@artisan-commerce/analytics-web 0.1.0-canary.11 → 0.1.0-canary.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/main.bundle.js
CHANGED
|
@@ -16,7 +16,7 @@ e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=
|
|
|
16
16
|
*/
|
|
17
17
|
var n=r(28),o=r(29),i=r(30);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|d(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|d(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|d(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function h(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return _(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,a=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,c/=2,r/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var s=-1;for(i=r;i<u;i++)if(l(t,i)===l(e,-1===s?0:i-s)){if(-1===s&&(s=i),i-s+1===c)return s*a}else-1!==s&&(i-=i-s),s=-1}else for(r+c>u&&(r=u-c),i=r;i>=0;i--){for(var f=!0,p=0;p<c;p++)if(l(t,i+p)!==l(e,p)){f=!1;break}if(f)return i}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return w(t,e,r,n)}function j(t,e,r,n){return q(H(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function _(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&l)<<6|63&i)>127&&(s=c);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(c=(15&l)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function A(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function k(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return i||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},c.byteLength=h,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?_(this,0,t):y.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(i,a),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){i=l[f],a=s[f];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return j(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,a=1,u=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=c.isBuffer(t)?t:N(new c(t,n).toString()),u=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%u]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(27))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),a=n[0],u=n[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),s=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(s(t,a,a+16383>u?u:a+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=a.length;u<c;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
|
|
18
18
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
19
|
-
e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-s)-1,d>>=-s,s+=u;s>0;i=256*i+t[e+f],f+=p,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=n;s>0;a=256*a+t[e+f],f+=p,s-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=l}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,c,l=8*i-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=s?(u=0,a=s):a+f>=1?(u=(e*c-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&u,d+=h,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+d]=255&a,d+=h,a/=256,l-=8);t[r+d-h]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"getCategories",(function(){return q})),r.d(e,"getProductDetails",(function(){return St})),r.d(e,"getProducts",(function(){return kt})),r.d(e,"getRecommendedProducts",(function(){return xt})),r.d(e,"getRelatedProducts",(function(){return Tt})),r.d(e,"getStoreDetails",(function(){return Ut})),r.d(e,"registerModifiersForm",(function(){return ne})),r.d(e,"validateProduct",(function(){return ue})),r.d(e,"initProducts",(function(){return pe})),r.d(e,"getProductTotals",(function(){return de})),r.d(e,"transformers",(function(){return i})),r.d(e,"assertions",(function(){return n})),r.d(e,"modifierUtils",(function(){return o}));var n={};r.r(n),r.d(n,"isBaseProduct",(function(){return c})),r.d(n,"isProductDetails",(function(){return l})),r.d(n,"isCartProduct",(function(){return s})),r.d(n,"isFormCartProduct",(function(){return f}));var o={};r.r(o),r.d(o,"multiplyProductQA",(function(){return m})),r.d(o,"divideProductQA",(function(){return w})),r.d(o,"operationOnProductQA",(function(){return P}));var i={};r.r(i),r.d(i,"toCartProduct",(function(){return I})),r.d(i,"toFormCartProduct",(function(){return A})),r.d(i,"toFormCartProductHelper",(function(){return E})),r.d(i,"toFormCartProductFromProductDetails",(function(){return k})),r.d(i,"toFormCartProductFromAnswer",(function(){return x})),r.d(i,"normalizeProductDetails",(function(){return T}));var a=r(2),u=function(t){console.error(t)},c=function(t){var e=t.attributes,r=t.description,n=t.name,o=t.images,i=t.prices,a=t.productId;return"boolean"==typeof e.showInMenu&&"string"==typeof r&&"string"==typeof n&&"string"==typeof a&&!("object"!=typeof i||"object"==typeof i&&Object.keys(i).length<1)&&!!Array.isArray(o)},l=function(t){if(!c(t))return!1;var e=t.questions;return!!Array.isArray(e)},s=function(t){if(!l(t))return!1;var e,r=t.hash,n=t.createdAt,o=t.updatedAt,i=t.amount,u=t.priceCategory,c=t.comment,s=t.questionsAndAnswers;return"string"==typeof r&&"string"==typeof n&&"string"==typeof o&&"number"==typeof i&&"string"==typeof c&&!!(e=a.PriceCategoryType,Object.keys(e)).includes(u)&&!!Array.isArray(s)},f=function(t){var e;if(!s(t))return!1;var r=t.questions;if(!Array.isArray(r))return!1;var n=null===(e=null==r?void 0:r[0])||void 0===e?void 0:e.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},p=function(t){var e=t.min,r=t.max,n=t.type;if(n)return"QUANTITY"===n||"SELECT"===n?"COUNTER":n;if(0===e&&1===r)return"CHECKBOX";if(1===e&&1===r)return"RADIO";if(0===e&&(0===r||r===1/0))return"COUNTER";if(r>=e)return"COUNTER";throw new Error("Modifier group bad configured. min "+e+", max "+r+", type "+n)},d=function(t,e,r){var n=[],o=t.max,i=t.min;return e>o&&n.push({code:101,message:"Amount is heigher than the maximum allowed amount "+o}),r&&e<i&&n.push({code:102,message:"Amount is lower than the minimum allowed amount "+i}),n},h=function(t,e){var r=[],n=t.modifiers,o=t.data,i=o.min,a=o.max;0===i&&0===a&&(a=1/0);var u=n.reduce((function(t,e){return t+e.amount}),0);return u>a&&r.push({code:201,message:"Amount is heigher than the maximum allowed amount "+a}),e&&u<i&&r.push({code:202,message:"Amount is lower than the minimum allowed amount "+i}),r},y=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.data,i=t.modifiers,a=o.min,u=i.some((function(t){return"FAIL"===t.status})),c=i.some((function(t){return"IDLE"===t.status})),l=i.some((function(t){return"INCOMPLETE"===t.status})),s=i.reduce((function(t,e){return t+e.amount}),0);return b({touched:e,errors:r,required:n,min:a,amount:s,childrenWithError:u,childrenIdle:c,childrenIncomplete:l,reviewChildren:!0})},g=function(t){var e=t.groups.some((function(t){return"FAIL"===t.status})),r=t.groups.some((function(t){return"IDLE"===t.status})),n=t.groups.some((function(t){return"INCOMPLETE"===t.status})),o=t.touched,i=t.errors,a=t.required,u=t.min,c=t.amount;return b({touched:o,errors:i,required:a,min:u,amount:c,childrenWithError:e,childrenIdle:r,childrenIncomplete:n,reviewChildren:c>0})},b=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.min,i=t.amount,a=t.reviewChildren,c=t.childrenWithError,l=t.childrenIdle,s=t.childrenIncomplete,f=i>0&&!e;return f||e||!n?f||e||n?r.length||a&&c?"FAIL":a&&(l||s)||i<o?"INCOMPLETE":i>=o?"OK":(u("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:e,errors:r,required:n,min:o,amount:i},void 0,2)),"FAIL"):"OK":"IDLE"},v=function(t){return t.every((function(t){var e=t.status,r=t.required;return"OK"===e||"IDLE"===e&&!r}))?"OK":t.every((function(t){return!t.touched}))?"IDLE":t.some((function(t){return"FAIL"===t.status}))?"FAIL":"INCOMPLETE"},O=function(){return(O=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},m=function(t){return P(t,(function(t,e){var r=t.amount*e,n=m(O(O({},t),{amount:r}));return O(O({},n),{amount:t.amount*e})}))},w=function(t){return P(t,(function(t,e){var r=w(t);return O(O({},r),{amount:t.amount/e})}))},P=function(t,e){var r=t.amount,n=void 0===r?1:r,o=t.questionsAndAnswers,i=(void 0===o?[]:o).map((function(t){var r=t.answers.map((function(t){return e(t,n)}));return O(O({},t),{answers:r})}));return O(O({},t),{questionsAndAnswers:i})},j=function(){return(j=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},I=function(t,e){if(void 0===e&&(e={}),s(t))return j(j({},t),e);if(l(t))return S(t,e);var r=_(t);return S(r,e)},S=function(t,e){void 0===e&&(e={});var r=t,n=r.questionsAndAnswers,o=r.priceCategory,i=r.amount;return j(j(j({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=i?i:0,priceCategory:null!=o?o:a.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),e)},_=function(t,e){return void 0===e&&(e={}),j(j(j({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),e)},A=function(t,e){if(void 0===e&&(e={}),f(t))return j(j({},t),e);if(l(t))return k(t,e);var r=_(t);return k(r,e)},E=function(t,e){void 0===e&&(e={});var r=w(t),n=r.priceCategory,o=r.productId,i=r.amount,a=r.questions.map((function(t){var e,a=null===(e=r.questionsAndAnswers)||void 0===e?void 0:e.find((function(e){return e.questionId===t.questionId})),u=null!=a?a:t,c=u.questionId,l=u.min,s=u.max,f={rootId:o,min:l,max:s,type:p(u),modifiersCount:t.answers.length,amount:i,path:[]};return j(j({},u),{answers:t.answers.map((function(t){var e,r=null==a?void 0:a.answers.find((function(e){return e.amount>0&&e.productId===t.productId})),o=null!=r?r:t,i=function(t){return 1===t.modifiersCount?t.min:0}(f),u=function(t){var e=t.type;return"RADIO"===e||"CHECKBOX"===e?1:t.max||1/0}(f),l=function(t){var e=t.groupType,r=t.min,n=t.max,o=t.type;return"RADIO"===e?"RADIO":o?"QUANTITY"===o||"SELECT"===o?"COUNTER":o:1===r&&1===n?"RADIO":0===r&&1===n?"CHECKBOX":0!==r||0!==n&&n!==1/0?n>=r?"COUNTER":e:"COUNTER"}({min:i,max:u,groupType:f.type,type:o.renderType}),s=o.questions.length,p=j(j({},o),{amount:null!==(e=null==o?void 0:o.amount)&&void 0!==e?e:0,priceCategory:n,questionId:c,min:i,max:u,renderType:l});return j(j({},p),{questions:s?E(p).questions:[]})}))})}));return j(j(j({},r),{questions:a}),e)},k=function(t,e){void 0===e&&(e={});var r=S(t);return E(r,e)},x=function(t,e){return void 0===e&&(e={}),E(t,e)},T=function(t){var e=t.questions;return j(j({},t),{questions:e.map((function(t){var e=t.answers;return j(j({},t),{answers:e.map((function(t){var e=t.questions;return j(j({},t),{questions:null!=e?e:[]})}))})}))})},C=r(0),R=["vendorId","storeId","catalogueId","categoryId","productId"],B=["category"],U=["type","method"],M=["alphabetic","price","predefined"],D=["asc","desc"],Y=["page","vendor","store","catalogue","category","product"],L=["price","query","tags","manufacturerId","weight","dimensions"],N=3e5,H={artisanApp:void 0,timeout:N,apiCache:{},expiresAt:(new Date).getTime()+N,forms:{}},q=function(){console.log("Not supported yet")},F=function(){return(F=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},z=Y,V=L,G=U,$=R,W=B,K=D,J=M,Q=function(t){var e=Z(t),r=X(e),n=tt(r),o=et(n);return rt(o)},Z=function(t){var e=Object(C.getState)(),r=e.vendorId,n=e.storeId,o=Object(C.getState)(),i=o.catalogueId,a=o.categoryId,u=o.productId,c=F(F({},{vendorId:r,storeId:n,catalogueId:i,categoryId:a,productId:u}),t.filterBy),l=nt(c,$,"filter"),s=it(l);return F(F({},t),{filterBy:s})},X=function(t){var e=ot(t,W,"groupBy");return F({},e)},tt=function(t){var e=t.orderBy,r=void 0===e?{}:e,n=nt(r,G,"orderBy"),o=F({},n),i=r.method,a=r.type;return a&&!J.includes(a)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+a),J.includes(a)||(delete o.type,o.type="predefined"),i&&!K.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),K.includes(i)||(delete o.method,o.method="asc"),F(F({},t),{orderBy:o})},et=function(t){var e=t.pagination,r=nt(void 0===e?{}:e,z,"pagination"),n=F({product:{size:20},category:{size:20}},r);return"category"!==t.groupBy&&delete n.category,F(F({},t),{pagination:n})},rt=function(t){var e=t.additionalFilters,r=nt(void 0===e?{}:e,V,"additionalFilters");return F(F({},t),{additionalFilters:r})},nt=function(t,e,r){var n=F({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?e.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+t),delete n[t]):delete n[t]})),n},ot=function(t,e,r){var n=F({},t),o=t[r];return void 0===o||e.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+o),delete n[r]),n},it=function(t){var e=F({},t);return Object.entries(e).forEach((function(t){var r=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete e[r]:Array.isArray(n)&&at(n[0])||at(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+r+" = "+n),delete e[r])})),e},at=function(t){var e=typeof t;return"number"===e||"string"===e},ut=(r(4),function(){return(ut=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}),ct=function(t,e,r){return function(t,e,r){var n;void 0===r&&(r="");var o=null!==(n=e.headers.get("account"))&&void 0!==n?n:void 0,i=t.filterBy,a=i.vendorId,u=i.storeId,c=i.catalogueId;!function(t,e){void 0===e&&(e="");var r=Object(C.getState)().accountId;if(void 0===t&&void 0===r)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+e)}(o,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+e)}(a,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+e)}(u,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+e)}(c,r)}(e=Q(e),r),function(t,e,r){var n=e.filterBy,o=e.groupBy,i=e.additionalFilters,a=e.orderBy,u=e.pagination,c=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],i=e[1],a=i;return Array.isArray(i)&&(a=i.reduce((function(t,e){return t+","+e}))),ut(ut({},t),"catalogueId"===o?((r={})[o]=a,r.channelId=a,r):((n={})[o]=a,n))}),{})}(n),l=function(t){var e=null!=t?t:{},r=e.type,n=void 0===r?"predefined":r,o=e.method;return{orderBy:n,orderMethod:void 0===o?"asc":o}}(a),s=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,e){var r,n=e[0],o=e[1];return"query"===n?ut(ut({},t),((r={})[n]=o,r)):t}),{})}(i),f=function(t){var e;void 0===t&&(t={});var r=Object.entries(t),n=(null!==(e=r.find((function(t){return"category"===t[0]})))&&void 0!==e?e:[])[1],o=(null==n?void 0:n.size)>0;return r.reduce((function(t,e){var r=e[0],n=e[1],i=void 0===n?{}:n;return"page"===r?ut(ut({},t),{page:i}):"product"===r?ut(ut({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===r?ut(ut({},t),{size:i.size}):t}),{})}(u),p=ut(ut(ut(ut(ut({},c),{groupBy:o}),l),s),f);o||delete p.groupBy;var d=function(t,e){for(var r=t,n=0,o=Object.entries(e);n<o.length;n++){var i=o[n],a=i[0],u=i[1],c=new RegExp("/:"+a,"g");r=r.replace(c,"/"+u)}return r}(t,r.params),h=Object(C.getState)().artisanApp,y=(null!=h?h:{}).apiURL,g=Object.entries(p).reduce((function(t,e,r){var n=e[0],o=e[1];return void 0===o?t:t+(r?"&":"")+n+"="+o}),y+"/"+d+"?");return ut(ut({},r),{url:g,query:p})}(t,e,r)},lt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var e,r,n,o,i,a;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(u){switch(u.label){case 0:e=t.url,r=t.headers,n=t.body,"{}"===(o={headers:r,body:JSON.stringify(n)}).body&&delete o.body,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,fetch(e,o).then((function(t){return t.json()}))];case 2:return i=u.sent(),[3,4];case 3:return a=u.sent(),i={code:null,status:"failed",message:a.message,stack:a.stack},[3,4];case 4:if(i.code<200||i.code>299)throw new Error(JSON.stringify({code:i.code,status:i.status,message:i.message,warnings:i.warning,stack:i.stack}));return[2,i]}}))}))},st=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,lt(t)];case 1:return[2,e.sent()]}}))}))},ft=r(5),pt=function(){return(pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},ht=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},yt={"Content-Type":"application/json"},gt=function(t,e){return void 0===t&&(t=!0),void 0===e&&(e={}),dt(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,l,s,f,p,d,h,y,g,b;return ht(this,(function(v){switch(v.label){case 0:return r=Object(C.getState)().artisanApp,n=r.settings,o=n.platform,i=n.accountId,a=null!==(d=null!==(p=null===(f=e.account)||void 0===f?void 0:f.toString())&&void 0!==p?p:null==i?void 0:i.toString())&&void 0!==d?d:"",u=null!==(y=null!==(h=e.Platform)&&void 0!==h?h:o)&&void 0!==y?y:"",c=u,null===(g=e.Authorization)||void 0===g?[3,1]:(s=g,[3,3]);case 1:return[4,bt(t)];case 2:s=v.sent(),v.label=3;case 3:return l=null!==(b=s)&&void 0!==b?b:"",[2,new Headers(pt(pt(pt({},yt),e),{Authorization:l,Platform:c,account:a}))]}}))}))},bt=function(t,e){return void 0===t&&(t=!0),dt(void 0,void 0,void 0,(function(){var r,n,o;return ht(this,(function(i){switch(i.label){case 0:return r=Object(C.getState)().artisanApp,[4,null===(o=Object(ft.initAuth)(r).currentUser)||void 0===o?void 0:o.getIdToken(e)];case 1:return(n=i.sent())||t?!n&&t?(u("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},vt=r(1),Ot=function(){return(Ot=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mt=function(t,e){var r=Q(e).pagination,n=t.pagination;return Ot(Ot({},t),{pagination:wt(r,n)})},wt=function(t,e){return Ot(Ot({},t),{page:null==e?void 0:e.page,hasMorePages:null==e?void 0:e.hasMorePages})},Pt=function(){return(Pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},It=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},St=function(t,e){return jt(void 0,void 0,void 0,(function(){var r,n,o;return It(this,(function(i){switch(i.label){case 0:return[4,gt(!1)];case 1:return r=i.sent(),n=ct("v1/products/:productId",e,{headers:r,params:{productId:t},query:{},body:{}}),[4,Object(vt.handleHttpCache)(n,(function(t){return jt(void 0,void 0,void 0,(function(){var e,r;return It(this,(function(n){switch(n.label){case 0:return[4,st(t)];case 1:return e=n.sent(),r=T(e.data),[2,Pt(Pt({},e),{data:r})]}}))}))}))];case 2:return o=i.sent(),[2,mt(o,e)]}}))}))},_t=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,lt(t)];case 1:return[2,e.sent()]}}))}))},At=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},Et=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},kt=function(t){return At(void 0,void 0,void 0,(function(){var e,r,n;return Et(this,(function(o){switch(o.label){case 0:return[4,gt(!1)];case 1:return e=o.sent(),r=ct("api/v3/productsBy",t,{headers:e,params:{},query:{},body:{}}),[4,Object(vt.handleHttpCache)(r,(function(t){return At(void 0,void 0,void 0,(function(){return Et(this,(function(e){switch(e.label){case 0:return[4,_t(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,mt(n,t)]}}))}))},xt=function(){console.log("Not implemented yet")},Tt=function(){console.log("not implemented yet")},Ct=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,lt(t)];case 1:return[2,e.sent()]}}))}))},Rt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},Bt=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Ut=function(t){return Rt(void 0,void 0,void 0,(function(){var e,r,n;return Bt(this,(function(o){switch(o.label){case 0:return[4,gt(!1)];case 1:return e=o.sent(),r=ct("v1/stores/details",t,{headers:e,params:{},query:{},body:{}}),[4,Object(vt.handleHttpCache)(r,(function(t){return Rt(void 0,void 0,void 0,(function(){return Bt(this,(function(e){switch(e.label){case 0:return[4,Ct(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,mt(n,t)]}}))}))},Mt=function(){return(Mt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Yt=function(t,e){for(var r=Dt([],e),n=t,o=t[0];r.length;)o=Nt(n,r[0]),r=r.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups;return o},Lt=function(t,e,r){for(var n=Dt([],e),o=t,i=Nt(o,n[0]),a=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Nt(o,n[0]),n=n.slice(1),a=Object.prototype.hasOwnProperty.call(i,"modifiers"),o=Dt([],a?i.modifiers:i.groups);var u=n[0];if(1===e.length&&(i={groups:t},a=!1),a){var c=i.modifiers.map((function(t){return t.id===u?Mt({},r):Mt({},t)}));i.modifiers=c}else{var l=i.groups.map((function(t){return t.id===u?Mt({},r):Mt({},t)}));i.groups=l}return 1===e.length?Dt([],i.groups):Dt([],t)},Nt=function(t,e){var r=t.find((function(t){return t.id===e}));if(!r)throw new Error("Path segment "+e+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return r},Ht=function(){return(Ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Ft=function(t,e,r,n,o){var i=Ht(Ht({},r),{amount:n,touched:!0,errors:d(r,n,o),totals:de(Ht(Ht({},r.data),{amount:n})),data:Ht(Ht({},r.data),{amount:n})});return i.status=g(i),Lt(t,e,i)},zt=function(t,e,r,n){var o=r.slice(0,-1),i=Yt(e,o),a=qt([],i.modifiers);"RADIO"!==i.type||n||(a=i.modifiers.map((function(t){return"RADIO"!==t.type||t.id===r[r.length-1]?Ht({},t):Ht(Ht({},t),{amount:0,error:"",totals:de(Ht(Ht({},t.data),{amount:0})),data:Ht(Ht({},t.data),{amount:0})})})));var u=(a=a.map((function(e){var o=x(e.data),i=qt(qt([],r.slice(0,-1)),[e.id]),a=Ht(Ht({},e),{groups:Kt(o,{rootId:t,path:i},e.groups)});return a.errors=d(a,a.amount,n),a.status=g(a),a}))).map((function(t){return Ht({},t.data)})),c=Ht(Ht({},i.data),{answers:u}),l=Ht(Ht({},i),{touched:!0,modifiers:a,data:c});l.errors=h(l,n),l.status=y(l);var s=Lt(e,o,l);return o.length>1&&(s=Vt(t,s,o,n)),s},Vt=function(t,e,r,n){var o=r.slice(0,-1),i=Yt(e,o),a=i.groups.map((function(t){return Ht({},t.data)})),u=Ht(Ht({},i.data),{questions:a}),c=i.groups.map((function(t){var e=Ht({},t);return e.errors=h(e,n),e.status=y(e),e})),l=Ht(Ht({},i),{touched:!0,groups:c,data:u});l.errors=d(l,l.amount,n),l.status=g(l);var s=Lt(e,o,l);return o.length>1&&(s=zt(t,s,o,n)),s},Gt=function(){return(Gt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$t=function(){return($t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Kt=function(t,e,r){var n=e.rootId,o=e.path;return t.questions.map((function(e){var i=null==r?void 0:r.find((function(t){return t.id===e.questionId}));return Jt(e,{amount:t.amount,rootId:n,path:Wt([],o)},i)}))},Jt=function(t,e,r){var n=t.questionId,o=t.name,i=t.description,a=t.max,u=t.min,c=t.images,l=e.amount,s=e.rootId,f=e.path,d=null!=r?r:{},h=d.errors,g=d.touched,b={id:n,name:o,description:null!=i?i:"",images:Wt([],null!=c?c:[]),data:$t({},t),errors:null!=h?h:[],touched:null!=g&&g,status:"IDLE",hidden:l<1,required:u>0,type:p(t)},v={rootId:s,max:a,min:u,type:b.type,modifiersCount:t.answers.length,amount:l,path:Wt(Wt([],f),[n])},O=t.answers.map((function(t){var e=null==r?void 0:r.modifiers.find((function(e){return e.id===t.productId}));return Qt(t,v,e)})),m=$t($t({},b),{modifiers:O});return $t($t({},m),{status:y(m)})},Qt=function(t,e,r){var n,o,i=t.productId,a=t.questionId,u=t.name,c=t.images,l=t.amount,s=t.renderType,f=t.min,p=t.max,d=x(t),h=e.rootId,y=e.path,b=Wt(Wt([],y),[i]),O=Kt(d,{rootId:h,path:b},null==r?void 0:r.groups),m={id:i,groupId:a,name:u,images:Wt([],c),amount:l,data:$t({},t),groups:O,errors:null!==(n=null==r?void 0:r.errors)&&void 0!==n?n:[],hidden:e.amount<1,min:f,max:p,required:f>0,touched:null!==(o=null==r?void 0:r.touched)&&void 0!==o&&o,status:"IDLE",totals:de($t($t({},t),{amount:l})),type:s,handleChange:function(t){!function(t,e,r){var n,o=Gt({},Object(C.getState)().forms),i=o[t],a=Yt(i.renderer,e),u=Ft(i.renderer,e,a,r,!1);u=zt(t,u,e,!1);var c=Xt(u,i.product),l=Gt(Gt({},i),{renderer:u,product:c,status:v(u)}),s=Gt(Gt({},o),((n={})[t]=l,n));Object(C.setState)({forms:s});var f=Gt({},l);delete f.callback,i.callback(f)}(e.rootId,b,t)}};return $t($t({},m),{status:g(m)})},Zt=function(){return(Zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xt=function(t,e){var r=I(e);return Zt(Zt({},r),{questionsAndAnswers:te(t),updatedAt:""})},te=function(t){return t.map((function(t){return Zt(Zt({},t.data),{answers:ee(t.modifiers)})}))},ee=function(t){return t.map((function(t){return t.amount?Zt(Zt({},t.data),{questionsAndAnswers:te(t.groups)}):Zt(Zt({},t.data),{questionsAndAnswers:[]})}))},re=function(){return(re=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ne=function(t,e){var r,n=t.productId,o=Object(C.getState)().forms;if(o[n])return u("Form for product with id "+n+" has already been register. Please unsuscribe if you need to register a new form."),function(){};var i=function(t){var e,r=A(t,{amount:null!==(e=t.amount)&&void 0!==e?e:1}),n=Kt(r,{rootId:r.productId,path:[]});return{product:Xt(n,t),renderer:n,validate:function(){return ue(t.productId)},status:v(n)}}(t),a=re(re({},o),((r={})[n]=re(re({},i),{callback:e}),r));return Object(C.setState)({forms:a}),e(re({},i)),function(){return oe(n)}},oe=function(t){var e=Object(C.getState)().forms,r=re({},e);delete r[t],Object(C.setState)({forms:r})},ie=function(){return(ie=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ae=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},ue=function(t){var e,r=ie({},Object(C.getState)().forms),n=r[t],o=n.renderer,i=n.callback,a=n.product,u=ae([],o);o.forEach((function(e){var r=[e.id];u=ce(e,u,t,r)}));var c=Xt(u,a),l=ie(ie({},n),{renderer:u,product:c,status:v(u)}),s=ie(ie({},r),((e={})[t]=l,e));Object(C.setState)({forms:s});var f=ie({},l);return delete f.callback,i(f),l.status},ce=function(t,e,r,n){var o=t.modifiers,i=t.id,a=!o.length,u=ae([],e);return a?(console.warn("Attempting to validate a Modifier group without modifiers, this will likely result in unexpected behaviour. \n Please update the bad group "+i+" of product 0."),u):(o.forEach((function(t){var e=ae(ae([],n),[t.id]);u=le(t,u,r,e)})),u)},le=function(t,e,r,n){var o=t.groups,i=t.amount,a=t.status,u=t.required,c=!o.length||0===i,l=ae([],e);if(c){var s="IDLE"===a&&u||"FAIL"===a||"INCOMPLETE"===a?"FAIL":a,f=ie(ie({},t),{status:s}),p=ae([],n);l=Ft(l,p,f,f.amount,!0),l=zt(r,l,p,!0)}else o.forEach((function(t){var e=ae(ae([],n),[t.id]);l=ce(t,l,r,e)}));return l},se=function(){return(se=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fe=!1,pe=function(t,e){if(void 0===e&&(e={}),fe)console.warn("artisan-commerce/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once");else{if(Object(C.setState)(se({artisanApp:t},e)),void 0!==e.timeout){var r=(new Date).getTime()+e.timeout;Object(C.setState)({expiresAt:r})}"undefined"==typeof window||(fe=!0)}},de=function(t,e){if(void 0===e&&(e=t.amount>0?t.amount:1),e<1)throw new Error("Cannot set the amount of getProductTotals with a value less than 1");var r=t,n=r.updatedAt?w(r):t;return{unitGrossPrice:ge(n,1),unitTotalDiscounts:be(n,1),unitTotalTaxes:he(n,1),unitNetPrice:ve(n,1),amount:e,grossPrice:ge(n,e),totalDiscounts:be(n,e),totalTaxes:he(n,e),netPrice:ve(n,e)}},he=function(t,e){var r=I(t,{amount:e}),n=r.prices,o=r.amount,i=n[r.priceCategory],a=i.taxes,u=i.grossPrice,c=we(a,u);return ye(r,e)+c*o},ye=function(t,e){return t.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices,o=r.amount,i=n[r.priceCategory],a=i.taxes,u=i.grossPrice;return t+o*(we(a,u)+ye(r,e))}),0)*e}),0)},ge=function(t,e){return Oe(t,"grossPrice",e)},be=function(t,e){return 0},ve=function(t,e){return Oe(t,"netPrice",e)},Oe=function(t,e,r){var n=I(t,{amount:r}),o=n.prices,i=n.amount,a=o[n.priceCategory][e];return(me(n,e)+a)*i},me=function(t,e){return t.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices;return t+r.amount*(n[r.priceCategory][e]+me(r,e))}),0)}),0)},we=function(t,e){return t.reduce((function(t,r){return t+r.percentage/100*e}),0)};Object(C.initState)(H)}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=33)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=33)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return a}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=null,i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},a=function(t){var e=o?n({},o):{};o=null,o=n(n({},e),t),Object.seal(o)},u=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=10)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return a}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=null,i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},a=function(t){var e=o?n({},o):{};o=null,o=n(n({},e),t),Object.seal(o)},u=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,a;n=r(8),o=r(1).utf8,i=r(1).bin,(a=function(t,r){var a=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,a=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var p=0;p<r.length;p+=16){for(var d=u,h=c,y=l,g=s,b=f,v=0;v<80;v++){if(v<16)a[v]=r[p+v];else{var O=a[v-3]^a[v-8]^a[v-14]^a[v-16];a[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(a[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=d,c+=h,l+=y,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?a:r&&r.asString?i.bytesToString(a):n.bytesToHex(a)})._blocksize=16,a._digestsize=20,t.exports=a}).call(this,r(3).Buffer)},function(t,e,r){"use strict";(function(t){
|
|
19
|
+
e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-s)-1,d>>=-s,s+=u;s>0;i=256*i+t[e+f],f+=p,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=n;s>0;a=256*a+t[e+f],f+=p,s-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=l}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,c,l=8*i-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=s?(u=0,a=s):a+f>=1?(u=(e*c-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&u,d+=h,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+d]=255&a,d+=h,a/=256,l-=8);t[r+d-h]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"getCategories",(function(){return q})),r.d(e,"getProductDetails",(function(){return St})),r.d(e,"getProducts",(function(){return kt})),r.d(e,"getRecommendedProducts",(function(){return xt})),r.d(e,"getRelatedProducts",(function(){return Tt})),r.d(e,"getStoreDetails",(function(){return Ut})),r.d(e,"registerModifiersForm",(function(){return ne})),r.d(e,"validateProduct",(function(){return ue})),r.d(e,"initProducts",(function(){return pe})),r.d(e,"getProductTotals",(function(){return de})),r.d(e,"transformers",(function(){return i})),r.d(e,"assertions",(function(){return n})),r.d(e,"modifierUtils",(function(){return o}));var n={};r.r(n),r.d(n,"isBaseProduct",(function(){return c})),r.d(n,"isProductDetails",(function(){return l})),r.d(n,"isCartProduct",(function(){return s})),r.d(n,"isFormCartProduct",(function(){return f}));var o={};r.r(o),r.d(o,"multiplyProductQA",(function(){return m})),r.d(o,"divideProductQA",(function(){return w})),r.d(o,"operationOnProductQA",(function(){return P}));var i={};r.r(i),r.d(i,"toCartProduct",(function(){return I})),r.d(i,"toFormCartProduct",(function(){return A})),r.d(i,"toFormCartProductHelper",(function(){return E})),r.d(i,"toFormCartProductFromProductDetails",(function(){return k})),r.d(i,"toFormCartProductFromAnswer",(function(){return x})),r.d(i,"normalizeProductDetails",(function(){return T}));var a=r(2),u=function(t){console.error(t)},c=function(t){var e=t.attributes,r=t.description,n=t.name,o=t.images,i=t.prices,a=t.productId;return"boolean"==typeof e.showInMenu&&"string"==typeof r&&"string"==typeof n&&"string"==typeof a&&!("object"!=typeof i||"object"==typeof i&&Object.keys(i).length<1)&&!!Array.isArray(o)},l=function(t){if(!c(t))return!1;var e=t.questions;return!!Array.isArray(e)},s=function(t){if(!l(t))return!1;var e,r=t.hash,n=t.createdAt,o=t.updatedAt,i=t.amount,u=t.priceCategory,c=t.comment,s=t.questionsAndAnswers;return"string"==typeof r&&"string"==typeof n&&"string"==typeof o&&"number"==typeof i&&"string"==typeof c&&!!(e=a.PriceCategoryType,Object.keys(e)).includes(u)&&!!Array.isArray(s)},f=function(t){var e;if(!s(t))return!1;var r=t.questions;if(!Array.isArray(r))return!1;var n=null===(e=null==r?void 0:r[0])||void 0===e?void 0:e.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},p=function(t){var e=t.min,r=t.max,n=t.type;if(n)return"QUANTITY"===n||"SELECT"===n?"COUNTER":n;if(0===e&&1===r)return"CHECKBOX";if(1===e&&1===r)return"RADIO";if(0===e&&(0===r||r===1/0))return"COUNTER";if(r>=e)return"COUNTER";throw new Error("Modifier group bad configured. min "+e+", max "+r+", type "+n)},d=function(t,e,r){var n=[],o=t.max,i=t.min;return e>o&&n.push({code:101,message:"Amount is heigher than the maximum allowed amount "+o}),r&&e<i&&n.push({code:102,message:"Amount is lower than the minimum allowed amount "+i}),n},h=function(t,e){var r=[],n=t.modifiers,o=t.data,i=o.min,a=o.max;0===i&&0===a&&(a=1/0);var u=n.reduce((function(t,e){return t+e.amount}),0);return u>a&&r.push({code:201,message:"Amount is heigher than the maximum allowed amount "+a}),e&&u<i&&r.push({code:202,message:"Amount is lower than the minimum allowed amount "+i}),r},y=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.data,i=t.modifiers,a=o.min,u=i.some((function(t){return"FAIL"===t.status})),c=i.some((function(t){return"IDLE"===t.status})),l=i.some((function(t){return"INCOMPLETE"===t.status})),s=i.reduce((function(t,e){return t+e.amount}),0);return b({touched:e,errors:r,required:n,min:a,amount:s,childrenWithError:u,childrenIdle:c,childrenIncomplete:l,reviewChildren:!0})},g=function(t){var e=t.groups.some((function(t){return"FAIL"===t.status})),r=t.groups.some((function(t){return"IDLE"===t.status})),n=t.groups.some((function(t){return"INCOMPLETE"===t.status})),o=t.touched,i=t.errors,a=t.required,u=t.min,c=t.amount;return b({touched:o,errors:i,required:a,min:u,amount:c,childrenWithError:e,childrenIdle:r,childrenIncomplete:n,reviewChildren:c>0})},b=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.min,i=t.amount,a=t.reviewChildren,c=t.childrenWithError,l=t.childrenIdle,s=t.childrenIncomplete,f=i>0&&!e;return f||e||!n?f||e||n?r.length||a&&c?"FAIL":a&&(l||s)||i<o?"INCOMPLETE":i>=o?"OK":(u("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:e,errors:r,required:n,min:o,amount:i},void 0,2)),"FAIL"):"OK":"IDLE"},v=function(t){return t.every((function(t){var e=t.status,r=t.required;return"OK"===e||"IDLE"===e&&!r}))?"OK":t.every((function(t){return!t.touched}))?"IDLE":t.some((function(t){return"FAIL"===t.status}))?"FAIL":"INCOMPLETE"},O=function(){return(O=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},m=function(t){return P(t,(function(t,e){var r=t.amount*e,n=m(O(O({},t),{amount:r}));return O(O({},n),{amount:t.amount*e})}))},w=function(t){return P(t,(function(t,e){var r=w(t);return O(O({},r),{amount:t.amount/e})}))},P=function(t,e){var r=t.amount,n=void 0===r?1:r,o=t.questionsAndAnswers,i=(void 0===o?[]:o).map((function(t){var r=t.answers.map((function(t){return e(t,n)}));return O(O({},t),{answers:r})}));return O(O({},t),{questionsAndAnswers:i})},j=function(){return(j=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},I=function(t,e){if(void 0===e&&(e={}),s(t))return j(j({},t),e);if(l(t))return S(t,e);var r=_(t);return S(r,e)},S=function(t,e){void 0===e&&(e={});var r=t,n=r.questionsAndAnswers,o=r.priceCategory,i=r.amount;return j(j(j({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=i?i:0,priceCategory:null!=o?o:a.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),e)},_=function(t,e){return void 0===e&&(e={}),j(j(j({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),e)},A=function(t,e){if(void 0===e&&(e={}),f(t))return j(j({},t),e);if(l(t))return k(t,e);var r=_(t);return k(r,e)},E=function(t,e){void 0===e&&(e={});var r=w(t),n=r.priceCategory,o=r.productId,i=r.amount,a=r.questions.map((function(t){var e,a=null===(e=r.questionsAndAnswers)||void 0===e?void 0:e.find((function(e){return e.questionId===t.questionId})),u=null!=a?a:t,c=u.questionId,l=u.min,s=u.max,f={rootId:o,min:l,max:s,type:p(u),modifiersCount:t.answers.length,amount:i,path:[]};return j(j({},u),{answers:t.answers.map((function(t){var e,r=null==a?void 0:a.answers.find((function(e){return e.amount>0&&e.productId===t.productId})),o=null!=r?r:t,i=function(t){return 1===t.modifiersCount?t.min:0}(f),u=function(t){var e=t.type;return"RADIO"===e||"CHECKBOX"===e?1:t.max||1/0}(f),l=function(t){var e=t.groupType,r=t.min,n=t.max,o=t.type;return"RADIO"===e?"RADIO":o?"QUANTITY"===o||"SELECT"===o?"COUNTER":o:1===r&&1===n?"RADIO":0===r&&1===n?"CHECKBOX":0!==r||0!==n&&n!==1/0?n>=r?"COUNTER":e:"COUNTER"}({min:i,max:u,groupType:f.type,type:o.renderType}),s=o.questions.length,p=j(j({},o),{amount:null!==(e=null==o?void 0:o.amount)&&void 0!==e?e:0,priceCategory:n,questionId:c,min:i,max:u,renderType:l});return j(j({},p),{questions:s?E(p).questions:[]})}))})}));return j(j(j({},r),{questions:a}),e)},k=function(t,e){void 0===e&&(e={});var r=S(t);return E(r,e)},x=function(t,e){return void 0===e&&(e={}),E(t,e)},T=function(t){var e=t.questions;return j(j({},t),{questions:e.map((function(t){var e=t.answers;return j(j({},t),{answers:e.map((function(t){var e=t.questions;return j(j({},t),{questions:null!=e?e:[]})}))})}))})},C=r(0),R=["vendorId","storeId","catalogueId","categoryId","productId"],B=["category"],U=["type","method"],M=["alphabetic","price","predefined"],D=["asc","desc"],Y=["page","vendor","store","catalogue","category","product"],L=["price","query","tags","manufacturerId","weight","dimensions"],N=3e5,H={artisanApp:void 0,timeout:N,apiCache:{},expiresAt:(new Date).getTime()+N,forms:{}},q=function(){console.log("Not supported yet")},F=function(){return(F=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},z=Y,V=L,G=U,$=R,W=B,K=D,J=M,Q=function(t){var e=Z(t),r=X(e),n=tt(r),o=et(n);return rt(o)},Z=function(t){var e=Object(C.getState)(),r=e.vendorId,n=e.storeId,o=Object(C.getState)(),i=o.catalogueId,a=o.categoryId,u=o.productId,c=F(F({},{vendorId:r,storeId:n,catalogueId:i,categoryId:a,productId:u}),t.filterBy),l=nt(c,$,"filter"),s=it(l);return F(F({},t),{filterBy:s})},X=function(t){var e=ot(t,W,"groupBy");return F({},e)},tt=function(t){var e=t.orderBy,r=void 0===e?{}:e,n=nt(r,G,"orderBy"),o=F({},n),i=r.method,a=r.type;return a&&!J.includes(a)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+a),J.includes(a)||(delete o.type,o.type="predefined"),i&&!K.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),K.includes(i)||(delete o.method,o.method="asc"),F(F({},t),{orderBy:o})},et=function(t){var e=t.pagination,r=nt(void 0===e?{}:e,z,"pagination"),n=F({product:{size:20},category:{size:20}},r);return"category"!==t.groupBy&&delete n.category,F(F({},t),{pagination:n})},rt=function(t){var e=t.additionalFilters,r=nt(void 0===e?{}:e,V,"additionalFilters");return F(F({},t),{additionalFilters:r})},nt=function(t,e,r){var n=F({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?e.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+t),delete n[t]):delete n[t]})),n},ot=function(t,e,r){var n=F({},t),o=t[r];return void 0===o||e.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+o),delete n[r]),n},it=function(t){var e=F({},t);return Object.entries(e).forEach((function(t){var r=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete e[r]:Array.isArray(n)&&at(n[0])||at(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+r+" = "+n),delete e[r])})),e},at=function(t){var e=typeof t;return"number"===e||"string"===e},ut=(r(4),function(){return(ut=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}),ct=function(t,e,r){return function(t,e,r){var n;void 0===r&&(r="");var o=null!==(n=e.headers.get("account"))&&void 0!==n?n:void 0,i=t.filterBy,a=i.vendorId,u=i.storeId,c=i.catalogueId;!function(t,e){void 0===e&&(e="");var r=Object(C.getState)().accountId;if(void 0===t&&void 0===r)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+e)}(o,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+e)}(a,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+e)}(u,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+e)}(c,r)}(e=Q(e),r),function(t,e,r){var n=e.filterBy,o=e.groupBy,i=e.additionalFilters,a=e.orderBy,u=e.pagination,c=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],i=e[1],a=i;return Array.isArray(i)&&(a=i.reduce((function(t,e){return t+","+e}))),ut(ut({},t),"catalogueId"===o?((r={})[o]=a,r.channelId=a,r):((n={})[o]=a,n))}),{})}(n),l=function(t){var e=null!=t?t:{},r=e.type,n=void 0===r?"predefined":r,o=e.method;return{orderBy:n,orderMethod:void 0===o?"asc":o}}(a),s=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,e){var r,n=e[0],o=e[1];return"query"===n?ut(ut({},t),((r={})[n]=o,r)):t}),{})}(i),f=function(t){var e;void 0===t&&(t={});var r=Object.entries(t),n=(null!==(e=r.find((function(t){return"category"===t[0]})))&&void 0!==e?e:[])[1],o=(null==n?void 0:n.size)>0;return r.reduce((function(t,e){var r=e[0],n=e[1],i=void 0===n?{}:n;return"page"===r?ut(ut({},t),{page:i}):"product"===r?ut(ut({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===r?ut(ut({},t),{size:i.size}):t}),{})}(u),p=ut(ut(ut(ut(ut({},c),{groupBy:o}),l),s),f);o||delete p.groupBy;var d=function(t,e){for(var r=t,n=0,o=Object.entries(e);n<o.length;n++){var i=o[n],a=i[0],u=i[1],c=new RegExp("/:"+a,"g");r=r.replace(c,"/"+u)}return r}(t,r.params),h=Object(C.getState)().artisanApp,y=(null!=h?h:{}).apiURL,g=Object.entries(p).reduce((function(t,e,r){var n=e[0],o=e[1];return void 0===o?t:t+(r?"&":"")+n+"="+o}),y+"/"+d+"?");return ut(ut({},r),{url:g,query:p})}(t,e,r)},lt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var e,r,n,o,i,a;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(u){switch(u.label){case 0:e=t.url,r=t.headers,n=t.body,"{}"===(o={headers:r,body:JSON.stringify(n)}).body&&delete o.body,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,fetch(e,o).then((function(t){return t.json()}))];case 2:return i=u.sent(),[3,4];case 3:return a=u.sent(),i={code:null,status:"failed",message:a.message,stack:a.stack},[3,4];case 4:if(i.code<200||i.code>299)throw new Error(JSON.stringify({code:i.code,status:i.status,message:i.message,warnings:i.warning,stack:i.stack}));return[2,i]}}))}))},st=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,lt(t)];case 1:return[2,e.sent()]}}))}))},ft=r(5),pt=function(){return(pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},ht=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},yt={"Content-Type":"application/json"},gt=function(t,e){return void 0===t&&(t=!0),void 0===e&&(e={}),dt(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,l,s,f,p,d,h,y,g,b;return ht(this,(function(v){switch(v.label){case 0:return r=Object(C.getState)().artisanApp,n=r.settings,o=n.platform,i=n.accountId,a=null!==(d=null!==(p=null===(f=e.account)||void 0===f?void 0:f.toString())&&void 0!==p?p:null==i?void 0:i.toString())&&void 0!==d?d:"",u=null!==(y=null!==(h=e.Platform)&&void 0!==h?h:o)&&void 0!==y?y:"",c=u,null===(g=e.Authorization)||void 0===g?[3,1]:(s=g,[3,3]);case 1:return[4,bt(t)];case 2:s=v.sent(),v.label=3;case 3:return l=null!==(b=s)&&void 0!==b?b:"",[2,new Headers(pt(pt(pt({},yt),e),{Authorization:l,Platform:c,account:a}))]}}))}))},bt=function(t,e){return void 0===t&&(t=!0),dt(void 0,void 0,void 0,(function(){var r,n,o;return ht(this,(function(i){switch(i.label){case 0:return r=Object(C.getState)().artisanApp,[4,null===(o=Object(ft.initAuth)(r).currentUser)||void 0===o?void 0:o.getIdToken(e)];case 1:return(n=i.sent())||t?!n&&t?(u("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},vt=r(1),Ot=function(){return(Ot=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mt=function(t,e){var r=Q(e).pagination,n=t.pagination;return Ot(Ot({},t),{pagination:wt(r,n)})},wt=function(t,e){return Ot(Ot({},t),{page:null==e?void 0:e.page,hasMorePages:null==e?void 0:e.hasMorePages})},Pt=function(){return(Pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},It=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},St=function(t,e){return jt(void 0,void 0,void 0,(function(){var r,n,o;return It(this,(function(i){switch(i.label){case 0:return[4,gt(!1)];case 1:return r=i.sent(),n=ct("v1/products/:productId",e,{headers:r,params:{productId:t},query:{},body:{}}),[4,Object(vt.handleHttpCache)(n,(function(t){return jt(void 0,void 0,void 0,(function(){var e,r;return It(this,(function(n){switch(n.label){case 0:return[4,st(t)];case 1:return e=n.sent(),r=T(e.data),[2,Pt(Pt({},e),{data:r})]}}))}))}))];case 2:return o=i.sent(),[2,mt(o,e)]}}))}))},_t=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,lt(t)];case 1:return[2,e.sent()]}}))}))},At=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},Et=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},kt=function(t){return At(void 0,void 0,void 0,(function(){var e,r,n;return Et(this,(function(o){switch(o.label){case 0:return[4,gt(!1)];case 1:return e=o.sent(),r=ct("api/v3/productsBy",t,{headers:e,params:{},query:{},body:{}}),[4,Object(vt.handleHttpCache)(r,(function(t){return At(void 0,void 0,void 0,(function(){return Et(this,(function(e){switch(e.label){case 0:return[4,_t(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,mt(n,t)]}}))}))},xt=function(){console.log("Not implemented yet")},Tt=function(){console.log("not implemented yet")},Ct=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,lt(t)];case 1:return[2,e.sent()]}}))}))},Rt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},Bt=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Ut=function(t){return Rt(void 0,void 0,void 0,(function(){var e,r,n;return Bt(this,(function(o){switch(o.label){case 0:return[4,gt(!1)];case 1:return e=o.sent(),r=ct("v1/stores/details",t,{headers:e,params:{},query:{},body:{}}),[4,Object(vt.handleHttpCache)(r,(function(t){return Rt(void 0,void 0,void 0,(function(){return Bt(this,(function(e){switch(e.label){case 0:return[4,Ct(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,mt(n,t)]}}))}))},Mt=function(){return(Mt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Yt=function(t,e){for(var r=Dt([],e),n=t,o=t[0];r.length;)o=Nt(n,r[0]),r=r.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups;return o},Lt=function(t,e,r){for(var n=Dt([],e),o=t,i=Nt(o,n[0]),a=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Nt(o,n[0]),n=n.slice(1),a=Object.prototype.hasOwnProperty.call(i,"modifiers"),o=Dt([],a?i.modifiers:i.groups);var u=n[0];if(1===e.length&&(i={groups:t},a=!1),a){var c=i.modifiers.map((function(t){return t.id===u?Mt({},r):Mt({},t)}));i.modifiers=c}else{var l=i.groups.map((function(t){return t.id===u?Mt({},r):Mt({},t)}));i.groups=l}return 1===e.length?Dt([],i.groups):Dt([],t)},Nt=function(t,e){var r=t.find((function(t){return t.id===e}));if(!r)throw new Error("Path segment "+e+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return r},Ht=function(){return(Ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Ft=function(t,e,r,n,o){var i=Ht(Ht({},r),{amount:n,touched:!0,errors:d(r,n,o),totals:de(Ht(Ht({},r.data),{amount:n})),data:Ht(Ht({},r.data),{amount:n})});return i.status=g(i),Lt(t,e,i)},zt=function(t,e,r,n){var o=r.slice(0,-1),i=Yt(e,o),a=qt([],i.modifiers);"RADIO"!==i.type||n||(a=i.modifiers.map((function(t){return"RADIO"!==t.type||t.id===r[r.length-1]?Ht({},t):Ht(Ht({},t),{amount:0,error:"",totals:de(Ht(Ht({},t.data),{amount:0})),data:Ht(Ht({},t.data),{amount:0})})})));var u=(a=a.map((function(e){var o=x(e.data),i=qt(qt([],r.slice(0,-1)),[e.id]),a=Ht(Ht({},e),{groups:Kt(o,{rootId:t,path:i},e.groups)});return a.errors=d(a,a.amount,n),a.status=g(a),a}))).map((function(t){return Ht({},t.data)})),c=Ht(Ht({},i.data),{answers:u}),l=Ht(Ht({},i),{touched:!0,modifiers:a,data:c});l.errors=h(l,n),l.status=y(l);var s=Lt(e,o,l);return o.length>1&&(s=Vt(t,s,o,n)),s},Vt=function(t,e,r,n){var o=r.slice(0,-1),i=Yt(e,o),a=i.groups.map((function(t){return Ht({},t.data)})),u=Ht(Ht({},i.data),{questions:a}),c=i.groups.map((function(t){var e=Ht({},t);return e.errors=h(e,n),e.status=y(e),e})),l=Ht(Ht({},i),{touched:!0,groups:c,data:u});l.errors=d(l,l.amount,n),l.status=g(l);var s=Lt(e,o,l);return o.length>1&&(s=zt(t,s,o,n)),s},Gt=function(){return(Gt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$t=function(){return($t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Kt=function(t,e,r){var n=e.rootId,o=e.path;return t.questions.map((function(e){var i=null==r?void 0:r.find((function(t){return t.id===e.questionId}));return Jt(e,{amount:t.amount,rootId:n,path:Wt([],o)},i)}))},Jt=function(t,e,r){var n=t.questionId,o=t.name,i=t.description,a=t.max,u=t.min,c=t.images,l=e.amount,s=e.rootId,f=e.path,d=null!=r?r:{},h=d.errors,g=d.touched,b={id:n,name:o,description:null!=i?i:"",images:Wt([],null!=c?c:[]),data:$t({},t),errors:null!=h?h:[],touched:null!=g&&g,status:"IDLE",hidden:l<1,required:u>0,type:p(t)},v={rootId:s,max:a,min:u,type:b.type,modifiersCount:t.answers.length,amount:l,path:Wt(Wt([],f),[n])},O=t.answers.map((function(t){var e=null==r?void 0:r.modifiers.find((function(e){return e.id===t.productId}));return Qt(t,v,e)})),m=$t($t({},b),{modifiers:O});return $t($t({},m),{status:y(m)})},Qt=function(t,e,r){var n,o,i=t.productId,a=t.questionId,u=t.name,c=t.images,l=t.amount,s=t.renderType,f=t.min,p=t.max,d=x(t),h=e.rootId,y=e.path,b=Wt(Wt([],y),[i]),O=Kt(d,{rootId:h,path:b},null==r?void 0:r.groups),m={id:i,groupId:a,name:u,images:Wt([],c),amount:l,data:$t({},t),groups:O,errors:null!==(n=null==r?void 0:r.errors)&&void 0!==n?n:[],hidden:e.amount<1,min:f,max:p,required:f>0,touched:null!==(o=null==r?void 0:r.touched)&&void 0!==o&&o,status:"IDLE",totals:de($t($t({},t),{amount:l})),type:s,handleChange:function(t){!function(t,e,r){var n,o=Gt({},Object(C.getState)().forms),i=o[t],a=Yt(i.renderer,e),u=Ft(i.renderer,e,a,r,!1);u=zt(t,u,e,!1);var c=Xt(u,i.product),l=Gt(Gt({},i),{renderer:u,product:c,status:v(u)}),s=Gt(Gt({},o),((n={})[t]=l,n));Object(C.setState)({forms:s});var f=Gt({},l);delete f.callback,i.callback(f)}(e.rootId,b,t)}};return $t($t({},m),{status:g(m)})},Zt=function(){return(Zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xt=function(t,e){var r=I(e);return Zt(Zt({},r),{questionsAndAnswers:te(t),updatedAt:""})},te=function(t){return t.map((function(t){return Zt(Zt({},t.data),{answers:ee(t.modifiers)})}))},ee=function(t){return t.map((function(t){return t.amount?Zt(Zt({},t.data),{questionsAndAnswers:te(t.groups)}):Zt(Zt({},t.data),{questionsAndAnswers:[]})}))},re=function(){return(re=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ne=function(t,e){var r,n=t.productId,o=Object(C.getState)().forms;if(o[n])return u("Form for product with id "+n+" has already been register. Please unsuscribe if you need to register a new form."),function(){};var i=function(t){var e,r=A(t,{amount:null!==(e=t.amount)&&void 0!==e?e:1}),n=Kt(r,{rootId:r.productId,path:[]});return{product:Xt(n,t),renderer:n,validate:function(){return ue(t.productId)},status:v(n)}}(t),a=re(re({},o),((r={})[n]=re(re({},i),{callback:e}),r));return Object(C.setState)({forms:a}),e(re({},i)),function(){return oe(n)}},oe=function(t){var e=Object(C.getState)().forms,r=re({},e);delete r[t],Object(C.setState)({forms:r})},ie=function(){return(ie=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ae=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},ue=function(t){var e,r=ie({},Object(C.getState)().forms),n=r[t],o=n.renderer,i=n.callback,a=n.product,u=ae([],o);o.forEach((function(e){var r=[e.id];u=ce(e,u,t,r)}));var c=Xt(u,a),l=ie(ie({},n),{renderer:u,product:c,status:v(u)}),s=ie(ie({},r),((e={})[t]=l,e));Object(C.setState)({forms:s});var f=ie({},l);return delete f.callback,i(f),l.status},ce=function(t,e,r,n){var o=t.modifiers,i=t.id,a=!o.length,u=ae([],e);return a?(console.warn("Attempting to validate a Modifier group without modifiers, this will likely result in unexpected behaviour. \n Please update the bad group "+i+" of product 0."),u):(o.forEach((function(t){var e=ae(ae([],n),[t.id]);u=le(t,u,r,e)})),u)},le=function(t,e,r,n){var o=t.groups,i=t.amount,a=t.status,u=t.required,c=!o.length||0===i,l=ae([],e);if(c){var s="IDLE"===a&&u||"FAIL"===a||"INCOMPLETE"===a?"FAIL":a,f=ie(ie({},t),{status:s}),p=ae([],n);l=Ft(l,p,f,f.amount,!0),l=zt(r,l,p,!0)}else o.forEach((function(t){var e=ae(ae([],n),[t.id]);l=ce(t,l,r,e)}));return l},se=function(){return(se=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fe=!1,pe=function(t,e){if(void 0===e&&(e={}),fe)console.warn("artisan-commerce/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once");else{if(Object(C.setState)(se({artisanApp:t},e)),void 0!==e.timeout){var r=(new Date).getTime()+e.timeout;Object(C.setState)({expiresAt:r})}"undefined"==typeof window||(fe=!0)}},de=function(t,e){if(void 0===e&&(e=t.amount>0?t.amount:1),e<1)throw new Error("Cannot set the amount of getProductTotals with a value less than 1");var r=t,n=r.updatedAt?w(r):t;return{unitGrossPrice:ge(n,1),unitTotalDiscounts:be(n,1),unitTotalTaxes:he(n,1),unitNetPrice:ve(n,1),amount:e,grossPrice:ge(n,e),totalDiscounts:be(n,e),totalTaxes:he(n,e),netPrice:ve(n,e)}},he=function(t,e){var r=I(t,{amount:e}),n=r.prices,o=r.amount,i=n[r.priceCategory],a=i.taxes,u=i.grossPrice,c=we(a,u);return ye(r,e)+c*o},ye=function(t,e){var r,n;return null!==(n=null===(r=t.questionsAndAnswers)||void 0===r?void 0:r.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices,o=r.amount,i=n[r.priceCategory],a=i.taxes,u=i.grossPrice;return t+o*(we(a,u)+ye(r,e))}),0)*e}),0))&&void 0!==n?n:0},ge=function(t,e){return Oe(t,"grossPrice",e)},be=function(t,e){return 0},ve=function(t,e){return Oe(t,"netPrice",e)},Oe=function(t,e,r){var n=I(t,{amount:r}),o=n.prices,i=n.amount,a=o[n.priceCategory][e];return(me(n,e)+a)*i},me=function(t,e){var r,n;return null!==(n=null===(r=t.questionsAndAnswers)||void 0===r?void 0:r.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices;return t+r.amount*(n[r.priceCategory][e]+me(r,e))}),0)}),0))&&void 0!==n?n:0},we=function(t,e){return t.reduce((function(t,r){return t+r.percentage/100*e}),0)};Object(C.initState)(H)}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=33)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=33)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return a}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=null,i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},a=function(t){var e=o?n({},o):{};o=null,o=n(n({},e),t),Object.seal(o)},u=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=10)}([function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return a}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=null,i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},a=function(t){var e=o?n({},o):{};o=null,o=n(n({},e),t),Object.seal(o)},u=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,a;n=r(8),o=r(1).utf8,i=r(1).bin,(a=function(t,r){var a=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,a=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var p=0;p<r.length;p+=16){for(var d=u,h=c,y=l,g=s,b=f,v=0;v<80;v++){if(v<16)a[v]=r[p+v];else{var O=a[v-3]^a[v-8]^a[v-14]^a[v-16];a[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(a[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=d,c+=h,l+=y,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?a:r&&r.asString?i.bytesToString(a):n.bytesToHex(a)})._blocksize=16,a._digestsize=20,t.exports=a}).call(this,r(3).Buffer)},function(t,e,r){"use strict";(function(t){
|
|
20
20
|
/*!
|
|
21
21
|
* The buffer module from node.js, for the browser.
|
|
22
22
|
*
|
|
@@ -34,7 +34,7 @@ e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=
|
|
|
34
34
|
*/
|
|
35
35
|
var n=r(28),o=r(29),i=r(30);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|d(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|d(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|d(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function h(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return _(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,a=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,c/=2,r/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var s=-1;for(i=r;i<u;i++)if(l(t,i)===l(e,-1===s?0:i-s)){if(-1===s&&(s=i),i-s+1===c)return s*a}else-1!==s&&(i-=i-s),s=-1}else for(r+c>u&&(r=u-c),i=r;i>=0;i--){for(var f=!0,p=0;p<c;p++)if(l(t,i+p)!==l(e,p)){f=!1;break}if(f)return i}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return w(t,e,r,n)}function j(t,e,r,n){return q(H(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function _(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&l)<<6|63&i)>127&&(s=c);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(c=(15&l)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function A(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function k(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return i||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},c.byteLength=h,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?_(this,0,t):y.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(i,a),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){i=l[f],a=s[f];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return j(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,a=1,u=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=c.isBuffer(t)?t:N(new c(t,n).toString()),u=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%u]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(27))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),a=n[0],u=n[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),s=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(s(t,a,a+16383>u?u:a+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=a.length;u<c;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
|
|
36
36
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
37
|
-
e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-s)-1,d>>=-s,s+=u;s>0;i=256*i+t[e+f],f+=p,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=n;s>0;a=256*a+t[e+f],f+=p,s-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=l}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,c,l=8*i-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=s?(u=0,a=s):a+f>=1?(u=(e*c-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&u,d+=h,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+d]=255&a,d+=h,a/=256,l-=8);t[r+d-h]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"getCategories",(function(){return U})),r.d(e,"getProductDetails",(function(){return vt})),r.d(e,"getProducts",(function(){return Pt})),r.d(e,"getRecommendedProducts",(function(){return jt})),r.d(e,"getRelatedProducts",(function(){return It})),r.d(e,"getStoreDetails",(function(){return Et})),r.d(e,"registerModifiersForm",(function(){return Jt})),r.d(e,"validateProduct",(function(){return te})),r.d(e,"initProducts",(function(){return ie})),r.d(e,"getProductTotals",(function(){return ae})),r.d(e,"transformers",(function(){return i})),r.d(e,"assertions",(function(){return n})),r.d(e,"modifierUtils",(function(){return o}));var n={};r.r(n),r.d(n,"isBaseProduct",(function(){return c})),r.d(n,"isProductDetails",(function(){return l})),r.d(n,"isCartProduct",(function(){return s})),r.d(n,"isFormCartProduct",(function(){return f}));var o={};r.r(o),r.d(o,"multiplyProductQA",(function(){return m})),r.d(o,"divideProductQA",(function(){return w})),r.d(o,"operationOnProductQA",(function(){return P}));var i={};r.r(i),r.d(i,"toCartProduct",(function(){return I})),r.d(i,"toFormCartProduct",(function(){return A})),r.d(i,"toFormCartProductHelper",(function(){return E})),r.d(i,"toFormCartProductFromProductDetails",(function(){return k})),r.d(i,"toFormCartProductFromAnswer",(function(){return x})),r.d(i,"normalizeProductDetails",(function(){return T}));var a=r(2),u=function(t){console.error(t)},c=function(t){var e=t.attributes,r=t.description,n=t.name,o=t.images,i=t.prices,a=t.productId;return"boolean"==typeof e.showInMenu&&"string"==typeof r&&"string"==typeof n&&"string"==typeof a&&!("object"!=typeof i||"object"==typeof i&&Object.keys(i).length<1)&&!!Array.isArray(o)},l=function(t){if(!c(t))return!1;var e=t.questions;return!!Array.isArray(e)},s=function(t){if(!l(t))return!1;var e,r=t.hash,n=t.createdAt,o=t.updatedAt,i=t.amount,u=t.priceCategory,c=t.comment,s=t.questionsAndAnswers;return"string"==typeof r&&"string"==typeof n&&"string"==typeof o&&"number"==typeof i&&"string"==typeof c&&!!(e=a.PriceCategoryType,Object.keys(e)).includes(u)&&!!Array.isArray(s)},f=function(t){var e;if(!s(t))return!1;var r=t.questions;if(!Array.isArray(r))return!1;var n=null===(e=null==r?void 0:r[0])||void 0===e?void 0:e.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},p=function(t){var e=t.min,r=t.max,n=t.type;if(n)return"QUANTITY"===n||"SELECT"===n?"COUNTER":n;if(0===e&&1===r)return"CHECKBOX";if(1===e&&1===r)return"RADIO";if(0===e&&(0===r||r===1/0))return"COUNTER";if(r>=e)return"COUNTER";throw new Error("Modifier group bad configured. min "+e+", max "+r+", type "+n)},d=function(t,e,r){var n=[],o=t.max,i=t.min;return e>o&&n.push({code:101,message:"Amount is heigher than the maximum allowed amount "+o}),r&&e<i&&n.push({code:102,message:"Amount is lower than the minimum allowed amount "+i}),n},h=function(t,e){var r=[],n=t.modifiers,o=t.data,i=o.min,a=o.max;0===i&&0===a&&(a=1/0);var u=n.reduce((function(t,e){return t+e.amount}),0);return u>a&&r.push({code:201,message:"Amount is heigher than the maximum allowed amount "+a}),e&&u<i&&r.push({code:202,message:"Amount is lower than the minimum allowed amount "+i}),r},y=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.data,i=t.modifiers,a=o.min,u=i.some((function(t){return"FAIL"===t.status})),c=i.some((function(t){return"IDLE"===t.status})),l=i.some((function(t){return"INCOMPLETE"===t.status})),s=i.reduce((function(t,e){return t+e.amount}),0);return b({touched:e,errors:r,required:n,min:a,amount:s,childrenWithError:u,childrenIdle:c,childrenIncomplete:l,reviewChildren:!0})},g=function(t){var e=t.groups.some((function(t){return"FAIL"===t.status})),r=t.groups.some((function(t){return"IDLE"===t.status})),n=t.groups.some((function(t){return"INCOMPLETE"===t.status})),o=t.touched,i=t.errors,a=t.required,u=t.min,c=t.amount;return b({touched:o,errors:i,required:a,min:u,amount:c,childrenWithError:e,childrenIdle:r,childrenIncomplete:n,reviewChildren:c>0})},b=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.min,i=t.amount,a=t.reviewChildren,c=t.childrenWithError,l=t.childrenIdle,s=t.childrenIncomplete,f=i>0&&!e;return f||e||!n?f||e||n?r.length||a&&c?"FAIL":a&&(l||s)||i<o?"INCOMPLETE":i>=o?"OK":(u("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:e,errors:r,required:n,min:o,amount:i},void 0,2)),"FAIL"):"OK":"IDLE"},v=function(t){return t.every((function(t){var e=t.status,r=t.required;return"OK"===e||"IDLE"===e&&!r}))?"OK":t.every((function(t){return!t.touched}))?"IDLE":t.some((function(t){return"FAIL"===t.status}))?"FAIL":"INCOMPLETE"},O=function(){return(O=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},m=function(t){return P(t,(function(t,e){var r=t.amount*e,n=m(O(O({},t),{amount:r}));return O(O({},n),{amount:t.amount*e})}))},w=function(t){return P(t,(function(t,e){var r=w(t);return O(O({},r),{amount:t.amount/e})}))},P=function(t,e){var r=t.amount,n=void 0===r?1:r,o=t.questionsAndAnswers,i=(void 0===o?[]:o).map((function(t){var r=t.answers.map((function(t){return e(t,n)}));return O(O({},t),{answers:r})}));return O(O({},t),{questionsAndAnswers:i})},j=function(){return(j=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},I=function(t,e){if(void 0===e&&(e={}),s(t))return j(j({},t),e);if(l(t))return S(t,e);var r=_(t);return S(r,e)},S=function(t,e){void 0===e&&(e={});var r=t,n=r.questionsAndAnswers,o=r.priceCategory,i=r.amount;return j(j(j({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=i?i:0,priceCategory:null!=o?o:a.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),e)},_=function(t,e){return void 0===e&&(e={}),j(j(j({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),e)},A=function(t,e){if(void 0===e&&(e={}),f(t))return j(j({},t),e);if(l(t))return k(t,e);var r=_(t);return k(r,e)},E=function(t,e){void 0===e&&(e={});var r=w(t),n=r.priceCategory,o=r.productId,i=r.amount,a=r.questions.map((function(t){var e,a=null===(e=r.questionsAndAnswers)||void 0===e?void 0:e.find((function(e){return e.questionId===t.questionId})),u=null!=a?a:t,c=u.questionId,l=u.min,s=u.max,f={rootId:o,min:l,max:s,type:p(u),modifiersCount:t.answers.length,amount:i,path:[]};return j(j({},u),{answers:t.answers.map((function(t){var e,r=null==a?void 0:a.answers.find((function(e){return e.amount>0&&e.productId===t.productId})),o=null!=r?r:t,i=function(t){return 1===t.modifiersCount?t.min:0}(f),u=function(t){var e=t.type;return"RADIO"===e||"CHECKBOX"===e?1:t.max||1/0}(f),l=function(t){var e=t.groupType,r=t.min,n=t.max,o=t.type;return"RADIO"===e?"RADIO":o?"QUANTITY"===o||"SELECT"===o?"COUNTER":o:1===r&&1===n?"RADIO":0===r&&1===n?"CHECKBOX":0!==r||0!==n&&n!==1/0?n>=r?"COUNTER":e:"COUNTER"}({min:i,max:u,groupType:f.type,type:o.renderType}),s=o.questions.length,p=j(j({},o),{amount:null!==(e=null==o?void 0:o.amount)&&void 0!==e?e:0,priceCategory:n,questionId:c,min:i,max:u,renderType:l});return j(j({},p),{questions:s?E(p).questions:[]})}))})}));return j(j(j({},r),{questions:a}),e)},k=function(t,e){void 0===e&&(e={});var r=S(t);return E(r,e)},x=function(t,e){return void 0===e&&(e={}),E(t,e)},T=function(t){var e=t.questions;return j(j({},t),{questions:e.map((function(t){var e=t.answers;return j(j({},t),{answers:e.map((function(t){var e=t.questions;return j(j({},t),{questions:null!=e?e:[]})}))})}))})},C=r(0),R=3e5,B={artisanApp:void 0,timeout:R,apiCache:{},expiresAt:(new Date).getTime()+R,forms:{}},U=function(){console.log("Not supported yet")},M=function(){return(M=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},D=["page","vendor","store","catalogue","category","product"],Y=["price","query","tags","manufacturerId","weight","dimensions"],L=["type","method"],N=["vendorId","storeId","catalogueId","categoryId","productId"],H=["category"],q=["asc","desc"],F=["alphabetic","price","predefined"],z=function(t){var e=V(t),r=G(e),n=$(r),o=W(n);return K(o)},V=function(t){var e=Object(C.getState)(),r=e.vendorId,n=e.storeId,o=Object(C.getState)(),i=o.catalogueId,a=o.categoryId,u=o.productId,c=M(M({},{vendorId:r,storeId:n,catalogueId:i,categoryId:a,productId:u}),t.filterBy),l=J(c,N,"filter"),s=Z(l);return M(M({},t),{filterBy:s})},G=function(t){var e=Q(t,H,"groupBy");return M({},e)},$=function(t){var e=t.orderBy,r=void 0===e?{}:e,n=J(r,L,"orderBy"),o=M({},n),i=r.method,a=r.type;return a&&!F.includes(a)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+a),F.includes(a)||(delete o.type,o.type="predefined"),i&&!q.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),q.includes(i)||(delete o.method,o.method="asc"),M(M({},t),{orderBy:o})},W=function(t){var e=t.pagination,r=J(void 0===e?{}:e,D,"pagination"),n=M({product:{size:20},category:{size:20}},r);return"category"!==t.groupBy&&delete n.category,M(M({},t),{pagination:n})},K=function(t){var e=t.additionalFilters,r=J(void 0===e?{}:e,Y,"additionalFilters");return M(M({},t),{additionalFilters:r})},J=function(t,e,r){var n=M({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?e.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+t),delete n[t]):delete n[t]})),n},Q=function(t,e,r){var n=M({},t),o=t[r];return void 0===o||e.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+o),delete n[r]),n},Z=function(t){var e=M({},t);return Object.entries(e).forEach((function(t){var r=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete e[r]:Array.isArray(n)&&X(n[0])||X(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+r+" = "+n),delete e[r])})),e},X=function(t){var e=typeof t;return"number"===e||"string"===e},tt=(r(4),function(){return(tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}),et=function(t,e,r){return function(t,e,r){var n;void 0===r&&(r="");var o=null!==(n=e.headers.get("account"))&&void 0!==n?n:void 0,i=t.filterBy,a=i.vendorId,u=i.storeId,c=i.catalogueId;!function(t,e){void 0===e&&(e="");var r=Object(C.getState)().accountId;if(void 0===t&&void 0===r)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+e)}(o,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+e)}(a,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+e)}(u,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+e)}(c,r)}(e=z(e),r),function(t,e,r){var n=e.filterBy,o=e.groupBy,i=e.additionalFilters,a=e.orderBy,u=e.pagination,c=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],i=e[1],a=i;return Array.isArray(i)&&(a=i.reduce((function(t,e){return t+","+e}))),tt(tt({},t),"catalogueId"===o?((r={})[o]=a,r.channelId=a,r):((n={})[o]=a,n))}),{})}(n),l=function(t){var e=null!=t?t:{},r=e.type,n=void 0===r?"predefined":r,o=e.method;return{orderBy:n,orderMethod:void 0===o?"asc":o}}(a),s=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,e){var r,n=e[0],o=e[1];return"query"===n?tt(tt({},t),((r={})[n]=o,r)):t}),{})}(i),f=function(t){var e;void 0===t&&(t={});var r=Object.entries(t),n=(null!==(e=r.find((function(t){return"category"===t[0]})))&&void 0!==e?e:[])[1],o=(null==n?void 0:n.size)>0;return r.reduce((function(t,e){var r=e[0],n=e[1],i=void 0===n?{}:n;return"page"===r?tt(tt({},t),{page:i}):"product"===r?tt(tt({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===r?tt(tt({},t),{size:i.size}):t}),{})}(u),p=tt(tt(tt(tt(tt({},c),{groupBy:o}),l),s),f);o||delete p.groupBy;var d=function(t,e){for(var r=t,n=0,o=Object.entries(e);n<o.length;n++){var i=o[n],a=i[0],u=i[1],c=new RegExp("/:"+a,"g");r=r.replace(c,"/"+u)}return r}(t,r.params),h=Object(C.getState)().artisanApp,y=(null!=h?h:{}).apiURL,g=Object.entries(p).reduce((function(t,e,r){var n=e[0],o=e[1];return void 0===o?t:t+(r?"&":"")+n+"="+o}),y+"/"+d+"?");return tt(tt({},r),{url:g,query:p})}(t,e,r)},rt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){var e,r,n,o,i,a;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(u){switch(u.label){case 0:e=t.url,r=t.headers,n=t.body,"{}"===(o={headers:r,body:JSON.stringify(n)}).body&&delete o.body,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,fetch(e,o).then((function(t){return t.json()}))];case 2:return i=u.sent(),[3,4];case 3:return a=u.sent(),i={code:null,status:"failed",message:a.message,stack:a.stack},[3,4];case 4:if(i.code<200||i.code>299)throw new Error(JSON.stringify({code:i.code,status:i.status,message:i.message,warnings:i.warning,stack:i.stack}));return[2,i]}}))}))},nt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,rt(t)];case 1:return[2,e.sent()]}}))}))},ot=r(5),it=function(){return(it=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},at=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},ut=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},ct={"Content-Type":"application/json"},lt=function(t,e){return void 0===t&&(t=!0),void 0===e&&(e={}),at(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,l,s,f,p,d,h,y,g,b;return ut(this,(function(v){switch(v.label){case 0:return r=Object(C.getState)().artisanApp,n=r.settings,o=n.platform,i=n.accountId,a=null!==(d=null!==(p=null===(f=e.account)||void 0===f?void 0:f.toString())&&void 0!==p?p:null==i?void 0:i.toString())&&void 0!==d?d:"",u=null!==(y=null!==(h=e.Platform)&&void 0!==h?h:o)&&void 0!==y?y:"",c=u,null===(g=e.Authorization)||void 0===g?[3,1]:(s=g,[3,3]);case 1:return[4,st(t)];case 2:s=v.sent(),v.label=3;case 3:return l=null!==(b=s)&&void 0!==b?b:"",[2,new Headers(it(it(it({},ct),e),{Authorization:l,Platform:c,account:a}))]}}))}))},st=function(t,e){return void 0===t&&(t=!0),at(void 0,void 0,void 0,(function(){var r,n,o;return ut(this,(function(i){switch(i.label){case 0:return r=Object(C.getState)().artisanApp,[4,null===(o=Object(ot.initAuth)(r).currentUser)||void 0===o?void 0:o.getIdToken(e)];case 1:return(n=i.sent())||t?!n&&t?(u("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},ft=r(1),pt=function(){return(pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dt=function(t,e){var r=z(e).pagination,n=t.pagination;return pt(pt({},t),{pagination:ht(r,n)})},ht=function(t,e){return pt(pt({},t),{page:null==e?void 0:e.page,hasMorePages:null==e?void 0:e.hasMorePages})},yt=function(){return(yt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},bt=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},vt=function(t,e){return gt(void 0,void 0,void 0,(function(){var r,n,o;return bt(this,(function(i){switch(i.label){case 0:return[4,lt(!1)];case 1:return r=i.sent(),n=et("v1/products/:productId",e,{headers:r,params:{productId:t},query:{},body:{}}),[4,Object(ft.handleHttpCache)(n,(function(t){return gt(void 0,void 0,void 0,(function(){var e,r;return bt(this,(function(n){switch(n.label){case 0:return[4,nt(t)];case 1:return e=n.sent(),r=T(e.data),[2,yt(yt({},e),{data:r})]}}))}))}))];case 2:return o=i.sent(),[2,dt(o,e)]}}))}))},Ot=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,rt(t)];case 1:return[2,e.sent()]}}))}))},mt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},wt=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Pt=function(t){return mt(void 0,void 0,void 0,(function(){var e,r,n;return wt(this,(function(o){switch(o.label){case 0:return[4,lt(!1)];case 1:return e=o.sent(),r=et("api/v3/productsBy",t,{headers:e,params:{},query:{},body:{}}),[4,Object(ft.handleHttpCache)(r,(function(t){return mt(void 0,void 0,void 0,(function(){return wt(this,(function(e){switch(e.label){case 0:return[4,Ot(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,dt(n,t)]}}))}))},jt=function(){console.log("Not implemented yet")},It=function(){console.log("not implemented yet")},St=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,rt(t)];case 1:return[2,e.sent()]}}))}))},_t=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},At=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Et=function(t){return _t(void 0,void 0,void 0,(function(){var e,r,n;return At(this,(function(o){switch(o.label){case 0:return[4,lt(!1)];case 1:return e=o.sent(),r=et("v1/stores/details",t,{headers:e,params:{},query:{},body:{}}),[4,Object(ft.handleHttpCache)(r,(function(t){return _t(void 0,void 0,void 0,(function(){return At(this,(function(e){switch(e.label){case 0:return[4,St(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,dt(n,t)]}}))}))},kt=function(){return(kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Tt=function(t,e){for(var r=xt([],e),n=t,o=t[0];r.length;)o=Rt(n,r[0]),r=r.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups;return o},Ct=function(t,e,r){for(var n=xt([],e),o=t,i=Rt(o,n[0]),a=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Rt(o,n[0]),n=n.slice(1),a=Object.prototype.hasOwnProperty.call(i,"modifiers"),o=xt([],a?i.modifiers:i.groups);var u=n[0];if(1===e.length&&(i={groups:t},a=!1),a){var c=i.modifiers.map((function(t){return t.id===u?kt({},r):kt({},t)}));i.modifiers=c}else{var l=i.groups.map((function(t){return t.id===u?kt({},r):kt({},t)}));i.groups=l}return 1===e.length?xt([],i.groups):xt([],t)},Rt=function(t,e){var r=t.find((function(t){return t.id===e}));if(!r)throw new Error("Path segment "+e+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return r},Bt=function(){return(Bt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ut=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Mt=function(t,e,r,n,o){var i=Bt(Bt({},r),{amount:n,touched:!0,errors:d(r,n,o),totals:ae(Bt(Bt({},r.data),{amount:n})),data:Bt(Bt({},r.data),{amount:n})});return i.status=g(i),Ct(t,e,i)},Dt=function(t,e,r,n){var o=r.slice(0,-1),i=Tt(e,o),a=Ut([],i.modifiers);"RADIO"!==i.type||n||(a=i.modifiers.map((function(t){return"RADIO"!==t.type||t.id===r[r.length-1]?Bt({},t):Bt(Bt({},t),{amount:0,error:"",totals:ae(Bt(Bt({},t.data),{amount:0})),data:Bt(Bt({},t.data),{amount:0})})})));var u=(a=a.map((function(e){var o=x(e.data),i=Ut(Ut([],r.slice(0,-1)),[e.id]),a=Bt(Bt({},e),{groups:qt(o,{rootId:t,path:i},e.groups)});return a.errors=d(a,a.amount,n),a.status=g(a),a}))).map((function(t){return Bt({},t.data)})),c=Bt(Bt({},i.data),{answers:u}),l=Bt(Bt({},i),{touched:!0,modifiers:a,data:c});l.errors=h(l,n),l.status=y(l);var s=Ct(e,o,l);return o.length>1&&(s=Yt(t,s,o,n)),s},Yt=function(t,e,r,n){var o=r.slice(0,-1),i=Tt(e,o),a=i.groups.map((function(t){return Bt({},t.data)})),u=Bt(Bt({},i.data),{questions:a}),c=i.groups.map((function(t){var e=Bt({},t);return e.errors=h(e,n),e.status=y(e),e})),l=Bt(Bt({},i),{touched:!0,groups:c,data:u});l.errors=d(l,l.amount,n),l.status=g(l);var s=Ct(e,o,l);return o.length>1&&(s=Dt(t,s,o,n)),s},Lt=function(){return(Lt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nt=function(){return(Nt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ht=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},qt=function(t,e,r){var n=e.rootId,o=e.path;return t.questions.map((function(e){var i=null==r?void 0:r.find((function(t){return t.id===e.questionId}));return Ft(e,{amount:t.amount,rootId:n,path:Ht([],o)},i)}))},Ft=function(t,e,r){var n=t.questionId,o=t.name,i=t.description,a=t.max,u=t.min,c=t.images,l=e.amount,s=e.rootId,f=e.path,d=null!=r?r:{},h=d.errors,g=d.touched,b={id:n,name:o,description:null!=i?i:"",images:Ht([],null!=c?c:[]),data:Nt({},t),errors:null!=h?h:[],touched:null!=g&&g,status:"IDLE",hidden:l<1,required:u>0,type:p(t)},v={rootId:s,max:a,min:u,type:b.type,modifiersCount:t.answers.length,amount:l,path:Ht(Ht([],f),[n])},O=t.answers.map((function(t){var e=null==r?void 0:r.modifiers.find((function(e){return e.id===t.productId}));return zt(t,v,e)})),m=Nt(Nt({},b),{modifiers:O});return Nt(Nt({},m),{status:y(m)})},zt=function(t,e,r){var n,o,i=t.productId,a=t.questionId,u=t.name,c=t.images,l=t.amount,s=t.renderType,f=t.min,p=t.max,d=x(t),h=e.rootId,y=e.path,b=Ht(Ht([],y),[i]),O=qt(d,{rootId:h,path:b},null==r?void 0:r.groups),m={id:i,groupId:a,name:u,images:Ht([],c),amount:l,data:Nt({},t),groups:O,errors:null!==(n=null==r?void 0:r.errors)&&void 0!==n?n:[],hidden:e.amount<1,min:f,max:p,required:f>0,touched:null!==(o=null==r?void 0:r.touched)&&void 0!==o&&o,status:"IDLE",totals:ae(Nt(Nt({},t),{amount:l})),type:s,handleChange:function(t){!function(t,e,r){var n,o=Lt({},Object(C.getState)().forms),i=o[t],a=Tt(i.renderer,e),u=Mt(i.renderer,e,a,r,!1);u=Dt(t,u,e,!1);var c=Gt(u,i.product),l=Lt(Lt({},i),{renderer:u,product:c,status:v(u)}),s=Lt(Lt({},o),((n={})[t]=l,n));Object(C.setState)({forms:s});var f=Lt({},l);delete f.callback,i.callback(f)}(e.rootId,b,t)}};return Nt(Nt({},m),{status:g(m)})},Vt=function(){return(Vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gt=function(t,e){var r=I(e);return Vt(Vt({},r),{questionsAndAnswers:$t(t),updatedAt:""})},$t=function(t){return t.map((function(t){return Vt(Vt({},t.data),{answers:Wt(t.modifiers)})}))},Wt=function(t){return t.map((function(t){return t.amount?Vt(Vt({},t.data),{questionsAndAnswers:$t(t.groups)}):Vt(Vt({},t.data),{questionsAndAnswers:[]})}))},Kt=function(){return(Kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Jt=function(t,e){var r,n=t.productId,o=Object(C.getState)().forms;if(o[n])return u("Form for product with id "+n+" has already been register. Please unsuscribe if you need to register a new form."),function(){};var i=function(t){var e,r=A(t,{amount:null!==(e=t.amount)&&void 0!==e?e:1}),n=qt(r,{rootId:r.productId,path:[]});return{product:Gt(n,t),renderer:n,validate:function(){return te(t.productId)},status:v(n)}}(t),a=Kt(Kt({},o),((r={})[n]=Kt(Kt({},i),{callback:e}),r));return Object(C.setState)({forms:a}),e(Kt({},i)),function(){return Qt(n)}},Qt=function(t){var e=Object(C.getState)().forms,r=Kt({},e);delete r[t],Object(C.setState)({forms:r})},Zt=function(){return(Zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},te=function(t){var e,r=Zt({},Object(C.getState)().forms),n=r[t],o=n.renderer,i=n.callback,a=n.product,u=Xt([],o);o.forEach((function(e){var r=[e.id];u=ee(e,u,t,r)}));var c=Gt(u,a),l=Zt(Zt({},n),{renderer:u,product:c,status:v(u)}),s=Zt(Zt({},r),((e={})[t]=l,e));Object(C.setState)({forms:s});var f=Zt({},l);return delete f.callback,i(f),l.status},ee=function(t,e,r,n){var o=t.modifiers,i=t.id,a=!o.length,u=Xt([],e);return a?(console.warn("Attempting to validate a Modifier group without modifiers, this will likely result in unexpected behaviour. \n Please update the bad group "+i+" of product 0."),u):(o.forEach((function(t){var e=Xt(Xt([],n),[t.id]);u=re(t,u,r,e)})),u)},re=function(t,e,r,n){var o=t.groups,i=t.amount,a=t.status,u=t.required,c=!o.length||0===i,l=Xt([],e);if(c){var s="IDLE"===a&&u||"FAIL"===a||"INCOMPLETE"===a?"FAIL":a,f=Zt(Zt({},t),{status:s}),p=Xt([],n);l=Mt(l,p,f,f.amount,!0),l=Dt(r,l,p,!0)}else o.forEach((function(t){var e=Xt(Xt([],n),[t.id]);l=ee(t,l,r,e)}));return l},ne=function(){return(ne=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},oe=!1,ie=function(t,e){if(void 0===e&&(e={}),oe)console.warn("artisan-commerce/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once");else{if(Object(C.setState)(ne({artisanApp:t},e)),void 0!==e.timeout){var r=(new Date).getTime()+e.timeout;Object(C.setState)({expiresAt:r})}"undefined"==typeof window||(oe=!0)}},ae=function(t,e){if(void 0===e&&(e=t.amount>0?t.amount:1),e<1)throw new Error("Cannot set the amount of getProductTotals with a value less than 1");var r=t,n=r.updatedAt?w(r):t;return{unitGrossPrice:le(n,1),unitTotalDiscounts:se(n,1),unitTotalTaxes:ue(n,1),unitNetPrice:fe(n,1),amount:e,grossPrice:le(n,e),totalDiscounts:se(n,e),totalTaxes:ue(n,e),netPrice:fe(n,e)}},ue=function(t,e){var r=I(t,{amount:e}),n=r.prices,o=r.amount,i=n[r.priceCategory],a=i.taxes,u=i.grossPrice,c=he(a,u);return ce(r,e)+c*o},ce=function(t,e){return t.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices,o=r.amount,i=n[r.priceCategory],a=i.taxes,u=i.grossPrice;return t+o*(he(a,u)+ce(r,e))}),0)*e}),0)},le=function(t,e){return pe(t,"grossPrice",e)},se=function(t,e){return 0},fe=function(t,e){return pe(t,"netPrice",e)},pe=function(t,e,r){var n=I(t,{amount:r}),o=n.prices,i=n.amount,a=o[n.priceCategory][e];return(de(n,e)+a)*i},de=function(t,e){return t.questionsAndAnswers.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices;return t+r.amount*(n[r.priceCategory][e]+de(r,e))}),0)}),0)},he=function(t,e){return t.reduce((function(t,r){return t+r.percentage/100*e}),0)};Object(C.initState)(B)}])},function(t,e,r){t.exports=function(){"use strict";var t="millisecond",e="second",r="minute",n="hour",o="day",i="week",a="month",u="quarter",c="year",l="date",s=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},d=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},h={s:d,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r%60;return(e<=0?"+":"-")+d(n,2,"0")+":"+d(o,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),o=e.clone().add(n,a),i=r-o<0,u=e.clone().add(n+(i?-1:1),a);return+(-(n+(r-o)/(i?o-u:u-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(s){return{M:a,y:c,w:i,d:o,D:l,h:n,m:r,s:e,ms:t,Q:u}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",g={};g[y]=p;var b=function(t){return t instanceof w},v=function(t,e,r){var n;if(!t)return y;if("string"==typeof t)g[t]&&(n=t),e&&(g[t]=e,n=t);else{var o=t.name;g[o]=t,n=o}return!r&&n&&(y=n),n||!r&&y},O=function(t,e){if(b(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new w(r)},m=h;m.l=v,m.i=b,m.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var w=function(){function p(t){this.$L=v(t.locale,null,!0),this.parse(t)}var d=p.prototype;return d.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(m.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(s);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return m},d.isValid=function(){return!("Invalid Date"===this.$d.toString())},d.isSame=function(t,e){var r=O(t);return this.startOf(e)<=r&&r<=this.endOf(e)},d.isAfter=function(t,e){return O(t)<this.startOf(e)},d.isBefore=function(t,e){return this.endOf(e)<O(t)},d.$g=function(t,e,r){return m.u(t)?this[e]:this.set(r,t)},d.unix=function(){return Math.floor(this.valueOf()/1e3)},d.valueOf=function(){return this.$d.getTime()},d.startOf=function(t,u){var s=this,f=!!m.u(u)||u,p=m.p(t),d=function(t,e){var r=m.w(s.$u?Date.UTC(s.$y,e,t):new Date(s.$y,e,t),s);return f?r:r.endOf(o)},h=function(t,e){return m.w(s.toDate()[t].apply(s.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(e)),s)},y=this.$W,g=this.$M,b=this.$D,v="set"+(this.$u?"UTC":"");switch(p){case c:return f?d(1,0):d(31,11);case a:return f?d(1,g):d(0,g+1);case i:var O=this.$locale().weekStart||0,w=(y<O?y+7:y)-O;return d(f?b-w:b+(6-w),g);case o:case l:return h(v+"Hours",0);case n:return h(v+"Minutes",1);case r:return h(v+"Seconds",2);case e:return h(v+"Milliseconds",3);default:return this.clone()}},d.endOf=function(t){return this.startOf(t,!1)},d.$set=function(i,u){var s,f=m.p(i),p="set"+(this.$u?"UTC":""),d=(s={},s[o]=p+"Date",s[l]=p+"Date",s[a]=p+"Month",s[c]=p+"FullYear",s[n]=p+"Hours",s[r]=p+"Minutes",s[e]=p+"Seconds",s[t]=p+"Milliseconds",s)[f],h=f===o?this.$D+(u-this.$W):u;if(f===a||f===c){var y=this.clone().set(l,1);y.$d[d](h),y.init(),this.$d=y.set(l,Math.min(this.$D,y.daysInMonth())).$d}else d&&this.$d[d](h);return this.init(),this},d.set=function(t,e){return this.clone().$set(t,e)},d.get=function(t){return this[m.p(t)]()},d.add=function(t,u){var l,s=this;t=Number(t);var f=m.p(u),p=function(e){var r=O(s);return m.w(r.date(r.date()+Math.round(e*t)),s)};if(f===a)return this.set(a,this.$M+t);if(f===c)return this.set(c,this.$y+t);if(f===o)return p(1);if(f===i)return p(7);var d=(l={},l[r]=6e4,l[n]=36e5,l[e]=1e3,l)[f]||1,h=this.$d.getTime()+t*d;return m.w(h,this)},d.subtract=function(t,e){return this.add(-1*t,e)},d.format=function(t){var e=this;if(!this.isValid())return"Invalid Date";var r=t||"YYYY-MM-DDTHH:mm:ssZ",n=m.z(this),o=this.$locale(),i=this.$H,a=this.$m,u=this.$M,c=o.weekdays,l=o.months,s=function(t,n,o,i){return t&&(t[n]||t(e,r))||o[n].substr(0,i)},p=function(t){return m.s(i%12||12,t,"0")},d=o.meridiem||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n},h={YY:String(this.$y).slice(-2),YYYY:this.$y,M:u+1,MM:m.s(u+1,2,"0"),MMM:s(o.monthsShort,u,l,3),MMMM:s(l,u),D:this.$D,DD:m.s(this.$D,2,"0"),d:String(this.$W),dd:s(o.weekdaysMin,this.$W,c,2),ddd:s(o.weekdaysShort,this.$W,c,3),dddd:c[this.$W],H:String(i),HH:m.s(i,2,"0"),h:p(1),hh:p(2),a:d(i,a,!0),A:d(i,a,!1),m:String(a),mm:m.s(a,2,"0"),s:String(this.$s),ss:m.s(this.$s,2,"0"),SSS:m.s(this.$ms,3,"0"),Z:n};return r.replace(f,(function(t,e){return e||h[t]||n.replace(":","")}))},d.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},d.diff=function(t,l,s){var f,p=m.p(l),d=O(t),h=6e4*(d.utcOffset()-this.utcOffset()),y=this-d,g=m.m(this,d);return g=(f={},f[c]=g/12,f[a]=g,f[u]=g/3,f[i]=(y-h)/6048e5,f[o]=(y-h)/864e5,f[n]=y/36e5,f[r]=y/6e4,f[e]=y/1e3,f)[p]||y,s?g:m.a(g)},d.daysInMonth=function(){return this.endOf(a).$D},d.$locale=function(){return g[this.$L]},d.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=v(t,e,!0);return n&&(r.$L=n),r},d.clone=function(){return m.w(this.$d,this)},d.toDate=function(){return new Date(this.valueOf())},d.toJSON=function(){return this.isValid()?this.toISOString():null},d.toISOString=function(){return this.$d.toISOString()},d.toString=function(){return this.$d.toUTCString()},p}(),P=w.prototype;return O.prototype=P,[["$ms",t],["$s",e],["$m",r],["$H",n],["$W",o],["$M",a],["$y",c],["$D",l]].forEach((function(t){P[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,w,O),t.$i=!0),O},O.locale=v,O.isDayjs=b,O.unix=function(t){return O(1e3*t)},O.en=g[y],O.Ls=g,O.p={},O}()},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,a;n=r(11),o=r(2).utf8,i=r(2).bin,(a=function(t,r){var a=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,a=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var p=0;p<r.length;p+=16){for(var d=u,h=c,y=l,g=s,b=f,v=0;v<80;v++){if(v<16)a[v]=r[p+v];else{var O=a[v-3]^a[v-8]^a[v-14]^a[v-16];a[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(a[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=d,c+=h,l+=y,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?a:r&&r.asString?i.bytesToString(a):n.bytesToHex(a)})._blocksize=16,a._digestsize=20,t.exports=a}).call(this,r(6).Buffer)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(12),e),o(r(13),e),o(r(14),e),o(r(15),e),o(r(16),e),o(r(17),e),o(r(18),e),o(r(19),e),o(r(20),e),o(r(21),e),o(r(22),e),o(r(23),e),o(r(24),e),o(r(25),e),o(r(26),e),o(r(27),e),o(r(28),e),o(r(29),e),o(r(30),e),o(r(31),e)},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initAuth",(function(){return n})),r.d(e,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,e,r){"use strict";(function(t){
|
|
37
|
+
e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-s)-1,d>>=-s,s+=u;s>0;i=256*i+t[e+f],f+=p,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=n;s>0;a=256*a+t[e+f],f+=p,s-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=l}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,c,l=8*i-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=s?(u=0,a=s):a+f>=1?(u=(e*c-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&u,d+=h,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+d]=255&a,d+=h,a/=256,l-=8);t[r+d-h]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},,function(t,e,r){"use strict";r.r(e),r.d(e,"getCategories",(function(){return U})),r.d(e,"getProductDetails",(function(){return vt})),r.d(e,"getProducts",(function(){return Pt})),r.d(e,"getRecommendedProducts",(function(){return jt})),r.d(e,"getRelatedProducts",(function(){return It})),r.d(e,"getStoreDetails",(function(){return Et})),r.d(e,"registerModifiersForm",(function(){return Jt})),r.d(e,"validateProduct",(function(){return te})),r.d(e,"initProducts",(function(){return ie})),r.d(e,"getProductTotals",(function(){return ae})),r.d(e,"transformers",(function(){return i})),r.d(e,"assertions",(function(){return n})),r.d(e,"modifierUtils",(function(){return o}));var n={};r.r(n),r.d(n,"isBaseProduct",(function(){return c})),r.d(n,"isProductDetails",(function(){return l})),r.d(n,"isCartProduct",(function(){return s})),r.d(n,"isFormCartProduct",(function(){return f}));var o={};r.r(o),r.d(o,"multiplyProductQA",(function(){return m})),r.d(o,"divideProductQA",(function(){return w})),r.d(o,"operationOnProductQA",(function(){return P}));var i={};r.r(i),r.d(i,"toCartProduct",(function(){return I})),r.d(i,"toFormCartProduct",(function(){return A})),r.d(i,"toFormCartProductHelper",(function(){return E})),r.d(i,"toFormCartProductFromProductDetails",(function(){return k})),r.d(i,"toFormCartProductFromAnswer",(function(){return x})),r.d(i,"normalizeProductDetails",(function(){return T}));var a=r(2),u=function(t){console.error(t)},c=function(t){var e=t.attributes,r=t.description,n=t.name,o=t.images,i=t.prices,a=t.productId;return"boolean"==typeof e.showInMenu&&"string"==typeof r&&"string"==typeof n&&"string"==typeof a&&!("object"!=typeof i||"object"==typeof i&&Object.keys(i).length<1)&&!!Array.isArray(o)},l=function(t){if(!c(t))return!1;var e=t.questions;return!!Array.isArray(e)},s=function(t){if(!l(t))return!1;var e,r=t.hash,n=t.createdAt,o=t.updatedAt,i=t.amount,u=t.priceCategory,c=t.comment,s=t.questionsAndAnswers;return"string"==typeof r&&"string"==typeof n&&"string"==typeof o&&"number"==typeof i&&"string"==typeof c&&!!(e=a.PriceCategoryType,Object.keys(e)).includes(u)&&!!Array.isArray(s)},f=function(t){var e;if(!s(t))return!1;var r=t.questions;if(!Array.isArray(r))return!1;var n=null===(e=null==r?void 0:r[0])||void 0===e?void 0:e.answers;return!(null==n?void 0:n.length)||void 0!==n[0].amount},p=function(t){var e=t.min,r=t.max,n=t.type;if(n)return"QUANTITY"===n||"SELECT"===n?"COUNTER":n;if(0===e&&1===r)return"CHECKBOX";if(1===e&&1===r)return"RADIO";if(0===e&&(0===r||r===1/0))return"COUNTER";if(r>=e)return"COUNTER";throw new Error("Modifier group bad configured. min "+e+", max "+r+", type "+n)},d=function(t,e,r){var n=[],o=t.max,i=t.min;return e>o&&n.push({code:101,message:"Amount is heigher than the maximum allowed amount "+o}),r&&e<i&&n.push({code:102,message:"Amount is lower than the minimum allowed amount "+i}),n},h=function(t,e){var r=[],n=t.modifiers,o=t.data,i=o.min,a=o.max;0===i&&0===a&&(a=1/0);var u=n.reduce((function(t,e){return t+e.amount}),0);return u>a&&r.push({code:201,message:"Amount is heigher than the maximum allowed amount "+a}),e&&u<i&&r.push({code:202,message:"Amount is lower than the minimum allowed amount "+i}),r},y=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.data,i=t.modifiers,a=o.min,u=i.some((function(t){return"FAIL"===t.status})),c=i.some((function(t){return"IDLE"===t.status})),l=i.some((function(t){return"INCOMPLETE"===t.status})),s=i.reduce((function(t,e){return t+e.amount}),0);return b({touched:e,errors:r,required:n,min:a,amount:s,childrenWithError:u,childrenIdle:c,childrenIncomplete:l,reviewChildren:!0})},g=function(t){var e=t.groups.some((function(t){return"FAIL"===t.status})),r=t.groups.some((function(t){return"IDLE"===t.status})),n=t.groups.some((function(t){return"INCOMPLETE"===t.status})),o=t.touched,i=t.errors,a=t.required,u=t.min,c=t.amount;return b({touched:o,errors:i,required:a,min:u,amount:c,childrenWithError:e,childrenIdle:r,childrenIncomplete:n,reviewChildren:c>0})},b=function(t){var e=t.touched,r=t.errors,n=t.required,o=t.min,i=t.amount,a=t.reviewChildren,c=t.childrenWithError,l=t.childrenIdle,s=t.childrenIncomplete,f=i>0&&!e;return f||e||!n?f||e||n?r.length||a&&c?"FAIL":a&&(l||s)||i<o?"INCOMPLETE":i>=o?"OK":(u("Unhandled case. Unable to compute the renderer status "+JSON.stringify({touched:e,errors:r,required:n,min:o,amount:i},void 0,2)),"FAIL"):"OK":"IDLE"},v=function(t){return t.every((function(t){var e=t.status,r=t.required;return"OK"===e||"IDLE"===e&&!r}))?"OK":t.every((function(t){return!t.touched}))?"IDLE":t.some((function(t){return"FAIL"===t.status}))?"FAIL":"INCOMPLETE"},O=function(){return(O=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},m=function(t){return P(t,(function(t,e){var r=t.amount*e,n=m(O(O({},t),{amount:r}));return O(O({},n),{amount:t.amount*e})}))},w=function(t){return P(t,(function(t,e){var r=w(t);return O(O({},r),{amount:t.amount/e})}))},P=function(t,e){var r=t.amount,n=void 0===r?1:r,o=t.questionsAndAnswers,i=(void 0===o?[]:o).map((function(t){var r=t.answers.map((function(t){return e(t,n)}));return O(O({},t),{answers:r})}));return O(O({},t),{questionsAndAnswers:i})},j=function(){return(j=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},I=function(t,e){if(void 0===e&&(e={}),s(t))return j(j({},t),e);if(l(t))return S(t,e);var r=_(t);return S(r,e)},S=function(t,e){void 0===e&&(e={});var r=t,n=r.questionsAndAnswers,o=r.priceCategory,i=r.amount;return j(j(j({},t),{questionsAndAnswers:null!=n?n:[],amount:null!=i?i:0,priceCategory:null!=o?o:a.PriceCategoryType.NORMAL,comment:"",alerts:[],hash:"",createdAt:"",updatedAt:""}),e)},_=function(t,e){return void 0===e&&(e={}),j(j(j({},t),{addDirectlyToCart:!0,isPriceVip:!1,manufacturer:[],maxAmountForSale:0,questions:[],schedule:[]}),e)},A=function(t,e){if(void 0===e&&(e={}),f(t))return j(j({},t),e);if(l(t))return k(t,e);var r=_(t);return k(r,e)},E=function(t,e){void 0===e&&(e={});var r=w(t),n=r.priceCategory,o=r.productId,i=r.amount,a=r.questions.map((function(t){var e,a=null===(e=r.questionsAndAnswers)||void 0===e?void 0:e.find((function(e){return e.questionId===t.questionId})),u=null!=a?a:t,c=u.questionId,l=u.min,s=u.max,f={rootId:o,min:l,max:s,type:p(u),modifiersCount:t.answers.length,amount:i,path:[]};return j(j({},u),{answers:t.answers.map((function(t){var e,r=null==a?void 0:a.answers.find((function(e){return e.amount>0&&e.productId===t.productId})),o=null!=r?r:t,i=function(t){return 1===t.modifiersCount?t.min:0}(f),u=function(t){var e=t.type;return"RADIO"===e||"CHECKBOX"===e?1:t.max||1/0}(f),l=function(t){var e=t.groupType,r=t.min,n=t.max,o=t.type;return"RADIO"===e?"RADIO":o?"QUANTITY"===o||"SELECT"===o?"COUNTER":o:1===r&&1===n?"RADIO":0===r&&1===n?"CHECKBOX":0!==r||0!==n&&n!==1/0?n>=r?"COUNTER":e:"COUNTER"}({min:i,max:u,groupType:f.type,type:o.renderType}),s=o.questions.length,p=j(j({},o),{amount:null!==(e=null==o?void 0:o.amount)&&void 0!==e?e:0,priceCategory:n,questionId:c,min:i,max:u,renderType:l});return j(j({},p),{questions:s?E(p).questions:[]})}))})}));return j(j(j({},r),{questions:a}),e)},k=function(t,e){void 0===e&&(e={});var r=S(t);return E(r,e)},x=function(t,e){return void 0===e&&(e={}),E(t,e)},T=function(t){var e=t.questions;return j(j({},t),{questions:e.map((function(t){var e=t.answers;return j(j({},t),{answers:e.map((function(t){var e=t.questions;return j(j({},t),{questions:null!=e?e:[]})}))})}))})},C=r(0),R=3e5,B={artisanApp:void 0,timeout:R,apiCache:{},expiresAt:(new Date).getTime()+R,forms:{}},U=function(){console.log("Not supported yet")},M=function(){return(M=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},D=["page","vendor","store","catalogue","category","product"],Y=["price","query","tags","manufacturerId","weight","dimensions"],L=["type","method"],N=["vendorId","storeId","catalogueId","categoryId","productId"],H=["category"],q=["asc","desc"],F=["alphabetic","price","predefined"],z=function(t){var e=V(t),r=G(e),n=$(r),o=W(n);return K(o)},V=function(t){var e=Object(C.getState)(),r=e.vendorId,n=e.storeId,o=Object(C.getState)(),i=o.catalogueId,a=o.categoryId,u=o.productId,c=M(M({},{vendorId:r,storeId:n,catalogueId:i,categoryId:a,productId:u}),t.filterBy),l=J(c,N,"filter"),s=Z(l);return M(M({},t),{filterBy:s})},G=function(t){var e=Q(t,H,"groupBy");return M({},e)},$=function(t){var e=t.orderBy,r=void 0===e?{}:e,n=J(r,L,"orderBy"),o=M({},n),i=r.method,a=r.type;return a&&!F.includes(a)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order type "+a),F.includes(a)||(delete o.type,o.type="predefined"),i&&!q.includes(i)&&console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig order method "+i),q.includes(i)||(delete o.method,o.method="asc"),M(M({},t),{orderBy:o})},W=function(t){var e=t.pagination,r=J(void 0===e?{}:e,D,"pagination"),n=M({product:{size:20},category:{size:20}},r);return"category"!==t.groupBy&&delete n.category,M(M({},t),{pagination:n})},K=function(t){var e=t.additionalFilters,r=J(void 0===e?{}:e,Y,"additionalFilters");return M(M({},t),{additionalFilters:r})},J=function(t,e,r){var n=M({},t);return Object.keys(n).forEach((function(t){void 0!==n[t]?e.includes(t)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+t),delete n[t]):delete n[t]})),n},Q=function(t,e,r){var n=M({},t),o=t[r];return void 0===o||e.includes(o)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig "+r+" "+o),delete n[r]),n},Z=function(t){var e=M({},t);return Object.entries(e).forEach((function(t){var r=t[0],n=t[1];void 0===n||Array.isArray(n)&&!n.length?delete e[r]:Array.isArray(n)&&X(n[0])||X(n)||(console.warn("@artisan-commerce/products: Invalid ProductsHTTPConfig filter value: "+r+" = "+n),delete e[r])})),e},X=function(t){var e=typeof t;return"number"===e||"string"===e},tt=(r(4),function(){return(tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)}),et=function(t,e,r){return function(t,e,r){var n;void 0===r&&(r="");var o=null!==(n=e.headers.get("account"))&&void 0!==n?n:void 0,i=t.filterBy,a=i.vendorId,u=i.storeId,c=i.catalogueId;!function(t,e){void 0===e&&(e="");var r=Object(C.getState)().accountId;if(void 0===t&&void 0===r)throw new Error("@artisan-commerce/products: AccountId must be defined. Either provide a global accountId or at the function call level. "+e)}(o,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().vendorId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: vendorId must be defined. Either provide a global vendorId or at the function call level. "+e)}(a,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().storeId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: storeId must be defined. Either provide a global storeId or at the function call level. "+e)}(u,r),function(t,e){void 0===e&&(e="");var r=Object(C.getState)().catalogueId;if(!(Array.isArray(t)&&t.length||void 0!==t||void 0!==r))throw new Error("@artisan-commerce/products: catalogueId must be defined. Either provide a global catalogueId or at the function call level. "+e)}(c,r)}(e=z(e),r),function(t,e,r){var n=e.filterBy,o=e.groupBy,i=e.additionalFilters,a=e.orderBy,u=e.pagination,c=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],i=e[1],a=i;return Array.isArray(i)&&(a=i.reduce((function(t,e){return t+","+e}))),tt(tt({},t),"catalogueId"===o?((r={})[o]=a,r.channelId=a,r):((n={})[o]=a,n))}),{})}(n),l=function(t){var e=null!=t?t:{},r=e.type,n=void 0===r?"predefined":r,o=e.method;return{orderBy:n,orderMethod:void 0===o?"asc":o}}(a),s=function(t){return void 0===t&&(t={}),Object.entries(t).reduce((function(t,e){var r,n=e[0],o=e[1];return"query"===n?tt(tt({},t),((r={})[n]=o,r)):t}),{})}(i),f=function(t){var e;void 0===t&&(t={});var r=Object.entries(t),n=(null!==(e=r.find((function(t){return"category"===t[0]})))&&void 0!==e?e:[])[1],o=(null==n?void 0:n.size)>0;return r.reduce((function(t,e){var r=e[0],n=e[1],i=void 0===n?{}:n;return"page"===r?tt(tt({},t),{page:i}):"product"===r?tt(tt({},t),o?{productsByGroup:i.size}:{size:i.size}):"category"===r?tt(tt({},t),{size:i.size}):t}),{})}(u),p=tt(tt(tt(tt(tt({},c),{groupBy:o}),l),s),f);o||delete p.groupBy;var d=function(t,e){for(var r=t,n=0,o=Object.entries(e);n<o.length;n++){var i=o[n],a=i[0],u=i[1],c=new RegExp("/:"+a,"g");r=r.replace(c,"/"+u)}return r}(t,r.params),h=Object(C.getState)().artisanApp,y=(null!=h?h:{}).apiURL,g=Object.entries(p).reduce((function(t,e,r){var n=e[0],o=e[1];return void 0===o?t:t+(r?"&":"")+n+"="+o}),y+"/"+d+"?");return tt(tt({},r),{url:g,query:p})}(t,e,r)},rt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){var e,r,n,o,i,a;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(u){switch(u.label){case 0:e=t.url,r=t.headers,n=t.body,"{}"===(o={headers:r,body:JSON.stringify(n)}).body&&delete o.body,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,fetch(e,o).then((function(t){return t.json()}))];case 2:return i=u.sent(),[3,4];case 3:return a=u.sent(),i={code:null,status:"failed",message:a.message,stack:a.stack},[3,4];case 4:if(i.code<200||i.code>299)throw new Error(JSON.stringify({code:i.code,status:i.status,message:i.message,warnings:i.warning,stack:i.stack}));return[2,i]}}))}))},nt=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,rt(t)];case 1:return[2,e.sent()]}}))}))},ot=r(5),it=function(){return(it=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},at=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},ut=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},ct={"Content-Type":"application/json"},lt=function(t,e){return void 0===t&&(t=!0),void 0===e&&(e={}),at(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,l,s,f,p,d,h,y,g,b;return ut(this,(function(v){switch(v.label){case 0:return r=Object(C.getState)().artisanApp,n=r.settings,o=n.platform,i=n.accountId,a=null!==(d=null!==(p=null===(f=e.account)||void 0===f?void 0:f.toString())&&void 0!==p?p:null==i?void 0:i.toString())&&void 0!==d?d:"",u=null!==(y=null!==(h=e.Platform)&&void 0!==h?h:o)&&void 0!==y?y:"",c=u,null===(g=e.Authorization)||void 0===g?[3,1]:(s=g,[3,3]);case 1:return[4,st(t)];case 2:s=v.sent(),v.label=3;case 3:return l=null!==(b=s)&&void 0!==b?b:"",[2,new Headers(it(it(it({},ct),e),{Authorization:l,Platform:c,account:a}))]}}))}))},st=function(t,e){return void 0===t&&(t=!0),at(void 0,void 0,void 0,(function(){var r,n,o;return ut(this,(function(i){switch(i.label){case 0:return r=Object(C.getState)().artisanApp,[4,null===(o=Object(ot.initAuth)(r).currentUser)||void 0===o?void 0:o.getIdToken(e)];case 1:return(n=i.sent())||t?!n&&t?(u("Please make sure you are authenticated before trying to call a restricted action."),[2]):[2,"Bearer "+n]:[2]}}))}))},ft=r(1),pt=function(){return(pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dt=function(t,e){var r=z(e).pagination,n=t.pagination;return pt(pt({},t),{pagination:ht(r,n)})},ht=function(t,e){return pt(pt({},t),{page:null==e?void 0:e.page,hasMorePages:null==e?void 0:e.hasMorePages})},yt=function(){return(yt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},bt=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},vt=function(t,e){return gt(void 0,void 0,void 0,(function(){var r,n,o;return bt(this,(function(i){switch(i.label){case 0:return[4,lt(!1)];case 1:return r=i.sent(),n=et("v1/products/:productId",e,{headers:r,params:{productId:t},query:{},body:{}}),[4,Object(ft.handleHttpCache)(n,(function(t){return gt(void 0,void 0,void 0,(function(){var e,r;return bt(this,(function(n){switch(n.label){case 0:return[4,nt(t)];case 1:return e=n.sent(),r=T(e.data),[2,yt(yt({},e),{data:r})]}}))}))}))];case 2:return o=i.sent(),[2,dt(o,e)]}}))}))},Ot=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,rt(t)];case 1:return[2,e.sent()]}}))}))},mt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},wt=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Pt=function(t){return mt(void 0,void 0,void 0,(function(){var e,r,n;return wt(this,(function(o){switch(o.label){case 0:return[4,lt(!1)];case 1:return e=o.sent(),r=et("api/v3/productsBy",t,{headers:e,params:{},query:{},body:{}}),[4,Object(ft.handleHttpCache)(r,(function(t){return mt(void 0,void 0,void 0,(function(){return wt(this,(function(e){switch(e.label){case 0:return[4,Ot(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,dt(n,t)]}}))}))},jt=function(){console.log("Not implemented yet")},It=function(){console.log("not implemented yet")},St=function(t){return function(t,e,r,n){return new(r||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function i(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(o,i)}a((n=n.apply(void 0,[])).next())}))}(0,0,void 0,(function(){return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(e){switch(e.label){case 0:return[4,rt(t)];case 1:return[2,e.sent()]}}))}))},_t=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},At=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Et=function(t){return _t(void 0,void 0,void 0,(function(){var e,r,n;return At(this,(function(o){switch(o.label){case 0:return[4,lt(!1)];case 1:return e=o.sent(),r=et("v1/stores/details",t,{headers:e,params:{},query:{},body:{}}),[4,Object(ft.handleHttpCache)(r,(function(t){return _t(void 0,void 0,void 0,(function(){return At(this,(function(e){switch(e.label){case 0:return[4,St(t)];case 1:return[2,e.sent()]}}))}))}))];case 2:return n=o.sent(),[2,dt(n,t)]}}))}))},kt=function(){return(kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Tt=function(t,e){for(var r=xt([],e),n=t,o=t[0];r.length;)o=Rt(n,r[0]),r=r.slice(1),n=Object.prototype.hasOwnProperty.call(o,"modifiers")?o.modifiers:o.groups;return o},Ct=function(t,e,r){for(var n=xt([],e),o=t,i=Rt(o,n[0]),a=Object.prototype.hasOwnProperty.call(i,"modifiers");n.length>1;)i=Rt(o,n[0]),n=n.slice(1),a=Object.prototype.hasOwnProperty.call(i,"modifiers"),o=xt([],a?i.modifiers:i.groups);var u=n[0];if(1===e.length&&(i={groups:t},a=!1),a){var c=i.modifiers.map((function(t){return t.id===u?kt({},r):kt({},t)}));i.modifiers=c}else{var l=i.groups.map((function(t){return t.id===u?kt({},r):kt({},t)}));i.groups=l}return 1===e.length?xt([],i.groups):xt([],t)},Rt=function(t,e){var r=t.find((function(t){return t.id===e}));if(!r)throw new Error("Path segment "+e+" doesn't exist in segments "+JSON.stringify(t.map((function(t){return t.id}))));return r},Bt=function(){return(Bt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ut=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Mt=function(t,e,r,n,o){var i=Bt(Bt({},r),{amount:n,touched:!0,errors:d(r,n,o),totals:ae(Bt(Bt({},r.data),{amount:n})),data:Bt(Bt({},r.data),{amount:n})});return i.status=g(i),Ct(t,e,i)},Dt=function(t,e,r,n){var o=r.slice(0,-1),i=Tt(e,o),a=Ut([],i.modifiers);"RADIO"!==i.type||n||(a=i.modifiers.map((function(t){return"RADIO"!==t.type||t.id===r[r.length-1]?Bt({},t):Bt(Bt({},t),{amount:0,error:"",totals:ae(Bt(Bt({},t.data),{amount:0})),data:Bt(Bt({},t.data),{amount:0})})})));var u=(a=a.map((function(e){var o=x(e.data),i=Ut(Ut([],r.slice(0,-1)),[e.id]),a=Bt(Bt({},e),{groups:qt(o,{rootId:t,path:i},e.groups)});return a.errors=d(a,a.amount,n),a.status=g(a),a}))).map((function(t){return Bt({},t.data)})),c=Bt(Bt({},i.data),{answers:u}),l=Bt(Bt({},i),{touched:!0,modifiers:a,data:c});l.errors=h(l,n),l.status=y(l);var s=Ct(e,o,l);return o.length>1&&(s=Yt(t,s,o,n)),s},Yt=function(t,e,r,n){var o=r.slice(0,-1),i=Tt(e,o),a=i.groups.map((function(t){return Bt({},t.data)})),u=Bt(Bt({},i.data),{questions:a}),c=i.groups.map((function(t){var e=Bt({},t);return e.errors=h(e,n),e.status=y(e),e})),l=Bt(Bt({},i),{touched:!0,groups:c,data:u});l.errors=d(l,l.amount,n),l.status=g(l);var s=Ct(e,o,l);return o.length>1&&(s=Dt(t,s,o,n)),s},Lt=function(){return(Lt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nt=function(){return(Nt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ht=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},qt=function(t,e,r){var n=e.rootId,o=e.path;return t.questions.map((function(e){var i=null==r?void 0:r.find((function(t){return t.id===e.questionId}));return Ft(e,{amount:t.amount,rootId:n,path:Ht([],o)},i)}))},Ft=function(t,e,r){var n=t.questionId,o=t.name,i=t.description,a=t.max,u=t.min,c=t.images,l=e.amount,s=e.rootId,f=e.path,d=null!=r?r:{},h=d.errors,g=d.touched,b={id:n,name:o,description:null!=i?i:"",images:Ht([],null!=c?c:[]),data:Nt({},t),errors:null!=h?h:[],touched:null!=g&&g,status:"IDLE",hidden:l<1,required:u>0,type:p(t)},v={rootId:s,max:a,min:u,type:b.type,modifiersCount:t.answers.length,amount:l,path:Ht(Ht([],f),[n])},O=t.answers.map((function(t){var e=null==r?void 0:r.modifiers.find((function(e){return e.id===t.productId}));return zt(t,v,e)})),m=Nt(Nt({},b),{modifiers:O});return Nt(Nt({},m),{status:y(m)})},zt=function(t,e,r){var n,o,i=t.productId,a=t.questionId,u=t.name,c=t.images,l=t.amount,s=t.renderType,f=t.min,p=t.max,d=x(t),h=e.rootId,y=e.path,b=Ht(Ht([],y),[i]),O=qt(d,{rootId:h,path:b},null==r?void 0:r.groups),m={id:i,groupId:a,name:u,images:Ht([],c),amount:l,data:Nt({},t),groups:O,errors:null!==(n=null==r?void 0:r.errors)&&void 0!==n?n:[],hidden:e.amount<1,min:f,max:p,required:f>0,touched:null!==(o=null==r?void 0:r.touched)&&void 0!==o&&o,status:"IDLE",totals:ae(Nt(Nt({},t),{amount:l})),type:s,handleChange:function(t){!function(t,e,r){var n,o=Lt({},Object(C.getState)().forms),i=o[t],a=Tt(i.renderer,e),u=Mt(i.renderer,e,a,r,!1);u=Dt(t,u,e,!1);var c=Gt(u,i.product),l=Lt(Lt({},i),{renderer:u,product:c,status:v(u)}),s=Lt(Lt({},o),((n={})[t]=l,n));Object(C.setState)({forms:s});var f=Lt({},l);delete f.callback,i.callback(f)}(e.rootId,b,t)}};return Nt(Nt({},m),{status:g(m)})},Vt=function(){return(Vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gt=function(t,e){var r=I(e);return Vt(Vt({},r),{questionsAndAnswers:$t(t),updatedAt:""})},$t=function(t){return t.map((function(t){return Vt(Vt({},t.data),{answers:Wt(t.modifiers)})}))},Wt=function(t){return t.map((function(t){return t.amount?Vt(Vt({},t.data),{questionsAndAnswers:$t(t.groups)}):Vt(Vt({},t.data),{questionsAndAnswers:[]})}))},Kt=function(){return(Kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Jt=function(t,e){var r,n=t.productId,o=Object(C.getState)().forms;if(o[n])return u("Form for product with id "+n+" has already been register. Please unsuscribe if you need to register a new form."),function(){};var i=function(t){var e,r=A(t,{amount:null!==(e=t.amount)&&void 0!==e?e:1}),n=qt(r,{rootId:r.productId,path:[]});return{product:Gt(n,t),renderer:n,validate:function(){return te(t.productId)},status:v(n)}}(t),a=Kt(Kt({},o),((r={})[n]=Kt(Kt({},i),{callback:e}),r));return Object(C.setState)({forms:a}),e(Kt({},i)),function(){return Qt(n)}},Qt=function(t){var e=Object(C.getState)().forms,r=Kt({},e);delete r[t],Object(C.setState)({forms:r})},Zt=function(){return(Zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xt=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},te=function(t){var e,r=Zt({},Object(C.getState)().forms),n=r[t],o=n.renderer,i=n.callback,a=n.product,u=Xt([],o);o.forEach((function(e){var r=[e.id];u=ee(e,u,t,r)}));var c=Gt(u,a),l=Zt(Zt({},n),{renderer:u,product:c,status:v(u)}),s=Zt(Zt({},r),((e={})[t]=l,e));Object(C.setState)({forms:s});var f=Zt({},l);return delete f.callback,i(f),l.status},ee=function(t,e,r,n){var o=t.modifiers,i=t.id,a=!o.length,u=Xt([],e);return a?(console.warn("Attempting to validate a Modifier group without modifiers, this will likely result in unexpected behaviour. \n Please update the bad group "+i+" of product 0."),u):(o.forEach((function(t){var e=Xt(Xt([],n),[t.id]);u=re(t,u,r,e)})),u)},re=function(t,e,r,n){var o=t.groups,i=t.amount,a=t.status,u=t.required,c=!o.length||0===i,l=Xt([],e);if(c){var s="IDLE"===a&&u||"FAIL"===a||"INCOMPLETE"===a?"FAIL":a,f=Zt(Zt({},t),{status:s}),p=Xt([],n);l=Mt(l,p,f,f.amount,!0),l=Dt(r,l,p,!0)}else o.forEach((function(t){var e=Xt(Xt([],n),[t.id]);l=ee(t,l,r,e)}));return l},ne=function(){return(ne=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},oe=!1,ie=function(t,e){if(void 0===e&&(e={}),oe)console.warn("artisan-commerce/products: initProducts has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initProducts is only called once");else{if(Object(C.setState)(ne({artisanApp:t},e)),void 0!==e.timeout){var r=(new Date).getTime()+e.timeout;Object(C.setState)({expiresAt:r})}"undefined"==typeof window||(oe=!0)}},ae=function(t,e){if(void 0===e&&(e=t.amount>0?t.amount:1),e<1)throw new Error("Cannot set the amount of getProductTotals with a value less than 1");var r=t,n=r.updatedAt?w(r):t;return{unitGrossPrice:le(n,1),unitTotalDiscounts:se(n,1),unitTotalTaxes:ue(n,1),unitNetPrice:fe(n,1),amount:e,grossPrice:le(n,e),totalDiscounts:se(n,e),totalTaxes:ue(n,e),netPrice:fe(n,e)}},ue=function(t,e){var r=I(t,{amount:e}),n=r.prices,o=r.amount,i=n[r.priceCategory],a=i.taxes,u=i.grossPrice,c=he(a,u);return ce(r,e)+c*o},ce=function(t,e){var r,n;return null!==(n=null===(r=t.questionsAndAnswers)||void 0===r?void 0:r.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices,o=r.amount,i=n[r.priceCategory],a=i.taxes,u=i.grossPrice;return t+o*(he(a,u)+ce(r,e))}),0)*e}),0))&&void 0!==n?n:0},le=function(t,e){return pe(t,"grossPrice",e)},se=function(t,e){return 0},fe=function(t,e){return pe(t,"netPrice",e)},pe=function(t,e,r){var n=I(t,{amount:r}),o=n.prices,i=n.amount,a=o[n.priceCategory][e];return(de(n,e)+a)*i},de=function(t,e){var r,n;return null!==(n=null===(r=t.questionsAndAnswers)||void 0===r?void 0:r.reduce((function(t,r){return t+r.answers.reduce((function(t,r){var n=r.prices;return t+r.amount*(n[r.priceCategory][e]+de(r,e))}),0)}),0))&&void 0!==n?n:0},he=function(t,e){return t.reduce((function(t,r){return t+r.percentage/100*e}),0)};Object(C.initState)(B)}])},function(t,e,r){t.exports=function(){"use strict";var t="millisecond",e="second",r="minute",n="hour",o="day",i="week",a="month",u="quarter",c="year",l="date",s=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,f=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},d=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},h={s:d,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r%60;return(e<=0?"+":"-")+d(n,2,"0")+":"+d(o,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),o=e.clone().add(n,a),i=r-o<0,u=e.clone().add(n+(i?-1:1),a);return+(-(n+(r-o)/(i?o-u:u-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(s){return{M:a,y:c,w:i,d:o,D:l,h:n,m:r,s:e,ms:t,Q:u}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",g={};g[y]=p;var b=function(t){return t instanceof w},v=function(t,e,r){var n;if(!t)return y;if("string"==typeof t)g[t]&&(n=t),e&&(g[t]=e,n=t);else{var o=t.name;g[o]=t,n=o}return!r&&n&&(y=n),n||!r&&y},O=function(t,e){if(b(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new w(r)},m=h;m.l=v,m.i=b,m.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var w=function(){function p(t){this.$L=v(t.locale,null,!0),this.parse(t)}var d=p.prototype;return d.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(m.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(s);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return m},d.isValid=function(){return!("Invalid Date"===this.$d.toString())},d.isSame=function(t,e){var r=O(t);return this.startOf(e)<=r&&r<=this.endOf(e)},d.isAfter=function(t,e){return O(t)<this.startOf(e)},d.isBefore=function(t,e){return this.endOf(e)<O(t)},d.$g=function(t,e,r){return m.u(t)?this[e]:this.set(r,t)},d.unix=function(){return Math.floor(this.valueOf()/1e3)},d.valueOf=function(){return this.$d.getTime()},d.startOf=function(t,u){var s=this,f=!!m.u(u)||u,p=m.p(t),d=function(t,e){var r=m.w(s.$u?Date.UTC(s.$y,e,t):new Date(s.$y,e,t),s);return f?r:r.endOf(o)},h=function(t,e){return m.w(s.toDate()[t].apply(s.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(e)),s)},y=this.$W,g=this.$M,b=this.$D,v="set"+(this.$u?"UTC":"");switch(p){case c:return f?d(1,0):d(31,11);case a:return f?d(1,g):d(0,g+1);case i:var O=this.$locale().weekStart||0,w=(y<O?y+7:y)-O;return d(f?b-w:b+(6-w),g);case o:case l:return h(v+"Hours",0);case n:return h(v+"Minutes",1);case r:return h(v+"Seconds",2);case e:return h(v+"Milliseconds",3);default:return this.clone()}},d.endOf=function(t){return this.startOf(t,!1)},d.$set=function(i,u){var s,f=m.p(i),p="set"+(this.$u?"UTC":""),d=(s={},s[o]=p+"Date",s[l]=p+"Date",s[a]=p+"Month",s[c]=p+"FullYear",s[n]=p+"Hours",s[r]=p+"Minutes",s[e]=p+"Seconds",s[t]=p+"Milliseconds",s)[f],h=f===o?this.$D+(u-this.$W):u;if(f===a||f===c){var y=this.clone().set(l,1);y.$d[d](h),y.init(),this.$d=y.set(l,Math.min(this.$D,y.daysInMonth())).$d}else d&&this.$d[d](h);return this.init(),this},d.set=function(t,e){return this.clone().$set(t,e)},d.get=function(t){return this[m.p(t)]()},d.add=function(t,u){var l,s=this;t=Number(t);var f=m.p(u),p=function(e){var r=O(s);return m.w(r.date(r.date()+Math.round(e*t)),s)};if(f===a)return this.set(a,this.$M+t);if(f===c)return this.set(c,this.$y+t);if(f===o)return p(1);if(f===i)return p(7);var d=(l={},l[r]=6e4,l[n]=36e5,l[e]=1e3,l)[f]||1,h=this.$d.getTime()+t*d;return m.w(h,this)},d.subtract=function(t,e){return this.add(-1*t,e)},d.format=function(t){var e=this;if(!this.isValid())return"Invalid Date";var r=t||"YYYY-MM-DDTHH:mm:ssZ",n=m.z(this),o=this.$locale(),i=this.$H,a=this.$m,u=this.$M,c=o.weekdays,l=o.months,s=function(t,n,o,i){return t&&(t[n]||t(e,r))||o[n].substr(0,i)},p=function(t){return m.s(i%12||12,t,"0")},d=o.meridiem||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n},h={YY:String(this.$y).slice(-2),YYYY:this.$y,M:u+1,MM:m.s(u+1,2,"0"),MMM:s(o.monthsShort,u,l,3),MMMM:s(l,u),D:this.$D,DD:m.s(this.$D,2,"0"),d:String(this.$W),dd:s(o.weekdaysMin,this.$W,c,2),ddd:s(o.weekdaysShort,this.$W,c,3),dddd:c[this.$W],H:String(i),HH:m.s(i,2,"0"),h:p(1),hh:p(2),a:d(i,a,!0),A:d(i,a,!1),m:String(a),mm:m.s(a,2,"0"),s:String(this.$s),ss:m.s(this.$s,2,"0"),SSS:m.s(this.$ms,3,"0"),Z:n};return r.replace(f,(function(t,e){return e||h[t]||n.replace(":","")}))},d.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},d.diff=function(t,l,s){var f,p=m.p(l),d=O(t),h=6e4*(d.utcOffset()-this.utcOffset()),y=this-d,g=m.m(this,d);return g=(f={},f[c]=g/12,f[a]=g,f[u]=g/3,f[i]=(y-h)/6048e5,f[o]=(y-h)/864e5,f[n]=y/36e5,f[r]=y/6e4,f[e]=y/1e3,f)[p]||y,s?g:m.a(g)},d.daysInMonth=function(){return this.endOf(a).$D},d.$locale=function(){return g[this.$L]},d.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=v(t,e,!0);return n&&(r.$L=n),r},d.clone=function(){return m.w(this.$d,this)},d.toDate=function(){return new Date(this.valueOf())},d.toJSON=function(){return this.isValid()?this.toISOString():null},d.toISOString=function(){return this.$d.toISOString()},d.toString=function(){return this.$d.toUTCString()},p}(),P=w.prototype;return O.prototype=P,[["$ms",t],["$s",e],["$m",r],["$H",n],["$W",o],["$M",a],["$y",c],["$D",l]].forEach((function(t){P[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,w,O),t.$i=!0),O},O.locale=v,O.isDayjs=b,O.unix=function(t){return O(1e3*t)},O.en=g[y],O.Ls=g,O.p={},O}()},function(t,e){var r={utf8:{stringToBytes:function(t){return r.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(r.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}};t.exports=r},function(t,e,r){(function(e){var n,o,i,a;n=r(11),o=r(2).utf8,i=r(2).bin,(a=function(t,r){var a=n.wordsToBytes(function(t){t.constructor==String?t=o.stringToBytes(t):void 0!==e&&"function"==typeof e.isBuffer&&e.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=n.bytesToWords(t),i=8*t.length,a=[],u=1732584193,c=-271733879,l=-1732584194,s=271733878,f=-1009589776;r[i>>5]|=128<<24-i%32,r[15+(i+64>>>9<<4)]=i;for(var p=0;p<r.length;p+=16){for(var d=u,h=c,y=l,g=s,b=f,v=0;v<80;v++){if(v<16)a[v]=r[p+v];else{var O=a[v-3]^a[v-8]^a[v-14]^a[v-16];a[v]=O<<1|O>>>31}var m=(u<<5|u>>>27)+f+(a[v]>>>0)+(v<20?1518500249+(c&l|~c&s):v<40?1859775393+(c^l^s):v<60?(c&l|c&s|l&s)-1894007588:(c^l^s)-899497514);f=s,s=l,l=c<<30|c>>>2,c=u,u=m}u+=d,c+=h,l+=y,s+=g,f+=b}return[u,c,l,s,f]}(t));return r&&r.asBytes?a:r&&r.asString?i.bytesToString(a):n.bytesToHex(a)})._blocksize=16,a._digestsize=20,t.exports=a}).call(this,r(6).Buffer)},function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),o(r(12),e),o(r(13),e),o(r(14),e),o(r(15),e),o(r(16),e),o(r(17),e),o(r(18),e),o(r(19),e),o(r(20),e),o(r(21),e),o(r(22),e),o(r(23),e),o(r(24),e),o(r(25),e),o(r(26),e),o(r(27),e),o(r(28),e),o(r(29),e),o(r(30),e),o(r(31),e)},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initAuth",(function(){return n})),r.d(e,"getServices",(function(){return o}));var n=function(t){if("undefined"!=typeof window)return t.__internals__.auth()},o=function(t){if("undefined"!=typeof window)return t.__instance__.auth}}])},function(t,e,r){"use strict";(function(t){
|
|
38
38
|
/*!
|
|
39
39
|
* The buffer module from node.js, for the browser.
|
|
40
40
|
*
|
|
@@ -43,4 +43,4 @@ e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=
|
|
|
43
43
|
*/
|
|
44
44
|
var n=r(8),o=r(9),i=r(10);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(this,t)}return l(this,t,e,r)}function l(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=p(t,e),t}(t,e,r,n):"string"==typeof e?function(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|h(e,r),o=(t=u(t,n)).write(e,r);return o!==n&&(t=t.slice(0,o)),t}(t,e,r):function(t,e){if(c.isBuffer(e)){var r=0|d(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):p(t,e);if("Buffer"===e.type&&i(e.data))return p(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e){if(s(e),t=u(t,e<0?0:0|d(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function p(t,e){var r=e.length<0?0:0|d(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function d(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function h(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return N(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,r);case"utf8":case"utf-8":return _(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,a=1,u=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,u/=2,c/=2,r/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var s=-1;for(i=r;i<u;i++)if(l(t,i)===l(e,-1===s?0:i-s)){if(-1===s&&(s=i),i-s+1===c)return s*a}else-1!==s&&(i-=i-s),s=-1}else for(r+c>u&&(r=u-c),i=r;i>=0;i--){for(var f=!0,p=0;p<c;p++)if(l(t,i+p)!==l(e,p)){f=!1;break}if(f)return i}return-1}function O(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var a=0;a<n;++a){var u=parseInt(e.substr(2*a,2),16);if(isNaN(u))return a;t[r+a]=u}return a}function m(t,e,r,n){return q(N(e,t.length-r),t,r,n)}function w(t,e,r,n){return q(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return w(t,e,r,n)}function j(t,e,r,n){return q(H(e),t,r,n)}function I(t,e,r,n){return q(function(t,e){for(var r,n,o,i=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(r=t.charCodeAt(a))>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function S(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function _(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,a,u,c,l=t[o],s=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(s=l);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&l)<<6|63&i)>127&&(s=c);break;case 3:i=t[o+1],a=t[o+2],128==(192&i)&&128==(192&a)&&(c=(15&l)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:i=t[o+1],a=t[o+2],u=t[o+3],128==(192&i)&&128==(192&a)&&128==(192&u)&&(c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&u)>65535&&c<1114112&&(s=c)}null===s?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}function A(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function E(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function k(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=L(t[i]);return o}function x(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function U(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(t,e,r,n,i){return i||U(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return i||U(t,0,r,8),o.write(t,e,r,n,52,8),r+8}e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return l(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return function(t,e,r,n){return s(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=c.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var a=t[r];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},c.byteLength=h,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?_(this,0,t):y.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0),u=Math.min(i,a),l=this.slice(n,o),s=t.slice(e,r),f=0;f<u;++f)if(l[f]!==s[f]){i=l[f],a=s[f];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return O(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return j(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},c.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=c.prototype;else{var o=e-t;r=new c(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},c.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||T(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e|=0,r|=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,a=1,u=0;for(this[e]=255&t;++i<r&&(a*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,a=1,u=0;for(this[e+i]=255&t;--i>=0&&(a*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/a>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var a=c.isBuffer(t)?t:N(new c(t,n).toString()),u=a.length;for(i=0;i<r-e;++i)this[i+e]=a[i%u]}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function N(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],a=0;a<n;++a){if((r=t.charCodeAt(a))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function H(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(Y,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}}).call(this,r(7))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=l(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=l(t),a=n[0],u=n[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),s=0,f=u>0?a-4:a;for(r=0;r<f;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[s++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],a=0,u=r-o;a<u;a+=16383)i.push(s(t,a,a+16383>u?u:a+16383));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,c=a.length;u<c;++u)n[u]=a[u],o[a.charCodeAt(u)]=u;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(t,e,r){for(var o,i,a=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),a.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){
|
|
45
45
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
46
|
-
e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-s)-1,d>>=-s,s+=u;s>0;i=256*i+t[e+f],f+=p,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=n;s>0;a=256*a+t[e+f],f+=p,s-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=l}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,c,l=8*i-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=s?(u=0,a=s):a+f>=1?(u=(e*c-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&u,d+=h,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+d]=255&a,d+=h,a/=256,l-=8);t[r+d-h]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DayOfWeekName=e.TaxType=e.PriceCategoryType=e.ProductType=void 0,function(t){t.PRODUCT="PRODUCT",t.MODIFIER="MODIFIER"}(e.ProductType||(e.ProductType={})),function(t){t.NORMAL="NORMAL",t.POINTS="POINTS"}(e.PriceCategoryType||(e.PriceCategoryType={})),function(t){t.IVA="IVA"}(e.TaxType||(e.TaxType={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY"}(e.DayOfWeekName||(e.DayOfWeekName={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ServiceStatus=e.Days=e.DeliveryTimeUnit=void 0,function(t){t.MIN="min"}(e.DeliveryTimeUnit||(e.DeliveryTimeUnit={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY",t.SPECIAL="SPECIAL"}(e.Days||(e.Days={})),function(t){t.INACTIVE="INACTIVE",t.ACTIVE="ACTIVE"}(e.ServiceStatus||(e.ServiceStatus={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Gender=e.MaritalStatus=void 0,function(t){t.MARRIED="MARRIED",t.DIVORCED="DIVORCED",t.SINGLE="SINGLE"}(e.MaritalStatus||(e.MaritalStatus={})),function(t){t.MALE="MALE",t.FEMALE="FEMALE"}(e.Gender||(e.Gender={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},,function(t,e,r){"use strict";r.r(e),r.d(e,"initShoppingCart",(function(){return p})),r.d(e,"closeShoppingCart",(function(){return d})),r.d(e,"listenShoppingCart",(function(){return A})),r.d(e,"getShoppingCart",(function(){return _})),r.d(e,"addProduct",(function(){return it})),r.d(e,"subtractProduct",(function(){return pt})),r.d(e,"removeProduct",(function(){return gt})),r.d(e,"setProduct",(function(){return jt})),r.d(e,"replaceProduct",(function(){return _t})),r.d(e,"createShoppingCart",(function(){return xt})),r.d(e,"emptyShoppingCart",(function(){return Bt})),r.d(e,"deleteShoppingCart",(function(){return Mt})),r.d(e,"getShoppingCartTotal",(function(){return J})),r.d(e,"getShoppingCartProducts",(function(){return Q})),r.d(e,"validateShoppingCart",(function(){return Kt})),r.d(e,"setShoppingCartAdditionalInfo",(function(){return Qt})),r.d(e,"getProductHash",(function(){return W})),r.d(e,"UNSAFE_listenBenefitsWallet",(function(){return de})),r.d(e,"listenBenefitsWallet",(function(){return ve})),r.d(e,"applyBenefits",(function(){return Pe})),r.d(e,"redeemCoupon",(function(){return Se})),r.d(e,"useBenefit",(function(){return Ee})),r.d(e,"unuseBenefit",(function(){return Te}));var n="YYYY-MM-DD hh:mm:ss.SSS",o="default",i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a={artisanApp:void 0,accountId:void 0,customerId:void 0,activeShoppingCart:o,maxShoppingCarts:2,wallets:{}};Object.freeze(a);var u=i({},a);Object.seal(u);var c=function(t){u=i(i({},u),t)},l=function(){return i({},u)},s=function(){return(s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},f=!1,p=function(t,e){void 0===e&&(e={}),f?console.warn("initShoppingCart has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initShoppingCart is only called once "):(c(s({artisanApp:t},e)),"undefined"==typeof window||(f=!0))},d=function(){var t;null===(t=l().artisanApp)||void 0===t||t.__internals__.firestore().terminate(),c(s({},a)),f=!1},h=function(t){if(void 0===t&&(t=""),!l().artisanApp)throw new Error("Artisan app must be provided, you probably forgot to initialize the shopping cart. Please make sure initShoppingCart has been called beforehand. "+t)},y=function(t,e){void 0===e&&(e="");var r=l().accountId;if(void 0===t&&void 0===r)throw new Error("AccountId must be defined. Either provide a global accountId or at the function call level. "+e)},g=function(t,e){void 0===e&&(e="");var r=l().customerId;if(void 0===t&&void 0===r)throw new Error("CustomerId must be defined. Either provide a global customerId or at the function call level. "+e)},b=function(t,e){void 0===e&&(e="");var r=l().store;if(void 0===t&&void 0===r)throw new Error("StoreId must be defined. Either provide a global storeId or at the function call level. "+e)},v=function(t){void 0===t&&(t={});var e=t.accountId,r=t.customerId;y(e),g(r)},O=function(t){var e=t.customerId;!function(t,e){if(void 0===e&&(e=""),void 0===t)throw new Error("VendorId must be defined. Either provide a global vendorId or at the function call level to retrieve a wallet. "+e)}(t.vendorId),g(e)},m=function(t){var e=null!=t?t:{},r=e.Platform,n=e.account;!function(t,e){void 0===e&&(e="");var r=l().artisanApp.settings.platform;if(void 0===t&&void 0===r)throw new Error("Platform must be defined. Either provide a global Plafform in the artisan object or at the function call level. "+e)}(r),y(n)},w=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},P=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},j=o,I=function(t){return void 0===t&&(t={}),w(void 0,void 0,void 0,(function(){var e,r,n,o,i,a,u,c,s;return P(this,(function(f){switch(f.label){case 0:return e=l(),r=e.artisanApp,n=e.accountId,o=l().customerId,i=t.accountId,a=t.customerId,h(),v(t),u=null==r?void 0:r.__internals__.firestore(),[4,null===(s=null===(c=null==u?void 0:u.collection("shoppingCartByUser"))||void 0===c?void 0:c.doc(String(null!=a?a:o)))||void 0===s?void 0:s.collection(String(null!=i?i:n))];case 1:return[2,f.sent()]}}))}))},S=function(t,e){return w(void 0,void 0,void 0,(function(){var r,n;return P(this,(function(o){switch(o.label){case 0:return r=null!=e?e:l().activeShoppingCart,[4,I(t)];case 1:return(n=o.sent())?[4,n.where("name","==",r).get().then((function(t){return t.docs[0]}))]:[2,void 0];case 2:return[2,o.sent()]}}))}))},_=function(t,e){return w(void 0,void 0,void 0,(function(){var r,n;return P(this,(function(o){switch(o.label){case 0:return r=null!=t?t:l().activeShoppingCart,[4,S(e,r)];case 1:return(n=o.sent())?(c({activeShoppingCart:r}),[4,n.data()]):[2];case 2:return[2,o.sent()]}}))}))},A=function(t,e,r){return void 0===r&&(r={}),w(void 0,void 0,void 0,(function(){var n,o;return P(this,(function(i){switch(i.label){case 0:return n=null!=e?e:l().activeShoppingCart,[4,I(r)];case 1:return(o=i.sent())?(c({activeShoppingCart:n}),o.where("name","==",n).onSnapshot((function(e){return w(void 0,void 0,void 0,(function(){var r;return P(this,(function(o){switch(o.label){case 0:return e.docs[0]?[4,e.docs[0].data()]:(n!==j&&console.warn("Failed to fetch a shopping cart with name "+n+" because there wasn't any."),[2,t(void 0)]);case 1:return r=o.sent(),[2,t(r)]}}))}))})),[2]):[2]}}))}))},E=r(1),k=r.n(E),x=r(0),T=function(){return(T=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},C=o,R=function(t){return void 0===t&&(t=C),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var e;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){switch(r.label){case 0:return[4,S({},t)];case 1:return[2,null==(e=r.sent())?void 0:e.id]}}))}))},B=function(t){if(void 0!==t)return"number"==typeof t?t:t.storeId},U=function(t,e){var r=B(t);return T("number"!=typeof t?T({},t):{},e[r])},M=function(t){var e=t.store,r=t.amount,n=B(e);b(n),function(t){if("number"!=typeof t)throw new Error("Invalid amount recieved, please make sure you include a valid amount.");if(t<0)throw new Error("Cannot receive a negative amount of an item. Please ensure you have added a proper amount of items.");if(0===t)throw new Error("Attempting to pass 0 amount. This might indicate a problem with your code. Please ensure you have added a proper amount of items.")}(r)},D=r(3),Y=r.n(D),L=r(4),N=function(t,e,r){var n=e[t],o=r[t];return n>o?1:o>n?-1:0},H=function(t,e){return N("productId",t,e)},q=function(t,e){return N("questionId",t,e)},F=function(t){console.error(t)},z=function(){return(z=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},V=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},G=x.transformers.toCartProduct,$=x.modifierUtils.divideProductQA,W=function(t){var e=$(t),r=e.productId,n=e.questionsAndAnswers,o=e.priceCategory,i=r+"-"+K(n).sort(q).reduce((function(t,e){var r=e.answers.sort(H).reduce((function(t,e,r){var n=e.productId,o=e.amount,i=W(e),a=i?"{"+i+"}":"";return 0===r?n+"="+o+a:t+"|"+n+"="+o+a}),""),n=e.questionId+":"+r;return""===t?""+n:t+"-"+n}),"")+"*"+o;return Y()(i)},K=function(t){return t.reduce((function(t,e){var r=e.answers.filter((function(t){return t.amount>0})).map((function(t){var e=K(t.questionsAndAnswers);return z(z({},t),{questionsAndAnswers:e})}));return V(V([],t),[z(z({},e),{answers:r})])}),[]).filter((function(t){return t.answers.length>0}))},J=function(t,e){void 0===e&&(e={});var r=Q(t).reduce((function(t,e){var r=G(e),n=r.priceCategory,o=Object(x.getProductTotals)(r),i=n===L.PriceCategoryType.POINTS,a=i?o.netPrice:0,u=i?0:o.netPrice,c=i?0:o.grossPrice;return{subtotal:t.subtotal+c,totalDiscounts:t.totalDiscounts+o.totalDiscounts,totalTaxes:t.totalTaxes+o.totalTaxes,totalPoints:t.totalPoints+a,total:t.total+u}}),{subtotal:0,totalDiscounts:0,totalTaxes:0,totalPoints:0,total:0}),n=Z(null==t?void 0:t.additional_info,null==t?void 0:t.benefits,r),o=e.shippingCost,i=void 0===o?t.shippingCost:o;if(!i)return n;var a=i.grossPrice,u=i.netPrice,c=i.taxTotal,l=i.discountTotal;return{subtotal:n.subtotal+a,totalDiscounts:n.totalDiscounts+l,totalTaxes:n.totalTaxes+c,shippingCost:u,totalPoints:n.totalPoints,total:n.total+u}},Q=function(t){return Object.values(t.stores).reduce((function(t,e){var r=Object.values(e.products);return V(V([],t),r)}),[])},Z=function(t,e,r){return e?Object.values(e).reduce((function(e,r){return"DISCOUNT"===r.type?X(r,e,t):e}),r):r},X=function(t,e,r){var n=e.subtotal,o=e.total,i=e.totalDiscounts,a=.01*t.discountPercentage;if(void 0!==(null==r?void 0:r.copayment)){var u=null==r?void 0:r.copayment,c=u*a,l=i+c,s=(u-c).toFixed(4);return z(z({},e),{totalDiscounts:l,total:Number(s)})}var f=n*a,p=i+f,d=o-f;return z(z({},e),{totalDiscounts:p,total:d})},tt=function(){return(tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},et=n,rt=x.transformers.toCartProduct,nt=x.modifierUtils.multiplyProductQA,ot=x.modifierUtils.divideProductQA,it=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return M(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=a.sent())?[4,n.data()]:(console.warn("Cannot add a product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=a.sent(),i=at(o,t,e),[4,n.ref.set(i)];case 3:return a.sent(),[2]}}))}))},at=function(t,e,r){var n=e.amount||1,o=rt(e,tt(tt({},r),{amount:null!=n?n:1})),i=rt(e,r),a=l().store,u=r.store,c=null!=u?u:a,s=B(c),f=W(o),p=tt({},t),d=tt({},t.stores),h=U(c,d),y=tt({},h.products),g=y[f],b=k()().format(et);g?(y[f]=ot(y[f]),y[f].amount+=i.amount):(y[f]=i,y[f].hash=f,y[f].createdAt=b),y[f].updatedAt=b;var v=y[f],O=(v=nt(v)).questionsAndAnswers,m=K(O);return y[f]=tt(tt({},v),{questionsAndAnswers:m}),h.products=y,d[s]=h,p.stores=d,p},ut=function(){return(ut=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ct=n,lt=x.transformers.toCartProduct,st=x.modifierUtils.multiplyProductQA,ft=x.modifierUtils.divideProductQA,pt=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return M(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=a.sent())?[4,n.data()]:(console.warn("Cannot subtract product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=a.sent(),i=dt(o,t,e),[4,n.ref.set(i)];case 3:return a.sent(),[2]}}))}))},dt=function(t,e,r){var n=e.amount||1,o=lt(e,ut(ut({},r),{amount:null!=n?n:1})),i=lt(e,r),a=l().store,u=r.store,c=null!=u?u:a,s=B(c),f=W(o),p=ut({},t),d=ut({},t.stores);if(void 0===d[s])return console.warn("StoreId given is invalid. There is no store with id "+s+" on the shopping cart."),t;var h=U(c,d),y=ut({},h.products),g=y[f],b=k()().format(ct);if(!g)return console.warn("Attempting to subtract the amount of product that is not in the given shopping cart store."),t;y[f]=ft(y[f]);var v=y[f].amount-i.amount;return v>0?(y[f].amount=v,y[f].updatedAt=b,y[f]=st(y[f])):delete y[f],h.products=y,Object.keys(h.products).length?d[s]=h:delete d[s],p.stores=d,p},ht=function(){return(ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},yt=x.transformers.toCartProduct,gt=function(t,e){return void 0===e&&(e={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return function(t){var e=t.store,r=B(e);b(r)}(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=a.sent())?[4,n.data()]:(console.warn("Cannot remove a product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=a.sent(),i=bt(o,t,e),[4,n.ref.set(i)];case 3:return a.sent(),[2]}}))}))},bt=function(t,e,r){var n=e.hash;if(!n){var o=yt(e);n=W(o)}var i=l().store,a=r.store,u=null!=a?a:i,c=B(u),s=ht({},t),f=ht({},t.stores);if(void 0===f[c])return console.warn("StoreId given is invalid. There is no store with id "+c+" on the shopping cart."),t;var p=U(u,f),d=ht({},p.products);return d[n]?(delete d[n],p.products=d,Object.keys(p.products).length?f[c]=p:delete f[c],s.stores=f,s):(console.warn("Attempting to remove product that is not in the given shopping cart store."),t)},vt=function(){return(vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ot=n,mt=x.transformers.toCartProduct,wt=x.modifierUtils.multiplyProductQA,Pt=x.modifierUtils.divideProductQA,jt=function(t,e){return void 0===e&&(e={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,l,s;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(f){switch(f.label){case 0:return r=null!==(s=null!==(c=e.amount)&&void 0!==c?c:null===(l=t)||void 0===l?void 0:l.amount)&&void 0!==s?s:1,n=vt(vt({},e),{amount:r}),M(n),o=e.shoppingCartName,[4,S(e,o)];case 1:return(i=f.sent())?[4,i.data()]:(console.warn("Cannot set product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return a=f.sent(),u=It(a,t,n),[4,i.ref.set(u)];case 3:return f.sent(),[2]}}))}))},It=function(t,e,r){var n,o,i=null!==(o=null===(n=e)||void 0===n?void 0:n.amount)&&void 0!==o?o:1,a=mt(e,vt(vt({},r),{amount:i})),u=l().store,c=r.store,s=null!=c?c:u,f=B(s),p=W(a),d=vt({},t),h=vt({},t.stores),y=U(s,h),g=vt({},y.products),b=g[p],v=k()().format(Ot);g[p]=a,b?g[p]=Pt(g[p]):(g[p].createdAt=v,g[p].hash=p),g[p].updatedAt=v;var O=mt(g[p],r),m=(O=wt(O)).questionsAndAnswers,w=K(m);return g[p]=vt(vt({},O),{questionsAndAnswers:w}),y.products=g,h[f]=y,d.stores=h,d},St=function(){return(St=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_t=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return function(t){var e=t.store,r=B(e);b(r)}(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=a.sent())?[4,n.data()]:(console.warn("Cannot replace product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=a.sent(),i=At(o,t,e),[4,n.ref.set(i)];case 3:return a.sent(),[2]}}))}))},At=function(t,e,r){var n=r.hash,o=null!=n?n:e.hash,i=l().store,a=r.store,u=null!=a?a:i,c=B(u),s=St({},t.stores),f=U(u,s),p=St({},f.products);if(!p[o])return console.warn("Cannot replace a product because no product was found in the given store"),t;delete p[o],f.products=p,Object.keys(f.products).length?s[c]=f:delete s[c];var d=St({},t);d.stores=s;var h=St(St({},e),{amount:0});return at(d,h,r)},Et=function(){return(Et=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},kt=o,xt=function(t,e){return void 0===t&&(t={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(s){switch(s.label){case 0:return[4,I(e)];case 1:return r=s.sent(),n=Tt(t),r?(o=n.name,[4,r.get()]):(console.warn("Couldn't find a shopping cart collection with the given config. Please make sure everything is correct in your configuration before continue."),[2]);case 2:if(i=null===(c=s.sent())||void 0===c?void 0:c.docs.length,a=l().maxShoppingCarts,i>=a)throw new Error("Cannot add more carts. Carts limit ("+a+") reached.");return[4,r.where("name","==",o).get()];case 3:if(s.sent().docs.length>0)throw new Error("Attempted to add a shopping cart with the name "+o+", but there is already one shopping cart with that name.");return[4,r.add(n)];case 4:return(u=s.sent())?[4,u.set(Et(Et({},n),{id:u.id}))]:(console.error("Failed to create a new shopping cart"),[2]);case 5:return s.sent(),[2]}}))}))},Tt=function(t){void 0===t&&(t={});var e=(new Date).toISOString();return Et({id:"",name:kt,latitude:-1,longitude:-1,createdAt:e,updatedAt:e,channelId:1,stores:{},billTotal:{}},t)},Ct=function(){return(Ct=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Rt=o,Bt=function(t,e){return void 0===t&&(t=Rt),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(i){switch(i.label){case 0:return[4,S(e,t)];case 1:return(r=i.sent())?[4,r.data()]:(console.warn("Cannot empty cart, shopping cart nodes not found. Please ensure you have a shopping cart with name "+t+" before continue."),[2]);case 2:return n=i.sent(),o=Ct(Ct({},n),{stores:{}}),[4,r.ref.set(o)];case 3:return i.sent(),[2]}}))}))},Ut=o,Mt=function(t,e){return void 0===t&&(t=Ut),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(n){switch(n.label){case 0:return[4,S(e,t)];case 1:return(r=n.sent())?[4,r.ref.delete()]:(console.warn("Coundn't find any shopping cart with name "+t+" with the given config."),[2]);case 2:return n.sent(),[2]}}))}))},Dt=r(5),Yt={"Content-Type":"application/json"},Lt=function(){return(Lt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},Ht=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},qt=function(t){return Nt(void 0,void 0,void 0,(function(){var e,r,n,o,i,a,u,c,s,f,p,d,h,y,g;return Ht(this,(function(b){switch(b.label){case 0:return e=l().artisanApp.settings,r=e.platform,n=e.accountId,o=null!==(p=null!==(f=null===(s=null==t?void 0:t.account)||void 0===s?void 0:s.toString())&&void 0!==f?f:null==n?void 0:n.toString())&&void 0!==p?p:"",i=null!==(h=null!==(d=null==t?void 0:t.Platform)&&void 0!==d?d:r)&&void 0!==h?h:"",a=i,null===(y=null==t?void 0:t.Authorization)||void 0===y?[3,1]:(c=y,[3,3]);case 1:return[4,Ft()];case 2:c=b.sent(),b.label=3;case 3:return u=null!==(g=c)&&void 0!==g?g:"",[2,new Headers(Lt(Lt(Lt({},Yt),t),{Authorization:u,Platform:a,account:o}))]}}))}))},Ft=function(t){return Nt(void 0,void 0,void 0,(function(){var e,r,n;return Ht(this,(function(o){switch(o.label){case 0:return e=l().artisanApp,[4,null===(n=Object(Dt.initAuth)(e).currentUser)||void 0===n?void 0:n.getIdToken(t)];case 1:return(r=o.sent())?[2,"Bearer "+r]:(F("Please make sure you are authenticated before trying to call a restricted action."),[2])}}))}))},zt=function(){return(zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},Gt=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},$t=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Wt=function(t,e){return Vt(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,s,f,p;return Gt(this,(function(d){switch(d.label){case 0:return r=l().artisanApp.apiURL,n=t.id,o=t.latitude,i=t.longitude,[4,qt(zt({},e))];case 1:a=d.sent(),d.label=2;case 2:return d.trys.push([2,4,,5]),[4,fetch(r+"/api/shopping-cart/"+n+"/validateShoppingCart?latitude="+o+"&longitude="+i,{headers:a}).then((function(t){return Vt(void 0,void 0,void 0,(function(){return Gt(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(u=d.sent(),!(c=u.data))throw new Error("No shopping cart was found.");return s=Object.values(c.stores).reduce((function(t,e){return e.alerts.length?$t($t([],t),e.alerts):t}),[]),f=Object.values(c.stores).some((function(t){return!!t.alerts.length||Object.values(t.products).some((function(t){return t.alerts.length}))})),[2,{stores:s,products:f}];case 4:return p=d.sent(),console.error(p.message),[2,{stores:[{errorLevel:1,message:"Occurrió un error desconocido, comuníquese con soporte",type:""}],products:!1}];case 5:return[2]}}))}))},Kt=function(t,e,r){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var n,o,i,a;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(u){switch(u.label){case 0:return function(t,e){!function(t,e){void 0===e&&(e="");var r=l().artisanApp.apiURL;if(void 0===t&&void 0===r)throw new Error("ApiURL must be defined. Either provide a global ApiURL or at the function call level. "+e)}(t.apiURL),m(e)}(t,e),n=null!=r?r:l().activeShoppingCart,[4,R(n)];case 1:return void 0===(o=u.sent())?(console.error("Cannot use undefined as a shopping cart id. Shopping cart "+n+" was not found. Validation canceled."),[2]):(i=t.latitude,a=t.longitude,[4,Wt({id:o,latitude:i,longitude:a},e)]);case 2:return[2,u.sent()]}}))}))},Jt=function(){return(Jt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Qt=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return[4,S({},e)];case 1:return(r=a.sent())?[4,r.data()]:(n=null!=e?e:l().activeShoppingCart,console.warn("Cannot set additional info because no shopping cart was found. Please ensure you create a shopping cart with name "+n+" before continue."),[2]);case 2:return o=a.sent(),i=Zt(o,t),[4,r.ref.set(i)];case 3:return a.sent(),[2]}}))}))},Zt=function(t,e){return Jt(Jt({},t),{additional_info:e(t.additional_info)})},Xt=function(){return(Xt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},te=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},ee=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},re=function(t){return void 0===t&&(t={}),Xt({benefits:[],usedBenefits:[],unusedBenefits:[]},t)},ne=function(t,e){var r,n=l().wallets,o=Xt(Xt({},n),((r={})[t]=Xt({},e),r));c({wallets:o})},oe=function(t){return void 0===t&&(t={}),te(void 0,void 0,void 0,(function(){var e,r,n,o,i,a,u,c,s;return ee(this,(function(f){switch(f.label){case 0:return e=l(),r=e.artisanApp,n=e.customerId,o=e.accountId,i=t.accountId,a=t.customerId,h(),v(t),u=null==r?void 0:r.__internals__.firestore(),[4,null===(s=null===(c=null==u?void 0:u.collection("benefitsByUser"))||void 0===c?void 0:c.doc(String(null!=a?a:n)))||void 0===s?void 0:s.collection(String(null!=i?i:o))];case 1:return[2,f.sent()]}}))}))},ie=function(t){return te(void 0,void 0,void 0,(function(){var e;return ee(this,(function(r){switch(r.label){case 0:return[4,oe(t)];case 1:return(e=r.sent())?[4,e.get().then((function(t){return t.docs[0]}))]:[2,void 0];case 2:return[2,r.sent()]}}))}))},ae=function(t){return te(void 0,void 0,void 0,(function(){var e,r;return ee(this,(function(n){switch(n.label){case 0:return[4,ie(t)];case 1:return(e=n.sent())?0===Object.keys(e.data()).length?[2,[]]:(r=e.id,[2,Object.values(e.data()).map((function(t){return Xt(Xt({},t),{hash:r})}))]):[2]}}))}))},ue=function(){return(ue=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ce=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},le=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},se=function(t,e){return ce(void 0,void 0,void 0,(function(){var r,n,o,i,a;return le(this,(function(u){switch(u.label){case 0:return r=l().artisanApp.apiURL,n=t.vendorId,o=t.customerId,[4,qt(ue(ue({},e),{uid:o.toString()}))];case 1:i=u.sent(),u.label=2;case 2:return u.trys.push([2,4,,5]),[4,fetch(r+"/api/shopping-cart/retrieveBenefits?vendorId="+n,{headers:i}).then((function(t){return ce(void 0,void 0,void 0,(function(){return le(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(!u.sent())throw new Error("The benefits wallet is not defined. Make sure coupons arewell configured");return[3,5];case 4:throw a=u.sent(),Error(a.message);case 5:return[2]}}))}))},fe=function(t,e,r){return ce(void 0,void 0,void 0,(function(){var n,o,i,a,u,c;return le(this,(function(s){switch(s.label){case 0:return n=l().artisanApp.apiURL,o=t.customerId,[4,qt(ue(ue({},r),{uid:o.toString()}))];case 1:i=s.sent(),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,fetch(n+"/api/wallet_profit/apply",{method:"post",body:JSON.stringify({code:e}),headers:i}).then((function(t){return ce(void 0,void 0,void 0,(function(){return le(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(a=s.sent(),200===(u=a).code)return[2,!0];if(null===u.data||!u.data)throw new Error(u.message);return F("Unhandled response when redeeming coupon "+JSON.stringify(u,void 0,2)),[2,!1];case 4:throw c=s.sent(),new Error("Failed to redeem coupon "+e+". "+c.message);case 5:return[2]}}))}))},pe=function(){return(pe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},de=function(t,e,r,n){O(e);var o=l().customerId,i=l(),a=i.activeShoppingCart,u=i.wallets,s=null!=r?r:a,f=u[s],p=e.customerId,d=null!=p?p:o;return f?(F("There is already a listener for wallet of name "+s+". Either unsubscribe to the other listener or create a new listener for a different cart"),function(){return he(s)}):(function(t,e,r,n){new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,o,i,a,l;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(f){switch(f.label){case 0:r=pe(pe({},e),{customerId:d}),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,se(r,n)];case 2:return f.sent(),[3,4];case 3:return f.sent(),[2,function(){return he(s)}];case 4:return[4,ae()];case 5:return(o=f.sent())?(i={benefits:o,unusedBenefits:o,usedBenefits:[]},a=pe(pe({},u),((l={})[s]=pe(pe({},i),{callback:t}),l)),c({wallets:a}),t(i),[2]):[2,function(){return he(s)}]}}))})),function(){return he(s)})},he=function(t){var e=l().wallets,r=pe({},e);delete r[t],c({wallets:r})},ye=function(){return(ye=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ge=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},be=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},ve=function(t,e,r,n){O(e),m(n);var o=l().customerId,i=l(),a=i.activeShoppingCart,u=i.wallets,c=null!=r?r:a,s=u[c],f=e.customerId,p=null!=f?f:o;if(s)return F("There is already a listener for wallet of name "+c+". Either unsubscribe to the other listener or create a new listener for a different cart"),function(){return Oe(c)};var d=re();ne(c,ye(ye({},d),{callback:t}));var h=void 0;return ge(void 0,void 0,void 0,(function(){var r,o;return be(this,(function(i){switch(i.label){case 0:r=ye(ye({},e),{customerId:p}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,se(r,n)];case 2:return i.sent(),[3,4];case 3:return i.sent(),console.error("Failed to retrieve the user's wallet"),[2];case 4:return[4,oe(e)];case 5:return(o=i.sent())?(h=o.onSnapshot((function(e){return ge(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,l;return be(this,(function(s){return r=null!==(l=null===(u=e.docs[0])||void 0===u?void 0:u.data())&&void 0!==l?l:{},0===Object.keys(r).length?(n=re(),ne(c,ye(ye({},n),{callback:t})),t(n),[2]):(o=e.docs[0].id,i=function(t,e){return Object.values(t).map((function(t){return Xt(Xt({},t),{hash:e})}))}(r,o),a=re({benefits:i,unusedBenefits:i}),ne(c,ye(ye({},a),{callback:t})),t(a),[2])}))}))})),[2]):(console.error("Failed to retrieve the benefits wallet node"),[2])}}))})),function(){return Oe(c,h)}},Oe=function(t,e){var r=l().wallets,n=ye({},r);delete n[t],c({wallets:n}),e&&e()},me=function(){return(me=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},we=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Pe=function(t,e,r){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var n,o,i,a,u,s,f,p,d,h,y,g,b,O,w;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(P){switch(P.label){case 0:if(n=l().customerId,v(t),m(r),o=l(),i=o.activeShoppingCart,a=o.wallets,!(s=a[u=null!=e?e:i]))return F("No benefits wallet available for "+u+", you probably forgot to call listenBenefitsWallet beforehand."),[2];f=s.usedBenefits,p=t.customerId,d=null!=p?p:n,h=me(me({},t),{customerId:d}),y=f.map((function(t){var e=t.hash,n=t.benefitId;return function(t,e){return ce(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,s;return le(this,(function(f){switch(f.label){case 0:return r=t.benefitId,n=t.benefitHash,o=t.shoppingCartId,i=t.customerId,a=l().artisanApp.apiURL,[4,qt(ue(ue({},e),{uid:i.toString()}))];case 1:return u=f.sent(),c={benefitId:r,shoppingCartId:o},[4,fetch(a+"/api/shopping-cart/benefitsByUser/"+n+"/applyBenefit",{method:"post",body:JSON.stringify(c),headers:u}).then((function(t){return ce(void 0,void 0,void 0,(function(){return le(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 2:if((s=f.sent()).benefits){if(Object.keys(null==s?void 0:s.benefits).length>0)return[2,s];if(0===Object.keys(null==s?void 0:s.benefits).length)throw Error("No benefits were applied to the current shopping cart")}if(200!==(null==s?void 0:s.code))throw Error(s.message);return[2]}}))}))}(me(me({},h),{benefitId:n,benefitHash:e}),r)})),P.label=1;case 1:return P.trys.push([1,3,,4]),[4,Promise.all(y)];case 2:return P.sent(),[3,4];case 3:throw g=P.sent(),Error(g.message);case 4:return b={benefits:we([],s.unusedBenefits),unusedBenefits:we([],s.unusedBenefits),usedBenefits:[],callback:s.callback},O=me(me({},a),((w={})[u]=b,w)),c({wallets:O}),s.callback(b),[2]}}))}))},je=function(){return(je=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ie=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Se=function(t,e,r,n){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var o,i,a,u,s,f,p,d,h,y,g,b,O,w;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(P){switch(P.label){case 0:return o=l().customerId,v(t),m(n),i=l(),a=i.activeShoppingCart,u=i.wallets,(f=u[s=null!=r?r:a])||F("No benefits wallet available for "+s+", you probably forgot to call listenBenefitsWallet beforehand."),p=t.customerId,d=null!=p?p:o,h=je(je({},t),{customerId:d}),[4,fe(h,e,n)];case 1:if(!P.sent())return[2];P.label=2;case 2:return P.trys.push([2,4,,5]),[4,se(h,n)];case 3:return P.sent(),[3,5];case 4:return P.sent(),console.error("Failed to retrieve the user's wallet after redeeming coupon"),[2];case 5:return[4,ae()];case 6:if(!(y=P.sent()))throw new Error("Failed to fetch benefits from ArtisanDB for the current customer after redeeming coupon");return g=re({benefits:y,unusedBenefits:y,usedBenefits:[]}),b={benefits:Ie([],g.benefits),unusedBenefits:Ie(Ie([],f.unusedBenefits),g.unusedBenefits),usedBenefits:Ie(Ie([],f.usedBenefits),g.usedBenefits),callback:f.callback},O=je(je({},u),((w={})[s]=b,w)),c({wallets:O}),f.callback(g),[2]}}))}))},_e=function(){return(_e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ae=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Ee=function(t,e){var r,n=l(),o=n.activeShoppingCart,i=n.wallets,a=null!=e?e:o,u=i[a],s=t.benefitId;if(u){var f=u.benefits.find((function(t){return t.benefitId===s}));if(f){var p=u.unusedBenefits.filter((function(t){return t.benefitId!==s})),d=_e(_e({},u),{unusedBenefits:p,usedBenefits:Ae(Ae([],u.usedBenefits),[f])}),h=_e(_e({},d),{callback:u.callback}),y=_e(_e({},i),((r={})[a]=h,r));c({wallets:y}),u.callback(d)}else F("There is no benefit to apply with the id "+s+" on the current cart. This might indicate something bad configured.")}else F("No benefits wallet available for "+a+", you probably forgot to call listenBenefitsWallet beforehand.")},ke=function(){return(ke=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xe=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Te=function(t,e){var r,n=l(),o=n.activeShoppingCart,i=n.wallets,a=null!=e?e:o,u=i[a],s=t.benefitId;if(u){var f=u.benefits.find((function(t){return t.benefitId===s}));if(f){var p=u.usedBenefits.filter((function(t){return t.benefitId!==s})),d=ke(ke({},u),{unusedBenefits:xe(xe([],u.unusedBenefits),[f]),usedBenefits:p}),h=ke(ke({},d),{callback:u.callback}),y=ke(ke({},i),((r={})[a]=h,r));c({wallets:y}),u.callback(d)}else F("There is no benefit to unuse with the id "+s+" on the current cart. This might indicate something bad configured.")}else F("No benefits wallet available for "+a+", you probably forgot to call listenBenefitsWallet beforehand.")}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return a}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=null,i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},a=function(t){var e=o?n({},o):{};o=null,o=n(n({},e),t),Object.seal(o)},u=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t){t.exports=JSON.parse('{"name":"@artisan-commerce/analytics-web","description":"Artisan commerce analytics web library","version":"0.1.0-canary.10","main":"./build/main.bundle.js","types":"./build/src/index.d.ts","files":["build/","LICENSE","README.md"],"scripts":{"start":"webpack --config webpack.dev.js","dev":"yarn start","build":"webpack --config webpack.prod.js","start:build":"nodemon ./build/main.bundle.js","test":"jest --watchAll --runInBand","test:all":"yarn test --watchAll=false --coverage","test:ci":"cross-env CI=true jest --runInBand","test:staged":"yarn test:ci --findRelatedTests ./src","check-types":"tsc --noEmit","lint":"eslint --ignore-path .gitignore --ignore-pattern !cypress/.eslintrc.js --ext .js,jsx,.ts,.tsx .","lint:staged":"yarn lint --max-warnings=0","prettier":"prettier --ignore-path .gitignore \\"**/*.+(js|jsx|ts|tsx|json|css|scss|html)\\"","format":"yarn prettier --write","check-format":"yarn prettier --list-different","validate":"cross-env CI=true npm-run-all --parallel test:ci check-types check-format lint build","validate:ci":"npm-run-all --parallel check-types check-format lint"},"author":"Luis Eduardo Andrade","license":"MIT","dependencies":{"@artisan-commerce/state":"0.2.2-canary.3","snake-case":"^3.0.4"},"devDependencies":{"@artisan-commerce/products":"0.8.2-canary.11","@artisan-commerce/shopping-cart":"0.11.0-canary.11","@artisan-commerce/types":"0.13.0-canary.7","@babel/core":"^7.10.5","@babel/preset-env":"^7.10.4","@babel/preset-react":"^7.10.4","@types/faker":"^4.1.12","@types/jest":"^26.0.5","@types/jest-in-case":"^1.0.2","@types/node":"^14.0.24","@typescript-eslint/eslint-plugin":"^4.15.2","@typescript-eslint/parser":"^4.15.2","avn":"^0.2.4","avn-nvm":"^0.2.2","clean-webpack-plugin":"^3.0.0","dotenv-webpack":"^2.0.0","env-cmd":"^10.1.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-config-react-app":"^5.2.1","eslint-config-universe":"^4.0.0","eslint-plugin-cypress":"^2.11.1","eslint-plugin-flowtype":"^5.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.3","eslint-plugin-react-hooks":"^4.0.8","is-ci-cli":"^2.1.2","jest-axe":"^3.5.0","jest-extended":"^0.11.5","jest-in-case":"^1.0.2","jest-styled-components":"^7.0.2","nodemon":"^2.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","start-server-and-test":"^1.11.2","test-data-bot":"^0.8.0","ts-jest":"^26.1.4","ts-loader":"^8.0.2","webpack":"^4.43.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.0","webpack-merge":"^5.0.9"},"peerDependencies":{"@artisan-commerce/products":"*","@artisan-commerce/shopping-cart":"*"}}')},,function(t,e,r){"use strict";r.r(e),r.d(e,"initAnalytics",(function(){return _})),r.d(e,"Providers",(function(){return w})),r.d(e,"events",(function(){return tf})),r.d(e,"updateActiveVendor",(function(){return l}));var n=r(2),o=r(3),i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a={providers:[],activeVendor:void 0,vendors:void 0,shareArtisanAnalytics:!1,debug:!1,meta:{accountId:void 0,vendorId:void 0,vendorName:void 0,storeId:void 0,storeName:void 0,catalogueId:void 0,catalogueName:void 0,appName:void 0,platform:"web",versionApp:void 0,versionSDK:o.version}},u=function(){return Object(n.getState)()},c=function(t){return Object(n.setState)(t)},l=function(t){var e=u();if("number"==typeof t)c(i(i({},e),{activeVendor:t,meta:i(i({},e.meta),{vendorName:void 0,vendorId:t})}));else{var r=t.id,n=t.name;c(i(i({},e),{activeVendor:r,meta:i(i({},e.meta),{vendorName:n,vendorId:r})}))}},s={GLOBAL_TRACKING_ID:"G-JZ7R91ZNMB"},f=function(){return(f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},p=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},d=function(t,e){var r=u().debug,n="artisan-commerce/analytics";if("debug"!==e||r)switch(e){case"debug":console.log("%c(Debug) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"log":console.log("%c(Log) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"warn":console.warn("%c(Warning) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"error":console.error("%c(Error) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"severe":throw new Error(n+": \n"+t);default:throw new Error("Log message "+t+" of type "+e+" is not a supported type.")}},h=function(){function t(){this.initialized=!1,this._type="GOOGLE_ANALYTICS",this._name="__GLOBAL_PROVIDER__",this._trackingId=s.GLOBAL_TRACKING_ID,this._sampleRate=100,this._currency="USD"}return Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trackingId",{get:function(){return this._trackingId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sampleRate",{get:function(){return this._sampleRate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),Object.defineProperty(t,"instance",{get:function(){return t._instance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vendors",{get:function(){var t,e=u().vendors;return null!==(t=this._vendors)&&void 0!==t?t:e},enumerable:!1,configurable:!0}),t.prototype.setVendors=function(t){this._vendors=t},t.prototype.init=function(){if("undefined"!=typeof window){if(this.initialized)return d("Provider "+this._name+" was already initialized. Do not call init unless you know what you are doing.","severe");this.initialized=!0;var t=document.createElement("script");t.setAttribute("async","true"),t.setAttribute("src","https://www.googletagmanager.com/gtag/js?id="+this._trackingId);var e=document.createElement("script");e.innerText="window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '"+this._trackingId+"', {'send_page_view': "+!1+"});gtag('event', 'page_view')",document.body.appendChild(t),document.body.appendChild(e)}},t.prototype.updateConfig=function(t){void 0===t&&(t={});var e=Object.entries(t).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),r=t.userId,n=t.currency,o=t.language;e.includes("userId")&&(this._userId=r),e.includes("currency")&&(this._currency=n),e.includes("language")&&(this._language=o),gtag("set",this._trackingId,t)},t._instance=new t,t}(),y=function(){function t(t){this.initialized=!1;var e=t.type,r=t.name,n=t.trackingId,o=t.vendors;this.type=e,this.name=r,this.trackingId=n,this._vendors=o}return Object.defineProperty(t.prototype,"vendors",{get:function(){var t,e=u().vendors;return null!==(t=this._vendors)&&void 0!==t?t:e},enumerable:!1,configurable:!0}),t.prototype.init=function(){if("undefined"!=typeof window)return this.initialized?d("Provider "+this.name+" was already initialized. Do not call init unless you know what you are doing.","severe"):void(this.initialized=!0)},t.prototype.updateConfig=function(t){!function(t,e){if(t.trackingId!==s.GLOBAL_TRACKING_ID){var r=Object.entries(e).reduce((function(t,e,r){var n=e[0],o=e[1];return 0===r?n+": "+o:t+"\n"+n+": "+o}),"");d(t.name+" config updated for the following fields.\n "+r,"debug")}}(this,t),h.instance.updateConfig(t)},t}(),g=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),b=function(){return(b=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},v=function(t){function e(e){var r=this,n=e.version,o=e.currency;return(r=t.call(this,b(b({},e),{type:"FACEBOOK_PIXEL"}))||this)._version=null!=n?n:"10.0",r._currency=null!=o?o:"USD",r}return g(e,t),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),e.prototype.init=function(){t.prototype.init.call(this);var e=document.createElement("script");e.innerText="!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='"+this.version+"';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js');fbq('init', '"+this.trackingId+"');fbq('trackSingle', '"+this.trackingId+"', 'PageView');";var r=document.createElement("noscript");r.innerHTML='\n <img height="1" width="1" style="display:none" \n src="https://www.facebook.com/tr?id={'+this.trackingId+'}&noscript=1"/>\n ',document.body.appendChild(e),document.body.appendChild(r)},e.prototype.updateConfig=function(e){void 0===e&&(e={});var r=Object.entries(e).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),n=e.currency;r.includes("currency")&&(this._currency=n),t.prototype.updateConfig.call(this,e)},e}(y),O=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),m=function(){return(m=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},w={FacebookPixel:v,GoogleAnalytics:function(t){function e(e){var r=t.call(this,m(m({},e),{type:"GOOGLE_ANALYTICS"}))||this,n=e.userId,o=e.currency,i=e.language,a=e.sampleRate;return r._sampleRate=a,r._userId=n,r._language=i,r._currency=null!=o?o:"USD",r}return O(e,t),Object.defineProperty(e.prototype,"sampleRate",{get:function(){return this._sampleRate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._userId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"language",{get:function(){return this._language},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),e.prototype.init=function(){t.prototype.init.call(this);var e=document.createElement("script");e.setAttribute("async","true"),e.setAttribute("src","https://www.googletagmanager.com/gtag/js?id="+this.trackingId);var r=document.createElement("script");r.innerText="window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '"+this.trackingId+"', {'send_page_view': "+!1+"});gtag('event', 'page_view')",document.body.appendChild(e),document.body.appendChild(r)},e.prototype.updateConfig=function(e){void 0===e&&(e={});var r=Object.entries(e).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),n=e.userId,o=e.currency,i=e.language;r.includes("userId")&&(this._userId=n),r.includes("currency")&&(this._currency=o),r.includes("language")&&(this._language=i),gtag("set",this.trackingId,e),t.prototype.updateConfig.call(this,e)},e}(y)},P=function(){return(P=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},j=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},I=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},S=!1,_=function(t){if(S)d("initAnalytics has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initAnalytics is only called once.","warn");else if(!("undefined"==typeof window)){S=!0,Object(n.initState)(a);var e=t.providers,r=t.shareArtisanAnalytics;if(!e.length)return d("At least one provider should be included but none were found","severe");if(!function(t){var e=t.map((function(t){return t.name}));return new Set(e).size===e.length}(e))return d("Providers names must be unique, check that no provider names are repeated","severe");if(!function(t){var e=t.map((function(t){return t.trackingId}));return new Set(e).size===e.length}(e))return d("Providers trackerId must be unique, check that no provider trackerId are repeated","severe");var i=t.meta,u=j(t,["meta"]),l=r?I([h.instance],e):e,s=P(P({},u),{providers:l,meta:P(P({},i),{vendorId:u.activeVendor,platform:"web",versionSDK:o.version})});c(s),e.forEach((function(t){var e=t.vendors,r=t.name;e||d("The provider "+r+" has no set vendors, as a result no events will be skipped for this provider","debug")}));var f,p={};l.forEach((function(t){p=P(P({},p),t),t.init()})),f=(null==(f=l.reduce((function(t,e){return e.vendors?I(I([],t),e.vendors):t}),[]))?void 0:f.length)?f:void 0,h.instance.updateConfig(p),h.instance.setVendors(f)}};var A=function(){return(A=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.create;Object.create;function E(t){return t.toLowerCase()}var k=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],x=/[^A-Z0-9]+/gi;function T(t,e,r){return e instanceof RegExp?t.replace(e,r):e.reduce((function(t,e){return t.replace(e,r)}),t)}function C(t,e){return void 0===e&&(e={}),function(t,e){void 0===e&&(e={});for(var r=e.splitRegexp,n=void 0===r?k:r,o=e.stripRegexp,i=void 0===o?x:o,a=e.transform,u=void 0===a?E:a,c=e.delimiter,l=void 0===c?" ":c,s=T(T(t,n,"$1\0$2"),i,"\0"),f=0,p=s.length;"\0"===s.charAt(f);)f++;for(;"\0"===s.charAt(p-1);)p--;return s.slice(f,p).split("\0").map(u).join(l)}(t,A({delimiter:"."},e))}var R=function(){return(R=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},B=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],i=e[1],a=(void 0===n&&(n={}),C(o,A({delimiter:"_"},n)));return R(R({},t),((r={})[a]=i,r))}),{})},U=function(){return(U=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},M=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},D=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=M(e,["callback","userId"]),c=null!=i?i:n,l=U(U({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","change_password_attempt",U(U({send_to:r,event_callback:o},s),p))},Y=function(){return(Y=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},L=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},N=function(t,e){var r=t.trackingId,n=L(e,[]);delete n.userId;var o=Y({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ChangePasswordAttempt",Y(Y({},i),c))},H=r(1),q=r(0),F=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},z=function(t,e){var r=e.vendors,n=u().activeVendor;return-1!==n&&(void 0!==r&&((!n||!r.includes(n))&&(void 0===n?d("No active vendor is set. Please make sure you configure an active vendor before trying to emit an event","warn"):function(t,e){var r=u().activeVendor;e.trackingId!==s.GLOBAL_TRACKING_ID&&d("Skipping vendor "+r+" for event "+t+" of provider "+e.name+" as configured","debug")}(t,e),!0)))},V=function(t){if(!t.length)return d("No providers found, the initAnalytics probably hasn't been run yet","severe"),!1;var e=function(t){var e=new Set(t.map((function(t){return t.type})));return Array.from(e).reduce((function(t,e){switch(e){case"GOOGLE_ANALYTICS":if("undefined"==typeof gtag)return F(F([],t),[e]);break;case"FACEBOOK_PIXEL":if("undefined"==typeof fbq)return F(F([],t),[e]);break;default:throw new Error("Profiver of type "+e+" is not supported")}return t}),[])}(t);return!e.length||(e.forEach((function(t){!function(t){d(t+" SDK not initialized. Please make sure the SDK is initialized before trying to emit an event","severe")}(t)})),!1)},G=function(){return(G=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},W=function(t,e,r){var n=r.facebookPixelHandler,o=r.googleAnalyticsHandler,i=u().providers;if(V(i)){var a=G(G({},e),{artisanEvent:t}),c=i.reduce((function(e,r){if(z(t,r))return e;switch(r.type){case"FACEBOOK_PIXEL":n(r,a);break;case"GOOGLE_ANALYTICS":o(r,a);break;default:throw new Error("Provider of type "+r.type+" is not supported")}return $($([],e),[r])}),[]);!function(t,e){var r=e.reduce((function(t,e){var r,n;if(e.trackingId===s.GLOBAL_TRACKING_ID)return t;var o=e.name,i=e.type,a=null!==(n=t[i])&&void 0!==n?n:[];return f(f({},t),((r={})[i]=p(p([],a),[o]),r))}),{}),n=Object.entries(r).reduce((function(t,e){var r=e[0],n=e[1];return""+t+(r.charAt(0).toUpperCase()+r.slice(1))+": "+n.join(", ")+"\n"}),"");d("Event "+t+" was successfully sent to the following providers "+n,"debug")}(t,c)}},K=function(t){return Object(H.getShoppingCartProducts)(t).map((function(t){return t.productId}))},J=function(t){return Object(H.getShoppingCartProducts)(t).map((function(t){return Q(t)}))},Q=function(t){var e=Object(q.getProductTotals)(t);return t.name+":"+e.netPrice},Z=function(t,e){return Object(H.getShoppingCartProducts)(t).map((function(t){return X(t,e)}))},X=function(t,e){var r=Object(q.getProductTotals)(t);return{item_id:t.productId,item_name:t.name,quantity:t.amount,price:r.netPrice,currency:e}},tt=function(t){W("changePasswordAttempt",t,{googleAnalyticsHandler:D,facebookPixelHandler:N})},et=function(){return(et=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},rt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},nt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=rt(e,["callback","userId"]),c=null!=i?i:n,l=et(et({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","sign_up_attempt",et(et({send_to:r,event_callback:o},s),p))},ot=function(){return(ot=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},it=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},at=function(t,e){var r=t.trackingId,n=it(e,[]);delete n.userId;var o=ot({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SignUpAttempt",ot(ot({},i),c))},ut=function(t){W("signUpAttempt",t,{googleAnalyticsHandler:nt,facebookPixelHandler:at})},ct=function(){return(ct=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},lt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},st=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=lt(e,["callback","userId"]),c=null!=i?i:n,l=ct(ct({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","change_password_fail",ct(ct({send_to:r,event_callback:o},s),p))},ft=function(){return(ft=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},pt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},dt=function(t,e){var r=t.trackingId,n=pt(e,[]);delete n.userId;var o=ft({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ChangePasswordFail",ft(ft({},i),c))},ht=function(t){W("changePasswordFail",t,{googleAnalyticsHandler:st,facebookPixelHandler:dt})},yt=function(){return(yt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=gt(e,["callback","userId"]),c=null!=i?i:n,l=yt(yt({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","change_password_success",yt(yt({send_to:r,event_callback:o},s),p))},vt=function(){return(vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ot=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},mt=function(t,e){var r=t.trackingId,n=Ot(e,[]);delete n.userId;var o=vt({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ChangePasswordSuccess",vt(vt({},i),c))},wt=function(t){W("changePasswordSuccess",t,{googleAnalyticsHandler:bt,facebookPixelHandler:mt})},Pt=function(){return(Pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},It=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=jt(e,["callback","userId"]),c=null!=i?i:n,l=Pt(Pt({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","login",Pt(Pt({send_to:r,event_callback:o},s),p))},St=function(){return(St=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_t=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},At=function(t,e){var r=t.trackingId,n=_t(e,[]);delete n.userId;var o=St({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SignIn",St(St({},i),c))},Et=function(t){W("signIn",t,{googleAnalyticsHandler:It,facebookPixelHandler:At})},kt=function(){return(kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Tt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=xt(e,["callback","userId"]),c=null!=i?i:n,l=kt(kt({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","sign_out",kt(kt({send_to:r,event_callback:o},s),p))},Ct=function(){return(Ct=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Rt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Bt=function(t,e){var r=t.trackingId,n=Rt(e,[]);delete n.userId;var o=Ct({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SignOut",Ct(Ct({},i),c))},Ut=function(t){W("signOut",t,{googleAnalyticsHandler:Tt,facebookPixelHandler:Bt})},Mt=function(){return(Mt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Dt(e,["callback","userId"]),c=null!=i?i:n,l=Mt(Mt({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","sign_up",Mt(Mt({send_to:r,event_callback:o},s),p))},Lt=function(){return(Lt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ht=function(t,e){var r=t.trackingId,n=Nt(e,[]);delete n.userId;var o=Lt({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingle",r,"CompleteRegistration",Lt(Lt({},i),c))},qt=function(t){W("signUp",t,{googleAnalyticsHandler:Yt,facebookPixelHandler:Ht})},Ft={logChangePasswordAttempt:tt,logSignUpAttempt:ut,logChangePasswordFail:ht,logChangePasswordSuccess:wt,logSignIn:Et,logSignOut:Ut,logSignUp:qt},zt=Ft,Vt=function(){return(Vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$t=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Gt(e,["callback","userId"]),c=null!=i?i:n,l=Vt(Vt({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","banner_impression",Vt(Vt({send_to:r,event_callback:o},s),p))},Wt=function(){return(Wt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jt=function(t,e){var r=t.trackingId,n=Kt(e,[]);delete n.userId;var o=Wt({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"BannerImpression",Wt(Wt({},i),c))},Qt=function(t){W("bannerImpression",t,{googleAnalyticsHandler:$t,facebookPixelHandler:Jt})},Zt=function(){return(Zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},te=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Xt(e,["callback","userId"]),c=null!=i?i:n,l=Zt(Zt({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","select_content",Zt(Zt({send_to:r,event_callback:o,content_type:"banner"},s),p))},ee=function(){return(ee=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},re=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ne=function(t,e){var r=t.trackingId,n=re(e,[]);delete n.userId;var o=ee({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SelectBanner",ee(ee({},i),c))},oe=function(t){W("selectBanner",t,{googleAnalyticsHandler:te,facebookPixelHandler:ne})},ie={logBannerImpression:Qt,logSelectBanner:oe},ae=ie,ue=function(){return(ue=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ce=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},le=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=ce(e,["callback","userId"]),c=null!=i?i:n,l=ue(ue({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","add_billing_info",ue(ue({send_to:r,event_callback:o},s),p))},se=function(){return(se=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},pe=function(t,e){var r=t.trackingId,n=fe(e,[]);delete n.userId;var o=se({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"AddBillingInfo",se(se({},i),c))},de=function(t){W("addBillingInfo",t,{googleAnalyticsHandler:le,facebookPixelHandler:pe})},he=function(){return(he=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ye=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ge=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=ye(e,["callback","userId"]),c=null!=i?i:n,l=he(he({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","select_billing_info",he(he({send_to:r,event_callback:o},s),p))},be=function(){return(be=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ve=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Oe=function(t,e){var r=t.trackingId,n=ve(e,[]);delete n.userId;var o=be({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SelectBillingInfo",be(be({},i),c))},me=function(t){W("selectBillingInfo",t,{googleAnalyticsHandler:ge,facebookPixelHandler:Oe})},we=function(){return(we=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Pe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},je=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Pe(e,["callback","userId"]),c=null!=i?i:n,l=we(we({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","update_billing_info",we(we({send_to:r,event_callback:o},s),p))},Ie=function(){return(Ie=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Se=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_e=function(t,e){var r=t.trackingId,n=Se(e,[]);delete n.userId;var o=Ie({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"UpdateBillingInfo",Ie(Ie({},i),c))},Ae=function(t){W("updateBillingInfo",t,{googleAnalyticsHandler:je,facebookPixelHandler:_e})},Ee={logAddBillingInfo:de,logSelectBillingInfo:me,logUpdateBillingInfo:Ae},ke=Ee,xe=function(){return(xe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Te=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ce=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Te(e,["callback","userId"]),c=null!=i?i:n,l=xe(xe({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","book_appointment",xe(xe({send_to:r,event_callback:o},s),p))},Re=function(){return(Re=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Be=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ue=function(t,e){var r=t.trackingId,n=Be(e,[]);delete n.userId;var o=Re({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingle",r,"Schedule",Re(Re({},i),c))},Me=function(t){W("bookAppointment",t,{googleAnalyticsHandler:Ce,facebookPixelHandler:Ue})},De={logBookAppointment:Me},Ye=De,Le=function(){return(Le=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ne=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},He=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.category,c=e.list,l=e.itemBrand,s=Ne(e,["callback","userId","category","list","itemBrand"]),f=e.position,p=[{item_brand:l,item_id:""+a.categoryId,item_list_name:c,item_name:a.name,index:f}],d=null!=i?i:n,h=Le(Le({},s),{userId:d}),y=B(h),g=u().meta,b=B(g);gtag("event","view_item_list",Le(Le({send_to:r,event_callback:o,item_list_name:c,items:p},y),b))},qe=function(){return(qe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ze=function(t,e){var r=t.trackingId,n=e.category,o=Fe(e,["category"]);delete o.userId;var i=n.categoryId,a=n.name,c=qe(qe({},o),{categoryId:i,categoryName:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"CategoryImpression",qe(qe({},l),f))},Ve=function(t){W("categoryImpression",t,{googleAnalyticsHandler:He,facebookPixelHandler:ze})},Ge=function(){return(Ge=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$e=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},We=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.query,c=$e(e,["callback","userId","query"]),l=null!=i?i:n,s=Ge(Ge({},c),{userId:l}),f=B(s),p=u().meta,d=B(p);gtag("event","search",Ge(Ge({send_to:r,event_callback:o,search_term:a},f),d))},Ke=function(){return(Ke=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Je=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Qe=function(t,e){var r=t.trackingId,n=e.query,o=Je(e,["query"]);delete o.userId;var i=Ke({},o),a=B(i),c=u().meta,l=B(c);fbq("trackSingle",r,"Search",Ke(Ke({search_string:n},a),l))},Ze=function(t){W("searchCategoryAttempt",t,{googleAnalyticsHandler:We,facebookPixelHandler:Qe})},Xe=function(){return(Xe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},tr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},er=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.category,c=tr(e,["callback","userId","category"]);c.contentType&&delete c.contentType;var l=a.categoryId,s=a.name,f=null!=i?i:n,p=Xe(Xe({},c),{userId:f,categoryId:l,categoryName:s}),d=B(p),h=u().meta,y=B(h);gtag("event","select_content",Xe(Xe({send_to:r,event_callback:o,content_type:"category"},d),y))},rr=function(){return(rr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},nr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},or=function(t,e){var r=t.trackingId,n=e.category,o=nr(e,["category"]);delete o.userId;var i=n.categoryId,a=n.name,c=rr(rr({},o),{categoryId:i,categoryName:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"SelectCategory",rr(rr({},l),f))},ir=function(t){W("selectCategory",t,{googleAnalyticsHandler:er,facebookPixelHandler:or})},ar=function(){return(ar=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ur=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cr=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.category,c=ur(e,["callback","userId","category"]),l=a.categoryId,s=a.name,f=null!=i?i:n,p=ar(ar({},c),{userId:f,categoryId:l,categoryName:s}),d=B(p),h=u().meta,y=B(h);gtag("event","view_cateogry",ar(ar({send_to:r,event_callback:o},d),y))},lr=function(){return(lr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fr=function(t,e){var r=t.trackingId,n=e.category,o=sr(e,["category"]);delete o.userId;var i=n.categoryId,a=n.name,c=lr(lr({},o),{categoryId:i,categoryName:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"ViewCategory",lr(lr({},l),f))},pr=function(t){W("viewCategory",t,{googleAnalyticsHandler:cr,facebookPixelHandler:fr})},dr={logCategoryImpression:Ve,logSearchCategoryAttempt:Ze,logSelectCategory:ir,logViewCategory:pr},hr=dr,yr=function(){return(yr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},br=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=gr(e,["callback","userId"]),l=null!=a?a:n,s=yr(yr({},c),{userId:l,currency:o}),f=B(s),p=u().meta,d=B(p);gtag("event","checkout_action",yr(yr({send_to:r,event_callback:i},f),d))},vr=function(){return(vr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Or=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},mr=function(t,e){var r=t.trackingId,n=Or(e,[]);delete n.userId;var o=vr({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"CheckoutAction",vr(vr({},i),c))},wr=function(t){W("checkoutAction",t,{googleAnalyticsHandler:br,facebookPixelHandler:mr})},Pr=function(){return(Pr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ir=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.shoppingCart,l=e.currency,s=jr(e,["callback","userId","shoppingCart","currency"]),f=null!=a?a:n,p=null!=l?l:o,d=Pr(Pr({},s),{userId:f,currency:p}),h=B(d),y=u().meta,g=B(y);gtag("event","begin_checkout",Pr(Pr({send_to:r,event_callback:i,items:Z(c,p),value:Object(H.getShoppingCartTotal)(c).total},h),g))},Sr=function(){return(Sr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_r=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ar=function(t,e){var r=t.trackingId,n=t.currency,o=e.shoppingCart,i=e.currency,a=_r(e,["shoppingCart","currency"]);delete a.userId;var c=null!=i?i:n,l=Sr(Sr({},a),{currency:c}),s=B(l),f=u().meta,p=B(f),d=K(o);fbq("trackSingle",r,"InitiateCheckout",Sr(Sr({content_ids:d,contents:J(o),num_items:d.length,value:Object(H.getShoppingCartTotal)(o).total},s),p))},Er=function(t){W("initiateCheckout",t,{googleAnalyticsHandler:Ir,facebookPixelHandler:Ar})},kr={logCheckoutAction:wr,logInitiateCheckout:Er},xr=kr,Tr=function(){return(Tr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Cr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Rr=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=Cr(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=Tr(Tr({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","apply_benefit",Tr(Tr({send_to:r,event_callback:i},d),y))},Br=function(){return(Br=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ur=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Mr=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=Ur(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=Br(Br({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"ApplyBenefit",Br(Br({},l),f))},Dr=function(t){W("applyBenefit",t,{googleAnalyticsHandler:Rr,facebookPixelHandler:Mr})},Yr=function(){return(Yr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Lr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Nr=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=Lr(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=Yr(Yr({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","coupon_code_error",Yr(Yr({send_to:r,event_callback:i},d),y))},Hr=function(){return(Hr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Fr=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=qr(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=Hr(Hr({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"CouponCodeError",Hr(Hr({},l),f))},zr=function(t){W("couponCodeError",t,{googleAnalyticsHandler:Nr,facebookPixelHandler:Fr})},Vr=function(){return(Vr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$r=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Gr(e,["callback","userId"]),c=null!=i?i:n,l=Vr(Vr({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","redeem_coupon_code",Vr(Vr({send_to:r,event_callback:o},s),p))},Wr=function(){return(Wr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jr=function(t,e){var r=t.trackingId,n=Kr(e,[]);delete n.userId;var o=Wr({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"RedeemCouponCode",Wr(Wr({},i),c))},Qr=function(t){W("redeemCouponCode",t,{googleAnalyticsHandler:$r,facebookPixelHandler:Jr})},Zr=function(){return(Zr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},tn=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=Xr(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=Zr(Zr({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","remove_benefit",Zr(Zr({send_to:r,event_callback:i},d),y))},en=function(){return(en=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},rn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},nn=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=rn(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=en(en({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"RemoveBenefit",en(en({},l),f))},on=function(t){W("removeBenefit",t,{googleAnalyticsHandler:tn,facebookPixelHandler:nn})},an=function(){return(an=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},un=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cn=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=un(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=an(an({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","view_benefit_details",an(an({send_to:r,event_callback:i},d),y))},ln=function(){return(ln=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fn=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=sn(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=ln(ln({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"ViewBenefitDetails",ln(ln({},l),f))},pn=function(t){W("viewBenefitDetails",t,{googleAnalyticsHandler:cn,facebookPixelHandler:fn})},dn=function(){return(dn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},hn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yn=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=hn(e,["callback","userId"]),c=null!=i?i:n,l=dn(dn({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_benefits_wallet",dn(dn({send_to:r,event_callback:o},s),p))},gn=function(){return(gn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},bn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},vn=function(t,e){var r=t.trackingId,n=bn(e,[]);delete n.userId;var o=gn({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewBenefitsWallet",gn(gn({},i),c))},On=function(t){W("viewBenefitsWallet",t,{googleAnalyticsHandler:yn,facebookPixelHandler:vn})},mn=function(){return(mn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Pn=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=wn(e,["callback","userId"]),c=null!=i?i:n,l=mn(mn({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_qr_store_coupon",mn(mn({send_to:r,event_callback:o},s),p))},jn=function(){return(jn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},In=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Sn=function(t,e){var r=t.trackingId,n=In(e,[]);delete n.userId;var o=jn({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewQRStoreCoupon",jn(jn({},i),c))},_n=function(t){void 0===t&&(t={}),W("viewQRStoreCoupon",t,{googleAnalyticsHandler:Pn,facebookPixelHandler:Sn})},An={logApplyBenefit:Dr,logCouponCodeError:zr,logRedeemCouponCode:Qr,logRemoveBenefit:on,logViewBenefitDetails:pn,logViewBenefitsWallet:On,logViewQRStoreCoupon:_n},En=An,kn=function(){return(kn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Tn=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=e.amount,s=xn(e,["callback","userId","currency","amount"]),f=null!=a?a:n,p=null!=c?c:o,d=kn(kn({},s),{userId:f,currency:p,amount:l,value:l}),h=B(d),y=u().meta,g=B(y);gtag("event","add_credits",kn(kn({send_to:r,event_callback:i},h),g))},Cn=function(){return(Cn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Rn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Bn=function(t,e){var r=t.trackingId,n=t.currency,o=e.amount,i=e.currency,a=Rn(e,["amount","currency"]);delete a.userId;var c=null!=i?i:n,l=Cn(Cn({},a),{currency:c,amount:o,value:o}),s=B(l),f=u().meta,p=B(f);fbq("trackSingleCustom",r,"AddCredits",Cn(Cn({},s),p))},Un=function(t){W("addCredits",t,{googleAnalyticsHandler:Tn,facebookPixelHandler:Bn})},Mn=function(){return(Mn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yn=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=e.amount,s=Dn(e,["callback","userId","currency","amount"]),f=null!=a?a:n,p=null!=c?c:o,d=Mn(Mn({},s),{userId:f,currency:p,amount:l,value:l}),h=B(d),y=u().meta,g=B(y);gtag("event","spend_credits",Mn(Mn({send_to:r,event_callback:i},h),g))},Ln=function(){return(Ln=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Hn=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.amount,a=Nn(e,["currency","amount"]);delete a.userId;var c=null!=o?o:n,l=Ln(Ln({},a),{currency:c,amount:i,value:i}),s=B(l),f=u().meta,p=B(f);fbq("trackSingleCustom",r,"SpendCredits",Ln(Ln({},s),p))},qn=function(t){W("spendCredits",t,{googleAnalyticsHandler:Yn,facebookPixelHandler:Hn})},Fn=function(){return(Fn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},zn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Vn=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=zn(e,["callback","userId"]),c=null!=i?i:n,l=Fn(Fn({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_credits",Fn(Fn({send_to:r,event_callback:o},s),p))},Gn=function(){return(Gn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Wn=function(t,e){var r=t.trackingId,n=$n(e,[]);delete n.userId;var o=Gn({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewCredits",Gn(Gn({},i),c))},Kn=function(t){W("viewCredits",t,{googleAnalyticsHandler:Vn,facebookPixelHandler:Wn})},Jn={logAddCredits:Un,logSpendCredits:qn,logViewCredits:Kn},Qn=Jn,Zn=function(){return(Zn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},to=function(t,e,r){var n=e.trackingId,o=e.userId,i=r.callback,a=r.userId,c=Xn(r,["callback","userId"]),l=null!=a?a:o,s=Zn(Zn({},c),{userId:l}),f=B(s),p=u().meta,d=B(p);gtag("event",t,Zn(Zn(Zn({send_to:n,event_callback:i},f),{artisan_event:"custom_event"}),d))},eo=function(){return(eo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ro=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},no=function(t,e,r){var n=e.trackingId,o=ro(r,[]);delete o.userId;var i=eo({},o),a=B(i),c=u().meta,l=B(c);fbq("trackSingleCustom",n,t,eo(eo(eo({},a),{artisan_event:"CustomEvent"}),l))},oo=function(t,e){void 0===e&&(e={}),W(t,e,{googleAnalyticsHandler:function(e,r){return to(t,e,r)},facebookPixelHandler:function(e,r){return no(t,e,r)}})},io=function(){return(io=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ao=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},uo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=ao(e,["callback","userId"]),c=null!=i?i:n,l=io(io({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_fulfillment_step",io(io({send_to:r,event_callback:o},s),p))},co=function(){return(co=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},lo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},so=function(t,e){var r=t.trackingId,n=lo(e,[]);delete n.userId;var o=co({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewFulfillmentStep",co(co({},i),c))},fo=function(t){W("viewFulfillmentStep",t,{googleAnalyticsHandler:uo,facebookPixelHandler:so})},po=function(){return(po=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ho=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=ho(e,["callback","userId"]),c=null!=i?i:n,l=po(po({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_tracking",po(po({send_to:r,event_callback:o},s),p))},go=function(){return(go=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},bo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},vo=function(t,e){var r=t.trackingId,n=bo(e,[]);delete n.userId;var o=go({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewTracking",go(go({},i),c))},Oo=function(t){W("viewTracking",t,{googleAnalyticsHandler:yo,facebookPixelHandler:vo})},mo={logViewFulfillmentStep:fo,logViewTracking:Oo},wo=mo,Po=function(){return(Po=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Io=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=jo(e,["callback","userId"]),c=null!=i?i:n,l=Po(Po({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","change_location",Po(Po({send_to:r,event_callback:o},s),p))},So=function(){return(So=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ao=function(t,e){var r=t.trackingId,n=_o(e,[]);delete n.userId;var o=So({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ChangeLocation",So(So({},i),c))},Eo=function(t){W("changeLocation",t,{googleAnalyticsHandler:Io,facebookPixelHandler:Ao})},ko=function(){return(ko=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},To=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=xo(e,["callback","userId"]),c=null!=i?i:n,l=ko(ko({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","find_location",ko(ko({send_to:r,event_callback:o},s),p))},Co=function(){return(Co=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ro=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Bo=function(t,e){var r=t.trackingId,n=Ro(e,[]);delete n.userId;var o=Co({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingle",r,"FindLocation",Co(Co({},i),c))},Uo=function(t){W("findLocation",t,{googleAnalyticsHandler:To,facebookPixelHandler:Bo})},Mo=function(){return(Mo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Do=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Do(e,["callback","userId"]),c=null!=i?i:n,l=Mo(Mo({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","out_of_coverage",Mo(Mo({send_to:r,event_callback:o},s),p))},Lo=function(){return(Lo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},No=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ho=function(t,e){var r=t.trackingId,n=No(e,[]);delete n.userId;var o=Lo({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"OutOfCoverage",Lo(Lo({},i),c))},qo=function(t){W("outOfCoverage",t,{googleAnalyticsHandler:Yo,facebookPixelHandler:Ho})},Fo=function(){return(Fo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},zo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Vo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=zo(e,["callback","userId"]),c=null!=i?i:n,l=Fo(Fo({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","set_location",Fo(Fo({send_to:r,event_callback:o},s),p))},Go=function(){return(Go=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Wo=function(t,e){var r=t.trackingId,n=$o(e,[]);delete n.userId;var o=Go({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SetLocation",Go(Go({},i),c))},Ko=function(t){W("setLocation",t,{googleAnalyticsHandler:Vo,facebookPixelHandler:Wo})},Jo={logChangeLocation:Eo,logFindLocation:Uo,logOutOfCoverage:qo,logSetLocation:Ko},Qo=Jo,Zo=function(){return(Zo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ti=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Xo(e,["callback","userId"]),c=null!=i?i:n,l=Zo(Zo({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","request_assistance",Zo(Zo({send_to:r,event_callback:o},s),p))},ei=function(){return(ei=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ri=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ni=function(t,e){var r=t.trackingId,n=ri(e,[]);delete n.userId;var o=ei({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingle",r,"Contact",ei(ei({},i),c))},oi=function(t){W("requestAssistance",t,{googleAnalyticsHandler:ti,facebookPixelHandler:ni})},ii={logRequestAssistance:oi},ai=ii,ui=function(){return(ui=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ci=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},li=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.currencyName,c=e.amount,l=ci(e,["callback","userId","currencyName","amount"]),s=null!=i?i:n,f=ui(ui({},l),{userId:s}),p=B(f),d=u().meta,h=B(d);gtag("event","earn_virtual_currency",ui(ui({send_to:r,event_callback:o,virtual_currency_name:a,value:c},p),h))},si=function(){return(si=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},pi=function(t,e){var r=t.trackingId,n=fi(e,[]);delete n.userId;var o=si({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"EarnPoints",si(si({},i),c))},di=function(t){W("earnPoints",t,{googleAnalyticsHandler:li,facebookPixelHandler:pi})},hi=function(){return(hi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},yi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},gi=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=yi(e,["callback","userId"]),c=null!=i?i:n,l=hi(hi({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","share_points",hi(hi({send_to:r,event_callback:o},s),p))},bi=function(){return(bi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},vi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Oi=function(t,e){var r=t.trackingId,n=vi(e,[]);delete n.userId;var o=bi({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SharePoints",bi(bi({},i),c))},mi=function(t){W("sharePoints",t,{googleAnalyticsHandler:gi,facebookPixelHandler:Oi})},wi=function(){return(wi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Pi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ji=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.currencyName,c=e.amount,l=Pi(e,["callback","userId","currencyName","amount"]),s=null!=i?i:n,f=wi(wi({},l),{userId:s}),p=B(f),d=u().meta,h=B(d);gtag("event","spend_virtual_currency",wi(wi({send_to:r,event_callback:o,virtual_currency_name:a,value:c},p),h))},Ii=function(){return(Ii=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Si=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_i=function(t,e){var r=t.trackingId,n=Si(e,[]);delete n.userId;var o=Ii({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SpendPoints",Ii(Ii({},i),c))},Ai=function(t){W("spendPoints",t,{googleAnalyticsHandler:ji,facebookPixelHandler:_i})},Ei=function(){return(Ei=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ki=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},xi=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=ki(e,["callback","userId"]),c=null!=i?i:n,l=Ei(Ei({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_loyalty_level",Ei(Ei({send_to:r,event_callback:o},s),p))},Ti=function(){return(Ti=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ci=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ri=function(t,e){var r=t.trackingId,n=Ci(e,[]);delete n.userId;var o=Ti({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewLoyaltyLevel",Ti(Ti({},i),c))},Bi=function(t){W("viewLoyaltyLevel",t,{googleAnalyticsHandler:xi,facebookPixelHandler:Ri})},Ui={logEarnPoints:di,logSharePoints:mi,logSpendPoints:Ai,logViewLoyaltyLevel:Bi},Mi=Ui,Di=function(){return(Di=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Yi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Li=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Yi(e,["callback","userId"]),c=null!=i?i:n,l=Di(Di({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","cancel_order",Di(Di({send_to:r,event_callback:o},s),p))},Ni=function(){return(Ni=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Hi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},qi=function(t,e){var r=t.trackingId,n=Hi(e,[]);delete n.userId;var o=Ni({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"CancelOrder",Ni(Ni({},i),c))},Fi=function(t){W("cancelOrder",t,{googleAnalyticsHandler:Li,facebookPixelHandler:qi})},zi=function(){return(zi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Gi=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Vi(e,["callback","userId"]),c=null!=i?i:n,l=zi(zi({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","rate_order",zi(zi({send_to:r,event_callback:o},s),p))},$i=function(){return($i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ki=function(t,e){var r=t.trackingId,n=e.maxScore,o=e.score,i=Wi(e,["maxScore","score"]);delete i.userId;var a=$i($i({},i),{maxScore:n,score:o}),c=B(a),l=u().meta,s=B(l);fbq("trackSingleCustom",r,"RateOrder",$i($i({max_rating_value:n,value:o},c),s))},Ji=function(t){W("rateOrder",t,{googleAnalyticsHandler:Gi,facebookPixelHandler:Ki})},Qi=function(){return(Qi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xi=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=e.orderId,s=e.orderTotal,f=Zi(e,["callback","userId","currency","orderId","orderTotal"]),p=null!=a?a:n,d=null!=c?c:o,h=Qi(Qi({},f),{userId:p,currency:d}),y=B(h),g=u().meta,b=B(g);gtag("event","refund",Qi(Qi({send_to:r,event_callback:i,transaction_id:l,value:s},y),b))},ta=function(){return(ta=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ea=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ra=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.orderTotal,a=ea(e,["currency","orderTotal"]);delete a.userId;var c=null!=o?o:n,l=ta(ta({},a),{currency:c}),s=B(l),f=u().meta,p=B(f);fbq("trackSingleCustom",r,"RequestRefund",ta(ta({value:i},s),p))},na=function(t){W("requestRefund",t,{googleAnalyticsHandler:Xi,facebookPixelHandler:ra})},oa={logCancelOrder:Fi,logRateOrder:Ji,logRequestRefund:na},ia=oa,aa=function(){return(aa=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ua=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ca=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=ua(e,["callback","userId"]),c=null!=i?i:n,l=aa(aa({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","generate_lead",aa(aa({send_to:r,event_callback:o},s),p))},la=function(){return(la=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fa=function(t,e){var r=t.trackingId,n=sa(e,[]);delete n.userId;var o=la({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingle",r,"Lead",la(la({},i),c))},pa=function(t){void 0===t&&(t={}),W("generateLead",t,{googleAnalyticsHandler:ca,facebookPixelHandler:fa})},da=function(){return(da=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ha=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ya=function(t,e){void 0===e&&(e={});var r=t.trackingId,n=ha(e,[]);delete n.userId;var o=da({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingle",r,"PageView",da(da({},i),c))},ga=function(){return(ga=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ba=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},va=function(t,e){void 0===e&&(e={});var r=t.trackingId,n=t.userId,o=e.pathname,i=e.name,a=e.callback,c=e.userId,l=ba(e,["pathname","name","callback","userId"]),s=null!=c?c:n,f=ga(ga({},l),{userId:s}),p=B(f),d=u().meta,h=B(d);gtag("event","page_view",ga(ga({page_title:i,page_path:o,send_to:r,event_callback:a},p),h))},Oa=function(t){W("pageView",t,{googleAnalyticsHandler:va,facebookPixelHandler:ya})},ma=function(){return(ma=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Pa=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.query,c=wa(e,["callback","userId","query"]),l=null!=i?i:n,s=ma(ma({},c),{userId:l}),f=B(s),p=u().meta,d=B(p);gtag("event","search",ma(ma({send_to:r,event_callback:o,search_term:a},f),d))},ja=function(){return(ja=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ia=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Sa=function(t,e){var r=t.trackingId,n=e.query,o=Ia(e,["query"]);delete o.userId;var i=ja({},o),a=B(i),c=u().meta,l=B(c);fbq("trackSingle",r,"Search",ja(ja({search_string:n},a),l))},_a=function(t){W("searchPageContent",t,{googleAnalyticsHandler:Pa,facebookPixelHandler:Sa})},Aa={logGenerateLead:pa,logPageView:Oa,logSearchPageContent:_a},Ea=Aa,ka=function(){return(ka=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ta=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=xa(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=ka(ka({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","change_payment_type",ka(ka({send_to:r,event_callback:i},d),y))},Ca=function(){return(Ca=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ra=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ba=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=Ra(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=Ca(Ca({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"ChangePaymentType",Ca(Ca({},l),f))},Ua=function(t){W("changePaymentType",t,{googleAnalyticsHandler:Ta,facebookPixelHandler:Ba})},Ma=function(){return(Ma=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Da=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ya=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=Da(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=Ma(Ma({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","select_payment_type",Ma(Ma({send_to:r,event_callback:i},d),y))},La=function(){return(La=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Na=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ha=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=Na(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=La(La({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"SelectPaymentType",La(La({},l),f))},qa=function(t){W("selectPaymentType",t,{googleAnalyticsHandler:Ya,facebookPixelHandler:Ha})},Fa=function(){return(Fa=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},za=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Va=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=za(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=Fa(Fa({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","add_payment_info",Fa(Fa({send_to:r,event_callback:i},d),y))},Ga=function(){return(Ga=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$a=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Wa=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=$a(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=Ga(Ga({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingle",r,"AddPaymentInfo",Ga(Ga({success:1},l),f))},Ka=function(t){W("setPaymentInfo",t,{googleAnalyticsHandler:Va,facebookPixelHandler:Wa})},Ja={logChangePaymentType:Ua,logSelectPaymentType:qa,logSetPaymentInfo:Ka},Qa=Ja,Za=function(){return(Za=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},tu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.product,c=Xa(e,["callback","userId","product"]),l=null!=i?i:n,s=a.productId,f=a.name,p=Za(Za({},c),{userId:l,productId:s,productName:f}),d=B(p),h=u().meta,y=B(h);gtag("event","customize_product",Za(Za({send_to:r,event_callback:o},d),y))},eu=function(){return(eu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ru=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},nu=function(t,e){var r=t.trackingId,n=e.product,o=ru(e,["product"]);delete o.userId;var i=n.productId,a=n.name,c=eu(eu({},o),{productId:i,productName:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingle",r,"CustomizeProduct",eu(eu({},l),f))},ou=function(t){W("customizeProduct",t,{googleAnalyticsHandler:tu,facebookPixelHandler:nu})},iu=function(){return(iu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},au=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},uu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=au(e,["callback","userId"]),c=null!=i?i:n,l=iu(iu({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","filter_products",iu(iu({send_to:r,event_callback:o},s),p))},cu=function(){return(cu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},lu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},su=function(t,e){var r=t.trackingId,n=lu(e,[]);delete n.userId;var o=cu({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"FilterProducts",cu(cu({},i),c))},fu=function(t){W("filterProducts",t,{googleAnalyticsHandler:uu,facebookPixelHandler:su})},pu=function(){return(pu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},du=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hu=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=du(e,["callback","userId","product","currency"]),f=null!=a?a:n,p=null!=l?l:o,d=c.productId,h=c.name,y=pu(pu({},s),{userId:f,productId:d,productName:h,currency:p}),g=Object(q.getProductTotals)(c),b=B(y),v=u().meta,O=B(v);gtag("event","product_impression",pu(pu({send_to:r,event_callback:i,value:g.netPrice},b),O))},yu=function(){return(yu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bu=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,a=gu(e,["product","currency"]);delete a.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=Object(q.getProductTotals)(o),p=yu(yu({},a),{productId:l,productName:s,currency:c}),d=B(p),h=u().meta,y=B(h);fbq("trackSingleCustom",r,"ProductImpression",yu(yu({value:f.netPrice},d),y))},vu=function(t){W("productImpression",t,{googleAnalyticsHandler:hu,facebookPixelHandler:bu})},Ou=function(){return(Ou=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},wu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=mu(e,["callback","userId"]),c=null!=i?i:n,l=Ou(Ou({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","search_product_success",Ou(Ou({send_to:r,event_callback:o},s),p))},Pu=function(){return(Pu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ju=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Iu=function(t,e){var r=t.trackingId,n=e.query,o=ju(e,["query"]);delete o.userId;var i=Pu({},o),a=B(i),c=u().meta,l=B(c);fbq("trackSingle",r,"Search",Pu(Pu({search_string:n,success:1},a),l))},Su=function(t){W("searchProductSuccess",t,{googleAnalyticsHandler:wu,facebookPixelHandler:Iu})},_u=function(){return(_u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Au=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Eu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.query,c=Au(e,["callback","userId","query"]),l=null!=i?i:n,s=_u(_u({},c),{userId:l}),f=B(s),p=u().meta,d=B(p);gtag("event","search",_u(_u({send_to:r,event_callback:o,search_term:a},f),d))},ku=function(){return(ku=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Tu=function(t,e){var r=t.trackingId,n=e.query,o=xu(e,["query"]);delete o.userId;var i=ku({},o),a=B(i),c=u().meta,l=B(c);fbq("trackSingle",r,"Search",ku(ku({search_string:n},a),l))},Cu=function(t){W("searchProductAttempt",t,{googleAnalyticsHandler:Eu,facebookPixelHandler:Tu})},Ru=function(){return(Ru=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Uu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Bu(e,["callback","userId"]),c=null!=i?i:n,l=Ru(Ru({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","search_product_not_found",Ru(Ru({send_to:r,event_callback:o},s),p))},Mu=function(){return(Mu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Du=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yu=function(t,e){var r=t.trackingId,n=e.query,o=Du(e,["query"]);delete o.userId;var i=Mu({},o),a=B(i),c=u().meta,l=B(c);fbq("trackSingle",r,"Search",Mu(Mu({search_string:n,success:0},a),l))},Lu=function(t){W("searchProductNotFound",t,{googleAnalyticsHandler:Uu,facebookPixelHandler:Yu})},Nu=function(){return(Nu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Hu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},qu=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=Hu(e,["callback","userId","product","currency"]);s.contentType&&delete s.contentType;var f=null!=a?a:n,p=null!=l?l:o,d=c.productId,h=c.name,y=Nu(Nu({},s),{userId:f,productId:d,productName:h,currency:p}),g=Object(q.getProductTotals)(c),b=B(y),v=u().meta,O=B(v);gtag("event","select_content",Nu(Nu({send_to:r,event_callback:i,content_type:"product",value:g.netPrice},b),O))},Fu=function(){return(Fu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},zu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Vu=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,a=zu(e,["product","currency"]);delete a.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=Object(q.getProductTotals)(o),p=Fu(Fu({},a),{productId:l,productName:s,currency:c}),d=B(p),h=u().meta,y=B(h);fbq("trackSingleCustom",r,"SelectProduct",Fu(Fu({value:f.netPrice},d),y))},Gu=function(t){W("selectProduct",t,{googleAnalyticsHandler:qu,facebookPixelHandler:Vu})},$u=function(){return($u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ku=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Wu(e,["callback","userId"]),c=null!=i?i:n,l=$u($u({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","sort_products",$u($u({send_to:r,event_callback:o},s),p))},Ju=function(){return(Ju=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Qu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Zu=function(t,e){var r=t.trackingId,n=Qu(e,[]);delete n.userId;var o=Ju({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SortProducts",Ju(Ju({},i),c))},Xu=function(t){W("sortProducts",t,{googleAnalyticsHandler:Ku,facebookPixelHandler:Zu})},tc=function(){return(tc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ec=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rc=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=ec(e,["callback","userId","product","currency"]),f=null!=a?a:n,p=null!=l?l:o,d=c.productId,h=c.name,y=tc(tc({},s),{userId:f,productId:d,productName:h,currency:p}),g=Object(q.getProductTotals)(c),b=B(y),v=u().meta,O=B(v);gtag("event","view_item",tc(tc({send_to:r,event_callback:i,value:g.netPrice},b),O))},nc=function(){return(nc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},oc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ic=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,a=oc(e,["product","currency"]);delete a.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=Object(q.getProductTotals)(o),p=nc(nc({},a),{productId:l,productName:s,currency:c}),d=B(p),h=u().meta,y=B(h);fbq("trackSingleCustom",r,"ViewProductDetails",nc(nc({value:f.netPrice},d),y))},ac=function(t){W("viewProductDetails",t,{googleAnalyticsHandler:rc,facebookPixelHandler:ic})},uc={logCustomizeProduct:ou,logFilterProducts:fu,logProductImpression:vu,logSearchProductSuccess:Su,logSearchProductAttempt:Cu,logSearchProductNotFound:Lu,logSelectProduct:Gu,logSortProducts:Xu,logViewProductDetails:ac},cc=uc,lc=function(){return(lc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fc=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=e.shoppingCart,s=sc(e,["callback","userId","currency","shoppingCart"]),f=null!=a?a:n,p=null!=c?c:o,d=lc(lc({},s),{userId:f,currency:p}),h=B(d),y=u().meta,g=B(y);gtag("event","purchase_attempt",lc(lc({send_to:r,event_callback:i,items:Z(l,p),value:Object(H.getShoppingCartTotal)(l).total},h),g))},pc=function(){return(pc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hc=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.shoppingCart,a=dc(e,["currency","shoppingCart"]);delete a.userId;var c=null!=o?o:n,l=pc(pc({},a),{currency:c}),s=B(l),f=u().meta,p=B(f),d=K(i);fbq("trackSingleCustom",r,"PurchaseAttempt",pc(pc({content_ids:d,contents:J(i),num_items:d.length,value:Object(H.getShoppingCartTotal)(i).total},s),p))},yc=function(t){W("purchaseAttempt",t,{googleAnalyticsHandler:fc,facebookPixelHandler:hc})},gc=function(){return(gc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},bc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},vc=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=e.shoppingCart,s=bc(e,["callback","userId","currency","shoppingCart"]),f=null!=a?a:n,p=null!=c?c:o,d=gc(gc({},s),{userId:f,currency:p}),h=B(d),y=u().meta,g=B(y);gtag("event","purchase_fail",gc(gc({send_to:r,event_callback:i,items:Z(l,p),value:Object(H.getShoppingCartTotal)(l).total},h),g))},Oc=function(){return(Oc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},wc=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.shoppingCart,a=mc(e,["currency","shoppingCart"]);delete a.userId;var c=null!=o?o:n,l=Oc(Oc({},a),{currency:c}),s=B(l),f=u().meta,p=B(f),d=K(i);fbq("trackSingleCustom",r,"PurchaseFail",Oc(Oc({content_ids:d,contents:J(i),num_items:d.length,value:Object(H.getShoppingCartTotal)(i).total},s),p))},Pc=function(t){W("purchaseFail",t,{googleAnalyticsHandler:vc,facebookPixelHandler:wc})},jc=function(){return(jc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ic=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Sc=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=e.shoppingCart,s=e.orderId,f=Ic(e,["callback","userId","currency","shoppingCart","orderId"]),p=null!=a?a:n,d=null!=c?c:o,h=jc(jc({},f),{userId:p,currency:d}),y=Object(H.getShoppingCartTotal)(l),g=y.total,b=y.shippingCost,v=y.totalTaxes,O=B(h),m=u().meta,w=B(m);gtag("event","purchase",jc(jc({send_to:r,event_callback:i,items:Z(l,d),value:g,transaction_id:s,shipping:b,tax:v},O),w))},_c=function(){return(_c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ac=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ec=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.shoppingCart,a=Ac(e,["currency","shoppingCart"]);delete a.userId;var c=null!=o?o:n,l=_c(_c({},a),{currency:c}),s=B(l),f=u().meta,p=B(f),d=K(i);fbq("trackSingle",r,"Purchase",_c(_c({content_ids:d,contents:J(i),num_items:d.length,value:Object(H.getShoppingCartTotal)(i).total},s),p))},kc=function(t){W("purchaseSuccess",t,{googleAnalyticsHandler:Sc,facebookPixelHandler:Ec})},xc={logPurchaseAttempt:yc,logPurchaseFail:Pc,logPurchaseSuccess:kc},Tc=xc,Cc=function(){return(Cc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Rc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Bc=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Rc(e,["callback","userId"]),c=null!=i?i:n,l=Cc(Cc({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_settings",Cc(Cc({send_to:r,event_callback:o},s),p))},Uc=function(){return(Uc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Mc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Dc=function(t,e){var r=t.trackingId,n=Mc(e,[]);delete n.userId;var o=Uc({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewSettings",Uc(Uc({},i),c))},Yc=function(t){void 0===t&&(t={}),W("viewSettings",t,{googleAnalyticsHandler:Bc,facebookPixelHandler:Dc})},Lc={logViewSettings:Yc},Nc=Lc,Hc=function(){return(Hc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Fc=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=qc(e,["callback","userId"]),c=null!=i?i:n,l=Hc(Hc({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","add_shipping_info",Hc(Hc({send_to:r,event_callback:o},s),p))},zc=function(){return(zc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Gc=function(t,e){var r=t.trackingId,n=Vc(e,[]);delete n.userId;var o=zc({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"AddShippingAddress",zc(zc({},i),c))},$c=function(t){W("addShippingAddress",t,{googleAnalyticsHandler:Fc,facebookPixelHandler:Gc})},Wc=function(){return(Wc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jc=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Kc(e,["callback","userId"]),c=null!=i?i:n,l=Wc(Wc({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","select_shipping_address",Wc(Wc({send_to:r,event_callback:o},s),p))},Qc=function(){return(Qc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xc=function(t,e){var r=t.trackingId,n=Zc(e,[]);delete n.userId;var o=Qc({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SelectShippingAddress",Qc(Qc({},i),c))},tl=function(){return(tl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},el=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rl=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=el(e,["callback","userId"]),c=null!=i?i:n,l=tl(tl({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","update_shipping_info",tl(tl({send_to:r,event_callback:o},s),p))},nl=function(){return(nl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ol=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},il=function(t,e){var r=t.trackingId,n=ol(e,[]);delete n.userId;var o=nl({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"UpdateShippingAddress",nl(nl({},i),c))},al=function(){return(al=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ul=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=e.store,f=ul(e,["callback","userId","product","currency","store"]),p=null!=a?a:n,d=null!=l?l:o,h=s.storeName,y=s.storeId,g=al(al({},f),{userId:p,storeId:y,storeName:h,currency:d}),b=Object(q.getProductTotals)(c),v=B(g),O=u().meta,m=B(O);gtag("event","add_to_cart",al(al({send_to:r,event_callback:i,items:[X(c,d)],value:b.netPrice},v),m))},ll=function(){return(ll=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.store,a=e.currency,c=sl(e,["product","store","currency"]);delete c.userId;var l=null!=a?a:n,s=o.productId,f=o.name,p=o.amount,d=i.storeName,h=i.storeId,y=ll(ll({},c),{storeId:h,storeName:d,amount:p,currency:l}),g=B(y),b=u().meta,v=B(b);fbq("trackSingle",r,"AddToCart",ll(ll({content_id:s,content_name:f,content:Q(o),value:Object(q.getProductTotals)(o).netPrice},g),v))},pl=function(){return(pl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=dl(e,["callback","userId","product","currency"]),f=null!=a?a:n,p=null!=l?l:o,d=pl(pl({},s),{userId:f,currency:p}),h=Object(q.getProductTotals)(c),y=B(d),g=u().meta,b=B(g);gtag("event","add_to_wishlist",pl(pl({send_to:r,event_callback:i,items:[X(c,p)],value:h.netPrice},y),b))},yl=function(){return(yl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,a=gl(e,["product","currency"]);delete a.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=o.amount,p=yl(yl({},a),{amount:f,currency:c}),d=B(p),h=u().meta,y=B(h);fbq("trackSingle",r,"AddToWishlist",yl(yl({content_id:l,content_name:s,content:Q(o),value:Object(q.getProductTotals)(o).netPrice},d),y))},vl=function(){return(vl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ol=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ml=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Ol(e,["callback","userId"]),c=null!=i?i:n,l=vl(vl({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","clear_cart",vl(vl({send_to:r,event_callback:o},s),p))},wl=function(){return(wl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Pl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},jl=function(t,e){var r=t.trackingId,n=Pl(e,[]);delete n.userId;var o=wl({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ClearCart",wl(wl({},i),c))},Il=function(){return(Il=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Sl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_l=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=e.store,f=Sl(e,["callback","userId","product","currency","store"]),p=null!=a?a:n,d=null!=l?l:o,h=c.productId,y=c.name,g=s.storeName,b=s.storeId,v=Il(Il({},f),{userId:p,productId:h,productName:y,storeId:b,storeName:g,currency:d}),O=Object(q.getProductTotals)(c),m=B(v),w=u().meta,P=B(w);gtag("event","remove_product_from_cart",Il(Il({send_to:r,event_callback:i,value:O.netPrice},m),P))},Al=function(){return(Al=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},El=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},kl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.store,a=e.currency,c=El(e,["product","store","currency"]);delete c.userId;var l=null!=a?a:n,s=o.productId,f=o.name,p=o.amount,d=i.storeName,h=i.storeId,y=Al(Al({},c),{storeId:h,storeName:d,amount:p,currency:l}),g=B(y),b=u().meta,v=B(b);fbq("trackSingleCustom",r,"RemoveProductFromCart",Al(Al({content_id:s,content_name:f,content:Q(o),value:Object(q.getProductTotals)(o).netPrice},g),v))},xl=function(){return(xl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Tl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Cl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=Tl(e,["callback","userId","product","currency"]),f=null!=a?a:n,p=null!=l?l:o,d=c.productId,h=c.name,y=xl(xl({},s),{userId:f,productId:d,productName:h,currency:p}),g=Object(q.getProductTotals)(c),b=B(y),v=u().meta,O=B(v);gtag("event","remove_product_from_wishlist",xl(xl({send_to:r,event_callback:i,value:g.netPrice},b),O))},Rl=function(){return(Rl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ul=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,a=Bl(e,["product","currency"]);delete a.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=o.amount,p=Rl(Rl({},a),{amount:f,currency:c}),d=B(p),h=u().meta,y=B(h);fbq("trackSingleCustom",r,"RemoveProductFromWishlist",Rl(Rl({content_id:l,content_name:s,content:Q(o),value:Object(q.getProductTotals)(o).netPrice},d),y))},Ml=function(){return(Ml=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=e.store,f=Dl(e,["callback","userId","product","currency","store"]),p=c.productId,d=c.name,h=null!=a?a:n,y=null!=l?l:o,g=s.storeName,b=s.storeId,v=Ml(Ml({},f),{userId:h,storeId:b,storeName:g,productId:p,productName:d,currency:y}),O=Object(q.getProductTotals)(c),m=B(v),w=u().meta,P=B(w);gtag("event","update_product_in_cart",Ml(Ml({send_to:r,event_callback:i,value:O.netPrice},m),P))},Ll=function(){return(Ll=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Hl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.store,a=e.currency,c=Nl(e,["product","store","currency"]);delete c.userId;var l=null!=a?a:n,s=o.productId,f=o.name,p=o.amount,d=i.storeName,h=i.storeId,y=Ll(Ll({},c),{storeId:h,storeName:d,amount:p,currency:l}),g=B(y),b=u().meta,v=B(b);fbq("trackSingleCustom",r,"UpdateProductInCart",Ll(Ll({content_id:s,content_name:f,content:Q(o),value:Object(q.getProductTotals)(o).netPrice},g),v))},ql=function(){return(ql=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=Fl(e,["callback","userId","product","currency"]),f=c.productId,p=c.name,d=null!=a?a:n,h=null!=l?l:o,y=ql(ql({},s),{userId:d,productId:f,productName:p,currency:h}),g=Object(q.getProductTotals)(c),b=B(y),v=u().meta,O=B(v);gtag("event","update_product_in_wishlist",ql(ql({send_to:r,event_callback:i,value:g.netPrice},b),O))},Vl=function(){return(Vl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$l=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,a=Gl(e,["product","currency"]);delete a.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=o.amount,p=Vl(Vl({},a),{amount:f,currency:c}),d=B(p),h=u().meta,y=B(h);fbq("trackSingleCustom",r,"UpdateProductInWishlist",Vl(Vl({content_id:l,content_name:s,content:Q(o),value:Object(q.getProductTotals)(o).netPrice},d),y))},Wl=function(){return(Wl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jl=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Kl(e,["callback","userId"]),c=null!=i?i:n,l=Wl(Wl({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_cart",Wl(Wl({send_to:r,event_callback:o},s),p))},Ql=function(){return(Ql=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xl=function(t,e){var r=t.trackingId,n=Zl(e,[]);delete n.userId;var o=Ql({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewCart",Ql(Ql({},i),c))},ts=function(){return(ts=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},es=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.shareTarget,c=e.itemId,l=es(e,["callback","userId","shareTarget","itemId"]),s=null!=i?i:n,f=ts(ts({},l),{userId:s}),p=B(f),d=u().meta,h=B(d);gtag("event","share",ts(ts({send_to:r,event_callback:o,method:a,content_id:c},p),h))},ns=function(){return(ns=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},os=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},is=function(t,e){var r=t.trackingId,n=os(e,[]);delete n.userId;var o=ns({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"Share",ns(ns({},i),c))},as=function(){return(as=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},us=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.previousStore,c=e.nextStore,l=us(e,["callback","userId","previousStore","nextStore"]),s=a.storeId,f=a.storeName,p=c.storeId,d=c.storeName,h=null!=i?i:n,y=as(as({},l),{userId:h,previousStoreId:s,previousStoreName:f,nextStoreId:p,nextStoreName:d}),g=B(y),b=u().meta,v=B(b);gtag("event","change_store",as(as({send_to:r,event_callback:o},g),v))},ls=function(){return(ls=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ss=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fs=function(t,e){var r=t.trackingId,n=e.previousStore,o=e.nextStore,i=ss(e,["previousStore","nextStore"]);delete i.userId;var a=n.storeId,c=n.storeName,l=o.storeId,s=o.storeName,f=ls(ls({},i),{previousStoreId:a,previousStoreName:c,nextStoreId:l,nextStoreName:s}),p=B(f),d=u().meta,h=B(d);fbq("trackSingleCustom",r,"ChangeStore",ls(ls({},p),h))},ps=function(){return(ps=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ds=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.store,c=ds(e,["callback","userId","store"]),l=a.storeId,s=a.storeName,f=null!=i?i:n,p=ps(ps({},c),{userId:f,storeId:l,storeName:s}),d=B(p),h=u().meta,y=B(h);gtag("event","set_store",ps(ps({send_to:r,event_callback:o},d),y))},ys=function(){return(ys=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bs=function(t,e){var r=t.trackingId,n=e.store,o=gs(e,["store"]);delete o.userId;var i=n.storeId,a=n.storeName,c=ys(ys({},o),{storeId:i,storeName:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"SetStore",ys(ys({},l),f))},vs=function(){return(vs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Os=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ms=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Os(e,["callback","userId"]),c=null!=i?i:n,l=vs(vs({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","set_user_info",vs(vs({send_to:r,event_callback:o},s),p))},ws=function(){return(ws=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ps=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},js=function(t,e){var r=t.trackingId,n=Ps(e,[]);delete n.userId;var o=ws({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SetUserInfo",ws(ws({},i),c))},Is=function(){return(Is=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ss=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_s=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Ss(e,["callback","userId"]),c=null!=i?i:n,l=Is(Is({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","update_user_info",Is(Is({send_to:r,event_callback:o},s),p))},As=function(){return(As=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Es=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ks=function(t,e){var r=t.trackingId,n=Es(e,[]);delete n.userId;var o=As({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"UpdateUserInfo",As(As({},i),c))},xs=function(){return(xs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ts=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Cs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Ts(e,["callback","userId"]),c=null!=i?i:n,l=xs(xs({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","change_vendor",xs(xs({send_to:r,event_callback:o},s),p))},Rs=function(){return(Rs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Us=function(t,e){var r=t.trackingId,n=Bs(e,[]);delete n.userId;var o=Rs({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ChangeVendor",Rs(Rs({},i),c))},Ms=function(){return(Ms=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ds=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ys=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Ds(e,["callback","userId"]),c=null!=i?i:n,l=Ms(Ms({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","set_vendor",Ms(Ms({send_to:r,event_callback:o},s),p))},Ls=function(){return(Ls=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ns=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Hs=function(t,e){var r=t.trackingId,n=Ns(e,[]);delete n.userId;var o=Ls({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SetVendor",Ls(Ls({},i),c))},qs=function(){return(qs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Fs(e,["callback","userId"]),c=null!=i?i:n,l=qs(qs({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","select_workflow",qs(qs({send_to:r,event_callback:o},s),p))},Vs=function(){return(Vs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$s=function(t,e){var r=t.trackingId,n=Gs(e,[]);delete n.userId;var o=Vs({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SelectWorkflow",Vs(Vs({},i),c))},Ws=function(){return(Ws=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ks=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Js=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Ks(e,["callback","userId"]),c=null!=i?i:n,l=Ws(Ws({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","update_workflow",Ws(Ws({send_to:r,event_callback:o},s),p))},Qs=function(){return(Qs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xs=function(t,e){var r=t.trackingId,n=Zs(e,[]);delete n.userId;var o=Qs({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"UpdateWorkflow",Qs(Qs({},i),c))},tf={auth:zt,banner:ae,billing:ke,booking:Ye,category:hr,checkout:xr,coupon:En,credit:Qn,fulfillment:wo,geo:Qo,help:ai,logCustomEvent:oo,loyalty:Mi,order:ia,other:Ea,payment:Qa,product:cc,purchase:Tc,settings:Nc,shipping:{logAddShippingAddress:$c,logSelectShippingAddress:function(t){W("selectShippingAddress",t,{googleAnalyticsHandler:Jc,facebookPixelHandler:Xc})},logUpdateShippingAddress:function(t){W("updateShippingAddress",t,{googleAnalyticsHandler:rl,facebookPixelHandler:il})}},shoppingCart:{logAddProductToCart:function(t){W("addProductToCart",t,{googleAnalyticsHandler:cl,facebookPixelHandler:fl})},logAddProductToWishlist:function(t){W("addProductToWishlist",t,{googleAnalyticsHandler:hl,facebookPixelHandler:bl})},logClearCart:function(t){W("clearCart",t,{googleAnalyticsHandler:ml,facebookPixelHandler:jl})},logRemoveProductFromCart:function(t){W("removeProductFromCart",t,{googleAnalyticsHandler:_l,facebookPixelHandler:kl})},logRemoveProductFromWishlist:function(t){W("removeProductFromWishlist",t,{googleAnalyticsHandler:Cl,facebookPixelHandler:Ul})},logUpdateProductInCart:function(t){W("updateProductInCart",t,{googleAnalyticsHandler:Yl,facebookPixelHandler:Hl})},logUpdateProductInWishlist:function(t){W("updateProductInWishlist",t,{googleAnalyticsHandler:zl,facebookPixelHandler:$l})},logViewCart:function(t){W("viewCart",t,{googleAnalyticsHandler:Jl,facebookPixelHandler:Xl})}},social:{logShare:function(t){W("share",t,{googleAnalyticsHandler:rs,facebookPixelHandler:is})}},store:{logChangeStore:function(t){W("changeStore",t,{googleAnalyticsHandler:cs,facebookPixelHandler:fs})},logSetStore:function(t){W("setStore",t,{googleAnalyticsHandler:hs,facebookPixelHandler:bs})}},user:{logSetUserInfo:function(t){W("setUserInfo",t,{googleAnalyticsHandler:ms,facebookPixelHandler:js})},logUpdateUserInfo:function(t){W("updateUserInfo",t,{googleAnalyticsHandler:_s,facebookPixelHandler:ks})}},vendor:{logChangeVendor:function(t){W("changeVendor",t,{googleAnalyticsHandler:Cs,facebookPixelHandler:Us})},logSetVendor:function(t){W("setVendor",t,{googleAnalyticsHandler:Ys,facebookPixelHandler:Hs})}},workflow:{logSelectWorkflow:function(t){W("selectWorkflow",t,{googleAnalyticsHandler:zs,facebookPixelHandler:$s})},logUpdateWorkflow:function(t){W("updateWorkflow",t,{googleAnalyticsHandler:Js,facebookPixelHandler:Xs})}}}}])}));
|
|
46
|
+
e.read=function(t,e,r,n,o){var i,a,u=8*o-n-1,c=(1<<u)-1,l=c>>1,s=-7,f=r?o-1:0,p=r?-1:1,d=t[e+f];for(f+=p,i=d&(1<<-s)-1,d>>=-s,s+=u;s>0;i=256*i+t[e+f],f+=p,s-=8);for(a=i&(1<<-s)-1,i>>=-s,s+=n;s>0;a=256*a+t[e+f],f+=p,s-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),i-=l}return(d?-1:1)*a*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var a,u,c,l=8*i-o-1,s=(1<<l)-1,f=s>>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,h=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=s):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+f>=1?p/c:p*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=s?(u=0,a=s):a+f>=1?(u=(e*c-1)*Math.pow(2,o),a+=f):(u=e*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;t[r+d]=255&u,d+=h,u/=256,o-=8);for(a=a<<o|u,l+=o;l>0;t[r+d]=255&a,d+=h,a/=256,l-=8);t[r+d-h]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e){var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&n.rotl(t,8)|4278255360&n.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=n.endian(t[e]);return t},randomBytes:function(t){for(var e=[];t>0;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],n=0;n<t.length;n+=3)for(var o=t[n]<<16|t[n+1]<<8|t[n+2],i=0;i<4;i++)8*n+6*i<=8*t.length?e.push(r.charAt(o>>>6*(3-i)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],n=0,o=0;n<t.length;o=++n%4)0!=o&&e.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<2*o|r.indexOf(t.charAt(n))>>>6-2*o);return e}},t.exports=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DayOfWeekName=e.TaxType=e.PriceCategoryType=e.ProductType=void 0,function(t){t.PRODUCT="PRODUCT",t.MODIFIER="MODIFIER"}(e.ProductType||(e.ProductType={})),function(t){t.NORMAL="NORMAL",t.POINTS="POINTS"}(e.PriceCategoryType||(e.PriceCategoryType={})),function(t){t.IVA="IVA"}(e.TaxType||(e.TaxType={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY"}(e.DayOfWeekName||(e.DayOfWeekName={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ServiceStatus=e.Days=e.DeliveryTimeUnit=void 0,function(t){t.MIN="min"}(e.DeliveryTimeUnit||(e.DeliveryTimeUnit={})),function(t){t.MONDAY="MONDAY",t.TUESDAY="TUESDAY",t.WEDNESDAY="WEDNESDAY",t.THURSDAY="THURSDAY",t.FRIDAY="FRIDAY",t.SATURDAY="SATURDAY",t.SUNDAY="SUNDAY",t.SPECIAL="SPECIAL"}(e.Days||(e.Days={})),function(t){t.INACTIVE="INACTIVE",t.ACTIVE="ACTIVE"}(e.ServiceStatus||(e.ServiceStatus={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Gender=e.MaritalStatus=void 0,function(t){t.MARRIED="MARRIED",t.DIVORCED="DIVORCED",t.SINGLE="SINGLE"}(e.MaritalStatus||(e.MaritalStatus={})),function(t){t.MALE="MALE",t.FEMALE="FEMALE"}(e.Gender||(e.Gender={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},,function(t,e,r){"use strict";r.r(e),r.d(e,"initShoppingCart",(function(){return p})),r.d(e,"closeShoppingCart",(function(){return d})),r.d(e,"listenShoppingCart",(function(){return A})),r.d(e,"getShoppingCart",(function(){return _})),r.d(e,"addProduct",(function(){return it})),r.d(e,"subtractProduct",(function(){return pt})),r.d(e,"removeProduct",(function(){return gt})),r.d(e,"setProduct",(function(){return jt})),r.d(e,"replaceProduct",(function(){return _t})),r.d(e,"createShoppingCart",(function(){return xt})),r.d(e,"emptyShoppingCart",(function(){return Bt})),r.d(e,"deleteShoppingCart",(function(){return Mt})),r.d(e,"getShoppingCartTotal",(function(){return J})),r.d(e,"getShoppingCartProducts",(function(){return Q})),r.d(e,"validateShoppingCart",(function(){return Kt})),r.d(e,"setShoppingCartAdditionalInfo",(function(){return Qt})),r.d(e,"getProductHash",(function(){return W})),r.d(e,"UNSAFE_listenBenefitsWallet",(function(){return de})),r.d(e,"listenBenefitsWallet",(function(){return ve})),r.d(e,"applyBenefits",(function(){return Pe})),r.d(e,"redeemCoupon",(function(){return Se})),r.d(e,"useBenefit",(function(){return Ee})),r.d(e,"unuseBenefit",(function(){return Te}));var n="YYYY-MM-DD hh:mm:ss.SSS",o="default",i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a={artisanApp:void 0,accountId:void 0,customerId:void 0,activeShoppingCart:o,maxShoppingCarts:2,wallets:{}};Object.freeze(a);var u=i({},a);Object.seal(u);var c=function(t){u=i(i({},u),t)},l=function(){return i({},u)},s=function(){return(s=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},f=!1,p=function(t,e){void 0===e&&(e={}),f?console.warn("initShoppingCart has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initShoppingCart is only called once "):(c(s({artisanApp:t},e)),"undefined"==typeof window||(f=!0))},d=function(){var t;null===(t=l().artisanApp)||void 0===t||t.__internals__.firestore().terminate(),c(s({},a)),f=!1},h=function(t){if(void 0===t&&(t=""),!l().artisanApp)throw new Error("Artisan app must be provided, you probably forgot to initialize the shopping cart. Please make sure initShoppingCart has been called beforehand. "+t)},y=function(t,e){void 0===e&&(e="");var r=l().accountId;if(void 0===t&&void 0===r)throw new Error("AccountId must be defined. Either provide a global accountId or at the function call level. "+e)},g=function(t,e){void 0===e&&(e="");var r=l().customerId;if(void 0===t&&void 0===r)throw new Error("CustomerId must be defined. Either provide a global customerId or at the function call level. "+e)},b=function(t,e){void 0===e&&(e="");var r=l().store;if(void 0===t&&void 0===r)throw new Error("StoreId must be defined. Either provide a global storeId or at the function call level. "+e)},v=function(t){void 0===t&&(t={});var e=t.accountId,r=t.customerId;y(e),g(r)},O=function(t){var e=t.customerId;!function(t,e){if(void 0===e&&(e=""),void 0===t)throw new Error("VendorId must be defined. Either provide a global vendorId or at the function call level to retrieve a wallet. "+e)}(t.vendorId),g(e)},m=function(t){var e=null!=t?t:{},r=e.Platform,n=e.account;!function(t,e){void 0===e&&(e="");var r=l().artisanApp.settings.platform;if(void 0===t&&void 0===r)throw new Error("Platform must be defined. Either provide a global Plafform in the artisan object or at the function call level. "+e)}(r),y(n)},w=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},P=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},j=o,I=function(t){return void 0===t&&(t={}),w(void 0,void 0,void 0,(function(){var e,r,n,o,i,a,u,c,s;return P(this,(function(f){switch(f.label){case 0:return e=l(),r=e.artisanApp,n=e.accountId,o=l().customerId,i=t.accountId,a=t.customerId,h(),v(t),u=null==r?void 0:r.__internals__.firestore(),[4,null===(s=null===(c=null==u?void 0:u.collection("shoppingCartByUser"))||void 0===c?void 0:c.doc(String(null!=a?a:o)))||void 0===s?void 0:s.collection(String(null!=i?i:n))];case 1:return[2,f.sent()]}}))}))},S=function(t,e){return w(void 0,void 0,void 0,(function(){var r,n;return P(this,(function(o){switch(o.label){case 0:return r=null!=e?e:l().activeShoppingCart,[4,I(t)];case 1:return(n=o.sent())?[4,n.where("name","==",r).get().then((function(t){return t.docs[0]}))]:[2,void 0];case 2:return[2,o.sent()]}}))}))},_=function(t,e){return w(void 0,void 0,void 0,(function(){var r,n;return P(this,(function(o){switch(o.label){case 0:return r=null!=t?t:l().activeShoppingCart,[4,S(e,r)];case 1:return(n=o.sent())?(c({activeShoppingCart:r}),[4,n.data()]):[2];case 2:return[2,o.sent()]}}))}))},A=function(t,e,r){return void 0===r&&(r={}),w(void 0,void 0,void 0,(function(){var n,o;return P(this,(function(i){switch(i.label){case 0:return n=null!=e?e:l().activeShoppingCart,[4,I(r)];case 1:return(o=i.sent())?(c({activeShoppingCart:n}),o.where("name","==",n).onSnapshot((function(e){return w(void 0,void 0,void 0,(function(){var r;return P(this,(function(o){switch(o.label){case 0:return e.docs[0]?[4,e.docs[0].data()]:(n!==j&&console.warn("Failed to fetch a shopping cart with name "+n+" because there wasn't any."),[2,t(void 0)]);case 1:return r=o.sent(),[2,t(r)]}}))}))})),[2]):[2]}}))}))},E=r(1),k=r.n(E),x=r(0),T=function(){return(T=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},C=o,R=function(t){return void 0===t&&(t=C),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var e;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){switch(r.label){case 0:return[4,S({},t)];case 1:return[2,null==(e=r.sent())?void 0:e.id]}}))}))},B=function(t){if(void 0!==t)return"number"==typeof t?t:t.storeId},U=function(t,e){var r=B(t);return T("number"!=typeof t?T({},t):{},e[r])},M=function(t){var e=t.store,r=t.amount,n=B(e);b(n),function(t){if("number"!=typeof t)throw new Error("Invalid amount recieved, please make sure you include a valid amount.");if(t<0)throw new Error("Cannot receive a negative amount of an item. Please ensure you have added a proper amount of items.");if(0===t)throw new Error("Attempting to pass 0 amount. This might indicate a problem with your code. Please ensure you have added a proper amount of items.")}(r)},D=r(3),Y=r.n(D),L=r(4),N=function(t,e,r){var n=e[t],o=r[t];return n>o?1:o>n?-1:0},H=function(t,e){return N("productId",t,e)},q=function(t,e){return N("questionId",t,e)},F=function(t){console.error(t)},z=function(){return(z=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},V=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},G=x.transformers.toCartProduct,$=x.modifierUtils.divideProductQA,W=function(t){var e=$(t),r=e.productId,n=e.questionsAndAnswers,o=e.priceCategory,i=r+"-"+K(n).sort(q).reduce((function(t,e){var r=e.answers.sort(H).reduce((function(t,e,r){var n=e.productId,o=e.amount,i=W(e),a=i?"{"+i+"}":"";return 0===r?n+"="+o+a:t+"|"+n+"="+o+a}),""),n=e.questionId+":"+r;return""===t?""+n:t+"-"+n}),"")+"*"+o;return Y()(i)},K=function(t){return t.reduce((function(t,e){var r=e.answers.filter((function(t){return t.amount>0})).map((function(t){var e=K(t.questionsAndAnswers);return z(z({},t),{questionsAndAnswers:e})}));return V(V([],t),[z(z({},e),{answers:r})])}),[]).filter((function(t){return t.answers.length>0}))},J=function(t,e){void 0===e&&(e={});var r=Q(t).reduce((function(t,e){var r=G(e),n=r.priceCategory,o=Object(x.getProductTotals)(r),i=n===L.PriceCategoryType.POINTS,a=i?o.netPrice:0,u=i?0:o.netPrice,c=i?0:o.grossPrice;return{subtotal:t.subtotal+c,totalDiscounts:t.totalDiscounts+o.totalDiscounts,totalTaxes:t.totalTaxes+o.totalTaxes,totalPoints:t.totalPoints+a,total:t.total+u}}),{subtotal:0,totalDiscounts:0,totalTaxes:0,totalPoints:0,total:0}),n=Z(null==t?void 0:t.additional_info,null==t?void 0:t.benefits,r),o=e.shippingCost,i=void 0===o?t.shippingCost:o;if(!i)return n;var a=i.grossPrice,u=i.netPrice,c=i.taxTotal,l=i.discountTotal;return{subtotal:n.subtotal+a,totalDiscounts:n.totalDiscounts+l,totalTaxes:n.totalTaxes+c,shippingCost:u,totalPoints:n.totalPoints,total:n.total+u}},Q=function(t){return Object.values(t.stores).reduce((function(t,e){var r=Object.values(e.products);return V(V([],t),r)}),[])},Z=function(t,e,r){return e?Object.values(e).reduce((function(e,r){return"DISCOUNT"===r.type?X(r,e,t):e}),r):r},X=function(t,e,r){var n=e.subtotal,o=e.total,i=e.totalDiscounts,a=.01*t.discountPercentage;if(void 0!==(null==r?void 0:r.copayment)){var u=null==r?void 0:r.copayment,c=u*a,l=i+c,s=(u-c).toFixed(4);return z(z({},e),{totalDiscounts:l,total:Number(s)})}var f=n*a,p=i+f,d=o-f;return z(z({},e),{totalDiscounts:p,total:d})},tt=function(){return(tt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},et=n,rt=x.transformers.toCartProduct,nt=x.modifierUtils.multiplyProductQA,ot=x.modifierUtils.divideProductQA,it=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return M(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=a.sent())?[4,n.data()]:(console.warn("Cannot add a product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=a.sent(),i=at(o,t,e),[4,n.ref.set(i)];case 3:return a.sent(),[2]}}))}))},at=function(t,e,r){var n=e.amount||1,o=rt(e,tt(tt({},r),{amount:null!=n?n:1})),i=rt(e,r),a=l().store,u=r.store,c=null!=u?u:a,s=B(c),f=W(o),p=tt({},t),d=tt({},t.stores),h=U(c,d),y=tt({},h.products),g=y[f],b=k()().format(et);g?(y[f]=ot(y[f]),y[f].amount+=i.amount):(y[f]=i,y[f].hash=f,y[f].createdAt=b),y[f].updatedAt=b;var v=y[f],O=(v=nt(v)).questionsAndAnswers,m=K(O);return y[f]=tt(tt({},v),{questionsAndAnswers:m}),h.products=y,d[s]=h,p.stores=d,p},ut=function(){return(ut=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ct=n,lt=x.transformers.toCartProduct,st=x.modifierUtils.multiplyProductQA,ft=x.modifierUtils.divideProductQA,pt=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return M(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=a.sent())?[4,n.data()]:(console.warn("Cannot subtract product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=a.sent(),i=dt(o,t,e),[4,n.ref.set(i)];case 3:return a.sent(),[2]}}))}))},dt=function(t,e,r){var n=e.amount||1,o=lt(e,ut(ut({},r),{amount:null!=n?n:1})),i=lt(e,r),a=l().store,u=r.store,c=null!=u?u:a,s=B(c),f=W(o),p=ut({},t),d=ut({},t.stores);if(void 0===d[s])return console.warn("StoreId given is invalid. There is no store with id "+s+" on the shopping cart."),t;var h=U(c,d),y=ut({},h.products),g=y[f],b=k()().format(ct);if(!g)return console.warn("Attempting to subtract the amount of product that is not in the given shopping cart store."),t;y[f]=ft(y[f]);var v=y[f].amount-i.amount;return v>0?(y[f].amount=v,y[f].updatedAt=b,y[f]=st(y[f])):delete y[f],h.products=y,Object.keys(h.products).length?d[s]=h:delete d[s],p.stores=d,p},ht=function(){return(ht=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},yt=x.transformers.toCartProduct,gt=function(t,e){return void 0===e&&(e={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return function(t){var e=t.store,r=B(e);b(r)}(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=a.sent())?[4,n.data()]:(console.warn("Cannot remove a product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=a.sent(),i=bt(o,t,e),[4,n.ref.set(i)];case 3:return a.sent(),[2]}}))}))},bt=function(t,e,r){var n=e.hash;if(!n){var o=yt(e);n=W(o)}var i=l().store,a=r.store,u=null!=a?a:i,c=B(u),s=ht({},t),f=ht({},t.stores);if(void 0===f[c])return console.warn("StoreId given is invalid. There is no store with id "+c+" on the shopping cart."),t;var p=U(u,f),d=ht({},p.products);return d[n]?(delete d[n],p.products=d,Object.keys(p.products).length?f[c]=p:delete f[c],s.stores=f,s):(console.warn("Attempting to remove product that is not in the given shopping cart store."),t)},vt=function(){return(vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ot=n,mt=x.transformers.toCartProduct,wt=x.modifierUtils.multiplyProductQA,Pt=x.modifierUtils.divideProductQA,jt=function(t,e){return void 0===e&&(e={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,l,s;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(f){switch(f.label){case 0:return r=null!==(s=null!==(c=e.amount)&&void 0!==c?c:null===(l=t)||void 0===l?void 0:l.amount)&&void 0!==s?s:1,n=vt(vt({},e),{amount:r}),M(n),o=e.shoppingCartName,[4,S(e,o)];case 1:return(i=f.sent())?[4,i.data()]:(console.warn("Cannot set product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return a=f.sent(),u=It(a,t,n),[4,i.ref.set(u)];case 3:return f.sent(),[2]}}))}))},It=function(t,e,r){var n,o,i=null!==(o=null===(n=e)||void 0===n?void 0:n.amount)&&void 0!==o?o:1,a=mt(e,vt(vt({},r),{amount:i})),u=l().store,c=r.store,s=null!=c?c:u,f=B(s),p=W(a),d=vt({},t),h=vt({},t.stores),y=U(s,h),g=vt({},y.products),b=g[p],v=k()().format(Ot);g[p]=a,b?g[p]=Pt(g[p]):(g[p].createdAt=v,g[p].hash=p),g[p].updatedAt=v;var O=mt(g[p],r),m=(O=wt(O)).questionsAndAnswers,w=K(m);return g[p]=vt(vt({},O),{questionsAndAnswers:w}),y.products=g,h[f]=y,d.stores=h,d},St=function(){return(St=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_t=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return function(t){var e=t.store,r=B(e);b(r)}(e),r=e.shoppingCartName,[4,S(e,r)];case 1:return(n=a.sent())?[4,n.data()]:(console.warn("Cannot replace product because no shopping cart nodes found. Please ensure you have a shopping cart before continue."),[2]);case 2:return o=a.sent(),i=At(o,t,e),[4,n.ref.set(i)];case 3:return a.sent(),[2]}}))}))},At=function(t,e,r){var n=r.hash,o=null!=n?n:e.hash,i=l().store,a=r.store,u=null!=a?a:i,c=B(u),s=St({},t.stores),f=U(u,s),p=St({},f.products);if(!p[o])return console.warn("Cannot replace a product because no product was found in the given store"),t;delete p[o],f.products=p,Object.keys(f.products).length?s[c]=f:delete s[c];var d=St({},t);d.stores=s;var h=St(St({},e),{amount:0});return at(d,h,r)},Et=function(){return(Et=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},kt=o,xt=function(t,e){return void 0===t&&(t={}),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(s){switch(s.label){case 0:return[4,I(e)];case 1:return r=s.sent(),n=Tt(t),r?(o=n.name,[4,r.get()]):(console.warn("Couldn't find a shopping cart collection with the given config. Please make sure everything is correct in your configuration before continue."),[2]);case 2:if(i=null===(c=s.sent())||void 0===c?void 0:c.docs.length,a=l().maxShoppingCarts,i>=a)throw new Error("Cannot add more carts. Carts limit ("+a+") reached.");return[4,r.where("name","==",o).get()];case 3:if(s.sent().docs.length>0)throw new Error("Attempted to add a shopping cart with the name "+o+", but there is already one shopping cart with that name.");return[4,r.add(n)];case 4:return(u=s.sent())?[4,u.set(Et(Et({},n),{id:u.id}))]:(console.error("Failed to create a new shopping cart"),[2]);case 5:return s.sent(),[2]}}))}))},Tt=function(t){void 0===t&&(t={});var e=(new Date).toISOString();return Et({id:"",name:kt,latitude:-1,longitude:-1,createdAt:e,updatedAt:e,channelId:1,stores:{},billTotal:{}},t)},Ct=function(){return(Ct=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Rt=o,Bt=function(t,e){return void 0===t&&(t=Rt),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(i){switch(i.label){case 0:return[4,S(e,t)];case 1:return(r=i.sent())?[4,r.data()]:(console.warn("Cannot empty cart, shopping cart nodes not found. Please ensure you have a shopping cart with name "+t+" before continue."),[2]);case 2:return n=i.sent(),o=Ct(Ct({},n),{stores:{}}),[4,r.ref.set(o)];case 3:return i.sent(),[2]}}))}))},Ut=o,Mt=function(t,e){return void 0===t&&(t=Ut),function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(n){switch(n.label){case 0:return[4,S(e,t)];case 1:return(r=n.sent())?[4,r.ref.delete()]:(console.warn("Coundn't find any shopping cart with name "+t+" with the given config."),[2]);case 2:return n.sent(),[2]}}))}))},Dt=r(5),Yt={"Content-Type":"application/json"},Lt=function(){return(Lt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},Ht=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},qt=function(t){return Nt(void 0,void 0,void 0,(function(){var e,r,n,o,i,a,u,c,s,f,p,d,h,y,g;return Ht(this,(function(b){switch(b.label){case 0:return e=l().artisanApp.settings,r=e.platform,n=e.accountId,o=null!==(p=null!==(f=null===(s=null==t?void 0:t.account)||void 0===s?void 0:s.toString())&&void 0!==f?f:null==n?void 0:n.toString())&&void 0!==p?p:"",i=null!==(h=null!==(d=null==t?void 0:t.Platform)&&void 0!==d?d:r)&&void 0!==h?h:"",a=i,null===(y=null==t?void 0:t.Authorization)||void 0===y?[3,1]:(c=y,[3,3]);case 1:return[4,Ft()];case 2:c=b.sent(),b.label=3;case 3:return u=null!==(g=c)&&void 0!==g?g:"",[2,new Headers(Lt(Lt(Lt({},Yt),t),{Authorization:u,Platform:a,account:o}))]}}))}))},Ft=function(t){return Nt(void 0,void 0,void 0,(function(){var e,r,n;return Ht(this,(function(o){switch(o.label){case 0:return e=l().artisanApp,[4,null===(n=Object(Dt.initAuth)(e).currentUser)||void 0===n?void 0:n.getIdToken(t)];case 1:return(r=o.sent())?[2,"Bearer "+r]:(F("Please make sure you are authenticated before trying to call a restricted action."),[2])}}))}))},zt=function(){return(zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vt=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},Gt=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},$t=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Wt=function(t,e){return Vt(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,s,f,p;return Gt(this,(function(d){switch(d.label){case 0:return r=l().artisanApp.apiURL,n=t.id,o=t.latitude,i=t.longitude,[4,qt(zt({},e))];case 1:a=d.sent(),d.label=2;case 2:return d.trys.push([2,4,,5]),[4,fetch(r+"/api/shopping-cart/"+n+"/validateShoppingCart?latitude="+o+"&longitude="+i,{headers:a}).then((function(t){return Vt(void 0,void 0,void 0,(function(){return Gt(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(u=d.sent(),!(c=u.data))throw new Error("No shopping cart was found.");return s=Object.values(c.stores).reduce((function(t,e){return e.alerts.length?$t($t([],t),e.alerts):t}),[]),f=Object.values(c.stores).some((function(t){return!!t.alerts.length||Object.values(t.products).some((function(t){return t.alerts.length}))})),[2,{stores:s,products:f}];case 4:return p=d.sent(),console.error(p.message),[2,{stores:[{errorLevel:1,message:"Occurrió un error desconocido, comuníquese con soporte",type:""}],products:!1}];case 5:return[2]}}))}))},Kt=function(t,e,r){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var n,o,i,a;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(u){switch(u.label){case 0:return function(t,e){!function(t,e){void 0===e&&(e="");var r=l().artisanApp.apiURL;if(void 0===t&&void 0===r)throw new Error("ApiURL must be defined. Either provide a global ApiURL or at the function call level. "+e)}(t.apiURL),m(e)}(t,e),n=null!=r?r:l().activeShoppingCart,[4,R(n)];case 1:return void 0===(o=u.sent())?(console.error("Cannot use undefined as a shopping cart id. Shopping cart "+n+" was not found. Validation canceled."),[2]):(i=t.latitude,a=t.longitude,[4,Wt({id:o,latitude:i,longitude:a},e)]);case 2:return[2,u.sent()]}}))}))},Jt=function(){return(Jt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Qt=function(t,e){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,n,o,i;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(a){switch(a.label){case 0:return[4,S({},e)];case 1:return(r=a.sent())?[4,r.data()]:(n=null!=e?e:l().activeShoppingCart,console.warn("Cannot set additional info because no shopping cart was found. Please ensure you create a shopping cart with name "+n+" before continue."),[2]);case 2:return o=a.sent(),i=Zt(o,t),[4,r.ref.set(i)];case 3:return a.sent(),[2]}}))}))},Zt=function(t,e){return Jt(Jt({},t),{additional_info:e(t.additional_info)})},Xt=function(){return(Xt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},te=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},ee=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},re=function(t){return void 0===t&&(t={}),Xt({benefits:[],usedBenefits:[],unusedBenefits:[]},t)},ne=function(t,e){var r,n=l().wallets,o=Xt(Xt({},n),((r={})[t]=Xt({},e),r));c({wallets:o})},oe=function(t){return void 0===t&&(t={}),te(void 0,void 0,void 0,(function(){var e,r,n,o,i,a,u,c,s;return ee(this,(function(f){switch(f.label){case 0:return e=l(),r=e.artisanApp,n=e.customerId,o=e.accountId,i=t.accountId,a=t.customerId,h(),v(t),u=null==r?void 0:r.__internals__.firestore(),[4,null===(s=null===(c=null==u?void 0:u.collection("benefitsByUser"))||void 0===c?void 0:c.doc(String(null!=a?a:n)))||void 0===s?void 0:s.collection(String(null!=i?i:o))];case 1:return[2,f.sent()]}}))}))},ie=function(t){return te(void 0,void 0,void 0,(function(){var e;return ee(this,(function(r){switch(r.label){case 0:return[4,oe(t)];case 1:return(e=r.sent())?[4,e.get().then((function(t){return t.docs[0]}))]:[2,void 0];case 2:return[2,r.sent()]}}))}))},ae=function(t){return te(void 0,void 0,void 0,(function(){var e,r;return ee(this,(function(n){switch(n.label){case 0:return[4,ie(t)];case 1:return(e=n.sent())?0===Object.keys(e.data()).length?[2,[]]:(r=e.id,[2,Object.values(e.data()).map((function(t){return Xt(Xt({},t),{hash:r})}))]):[2]}}))}))},ue=function(){return(ue=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ce=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},le=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},se=function(t,e){return ce(void 0,void 0,void 0,(function(){var r,n,o,i,a;return le(this,(function(u){switch(u.label){case 0:return r=l().artisanApp.apiURL,n=t.vendorId,o=t.customerId,[4,qt(ue(ue({},e),{uid:o.toString()}))];case 1:i=u.sent(),u.label=2;case 2:return u.trys.push([2,4,,5]),[4,fetch(r+"/api/shopping-cart/retrieveBenefits?vendorId="+n,{headers:i}).then((function(t){return ce(void 0,void 0,void 0,(function(){return le(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(!u.sent())throw new Error("The benefits wallet is not defined. Make sure coupons arewell configured");return[3,5];case 4:throw a=u.sent(),Error(a.message);case 5:return[2]}}))}))},fe=function(t,e,r){return ce(void 0,void 0,void 0,(function(){var n,o,i,a,u,c;return le(this,(function(s){switch(s.label){case 0:return n=l().artisanApp.apiURL,o=t.customerId,[4,qt(ue(ue({},r),{uid:o.toString()}))];case 1:i=s.sent(),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,fetch(n+"/api/wallet_profit/apply",{method:"post",body:JSON.stringify({code:e}),headers:i}).then((function(t){return ce(void 0,void 0,void 0,(function(){return le(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 3:if(a=s.sent(),200===(u=a).code)return[2,!0];if(null===u.data||!u.data)throw new Error(u.message);return F("Unhandled response when redeeming coupon "+JSON.stringify(u,void 0,2)),[2,!1];case 4:throw c=s.sent(),new Error("Failed to redeem coupon "+e+". "+c.message);case 5:return[2]}}))}))},pe=function(){return(pe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},de=function(t,e,r,n){O(e);var o=l().customerId,i=l(),a=i.activeShoppingCart,u=i.wallets,s=null!=r?r:a,f=u[s],p=e.customerId,d=null!=p?p:o;return f?(F("There is already a listener for wallet of name "+s+". Either unsubscribe to the other listener or create a new listener for a different cart"),function(){return he(s)}):(function(t,e,r,n){new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var r,o,i,a,l;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(f){switch(f.label){case 0:r=pe(pe({},e),{customerId:d}),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,se(r,n)];case 2:return f.sent(),[3,4];case 3:return f.sent(),[2,function(){return he(s)}];case 4:return[4,ae()];case 5:return(o=f.sent())?(i={benefits:o,unusedBenefits:o,usedBenefits:[]},a=pe(pe({},u),((l={})[s]=pe(pe({},i),{callback:t}),l)),c({wallets:a}),t(i),[2]):[2,function(){return he(s)}]}}))})),function(){return he(s)})},he=function(t){var e=l().wallets,r=pe({},e);delete r[t],c({wallets:r})},ye=function(){return(ye=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ge=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))},be=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},ve=function(t,e,r,n){O(e),m(n);var o=l().customerId,i=l(),a=i.activeShoppingCart,u=i.wallets,c=null!=r?r:a,s=u[c],f=e.customerId,p=null!=f?f:o;if(s)return F("There is already a listener for wallet of name "+c+". Either unsubscribe to the other listener or create a new listener for a different cart"),function(){return Oe(c)};var d=re();ne(c,ye(ye({},d),{callback:t}));var h=void 0;return ge(void 0,void 0,void 0,(function(){var r,o;return be(this,(function(i){switch(i.label){case 0:r=ye(ye({},e),{customerId:p}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,se(r,n)];case 2:return i.sent(),[3,4];case 3:return i.sent(),console.error("Failed to retrieve the user's wallet"),[2];case 4:return[4,oe(e)];case 5:return(o=i.sent())?(h=o.onSnapshot((function(e){return ge(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,l;return be(this,(function(s){return r=null!==(l=null===(u=e.docs[0])||void 0===u?void 0:u.data())&&void 0!==l?l:{},0===Object.keys(r).length?(n=re(),ne(c,ye(ye({},n),{callback:t})),t(n),[2]):(o=e.docs[0].id,i=function(t,e){return Object.values(t).map((function(t){return Xt(Xt({},t),{hash:e})}))}(r,o),a=re({benefits:i,unusedBenefits:i}),ne(c,ye(ye({},a),{callback:t})),t(a),[2])}))}))})),[2]):(console.error("Failed to retrieve the benefits wallet node"),[2])}}))})),function(){return Oe(c,h)}},Oe=function(t,e){var r=l().wallets,n=ye({},r);delete n[t],c({wallets:n}),e&&e()},me=function(){return(me=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},we=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Pe=function(t,e,r){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var n,o,i,a,u,s,f,p,d,h,y,g,b,O,w;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(P){switch(P.label){case 0:if(n=l().customerId,v(t),m(r),o=l(),i=o.activeShoppingCart,a=o.wallets,!(s=a[u=null!=e?e:i]))return F("No benefits wallet available for "+u+", you probably forgot to call listenBenefitsWallet beforehand."),[2];f=s.usedBenefits,p=t.customerId,d=null!=p?p:n,h=me(me({},t),{customerId:d}),y=f.map((function(t){var e=t.hash,n=t.benefitId;return function(t,e){return ce(void 0,void 0,void 0,(function(){var r,n,o,i,a,u,c,s;return le(this,(function(f){switch(f.label){case 0:return r=t.benefitId,n=t.benefitHash,o=t.shoppingCartId,i=t.customerId,a=l().artisanApp.apiURL,[4,qt(ue(ue({},e),{uid:i.toString()}))];case 1:return u=f.sent(),c={benefitId:r,shoppingCartId:o},[4,fetch(a+"/api/shopping-cart/benefitsByUser/"+n+"/applyBenefit",{method:"post",body:JSON.stringify(c),headers:u}).then((function(t){return ce(void 0,void 0,void 0,(function(){return le(this,(function(e){switch(e.label){case 0:return[4,t.json()];case 1:return[2,e.sent()]}}))}))}))];case 2:if((s=f.sent()).benefits){if(Object.keys(null==s?void 0:s.benefits).length>0)return[2,s];if(0===Object.keys(null==s?void 0:s.benefits).length)throw Error("No benefits were applied to the current shopping cart")}if(200!==(null==s?void 0:s.code))throw Error(s.message);return[2]}}))}))}(me(me({},h),{benefitId:n,benefitHash:e}),r)})),P.label=1;case 1:return P.trys.push([1,3,,4]),[4,Promise.all(y)];case 2:return P.sent(),[3,4];case 3:throw g=P.sent(),Error(g.message);case 4:return b={benefits:we([],s.unusedBenefits),unusedBenefits:we([],s.unusedBenefits),usedBenefits:[],callback:s.callback},O=me(me({},a),((w={})[u]=b,w)),c({wallets:O}),s.callback(b),[2]}}))}))},je=function(){return(je=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ie=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Se=function(t,e,r,n){return function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,u)}c((n=n.apply(t,e||[])).next())}))}(void 0,void 0,void 0,(function(){var o,i,a,u,s,f,p,d,h,y,g,b,O,w;return function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(P){switch(P.label){case 0:return o=l().customerId,v(t),m(n),i=l(),a=i.activeShoppingCart,u=i.wallets,(f=u[s=null!=r?r:a])||F("No benefits wallet available for "+s+", you probably forgot to call listenBenefitsWallet beforehand."),p=t.customerId,d=null!=p?p:o,h=je(je({},t),{customerId:d}),[4,fe(h,e,n)];case 1:if(!P.sent())return[2];P.label=2;case 2:return P.trys.push([2,4,,5]),[4,se(h,n)];case 3:return P.sent(),[3,5];case 4:return P.sent(),console.error("Failed to retrieve the user's wallet after redeeming coupon"),[2];case 5:return[4,ae()];case 6:if(!(y=P.sent()))throw new Error("Failed to fetch benefits from ArtisanDB for the current customer after redeeming coupon");return g=re({benefits:y,unusedBenefits:y,usedBenefits:[]}),b={benefits:Ie([],g.benefits),unusedBenefits:Ie(Ie([],f.unusedBenefits),g.unusedBenefits),usedBenefits:Ie(Ie([],f.usedBenefits),g.usedBenefits),callback:f.callback},O=je(je({},u),((w={})[s]=b,w)),c({wallets:O}),f.callback(g),[2]}}))}))},_e=function(){return(_e=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ae=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Ee=function(t,e){var r,n=l(),o=n.activeShoppingCart,i=n.wallets,a=null!=e?e:o,u=i[a],s=t.benefitId;if(u){var f=u.benefits.find((function(t){return t.benefitId===s}));if(f){var p=u.unusedBenefits.filter((function(t){return t.benefitId!==s})),d=_e(_e({},u),{unusedBenefits:p,usedBenefits:Ae(Ae([],u.usedBenefits),[f])}),h=_e(_e({},d),{callback:u.callback}),y=_e(_e({},i),((r={})[a]=h,r));c({wallets:y}),u.callback(d)}else F("There is no benefit to apply with the id "+s+" on the current cart. This might indicate something bad configured.")}else F("No benefits wallet available for "+a+", you probably forgot to call listenBenefitsWallet beforehand.")},ke=function(){return(ke=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xe=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},Te=function(t,e){var r,n=l(),o=n.activeShoppingCart,i=n.wallets,a=null!=e?e:o,u=i[a],s=t.benefitId;if(u){var f=u.benefits.find((function(t){return t.benefitId===s}));if(f){var p=u.usedBenefits.filter((function(t){return t.benefitId!==s})),d=ke(ke({},u),{unusedBenefits:xe(xe([],u.unusedBenefits),[f]),usedBenefits:p}),h=ke(ke({},d),{callback:u.callback}),y=ke(ke({},i),((r={})[a]=h,r));c({wallets:y}),u.callback(d)}else F("There is no benefit to unuse with the id "+s+" on the current cart. This might indicate something bad configured.")}else F("No benefits wallet available for "+a+", you probably forgot to call listenBenefitsWallet beforehand.")}}])},function(t,e,r){t.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([,function(t,e,r){"use strict";r.r(e),r.d(e,"initState",(function(){return i})),r.d(e,"getState",(function(){return u})),r.d(e,"setState",(function(){return a}));var n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=null,i=function(t){Object.freeze(t),o=n({},t),Object.seal(o)},a=function(t){var e=o?n({},o):{};o=null,o=n(n({},e),t),Object.seal(o)},u=function(){if(null===o)throw new Error("The state has not been initialized, make sure to call initState beforehand");return n({},o)}}])},function(t){t.exports=JSON.parse('{"name":"@artisan-commerce/analytics-web","description":"Artisan commerce analytics web library","version":"0.1.0-canary.12","main":"./build/main.bundle.js","types":"./build/src/index.d.ts","files":["build/","LICENSE","README.md"],"scripts":{"start":"webpack --config webpack.dev.js","dev":"yarn start","build":"webpack --config webpack.prod.js","start:build":"nodemon ./build/main.bundle.js","test":"jest --watchAll --runInBand","test:all":"yarn test --watchAll=false --coverage","test:ci":"cross-env CI=true jest --runInBand","test:staged":"yarn test:ci --findRelatedTests ./src","check-types":"tsc --noEmit","lint":"eslint --ignore-path .gitignore --ignore-pattern !cypress/.eslintrc.js --ext .js,jsx,.ts,.tsx .","lint:staged":"yarn lint --max-warnings=0","prettier":"prettier --ignore-path .gitignore \\"**/*.+(js|jsx|ts|tsx|json|css|scss|html)\\"","format":"yarn prettier --write","check-format":"yarn prettier --list-different","validate":"cross-env CI=true npm-run-all --parallel test:ci check-types check-format lint build","validate:ci":"npm-run-all --parallel check-types check-format lint"},"author":"Luis Eduardo Andrade","license":"MIT","dependencies":{"@artisan-commerce/state":"0.2.2-canary.4","snake-case":"^3.0.4"},"devDependencies":{"@artisan-commerce/products":"0.8.2-canary.12","@artisan-commerce/shopping-cart":"0.11.0-canary.12","@artisan-commerce/types":"0.13.0-canary.7","@babel/core":"^7.10.5","@babel/preset-env":"^7.10.4","@babel/preset-react":"^7.10.4","@types/faker":"^4.1.12","@types/jest":"^26.0.5","@types/jest-in-case":"^1.0.2","@types/node":"^14.0.24","@typescript-eslint/eslint-plugin":"^4.15.2","@typescript-eslint/parser":"^4.15.2","avn":"^0.2.4","avn-nvm":"^0.2.2","clean-webpack-plugin":"^3.0.0","dotenv-webpack":"^2.0.0","env-cmd":"^10.1.0","eslint":"^7.5.0","eslint-config-prettier":"^6.11.0","eslint-config-react-app":"^5.2.1","eslint-config-universe":"^4.0.0","eslint-plugin-cypress":"^2.11.1","eslint-plugin-flowtype":"^5.2.0","eslint-plugin-import":"^2.22.0","eslint-plugin-jsx-a11y":"^6.3.1","eslint-plugin-react":"^7.20.3","eslint-plugin-react-hooks":"^4.0.8","is-ci-cli":"^2.1.2","jest-axe":"^3.5.0","jest-extended":"^0.11.5","jest-in-case":"^1.0.2","jest-styled-components":"^7.0.2","nodemon":"^2.0.4","npm-run-all":"^4.1.5","prettier":"^2.0.5","start-server-and-test":"^1.11.2","test-data-bot":"^0.8.0","ts-jest":"^26.1.4","ts-loader":"^8.0.2","webpack":"^4.43.0","webpack-bundle-analyzer":"^4.4.0","webpack-cli":"^3.3.12","webpack-dev-server":"^3.11.0","webpack-merge":"^5.0.9"},"peerDependencies":{"@artisan-commerce/products":"*","@artisan-commerce/shopping-cart":"*"}}')},,function(t,e,r){"use strict";r.r(e),r.d(e,"initAnalytics",(function(){return _})),r.d(e,"Providers",(function(){return w})),r.d(e,"events",(function(){return tf})),r.d(e,"updateActiveVendor",(function(){return l}));var n=r(2),o=r(3),i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a={providers:[],activeVendor:void 0,vendors:void 0,shareArtisanAnalytics:!1,debug:!1,meta:{accountId:void 0,vendorId:void 0,vendorName:void 0,storeId:void 0,storeName:void 0,catalogueId:void 0,catalogueName:void 0,appName:void 0,platform:"web",versionApp:void 0,versionSDK:o.version}},u=function(){return Object(n.getState)()},c=function(t){return Object(n.setState)(t)},l=function(t){var e=typeof t;if("number"!==e&&"object"!==e&&"undefined"!==e)return d("The type of vendor must be a number or Vendor type","severe");var r=u();if("number"==typeof t||void 0===t)c(i(i({},r),{activeVendor:t,meta:i(i({},r.meta),{vendorName:void 0,vendorId:t})}));else{var n=t.id,o=t.name;c(i(i({},r),{activeVendor:n,meta:i(i({},r.meta),{vendorName:o,vendorId:n})}))}},s={GLOBAL_TRACKING_ID:"G-JZ7R91ZNMB"},f=function(){return(f=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},p=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},d=function(t,e){var r=u().debug,n="artisan-commerce/analytics";if("debug"!==e||r)switch(e){case"debug":console.log("%c(Debug) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"log":console.log("%c(Log) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"warn":console.warn("%c(Warning) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"error":console.error("%c(Error) %c"+n+":\n"+t,"font-weight: bold","font-weight: normal");break;case"severe":throw new Error(n+": \n"+t);default:throw new Error("Log message "+t+" of type "+e+" is not a supported type.")}},h=function(){function t(){this.initialized=!1,this._type="GOOGLE_ANALYTICS",this._name="__GLOBAL_PROVIDER__",this._trackingId=s.GLOBAL_TRACKING_ID,this._sampleRate=100,this._currency="USD"}return Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trackingId",{get:function(){return this._trackingId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sampleRate",{get:function(){return this._sampleRate},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"language",{get:function(){return this._language},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),Object.defineProperty(t,"instance",{get:function(){return t._instance},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vendors",{get:function(){var t,e=u().vendors;return null!==(t=this._vendors)&&void 0!==t?t:e},enumerable:!1,configurable:!0}),t.prototype.setVendors=function(t){this._vendors=t},t.prototype.init=function(){if("undefined"!=typeof window){if(this.initialized)return d("Provider "+this._name+" was already initialized. Do not call init unless you know what you are doing.","severe");this.initialized=!0;var t=document.createElement("script");t.setAttribute("async","true"),t.setAttribute("src","https://www.googletagmanager.com/gtag/js?id="+this._trackingId);var e=document.createElement("script");e.innerText="window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '"+this._trackingId+"', {'send_page_view': "+!1+"});gtag('event', 'page_view')",document.body.appendChild(t),document.body.appendChild(e)}},t.prototype.updateConfig=function(t){void 0===t&&(t={});var e=Object.entries(t).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),r=t.userId,n=t.currency,o=t.language;e.includes("userId")&&(this._userId=r),e.includes("currency")&&(this._currency=n),e.includes("language")&&(this._language=o),gtag("set",this._trackingId,t)},t._instance=new t,t}(),y=function(){function t(t){this.initialized=!1;var e=t.type,r=t.name,n=t.trackingId,o=t.vendors;this.type=e,this.name=r,this.trackingId=n,this._vendors=o}return Object.defineProperty(t.prototype,"vendors",{get:function(){var t,e=u().vendors;return null!==(t=this._vendors)&&void 0!==t?t:e},enumerable:!1,configurable:!0}),t.prototype.init=function(){if("undefined"!=typeof window)return this.initialized?d("Provider "+this.name+" was already initialized. Do not call init unless you know what you are doing.","severe"):void(this.initialized=!0)},t.prototype.updateConfig=function(t){!function(t,e){if(t.trackingId!==s.GLOBAL_TRACKING_ID){var r=Object.entries(e).reduce((function(t,e,r){var n=e[0],o=e[1];return 0===r?n+": "+o:t+"\n"+n+": "+o}),"");d(t.name+" config updated for the following fields.\n "+r,"debug")}}(this,t),h.instance.updateConfig(t)},t}(),g=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),b=function(){return(b=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},v=function(t){function e(e){var r=this,n=e.version,o=e.currency;return(r=t.call(this,b(b({},e),{type:"FACEBOOK_PIXEL"}))||this)._version=null!=n?n:"10.0",r._currency=null!=o?o:"USD",r}return g(e,t),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),e.prototype.init=function(){t.prototype.init.call(this);var e=document.createElement("script");e.innerText="!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='"+this.version+"';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js');fbq('init', '"+this.trackingId+"');fbq('trackSingle', '"+this.trackingId+"', 'PageView');";var r=document.createElement("noscript");r.innerHTML='\n <img height="1" width="1" style="display:none" \n src="https://www.facebook.com/tr?id={'+this.trackingId+'}&noscript=1"/>\n ',document.body.appendChild(e),document.body.appendChild(r)},e.prototype.updateConfig=function(e){void 0===e&&(e={});var r=Object.entries(e).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),n=e.currency;r.includes("currency")&&(this._currency=n),t.prototype.updateConfig.call(this,e)},e}(y),O=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),m=function(){return(m=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},w={FacebookPixel:v,GoogleAnalytics:function(t){function e(e){var r=t.call(this,m(m({},e),{type:"GOOGLE_ANALYTICS"}))||this,n=e.userId,o=e.currency,i=e.language,a=e.sampleRate;return r._sampleRate=a,r._userId=n,r._language=i,r._currency=null!=o?o:"USD",r}return O(e,t),Object.defineProperty(e.prototype,"sampleRate",{get:function(){return this._sampleRate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._userId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"language",{get:function(){return this._language},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currency",{get:function(){return this._currency},enumerable:!1,configurable:!0}),e.prototype.init=function(){t.prototype.init.call(this);var e=document.createElement("script");e.setAttribute("async","true"),e.setAttribute("src","https://www.googletagmanager.com/gtag/js?id="+this.trackingId);var r=document.createElement("script");r.innerText="window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '"+this.trackingId+"', {'send_page_view': "+!1+"});gtag('event', 'page_view')",document.body.appendChild(e),document.body.appendChild(r)},e.prototype.updateConfig=function(e){void 0===e&&(e={});var r=Object.entries(e).filter((function(t){return void 0!==t[1]})).map((function(t){return t[0]})),n=e.userId,o=e.currency,i=e.language;r.includes("userId")&&(this._userId=n),r.includes("currency")&&(this._currency=o),r.includes("language")&&(this._language=i),gtag("set",this.trackingId,e),t.prototype.updateConfig.call(this,e)},e}(y)},P=function(){return(P=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},j=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},I=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},S=!1,_=function(t){if(S)d("initAnalytics has been called more than once. This behaviour will very likely result in unexpected outcomes so its call was skipped. Please make sure initAnalytics is only called once.","warn");else if(!("undefined"==typeof window)){S=!0,Object(n.initState)(a);var e=t.providers,r=t.shareArtisanAnalytics;if(!e.length)return d("At least one provider should be included but none were found","severe");if(!function(t){var e=t.map((function(t){return t.name}));return new Set(e).size===e.length}(e))return d("Providers names must be unique, check that no provider names are repeated","severe");if(!function(t){var e=t.map((function(t){return t.trackingId}));return new Set(e).size===e.length}(e))return d("Providers trackerId must be unique, check that no provider trackerId are repeated","severe");var i=t.meta,u=j(t,["meta"]),l=r?I([h.instance],e):e,s=P(P({},u),{providers:l,meta:P(P({},i),{vendorId:u.activeVendor,platform:"web",versionSDK:o.version})});c(s),e.forEach((function(t){var e=t.vendors,r=t.name;e||d("The provider "+r+" has no set vendors, as a result no events will be skipped for this provider","debug")}));var f,p={};l.forEach((function(t){p=P(P({},p),t),t.init()})),f=(null==(f=l.reduce((function(t,e){return e.vendors?I(I([],t),e.vendors):t}),[]))?void 0:f.length)?f:void 0,h.instance.updateConfig(p),h.instance.setVendors(f)}};var A=function(){return(A=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.create;Object.create;function E(t){return t.toLowerCase()}var k=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],x=/[^A-Z0-9]+/gi;function T(t,e,r){return e instanceof RegExp?t.replace(e,r):e.reduce((function(t,e){return t.replace(e,r)}),t)}function C(t,e){return void 0===e&&(e={}),function(t,e){void 0===e&&(e={});for(var r=e.splitRegexp,n=void 0===r?k:r,o=e.stripRegexp,i=void 0===o?x:o,a=e.transform,u=void 0===a?E:a,c=e.delimiter,l=void 0===c?" ":c,s=T(T(t,n,"$1\0$2"),i,"\0"),f=0,p=s.length;"\0"===s.charAt(f);)f++;for(;"\0"===s.charAt(p-1);)p--;return s.slice(f,p).split("\0").map(u).join(l)}(t,A({delimiter:"."},e))}var R=function(){return(R=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},B=function(t){return Object.entries(t).reduce((function(t,e){var r,n,o=e[0],i=e[1],a=(void 0===n&&(n={}),C(o,A({delimiter:"_"},n)));return R(R({},t),((r={})[a]=i,r))}),{})},U=function(){return(U=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},M=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},D=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=M(e,["callback","userId"]),c=null!=i?i:n,l=U(U({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","change_password_attempt",U(U({send_to:r,event_callback:o},s),p))},Y=function(){return(Y=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},L=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},N=function(t,e){var r=t.trackingId,n=L(e,[]);delete n.userId;var o=Y({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ChangePasswordAttempt",Y(Y({},i),c))},H=r(1),q=r(0),F=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},z=function(t,e){var r=e.vendors,n=u().activeVendor;return-1!==n&&(void 0!==r&&((!n||!r.includes(n))&&(void 0===n?d("No active vendor is set. Please make sure you configure an active vendor before trying to emit an event","warn"):function(t,e){var r=u().activeVendor;e.trackingId!==s.GLOBAL_TRACKING_ID&&d("Skipping vendor "+r+" for event "+t+" of provider "+e.name+" as configured","debug")}(t,e),!0)))},V=function(t){if(!t.length)return d("No providers found, the initAnalytics probably hasn't been run yet","severe"),!1;var e=function(t){var e=new Set(t.map((function(t){return t.type})));return Array.from(e).reduce((function(t,e){switch(e){case"GOOGLE_ANALYTICS":if("undefined"==typeof gtag)return F(F([],t),[e]);break;case"FACEBOOK_PIXEL":if("undefined"==typeof fbq)return F(F([],t),[e]);break;default:throw new Error("Profiver of type "+e+" is not supported")}return t}),[])}(t);return!e.length||(e.forEach((function(t){!function(t){d(t+" SDK not initialized. Please make sure the SDK is initialized before trying to emit an event","severe")}(t)})),!1)},G=function(){return(G=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$=function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},W=function(t,e,r){var n=r.facebookPixelHandler,o=r.googleAnalyticsHandler,i=u().providers;if(V(i)){var a=G(G({},e),{artisanEvent:t}),c=i.reduce((function(e,r){if(z(t,r))return e;switch(r.type){case"FACEBOOK_PIXEL":n(r,a);break;case"GOOGLE_ANALYTICS":o(r,a);break;default:throw new Error("Provider of type "+r.type+" is not supported")}return $($([],e),[r])}),[]);!function(t,e){var r=e.reduce((function(t,e){var r,n;if(e.trackingId===s.GLOBAL_TRACKING_ID)return t;var o=e.name,i=e.type,a=null!==(n=t[i])&&void 0!==n?n:[];return f(f({},t),((r={})[i]=p(p([],a),[o]),r))}),{}),n=Object.entries(r).reduce((function(t,e){var r=e[0],n=e[1];return""+t+(r.charAt(0).toUpperCase()+r.slice(1))+": "+n.join(", ")+"\n"}),"");d("Event "+t+" was successfully sent to the following providers "+n,"debug")}(t,c)}},K=function(t){return Object(H.getShoppingCartProducts)(t).map((function(t){return t.productId}))},J=function(t){return Object(H.getShoppingCartProducts)(t).map((function(t){return Q(t)}))},Q=function(t){var e=Object(q.getProductTotals)(t);return t.name+":"+e.netPrice},Z=function(t,e){return Object(H.getShoppingCartProducts)(t).map((function(t){return X(t,e)}))},X=function(t,e){var r=Object(q.getProductTotals)(t);return{item_id:t.productId,item_name:t.name,quantity:t.amount,price:r.netPrice,currency:e}},tt=function(t){W("changePasswordAttempt",t,{googleAnalyticsHandler:D,facebookPixelHandler:N})},et=function(){return(et=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},rt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},nt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=rt(e,["callback","userId"]),c=null!=i?i:n,l=et(et({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","sign_up_attempt",et(et({send_to:r,event_callback:o},s),p))},ot=function(){return(ot=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},it=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},at=function(t,e){var r=t.trackingId,n=it(e,[]);delete n.userId;var o=ot({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SignUpAttempt",ot(ot({},i),c))},ut=function(t){W("signUpAttempt",t,{googleAnalyticsHandler:nt,facebookPixelHandler:at})},ct=function(){return(ct=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},lt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},st=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=lt(e,["callback","userId"]),c=null!=i?i:n,l=ct(ct({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","change_password_fail",ct(ct({send_to:r,event_callback:o},s),p))},ft=function(){return(ft=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},pt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},dt=function(t,e){var r=t.trackingId,n=pt(e,[]);delete n.userId;var o=ft({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ChangePasswordFail",ft(ft({},i),c))},ht=function(t){W("changePasswordFail",t,{googleAnalyticsHandler:st,facebookPixelHandler:dt})},yt=function(){return(yt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=gt(e,["callback","userId"]),c=null!=i?i:n,l=yt(yt({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","change_password_success",yt(yt({send_to:r,event_callback:o},s),p))},vt=function(){return(vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ot=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},mt=function(t,e){var r=t.trackingId,n=Ot(e,[]);delete n.userId;var o=vt({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ChangePasswordSuccess",vt(vt({},i),c))},wt=function(t){W("changePasswordSuccess",t,{googleAnalyticsHandler:bt,facebookPixelHandler:mt})},Pt=function(){return(Pt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},It=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=jt(e,["callback","userId"]),c=null!=i?i:n,l=Pt(Pt({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","login",Pt(Pt({send_to:r,event_callback:o},s),p))},St=function(){return(St=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_t=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},At=function(t,e){var r=t.trackingId,n=_t(e,[]);delete n.userId;var o=St({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SignIn",St(St({},i),c))},Et=function(t){W("signIn",t,{googleAnalyticsHandler:It,facebookPixelHandler:At})},kt=function(){return(kt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Tt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=xt(e,["callback","userId"]),c=null!=i?i:n,l=kt(kt({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","sign_out",kt(kt({send_to:r,event_callback:o},s),p))},Ct=function(){return(Ct=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Rt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Bt=function(t,e){var r=t.trackingId,n=Rt(e,[]);delete n.userId;var o=Ct({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SignOut",Ct(Ct({},i),c))},Ut=function(t){W("signOut",t,{googleAnalyticsHandler:Tt,facebookPixelHandler:Bt})},Mt=function(){return(Mt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yt=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Dt(e,["callback","userId"]),c=null!=i?i:n,l=Mt(Mt({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","sign_up",Mt(Mt({send_to:r,event_callback:o},s),p))},Lt=function(){return(Lt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ht=function(t,e){var r=t.trackingId,n=Nt(e,[]);delete n.userId;var o=Lt({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingle",r,"CompleteRegistration",Lt(Lt({},i),c))},qt=function(t){W("signUp",t,{googleAnalyticsHandler:Yt,facebookPixelHandler:Ht})},Ft={logChangePasswordAttempt:tt,logSignUpAttempt:ut,logChangePasswordFail:ht,logChangePasswordSuccess:wt,logSignIn:Et,logSignOut:Ut,logSignUp:qt},zt=Ft,Vt=function(){return(Vt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$t=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Gt(e,["callback","userId"]),c=null!=i?i:n,l=Vt(Vt({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","banner_impression",Vt(Vt({send_to:r,event_callback:o},s),p))},Wt=function(){return(Wt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jt=function(t,e){var r=t.trackingId,n=Kt(e,[]);delete n.userId;var o=Wt({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"BannerImpression",Wt(Wt({},i),c))},Qt=function(t){W("bannerImpression",t,{googleAnalyticsHandler:$t,facebookPixelHandler:Jt})},Zt=function(){return(Zt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},te=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Xt(e,["callback","userId"]),c=null!=i?i:n,l=Zt(Zt({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","select_content",Zt(Zt({send_to:r,event_callback:o,content_type:"banner"},s),p))},ee=function(){return(ee=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},re=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ne=function(t,e){var r=t.trackingId,n=re(e,[]);delete n.userId;var o=ee({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SelectBanner",ee(ee({},i),c))},oe=function(t){W("selectBanner",t,{googleAnalyticsHandler:te,facebookPixelHandler:ne})},ie={logBannerImpression:Qt,logSelectBanner:oe},ae=ie,ue=function(){return(ue=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ce=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},le=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=ce(e,["callback","userId"]),c=null!=i?i:n,l=ue(ue({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","add_billing_info",ue(ue({send_to:r,event_callback:o},s),p))},se=function(){return(se=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},pe=function(t,e){var r=t.trackingId,n=fe(e,[]);delete n.userId;var o=se({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"AddBillingInfo",se(se({},i),c))},de=function(t){W("addBillingInfo",t,{googleAnalyticsHandler:le,facebookPixelHandler:pe})},he=function(){return(he=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ye=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ge=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=ye(e,["callback","userId"]),c=null!=i?i:n,l=he(he({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","select_billing_info",he(he({send_to:r,event_callback:o},s),p))},be=function(){return(be=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ve=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Oe=function(t,e){var r=t.trackingId,n=ve(e,[]);delete n.userId;var o=be({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SelectBillingInfo",be(be({},i),c))},me=function(t){W("selectBillingInfo",t,{googleAnalyticsHandler:ge,facebookPixelHandler:Oe})},we=function(){return(we=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Pe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},je=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Pe(e,["callback","userId"]),c=null!=i?i:n,l=we(we({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","update_billing_info",we(we({send_to:r,event_callback:o},s),p))},Ie=function(){return(Ie=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Se=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_e=function(t,e){var r=t.trackingId,n=Se(e,[]);delete n.userId;var o=Ie({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"UpdateBillingInfo",Ie(Ie({},i),c))},Ae=function(t){W("updateBillingInfo",t,{googleAnalyticsHandler:je,facebookPixelHandler:_e})},Ee={logAddBillingInfo:de,logSelectBillingInfo:me,logUpdateBillingInfo:Ae},ke=Ee,xe=function(){return(xe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Te=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ce=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Te(e,["callback","userId"]),c=null!=i?i:n,l=xe(xe({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","book_appointment",xe(xe({send_to:r,event_callback:o},s),p))},Re=function(){return(Re=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Be=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ue=function(t,e){var r=t.trackingId,n=Be(e,[]);delete n.userId;var o=Re({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingle",r,"Schedule",Re(Re({},i),c))},Me=function(t){W("bookAppointment",t,{googleAnalyticsHandler:Ce,facebookPixelHandler:Ue})},De={logBookAppointment:Me},Ye=De,Le=function(){return(Le=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ne=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},He=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.category,c=e.list,l=e.itemBrand,s=Ne(e,["callback","userId","category","list","itemBrand"]),f=e.position,p=[{item_brand:l,item_id:""+a.categoryId,item_list_name:c,item_name:a.name,index:f}],d=null!=i?i:n,h=Le(Le({},s),{userId:d}),y=B(h),g=u().meta,b=B(g);gtag("event","view_item_list",Le(Le({send_to:r,event_callback:o,item_list_name:c,items:p},y),b))},qe=function(){return(qe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fe=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ze=function(t,e){var r=t.trackingId,n=e.category,o=Fe(e,["category"]);delete o.userId;var i=n.categoryId,a=n.name,c=qe(qe({},o),{categoryId:i,categoryName:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"CategoryImpression",qe(qe({},l),f))},Ve=function(t){W("categoryImpression",t,{googleAnalyticsHandler:He,facebookPixelHandler:ze})},Ge=function(){return(Ge=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$e=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},We=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.query,c=$e(e,["callback","userId","query"]),l=null!=i?i:n,s=Ge(Ge({},c),{userId:l}),f=B(s),p=u().meta,d=B(p);gtag("event","search",Ge(Ge({send_to:r,event_callback:o,search_term:a},f),d))},Ke=function(){return(Ke=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Je=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Qe=function(t,e){var r=t.trackingId,n=e.query,o=Je(e,["query"]);delete o.userId;var i=Ke({},o),a=B(i),c=u().meta,l=B(c);fbq("trackSingle",r,"Search",Ke(Ke({search_string:n},a),l))},Ze=function(t){W("searchCategoryAttempt",t,{googleAnalyticsHandler:We,facebookPixelHandler:Qe})},Xe=function(){return(Xe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},tr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},er=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.category,c=tr(e,["callback","userId","category"]);c.contentType&&delete c.contentType;var l=a.categoryId,s=a.name,f=null!=i?i:n,p=Xe(Xe({},c),{userId:f,categoryId:l,categoryName:s}),d=B(p),h=u().meta,y=B(h);gtag("event","select_content",Xe(Xe({send_to:r,event_callback:o,content_type:"category"},d),y))},rr=function(){return(rr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},nr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},or=function(t,e){var r=t.trackingId,n=e.category,o=nr(e,["category"]);delete o.userId;var i=n.categoryId,a=n.name,c=rr(rr({},o),{categoryId:i,categoryName:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"SelectCategory",rr(rr({},l),f))},ir=function(t){W("selectCategory",t,{googleAnalyticsHandler:er,facebookPixelHandler:or})},ar=function(){return(ar=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ur=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cr=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.category,c=ur(e,["callback","userId","category"]),l=a.categoryId,s=a.name,f=null!=i?i:n,p=ar(ar({},c),{userId:f,categoryId:l,categoryName:s}),d=B(p),h=u().meta,y=B(h);gtag("event","view_cateogry",ar(ar({send_to:r,event_callback:o},d),y))},lr=function(){return(lr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fr=function(t,e){var r=t.trackingId,n=e.category,o=sr(e,["category"]);delete o.userId;var i=n.categoryId,a=n.name,c=lr(lr({},o),{categoryId:i,categoryName:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"ViewCategory",lr(lr({},l),f))},pr=function(t){W("viewCategory",t,{googleAnalyticsHandler:cr,facebookPixelHandler:fr})},dr={logCategoryImpression:Ve,logSearchCategoryAttempt:Ze,logSelectCategory:ir,logViewCategory:pr},hr=dr,yr=function(){return(yr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},br=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=gr(e,["callback","userId"]),l=null!=a?a:n,s=yr(yr({},c),{userId:l,currency:o}),f=B(s),p=u().meta,d=B(p);gtag("event","checkout_action",yr(yr({send_to:r,event_callback:i},f),d))},vr=function(){return(vr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Or=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},mr=function(t,e){var r=t.trackingId,n=Or(e,[]);delete n.userId;var o=vr({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"CheckoutAction",vr(vr({},i),c))},wr=function(t){W("checkoutAction",t,{googleAnalyticsHandler:br,facebookPixelHandler:mr})},Pr=function(){return(Pr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ir=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.shoppingCart,l=e.currency,s=jr(e,["callback","userId","shoppingCart","currency"]),f=null!=a?a:n,p=null!=l?l:o,d=Pr(Pr({},s),{userId:f,currency:p}),h=B(d),y=u().meta,g=B(y);gtag("event","begin_checkout",Pr(Pr({send_to:r,event_callback:i,items:Z(c,p),value:Object(H.getShoppingCartTotal)(c).total},h),g))},Sr=function(){return(Sr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_r=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ar=function(t,e){var r=t.trackingId,n=t.currency,o=e.shoppingCart,i=e.currency,a=_r(e,["shoppingCart","currency"]);delete a.userId;var c=null!=i?i:n,l=Sr(Sr({},a),{currency:c}),s=B(l),f=u().meta,p=B(f),d=K(o);fbq("trackSingle",r,"InitiateCheckout",Sr(Sr({content_ids:d,contents:J(o),num_items:d.length,value:Object(H.getShoppingCartTotal)(o).total},s),p))},Er=function(t){W("initiateCheckout",t,{googleAnalyticsHandler:Ir,facebookPixelHandler:Ar})},kr={logCheckoutAction:wr,logInitiateCheckout:Er},xr=kr,Tr=function(){return(Tr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Cr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Rr=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=Cr(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=Tr(Tr({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","apply_benefit",Tr(Tr({send_to:r,event_callback:i},d),y))},Br=function(){return(Br=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ur=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Mr=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=Ur(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=Br(Br({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"ApplyBenefit",Br(Br({},l),f))},Dr=function(t){W("applyBenefit",t,{googleAnalyticsHandler:Rr,facebookPixelHandler:Mr})},Yr=function(){return(Yr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Lr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Nr=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=Lr(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=Yr(Yr({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","coupon_code_error",Yr(Yr({send_to:r,event_callback:i},d),y))},Hr=function(){return(Hr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Fr=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=qr(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=Hr(Hr({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"CouponCodeError",Hr(Hr({},l),f))},zr=function(t){W("couponCodeError",t,{googleAnalyticsHandler:Nr,facebookPixelHandler:Fr})},Vr=function(){return(Vr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$r=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Gr(e,["callback","userId"]),c=null!=i?i:n,l=Vr(Vr({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","redeem_coupon_code",Vr(Vr({send_to:r,event_callback:o},s),p))},Wr=function(){return(Wr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jr=function(t,e){var r=t.trackingId,n=Kr(e,[]);delete n.userId;var o=Wr({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"RedeemCouponCode",Wr(Wr({},i),c))},Qr=function(t){W("redeemCouponCode",t,{googleAnalyticsHandler:$r,facebookPixelHandler:Jr})},Zr=function(){return(Zr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},tn=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=Xr(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=Zr(Zr({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","remove_benefit",Zr(Zr({send_to:r,event_callback:i},d),y))},en=function(){return(en=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},rn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},nn=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=rn(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=en(en({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"RemoveBenefit",en(en({},l),f))},on=function(t){W("removeBenefit",t,{googleAnalyticsHandler:tn,facebookPixelHandler:nn})},an=function(){return(an=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},un=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cn=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=un(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=an(an({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","view_benefit_details",an(an({send_to:r,event_callback:i},d),y))},ln=function(){return(ln=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fn=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=sn(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=ln(ln({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"ViewBenefitDetails",ln(ln({},l),f))},pn=function(t){W("viewBenefitDetails",t,{googleAnalyticsHandler:cn,facebookPixelHandler:fn})},dn=function(){return(dn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},hn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yn=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=hn(e,["callback","userId"]),c=null!=i?i:n,l=dn(dn({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_benefits_wallet",dn(dn({send_to:r,event_callback:o},s),p))},gn=function(){return(gn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},bn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},vn=function(t,e){var r=t.trackingId,n=bn(e,[]);delete n.userId;var o=gn({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewBenefitsWallet",gn(gn({},i),c))},On=function(t){W("viewBenefitsWallet",t,{googleAnalyticsHandler:yn,facebookPixelHandler:vn})},mn=function(){return(mn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Pn=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=wn(e,["callback","userId"]),c=null!=i?i:n,l=mn(mn({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_qr_store_coupon",mn(mn({send_to:r,event_callback:o},s),p))},jn=function(){return(jn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},In=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Sn=function(t,e){var r=t.trackingId,n=In(e,[]);delete n.userId;var o=jn({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewQRStoreCoupon",jn(jn({},i),c))},_n=function(t){void 0===t&&(t={}),W("viewQRStoreCoupon",t,{googleAnalyticsHandler:Pn,facebookPixelHandler:Sn})},An={logApplyBenefit:Dr,logCouponCodeError:zr,logRedeemCouponCode:Qr,logRemoveBenefit:on,logViewBenefitDetails:pn,logViewBenefitsWallet:On,logViewQRStoreCoupon:_n},En=An,kn=function(){return(kn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Tn=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=e.amount,s=xn(e,["callback","userId","currency","amount"]),f=null!=a?a:n,p=null!=c?c:o,d=kn(kn({},s),{userId:f,currency:p,amount:l,value:l}),h=B(d),y=u().meta,g=B(y);gtag("event","add_credits",kn(kn({send_to:r,event_callback:i},h),g))},Cn=function(){return(Cn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Rn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Bn=function(t,e){var r=t.trackingId,n=t.currency,o=e.amount,i=e.currency,a=Rn(e,["amount","currency"]);delete a.userId;var c=null!=i?i:n,l=Cn(Cn({},a),{currency:c,amount:o,value:o}),s=B(l),f=u().meta,p=B(f);fbq("trackSingleCustom",r,"AddCredits",Cn(Cn({},s),p))},Un=function(t){W("addCredits",t,{googleAnalyticsHandler:Tn,facebookPixelHandler:Bn})},Mn=function(){return(Mn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yn=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=e.amount,s=Dn(e,["callback","userId","currency","amount"]),f=null!=a?a:n,p=null!=c?c:o,d=Mn(Mn({},s),{userId:f,currency:p,amount:l,value:l}),h=B(d),y=u().meta,g=B(y);gtag("event","spend_credits",Mn(Mn({send_to:r,event_callback:i},h),g))},Ln=function(){return(Ln=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Hn=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.amount,a=Nn(e,["currency","amount"]);delete a.userId;var c=null!=o?o:n,l=Ln(Ln({},a),{currency:c,amount:i,value:i}),s=B(l),f=u().meta,p=B(f);fbq("trackSingleCustom",r,"SpendCredits",Ln(Ln({},s),p))},qn=function(t){W("spendCredits",t,{googleAnalyticsHandler:Yn,facebookPixelHandler:Hn})},Fn=function(){return(Fn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},zn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Vn=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=zn(e,["callback","userId"]),c=null!=i?i:n,l=Fn(Fn({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_credits",Fn(Fn({send_to:r,event_callback:o},s),p))},Gn=function(){return(Gn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$n=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Wn=function(t,e){var r=t.trackingId,n=$n(e,[]);delete n.userId;var o=Gn({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewCredits",Gn(Gn({},i),c))},Kn=function(t){W("viewCredits",t,{googleAnalyticsHandler:Vn,facebookPixelHandler:Wn})},Jn={logAddCredits:Un,logSpendCredits:qn,logViewCredits:Kn},Qn=Jn,Zn=function(){return(Zn=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xn=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},to=function(t,e,r){var n=e.trackingId,o=e.userId,i=r.callback,a=r.userId,c=Xn(r,["callback","userId"]),l=null!=a?a:o,s=Zn(Zn({},c),{userId:l}),f=B(s),p=u().meta,d=B(p);gtag("event",t,Zn(Zn(Zn({send_to:n,event_callback:i},f),{artisan_event:"custom_event"}),d))},eo=function(){return(eo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ro=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},no=function(t,e,r){var n=e.trackingId,o=ro(r,[]);delete o.userId;var i=eo({},o),a=B(i),c=u().meta,l=B(c);fbq("trackSingleCustom",n,t,eo(eo(eo({},a),{artisan_event:"CustomEvent"}),l))},oo=function(t,e){void 0===e&&(e={}),W(t,e,{googleAnalyticsHandler:function(e,r){return to(t,e,r)},facebookPixelHandler:function(e,r){return no(t,e,r)}})},io=function(){return(io=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ao=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},uo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=ao(e,["callback","userId"]),c=null!=i?i:n,l=io(io({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_fulfillment_step",io(io({send_to:r,event_callback:o},s),p))},co=function(){return(co=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},lo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},so=function(t,e){var r=t.trackingId,n=lo(e,[]);delete n.userId;var o=co({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewFulfillmentStep",co(co({},i),c))},fo=function(t){W("viewFulfillmentStep",t,{googleAnalyticsHandler:uo,facebookPixelHandler:so})},po=function(){return(po=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ho=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},yo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=ho(e,["callback","userId"]),c=null!=i?i:n,l=po(po({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_tracking",po(po({send_to:r,event_callback:o},s),p))},go=function(){return(go=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},bo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},vo=function(t,e){var r=t.trackingId,n=bo(e,[]);delete n.userId;var o=go({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewTracking",go(go({},i),c))},Oo=function(t){W("viewTracking",t,{googleAnalyticsHandler:yo,facebookPixelHandler:vo})},mo={logViewFulfillmentStep:fo,logViewTracking:Oo},wo=mo,Po=function(){return(Po=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},jo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Io=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=jo(e,["callback","userId"]),c=null!=i?i:n,l=Po(Po({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","change_location",Po(Po({send_to:r,event_callback:o},s),p))},So=function(){return(So=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ao=function(t,e){var r=t.trackingId,n=_o(e,[]);delete n.userId;var o=So({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ChangeLocation",So(So({},i),c))},Eo=function(t){W("changeLocation",t,{googleAnalyticsHandler:Io,facebookPixelHandler:Ao})},ko=function(){return(ko=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},To=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=xo(e,["callback","userId"]),c=null!=i?i:n,l=ko(ko({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","find_location",ko(ko({send_to:r,event_callback:o},s),p))},Co=function(){return(Co=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ro=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Bo=function(t,e){var r=t.trackingId,n=Ro(e,[]);delete n.userId;var o=Co({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingle",r,"FindLocation",Co(Co({},i),c))},Uo=function(t){W("findLocation",t,{googleAnalyticsHandler:To,facebookPixelHandler:Bo})},Mo=function(){return(Mo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Do=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Do(e,["callback","userId"]),c=null!=i?i:n,l=Mo(Mo({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","out_of_coverage",Mo(Mo({send_to:r,event_callback:o},s),p))},Lo=function(){return(Lo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},No=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ho=function(t,e){var r=t.trackingId,n=No(e,[]);delete n.userId;var o=Lo({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"OutOfCoverage",Lo(Lo({},i),c))},qo=function(t){W("outOfCoverage",t,{googleAnalyticsHandler:Yo,facebookPixelHandler:Ho})},Fo=function(){return(Fo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},zo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Vo=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=zo(e,["callback","userId"]),c=null!=i?i:n,l=Fo(Fo({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","set_location",Fo(Fo({send_to:r,event_callback:o},s),p))},Go=function(){return(Go=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$o=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Wo=function(t,e){var r=t.trackingId,n=$o(e,[]);delete n.userId;var o=Go({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SetLocation",Go(Go({},i),c))},Ko=function(t){W("setLocation",t,{googleAnalyticsHandler:Vo,facebookPixelHandler:Wo})},Jo={logChangeLocation:Eo,logFindLocation:Uo,logOutOfCoverage:qo,logSetLocation:Ko},Qo=Jo,Zo=function(){return(Zo=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xo=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ti=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Xo(e,["callback","userId"]),c=null!=i?i:n,l=Zo(Zo({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","request_assistance",Zo(Zo({send_to:r,event_callback:o},s),p))},ei=function(){return(ei=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ri=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ni=function(t,e){var r=t.trackingId,n=ri(e,[]);delete n.userId;var o=ei({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingle",r,"Contact",ei(ei({},i),c))},oi=function(t){W("requestAssistance",t,{googleAnalyticsHandler:ti,facebookPixelHandler:ni})},ii={logRequestAssistance:oi},ai=ii,ui=function(){return(ui=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ci=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},li=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.currencyName,c=e.amount,l=ci(e,["callback","userId","currencyName","amount"]),s=null!=i?i:n,f=ui(ui({},l),{userId:s}),p=B(f),d=u().meta,h=B(d);gtag("event","earn_virtual_currency",ui(ui({send_to:r,event_callback:o,virtual_currency_name:a,value:c},p),h))},si=function(){return(si=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},fi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},pi=function(t,e){var r=t.trackingId,n=fi(e,[]);delete n.userId;var o=si({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"EarnPoints",si(si({},i),c))},di=function(t){W("earnPoints",t,{googleAnalyticsHandler:li,facebookPixelHandler:pi})},hi=function(){return(hi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},yi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},gi=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=yi(e,["callback","userId"]),c=null!=i?i:n,l=hi(hi({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","share_points",hi(hi({send_to:r,event_callback:o},s),p))},bi=function(){return(bi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},vi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Oi=function(t,e){var r=t.trackingId,n=vi(e,[]);delete n.userId;var o=bi({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SharePoints",bi(bi({},i),c))},mi=function(t){W("sharePoints",t,{googleAnalyticsHandler:gi,facebookPixelHandler:Oi})},wi=function(){return(wi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Pi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ji=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.currencyName,c=e.amount,l=Pi(e,["callback","userId","currencyName","amount"]),s=null!=i?i:n,f=wi(wi({},l),{userId:s}),p=B(f),d=u().meta,h=B(d);gtag("event","spend_virtual_currency",wi(wi({send_to:r,event_callback:o,virtual_currency_name:a,value:c},p),h))},Ii=function(){return(Ii=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Si=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_i=function(t,e){var r=t.trackingId,n=Si(e,[]);delete n.userId;var o=Ii({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SpendPoints",Ii(Ii({},i),c))},Ai=function(t){W("spendPoints",t,{googleAnalyticsHandler:ji,facebookPixelHandler:_i})},Ei=function(){return(Ei=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ki=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},xi=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=ki(e,["callback","userId"]),c=null!=i?i:n,l=Ei(Ei({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_loyalty_level",Ei(Ei({send_to:r,event_callback:o},s),p))},Ti=function(){return(Ti=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ci=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ri=function(t,e){var r=t.trackingId,n=Ci(e,[]);delete n.userId;var o=Ti({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewLoyaltyLevel",Ti(Ti({},i),c))},Bi=function(t){W("viewLoyaltyLevel",t,{googleAnalyticsHandler:xi,facebookPixelHandler:Ri})},Ui={logEarnPoints:di,logSharePoints:mi,logSpendPoints:Ai,logViewLoyaltyLevel:Bi},Mi=Ui,Di=function(){return(Di=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Yi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Li=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Yi(e,["callback","userId"]),c=null!=i?i:n,l=Di(Di({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","cancel_order",Di(Di({send_to:r,event_callback:o},s),p))},Ni=function(){return(Ni=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Hi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},qi=function(t,e){var r=t.trackingId,n=Hi(e,[]);delete n.userId;var o=Ni({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"CancelOrder",Ni(Ni({},i),c))},Fi=function(t){W("cancelOrder",t,{googleAnalyticsHandler:Li,facebookPixelHandler:qi})},zi=function(){return(zi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Gi=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Vi(e,["callback","userId"]),c=null!=i?i:n,l=zi(zi({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","rate_order",zi(zi({send_to:r,event_callback:o},s),p))},$i=function(){return($i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ki=function(t,e){var r=t.trackingId,n=e.maxScore,o=e.score,i=Wi(e,["maxScore","score"]);delete i.userId;var a=$i($i({},i),{maxScore:n,score:o}),c=B(a),l=u().meta,s=B(l);fbq("trackSingleCustom",r,"RateOrder",$i($i({max_rating_value:n,value:o},c),s))},Ji=function(t){W("rateOrder",t,{googleAnalyticsHandler:Gi,facebookPixelHandler:Ki})},Qi=function(){return(Qi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zi=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xi=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=e.orderId,s=e.orderTotal,f=Zi(e,["callback","userId","currency","orderId","orderTotal"]),p=null!=a?a:n,d=null!=c?c:o,h=Qi(Qi({},f),{userId:p,currency:d}),y=B(h),g=u().meta,b=B(g);gtag("event","refund",Qi(Qi({send_to:r,event_callback:i,transaction_id:l,value:s},y),b))},ta=function(){return(ta=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ea=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ra=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.orderTotal,a=ea(e,["currency","orderTotal"]);delete a.userId;var c=null!=o?o:n,l=ta(ta({},a),{currency:c}),s=B(l),f=u().meta,p=B(f);fbq("trackSingleCustom",r,"RequestRefund",ta(ta({value:i},s),p))},na=function(t){W("requestRefund",t,{googleAnalyticsHandler:Xi,facebookPixelHandler:ra})},oa={logCancelOrder:Fi,logRateOrder:Ji,logRequestRefund:na},ia=oa,aa=function(){return(aa=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ua=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ca=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=ua(e,["callback","userId"]),c=null!=i?i:n,l=aa(aa({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","generate_lead",aa(aa({send_to:r,event_callback:o},s),p))},la=function(){return(la=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fa=function(t,e){var r=t.trackingId,n=sa(e,[]);delete n.userId;var o=la({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingle",r,"Lead",la(la({},i),c))},pa=function(t){void 0===t&&(t={}),W("generateLead",t,{googleAnalyticsHandler:ca,facebookPixelHandler:fa})},da=function(){return(da=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ha=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ya=function(t,e){void 0===e&&(e={});var r=t.trackingId,n=ha(e,[]);delete n.userId;var o=da({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingle",r,"PageView",da(da({},i),c))},ga=function(){return(ga=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ba=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},va=function(t,e){void 0===e&&(e={});var r=t.trackingId,n=t.userId,o=e.pathname,i=e.name,a=e.callback,c=e.userId,l=ba(e,["pathname","name","callback","userId"]),s=null!=c?c:n,f=ga(ga({},l),{userId:s}),p=B(f),d=u().meta,h=B(d);gtag("event","page_view",ga(ga({page_title:i,page_path:o,send_to:r,event_callback:a},p),h))},Oa=function(t){W("pageView",t,{googleAnalyticsHandler:va,facebookPixelHandler:ya})},ma=function(){return(ma=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},wa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Pa=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.query,c=wa(e,["callback","userId","query"]),l=null!=i?i:n,s=ma(ma({},c),{userId:l}),f=B(s),p=u().meta,d=B(p);gtag("event","search",ma(ma({send_to:r,event_callback:o,search_term:a},f),d))},ja=function(){return(ja=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ia=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Sa=function(t,e){var r=t.trackingId,n=e.query,o=Ia(e,["query"]);delete o.userId;var i=ja({},o),a=B(i),c=u().meta,l=B(c);fbq("trackSingle",r,"Search",ja(ja({search_string:n},a),l))},_a=function(t){W("searchPageContent",t,{googleAnalyticsHandler:Pa,facebookPixelHandler:Sa})},Aa={logGenerateLead:pa,logPageView:Oa,logSearchPageContent:_a},Ea=Aa,ka=function(){return(ka=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ta=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=xa(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=ka(ka({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","change_payment_type",ka(ka({send_to:r,event_callback:i},d),y))},Ca=function(){return(Ca=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ra=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ba=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=Ra(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=Ca(Ca({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"ChangePaymentType",Ca(Ca({},l),f))},Ua=function(t){W("changePaymentType",t,{googleAnalyticsHandler:Ta,facebookPixelHandler:Ba})},Ma=function(){return(Ma=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Da=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ya=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=Da(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=Ma(Ma({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","select_payment_type",Ma(Ma({send_to:r,event_callback:i},d),y))},La=function(){return(La=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Na=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ha=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=Na(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=La(La({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"SelectPaymentType",La(La({},l),f))},qa=function(t){W("selectPaymentType",t,{googleAnalyticsHandler:Ya,facebookPixelHandler:Ha})},Fa=function(){return(Fa=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},za=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Va=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=za(e,["callback","userId","currency"]),s=null!=a?a:n,f=null!=c?c:o,p=Fa(Fa({},l),{userId:s,currency:f}),d=B(p),h=u().meta,y=B(h);gtag("event","add_payment_info",Fa(Fa({send_to:r,event_callback:i},d),y))},Ga=function(){return(Ga=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},$a=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Wa=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=$a(e,["currency"]);delete i.userId;var a=null!=o?o:n,c=Ga(Ga({},i),{currency:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingle",r,"AddPaymentInfo",Ga(Ga({success:1},l),f))},Ka=function(t){W("setPaymentInfo",t,{googleAnalyticsHandler:Va,facebookPixelHandler:Wa})},Ja={logChangePaymentType:Ua,logSelectPaymentType:qa,logSetPaymentInfo:Ka},Qa=Ja,Za=function(){return(Za=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Xa=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},tu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.product,c=Xa(e,["callback","userId","product"]),l=null!=i?i:n,s=a.productId,f=a.name,p=Za(Za({},c),{userId:l,productId:s,productName:f}),d=B(p),h=u().meta,y=B(h);gtag("event","customize_product",Za(Za({send_to:r,event_callback:o},d),y))},eu=function(){return(eu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ru=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},nu=function(t,e){var r=t.trackingId,n=e.product,o=ru(e,["product"]);delete o.userId;var i=n.productId,a=n.name,c=eu(eu({},o),{productId:i,productName:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingle",r,"CustomizeProduct",eu(eu({},l),f))},ou=function(t){W("customizeProduct",t,{googleAnalyticsHandler:tu,facebookPixelHandler:nu})},iu=function(){return(iu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},au=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},uu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=au(e,["callback","userId"]),c=null!=i?i:n,l=iu(iu({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","filter_products",iu(iu({send_to:r,event_callback:o},s),p))},cu=function(){return(cu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},lu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},su=function(t,e){var r=t.trackingId,n=lu(e,[]);delete n.userId;var o=cu({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"FilterProducts",cu(cu({},i),c))},fu=function(t){W("filterProducts",t,{googleAnalyticsHandler:uu,facebookPixelHandler:su})},pu=function(){return(pu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},du=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hu=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=du(e,["callback","userId","product","currency"]),f=null!=a?a:n,p=null!=l?l:o,d=c.productId,h=c.name,y=pu(pu({},s),{userId:f,productId:d,productName:h,currency:p}),g=Object(q.getProductTotals)(c),b=B(y),v=u().meta,O=B(v);gtag("event","product_impression",pu(pu({send_to:r,event_callback:i,value:g.netPrice},b),O))},yu=function(){return(yu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bu=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,a=gu(e,["product","currency"]);delete a.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=Object(q.getProductTotals)(o),p=yu(yu({},a),{productId:l,productName:s,currency:c}),d=B(p),h=u().meta,y=B(h);fbq("trackSingleCustom",r,"ProductImpression",yu(yu({value:f.netPrice},d),y))},vu=function(t){W("productImpression",t,{googleAnalyticsHandler:hu,facebookPixelHandler:bu})},Ou=function(){return(Ou=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},wu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=mu(e,["callback","userId"]),c=null!=i?i:n,l=Ou(Ou({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","search_product_success",Ou(Ou({send_to:r,event_callback:o},s),p))},Pu=function(){return(Pu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ju=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Iu=function(t,e){var r=t.trackingId,n=e.query,o=ju(e,["query"]);delete o.userId;var i=Pu({},o),a=B(i),c=u().meta,l=B(c);fbq("trackSingle",r,"Search",Pu(Pu({search_string:n,success:1},a),l))},Su=function(t){W("searchProductSuccess",t,{googleAnalyticsHandler:wu,facebookPixelHandler:Iu})},_u=function(){return(_u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Au=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Eu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.query,c=Au(e,["callback","userId","query"]),l=null!=i?i:n,s=_u(_u({},c),{userId:l}),f=B(s),p=u().meta,d=B(p);gtag("event","search",_u(_u({send_to:r,event_callback:o,search_term:a},f),d))},ku=function(){return(ku=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},xu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Tu=function(t,e){var r=t.trackingId,n=e.query,o=xu(e,["query"]);delete o.userId;var i=ku({},o),a=B(i),c=u().meta,l=B(c);fbq("trackSingle",r,"Search",ku(ku({search_string:n},a),l))},Cu=function(t){W("searchProductAttempt",t,{googleAnalyticsHandler:Eu,facebookPixelHandler:Tu})},Ru=function(){return(Ru=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Uu=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Bu(e,["callback","userId"]),c=null!=i?i:n,l=Ru(Ru({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","search_product_not_found",Ru(Ru({send_to:r,event_callback:o},s),p))},Mu=function(){return(Mu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Du=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yu=function(t,e){var r=t.trackingId,n=e.query,o=Du(e,["query"]);delete o.userId;var i=Mu({},o),a=B(i),c=u().meta,l=B(c);fbq("trackSingle",r,"Search",Mu(Mu({search_string:n,success:0},a),l))},Lu=function(t){W("searchProductNotFound",t,{googleAnalyticsHandler:Uu,facebookPixelHandler:Yu})},Nu=function(){return(Nu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Hu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},qu=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=Hu(e,["callback","userId","product","currency"]);s.contentType&&delete s.contentType;var f=null!=a?a:n,p=null!=l?l:o,d=c.productId,h=c.name,y=Nu(Nu({},s),{userId:f,productId:d,productName:h,currency:p}),g=Object(q.getProductTotals)(c),b=B(y),v=u().meta,O=B(v);gtag("event","select_content",Nu(Nu({send_to:r,event_callback:i,content_type:"product",value:g.netPrice},b),O))},Fu=function(){return(Fu=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},zu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Vu=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,a=zu(e,["product","currency"]);delete a.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=Object(q.getProductTotals)(o),p=Fu(Fu({},a),{productId:l,productName:s,currency:c}),d=B(p),h=u().meta,y=B(h);fbq("trackSingleCustom",r,"SelectProduct",Fu(Fu({value:f.netPrice},d),y))},Gu=function(t){W("selectProduct",t,{googleAnalyticsHandler:qu,facebookPixelHandler:Vu})},$u=function(){return($u=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Wu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ku=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Wu(e,["callback","userId"]),c=null!=i?i:n,l=$u($u({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","sort_products",$u($u({send_to:r,event_callback:o},s),p))},Ju=function(){return(Ju=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Qu=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Zu=function(t,e){var r=t.trackingId,n=Qu(e,[]);delete n.userId;var o=Ju({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SortProducts",Ju(Ju({},i),c))},Xu=function(t){W("sortProducts",t,{googleAnalyticsHandler:Ku,facebookPixelHandler:Zu})},tc=function(){return(tc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ec=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rc=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=ec(e,["callback","userId","product","currency"]),f=null!=a?a:n,p=null!=l?l:o,d=c.productId,h=c.name,y=tc(tc({},s),{userId:f,productId:d,productName:h,currency:p}),g=Object(q.getProductTotals)(c),b=B(y),v=u().meta,O=B(v);gtag("event","view_item",tc(tc({send_to:r,event_callback:i,value:g.netPrice},b),O))},nc=function(){return(nc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},oc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ic=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,a=oc(e,["product","currency"]);delete a.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=Object(q.getProductTotals)(o),p=nc(nc({},a),{productId:l,productName:s,currency:c}),d=B(p),h=u().meta,y=B(h);fbq("trackSingleCustom",r,"ViewProductDetails",nc(nc({value:f.netPrice},d),y))},ac=function(t){W("viewProductDetails",t,{googleAnalyticsHandler:rc,facebookPixelHandler:ic})},uc={logCustomizeProduct:ou,logFilterProducts:fu,logProductImpression:vu,logSearchProductSuccess:Su,logSearchProductAttempt:Cu,logSearchProductNotFound:Lu,logSelectProduct:Gu,logSortProducts:Xu,logViewProductDetails:ac},cc=uc,lc=function(){return(lc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fc=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=e.shoppingCart,s=sc(e,["callback","userId","currency","shoppingCart"]),f=null!=a?a:n,p=null!=c?c:o,d=lc(lc({},s),{userId:f,currency:p}),h=B(d),y=u().meta,g=B(y);gtag("event","purchase_attempt",lc(lc({send_to:r,event_callback:i,items:Z(l,p),value:Object(H.getShoppingCartTotal)(l).total},h),g))},pc=function(){return(pc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hc=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.shoppingCart,a=dc(e,["currency","shoppingCart"]);delete a.userId;var c=null!=o?o:n,l=pc(pc({},a),{currency:c}),s=B(l),f=u().meta,p=B(f),d=K(i);fbq("trackSingleCustom",r,"PurchaseAttempt",pc(pc({content_ids:d,contents:J(i),num_items:d.length,value:Object(H.getShoppingCartTotal)(i).total},s),p))},yc=function(t){W("purchaseAttempt",t,{googleAnalyticsHandler:fc,facebookPixelHandler:hc})},gc=function(){return(gc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},bc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},vc=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=e.shoppingCart,s=bc(e,["callback","userId","currency","shoppingCart"]),f=null!=a?a:n,p=null!=c?c:o,d=gc(gc({},s),{userId:f,currency:p}),h=B(d),y=u().meta,g=B(y);gtag("event","purchase_fail",gc(gc({send_to:r,event_callback:i,items:Z(l,p),value:Object(H.getShoppingCartTotal)(l).total},h),g))},Oc=function(){return(Oc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},mc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},wc=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.shoppingCart,a=mc(e,["currency","shoppingCart"]);delete a.userId;var c=null!=o?o:n,l=Oc(Oc({},a),{currency:c}),s=B(l),f=u().meta,p=B(f),d=K(i);fbq("trackSingleCustom",r,"PurchaseFail",Oc(Oc({content_ids:d,contents:J(i),num_items:d.length,value:Object(H.getShoppingCartTotal)(i).total},s),p))},Pc=function(t){W("purchaseFail",t,{googleAnalyticsHandler:vc,facebookPixelHandler:wc})},jc=function(){return(jc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ic=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Sc=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.currency,l=e.shoppingCart,s=e.orderId,f=Ic(e,["callback","userId","currency","shoppingCart","orderId"]),p=null!=a?a:n,d=null!=c?c:o,h=jc(jc({},f),{userId:p,currency:d}),y=Object(H.getShoppingCartTotal)(l),g=y.total,b=y.shippingCost,v=y.totalTaxes,O=B(h),m=u().meta,w=B(m);gtag("event","purchase",jc(jc({send_to:r,event_callback:i,items:Z(l,d),value:g,transaction_id:s,shipping:b,tax:v},O),w))},_c=function(){return(_c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ac=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ec=function(t,e){var r=t.trackingId,n=t.currency,o=e.currency,i=e.shoppingCart,a=Ac(e,["currency","shoppingCart"]);delete a.userId;var c=null!=o?o:n,l=_c(_c({},a),{currency:c}),s=B(l),f=u().meta,p=B(f),d=K(i);fbq("trackSingle",r,"Purchase",_c(_c({content_ids:d,contents:J(i),num_items:d.length,value:Object(H.getShoppingCartTotal)(i).total},s),p))},kc=function(t){W("purchaseSuccess",t,{googleAnalyticsHandler:Sc,facebookPixelHandler:Ec})},xc={logPurchaseAttempt:yc,logPurchaseFail:Pc,logPurchaseSuccess:kc},Tc=xc,Cc=function(){return(Cc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Rc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Bc=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Rc(e,["callback","userId"]),c=null!=i?i:n,l=Cc(Cc({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_settings",Cc(Cc({send_to:r,event_callback:o},s),p))},Uc=function(){return(Uc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Mc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Dc=function(t,e){var r=t.trackingId,n=Mc(e,[]);delete n.userId;var o=Uc({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewSettings",Uc(Uc({},i),c))},Yc=function(t){void 0===t&&(t={}),W("viewSettings",t,{googleAnalyticsHandler:Bc,facebookPixelHandler:Dc})},Lc={logViewSettings:Yc},Nc=Lc,Hc=function(){return(Hc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},qc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Fc=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=qc(e,["callback","userId"]),c=null!=i?i:n,l=Hc(Hc({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","add_shipping_info",Hc(Hc({send_to:r,event_callback:o},s),p))},zc=function(){return(zc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Vc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Gc=function(t,e){var r=t.trackingId,n=Vc(e,[]);delete n.userId;var o=zc({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"AddShippingAddress",zc(zc({},i),c))},$c=function(t){W("addShippingAddress",t,{googleAnalyticsHandler:Fc,facebookPixelHandler:Gc})},Wc=function(){return(Wc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jc=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Kc(e,["callback","userId"]),c=null!=i?i:n,l=Wc(Wc({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","select_shipping_address",Wc(Wc({send_to:r,event_callback:o},s),p))},Qc=function(){return(Qc=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zc=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xc=function(t,e){var r=t.trackingId,n=Zc(e,[]);delete n.userId;var o=Qc({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SelectShippingAddress",Qc(Qc({},i),c))},tl=function(){return(tl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},el=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rl=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=el(e,["callback","userId"]),c=null!=i?i:n,l=tl(tl({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","update_shipping_info",tl(tl({send_to:r,event_callback:o},s),p))},nl=function(){return(nl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ol=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},il=function(t,e){var r=t.trackingId,n=ol(e,[]);delete n.userId;var o=nl({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"UpdateShippingAddress",nl(nl({},i),c))},al=function(){return(al=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ul=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=e.store,f=ul(e,["callback","userId","product","currency","store"]),p=null!=a?a:n,d=null!=l?l:o,h=s.storeName,y=s.storeId,g=al(al({},f),{userId:p,storeId:y,storeName:h,currency:d}),b=Object(q.getProductTotals)(c),v=B(g),O=u().meta,m=B(O);gtag("event","add_to_cart",al(al({send_to:r,event_callback:i,items:[X(c,d)],value:b.netPrice},v),m))},ll=function(){return(ll=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},sl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.store,a=e.currency,c=sl(e,["product","store","currency"]);delete c.userId;var l=null!=a?a:n,s=o.productId,f=o.name,p=o.amount,d=i.storeName,h=i.storeId,y=ll(ll({},c),{storeId:h,storeName:d,amount:p,currency:l}),g=B(y),b=u().meta,v=B(b);fbq("trackSingle",r,"AddToCart",ll(ll({content_id:s,content_name:f,content:Q(o),value:Object(q.getProductTotals)(o).netPrice},g),v))},pl=function(){return(pl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},dl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=dl(e,["callback","userId","product","currency"]),f=null!=a?a:n,p=null!=l?l:o,d=pl(pl({},s),{userId:f,currency:p}),h=Object(q.getProductTotals)(c),y=B(d),g=u().meta,b=B(g);gtag("event","add_to_wishlist",pl(pl({send_to:r,event_callback:i,items:[X(c,p)],value:h.netPrice},y),b))},yl=function(){return(yl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,a=gl(e,["product","currency"]);delete a.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=o.amount,p=yl(yl({},a),{amount:f,currency:c}),d=B(p),h=u().meta,y=B(h);fbq("trackSingle",r,"AddToWishlist",yl(yl({content_id:l,content_name:s,content:Q(o),value:Object(q.getProductTotals)(o).netPrice},d),y))},vl=function(){return(vl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ol=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ml=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Ol(e,["callback","userId"]),c=null!=i?i:n,l=vl(vl({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","clear_cart",vl(vl({send_to:r,event_callback:o},s),p))},wl=function(){return(wl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Pl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},jl=function(t,e){var r=t.trackingId,n=Pl(e,[]);delete n.userId;var o=wl({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ClearCart",wl(wl({},i),c))},Il=function(){return(Il=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Sl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_l=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=e.store,f=Sl(e,["callback","userId","product","currency","store"]),p=null!=a?a:n,d=null!=l?l:o,h=c.productId,y=c.name,g=s.storeName,b=s.storeId,v=Il(Il({},f),{userId:p,productId:h,productName:y,storeId:b,storeName:g,currency:d}),O=Object(q.getProductTotals)(c),m=B(v),w=u().meta,P=B(w);gtag("event","remove_product_from_cart",Il(Il({send_to:r,event_callback:i,value:O.netPrice},m),P))},Al=function(){return(Al=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},El=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},kl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.store,a=e.currency,c=El(e,["product","store","currency"]);delete c.userId;var l=null!=a?a:n,s=o.productId,f=o.name,p=o.amount,d=i.storeName,h=i.storeId,y=Al(Al({},c),{storeId:h,storeName:d,amount:p,currency:l}),g=B(y),b=u().meta,v=B(b);fbq("trackSingleCustom",r,"RemoveProductFromCart",Al(Al({content_id:s,content_name:f,content:Q(o),value:Object(q.getProductTotals)(o).netPrice},g),v))},xl=function(){return(xl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Tl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Cl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=Tl(e,["callback","userId","product","currency"]),f=null!=a?a:n,p=null!=l?l:o,d=c.productId,h=c.name,y=xl(xl({},s),{userId:f,productId:d,productName:h,currency:p}),g=Object(q.getProductTotals)(c),b=B(y),v=u().meta,O=B(v);gtag("event","remove_product_from_wishlist",xl(xl({send_to:r,event_callback:i,value:g.netPrice},b),O))},Rl=function(){return(Rl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ul=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,a=Bl(e,["product","currency"]);delete a.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=o.amount,p=Rl(Rl({},a),{amount:f,currency:c}),d=B(p),h=u().meta,y=B(h);fbq("trackSingleCustom",r,"RemoveProductFromWishlist",Rl(Rl({content_id:l,content_name:s,content:Q(o),value:Object(q.getProductTotals)(o).netPrice},d),y))},Ml=function(){return(Ml=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Dl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Yl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=e.store,f=Dl(e,["callback","userId","product","currency","store"]),p=c.productId,d=c.name,h=null!=a?a:n,y=null!=l?l:o,g=s.storeName,b=s.storeId,v=Ml(Ml({},f),{userId:h,storeId:b,storeName:g,productId:p,productName:d,currency:y}),O=Object(q.getProductTotals)(c),m=B(v),w=u().meta,P=B(w);gtag("event","update_product_in_cart",Ml(Ml({send_to:r,event_callback:i,value:O.netPrice},m),P))},Ll=function(){return(Ll=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Nl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Hl=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.store,a=e.currency,c=Nl(e,["product","store","currency"]);delete c.userId;var l=null!=a?a:n,s=o.productId,f=o.name,p=o.amount,d=i.storeName,h=i.storeId,y=Ll(Ll({},c),{storeId:h,storeName:d,amount:p,currency:l}),g=B(y),b=u().meta,v=B(b);fbq("trackSingleCustom",r,"UpdateProductInCart",Ll(Ll({content_id:s,content_name:f,content:Q(o),value:Object(q.getProductTotals)(o).netPrice},g),v))},ql=function(){return(ql=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zl=function(t,e){var r=t.trackingId,n=t.userId,o=t.currency,i=e.callback,a=e.userId,c=e.product,l=e.currency,s=Fl(e,["callback","userId","product","currency"]),f=c.productId,p=c.name,d=null!=a?a:n,h=null!=l?l:o,y=ql(ql({},s),{userId:d,productId:f,productName:p,currency:h}),g=Object(q.getProductTotals)(c),b=B(y),v=u().meta,O=B(v);gtag("event","update_product_in_wishlist",ql(ql({send_to:r,event_callback:i,value:g.netPrice},b),O))},Vl=function(){return(Vl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$l=function(t,e){var r=t.trackingId,n=t.currency,o=e.product,i=e.currency,a=Gl(e,["product","currency"]);delete a.userId;var c=null!=i?i:n,l=o.productId,s=o.name,f=o.amount,p=Vl(Vl({},a),{amount:f,currency:c}),d=B(p),h=u().meta,y=B(h);fbq("trackSingleCustom",r,"UpdateProductInWishlist",Vl(Vl({content_id:l,content_name:s,content:Q(o),value:Object(q.getProductTotals)(o).netPrice},d),y))},Wl=function(){return(Wl=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Kl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Jl=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Kl(e,["callback","userId"]),c=null!=i?i:n,l=Wl(Wl({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","view_cart",Wl(Wl({send_to:r,event_callback:o},s),p))},Ql=function(){return(Ql=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zl=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xl=function(t,e){var r=t.trackingId,n=Zl(e,[]);delete n.userId;var o=Ql({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ViewCart",Ql(Ql({},i),c))},ts=function(){return(ts=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},es=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},rs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.shareTarget,c=e.itemId,l=es(e,["callback","userId","shareTarget","itemId"]),s=null!=i?i:n,f=ts(ts({},l),{userId:s}),p=B(f),d=u().meta,h=B(d);gtag("event","share",ts(ts({send_to:r,event_callback:o,method:a,content_id:c},p),h))},ns=function(){return(ns=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},os=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},is=function(t,e){var r=t.trackingId,n=os(e,[]);delete n.userId;var o=ns({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"Share",ns(ns({},i),c))},as=function(){return(as=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},us=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},cs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.previousStore,c=e.nextStore,l=us(e,["callback","userId","previousStore","nextStore"]),s=a.storeId,f=a.storeName,p=c.storeId,d=c.storeName,h=null!=i?i:n,y=as(as({},l),{userId:h,previousStoreId:s,previousStoreName:f,nextStoreId:p,nextStoreName:d}),g=B(y),b=u().meta,v=B(b);gtag("event","change_store",as(as({send_to:r,event_callback:o},g),v))},ls=function(){return(ls=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ss=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},fs=function(t,e){var r=t.trackingId,n=e.previousStore,o=e.nextStore,i=ss(e,["previousStore","nextStore"]);delete i.userId;var a=n.storeId,c=n.storeName,l=o.storeId,s=o.storeName,f=ls(ls({},i),{previousStoreId:a,previousStoreName:c,nextStoreId:l,nextStoreName:s}),p=B(f),d=u().meta,h=B(d);fbq("trackSingleCustom",r,"ChangeStore",ls(ls({},p),h))},ps=function(){return(ps=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},ds=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},hs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=e.store,c=ds(e,["callback","userId","store"]),l=a.storeId,s=a.storeName,f=null!=i?i:n,p=ps(ps({},c),{userId:f,storeId:l,storeName:s}),d=B(p),h=u().meta,y=B(h);gtag("event","set_store",ps(ps({send_to:r,event_callback:o},d),y))},ys=function(){return(ys=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},gs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},bs=function(t,e){var r=t.trackingId,n=e.store,o=gs(e,["store"]);delete o.userId;var i=n.storeId,a=n.storeName,c=ys(ys({},o),{storeId:i,storeName:a}),l=B(c),s=u().meta,f=B(s);fbq("trackSingleCustom",r,"SetStore",ys(ys({},l),f))},vs=function(){return(vs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Os=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ms=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Os(e,["callback","userId"]),c=null!=i?i:n,l=vs(vs({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","set_user_info",vs(vs({send_to:r,event_callback:o},s),p))},ws=function(){return(ws=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ps=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},js=function(t,e){var r=t.trackingId,n=Ps(e,[]);delete n.userId;var o=ws({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SetUserInfo",ws(ws({},i),c))},Is=function(){return(Is=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ss=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},_s=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Ss(e,["callback","userId"]),c=null!=i?i:n,l=Is(Is({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","update_user_info",Is(Is({send_to:r,event_callback:o},s),p))},As=function(){return(As=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Es=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},ks=function(t,e){var r=t.trackingId,n=Es(e,[]);delete n.userId;var o=As({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"UpdateUserInfo",As(As({},i),c))},xs=function(){return(xs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ts=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Cs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Ts(e,["callback","userId"]),c=null!=i?i:n,l=xs(xs({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","change_vendor",xs(xs({send_to:r,event_callback:o},s),p))},Rs=function(){return(Rs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Bs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Us=function(t,e){var r=t.trackingId,n=Bs(e,[]);delete n.userId;var o=Rs({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"ChangeVendor",Rs(Rs({},i),c))},Ms=function(){return(Ms=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ds=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Ys=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Ds(e,["callback","userId"]),c=null!=i?i:n,l=Ms(Ms({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","set_vendor",Ms(Ms({send_to:r,event_callback:o},s),p))},Ls=function(){return(Ls=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ns=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Hs=function(t,e){var r=t.trackingId,n=Ns(e,[]);delete n.userId;var o=Ls({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SetVendor",Ls(Ls({},i),c))},qs=function(){return(qs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Fs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},zs=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Fs(e,["callback","userId"]),c=null!=i?i:n,l=qs(qs({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","select_workflow",qs(qs({send_to:r,event_callback:o},s),p))},Vs=function(){return(Vs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Gs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},$s=function(t,e){var r=t.trackingId,n=Gs(e,[]);delete n.userId;var o=Vs({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"SelectWorkflow",Vs(Vs({},i),c))},Ws=function(){return(Ws=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Ks=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Js=function(t,e){var r=t.trackingId,n=t.userId,o=e.callback,i=e.userId,a=Ks(e,["callback","userId"]),c=null!=i?i:n,l=Ws(Ws({},a),{userId:c}),s=B(l),f=u().meta,p=B(f);gtag("event","update_workflow",Ws(Ws({send_to:r,event_callback:o},s),p))},Qs=function(){return(Qs=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Zs=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r},Xs=function(t,e){var r=t.trackingId,n=Zs(e,[]);delete n.userId;var o=Qs({},n),i=B(o),a=u().meta,c=B(a);fbq("trackSingleCustom",r,"UpdateWorkflow",Qs(Qs({},i),c))},tf={auth:zt,banner:ae,billing:ke,booking:Ye,category:hr,checkout:xr,coupon:En,credit:Qn,fulfillment:wo,geo:Qo,help:ai,logCustomEvent:oo,loyalty:Mi,order:ia,other:Ea,payment:Qa,product:cc,purchase:Tc,settings:Nc,shipping:{logAddShippingAddress:$c,logSelectShippingAddress:function(t){W("selectShippingAddress",t,{googleAnalyticsHandler:Jc,facebookPixelHandler:Xc})},logUpdateShippingAddress:function(t){W("updateShippingAddress",t,{googleAnalyticsHandler:rl,facebookPixelHandler:il})}},shoppingCart:{logAddProductToCart:function(t){W("addProductToCart",t,{googleAnalyticsHandler:cl,facebookPixelHandler:fl})},logAddProductToWishlist:function(t){W("addProductToWishlist",t,{googleAnalyticsHandler:hl,facebookPixelHandler:bl})},logClearCart:function(t){W("clearCart",t,{googleAnalyticsHandler:ml,facebookPixelHandler:jl})},logRemoveProductFromCart:function(t){W("removeProductFromCart",t,{googleAnalyticsHandler:_l,facebookPixelHandler:kl})},logRemoveProductFromWishlist:function(t){W("removeProductFromWishlist",t,{googleAnalyticsHandler:Cl,facebookPixelHandler:Ul})},logUpdateProductInCart:function(t){W("updateProductInCart",t,{googleAnalyticsHandler:Yl,facebookPixelHandler:Hl})},logUpdateProductInWishlist:function(t){W("updateProductInWishlist",t,{googleAnalyticsHandler:zl,facebookPixelHandler:$l})},logViewCart:function(t){W("viewCart",t,{googleAnalyticsHandler:Jl,facebookPixelHandler:Xl})}},social:{logShare:function(t){W("share",t,{googleAnalyticsHandler:rs,facebookPixelHandler:is})}},store:{logChangeStore:function(t){W("changeStore",t,{googleAnalyticsHandler:cs,facebookPixelHandler:fs})},logSetStore:function(t){W("setStore",t,{googleAnalyticsHandler:hs,facebookPixelHandler:bs})}},user:{logSetUserInfo:function(t){W("setUserInfo",t,{googleAnalyticsHandler:ms,facebookPixelHandler:js})},logUpdateUserInfo:function(t){W("updateUserInfo",t,{googleAnalyticsHandler:_s,facebookPixelHandler:ks})}},vendor:{logChangeVendor:function(t){W("changeVendor",t,{googleAnalyticsHandler:Cs,facebookPixelHandler:Us})},logSetVendor:function(t){W("setVendor",t,{googleAnalyticsHandler:Ys,facebookPixelHandler:Hs})}},workflow:{logSelectWorkflow:function(t){W("selectWorkflow",t,{googleAnalyticsHandler:zs,facebookPixelHandler:$s})},logUpdateWorkflow:function(t){W("updateWorkflow",t,{googleAnalyticsHandler:Js,facebookPixelHandler:Xs})}}}}])}));
|