From a3bc3dff3af42f8fc2a1e438bf80c2470394232e Mon Sep 17 00:00:00 2001 From: Robby Klein Date: Wed, 26 May 2021 00:16:17 -0700 Subject: [PATCH] fix bug --- slidecarthq.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slidecarthq.js b/slidecarthq.js index 3b724d1..91f6078 100644 --- a/slidecarthq.js +++ b/slidecarthq.js @@ -115,4 +115,4 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. -***************************************************************************** */var c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function d(e){return e.current?Object(l.h)(e.current):""}var p=[];function h(){var e=f(Object(r.useState)(0),2)[1];return Object(r.useCallback)((function(){e((function(e){return e+1}))}),[])}var m={};function y(e,t,n){if(void 0===t&&(t="observed"),void 0===n&&(n=m),u())return e();var o=(n.useForceUpdate||h)(),i=Object(r.useRef)(null);i.current||(i.current=new l.b("observer("+t+")",(function(){o()})));var a,s,c=function(){i.current&&!i.current.isDisposed&&(i.current.dispose(),i.current=null)};if(Object(r.useDebugValue)(i,d),function(e){Object(r.useEffect)((function(){return e}),p)}((function(){c()})),i.current.track((function(){try{a=e()}catch(e){s=e}})),s)throw c(),s;return a}function v(e,t){if(u())return e;var n,o,i,a=c({forwardRef:!1},t),l=e.displayName||e.name,s=function(t,n){return y((function(){return e(t,n)}),l)};return s.displayName=l,n=a.forwardRef?Object(r.memo)(Object(r.forwardRef)(s)):Object(r.memo)(s),o=e,i=n,Object.keys(o).forEach((function(e){o.hasOwnProperty(e)&&!g[e]&&Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(o,e))})),n.displayName=l,n}var g={$$typeof:!0,render:!0,compare:!0,type:!0};function b(e){var t=e.children,n=e.render,r=t||n;return"function"!=typeof r?null:y(r)}function w(e,t,n,r,o){var i="children"===t?"render":"children",a="function"==typeof e[t],l="function"==typeof e[i];return a&&l?new Error("MobX Observer: Do not use children and render in the same time in`"+n):a||l?null:new Error("Invalid prop `"+o+"` of type `"+typeof e[t]+"` supplied to `"+n+"`, expected `function`.")}b.propTypes={children:w,render:w},b.displayName="Observer";var x=0,k={};function S(e){return k[e]||(k[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react "+e+" ("+x+")";return x++,t}(e)),k[e]}function E(e,t){if(_(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o0;)r[o]=arguments[o+2];t.locks++;try{var i;return null!=e&&(i=e.apply(this,r)),i}finally{t.locks--,0===t.locks&&t.methods.forEach((function(e){e.apply(n,r)}))}}function P(e,t){return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];A.call.apply(A,[this,e,t].concat(n))}}function N(e,t,n){var r=function(e,t){var n=e[O]=e[O]||{},r=n[t]=n[t]||{};return r.locks=r.locks||0,r.methods=r.methods||[],r}(e,t);r.methods.indexOf(n)<0&&r.methods.push(n);var o=Object.getOwnPropertyDescriptor(e,t);if(!o||!o[j]){var i=function e(t,n,r,o,i){var a,l=P(i,o);return(a={})[j]=!0,a.get=function(){return l},a.set=function(i){if(this===t)l=P(i,o);else{var a=e(this,n,r,o,i);Object.defineProperty(this,n,a)}},a.configurable=!0,a.enumerable=r,a}(e,t,o?o.enumerable:void 0,r,e[t]);Object.defineProperty(e,t,i)}}var L=l.a||"$mobx",D=S("isUnmounted"),q=S("skipRender"),M=S("isForcingUpdate");function I(e,t){return u()&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==t||!E(this.props,e)}function R(e,t){var n=S("reactProp_"+t+"_valueHolder"),r=S("reactProp_"+t+"_atomHolder");function o(){return this[r]||T(this,r,Object(l.g)("reactive "+t)),this[r]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return o.call(this).reportObserved(),this[n]},set:function(e){this[M]||E(this[n],e)?T(this,n,e):(T(this,n,e),T(this,q,!0),o.call(this).reportChanged(),T(this,q,!1))}})}var z="function"==typeof Symbol&&Symbol.for,U=z?Symbol.for("react.forward_ref"):"function"==typeof r.forwardRef&&Object(r.forwardRef)((function(){})).$$typeof,H=z?Symbol.for("react.memo"):"function"==typeof r.memo&&Object(r.memo)((function(){})).$$typeof;function F(e){if(!0===e.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),H&&e.$$typeof===H)throw new Error("Mobx observer: You are trying to use 'observer' on function component wrapped to either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(U&&e.$$typeof===U){var t=e.render;if("function"!=typeof t)throw new Error("render property of ForwardRef was not a function");return Object(r.forwardRef)((function(){var e=arguments;return o.a.createElement(b,null,(function(){return t.apply(void 0,e)}))}))}return"function"!=typeof e||e.prototype&&e.prototype.render||e.isReactClass||Object.prototype.isPrototypeOf.call(r.Component,e)?function(e){var t=e.prototype;if(t.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(e.__proto__!==r.PureComponent)if(t.shouldComponentUpdate){if(t.shouldComponentUpdate!==I)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else t.shouldComponentUpdate=I;R(t,"props"),R(t,"state");var n=t.render;return t.render=function(){return function(e){var t=this;if(!0===u())return e.call(this);T(this,q,!1),T(this,M,!1);var n=this.displayName||this.name||this.constructor&&(this.constructor.displayName||this.constructor.name)||"",o=e.bind(this),i=!1,a=new l.b(n+".render()",(function(){if(!i&&(i=!0,!0!==t[D])){var e=!0;try{T(t,M,!0),t[q]||r.Component.prototype.forceUpdate.call(t),e=!1}finally{T(t,M,!1),e&&a.dispose()}}}));function s(){i=!1;var e=void 0,t=void 0;if(a.track((function(){try{t=Object(l.c)(!1,o)}catch(t){e=t}})),e)throw e;return t}return a.reactComponent=this,s[L]=a,this.render=s,s.call(this)}.call(this,n)},N(t,"componentWillUnmount",(function(){!0!==u()&&(this.render[L]&&this.render[L].dispose(),this[D]=!0)})),e}(e):v(e)}var B=o.a.createContext({});function W(e){var t=e.children,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}(e,["children"]),r=o.a.useContext(B),i=o.a.useRef(Object.assign({},r,n)).current;return o.a.createElement(B.Provider,{value:i},t)}function V(e,t,n,i){var a,l,s,u=o.a.forwardRef((function(n,i){var a=Object.assign({},n),l=o.a.useContext(B);return Object.assign(a,e(l||{},a)||{}),i&&(a.ref=i),Object(r.createElement)(t,a)}));return i&&(u=F(u)),u.isMobxInjector=!0,a=t,l=u,s=Object.getOwnPropertyNames(Object.getPrototypeOf(a)),Object.getOwnPropertyNames(a).forEach((function(e){C[e]||-1!==s.indexOf(e)||Object.defineProperty(l,e,Object.getOwnPropertyDescriptor(a,e))})),u.wrappedComponent=t,u.displayName=function(e,t){var n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t?"inject-with-"+t+"("+n+")":"inject("+n+")"}(t,n),u}function $(){for(var e,t=[],n=arguments.length;n--;)t[n]=arguments[n];return"function"==typeof arguments[0]?(e=arguments[0],function(t){return V(e,t,e.name,!0)}):function(e){return V(function(e){return function(t,n){return e.forEach((function(e){if(!(e in n)){if(!(e in t))throw new Error("MobX injector: Store '"+e+"' is not available! Make sure it is provided by some Provider");n[e]=t[e]}})),n}}(t),e,t.join("-"),!1)}}W.displayName="MobXProvider";S("disposeOnUnmountProto"),S("disposeOnUnmountInst");function Y(e){function t(t,n,r,o,i,a){for(var s=[],u=arguments.length-6;u-- >0;)s[u]=arguments[u+6];return Object(l.q)((function(){return o=o||"<>",a=a||r,null==n[r]?t?new Error("The "+i+" `"+a+"` is marked as required in `"+o+"`, but its value is `"+(null===n[r]?"null":"undefined")+"`."):null:e.apply(void 0,[n,r,o,i,a].concat(s))}))}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function G(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}(t,e)?"symbol":t}function X(e,t){return Y((function(n,r,o,i,a){return Object(l.q)((function(){if(e&&G(n[r])===t.toLowerCase())return null;var i;switch(t){case"Array":i=l.i;break;case"Object":i=l.k;break;case"Map":i=l.j;break;default:throw new Error("Unexpected mobxType: "+t)}var s=n[r];if(!i(s)){var u=function(e){var t=G(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}(s),c=e?" or javascript `"+t.toLowerCase()+"`":"";return new Error("Invalid prop `"+a+"` of type `"+u+"` supplied to `"+o+"`, expected `mobx.Observable"+t+"`"+c+".")}return null}))}))}function Q(e,t){return Y((function(n,r,o,i,a){for(var s=[],u=arguments.length-5;u-- >0;)s[u]=arguments[u+5];return Object(l.q)((function(){if("function"!=typeof t)return new Error("Property `"+a+"` of component `"+o+"` has invalid PropType notation.");var l=X(e,"Array")(n,r,o);if(l instanceof Error)return l;for(var u=n[r],c=0;c0&&o.a.createElement(Ve,null)),n.enabled&&n.premium&&n.floating_cart&&o.a.createElement(jn,null)):o.a.createElement(o.a.Fragment,null)}}])&&oe(n.prototype,r),i&&oe(n,i),t}(r.Component))||te)||te;function ce(e){var t=e.color,n=e.width;return o.a.createElement("svg",{width:n||"10",viewBox:"0 0 10 10"},o.a.createElement("path",{d:"M9.677 8.118a1.102 1.102 0 11-1.559 1.56L5 6.558 1.882 9.677a1.102 1.102 0 11-1.56-1.559L3.442 5 .323 1.882A1.102 1.102 0 111.882.322L5 3.442 8.118.323a1.102 1.102 0 111.56 1.559L6.558 5l3.118 3.118z",fill:t||"#A1A1A1",fillRule:"nonzero"}))}function fe(e){var t=e.width;return o.a.createElement("svg",{width:t||"65",viewBox:"0 0 65 74",xmlns:"http://www.w3.org/2000/svg"},o.a.createElement("g",{fillRule:"nonzero",fill:"none"},o.a.createElement("path",{d:"M64.407 9.856L53.605 0H11.371L.569 9.856A1.548 1.548 0 00.1 11.603c.235.619.843 1.031 1.524 1.031h61.727a1.62 1.62 0 001.522-1.031 1.545 1.545 0 00-.467-1.747z",fill:"#C4C4C4"}),o.a.createElement("path",{d:"M63.351 9.927H1.624C.728 9.927 0 10.644 0 11.529v59.267C0 72.566 1.454 74 3.249 74h58.478c1.795 0 3.249-1.434 3.249-3.204V11.53c0-.885-.728-1.602-1.625-1.602z",fill:"#E4E4E4"}),o.a.createElement("path",{d:"M32.488 45.122c-7.963 0-14.44-6.447-14.44-14.37v-4.79a1.6 1.6 0 011.605-1.596 1.6 1.6 0 011.604 1.596v4.79c0 6.163 5.04 11.177 11.23 11.177 6.192 0 11.231-5.014 11.231-11.177v-4.79a1.6 1.6 0 011.604-1.596 1.6 1.6 0 011.605 1.596v4.79c0 7.923-6.477 14.37-14.44 14.37z",fill:"#6D6D6D"})))}function de(e){e.color;var t=e.width;return o.a.createElement("svg",{width:t||"60",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"},o.a.createElement("path",{fill:"currentColor",d:"M40.645 14.333c-5.878-8.48-17.517-10.59-25.998-4.712-8.48 5.877-10.59 17.518-4.712 25.998l3.343-2.318c-4.598-6.633-2.948-15.739 3.686-20.337 6.634-4.598 15.74-2.948 20.337 3.686l3.344-2.317z"}))}function pe(e){var t=e.width;e.color;return o.a.createElement("svg",{width:t||"10",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg"},o.a.createElement("path",{d:"M11 5H7V1a1 1 0 00-2 0v4H1a1 1 0 000 2h4v4a1 1 0 002 0V7h4a1 1 0 000-2z",fill:"currentColor",fillRule:"nonzero"}))}function he(e){var t=e.color,n=e.width;return o.a.createElement("svg",{width:n||"10",viewBox:"0 0 12 2",xmlns:"http://www.w3.org/2000/svg"},o.a.createElement("path",{d:"M11.25 0H.75C.3 0 0 .4 0 1s.3 1 .75 1h10.5c.45 0 .75-.4.75-1s-.3-1-.75-1z",fill:t||"#7A7A7A",fillRule:"nonzero"}))}function me(e){var t=e.className;return o.a.createElement("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",width:"14px",height:"14px"},o.a.createElement("path",{d:"M17.78 3.09C17.45 2.443 16.778 2 16 2h-5.165c-.535 0-1.046.214-1.422.593l-6.82 6.89c0 .002 0 .003-.002.003-.245.253-.413.554-.5.874L.738 8.055c-.56-.953-.24-2.178.712-2.737L9.823.425C10.284.155 10.834.08 11.35.22l4.99 1.337c.755.203 1.293.814 1.44 1.533z",fillOpacity:".55",fill:"currentColor"}),o.a.createElement("path",{fill:"currentColor",d:"M10.835 2H16c1.105 0 2 .895 2 2v5.172c0 .53-.21 1.04-.586 1.414l-6.818 6.818c-.777.778-2.036.782-2.82.01l-5.166-5.1c-.786-.775-.794-2.04-.02-2.828.002 0 .003 0 .003-.002l6.82-6.89C9.79 2.214 10.3 2 10.835 2zM13.5 8c.828 0 1.5-.672 1.5-1.5S14.328 5 13.5 5 12 5.672 12 6.5 12.672 8 13.5 8z"}))}function ye(){return(ye=Object.assign||function(e){for(var t=1;t0?n.item_count:"";return o.a.createElement("header",{className:"header"},o.a.createElement("h2",null,r.title_text," ",o.a.createElement("span",{className:"cart-count"},i)),o.a.createElement("button",{onClick:t},o.a.createElement(ce,null)))}}])&&be(n.prototype,r),i&&be(n,i),t}(r.Component))||se)||se;function _e(){return o.a.createElement("div",{className:"loading-state"},o.a.createElement(de,null))}function Ce(e){return(Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Te(e,t){for(var n=0;n$1")}function Xe(e){var t=e.upsell,n=e.item,r=e.size,i=e.useCompact;return n&&n.image?o.a.createElement("img",{className:r,src:Qe(n.image,i)}):t&&t.variant&&t.variant.featured_image?o.a.createElement("img",{className:r,src:Qe(t.variant.featured_image.src,i)}):t&&t.product&&t.product.featured_image?o.a.createElement("img",{className:r,src:Qe(t.product.featured_image,i)}):o.a.createElement("span",{className:Z()("image-placeholder",r)})}function Qe(e,t){return t?e.split(/\.(?=[^\.]+$)/).join("_compact."):e}function Ke(e){return(Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ze(e,t){for(var n=0;n0?" • ".concat(e):e})),h&&(s.length&&"Default Title"!==s[0]?f+=" • ".concat(r.subscription_text):f+="".concat(r.subscription_text)),e.selling_plan_allocation&&e.selling_plan_allocation.selling_plan){var m=e.selling_plan_allocation.selling_plan;s.length&&"Default Title"!==s[0]?f+=" • ".concat(m.name):f+="".concat(m.name)}r.show_product_type&&e.product_type&&e.product_type.length>0&&(f.length>0?f+=" • ".concat(e.product_type):f+="".concat(e.product_type)),r.show_vendor&&e.vendor&&e.vendor.length>0&&(f.length>0?f+=" • ".concat(e.vendor):f+="".concat(e.vendor)),r.custom_properties&&e.properties&&Object.entries(e.properties).forEach((function(e,t){e[0]&&e[1]&&(d+=t>0?" • ".concat(e[1]):e[1])})),f.length>0&&(p+=f),f.length>0&&d.length>0&&(p+=" • "),d.length>0&&(p+=d);var y=!1;r.unit_price&&e.unit_price&&e.unit_price_measurement&&e.unit_price_measurement.reference_value&&e.unit_price_measurement.reference_unit&&(y=Ye(t,e.unit_price)+"/"+e.unit_price_measurement.reference_value+e.unit_price_measurement.reference_unit);var v=[];if(2==r.custom_property_format){if("Default Title"!=e.variant_options[0]&&e.options_with_values&&e.options_with_values.map((function(e){v.push({key:e.name,value:e.value})})),e.selling_plan_allocation&&e.selling_plan_allocation.selling_plan){var g=e.selling_plan_allocation.selling_plan;v.push({key:"",value:g.name})}r.show_product_type&&e.product_type&&e.product_type.length>0&&v.push({key:r.product_type_key_text,value:e.product_type}),r.show_vendor&&e.vendor&&e.vendor.length>0&&v.push({key:r.vendor_key_text,value:e.vendor}),e.properties&&Object.entries(e.properties).forEach((function(e,t){e[0]&&e[1]&&v.push({key:e[0],value:e[1]})}))}return o.a.createElement("div",{className:"item",key:"".concat(e.variant_id,"-").concat(a),"data-line-item-id":e.id,"data-variant-id":e.variant_id,"data-line-item-key":e.key},o.a.createElement("div",{className:"image"},o.a.createElement("a",{href:e.url},o.a.createElement(Xe,{item:e,useCompact:r.compact_images}))),o.a.createElement("div",{className:"main"},o.a.createElement("div",{className:"main-top"},o.a.createElement("div",{className:"main-top-left"},o.a.createElement("h3",{className:"title"},o.a.createElement("a",{href:e.url,dangerouslySetInnerHTML:{__html:e.product_title}})),1==r.custom_property_format?o.a.createElement(o.a.Fragment,null,p.length>0&&o.a.createElement("p",{className:"variants-p"},p)):o.a.createElement("ul",{className:"properties-key-value"},v.map((function(e,t){if("string"==typeof e.value)return o.a.createElement("li",{key:t,"data-key":e.key},e.key.length>0&&o.a.createElement(o.a.Fragment,null,o.a.createElement("span",{className:"properties-key-value-key"},e.key),o.a.createElement("span",{className:"properties-key-value-spacer"},": ")),o.a.createElement("span",{className:"properties-key-value-value"},e.value))})))),o.a.createElement("button",{className:"remove",onClick:r.dev?function(){return i(a,0,e.variant_id)}:function(){return n(e.variant_id)}},o.a.createElement(ce,{width:9,color:"#cacaca"}))),o.a.createElement("div",{className:"main-bottom"},r.dev?o.a.createElement(vt,{value:e.quantity,id:e.variant_id,index:a}):o.a.createElement(ct,{value:e.quantity,id:e.variant_id,index:a}),r.carthook?o.a.createElement(o.a.Fragment,null,e.line_price0&&o.a.createElement("div",{className:"footer-row"},o.a.createElement("span",{className:"flex"},t.discounts_label_text),o.a.createElement("span",{className:"slidecart-discount-amount",dangerouslySetInnerHTML:{__html:r}})),!1!==e.discountCode&&void 0!==e.discountCode&&0===e.cart.total_discount&&o.a.createElement("div",{className:"footer-row"},o.a.createElement("span",{className:"footer-row-flex flex"},t.discounts_label_text,o.a.createElement("span",{className:Z()("footer-code",{right:0===e.discountCodeAmount||!1===e.discountCodeAmount})},o.a.createElement(me,{className:"footer-tags-icon"}),e.discountCode,o.a.createElement("button",{onClick:e.clearDiscountCode},o.a.createElement(ce,null)))),e.discountCodeAmount>0&&o.a.createElement("span",{className:"slidecart-discount-amount",dangerouslySetInnerHTML:{__html:i}})),o.a.createElement("div",{className:"footer-row"},o.a.createElement("strong",{className:"flex",dangerouslySetInnerHTML:{__html:t.subtotal_label_text}}),e.discountCodeAmount>0&&0===e.cart.total_discount?o.a.createElement("strong",{className:"slidecart-subtotal",dangerouslySetInnerHTML:{__html:l}}):o.a.createElement("strong",{className:"slidecart-subtotal",dangerouslySetInnerHTML:{__html:a}})))},n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&kt(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.CartStore,t=e.settings;return t.sticky_checkout?o.a.createElement(o.a.Fragment,null,o.a.createElement("footer",{className:Z()("footer new-footer",{sticky_checkout:t.sticky_checkout})},this.renderShared()),o.a.createElement("div",{className:"footer-sticky"},o.a.createElement("div",{className:"footer-buttons"},this.renderButton(),t.additional_buttons&&o.a.createElement("div",{className:"additional-buttons"},o.a.createElement("div",{className:"dynamic-checkout__content",id:"dynamic-checkout-cart","data-shopify":"dynamic-checkout-cart"})),t.continue_shopping&&o.a.createElement("a",{className:"footer-continue",onClick:e.closeCart},t.continue_shopping_text)),o.a.createElement(kn,{setting:"custom_html_checkout"}))):o.a.createElement("footer",{className:"footer"},this.renderShared(),this.renderButton(),t.additional_buttons&&o.a.createElement("div",{className:"additional-buttons"},o.a.createElement("div",{className:"dynamic-checkout__content",id:"dynamic-checkout-cart","data-shopify":"dynamic-checkout-cart"})),t.continue_shopping&&o.a.createElement("a",{className:"footer-continue",onClick:e.closeCart},t.continue_shopping_text),o.a.createElement(kn,{setting:"custom_html_checkout"}))}}])&&bt(n.prototype,r),i&&bt(n,i),t}(r.Component))||yt)||yt;function _t(e){return(_t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ct(e,t){for(var n=0;ne)return o.a.createElement("div",{key:e,className:"option"},o.a.createElement("label",null,t.product.options[e].name),o.a.createElement("select",{onChange:function(t){return n.changeVariant(t,e+1)},defaultValue:t.variant.options[e]},t["option".concat(e+1)].map((function(e){return o.a.createElement("option",{key:e},e)}))))},n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Rt(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.upsell,n=this.props.CartStore,r=n.closeUpsellOptions,i=n.settings,a=n.currency,l=t.optionsOpen,s=t.title,u=t.noVariant,c=t.variant,f=this.state,d=f.option1,p=f.option2,h=f.option3,m=!c.available||u?i.upsell_unavailable_text:i.upsell_add_long_text,y=Ye(a,c.price),v=c.compare_at_price&&c.compare_at_price>c.price,g=v?Ye(a,c.compare_at_price):"",b=!1;return i.unit_price&&c.unit_price&&c.unit_price_measurement&&c.unit_price_measurement.reference_value&&c.unit_price_measurement.reference_unit&&(b=Ye(a,c.unit_price)+"/"+c.unit_price_measurement.reference_value+c.unit_price_measurement.reference_unit),o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{style:{width:"".concat(i.max_width,"%")},onClick:function(){return r(t.product_id)},className:Z()("upsell-options-overlay",{active:l})}),o.a.createElement("div",{style:{width:"".concat(i.max_width,"%")},className:Z()("upsell-options",{active:l})},o.a.createElement("header",{className:"upsell-options-header"},o.a.createElement("div",{className:"image"},o.a.createElement("a",{href:t.product.url},o.a.createElement(Xe,{upsell:t,useCompact:i.compact_images}))),o.a.createElement("div",{className:"text"},o.a.createElement("div",null,o.a.createElement("h2",null,o.a.createElement("a",{href:t.product.url},s)),o.a.createElement("p",{className:"upsell-options-variant"},d&&d,p&&" • ".concat(p),h&&" • ".concat(h))),o.a.createElement("div",{className:"upsell-options-prices-wrap"},o.a.createElement("div",{className:"upsell-options-prices"},o.a.createElement("p",{className:"price",dangerouslySetInnerHTML:{__html:y}}),v&&o.a.createElement("p",{className:"compare-at",dangerouslySetInnerHTML:{__html:g}})),b&&o.a.createElement("div",{className:"upsell-options-unit-price"},o.a.createElement("p",null,b))))),[0,1,2].map((function(t){return e.renderOption(t)})),o.a.createElement("button",{onClick:this.addVariantToCart,className:"button full",disabled:u||!c.available},m)))}}])&&qt(n.prototype,r),i&&qt(n,i),t}(r.Component))||At)||At;function Ht(e){return(Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ft(e,t){for(var n=0;n-1})).length===t.length,s=r.upsell_heading.length>0&&!l||r.upsell_heading.length>0&&r.upsell_multi;return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"upsells"},s&&o.a.createElement("div",{className:"upsells-header"},o.a.createElement("h2",null,r.upsell_heading)),a?o.a.createElement("div",{className:"upsells-stacked"},t.map((function(e,t){if(!(!i&&n.items.filter((function(t){return t.product_id===Number(e.product_id)}))).length&&e.finished)return e.multi&&!e.variant?void 0:o.a.createElement(en,{key:e.id,upsell:e,index:t})}))):o.a.createElement(Lt.a,{dots:!1,infinite:!0,speed:500,slidesToShow:1,slidesToScroll:1},t.map((function(e,t){if(!(!i&&n.items.filter((function(t){return t.product_id===Number(e.product_id)}))).length&&e.finished)return e.multi&&!e.variant?void 0:o.a.createElement(en,{key:e.id,upsell:e,index:t})})))),t.map((function(e,t){if(!(!i&&n.items.filter((function(t){return t.product_id===Number(e.product_id)}))).length&&e.finished&&e.multi&&e.variant)return o.a.createElement(Ut,{key:e.id,upsell:e,index:t})})))}}])&&Ft(n.prototype,r),i&&Ft(n,i),t}(r.Component))||zt)||zt;function Gt(e){return(Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xt(e,t){for(var n=0;n1})},o.a.createElement("div",{className:"upsell-item"},o.a.createElement("div",{className:"upsell-image"},o.a.createElement("a",{href:u},o.a.createElement(Xe,{upsell:n,size:"small",useCompact:i.compact_images}))),o.a.createElement("div",{className:"upsell-text"},o.a.createElement("h3",null,o.a.createElement("a",{href:u,dangerouslySetInnerHTML:{__html:l}})),o.a.createElement("div",{className:"upsell-text-prices"},o.a.createElement("p",{dangerouslySetInnerHTML:{__html:f}}),d&&o.a.createElement("p",{className:"upsell-compare-at",dangerouslySetInnerHTML:{__html:Ye(r,c.compare_at_price)}})),p&&o.a.createElement("p",{className:"upsell-unit-price",dangerouslySetInnerHTML:{__html:p}})),o.a.createElement("div",{className:"upsell-add"},i.upsell_goto_product?o.a.createElement("a",{href:u},o.a.createElement(pe,{color:"#fff"}),i.upsell_add_text):o.a.createElement("button",{onClick:this.addToCart},o.a.createElement(pe,{color:"#fff"}),i.upsell_add_text))))}}])&&Xt(n.prototype,r),i&&Xt(n,i),t}(r.Component))||$t)||$t;function tn(e){return(tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nn(e,t){for(var n=0;n0?t.rewards_pre.length<1?o.a.createElement(o.a.Fragment,null):o.a.createElement("div",{className:"rewards"},o.a.createElement("p",{dangerouslySetInnerHTML:{__html:this.formatText(t.rewards_pre,l)}}),o.a.createElement("div",{className:"rewards-progress-bar"},o.a.createElement("div",{className:"rewards-progress",style:{width:100*s+"%"}}))):t.rewards_post.length<1?o.a.createElement(o.a.Fragment,null):o.a.createElement("div",{className:"rewards"},o.a.createElement("p",{dangerouslySetInnerHTML:{__html:this.formatText(t.rewards_post,l)}})):o.a.createElement(o.a.Fragment,null)}}])&&cn(n.prototype,r),i&&cn(n,i),t}(r.Component))||ln)||ln;function yn(e){return(yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vn(e,t){for(var n=0;ne)return o.a.createElement("div",{key:e,className:"option"},o.a.createElement("label",null,t.product.options[e].name),o.a.createElement("select",{onChange:function(t){return n.changeVariant(t,e+1)},defaultValue:t.variant.options[e]},t["option".concat(e+1)].map((function(e){return o.a.createElement("option",{key:e},e)}))))},n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Dn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.aupsell,n=this.props.CartStore,r=n.closeAupsellOptions,i=n.settings,a=n.currency,l=t.optionsOpen,s=t.product,u=t.noVariant,c=t.variant,f=this.state,d=f.option1,p=f.option2,h=f.option3,m=!c.available||u?i.upsell_unavailable_text:i.upsell_add_long_text,y=Ye(a,c.price),v=c.compare_at_price&&c.compare_at_price>c.price,g=v?Ye(a,c.compare_at_price):"",b=s.title,w=!1;return i.unit_price&&c.unit_price&&c.unit_price_measurement&&c.unit_price_measurement.reference_value&&c.unit_price_measurement.reference_unit&&(w=Ye(a,c.unit_price)+"/"+c.unit_price_measurement.reference_value+c.unit_price_measurement.reference_unit),o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{style:{width:"".concat(i.max_width,"%")},onClick:function(){return r(t.product_y_handle)},className:Z()("upsell-options-overlay",{active:l})}),o.a.createElement("div",{style:{width:"".concat(i.max_width,"%")},className:Z()("upsell-options",{active:l})},o.a.createElement("header",{className:"upsell-options-header"},o.a.createElement("div",{className:"image"},o.a.createElement("a",{href:t.product.url},o.a.createElement(Xe,{upsell:t,useCompact:i.compact_images}))),o.a.createElement("div",{className:"text"},o.a.createElement("div",null,o.a.createElement("h2",null,o.a.createElement("a",{href:t.product.url},b)),o.a.createElement("p",{className:"upsell-options-variant"},d&&d,p&&" • ".concat(p),h&&" • ".concat(h))),o.a.createElement("div",{className:"upsell-options-prices-wrap"},o.a.createElement("div",{className:"upsell-options-prices"},o.a.createElement("p",{className:"price",dangerouslySetInnerHTML:{__html:y}}),v&&o.a.createElement("p",{className:"compare-at",dangerouslySetInnerHTML:{__html:g}})),w&&o.a.createElement("div",{className:"upsell-options-unit-price"},o.a.createElement("p",null,w))))),[0,1,2].map((function(t){return e.renderOption(t)})),o.a.createElement("button",{onClick:this.addVariantToCart,className:"button full",disabled:u||!c.available},m)))}}])&&Pn(n.prototype,r),i&&Pn(n,i),t}(r.Component))||On)||On;function In(e){return(In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rn(e,t){for(var n=0;n-1})).length===t.length,c=r.aupsell_heading.length>0&&!u||r.aupsell_heading.length>0&&a;return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"upsells"},c&&o.a.createElement("div",{className:"upsells-header"},o.a.createElement("h2",null,r.aupsell_heading)),i?o.a.createElement("div",{className:"upsells-stacked"},t.map((function(e,t){if(!(!a&&n.items.filter((function(t){return t.handle===e.product_y_handle}))).length&&e.finished){if(e.multi&&!e.variant)return;if(s>=l)return;return s+=1,o.a.createElement(Xn,{key:t,aupsell:e,index:t})}}))):o.a.createElement(Lt.a,{dots:!1,infinite:!0,speed:500,slidesToShow:1,slidesToScroll:1},t.map((function(e,t){if(!(!a&&n.items.filter((function(t){return t.handle===e.product_y_handle}))).length&&e.finished){if(e.multi&&!e.variant)return;if(s>=l)return;return s+=1,o.a.createElement(Xn,{key:t,aupsell:e,index:t})}})))),t.map((function(e,t){if(!(!a&&n.items.filter((function(t){return t.handle===e.product_y_handle}))).length&&e.finished&&e.multi&&e.variant)return o.a.createElement(Mn,{key:t,aupsell:e,index:t})})))}}])&&Rn(n.prototype,r),i&&Rn(n,i),t}(r.Component))||qn)||qn;function Wn(e){return(Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vn(e,t){for(var n=0;n1})},o.a.createElement("div",{className:"upsell-item"},o.a.createElement("div",{className:"upsell-image"},o.a.createElement("a",{href:u},o.a.createElement(Xe,{upsell:n,size:"small",useCompact:i.compact_images}))),o.a.createElement("div",{className:"upsell-text"},o.a.createElement("h3",null,o.a.createElement("a",{href:u,dangerouslySetInnerHTML:{__html:l}})),o.a.createElement("div",{className:"upsell-text-prices"},o.a.createElement("p",{dangerouslySetInnerHTML:{__html:f}}),d&&o.a.createElement("p",{className:"upsell-compare-at",dangerouslySetInnerHTML:{__html:Ye(r,c.compare_at_price)}})),p&&o.a.createElement("p",{className:"upsell-unit-price",dangerouslySetInnerHTML:{__html:p}})),o.a.createElement("div",{className:"upsell-add"},o.a.createElement("button",{onClick:this.addToCart},o.a.createElement(pe,{color:"#fff"}),i.upsell_add_text))))}}])&&Vn(n.prototype,r),i&&Vn(n,i),t}(r.Component))||Fn)||Fn,Qn=n(4),Kn=n.n(Qn),Zn=n(2),Jn=n.n(Zn);function er(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1),no=[],ro=!1,oo=-1,io=void 0,ao=void 0,lo=function(e){return no.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},so=function(e){var t=e||window.event;return!!lo(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},uo=function(){setTimeout((function(){void 0!==ao&&(document.body.style.paddingRight=ao,ao=void 0),void 0!==io&&(document.body.style.overflow=io,io=void 0)}))},co=function(e,t){if(to){if(!e)return void console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");if(e&&!no.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};no=[].concat(er(no),[n]),e.ontouchstart=function(e){1===e.targetTouches.length&&(oo=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&function(e,t){var n=e.targetTouches[0].clientY-oo;!lo(e.target)&&(t&&0===t.scrollTop&&n>0?so(e):function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?so(e):e.stopPropagation())}(t,e)},ro||(document.addEventListener("touchmove",so,tr?{passive:!1}:void 0),ro=!0)}}else{!function(e){setTimeout((function(){if(void 0===ao){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(ao=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===io&&(io=document.body.style.overflow,document.body.style.overflow="hidden")}))}(t);var r={targetElement:e,options:t||{}};no=[].concat(er(no),[r])}},fo=n(14),po=n.n(fo),ho="https://cart-go.apphq.co/api";function mo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function yo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function go(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0?s:t.total_price-l;return{name:i.textContent.trim().split(" ")[0],amount:u}}return i?{name:i.textContent,amount:!1}:{name:!1,amount:!1}}function So(e,t){window.SLIDECART_DEV&&(console.log(e),t&&console.log(t))}var Eo=new(or=wo((rr=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),bo(this,"loading",or,this),bo(this,"init",ir,this),bo(this,"settings",ar,this),bo(this,"open",lr,this),bo(this,"shop",sr,this),bo(this,"cart",ur,this),bo(this,"currency",cr,this),bo(this,"showNote",fr,this),bo(this,"note",dr,this),bo(this,"upsells",pr,this),bo(this,"aupsells",hr,this),bo(this,"announcements",mr,this),bo(this,"upsellProducts",yr,this),bo(this,"aupsellProducts",vr,this),bo(this,"discountCode",gr,this),bo(this,"discountCodeField",br,this),bo(this,"discountCodeAmount",wr,this),bo(this,"discountCodeInvalid",xr,this),bo(this,"checkout_clicked",kr,this),bo(this,"checkbox",Sr,this),bo(this,"langs",Er,this),bo(this,"urlBase",_r,this),bo(this,"initiate",Cr,this),bo(this,"setScrollListener",Tr,this),bo(this,"updateCart",Or,this),bo(this,"setCart",jr,this),bo(this,"setCartLinkListeners",Ar,this),bo(this,"setFormSubmitListeners",Pr,this),bo(this,"openCart",Nr,this),bo(this,"closeCart",Lr,this),bo(this,"addToCart",Dr,this),bo(this,"updateQuantity",qr,this),bo(this,"addToCartNew",Mr,this),bo(this,"addToCartClassic",Ir,this),bo(this,"removeFromCart",Rr,this),bo(this,"fetchDiscount",zr,this),bo(this,"applyDiscountCode",Ur,this),bo(this,"clearDiscountCode",Hr,this),bo(this,"setDiscountCode",Fr,this),bo(this,"toggleNote",Br,this),bo(this,"setNote",Wr,this),bo(this,"toCheckout",Vr,this),bo(this,"fetchUpsells",$r,this),bo(this,"openUpsellOptions",Yr,this),bo(this,"closeUpsellOptions",Gr,this),bo(this,"changeUpsellVariant",Xr,this),bo(this,"fetchAupsells",Qr,this),this.processAupsell=function(e){if(e.available){var n=t.aupsells.findIndex((function(t){return e.handle===t.product_y_handle}));if(-1==n&&(t.aupsells.push({product_y_handle:e.handle}),n=t.aupsells.length-1),t.aupsells[n].product=e,e.variants.length>1){t.aupsells[n].multi=!0,t.aupsells[n].optionsOpen=!1;for(var r=0;r0&&t.cart.items[0];if(!e)return So("Cart is empty, skipping to basic"),void t.findBasicUpsells();So("Cart has item, using it for recommended");var n="/recommendations/products.js?product_id=".concat(e.product_id);Kn.a.get(n).then((function(e){So("Fetched the products, time to filter recommended");var n=e.data.products,r=t.filterAupsells(n,!0);r.length>0?r.map((function(e){t.processAupsell(e)})):(So("No products found after recommended filter, going to basic"),t.findBasicUpsells())}))},this.findBasicUpsells=function(){var e=t.upsells.map((function(e){return e.handle})),n=t.filterAupsells(e);So("were in basic",n);var r=[];n.map((function(e){r.push(Kn.a.get("/products/".concat(e,".js")))})),Promise.allSettled(r).then((function(e){e.map((function(e){"fulfilled"===e.status&&t.processAupsell(e.value.data)}))}))},bo(this,"openAupsellOptions",Kr,this),bo(this,"closeAupsellOptions",Zr,this),bo(this,"changeAupsellVariant",Jr,this),bo(this,"toggleCheckbox",eo,this)}).prototype,"loading",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ir=wo(rr.prototype,"init",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ar=wo(rr.prototype,"settings",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),lr=wo(rr.prototype,"open",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),sr=wo(rr.prototype,"shop",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Shopify.shop}}),ur=wo(rr.prototype,"cart",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),cr=wo(rr.prototype,"currency",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Shopify.currency.active}}),fr=wo(rr.prototype,"showNote",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),dr=wo(rr.prototype,"note",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),pr=wo(rr.prototype,"upsells",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),hr=wo(rr.prototype,"aupsells",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),mr=wo(rr.prototype,"announcements",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),yr=wo(rr.prototype,"upsellProducts",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),vr=wo(rr.prototype,"aupsellProducts",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),gr=wo(rr.prototype,"discountCode",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),br=wo(rr.prototype,"discountCodeField",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),wr=wo(rr.prototype,"discountCodeAmount",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),xr=wo(rr.prototype,"discountCodeInvalid",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),kr=wo(rr.prototype,"checkout_clicked",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Sr=wo(rr.prototype,"checkbox",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Er=wo(rr.prototype,"langs",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return t=[],n=null===(e=document.querySelector('[hreflang="x-default"]'))||void 0===e?void 0:e.getAttribute("href"),document.querySelectorAll("[hreflang]").forEach((function(e){var r=e.getAttribute("href"),o=e.getAttribute("hreflang");r!=n&&t.push(o)})),t;var e,t,n}}),_r=wo(rr.prototype,"urlBase",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Cr=wo(rr.prototype,"initiate",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!0===window.SLIDECART_LANG){var t=document.querySelector("html").getAttribute("lang");if(t&&e.langs.length>0&&e.langs.indexOf(t)>-1){for(var n=new po.a(window.location.href),r=n.origin,o=n.host.split("."),i=!1,a=0;a0,e.init=!0,e.setScrollListener(),window.SLIDECART_LOADED&&window.SLIDECART_LOADED(i.data),l.discount_box&&0===i.data.total_discount&&e.fetchDiscount(i.data),e.settings.aupsell&&e.aupsells&&e.aupsells.length>0?e.fetchAupsells():e.settings.upsell&&e.upsells&&e.upsells.length>0&&e.fetchUpsells(),"undefined"!=typeof conversionBearAutoCurrencyConverter)&&(null===(n=conversionBearAutoCurrencyConverter)||void 0===n||n.convertPricesOnPage());e.settings.checkbox&&e.settings.checkbox_default&&e.settings.checkbox_note&&e.setNote(e.settings.checkbox_note_text),window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(i.data)}))}}}),Tr=wo(rr.prototype,"setScrollListener",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return function(){var e=document.querySelector(".slidecarthq-overlay"),t=document.querySelector(".slidecarthq");e&&t&&e.addEventListener("mousewheel",(function(e){e.preventDefault(),t.scrollTop+=e.deltaY}))}}}),Or=wo(rr.prototype,"updateCart",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){Kn.a.get("".concat(e.urlBase,"/cart.js")).then((function(n){var r;(e.cart=n.data,e.note=n.data.note,e.showNote=e.note&&e.note.length>0,Jn()("[data-cart-count]").text(n.data.item_count.toString()),Jn()("[data-cart-total]").html(Ye(e.currency,n.data.total_price)),e.settings.discount_box&&0===n.data.total_discount&&e.fetchDiscount(n.data),"undefined"!=typeof conversionBearAutoCurrencyConverter)&&(null===(r=conversionBearAutoCurrencyConverter)||void 0===r||r.convertPricesOnPage());t&&t(n.data),window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(n.data)}))}}}),jr=wo(rr.prototype,"setCart",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.cart=t}}}),Ar=wo(rr.prototype,"setCartLinkListeners",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){document.querySelectorAll('[href$="/cart"], [data-slidecart-open]').forEach((function(t){t.addEventListener("click",(function(n){var r=t.getAttribute("href").split("?")[0].indexOf("/cart")>-1,o=t.getAttribute("data-slidecart-dont-open");r&&"true"!=o&&(n.preventDefault(),e.openCart())}))}))}}}),Pr=wo(rr.prototype,"setFormSubmitListeners",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=e;Jn()(document).on("submit",'[action$="/cart/add"], [data-slidecart-form]',(function(e){e.preventDefault(),e.stopPropagation();var n=xo(Jn()(this)),r=n.id,o=n.quantity;Jn()('[action$="/cart/add"] [type="submit"], [data-slidecart-form] [type="submit"]').attr("aria-disabled")||(t.settings.recharge?t.addToCartNew(Jn()(this)):t.addToCart(r,o)),window.SLIDECART_ADD_TO_CART&&window.SLIDECART_ADD_TO_CART({id:r,quantity:o})})),Jn()(document).on("click",'[action$="/cart/add"] [type="submit"], [data-slidecart-form] [type="submit"]',(function(e){e.preventDefault(),e.stopPropagation();var n=xo(Jn()(this).closest('[action$="/cart/add"]')),r=n.id,o=n.quantity;Jn()('[action$="/cart/add"] [type="submit"], [data-slidecart-form] [type="submit"]').attr("aria-disabled")||(t.settings.recharge?t.addToCartNew(Jn()(this).parents("form")):t.addToCart(r,o)),window.SLIDECART_ADD_TO_CART&&window.SLIDECART_ADD_TO_CART({id:r,quantity:o})})),Jn()(document).on("click","[data-slidecart-ajax]",(function(e){e.preventDefault(),e.stopPropagation();var n=Jn()(this).attr("data-slidecart-id"),r=Jn()(this).attr("data-slidecart-quantity");if(n){var o=Number(n),i=r?Number(i):1;t.addToCart(o,i)}})),window.addEventListener("load",(function(e){window.__pagefly_helper_store__&&window.__pagefly_helper_store__.subscribe((function(e){Kn.a.get("/cart.js").then((function(e){t.cart=e.data,Jn()("[data-cart-count], .cart-item-count-header--quantity").text(t.cart.item_count.toString()),t.cart.item_count>0?Jn()("[data-cart-count-show]").removeClass("hide"):Jn()("[data-cart-count-show]").addClass("hide"),!t.open&&t.settings.open_on_add&&t.openCart()}))}))}))}}}),Nr=wo(rr.prototype,"openCart",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=document.querySelector(".slidecarthq");co(t),window.SLIDECART_OPENED&&window.SLIDECART_OPENED(),e.open=!0}}}),Lr=wo(rr.prototype,"closeCart",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){!function(e){if(to){if(!e)return void console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");e.ontouchstart=null,e.ontouchmove=null,no=no.filter((function(t){return t.targetElement!==e})),ro&&0===no.length&&(document.removeEventListener("touchmove",so,tr?{passive:!1}:void 0),ro=!1)}else(no=no.filter((function(t){return t.targetElement!==e}))).length||uo()}(document.querySelector(".slidecarthq")),window.SLIDECART_CLOSED&&window.SLIDECART_CLOSED(),e.upsells.forEach((function(e){e.optionsOpen=!1})),e.open=!1}}}),Dr=wo(rr.prototype,"addToCart",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n,r,o){e.loading=!0;var i=e.cart.items.find((function(e){return e.id===t})),a=i?n+i.quantity:n,s={updates:vo({},t,r?n:a)};Kn.a.post("".concat(e.urlBase,"/cart/update.js"),s).then((function(o){if(e.cart=o.data,e.loading=!1,window.SLIDECART_ADDED_TO_CART){var s=o.data.items.find((function(e){return e.variant_id===t}));window.SLIDECART_ADDED_TO_CART(s)}var u;(Jn()("[data-cart-count]").text(e.cart.item_count.toString()),Jn()("[data-cart-total]").html(Ye(e.currency,o.data.total_price)),e.cart.item_count>0?Jn()("[data-cart-count-show]").removeClass("hide"):Jn()("[data-cart-count-show]").addClass("hide"),!e.open&&e.settings.open_on_add&&e.openCart(),e.settings.aupsell&&e.aupsells&&e.aupsells.length>0&&e.fetchAupsells(),e.settings.discount_box&&0===o.data.total_discount&&e.fetchDiscount(o.data),"undefined"!=typeof conversionBearAutoCurrencyConverter)&&(null===(u=conversionBearAutoCurrencyConverter)||void 0===u||u.convertPricesOnPage());window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(o.data);var c=r?n:a;window.SLIDECART_REMOVED_FROM_CART&&0==c&&window.SLIDECART_REMOVED_FROM_CART({id:t},Object(l.o)(i,{recurseEverything:!0}))}))}}}),qr=wo(rr.prototype,"updateQuantity",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n,r){var o=[];e.cart.items.map((function(e){return o.push(e.quantity)})),o[t]=n,e.loading=!0,Kn.a.post("".concat(e.urlBase,"/cart/update.js"),{updates:o}).then((function(t){var o;(e.cart=t.data,e.loading=!1,Jn()("[data-cart-count]").text(e.cart.item_count.toString()),Jn()("[data-cart-total]").html(Ye(e.currency,t.data.total_price)),e.cart.item_count>0?Jn()("[data-cart-count-show]").removeClass("hide"):Jn()("[data-cart-count-show]").addClass("hide"),!e.open&&e.settings.open_on_add&&e.openCart(),e.settings.discount_box&&0===t.data.total_discount&&e.fetchDiscount(t.data),"undefined"!=typeof conversionBearAutoCurrencyConverter)&&(null===(o=conversionBearAutoCurrencyConverter)||void 0===o||o.convertPricesOnPage());window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(t.data),window.SLIDECART_REMOVED_FROM_CART&&0==n&&window.SLIDECART_REMOVED_FROM_CART({id:r})}))}}}),Mr=wo(rr.prototype,"addToCartNew",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e;e.loading=!0,Jn.a.ajax({type:"POST",url:"".concat(e.urlBase,"/cart/add.js"),data:t.serialize(),success:function(e){Kn.a.get("".concat(n.urlBase,"/cart.js")).then((function(e){if(n.cart=e.data,n.loading=!1,window.SLIDECART_ADDED_TO_CART){var r=e.data.items,o=Number(t.find('[name="id"]').val()),i=r.find((function(e){return e.variant_id===o}));window.SLIDECART_ADDED_TO_CART(i)}var a;(Jn()("[data-cart-count]").text(n.cart.item_count.toString()),Jn()("[data-cart-total]").html(Ye(n.currency,e.data.total_price)),n.cart.item_count>0?Jn()("[data-cart-count-show]").removeClass("hide"):Jn()("[data-cart-count-show]").addClass("hide"),n.settings.aupsell&&n.aupsells&&n.aupsells.length>0&&n.fetchAupsells(),n.settings.discount_box&&0===e.data.total_discount&&n.fetchDiscount(e.data),!n.open&&n.settings.open_on_add&&n.openCart(),"undefined"!=typeof conversionBearAutoCurrencyConverter)&&(null===(a=conversionBearAutoCurrencyConverter)||void 0===a||a.convertPricesOnPage());window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(e.data)}))},error:function(e){n.loading=!1;var r=t.find('[type="submit"]'),o=e.responseJSON.description,i=t.find(".slidecart-form-error");i.length?i.text(o):r.length?Jn()('

'.concat(o,"

")).insertAfter(r):t.append('

'.concat(o,"

"))},dataType:"json"})}}}),Ir=wo(rr.prototype,"addToCartClassic",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){Kn.a.post("".concat(e.urlBase,"/cart/add.js"),{id:t,quantity:n},{headers:{"X-Requested-With":"XMLHttpRequest"}}).then((function(t){e.updateCart(),e.settings.aupsell&&e.aupsells&&e.aupsells.length>0&&e.fetchAupsells()})).catch((function(n){var r=e.cart.items.findIndex((function(e){return e.variant_id===t}));e.cart.items[r].error=n.response.data.description}))}}}),Rr=wo(rr.prototype,"removeFromCart",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.loading=!0;var n={updates:vo({},t,0)},r=e.cart.items.find((function(e){return e.variant_id===t}));Kn.a.post("".concat(e.urlBase,"/cart/update.js"),n).then((function(n){var o;(e.cart=n.data,e.loading=!1,e.cart.item_count>0?Jn()("[data-cart-count-show]").removeClass("hide"):Jn()("[data-cart-count-show]").addClass("hide"),Jn()("[data-cart-count]").text(e.cart.item_count.toString()),Jn()("[data-cart-total]").html(Ye(e.currency,n.data.total_price)),e.settings.aupsell&&e.aupsells&&e.aupsells.length>0&&e.fetchAupsells(),e.settings.discount_box&&0===n.data.total_discount&&e.fetchDiscount(n.data),e.open||e.openCart(),"undefined"!=typeof conversionBearAutoCurrencyConverter)&&(null===(o=conversionBearAutoCurrencyConverter)||void 0===o||o.convertPricesOnPage());window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(n.data),window.SLIDECART_REMOVED_FROM_CART&&window.SLIDECART_REMOVED_FROM_CART({id:t},Object(l.o)(r,{recurseEverything:!0}))}))}}}),zr=wo(rr.prototype,"fetchDiscount",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.cart.items.length>0&&Kn.a.post("/cart",{checkout:"Check out"}).then((function(t){var n=ko(t.data,e.cart),r=n.name,o=n.amount;r||o?(e.discountCode=r,e.discountCodeField=r,e.discountCodeAmount=o,e.discountCodeInvalid=!1,window.chCouponCode=r):(e.discountCode=!1,e.discountCodeField=!1,e.discountCodeAmount=!1,e.discountCodeInvalid=!1)}))}}}),Ur=wo(rr.prototype,"applyDiscountCode",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){t&&t.preventDefault(),n&&(e.discountCodeField=n),e.discountCodeField=e.discountCodeField.trim(),Kn.a.post("/cart",{checkout:"Check out",discount:e.discountCodeField.trim()}).then((function(t){var n=ko(t.data,e.cart),r=n.amount,o=n.name;!1===r&&!1===o||o.toLowerCase()!==e.discountCodeField.toLowerCase()?e.discountCodeInvalid=!0:(e.discountCode=e.discountCodeField,e.discountCodeAmount=r,e.discountCodeInvalid=!1,e.discountCodeField=!1,window.chCouponCode=o,window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(e.cart))}))}}}),Hr=wo(rr.prototype,"clearDiscountCode",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.discountCode=!1,e.discountCodeField=!1,e.discountCodeAmount=!1,e.discountCodeInvalid=!1}}}),Fr=wo(rr.prototype,"setDiscountCode",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.discountCodeField=t.target.value}}}),Br=wo(rr.prototype,"toggleNote",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showNote=!e.showNote}}}),Wr=wo(rr.prototype,"setNote",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){Kn.a.post("".concat(e.urlBase,"/cart/update.js"),{note:t}).then((function(n){e.note=t}))}}}),Vr=wo(rr.prototype,"toCheckout",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){window.SLIDECART_CHECKOUT&&!e.checkout_clicked&&window.SLIDECART_CHECKOUT(),e.checkout_clicked=!0;var n="".concat(e.urlBase,"/checkout");if(Jn()("#slidecart-checkout-form").attr("data-ly-processed")){var r=Jn()("#slidecart-checkout-form").attr("action").split("/");3===r.length&&(n+="?locale=".concat(r[1]))}if(Jn()("#slidecart-checkout-form").length&&e.settings.dev){var o,i,a=new po.a(Jn()("#slidecart-checkout-form").attr("action"),!0);if(null==a?void 0:null===(o=a.query)||void 0===o?void 0:o.locale)n+="?locale=".concat(null==a?void 0:null===(i=a.query)||void 0===i?void 0:i.locale)}if(e.settings.recharge||e.settings.goto_cart){for(var l=e.cart.items,s=!1,u=!1,c=0;c1){e.upsells[r].multi=!0,e.upsells[r].optionsOpen=!1;for(var o=0;o0){So("Direct match found, fetching items",n[0]);var r=[];n.map((function(e){r.push(Kn.a.get("/products/".concat(e,".js")))})),Promise.allSettled(r).then((function(t){t.map((function(t){"fulfilled"===t.status&&e.processAupsell(t.value.data)}))}))}else So("No direct matches, hitting recommended api"),e.findRecommendedAupsells()}}}),Kr=wo(rr.prototype,"openAupsellOptions",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.aupsells.findIndex((function(e){return e.product_y_handle===t}));e.aupsells[n].optionsOpen=!0}}}),Zr=wo(rr.prototype,"closeAupsellOptions",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.aupsells.findIndex((function(e){return e.product_y_handle===t}));e.aupsells[n].optionsOpen=!1}}}),Jr=wo(rr.prototype,"changeAupsellVariant",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n,r,o){var i=e.aupsells.findIndex((function(e){return e.product_y_handle===t})),a=e.aupsells[i].product.variants.find((function(e){var t=!n||e.option1===n,i=!r||e.option2===r,a=!o||e.option3===o;return t&&i&&a}));a?(e.aupsells[i].variant=a,e.aupsells[i].noVariant=!1):e.aupsells[i].noVariant=!0}}}),eo=wo(rr.prototype,"toggleCheckbox",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.checkbox=!e.checkbox,e.settings.checkbox_note&&e.settings.checkbox_note_text&&e.settings.checkbox_note_text.length>1&&(e.checkbox?e.setNote(e.settings.checkbox_note_text):e.setNote(""))}}}),rr);window.SLIDECART_OPEN=function(){Eo.openCart()},window.SLIDECART_CLOSE=function(){Eo.closeCart()},window.SLIDECART_UPDATE=function(e){Eo.updateCart(e)},window.SLIDECART_SET_CART=function(e){Eo.setCart(e)},window.SLIDECART_APPLY_DISCOUNT=function(e){Eo.applyDiscountCode(!1,e)},window.SLIDECART_STATE=function(){return Eo};var _o=Eo;n(71);if(100!==window.SLIDECART){window.SLIDECART=100;var Co=document.createElement("div");Co.id="slidecarthq",document.body.appendChild(Co),a.a.render(o.a.createElement(W,{CartStore:_o},o.a.createElement(ue,null)),Co)}}]); \ No newline at end of file +***************************************************************************** */var c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function d(e){return e.current?Object(l.h)(e.current):""}var p=[];function h(){var e=f(Object(r.useState)(0),2)[1];return Object(r.useCallback)((function(){e((function(e){return e+1}))}),[])}var m={};function y(e,t,n){if(void 0===t&&(t="observed"),void 0===n&&(n=m),u())return e();var o=(n.useForceUpdate||h)(),i=Object(r.useRef)(null);i.current||(i.current=new l.b("observer("+t+")",(function(){o()})));var a,s,c=function(){i.current&&!i.current.isDisposed&&(i.current.dispose(),i.current=null)};if(Object(r.useDebugValue)(i,d),function(e){Object(r.useEffect)((function(){return e}),p)}((function(){c()})),i.current.track((function(){try{a=e()}catch(e){s=e}})),s)throw c(),s;return a}function v(e,t){if(u())return e;var n,o,i,a=c({forwardRef:!1},t),l=e.displayName||e.name,s=function(t,n){return y((function(){return e(t,n)}),l)};return s.displayName=l,n=a.forwardRef?Object(r.memo)(Object(r.forwardRef)(s)):Object(r.memo)(s),o=e,i=n,Object.keys(o).forEach((function(e){o.hasOwnProperty(e)&&!g[e]&&Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(o,e))})),n.displayName=l,n}var g={$$typeof:!0,render:!0,compare:!0,type:!0};function b(e){var t=e.children,n=e.render,r=t||n;return"function"!=typeof r?null:y(r)}function w(e,t,n,r,o){var i="children"===t?"render":"children",a="function"==typeof e[t],l="function"==typeof e[i];return a&&l?new Error("MobX Observer: Do not use children and render in the same time in`"+n):a||l?null:new Error("Invalid prop `"+o+"` of type `"+typeof e[t]+"` supplied to `"+n+"`, expected `function`.")}b.propTypes={children:w,render:w},b.displayName="Observer";var x=0,k={};function S(e){return k[e]||(k[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react "+e+" ("+x+")";return x++,t}(e)),k[e]}function E(e,t){if(_(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o0;)r[o]=arguments[o+2];t.locks++;try{var i;return null!=e&&(i=e.apply(this,r)),i}finally{t.locks--,0===t.locks&&t.methods.forEach((function(e){e.apply(n,r)}))}}function P(e,t){return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];A.call.apply(A,[this,e,t].concat(n))}}function N(e,t,n){var r=function(e,t){var n=e[O]=e[O]||{},r=n[t]=n[t]||{};return r.locks=r.locks||0,r.methods=r.methods||[],r}(e,t);r.methods.indexOf(n)<0&&r.methods.push(n);var o=Object.getOwnPropertyDescriptor(e,t);if(!o||!o[j]){var i=function e(t,n,r,o,i){var a,l=P(i,o);return(a={})[j]=!0,a.get=function(){return l},a.set=function(i){if(this===t)l=P(i,o);else{var a=e(this,n,r,o,i);Object.defineProperty(this,n,a)}},a.configurable=!0,a.enumerable=r,a}(e,t,o?o.enumerable:void 0,r,e[t]);Object.defineProperty(e,t,i)}}var L=l.a||"$mobx",D=S("isUnmounted"),q=S("skipRender"),M=S("isForcingUpdate");function I(e,t){return u()&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==t||!E(this.props,e)}function R(e,t){var n=S("reactProp_"+t+"_valueHolder"),r=S("reactProp_"+t+"_atomHolder");function o(){return this[r]||T(this,r,Object(l.g)("reactive "+t)),this[r]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return o.call(this).reportObserved(),this[n]},set:function(e){this[M]||E(this[n],e)?T(this,n,e):(T(this,n,e),T(this,q,!0),o.call(this).reportChanged(),T(this,q,!1))}})}var z="function"==typeof Symbol&&Symbol.for,U=z?Symbol.for("react.forward_ref"):"function"==typeof r.forwardRef&&Object(r.forwardRef)((function(){})).$$typeof,H=z?Symbol.for("react.memo"):"function"==typeof r.memo&&Object(r.memo)((function(){})).$$typeof;function F(e){if(!0===e.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),H&&e.$$typeof===H)throw new Error("Mobx observer: You are trying to use 'observer' on function component wrapped to either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(U&&e.$$typeof===U){var t=e.render;if("function"!=typeof t)throw new Error("render property of ForwardRef was not a function");return Object(r.forwardRef)((function(){var e=arguments;return o.a.createElement(b,null,(function(){return t.apply(void 0,e)}))}))}return"function"!=typeof e||e.prototype&&e.prototype.render||e.isReactClass||Object.prototype.isPrototypeOf.call(r.Component,e)?function(e){var t=e.prototype;if(t.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(e.__proto__!==r.PureComponent)if(t.shouldComponentUpdate){if(t.shouldComponentUpdate!==I)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else t.shouldComponentUpdate=I;R(t,"props"),R(t,"state");var n=t.render;return t.render=function(){return function(e){var t=this;if(!0===u())return e.call(this);T(this,q,!1),T(this,M,!1);var n=this.displayName||this.name||this.constructor&&(this.constructor.displayName||this.constructor.name)||"",o=e.bind(this),i=!1,a=new l.b(n+".render()",(function(){if(!i&&(i=!0,!0!==t[D])){var e=!0;try{T(t,M,!0),t[q]||r.Component.prototype.forceUpdate.call(t),e=!1}finally{T(t,M,!1),e&&a.dispose()}}}));function s(){i=!1;var e=void 0,t=void 0;if(a.track((function(){try{t=Object(l.c)(!1,o)}catch(t){e=t}})),e)throw e;return t}return a.reactComponent=this,s[L]=a,this.render=s,s.call(this)}.call(this,n)},N(t,"componentWillUnmount",(function(){!0!==u()&&(this.render[L]&&this.render[L].dispose(),this[D]=!0)})),e}(e):v(e)}var B=o.a.createContext({});function W(e){var t=e.children,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}(e,["children"]),r=o.a.useContext(B),i=o.a.useRef(Object.assign({},r,n)).current;return o.a.createElement(B.Provider,{value:i},t)}function V(e,t,n,i){var a,l,s,u=o.a.forwardRef((function(n,i){var a=Object.assign({},n),l=o.a.useContext(B);return Object.assign(a,e(l||{},a)||{}),i&&(a.ref=i),Object(r.createElement)(t,a)}));return i&&(u=F(u)),u.isMobxInjector=!0,a=t,l=u,s=Object.getOwnPropertyNames(Object.getPrototypeOf(a)),Object.getOwnPropertyNames(a).forEach((function(e){C[e]||-1!==s.indexOf(e)||Object.defineProperty(l,e,Object.getOwnPropertyDescriptor(a,e))})),u.wrappedComponent=t,u.displayName=function(e,t){var n=e.displayName||e.name||e.constructor&&e.constructor.name||"Component";return t?"inject-with-"+t+"("+n+")":"inject("+n+")"}(t,n),u}function $(){for(var e,t=[],n=arguments.length;n--;)t[n]=arguments[n];return"function"==typeof arguments[0]?(e=arguments[0],function(t){return V(e,t,e.name,!0)}):function(e){return V(function(e){return function(t,n){return e.forEach((function(e){if(!(e in n)){if(!(e in t))throw new Error("MobX injector: Store '"+e+"' is not available! Make sure it is provided by some Provider");n[e]=t[e]}})),n}}(t),e,t.join("-"),!1)}}W.displayName="MobXProvider";S("disposeOnUnmountProto"),S("disposeOnUnmountInst");function Y(e){function t(t,n,r,o,i,a){for(var s=[],u=arguments.length-6;u-- >0;)s[u]=arguments[u+6];return Object(l.q)((function(){return o=o||"<>",a=a||r,null==n[r]?t?new Error("The "+i+" `"+a+"` is marked as required in `"+o+"`, but its value is `"+(null===n[r]?"null":"undefined")+"`."):null:e.apply(void 0,[n,r,o,i,a].concat(s))}))}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function G(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||"Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol}(t,e)?"symbol":t}function X(e,t){return Y((function(n,r,o,i,a){return Object(l.q)((function(){if(e&&G(n[r])===t.toLowerCase())return null;var i;switch(t){case"Array":i=l.i;break;case"Object":i=l.k;break;case"Map":i=l.j;break;default:throw new Error("Unexpected mobxType: "+t)}var s=n[r];if(!i(s)){var u=function(e){var t=G(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}(s),c=e?" or javascript `"+t.toLowerCase()+"`":"";return new Error("Invalid prop `"+a+"` of type `"+u+"` supplied to `"+o+"`, expected `mobx.Observable"+t+"`"+c+".")}return null}))}))}function Q(e,t){return Y((function(n,r,o,i,a){for(var s=[],u=arguments.length-5;u-- >0;)s[u]=arguments[u+5];return Object(l.q)((function(){if("function"!=typeof t)return new Error("Property `"+a+"` of component `"+o+"` has invalid PropType notation.");var l=X(e,"Array")(n,r,o);if(l instanceof Error)return l;for(var u=n[r],c=0;c0&&o.a.createElement(Ve,null)),n.enabled&&n.premium&&n.floating_cart&&o.a.createElement(jn,null)):o.a.createElement(o.a.Fragment,null)}}])&&oe(n.prototype,r),i&&oe(n,i),t}(r.Component))||te)||te;function ce(e){var t=e.color,n=e.width;return o.a.createElement("svg",{width:n||"10",viewBox:"0 0 10 10"},o.a.createElement("path",{d:"M9.677 8.118a1.102 1.102 0 11-1.559 1.56L5 6.558 1.882 9.677a1.102 1.102 0 11-1.56-1.559L3.442 5 .323 1.882A1.102 1.102 0 111.882.322L5 3.442 8.118.323a1.102 1.102 0 111.56 1.559L6.558 5l3.118 3.118z",fill:t||"#A1A1A1",fillRule:"nonzero"}))}function fe(e){var t=e.width;return o.a.createElement("svg",{width:t||"65",viewBox:"0 0 65 74",xmlns:"http://www.w3.org/2000/svg"},o.a.createElement("g",{fillRule:"nonzero",fill:"none"},o.a.createElement("path",{d:"M64.407 9.856L53.605 0H11.371L.569 9.856A1.548 1.548 0 00.1 11.603c.235.619.843 1.031 1.524 1.031h61.727a1.62 1.62 0 001.522-1.031 1.545 1.545 0 00-.467-1.747z",fill:"#C4C4C4"}),o.a.createElement("path",{d:"M63.351 9.927H1.624C.728 9.927 0 10.644 0 11.529v59.267C0 72.566 1.454 74 3.249 74h58.478c1.795 0 3.249-1.434 3.249-3.204V11.53c0-.885-.728-1.602-1.625-1.602z",fill:"#E4E4E4"}),o.a.createElement("path",{d:"M32.488 45.122c-7.963 0-14.44-6.447-14.44-14.37v-4.79a1.6 1.6 0 011.605-1.596 1.6 1.6 0 011.604 1.596v4.79c0 6.163 5.04 11.177 11.23 11.177 6.192 0 11.231-5.014 11.231-11.177v-4.79a1.6 1.6 0 011.604-1.596 1.6 1.6 0 011.605 1.596v4.79c0 7.923-6.477 14.37-14.44 14.37z",fill:"#6D6D6D"})))}function de(e){e.color;var t=e.width;return o.a.createElement("svg",{width:t||"60",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"},o.a.createElement("path",{fill:"currentColor",d:"M40.645 14.333c-5.878-8.48-17.517-10.59-25.998-4.712-8.48 5.877-10.59 17.518-4.712 25.998l3.343-2.318c-4.598-6.633-2.948-15.739 3.686-20.337 6.634-4.598 15.74-2.948 20.337 3.686l3.344-2.317z"}))}function pe(e){var t=e.width;e.color;return o.a.createElement("svg",{width:t||"10",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg"},o.a.createElement("path",{d:"M11 5H7V1a1 1 0 00-2 0v4H1a1 1 0 000 2h4v4a1 1 0 002 0V7h4a1 1 0 000-2z",fill:"currentColor",fillRule:"nonzero"}))}function he(e){var t=e.color,n=e.width;return o.a.createElement("svg",{width:n||"10",viewBox:"0 0 12 2",xmlns:"http://www.w3.org/2000/svg"},o.a.createElement("path",{d:"M11.25 0H.75C.3 0 0 .4 0 1s.3 1 .75 1h10.5c.45 0 .75-.4.75-1s-.3-1-.75-1z",fill:t||"#7A7A7A",fillRule:"nonzero"}))}function me(e){var t=e.className;return o.a.createElement("svg",{className:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",width:"14px",height:"14px"},o.a.createElement("path",{d:"M17.78 3.09C17.45 2.443 16.778 2 16 2h-5.165c-.535 0-1.046.214-1.422.593l-6.82 6.89c0 .002 0 .003-.002.003-.245.253-.413.554-.5.874L.738 8.055c-.56-.953-.24-2.178.712-2.737L9.823.425C10.284.155 10.834.08 11.35.22l4.99 1.337c.755.203 1.293.814 1.44 1.533z",fillOpacity:".55",fill:"currentColor"}),o.a.createElement("path",{fill:"currentColor",d:"M10.835 2H16c1.105 0 2 .895 2 2v5.172c0 .53-.21 1.04-.586 1.414l-6.818 6.818c-.777.778-2.036.782-2.82.01l-5.166-5.1c-.786-.775-.794-2.04-.02-2.828.002 0 .003 0 .003-.002l6.82-6.89C9.79 2.214 10.3 2 10.835 2zM13.5 8c.828 0 1.5-.672 1.5-1.5S14.328 5 13.5 5 12 5.672 12 6.5 12.672 8 13.5 8z"}))}function ye(){return(ye=Object.assign||function(e){for(var t=1;t0?n.item_count:"";return o.a.createElement("header",{className:"header"},o.a.createElement("h2",null,r.title_text," ",o.a.createElement("span",{className:"cart-count"},i)),o.a.createElement("button",{onClick:t},o.a.createElement(ce,null)))}}])&&be(n.prototype,r),i&&be(n,i),t}(r.Component))||se)||se;function _e(){return o.a.createElement("div",{className:"loading-state"},o.a.createElement(de,null))}function Ce(e){return(Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Te(e,t){for(var n=0;n$1")}function Xe(e){var t=e.upsell,n=e.item,r=e.size,i=e.useCompact;return n&&n.image?o.a.createElement("img",{className:r,src:Qe(n.image,i)}):t&&t.variant&&t.variant.featured_image?o.a.createElement("img",{className:r,src:Qe(t.variant.featured_image.src,i)}):t&&t.product&&t.product.featured_image?o.a.createElement("img",{className:r,src:Qe(t.product.featured_image,i)}):o.a.createElement("span",{className:Z()("image-placeholder",r)})}function Qe(e,t){return t?e.split(/\.(?=[^\.]+$)/).join("_compact."):e}function Ke(e){return(Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ze(e,t){for(var n=0;n0?" • ".concat(e):e})),h&&(s.length&&"Default Title"!==s[0]?f+=" • ".concat(r.subscription_text):f+="".concat(r.subscription_text)),e.selling_plan_allocation&&e.selling_plan_allocation.selling_plan){var m=e.selling_plan_allocation.selling_plan;s.length&&"Default Title"!==s[0]?f+=" • ".concat(m.name):f+="".concat(m.name)}r.show_product_type&&e.product_type&&e.product_type.length>0&&(f.length>0?f+=" • ".concat(e.product_type):f+="".concat(e.product_type)),r.show_vendor&&e.vendor&&e.vendor.length>0&&(f.length>0?f+=" • ".concat(e.vendor):f+="".concat(e.vendor)),r.custom_properties&&e.properties&&Object.entries(e.properties).forEach((function(e,t){e[0]&&e[1]&&(d+=t>0?" • ".concat(e[1]):e[1])})),f.length>0&&(p+=f),f.length>0&&d.length>0&&(p+=" • "),d.length>0&&(p+=d);var y=!1;r.unit_price&&e.unit_price&&e.unit_price_measurement&&e.unit_price_measurement.reference_value&&e.unit_price_measurement.reference_unit&&(y=Ye(t,e.unit_price)+"/"+e.unit_price_measurement.reference_value+e.unit_price_measurement.reference_unit);var v=[];if(2==r.custom_property_format){if(e.variant_options&&"Default Title"!=e.variant_options[0]&&e.options_with_values&&e.options_with_values.map((function(e){v.push({key:e.name,value:e.value})})),e.selling_plan_allocation&&e.selling_plan_allocation.selling_plan){var g=e.selling_plan_allocation.selling_plan;v.push({key:"",value:g.name})}r.show_product_type&&e.product_type&&e.product_type.length>0&&v.push({key:r.product_type_key_text,value:e.product_type}),r.show_vendor&&e.vendor&&e.vendor.length>0&&v.push({key:r.vendor_key_text,value:e.vendor}),e.properties&&Object.entries(e.properties).forEach((function(e,t){e[0]&&e[1]&&v.push({key:e[0],value:e[1]})}))}return o.a.createElement("div",{className:"item",key:"".concat(e.variant_id,"-").concat(a),"data-line-item-id":e.id,"data-variant-id":e.variant_id,"data-line-item-key":e.key},o.a.createElement("div",{className:"image"},o.a.createElement("a",{href:e.url},o.a.createElement(Xe,{item:e,useCompact:r.compact_images}))),o.a.createElement("div",{className:"main"},o.a.createElement("div",{className:"main-top"},o.a.createElement("div",{className:"main-top-left"},o.a.createElement("h3",{className:"title"},o.a.createElement("a",{href:e.url,dangerouslySetInnerHTML:{__html:e.product_title}})),1==r.custom_property_format?o.a.createElement(o.a.Fragment,null,p.length>0&&o.a.createElement("p",{className:"variants-p"},p)):o.a.createElement("ul",{className:"properties-key-value"},v.map((function(e,t){if("string"==typeof e.value)return o.a.createElement("li",{key:t,"data-key":e.key},e.key.length>0&&o.a.createElement(o.a.Fragment,null,o.a.createElement("span",{className:"properties-key-value-key"},e.key),o.a.createElement("span",{className:"properties-key-value-spacer"},": ")),o.a.createElement("span",{className:"properties-key-value-value"},e.value))})))),o.a.createElement("button",{className:"remove",onClick:r.dev?function(){return i(a,0,e.variant_id)}:function(){return n(e.variant_id)}},o.a.createElement(ce,{width:9,color:"#cacaca"}))),o.a.createElement("div",{className:"main-bottom"},r.dev?o.a.createElement(vt,{value:e.quantity,id:e.variant_id,index:a}):o.a.createElement(ct,{value:e.quantity,id:e.variant_id,index:a}),r.carthook?o.a.createElement(o.a.Fragment,null,e.line_price0&&o.a.createElement("div",{className:"footer-row"},o.a.createElement("span",{className:"flex"},t.discounts_label_text),o.a.createElement("span",{className:"slidecart-discount-amount",dangerouslySetInnerHTML:{__html:r}})),!1!==e.discountCode&&void 0!==e.discountCode&&0===e.cart.total_discount&&o.a.createElement("div",{className:"footer-row"},o.a.createElement("span",{className:"footer-row-flex flex"},t.discounts_label_text,o.a.createElement("span",{className:Z()("footer-code",{right:0===e.discountCodeAmount||!1===e.discountCodeAmount})},o.a.createElement(me,{className:"footer-tags-icon"}),e.discountCode,o.a.createElement("button",{onClick:e.clearDiscountCode},o.a.createElement(ce,null)))),e.discountCodeAmount>0&&o.a.createElement("span",{className:"slidecart-discount-amount",dangerouslySetInnerHTML:{__html:i}})),o.a.createElement("div",{className:"footer-row"},o.a.createElement("strong",{className:"flex",dangerouslySetInnerHTML:{__html:t.subtotal_label_text}}),e.discountCodeAmount>0&&0===e.cart.total_discount?o.a.createElement("strong",{className:"slidecart-subtotal",dangerouslySetInnerHTML:{__html:l}}):o.a.createElement("strong",{className:"slidecart-subtotal",dangerouslySetInnerHTML:{__html:a}})))},n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&kt(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props.CartStore,t=e.settings;return t.sticky_checkout?o.a.createElement(o.a.Fragment,null,o.a.createElement("footer",{className:Z()("footer new-footer",{sticky_checkout:t.sticky_checkout})},this.renderShared()),o.a.createElement("div",{className:"footer-sticky"},o.a.createElement("div",{className:"footer-buttons"},this.renderButton(),t.additional_buttons&&o.a.createElement("div",{className:"additional-buttons"},o.a.createElement("div",{className:"dynamic-checkout__content",id:"dynamic-checkout-cart","data-shopify":"dynamic-checkout-cart"})),t.continue_shopping&&o.a.createElement("a",{className:"footer-continue",onClick:e.closeCart},t.continue_shopping_text)),o.a.createElement(kn,{setting:"custom_html_checkout"}))):o.a.createElement("footer",{className:"footer"},this.renderShared(),this.renderButton(),t.additional_buttons&&o.a.createElement("div",{className:"additional-buttons"},o.a.createElement("div",{className:"dynamic-checkout__content",id:"dynamic-checkout-cart","data-shopify":"dynamic-checkout-cart"})),t.continue_shopping&&o.a.createElement("a",{className:"footer-continue",onClick:e.closeCart},t.continue_shopping_text),o.a.createElement(kn,{setting:"custom_html_checkout"}))}}])&&bt(n.prototype,r),i&&bt(n,i),t}(r.Component))||yt)||yt;function _t(e){return(_t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ct(e,t){for(var n=0;ne)return o.a.createElement("div",{key:e,className:"option"},o.a.createElement("label",null,t.product.options[e].name),o.a.createElement("select",{onChange:function(t){return n.changeVariant(t,e+1)},defaultValue:t.variant.options[e]},t["option".concat(e+1)].map((function(e){return o.a.createElement("option",{key:e},e)}))))},n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Rt(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.upsell,n=this.props.CartStore,r=n.closeUpsellOptions,i=n.settings,a=n.currency,l=t.optionsOpen,s=t.title,u=t.noVariant,c=t.variant,f=this.state,d=f.option1,p=f.option2,h=f.option3,m=!c.available||u?i.upsell_unavailable_text:i.upsell_add_long_text,y=Ye(a,c.price),v=c.compare_at_price&&c.compare_at_price>c.price,g=v?Ye(a,c.compare_at_price):"",b=!1;return i.unit_price&&c.unit_price&&c.unit_price_measurement&&c.unit_price_measurement.reference_value&&c.unit_price_measurement.reference_unit&&(b=Ye(a,c.unit_price)+"/"+c.unit_price_measurement.reference_value+c.unit_price_measurement.reference_unit),o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{style:{width:"".concat(i.max_width,"%")},onClick:function(){return r(t.product_id)},className:Z()("upsell-options-overlay",{active:l})}),o.a.createElement("div",{style:{width:"".concat(i.max_width,"%")},className:Z()("upsell-options",{active:l})},o.a.createElement("header",{className:"upsell-options-header"},o.a.createElement("div",{className:"image"},o.a.createElement("a",{href:t.product.url},o.a.createElement(Xe,{upsell:t,useCompact:i.compact_images}))),o.a.createElement("div",{className:"text"},o.a.createElement("div",null,o.a.createElement("h2",null,o.a.createElement("a",{href:t.product.url},s)),o.a.createElement("p",{className:"upsell-options-variant"},d&&d,p&&" • ".concat(p),h&&" • ".concat(h))),o.a.createElement("div",{className:"upsell-options-prices-wrap"},o.a.createElement("div",{className:"upsell-options-prices"},o.a.createElement("p",{className:"price",dangerouslySetInnerHTML:{__html:y}}),v&&o.a.createElement("p",{className:"compare-at",dangerouslySetInnerHTML:{__html:g}})),b&&o.a.createElement("div",{className:"upsell-options-unit-price"},o.a.createElement("p",null,b))))),[0,1,2].map((function(t){return e.renderOption(t)})),o.a.createElement("button",{onClick:this.addVariantToCart,className:"button full",disabled:u||!c.available},m)))}}])&&qt(n.prototype,r),i&&qt(n,i),t}(r.Component))||At)||At;function Ht(e){return(Ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ft(e,t){for(var n=0;n-1})).length===t.length,s=r.upsell_heading.length>0&&!l||r.upsell_heading.length>0&&r.upsell_multi;return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"upsells"},s&&o.a.createElement("div",{className:"upsells-header"},o.a.createElement("h2",null,r.upsell_heading)),a?o.a.createElement("div",{className:"upsells-stacked"},t.map((function(e,t){if(!(!i&&n.items.filter((function(t){return t.product_id===Number(e.product_id)}))).length&&e.finished)return e.multi&&!e.variant?void 0:o.a.createElement(en,{key:e.id,upsell:e,index:t})}))):o.a.createElement(Lt.a,{dots:!1,infinite:!0,speed:500,slidesToShow:1,slidesToScroll:1},t.map((function(e,t){if(!(!i&&n.items.filter((function(t){return t.product_id===Number(e.product_id)}))).length&&e.finished)return e.multi&&!e.variant?void 0:o.a.createElement(en,{key:e.id,upsell:e,index:t})})))),t.map((function(e,t){if(!(!i&&n.items.filter((function(t){return t.product_id===Number(e.product_id)}))).length&&e.finished&&e.multi&&e.variant)return o.a.createElement(Ut,{key:e.id,upsell:e,index:t})})))}}])&&Ft(n.prototype,r),i&&Ft(n,i),t}(r.Component))||zt)||zt;function Gt(e){return(Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xt(e,t){for(var n=0;n1})},o.a.createElement("div",{className:"upsell-item"},o.a.createElement("div",{className:"upsell-image"},o.a.createElement("a",{href:u},o.a.createElement(Xe,{upsell:n,size:"small",useCompact:i.compact_images}))),o.a.createElement("div",{className:"upsell-text"},o.a.createElement("h3",null,o.a.createElement("a",{href:u,dangerouslySetInnerHTML:{__html:l}})),o.a.createElement("div",{className:"upsell-text-prices"},o.a.createElement("p",{dangerouslySetInnerHTML:{__html:f}}),d&&o.a.createElement("p",{className:"upsell-compare-at",dangerouslySetInnerHTML:{__html:Ye(r,c.compare_at_price)}})),p&&o.a.createElement("p",{className:"upsell-unit-price",dangerouslySetInnerHTML:{__html:p}})),o.a.createElement("div",{className:"upsell-add"},i.upsell_goto_product?o.a.createElement("a",{href:u},o.a.createElement(pe,{color:"#fff"}),i.upsell_add_text):o.a.createElement("button",{onClick:this.addToCart},o.a.createElement(pe,{color:"#fff"}),i.upsell_add_text))))}}])&&Xt(n.prototype,r),i&&Xt(n,i),t}(r.Component))||$t)||$t;function tn(e){return(tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nn(e,t){for(var n=0;n0?t.rewards_pre.length<1?o.a.createElement(o.a.Fragment,null):o.a.createElement("div",{className:"rewards"},o.a.createElement("p",{dangerouslySetInnerHTML:{__html:this.formatText(t.rewards_pre,l)}}),o.a.createElement("div",{className:"rewards-progress-bar"},o.a.createElement("div",{className:"rewards-progress",style:{width:100*s+"%"}}))):t.rewards_post.length<1?o.a.createElement(o.a.Fragment,null):o.a.createElement("div",{className:"rewards"},o.a.createElement("p",{dangerouslySetInnerHTML:{__html:this.formatText(t.rewards_post,l)}})):o.a.createElement(o.a.Fragment,null)}}])&&cn(n.prototype,r),i&&cn(n,i),t}(r.Component))||ln)||ln;function yn(e){return(yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function vn(e,t){for(var n=0;ne)return o.a.createElement("div",{key:e,className:"option"},o.a.createElement("label",null,t.product.options[e].name),o.a.createElement("select",{onChange:function(t){return n.changeVariant(t,e+1)},defaultValue:t.variant.options[e]},t["option".concat(e+1)].map((function(e){return o.a.createElement("option",{key:e},e)}))))},n}var n,r,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Dn(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this,t=this.props.aupsell,n=this.props.CartStore,r=n.closeAupsellOptions,i=n.settings,a=n.currency,l=t.optionsOpen,s=t.product,u=t.noVariant,c=t.variant,f=this.state,d=f.option1,p=f.option2,h=f.option3,m=!c.available||u?i.upsell_unavailable_text:i.upsell_add_long_text,y=Ye(a,c.price),v=c.compare_at_price&&c.compare_at_price>c.price,g=v?Ye(a,c.compare_at_price):"",b=s.title,w=!1;return i.unit_price&&c.unit_price&&c.unit_price_measurement&&c.unit_price_measurement.reference_value&&c.unit_price_measurement.reference_unit&&(w=Ye(a,c.unit_price)+"/"+c.unit_price_measurement.reference_value+c.unit_price_measurement.reference_unit),o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{style:{width:"".concat(i.max_width,"%")},onClick:function(){return r(t.product_y_handle)},className:Z()("upsell-options-overlay",{active:l})}),o.a.createElement("div",{style:{width:"".concat(i.max_width,"%")},className:Z()("upsell-options",{active:l})},o.a.createElement("header",{className:"upsell-options-header"},o.a.createElement("div",{className:"image"},o.a.createElement("a",{href:t.product.url},o.a.createElement(Xe,{upsell:t,useCompact:i.compact_images}))),o.a.createElement("div",{className:"text"},o.a.createElement("div",null,o.a.createElement("h2",null,o.a.createElement("a",{href:t.product.url},b)),o.a.createElement("p",{className:"upsell-options-variant"},d&&d,p&&" • ".concat(p),h&&" • ".concat(h))),o.a.createElement("div",{className:"upsell-options-prices-wrap"},o.a.createElement("div",{className:"upsell-options-prices"},o.a.createElement("p",{className:"price",dangerouslySetInnerHTML:{__html:y}}),v&&o.a.createElement("p",{className:"compare-at",dangerouslySetInnerHTML:{__html:g}})),w&&o.a.createElement("div",{className:"upsell-options-unit-price"},o.a.createElement("p",null,w))))),[0,1,2].map((function(t){return e.renderOption(t)})),o.a.createElement("button",{onClick:this.addVariantToCart,className:"button full",disabled:u||!c.available},m)))}}])&&Pn(n.prototype,r),i&&Pn(n,i),t}(r.Component))||On)||On;function In(e){return(In="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rn(e,t){for(var n=0;n-1})).length===t.length,c=r.aupsell_heading.length>0&&!u||r.aupsell_heading.length>0&&a;return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"upsells"},c&&o.a.createElement("div",{className:"upsells-header"},o.a.createElement("h2",null,r.aupsell_heading)),i?o.a.createElement("div",{className:"upsells-stacked"},t.map((function(e,t){if(!(!a&&n.items.filter((function(t){return t.handle===e.product_y_handle}))).length&&e.finished){if(e.multi&&!e.variant)return;if(s>=l)return;return s+=1,o.a.createElement(Xn,{key:t,aupsell:e,index:t})}}))):o.a.createElement(Lt.a,{dots:!1,infinite:!0,speed:500,slidesToShow:1,slidesToScroll:1},t.map((function(e,t){if(!(!a&&n.items.filter((function(t){return t.handle===e.product_y_handle}))).length&&e.finished){if(e.multi&&!e.variant)return;if(s>=l)return;return s+=1,o.a.createElement(Xn,{key:t,aupsell:e,index:t})}})))),t.map((function(e,t){if(!(!a&&n.items.filter((function(t){return t.handle===e.product_y_handle}))).length&&e.finished&&e.multi&&e.variant)return o.a.createElement(Mn,{key:t,aupsell:e,index:t})})))}}])&&Rn(n.prototype,r),i&&Rn(n,i),t}(r.Component))||qn)||qn;function Wn(e){return(Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vn(e,t){for(var n=0;n1})},o.a.createElement("div",{className:"upsell-item"},o.a.createElement("div",{className:"upsell-image"},o.a.createElement("a",{href:u},o.a.createElement(Xe,{upsell:n,size:"small",useCompact:i.compact_images}))),o.a.createElement("div",{className:"upsell-text"},o.a.createElement("h3",null,o.a.createElement("a",{href:u,dangerouslySetInnerHTML:{__html:l}})),o.a.createElement("div",{className:"upsell-text-prices"},o.a.createElement("p",{dangerouslySetInnerHTML:{__html:f}}),d&&o.a.createElement("p",{className:"upsell-compare-at",dangerouslySetInnerHTML:{__html:Ye(r,c.compare_at_price)}})),p&&o.a.createElement("p",{className:"upsell-unit-price",dangerouslySetInnerHTML:{__html:p}})),o.a.createElement("div",{className:"upsell-add"},o.a.createElement("button",{onClick:this.addToCart},o.a.createElement(pe,{color:"#fff"}),i.upsell_add_text))))}}])&&Vn(n.prototype,r),i&&Vn(n,i),t}(r.Component))||Fn)||Fn,Qn=n(4),Kn=n.n(Qn),Zn=n(2),Jn=n.n(Zn);function er(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1),no=[],ro=!1,oo=-1,io=void 0,ao=void 0,lo=function(e){return no.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},so=function(e){var t=e||window.event;return!!lo(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},uo=function(){setTimeout((function(){void 0!==ao&&(document.body.style.paddingRight=ao,ao=void 0),void 0!==io&&(document.body.style.overflow=io,io=void 0)}))},co=function(e,t){if(to){if(!e)return void console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");if(e&&!no.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};no=[].concat(er(no),[n]),e.ontouchstart=function(e){1===e.targetTouches.length&&(oo=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&function(e,t){var n=e.targetTouches[0].clientY-oo;!lo(e.target)&&(t&&0===t.scrollTop&&n>0?so(e):function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?so(e):e.stopPropagation())}(t,e)},ro||(document.addEventListener("touchmove",so,tr?{passive:!1}:void 0),ro=!0)}}else{!function(e){setTimeout((function(){if(void 0===ao){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;t&&n>0&&(ao=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===io&&(io=document.body.style.overflow,document.body.style.overflow="hidden")}))}(t);var r={targetElement:e,options:t||{}};no=[].concat(er(no),[r])}},fo=n(14),po=n.n(fo),ho="https://cart-go.apphq.co/api";function mo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function yo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function go(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t0?s:t.total_price-l;return{name:i.textContent.trim().split(" ")[0],amount:u}}return i?{name:i.textContent,amount:!1}:{name:!1,amount:!1}}function So(e,t){window.SLIDECART_DEV&&(console.log(e),t&&console.log(t))}var Eo=new(or=wo((rr=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),bo(this,"loading",or,this),bo(this,"init",ir,this),bo(this,"settings",ar,this),bo(this,"open",lr,this),bo(this,"shop",sr,this),bo(this,"cart",ur,this),bo(this,"currency",cr,this),bo(this,"showNote",fr,this),bo(this,"note",dr,this),bo(this,"upsells",pr,this),bo(this,"aupsells",hr,this),bo(this,"announcements",mr,this),bo(this,"upsellProducts",yr,this),bo(this,"aupsellProducts",vr,this),bo(this,"discountCode",gr,this),bo(this,"discountCodeField",br,this),bo(this,"discountCodeAmount",wr,this),bo(this,"discountCodeInvalid",xr,this),bo(this,"checkout_clicked",kr,this),bo(this,"checkbox",Sr,this),bo(this,"langs",Er,this),bo(this,"urlBase",_r,this),bo(this,"initiate",Cr,this),bo(this,"setScrollListener",Tr,this),bo(this,"updateCart",Or,this),bo(this,"setCart",jr,this),bo(this,"setCartLinkListeners",Ar,this),bo(this,"setFormSubmitListeners",Pr,this),bo(this,"openCart",Nr,this),bo(this,"closeCart",Lr,this),bo(this,"addToCart",Dr,this),bo(this,"updateQuantity",qr,this),bo(this,"addToCartNew",Mr,this),bo(this,"addToCartClassic",Ir,this),bo(this,"removeFromCart",Rr,this),bo(this,"fetchDiscount",zr,this),bo(this,"applyDiscountCode",Ur,this),bo(this,"clearDiscountCode",Hr,this),bo(this,"setDiscountCode",Fr,this),bo(this,"toggleNote",Br,this),bo(this,"setNote",Wr,this),bo(this,"toCheckout",Vr,this),bo(this,"fetchUpsells",$r,this),bo(this,"openUpsellOptions",Yr,this),bo(this,"closeUpsellOptions",Gr,this),bo(this,"changeUpsellVariant",Xr,this),bo(this,"fetchAupsells",Qr,this),this.processAupsell=function(e){if(e.available){var n=t.aupsells.findIndex((function(t){return e.handle===t.product_y_handle}));if(-1==n&&(t.aupsells.push({product_y_handle:e.handle}),n=t.aupsells.length-1),t.aupsells[n].product=e,e.variants.length>1){t.aupsells[n].multi=!0,t.aupsells[n].optionsOpen=!1;for(var r=0;r0&&t.cart.items[0];if(!e)return So("Cart is empty, skipping to basic"),void t.findBasicUpsells();So("Cart has item, using it for recommended");var n="/recommendations/products.js?product_id=".concat(e.product_id);Kn.a.get(n).then((function(e){So("Fetched the products, time to filter recommended");var n=e.data.products,r=t.filterAupsells(n,!0);r.length>0?r.map((function(e){t.processAupsell(e)})):(So("No products found after recommended filter, going to basic"),t.findBasicUpsells())}))},this.findBasicUpsells=function(){var e=t.upsells.map((function(e){return e.handle})),n=t.filterAupsells(e);So("were in basic",n);var r=[];n.map((function(e){r.push(Kn.a.get("/products/".concat(e,".js")))})),Promise.allSettled(r).then((function(e){e.map((function(e){"fulfilled"===e.status&&t.processAupsell(e.value.data)}))}))},bo(this,"openAupsellOptions",Kr,this),bo(this,"closeAupsellOptions",Zr,this),bo(this,"changeAupsellVariant",Jr,this),bo(this,"toggleCheckbox",eo,this)}).prototype,"loading",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ir=wo(rr.prototype,"init",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ar=wo(rr.prototype,"settings",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),lr=wo(rr.prototype,"open",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),sr=wo(rr.prototype,"shop",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Shopify.shop}}),ur=wo(rr.prototype,"cart",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),cr=wo(rr.prototype,"currency",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return Shopify.currency.active}}),fr=wo(rr.prototype,"showNote",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),dr=wo(rr.prototype,"note",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),pr=wo(rr.prototype,"upsells",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),hr=wo(rr.prototype,"aupsells",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),mr=wo(rr.prototype,"announcements",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),yr=wo(rr.prototype,"upsellProducts",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),vr=wo(rr.prototype,"aupsellProducts",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),gr=wo(rr.prototype,"discountCode",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),br=wo(rr.prototype,"discountCodeField",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),wr=wo(rr.prototype,"discountCodeAmount",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),xr=wo(rr.prototype,"discountCodeInvalid",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),kr=wo(rr.prototype,"checkout_clicked",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Sr=wo(rr.prototype,"checkbox",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Er=wo(rr.prototype,"langs",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return t=[],n=null===(e=document.querySelector('[hreflang="x-default"]'))||void 0===e?void 0:e.getAttribute("href"),document.querySelectorAll("[hreflang]").forEach((function(e){var r=e.getAttribute("href"),o=e.getAttribute("hreflang");r!=n&&t.push(o)})),t;var e,t,n}}),_r=wo(rr.prototype,"urlBase",[l.l],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return""}}),Cr=wo(rr.prototype,"initiate",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){if(!0===window.SLIDECART_LANG){var t=document.querySelector("html").getAttribute("lang");if(t&&e.langs.length>0&&e.langs.indexOf(t)>-1){for(var n=new po.a(window.location.href),r=n.origin,o=n.host.split("."),i=!1,a=0;a0,e.init=!0,e.setScrollListener(),window.SLIDECART_LOADED&&window.SLIDECART_LOADED(i.data),l.discount_box&&0===i.data.total_discount&&e.fetchDiscount(i.data),e.settings.aupsell&&e.aupsells&&e.aupsells.length>0?e.fetchAupsells():e.settings.upsell&&e.upsells&&e.upsells.length>0&&e.fetchUpsells(),"undefined"!=typeof conversionBearAutoCurrencyConverter)&&(null===(n=conversionBearAutoCurrencyConverter)||void 0===n||n.convertPricesOnPage());e.settings.checkbox&&e.settings.checkbox_default&&e.settings.checkbox_note&&e.setNote(e.settings.checkbox_note_text),window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(i.data)}))}}}),Tr=wo(rr.prototype,"setScrollListener",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return function(){var e=document.querySelector(".slidecarthq-overlay"),t=document.querySelector(".slidecarthq");e&&t&&e.addEventListener("mousewheel",(function(e){e.preventDefault(),t.scrollTop+=e.deltaY}))}}}),Or=wo(rr.prototype,"updateCart",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){Kn.a.get("".concat(e.urlBase,"/cart.js")).then((function(n){var r;(e.cart=n.data,e.note=n.data.note,e.showNote=e.note&&e.note.length>0,Jn()("[data-cart-count]").text(n.data.item_count.toString()),Jn()("[data-cart-total]").html(Ye(e.currency,n.data.total_price)),e.settings.discount_box&&0===n.data.total_discount&&e.fetchDiscount(n.data),"undefined"!=typeof conversionBearAutoCurrencyConverter)&&(null===(r=conversionBearAutoCurrencyConverter)||void 0===r||r.convertPricesOnPage());t&&t(n.data),window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(n.data)}))}}}),jr=wo(rr.prototype,"setCart",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.cart=t}}}),Ar=wo(rr.prototype,"setCartLinkListeners",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){document.querySelectorAll('[href$="/cart"], [data-slidecart-open]').forEach((function(t){t.addEventListener("click",(function(n){var r=t.getAttribute("href").split("?")[0].indexOf("/cart")>-1,o=t.getAttribute("data-slidecart-dont-open");r&&"true"!=o&&(n.preventDefault(),e.openCart())}))}))}}}),Pr=wo(rr.prototype,"setFormSubmitListeners",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=e;Jn()(document).on("submit",'[action$="/cart/add"], [data-slidecart-form]',(function(e){e.preventDefault(),e.stopPropagation();var n=xo(Jn()(this)),r=n.id,o=n.quantity;Jn()('[action$="/cart/add"] [type="submit"], [data-slidecart-form] [type="submit"]').attr("aria-disabled")||(t.settings.recharge?t.addToCartNew(Jn()(this)):t.addToCart(r,o)),window.SLIDECART_ADD_TO_CART&&window.SLIDECART_ADD_TO_CART({id:r,quantity:o})})),Jn()(document).on("click",'[action$="/cart/add"] [type="submit"], [data-slidecart-form] [type="submit"]',(function(e){e.preventDefault(),e.stopPropagation();var n=xo(Jn()(this).closest('[action$="/cart/add"]')),r=n.id,o=n.quantity;Jn()('[action$="/cart/add"] [type="submit"], [data-slidecart-form] [type="submit"]').attr("aria-disabled")||(t.settings.recharge?t.addToCartNew(Jn()(this).parents("form")):t.addToCart(r,o)),window.SLIDECART_ADD_TO_CART&&window.SLIDECART_ADD_TO_CART({id:r,quantity:o})})),Jn()(document).on("click","[data-slidecart-ajax]",(function(e){e.preventDefault(),e.stopPropagation();var n=Jn()(this).attr("data-slidecart-id"),r=Jn()(this).attr("data-slidecart-quantity");if(n){var o=Number(n),i=r?Number(i):1;t.addToCart(o,i)}})),window.addEventListener("load",(function(e){window.__pagefly_helper_store__&&window.__pagefly_helper_store__.subscribe((function(e){Kn.a.get("/cart.js").then((function(e){t.cart=e.data,Jn()("[data-cart-count], .cart-item-count-header--quantity").text(t.cart.item_count.toString()),t.cart.item_count>0?Jn()("[data-cart-count-show]").removeClass("hide"):Jn()("[data-cart-count-show]").addClass("hide"),!t.open&&t.settings.open_on_add&&t.openCart()}))}))}))}}}),Nr=wo(rr.prototype,"openCart",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){var t=document.querySelector(".slidecarthq");co(t),window.SLIDECART_OPENED&&window.SLIDECART_OPENED(),e.open=!0}}}),Lr=wo(rr.prototype,"closeCart",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){!function(e){if(to){if(!e)return void console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");e.ontouchstart=null,e.ontouchmove=null,no=no.filter((function(t){return t.targetElement!==e})),ro&&0===no.length&&(document.removeEventListener("touchmove",so,tr?{passive:!1}:void 0),ro=!1)}else(no=no.filter((function(t){return t.targetElement!==e}))).length||uo()}(document.querySelector(".slidecarthq")),window.SLIDECART_CLOSED&&window.SLIDECART_CLOSED(),e.upsells.forEach((function(e){e.optionsOpen=!1})),e.open=!1}}}),Dr=wo(rr.prototype,"addToCart",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n,r,o){e.loading=!0;var i=e.cart.items.find((function(e){return e.id===t})),a=i?n+i.quantity:n,s={updates:vo({},t,r?n:a)};Kn.a.post("".concat(e.urlBase,"/cart/update.js"),s).then((function(o){if(e.cart=o.data,e.loading=!1,window.SLIDECART_ADDED_TO_CART){var s=o.data.items.find((function(e){return e.variant_id===t}));window.SLIDECART_ADDED_TO_CART(s)}var u;(Jn()("[data-cart-count]").text(e.cart.item_count.toString()),Jn()("[data-cart-total]").html(Ye(e.currency,o.data.total_price)),e.cart.item_count>0?Jn()("[data-cart-count-show]").removeClass("hide"):Jn()("[data-cart-count-show]").addClass("hide"),!e.open&&e.settings.open_on_add&&e.openCart(),e.settings.aupsell&&e.aupsells&&e.aupsells.length>0&&e.fetchAupsells(),e.settings.discount_box&&0===o.data.total_discount&&e.fetchDiscount(o.data),"undefined"!=typeof conversionBearAutoCurrencyConverter)&&(null===(u=conversionBearAutoCurrencyConverter)||void 0===u||u.convertPricesOnPage());window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(o.data);var c=r?n:a;window.SLIDECART_REMOVED_FROM_CART&&0==c&&window.SLIDECART_REMOVED_FROM_CART({id:t},Object(l.o)(i,{recurseEverything:!0}))}))}}}),qr=wo(rr.prototype,"updateQuantity",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n,r){var o=[];e.cart.items.map((function(e){return o.push(e.quantity)})),o[t]=n,e.loading=!0,Kn.a.post("".concat(e.urlBase,"/cart/update.js"),{updates:o}).then((function(t){var o;(e.cart=t.data,e.loading=!1,Jn()("[data-cart-count]").text(e.cart.item_count.toString()),Jn()("[data-cart-total]").html(Ye(e.currency,t.data.total_price)),e.cart.item_count>0?Jn()("[data-cart-count-show]").removeClass("hide"):Jn()("[data-cart-count-show]").addClass("hide"),!e.open&&e.settings.open_on_add&&e.openCart(),e.settings.discount_box&&0===t.data.total_discount&&e.fetchDiscount(t.data),"undefined"!=typeof conversionBearAutoCurrencyConverter)&&(null===(o=conversionBearAutoCurrencyConverter)||void 0===o||o.convertPricesOnPage());window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(t.data),window.SLIDECART_REMOVED_FROM_CART&&0==n&&window.SLIDECART_REMOVED_FROM_CART({id:r})}))}}}),Mr=wo(rr.prototype,"addToCartNew",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e;e.loading=!0,Jn.a.ajax({type:"POST",url:"".concat(e.urlBase,"/cart/add.js"),data:t.serialize(),success:function(e){Kn.a.get("".concat(n.urlBase,"/cart.js")).then((function(e){if(n.cart=e.data,n.loading=!1,window.SLIDECART_ADDED_TO_CART){var r=e.data.items,o=Number(t.find('[name="id"]').val()),i=r.find((function(e){return e.variant_id===o}));window.SLIDECART_ADDED_TO_CART(i)}var a;(Jn()("[data-cart-count]").text(n.cart.item_count.toString()),Jn()("[data-cart-total]").html(Ye(n.currency,e.data.total_price)),n.cart.item_count>0?Jn()("[data-cart-count-show]").removeClass("hide"):Jn()("[data-cart-count-show]").addClass("hide"),n.settings.aupsell&&n.aupsells&&n.aupsells.length>0&&n.fetchAupsells(),n.settings.discount_box&&0===e.data.total_discount&&n.fetchDiscount(e.data),!n.open&&n.settings.open_on_add&&n.openCart(),"undefined"!=typeof conversionBearAutoCurrencyConverter)&&(null===(a=conversionBearAutoCurrencyConverter)||void 0===a||a.convertPricesOnPage());window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(e.data)}))},error:function(e){n.loading=!1;var r=t.find('[type="submit"]'),o=e.responseJSON.description,i=t.find(".slidecart-form-error");i.length?i.text(o):r.length?Jn()('

'.concat(o,"

")).insertAfter(r):t.append('

'.concat(o,"

"))},dataType:"json"})}}}),Ir=wo(rr.prototype,"addToCartClassic",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){Kn.a.post("".concat(e.urlBase,"/cart/add.js"),{id:t,quantity:n},{headers:{"X-Requested-With":"XMLHttpRequest"}}).then((function(t){e.updateCart(),e.settings.aupsell&&e.aupsells&&e.aupsells.length>0&&e.fetchAupsells()})).catch((function(n){var r=e.cart.items.findIndex((function(e){return e.variant_id===t}));e.cart.items[r].error=n.response.data.description}))}}}),Rr=wo(rr.prototype,"removeFromCart",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.loading=!0;var n={updates:vo({},t,0)},r=e.cart.items.find((function(e){return e.variant_id===t}));Kn.a.post("".concat(e.urlBase,"/cart/update.js"),n).then((function(n){var o;(e.cart=n.data,e.loading=!1,e.cart.item_count>0?Jn()("[data-cart-count-show]").removeClass("hide"):Jn()("[data-cart-count-show]").addClass("hide"),Jn()("[data-cart-count]").text(e.cart.item_count.toString()),Jn()("[data-cart-total]").html(Ye(e.currency,n.data.total_price)),e.settings.aupsell&&e.aupsells&&e.aupsells.length>0&&e.fetchAupsells(),e.settings.discount_box&&0===n.data.total_discount&&e.fetchDiscount(n.data),e.open||e.openCart(),"undefined"!=typeof conversionBearAutoCurrencyConverter)&&(null===(o=conversionBearAutoCurrencyConverter)||void 0===o||o.convertPricesOnPage());window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(n.data),window.SLIDECART_REMOVED_FROM_CART&&window.SLIDECART_REMOVED_FROM_CART({id:t},Object(l.o)(r,{recurseEverything:!0}))}))}}}),zr=wo(rr.prototype,"fetchDiscount",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.cart.items.length>0&&Kn.a.post("/cart",{checkout:"Check out"}).then((function(t){var n=ko(t.data,e.cart),r=n.name,o=n.amount;r||o?(e.discountCode=r,e.discountCodeField=r,e.discountCodeAmount=o,e.discountCodeInvalid=!1,window.chCouponCode=r):(e.discountCode=!1,e.discountCodeField=!1,e.discountCodeAmount=!1,e.discountCodeInvalid=!1)}))}}}),Ur=wo(rr.prototype,"applyDiscountCode",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n){t&&t.preventDefault(),n&&(e.discountCodeField=n),e.discountCodeField=e.discountCodeField.trim(),Kn.a.post("/cart",{checkout:"Check out",discount:e.discountCodeField.trim()}).then((function(t){var n=ko(t.data,e.cart),r=n.amount,o=n.name;!1===r&&!1===o||o.toLowerCase()!==e.discountCodeField.toLowerCase()?e.discountCodeInvalid=!0:(e.discountCode=e.discountCodeField,e.discountCodeAmount=r,e.discountCodeInvalid=!1,e.discountCodeField=!1,window.chCouponCode=o,window.SLIDECART_UPDATED&&window.SLIDECART_UPDATED(e.cart))}))}}}),Hr=wo(rr.prototype,"clearDiscountCode",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.discountCode=!1,e.discountCodeField=!1,e.discountCodeAmount=!1,e.discountCodeInvalid=!1}}}),Fr=wo(rr.prototype,"setDiscountCode",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){e.discountCodeField=t.target.value}}}),Br=wo(rr.prototype,"toggleNote",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.showNote=!e.showNote}}}),Wr=wo(rr.prototype,"setNote",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){Kn.a.post("".concat(e.urlBase,"/cart/update.js"),{note:t}).then((function(n){e.note=t}))}}}),Vr=wo(rr.prototype,"toCheckout",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){window.SLIDECART_CHECKOUT&&!e.checkout_clicked&&window.SLIDECART_CHECKOUT(),e.checkout_clicked=!0;var n="".concat(e.urlBase,"/checkout");if(Jn()("#slidecart-checkout-form").attr("data-ly-processed")){var r=Jn()("#slidecart-checkout-form").attr("action").split("/");3===r.length&&(n+="?locale=".concat(r[1]))}if(Jn()("#slidecart-checkout-form").length&&e.settings.dev){var o,i,a=new po.a(Jn()("#slidecart-checkout-form").attr("action"),!0);if(null==a?void 0:null===(o=a.query)||void 0===o?void 0:o.locale)n+="?locale=".concat(null==a?void 0:null===(i=a.query)||void 0===i?void 0:i.locale)}if(e.settings.recharge||e.settings.goto_cart){for(var l=e.cart.items,s=!1,u=!1,c=0;c1){e.upsells[r].multi=!0,e.upsells[r].optionsOpen=!1;for(var o=0;o0){So("Direct match found, fetching items",n[0]);var r=[];n.map((function(e){r.push(Kn.a.get("/products/".concat(e,".js")))})),Promise.allSettled(r).then((function(t){t.map((function(t){"fulfilled"===t.status&&e.processAupsell(t.value.data)}))}))}else So("No direct matches, hitting recommended api"),e.findRecommendedAupsells()}}}),Kr=wo(rr.prototype,"openAupsellOptions",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.aupsells.findIndex((function(e){return e.product_y_handle===t}));e.aupsells[n].optionsOpen=!0}}}),Zr=wo(rr.prototype,"closeAupsellOptions",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t){var n=e.aupsells.findIndex((function(e){return e.product_y_handle===t}));e.aupsells[n].optionsOpen=!1}}}),Jr=wo(rr.prototype,"changeAupsellVariant",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(t,n,r,o){var i=e.aupsells.findIndex((function(e){return e.product_y_handle===t})),a=e.aupsells[i].product.variants.find((function(e){var t=!n||e.option1===n,i=!r||e.option2===r,a=!o||e.option3===o;return t&&i&&a}));a?(e.aupsells[i].variant=a,e.aupsells[i].noVariant=!1):e.aupsells[i].noVariant=!0}}}),eo=wo(rr.prototype,"toggleCheckbox",[l.d],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){var e=this;return function(){e.checkbox=!e.checkbox,e.settings.checkbox_note&&e.settings.checkbox_note_text&&e.settings.checkbox_note_text.length>1&&(e.checkbox?e.setNote(e.settings.checkbox_note_text):e.setNote(""))}}}),rr);window.SLIDECART_OPEN=function(){Eo.openCart()},window.SLIDECART_CLOSE=function(){Eo.closeCart()},window.SLIDECART_UPDATE=function(e){Eo.updateCart(e)},window.SLIDECART_SET_CART=function(e){Eo.setCart(e)},window.SLIDECART_APPLY_DISCOUNT=function(e){Eo.applyDiscountCode(!1,e)},window.SLIDECART_STATE=function(){return Eo};var _o=Eo;n(71);if(100!==window.SLIDECART){window.SLIDECART=100;var Co=document.createElement("div");Co.id="slidecarthq",document.body.appendChild(Co),a.a.render(o.a.createElement(W,{CartStore:_o},o.a.createElement(ue,null)),Co)}}]); \ No newline at end of file