document.sezzleButtonVersion = "sezzle-widget22.6.3.js";
document.sezzleCssVersionOverride = "sezzle-styles-global2.1.0.css";
document.widgetServerBaseUrl = "https://widget.sezzle.com";
document.geoIpBaseUrl = "https://geoip.sezzle.com";
document.sezzleDefaultModalVersion = "sezzle-modal-3.0.6.html";
document.sezzleModalAvailableLanguages = "en,fr,es";

// Sezzle's merchant widget config override
    document.sezzleConfig = {
        "configGroups": [
            {
                "targetXPath": window.innerWidth > 768 ? ".product-block/.modal_price/.price-ui/.price" : ".modal_price/.price-ui--loading/.price",
                "renderToPath": window.innerWidth > 768 ? ".." : "../..",
                "alignment": "left",
                "urlMatch": "product"
            },
            {
                "targetXPath": ".cart_subtotal/.right",
                "alignment": "center",
                "urlMatch": "cart"
            }
        ]
    }


if (document.sezzleConfig){
   document.sezzleConfig.merchantID = 'dcb04bae-adc9-4d7d-b719-ddb25940b62b';

   // Sezzle's merchant payment settings override

   // Sezzle's merchant local config override
   try {document.sezzleConfig = Object.assign(document.localSezzleConfig, document.sezzleConfig); } catch(e) {}
 }
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){var r=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new E(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return k()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function f(){}function d(){}function h(){}var m={};s(m,o,(function(){return this}));var p=Object.getPrototypeOf,g=p&&p(p(C([])));g&&g!==t&&n.call(g,o)&&(m=g);var y=h.prototype=f.prototype=Object.create(m);function v(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(o,i){function a(){return new t((function(r,a){!function r(o,i,a,s){var c=l(e[o],e,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function z(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(z,this),this.reset(!0)}function C(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=h,s(y,"constructor",h),s(h,"constructor",d),d.displayName=s(h,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,s(e,a,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},v(b.prototype),s(b.prototype,i,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new b(c(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(y),s(y,a,"Generator"),s(y,o,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=C,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;_(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(e,t,n){(function(e,n){var r="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",a="[object Map]",s="[object Set]",c=/\w*$/,l=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,f={};f[r]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object DataView]"]=f["[object Boolean]"]=f["[object Date]"]=f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f[a]=f["[object Number]"]=f["[object Object]"]=f["[object RegExp]"]=f[s]=f["[object String]"]=f["[object Symbol]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f["[object Error]"]=f[o]=f["[object WeakMap]"]=!1;var d="object"==typeof e&&e&&e.Object===Object&&e,h="object"==typeof self&&self&&self.Object===Object&&self,m=d||h||Function("return this")(),p=t&&!t.nodeType&&t,g=p&&"object"==typeof n&&n&&!n.nodeType&&n,y=g&&g.exports===p;function v(e,t){return e.set(t[0],t[1]),e}function b(e,t){return e.add(t),e}function w(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function z(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function _(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function E(e,t){return function(n){return e(t(n))}}function C(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var k,P=Array.prototype,x=Function.prototype,S=Object.prototype,T=m["__core-js_shared__"],L=(k=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"",O=x.toString,j=S.hasOwnProperty,A=S.toString,M=RegExp("^"+O.call(j).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),N=y?m.Buffer:void 0,W=m.Symbol,F=m.Uint8Array,I=E(Object.getPrototypeOf,Object),D=Object.create,B=S.propertyIsEnumerable,G=P.splice,R=Object.getOwnPropertySymbols,U=N?N.isBuffer:void 0,q=E(Object.keys,Object),H=ge(m,"DataView"),V=ge(m,"Map"),$=ge(m,"Promise"),X=ge(m,"Set"),J=ge(m,"WeakMap"),K=ge(Object,"create"),Y=ze(H),Z=ze(V),Q=ze($),ee=ze(X),te=ze(J),ne=W?W.prototype:void 0,re=ne?ne.valueOf:void 0;function oe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function se(e){this.__data__=new ie(e)}function ce(e,t){var n=Ee(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ce(e)}(e)&&j.call(e,"callee")&&(!B.call(e,"callee")||A.call(e)==r)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],o=n.length,i=!!o;for(var a in e)!t&&!j.call(e,a)||i&&("length"==a||be(a,o))||n.push(a);return n}function le(e,t,n){var r=e[t];j.call(e,t)&&_e(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function ue(e,t){for(var n=e.length;n--;)if(_e(e[n][0],t))return n;return-1}function fe(e,t,n,l,u,d,h){var m;if(l&&(m=d?l(e,u,d,h):l(e)),void 0!==m)return m;if(!xe(e))return e;var p=Ee(e);if(p){if(m=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&j.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(e,m)}else{var g=ve(e),y=g==o||g==i;if(ke(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if("[object Object]"==g||g==r||y&&!d){if(z(e))return d?e:{};if(m=function(e){return"function"!=typeof e.constructor||we(e)?{}:(t=I(e),xe(t)?D(t):{});var t}(y?{}:e),!t)return function(e,t){return me(e,ye(e),t)}(e,function(e,t){return e&&me(t,Se(t),e)}(m,e))}else{if(!f[g])return d?e:{};m=function(e,t,n,r){var o=e.constructor;switch(t){case"[object ArrayBuffer]":return he(e);case"[object Boolean]":case"[object Date]":return new o(+e);case"[object DataView]":return function(e,t){var n=t?he(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?he(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case a:return function(e,t,n){return w(t?n(_(e),!0):_(e),v,new e.constructor)}(e,r,n);case"[object Number]":case"[object String]":return new o(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,c.exec(e));return t.lastIndex=e.lastIndex,t}(e);case s:return function(e,t,n){return w(t?n(C(e),!0):C(e),b,new e.constructor)}(e,r,n);case"[object Symbol]":return i=e,re?Object(re.call(i)):{}}var i}(e,g,fe,t)}}h||(h=new se);var E=h.get(e);if(E)return E;if(h.set(e,m),!p)var k=n?function(e){return function(e,t,n){var r=t(e);return Ee(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Se,ye)}(e):Se(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n,e););}(k||e,(function(r,o){k&&(r=e[o=r]),le(m,o,fe(r,t,n,l,o,e,h))})),m}function de(e){return!(!xe(e)||(t=e,L&&L in t))&&(Pe(e)||z(e)?M:l).test(ze(e));var t}function he(e){var t=new e.constructor(e.byteLength);return new F(t).set(new F(e)),t}function me(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],s=r?r(n[a],e[a],a,n,e):void 0;le(n,a,void 0===s?e[a]:s)}return n}function pe(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ge(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return de(n)?n:void 0}oe.prototype.clear=function(){this.__data__=K?K(null):{}},oe.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},oe.prototype.get=function(e){var t=this.__data__;if(K){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return j.call(t,e)?t[e]:void 0},oe.prototype.has=function(e){var t=this.__data__;return K?void 0!==t[e]:j.call(t,e)},oe.prototype.set=function(e,t){return this.__data__[e]=K&&void 0===t?"__lodash_hash_undefined__":t,this},ie.prototype.clear=function(){this.__data__=[]},ie.prototype.delete=function(e){var t=this.__data__,n=ue(t,e);return!(n<0)&&(n==t.length-1?t.pop():G.call(t,n,1),!0)},ie.prototype.get=function(e){var t=this.__data__,n=ue(t,e);return n<0?void 0:t[n][1]},ie.prototype.has=function(e){return ue(this.__data__,e)>-1},ie.prototype.set=function(e,t){var n=this.__data__,r=ue(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},ae.prototype.clear=function(){this.__data__={hash:new oe,map:new(V||ie),string:new oe}},ae.prototype.delete=function(e){return pe(this,e).delete(e)},ae.prototype.get=function(e){return pe(this,e).get(e)},ae.prototype.has=function(e){return pe(this,e).has(e)},ae.prototype.set=function(e,t){return pe(this,e).set(e,t),this},se.prototype.clear=function(){this.__data__=new ie},se.prototype.delete=function(e){return this.__data__.delete(e)},se.prototype.get=function(e){return this.__data__.get(e)},se.prototype.has=function(e){return this.__data__.has(e)},se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ie){var r=n.__data__;if(!V||r.length<199)return r.push([e,t]),this;n=this.__data__=new ae(r)}return n.set(e,t),this};var ye=R?E(R,Object):function(){return[]},ve=function(e){return A.call(e)};function be(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||u.test(e))&&e>-1&&e%1==0&&e<t}function we(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||S)}function ze(e){if(null!=e){try{return O.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function _e(e,t){return e===t||e!=e&&t!=t}(H&&"[object DataView]"!=ve(new H(new ArrayBuffer(1)))||V&&ve(new V)!=a||$&&"[object Promise]"!=ve($.resolve())||X&&ve(new X)!=s||J&&"[object WeakMap]"!=ve(new J))&&(ve=function(e){var t=A.call(e),n="[object Object]"==t?e.constructor:void 0,r=n?ze(n):void 0;if(r)switch(r){case Y:return"[object DataView]";case Z:return a;case Q:return"[object Promise]";case ee:return s;case te:return"[object WeakMap]"}return t});var Ee=Array.isArray;function Ce(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!Pe(e)}var ke=U||function(){return!1};function Pe(e){var t=xe(e)?A.call(e):"";return t==o||t==i}function xe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Se(e){return Ce(e)?ce(e):function(e){if(!we(e))return q(e);var t=[];for(var n in Object(e))j.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}n.exports=function(e){return fe(e,!0,!0)}}).call(this,n(2),n(3)(e))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";n.r(t);n(0);function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var o=document.widgetServerBaseUrl?"".concat(document.widgetServerBaseUrl,"/v1/event/log"):"http://widget.sezzle.com/v1/event/log",i=["afterpay-paragraph","affirm-as-low-as","qp-widget-container"],a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,a;return t=e,a=[{key:"httpRequestWrapper",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new Promise((function(r,o){var i=new XMLHttpRequest;i.open(e,t,!0),null!==n&&i.setRequestHeader("Content-Type","application/json"),i.onload=function(){this.status>=200&&this.status<300?r(i.response):o(new Error("An error occurred when calling ".concat(t,". Status code: ").concat(this.status,"; Response text: ").concat(i.responseText)))},i.onerror=function(e){var n="";n=e instanceof ErrorEvent?"An error occurred when calling ".concat(t,". Error message: ").concat(e.message,"; Filename: ").concat(e.filename,"; Line#: ").concat(e.lineno):"An error occurred when calling ".concat(t,". Error type: ").concat(e.type),o(new Error(n))},null===n?i.send():i.send(JSON.stringify(n))}))}},{key:"_getCookie",value:function(e){var t=";".concat(document.cookie).split(";".concat(e,"="));if(2===t.length)return t.pop().split(";").shift()}},{key:"isWidgetDuplicateFound",value:function(){return document.getElementsByClassName("sezzle-shopify-info-button").length>1}},{key:"isCompetitorWidgetFound",value:function(){var e=0;return Array.prototype.forEach.call(i,(function(t){document.getElementsByClassName(t).length&&e++})),e>0}},{key:"sendEvents",value:function(e){this.httpRequestWrapper("post",o,e)}},{key:"breakXPath",value:function(e){return e.split("/").filter((function(e){return""!==e}))}},{key:"getWidgetBaseUrl",value:function(){return document.widgetServerBaseUrl||"https://widget.sezzle.com"}},{key:"predictBackgroundTheme",value:function(){var e,t,n,r=window.getComputedStyle(document.body).getPropertyValue("background-color");if("transparent"===r||"rgba(0, 0, 0, 0)"===r)return"light";r.match(/^rgb/)?(e=(r=r.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/))[1],t=r[2],n=r[3]):(e=(r=+"0x".concat(r.slice(1).replace(r.length<5&&/./g,"$&$&")))>>16,t=r>>8&255,n=255&r);var o=.2126*e+.7152*t+.0722*n,i=(Math.max(e,t,n)+Math.min(e,t,n))/2;return Math.sqrt(e*e*.299+t*t*.587+n*n*.114)<=180&&o<=180&&i<=180?"dark":"light"}},{key:"matchAll",value:function(e,t){for(var n,r=[];n=e.exec(t);)r.push(n[0]);return r}}],(n=null)&&r(t.prototype,n),a&&r(t,a),Object.defineProperty(t,"prototype",{writable:!1}),e}();function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}n(1);var d=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.basicWidgetConfig=t,this.propsNotInConfigGroup=["merchantID","minPrice","maxPrice","numberOfPayments","apModalHTML","language","apDualInstall"],this.widgetConfig={config:null,configGroups:null,merchantID:null,numberOfPayments:null,minPrice:null,maxPrice:null,apModalHTML:null,fingerprint:null,apDualInstall:null,mutationObserverConfig:{attributes:!0,childList:!0,characterData:!0},apiEndpoints:{sezzleAssetsCDN:"https://media.sezzle.com/shopify-app/assets/",cssForMerchantURL:"".concat(a.getWidgetBaseUrl(),"/v1/css/price-widget?uuid=").concat(t.merchantID)},observeElements:null},this.modifySezzleConfig()}var t,n,r;return t=e,(n=[{key:"getSezzleConfig",get:function(){return this.widgetConfig}},{key:"modifySezzleConfig",value:function(){this._validateConfig(),this._urlConfigFilter(),this._configSetters(),this._setConfigGroups()}},{key:"_validateConfig",value:function(){var e=this;if(!Array.isArray(this.basicWidgetConfig.configGroups))throw new Error("options.configGroups is not an array");if(!this.basicWidgetConfig.configGroups.length)throw new Error("options.configGroups must have at least one config object");var t=["targetXPath"];this.basicWidgetConfig.configGroups.forEach((function(e){t.forEach((function(t){if(!e.hasOwnProperty(t))throw new Error("".concat(t," must be specified in all configs in options.configGroups"))}))}));var n={targetXPath:"string",renderToPath:"string",urlMatch:"string"};this.basicWidgetConfig.configGroups.forEach((function(e){Object.keys(n).forEach((function(t){if(e.hasOwnProperty(t)&&u(e[t])!==u(n[t]))throw new Error("".concat(t," must be of type ").concat(n[t]))}))})),this.basicWidgetConfig.configGroups.forEach((function(t){Object.keys(t).forEach((function(t){if(e.propsNotInConfigGroup.indexOf(t)>=0)throw new Error("".concat(t," is not a property of a configGroup. Specify this key at the outermost layer"))}))}))}},{key:"_urlConfigFilter",value:function(){this.basicWidgetConfig.configGroups=this.basicWidgetConfig.configGroups.filter((function(e){return!e.urlMatch||RegExp(e.urlMatch).test(window.location.href)}))}},{key:"_configSetters",value:function(){var e={config:this.basicWidgetConfig,merchantID:this.basicWidgetConfig.merchantID||"",numberOfPayments:4,minPrice:this.basicWidgetConfig.minPrice||0,maxPrice:this.basicWidgetConfig.maxPrice||25e4,apModalHTML:'<div id="afterpay-popup-wrapper" style="position: fixed; z-index: 2147483647; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: auto;"><div id="afterpay-popup-outer" style="display: flex; place-content: center; align-items: center; width: 100%; min-height: 100%; background-color: rgba(0, 0, 0, 0.8);"><div id="afterpay-popup-inner" style="position: relative; background-color: rgb(255, 255, 255);"><a href="https://www.afterpay.com/purchase-payment-agreement" target="_blank" style="display: block;"><img src="https://static.afterpay.com/us-popup-medium.png" srcset="https://static.afterpay.com/us-popup-medium.png 1x, https://static.afterpay.com/us-popup-medium@2x.png 2x" style="max-width: 597px; display: block; width: 100%;"></a><a href="#" style="position: absolute; right: 8px; top: 8px;"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" version="1.1" width="32px" height="32px"><g id="surface1"><path style=" " d="M 16 3 C 8.832031 3 3 8.832031 3 16 C 3 23.167969 8.832031 29 16 29 C 23.167969 29 29 23.167969 29 16 C 29 8.832031 23.167969 3 16 3 Z M 16 5 C 22.085938 5 27 9.914063 27 16 C 27 22.085938 22.085938 27 16 27 C 9.914063 27 5 22.085938 5 16 C 5 9.914063 9.914063 5 16 5 Z M 12.21875 10.78125 L 10.78125 12.21875 L 14.5625 16 L 10.78125 19.78125 L 12.21875 21.21875 L 16 17.4375 L 19.78125 21.21875 L 21.21875 19.78125 L 17.4375 16 L 21.21875 12.21875 L 19.78125 10.78125 L 16 14.5625 Z "></path></g></svg></a></div></div></div>',observeElements:this.basicWidgetConfig.observeElements||[],apDualInstall:this.basicWidgetConfig.apDualInstall||!1};this.widgetConfig=c(c({},this.widgetConfig),e)}},{key:"_mapGroupToDefault",value:function(e){var t={};switch(t.xpath=a.breakXPath(e.targetXPath),t.rendertopath=e.renderToPath||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.renderToPath||"..",t.relatedElementActions=e.relatedElementActions||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.relatedElementActions||[],t.ignoredPriceElements=e.ignoredPriceElements||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.ignoredPriceElements||[],"string"==typeof t.ignoredPriceElements?t.ignoredPriceElements=[a.breakXPath(t.ignoredPriceElements.trim())]:t.ignoredPriceElements=t.ignoredPriceElements.map((function(e){return a.breakXPath(e.trim())})),t.alignment=e.alignment||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.alignment||"auto",t.alignmentSwitchMinWidth=e.alignmentSwitchMinWidth||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.alignmentSwitchMinWidth,t.alignmentSwitchType=e.alignmentSwitchType||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.alignmentSwitchType,t.containerStyle=e.containerStyle||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.containerStyle||{},t.textStyle=e.textStyle||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.textStyle||{},t.logoStyle=e.logoStyle||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.logoStyle||{},t.theme=e.theme||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.theme||"",t.theme){case"dark":t.imageURL="https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor_WhiteWM.svg",t.imageClassName="szl-dark-image";break;case"light":t.imageURL="https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",t.imageClassName="szl-light-image";break;case"white-flat":t.imageURL="https://media.sezzle.com/branding/2.0/Sezzle_Logo_WhiteAlt.svg",t.imageClassName="szl-dark-image";break;case"black-flat":t.imageURL="https://media.sezzle.com/branding/2.0/Sezzle_Logo_BlackAlt.svg",t.imageClassName="szl-light-image";break;default:"dark"===a.predictBackgroundTheme()?(t.imageURL="https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor_WhiteWM.svg",t.imageClassName="szl-dark-image"):(t.imageURL="https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",t.imageClassName="szl-light-image")}return t.hideClasses=e.hideClasses||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.hideClasses||[],"string"==typeof t.hideClasses?t.hideClasses=[a.breakXPath(t.hideClasses.trim())]:t.hideClasses=t.hideClasses.map((function(e){return a.breakXPath(e.trim())})),t.ignoredFormattedPriceText=e.ignoredFormattedPriceText||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.ignoredFormattedPriceText||["Subtotal","Total:","Sold Out"],Array.isArray(t.ignoredFormattedPriceText)||(t.ignoredFormattedPriceText=[t.ignoredFormattedPriceText]),t.widgetIsFirstChild=!1,t}},{key:"_setConfigGroups",value:function(){var e=this;this.widgetConfig.configGroups=[],this.basicWidgetConfig.configGroups.forEach((function(t){e.widgetConfig.configGroups.push(e._mapGroupToDefault(t))}))}}])&&f(t.prototype,n),r&&f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var m=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=t}var t,n,r;return t=e,(n=[{key:"getElementsByXPath",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e===[])return[];if(t===e.length)return n;null===n&&(n=[document]);for(var r=[],o=Array.prototype.slice.call(n),i=0;i<o.length;i++){var a=o[i];if(".."===e[t])r.push(a.parentElement);else if("#"===e[t][0])r.push(a.getElementById(e[t].substr(1)));else if("."===e[t][0])1===e[t].trim().length&&r.push(a),Array.prototype.forEach.call(a.getElementsByClassName(e[t].substr(1)),(function(e){r.push(e)}));else if(0===e[t].indexOf("child")){var s=e[t].split("-")[1],c=a.childNodes[s];if(void 0!==c)if("#text"===c.nodeName){var l=document.createElement("span");l.appendChild(document.createTextNode(c.nodeValue)),a.replaceChild(l,c),r.push(l)}else r.push(c);else r.push(a)}else!function(){var n=0;e[t].split("-").length>1&&e[t].split("-")[1]>=0&&(n=parseInt(e[t].split("-")[1],10)),Array.prototype.forEach.call(a.getElementsByTagName(e[t].split("-")[0]),(function(e,t){t===n&&r.push(e)}))}()}return r=r.filter((function(e){return null!==e})),this.getElementsByXPath(e,t+1,r)}},{key:"getElementToRender",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null;if(null!==this._config.configGroups[t].rendertopath){var r=a.breakXPath(this._config.configGroups[t].rendertopath);n=e;for(var o=0;o<r.length;o++){var i=r[o];if(null===n)break;if("."!==i)if(".."===i)n=n.parentElement;else if("."===i[0])n=n.getElementsByClassName(i.substr(1)).length?n.getElementsByClassName(i.substr(1))[0]:null;else if("#"===i[0])n=document.getElementById(i.substr(1));else if("::first-child"===i)n=n.children.length>0?n.firstElementChild:null,this._config.configGroups[t].widgetIsFirstChild=!0;else{var s=0;i.split("-").length>1&&i.split("-")[1]>=0&&(s=parseInt(i.split("-")[1],10)),n=n.getElementsByTagName(i.split("-")[0]).length>s?n.getElementsByTagName(i.split("-")[0])[s]:null}}}return n||e.parentElement}},{key:"getPriceText",value:function(e,t){var n=this;if(!t||0===t.length)return e.textContent;if(t.forEach((function(t){n.getElementsByXPath(t,0,[e]).forEach((function(e){e.classList.add("sezzle-ignored-price-element")}))})),!e.getElementsByClassName("sezzle-ignored-price-element").length)return e.textContent;var r=e.cloneNode(!0);return Array.prototype.forEach.call(r.getElementsByTagName("*"),(function(e){-1!==Array.prototype.slice.call(e.classList).indexOf("sezzle-ignored-price-element")&&r.removeChild(e)})),Array.prototype.forEach.call(e.getElementsByClassName("sezzle-ignored-price-element"),(function(e){e.classList.remove("sezzle-ignored-price-element")})),r.textContent}},{key:"startObserve",value:function(e,t){var n=new MutationObserver(t);return n.observe(e,this._config.mutationObserverConfig),n}},{key:"observeRelatedElements",value:function(e,t,n){var r=this;n&&n.forEach((function(n){if("string"==typeof n.relatedPath&&("function"==typeof n.action||"function"==typeof n.initialAction)){var o=r.getElementsByXPath(a.breakXPath(n.relatedPath),0,[e]);o.length>0&&("function"==typeof n.action&&r.startObserve(o[0],(function(e){n.action(e,t)})),"function"==typeof n.initialAction&&n.initialAction(o[0],t))}}))}},{key:"hideSezzleHideElements",value:function(e){var t=this;this._config.configGroups[e].hideClasses.forEach((function(e){t.getElementsByXPath(e).forEach((function(e){e.classList.contains("sezzle-hidden")||e.classList.add("sezzle-hidden")}))}))}}])&&h(t.prototype,n),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function p(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var b=function(){function e(t,n,r,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._widgetConfig=t,this._widgetEventLogger=n,this._scrollDistance=0,this._modalNode=null,this._sezzleElement=null,this._vendorsSupportedForDualInstall=["ap"],this._promotion=r,this._priceProcessor=o,this._languageConfig=i}var t,n,r,o,i;return t=e,(n=[{key:"addClickEventForModal",value:function(e){this._sezzleElement=e.widget,this._sezzleAddClickEvent(e),this._addClickEventForOtherVendors()}},{key:"renderModals",value:function(){this._renderModal(),this._renderOtherVendorModals()}},{key:"_sezzleAddClickEvent",value:function(e){var t=this,n=document.getElementsByClassName("sezzle-modal-link");Array.prototype.forEach.call(n,(function(n){n.addEventListener("click",(function(n){if(n.preventDefault(),t._processContentForModal(e),n.target.id="sezzle-modal-return",!n.target.classList.contains("no-sezzle-info")){var r,o=document.getElementsByClassName("sezzle-checkout-modal-lightbox");if(Array.prototype.forEach.call(o,(function(e){e.classList.contains("close-sezzle-modal")&&(r=e)})),r){t._disableBodyScroll(!0),r.style.display="block",r.getElementsByClassName("close-sezzle-modal")[0].focus();var i=r.getElementsByClassName("sezzle-modal");i.length&&(i[0].className="sezzle-modal"),t.modalKeyboardNavigation(),t._widgetEventLogger.logEvent("onclick")}}}))}))}},{key:"_addClickEventForOtherVendors",value:function(){var e=this;this._vendorsSupportedForDualInstall.forEach((function(t){var n=e._sezzleElement.getElementsByClassName("".concat(t,"-modal-info-link"));Array.prototype.forEach.call(n,(function(n){n.addEventListener("click",(function(n){n.target.id="sezzle-modal-return",e._disableBodyScroll(!0),document.getElementsByClassName("sezzle-".concat(t,"-modal"))[0].style.display="block",document.getElementsByClassName("sezzle-".concat(t,"-modal"))[0].focus(),e.modalKeyboardNavigation(),e._widgetEventLogger.logEvent("onclick-".concat(t))}))}))}))}},{key:"_disableBodyScroll",value:function(e){var t=document.body;e?(this._scrollDistance=window.pageYOffset||(document.documentElement.clientHeight?document.documentElement.scrollTop:document.body.scrollTop)||0,t.classList.add("sezzle-modal-open"),t.style.top="".concat(-1*this._scrollDistance,"px")):(t.classList.remove("sezzle-modal-open"),window.scrollTo(0,this._scrollDistance),t.style.top=0,document.getElementsByClassName("sezzle-modal")[0].scrollTop=0,this._scrollDistance=0)}},{key:"modalKeyboardNavigation",value:function(){var e=this,t=document.querySelector(".sezzle-modal-content").childNodes,n=t[0],r=t[t.length-1];document.addEventListener("keydown",(function(t){if("ArrowDown"===t.key&&document.activeElement===r)n.focus();else if("ArrowUp"===t.key&&document.activeElement===n)r.focus();else if("Escape"===t.key){for(var o=document.getElementsByClassName("sezzle-checkout-modal-lightbox"),i=0;i<o.length;i++)o[i].style.display="none",e._disableBodyScroll(!1);var a=document.querySelector("#sezzle-modal-return");a?(a.focus(),a.removeAttribute("id")):document.querySelector(".sezzle-checkout-button-wrapper").querySelector(".sezzle-info-icon")?document.querySelector(".sezzle-checkout-button-wrapper").querySelector(".sezzle-info-icon").focus():document.querySelector(".sezzle-checkout-button-wrapper").focus()}}))}},{key:"_renderModal",value:(o=regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,(t=document.getElementsByClassName("sezzle-checkout-modal-lightbox")).length?this._modalNode=t[0]:(this._modalNode=document.createElement("section"),this._modalNode.className="sezzle-checkout-modal-lightbox close-sezzle-modal",this._modalNode.style.display="none",this._modalNode.role="dialog",this._modalNode.ariaLabel="Sezzle Information",this._modalNode.style.maxHeight="100%",this._modalNode.lang=this._languageConfig._language,document.getElementsByTagName("html")[0].appendChild(this._modalNode)),!document.sezzleDefaultModalVersion||!document.sezzleModalAvailableLanguages){e.next=11;break}return document.sezzleModalAvailableLanguages.split(",").map((function(e){return e.trim()})).indexOf(this._languageConfig._language)>-1?document.modalLanguage=this._languageConfig._language:document.modalLanguage="en",n="".concat(this._widgetConfig.apiEndpoints.sezzleAssetsCDN).concat(document.sezzleDefaultModalVersion),e.next=9,a.httpRequestWrapper("GET",n);case 9:r=e.sent,this._modalNode.innerHTML=r;case 11:this._loadModalScript(),this._closeSezzleModalHandler(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),this._widgetEventLogger.logEvent("error",e.t0.message);case 18:case"end":return e.stop()}}),e,this,[[0,15]])})),i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){y(i,n,r,a,s,"next",e)}function s(e){y(i,n,r,a,s,"throw",e)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"_closeSezzleModalHandler",value:function(){var e=this;Array.prototype.forEach.call(document.getElementsByClassName("close-sezzle-modal"),(function(t){t.addEventListener("click",(function(t){e._disableBodyScroll(!1),e._modalNode.style.display="none",e._modalNode.getElementsByClassName("sezzle-modal")[0].className="sezzle-modal sezzle-checkout-modal-hidden";var n=document.querySelector("#sezzle-modal-return");n?(n.focus(),n.removeAttribute("id")):document.querySelector(".sezzle-checkout-button-wrapper").querySelector(".sezzle-info-icon")?document.querySelector(".sezzle-checkout-button-wrapper").querySelector(".sezzle-info-icon").focus():document.querySelector(".sezzle-checkout-button-wrapper").focus()}))}));var t=document.getElementsByClassName("sezzle-modal")[0];t||(t=document.getElementsByClassName("sezzle-checkout-modal-lightbox")[0]),t.addEventListener("click",(function(e){return e.stopPropagation()}))}},{key:"_renderOtherVendorModals",value:function(){var e=this;this._vendorsSupportedForDualInstall.forEach((function(t){if(document.getElementsByClassName("".concat(t,"-modal-info-link")).length>0){var n=document.createElement("section");n.className="sezzle-checkout-modal-lightbox sezzle-".concat(t,"-modal"),n.style="position: center",n.style.display="none",n.role="dialog",n.ariaLabel="".concat(t," Information"),n.name="Learn more about ".concat(t),n.innerHTML=e._widgetConfig["".concat(t,"ModalHTML")]||"",document.getElementsByTagName("html")[0].appendChild(n),n.addEventListener("click",(function(r){e._disableBodyScroll(!1),n.style.display="none";var o=document.querySelector("#sezzle-modal-return");o?(o.focus(),o.removeAttribute("id")):document.querySelector(".".concat(t,"-modal-info-link"))?document.querySelector(".sezzle-checkout-button-wrapper").getElementsByClassName("".concat(t,"-modal-info-link"))[0].focus():document.querySelector(".sezzle-checkout-button-wrapper").focus(),r.stopPropagation()}))}}))}},{key:"_addPromoToModal",value:function(){if(document.sezzlePromotion){var e=document.createElement("div");e.className="promo";var t=this._promotion.getModalPromotionString();if(t.includes(this._promotion.promoInitiative.name)){var n=document.createElement("a");n.href=this._promotion.promoInitiative.link,n.target="_blank",n.rel="noopener",n.textContent=this._promotion.promoInitiative.name;var r=p(t.split(this._promotion.promoInitiative.name)),o=r[0],i=r.slice(1);e.append(o,n,i)}else e.append(t);var a=document.querySelector(".terms");a.parentElement.insertBefore(e,a)}}},{key:"_loadModalScript",value:function(){if(!document.sezzleDefaultModalVersion||!document.sezzleModalAvailableLanguages)return null;var e=document.head,t=document.createElement("script");t.innerHTML=this._modalNode.querySelector("script").innerHTML,e.appendChild(t)}},{key:"_processContentForModal",value:function(e){if(!document.sezzleDefaultModalVersion||!document.sezzleModalAvailableLanguages)return null;var t=this._priceProcessor.getParsedPrice(e.priceElement,e.configGroup.ignoredPriceElements,e.configGroup.ignoredFormattedPriceText);if(!t)return this._widgetEventLogger.logEvent("warning","Cannot render modal. Failed to parse price for the element ".concat(e.id)),null;var n=this._priceProcessor.getProductPriceEligibility(t);n.isLongTermPaymentEligible?document.longTermPayment=this._priceProcessor.getFormattedLongTermPaymentInfo(t,"$"):document.longTermPayment=null,this._executeModalScript(n.isLongTermPaymentEligible)}},{key:"_executeModalScript",value:function(e){ModalUI?ModalUI.load():this._widgetEventLogger.logEvent("error","ModalUI is undefined. Problem adding modal script to the document"),e||this._addPromoToModal()}}])&&v(t.prototype,n),r&&v(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function w(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function z(e,t,n){_(e,t),t.set(e,n)}function _(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function E(e,t,n,r){return O(e,t),L(n,"set"),S(e,n,r),r}function C(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function k(e,t){return j(e,x(e,t,"get"))}function P(e,t,n){return S(e,x(e,t,"set"),n),n}function x(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function S(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function T(e,t,n){return O(e,t),L(n,"get"),j(e,n)}function L(e,t){if(void 0===e)throw new TypeError("attempted to "+t+" private static field before its declaration")}function O(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}function j(e,t){return t.get?t.get.call(e):t.value}var A=new WeakMap,M=new WeakMap,N=new WeakSet,W=function(){function e(t){var n,r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_(n=this,r=N),r.add(n),z(this,A,{writable:!0,value:void 0}),z(this,M,{writable:!0,value:void 0}),!T(e,e,I))throw new Error("Use static initializer to initialize the logger");P(this,A,t),P(this,M,[])}var t,n,r;return t=e,r=[{key:"NewWidgetEventLogger",value:function(t){return T(e,e,D)||(E(e,e,I,!0),E(e,e,D,new e(t))),T(e,e,D)}},{key:"Destruct",value:function(){E(e,e,D,null)}}],(n=[{key:"logEvent",value:function(e,t){var n={name:e,description:null!=t?t:"",createdAt:(new Date).toJSON()};!n.name.startsWith("onclick")&&this.isEventLogged(n.name,n.description)||k(this,M).push(n),n.name.startsWith("onclick")&&(C(this,N,F).call(this),P(this,M,[]))}},{key:"isEventLogged",value:function(e,t){return k(this,M).some((function(n){return n.name===e&&n.description===t}))}},{key:"forceSendEvents",value:function(){C(this,N,F).call(this),P(this,M,[])}}])&&w(t.prototype,n),r&&w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function F(){var e=this;try{var t=[];k(this,M).forEach((function(n){var r;t.push({event_name:n.name,description:n.description,merchant_uuid:null!==(r=k(e,A))&&void 0!==r?r:"",merchant_site:window.location.hostname,created_at:n.createdAt})})),t.length>0&&a.sendEvents(t)}catch(e){console.log(e)}}var I={writable:!0,value:void 0},D={writable:!0,value:void 0},B=W;function G(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var R=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._numberOfPayments=t,this._defaultLanguage="en",this._translations={en:"or ".concat(this._numberOfPayments," interest-free payments of %%price%%{promotext} with %%logo%% %%info%%{apDualInstallText}{thresholdPriceText}"),fr:"ou ".concat(this._numberOfPayments," paiements de %%price%% sans intérêts{promotext} avec %%logo%% %%info%%{apDualInstallText}{thresholdPriceText}"),es:"o ".concat(this._numberOfPayments," pagos sin intereses de %%price%%{promotext} con %%logo%% %%info%%{apDualInstallText}{thresholdPriceText}")},this._longTermTranslations={en:"or monthly payments as low as %%price%% with %%logo%% %%info%%",fr:"ou des paiements mensuels aussi bas que %%price%% avec %%logo%% %%info%%",es:"o pagos mensuales tan bajos como %%price%% con %%logo%% %%info%%"},this._apDualInstallTranslations={en:" or %%afterpay-logo%% %%afterpay-info-icon%%",fr:" ou %%afterpay-logo%% %%afterpay-info-icon%%",es:" o %%afterpay-logo%% %%afterpay-info-icon%%"},this._thresholdPriceTextTranslations={en:" for orders over %%min-price%%",fr:" pour les achats de plus de %%min-price%%",es:" por compras superiores a %%min-price%%"},this._language=null}var t,n,r;return t=e,(n=[{key:"getTranslation",value:function(){return this._translations[this._language]}},{key:"getLongTermWidgetText",value:function(){return this._longTermTranslations[this._language]||this._longTermTranslations[this._defaultLanguage]}},{key:"getThresholdPriceText",value:function(){return this._thresholdPriceTextTranslations[this._language]}},{key:"getApDualInstallText",value:function(){return this._apDualInstallTranslations[this._language]}},{key:"setLanguage",value:function(e){var t;(t="function"==typeof e?e():e)&&"string"==typeof t||(t=document.querySelector("html").lang);var n=t.substring(0,2).toLowerCase();t.split("-")[1],this._checkIfLanguageIsValid(n)?this._language=n:this._language=this._defaultLanguage}},{key:"_checkIfLanguageIsValid",value:function(e){var t=0;return Object.getOwnPropertyNames(this._translations).forEach((function(n){n===e&&t++})),t>0}},{key:"getLanguage",value:function(){return this._language}}])&&G(t.prototype,n),r&&G(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function U(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var q=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.promoTranslations={main:{reward:{is_new_user_only:{true:{threshold:{true:{promocode:{true:[{en:". Get {money} back on your first purchase of {threshold} or more using promo code {promocode}"},{fr:". {money} remboursés sur votre premier achat de {threshold} ou plus en utilisant le code promo {promocode}"},{es:". Consigue {money} de vuelta en tu primera compra de {threshold} o más usando el código promocional {promocode}"}],false:[{en:". Get {money} back on your first purchase of {threshold} or more"},{fr:". {money} remboursés sur votre premier achat de {threshold} ou plus"},{es:". Recibe {money} de vuelta en tu primera compra de {threshold} o más"}]}},false:{promocode:{true:[{en:". Get {money} back on your first purchase using promo code {promocode}"},{fr:". {money} remboursés sur votre premier achat en utilisant le code promo {promocode}"},{es:". Recibe {money} de vuelta en tu primera compra usando el código promocional {promocode}"}],false:[{en:". Get {money} back on your first purchase"},{fr:". {money} remboursés sur votre premier achat"},{es:". Recibe {money} de vuelta en tu primera compra"}]}}}},false:{threshold:{true:{promocode:{true:[{en:". Get {money} back on purchases of {threshold} or more using promo code {promocode}"},{fr:". Recevez {money} de remboursement sur vos achats de {threshold} ou plus en utilisant le code promo {promocode}"},{es:". Obtén {money} de vuelta en compras de {threshold} o más usando el código promocional {promocode}"}],false:[{en:". Get {money} back on purchases of {threshold} or more"},{fr:". Obtenez {money} de remboursement sur vos achats de plus de {threshold}"},{es:". Obtén {money} de vuelta en tus compras de {threshold} o más"}]}},false:{promocode:{true:[{en:". Get {money} back using promo code {promocode}"},{fr:". {money} remboursés en utilisant le code promo {promocode}"},{es:". Recibe {money} de vuelta usando el código promocional {promocode}"}],false:[{en:". Get {money} back"},{fr:". {money} remboursés"},{es:". Recibe {money} de vuelta"}]}}}}}},discount:{is_new_user_only:{true:{threshold:{true:{promocode:{true:[{en:". Get {money} off your first purchase of {threshold} or more using promo code {promocode}"},{fr:". Obtenez {money} de remise sur votre premier achat de {threshold} ou plus en utilisant le code promo {promocode}"},{es:". Obtén {money} de descuento en tu primera compra de {threshold} o más usando el código promocional {promocode}"}],false:[{en:". Get {money} off your first purchase of {threshold} or more"},{fr:". Obtenez {money} de remise sur votre premier achat de {threshold} ou plus"},{es:". Obtén {money} de descuento en tu primera compra de {threshold} o más"}]}},false:{promocode:{true:[{en:". Get {money} off your first purchase using promo code {promocode}"},{fr:". Obtenez {money} de remise sur votre premier achat en utilisant le code promo {promocode}"},{es:". Obtén {money} de descuento en tu primera compra usando el código promocional {promocode}"}],false:[{en:". Get {money} off your first purchase"},{fr:". Obtenez {money} de remise sur votre premier achat"},{es:". Obtén {money} de descuento en tu primera compra"}]}}}},false:{threshold:{true:{promocode:{true:[{en:". Get {money} off on purchases of {threshold} or more using promo code {promocode}"},{fr:". Obtenez {money} de remise sur vos achats de {threshold} ou plus en utilisant le code promo {promocode}"},{es:". Obtén {money} de descuento en tu primera compra de {threshold} o más usando el código promocional {promocode}"}],false:[{en:". Get {money} off on purchases of {threshold} or more"},{fr:". Obtenez {money} de remise sur vos achats de {threshold} ou plus"},{es:". Obtén {money} de descuento en tu primera compra de {threshold} o más"}]}},false:{promocode:{true:[{en:". Get {money} off using promo code {promocode}"},{fr:". Obtenez {money} de remise en utilisant le code promo {promocode}"},{es:". Obtén {money} de descuento usando el código promocional {promocode}"}],false:[{en:". Get {money} off"},{fr:". Obtenez {money} de remise"},{es:". Obtén {money} de descuento"}]}}}}}}},modal:[{en:"Customer will receive {promoinitiative} award at the time of their purchase."},{fr:"Les clients obtiendront des {promoinitiative} en récompense au moment de leur achat."},{es:"Los clientes recibirán una recompensa {promoinitiative} al realizar la compra."}]}}var t,n,r;return t=e,(n=[{key:"getMainViewTranslationTextByLanguage",value:function(e,t,n,r,o,i){var a=this.promoTranslations.main[e].is_new_user_only[t].threshold[n].promocode[r];if(a){var s=a.find((function(e){return e["".concat(o)]}));return s?s["".concat(o)]:(s=a.find((function(e){return e["".concat(i)]})))["".concat(i)]}return""}},{key:"getModalViewTranslationTextByLanguage",value:function(e,t){var n=this.promoTranslations.modal;if(n){var r=n.find((function(t){return t["".concat(e)]}));return r?r["".concat(e)]:(r=n.find((function(e){return e["".concat(t)]})))["".concat(t)]}return""}}])&&U(t.prototype,n),r&&U(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function H(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var V=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.promoConfig=t,this.promoConfig&&(this.promoInitiative={name:this.promoConfig.promo_initiative_name,link:this.promoConfig.promo_initiative_link}),this.language=n._language,this.defaultLanguage=n._defaultLanguage,this.promoTranslations=new q}var t,n,r;return t=e,r=[{key:"getPromotionString",value:function(t,n,r,o){var i=$[t.type],a=!!t.spend_award_threshold_in_cents,s=!!t.is_new_user_only&&t.is_new_user_only,c=!!t.promo_code,l=o.getMainViewTranslationTextByLanguage(i,s,a,c,n,r);return l=l.replace("{money}",e.format(n,t.currency_code,t.spend_award_in_cents)),a&&(l=l.replace("{threshold}",e.format(n,t.currency_code,t.spend_award_threshold_in_cents))),c&&(l=l.replace("{promocode}",t.promo_code)),l}},{key:"format",value:function(e,t,n){var r=new Intl.NumberFormat(e,{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:0}),o=new Intl.NumberFormat(e,{style:"currency",currency:t,minimumFractionDigits:2}),i=parseInt(n)/100;return i%1==0?r.format(i):o.format(i)}}],(n=[{key:"getModalPromotionString",value:function(){return this.promoConfig?this.promoTranslations.getModalViewTranslationTextByLanguage(this.language,this.defaultLanguage).replace("{promoinitiative}",this.promoInitiative.name):""}},{key:"getPromotionString",value:function(){return this.promoConfig?e.getPromotionString(this.promoConfig,this.language,this.defaultLanguage,this.promoTranslations):""}}])&&H(t.prototype,n),r&&H(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),$={1:"reward",2:"discount"},X=V;function J(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Z(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function Q(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var ee=new WeakSet,te=new WeakSet,ne=new WeakSet,re=new WeakSet;function oe(e,t,n){if(n>0){var r=n/100/12,o=Math.pow(1+r,t);return e*r*o/(o-1)}return e/t}function ie(e){return Q(this,ne,ae).call(this,e)[0]}function ae(e){var t,n=J(this.terms);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e>r.price)return r.options}}catch(e){n.e(e)}finally{n.f()}return this.terms[this.terms.length-1].options}function se(e){return Math.round(100*e)/100}var ce=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Z(this,re),Z(this,ne),Z(this,te),Z(this,ee),this.terms=t||[{price:1e3,options:[[48,8.99],[36,7.99],[3,0]]},{price:500,options:[[24,7.99],[12,6.99],[3,0]]},{price:250,options:[[12,6.99],[9,5.99],[3,0]]},{price:100,options:[[9,5.99],[6,5.99],[3,0]]}]}var t,n,r;return t=e,(n=[{key:"getPaymentInfo",value:function(e){var t=this;if(!e||e<=0)throw new Error("Unable to calculate Long Term payments: product price is undefined or non-positive");var n=Q(this,ne,ae).call(this,e),r={productPrice:e,paymentTerms:[]};return r.paymentTerms=n.map((function(n){var r=n[0],o=n[1],i=Q(t,ee,oe).call(t,e,r,o),a=Q(t,re,se).call(t,i*r);return{durationInMonths:r,apr:o,monthlyPayment:i,totalAmount:a,totalInterest:a-e}})),r.paymentTerms.sort((function(e,t){return e.monthlyPayment-t.monthlyPayment})),r}},{key:"calculateLowestAvailablePayment",value:function(e){if(!e||e<=0)throw new Error("Unable to calculate lowest Long Term payment: product price is undefined or non-positive");var t=Q(this,te,ie).call(this,e);return Q(this,ee,oe).call(this,e,t[0],t[1])}}])&&Y(t.prototype,n),r&&Y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function le(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ue(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function de(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function he(e,t){return function(e,t){if(t.get)return t.get.call(e);return t.value}(e,pe(e,t,"get"))}function me(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,pe(e,t,"set"),n),n}function pe(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var ge=new WeakMap,ye=new WeakMap,ve=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),de(this,ge,{writable:!0,value:void 0}),de(this,ye,{writable:!0,value:void 0}),this.sezzleDOMFunctions=r,this.widgetConfig=t,this.longTermPaymentConfig=n,me(this,ge,"{price}"),me(this,ye,2),this.thousandDelimiter=/\B(?=(\d{3})+(?!\d))/g,this.naFormat=/^\d{1,3}(,\d{3})+(\.\d+)?$/,this.euFormat=/^\d{1,3}(\.\d{3})+(,\d+)?$/,this.euFormatWithSpace=/^\d{1,3}(\s\d{3})+(,\d+)?$/,this.euDecimalsNoThousandDelimiterFormat=/(^\d+((,\d{1,2})|(,\d{4,}))$)|(^\d{4,},\d+$)/}var t,n,r;return t=e,(n=[{key:"getParsedPrice",value:function(e,t,n){var r=this,o=this.sezzleDOMFunctions.getPriceText(e,t);if(!o)return null;o=o.replace("\n","").trim(),n&&n.forEach((function(e){var t=new RegExp(e,"ig");o=o.replace(t,"")}));var i=new RegExp(/\d+((\.|,|\s)\d+)*/g),s=a.matchAll(i,o);if(0===s.length||s.length>2)return null;var c={formatter:o.replace(i,he(this,ge)),prices:[]};return c.prices=s.map((function(e){var t,n=e;return r.naFormat.test(e)&&(n=e.replaceAll(",",""),t=r.naFormat),r.euFormat.test(e)&&(n=e.replaceAll(".","").replaceAll(",","."),t=r.euFormat),r.euFormatWithSpace.test(e)&&(n=e.replaceAll(" ","").replaceAll(",","."),t=r.euFormatWithSpace),r.euDecimalsNoThousandDelimiterFormat.test(e)&&(n=e.replaceAll(",","."),t=r.euDecimalsNoThousandDelimiterFormat),{value:parseFloat(n),format:t}})),c}},{key:"getFormattedPrice",value:function(e,t){switch(t){case this.naFormat:return e.toString().replace(this.thousandDelimiter,",");case this.euFormat:return e.toString().replace(".",",").replace(this.thousandDelimiter,".");case this.euFormatWithSpace:return e.toString().replace(".",",").replace(this.thousandDelimiter," ");case this.euDecimalsNoThousandDelimiterFormat:return e.toString().replace(".",",");default:return e.toString()}}},{key:"getFormattedWidgetPrice",value:function(e,t){if(!e.prices||0===e.prices.length)throw new Error("Cannot get formatted widget price: no product prices are provided");var n,r=e.formatter,o=le(e.prices);try{for(o.s();!(n=o.n()).done;){var i,a=n.value,s=void 0;s=t?new ce(this.longTermPaymentConfig.paymentTerms).calculateLowestAvailablePayment(a.value).toFixed(he(this,ye)):(a.value/this.widgetConfig.numberOfPayments).toFixed(he(this,ye)),i=this.getFormattedPrice(s,a.format),r=r.replace(he(this,ge),i)}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"getFormattedMinPrice",value:function(e){var t=e.prices[0].format,n=e.formatter,r=this.getFormattedPrice(this.widgetConfig.minPrice/100,t);return n.replace(he(this,ge),r)}},{key:"getProductPriceEligibility",value:function(e){var t=100*e.prices[0].value;return{isPriceLessThanMinPrice:!!(t<this.widgetConfig.minPrice),isPriceGreaterThanMaxPrice:!!(t>this.widgetConfig.maxPrice),isLongTermPaymentEligible:!!(this.longTermPaymentConfig&&t>=this.longTermPaymentConfig.minPrice&&t<=this.longTermPaymentConfig.maxPrice)}}},{key:"getFormattedLongTermPaymentInfo",value:function(e,t){var n=this;if(!t)throw new Error("Cannot get formatted long term payment info: the currency symbol is not provided");var r=e.prices[0].value,o=new ce(this.longTermPaymentConfig.paymentTerms).getPaymentInfo(r),i={productPrice:t+o.productPrice.toFixed(he(this,ye)).replace(this.thousandDelimiter,","),paymentTerms:[]};return i.paymentTerms=o.paymentTerms.map((function(e){return{durationInMonths:e.durationInMonths,apr:e.apr,monthlyPayment:t+e.monthlyPayment.toFixed(he(n,ye)).replace(n.thousandDelimiter,","),totalAmount:t+e.totalAmount.toFixed(he(n,ye)).replace(n.thousandDelimiter,","),totalInterest:t+e.totalInterest.toFixed(he(n,ye)).replace(n.thousandDelimiter,",")}})),i}}])&&fe(t.prototype,n),r&&fe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function we(e,t){ze(e,t),t.add(e)}function ze(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _e(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function Ee(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,Ce(e,t,"set"),n),n}function Ce(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var ke=new WeakMap,Pe=new WeakSet,xe=new WeakSet,Se=new WeakSet,Te=new WeakSet,Le=new WeakSet,Oe=new WeakSet,je=new WeakSet,Ae=new WeakSet,Me=new WeakSet,Ne=new WeakSet,We=new WeakSet,Fe=new WeakSet;function Ie(e){var t,n=this;e=e.filter((function(e){return null!=e.widget})),this.widgetConfig.configGroups.forEach((function(t,r){n.sezzleDOMFunctions.getElementsByXPath(t.xpath).forEach((function(o){if(!o.hasAttribute("data-sezzleindex")){var i=n.render(o,r,t);if(i){n.widgetEventLogger.logEvent("onload");try{var a={priceElement:o,observer:n.sezzleDOMFunctions.startObserve(o,(function(e){n.mutationCallBack(e,t,n.priceProcessor)})),widget:i,configGroup:t};e.push(a),n.modal.addClickEventForModal(a),n.sezzleDOMFunctions.observeRelatedElements(a.priceElement,a.widget,a.configGroup.relatedElementActions)}catch(e){n.widgetEventLogger.logEvent("warning","The widget has been rendered, but an error occurred when running additional instructions: ".concat(e.message))}}}}))})),e.forEach((function(e){document.body.contains(e.priceElement)||(null!==e.observer&&e.observer.disconnect(),e.widget.remove(),e.widget=null)}));for(var r=0,o=this.widgetConfig.configGroups.length;r<o;r++)this.sezzleDOMFunctions.hideSezzleHideElements(r);setTimeout((function(){return _e(n,Pe,Ie).call(n,e)}),function(e,t){return t.get?t.get.call(e):t.value}(t=this,Ce(t,ke,"get")));var i=document.getElementsByClassName("sezzle-")[0];void 0!==i&&(i.classList.contains("sezzle-hidden")||i.classList.add("sezzle-hidden"))}function De(e,t){var n;if(n=t.isLongTermPaymentEligible?this.language.getLongTermWidgetText():this.language.getTranslation(),t.isPriceLessThanMinPrice){var r=this.language.getThresholdPriceText();n=n.replace("{thresholdPriceText}",r)}else if(this.widgetConfig.apDualInstall){var o=this.language.getApDualInstallText();n=n.replace("{apDualInstallText}",o)}n=(n=n.replace("{apDualInstallText}","")).replace("{thresholdPriceText}","");var i=this.promotion.getPromotionString();return n=n.replace("{promotext}",i).split("%%")}function Be(e){if(!e)return"left";var t=window.getComputedStyle(e).textAlign;return"start"===t||"justify"===t?"left":"end"===t?"right":t}function Ge(e){return e.className+=" sezzle-".concat(this.widgetConfig.merchantID),e}function Re(e,t){Object.keys(t.containerStyle).forEach((function(n){e.style[n]=t.containerStyle[n]}))}function Ue(e,t){var n="";if(matchMedia&&t.alignmentSwitchMinWidth&&t.alignmentSwitchType){var r="(min-width: ".concat(t.alignmentSwitchMinWidth,"px)");window.matchMedia(r).matches||(n=t.alignmentSwitchType)}var o=n||t.alignment||"auto";e.className+=" sezzle-".concat(o)}function qe(e,t){Object.keys(t.textStyle).forEach((function(n){e.style[n]=t.textStyle[n]}))}function He(e,t){switch(t.theme){case"dark":case"white-flat":e.className+=" szl-dark";break;default:e.className+=" szl-light"}}function Ve(e,t){Object.keys(t.logoStyle).forEach((function(n){e.style[n]=t.logoStyle[n]}))}function $e(e,t){t.parentNode.insertBefore(e,t.nextSibling)}function Xe(e,t){for(t.parentElement.insertBefore(e,t);e.previousSibling;)e.parentElement.insertBefore(e,e.previousSibling)}function Je(e){Array.isArray(e)&&0!=e.length&&e.forEach((function(e){var t=document.querySelectorAll(e.element);t.length>0&&t.forEach((function(t){t.addEventListener(e.eventType,(function(){document.querySelector("[data-sezzleindex]").removeAttribute("data-sezzleindex"),document.querySelector(".sezzle-shopify-info-button").remove();var e=B.NewWidgetEventLogger(document.sezzleConfig.merchantID);new et(document.sezzleConfig,e).init()}))}))}))}var Ke=function(){function e(t,n){var r,o,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),we(this,Fe),we(this,We),we(this,Ne),we(this,Me),we(this,Ae),we(this,je),we(this,Oe),we(this,Le),we(this,Te),we(this,Se),we(this,xe),we(this,Pe),i={writable:!0,value:void 0},ze(r=this,o=ke),o.set(r,i),Ee(this,ke,2e3),this.widgetConfig=t,this.widgetEventLogger=n,this.sezzleDOMFunctions=new m(t),this.language=new R(4),this.language.setLanguage(this.widgetConfig.config.language),this.promotion=new X(document.sezzlePromotion,this.language),this.priceProcessor=new ve(t,document.longTermPaymentConfig,this.sezzleDOMFunctions),this.modal=new b(t,n,this.promotion,this.priceProcessor,this.language)}var t,n,r;return t=e,(n=[{key:"initializeRendering",value:function(){_e(this,Fe,Je).call(this,this.widgetConfig.observeElements),_e(this,Pe,Ie).call(this,[]),this.modal.renderModals()}},{key:"mutationCallBack",value:function(e,t,n){var r=this;e.filter((function(e){return"childList"===e.type})).forEach((function(e){var o=e.target.dataset.sezzleindex,i=document.getElementsByClassName("sezzleindex-".concat(o))[0];if(i){var a=i.parentElement,s=a.parentElement.parentElement;try{s.classList.remove("sezzle-hidden");var c=n.getParsedPrice(e.target,t.ignoredPriceElements,t.ignoredFormattedPriceText),l=n.getProductPriceEligibility(c);l.isPriceGreaterThanMaxPrice&&!l.isLongTermPaymentEligible&&s.classList.add("sezzle-hidden");var u=r.getWidgetInnerContent(t,o,l,c);a.innerHTML=u.innerHTML}catch(e){s.classList.add("sezzle-hidden"),r.widgetEventLogger.logEvent("warning",e.message)}}}))}},{key:"render",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;try{if(e.classList.contains("sezzle-ignored-price-element"))return null;var r=this.priceProcessor.getParsedPrice(e,n.ignoredPriceElements,n.ignoredFormattedPriceText);if(!r)return this.widgetEventLogger.logEvent("warning","Cannot render widget. Failed to parse price for the element ".concat(e.id)),null;var o=this.priceProcessor.getProductPriceEligibility(r);if(o.isPriceGreaterThanMaxPrice&&!o.isLongTermPaymentEligible)return null;var i=this.sezzleDOMFunctions.getElementToRender(e,t);e.dataset.sezzleindex=t,"auto"===n.alignment&&(n.alignment=_e(this,Se,Be).call(this,e));var a=document.createElement("div");a.className="sezzle-shopify-info-button sezzlewidgetindex-".concat(t),_e(this,Te,Ge).call(this,a),n.containerStyle!=={}&&_e(this,Le,Re).call(this,a,n);var s=document.createElement("button");s.ariaHasPopup="dialog",s.className="sezzle-checkout-button-wrapper sezzle-modal-link",s.style.cursor="pointer",_e(this,Te,Ge).call(this,s),_e(this,Oe,Ue).call(this,s,n);var c=this.getWidgetInnerContent(n,t,o,r);return s.appendChild(c),a.appendChild(s),n.widgetIsFirstChild?_e(this,We,Xe).call(this,a,i):_e(this,Ne,$e).call(this,a,i),a}catch(e){return this.widgetEventLogger.logEvent("error","An exception occurred when rendering a widget: ".concat(e.message)),null}}},{key:"getWidgetInnerContent",value:function(e,t,n,r){var o=this,i=document.createElement("div");return i.className="sezzle-button-text",e.textStyle!=={}&&_e(this,je,qe).call(this,i,e),_e(this,Oe,Ue).call(this,i,e),_e(this,Ae,He).call(this,i,e),_e(this,xe,De).call(this,e,n).forEach((function(a){switch(a){case"price":var s=document.createElement("span");s.className="sezzle-payment-amount sezzle-button-text sezzleindex-".concat(t);var c=o.priceProcessor.getFormattedWidgetPrice(r,n.isLongTermPaymentEligible),l=document.createTextNode(c);s.appendChild(l),i.appendChild(s);break;case"logo":var u=document.createElement("img");u.className="sezzle-logo ".concat(e.imageClassName),u.src=e.imageURL,u.alt="Sezzle",u.style.height="18px",i.appendChild(u),e.logoStyle!=={}&&_e(o,Me,Ve).call(o,u,e);break;case"info":var f=document.createElement("div");f.ariaLabel="Click to learn more about Sezzle",f.name="Click to learn more about Sezzle",f.className="sezzle-info-icon",f.innerHTML="&#9432;",f.style="font-size: ".concat(e.textStyle.fontSize,"px;"),i.appendChild(f);break;case"afterpay-logo":var d=document.createElement("img");d.className="sezzle-ap-logo ap-modal-info-link no-sezzle-info",d.src="https://media.sezzle.com/sezzle-credit-website-assets/ap-badge-black-on-mint.svg",d.alt="Afterpay",i.appendChild(d);break;case"afterpay-info-icon":var h=document.createElement("button");h.role="button",h.type="button",h.ariaLabel="Click to learn more about Afterpay",h.name="Click to learn more about Afterpay",h.ariaHasPopup="dialog",h.className="ap-modal-info-link no-sezzle-info",h.innerHTML="&#9432;",h.style="font-size: ".concat(e.textStyle.fontSize,"px;"),i.appendChild(h);break;case"line-break":var m=document.createElement("br");i.appendChild(m);break;case"min-price":var p=document.createElement("span");p.className="sezzle-payment-amount sezzle-button-text sezzleindex-".concat(t);var g=o.priceProcessor.getFormattedMinPrice(r),y=document.createTextNode(g);p.appendChild(y),i.appendChild(p);break;default:var v=document.createTextNode(a);i.appendChild(v)}})),i}}])&&be(t.prototype,n),r&&be(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ye(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function Ze(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ye(i,r,o,a,s,"next",e)}function s(e){Ye(i,r,o,a,s,"throw",e)}a(void 0)}))}}function Qe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var et=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.basicWidgetConfiguration=t,this.widgetEventLogger=n}var t,n,r,o,i,s;return t=e,(n=[{key:"init",value:(s=Ze(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.widgetEventLogger.logEvent("request"),(t=a._getCookie("shopify_pay_redirect"))&&this.widgetEventLogger.logEvent("shop-checkout-status-".concat(t)),!((n=new d(this.basicWidgetConfiguration).getSezzleConfig).configGroups.length>0)){e.next=8;break}return e.next=8,this.initializeWidget(n);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),this.widgetEventLogger.logEvent("error",e.t0.message);case 13:this.widgetEventLogger.forceSendEvents();case 14:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return s.apply(this,arguments)})},{key:"initializeWidget",value:(i=Ze(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loadCSS();case 2:new Ke(t,this.widgetEventLogger).initializeRendering(),a.isWidgetDuplicateFound()&&this.widgetEventLogger.logEvent("duplicate-widget"),a.isCompetitorWidgetFound()&&this.widgetEventLogger.logEvent("competitor-widget");case 6:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_loadCSS",value:(o=Ze(regeneratorRuntime.mark((function e(){var t,n,r,o,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=document.sezzleCssVersionOverride){e.next=8;break}return n="".concat(a.getWidgetBaseUrl(),"/v1/css/price-widget?uuid=").concat(this.basicWidgetConfiguration.merchantID),e.next=5,a.httpRequestWrapper("GET",n);case 5:r=e.sent,r=JSON.parse(r),t=r.version;case 8:o=document,i=o.head,(s=document.createElement("link")).type="text/css",s.rel="stylesheet",s.href="https://media.sezzle.com/shopify-app/assets/".concat(t),i.appendChild(s);case 14:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})}])&&Qe(t.prototype,n),r&&Qe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();if(0===document.getElementsByClassName("sezzle-shopify-info-button").length)if(document.sezzleConfig){var tt=B.NewWidgetEventLogger(document.sezzleConfig.merchantID);document.sezzleConfig.merchantID||tt.logEvent("warning","Merchant UUID is not provided"),new et(document.sezzleConfig,tt).init()}else{var nt=B.NewWidgetEventLogger("");nt.logEvent("request"),nt.logEvent("error","No sezzleConfig is found in the document. Check that at least a default or a custom override config is presented for the merchant")}}]);