/*! * File: integrations/shopify.js * Hash: 9c401377dd5764ab9fc1 * Chunkhash: df86c39704dc1423f58f * Release: v20230531.1-hotfix * Commit: b8a27db720a1e43d054366b26bffae7757710acb * Stage: production * Date: 2023-06-01T20:10:28.603Z * */!function(){var t,e,n={87757:function(t,e,n){t.exports=n(35666)},13819:function(t,e,n){"use strict";var r;n.d(e,{z:function(){return r}}),function(t){t.Fatal="fatal",t.Error="error",t.Warning="warning",t.Log="log",t.Info="info",t.Debug="debug",t.Critical="critical"}(r||(r={}))},35666:function(t){var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var o=e&&e.prototype instanceof g?e:g,i=Object.create(o.prototype),a=new L(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===d)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return P()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=O(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var c=f(t,e,n);if("normal"===c.type){if(r=n.done?h:p,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}(t,n,a),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l="suspendedStart",p="suspendedYield",d="executing",h="completed",v={};function g(){}function y(){}function w(){}var m={};c(m,i,(function(){return this}));var _=Object.getPrototypeOf,b=_&&_(_(j([])));b&&b!==n&&r.call(b,i)&&(m=b);var E=w.prototype=g.prototype=Object.create(m);function S(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function O(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,O(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=f(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,v;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(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 I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function j(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),I(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;I(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={id:t,loaded:!1,exports:{}};return n[t](i,i.exports,o),i.loaded=!0,i.exports}o.m=n,o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.f={},o.e=function(t){return Promise.all(Object.keys(o.f).reduce((function(e,n){return o.f[n](t,e),e}),[]))},o.u=function(t){return"sentry-browser-"+o.h()+".js"},o.h=function(){return"9c401377dd5764ab9fc1"},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.hmd=function(t){return(t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t={},e="zeffo:",o.l=function(n,r,i,a){if(t[n])t[n].push(r);else{var u,c;if(void 0!==i)for(var s=document.getElementsByTagName("script"),f=0;ft.length)&&(e=t.length);for(var n=0,r=new Array(e);n]+)>/g,(function(t,e){return"$"+i[e]})))}if("function"==typeof o){var a=this;return t[Symbol.replace].call(this,n,(function(){var t=arguments;return"object"!=typeof t[t.length-1]&&(t=[].slice.call(t)).push(r(t,a)),o.apply(this,t)}))}return t[Symbol.replace].call(this,n,o)},q.apply(this,arguments)}var z=function(t){return fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}}).then((function(e){if(!e.ok)throw new Error("Getting ".concat(t," failed with status ").concat(e.status));return e.json()}))},K=function(t,e){return n="/cart/update.js",r={updates:(o={},i=t,a=e,i in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o)},fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then((function(t){if(!t.ok)throw new Error("Posting ".concat(n," failed with status ").concat(t.status));t.json()}));var n,r,o,i,a},Y=function(t,e,n){void 0===e&&(e=""),void 0===n&&(n=q(/^\/(.+?)\.(jpeg|jpg|pjpg|gif|webp|png|heic)$/i,{path:1,ext:2}));var r,o,i=t.startsWith("//")?"https:".concat(t):t,u=new URL(i),c=u.pathname.match(n);return c&&c.groups?(u.pathname="".concat(c.groups.path).concat(e?"_"+e:"",".").concat(c.groups.ext),u.toString()):(r=new Error("Invalid pathname: ".concat(u.pathname)),X().captureException(r,o),a()&&console.error(r,o),i)},J=function(t){return t.includes("720x720")?t:Y(t,"720x720")},$=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}c((r=r.apply(t,e||[])).next())}))};function V(t,e){return window._fwn.shopping.productFactory((function(n){var r,o,i=n.description(t.description).extId(String(t.id)).name(t.title);return(null===(o=null===(r=null===window||void 0===window?void 0:window.Shopify)||void 0===r?void 0:r.currency)||void 0===o?void 0:o.active)&&i.currency(window.Shopify.currency.active),e.product_images.forEach((function(t){return i.image((function(e){var n;return e.extId(t.image_ext_id).position(t.image_position).url(J(t.image_src)).imageId(t.image_id).unitIds(t.unit_ids).unitExtIds(null!==(n=t.unit_ext_ids)&&void 0!==n?n:[])}))})),t.variants.forEach((function(e){i.variant((function(n){var r=n.extId(String(e.id)).isAvailable(e.available).name(e.title).price(e.price/100).originalPrice((e.compare_at_price||0)/100).sku(e.sku).url("".concat(window.origin).concat(t.url,"?variant=").concat(e.id));return e.featured_image&&r.image((function(t){var n;return t.extId(String(e.featured_image.id)).position(e.featured_image.position).title(null!==(n=e.featured_image.alt)&&void 0!==n?n:"").url(J(e.featured_image.src))})),t.options.forEach((function(t){var n=t.name,o=t.position;e.options[o-1]&&r.option({name:n,value:e.options[o-1]})})),r}))})),i}))}function Z(t,e){return window._fwn.shopping.productFactory((function(n){return n.currency(e).description(t.product_description).extId(String(t.product_id)).name(t.product_title).variant((function(e){e.extId(String(t.variant_id)).isAvailable(!0).name(t.title).price(t.final_price/100).sku(t.sku).url("".concat(window.origin).concat(t.url)),t.featured_image&&t.featured_image.url&&e.image((function(e){return e.title(t.featured_image.alt).url(J(t.featured_image.url))})),t.options_with_values.forEach((function(t){var n=t.name,r=t.value;e.option({name:n,value:r})}))}))}))}function Q(){!function(){var t=this;window._fwn.shopping.onProductsLoaded((function(n){var r=n.products;return $(t,void 0,void 0,e().mark((function t(){var n=this;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Promise.all(r.map((function(t){return $(n,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n=t.product_handle,z("/products/".concat(n,".js"));case 2:return r=e.sent,e.abrupt("return",V(r,t));case 4:case"end":return e.stop()}var n}),n)})))})));case 3:return t.abrupt("return",t.sent);case 6:return t.prev=6,t.t0=t.catch(0),t.t0 instanceof Error&&M(t.t0.message),t.abrupt("return",[]);case 10:case"end":return t.stop()}}),t,null,[[0,6]])})))}))}(),function(){var t=this;window._fwn.shopping.onCartDisplayed((function(){return $(t,void 0,void 0,e().mark((function t(){var n,r,o;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,z("/cart.js");case 3:return n=t.sent,r=n.currency,o=n.items,window._fwn.shopping.configureCart({currency:r}),t.abrupt("return",o.map((function(t){return{product:Z(t,r),unitId:String(t.variant_id),quantity:t.quantity}})));case 9:return t.prev=9,t.t0=t.catch(0),t.t0 instanceof Error&&M(t.t0.message),t.abrupt("return",[]);case 13:case"end":return t.stop()}}),t,null,[[0,9]])})))}))}(),function(){var t=this;window._fwn.shopping.onCartUpdated((function(n){var r=n.productUnit,o=n.quantity;return $(t,void 0,void 0,e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,K(Number(r.unit_ext_id),o);case 3:return t.abrupt("return",o);case 6:throw t.prev=6,t.t0=t.catch(0),t.t0 instanceof Error&&M(t.t0.message),new Error("Please try again later.");case 10:case"end":return t.stop()}}),t,null,[[0,6]])})))}))}(),function(){var t=this;document.addEventListener("fw:shopping:request-checkout",(function(){return $(t,void 0,void 0,e().mark((function t(){return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})))}))}()}window._fwnStoreFront={settings:{name:"Shopify",cartUrl:location.origin+"/cart"}},window._fwn?Q():document.addEventListener("fw:ready",(function(){Q()}))}()}(); //# sourceMappingURL=shopify.js.map