/**
 * Minified by jsDelivr using Terser v5.48.0.
 * Original file: /npm/@ordergroove/offers@2.53.3/dist/offers.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
(e=>{"object"==typeof exports&&"object"==typeof module?module.exports=e():(window.og=window.og||{},window.og.offers=e())})(()=>(()=>{var e=Object.create,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,a=(e,r)=>t(e,"name",{value:r,configurable:!0}),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,r)=>{for(var i in r)t(e,i,{get:r[i],enumerable:!0})},u=(e,n,a,s)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let l of i(n))!o.call(e,l)&&l!==a&&t(e,l,{get:()=>n[l],enumerable:!(s=r(n,l))||s.enumerable});return e},c=(r,i,o)=>(o=null!=r?e(n(r)):{},u(!i&&r&&r.__esModule?o:t(o,"default",{value:r,enumerable:!0}),r)),d=s((e,t)=>{var r,i;r=e,i=function(e){"use strict";function t(e,t,r,i){var n,o=!1,s=0;function l(){n&&clearTimeout(n)}function u(){l(),o=!0}function c(){for(var u=arguments.length,c=new Array(u),d=0;d<u;d++)c[d]=arguments[d];var p=this,h=Date.now()-s;function f(){s=Date.now(),r.apply(p,c)}function g(){n=void 0}o||(a(f,"exec"),a(g,"clear"),i&&!n&&f(),l(),void 0===i&&h>e?f():!0!==t&&(n=setTimeout(i?g:f,void 0===i?e-h:e)))}return a(l,"clearExistingTimeout"),a(u,"cancel"),"boolean"!=typeof t&&(i=r,r=t,t=void 0),a(c,"wrapper"),c.cancel=u,c}function r(e,r,i){return void 0===i?t(e,r,!1):t(e,i,!1!==r)}a(t,"throttle"),a(r,"debounce"),e.debounce=r,e.throttle=t,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&typeof t<"u"?i(e):"function"==typeof define&&define.amd?define(["exports"],i):i((r=r||self).throttleDebounce={})}),p=s((e,t)=>{var r="__lodash_hash_undefined__",i=/^\[object .+?Constructor\]$/,n="object"==typeof window&&window&&window.Object===Object&&window,o="object"==typeof self&&self&&self.Object===Object&&self,s=n||o||Function("return this")();function l(e,t){return e?.[t]}function u(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch{}return t}a(l,"getValue"),a(u,"isHostObject");var c,d=Array.prototype,p=Function.prototype,h=Object.prototype,f=s["__core-js_shared__"],g=(c=/[^.]+$/.exec(f&&f.keys&&f.keys.IE_PROTO||""))?"Symbol(src)_1."+c:"",y=p.toString,m=h.hasOwnProperty,b=h.toString,v=RegExp("^"+y.call(m).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_=d.splice,S=z(s,"Map"),w=z(Object,"create");function P(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function O(){this.__data__=w?w(null):{}}function x(e){return this.has(e)&&delete this.__data__[e]}function E(e){var t=this.__data__;if(w){var i=t[e];return i===r?void 0:i}return m.call(t,e)?t[e]:void 0}function C(e){var t=this.__data__;return w?void 0!==t[e]:m.call(t,e)}function q(e,t){return this.__data__[e]=w&&void 0===t?r:t,this}function T(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function k(){this.__data__=[]}function A(e){var t=this.__data__,r=U(t,e);return!(r<0)&&(r==t.length-1?t.pop():_.call(t,r,1),!0)}function I(e){var t=this.__data__,r=U(t,e);return r<0?void 0:t[r][1]}function N(e){return U(this.__data__,e)>-1}function F(e,t){var r=this.__data__,i=U(r,e);return i<0?r.push([e,t]):r[i][1]=t,this}function $(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function R(){this.__data__={hash:new P,map:new(S||T),string:new P}}function D(e){return V(this,e).delete(e)}function j(e){return V(this,e).get(e)}function M(e){return V(this,e).has(e)}function L(e,t){return V(this,e).set(e,t),this}function U(e,t){for(var r=e.length;r--;)if(Y(e[r][0],t))return r;return-1}function B(e){return!(!Z(e)||H(e))&&(K(e)||u(e)?v:i).test(W(e))}function V(e,t){var r=e.__data__;return G(t)?r["string"==typeof t?"string":"hash"]:r.map}function z(e,t){var r=l(e,t);return B(r)?r:void 0}function G(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function H(e){return!!g&&g in e}function W(e){if(null!=e){try{return y.call(e)}catch{}try{return e+""}catch{}}return""}function J(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=a(function(){var i=arguments,n=t?t.apply(this,i):i[0],o=r.cache;if(o.has(n))return o.get(n);var a=e.apply(this,i);return r.cache=o.set(n,a),a},"memoized");return r.cache=new(J.Cache||$),r}function Y(e,t){return e===t||e!=e&&t!=t}function K(e){var t=Z(e)?b.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}function Z(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}a(P,"Hash"),a(O,"hashClear"),a(x,"hashDelete"),a(E,"hashGet"),a(C,"hashHas"),a(q,"hashSet"),P.prototype.clear=O,P.prototype.delete=x,P.prototype.get=E,P.prototype.has=C,P.prototype.set=q,a(T,"ListCache"),a(k,"listCacheClear"),a(A,"listCacheDelete"),a(I,"listCacheGet"),a(N,"listCacheHas"),a(F,"listCacheSet"),T.prototype.clear=k,T.prototype.delete=A,T.prototype.get=I,T.prototype.has=N,T.prototype.set=F,a($,"MapCache"),a(R,"mapCacheClear"),a(D,"mapCacheDelete"),a(j,"mapCacheGet"),a(M,"mapCacheHas"),a(L,"mapCacheSet"),$.prototype.clear=R,$.prototype.delete=D,$.prototype.get=j,$.prototype.has=M,$.prototype.set=L,a(U,"assocIndexOf"),a(B,"baseIsNative"),a(V,"getMapData"),a(z,"getNative"),a(G,"isKeyable"),a(H,"isMasked"),a(W,"toSource"),a(J,"memoize"),J.Cache=$,a(Y,"eq"),a(K,"isFunction"),a(Z,"isObject"),t.exports=J}),h=s((e,t)=>{function r(e,t){var r,i,n,o,a,s,l,u;for(r=3&e.length,i=e.length-r,n=t,a=3432918353,s=461845907,u=0;u<i;)l=255&e.charCodeAt(u)|(255&e.charCodeAt(++u))<<8|(255&e.charCodeAt(++u))<<16|(255&e.charCodeAt(++u))<<24,++u,n=27492+(65535&(o=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+(((o>>>16)+58964&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return n^=e.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0}a(r,"murmurhash3_32_gc"),typeof t<"u"&&(t.exports=r)}),f=s((e,t)=>{function r(e,t){for(var r,i=e.length,n=t^i,o=0;i>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}a(r,"murmurhash2_32_gc"),void 0!==typeof t&&(t.exports=r)}),g=s((e,t)=>{var r=h(),i=f();t.exports=r,t.exports.murmur3=r,t.exports.murmur2=i}),y=s((e,t)=>{var r={PAR_OPEN:"(".charCodeAt(0),PAR_CLOSE:")".charCodeAt(0),OP_NOT:"!".charCodeAt(0),BINARY_AND:"&".charCodeAt(0),BINARY_OR:"|".charCodeAt(0),LITERAL:"LITERAL",END:"END",LEAF:"LEAF",ATOMIC:"ATOMIC"};t.exports=r}),m=s((e,t)=>{var r=y(),i=a(e=>{let t="",i=[];for(let n of e){let e=n.charCodeAt(0);switch(e){case r.PAR_OPEN:case r.PAR_CLOSE:case r.OP_NOT:case r.BINARY_AND:case r.BINARY_OR:t&&(i.push({type:r.LITERAL,value:t}),t=""),i.push({type:e,value:n});break;default:t+=n}}return t&&i.push({type:r.LITERAL,value:t}),i},"Tokenizer");t.exports=i}),b=s((e,t)=>{var r=y(),i=a(e=>{let t=[],i=[];return e.forEach(e=>{switch(e.type){case r.LITERAL:t.unshift(e);break;case r.BINARY_AND:case r.BINARY_OR:case r.OP_NOT:case r.PAR_OPEN:i.push(e);break;case r.PAR_CLOSE:for(;i.length&&i[i.length-1].type!==r.PAR_OPEN;)t.unshift(i.pop());i.pop(),i.length&&i[i.length-1].type===r.OP_NOT&&t.unshift(i.pop())}}),i.length&&[...i.reverse(),...t]||t},"PolishNotation"),n=a(function*(e){for(let t=0;t<e.length-1;t++)yield e[t];return e[e.length-1]},"PolishGenerator");t.exports={PolishNotation:i,PolishGenerator:n}}),v=s((e,t)=>{var r=y(),i=class{constructor(e,t,r,i){this.op=e,this.left=t,this.right=r,this.literal=i}isLeaf(){return this.op===r.LEAF}isAtomic(){return this.isLeaf()||this.op===r.OP_NOT&&this.left.isLeaf()}getLiteralValue(){return this.literal}static CreateAnd(e,t){return new i(r.BINARY_AND,e,t)}static CreateNot(e){return new i(r.OP_NOT,e)}static CreateOr(e,t){return new i(r.BINARY_OR,e,t)}static CreateLiteral(e){return new i(r.LEAF,null,null,e)}};a(i,"ExpNode");var n=a(e=>{let t=e.next().value;switch(t.type){case r.LITERAL:return i.CreateLiteral(t.value);case r.OP_NOT:return i.CreateNot(n(e));case r.BINARY_AND:{let t=n(e),r=n(e);return i.CreateAnd(t,r)}case r.BINARY_OR:{let t=n(e),r=n(e);return i.CreateOr(t,r)}}return null},"make"),o=a((e,t)=>e.isLeaf()?t(e.getLiteralValue()):e.op===r.OP_NOT?!o(e.left,t):e.op===r.BINARY_OR?o(e.left,t)||o(e.right,t):e.op===r.BINARY_AND?o(e.left,t)&&o(e.right,t):void 0,"nodeEvaluator");t.exports={make:n,nodeEvaluator:o}}),_=s((e,t)=>{var r=m(),i=b(),n=v(),o=a((e,t)=>{let o=r(e),a=i.PolishNotation(o),s=i.PolishGenerator(a),l=n.make(s);return n.nodeEvaluator(l,t)},"parse");t.exports={parse:o}}),S={};function w(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}l(S,{addOptinChangedCallback:()=>Pu,addTemplate:()=>Ou,autoInit:()=>zu,clear:()=>xu,config:()=>Eu,default:()=>Gu,disableOptinChangedCallbacks:()=>Cu,getOptins:()=>qu,getProductsForPurchasePost:()=>Tu,initialize:()=>ku,isReady:()=>wu,offers:()=>Su,platform:()=>ct,previewMode:()=>Au,register:()=>Iu,resolveSettings:()=>Nu,setAuthUrl:()=>Fu,setBenefitMessages:()=>$u,setEnvironment:()=>Ru,setLocale:()=>Du,setMerchantId:()=>ju,setPublicPath:()=>Mu,setTemplates:()=>Lu,setupCart:()=>Uu,setupProduct:()=>Bu,setupProducts:()=>Vu,store:()=>_u}),a(w,"symbolObservablePonyfill");var P=w(typeof self<"u"?self:typeof window<"u"||typeof window<"u"?window:typeof module<"u"?module:Function("return this")()),O=a(function(){return Math.random().toString(36).substring(7).split("").join(".")},"randomString"),x={INIT:"@@redux/INIT"+O(),REPLACE:"@@redux/REPLACE"+O(),PROBE_UNKNOWN_ACTION:a(function(){return"@@redux/PROBE_UNKNOWN_ACTION"+O()},"PROBE_UNKNOWN_ACTION")};function E(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function C(e,t,r){var i;if("function"==typeof t&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof t&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if("function"!=typeof r)throw new Error("Expected the enhancer to be a function.");return r(C)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var n=e,o=t,s=[],l=s,u=!1;function c(){l===s&&(l=s.slice())}function d(){if(u)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function p(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(u)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return c(),l.push(e),a(function(){if(t){if(u)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,c();var r=l.indexOf(e);l.splice(r,1),s=null}},"unsubscribe")}function h(e){if(!E(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(typeof e.type>"u")throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(u)throw new Error("Reducers may not dispatch actions.");try{u=!0,o=n(o,e)}finally{u=!1}for(var t=s=l,r=0;r<t.length;r++){(0,t[r])()}return e}function f(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");n=e,h({type:x.REPLACE})}function g(){var e,t=p;return(e={subscribe:a(function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function r(){e.next&&e.next(d())}return a(r,"observeState"),r(),{unsubscribe:t(r)}},"subscribe")})[P]=function(){return this},e}return a(c,"ensureCanMutateNextListeners"),a(d,"getState"),a(p,"subscribe"),a(h,"dispatch"),a(f,"replaceReducer"),a(g,"observable"),h({type:x.INIT}),(i={dispatch:h,subscribe:p,getState:d,replaceReducer:f})[P]=g,i}function q(e,t){var r=t&&t.type;return"Given "+(r&&'action "'+String(r)+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function T(e){Object.keys(e).forEach(function(t){var r=e[t];if(typeof r(void 0,{type:x.INIT})>"u")throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(typeof r(void 0,{type:x.PROBE_UNKNOWN_ACTION()})>"u")throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+x.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}function k(e){for(var t=Object.keys(e),r={},i=0;i<t.length;i++){var n=t[i];"function"==typeof e[n]&&(r[n]=e[n])}var o,s=Object.keys(r);try{T(r)}catch(e){o=e}return a(function(e,t){if(void 0===e&&(e={}),o)throw o;for(var i=!1,n={},a=0;a<s.length;a++){var l=s[a],u=r[l],c=e[l],d=u(c,t);if(typeof d>"u"){var p=q(l,t);throw new Error(p)}n[l]=d,i=i||d!==c}return(i=i||s.length!==Object.keys(e).length)?n:e},"combination")}function A(e,t){return function(){return t(e.apply(this,arguments))}}function I(e,t){if("function"==typeof e)return A(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var r={};for(var i in e){var n=e[i];"function"==typeof n&&(r[i]=A(n,t))}return r}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function F(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e)),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r}function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?F(r,!0).forEach(function(t){N(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function R(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}function D(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),i=a(function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},"dispatch"),n={getState:r.getState,dispatch:a(function(){return i.apply(void 0,arguments)},"dispatch")},o=t.map(function(e){return e(n)});return $({},r,{dispatch:i=R.apply(void 0,o)(r.dispatch)})}}}function j(e){return a(function(t){var r=t.dispatch,i=t.getState;return function(t){return function(n){return"function"==typeof n?n(r,i,e):t(n)}}},"middleware")}a(E,"isPlainObject"),a(C,"createStore"),a(q,"getUndefinedStateErrorMessage"),a(T,"assertReducerShape"),a(k,"combineReducers"),a(A,"bindActionCreator"),a(I,"bindActionCreators"),a(N,"_defineProperty"),a(F,"ownKeys"),a($,"_objectSpread2"),a(R,"compose"),a(D,"applyMiddleware"),a(j,"createThunkMiddleware");var M=j();M.withExtraArgument=j;var L=M,U=c(d()),B=/^og_auth=/,V=a((e=B)=>(document.cookie.split(/;\s*/).find(t=>t.match(e))||"").replace(B,""),"c"),z=a(e=>{if("object"==typeof e)return e;let t=String(e||"").split("|");return 3===t.length?{sig_field:t[0],ts:parseInt(t[1],10),sig:t[2]}:null},"r"),G=a(e=>new Promise((t,r)=>{let i=document.createElement("iframe");i.style.setProperty("display","none","important"),document.body.appendChild(i),i.onload=t,i.onerror=r,i.src=e}),"p"),H=a(e=>-1!==(e.headers.get("content-type")||"").indexOf("application/json"),"d");function W(){return typeof window.og_auth<"u"?z(window.og_auth):null}async function J(e=100){return new Promise(t=>{setTimeout(()=>t(W()),e)})}async function Y(e,t=V,r=G){let i;if(i=z(W())||z(t()),i)return i;if(e&&"string"==typeof e){let n=await fetch(e);n.status>=200&&n.status<300&&(i=t()||await(H(n)?n.json():Promise.resolve(r(e)).then(t)))}else i||(i=await J());if(i=z(i),i)return i;throw new Error("Unauthorized")}a(W,"a"),a(J,"f"),a(Y,"u");var K="OPTIN_PRODUCT",Z="OPTOUT_PRODUCT",Q="PRODUCT_CHANGE_FREQUENCY",X="PRODUCT_CHANGE_PREPAID_SHIPMENTS",ee="SET_MERCHANT_ID",te="REQUEST_OFFER",re="RECEIVE_OFFER",ie="PRODUCT_HAS_CHANGED",ne="CREATED_SESSION_ID",oe="SET_AUTH_URL",ae="AUTHORIZE",se="UNAUTHORIZED",le="RECEIVE_ORDERS",ue="CART_PRODUCT_KEY_HAS_CHANGED",ce="RECEIVE_ORDER_ITEMS",de="SET_ENVIRONMENT_LOCAL",pe="SET_ENVIRONMENT_STAGING",he="SET_ENVIRONMENT_DEV",fe="SET_ENVIRONMENT_PROD",ge="READY",ye="CREATE_ONE_TIME",me="CONVERT_ONE_TIME",be="CHECKOUT",ve="SET_LOCALE",_e="SET_CONFIG",Se="SET_BENEFIT_MESSAGES",we="SET_PREVIEW_STANDARD_OFFER",Pe="SET_PREVIEW_UPSELL_OFFER",Oe="ADD_TEMPLATE",xe="SET_TEMPLATES",Ee="LOCAL_STORAGE_CHANGE",Ce="LOCAL_STORAGE_CLEAR",qe="SET_FIRST_ORDER_PLACE_DATE",Te="SET_PRODUCT_TO_SUBSCRIBE",ke="RECEIVE_PRODUCT_PLANS",Ae="SETUP_PRODUCT",Ie="SETUP_CART",Ne="RECEIVE_MERCHANT_SETTINGS",Fe="SET_EXPERIMENT_VARIANT",$e="pdp",Re="staging",De="prod",je="static.ordergroove.com",Me="staging.static.ordergroove.com",Le="PSI",Ue="PROGRAM_WIDE",Be="prepaid",Ve=c(p()),ze=a((...e)=>JSON.stringify(e),"memoizeKey"),Ge=a(e=>(...t)=>fetch(...e(...t)).then(e=>e.json()),"withFetchJson"),He=a(e=>(t,...r)=>{if(!t)throw Error("host required");let[i,n={}]=e(...r);return[`${t.replace(/\/+$/,"")}${i}`,n]},"withHost"),We=a(e=>(t,...r)=>{if(!t)throw Error("auth required");let[i,n={}]=e(...r);return[i,{...n,headers:{Authorization:JSON.stringify(t),...n.headers}}]},"withAuth"),Je=a(e=>(...t)=>{let[r,i={}]=e(...t);return[r,{method:"POST",...i,body:JSON.stringify(i.body),headers:{"Content-type":"application/json",...i.headers}}]},"withJsonBody"),Ye=a((e=[])=>(Array.isArray(e)?e:Object.entries(e)).map(([e,t])=>[e,encodeURIComponent(t)].join("=")).join("&"),"toQuery"),Ke=a(e=>JSON.stringify([].concat(e).map(e=>"object"==typeof e?e.id:e).filter(e=>e)),"toProductId"),Ze=(0,Ve.default)(Ge(He((e,t,r,i="pdp",n={})=>{if(!e)throw Error("merchantId required");if(!t)throw Error("sessionId required");if(!r)throw Error("product required");let o=[["session_id",t],["page_type",1],["p",Ke(r)],["module_view",JSON.stringify(["regular"])],...Object.entries(n)];return[`/offer/${e}/${i}?${Ye(o)}`]})),ze),Qe=(0,Ve.default)(Ge(He(We((e=1,t="place")=>[`/orders/?${Ye([["status",e],["ordering",t],["exclude_prepaid_orders","true"]])}`]))),ze),Xe=(0,Ve.default)(Ge(He(We(e=>{if(!e)throw Error("orderId required");return[`/items/?order=${e}`]}))),ze),et=Ge(He(We(Je((e,t,r,i)=>{if(!e)throw Error("product required");if(!t)throw Error("order required");if(!r)throw Error("quantity required");if(r<=0)throw Error("quantity must be greater or equal than one");if(!i)throw Error("offer required");return["/items/iu/",{body:{product:e,order:t,quantity:r,offer:i}}]})))),tt=a(e=>{if("object"==typeof e)return{...e};let[t,r]=(e||"").split(/_/).map(e=>parseInt(e,10));return t&&r&&{every:t,every_period:r}},"parseFrequency"),rt=a(e=>e.match(/^\d+_\d$/),"isFrequencyValid"),it=a((e,t)=>String.prototype.localeCompare.call(e&&e.split("_").reverse().join("_"),t&&t.split("_").reverse().join("_")),"compareFrequencies"),nt=a(e=>[...new Set(e&&e.split(/\s+/))].filter(rt).sort(it),"parseFrequenciesList"),ot=a(e=>{if("object"==typeof e){let{every:t,period:r,every_period:i}=e;return`${t}_${r||i}`}return"string"==typeof e?e:""},"stringifyFrequency"),at=Ge(He(We(Je((e,t,r,i)=>{if(!e)throw Error("item required");if(!t)throw Error("frequency required");let n=tt(t);if(!n)throw Error("invalid frequency");return["/subscriptions/create_from_item/",{body:{item:e.public_id,offer:r,session_id:i,...n}}]})))),st={fetchOffer:Ze,fetchOrders:Qe,fetchItems:Xe,createOneTime:et,convertOneTimeToSubscription:at},lt=st,ut=cr(),ct={shopify:void 0!==window.Shopify,shopify_selling_plans:void 0!==(null==ut?void 0:ut.dataset.shopifySellingPlans)};function dt(e,t){return e===t}function pt(e,t,r){if(null===t||null===r||t.length!==r.length)return!1;for(var i=t.length,n=0;n<i;n++)if(!e(t[n],r[n]))return!1;return!0}function ht(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dt,r=null,i=null;return function(){return pt(t,r,arguments)||(i=e.apply(null,arguments)),r=arguments,i}}function ft(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var r=t.map(function(e){return typeof e}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+r+"]")}return t}function gt(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return function(){for(var t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];var o=0,a=i.pop(),s=ft(i),l=e.apply(void 0,[function(){return o++,a.apply(null,arguments)}].concat(r)),u=e(function(){for(var e=[],t=s.length,r=0;r<t;r++)e.push(s[r].apply(null,arguments));return l.apply(null,e)});return u.resultFunc=a,u.dependencies=s,u.recomputations=function(){return o},u.resetRecomputations=function(){return o=0},u}}a(dt,"defaultEqualityCheck"),a(pt,"areArgumentsShallowlyEqual"),a(ht,"defaultMemoize"),a(ft,"getDependencies"),a(gt,"createSelectorCreator");var yt=gt(ht),mt=c(p()),bt=a((e,t)=>null===e?"":new Intl.NumberFormat(navigator.language,{style:"currency",currency:t}).format(e/100),"money"),vt=a(e=>`${e}%`,"percentage"),_t=a((e=[])=>e.find(Pt)||e.find(wt)||e.find(Ot),"getPayAsYouGoSellingPlanGroup"),St=a((e=[])=>e.filter(e=>wt(e)||Pt(e)||Ot(e)),"getPayAsYouGoSellingPlanGroups"),wt=a(e=>"Subscribe and Save"===e.name||"ordergroove-subscribe-and-save"===e.app_id,"isDefaultSellingPlanGroup"),Pt=a(e=>e.name.startsWith("og_psfl")||"ordergroove-product-specific-frequency-list"===e.app_id,"isProductSpecificFrequencySellingPlanGroup"),Ot=a(e=>{var t;return null==(t=e.app_id)?void 0:t.startsWith("ordergroove-subscribe-and-save-")},"isExperimentSellingPlanGroup"),xt=a(e=>{let t=_t(e.map(e=>e.group));return e.find(e=>e.group===t)},"getPayAsYouGoSellingPlan");function Et(e){var t;return null==(t=null==e?void 0:e.selling_plans)?void 0:t.map(({id:e})=>`${e}`)}function Ct(e){var t;return null==(t=null==e?void 0:e.selling_plans)?void 0:t.map(({options:e})=>e||[]).flat().map(({value:e})=>qt(e))}function qt(e){let t=["day","week","month"].findIndex(t=>e.toLowerCase().includes(t))+1,r=(e.match(/(\d+)/)||["",1])[1];return r&&t?`${r}_${t}`:null}function Tt(e){var t;let r=null==(t=null==e?void 0:e.options.find(({name:e})=>"Shipment amount"===e))?void 0:t.value.split(" ")[0];return r?Number(r):void 0}function kt(e){return e[1]||e[0]}function At(e,t){if(e===t)return!0;if(null===e||null===t||e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0}function It(e,t,r){let i=ot(r);return ct.shopify_selling_plans?Sr(e,t,i):i}a(Et,"sellingPlansToFrequencies"),a(Ct,"sellingPlansToEveryPeriod"),a(qt,"textToFreq"),a(Tt,"getPrepaidShipments"),a(kt,"getDefaultPrepaidOption"),mt.default.Cache=Map,a(At,"arraysEqual"),a(It,"resolveFrequency");var Nt=a((e,t)=>!(e!==t&&("object"!=typeof e||"object"!=typeof t||!e||!t||e.id!==t.id||Array.isArray(e.components)&&Array.isArray(t.components)&&!At((e.components||[]).sort(),(t.components||[]).sort()))),"isSameProduct"),Ft=a(e=>e.optedin||[],"optedinSelector"),$t=a(e=>e.optedout||[],"optedoutSelector"),Rt=a(e=>e.autoshipByDefault||{},"autoshipSelector"),Dt=a(e=>e.defaultFrequencies||{},"defaultFrequenciesSelector"),jt=a(e=>{var t;return(null==(t=null==e?void 0:e.config)?void 0:t.prepaidSellingPlans)||[]},"prepaidSellingPlansSelector"),Mt=a(e=>(null==e?void 0:e.prepaidShipmentsSelected)||{},"prepaidShipmentsSelectedSelector"),Lt=(0,mt.default)(e=>yt(Ft,$t,Rt,(t,r,i)=>t.find(t=>Nt(e,t))||!r.find(t=>Nt(e,t))&&(!(!e||!i[e.id])&&{id:e.id})),e=>JSON.stringify(e)),Ut=(0,mt.default)(e=>yt(Ft,t=>t.find(t=>Nt(e,t))||!1),e=>JSON.stringify(e)),Bt=(0,mt.default)(e=>yt(Ft,t=>t.some(t=>Nt(e,t)&&t.prepaidShipments)),e=>JSON.stringify(e)),Vt=(0,mt.default)(e=>yt(Mt,t=>t[e.id]||null),e=>JSON.stringify(e)),zt=(0,mt.default)(e=>yt($t,t=>t.find(t=>Nt(e,t)))),Gt=(0,mt.default)(e=>yt(Lt(e),e=>e&&"frequency"in e&&e.frequency||null),e=>JSON.stringify(e)),Ht=(0,mt.default)(e=>yt(Lt(e),e=>e&&"prepaidShipments"in e&&e.prepaidShipments||null),e=>JSON.stringify(e)),Wt=(0,mt.default)(e=>yt(jt,t=>{var r;return((null==(r=t[pr(e)])?void 0:r.map(({numberShipments:e})=>e))||[]).sort((e,t)=>e-t)})),Jt=(0,mt.default)(e=>yt(Dt,Zt(e),(t,{frequencies:r=[],frequenciesEveryPeriod:i=[]})=>t[pr(e)]&&It(r,i,t[pr(e)])||null)),Yt=(0,mt.default)(e=>yt(Zt(e),e=>e.frequencies)),Kt=(0,mt.default)(e=>yt(Zt(e),e=>e.defaultFrequency)),Zt=(0,mt.default)(e=>yt(e=>{var t;return null==(t=null==e?void 0:e.config)?void 0:t.productFrequencies},e=>{var t;return null==(t=null==e?void 0:e.config)?void 0:t.frequencies},e=>{var t;return null==(t=null==e?void 0:e.config)?void 0:t.frequenciesEveryPeriod},e=>{var t;return null==(t=null==e?void 0:e.config)?void 0:t.frequenciesText},e=>{var t;return null==(t=null==e?void 0:e.config)?void 0:t.defaultFrequency},(t,r,i,n,o)=>t?t[pr(e)]||{}:{frequencies:r,frequenciesEveryPeriod:i,frequenciesText:n,defaultFrequency:o})),Qt=a((e,t)=>yt(jt,Zt(e.id),(r,{frequencies:i})=>{var n;if(t){let i=null==(n=r[pr(e.id)])?void 0:n.find(e=>e.numberShipments===t);return i?i.sellingPlan:null}return i[0]}),"makeFrequencyForPrepaidShipmentsSelector"),Xt=a(e=>yt(jt,t=>t[pr(e)]||[]),"makePrepaidSellingPlansSelector"),er=(0,mt.default)(e=>yt(e=>e.price||{},e=>e.incentives||{},e=>e.config.storeCurrency,e=>{var t;return null==(t=e.config.merchantSettings)?void 0:t.round_up_totals},(t,r,i,n)=>{let o=t[pr(e)];if(null==o||!i)return{};let a=o.value,s=a,l=a,u=r[pr(e)],c=null==u?void 0:u.initial.find(rr),d="",p=n?Math.ceil:Math.round;return c&&("Discount Percent"===c.type?(l=p(a*(100-c.value)/100),d=vt(c.value)):"Discount Amount"===c.type&&"USD"===i&&(l=Math.max(0,a-Math.round(100*c.value)))),{regularPrice:bt(s,i),subscriptionPrice:bt(l,i),discountRate:d||bt(s-l,i)}})),tr=[Ue,Le];function rr(e){return"item"===e.object&&("Discount Percent"===e.type||"Discount Amount"===e.type)&&e.criteria&&"PREMISE"===e.criteria.node_type&&tr.includes(e.criteria.standard)}a(rr,"findRelevantIncentive");var ir=a(e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),"kebabCase"),nr=a((e,t,r)=>e&&e.hasAttribute&&e.hasAttribute(ir(t))&&e[t]||e.offer&&typeof("undefined"!==e.offer[t])&&e.offer[t]||r,"getFallbackValue"),or=a(e=>({templates:e.templates||[]}),"templatesSelector"),ar=a(e=>{let t=Object.values(e.productPlans).flat();return t.length>0&&t.every(e=>!1===e.hasPriceAdjustments||e.prepaidShipments)},"isShopifyDiscountFunctionInUseSelector"),sr=a(e=>{if(!e||"object"!=typeof e)return null;let t="en-US",r=(null==navigator?void 0:navigator.language)||t,i=r.split("-")[0],n=Object.keys(e).find(e=>e!==r&&e.split("-")[0]===i),o=e[r]||e[n]||e[t];return"string"==typeof o&&o.length>0?o:null},"resolveLocaleMessage"),lr=(0,mt.default)(e=>yt(t=>(t.incentives||{})[pr(null==e?void 0:e.id)],e=>{var t,r;return(null==(r=null==(t=e.benefitMessages)?void 0:t.channels)?void 0:r.offers)||{}},(e,t)=>{var r;if(!e)return{messages:[]};let i=null==(r=null==window?void 0:window.og)?void 0:r.previewMode,n=new Set,o=new Set;return[e.initial,e.ongoing].forEach(e=>{(e||[]).forEach(e=>{if(!(i||null!=e&&e.enhanced))return;let r=e.id;if(!r||n.has(r))return;n.add(r);let a=sr(t[r]);!a||o.add(a)})}),{messages:[...o]}}),e=>JSON.stringify(e));function ur(e){"loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e()}function cr(){return document.querySelector([`script[src^="https://${je}"]`,`script[src^="https://${Me}"]`,`script[src^="http://${je}"]`,`script[src^="http://${Me}"]`].join(","))}function dr(){let e=cr();if(!e)return[];let t=new URL(e.src),r=t.host.startsWith(Re)?Re:De,i=t.pathname.split("/")[1];return r||i?[i,r,e]:[]}a(ur,"onReady"),a(cr,"getMainJs"),a(dr,"resolveEnvAndMerchant");var pr=a(e=>{var t;if(!e)return"";let r=`${e.id||e}`;return null!=(t=ct)&&t.shopify_selling_plans&&(r=r.split(":")[0]),r},"safeProductId"),hr=a((e,t,r)=>{if(ct.shopify_selling_plans){let i=null==t?void 0:t.indexOf(e);if(i>=0&&r[i])return r[i]}return e},"safeOgFrequency"),fr=a((e,t)=>{if(!`${e}`.includes("_"))return e;let{frequencies:r,frequenciesEveryPeriod:i}=t,n=null==i?void 0:i.indexOf(e);return n>=0&&i[n]?r[n]:(null==r?void 0:r.length)>0&&(null==i?void 0:i.length)>0?(console.warn(`Unable to find selling plan match for frequency ${e}; falling back to first selling plan`),r[0]):e},"frequencyToSellingPlan");function gr(e){if(e.isReady())return;console.info("OG offers are auto initializing");let[t,r]=dr();if(!r&&!t)return;let i=document.createElement("script");i.onload=()=>console.info("OG pull initialization chunk for merchant",t,r),i.onerror=()=>e.initialize(t,r),i.src=`${window.location.protocol}//${r===De?je:Me}/${t}/main.js?initOnly=true`,document.head.appendChild(i)}a(gr,"autoInitializeOffers");var yr=a(e=>{document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`},"clearCookie");function mr(e){let t=document.cookie.match(`(^|;) ?${e}=([^;]*)(;|$)`);return t?t[2]:null}a(mr,"getCookieValue");var br=a(e=>!(!e||!(null==e?void 0:e.includes("_"))),"isOgFrequency"),vr=a((e=[])=>(null==e?void 0:e[0])||null,"getFirstSellingPlan"),_r=a((e=[],t=[])=>{var r;return!!((null==(r=ct)?void 0:r.shopify_selling_plans)&&e.length&&t.length)},"hasShopifySellingPlans"),Sr=a((e,t,r)=>{if(e.length!==t.length)return null;let i=t.findIndex(e=>e===r);return i>=0?e[i]:null},"mapFrequencyToSellingPlan");function wr(e,t,r){let i=e.querySelector(`[name="${t}"]`);!i||r?(!i&&r&&(i=document.createElement("input"),i.type="hidden",i.name=t,e.appendChild(i)),i&&(i.value=r)):i.remove()}function Pr(e,t){let[[r],i]=e.reduce((e,r)=>e[Nt(t,r)?0:1].push(r)&&e,[[],[]]);return[r||{},i||[]]}a(wr,"getOrCreateHidden"),a(Pr,"getMatchingProductIfExists");var Or=a((e,t,r)=>({type:K,payload:{product:e,frequency:t,offer:r}}),"optinProduct"),xr=a((e,t)=>({type:Z,payload:{product:e,offer:t}}),"optoutProduct"),Er=a((e,t)=>({type:ie,payload:{newProduct:e,product:t}}),"productHasChangedComponents"),Cr=a((e,t,r)=>({type:Q,payload:{product:e,frequency:t,offer:r}}),"productChangeFrequency"),qr=a((e,t,r)=>(i,n)=>{let o=Qt(e,t)(n());i({type:X,payload:{product:e,prepaidShipments:t,offer:r,frequency:o}})},"productChangePrepaidShipments"),Tr=a(e=>({type:"CONCLUDE_UPSELL",payload:{product:e}}),"concludeUpsell"),kr=a(e=>({type:ee,payload:e}),"setMerchantId"),Ar=a(e=>({type:ne,payload:`${e}.${Math.floor(999999*Math.random())}.${Math.round((new Date).getTime()/1e3)}`}),"createSessionId"),Ir=a(e=>({type:"REQUEST_AUTH",payload:e}),"requestAuth"),Nr=a((e,t,r,i)=>({type:ae,payload:{public_id:e,sig_field:t,ts:r,sig:i}}),"authorize"),Fr=a(e=>({type:se,payload:e}),"unauthorized"),$r=a(e=>({type:oe,payload:e}),"setAuthUrl"),Rr=a(e=>({type:"RECEIVE_FETCH",payload:e}),"fetchDone"),Dr=a((e=Y)=>a(function(t,r){if(window.og&&window.og.previewMode)return t(Fr({message:"Offers are running in preview mode"}));let{merchantId:i,authUrl:n}=r(),o=Ir(n);return t(o),e(n).then(({sig_field:e,ts:r,sig:n})=>t(Nr(i,e,r,n)),e=>t(Fr(e))).finally(()=>t(Rr(o)))},"fetchAuthThunk"),"fetchAuth"),jr=a((e,t)=>({type:"REQUEST_ORDERS",payload:{status:e,ordering:t}}),"requestOrders"),Mr=a(e=>({type:le,payload:e}),"receiveOrders"),Lr=a(e=>({type:ce,payload:e}),"receiveItems"),Ur=a((e=1,t="place")=>a(function(r,i){let{environment:{legoUrl:n},auth:o}=i();if(!o)return r(Fr("No auth set."));let a=jr(e,t);return r(a),st.fetchOrders(n,o,e,t).then(e=>{if(e.results){r(Mr(e));let t=(e.results[0]||{}).public_id;if(t)return st.fetchItems(n,o,t).then(e=>r(Lr(e)))}return r(Fr(e.detail)),null},e=>r(Fr(e))).finally(()=>r(Rr(a)))},"fetchOrdersThunk"),"fetchOrders"),Br=a(e=>{switch(e){case"local":return{type:de,payload:e};case"dev":return{type:he,payload:e};case Re:return{type:pe,payload:e};case De:return{type:fe,payload:e};default:throw new Error(`${e} is not a supported environment`)}},"setEnvironment"),Vr=a(()=>(e,t)=>{let{merchantId:r,sessionId:i}=t();return(!i||r&&!i.startsWith(r))&&e(Ar(r)),i},"requestSessionId"),zr=a((e,t,r)=>(i,n)=>{let o=n(),a=Zt(r)(o),s=Xt(r)(o);i({type:re,payload:{...e,offer:t,frequencyConfig:a,prepaidSellingPlans:s}})},"receiveOffer"),Gr=a(e=>({type:"FETCH_RESPONSE_ERROR",payload:e}),"fetchResponseError"),Hr=a((e,t=$e,r)=>({type:te,payload:{product:e,module:t,offer:r}}),"requestOffer"),Wr=Hr,Jr=a(()=>({type:be}),"checkout"),Yr=a((e,t,r,i)=>({type:"REQUEST_CREATE_IU_ORDER",payload:{product:e,order:t,quantity:r,offerId:i}}),"requestCreateOneTime"),Kr=a(e=>({type:ye,payload:e}),"receiveCreateOneTime"),Zr=a((e,t)=>({type:"REQUEST_CONVERT_ONE_TIME",payload:{item:e,frequency:t}}),"requestConvertOneTimeToSubscription"),Qr=a((e,t)=>({type:me,payload:{response:e,product:t}}),"receiveConvertOneTime"),Xr=a((e,t,r,i=!1,n=null)=>a(function(o,a){let s=a(),{auth:l,environment:{legoUrl:u},previewUpsellOffer:c,offerId:d,sessionId:p}=s;if(!l)return o(Fr("No auth set."));let{frequencies:h,frequenciesEveryPeriod:f}=Zt(e.id)(s),g=hr(n,h,f),y=Yr(e,t,r,d);return o(y),(c?Promise.resolve({legoUrl:u,product:e,order:t,quantity:r,offer:d}):st.createOneTime(u,l,e.id,t,r,d)).then(t=>(o(Kr(t)),i?(o(Zr(t,g)),(c?Promise.resolve({item:t,frequency:g}):st.convertOneTimeToSubscription(u,l,t,g,d,p)).then(t=>o(Qr(t,e)),e=>o(Gr(e)))):t),e=>o(Gr(e))).finally(()=>o(Rr(y)))},"createIuThunk"),"createIu"),ei=a(e=>({type:ve,payload:e}),"setLocale"),ti=a(e=>({type:_e,payload:e}),"setConfig"),ri=a(e=>({type:Se,payload:e}),"setBenefitMessages"),ii=a((e,t,r)=>({type:Oe,payload:{selector:e,markup:t,config:r}}),"addTemplate"),ni=a(e=>({type:xe,payload:e}),"setTemplates"),oi=a((e,t)=>({type:qe,payload:{product:e,firstOrderPlaceDate:t}}),"setFirstOrderPlaceDate"),ai=a((e,t)=>({type:Te,payload:{product:e,productToSubscribe:t}}),"setProductToSubscribe"),si=a(e=>({type:Ne,payload:e}),"receiveMerchantSettings"),li="OG_STATE",ui=a(e=>{try{return null===e?void 0:JSON.parse(e)}catch{return}},"safeParseState"),ci=a(()=>window.og&&window.og.previewMode,"isPreviewMode"),di=a(()=>ci()?{}:ui(localStorage.getItem(li)),"loadState"),pi=a(e=>!(!e||!e.sessionId)&&JSON.stringify({sessionId:e.sessionId,optedin:e.optedin,optedout:e.optedout,productOffer:e.productOffer,firstOrderPlaceDate:e.firstOrderPlaceDate,productToSubscribe:e.productToSubscribe}),"serializeState"),hi=a(e=>{if(ci())return;e&&e.sessionId&&(document.cookie="og_session_id="+encodeURIComponent(e.sessionId)+"; path=/; expires=Fri, 31 Dec 9999 23:59:59 GMT; SameSite=Lax");let t=pi(e);t&&localStorage.getItem(li)!==t&&localStorage.setItem(li,t)},"saveState"),fi=a(e=>(0,U.throttle)(500,t=>{if(ci())return;let{key:r,newValue:i}=t;r===li&&null===i?(e.dispatch({type:Ce}),setTimeout(()=>e.dispatch(Vr()),0)):r===li&&e.dispatch({type:Ee,newValue:ui(i)})}),"listenLocalStorageChanges"),gi=c(d()),yi=a((e,t,r=document)=>r.dispatchEvent(new CustomEvent(e,{detail:t})),"dispatchEvent"),mi=a(e=>({payload:{product:{id:t,components:r}={}}={}}={})=>setTimeout(()=>yi("optin-changed",{productId:t,components:r,optedIn:e}),0),"dispatchOptinChangedEvent"),bi=[{expressions:[({type:e}={})=>e===K,({type:e}={})=>e===Q],fn:mi(!0)},{expressions:[({type:e}={})=>e===Z],fn:mi(!1)}],vi=a(e=>t=>r=>{let i=e.getState();bi.forEach(e=>{e.expressions.some(e=>e(r,i))&&e.fn(r)}),t(r)},"dispatchMiddleware"),_i=a(e=>e=>t=>{var r;let i;switch(t.type){case re:case Z:case K:case Q:i=new CustomEvent(`og-${t.type.toLowerCase().replace(/_/g,"-")}`,{bubbles:!0,cancelable:!0,detail:t.payload}),((null==(r=t.payload)?void 0:r.offer)||document).dispatchEvent(i)}null!=i&&i.defaultPrevented||e(t)},"offerEvents"),Si=a(e=>t=>r=>{t(r);let i=(0,gi.throttle)(500,()=>{hi({...e.getState()})});r.type!==Ee&&i()},"localStorageMiddleware"),wi=a(()=>{let e,t;return[new Promise((r,i)=>{e=r,t=i}),e,t]},"waitFor");function Pi(e){let[t,r]=wi(),[i,n]=wi(),[o,a]=wi();i.then(t=>{let{sessionId:r}=e.getState();!r||t&&!r.startsWith(t)?e.dispatch(Ar(t)):a(r)});let s=Promise.all([i,t,o]);return s.then(()=>{var t;e.dispatch({type:ge,payload:{}}),window.addEventListener("storage",fi(e)),null!=(t=e.getState().auth)&&t.ts||e.dispatch(Dr())}),e=>async t=>{de===t.type||he===t.type||pe===t.type||fe===t.type?r(t.payload):ee===t.type?n(t.payload):ne===t.type?a(t.payload):await s,e(t)}}function Oi(e){return t=>r=>{if(r.type===te){let{merchantId:t,sessionId:i,environment:{apiUrl:n}}=e.getState(),o=pr(r.payload.product);o&&lt.fetchOffer(n,t,i,o,r.payload.module||$e,r.payload.searchParams).then(t=>e.dispatch(zr(t,r.payload.offer,o)),t=>e.dispatch(Gr(t))).finally(()=>e.dispatch(Rr(r)))}return t(r)}}a(Pi,"waitUntilOffersReady"),a(Oi,"offerRequestMiddleware");var xi=c(g());function Ei(e,t){100!==t.map(e=>e.weight).reduce((e,t)=>e+t,0)&&console.error("OG: Sum of weights for variants must be 100. Defaulting to last variant.");let r=xi.default.murmur3(e,0)%100,i=0;for(let e=0;e<t.length;e++){let n=t[e],o=i+n.weight;if(n.weight>0&&r<o)return e;i=o}return t.length-1}function Ci(e={},t){var r;switch(t.type){case Ne:return{...e,...t.payload.experiments};case Fe:return{...e,currentVariant:t.payload.index,offerProfileId:null==(r=t.payload.parameters)?void 0:r.offer_profile_public_id};default:return e}}function qi(e,t,r){if(!e||0===r.variants.length)return;let i=t.selling_plan_groups.filter(Ot);if(i.length!==r.variants.length)return;let n=i.find(({app_id:t})=>t.endsWith(e.public_id));return n?{...t,selling_plan_groups:[n],variants:t.variants.map(({selling_plan_allocations:e,...t})=>({...t,selling_plan_allocations:e.filter(({selling_plan_group_id:e})=>e===n.id)}))}:void 0}function Ti(e,t){let r=null==e?void 0:e.public_id;if(!r)return null;let i=e.variants,n=Ei(`${r}|${t}`,i);return{...i[n],index:n}}function ki(e){let t,r,[i,n]=wi();return o=>async a=>{if(a.type===ge)n();else if(a.type===Ne){await i,r=a.payload.experiments;let{sessionId:n}=e.getState();t=Ti(r,n),t&&e.dispatch({type:Fe,payload:t})}else if(a.type===te)await i,t&&(a.payload.searchParams={...a.payload.searchParams,variant:t.public_id});else if(a.type===Ae){await i;let e=qi(t,a.payload.product,r);if(e)return o({type:Ae,payload:{...a.payload,experiments:!0,originalPayload:a.payload,product:e}})}return o(a)}}function Ai(e,...t){if(window.og&&window.og.store)return window.og.store;let r=window.og&&window.og.previewMode,i="object"==typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({name:"Ordergroove Offers"}):R,n=[Pi,L,ki,Oi,vi,_i],o={};if(!r)try{o=di(),n.push(Si)}catch{}let a=C(e,o,i(D(...n,...t.filter(e=>e))));return window.og=window.og||{},window.og.store=a,a}a(Ei,"getVariantIx"),a(Ci,"experimentsReducer"),a(qi,"resolveShopifySetupProductWhenExperiment"),a(Ti,"getAssignedExperimentVariant"),a(ki,"experimentsMiddleware"),a(Ai,"makeStore");var Ii=Object.defineProperty,Ni=a((e,t)=>Ii(e,"name",{value:t,configurable:!0}),"i"),Fi=Ni(e=>t=>e.indexOf(t.origin)>=0,"createIsMessageAllowed"),$i=["https://rc3.ordergroove.com","https://rc3.stg.ordergroove.com","https://rc3-beta.stg.ordergroove.com","http://localhost:3000","http://localhost:3010","http://0.0.0.0:3010",window.location.origin],Ri=Ni(e=>(t,r)=>{$i.forEach(i=>e.postMessage({ogType:t,...r},i))},"createBroadcastMessage");function Di(e=window.opener,t=window.og){let r=Ni(e=>{let i=Fi($i),n=Ri(e.source),o=e.data.options||{};if(i(e)&&"READY"===e.data.ogType){let e="//static.ordergroove.com/@ordergroove/offers-live-editor/0.6.9/dist/";e.startsWith("//")&&(e=window.location.protocol+e),e.endsWith("/")||(e+="/"),import(`${e}client.js`).then(({initializeClient:e})=>{e({isMessageAllowed:i,broadcastMessage:n,options:o,og:t}),window.removeEventListener("message",r)})}},"handleReady");e&&e!==window&&(window.addEventListener("message",r),Ri(e)("READY"))}a(Di,"h"),Ni(Di,"offersLiveEditor");var ji=null,Mi=a(e=>({dispatch:e}),"defaultMapDispatchToProps"),Li=a(e=>{if(!ji)throw new Error("Missing redux store.");return ji},"resolveStore"),Ui=a((e,t)=>r=>{let{getState:i,dispatch:n}=Li(r),o=e?e(i(),r):{},a=t(n,r);Object.assign(r,o,a)},"createRecalcProps"),Bi=a((e,t=Mi)=>r=>{let i=Ui(e,"function"==typeof t?t:e=>I(t,e));return class extends r{get store(){return ji}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=Li(this).subscribe(()=>i(this)),i(this)}attributeChangedCallback(e,t,r){super.attributeChangedCallback&&super.attributeChangedCallback(e,t,r),this._storeUnsubscribe&&t!==r&&i(this)}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}}},"connect"),Vi=a(e=>{ji=e},"setStore"),zi=a((e={},t=[])=>(e.optedin||[]).map(t=>{let r={product:t.id,subscription_info:{components:t.components||[]},tracking_override:{offer:((e.productOffer||{})[t.id]||[])[0],...e.sessionId&&{session_id:e.sessionId},...tt(t.frequency)}};return e.firstOrderPlaceDate&&e.firstOrderPlaceDate[t.id]&&(r.subscription_info.first_order_place_date=e.firstOrderPlaceDate[t.id]),e.productToSubscribe&&e.productToSubscribe[t.id]&&(r.tracking_override.product=e.productToSubscribe[t.id]),r}).filter(e=>e.tracking_override.offer).filter(e=>t.length?t.includes(e.product):e),"getProductsForPurchasePost"),Gi=a((e={})=>{let t={};return Object.entries(e).forEach(([e,r])=>{Object.entries(r).forEach(([r,i])=>{let n={};n=i&&!Array.isArray(i)?i:{frequency:r,prepaidShipments:null,regularPrice:i[0],subscriptionPrice:i[2],discountRate:i[1]},t[e]?t[e].push(n):t[e]=[n]})}),t},"getObjectStructuredProductPlans"),Hi=typeof window<"u"&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,Wi=a((e,t,r=null)=>{for(;t!==r;){let r=t.nextSibling;e.removeChild(t),t=r}},"removeNodes"),Ji=`{{lit-${String(Math.random()).slice(2)}}}`,Yi=`\x3c!--${Ji}--\x3e`,Ki=new RegExp(`${Ji}|${Yi}`),Zi="$lit$",Qi=class{constructor(e,t){this.parts=[],this.element=t;let r=[],i=[],n=document.createTreeWalker(t.content,133,null,!1),o=0,a=-1,s=0,{strings:l,values:{length:u}}=e;for(;s<u;){let e=n.nextNode();if(null!==e){if(a++,1===e.nodeType){if(e.hasAttributes()){let t=e.attributes,{length:r}=t,i=0;for(let e=0;e<r;e++)Xi(t[e].name,Zi)&&i++;for(;i-- >0;){let t=l[s],r=rn.exec(t)[2],i=r.toLowerCase()+Zi,n=e.getAttribute(i);e.removeAttribute(i);let o=n.split(Ki);this.parts.push({type:"attribute",index:a,name:r,strings:o}),s+=o.length-1}}"TEMPLATE"===e.tagName&&(i.push(e),n.currentNode=e.content)}else if(3===e.nodeType){let t=e.data;if(t.indexOf(Ji)>=0){let i=e.parentNode,n=t.split(Ki),o=n.length-1;for(let t=0;t<o;t++){let r,o=n[t];if(""===o)r=tn();else{let e=rn.exec(o);null!==e&&Xi(e[2],Zi)&&(o=o.slice(0,e.index)+e[1]+e[2].slice(0,-5)+e[3]),r=document.createTextNode(o)}i.insertBefore(r,e),this.parts.push({type:"node",index:++a})}""===n[o]?(i.insertBefore(tn(),e),r.push(e)):e.data=n[o],s+=o}}else if(8===e.nodeType)if(e.data===Ji){let t=e.parentNode;(null===e.previousSibling||a===o)&&(a++,t.insertBefore(tn(),e)),o=a,this.parts.push({type:"node",index:a}),null===e.nextSibling?e.data="":(r.push(e),a--),s++}else{let t=-1;for(;-1!==(t=e.data.indexOf(Ji,t+1));)this.parts.push({type:"node",index:-1}),s++}}else n.currentNode=i.pop()}for(let e of r)e.parentNode.removeChild(e)}};a(Qi,"Template");var Xi=a((e,t)=>{let r=e.length-t.length;return r>=0&&e.slice(r)===t},"endsWith"),en=a(e=>-1!==e.index,"isTemplatePartActive"),tn=a(()=>document.createComment(""),"createMarker"),rn=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function nn(e,t){let{element:{content:r},parts:i}=e,n=document.createTreeWalker(r,133,null,!1),o=an(i),a=i[o],s=-1,l=0,u=[],c=null;for(;n.nextNode();){s++;let e=n.currentNode;for(e.previousSibling===c&&(c=null),t.has(e)&&(u.push(e),null===c&&(c=e)),null!==c&&l++;void 0!==a&&a.index===s;)a.index=null!==c?-1:a.index-l,o=an(i,o),a=i[o]}u.forEach(e=>e.parentNode.removeChild(e))}a(nn,"removeNodesFromTemplate");var on=a(e=>{let t=11===e.nodeType?0:1,r=document.createTreeWalker(e,133,null,!1);for(;r.nextNode();)t++;return t},"countNodes"),an=a((e,t=-1)=>{for(let r=t+1;r<e.length;r++){let t=e[r];if(en(t))return r}return-1},"nextActiveIndexInTemplateParts");function sn(e,t,r=null){let{element:{content:i},parts:n}=e;if(null==r)return void i.appendChild(t);let o=document.createTreeWalker(i,133,null,!1),a=an(n),s=0,l=-1;for(;o.nextNode();)for(l++,o.currentNode===r&&(s=on(t),r.parentNode.insertBefore(t,r));-1!==a&&n[a].index===l;){if(s>0){for(;-1!==a;)n[a].index+=s,a=an(n,a);return}a=an(n,a)}}a(sn,"insertNodeIntoTemplate");var ln=new WeakMap,un=a(e=>(...t)=>{let r=e(...t);return ln.set(r,!0),r},"directive"),cn=a(e=>"function"==typeof e&&ln.has(e),"isDirective"),dn={},pn={},hn=class{constructor(e,t,r){this.__parts=[],this.template=e,this.processor=t,this.options=r}update(e){let t=0;for(let r of this.__parts)void 0!==r&&r.setValue(e[t]),t++;for(let e of this.__parts)void 0!==e&&e.commit()}_clone(){let e,t=Hi?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),r=[],i=this.template.parts,n=document.createTreeWalker(t,133,null,!1),o=0,a=0,s=n.nextNode();for(;o<i.length;)if(e=i[o],en(e)){for(;a<e.index;)a++,"TEMPLATE"===s.nodeName&&(r.push(s),n.currentNode=s.content),null===(s=n.nextNode())&&(n.currentNode=r.pop(),s=n.nextNode());if("node"===e.type){let e=this.processor.handleTextExpression(this.options);e.insertAfterNode(s.previousSibling),this.__parts.push(e)}else this.__parts.push(...this.processor.handleAttributeExpressions(s,e.name,e.strings,this.options));o++}else this.__parts.push(void 0),o++;return Hi&&(document.adoptNode(t),customElements.upgrade(t)),t}};a(hn,"TemplateInstance");var fn=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:e=>e}),gn=` ${Ji} `,yn=class{constructor(e,t,r,i){this.strings=e,this.values=t,this.type=r,this.processor=i}getHTML(){let e=this.strings.length-1,t="",r=!1;for(let i=0;i<e;i++){let e=this.strings[i],n=e.lastIndexOf("\x3c!--");r=(n>-1||r)&&-1===e.indexOf("--\x3e",n+1);let o=rn.exec(e);t+=null===o?e+(r?gn:Yi):e.substr(0,o.index)+o[1]+o[2]+Zi+o[3]+Ji}return t+=this.strings[e],t}getTemplateElement(){let e=document.createElement("template"),t=this.getHTML();return void 0!==fn&&(t=fn.createHTML(t)),e.innerHTML=t,e}};a(yn,"TemplateResult");var mn=a(e=>null===e||!("object"==typeof e||"function"==typeof e),"isPrimitive"),bn=a(e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]),"isIterable"),vn=class{constructor(e,t,r){this.dirty=!0,this.element=e,this.name=t,this.strings=r,this.parts=[];for(let e=0;e<r.length-1;e++)this.parts[e]=this._createPart()}_createPart(){return new _n(this)}_getValue(){let e=this.strings,t=e.length-1,r=this.parts;if(1===t&&""===e[0]&&""===e[1]){let e=r[0].value;if("symbol"==typeof e)return String(e);if("string"==typeof e||!bn(e))return e}let i="";for(let n=0;n<t;n++){i+=e[n];let t=r[n];if(void 0!==t){let e=t.value;if(mn(e)||!bn(e))i+="string"==typeof e?e:String(e);else for(let t of e)i+="string"==typeof t?t:String(t)}}return i+=e[t],i}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}};a(vn,"AttributeCommitter");var _n=class{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==dn&&(!mn(e)||e!==this.value)&&(this.value=e,cn(e)||(this.committer.dirty=!0))}commit(){for(;cn(this.value);){let e=this.value;this.value=dn,e(this)}this.value!==dn&&this.committer.commit()}};a(_n,"AttributePart");var Sn=class{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(tn()),this.endNode=e.appendChild(tn())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=tn()),e.__insert(this.endNode=tn())}insertAfterPart(e){e.__insert(this.startNode=tn()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(null===this.startNode.parentNode)return;for(;cn(this.__pendingValue);){let e=this.__pendingValue;this.__pendingValue=dn,e(this)}let e=this.__pendingValue;e!==dn&&(mn(e)?e!==this.value&&this.__commitText(e):e instanceof yn?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):bn(e)?this.__commitIterable(e):e===pn?(this.value=pn,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){let t=this.startNode.nextSibling,r="string"==typeof(e=e??"")?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=r:this.__commitNode(document.createTextNode(r)),this.value=e}__commitTemplateResult(e){let t=this.options.templateFactory(e);if(this.value instanceof hn&&this.value.template===t)this.value.update(e.values);else{let r=new hn(t,e.processor,this.options),i=r._clone();r.update(e.values),this.__commitNode(i),this.value=r}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());let t,r=this.value,i=0;for(let n of e)t=r[i],void 0===t&&(t=new Sn(this.options),r.push(t),0===i?t.appendIntoPart(this):t.insertAfterPart(r[i-1])),t.setValue(n),t.commit(),i++;i<r.length&&(r.length=i,this.clear(t&&t.endNode))}clear(e=this.startNode){Wi(this.startNode.parentNode,e.nextSibling,this.endNode)}};a(Sn,"NodePart");var wn=class{constructor(e,t,r){if(this.value=void 0,this.__pendingValue=void 0,2!==r.length||""!==r[0]||""!==r[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=r}setValue(e){this.__pendingValue=e}commit(){for(;cn(this.__pendingValue);){let e=this.__pendingValue;this.__pendingValue=dn,e(this)}if(this.__pendingValue===dn)return;let e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=dn}};a(wn,"BooleanAttributePart");var Pn=class extends vn{constructor(e,t,r){super(e,t,r),this.single=2===r.length&&""===r[0]&&""===r[1]}_createPart(){return new On(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}};a(Pn,"PropertyCommitter");var On=class extends _n{};a(On,"PropertyPart");var xn=!1;(()=>{try{let e={get capture(){return xn=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch{}})();var En=class{constructor(e,t,r){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=r,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;cn(this.__pendingValue);){let e=this.__pendingValue;this.__pendingValue=dn,e(this)}if(this.__pendingValue===dn)return;let e=this.__pendingValue,t=this.value,r=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=null!=e&&(null==t||r);r&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=Cn(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=dn}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}};a(En,"EventPart");var Cn=a(e=>e&&(xn?{capture:e.capture,passive:e.passive,once:e.once}:e.capture),"getOptions");function qn(e){let t=Tn.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},Tn.set(e.type,t));let r=t.stringsArray.get(e.strings);if(void 0!==r)return r;let i=e.strings.join(Ji);return r=t.keyString.get(i),void 0===r&&(r=new Qi(e,e.getTemplateElement()),t.keyString.set(i,r)),t.stringsArray.set(e.strings,r),r}a(qn,"templateFactory");var Tn=new Map,kn=new WeakMap,An=a((e,t,r)=>{let i=kn.get(t);void 0===i&&(Wi(t,t.firstChild),kn.set(t,i=new Sn(Object.assign({templateFactory:qn},r))),i.appendInto(t)),i.setValue(e),i.commit()},"render"),In=class{handleAttributeExpressions(e,t,r,i){let n=t[0];return"."===n?new Pn(e,t.slice(1),r).parts:"@"===n?[new En(e,t.slice(1),i.eventContext)]:"?"===n?[new wn(e,t.slice(1),r)]:new vn(e,t,r).parts}handleTextExpression(e){return new Sn(e)}};a(In,"DefaultTemplateProcessor");var Nn=new In;typeof window<"u"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");var Fn=a((e,...t)=>new yn(e,t,"html",Nn),"html"),$n=a((e,t)=>`${e}--${t}`,"getTemplateCacheKey"),Rn=!0;typeof window.ShadyCSS>"u"?Rn=!1:typeof window.ShadyCSS.prepareTemplateDom>"u"&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),Rn=!1);var Dn=a(e=>t=>{let r=$n(t.type,e),i=Tn.get(r);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},Tn.set(r,i));let n=i.stringsArray.get(t.strings);if(void 0!==n)return n;let o=t.strings.join(Ji);if(n=i.keyString.get(o),void 0===n){let r=t.getTemplateElement();Rn&&window.ShadyCSS.prepareTemplateDom(r,e),n=new Qi(t,r),i.keyString.set(o,n)}return i.stringsArray.set(t.strings,n),n},"shadyTemplateFactory"),jn=["html","svg"],Mn=a(e=>{jn.forEach(t=>{let r=Tn.get($n(t,e));void 0!==r&&r.keyString.forEach(e=>{let{element:{content:t}}=e,r=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{r.add(e)}),nn(e,r)})})},"removeStylesFromLitTemplates"),Ln=new Set,Un=a((e,t,r)=>{Ln.add(e);let i=r?r.element:document.createElement("template"),n=t.querySelectorAll("style"),{length:o}=n;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(i,e);let a=document.createElement("style");for(let e=0;e<o;e++){let t=n[e];t.parentNode.removeChild(t),a.textContent+=t.textContent}Mn(e);let s=i.content;r?sn(r,a,s.firstChild):s.insertBefore(a,s.firstChild),window.ShadyCSS.prepareTemplateStyles(i,e);let l=s.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)t.insertBefore(l.cloneNode(!0),t.firstChild);else if(r){s.insertBefore(a,s.firstChild);let e=new Set;e.add(a),nn(r,e)}},"prepareTemplateStyles"),Bn=a((e,t,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");let i=r.scopeName,n=kn.has(t),o=Rn&&11===t.nodeType&&!!t.host,a=o&&!Ln.has(i),s=a?document.createDocumentFragment():t;if(An(e,s,Object.assign({templateFactory:Dn(i)},r)),a){let e=kn.get(s);kn.delete(s);let r=e.value instanceof hn?e.value.template:void 0;Un(i,s,r),Wi(t,t.firstChild),t.appendChild(s),kn.set(t,e)}!n&&o&&window.ShadyCSS.styleElement(t.host)},"render");window.JSCompiler_renameProperty=(e,t)=>e;var Vn={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},zn=a((e,t)=>t!==e&&(t==t||e==e),"notEqual"),Gn={attribute:!0,type:String,converter:Vn,reflect:!1,hasChanged:zn},Hn="finalized",Wn=class extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();let e=[];return this._classProperties.forEach((t,r)=>{let i=this._attributeNameForProperty(r,t);void 0!==i&&(this._attributeToPropertyMap.set(i,r),e.push(i))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;let e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t=Gn){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;let r="symbol"==typeof e?Symbol():`__${e}`,i=this.getPropertyDescriptor(e,r,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}static getPropertyDescriptor(e,t,r){return{get(){return this[t]},set(i){let n=this[e];this[t]=i,this.requestUpdateInternal(e,n,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||Gn}static finalize(){let e=Object.getPrototypeOf(this);if(e.hasOwnProperty(Hn)||e.finalize(),this[Hn]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){let e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(let r of t)this.createProperty(r,e[r])}}static _attributeNameForProperty(e,t){let r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,r=zn){return r(e,t)}static _propertyValueFromAttribute(e,t){let r=t.type,i=t.converter||Vn,n="function"==typeof i?i:i.fromAttribute;return n?n(e,r):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;let r=t.type,i=t.converter;return(i&&i.toAttribute||Vn.toAttribute)(e,r)}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){let e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,r){t!==r&&this._attributeToProperty(e,r)}_propertyToAttribute(e,t,r=Gn){let i=this.constructor,n=i._attributeNameForProperty(e,r);if(void 0!==n){let e=i._propertyValueToAttribute(t,r);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(n):this.setAttribute(n,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;let r=this.constructor,i=r._attributeToPropertyMap.get(e);if(void 0!==i){let e=r.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=r._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,t,r){let i=!0;if(void 0!==e){let n=this.constructor;r=r||n.getPropertyOptions(e),n._valueHasChanged(this[e],t,r.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0===r.reflect&&!(16&this._updateState)&&(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,r))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch{}let e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1,t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}};a(Wn,"UpdatingElement"),Wn[Hn]=!0;var Jn=Element.prototype,Yn=(Jn.msMatchesSelector||Jn.webkitMatchesSelector,window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype),Kn=Symbol(),Zn=class{constructor(e,t){if(t!==Kn)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(Yn?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}};a(Zn,"CSSResult");var Qn=a(e=>new Zn(String(e),Kn),"unsafeCSS"),Xn=a(e=>{if(e instanceof Zn)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n            take care to ensure page security.`)},"textFromCSSResult"),eo=a((e,...t)=>{let r=t.reduce((t,r,i)=>t+Xn(r)+e[i+1],e[0]);return new Zn(r,Kn)},"css");(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");var to={},ro=class extends Wn{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;let e=this.getStyles();if(Array.isArray(e)){let t=a((e,r)=>e.reduceRight((e,r)=>Array.isArray(r)?t(r,e):(e.add(r),e),r),"addStyles"),r=t(e,new Set),i=[];r.forEach(e=>i.unshift(e)),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!Yn){let t=Array.prototype.slice.call(e.cssRules).reduce((e,t)=>e+t.cssText,"");return Qn(t)}return e})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){let e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Yn?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){let t=this.render();super.update(e),t!==to&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{let t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return to}};a(ro,"LitElement"),ro.finalized=!0,ro.render=Bn;var io=c(_()),no=a(e=>{let t=String(e||"").trim().match(/(\d+)\s*([dwm])/);return t?`${t[1]}_${{d:1,w:2,m:3}[t[2]]}`:e},"sanitizeFrequencyString"),oo=a(e=>e.hasAttribute("product")&&{id:e.getAttribute("product"),...e.hasAttribute("product-components")&&{components:JSON.parse(e.getAttribute("product-components"))}},"buildProduct"),ao=a(e=>{let t=oo(e);if(!t){let r=e.offer;r&&(t=oo(r))}return t},"resolveProduct"),so=a(e=>{let t=e;for(;t;){if("OG-OFFER"===t.tagName)return t;t=11===t.nodeType?t.host:t.parentNode}},"resolveOffer"),lo=a(e=>class extends e{get offer(){return so(this)}connectedCallback(){super.connectedCallback(),this.offersChangeTemplate=this.offersChangeTemplate.bind(this),this.offer&&this.offer.addEventListener("template-changed",this.offersChangeTemplate)}disconnectedCallback(){super.disconnectedCallback(),this.offer&&this.offer.removeEventListener("template-changed",this.offersChangeTemplate)}offersChangeTemplate(){this._enqueueUpdate()}},"withOfferTemplate"),uo=a(e=>class extends(lo(e)){get product(){return ao(this)}},"withProduct"),co=a(e=>class extends e{get childOptions(){let e=[],t=null;return this.querySelectorAll("option").forEach(r=>{let i=no(r.value),n=r.innerText.trim();e.push({value:i,text:n}),!t&&r.selected&&(t=i)}),{options:e,isSelected:t}}},"withChildOptions"),po={};l(po,{autoshipByDefault:()=>go,eligibilityGroups:()=>mo,eligible:()=>fo,hasPrepaidOptions:()=>Po,hasUpcomingOrder:()=>Oo,hasUpsellGroup:()=>bo,inStock:()=>ho,optedout:()=>So,prepaidEligible:()=>vo,prepaidSubscribed:()=>wo,regularEligible:()=>Co,subscribed:()=>_o,subscriptionEligible:()=>yo,upcomingOrderContainsProduct:()=>xo,upsellEligible:()=>Eo});var ho=a((e,t)=>(e.inStock||{})[(t.product||{}).id],"inStock"),fo=a((e,t)=>(e.autoshipEligible||{})[(t.product||{}).id]||!1,"eligible"),go=a((e,t)=>(e.autoshipByDefault||{})[(t.product||{}).id]||!1,"autoshipByDefault"),yo=a((e,t)=>!(!e.offerId||"0"===e.offerId)&&fo(e,t)&&ho(e,t),"subscriptionEligible"),mo=a((e,t)=>{let r=pr((t.product||{}).id);return(e.eligibilityGroups||{})[r]||null},"eligibilityGroups"),bo=a((e,t)=>{let r=mo(e,t);return null===r||!!r.find(e=>"upsell"===e||"impulse_upsell"===e)},"hasUpsellGroup"),vo=a((e,t)=>{let r=mo(e,t);return(null==r?void 0:r.some(e=>e===Be))||!1},"prepaidEligible"),_o=a((e,t)=>Ut(t.product)(e),"subscribed"),So=a((e,t)=>zt(t.product)(e),"optedout"),wo=a((e,t)=>Bt(t.product)(e),"prepaidSubscribed"),Po=a((e,t)=>Wt(t.product.id)(e).length>0,"hasPrepaidOptions"),Oo=a(e=>!(!e.nextUpcomingOrder||!e.nextUpcomingOrder.public_id),"hasUpcomingOrder"),xo=a((e,t)=>(e.nextUpcomingOrder&&e.nextUpcomingOrder.products||[]).includes((t.product||{}).id),"upcomingOrderContainsProduct"),Eo=a((e,t)=>{var r;return!(null!=(r=t.offer)&&r.isCart)&&e.offerId&&"0"!==e.offerId&&e.auth&&ho(e,t)&&Oo(e)&&bo(e,t)},"upsellEligible"),Co=a((e,t)=>yo(e,t)&&!Eo(e,t),"regularEligible"),qo=a(e=>e.replace(/(\r\n|\n|\r|\s)+/gm,""),"removeWhitespace"),To=class extends(uo(ro)){static get properties(){return{...super.properties,state:{type:Object,attribute:!1},test:{type:String}}}render(){if(!this.test)return Fn``;let e=qo(this.test);return e=e.replace(/(![a-zA-Z]+)/g,"($1)"),io.default.parse(e,e=>po[e]&&po[e](this.state,this))?Fn`
        <slot></slot>
      `:Fn``}shouldUpdate(e){return e.size&&(this.product&&this.product.id in this.state.autoshipEligible&&this.product.id in this.state.inStock||!this.product.id)}};a(To,"When");var ko=a(e=>({state:e}),"mapStateToProps"),Ao=Bi(ko)(To),Io={type:Object,converter:{toAttribute:e=>null==e?e:JSON.stringify(e),fromAttribute:e=>e&&e.match(/[{[]/)?JSON.parse(e):{id:e}}},No={type:String,attribute:"default-frequency",converter:{fromAttribute:e=>e&&rt(e)?e:null}},Fo={type:Boolean,attribute:!0,reflect:!0},$o={type:Object,attribute:!1},Ro=a(e=>class extends e{applyTemplate(e){this.template=e;let t=void 0===e.markup?this.constructor.initialTemplate:e.markup;t&&this._templateMarkup!==t&&(this._templateMarkup=t,this.innerHTML=t)}refreshTemplate(){if(this._templates&&this._templates.length){let e=this._templates.find(({selector:e})=>{try{return this.matches(e)}catch{return!1}});this.applyTemplate(e||{})}}set templates(e){this._templates=e,this.refreshTemplate()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.constructor.initialTemplate&&!this.innerHTML.trim()&&(this.innerHTML=this.constructor.initialTemplate)}},"withTemplate"),Do=Ro(ro),jo=class extends(uo(Do)){static get properties(){return{subscribed:Fo,frequencyMatch:{type:Boolean,reflect:!0,attribute:"frequency-match"},productDefaultFrequency:{type:String},defaultFrequency:{type:String},frequencies:{type:Array}}}static get styles(){return eo`
      :host {
        cursor: default;
        display: inline-block;
      }

      :host[hidden] {
        display: none;
      }

      .btn {
        position: relative;
        width: var(--og-radio-width, 1.4em);
        height: var(--og-radio-height, 1.4em);
        margin: var(--og-radio-margin, 0);
        padding: 0;
        border: 1px solid var(--og-primary-color, var(--og-border-color, black));
        background: #fff;
        border-radius: 100%;
        vertical-align: middle;
        color: var(--og-primary-color, var(--og-btn-color, black));
      }

      .radio {
        text-indent: -9999px;
        flex-shrink: 0;
      }

      .checkbox {
        border-radius: 3px;
      }

      .radio,
      .checkbox {
        border-color: var(--og-checkbox-border-color, black);
      }

      .checkbox.active::after,
      .radio.active::after {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        box-sizing: border-box;
        background: var(--og-checkbox-border-color, black);
      }

      .radio.active::after {
        content: ' ';
        border-radius: 100%;
        border: 2px solid #fff;
      }

      .checkbox.active::after {
        border: none;
        border-radius: 0;
        background: #fff;
        content: '\\2714';
        line-height: 1;
        text-align: center;
        overflow: visible;
      }
    `}constructor(){super(),this.addEventListener("click",this.handleClick.bind(this))}updated(e){e.has("subscribed")&&(this.frequencyMatch=this.frequency===this.defaultFrequency)}handleClick(){}render(){return this.subscribed&&!this.defaultFrequency?Fn`
        <slot name="subscribed"></slot>
        <slot name="frequency-mismatch"></slot>
      `:this.subscribed&&this.defaultFrequency===this.frequency?Fn`
        <slot name="subscribed"></slot>
        <slot name="frequency-match"></slot>
      `:this.subscribed&&this.defaultFrequency!==this.frequency?Fn`
        <slot name="subscribed"></slot>
        <slot name="frequency-mismatch"></slot>
      `:Fn`
      <slot name="not-subscribed"></slot>
    `}};a(jo,"OptinStatus");var Mo=a((e,t={})=>{var r,i;return{subscribed:Lt(t.product)(e),frequency:Gt(t.product)(e),productDefaultFrequency:Jt((t.product||{}).id)(e),prepaidShipmentsOptedIn:Ht(t.product)(e),defaultFrequency:Kt(null==(r=t.product)?void 0:r.id)(e)||nr(t,"defaultFrequency"),frequencies:Yt(null==(i=t.product)?void 0:i.id)(e)||nr(t,"frequencies"),...or(e,t),productFrequencies:Zt(t.product)(e)}},"mapStateToProps"),Lo=Bi(Mo)(jo),Uo=class extends jo{static get properties(){return{...super.properties,frequency:{type:String,reflect:!0},defaultFrequency:No,optinButtonLabel:{type:String}}}updated(e){if(e.has("subscribed")||e.has("frequencies")){if(ct.shopify_selling_plans&&this.store){let e=this.getAttribute("default-frequency");e=fr(e,this.productFrequencies),this.sellingPlanFreq=e}this.frequencyMatch=this.frequency===this.optinFrequency}}get optinFrequency(){let e;return e=this.sellingPlanFreq?this.sellingPlanFreq:this.hasAttribute("default-frequency")?this.getAttribute("default-frequency"):this.offer?this.offer.defaultFrequency:this.defaultFrequency,ct.shopify_selling_plans&&this.store&&(e=fr(e,this.productFrequencies)),e}handleClick(e){this.optinProduct(ao(this),this.optinFrequency,this.offer),e.preventDefault()}render(){return Fn`
      <slot name="default">
        <button
          aria-labelledby="ogOfferOptInLabel"
          role="radio"
          aria-checked="${!!this.subscribed}"
          class="btn radio ${this.subscribed?"active":""}"
        ></button>
        <label id="ogOfferOptInLabel">
          <slot>
            <slot name="label"><og-text key="offerOptInLabel"></og-text></slot>
          </slot>
        </label>
      </slot>
    `}};a(Uo,"OptinButton");var Bo=Bi(Mo,{optinProduct:Or})(Uo),Vo=class extends jo{static get properties(){return{...super.properties,label:{type:String}}}handleClick(e){this.optoutProduct(this.product,this.offer),e.preventDefault()}render(){return Fn`
      <slot name="default">
        <button
          aria-labelledby="ogOfferOptOutLabel"
          role="radio"
          aria-checked="${!this.subscribed}"
          class="btn radio ${this.subscribed?"":"active"}"
        ></button>
        <label id="ogOfferOptOutLabel">
          <slot>
            <og-text key="offerOptOutLabel"></og-text>
          </slot>
        </label>
      </slot>
    `}};a(Vo,"OptoutButton");var zo=Bi(Mo,{optoutProduct:xr})(Vo),Go=a((e,t)=>{let{every:r,every_period:i}=tt(e);return r&&i?Fn`
        ${r}
        <og-text key="frequencyPeriods" variant="${i}" pluralize="${r}"></og-text>
        ${t&&t===e?Fn`
              <og-text key="defaultFrequencyCopy"></og-text>
            `:""}
      `:e},"frequencyText"),Ho=class extends(uo(Do)){static get properties(){return{...super.properties,disabled:{type:Boolean},subscribed:Fo,frequency:{type:String},defaultFrequency:No,productDefaultFrequency:{type:String},config:{type:Object},frequencies:{converter:{fromAttribute:nt}}}}static get styles(){return eo`
      :host[hidden] {
        display: none;
      }
      :host {
        display: inline-block;
      }
    `}constructor(){super(),this.frequencies=[]}render(){let e=this.frequency||this.defaultFrequency;return Fn`
      <span>
        ${this.subscribed&&Fn`
            <slot name="subscribed">${Go(e)}</slot>
          `||""}
        ${!this.subscribed&&Fn`
            <slot name="not-subscribed"></slot>
          `||""}
        ${this.subscribed&&this.defaultFrequency&&this.defaultFrequency!==this.frequency&&Fn`
            <slot name="frequency-mismatch"></slot>
          `||""}
      </span>
    `}};a(Ho,"FrequencyStatus");var Wo=a((e,t)=>{var r,i;return{subscribed:Lt(t.product)(e),frequency:Gt(t.product)(e),productDefaultFrequency:Jt((t.product||{}).id)(e),frequencies:Yt(null==(r=t.product)?void 0:r.id)(e)||nr(t,"frequencies"),defaultFrequency:Kt(null==(i=t.product)?void 0:i.id)(e)||nr(t,"defaultFrequency"),...or(e,t),productFrequencies:Zt(t.product)(e)}},"mapStateToProps"),Jo=Bi(Wo)(Ho),Yo=class extends(co(jo)){static get properties(){return{...super.properties,frequencies:{type:Array,attribute:!1},frequency:{type:String},defaultFrequency:No,selectLabel:{type:String,attribute:"select-label"}}}static get styles(){return eo`
      :host {
        display: inline-block;
        cursor: pointer;
        background-color: var(--og-select-bg-color, #fff);
        border: var(--og-select-border, 1px solid #aaa);
        border-radius: var(--og-select-border-radius, 0.5em);
        border-width: var(--og-select-border-width, 1px);
        box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.04);
      }
    `}get currentFrequency(){return this.subscribed?this.frequency||this.productDefaultFrequency||this.defaultFrequency:"optedOut"}onOptinChange(e){"optedOut"===e?this.optoutProduct(this.product,this.offer):this.productChangeFrequency(this.product,e,this.offer)}render(){var e;let t,{options:r}=this.childOptions;if(null!=(e=this.frequencies)&&e.length){let{frequenciesText:e}=this.productFrequencies;t=[r.find(e=>"optedOut"===e.value),...this.frequencies.map((t,r)=>({value:t,text:e&&r in e?e[r]:Go(t,this.defaultFrequency)}))]}else t=r;return Fn`
      <og-select
        .options="${t}"
        .selected="${this.currentFrequency}"
        .onChange="${({target:{value:e}})=>this.onOptinChange(e)}"
        .ariaLabel="${this.selectLabel}"
      ></og-select>
    `}};a(Yo,"OptinSelect");var Ko=Bi((e,t)=>{var r;return{...Mo(e,t),...Wo(e,t),frequencies:Yt(null==(r=t.product)?void 0:r.id)(e)||nr(t,"frequencies")}},{productChangeFrequency:Cr,optoutProduct:xr})(Yo),Zo=class extends(uo(Do)){static get styles(){return eo`
      :host[hidden] {
        display: none;
      }
      :host {
        display: inline-block;
      }
    `}static get properties(){return{...super.properties,upcomingOrderDate:{type:String,attribute:!1},auth:$o,isPreview:{type:Boolean,attribute:!1},target:{type:String},skipModal:{type:Boolean,attribute:"skip-modal"}}}constructor(){super(),this.fetchOrders=()=>0,this.createIu=()=>0,this.concludeUpsell=()=>0,this.addEventListener("click",this.handleClick.bind(this))}updated(e){e.has("auth")&&this.auth&&!this.upcomingOrderDate&&!this.isPreview&&this.fetchOrders()}handleClick(){let e;if(this.skipModal)this.createIu(this.product,this.nextUpcomingOrder.public_id,1,!1,null),this.concludeUpsell(this.product);else if(!this.target&&this.offer)e=this.offer.querySelector("og-upsell-modal"),e||(e=this.offer.shadowRoot.querySelector("og-upsell-modal"));else{if(!this.target)throw Error("You must specify a target attribute or place this element as child of og-offer");e=document.querySelector(this.target)}e&&e.setAttribute("show",!0)}render(){return Fn`
      <slot>
        <og-next-upcoming-order></og-next-upcoming-order>
      </slot>
    `}};a(Zo,"UpsellButton");var Qo=a(e=>({isPreview:e.previewUpsellOffer,nextUpcomingOrder:e.previewUpsellOffer?{public_id:"preview-order-id"}:e.nextUpcomingOrder}),"mapStateToProps"),Xo=Bi(Qo,{fetchOrders:Ur,createIu:Xr,concludeUpsell:Tr})(Zo),ea=class extends(uo(Do)){static get properties(){return{...super.properties,defaultFrequency:No,auth:$o,subscribed:{type:Boolean,attribute:!1},frequency:{type:String,attribute:!1},nextUpcomingOrder:{type:Object,attribute:!1},show:{type:Boolean,attribute:"show"},offerId:{type:String}}}constructor(){super(),this.createIu=()=>0,this.concludeUpsell=()=>0}render(){return Fn`
      <og-modal ?show=${this.show} @close=${()=>this.close()} @confirm=${()=>this.confirm()}>
        <div slot="content">
          <slot>
            <slot name="content">
              <og-text key="upsellModalContent"></og-text>
            </slot>
            <slot name="offer">
              <br />

              <og-optout-button>
                <slot name="opt-out-label">
                  <og-text key="upsellModalOptOutLabel" slot="label"></og-text>
                </slot>
              </og-optout-button>
              <br />
              <og-optin-button default-frequency=${this.defaultFrequency}>
                <slot name="opt-in-label">
                  <og-text key="upsellModalOptInLabel" slot="label"></og-text>
                </slot>
              </og-optin-button>
              <br />
              <slot name="every-label">
                <og-text key="offerEveryLabel"></og-text>
              </slot>
              <og-select-frequency default-frequency=${this.defaultFrequency}></og-select-frequency>
            </slot>
          </slot>
        </div>
        <span slot="confirm">
          <slot name="confirm"><og-text key="upsellModalConfirmLabel"></og-text></slot>
        </span>
        <span slot="cancel">
          <slot name="cancel">
            <og-text key="upsellModalCancelLabel"></og-text>
          </slot>
        </span>
      </og-modal>
    `}set defaultFrequency(e){this._defaultFrequency=e}get defaultFrequency(){let e=this.querySelector("og-select-frequency");return e?e.defaultFrequency:this._defaultFrequency}confirm(){this.createIu(this.product,this.nextUpcomingOrder.public_id,1,this.subscribed,this.frequency||this.defaultFrequency),this.close()}close(){this.concludeUpsell(),this.removeAttribute("show")}};a(ea,"UpsellModal");var ta=a((e,t)=>{var r;return{auth:e.auth,offerId:e.offerId,subscribed:Lt(t.product)(e),frequency:Gt(t.product)(e),defaultFrequency:Kt(null==(r=t.product)?void 0:r.id)(e)||nr(t,"defaultFrequency"),nextUpcomingOrder:e.previewUpsellOffer?{public_id:"preview-order-id"}:e.nextUpcomingOrder,isPreview:e.previewUpsellOffer}},"mapStateToProps"),ra=Bi(ta,{concludeUpsell:Tr,createIu:Xr})(ea),ia=class extends jo{static get properties(){return{...super.properties,frequency:{type:String}}}static get styles(){return eo`
      :host {
        cursor: default;
        display: inline-block;
      }

      .btn {
        position: relative;
        width: var(--og-radio-width, 1.4em);
        height: var(--og-radio-height, 1.4em);
        margin: var(--og-radio-margin, 0);
        padding: 0;
        border: 1px solid var(--og-checkbox-border-color, black);
        background: #fff;
        vertical-align: middle;
        color: var(--og-primary-color, black);
        display: inline-flex;
        justify-content: center;
        align-items: center;
        border-radius: 3px;
      }

      .btn.active {
        background: var(--og-checkbox-border-color, black);
      }

      .btn.active:after {
        content: '✓';
        color: #fff;
        transform: scale(1.6);
        margin-left: 2px;
      }

      .btn:focus-visible {
        outline: 2px solid var(--og-primary-color, #1a73e8);
        outline-offset: 2px;
      }
    `}updated(e){super.updated(e),e.has("subscribed")&&this.syncSlottedButtonState()}get slottedButton(){var e;let t=null==(e=this.shadowRoot)?void 0:e.querySelector('slot[name="default"]');for(let e of(null==t?void 0:t.assignedElements())||[]){let t=e.matches("button")?e:e.querySelector("button");if(t)return t}return null}syncSlottedButtonState(){var e;null==(e=this.slottedButton)||e.setAttribute("aria-pressed",`${!!this.subscribed}`)}handleClick(e){this.subscribed?this.optoutProduct(this.product,this.offer):this.optinProduct(this.product,this.frequency||this.productDefaultFrequency||this.defaultFrequency,this.offer),e.preventDefault()}render(){return Fn`
      <slot name="default" @slotchange=${this.syncSlottedButtonState}>
        <button
          id="action-trigger"
          class="btn checkbox ${this.subscribed?"active":""}"
          aria-pressed="${!!this.subscribed}"
        ></button>
        <label for="action-trigger">
          <slot>
            <slot name="label"><og-text key="offerOptInLabel"></og-text></slot>
          </slot>
        </label>
      </slot>
    `}};a(ia,"OptinToggle");var na=Bi(Mo,{optoutProduct:xr,optinProduct:Or})(ia),oa=a((e,t)=>`${e}${parseInt(t,10)>1?"s":""}`,"pluralize"),aa=class extends(lo(ro)){static get properties(){return{pluralize:{type:Number},variant:{type:Number},i18n:{type:Object,attribute:!1},locale:{type:Object,attribute:!1},key:{type:String}}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this._textOverride=this.innerText.trim()}getText(){return this._textOverride?this._textOverride:this.getPluralizedText(this.getVariantText(this.key))}getVariantText(e){let t={...this.i18n,...this.offer&&this.offer.locale},r=void 0!==t[e]?t[e]:"";return void 0===this.variant?r:r[this.variant]}getPluralizedText(e){return void 0===this.pluralize?e:e&&oa(e,this.pluralize)}render(){return Fn`
      ${this.getText()}
    `}};a(aa,"Text");var sa=a(e=>({i18n:e.locale||{}}),"mapStateToProps"),la=Bi(sa)(aa),ua=class{constructor(e){this.value=e,this.className="DiscountAmount"}toString(){let e=Number(this.value);return Number.isInteger(e)?`${e}`:e.toFixed(2)}};a(ua,"DiscountAmount");var ca=class extends ua{constructor(e){super(e),this.className="DiscountPercent"}toString(){return`${this.value}%`}};a(ca,"DiscountPercent");var da=class extends ca{constructor(e){super(e),this.className="ShippingDiscountPercent"}toString(){return 100===this.value?"free shipping":super.toString()}};a(da,"ShippingDiscountPercent");var pa="Discount Percent",ha="Discount Amount",fa="total_price",ga="shipping_total",ya="sub_total",ma=a(({field:e,object:t,type:r,value:i})=>{let n=[[new ca(i),{field:fa,object:"item",type:pa}],[new ua(i),{field:fa,object:"item",type:ha}],[new da(i),{field:ga,object:"order",type:pa}],[new ua(i),{field:ga,object:"order",type:ha}],[new ca(i),{field:ya,object:"order",type:pa}],[new ua(i),{field:ya,object:"order",type:ha}]].find(([,i])=>i.field===e&&i.object===t&&i.type===r);return n&&n[0]},"discountBuilder");function ba(e,{incentiveValue:t,incentiveClass:r}){return!(ma(e).className!==r||t&&t.toString()!==e.value.toString())}a(ba,"isMatchingIncentive");var va=[Le,Ue];function _a(e,t){return Number(e.threshold_value)-Number(t.threshold_value)}a(_a,"compareThresholds");var Sa=class extends(uo(ro)){static get properties(){return{...super.properties,incentives:{type:Object,attribute:!1},from:{type:String},label:{type:String},initial:{type:Boolean,default:!1},value:{type:Number}}}createRenderRoot(){return this}render(){let e=this.from,t=this.value,r=this.initial?"initial":"ongoing",i=this.incentives[r]||[],n=i.filter(e=>e.criteria&&"PREMISE"===e.criteria.node_type&&va.includes(e.criteria.standard)),o=[...n.filter(e=>!e.threshold_field),...n.filter(e=>e.threshold_field).sort(_a),...i.filter(e=>!n.includes(e))].find(r=>ba(r,{incentiveClass:e,incentiveValue:t}));return Fn`
      ${this.label} ${o?ma(o):this.renderFallback()}
    `}renderFallback(){return Fn`
      ${ma({field:"sub_total",object:"order",type:"Discount Percent",value:this.value})}
    `}};a(Sa,"IncentiveText");var wa=a((e,t)=>{var r;return{incentives:(e.incentives||{})[t&&(null==t?void 0:t.product)&&pr(null==(r=null==t?void 0:t.product)?void 0:r.id)]||{}}},"mapStateToProps"),Pa=Bi(wa)(Sa),Oa=new WeakMap,xa=un(e=>t=>{if(!(t instanceof Sn))throw new Error("unsafeHTML can only be used in text bindings");let r=Oa.get(t);if(void 0!==r&&mn(e)&&e===r.value&&t.value===r.fragment)return;let i=document.createElement("template");i.innerHTML=e;let n=document.importNode(i.content,!0);t.setValue(n),Oa.set(t,{value:e,fragment:n})}),Ea=class extends(uo(ro)){static get properties(){return{...super.properties,messages:{type:Array,attribute:!1}}}createRenderRoot(){return this}render(){var e;return null!=(e=this.messages)&&e.length?Fn`
      <ul class="og-benefit-messages">
        ${this.messages.map(e=>Fn`
            <li>${xa(e)}</li>
          `)}
      </ul>
    `:Fn``}};a(Ea,"BenefitMessages");var Ca=a((e,t)=>lr(null==t?void 0:t.product)(e),"mapStateToProps"),qa=Bi(Ca)(Ea),Ta=class extends(co(Ho)){static get properties(){return{...super.properties,defaultText:{type:String,attribute:"default-text"},selectLabel:{type:String,attribute:"select-label"}}}static get styles(){return eo`
      :host {
        display: inline-block;
        cursor: pointer;
        background-color: var(--og-select-bg-color, #fff);
        border: var(--og-select-border, 1px solid #aaa);
        border-radius: var(--og-select-border-radius, 0.5em);
        border-width: var(--og-select-border-width, 1px);
        box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.04);
        z-index: 1;
      }
    `}set defaultFrequency(e){this._defaultFrequency=e}get defaultFrequency(){var e,t,r,i;let n,{options:o,isSelected:a}=this.childOptions;return n=this.productDefaultFrequency?this.productDefaultFrequency:a||(o.length?o[0].value:this._defaultFrequency),(null==(t=null==(e=this.productFrequencies)?void 0:e.frequencies)?void 0:t.length)&&n&&(null==(i=null==(r=this.productFrequencies)?void 0:r.frequenciesEveryPeriod)?void 0:i.length)?fr(n,this.productFrequencies):n}get currentFrequency(){return this.frequency?this.frequency:this.defaultFrequency}productChangeFrequency(e,t){this.frequency=t}render(){var e;let t,r=this.defaultFrequency;return null!=(e=this.frequencies)&&e.length?t=this.frequencies.map((e,t)=>{let i,{frequenciesEveryPeriod:n,frequenciesText:o}=this.productFrequencies;return i=n&&t in n?Go(n[t],r):o&&t in o?o[t]:Go(e,this.defaultFrequency),{value:e,text:i}}):({options:t}=this.childOptions),t.length||(t=(this.frequencies||[]).map(e=>({value:e,text:Go(e,r)}))),t=t.map(({text:e,value:t})=>({text:t===r?Fn`
              ${e} ${this.defaultText||""}
            `:e,value:t})),Fn`
      <og-select
        .ariaLabel="${this.selectLabel||"Deliver every"}"
        .options="${t}"
        .selected="${this.currentFrequency}"
        .onChange="${({target:{value:e}})=>{this.productChangeFrequency(this.product,e,this.offer)}}"
      ></og-select>
    `}};a(Ta,"SelectFrequency");var ka=Bi(Wo,{productChangeFrequency:Cr})(Ta),Aa={day:{day:"2-digit"},"day-numeric":{day:"numeric"},"day-short":{weekday:"short"},"day-long":{weekday:"long"},month:{month:"2-digit"},"month-numeric":{month:"numeric"},"month-short":{month:"short"},"month-long":{month:"long"},year:{year:"2-digit"},"year-numeric":{year:"numeric"}},Ia=a((e,t)=>e instanceof Date?(t||"").toString().replace(/\{\{([-\w]+)\}\}/g,t=>{let r=t.replace(/[{}]/g,""),i=Aa[r];if(void 0===i)return r;let n=new Intl.DateTimeFormat("en-us",i).formatToParts(e),[{value:o}]=n;return o}):e,"formatDate"),Na=class extends ro{static get properties(){return{value:{type:String,reflect:!0},format:{type:String}}}createRenderRoot(){return this}render(){return Fn`
      ${Ia(this.value,this.format||"{{month-long}} {{day}}, {{year-numeric}}")}
    `}};a(Na,"FormattedDate");var Fa=a(e=>({value:e.previewUpsellOffer?new Date:e.nextUpcomingOrder.place}),"mapStateToProps"),$a=Bi(Fa)(Na),Ra=c(p()),Da=a((e,t,r)=>a(async function(i){await i({type:we,payload:{isPreview:e,productId:t}}),await i({type:se}),await i(ri({channels:{offers:{"47c01e9aacbe40389b5c7325d79091aa":{"en-US":"Coffee products with 15% off"},e6534b9d877f41e586c37b7d8abc3a58:{"en-US":"Get a free gift on your 3rd order"},f35e842710b24929922db4a529eecd40:{"en-US":"Free shipping for your recurring orders"}}}})),await i(zr({in_stock:{[t]:!0},eligibility_groups:{[t]:["subscription","upsell"]},result:"success",autoship:{[t]:!0},autoship_by_default:{[t]:!1},modifiers:{},module_view:{regular:"096135e6650111e9a444bc764e106cf4"},incentives_display:{"47c01e9aacbe40389b5c7325d79091aa":{field:"sub_total",object:"order",type:"Discount Percent",value:5},e6534b9d877f41e586c37b7d8abc3a58:{field:"total_price",object:"item",type:"Discount Percent",value:10},f35e842710b24929922db4a529eecd40:{field:"total_price",object:"item",type:"Discount Percent",value:10},"5be321d7c17f4e18a757212b9a20bfcc":{field:"total_price",object:"item",type:"Discount Percent",value:1}},incentives:{[t]:{initial:["5be321d7c17f4e18a757212b9a20bfcc"],ongoing:["e6534b9d877f41e586c37b7d8abc3a58","47c01e9aacbe40389b5c7325d79091aa","f35e842710b24929922db4a529eecd40"]}}},r,t))},"setPreviewStandardOfferThunk"),"setPreviewStandardOffer"),ja=a((e,t)=>(Object.entries(t).forEach(([t,r])=>{if(Object.prototype.hasOwnProperty.call(e,t)){let i=e[t].concat(r),n=[...new Set(i.map(e=>JSON.stringify(e)))];e[t]=n.map(e=>JSON.parse(e))}else e[t]=r}),e),"mergeProductPlansToState"),Ma=a((e,t,r)=>a(async function(i,n){await i({type:Pe,payload:{isPreview:e,productId:t}});let{merchantId:o}=n();e?(await i(ri({"47c01e9aacbe40389b5c7325d79091aa":{"en-US":"Coffee products with 15% off"},e6534b9d877f41e586c37b7d8abc3a58:{"en-US":"Get a free gift on your 3rd order"}})),await i(zr({in_stock:{[t]:!0},module_view:{regular:"096135e6650111e9a444bc764e106cf4"},default_frequencies:{[t]:{every:1,every_period:3}},eligibility_groups:{[t]:["subscription","upsell"]},result:"success",autoship:{[t]:!0},autoship_by_default:{[t]:!1},modifiers:{}},r,t)),await i(Mr({count:1,next:null,previous:null,results:[{merchant:"0e5de2bedc5e11e3a2e4bc764e106cf4",customer:"TestCust",payment:"e98e789aba0111e9b90fbc764e107990",shipping_address:"b3a5816ae59611e78937bc764e1043b0",public_id:"23322d4a83eb11ea9a1ebc764e101db1",sub_total:"206.98",tax_total:"0.00",shipping_total:"10.00",discount_total:"0.00",total:"216.98",created:"2020-04-21 11:14:11",place:"2020-06-24 00:00:00",cancelled:null,tries:0,generic_error_count:0,status:1,type:1,order_merchant_id:null,rejected_message:null,extra_data:null,locked:!1,oos_free_shipping:!1}]})),await i(Nr(o,"sig_field","ts","sig"))):await i(Fr())},"setPreviewUpsellOfferThunk"),"setPreviewUpsellOffer"),La=a((e,t,r)=>a(async function(i,n){let o=n().productPlans;await i({type:"SET_PREVIEW_PREPAID_OFFER",payload:{isPreview:e,productId:t}}),await i({type:se}),await i(ri({"47c01e9aacbe40389b5c7325d79091aa":{"en-US":"Coffee products with 15% off"},e6534b9d877f41e586c37b7d8abc3a58:{"en-US":"Get a free gift on your 3rd order"}})),await i(zr({in_stock:{[t]:!0},eligibility_groups:{[t]:["subscription","upsell","prepaid"]},result:"success",autoship:{[t]:!0},autoship_by_default:{[t]:!1},modifiers:{},module_view:{regular:"096135e6650111e9a444bc764e106cf4"},incentives_display:{"47c01e9aacbe40389b5c7325d79091aa":{field:"sub_total",object:"order",type:"Discount Percent",value:5},e6534b9d877f41e586c37b7d8abc3a58:{field:"total_price",object:"item",type:"Discount Percent",value:10},f35e842710b24929922db4a529eecd40:{field:"total_price",object:"item",type:"Discount Percent",value:10},"5be321d7c17f4e18a757212b9a20bfcc":{field:"total_price",object:"item",type:"Discount Percent",value:1}},incentives:{[t]:{initial:["5be321d7c17f4e18a757212b9a20bfcc"],ongoing:["e6534b9d877f41e586c37b7d8abc3a58","47c01e9aacbe40389b5c7325d79091aa","f35e842710b24929922db4a529eecd40"]}}},r,t)),await i({type:ke,payload:ja(o,Gi({[t]:[{frequency:"1_3",regularPrice:"$15.00",subscriptionPrice:"$12.00",discountRate:"25%",prepaidShipments:3,regularPrepaidPrice:"$36.00",prepaidSavingsPerShipment:"$3.00",prepaidSavingsTotal:"$9.00",prepaidExtraSavingsPercentage:"10%"},{frequency:"1_3",regularPrice:"$15.00",subscriptionPrice:"$12.00",discountRate:"20%",prepaidShipments:6,regularPrepaidPrice:"$72.00",prepaidSavingsPerShipment:"$3.00",prepaidSavingsTotal:"$18.00",prepaidExtraSavingsPercentage:"10%"},{frequency:"1_3",regularPrice:"$15.00",subscriptionPrice:"$12.00",discountRate:"20%",prepaidShipments:12,regularPrepaidPrice:"$144.00",prepaidSavingsPerShipment:"$3.00",prepaidSavingsTotal:"$36.00",prepaidExtraSavingsPercentage:"10%"}]}))}),await i({type:_e,payload:{prepaidSellingPlans:{[t]:[{numberShipments:3,sellingPlan:"1_3"},{numberShipments:6,sellingPlan:"1_3"},{numberShipments:12,sellingPlan:"1_3"}]}}})},"setPreviewPrepaidThunk"),"setPreviewPrepaid"),Ua=a((e,t,r)=>async function(t,i){switch(await t({type:Ce}),await t({type:we,payload:{isPreview:!1,productId:r.product.id}}),await t({type:Pe,payload:{isPreview:!1,productId:r.product.id}}),e){case"regular":t(Da(!0,r.product.id,r));break;case"upsell":t(Ma(!0,r.product.id,r));break;case"subscribed":t(Da(!0,r.product.id,r)),t(Or(r.product,"2_2"));break;case"prepaid":t(La(!0,r.product.id,r)),t(Or(r.product,"1_3"))}},"setPreview"),Ba=a((...e)=>JSON.stringify(e),"memoizeKey"),Va=a(e=>{let t=!1;return(...r)=>{t||(console.warn(e(...r)),t=!0)}},"logOnce"),za=Va((e,t)=>`Hiding Ordergroove offer since the store currency ${e} does not match your configured currency ${t} and you are not set up for multicurrency. Contact your Ordergroove representative for next steps.`),Ga=(Va(()=>"Hiding Ordergroove offer since cart offers does not currently support product-specific frequency lists."),(0,Ra.default)((e,t)=>Object.assign({components:t},e),Ba)),Ha=class extends Do{static get properties(){return{...super.properties,config:{type:Object,attribute:!1},product:Io,productComponents:{type:Array,attribute:"product-components"},offerId:{type:String,attribute:!1},auth:$o,preview:{type:String,attribute:"preview",reflect:"true"},location:{type:String},autoshipByDefault:{type:Boolean,attribute:"autoship-by-default"},productDefaultFrequency:{type:String,attribute:!1},locale:{type:Object,attribute:!0},firstOrderPlaceDate:{type:String,attribute:"first-order-place-date"},productToSubscribe:{type:String,attribute:"product-to-subscribe"},subscribed:{type:Boolean,reflect:!0},frequency:{type:String,reflect:!0},productFrequency:{type:String},isCart:{type:Boolean,attribute:"cart"},optedin:{type:Object},variationId:{type:String},overrideSellingPlanPrice:{type:Boolean,attribute:"dev-override-selling-plan-price"}}}firstUpdated(){try{let e=Array.from(this.getAttributeNames()).find(e=>e.startsWith("preview-"));"preview-standard-offer"===e?this.preview="regular":"preview-upsell-offer"===e?this.preview="upsell":"preview-subscribed-offer"===e?this.preview="subscribed":"preview-prepaid-offer"===e&&(this.preview="prepaid")}catch(e){console.warn("Unable to set preview property",e)}}static get styles(){return eo`
      :host[hidden] {
        display: none;
      }

      :host {
        display: block;
      }

      :host {
        color: var(--og-global-color, #000);
        font-family: var(--og-global-family, inherit);
        font-size: var(--og-global-size, inherit);
        padding: var(--og-wrapper-padding, 10px 0);
        min-width: var(--og-wrapper-min-width, 0);
      }

      p {
        margin: 0 0 0.3em;
      }

      :host og-upsell-button button {
        font-family: var(--og-upsell-family, inherit);
        font-size: var(--og-upsell-size, inherit);
        background-color: var(--og-upsell-background, inherit);
        color: var(--og-upsell-color, inherit);
      }

      .og-modal__btn {
        font-size: var(--og-modal-button-size, 0.875rem);
        font-family: var(--og-modal-button-family, inherit);
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        background-color: var(--og-modal-button-background, #e6e6e6);
        color: var(--og-modal-button-color, rgba(0, 0, 0, 0.8));
        border-radius: 0.25rem;
        border-style: none;
        border-width: 0;
        cursor: pointer;
        -webkit-appearance: button;
        text-transform: none;
        overflow: visible;
        line-height: 1.15;
        margin: 0;
        will-change: transform;
        -moz-osx-font-smoothing: grayscale;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        transition: -webkit-transform 0.25s ease-out;
        transition: transform 0.25s ease-out;
        transition:
          transform 0.25s ease-out,
          -webkit-transform 0.25s ease-out;
      }

      .og-modal__btn:focus,
      .og-modal__btn:hover {
        -webkit-transform: scale(1.05);
        transform: scale(1.05);
      }

      .og-modal__btn-primary {
        background-color: var(--og-confirm-button-background, #00449e);
        color: var(--og-confirm-button-color, #fff);
      }
    `}static get initialTemplate(){return'\n    <og-when test="regularEligible">\n      <div>\n\n        <og-optout-button>\n          <og-text key="offerOptOutLabel"></og-text>\n        </og-optout-button>\n      </div>\n      <div>\n        <og-optin-button>\n          <og-price discount>\n            <span slot="prepend">Subscribe and get</span>\n            <span slot="append">off</span>\n            <og-text key="offerOptInLabel" slot="fallback"></og-text> \n          </og-price>\n          <og-price regular></og-price>\n          <og-price subscription></og-price>\n    \n        </og-optin-button>\n        <og-tooltip placement="bottom">\n          <div slot="trigger">\n            <og-text key="offerTooltipTrigger"></og-text>\n          </div>\n          <div slot="content">\n            <og-text key="offerTooltipContent"></og-text>\n          </div>\n        </og-tooltip>\n      </div>\n      <div style="margin-left: 2.2em">\n        <og-text key="offerEveryLabel"></og-text>\n        <og-select-frequency>\n          <option value="3_1" selected>3 Days</option>\n          <option value="1_2">1 Week</option>\n          <option value="1_3">1 Month</option>\n        </og-select-frequency>\n      </div>\n    </og-when>\n\n    <og-when test="upsellEligible">\n      <og-when test="!upcomingOrderContainsProduct">\n      <div class="og-iu-offer">\n        <og-text key="upsellButtonLabel"></og-text>\n        <og-upsell-button>\n          <button type="button">\n            <og-text key="upsellButtonContent"></og-text>\n            <og-next-upcoming-order></og-next-upcoming-order>\n          </button>\n        </og-upsell-button>\n        <og-upsell-modal>\n          <og-text key="upsellModalContent"></og-text>\n          <br />\n\n          <og-optout-button>\n            <og-text key="upsellModalOptOutLabel"></og-text>\n          </og-optout-button>\n\n          <br />\n\n          <og-optin-button>\n            <og-text key="upsellModalOptInLabel"></og-text>\n          </og-optin-button>\n          <br />\n\n          <og-text key="offerEveryLabel"></og-text>\n          <og-select-frequency>\n            <option value="3_1" selected>3 Days</option>\n            <option value="1_2">1 Week</option>\n            <option value="1_3">1 Month</option>\n          </og-select-frequency>\n\n          <button slot="confirm" class="og-modal__btn og-modal__btn-primary">\n            <og-text key="upsellModalConfirmLabel"></og-text>\n          </button>\n          <button slot="cancel" class="og-modal__btn"><og-text key="upsellModalCancelLabel"></og-text></button>\n        </og-upsell-modal>\n      </div>\n      </og-when>\n      <og-when test="upcomingOrderContainsProduct">\n        The product is in your next upcomming order\n      </og-when>\n    </og-when>\n    \n    '}constructor(){super(),this.module="pdp",this.product={},this.productComponents=[],this.fetchOffer=()=>0,this.fetchOrders=()=>0,this.productHasChangedComponents=()=>0,this.setFirstOrderPlaceDate=()=>0,this.setProductToSubscribe=()=>0,this.productChangeFrequency=()=>0}applyTemplate(e){super.applyTemplate(e);let{id:t,locale:r}=e;this.variationId=t,this.locale=r;let i=new CustomEvent("template-changed");this.dispatchEvent(i)}updated(e){if(e.has("preview")&&this.setPreview(this.preview,e.get("preview"),this),this.frequency=this.defaultFrequency,e.has("product")&&!this.isPreview&&ur(()=>this.fetchOffer(this.product.id,$e,this)),e.has("firstOrderPlaceDate")&&this.product.id&&!this.isPreview&&this.setFirstOrderPlaceDate(this.product.id,this.firstOrderPlaceDate),e.has("productToSubscribe")&&this.product.id&&!this.isPreview&&this.setProductToSubscribe(this.product.id,this.productToSubscribe),e.has("auth")&&this.auth&&!this.isPreview&&this.fetchOrders(),e.has("productComponents")){let t=Ga(this.product,this.productComponents),r=Object.assign({},this.product,{components:e.get("productComponents")});Nt(t,r)||this.productHasChangedComponents(t,r)}(e.has("offerId")||e.has("autoshipByDefault")||e.has("location")||e.has("product"))&&this.offerId&&this.autoshipByDefault&&("cart"===this.location||this.isCart)&&this.product.id&&this.optinProduct&&!(this.optedin||[]).find(e=>Nt(e,this.product))&&this.optinProduct({...this.product,...this.productComponents.length&&{components:this.productComponents}},this.defaultFrequency,this)}get isPreview(){return this.preview||window.og.previewMode}get shouldEnableOffer(){return!(this.config&&this.config.storeCurrency&&this.config.merchantSettings&&!this.config.merchantSettings.multicurrency_enabled&&this.config.storeCurrency!==this.config.merchantSettings.currency_code)||(za(this.config.storeCurrency,this.config.merchantSettings.currency_code),!1)}render(){return this.shouldEnableOffer?Fn`
          <slot></slot>
        `:null}get defaultFrequency(){let e=this.productFrequency||this.productDefaultFrequency;if(e)return e;let t=this.querySelector("og-select-frequency");return t&&t.currentFrequency?t.currentFrequency:this.getValueFromAttribute("defaultFrequency")||(this.template&&this.template.config&&void 0!==this.template.config.defaultFrequency?this.template.config.defaultFrequency:this.configDefaultFrequency)}getValueFromAttribute(e){let t=ir(e);if(this.hasAttribute(t)){let e=this.getAttribute(t);return"true"===e.toString().toLowerCase()||"false"!==e.toString().toLowerCase()&&e}}};a(Ha,"Offer");var Wa=a((e,t)=>{var r;return{config:e.config,auth:e.auth,offerId:((e.productOffer||{})[(t.product||{}).id]||[])[0],configDefaultFrequency:Kt(null==(r=t.product)?void 0:r.id)(e),productFrequency:Gt(t.product)(e),productDefaultFrequency:Jt((t.product||{}).id)(e),autoshipByDefault:e.config&&e.config.autoshipByDefault||nr(t,"autoshipByDefault",Rt(e)[(t.product||{}).id]),...zt(t.product)(e)&&{autoshipByDefault:!1},optedin:Ft(e),subscribed:Lt(t.product)(e),...or(e)}},"mapStateToProps"),Ja=Bi(Wa,{fetchOffer:Wr,fetchOrders:Ur,productHasChangedComponents:Er,optinProduct:Or,setFirstOrderPlaceDate:oi,setProductToSubscribe:ai,setPreview:Ua})(Ha),Ya=class extends ro{constructor(){super(),this.showCancelButton=!0,this.showConfirmButton=!0}static get properties(){return{title:{type:String,attribute:!1},content:{type:String,attribute:!1},confirmText:{type:String,attribute:!1},cancelText:{type:String,attribute:!1},showCancelButton:{type:Boolean},showConfirmButton:{type:Boolean},show:{type:Boolean,attribute:"show"}}}static get styles(){return eo`
      :host[hidden] {
        display: none;
      }

      :host {
        display: block;
      }

      .og-modal {
        display: none;
      }

      .og-modal.is-open {
        display: block;
      }

      .og-modal__overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 9999;
      }

      .og-modal__container {
        background-color: var(--og-modal-background-color, #fff);
        padding: var(--og-modal-padding, 30px);
        max-width: 500px;
        max-height: 100vh;
        border-radius: var(--og-modal-border-radius, 4px);
        box-sizing: border-box;
      }

      .og-modal__header {
        display: flex;
        justify-content: space-between;
        align-items: center;
      }

      .og-modal__title {
        margin-top: 0;
        margin-bottom: 0;
        font-weight: 600;
        font-size: 1.25rem;
        line-height: 1.25;
        color: #00449e;
        box-sizing: border-box;
      }

      .og-modal__close {
        background: transparent;
        border: 0;
      }

      .og-modal__close:before {
        content: '✕';
      }

      .og-modal__content {
        margin-top: 2rem;
        margin-bottom: 2rem;
        line-height: 1.5;
      }

      .og-modal__btn {
        font-size: var(--og-modal-button-size, 0.875rem);
        font-family: var(--og-modal-button-family, inherit);
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        background-color: var(--og-modal-button-background, #e6e6e6);
        color: var(--og-modal-button-color, rgba(0, 0, 0, 0.8));
        border-radius: 0.25rem;
        border-style: none;
        border-width: 0;
        cursor: pointer;
        -webkit-appearance: button;
        text-transform: none;
        overflow: visible;
        line-height: 1.15;
        margin: 0;
        will-change: transform;
        -moz-osx-font-smoothing: grayscale;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        transition: -webkit-transform 0.25s ease-out;
        transition: transform 0.25s ease-out;
        transition:
          transform 0.25s ease-out,
          -webkit-transform 0.25s ease-out;
      }

      .og-modal__btn:focus,
      .og-modal__btn:hover {
        -webkit-transform: scale(1.05);
        transform: scale(1.05);
      }

      .og-modal__btn-primary {
        background-color: var(--og-confirm-button-background, #00449e);
        color: var(--og-confirm-button-color, #fff);
      }
      .btn {
        cursor: pointer;
      }
    `}close(){this.removeAttribute("show"),this.dispatchEvent(new CustomEvent("close"))}confirm(){this.removeAttribute("show"),this.dispatchEvent(new CustomEvent("confirm"))}get confirmButton(){return this.showConfirmButton?Fn`
          <span @click="${()=>this.confirm()}">
            <slot name="confirm" class="btn">
              <button class="og-modal__btn og-modal__btn-primary og-modal__confirm" @click="${()=>this.confirm()}">
                ${this.confirmText}
              </button>
            </slot>
          </span>
        `:Fn``}get cancelButton(){return this.showCancelButton?Fn`
          <span @click="${()=>this.close()}" class="btn">
            <slot name="cancel">
              <button class="og-modal__btn og-modal__cancel" @click="${()=>this.close()}">${this.cancelText}</button>
            </slot>
          </span>
        `:Fn``}render(){return this.show?Fn`
      <div class="og-modal is-open" aria-hidden="true">
        <div class="og-modal__overlay" tabindex="-1">
          <div class="og-modal__container" role="dialog" aria-modal="true">
            <header class="og-modal__header">
              <h2 class="og-modal__title">
                <slot name="title">${this.title}</slot>
              </h2>
              <button class="og-modal__close" aria-label="Close" @click="${()=>this.close()}"></button>
            </header>
            <main class="og-modal__content">
              <slot name="content">${this.content}</slot>
            </main>
            <footer class="og-modal__footer">${this.confirmButton} ${this.cancelButton}</footer>
          </div>
        </div>
      </div>
    `:Fn``}};a(Ya,"Modal");var Ka=new WeakMap,Za=un(e=>t=>{let r=Ka.get(t);if(void 0===e&&t instanceof _n){if(void 0!==r||!Ka.has(t)){let e=t.committer.name;t.committer.element.removeAttribute(e)}}else e!==r&&t.setValue(e);Ka.set(t,e)}),Qa=class extends ro{static get styles(){return eo`
      :host {
        display: inline-block;
        color: inherit;
        position: relative;
        height: 100%;
        cursor: inherit;
        font-family: inherit;
        font-weight: inherit;
      }
      select {
        font-weight: inherit;
        display: block;
        height: 100%;
        cursor: inherit;
        color: inherit;
        font-family: inherit;
        font-size: 1em;
        line-height: 1.3;
        padding: var(--og-select-padding, 0.4em 1.8em 0.3em 0.5em);
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
        border: none;
        -moz-appearance: none;
        -webkit-appearance: none;
        appearance: none;
        background-color: transparent;
      }
      select::-ms-expand {
        display: none;
      }
      select:focus {
        outline: none;
      }
      select option {
        font-weight: inherit;
      }
      span {
        position: absolute;
        // background: white;
        color: inherit;
        fill: white;
        pointer-events: none;
        right: 0.3em;
        top: 50%;
        z-index: 1;
        font-size: 1em;
        line-height: 0.2em;
        transform: scaleY(0.5);
      }
    `}static get properties(){return{options:{type:Array},selected:{type:String},ariaLabel:{type:String}}}render(){return Fn`
      <select @change="${a(e=>this.onChange(e),"handleOnChange")}" aria-label="${Za(this.ariaLabel)}">
        ${this.options.map(e=>Fn`
            <option
              value="${e.value}"
              ?selected=${e.value===this.selected}
              .selected=${e.value===this.selected}
            >
              ${e.text}
            </option>
          `)}
      </select>
      <span>&#9660;</span>
    `}};a(Qa,"Select");var Xa="automatic",es="manual",ts=class extends ro{constructor(){super(),this.triggerLabel="Show tooltip",this.open=!1,this.activationType=Xa}static get properties(){return{placement:{type:String,default:"bottom"},triggerLabel:{type:String,attribute:"trigger-label"},activationType:{type:String,attribute:"activation-type"},open:{type:Boolean,attribute:!1}}}static get styles(){return eo`
      :host[hidden] {
        display: none;
      }

      :host {
        display: inline-block;
        position: relative;
        z-index: 9;
      }

      /* reset default button styles */
      button.trigger {
        all: unset;
      }

      /* do not reset the button's default focus outline */
      button.trigger:focus {
        outline: revert;
      }

      .trigger {
        display: block;
        cursor: pointer;
      }

      /* for manual activation, hide the content completely from screen readers when the tooltip is closed */
      /* otherwise, interactive elements may receive focus even when they are not visible */
      [data-manual] .content {
        visibility: hidden;
      }

      .content {
        box-sizing: border-box;
        font-family: var(--og-tooltip-family, inherit);
        font-size: var(--og-tooltip-size, inherit);
        color: var(--og-tooltip-color, inherit);
        background-color: var(--og-tooltip-background, #ececec);
        box-shadow: var(--og-tooltip-box-shadow, 2px 2px 6px rgba(0, 0, 0, 0.28));
        display: block;
        opacity: 0;
        padding: var(--og-tooltip-padding, 0.5em);
        text-align: var(--og-tooltip-text-align, left);
        pointer-events: none;
        position: absolute;
        transform: translateY(10px);
        transition: transform 0.25s ease-out;
        z-index: 99999;
        border-radius: var(--og-tooltip-border-radius, 0);
      }

      .content:after {
        content: ' ';
        height: 0;
        position: absolute;
        width: 0;
      }

      .top {
        bottom: 100%;
        margin-bottom: 10px;
      }

      .bottom {
        top: 100%;
        margin-top: 10px;
      }

      .left {
        right: 100%;
        margin-right: 10px;
      }

      .right {
        left: 100%;
        margin-left: 10px;
      }

      .top-left {
        bottom: 100%;
        margin-bottom: 10px;
        right: 100%;
        margin-right: -16px;
      }

      .top-right {
        bottom: 100%;
        margin-bottom: 10px;
        left: 100%;
        margin-left: -16px;
      }

      .bottom-left {
        top: 100%;
        margin-top: 10px;
        right: 100%;
        margin-right: -16px;
      }

      .bottom-right {
        top: 100%;
        margin-top: 10px;
        left: 100%;
        margin-left: -16px;
      }

      .bottom-left:after,
      .bottom-right:after,
      .top-left:after,
      .top-right:after,
      .top:after,
      .bottom:after {
        margin-left: -10px;
        left: 50%;
        border-left: solid transparent 10px;
        border-right: solid transparent 10px;
      }

      .top-left:after,
      .top-right:after,
      .top:after {
        bottom: -10px;
        border-top: solid var(--og-tooltip-background, #ececec) 10px;
      }
      .bottom-left:after,
      .top-left:after {
        left: auto;
        right: 0;
      }

      .bottom-right:after,
      .top-right:after {
        left: 0;
        right: auto;
        margin-left: 0;
      }

      .bottom-left:after,
      .bottom-right:after,
      .bottom:after {
        top: -10px;
        border-bottom: solid var(--og-tooltip-background, #ececec) 10px;
      }

      .left:after,
      .right:after {
        margin-top: -10px;
        top: 50%;
        border-top: solid transparent 10px;
        border-bottom: solid transparent 10px;
      }
      .right:after {
        left: -10px;
        border-right: solid var(--og-tooltip-background, #ececec) 10px;
      }
      .left:after {
        right: -10px;
        border-left: solid var(--og-tooltip-background, #ececec) 10px;
      }

      .tooltip[data-open] .content {
        visibility: visible;
        opacity: 1;
        width: 200px;
        pointer-events: auto;
        transform: translateY(0px);
      }
    `}connectedCallback(){super.connectedCallback(),this.abortController=new AbortController;let e=this.abortController.signal;this.addEventListener("mouseenter",this.handleMouseEnter.bind(this),{signal:e}),this.addEventListener("mouseleave",this.handleMouseLeave.bind(this),{signal:e}),this.addEventListener("focusin",this.handleFocusIn.bind(this),{signal:e}),this.addEventListener("focusout",this.handleFocusOut.bind(this),{signal:e}),this.addEventListener("keydown",this.handleKeyDown.bind(this),{signal:e}),document.addEventListener("click",this.handleDocumentClick.bind(this),{signal:e})}async recalculatePosition(){if(await this.updateComplete,!this.open)return;let e=this.shadowRoot.querySelector(".trigger").getBoundingClientRect(),t=this.shadowRoot.querySelector(".content"),r=t.getBoundingClientRect();this.placement&&"top"!==this.placement&&"bottom"!==this.placement?("left"===this.placement||"right"===this.placement)&&(t.style.top=(-1*r.height+e.height)/2+"px"):t.style.left=(-1*r.width+e.width)/2+"px"}handleMouseEnter(){this.open=!0,this.recalculatePosition()}handleMouseLeave(){this.open=!1}handleFocusIn(){this.activationType===Xa&&(this.open=!0,this.recalculatePosition())}handleFocusOut(e){this.activationType===Xa&&(this.contains(e.relatedTarget)||(this.open=!1))}handleKeyDown(e){"Escape"===e.key&&this.open&&(this.open=!1,e.stopPropagation())}handleClick(){this.activationType===es&&(this.open=!this.open,this.recalculatePosition())}handleDocumentClick(e){this.activationType!==es||!this.open||this.contains(e.target)||(this.open=!1)}disconnectedCallback(){super.disconnectedCallback(),this.abortController.abort()}render(){let e=this.triggerLabel?this.triggerLabel:void 0;return Fn`
      <span class="tooltip" ?data-open="${this.open}" ?data-manual="${this.activationType===es}">
        ${this.activationType===es?Fn`
              <button
                class="trigger"
                aria-label="${Za(e)}"
                aria-expanded="${this.open}"
                aria-controls="tooltip-content"
                @click="${this.handleClick}"
              >
                <slot name="trigger">${this.trigger}</slot>
              </button>
            `:Fn`
              <span
                class="trigger"
                tabindex="0"
                role="button"
                aria-label="${Za(e)}"
                aria-describedby="tooltip-content"
              >
                <slot name="trigger">${this.trigger}</slot>
              </span>
            `}
        <div class="content ${this.placement||"bottom"}" role="tooltip" id="tooltip-content">
          <slot name="content">${this.content}</slot>
        </div>
      </span>
    `}};a(ts,"Tooltip");var rs=class extends(uo(ro)){static get properties(){return{options:{type:Array},shipmentsOptedIn:{type:Number},prepaidShipmentsSelected:{type:Number},defaultPrepaidShipments:{type:Number,attribute:"default-prepaid-shipments"}}}get prepaidOptedIn(){return this.shipmentsOptedIn>1}get selectedNumberOfShipments(){return this.prepaidShipmentsSelected||this.shipmentsOptedIn||this.getDefaultPrepaidShipments()}getDefaultPrepaidShipments(){return this.options.includes(this.defaultPrepaidShipments)?this.defaultPrepaidShipments:kt(this.options)}handleSelect({target:{value:e}}){let t=+e;this.productChangePrepaidShipments(this.product,t,this.offer)}render(){return Fn``}};a(rs,"PrepaidStatus");var is=a((e,t)=>({options:Wt(t.product.id)(e),shipmentsOptedIn:Ht(t.product)(e),prepaidShipmentsSelected:Vt(t.product)(e)}),"mapStateToProps"),ns=(Bi(is,{productChangePrepaidShipments:qr})(rs),class extends rs{constructor(){super(),this.options=[],this.text="shipments"}static get properties(){return{...super.properties,text:{type:String}}}static get styles(){return eo`
      og-select {
        display: inline-block;
        cursor: pointer;
        background-color: var(--og-select-bg-color, #fff);
        border: var(--og-select-border, 1px solid #aaa);
        border-width: var(--og-select-border-width, 1px);
        box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.04);
        z-index: 1;
      }

      input {
        width: 1.2em;
        height: 1.2em;
        accent-color: var(--og-prepaid-checkbox-color, black);
        border-radius: 4px;
      }
    `}handleChange(e){e.target.checked?this.productChangePrepaidShipments(this.product,this.selectedNumberOfShipments,this.offer):this.productChangePrepaidShipments(this.product,null,this.offer)}render(){if(0===this.options.length)return Fn``;let e=this.options.map(e=>({value:e,text:`${e} ${this.text}`}));return Fn`
      <div>
        <input id="cbx" type="checkbox" .checked=${this.prepaidOptedIn} @change=${this.handleChange} />
        <label for="cbx">
          <slot name="label">Prepay for</slot>
          ${this.options.length>1?Fn`
                <og-select
                  .options=${e}
                  .selected=${this.selectedNumberOfShipments}
                  .onChange="${e=>this.handleSelect(e)}"
                ></og-select>
              `:Fn`
                <span>${e[0].text}</span>
              `}
          <slot name="append"></slot>
        </label>
      </div>
    `}});a(ns,"PrepaidToggle");var os=a((e,t)=>({options:Wt(t.product.id)(e),shipmentsOptedIn:Ht(t.product)(e),prepaidShipmentsSelected:Vt(t.product)(e)}),"mapStateToProps"),as=Bi(os,{productChangePrepaidShipments:qr})(ns),ss=class extends rs{static get properties(){return{...super.properties,productPlans:{type:Object},prepaidShipmentsSelected:{type:Number},totalPrice:{type:Boolean,reflect:!0,attribute:"total-price"},perDeliveryPrice:{type:Boolean,reflect:!0,attribute:"per-delivery-price"},totalSavings:{type:Boolean,reflect:!0,attribute:"total-savings"},perDeliverySavings:{type:Boolean,reflect:!0,attribute:"per-delivery-savings"},percentageSavings:{type:Boolean,reflect:!0,attribute:"percentage-savings"},extraPercentageSavings:{type:Boolean,reflect:!0,attribute:"extra-percentage-savings"},numberOfShipments:{type:Boolean,reflect:!0,attribute:"number-of-shipments"}}}static get styles(){return eo`
      :host {
        display: inline-block;
        text-indent: initial;
      }
    `}get value(){let e=pr(this.product),t=this.productPlans[e]||[],r=this.selectedNumberOfShipments,i=t.find(e=>e.prepaidShipments>1&&e.prepaidShipments===r);if(!i&&(i=t.find(e=>e.prepaidShipments>1),!i))return"";let{discountRate:n,subscriptionPrice:o,prepaidShipments:a,regularPrepaidPrice:s,prepaidSavingsPerShipment:l,prepaidSavingsTotal:u,prepaidExtraSavingsPercentage:c}=i;return this.totalPrice?s:this.perDeliveryPrice?o:this.totalSavings?u:this.perDeliverySavings?l:this.percentageSavings?n:this.extraPercentageSavings?c:this.numberOfShipments?a:""}render(){let e=this.value;return e?Fn`
        <slot name="prepend"></slot>
        ${e}
        <slot name="append"></slot>
      `:Fn`
      <slot name="fallback"></slot>
    `}};a(ss,"PrepaidData");var ls=a((e,t)=>({options:Wt(t.product.id)(e),shipmentsOptedIn:Ht(t.product)(e),prepaidShipmentsSelected:Vt(t.product)(e),productPlans:e.productPlans}),"mapStateToProps"),us=Bi(ls)(ss),cs=class extends rs{constructor(){super(),this.addEventListener("click",this.handleClick.bind(this))}static get styles(){return eo`
      :host {
        cursor: pointer;
        display: inline-block;
      }

      :host[hidden] {
        display: none;
      }

      .btn {
        position: relative;
        width: var(--og-radio-width, 1.4em);
        height: var(--og-radio-height, 1.4em);
        margin: var(--og-radio-margin, 0);
        padding: 0;
        border: 1px solid var(--og-primary-color, var(--og-border-color, black));
        background: #fff;
        border-radius: 100%;
        vertical-align: middle;
        color: var(--og-primary-color, var(--og-btn-color, black));
      }

      .radio {
        text-indent: -9999px;
        flex-shrink: 0;
      }

      .radio {
        border-color: var(--og-checkbox-border-color, black);
      }

      .radio.active::after {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        box-sizing: border-box;
        background: var(--og-checkbox-border-color, black);
      }

      .radio.active::after {
        content: ' ';
        border-radius: 100%;
        border: 2px solid #fff;
      }
    `}handleClick(e){this.prepaidOptedIn||this.productChangePrepaidShipments(this.product,this.selectedNumberOfShipments,this.offer),e.preventDefault()}render(){return Fn`
      <slot name="default">
        <button id="action-trigger" class="btn radio ${this.prepaidOptedIn?"active":""}"></button>
        <label for="action-trigger">
          <slot name="label"><og-text key="prepaidOptInLabel"></og-text></slot>
        </label>
      </slot>
    `}};a(cs,"PrepaidButton");var ds=a((e,t)=>({options:Wt(t.product.id)(e),shipmentsOptedIn:Ht(t.product)(e),prepaidShipmentsSelected:Vt(t.product)(e)}),"mapStateToProps"),ps=Bi(ds,{productChangePrepaidShipments:qr})(cs),hs=class extends rs{constructor(){super(),this.options=[],this.text="shipments"}static get properties(){return{...super.properties,text:{type:String},selectLabel:{type:String,attribute:"select-label"}}}static get styles(){return eo`
      og-select {
        display: inline-block;
        cursor: pointer;
        background-color: var(--og-select-bg-color, #fff);
        border: var(--og-select-border, 1px solid #aaa);
        border-width: var(--og-select-border-width, 1px);
        box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.04);
        z-index: 1;
      }
    `}render(){if(0===this.options.length)return Fn``;let e=this.options.map(e=>({value:e,text:`${e} ${this.text}`}));return Fn`
      ${this.options.length>1?Fn`
            <og-select
              .options=${e}
              .selected=${this.selectedNumberOfShipments}
              .onChange="${e=>this.handleSelect(e)}"
              .ariaLabel="${this.selectLabel}"
            ></og-select>
          `:Fn`
            <span>${e[0].text}</span>
          `}
      <slot name="append"></slot>
    `}};a(hs,"PrepaidSelect");var fs=a((e,t)=>({options:Wt(t.product.id)(e),shipmentsOptedIn:Ht(t.product)(e),prepaidShipmentsSelected:Vt(t.product)(e)}),"mapStateToProps"),gs=Bi(fs,{productChangePrepaidShipments:qr})(hs),ys=class extends Uo{static get properties(){return{...super.properties,prepaidShipmentsOptedIn:{type:Number}}}get isActive(){return!(this.prepaidShipmentsOptedIn>0)&&this.subscribed}handleClick(e){if(!this.isActive){let e=this.frequencies&&this.frequencies.length>0?this.frequencies[0]:this.optinFrequency;this.optinProduct(ao(this),e,this.offer)}e.preventDefault()}render(){return Fn`
      <slot name="default">
        <button id="action-trigger" class="btn radio ${this.isActive?" active":""}"></button>
        <label for="action-trigger">
          <slot>
            <slot name="label"><og-text key="offerOptInLabel"></og-text></slot>
          </slot>
        </label>
      </slot>
    `}};a(ys,"SubscriptionButton");var ms=Bi(Mo,{optinProduct:Or})(ys),bs=class extends ro{static get styles(){return eo`
      :host {
        position: fixed;
        top: 5em;
        righit: 5em;
        background-color: rgba(255, 255, 255, 0.7);
        width: 400px;
        padding: 1em;
        border-radius: 5px;
        border: 1px solid #ccc;
        box-shadow: 2px 2px 0 0 #000;
      }

      button {
        margin: 0 0.5em 0.5em;
        background-color: gray;
        color: white;
        border: 0;
        border-radius: 3px;
        cursor: pointer;
        padding: 0.5em;
      }

      button.primary {
        background-color: blue;
        padding: 1em;
        color: white;
        border: 0;
        border-radius: 3px;
      }

      button[disabled] {
        background-color: #777;
      }

      div {
        margin-bottom: 0.5em;
      }

      .message {
        margin-left: 0.5em;
        margin: 1em;
      }

      .success {
        color: green;
      }

      .error {
        color: red;
      }

      .warning {
        color: orange;
      }
      a {
        color: white;
      }
    `}runTests(){this.results=[],this.disabled=!0,this.requestUpdate(),document.querySelectorAll("og-offer").forEach(e=>{let t=e.store.getState(),r=e.getAttribute("product"),i=e.getAttribute("location"),n={messages:this.getOfferAttributeMessages(r,i).concat(this.getOfferRequestMessages(r,t)),product:r};this.results.push(n)}),this.testsRan=!0,this.disabled=!1,this.requestUpdate()}getOfferAttributeMessages(e,t){let r=[];return e||r.push({name:"Offer element found but missing product attribute",type:"error"}),t||r.push({name:"Offer element found but missing location attribute",type:"warning"}),e&&t&&r.push({name:"Offer element found and properly tagged",type:"success"}),r}getOfferRequestMessages(e,t){let r=t.inStock[e],i=t.autoshipEligible[e],n=[];return e&&!1===r&&n.push({name:"This product is marked as out of stock in the OG database",type:"warning"}),e&&!1===i&&n.push({name:"This product is not eligible for autoship",type:"warning"}),e&&null===r&&null===i&&n.push({name:"This product does not exist in our database",type:"error"}),n}resultsCodeBlock(){return 0===this.results.length?Fn`
          <div class="message error">No offer element found on the page</div>
        `:this.results.map((e,t)=>Fn`
            <div>For offer tag with product = "${e.product}"</div>
            ${e.messages.map(e=>Fn`
                <div class="message ${e.type}">${e.name}</div>
              `)}
            <button @click=${this.toggleProductFlags(t,{})}>Set inStock and eligible</button>
            <br />
            <button @click=${this.toggleProductFlags(t,{inStock:!1})}>Set to not inStock</button>
            <br />
            <button @click=${this.toggleProductFlags(t,{autoship:!1})}>Set to not eligible</button>
            <br />
            <button @click=${this.toggleProductFlags(t,{autoship:!1,inStock:!1})}>
              Set to not eligible and not in stock
            </button>
            <br />
            <button @click=${this.toggleUpsellPreview(t)}>Toggle upsell/regular in this offer</button>
            <br />
            <button @click=${this.toggleUpsellNextOrder(t)}>upsell product is in next order</button>
            <br />
          `)}toggleUpsellPreview(e){return t=>{t.preventDefault();let r=document.querySelectorAll("og-offer")[e];r.getAttribute("preview-upsell-offer")?r.removeAttribute("preview-upsell-offer"):r.setAttribute("preview-upsell-offer",!0),this.runTests()}}toggleProductFlags(e,{inStock:t=!0,autoship:r=!0,groups:i=["subscription","upsell"]}){return n=>{n.preventDefault();let o=document.querySelectorAll("og-offer")[e],a=o.product.id;o.store.dispatch(zr({in_stock:{[a]:t},eligibility_groups:{[a]:i},result:"success",autoship:{[a]:r},module_view:{regular:"58a01e9aacbe40389b5c7325d79091bb"},modifiers:{},incentives_display:{"47c01e9aacbe40389b5c7325d79091aa":{field:"sub_total",object:"order",type:"Discount Percent",value:5},e6534b9d877f41e586c37b7d8abc3a58:{field:"total_price",object:"item",type:"Discount Percent",value:5},f35e842710b24929922db4a529eecd40:{field:"total_price",object:"item",type:"Discount Percent",value:10},"5be321d7c17f4e18a757212b9a20bfcc":{field:"total_price",object:"item",type:"Discount Percent",value:1}},incentives:{[a]:{initial:["5be321d7c17f4e18a757212b9a20bfcc"],ongoing:["e6534b9d877f41e586c37b7d8abc3a58","47c01e9aacbe40389b5c7325d79091aa","f35e842710b24929922db4a529eecd40"]}}},{},a)),this.runTests()}}toggleUpsellNextOrder(e){return t=>{let r=document.querySelectorAll("og-offer")[e],i=r.product.id;t.preventDefault(),r.store.dispatch(Lr({count:1,next:null,previous:null,results:[{order:"24d50352579511ea806cbc764e100cfd",offer:null,subscription:"8a076b7a0ea011e7a5bcbc764e105eda",product:i,components:[],quantity:1,public_id:"24d6901e579511ea806cbc764e100cfd",product_attribute:null,price:"14.99",extra_cost:"0.00",total_price:"13.49",one_time:!1,frozen:!1,first_placed:null}]})),this.runTests()}}render(){return Fn`
      <div>
        ${this.testsRan?this.resultsCodeBlock():Fn`
              <div>Click the button to run tests</div>
            `}
        <button ?disabled=${this.disabled} @click="${this.runTests.bind(this)}" class="primary">Run Test</button>
      </div>
    `}};function vs(){let e="og-test-wizard";customElements.get(e)||customElements.define(e,bs);let t=document.createElement(e);document.body.appendChild(t)}a(bs,"TestWizard"),a(vs,"default");var _s=[79,71,68,69,86],Ss=a(()=>{if(window.OG_OFFERS_TEST_MODE_ENABLE)return;window.OG_OFFERS_TEST_MODE_ENABLE=!0;let e=0;document.addEventListener("keyup",async function(t){if(t.which===_s[e]){let t=_s[e];setTimeout(function(){e<=t&&(e=0)},5e3),e+=1,e>=_s.length&&vs()}else e=0},!1)},"enable"),ws=class extends(uo(Do)){static get properties(){return{...super.properties,regular:{type:Boolean,reflect:!0},subscription:{type:Boolean,reflect:!0},discount:{type:Boolean,reflect:!0},payAsYouGo:{type:Boolean,reflect:!0,attribute:"pay-as-you-go"},frequency:{type:Object},productPlans:{type:Object},discountedProductPriceFromOffers:{type:Object}}}static get styles(){return eo`
      :host::before {
        clip-path: inset(100%);
        clip: rect(1px, 1px, 1px, 1px);
        height: 1px;
        overflow: hidden;
        position: absolute;
        white-space: nowrap;
        width: 1px;
      }

      :host([subscription])::before {
        content: 'Discounted subscription price';
      }

      :host([regular])::before {
        content: 'Regular price';
      }
    `}get value(){var e,t;let r=pr(this.product),i=this.frequency||this.configDefaultFrequency||(null==(e=this.offer)?void 0:e.defaultFrequency),n=this.productPlans[r]||[],o=this.payAsYouGo?n.find(e=>null===e.prepaidShipments||void 0===e.prepaidShipments):n.find(e=>e.frequency===i);if(!o)return"";let{regularPrice:a,discountRate:s,subscriptionPrice:l}=o;return(!1===o.hasPriceAdjustments||(null==(t=this.offer)?void 0:t.overrideSellingPlanPrice))&&!o.prepaidShipments&&({regularPrice:a,discountRate:s,subscriptionPrice:l}=this.discountedProductPriceFromOffers),l!==a||this.payAsYouGo?this.regular?a:this.discount?s:l:""}render(){let e=this.value;return e?Fn`
        <slot name="prepend"></slot>
        ${e}
        <slot name="append"></slot>
      `:Fn`
      <slot name="fallback"></slot>
    `}};a(ws,"Price");var Ps=a((e,t)=>{var r,i;return{productPlans:e.productPlans,configDefaultFrequency:Kt(null==(r=t.product)?void 0:r.id)(e),frequency:Gt(t.product)(e),discountedProductPriceFromOffers:er(null==(i=t.product)?void 0:i.id)(e)}},"mapStateToProps"),Os=Bi(Ps)(ws);function xs(e){Ss(),Vi(e);try{customElements.define("og-when",Ao),customElements.define("og-text",la),customElements.define("og-incentive-text",Pa),customElements.define("og-benefit-messages",qa),customElements.define("og-offer",Ja),customElements.define("og-select-frequency",ka),customElements.define("og-optout-button",zo),customElements.define("og-optin-toggle",na),customElements.define("og-optin-status",Lo),customElements.define("og-optin-button",Bo),customElements.define("og-optin-select",Ko),customElements.define("og-upsell-button",Xo),customElements.define("og-frequency-status",Jo),customElements.define("og-modal",Ya),customElements.define("og-select",Qa),customElements.define("og-tooltip",ts),customElements.define("og-upsell-modal",ra),customElements.define("og-next-upcoming-order",$a),customElements.define("og-price",Os),customElements.define("og-prepaid-toggle",as),customElements.define("og-prepaid-data",us),customElements.define("og-prepaid-button",ps),customElements.define("og-prepaid-select",gs),customElements.define("og-subscription-button",ms)}catch{console.info("OG WebComponents already registered, skipping.")}let t=!1,r={store:e,isReady:()=>t,setEnvironment(t){return e.dispatch(Br(t)),this},setMerchantId(t){return e.dispatch(kr(t)),this},setAuthUrl(t){return e.dispatch($r(t)),this},receiveMerchantSettings(t){return e.dispatch(si(t)),this},getProductsForPurchasePost:(t=[])=>zi(e.getState(),t),getOptins:(t=[])=>zi(e.getState(),t),clear(){e.dispatch(Jr())},addOptinChangedCallback(e){"function"==typeof e&&document.addEventListener("optin-changed",t=>e(t.detail))},disableOptinChangedCallbacks(){document.addEventListener("optin-changed",e=>e.stopPropagation(),!0)},register(){},previewMode(e){return window.og=window.og||{},!1===e?delete window.og:(window.og.previewMode=!0,console.log("OG Offers preview mode enabled")),this},config(t){return e.dispatch(ti(t)),this},setLocale(t){return e.dispatch(ei(t)),this},setBenefitMessages(t){return e.dispatch(ri(t)),this},addTemplate(t,r,i){return e.dispatch(ii(t,r,i)),this},setTemplates(t){return e.dispatch(ni(t)),this},setPublicPath(e){return this},resolveSettings(t,r,i,n=e){if(!ct.shopify_selling_plans&&t&&r&&i){let e=[];i.product?e.push(i.product):i.cart&&Array.isArray(i.cart.products)&&(e=e.concat(i.cart.products));let t=n.getState(),{sessionId:r}=t;r&&e.forEach(e=>n.dispatch(Hr(e))),i.product_discounts&&"object"==typeof i.product_discounts&&n.dispatch({type:ke,payload:i.product_discounts})}},initialize(i,n,o,a={}){var s;t&&console.warn("og.offers has been initialized already. Skipping.");let l=e.getState();return i&&i!==l.merchantId&&r.setMerchantId(i),n&&n!==(null==(s=l.environment)?void 0:s.name)&&r.setEnvironment(n),r.receiveMerchantSettings(a),o&&r.setAuthUrl(o),t||r.resolveSettings(i,n,window.og_settings,e),t=!0,this}};return window.OG=window.OG||{},Object.assign(window.OG,r),Object.assign(r.initialize,r),Di(window.opener,r),r}a(xs,"makeApi");var Es=a((e=[],t)=>{switch(t.type){case Ce:return[];case Ee:return t.newValue?t.newValue.optedin:e;case K:case Q:{let[{prepaidShipments:r,...i},n]=Pr(e,t.payload.product);return n.concat({...i,...t.payload.product,frequency:t.payload.frequency})}case X:{let{payload:r}=t,[{prepaidShipments:i,...n},o]=Pr(e,r.product),a={...n,...r.product};return r.prepaidShipments&&(a.prepaidShipments=r.prepaidShipments),o.concat(a)}case Z:return e.filter(e=>!Nt(t.payload.product,e));case ie:return e.map(e=>Nt(t.payload.product,e)?{...e,...t.payload.newProduct}:e);case me:return e.filter(e=>!Nt(t.payload.product,e));case be:return[];default:return e}},"optedin"),Cs=a((e=[],t)=>{switch(t.type){case Ce:return[];case Ee:return t.newValue?t.newValue.optedout:e;case K:case Q:return e.filter(e=>!Nt(t.payload.product,e));case Z:{let[r,i]=Pr(e,t.payload.product);return i.concat({...r,...t.payload.product,frequency:t.payload.frequency})}case ie:return e.map(e=>Nt(t.payload.product,e)?{...e,...t.payload.newProduct}:e);case be:return[];default:return e}},"optedout"),qs=a((e={},{type:t,payload:r})=>{switch(t){case le:return r&&r.count>0?{...e,...r.results[0]&&{...r.results[0],place:new Date(Date.parse(r.results[0].place.replace(/-/gi,"/")))}}:e;case ce:return{...e,products:(r.results||[]).map(e=>e.product)};case ye:return{...e,...r,public_id:r.order,...r.product&&{products:(e.products||[]).concat(r.product)}};default:return e}},"nextUpcomingOrder"),Ts=a((e={},t)=>t.type===re?{...e,...t.payload.autoship}:e,"autoshipEligible"),ks=a((e={},t)=>{switch(t.type){case te:return{...e};case re:return{...e,...t.payload.in_stock};default:return e}},"inStock"),As=a((e={},t)=>t.type===re?{...e,...t.payload.eligibility_groups}:e,"eligibilityGroups"),Is=a((e,t,r)=>e.map(e=>{let i=null==r?void 0:r[e];return{...t[e],...i?{enhanced:!0,criteria:i.criteria?i.criteria:{node_type:"PREMISE",standard:Ue,premise_value:null},threshold_field:i.threshold_field,threshold_value:i.threshold_value}:{},id:[e][0]}}),"mapIncentive"),Ns=a((e={},t)=>t.type===re?{...e,...[...new Set(Object.keys(t.payload.incentives||{}))].reduce((e,r)=>({...e,[r]:Object.entries(t.payload.incentives).filter(([e])=>e===r).reduce((e,[,{initial:r,ongoing:i}])=>({...e,initial:[...e.initial||[],...Is(r,t.payload.incentives_display,t.payload.incentives_display_enhanced)],ongoing:[...e.ongoing||[],...Is(i,t.payload.incentives_display,t.payload.incentives_display_enhanced)]}),{})}),{})}:e,"incentives"),Fs=a((e={},t)=>{switch(t.type){case K:case Q:return{...e,[pr(t.payload.product)]:t.payload.frequency};case Z:return{...e,[pr(t.payload.product)]:void 0};default:return e}},"frequency"),$s=a((e=!1,t)=>{switch(t.type){case ae:return{...t.payload};case se:return!1;default:return e}},"auth"),Rs=a((e="",t)=>t.type===ee?t.payload:e,"merchantId"),Ds=a((e=null,t)=>t.type===oe?t.payload:e,"authUrl"),js=a((e={},t)=>t.type===re?{...e,offerId:(t.payload.module_view||{}).regular,...t.payload.modifiers}:e,"offer"),Ms=a((e="",t)=>t.type===re?(t.payload.module_view||{}).regular||"":e,"offerId"),Ls=a((e=null,t)=>{switch(t.type){case Ce:return null;case ne:return t.payload;default:return e}},"sessionId"),Us=a((e={},t)=>{switch(t.type){case re:return{...e,...Object.entries(t.payload.autoship).map(([e])=>({[e]:Object.keys(t.payload.modifiers)})).reduce((e,t)=>({...e,...t}),{})};case be:return{};default:return e}},"productOffer"),Bs=a((e={},t)=>t.type===qe?{...e,[pr(t.payload.product)]:t.payload.firstOrderPlaceDate}:e,"firstOrderPlaceDate"),Vs=a((e={},t)=>t.type===Te?{...e,[pr(t.payload.product)]:t.payload.productToSubscribe}:e,"productToSubscribe"),zs=a((e={},t)=>{switch(t.type){case de:return{...e,name:"local",apiUrl:"http://py3web.ordergroove.localhost",legoUrl:"http://py3lego.ordergroove.localhost"};case pe:return{...e,name:Re,apiUrl:"https://staging.offers.ordergroove.com",legoUrl:"https://staging.restapi.ordergroove.com"};case he:return{...e,name:"dev",apiUrl:"https://dev.offers.ordergroove.com",legoUrl:"https://dev.restapi.ordergroove.com"};case fe:return{...e,name:De,apiUrl:"https://offers.ordergroove.com",legoUrl:"https://restapi.ordergroove.com"};default:return e}},"environment"),Gs=a((e={offerOptInLabel:"Subscribe to save",offerIncentiveText:"Save {{ogIncentive DiscountPercent}} when you subscribe",offerOptOutLabel:"Deliver one-time only",offerEveryLabel:"Delivery Every",offerTooltipTrigger:"[?]",offerTooltipContent:"Seems this is a great subscription offering. Many fun details about this program exist.",optinButtonLabel:"•",optoutButtonLabel:"•",optinStatusOptedInLabel:"You're opted in!",optinStatusOptedOutLabel:"You're not opted in.",optinToggleLabel:"•",upsellButtonLabel:"Add item to order on ",upsellButtonPrefix:"",upsellModalContent:"Some upsell modal content",upsellModalOptInLabel:"Subscribe",upsellModalOptOutLabel:"Purchase one time",upsellModalTitle:"Impulse Upsell",upsellModalConfirmLabel:"Ok",upsellModalCancelLabel:"Cancel",defaultFrequencyCopy:"(Most Popular)",frequencyPeriods:{1:"day",2:"week",3:"month"},prepaidOptInLabel:"Prepaid Subscription",prepaidShipmentsLabel:"Number of prepaid shipments"},t)=>t.type===ve?{...e,...t.payload}:e,"locale"),Hs=a((e={offerType:"radio"},t)=>{switch(t.type){case _e:return{...e,...t.payload,defaultFrequency:t.payload.defaultFrequency?ot(t.payload.defaultFrequency):e.defaultFrequency,frequenciesEveryPeriod:[],frequencies:t.payload.frequencies?t.payload.frequencies.map(ot):e.frequencies};case Ne:return{...e,merchantSettings:{...t.payload}};default:return e}},"config"),Ws=a((e=!1,t)=>t.type===we?t.payload.isPreview:e,"previewStandardOffer"),Js=a((e=!1,t)=>t.type===Pe?t.payload.isPreview:e,"previewUpsellOffer"),Ys=a((e={},t)=>t.type===re?{...e,...t.payload.autoship_by_default}:e,"autoshipByDefault"),Ks=a((e=[],t)=>t.type===re?{...e,...t.payload.default_frequencies}:e,"defaultFrequencies"),Zs=a((e=[],t)=>{switch(t.type){case xe:return[...t.payload||[]];case Oe:return[t.payload,...e];default:return e}},"templates"),Qs=a((e={},t)=>t.type===ke?Gi(t.payload):e,"productPlans"),Xs=a((e={},t)=>{switch(t.type){case ue:{let{[t.payload.oldCartProductKey]:r,...i}=e;return{...i,[t.payload.newCartProductKey]:r}}case X:return t.payload.prepaidShipments?{...e,[t.payload.product.id]:t.payload.prepaidShipments}:e;default:return e}},"prepaidShipmentsSelected"),el=a((e={},t)=>e,"price"),tl=a((e={},t)=>t.type===Se?{...t.payload||{}}:e,"benefitMessages"),rl=k({optedin:Es,optedout:Cs,nextUpcomingOrder:qs,autoshipEligible:Ts,inStock:ks,eligibilityGroups:As,incentives:Ns,frequency:Fs,auth:$s,merchantId:Rs,authUrl:Ds,offer:js,offerId:Ms,experiments:Ci,sessionId:Ls,productOffer:Us,firstOrderPlaceDate:Bs,productToSubscribe:Vs,environment:zs,locale:Gs,config:Hs,previewStandardOffer:Ws,previewUpsellOffer:Js,autoshipByDefault:Ys,defaultFrequencies:Ks,templates:Zs,productPlans:Qs,prepaidShipmentsSelected:Xs,price:el,benefitMessages:tl}),il=a(e=>{var t,r;return Array.isArray(null==(t=e.selling_plan)?void 0:t.options)&&(null==(r=e.selling_plan)?void 0:r.options.some(e=>"Shipment amount"===(null==e?void 0:e.name)))},"isPrepaidAllocation"),nl=a(e=>{if(e&&e.length>1){let t=e.find(e=>"Shipment amount"===(null==e?void 0:e.name)).value.split(" ");return t.length>0?+t[0]:null}return null},"getPrepaidShipmentsNumberFromOptions"),ol=a(e=>{var t,r;return(e.selling_plan_id||(null!=(r=null==(t=e.selling_plan)?void 0:t.id)?r:"")).toString()},"getAllocationFrequency"),al=a((e,t)=>bt(e.compare_at_price,t),"getAllocationRegularPrice"),sl=a((e,t)=>{var r;if(il(e)){let i=nl(null==(r=e.selling_plan)?void 0:r.options),n=Math.round(e.price/i);return bt(n,t)}return bt(e.price,t)},"getAllocationSubscriptionPrice"),ll=a((e,t)=>Math.round(100*(e.compare_at_price-t)/e.compare_at_price),"getPrepaidPercentage"),ul=a((e,t)=>{var r,i,n;if(il(e)){let t=nl(null==(r=e.selling_plan)?void 0:r.options),i=e.price/t,n=ll(e,i);return vt(n)}let o="";return"percentage"===(null==(i=e.price_adjustments[0])?void 0:i.value_type)?o=vt(e.price_adjustments[0].value):null!=(n=e.price_adjustments[0])&&n.value?o=bt(e.price_adjustments[0].value,t):e.compare_at_price&&(o=bt(e.compare_at_price-e.price,t)),o},"getAllocationDiscountRate"),cl=a(e=>{var t;return il(e)?nl(null==(t=e.selling_plan)?void 0:t.options):null},"getAllocationNumberOfShipments"),dl=a((e,t,r,i)=>{var n,o;let a=nl(null==(n=e.selling_plan)?void 0:n.options),s=e.price/a,l=e.compare_at_price-s,u=ll(e,s),c=null==(o=null==r?void 0:r.price_adjustments)?void 0:o[0],d=c&&"percentage"===c.value_type?c.value:null;return t.regularPrepaidPrice=bt(e.price,i),t.prepaidSavingsPerShipment=bt(Math.round(l),i),t.prepaidSavingsTotal=bt(Math.round(l*a),i),d&&u&&(t.prepaidExtraSavingsPercentage=vt(u-d)),t},"addPrepaidPriceAndSavings"),pl=a((e,t,r)=>{var i;e.selling_plan||(e.selling_plan=t.find(t=>t.id===e.selling_plan_id));let n={frequency:ol(e),regularPrice:al(e,r),subscriptionPrice:sl(e,r),discountRate:ul(e,r),prepaidShipments:cl(e),hasPriceAdjustments:(null==(i=e.price_adjustments)?void 0:i.length)>0};if(il(e)){let i=xt(t);return dl(e,n,i,r)}return n},"mapSellingPlanToDiscount"),hl=a((e,t,r=[],i)=>[...e,pl(t,r,i)],"sellingPlanAllocationsReducer"),fl=a(e=>e.selling_plan_groups.reduce((e,t)=>[...e,...t.selling_plans.map(e=>({...e,group:t}))],[]),"getSellingPlans"),gl=a((e={offerType:"radio",productFrequencies:{},frequencies:[],frequenciesEveryPeriod:[]},t)=>{var r;if(Ae===t.type){let{payload:{product:i,currency:n}}=t,o={},a=null==(r=i.variants)?void 0:r.reduce((t,r)=>ml(t,r,i.selling_plan_groups,e),{}),s={...e.productFrequencies,...a};o={...o,productFrequencies:s,...Object.values(s)[0]};let l=vl(i);return Object.keys(l).length&&(o={...o,prepaidSellingPlans:{...e.prepaidSellingPlans,...l}}),{...e,...o,storeCurrency:n}}if(re===t.type){let{payload:{offer:r}}=t,{defaultFrequency:i,product:n}=r||{},{prepaidSellingPlans:o={}}=e,a=pr(null==n?void 0:n.id),s=e.productFrequencies[a],l={...e.productFrequencies,[a]:{...s,defaultFrequency:bl(a,i,o,null==s?void 0:s.frequencies,null==s?void 0:s.frequenciesEveryPeriod)}};return{...e,productFrequencies:l,...Object.values(l)[0]}}return Ne===t.type?{...e,merchantSettings:{...t.payload}}:e},"config");function yl(e,t){var r,i;let n=_t(e),o=Et(n);if(null!=o&&o.length){let e=Ct(n),a=(null==(i=null==(r=n.options)?void 0:r[0])?void 0:i.values)||o,s=null==t?void 0:t.defaultFrequency;return s&&br(s)&&(s=Sr(o,e,s)||vr(o)||s),{frequencies:o,frequenciesEveryPeriod:e,frequenciesText:a,...s?{defaultFrequency:s}:{}}}return null}function ml(e,t,r,i){let n=t.selling_plan_allocations.map(e=>e.selling_plan_group_id),o=yl(r.filter(e=>n.includes(e.id)),i.productFrequencies[t.id]);return o&&(e[t.id]=o),e}function bl(e,t,r,i=[],n=[]){var o;return null!=(o=r[e])&&o.some(({sellingPlan:e})=>e===t)?vr(i)||t:br(t)&&(Sr(i,n,t)||vr(i))||t}function vl(e){let t=null==e?void 0:e.selling_plan_groups.filter(e=>/^Prepaid-.*/.test(e.name));return t.length?t.reduce((e,t)=>{let r=t.name.split("-")[1],i=t.selling_plans.map(e=>({numberShipments:Tt(e),sellingPlan:String(e.id)}));return{...e,[r]:i}},{}):{}}a(yl,"getFrequencies"),a(ml,"reduceSellingPlansToFrequencies"),a(bl,"getUpdatedDefaultFrequency"),a(vl,"getPrepaidSellingPlans");var _l=gl,Sl=a((e,t,r)=>{let i=Object.keys(e).filter(e=>e.startsWith(t.toString()));return i.length?{...e,...i.reduce((e,t)=>({...e,[t]:r}),{})}:e},"overrideLineKey"),wl=a((e,t,r)=>{if(!r)return null;if(!br(r))return r;if(_r(e,t)){return Sr(e,t,r)||vr(e)}return r},"getDefaultSellingPlan"),Pl=a((e,t,r)=>e.map(e=>br(null==e?void 0:e.frequency)?{...e,frequency:_r(null==r?void 0:r.frequencies,null==r?void 0:r.frequenciesEveryPeriod)?Sr(null==r?void 0:r.frequencies,null==r?void 0:r.frequenciesEveryPeriod,e.frequency)||Sr(null==r?void 0:r.frequencies,null==r?void 0:r.frequenciesEveryPeriod,null==t?void 0:t.defaultFrequency)||vr(null==r?void 0:r.frequencies):e.frequency}:e),"mapExistingOptinsFromOfferResponse"),Ol=a(({autoship:e={},autoship_by_default:t={},default_frequencies:r={},in_stock:i={},eligibility_groups:n={}},o,a,s,l)=>Object.keys(e).reduce((u,c)=>{var d;if(!o.some(e=>e.id===c)&&t[c]&&i[c]){if(e[c])return u.concat({id:c,frequency:xl({frequencyConfig:s,offerEl:a,default_frequencies:r,id:c})});if(null!=(d=n[c])&&d.includes(Be)){let e=l?kt(l):null;return u.concat({id:c,frequency:(null==e?void 0:e.sellingPlan)||Il,prepaidShipments:(null==e?void 0:e.numberShipments)||null})}}return u},[]),"reduceNewOptinsFromOfferResponse"),xl=a(({frequencyConfig:e,offerEl:t,default_frequencies:r,id:i})=>{let n,{frequencies:o,frequenciesEveryPeriod:a}=e,{defaultFrequency:s}=t||{},l=r[i];return n=r[i]&&_r(o,a)?Sr(o,a,`${l.every}_${l.every_period}`)||wl(o,a,s)||vr(o):r[i]?`${l.every}_${l.every_period}`:wl(o,a,s)||"_",n},"getOptInDefaultFrequency"),El=a((e,t)=>({...Sl(e,t.id,t.available),[t.id]:t.available}),"productOrVariantInStockReducer"),Cl=a((e,t)=>{let r=pr(t.key);return{...e,[t.key]:e[r]||null}},"reduceProductCartLine"),ql=a((e={},t)=>{var r;if(Ie===t.type){let{payload:r}=t;return r.items.reduce(Cl,e)}if(Ae===t.type){let{payload:{product:i}}=t,n=St(null==i?void 0:i.selling_plan_groups),o=new Set(null!=(r=n.flatMap(e=>e.selling_plans.map(e=>e.id)))?r:[]);return i.variants.reduce((e,t)=>{var r,i;let n=(null!=(i=null==(r=null==t?void 0:t.selling_plan_allocations)?void 0:r.filter(e=>o.has(e.selling_plan_id)))?i:[]).length>0;return{...Sl(e,t.id,n),[t.id]:n}},e)}return we===t.type?!0!==t.payload.isPreview?e:{...e,[t.payload.productId]:!0}:e},"autoshipEligible"),Tl=a((e={},t)=>{var r;if(Ie===t.type)return t.payload.items.reduce(Cl,e);if(Ae===t.type){let{payload:{product:i}}=t;return[i,...null!=(r=null==i?void 0:i.variants)?r:[]].reduce(El,e)||e}return te===t.type&&null===t.payload.product?{...e}:we===t.type?!0!==t.payload.isPreview?e:{...e,[t.payload.productId]:!0}:e},"inStock"),kl=a((e={},t)=>e,"offer");function Al(e){let t=Tt(e.selling_plan_allocation.selling_plan),r={id:e.key,frequency:`${e.selling_plan_allocation.selling_plan.id}`};return t&&(r.prepaidShipments=t),r}a(Al,"getOptedInItem");var Il="prepaid-replace-me",Nl=a((e=[],t)=>{if(Ie===t.type){let r=t.payload;return e.filter(e=>!e.id.includes(":")).concat(r.items.reduce((e,t)=>t.selling_plan_allocation?[...e,Al(t)]:e,[]))}if(re===t.type){let r=t.payload,{offer:i={},frequencyConfig:n,prepaidSellingPlans:o}=r,a=Pl(e,i,n),s=Ol(r,a,i,n,o);return[...a,...s]}if(Ae===t.type){let{product:r}=t.payload,i=_t(null==r?void 0:r.selling_plan_groups),n=vl(r),o=i?Et(i):[],a=i?Ct(i):[];return e.map(e=>{let t=n[e.id];if(i&&br(e.frequency))return{...e,frequency:Sr(o,a,e.frequency)||vr(o)};if(e.frequency===Il&&(null==t?void 0:t.length)>0){let{sellingPlan:r,numberShipments:i}=kt(t);return{...e,frequency:r,prepaidShipments:i}}return e}).filter(e=>e.frequency!==Il)}if(X===t.type){let{payload:r}=t,i=Es(e,t),[n,o]=Pr(i,r.product);return o.concat({...n,...r.product,frequency:r.frequency})}return Es(e,t)},"optedin"),Fl=a((e={},t)=>{var r;if(Ae===t.type){let{payload:{product:i}}=t;return(null==(r=i.variants)?void 0:r.reduce((e,t)=>({...e,[t.id]:{value:t.price}}),e))||e}return e},"price"),$l=a((e={},t)=>e,"productOffer"),Rl=a((e={},t)=>{if(Ae===t.type){let{payload:{product:r,currency:i}}=t,n=fl(r);return r.variants.reduce((e,t)=>{var r;return{...e,[t.id]:null==(r=t.selling_plan_allocations)?void 0:r.reduce((e,t)=>hl(e,t,n,i),[])}},e)||e}if(Ie===t.type){let r=t.payload;return r.items.reduce((e,t)=>t.selling_plan_allocation?{...e,[t.key]:hl([],t.selling_plan_allocation,[],r.currency)}:e,e)||e}return e},"productPlans"),Dl=k({auth:$s,authUrl:Ds,autoshipByDefault:Ys,autoshipEligible:ql,config:_l,defaultFrequencies:Ks,eligibilityGroups:As,environment:zs,firstOrderPlaceDate:Bs,incentives:Ns,inStock:Tl,locale:Gs,merchantId:Rs,nextUpcomingOrder:qs,offer:kl,offerId:Ms,experiments:Ci,optedin:Nl,optedout:Cs,previewStandardOffer:Ws,previewUpsellOffer:Js,price:Fl,productOffer:$l,productPlans:Rl,productToSubscribe:Vs,sessionId:Ls,templates:Zs,prepaidShipmentsSelected:Xs,benefitMessages:tl});function jl(e,t){return window.og&&window.og.previewMode?rl(e,t):Dl(e,t)}a(jl,"shopifyReducer");var Ml=c(p()),Ll=c(d());function Ul(e,t,r){let i=`[name="id"][value="${e}"]`,n=`form[action="/cart/add"] option[value="${e}"]`;if(!t)return;let o=document.querySelectorAll(i);o.length||(o=document.querySelectorAll(n)),[...o].forEach(e=>{let i=e.form,n=null==i?void 0:i.querySelector(`[name="${t}"]`);n||(n=document.createElement("input"),n.type="hidden",n.name=`attributes[${t}]`,null==i||i.appendChild(n)),n.value=r})}function Bl(){return`og__${Math.ceil((new Date).getTime()/1e3)}`}function Vl(e,t){var r,i,n,o;if(!(null==(r=e.payload.offer)?void 0:r.autoshipByDefault))return;let a=null==(i=e.payload.offer)?void 0:i.product.id,s=Bl(),l=(null==(n=e.payload.offer)?void 0:n.location)||"",u=(null==(o=e.payload.offer)?void 0:o.variationId)||"",c=lu(a,t),d=[a,K.toLowerCase(),l,c,u].join(",");Ul(a,s,d)}function zl(e){return t=>r=>{switch(t(r),r.type){case K:case Z:case Q:{let e=r.payload.offer,t=su(r);e&&!e.isCart&&Ul(e.product.id,t[0],t[1]);break}case re:Vl(r,e)}}}a(Ul,"updateTrackingInputs"),a(Bl,"getTrackingKey"),a(Vl,"addDefaultToSubTracking"),a(zl,"shopifyTrackingMiddleware");var Gl,Hl,Wl=(null==(Hl=null==(Gl=window.Shopify)?void 0:Gl.routes)?void 0:Hl.root)||"/",Jl=`${Wl}cart.js`,Yl=`${Wl}cart/change.js`,Kl=`${Wl}cart/update.js`,Zl=`${Wl}products/`,Ql="__ordergroove_offer_id",Xl=a(e=>(0,Ll.debounce)(100,!1,function(t){let{id:r}=Object.fromEntries([...new FormData(t).entries()]);r?e.setAttribute("product",r):e.removeAttribute("product")}),"makeSyncProductId");async function eu(){var e,t;return(null==(t=null==(e=window.Shopify)?void 0:e.currency)?void 0:t.active)||(await ru()).currency}async function tu(e,t){let r=iu(t);if(r)try{let[i,n]=await Promise.all([nu(r),eu()]),o={product:i,offer:t,currency:n};e.dispatch({type:Ae,payload:o})}catch(e){console.warn("OG: Unable to fetch product details for PDP",e)}let i=t.closest("form");if(!i){let e=t.parentElement;for(;e&&(i=e.querySelector('form[action$="/cart/add"]'),!i&&"body"!==e.tagName.toLowerCase());)e=e.parentElement}if(i){let e=Xl(t);i.addEventListener("change",()=>e(i)),new MutationObserver(t=>{t.every(e=>"attributes"===e.type)?t.some(e=>"id"===e.target.name)&&e(i):e(i)}).observe(i,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["value"]})}else console.info("no /cart/add form found for og-offer",t)}async function ru(){return(await fetch(Jl)).json()}function iu(e){return[()=>null==e?void 0:e.dataset.shopifyProductHandle,()=>{var e,t;return((null==(t=null==(e=document.querySelector('[href$=".oembed"]'))?void 0:e.getAttribute("href"))?void 0:t.match(/\/([^/]+)\.oembed$/))||[])[1]},()=>{var e,t;return(document.querySelector('meta[property="og:type"][content="product"]')&&(null==(t=null==(e=document.querySelector('meta[property="og:url"][content]'))?void 0:e.getAttribute("content"))?void 0:t.match(/\/([^/]+)$/))||[])[1]},()=>{var e;return null==(e=[...document.querySelectorAll("[type$=json]")].map(e=>JSON.parse(e.textContent||"{}")).find(e=>e.handle&&e.price))?void 0:e.handle}].reduce((e,t)=>e||t(),"")}a(eu,"getCurrency"),a(tu,"setupPdp"),a(ru,"getCart"),a(iu,"guessProductHandle");var nu=(0,Ml.default)(async function(e){return(await fetch(`${Zl}${e}.js`)).json()});async function ou(e,t){let r=await ru(),{items:i}=r,n=r;e.dispatch({type:Ie,payload:n});let o=Number(t.product.id);o<=i.length&&t.setAttribute("product",i[o-1].key),(await Promise.all(Array.from(new Set(i.map(({handle:e})=>e))).map(nu))).forEach(i=>{let n={product:i,offer:t,currency:r.currency};e.dispatch({type:Ae,payload:n})})}async function au(e,t){var r,i;let n=e.payload.offer,o=e.payload.frequency||lu(e.payload.product.id,t),a=su(e);if(null!=n&&n.isCart)try{n.style.pointerEvents="none",n.style.opacity=".7";let s=Array.from(document.querySelectorAll('[id^="shopify-section-"][id$=__cart-items], [id^="shopify-section-"][id$="__cart-footer"],#cart-live-region-text,#cart-icon-bubble')),l=e.payload.product.id,u=await ru(),c=null==(r=null==u?void 0:u.items)?void 0:r.findIndex(e=>e.key===l),d=u.items[c],p=d.quantity,h=pr(l),f=uu(t),g={...Object.fromEntries([a]),...f?{[Ql]:f}:{}};if(Object.keys(g).length>0&&200!==(await fetch(Kl,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:g})})).status)throw new Error("Cart attributes not updated");let y=await fetch(Yl,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:l,quantity:p,properties:d.properties,selling_plan:o||null,sections:s.map(e=>e.id.replace(/^shopify-section-/,""))})});if(200!==y.status)throw new Error("Cart not updated");let m=await y.json(),b=u.items.length===m.items.length?m.items[c].key:null==(i=m.items.find(e=>e.quantity===p&&e.product_id===h&&(!o&&!e.selling_plan_allocation||(null==e?void 0:e.selling_plan_allocation.selling_plan.id)===o)))?void 0:i.key;b&&(t.dispatch({type:ue,payload:{oldCartProductKey:l,newCartProductKey:b}}),n.setAttribute("product",b));let v=m;t.dispatch({type:Ie,payload:v});let _=new CustomEvent("og-cart-updated",{bubbles:!0,cancelable:!0});if(n.dispatchEvent(_),_.defaultPrevented)return;let S=m.sections;Object.values(S).length?s.forEach(e=>{let t=e.id.replace(/^shopify-section-/,"");if(!(t in S))return;let r=S[t],i=(new DOMParser).parseFromString(r.toString()||"","text/html").getElementById(e.id);i&&(e.innerHTML=i.innerHTML)}):window.location.pathname.startsWith("/cart")&&window.location.reload()}catch(e){console.log("OG Error updating cart",e)}finally{n.style.pointerEvents="auto",n.style.opacity="1"}}function su(e){var t,r;let i=e.payload.product.id;if(!i)return[];let n=Bl(),o=(null==(t=e.payload.offer)?void 0:t.location)||"",a=(null==(r=e.payload.offer)?void 0:r.variationId)||"",s=[i,e.type.toLowerCase(),o];switch(e.type){case te:case Z:s.push(""),s.push(a);break;case K:case Q:s.push(e.payload.frequency),s.push(a);break;default:return[]}return[n,s.join(",")]}function lu(e,t){let r=Ut({id:e})(t.getState());return r?r.frequency:void 0}function uu(e){let t=e.getState();return ar(t)?t.offerId:null}function cu(e,t){null!=t&&t.isCart||null==t||!t.shouldEnableOffer||[...document.querySelectorAll('form[action$="/cart/add"] [name=id]')].forEach(t=>{let r=lu(t.value,e);wr(t.form,"selling_plan",r),wr(t.form,"attributes[og__session]",e.getState().sessionId);let i=uu(e);i&&wr(t.form,`attributes[${Ql}]`,i)})}function du(e){return t=>r=>{var i;switch(r.type){case K:case Z:case Q:break;case te:null!=(i=r.payload.offer)&&i.isCart?ou(e,r.payload.offer):tu(e,r.payload.offer)}switch(t(r),r.type){case K:case Z:case Q:case X:au(r,e);case te:case re:case Ae:cu(e,r.payload.offer)}}}a(ou,"setupCart"),a(au,"synchronizeCartOptin"),a(su,"getTrackingEvent"),a(lu,"getSubscribedFrequency"),a(uu,"getOfferIdAttribute"),a(cu,"synchronizeSellingPlan"),a(du,"shopifyMiddleware");var pu="og_auth_begin",hu=a(e=>{let[t,r,i,n]=atob(e).split("|");return{id:t,signature:i,timestamp:r,email:n}},"parseIntegrationTempAuth");async function fu({store:e}){var t;let[r]=dr(),i=cr(),n=null!=i&&i.dataset.customer?hu(i.dataset.customer):null==(t=window.ogShopifyConfig)?void 0:t.customer;if(n){let t=await yu(n);if(t){let[i,n,o]=t.split("|");e.dispatch(Nr(r,i,Number(n),o))}}else yr("og_auth"),e.dispatch(Fr("No customer found"))}async function gu(e){try{let t=await(await fetch(`/apps/subscriptions/auth/?customer=${e.id}&customer_signature=${e.signature}&customer_timestamp=${e.timestamp}`)).text(),r=t.lastIndexOf(pu);if(r<0)throw"Invalid response from OG auth endpoint";return JSON.parse(t.substring(r+13,t.lastIndexOf("og_auth_end")))}catch(e){console.error(e)}}async function yu(e){let t=mr("og_auth");if(t)return t;let{customerId:r,timestamp:i,signature:n}=await gu(e);if(!r)return"";let o=new Date,a=btoa(n);o.setTime(o.getTime()+72e5);let s=`${r}|${i}|${a}`;return document.cookie=`og_auth=${s};expires=${o.toUTCString()};secure;path=/`,s}a(fu,"authorizeShopifyCustomer"),a(gu,"fetchOGSignature"),a(yu,"getOrCreateAuthCookie");var mu,bu,vu,_u=Ai(...null!=(mu=ct)&&mu.shopify_selling_plans?[jl,du]:[rl],ct.shopify&&zl),Su=xs(_u),wu=Su.isReady,Pu=Su.addOptinChangedCallback,Ou=Su.addTemplate,xu=Su.clear,Eu=Su.config,Cu=Su.disableOptinChangedCallbacks,qu=Su.getOptins,Tu=Su.getProductsForPurchasePost,ku=Su.initialize,Au=Su.previewMode,Iu=Su.register,Nu=Su.resolveSettings,Fu=Su.setAuthUrl,$u=Su.setBenefitMessages,Ru=Su.setEnvironment,Du=Su.setLocale,ju=Su.setMerchantId,Mu=Su.setPublicPath,Lu=Su.setTemplates,Uu=Su.setupCart,Bu=Su.setupProduct,Vu=Su.setupProducts,zu=a(()=>gr(Su),"autoInit"),Gu=Su.initialize;return null!=(bu=ct)&&bu.shopify_selling_plans&&ur(()=>fu(Su)),vu=S,u(t({},"__esModule",{value:!0}),vu)})());
//# sourceMappingURL=/sm/49db6bb62e04c178211a155abbaf5ce4824cb08abd276148e1858691a39d790c.map