@spot-flow/checkout-inline-js 0.1.40-dev.1 → 0.1.41-dev.1

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.
@@ -1,4 +1,4 @@
1
- (function(Be,Ae){typeof exports=="object"&&typeof module<"u"?Ae(exports):typeof define=="function"&&define.amd?define(["exports"],Ae):(Be=typeof globalThis<"u"?globalThis:Be||self,Ae(Be.SpotflowCheckout={}))})(this,function(Be){"use strict";var wc=Object.defineProperty;var kc=(Be,Ae,En)=>Ae in Be?wc(Be,Ae,{enumerable:!0,configurable:!0,writable:!0,value:En}):Be[Ae]=En;var h=(Be,Ae,En)=>kc(Be,typeof Ae!="symbol"?Ae+"":Ae,En);var Ae=document.createElement("style");Ae.textContent=`*:where(#checkout-modal,#checkout-modal *),:before:where(#checkout-modal,#checkout-modal *),:after:where(#checkout-modal,#checkout-modal *){box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before:where(#checkout-modal,#checkout-modal *),:after:where(#checkout-modal,#checkout-modal *){--tw-content: ""}#checkout-modal{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:IBM Plex Sans,Inter,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}#checkout-modal{margin:0;line-height:inherit}hr:where(#checkout-modal,#checkout-modal *){height:0;color:inherit;border-top-width:1px}abbr:where([title]):where(#checkout-modal,#checkout-modal *){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1:where(#checkout-modal,#checkout-modal *),h2:where(#checkout-modal,#checkout-modal *),h3:where(#checkout-modal,#checkout-modal *),h4:where(#checkout-modal,#checkout-modal *),h5:where(#checkout-modal,#checkout-modal *),h6:where(#checkout-modal,#checkout-modal *){font-size:inherit;font-weight:inherit}a:where(#checkout-modal,#checkout-modal *){color:inherit;text-decoration:inherit}b:where(#checkout-modal,#checkout-modal *),strong:where(#checkout-modal,#checkout-modal *){font-weight:bolder}code:where(#checkout-modal,#checkout-modal *),kbd:where(#checkout-modal,#checkout-modal *),samp:where(#checkout-modal,#checkout-modal *),pre:where(#checkout-modal,#checkout-modal *){font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small:where(#checkout-modal,#checkout-modal *){font-size:80%}sub:where(#checkout-modal,#checkout-modal *),sup:where(#checkout-modal,#checkout-modal *){font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub:where(#checkout-modal,#checkout-modal *){bottom:-.25em}sup:where(#checkout-modal,#checkout-modal *){top:-.5em}table:where(#checkout-modal,#checkout-modal *){text-indent:0;border-color:inherit;border-collapse:collapse}button:where(#checkout-modal,#checkout-modal *),input:where(#checkout-modal,#checkout-modal *),optgroup:where(#checkout-modal,#checkout-modal *),select:where(#checkout-modal,#checkout-modal *),textarea:where(#checkout-modal,#checkout-modal *){font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button:where(#checkout-modal,#checkout-modal *),select:where(#checkout-modal,#checkout-modal *){text-transform:none}button:where(#checkout-modal,#checkout-modal *),input:where([type=button]):where(#checkout-modal,#checkout-modal *),input:where([type=reset]):where(#checkout-modal,#checkout-modal *),input:where([type=submit]):where(#checkout-modal,#checkout-modal *){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring:where(#checkout-modal,#checkout-modal *){outline:auto}:-moz-ui-invalid:where(#checkout-modal,#checkout-modal *){box-shadow:none}progress:where(#checkout-modal,#checkout-modal *){vertical-align:baseline}::-webkit-inner-spin-button:where(#checkout-modal,#checkout-modal *),::-webkit-outer-spin-button:where(#checkout-modal,#checkout-modal *){height:auto}[type=search]:where(#checkout-modal,#checkout-modal *){-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration:where(#checkout-modal,#checkout-modal *){-webkit-appearance:none}::-webkit-file-upload-button:where(#checkout-modal,#checkout-modal *){-webkit-appearance:button;font:inherit}summary:where(#checkout-modal,#checkout-modal *){display:list-item}blockquote:where(#checkout-modal,#checkout-modal *),dl:where(#checkout-modal,#checkout-modal *),dd:where(#checkout-modal,#checkout-modal *),h1:where(#checkout-modal,#checkout-modal *),h2:where(#checkout-modal,#checkout-modal *),h3:where(#checkout-modal,#checkout-modal *),h4:where(#checkout-modal,#checkout-modal *),h5:where(#checkout-modal,#checkout-modal *),h6:where(#checkout-modal,#checkout-modal *),hr:where(#checkout-modal,#checkout-modal *),figure:where(#checkout-modal,#checkout-modal *),p:where(#checkout-modal,#checkout-modal *),pre:where(#checkout-modal,#checkout-modal *){margin:0}fieldset:where(#checkout-modal,#checkout-modal *){margin:0;padding:0}legend:where(#checkout-modal,#checkout-modal *){padding:0}ol:where(#checkout-modal,#checkout-modal *),ul:where(#checkout-modal,#checkout-modal *),menu:where(#checkout-modal,#checkout-modal *){list-style:none;margin:0;padding:0}dialog:where(#checkout-modal,#checkout-modal *){padding:0}textarea:where(#checkout-modal,#checkout-modal *){resize:vertical}input::-moz-placeholder:where(#checkout-modal,#checkout-modal *),textarea::-moz-placeholder:where(#checkout-modal,#checkout-modal *){opacity:1;color:#9ca3af}input::placeholder:where(#checkout-modal,#checkout-modal *),textarea::placeholder:where(#checkout-modal,#checkout-modal *){opacity:1;color:#9ca3af}button:where(#checkout-modal,#checkout-modal *),[role=button]:where(#checkout-modal,#checkout-modal *){cursor:pointer}:disabled:where(#checkout-modal,#checkout-modal *){cursor:default}img:where(#checkout-modal,#checkout-modal *),svg:where(#checkout-modal,#checkout-modal *),video:where(#checkout-modal,#checkout-modal *),canvas:where(#checkout-modal,#checkout-modal *),audio:where(#checkout-modal,#checkout-modal *),iframe:where(#checkout-modal,#checkout-modal *),embed:where(#checkout-modal,#checkout-modal *),object:where(#checkout-modal,#checkout-modal *){display:block;vertical-align:middle}img:where(#checkout-modal,#checkout-modal *),video:where(#checkout-modal,#checkout-modal *){max-width:100%;height:auto}[hidden]:where(#checkout-modal,#checkout-modal *){display:none}:root{--primary: 264, 52%, 6%;--primary-light: 266, 21%, 76%;--primary-10: 240, 39%, 86%, 1;--primary-lighter: 240, 100%, 98%;--primary-dark: 240, 39%, 52%;--primary-darker: 240, 100%, 28%;--success: 151, 58%, 46%;--error: 0, 74%, 48%;--error-dark: 19, 100%, 37%;--common: 60, 4%, 43%;--tone-10: 240, 2%, 90%;--tone-40: 202, 6%, 82%;--tone-50: 202, 4%, 68%;--tone-60: 260, 4%, 43%, 1;--tone-70: 266, 3%, 53%;--tone-80: 265, 10%, 24%, 1;--tone-90: 266, 18%, 15%;--tone-100: 266, 54%, 6%;--grey: 218, 15%, 65%;--grey-100: 270, 3%, 62%;--grey-200: 264, 3%, 72%;--grey-300: 260, 3%, 81%;--grey-400: 264, 6%, 34%;--grey-500: 217, 24%, 27%;--grey-600: 265, 10%, 24%;--grey-700: 260, 4%, 43%;--grey-800: 265, 21%, 76%;--grey-faint: 240, 7%, 97%;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}input:focus,button:focus{outline:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.container-center{display:flex;align-items:center;justify-content:center}.hide-scrollbar::-webkit-scrollbar{display:none!important}.hide-scrollbar{-ms-overflow-style:none!important;scrollbar-width:none!important}.container-between{display:flex;align-items:center;justify-content:space-between}.align-center{display:flex;align-items:center}.box-container{padding-left:0;padding-right:0;padding-top:1rem;padding-bottom:1rem}@media (min-width: 768px){.box-container{padding:1.75rem 1.25rem}}@media (min-width: 1024px){.box-container{padding-left:1.75rem;padding-right:1.75rem}}.button-fill{display:flex;height:2.5rem;align-items:center;justify-content:center;border-radius:.5rem;background-color:hsl(var(--primary));font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.button-outline{display:flex;height:2.5rem;align-items:center;justify-content:center;border-radius:.5rem;border-width:1px;border-color:hsl(var(--tone-100));font-size:.875rem;line-height:1.25rem;font-weight:600;color:hsl(var(--tone-100))}.payment-options{display:flex;width:100%;flex-direction:column;overflow:hidden}.tab{margin-bottom:.75rem;display:flex;align-items:center;justify-content:flex-start;text-align:left}.tab-button{display:flex;width:100%;flex-grow:1;align-items:center;border-radius:.5rem;border-width:1px;border-color:hsl(var(--grey-100));padding:.75rem 1.25rem;text-align:center;color:hsl(var(--primary))}.tab-button:disabled{cursor:not-allowed;opacity:.4}.tab-button:hover:disabled{border-color:#11032666;color:hsl(var(--primary) / .4)}@media (min-width: 768px){.tab-button{display:flex;justify-content:center}.tab-button:hover{border-color:hsl(var(--primary))}}.tab-button.active{border-width:2px;border-color:hsl(var(--primary))}.tab-button.active span{font-weight:700}.tab-button span{margin-top:.25rem;margin-bottom:.25rem;display:flex;flex-shrink:0;justify-content:center}@media (min-width: 768px){.tab-button span{font-size:.875rem;line-height:1.25rem}}@media (min-width: 1024px){.tab-button span{justify-content:flex-start}}.main{max-height:98dvh;width:100%;overflow:auto}@media (min-width: 768px){.main{padding-top:1rem;padding-bottom:1rem}}@media (min-width: 1024px){.main{width:calc(100% - 250px);padding-left:1rem;padding-right:1rem}}.header-container{border-radius:.75rem;padding:2.5rem 1rem;color:hsl(var(--primary))}@media (min-width: 768px){.header-container{padding:1.25rem 2.25rem}}.tooltip{position:absolute;left:-3rem;top:20px;margin-bottom:1.25rem;display:none;width:auto;flex-direction:column;align-items:center}.group:hover .tooltip{display:flex}@media (min-width: 768px){.tooltip{left:0}}.tooltip-textbox{position:relative;z-index:10;border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:.5rem;font-size:.75rem;line-height:1rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media (min-width: 768px){.tooltip-textbox{padding:.75rem 1rem}}.tooltip-text{font-size:13px;line-height:17.4px;letter-spacing:.025em;color:hsl(var(--grey))}.details-input-container{width:100%;border-width:1px;border-style:none;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));font-weight:600;color:hsl(var(--tone-100))}.details-input-container::-moz-placeholder{font-size:.875rem;line-height:1.25rem;color:hsl(var(--tone-100))}.details-input-container::placeholder{font-size:.875rem;line-height:1.25rem;color:hsl(var(--tone-100))}.details-input-container:focus{outline:2px solid transparent;outline-offset:2px}.details-input-container:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.avs-input-container{width:100%;border-radius:.25rem;border-width:1px;border-color:hsl(var(--tone-40));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:1.5rem .75rem .5rem;color:hsl(var(--tone-100))}.avs-input-container:focus{border-color:hsl(var(--grey-100));outline:2px solid transparent;outline-offset:2px}.avs-input-container:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.mm-input-container{width:100%;border-radius:.5rem;border-width:1px;border-color:hsl(var(--tone-40));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:1.5rem .75rem .5rem;color:hsl(var(--tone-100))}.mm-input-container::-moz-placeholder{color:hsl(var(--tone-50))}.mm-input-container::placeholder{color:hsl(var(--tone-50))}.mm-input-container:focus{border-color:hsl(var(--grey-100));outline:2px solid transparent;outline-offset:2px}.mm-input-container:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.details-form-button{display:inline-flex;height:50px;width:100%;align-items:center;justify-content:center;border-radius:.5rem;background-color:hsl(var(--primary));font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.details-form-button:focus{outline:2px solid transparent;outline-offset:2px}.details-form-button:disabled{background-color:hsl(var(--grey-100));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.pin-input{height:3.5rem;width:4rem;border-radius:.5rem;border-width:1px;border-color:hsla(var(--tone-90));text-align:center;font-size:1.125rem;line-height:1.75rem}.pin-input:focus{border-color:hsl(var(--primary));outline:2px solid transparent;outline-offset:2px}@media (min-width: 768px){.pin-input{height:3.5rem;width:6rem}}.otp-input{width:100%;border-radius:.5rem;border-width:1px;border-color:hsla(var(--tone-90));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:.75rem;font-size:1.5rem;line-height:2rem;font-weight:700}.otp-input:focus{outline:2px solid transparent;outline-offset:2px}.otp-button{height:3.5rem;width:100%;border-radius:.5rem;background-color:hsl(var(--tone-100));padding-left:1.5rem;padding-right:1.5rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.otp-button:disabled{background-color:hsl(var(--grey-100))}.warning-text,.success-text{margin-top:1rem;margin-bottom:1rem;margin-left:auto;margin-right:auto;text-align:center;font-weight:600;color:hsl(var(--grey-400))}.warning-list{margin-left:auto;margin-right:auto;margin-top:.25rem}@media (min-width: 768px){.warning-list{margin-top:.5rem}}.warning-button,.success-button{margin-bottom:1rem;width:100%;border-radius:.5rem;border-width:1px;border-color:hsl(var(--grey-800));padding:1rem;text-align:center;font-size:.875rem;line-height:1.25rem;font-weight:600;color:hsl(var(--grey-400))}.transfer-close{margin-bottom:1rem;width:200px;border-radius:.5rem;background-color:hsl(var(--success));padding:1rem;text-align:center;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#bank-search-input{width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:2px solid transparent;outline-offset:2px}#bank-select-container{display:flex;gap:.75rem;border-radius:.5rem;border-width:1px;border-color:hsl(var(--primary-light));padding:1rem}#bank-code-span{border-radius:.25rem;background-color:hsla(var(--primary-10));padding:.25rem;color:hsla(var(--tone-60))}.spinner{margin-right:.75rem;height:2rem;width:2rem}.spinner{animation:spin 1s linear infinite;fill:#fff}.transaction-issues-input{display:flex;height:3.5rem;width:100%;-webkit-user-select:all;-moz-user-select:all;user-select:all;border-radius:.5rem;border-width:1px;border-style:none;--tw-bg-opacity: 1;background-color:rgb(247 248 251 / var(--tw-bg-opacity));padding-left:1rem;padding-right:1rem;padding-top:1.25rem;padding-bottom:0;color:hsl(var(--tone-100));outline:2px solid transparent!important;outline-offset:2px!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transaction-issues-input:disabled{cursor:not-allowed;opacity:.5}.active-tab{border-bottom-width:2px;border-color:hsl(var(--tone-100));padding-bottom:.25rem;font-weight:500;color:hsl(var(--tone-100))}.transaction-issues-input-placeholder{pointer-events:none;position:absolute;top:1rem;bottom:1rem;left:.75rem;z-index:20;margin:0;display:flex;height:-moz-fit-content;height:fit-content;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;padding-left:.25rem;padding-right:.25rem;font-size:.625rem;color:hsla(var(--tone-70));transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.peer:-moz-placeholder-shown~.transaction-issues-input-placeholder{margin:auto;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding-left:0;padding-right:0;font-size:.875rem;line-height:1.25rem}.peer:placeholder-shown~.transaction-issues-input-placeholder{margin:auto;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding-left:0;padding-right:0;font-size:.875rem;line-height:1.25rem}.peer:focus~.transaction-issues-input-placeholder{margin:0;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding-left:.25rem;padding-right:.25rem;font-size:.625rem}#checkout-modal .static{position:static}#checkout-modal .fixed{position:fixed}#checkout-modal .absolute{position:absolute}#checkout-modal .relative{position:relative}#checkout-modal .inset-0{top:0;right:0;bottom:0;left:0}#checkout-modal .inset-y-4{top:1rem;bottom:1rem}#checkout-modal .left-0{left:0}#checkout-modal .right-4{right:1rem}#checkout-modal .top-0{top:0}#checkout-modal .top-1{top:.25rem}#checkout-modal .top-1\\/2{top:50%}#checkout-modal .top-5{top:1.25rem}#checkout-modal .z-10{z-index:10}#checkout-modal .z-30{z-index:30}#checkout-modal .z-\\[3000\\]{z-index:3000}#checkout-modal .order-1{order:1}#checkout-modal .order-2{order:2}#checkout-modal .mx-5{margin-left:1.25rem;margin-right:1.25rem}#checkout-modal .mx-\\[18px\\]{margin-left:18px;margin-right:18px}#checkout-modal .mx-auto{margin-left:auto;margin-right:auto}#checkout-modal .my-3{margin-top:.75rem;margin-bottom:.75rem}#checkout-modal .mb-1{margin-bottom:.25rem}#checkout-modal .mb-2{margin-bottom:.5rem}#checkout-modal .mb-3{margin-bottom:.75rem}#checkout-modal .mb-4{margin-bottom:1rem}#checkout-modal .mb-5{margin-bottom:1.25rem}#checkout-modal .mb-7{margin-bottom:1.75rem}#checkout-modal .mb-8{margin-bottom:2rem}#checkout-modal .ml-1{margin-left:.25rem}#checkout-modal .ml-20{margin-left:5rem}#checkout-modal .ml-9{margin-left:2.25rem}#checkout-modal .ml-auto{margin-left:auto}#checkout-modal .mr-1{margin-right:.25rem}#checkout-modal .mr-11{margin-right:2.75rem}#checkout-modal .mt-1{margin-top:.25rem}#checkout-modal .mt-10{margin-top:2.5rem}#checkout-modal .mt-2{margin-top:.5rem}#checkout-modal .mt-3{margin-top:.75rem}#checkout-modal .mt-4{margin-top:1rem}#checkout-modal .mt-5{margin-top:1.25rem}#checkout-modal .mt-6{margin-top:1.5rem}#checkout-modal .mt-7{margin-top:1.75rem}#checkout-modal .mt-8{margin-top:2rem}#checkout-modal .block{display:block}#checkout-modal .inline-block{display:inline-block}#checkout-modal .flex{display:flex}#checkout-modal .grid{display:grid}#checkout-modal .contents{display:contents}#checkout-modal .hidden{display:none}#checkout-modal .h-12{height:3rem}#checkout-modal .h-3{height:.75rem}#checkout-modal .h-8{height:2rem}#checkout-modal .h-\\[22px\\]{height:22px}#checkout-modal .h-\\[40dvh\\]{height:40dvh}#checkout-modal .h-\\[40vh\\]{height:40vh}#checkout-modal .h-\\[50px\\]{height:50px}#checkout-modal .h-auto{height:auto}#checkout-modal .h-full{height:100%}#checkout-modal .max-h-screen{max-height:100vh}#checkout-modal .min-h-\\[20dvh\\]{min-height:20dvh}#checkout-modal .min-h-\\[30dvh\\]{min-height:30dvh}#checkout-modal .min-h-\\[40dvh\\]{min-height:40dvh}#checkout-modal .min-h-full{min-height:100%}#checkout-modal .min-h-screen{min-height:100vh}#checkout-modal .w-0{width:0px}#checkout-modal .w-11\\/12{width:91.666667%}#checkout-modal .w-12{width:3rem}#checkout-modal .w-14{width:3.5rem}#checkout-modal .w-16{width:4rem}#checkout-modal .w-3{width:.75rem}#checkout-modal .w-4\\/5{width:80%}#checkout-modal .w-60{width:15rem}#checkout-modal .w-8{width:2rem}#checkout-modal .w-9\\/12{width:75%}#checkout-modal .w-\\[200px\\]{width:200px}#checkout-modal .w-full{width:100%}#checkout-modal .min-w-\\[15rem\\]{min-width:15rem}#checkout-modal .max-w-\\[200px\\]{max-width:200px}#checkout-modal .flex-1{flex:1 1 0%}#checkout-modal .flex-shrink-0{flex-shrink:0}#checkout-modal .flex-grow,#checkout-modal .grow{flex-grow:1}#checkout-modal .-translate-y-2\\/4{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .translate-x-\\[-45\\%\\]{--tw-translate-x: -45%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .translate-x-\\[0\\%\\]{--tw-translate-x: 0%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}#checkout-modal .animate-spin{animation:spin 1s linear infinite}#checkout-modal .cursor-pointer{cursor:pointer}#checkout-modal .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}#checkout-modal .grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}#checkout-modal .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#checkout-modal .grid-cols-\\[1fr_auto\\]{grid-template-columns:1fr auto}#checkout-modal .grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))}#checkout-modal .grid-rows-\\[auto_1fr\\]{grid-template-rows:auto 1fr}#checkout-modal .flex-col{flex-direction:column}#checkout-modal .items-start{align-items:flex-start}#checkout-modal .items-end{align-items:flex-end}#checkout-modal .items-center{align-items:center}#checkout-modal .justify-center{justify-content:center}#checkout-modal .justify-between{justify-content:space-between}#checkout-modal .gap-1{gap:.25rem}#checkout-modal .gap-1\\.5{gap:.375rem}#checkout-modal .gap-2{gap:.5rem}#checkout-modal .gap-3{gap:.75rem}#checkout-modal .gap-4{gap:1rem}#checkout-modal .gap-5{gap:1.25rem}#checkout-modal .gap-6{gap:1.5rem}#checkout-modal .gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}#checkout-modal .justify-self-center{justify-self:center}#checkout-modal .overflow-hidden{overflow:hidden}#checkout-modal .overflow-y-auto{overflow-y:auto}#checkout-modal .whitespace-normal{white-space:normal}#checkout-modal .whitespace-nowrap{white-space:nowrap}#checkout-modal .break-words{overflow-wrap:break-word}#checkout-modal .rounded-2xl{border-radius:1rem}#checkout-modal .rounded-\\[40px\\]{border-radius:40px}#checkout-modal .rounded-full{border-radius:9999px}#checkout-modal .rounded-lg{border-radius:.5rem}#checkout-modal .rounded-md{border-radius:.375rem}#checkout-modal .border,#checkout-modal .border-\\[1px\\]{border-width:1px}#checkout-modal .border-b{border-bottom-width:1px}#checkout-modal .border-r{border-right-width:1px}#checkout-modal .border-dashed{border-style:dashed}#checkout-modal .border-\\[\\#C0B5CF\\]{--tw-border-opacity: 1;border-color:rgb(192 181 207 / var(--tw-border-opacity))}#checkout-modal .border-\\[\\#D0D5DD\\]{--tw-border-opacity: 1;border-color:rgb(208 213 221 / var(--tw-border-opacity))}#checkout-modal .border-\\[\\#D62020\\]{--tw-border-opacity: 1;border-color:rgb(214 32 32 / var(--tw-border-opacity))}#checkout-modal .border-grey-100{border-color:hsl(var(--grey-100))}#checkout-modal .border-primary{border-color:hsl(var(--primary))}#checkout-modal .border-tone-10{border-color:hsl(var(--tone-10))}#checkout-modal .border-tone-40{border-color:hsl(var(--tone-40))}#checkout-modal .border-tone-50{border-color:hsl(var(--tone-50))}#checkout-modal .border-tone-70{border-color:hsla(var(--tone-70))}#checkout-modal .border-b-grey-faint{border-bottom-color:hsl(var(--grey-faint))}#checkout-modal .bg-\\[\\#FEF7ED\\]{--tw-bg-opacity: 1;background-color:rgb(254 247 237 / var(--tw-bg-opacity))}#checkout-modal .bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}#checkout-modal .bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}#checkout-modal .bg-primary{background-color:hsl(var(--primary))}#checkout-modal .bg-tone-10{background-color:hsl(var(--tone-10))}#checkout-modal .bg-tone-100{background-color:hsl(var(--tone-100))}#checkout-modal .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}#checkout-modal .bg-opacity-30{--tw-bg-opacity: .3}#checkout-modal .object-contain{-o-object-fit:contain;object-fit:contain}#checkout-modal .p-0{padding:0}#checkout-modal .p-1{padding:.25rem}#checkout-modal .p-2{padding:.5rem}#checkout-modal .p-3{padding:.75rem}#checkout-modal .p-4{padding:1rem}#checkout-modal .px-0{padding-left:0;padding-right:0}#checkout-modal .px-2{padding-left:.5rem;padding-right:.5rem}#checkout-modal .px-3{padding-left:.75rem;padding-right:.75rem}#checkout-modal .px-3\\.5{padding-left:.875rem;padding-right:.875rem}#checkout-modal .px-4{padding-left:1rem;padding-right:1rem}#checkout-modal .px-6{padding-left:1.5rem;padding-right:1.5rem}#checkout-modal .py-1{padding-top:.25rem;padding-bottom:.25rem}#checkout-modal .py-2{padding-top:.5rem;padding-bottom:.5rem}#checkout-modal .py-3{padding-top:.75rem;padding-bottom:.75rem}#checkout-modal .py-4{padding-top:1rem;padding-bottom:1rem}#checkout-modal .py-5{padding-top:1.25rem;padding-bottom:1.25rem}#checkout-modal .pb-0{padding-bottom:0}#checkout-modal .pb-1{padding-bottom:.25rem}#checkout-modal .pb-3{padding-bottom:.75rem}#checkout-modal .pb-4{padding-bottom:1rem}#checkout-modal .pb-5{padding-bottom:1.25rem}#checkout-modal .pl-4{padding-left:1rem}#checkout-modal .pr-2{padding-right:.5rem}#checkout-modal .pr-7{padding-right:1.75rem}#checkout-modal .pt-0{padding-top:0}#checkout-modal .pt-1{padding-top:.25rem}#checkout-modal .pt-3{padding-top:.75rem}#checkout-modal .pt-5{padding-top:1.25rem}#checkout-modal .pt-6{padding-top:1.5rem}#checkout-modal .text-left{text-align:left}#checkout-modal .text-center{text-align:center}#checkout-modal .text-2xl{font-size:1.5rem;line-height:2rem}#checkout-modal .text-\\[10px\\]{font-size:10px}#checkout-modal .text-\\[11px\\]{font-size:11px}#checkout-modal .text-base{font-size:1rem;line-height:1.5rem}#checkout-modal .text-lg{font-size:1.125rem;line-height:1.75rem}#checkout-modal .text-sm{font-size:.875rem;line-height:1.25rem}#checkout-modal .text-xl{font-size:1.25rem;line-height:1.75rem}#checkout-modal .text-xs{font-size:.75rem;line-height:1rem}#checkout-modal .text-xxs{font-size:.625rem}#checkout-modal .font-bold{font-weight:700}#checkout-modal .font-medium{font-weight:500}#checkout-modal .font-normal{font-weight:400}#checkout-modal .font-semibold{font-weight:600}#checkout-modal .uppercase{text-transform:uppercase}#checkout-modal .lowercase{text-transform:lowercase}#checkout-modal .tracking-\\[0\\.5px\\]{letter-spacing:.5px}#checkout-modal .text-\\[\\#816039\\]{--tw-text-opacity: 1;color:rgb(129 96 57 / var(--tw-text-opacity))}#checkout-modal .text-\\[\\#98A2B3\\]{--tw-text-opacity: 1;color:rgb(152 162 179 / var(--tw-text-opacity))}#checkout-modal .text-\\[\\#D62020\\]{--tw-text-opacity: 1;color:rgb(214 32 32 / var(--tw-text-opacity))}#checkout-modal .text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}#checkout-modal .text-error{color:hsl(var(--error))}#checkout-modal .text-error-dark{color:hsl(var(--error-dark))}#checkout-modal .text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}#checkout-modal .text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}#checkout-modal .text-grey-100{color:hsl(var(--grey-100))}#checkout-modal .text-grey-400{color:hsl(var(--grey-400))}#checkout-modal .text-tone-100{color:hsl(var(--tone-100))}#checkout-modal .text-tone-40{color:hsl(var(--tone-40))}#checkout-modal .text-tone-50{color:hsl(var(--tone-50))}#checkout-modal .text-tone-60{color:hsla(var(--tone-60))}#checkout-modal .text-tone-70{color:hsla(var(--tone-70))}#checkout-modal .text-tone-80{color:hsla(var(--tone-80))}#checkout-modal .text-tone-90{color:hsla(var(--tone-90))}#checkout-modal .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#checkout-modal .opacity-0{opacity:0}#checkout-modal .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#checkout-modal .shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#checkout-modal .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#checkout-modal .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .duration-200{transition-duration:.2s}#checkout-modal .duration-500{transition-duration:.5s}#checkout-modal .duration-700{transition-duration:.7s}#checkout-modal *::-webkit-scrollbar{height:.2em;width:.4em;cursor:pointer;--tw-bg-opacity: 1;background-color:rgb(244 244 244 / var(--tw-bg-opacity))}#checkout-modal *::-webkit-scrollbar-track{border-radius:100vh;--tw-bg-opacity: 1;background-color:rgb(153 146 146 / var(--tw-bg-opacity))}#checkout-modal *::-webkit-scrollbar-thumb{cursor:pointer;border-radius:100vh;border-width:3px;--tw-border-opacity: 1;border-color:rgb(112 112 112 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(224 203 203 / var(--tw-bg-opacity))}#checkout-modal *::-webkit-scrollbar-thumb:hover{background:#53b6ed}@font-face{font-family:IBM Plex Sans;src:url("https://d104jydf2tp7hm.cloudfront.net/IBM Plex Sans/IBMPlexSans-Regular.ttf");font-weight:400;font-display:swap}@font-face{font-family:IBM Plex Sans;src:url("https://d104jydf2tp7hm.cloudfront.net/IBM Plex Sans/IBMPlexSans-SemiBold.ttf");font-weight:600;font-display:swap}@font-face{font-family:IBM Plex Sans;src:url("https://d104jydf2tp7hm.cloudfront.net/IBM Plex Sans/IBMPlexSans-Bold.ttf");font-weight:700;font-display:swap}.tab-button.active:after{animation:text-underline-animation .3s linear forwards}#toast-container{width:100%;margin:0 auto}.toast{display:flex;align-items:center;padding:15px;margin-bottom:10px;border-radius:5px;opacity:0;transform:translateY(-50px);transition:opacity .5s,transform .5s;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a}.toast.show{opacity:1;transform:translateY(0)}.toast.success{background-color:hsl(var(--success));color:#fff}.toast.error{background-color:hsl(var(--error));color:#fff}.toast .close-btn{margin-left:auto;cursor:pointer;color:#fff}.progress-container{width:100%;height:10px;background-color:#f3f3f3;border-radius:5px;overflow:hidden;position:relative}.progress-bar{height:100%;background-color:#4caf50;width:0;position:absolute;top:0;left:0;animation:progress 1s linear infinite}@keyframes progress{0%{width:0px}to{width:100%}}#checkout-modal{color:hsla(var(--tone-80))}#test-cards-link{cursor:pointer;transition:color .2s ease}@media (min-width: 768px){.md\\:container-center{display:flex;align-items:center;justify-content:center}}#checkout-modal .placeholder\\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}#checkout-modal .placeholder\\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}#checkout-modal .placeholder\\:text-tone-50::-moz-placeholder{color:hsl(var(--tone-50))}#checkout-modal .placeholder\\:text-tone-50::placeholder{color:hsl(var(--tone-50))}#checkout-modal .before\\:absolute:before{content:var(--tw-content);position:absolute}#checkout-modal .before\\:-top-0:before{content:var(--tw-content);top:-0px}#checkout-modal .before\\:left-0:before{content:var(--tw-content);left:0}#checkout-modal .before\\:h-4:before{content:var(--tw-content);height:1rem}#checkout-modal .before\\:w-4:before{content:var(--tw-content);width:1rem}#checkout-modal .before\\:-translate-y-1:before{content:var(--tw-content);--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:translate-x-\\[-45\\%\\]:before{content:var(--tw-content);--tw-translate-x: -45%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:translate-x-\\[0\\%\\]:before{content:var(--tw-content);--tw-translate-x: 0%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:rotate-45:before{content:var(--tw-content);--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:bg-white:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}#checkout-modal .hover\\:block:hover{display:block}#checkout-modal .hover\\:w-full:hover{width:100%}#checkout-modal .hover\\:rotate-0:hover{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .hover\\:font-bold:hover{font-weight:700}#checkout-modal .hover\\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}#checkout-modal .hover\\:underline:hover{text-decoration-line:underline}#checkout-modal .hover\\:opacity-100:hover{opacity:1}#checkout-modal .hover\\:opacity-80:hover{opacity:.8}#checkout-modal :is(.group:hover .group-hover\\:block){display:block}#checkout-modal :is(.group:hover .group-hover\\:w-4\\/5){width:80%}#checkout-modal :is(.group:hover .group-hover\\:w-full){width:100%}#checkout-modal :is(.group:hover .group-hover\\:rotate-0){--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width: 640px){#checkout-modal .sm\\:my-8{margin-top:2rem;margin-bottom:2rem}#checkout-modal .sm\\:items-center{align-items:center}}@media (min-width: 768px){#checkout-modal .md\\:mb-5{margin-bottom:1.25rem}#checkout-modal .md\\:mt-6{margin-top:1.5rem}#checkout-modal .md\\:mt-8{margin-top:2rem}#checkout-modal .md\\:block{display:block}#checkout-modal .md\\:flex{display:flex}#checkout-modal .md\\:hidden{display:none}#checkout-modal .md\\:min-h-\\[70\\%\\]{min-height:70%}#checkout-modal .md\\:w-16{width:4rem}#checkout-modal .md\\:w-20{width:5rem}#checkout-modal .md\\:w-3\\/5{width:60%}#checkout-modal .md\\:w-4\\/5{width:80%}#checkout-modal .md\\:w-4\\/6{width:66.666667%}#checkout-modal .md\\:min-w-\\[18rem\\]{min-width:18rem}#checkout-modal .md\\:max-w-\\[600px\\]{max-width:600px}#checkout-modal .md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#checkout-modal .md\\:justify-between{justify-content:space-between}#checkout-modal .md\\:gap-6{gap:1.5rem}#checkout-modal .md\\:gap-9{gap:2.25rem}#checkout-modal .md\\:rounded-lg{border-radius:.5rem}#checkout-modal .md\\:px-5{padding-left:1.25rem;padding-right:1.25rem}#checkout-modal .md\\:px-7{padding-left:1.75rem;padding-right:1.75rem}#checkout-modal .md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}#checkout-modal .md\\:py-4{padding-top:1rem;padding-bottom:1rem}#checkout-modal .md\\:py-5{padding-top:1.25rem;padding-bottom:1.25rem}#checkout-modal .md\\:text-xs{font-size:.75rem;line-height:1rem}}@media (min-width: 1024px){#checkout-modal .lg\\:block{display:block}#checkout-modal .lg\\:max-w-\\[20rem\\]{max-width:20rem}#checkout-modal .lg\\:px-7{padding-left:1.75rem;padding-right:1.75rem}#checkout-modal .lg\\:px-8{padding-left:2rem;padding-right:2rem}}
1
+ (function(De,Ae){typeof exports=="object"&&typeof module<"u"?Ae(exports):typeof define=="function"&&define.amd?define(["exports"],Ae):(De=typeof globalThis<"u"?globalThis:De||self,Ae(De.SpotflowCheckout={}))})(this,function(De){"use strict";var wc=Object.defineProperty;var kc=(De,Ae,En)=>Ae in De?wc(De,Ae,{enumerable:!0,configurable:!0,writable:!0,value:En}):De[Ae]=En;var h=(De,Ae,En)=>kc(De,typeof Ae!="symbol"?Ae+"":Ae,En);var Ae=document.createElement("style");Ae.textContent=`*:where(#checkout-modal,#checkout-modal *),:before:where(#checkout-modal,#checkout-modal *),:after:where(#checkout-modal,#checkout-modal *){box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before:where(#checkout-modal,#checkout-modal *),:after:where(#checkout-modal,#checkout-modal *){--tw-content: ""}#checkout-modal{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:IBM Plex Sans,Inter,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}#checkout-modal{margin:0;line-height:inherit}hr:where(#checkout-modal,#checkout-modal *){height:0;color:inherit;border-top-width:1px}abbr:where([title]):where(#checkout-modal,#checkout-modal *){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1:where(#checkout-modal,#checkout-modal *),h2:where(#checkout-modal,#checkout-modal *),h3:where(#checkout-modal,#checkout-modal *),h4:where(#checkout-modal,#checkout-modal *),h5:where(#checkout-modal,#checkout-modal *),h6:where(#checkout-modal,#checkout-modal *){font-size:inherit;font-weight:inherit}a:where(#checkout-modal,#checkout-modal *){color:inherit;text-decoration:inherit}b:where(#checkout-modal,#checkout-modal *),strong:where(#checkout-modal,#checkout-modal *){font-weight:bolder}code:where(#checkout-modal,#checkout-modal *),kbd:where(#checkout-modal,#checkout-modal *),samp:where(#checkout-modal,#checkout-modal *),pre:where(#checkout-modal,#checkout-modal *){font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small:where(#checkout-modal,#checkout-modal *){font-size:80%}sub:where(#checkout-modal,#checkout-modal *),sup:where(#checkout-modal,#checkout-modal *){font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub:where(#checkout-modal,#checkout-modal *){bottom:-.25em}sup:where(#checkout-modal,#checkout-modal *){top:-.5em}table:where(#checkout-modal,#checkout-modal *){text-indent:0;border-color:inherit;border-collapse:collapse}button:where(#checkout-modal,#checkout-modal *),input:where(#checkout-modal,#checkout-modal *),optgroup:where(#checkout-modal,#checkout-modal *),select:where(#checkout-modal,#checkout-modal *),textarea:where(#checkout-modal,#checkout-modal *){font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button:where(#checkout-modal,#checkout-modal *),select:where(#checkout-modal,#checkout-modal *){text-transform:none}button:where(#checkout-modal,#checkout-modal *),input:where([type=button]):where(#checkout-modal,#checkout-modal *),input:where([type=reset]):where(#checkout-modal,#checkout-modal *),input:where([type=submit]):where(#checkout-modal,#checkout-modal *){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring:where(#checkout-modal,#checkout-modal *){outline:auto}:-moz-ui-invalid:where(#checkout-modal,#checkout-modal *){box-shadow:none}progress:where(#checkout-modal,#checkout-modal *){vertical-align:baseline}::-webkit-inner-spin-button:where(#checkout-modal,#checkout-modal *),::-webkit-outer-spin-button:where(#checkout-modal,#checkout-modal *){height:auto}[type=search]:where(#checkout-modal,#checkout-modal *){-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration:where(#checkout-modal,#checkout-modal *){-webkit-appearance:none}::-webkit-file-upload-button:where(#checkout-modal,#checkout-modal *){-webkit-appearance:button;font:inherit}summary:where(#checkout-modal,#checkout-modal *){display:list-item}blockquote:where(#checkout-modal,#checkout-modal *),dl:where(#checkout-modal,#checkout-modal *),dd:where(#checkout-modal,#checkout-modal *),h1:where(#checkout-modal,#checkout-modal *),h2:where(#checkout-modal,#checkout-modal *),h3:where(#checkout-modal,#checkout-modal *),h4:where(#checkout-modal,#checkout-modal *),h5:where(#checkout-modal,#checkout-modal *),h6:where(#checkout-modal,#checkout-modal *),hr:where(#checkout-modal,#checkout-modal *),figure:where(#checkout-modal,#checkout-modal *),p:where(#checkout-modal,#checkout-modal *),pre:where(#checkout-modal,#checkout-modal *){margin:0}fieldset:where(#checkout-modal,#checkout-modal *){margin:0;padding:0}legend:where(#checkout-modal,#checkout-modal *){padding:0}ol:where(#checkout-modal,#checkout-modal *),ul:where(#checkout-modal,#checkout-modal *),menu:where(#checkout-modal,#checkout-modal *){list-style:none;margin:0;padding:0}dialog:where(#checkout-modal,#checkout-modal *){padding:0}textarea:where(#checkout-modal,#checkout-modal *){resize:vertical}input::-moz-placeholder:where(#checkout-modal,#checkout-modal *),textarea::-moz-placeholder:where(#checkout-modal,#checkout-modal *){opacity:1;color:#9ca3af}input::placeholder:where(#checkout-modal,#checkout-modal *),textarea::placeholder:where(#checkout-modal,#checkout-modal *){opacity:1;color:#9ca3af}button:where(#checkout-modal,#checkout-modal *),[role=button]:where(#checkout-modal,#checkout-modal *){cursor:pointer}:disabled:where(#checkout-modal,#checkout-modal *){cursor:default}img:where(#checkout-modal,#checkout-modal *),svg:where(#checkout-modal,#checkout-modal *),video:where(#checkout-modal,#checkout-modal *),canvas:where(#checkout-modal,#checkout-modal *),audio:where(#checkout-modal,#checkout-modal *),iframe:where(#checkout-modal,#checkout-modal *),embed:where(#checkout-modal,#checkout-modal *),object:where(#checkout-modal,#checkout-modal *){display:block;vertical-align:middle}img:where(#checkout-modal,#checkout-modal *),video:where(#checkout-modal,#checkout-modal *){max-width:100%;height:auto}[hidden]:where(#checkout-modal,#checkout-modal *){display:none}:root{--primary: 264, 52%, 6%;--primary-light: 266, 21%, 76%;--primary-10: 240, 39%, 86%, 1;--primary-lighter: 240, 100%, 98%;--primary-dark: 240, 39%, 52%;--primary-darker: 240, 100%, 28%;--success: 151, 58%, 46%;--error: 0, 74%, 48%;--error-dark: 19, 100%, 37%;--common: 60, 4%, 43%;--tone-10: 240, 2%, 90%;--tone-40: 202, 6%, 82%;--tone-50: 202, 4%, 68%;--tone-60: 260, 4%, 43%, 1;--tone-70: 266, 3%, 53%;--tone-80: 265, 10%, 24%, 1;--tone-90: 266, 18%, 15%;--tone-100: 266, 54%, 6%;--grey: 218, 15%, 65%;--grey-100: 270, 3%, 62%;--grey-200: 264, 3%, 72%;--grey-300: 260, 3%, 81%;--grey-400: 264, 6%, 34%;--grey-500: 217, 24%, 27%;--grey-600: 265, 10%, 24%;--grey-700: 260, 4%, 43%;--grey-800: 265, 21%, 76%;--grey-faint: 240, 7%, 97%;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}input:focus,button:focus{outline:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.container-center{display:flex;align-items:center;justify-content:center}.hide-scrollbar::-webkit-scrollbar{display:none!important}.hide-scrollbar{-ms-overflow-style:none!important;scrollbar-width:none!important}.container-between{display:flex;align-items:center;justify-content:space-between}.align-center{display:flex;align-items:center}.box-container{padding-left:0;padding-right:0;padding-top:1rem;padding-bottom:1rem}@media (min-width: 768px){.box-container{padding:1.75rem 1.25rem}}@media (min-width: 1024px){.box-container{padding-left:1.75rem;padding-right:1.75rem}}.button-fill{display:flex;height:2.5rem;align-items:center;justify-content:center;border-radius:.5rem;background-color:hsl(var(--primary));font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.button-outline{display:flex;height:2.5rem;align-items:center;justify-content:center;border-radius:.5rem;border-width:1px;border-color:hsl(var(--tone-100));font-size:.875rem;line-height:1.25rem;font-weight:600;color:hsl(var(--tone-100))}.payment-options{display:flex;width:100%;flex-direction:column;overflow:hidden}.tab{margin-bottom:.75rem;display:flex;align-items:center;justify-content:flex-start;text-align:left}.tab-button{display:flex;width:100%;flex-grow:1;align-items:center;border-radius:.5rem;border-width:1px;border-color:hsl(var(--grey-100));padding:.75rem 1.25rem;text-align:center;color:hsl(var(--primary))}.tab-button:disabled{cursor:not-allowed;opacity:.4}.tab-button:hover:disabled{border-color:#11032666;color:hsl(var(--primary) / .4)}@media (min-width: 768px){.tab-button{display:flex;justify-content:center}.tab-button:hover{border-color:hsl(var(--primary))}}.tab-button.active{border-width:2px;border-color:hsl(var(--primary))}.tab-button.active span{font-weight:700}.tab-button span{margin-top:.25rem;margin-bottom:.25rem;display:flex;flex-shrink:0;justify-content:center}@media (min-width: 768px){.tab-button span{font-size:.875rem;line-height:1.25rem}}@media (min-width: 1024px){.tab-button span{justify-content:flex-start}}.main{max-height:98dvh;width:100%;overflow:auto}@media (min-width: 768px){.main{padding-top:1rem;padding-bottom:1rem}}@media (min-width: 1024px){.main{width:calc(100% - 250px);padding-left:1rem;padding-right:1rem}}.header-container{border-radius:.75rem;padding:2.5rem 1rem;color:hsl(var(--primary))}@media (min-width: 768px){.header-container{padding:1.25rem 2.25rem}}.tooltip{position:absolute;left:-3rem;top:20px;margin-bottom:1.25rem;display:none;width:auto;flex-direction:column;align-items:center}.group:hover .tooltip{display:flex}@media (min-width: 768px){.tooltip{left:0}}.tooltip-textbox{position:relative;z-index:10;border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:.5rem;font-size:.75rem;line-height:1rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media (min-width: 768px){.tooltip-textbox{padding:.75rem 1rem}}.tooltip-text{font-size:13px;line-height:17.4px;letter-spacing:.025em;color:hsl(var(--grey))}.details-input-container{width:100%;border-width:1px;border-style:none;--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));font-weight:600;color:hsl(var(--tone-100))}.details-input-container::-moz-placeholder{font-size:.875rem;line-height:1.25rem;color:hsl(var(--tone-100))}.details-input-container::placeholder{font-size:.875rem;line-height:1.25rem;color:hsl(var(--tone-100))}.details-input-container:focus{outline:2px solid transparent;outline-offset:2px}.details-input-container:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.avs-input-container{width:100%;border-radius:.25rem;border-width:1px;border-color:hsl(var(--tone-40));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:1.5rem .75rem .5rem;color:hsl(var(--tone-100))}.avs-input-container:focus{border-color:hsl(var(--grey-100));outline:2px solid transparent;outline-offset:2px}.avs-input-container:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.mm-input-container{width:100%;border-radius:.5rem;border-width:1px;border-color:hsl(var(--tone-40));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:1.5rem .75rem .5rem;color:hsl(var(--tone-100))}.mm-input-container::-moz-placeholder{color:hsl(var(--tone-50))}.mm-input-container::placeholder{color:hsl(var(--tone-50))}.mm-input-container:focus{border-color:hsl(var(--grey-100));outline:2px solid transparent;outline-offset:2px}.mm-input-container:focus-visible{outline:2px solid transparent!important;outline-offset:2px!important}.details-form-button{display:inline-flex;height:50px;width:100%;align-items:center;justify-content:center;border-radius:.5rem;background-color:hsl(var(--primary));font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.details-form-button:focus{outline:2px solid transparent;outline-offset:2px}.details-form-button:disabled{background-color:hsl(var(--grey-100));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.pin-input{height:3.5rem;width:4rem;border-radius:.5rem;border-width:1px;border-color:hsla(var(--tone-90));text-align:center;font-size:1.125rem;line-height:1.75rem}.pin-input:focus{border-color:hsl(var(--primary));outline:2px solid transparent;outline-offset:2px}@media (min-width: 768px){.pin-input{height:3.5rem;width:6rem}}.otp-input{width:100%;border-radius:.5rem;border-width:1px;border-color:hsla(var(--tone-90));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity));padding:.75rem;font-size:1.5rem;line-height:2rem;font-weight:700}.otp-input:focus{outline:2px solid transparent;outline-offset:2px}.otp-button{height:3.5rem;width:100%;border-radius:.5rem;background-color:hsl(var(--tone-100));padding-left:1.5rem;padding-right:1.5rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.otp-button:disabled{background-color:hsl(var(--grey-100))}.warning-text,.success-text{margin-top:1rem;margin-bottom:1rem;margin-left:auto;margin-right:auto;text-align:center;font-weight:600;color:hsl(var(--grey-400))}.warning-list{margin-left:auto;margin-right:auto;margin-top:.25rem}@media (min-width: 768px){.warning-list{margin-top:.5rem}}.warning-button,.success-button{margin-bottom:1rem;width:100%;border-radius:.5rem;border-width:1px;border-color:hsl(var(--grey-800));padding:1rem;text-align:center;font-size:.875rem;line-height:1.25rem;font-weight:600;color:hsl(var(--grey-400))}.transfer-close{margin-bottom:1rem;width:200px;border-radius:.5rem;background-color:hsl(var(--success));padding:1rem;text-align:center;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#bank-search-input{width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:2px solid transparent;outline-offset:2px}#bank-select-container{display:flex;gap:.75rem;border-radius:.5rem;border-width:1px;border-color:hsl(var(--primary-light));padding:1rem}#bank-code-span{border-radius:.25rem;background-color:hsla(var(--primary-10));padding:.25rem;color:hsla(var(--tone-60))}.spinner{margin-right:.75rem;height:2rem;width:2rem}.spinner{animation:spin 1s linear infinite;fill:#fff}.transaction-issues-input{display:flex;height:3.5rem;width:100%;-webkit-user-select:all;-moz-user-select:all;user-select:all;border-radius:.5rem;border-width:1px;border-style:none;--tw-bg-opacity: 1;background-color:rgb(247 248 251 / var(--tw-bg-opacity));padding-left:1rem;padding-right:1rem;padding-top:1.25rem;padding-bottom:0;color:hsl(var(--tone-100));outline:2px solid transparent!important;outline-offset:2px!important;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transaction-issues-input:disabled{cursor:not-allowed;opacity:.5}.active-tab{border-bottom-width:2px;border-color:hsl(var(--tone-100));padding-bottom:.25rem;font-weight:500;color:hsl(var(--tone-100))}.transaction-issues-input-placeholder{pointer-events:none;position:absolute;top:1rem;bottom:1rem;left:.75rem;z-index:20;margin:0;display:flex;height:-moz-fit-content;height:fit-content;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;padding-left:.25rem;padding-right:.25rem;font-size:.625rem;color:hsla(var(--tone-70));transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.peer:-moz-placeholder-shown~.transaction-issues-input-placeholder{margin:auto;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding-left:0;padding-right:0;font-size:.875rem;line-height:1.25rem}.peer:placeholder-shown~.transaction-issues-input-placeholder{margin:auto;--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding-left:0;padding-right:0;font-size:.875rem;line-height:1.25rem}.peer:focus~.transaction-issues-input-placeholder{margin:0;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));padding-left:.25rem;padding-right:.25rem;font-size:.625rem}#checkout-modal .static{position:static}#checkout-modal .fixed{position:fixed}#checkout-modal .absolute{position:absolute}#checkout-modal .relative{position:relative}#checkout-modal .inset-0{top:0;right:0;bottom:0;left:0}#checkout-modal .inset-y-4{top:1rem;bottom:1rem}#checkout-modal .left-0{left:0}#checkout-modal .right-4{right:1rem}#checkout-modal .top-0{top:0}#checkout-modal .top-1{top:.25rem}#checkout-modal .top-1\\/2{top:50%}#checkout-modal .top-5{top:1.25rem}#checkout-modal .z-10{z-index:10}#checkout-modal .z-30{z-index:30}#checkout-modal .z-\\[3000\\]{z-index:3000}#checkout-modal .order-1{order:1}#checkout-modal .order-2{order:2}#checkout-modal .mx-5{margin-left:1.25rem;margin-right:1.25rem}#checkout-modal .mx-\\[18px\\]{margin-left:18px;margin-right:18px}#checkout-modal .mx-auto{margin-left:auto;margin-right:auto}#checkout-modal .my-3{margin-top:.75rem;margin-bottom:.75rem}#checkout-modal .mb-1{margin-bottom:.25rem}#checkout-modal .mb-2{margin-bottom:.5rem}#checkout-modal .mb-3{margin-bottom:.75rem}#checkout-modal .mb-4{margin-bottom:1rem}#checkout-modal .mb-5{margin-bottom:1.25rem}#checkout-modal .mb-7{margin-bottom:1.75rem}#checkout-modal .mb-8{margin-bottom:2rem}#checkout-modal .ml-1{margin-left:.25rem}#checkout-modal .ml-20{margin-left:5rem}#checkout-modal .ml-9{margin-left:2.25rem}#checkout-modal .ml-auto{margin-left:auto}#checkout-modal .mr-1{margin-right:.25rem}#checkout-modal .mr-11{margin-right:2.75rem}#checkout-modal .mt-1{margin-top:.25rem}#checkout-modal .mt-10{margin-top:2.5rem}#checkout-modal .mt-2{margin-top:.5rem}#checkout-modal .mt-3{margin-top:.75rem}#checkout-modal .mt-4{margin-top:1rem}#checkout-modal .mt-5{margin-top:1.25rem}#checkout-modal .mt-6{margin-top:1.5rem}#checkout-modal .mt-7{margin-top:1.75rem}#checkout-modal .mt-8{margin-top:2rem}#checkout-modal .block{display:block}#checkout-modal .inline-block{display:inline-block}#checkout-modal .flex{display:flex}#checkout-modal .grid{display:grid}#checkout-modal .contents{display:contents}#checkout-modal .hidden{display:none}#checkout-modal .h-12{height:3rem}#checkout-modal .h-3{height:.75rem}#checkout-modal .h-8{height:2rem}#checkout-modal .h-\\[22px\\]{height:22px}#checkout-modal .h-\\[40dvh\\]{height:40dvh}#checkout-modal .h-\\[40vh\\]{height:40vh}#checkout-modal .h-\\[50px\\]{height:50px}#checkout-modal .h-auto{height:auto}#checkout-modal .h-full{height:100%}#checkout-modal .max-h-screen{max-height:100vh}#checkout-modal .min-h-\\[20dvh\\]{min-height:20dvh}#checkout-modal .min-h-\\[30dvh\\]{min-height:30dvh}#checkout-modal .min-h-\\[40dvh\\]{min-height:40dvh}#checkout-modal .min-h-full{min-height:100%}#checkout-modal .min-h-screen{min-height:100vh}#checkout-modal .w-0{width:0px}#checkout-modal .w-11\\/12{width:91.666667%}#checkout-modal .w-12{width:3rem}#checkout-modal .w-14{width:3.5rem}#checkout-modal .w-16{width:4rem}#checkout-modal .w-3{width:.75rem}#checkout-modal .w-4\\/5{width:80%}#checkout-modal .w-60{width:15rem}#checkout-modal .w-8{width:2rem}#checkout-modal .w-9\\/12{width:75%}#checkout-modal .w-\\[200px\\]{width:200px}#checkout-modal .w-full{width:100%}#checkout-modal .min-w-\\[15rem\\]{min-width:15rem}#checkout-modal .max-w-\\[200px\\]{max-width:200px}#checkout-modal .flex-1{flex:1 1 0%}#checkout-modal .flex-shrink-0{flex-shrink:0}#checkout-modal .flex-grow,#checkout-modal .grow{flex-grow:1}#checkout-modal .-translate-y-2\\/4{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .translate-x-\\[-45\\%\\]{--tw-translate-x: -45%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .translate-x-\\[0\\%\\]{--tw-translate-x: 0%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .scale-95{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}#checkout-modal .animate-spin{animation:spin 1s linear infinite}#checkout-modal .cursor-pointer{cursor:pointer}#checkout-modal .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}#checkout-modal .grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}#checkout-modal .grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#checkout-modal .grid-cols-\\[1fr_auto\\]{grid-template-columns:1fr auto}#checkout-modal .grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))}#checkout-modal .grid-rows-\\[auto_1fr\\]{grid-template-rows:auto 1fr}#checkout-modal .flex-col{flex-direction:column}#checkout-modal .items-start{align-items:flex-start}#checkout-modal .items-end{align-items:flex-end}#checkout-modal .items-center{align-items:center}#checkout-modal .justify-center{justify-content:center}#checkout-modal .justify-between{justify-content:space-between}#checkout-modal .gap-1{gap:.25rem}#checkout-modal .gap-1\\.5{gap:.375rem}#checkout-modal .gap-2{gap:.5rem}#checkout-modal .gap-3{gap:.75rem}#checkout-modal .gap-4{gap:1rem}#checkout-modal .gap-5{gap:1.25rem}#checkout-modal .gap-6{gap:1.5rem}#checkout-modal .gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}#checkout-modal .justify-self-center{justify-self:center}#checkout-modal .overflow-hidden{overflow:hidden}#checkout-modal .overflow-y-auto{overflow-y:auto}#checkout-modal .whitespace-normal{white-space:normal}#checkout-modal .whitespace-nowrap{white-space:nowrap}#checkout-modal .break-words{overflow-wrap:break-word}#checkout-modal .rounded-2xl{border-radius:1rem}#checkout-modal .rounded-\\[40px\\]{border-radius:40px}#checkout-modal .rounded-full{border-radius:9999px}#checkout-modal .rounded-lg{border-radius:.5rem}#checkout-modal .rounded-md{border-radius:.375rem}#checkout-modal .border,#checkout-modal .border-\\[1px\\]{border-width:1px}#checkout-modal .border-b{border-bottom-width:1px}#checkout-modal .border-r{border-right-width:1px}#checkout-modal .border-dashed{border-style:dashed}#checkout-modal .border-\\[\\#C0B5CF\\]{--tw-border-opacity: 1;border-color:rgb(192 181 207 / var(--tw-border-opacity))}#checkout-modal .border-\\[\\#D0D5DD\\]{--tw-border-opacity: 1;border-color:rgb(208 213 221 / var(--tw-border-opacity))}#checkout-modal .border-\\[\\#D62020\\]{--tw-border-opacity: 1;border-color:rgb(214 32 32 / var(--tw-border-opacity))}#checkout-modal .border-grey-100{border-color:hsl(var(--grey-100))}#checkout-modal .border-primary{border-color:hsl(var(--primary))}#checkout-modal .border-tone-10{border-color:hsl(var(--tone-10))}#checkout-modal .border-tone-40{border-color:hsl(var(--tone-40))}#checkout-modal .border-tone-50{border-color:hsl(var(--tone-50))}#checkout-modal .border-tone-70{border-color:hsla(var(--tone-70))}#checkout-modal .border-b-grey-faint{border-bottom-color:hsl(var(--grey-faint))}#checkout-modal .bg-\\[\\#FEF7ED\\]{--tw-bg-opacity: 1;background-color:rgb(254 247 237 / var(--tw-bg-opacity))}#checkout-modal .bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}#checkout-modal .bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}#checkout-modal .bg-primary{background-color:hsl(var(--primary))}#checkout-modal .bg-tone-10{background-color:hsl(var(--tone-10))}#checkout-modal .bg-tone-100{background-color:hsl(var(--tone-100))}#checkout-modal .bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}#checkout-modal .bg-opacity-30{--tw-bg-opacity: .3}#checkout-modal .object-contain{-o-object-fit:contain;object-fit:contain}#checkout-modal .p-0{padding:0}#checkout-modal .p-1{padding:.25rem}#checkout-modal .p-2{padding:.5rem}#checkout-modal .p-3{padding:.75rem}#checkout-modal .p-4{padding:1rem}#checkout-modal .px-0{padding-left:0;padding-right:0}#checkout-modal .px-2{padding-left:.5rem;padding-right:.5rem}#checkout-modal .px-3{padding-left:.75rem;padding-right:.75rem}#checkout-modal .px-3\\.5{padding-left:.875rem;padding-right:.875rem}#checkout-modal .px-4{padding-left:1rem;padding-right:1rem}#checkout-modal .px-6{padding-left:1.5rem;padding-right:1.5rem}#checkout-modal .py-1{padding-top:.25rem;padding-bottom:.25rem}#checkout-modal .py-2{padding-top:.5rem;padding-bottom:.5rem}#checkout-modal .py-3{padding-top:.75rem;padding-bottom:.75rem}#checkout-modal .py-4{padding-top:1rem;padding-bottom:1rem}#checkout-modal .py-5{padding-top:1.25rem;padding-bottom:1.25rem}#checkout-modal .pb-0{padding-bottom:0}#checkout-modal .pb-1{padding-bottom:.25rem}#checkout-modal .pb-3{padding-bottom:.75rem}#checkout-modal .pb-4{padding-bottom:1rem}#checkout-modal .pb-5{padding-bottom:1.25rem}#checkout-modal .pl-4{padding-left:1rem}#checkout-modal .pr-2{padding-right:.5rem}#checkout-modal .pr-7{padding-right:1.75rem}#checkout-modal .pt-0{padding-top:0}#checkout-modal .pt-1{padding-top:.25rem}#checkout-modal .pt-3{padding-top:.75rem}#checkout-modal .pt-5{padding-top:1.25rem}#checkout-modal .pt-6{padding-top:1.5rem}#checkout-modal .text-left{text-align:left}#checkout-modal .text-center{text-align:center}#checkout-modal .text-2xl{font-size:1.5rem;line-height:2rem}#checkout-modal .text-\\[10px\\]{font-size:10px}#checkout-modal .text-\\[11px\\]{font-size:11px}#checkout-modal .text-base{font-size:1rem;line-height:1.5rem}#checkout-modal .text-lg{font-size:1.125rem;line-height:1.75rem}#checkout-modal .text-sm{font-size:.875rem;line-height:1.25rem}#checkout-modal .text-xl{font-size:1.25rem;line-height:1.75rem}#checkout-modal .text-xs{font-size:.75rem;line-height:1rem}#checkout-modal .text-xxs{font-size:.625rem}#checkout-modal .font-bold{font-weight:700}#checkout-modal .font-medium{font-weight:500}#checkout-modal .font-normal{font-weight:400}#checkout-modal .font-semibold{font-weight:600}#checkout-modal .uppercase{text-transform:uppercase}#checkout-modal .lowercase{text-transform:lowercase}#checkout-modal .tracking-\\[0\\.5px\\]{letter-spacing:.5px}#checkout-modal .text-\\[\\#816039\\]{--tw-text-opacity: 1;color:rgb(129 96 57 / var(--tw-text-opacity))}#checkout-modal .text-\\[\\#98A2B3\\]{--tw-text-opacity: 1;color:rgb(152 162 179 / var(--tw-text-opacity))}#checkout-modal .text-\\[\\#D62020\\]{--tw-text-opacity: 1;color:rgb(214 32 32 / var(--tw-text-opacity))}#checkout-modal .text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}#checkout-modal .text-error{color:hsl(var(--error))}#checkout-modal .text-error-dark{color:hsl(var(--error-dark))}#checkout-modal .text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}#checkout-modal .text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}#checkout-modal .text-grey-100{color:hsl(var(--grey-100))}#checkout-modal .text-grey-400{color:hsl(var(--grey-400))}#checkout-modal .text-tone-100{color:hsl(var(--tone-100))}#checkout-modal .text-tone-40{color:hsl(var(--tone-40))}#checkout-modal .text-tone-50{color:hsl(var(--tone-50))}#checkout-modal .text-tone-60{color:hsla(var(--tone-60))}#checkout-modal .text-tone-70{color:hsla(var(--tone-70))}#checkout-modal .text-tone-80{color:hsla(var(--tone-80))}#checkout-modal .text-tone-90{color:hsla(var(--tone-90))}#checkout-modal .text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}#checkout-modal .opacity-0{opacity:0}#checkout-modal .shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#checkout-modal .shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#checkout-modal .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#checkout-modal .transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#checkout-modal .duration-200{transition-duration:.2s}#checkout-modal .duration-500{transition-duration:.5s}#checkout-modal .duration-700{transition-duration:.7s}#checkout-modal *::-webkit-scrollbar{height:.2em;width:.4em;cursor:pointer;--tw-bg-opacity: 1;background-color:rgb(244 244 244 / var(--tw-bg-opacity))}#checkout-modal *::-webkit-scrollbar-track{border-radius:100vh;--tw-bg-opacity: 1;background-color:rgb(153 146 146 / var(--tw-bg-opacity))}#checkout-modal *::-webkit-scrollbar-thumb{cursor:pointer;border-radius:100vh;border-width:3px;--tw-border-opacity: 1;border-color:rgb(112 112 112 / var(--tw-border-opacity));--tw-bg-opacity: 1;background-color:rgb(224 203 203 / var(--tw-bg-opacity))}#checkout-modal *::-webkit-scrollbar-thumb:hover{background:#53b6ed}@font-face{font-family:IBM Plex Sans;src:url("https://d104jydf2tp7hm.cloudfront.net/IBM Plex Sans/IBMPlexSans-Regular.ttf");font-weight:400;font-display:swap}@font-face{font-family:IBM Plex Sans;src:url("https://d104jydf2tp7hm.cloudfront.net/IBM Plex Sans/IBMPlexSans-SemiBold.ttf");font-weight:600;font-display:swap}@font-face{font-family:IBM Plex Sans;src:url("https://d104jydf2tp7hm.cloudfront.net/IBM Plex Sans/IBMPlexSans-Bold.ttf");font-weight:700;font-display:swap}.tab-button.active:after{animation:text-underline-animation .3s linear forwards}#toast-container{width:100%;margin:0 auto}.toast{display:flex;align-items:center;padding:15px;margin-bottom:10px;border-radius:5px;opacity:0;transform:translateY(-50px);transition:opacity .5s,transform .5s;box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a}.toast.show{opacity:1;transform:translateY(0)}.toast.success{background-color:hsl(var(--success));color:#fff}.toast.error{background-color:hsl(var(--error));color:#fff}.toast .close-btn{margin-left:auto;cursor:pointer;color:#fff}.progress-container{width:100%;height:10px;background-color:#f3f3f3;border-radius:5px;overflow:hidden;position:relative}.progress-bar{height:100%;background-color:#4caf50;width:0;position:absolute;top:0;left:0;animation:progress 1s linear infinite}@keyframes progress{0%{width:0px}to{width:100%}}#checkout-modal{color:hsla(var(--tone-80))}#test-cards-link{cursor:pointer;transition:color .2s ease}@media (min-width: 768px){.md\\:container-center{display:flex;align-items:center;justify-content:center}}#checkout-modal .placeholder\\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}#checkout-modal .placeholder\\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}#checkout-modal .placeholder\\:text-tone-50::-moz-placeholder{color:hsl(var(--tone-50))}#checkout-modal .placeholder\\:text-tone-50::placeholder{color:hsl(var(--tone-50))}#checkout-modal .before\\:absolute:before{content:var(--tw-content);position:absolute}#checkout-modal .before\\:-top-0:before{content:var(--tw-content);top:-0px}#checkout-modal .before\\:left-0:before{content:var(--tw-content);left:0}#checkout-modal .before\\:h-4:before{content:var(--tw-content);height:1rem}#checkout-modal .before\\:w-4:before{content:var(--tw-content);width:1rem}#checkout-modal .before\\:-translate-y-1:before{content:var(--tw-content);--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:translate-x-\\[-45\\%\\]:before{content:var(--tw-content);--tw-translate-x: -45%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:translate-x-\\[0\\%\\]:before{content:var(--tw-content);--tw-translate-x: 0%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:rotate-45:before{content:var(--tw-content);--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .before\\:bg-white:before{content:var(--tw-content);--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}#checkout-modal .hover\\:block:hover{display:block}#checkout-modal .hover\\:w-full:hover{width:100%}#checkout-modal .hover\\:rotate-0:hover{--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#checkout-modal .hover\\:font-bold:hover{font-weight:700}#checkout-modal .hover\\:text-black:hover{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity))}#checkout-modal .hover\\:underline:hover{text-decoration-line:underline}#checkout-modal .hover\\:opacity-100:hover{opacity:1}#checkout-modal .hover\\:opacity-80:hover{opacity:.8}#checkout-modal :is(.group:hover .group-hover\\:block){display:block}#checkout-modal :is(.group:hover .group-hover\\:w-4\\/5){width:80%}#checkout-modal :is(.group:hover .group-hover\\:w-full){width:100%}#checkout-modal :is(.group:hover .group-hover\\:rotate-0){--tw-rotate: 0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@media (min-width: 640px){#checkout-modal .sm\\:my-8{margin-top:2rem;margin-bottom:2rem}#checkout-modal .sm\\:items-center{align-items:center}}@media (min-width: 768px){#checkout-modal .md\\:mb-5{margin-bottom:1.25rem}#checkout-modal .md\\:mt-6{margin-top:1.5rem}#checkout-modal .md\\:mt-8{margin-top:2rem}#checkout-modal .md\\:block{display:block}#checkout-modal .md\\:flex{display:flex}#checkout-modal .md\\:hidden{display:none}#checkout-modal .md\\:min-h-\\[70\\%\\]{min-height:70%}#checkout-modal .md\\:w-16{width:4rem}#checkout-modal .md\\:w-20{width:5rem}#checkout-modal .md\\:w-3\\/5{width:60%}#checkout-modal .md\\:w-4\\/5{width:80%}#checkout-modal .md\\:w-4\\/6{width:66.666667%}#checkout-modal .md\\:min-w-\\[18rem\\]{min-width:18rem}#checkout-modal .md\\:max-w-\\[600px\\]{max-width:600px}#checkout-modal .md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}#checkout-modal .md\\:justify-between{justify-content:space-between}#checkout-modal .md\\:gap-6{gap:1.5rem}#checkout-modal .md\\:gap-9{gap:2.25rem}#checkout-modal .md\\:rounded-lg{border-radius:.5rem}#checkout-modal .md\\:px-5{padding-left:1.25rem;padding-right:1.25rem}#checkout-modal .md\\:px-7{padding-left:1.75rem;padding-right:1.75rem}#checkout-modal .md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}#checkout-modal .md\\:py-4{padding-top:1rem;padding-bottom:1rem}#checkout-modal .md\\:py-5{padding-top:1.25rem;padding-bottom:1.25rem}#checkout-modal .md\\:text-xs{font-size:.75rem;line-height:1rem}}@media (min-width: 1024px){#checkout-modal .lg\\:block{display:block}#checkout-modal .lg\\:max-w-\\[20rem\\]{max-width:20rem}#checkout-modal .lg\\:px-7{padding-left:1.75rem;padding-right:1.75rem}#checkout-modal .lg\\:px-8{padding-left:2rem;padding-right:2rem}}
2
2
  `,document.head.appendChild(Ae);const En=`<div id="checkout-modal">
3
3
  <div role="dialog" class="relative z-10" aria-labelledby="modal-title" aria-modal="true">
4
4
  <div class="fixed inset-0 bg-black bg-opacity-30 transition-opacity" aria-hidden="true"></div>
@@ -46,7 +46,7 @@
46
46
  </div>
47
47
  <!-- end of footer -->
48
48
  </div>
49
- </div>`,ve=(n,e)=>e||n;let Y=class extends Error{constructor(e,i){super(e),this.status=i,this.name="FetchError"}},Ne=class extends Error{constructor(e){super(e),this.name="AuthorizationError"}};const Oe=(n,e,i)=>{if(!n)throw new Ne("Missing authorization token");const t=new Headers;return i||t.append("Content-Type","application/json"),t.append("Authorization",`Bearer ${n}`),e&&t.append("Spotflow-Payment-Code",e),t},Ve="https://api.spotflow.co/api/v1",As=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/payments`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const l=await s.json();throw l.message?l:new Y("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Ne?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},di=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/payments/authorize`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const l=await s.json();throw l.message?l:new Y("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Ne?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},Nt=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/payments`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const l=await s.json();throw l.message?l:new Y("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Ne?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},xs=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/payments`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const l=await s.json();throw l.message?new Y(l.message,s.status):new Y("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Ne?console.error(`AuthorizationError: ${o.message}`):console.error(`UnexpectedError: ${o}`),o}},an=async(n,e,i,t,o)=>{try{const s=Oe(n,t),a=await fetch(`${ve(Ve,o)}/payments/verify?reference=${e}`,{method:"GET",headers:s,signal:i});if(!a.ok){const d=await a.json();throw d.message?new Y(d.message,a.status):new Y("Network response was not ok",a.status)}return{data:await a.json(),headers:a.headers}}catch(s){throw s instanceof Y?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Ne?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}};async function Ls(n,e,i,t,o){const s=Oe(n,i);try{const a=await fetch(`${ve(Ve,t)}/mobile-money/providers?currency=${o||e}`,{headers:s,method:"GET"});if(!a.ok){const l=await a.json();throw l.message?new Y(l.message,a.status):new Y("Network response was not okay",a.status)}return await a.json()}catch(a){throw a instanceof Y?console.error(`FetchError: ${a.message} (status: ${a.status})`):a instanceof Ne?console.error(`AuthorizationError: ${a.message}`):console.error(`Unexpected error: ${a}`),a}}const Ts=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/payments/cancel`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const a=await s.json();throw a.message?new Y(a.message,s.status):new Y("Network response was not ok",s.status)}return{headers:s.headers}}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Ne?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},Es=async(n,e,i,t)=>{try{const o=Oe(n,i,!0),s=await fetch(`${ve(Ve,t)}/disputes/upload-documents`,{method:"POST",headers:o,body:e});if(!s.ok){const a=await s.json();throw a.message?new Y(a.message,s.status):new Y("Network response was not ok",s.status)}return s.json()}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Ne?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},Ps=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/disputes/reference`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const a=await s.json();throw a.message?new Y(a.message,s.status):new Y("Network response was not ok",s.status)}return s.json()}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Ne?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},ci=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/payments/retry`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const l=await s.json();throw l.message?l:new Y("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Ne?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}};async function Is(n,e,i,t,o){try{const s=Oe(n,t),a=await fetch(`${ve(Ve,o)}/payments/tax-quotes?amount=${e||""}&currency=${i||""}`,{headers:s,method:"GET"});if(!a.ok){const l=await a.json();throw l.message?new Y(l.message,a.status):new Y("Network response was not ok",a.status)}return a.json()}catch(s){throw s instanceof Y?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Ne?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}}const xe=(n,e)=>{const i=new Intl.NumberFormat("ng-NG",{style:"decimal",maximumFractionDigits:e||0,minimumFractionDigits:e||0});return isNaN(parseFloat(i.format(n)))?"-":i.format(n)},be={card:{key:"card",label:"Pay with Card",icon:`<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
49
+ </div>`,ve=(n,e)=>e||n;let Y=class extends Error{constructor(e,i){super(e),this.status=i,this.name="FetchError"}},Be=class extends Error{constructor(e){super(e),this.name="AuthorizationError"}};const Oe=(n,e,i)=>{if(!n)throw new Be("Missing authorization token");const t=new Headers;return i||t.append("Content-Type","application/json"),t.append("Authorization",`Bearer ${n}`),e&&t.append("Spotflow-Payment-Code",e),t},Ve="https://api.spotflow.co/api/v1",As=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/payments`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const l=await s.json();throw l.message?l:new Y("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Be?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},di=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/payments/authorize`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const l=await s.json();throw l.message?l:new Y("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Be?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},Bt=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/payments`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const l=await s.json();throw l.message?l:new Y("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Be?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},xs=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/payments`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const l=await s.json();throw l.message?new Y(l.message,s.status):new Y("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Be?console.error(`AuthorizationError: ${o.message}`):console.error(`UnexpectedError: ${o}`),o}},an=async(n,e,i,t,o)=>{try{const s=Oe(n,t),a=await fetch(`${ve(Ve,o)}/payments/verify?reference=${e}`,{method:"GET",headers:s,signal:i});if(!a.ok){const d=await a.json();throw d.message?new Y(d.message,a.status):new Y("Network response was not ok",a.status)}return{data:await a.json(),headers:a.headers}}catch(s){throw s instanceof Y?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Be?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}};async function Ls(n,e,i,t,o){const s=Oe(n,i);try{const a=await fetch(`${ve(Ve,t)}/mobile-money/providers?currency=${o||e}`,{headers:s,method:"GET"});if(!a.ok){const l=await a.json();throw l.message?new Y(l.message,a.status):new Y("Network response was not okay",a.status)}return await a.json()}catch(a){throw a instanceof Y?console.error(`FetchError: ${a.message} (status: ${a.status})`):a instanceof Be?console.error(`AuthorizationError: ${a.message}`):console.error(`Unexpected error: ${a}`),a}}const Ts=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/payments/cancel`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const a=await s.json();throw a.message?new Y(a.message,s.status):new Y("Network response was not ok",s.status)}return{headers:s.headers}}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Be?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},Es=async(n,e,i,t)=>{try{const o=Oe(n,i,!0),s=await fetch(`${ve(Ve,t)}/disputes/upload-documents`,{method:"POST",headers:o,body:e});if(!s.ok){const a=await s.json();throw a.message?new Y(a.message,s.status):new Y("Network response was not ok",s.status)}return s.json()}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Be?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},Ps=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/disputes/reference`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const a=await s.json();throw a.message?new Y(a.message,s.status):new Y("Network response was not ok",s.status)}return s.json()}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Be?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},ci=async(n,e,i,t)=>{try{const o=Oe(n,i),s=await fetch(`${ve(Ve,t)}/payments/retry`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const l=await s.json();throw l.message?l:new Y("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof Y?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof Be?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}};async function Is(n,e,i,t,o){try{const s=Oe(n,t),a=await fetch(`${ve(Ve,o)}/payments/tax-quotes?amount=${e||""}&currency=${i||""}`,{headers:s,method:"GET"});if(!a.ok){const l=await a.json();throw l.message?new Y(l.message,a.status):new Y("Network response was not ok",a.status)}return a.json()}catch(s){throw s instanceof Y?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof Be?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}}const xe=(n,e)=>{const i=new Intl.NumberFormat("ng-NG",{style:"decimal",maximumFractionDigits:e||0,minimumFractionDigits:e||0});return isNaN(parseFloat(i.format(n)))?"-":i.format(n)},be={card:{key:"card",label:"Pay with Card",icon:`<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
50
50
  <path d="M1.83398 6.16992H15.1673" stroke="currentColor" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
51
51
  <path d="M4.5 11.5034H5.83333" stroke="currentColor" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
52
52
  <path d="M7.5 11.5034H10.1667" stroke="currentColor" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
@@ -81,7 +81,7 @@
81
81
  <path d="M13.834 12.0002V7.3335" stroke="#0D0716" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
82
82
  <path d="M1.16602 14.6665H15.8327" stroke="#0D0716" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
83
83
  <path d="M8.5 5.6665C9.05228 5.6665 9.5 5.21879 9.5 4.6665C9.5 4.11422 9.05228 3.6665 8.5 3.6665C7.94772 3.6665 7.5 4.11422 7.5 4.6665C7.5 5.21879 7.94772 5.6665 8.5 5.6665Z" stroke="#0D0716" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
84
- </svg>`}};be.card.label,be.card.icon,be.card.key,be.bank_transfer.label,be.bank_transfer.icon,be.bank_transfer.key,be.ussd.label,be.ussd.icon,be.ussd.key,be.mobile_money.label,be.mobile_money.icon,be.mobile_money.key,be.eft.label,be.eft.icon,be.eft.key;const Dt=[{name:"MasterCard",icon:`<svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg">
84
+ </svg>`}};be.card.label,be.card.icon,be.card.key,be.bank_transfer.label,be.bank_transfer.icon,be.bank_transfer.key,be.ussd.label,be.ussd.icon,be.ussd.key,be.mobile_money.label,be.mobile_money.icon,be.mobile_money.key,be.eft.label,be.eft.icon,be.eft.key;const Nt=[{name:"MasterCard",icon:`<svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg">
85
85
  <path d="M15.3295 1.73883H8.91364V12.2617H15.3295V1.73883Z" fill="#FF5F00"/>
86
86
  <path d="M9.32119 6.99988C9.32018 5.98645 9.5718 4.98609 10.057 4.07454C10.5422 3.16299 11.2483 2.36413 12.1218 1.73845C11.0401 0.962455 9.74099 0.479876 8.37301 0.345869C7.00503 0.211862 5.62333 0.43183 4.38585 0.98064C3.14837 1.52945 2.10503 2.38496 1.37509 3.44937C0.645144 4.51379 0.258057 5.74417 0.258057 6.99988C0.258057 8.25559 0.645144 9.48597 1.37509 10.5504C2.10503 11.6148 3.14837 12.4703 4.38585 13.0191C5.62333 13.5679 7.00503 13.7879 8.37301 13.6539C9.74099 13.5199 11.0401 13.0373 12.1218 12.2613C11.2483 11.6356 10.5422 10.8368 10.057 9.92521C9.57181 9.01366 9.32019 8.0133 9.32119 6.99988Z" fill="#EB001B"/>
87
87
  <path d="M23.9852 6.99994C23.9852 8.25563 23.5982 9.48601 22.8683 10.5504C22.1384 11.6148 21.0951 12.4703 19.8576 13.0192C18.6201 13.568 17.2385 13.788 15.8705 13.654C14.5025 13.5199 13.2035 13.0374 12.1218 12.2614C12.9945 11.6351 13.7001 10.8361 14.1852 9.92466C14.6703 9.01325 14.9224 8.01321 14.9224 6.99994C14.9224 5.98667 14.6703 4.98663 14.1852 4.07522C13.7001 3.16381 12.9945 2.36483 12.1218 1.73851C13.2035 0.962513 14.5025 0.479933 15.8705 0.345928C17.2385 0.211923 18.6201 0.431901 19.8576 0.980717C21.0951 1.52953 22.1384 2.38504 22.8683 3.44946C23.5982 4.51387 23.9852 5.74425 23.9852 6.99994Z" fill="#F79E1B"/>
@@ -386,7 +386,7 @@
386
386
  </defs>
387
387
  </svg>
388
388
 
389
- `}],Bs=`<div>
389
+ `}],Ds=`<div>
390
390
  <form id="checkoutcard">
391
391
  <div>
392
392
  <div class="container-between">
@@ -472,21 +472,21 @@
472
472
  accordance with their terms.
473
473
  </p>
474
474
  </div>
475
- </div>`,Ns=()=>{const n=Date.now().toString(36),e="xxxx-xxxx-xxx-xxxx".replace(/[x]/g,()=>Math.floor(Math.random()*16).toString(16));return`SPF-${n}-${e}`.toUpperCase()},ui=(n="")=>n.replace(/\D+/g,""),Ds=n=>n.replace(/\D/g,""),Hs=n=>n.replace(/\D/g,"").replace(/(\d{4})(?=\d)/g,"$1 ").trim(),Rs=n=>ui(n).slice(0,3),Os=n=>{const e=ui(n);return e.length>=3?`${e.slice(0,2)}/${e.slice(2,4)}`:e},zn=n=>{const e=Math.floor(n/60),i=n%60;return`${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`},Vs=n=>{n=n.replace(/\D/g,"");const e={Visa:/^4/,MasterCard:/^5[1-5]|^2(2[2-9]|[3-6]|7[01])/,"American Express":/^3[47]/,Discover:/^6(?:011|5[0-9]{2})[0-9]{12}$/,UnionPay:/^62/,Verve:/^((506(0|1))|(507(8|9))|(6500))[0-9]{12,15}$/,"Diners Club":/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/};for(const[i,t]of Object.entries(e))if(t.test(n))return i;return"Unknown"},Us={Visa:[16],MasterCard:[16],"American Express":[15],Discover:[16],UnionPay:[16],Verve:[16,17,18,19]},pn=class pn{};h(pn,"createToast",(e,i)=>{const t=document.createElement("div");t.classList.add("toast",i,"grid","grid-cols-[1fr_auto]");const o=document.createElement("span");o.classList.add("flex","items-center","gap-2","text-[10px]","justify-self-center"),o.innerHTML=["error","warning","info"].includes(i)?`<svg class=" inline-block mr-1" width="18" height="19" viewBox="0 0 18 19" fill="none"
475
+ </div>`,Bs=()=>{const n=Date.now().toString(36),e="xxxx-xxxx-xxx-xxxx".replace(/[x]/g,()=>Math.floor(Math.random()*16).toString(16));return`SPF-${n}-${e}`.toUpperCase()},ui=(n="")=>n.replace(/\D+/g,""),Ns=n=>n.replace(/\D/g,""),Hs=n=>n.replace(/\D/g,"").replace(/(\d{4})(?=\d)/g,"$1 ").trim(),Rs=n=>ui(n).slice(0,3),Os=n=>{const e=ui(n);return e.length>=3?`${e.slice(0,2)}/${e.slice(2,4)}`:e},zn=n=>{const e=Math.floor(n/60),i=n%60;return`${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`},Vs=n=>{n=n.replace(/\D/g,"");const e={Visa:/^4/,MasterCard:/^5[1-5]|^2(2[2-9]|[3-6]|7[01])/,"American Express":/^3[47]/,Discover:/^6(?:011|5[0-9]{2})[0-9]{12}$/,UnionPay:/^62/,Verve:/^((506(0|1))|(507(8|9))|(6500))[0-9]{12,15}$/,"Diners Club":/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/};for(const[i,t]of Object.entries(e))if(t.test(n))return i;return"Unknown"},Us={Visa:[16],MasterCard:[16],"American Express":[15],Discover:[16],UnionPay:[16],Verve:[16,17,18,19]},pn=class pn{};h(pn,"createToast",(e,i)=>{const t=document.createElement("div");t.classList.add("toast",i,"grid","grid-cols-[1fr_auto]");const o=document.createElement("span");o.classList.add("flex","items-center","gap-2","text-[10px]","justify-self-center"),o.innerHTML=["error","warning","info"].includes(i)?`<svg class=" inline-block mr-1" width="18" height="19" viewBox="0 0 18 19" fill="none"
476
476
  xmlns="http://www.w3.org/2000/svg">
477
477
  <path fill-rule="evenodd" clip-rule="evenodd"
478
478
  d="M2.80944 12.6864L7.40177 4.11968C8.13226 2.75698 10.1359 2.75698 10.8664 4.11968L15.4587 12.6864C16.1374 13.9525 15.1936 15.4677 13.7264 15.4677H4.54174C3.0745 15.4677 2.13075 13.9525 2.80944 12.6864ZM9.13406 5.28061C9.53593 5.28061 9.86171 5.60639 9.86171 6.00826V11.1018C9.86171 11.5037 9.53593 11.8295 9.13406 11.8295C8.73219 11.8295 8.40641 11.5037 8.40641 11.1018V6.00826C8.40641 5.60639 8.73219 5.28061 9.13406 5.28061ZM8.2245 13.1029C8.2245 13.6052 8.63172 14.0124 9.13406 14.0124C9.6364 14.0124 10.0436 13.6052 10.0436 13.1029C10.0436 12.6005 9.6364 12.1933 9.13406 12.1933C8.63172 12.1933 8.2245 12.6005 8.2245 13.1029Z"
479
479
  fill="white" />
480
480
  </svg>
481
- <span id="custom-toast-msg">${e}</span>`:e,t.appendChild(o);const s=document.createElement("span");return s.textContent="×",s.classList.add("close-btn","opacity-0"),s.onclick=()=>pn.removeToast(t),t.appendChild(s),t}),h(pn,"showToast",(e,i,t=3e3)=>{const o=document.getElementById("toast-container");if(o){const s=pn.createToast(e,i);o.appendChild(s),s.offsetHeight,s.classList.add("show"),setTimeout(()=>pn.removeToast(s),t)}}),h(pn,"removeToast",e=>{e.classList.remove("show"),e.addEventListener("transitionend",()=>{e.parentElement&&e.parentElement.removeChild(e)})});let hi=pn;class Ht{constructor(e){h(this,"container");h(this,"onAction");h(this,"cardDetailsValues");h(this,"creditCardTypes");h(this,"merchantName");h(this,"currency");this.container=e.container,this.onAction=e.onAction,this.creditCardTypes=[...Dt],this.cardDetailsValues={number:"",expiry:"",cvv:"",name:""},this.merchantName=e.merchantName,this.currency=e.currency}attachListener(){const e=document.querySelector("#pci-dss");e&&e.classList.remove("hidden");const i=document.querySelector('input[name="number"]'),t=document.querySelector('input[name="expiry"]'),o=document.querySelector('input[name="cvv"]'),s=document.querySelector('input[name="name"]'),a=document.querySelector(".details-form-button"),l=document.querySelector("#checkoutcard");i&&i.addEventListener("input",d=>this.handleInputChange(d,a)),t&&t.addEventListener("input",d=>this.handleInputChange(d,a)),o&&o.addEventListener("input",d=>this.handleInputChange(d,a)),s&&s.addEventListener("input",d=>this.handleInputChange(d,a)),l&&l.addEventListener("submit",d=>{var v,p,g;d.preventDefault(),this.onAction(d)({pan:Ds(this.cardDetailsValues.number),cvv:this.cardDetailsValues.cvv,expiryMonth:(v=this.cardDetailsValues)==null?void 0:v.expiry.split("/")[0].trim(),expiryYear:(p=this.cardDetailsValues)==null?void 0:p.expiry.split("/")[1].trim(),...this.currency==="ZAR"&&{cardHolderName:(g=this.cardDetailsValues)==null?void 0:g.name}})})}validateCreditCard(e){if(e=e.replace(/\D/g,""),!e||e.length===0||e.length<13||e.length>19)return!1;const i=e.split("").map(o=>parseInt(o,10));for(let o=i.length-2;o>=0;o-=2){let s=i[o]*2;s>9&&(s-=9),i[o]=s}return i.reduce((o,s)=>o+s,0)%10===0}handleInputChange(e,i){var l,d,v;const t=e.target,{name:o,value:s}=t;let a=s;if(s.trim()===""){this.emptyCardState(t,o);return}if(o==="number"){a=Hs(s);const p=a.replace(/\s+/g,""),g=this.validateCreditCard(p);this.filterCreditCardType(s);const f=(l=this.creditCardTypes[0])==null?void 0:l.name;f&&Pn.map(y=>{if(y.name===this.currency)if(y.cardTypes.includes(f)){const k=Us[f];if(k.length>1){const C=k.some(S=>p.length===S);this.checkInputValidity(g,t,"Your card number is invalid",C)}else p.length===k[0]&&this.checkInputValidity(g,t,"Your card number is invalid",p.length>=14&&p.length<=19)}else this.checkInputValidity(!1,t,"Invalid card. Only locally issued cards are accepted.",s.trim().length>=14&&s.trim().length<=19)})}else if(o==="expiry"){const p=new Date;a=Os(s);const g=a.split("/"),f=(d=g[0])==null?void 0:d.trim(),y=(v=g[1])==null?void 0:v.trim(),k=new Date().getFullYear()%100,C=p.getMonth()+1;let S=!0;(parseInt(y)===k&&parseInt(f)<C||parseInt(y)<k)&&(S=!1),(y==null?void 0:y.length)===2&&this.checkInputValidity(S,t,"Your card has expired",g.join("").length===4)}else o==="cvv"?a=Rs(s):o==="name"&&(a=s);if(this.cardDetailsValues={...this.cardDetailsValues,[o]:a},t.value=a,this.validateCard())i&&i.removeAttribute("disabled");else if(i){if(i.disabled)return;i.setAttribute("disabled","")}}hideCardHolderInput(){const e=document.querySelector("#card-name");this.currency==="ZAR"?e&&(e.style.display="block"):e&&(e.style.display="none")}validateCard(){if(this.cardDetailsValues.expiry.split("/").length===2){const e=this.cardDetailsValues.expiry.split("/")[1].trim();return!!this.cardDetailsValues.number&&this.cardDetailsValues.number.length>15&&!!this.cardDetailsValues.expiry&&this.cardDetailsValues.expiry.length>3&&!!this.cardDetailsValues.cvv&&this.cardDetailsValues.cvv.length>2&&e.length===2&&(this.currency==="ZAR"?this.cardDetailsValues.name.trim()!=="":!0)}}displayCardTypes(){requestAnimationFrame(()=>{const e=this.container.querySelector("#card-type");e.innerHTML="",this.creditCardTypes.length>0?this.creditCardTypes.forEach(i=>{const t=document.createElement("div");t.classList.add("card-type"),t.innerHTML=i.icon,e.appendChild(t)}):e.innerHTML=`<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg">
481
+ <span id="custom-toast-msg">${e}</span>`:e,t.appendChild(o);const s=document.createElement("span");return s.textContent="×",s.classList.add("close-btn","opacity-0"),s.onclick=()=>pn.removeToast(t),t.appendChild(s),t}),h(pn,"showToast",(e,i,t=3e3)=>{const o=document.getElementById("toast-container");if(o){const s=pn.createToast(e,i);o.appendChild(s),s.offsetHeight,s.classList.add("show"),setTimeout(()=>pn.removeToast(s),t)}}),h(pn,"removeToast",e=>{e.classList.remove("show"),e.addEventListener("transitionend",()=>{e.parentElement&&e.parentElement.removeChild(e)})});let hi=pn;class Ht{constructor(e){h(this,"container");h(this,"onAction");h(this,"cardDetailsValues");h(this,"creditCardTypes");h(this,"merchantName");h(this,"currency");this.container=e.container,this.onAction=e.onAction,this.creditCardTypes=[...Nt],this.cardDetailsValues={number:"",expiry:"",cvv:"",name:""},this.merchantName=e.merchantName,this.currency=e.currency}attachListener(){const e=document.querySelector("#pci-dss");e&&e.classList.remove("hidden");const i=document.querySelector('input[name="number"]'),t=document.querySelector('input[name="expiry"]'),o=document.querySelector('input[name="cvv"]'),s=document.querySelector('input[name="name"]'),a=document.querySelector(".details-form-button"),l=document.querySelector("#checkoutcard");i&&i.addEventListener("input",d=>this.handleInputChange(d,a)),t&&t.addEventListener("input",d=>this.handleInputChange(d,a)),o&&o.addEventListener("input",d=>this.handleInputChange(d,a)),s&&s.addEventListener("input",d=>this.handleInputChange(d,a)),l&&l.addEventListener("submit",d=>{var v,p,g;d.preventDefault(),this.onAction(d)({pan:Ns(this.cardDetailsValues.number),cvv:this.cardDetailsValues.cvv,expiryMonth:(v=this.cardDetailsValues)==null?void 0:v.expiry.split("/")[0].trim(),expiryYear:(p=this.cardDetailsValues)==null?void 0:p.expiry.split("/")[1].trim(),...this.currency==="ZAR"&&{cardHolderName:(g=this.cardDetailsValues)==null?void 0:g.name}})})}validateCreditCard(e){if(e=e.replace(/\D/g,""),!e||e.length===0||e.length<13||e.length>19)return!1;const i=e.split("").map(o=>parseInt(o,10));for(let o=i.length-2;o>=0;o-=2){let s=i[o]*2;s>9&&(s-=9),i[o]=s}return i.reduce((o,s)=>o+s,0)%10===0}handleInputChange(e,i){var l,d,v;const t=e.target,{name:o,value:s}=t;let a=s;if(s.trim()===""){this.emptyCardState(t,o);return}if(o==="number"){a=Hs(s);const p=a.replace(/\s+/g,""),g=this.validateCreditCard(p);this.filterCreditCardType(s);const f=(l=this.creditCardTypes[0])==null?void 0:l.name;f&&Pn.map(y=>{if(y.name===this.currency)if(y.cardTypes.includes(f)){const k=Us[f];if(k.length>1){const C=k.some(S=>p.length===S);this.checkInputValidity(g,t,"Your card number is invalid",C)}else p.length===k[0]&&this.checkInputValidity(g,t,"Your card number is invalid",p.length>=14&&p.length<=19)}else this.checkInputValidity(!1,t,"Invalid card. Only locally issued cards are accepted.",s.trim().length>=14&&s.trim().length<=19)})}else if(o==="expiry"){const p=new Date;a=Os(s);const g=a.split("/"),f=(d=g[0])==null?void 0:d.trim(),y=(v=g[1])==null?void 0:v.trim(),k=new Date().getFullYear()%100,C=p.getMonth()+1;let S=!0;(parseInt(y)===k&&parseInt(f)<C||parseInt(y)<k)&&(S=!1),(y==null?void 0:y.length)===2&&this.checkInputValidity(S,t,"Your card has expired",g.join("").length===4)}else o==="cvv"?a=Rs(s):o==="name"&&(a=s);if(this.cardDetailsValues={...this.cardDetailsValues,[o]:a},t.value=a,this.validateCard())i&&i.removeAttribute("disabled");else if(i){if(i.disabled)return;i.setAttribute("disabled","")}}hideCardHolderInput(){const e=document.querySelector("#card-name");this.currency==="ZAR"?e&&(e.style.display="block"):e&&(e.style.display="none")}validateCard(){if(this.cardDetailsValues.expiry.split("/").length===2){const e=this.cardDetailsValues.expiry.split("/")[1].trim();return!!this.cardDetailsValues.number&&this.cardDetailsValues.number.length>15&&!!this.cardDetailsValues.expiry&&this.cardDetailsValues.expiry.length>3&&!!this.cardDetailsValues.cvv&&this.cardDetailsValues.cvv.length>2&&e.length===2&&(this.currency==="ZAR"?this.cardDetailsValues.name.trim()!=="":!0)}}displayCardTypes(){requestAnimationFrame(()=>{const e=this.container.querySelector("#card-type");e.innerHTML="",this.creditCardTypes.length>0?this.creditCardTypes.forEach(i=>{const t=document.createElement("div");t.classList.add("card-type"),t.innerHTML=i.icon,e.appendChild(t)}):e.innerHTML=`<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg">
482
482
  <path
483
483
  d="M24.5827 6.33333V14.6667C24.5827 14.8877 24.4554 15.0996 24.2288 15.2559C24.0022 15.4122 23.6948 15.5 23.3743 15.5H1.62435C1.30388 15.5 0.996535 15.4122 0.769928 15.2559C0.543322 15.0996 0.416016 14.8877 0.416016 14.6667V6.33333H24.5827ZM24.5827 4.66667H0.416016V1.33333C0.416016 1.11232 0.543322 0.900358 0.769928 0.744078C0.996535 0.587797 1.30388 0.5 1.62435 0.5H23.3743C23.6948 0.5 24.0022 0.587797 24.2288 0.744078C24.4554 0.900358 24.5827 1.11232 24.5827 1.33333V4.66667ZM16.1243 11.3333V13H20.9577V11.3333H16.1243Z"
484
484
  fill="#B6B4B9" />
485
- </svg>`})}filterCreditCardType(e){e?(this.creditCardTypes=Dt.filter(i=>i.name===Vs(e)),this.displayCardTypes()):(this.creditCardTypes=[],this.displayCardTypes())}emptyCardState(e,i){e.style.border="";const t=document.getElementById("card-number-error"),o=document.getElementById("expiry-error"),s=this.container.querySelector("#card-type"),a=document.querySelector("#card-error"),l=document.querySelector("#card-details");if(e.style.color="#0D0716",l&&(l.style.border="1px solid #9E9BA1"),a&&(a.classList.remove("block"),a.classList.add("hidden")),o&&o.remove(),t&&t.remove(),this.cardDetailsValues={...this.cardDetailsValues,[i]:""},i==="number"&&(s.innerHTML=`<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg">
485
+ </svg>`})}filterCreditCardType(e){e?(this.creditCardTypes=Nt.filter(i=>i.name===Vs(e)),this.displayCardTypes()):(this.creditCardTypes=[],this.displayCardTypes())}emptyCardState(e,i){e.style.border="";const t=document.getElementById("card-number-error"),o=document.getElementById("expiry-error"),s=this.container.querySelector("#card-type"),a=document.querySelector("#card-error"),l=document.querySelector("#card-details");if(e.style.color="#0D0716",l&&(l.style.border="1px solid #9E9BA1"),a&&(a.classList.remove("block"),a.classList.add("hidden")),o&&o.remove(),t&&t.remove(),this.cardDetailsValues={...this.cardDetailsValues,[i]:""},i==="number"&&(s.innerHTML=`<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg">
486
486
  <path
487
487
  d="M24.5827 6.33333V14.6667C24.5827 14.8877 24.4554 15.0996 24.2288 15.2559C24.0022 15.4122 23.6948 15.5 23.3743 15.5H1.62435C1.30388 15.5 0.996535 15.4122 0.769928 15.2559C0.543322 15.0996 0.416016 14.8877 0.416016 14.6667V6.33333H24.5827ZM24.5827 4.66667H0.416016V1.33333C0.416016 1.11232 0.543322 0.900358 0.769928 0.744078C0.996535 0.587797 1.30388 0.5 1.62435 0.5H23.3743C23.6948 0.5 24.0022 0.587797 24.2288 0.744078C24.4554 0.900358 24.5827 1.11232 24.5827 1.33333V4.66667ZM16.1243 11.3333V13H20.9577V11.3333H16.1243Z"
488
488
  fill="#B6B4B9" />
489
- </svg>`),i==="expiry"&&e.value.length===0){const d=document.querySelector('input[name="number"]');d==null||d.focus()}if(i==="cvv"&&e.value.length===0){const d=document.querySelector('input[name="expiry"]');d==null||d.focus()}}checkInputValidity(e,i,t,o){const s=document.querySelector("#card-details"),a=document.querySelector("#card-error"),{name:l}=i;if(!e)s&&(s.style.border="1px solid #D62020"),a&&(a.classList.remove("hidden"),a.classList.add("block"),a.innerHTML=t),i.style.color="#D62020";else if(s&&(s.style.border="1px solid #9E9BA1"),a&&(a.classList.remove("block"),a.classList.add("hidden")),i.style.color="#0D0716",o){if(l==="number"){const d=document.querySelector('input[name="expiry"]');d==null||d.focus()}if(l==="expiry"){const d=document.querySelector('input[name="cvv"]');d==null||d.focus()}}}renderContent(){this.container.innerHTML=this.render();const e=this.container.querySelector("#merchant-name");e&&(e.innerHTML=this.merchantName),this.attachListener(),this.hideCardHolderInput()}render(){return Bs}}async function js(n,e){const i=Uint8Array.from(atob(e),d=>d.charCodeAt(0)),t=crypto.getRandomValues(new Uint8Array(12)),o=new TextEncoder().encode(n),s=await crypto.subtle.importKey("raw",i,{name:"AES-GCM"},!1,["encrypt"]),a=await crypto.subtle.encrypt({name:"AES-GCM",iv:t},s,o),l=new Uint8Array(t.length+a.byteLength);return l.set(t),l.set(new Uint8Array(a),t.length),btoa(String.fromCharCode.apply(null,l))}const Ks=`<div id="paymentSuccess">
489
+ </svg>`),i==="expiry"&&e.value.length===0){const d=document.querySelector('input[name="number"]');d==null||d.focus()}if(i==="cvv"&&e.value.length===0){const d=document.querySelector('input[name="expiry"]');d==null||d.focus()}}checkInputValidity(e,i,t,o){const s=document.querySelector("#card-details"),a=document.querySelector("#card-error"),{name:l}=i;if(!e)s&&(s.style.border="1px solid #D62020"),a&&(a.classList.remove("hidden"),a.classList.add("block"),a.innerHTML=t),i.style.color="#D62020";else if(s&&(s.style.border="1px solid #9E9BA1"),a&&(a.classList.remove("block"),a.classList.add("hidden")),i.style.color="#0D0716",o){if(l==="number"){const d=document.querySelector('input[name="expiry"]');d==null||d.focus()}if(l==="expiry"){const d=document.querySelector('input[name="cvv"]');d==null||d.focus()}}}renderContent(){this.container.innerHTML=this.render();const e=this.container.querySelector("#merchant-name");e&&(e.innerHTML=this.merchantName),this.attachListener(),this.hideCardHolderInput()}render(){return Ds}}async function js(n,e){const i=Uint8Array.from(atob(e),d=>d.charCodeAt(0)),t=crypto.getRandomValues(new Uint8Array(12)),o=new TextEncoder().encode(n),s=await crypto.subtle.importKey("raw",i,{name:"AES-GCM"},!1,["encrypt"]),a=await crypto.subtle.encrypt({name:"AES-GCM",iv:t},s,o),l=new Uint8Array(t.length+a.byteLength);return l.set(t),l.set(new Uint8Array(a),t.length),btoa(String.fromCharCode.apply(null,l))}const Ks=`<div id="paymentSuccess">
490
490
  <div class="container-center min-h-[30dvh]">
491
491
  <div>
492
492
  <div class="container-center mb-5">
@@ -697,7 +697,7 @@
697
697
  </div>
698
698
  </div>
699
699
  </div>
700
- </div>`;class De{constructor(e){h(this,"container");this.container=e}renderContent(){return this.container}mountLoader(e){if(this.container.innerHTML=this.render(),e){const i=this.container.querySelector("#loader-container");i&&(i.style.height=e)}}unmountLoader(){const e=this.container.querySelector("#loader-container");e&&e.classList.add("hidden")}updateMessage(e,i){const t=this.container.querySelector("#loader-message");if(t&&(t.textContent=e,t.classList.remove("hidden")),i){const o=this.container.querySelector("#loader-sub-message");o&&(o.textContent=i,o.classList.remove("hidden"))}}renderComponent(){}render(){return $s}}const Ys=`<div class="relative gap-3 pb-5" id="transaction-issues-form">
700
+ </div>`;class Ne{constructor(e){h(this,"container");this.container=e}renderContent(){return this.container}mountLoader(e){if(this.container.innerHTML=this.render(),e){const i=this.container.querySelector("#loader-container");i&&(i.style.height=e)}}unmountLoader(){const e=this.container.querySelector("#loader-container");e&&e.classList.add("hidden")}updateMessage(e,i){const t=this.container.querySelector("#loader-message");if(t&&(t.textContent=e,t.classList.remove("hidden")),i){const o=this.container.querySelector("#loader-sub-message");o&&(o.textContent=i,o.classList.remove("hidden"))}}renderComponent(){}render(){return $s}}const Ys=`<div class="relative gap-3 pb-5" id="transaction-issues-form">
701
701
  <div class="border-b border-tone-70 pb-3 container-center">
702
702
 
703
703
  <svg width="84" height="24" viewBox="0 0 84 24" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -950,9 +950,9 @@
950
950
 
951
951
  </div>
952
952
  </div>
953
- </div>`}renderTransactionIssuesComponent(){const e=document.querySelector("#main-header"),i=document.querySelector("#main-content"),t=document.querySelector("#main-footer");switch(e&&(e.style.display="none"),i&&i.classList.remove("box-container"),t&&(t.style.display="none"),this.currentStep){case 1:this.transactionIssuesForm=new Qs({container:this.container,uploadEvidenceFile:this.uploadEvidenceFile.bind(this),onAction:this.submitDisputeForm.bind(this),paymentResponse:this.paymentResponse}),this.transactionIssuesForm.renderComponent();break}this.attachListener()}}var le;(function(n){n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment"})(le||(le={}));function Xs(n){return n.nodeType===n.ELEMENT_NODE}function Wn(n){const e=n==null?void 0:n.host;return(e==null?void 0:e.shadowRoot)===n}function Zn(n){return Object.prototype.toString.call(n)==="[object ShadowRoot]"}function ea(n){return n.includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n}function na(n){const{cssText:e}=n;if(e.split('"').length<3)return e;const i=["@import",`url(${JSON.stringify(n.href)})`];return n.layerName===""?i.push("layer"):n.layerName&&i.push(`layer(${n.layerName})`),n.supportsText&&i.push(`supports(${n.supportsText})`),n.media.length&&i.push(n.media.mediaText),i.join(" ")+";"}function pi(n){try{const e=n.rules||n.cssRules;return e?ea(Array.from(e,Ot).join("")):null}catch{return null}}function Ot(n){let e;if(ta(n))try{e=pi(n.styleSheet)||na(n)}catch{}else if(oa(n)&&n.selectorText.includes(":"))return ia(n.cssText);return e||n.cssText}function ia(n){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(e,"$1\\$2")}function ta(n){return"styleSheet"in n}function oa(n){return"selectorText"in n}class Vt{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var i;if(!e)return-1;const t=(i=this.getMeta(e))===null||i===void 0?void 0:i.id;return t??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const i=this.getId(e);this.idNodeMap.delete(i),e.childNodes&&e.childNodes.forEach(t=>this.removeNodeFromMap(t))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,i){const t=i.id;this.idNodeMap.set(t,e),this.nodeMetaMap.set(e,i)}replace(e,i){const t=this.getNode(e);if(t){const o=this.nodeMetaMap.get(t);o&&this.nodeMetaMap.set(i,o)}this.idNodeMap.set(e,i)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function sa(){return new Vt}function qi({element:n,maskInputOptions:e,tagName:i,type:t,value:o,maskInputFn:s}){let a=o||"";const l=t&&yn(t);return(e[i.toLowerCase()]||l&&e[l])&&(s?a=s(a,n):a="*".repeat(a.length)),a}function yn(n){return n.toLowerCase()}const Ut="__rrweb_original__";function aa(n){const e=n.getContext("2d");if(!e)return!0;const i=50;for(let t=0;t<n.width;t+=i)for(let o=0;o<n.height;o+=i){const s=e.getImageData,a=Ut in s?s[Ut]:s;if(new Uint32Array(a.call(e,t,o,Math.min(i,n.width-t),Math.min(i,n.height-o)).data.buffer).some(d=>d!==0))return!1}return!0}function Wi(n){const e=n.type;return n.hasAttribute("data-rr-is-password")?"password":e?yn(e):null}function jt(n,e){var i;let t;try{t=new URL(n,e??window.location.href)}catch{return null}const o=/\.([0-9a-z]+)(?:$)/i,s=t.pathname.match(o);return(i=s==null?void 0:s[1])!==null&&i!==void 0?i:null}let ra=1;const la=new RegExp("[^a-z0-9-_:]"),Jn=-2;function Kt(){return ra++}function da(n){if(n instanceof HTMLFormElement)return"form";const e=yn(n.tagName);return la.test(e)?"div":e}function ca(n){let e="";return n.indexOf("//")>-1?e=n.split("/").slice(0,3).join("/"):e=n.split("/")[0],e=e.split("?")[0],e}let In,Ft;const ua=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ha=/^(?:[a-z+]+:)?\/\//i,ma=/^www\..*/i,pa=/^(data:)([^,]*),(.*)/i;function vi(n,e){return(n||"").replace(ua,(i,t,o,s,a,l)=>{const d=o||a||l,v=t||s||"";if(!d)return i;if(ha.test(d)||ma.test(d))return`url(${v}${d}${v})`;if(pa.test(d))return`url(${v}${d}${v})`;if(d[0]==="/")return`url(${v}${ca(e)+d}${v})`;const p=e.split("/"),g=d.split("/");p.pop();for(const f of g)f!=="."&&(f===".."?p.pop():p.push(f));return`url(${v}${p.join("/")}${v})`})}const va=/^[^ \t\n\r\u000c]+/,ba=/^[, \t\n\r\u000c]+/;function fa(n,e){if(e.trim()==="")return e;let i=0;function t(s){let a;const l=s.exec(e.substring(i));return l?(a=l[0],i+=a.length,a):""}const o=[];for(;t(ba),!(i>=e.length);){let s=t(va);if(s.slice(-1)===",")s=Bn(n,s.substring(0,s.length-1)),o.push(s);else{let a="";s=Bn(n,s);let l=!1;for(;;){const d=e.charAt(i);if(d===""){o.push((s+a).trim());break}else if(l)d===")"&&(l=!1);else if(d===","){i+=1,o.push((s+a).trim());break}else d==="("&&(l=!0);a+=d,i+=1}}}return o.join(", ")}function Bn(n,e){if(!e||e.trim()==="")return e;const i=n.createElement("a");return i.href=e,i.href}function ga(n){return!!(n.tagName==="svg"||n.ownerSVGElement)}function Zi(){const n=document.createElement("a");return n.href="",n.href}function Gt(n,e,i,t){return t&&(i==="src"||i==="href"&&!(e==="use"&&t[0]==="#")||i==="xlink:href"&&t[0]!=="#"||i==="background"&&(e==="table"||e==="td"||e==="th")?Bn(n,t):i==="srcset"?fa(n,t):i==="style"?vi(t,Zi()):e==="object"&&i==="data"?Bn(n,t):t)}function zt(n,e,i){return(n==="video"||n==="audio")&&e==="autoplay"}function ya(n,e,i){try{if(typeof e=="string"){if(n.classList.contains(e))return!0}else for(let t=n.classList.length;t--;){const o=n.classList[t];if(e.test(o))return!0}if(i)return n.matches(i)}catch{}return!1}function bi(n,e,i){if(!n)return!1;if(n.nodeType!==n.ELEMENT_NODE)return i?bi(n.parentNode,e,i):!1;for(let t=n.classList.length;t--;){const o=n.classList[t];if(e.test(o))return!0}return i?bi(n.parentNode,e,i):!1}function qt(n,e,i,t){try{const o=n.nodeType===n.ELEMENT_NODE?n:n.parentElement;if(o===null)return!1;if(typeof e=="string"){if(t){if(o.closest(`.${e}`))return!0}else if(o.classList.contains(e))return!0}else if(bi(o,e,t))return!0;if(i){if(t){if(o.closest(i))return!0}else if(o.matches(i))return!0}}catch{}return!1}function Ca(n,e,i){const t=n.contentWindow;if(!t)return;let o=!1,s;try{s=t.document.readyState}catch{return}if(s!=="complete"){const l=setTimeout(()=>{o||(e(),o=!0)},i);n.addEventListener("load",()=>{clearTimeout(l),o=!0,e()});return}const a="about:blank";if(t.location.href!==a||n.src===a||n.src==="")return setTimeout(e,0),n.addEventListener("load",e);n.addEventListener("load",e)}function wa(n,e,i){let t=!1,o;try{o=n.sheet}catch{return}if(o)return;const s=setTimeout(()=>{t||(e(),t=!0)},i);n.addEventListener("load",()=>{clearTimeout(s),t=!0,e()})}function ka(n,e){const{doc:i,mirror:t,blockClass:o,blockSelector:s,needsMask:a,inlineStylesheet:l,maskInputOptions:d={},maskTextFn:v,maskInputFn:p,dataURLOptions:g={},inlineImages:f,recordCanvas:y,keepIframeSrcFn:k,newlyAddedElement:C=!1}=e,S=Sa(i,t);switch(n.nodeType){case n.DOCUMENT_NODE:return n.compatMode!=="CSS1Compat"?{type:le.Document,childNodes:[],compatMode:n.compatMode}:{type:le.Document,childNodes:[]};case n.DOCUMENT_TYPE_NODE:return{type:le.DocumentType,name:n.name,publicId:n.publicId,systemId:n.systemId,rootId:S};case n.ELEMENT_NODE:return Ma(n,{doc:i,blockClass:o,blockSelector:s,inlineStylesheet:l,maskInputOptions:d,maskInputFn:p,dataURLOptions:g,inlineImages:f,recordCanvas:y,keepIframeSrcFn:k,newlyAddedElement:C,rootId:S});case n.TEXT_NODE:return _a(n,{needsMask:a,maskTextFn:v,rootId:S});case n.CDATA_SECTION_NODE:return{type:le.CDATA,textContent:"",rootId:S};case n.COMMENT_NODE:return{type:le.Comment,textContent:n.textContent||"",rootId:S};default:return!1}}function Sa(n,e){if(!e.hasNode(n))return;const i=e.getId(n);return i===1?void 0:i}function _a(n,e){var i;const{needsMask:t,maskTextFn:o,rootId:s}=e,a=n.parentNode&&n.parentNode.tagName;let l=n.textContent;const d=a==="STYLE"?!0:void 0,v=a==="SCRIPT"?!0:void 0;if(d&&l){try{n.nextSibling||n.previousSibling||!((i=n.parentNode.sheet)===null||i===void 0)&&i.cssRules&&(l=pi(n.parentNode.sheet))}catch(p){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${p}`,n)}l=vi(l,Zi())}return v&&(l="SCRIPT_PLACEHOLDER"),!d&&!v&&l&&t&&(l=o?o(l,n.parentElement):l.replace(/[\S]/g,"*")),{type:le.Text,textContent:l||"",isStyle:d,rootId:s}}function Ma(n,e){const{doc:i,blockClass:t,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:d={},inlineImages:v,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:f=!1,rootId:y}=e,k=ya(n,t,o),C=da(n);let S={};const M=n.attributes.length;for(let _=0;_<M;_++){const T=n.attributes[_];zt(C,T.name,T.value)||(S[T.name]=Gt(i,C,yn(T.name),T.value))}if(C==="link"&&s){const _=Array.from(i.styleSheets).find(I=>I.href===n.href);let T=null;_&&(T=pi(_)),T&&(delete S.rel,delete S.href,S._cssText=vi(T,_.href))}if(C==="style"&&n.sheet&&!(n.innerText||n.textContent||"").trim().length){const _=pi(n.sheet);_&&(S._cssText=vi(_,Zi()))}if(C==="input"||C==="textarea"||C==="select"){const _=n.value,T=n.checked;S.type!=="radio"&&S.type!=="checkbox"&&S.type!=="submit"&&S.type!=="button"&&_?S.value=qi({element:n,type:Wi(n),tagName:C,value:_,maskInputOptions:a,maskInputFn:l}):T&&(S.checked=T)}if(C==="option"&&(n.selected&&!a.select?S.selected=!0:delete S.selected),C==="canvas"&&p){if(n.__context==="2d")aa(n)||(S.rr_dataURL=n.toDataURL(d.type,d.quality));else if(!("__context"in n)){const _=n.toDataURL(d.type,d.quality),T=document.createElement("canvas");T.width=n.width,T.height=n.height;const I=T.toDataURL(d.type,d.quality);_!==I&&(S.rr_dataURL=_)}}if(C==="img"&&v){In||(In=i.createElement("canvas"),Ft=In.getContext("2d"));const _=n,T=_.crossOrigin;_.crossOrigin="anonymous";const I=()=>{_.removeEventListener("load",I);try{In.width=_.naturalWidth,In.height=_.naturalHeight,Ft.drawImage(_,0,0),S.rr_dataURL=In.toDataURL(d.type,d.quality)}catch(K){console.warn(`Cannot inline img src=${_.currentSrc}! Error: ${K}`)}T?S.crossOrigin=T:_.removeAttribute("crossorigin")};_.complete&&_.naturalWidth!==0?I():_.addEventListener("load",I)}if(C==="audio"||C==="video"){const _=S;_.rr_mediaState=n.paused?"paused":"played",_.rr_mediaCurrentTime=n.currentTime,_.rr_mediaPlaybackRate=n.playbackRate,_.rr_mediaMuted=n.muted,_.rr_mediaLoop=n.loop,_.rr_mediaVolume=n.volume}if(f||(n.scrollLeft&&(S.rr_scrollLeft=n.scrollLeft),n.scrollTop&&(S.rr_scrollTop=n.scrollTop)),k){const{width:_,height:T}=n.getBoundingClientRect();S={class:S.class,rr_width:`${_}px`,rr_height:`${T}px`}}C==="iframe"&&!g(S.src)&&(n.contentDocument||(S.rr_src=S.src),delete S.src);let A;try{customElements.get(C)&&(A=!0)}catch{}return{type:le.Element,tagName:C,attributes:S,childNodes:[],isSVG:ga(n)||void 0,needBlock:k,rootId:y,isCustom:A}}function ne(n){return n==null?"":n.toLowerCase()}function Aa(n,e){if(e.comment&&n.type===le.Comment)return!0;if(n.type===le.Element){if(e.script&&(n.tagName==="script"||n.tagName==="link"&&(n.attributes.rel==="preload"||n.attributes.rel==="modulepreload")&&n.attributes.as==="script"||n.tagName==="link"&&n.attributes.rel==="prefetch"&&typeof n.attributes.href=="string"&&jt(n.attributes.href)==="js"))return!0;if(e.headFavicon&&(n.tagName==="link"&&n.attributes.rel==="shortcut icon"||n.tagName==="meta"&&(ne(n.attributes.name).match(/^msapplication-tile(image|color)$/)||ne(n.attributes.name)==="application-name"||ne(n.attributes.rel)==="icon"||ne(n.attributes.rel)==="apple-touch-icon"||ne(n.attributes.rel)==="shortcut icon")))return!0;if(n.tagName==="meta"){if(e.headMetaDescKeywords&&ne(n.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ne(n.attributes.property).match(/^(og|twitter|fb):/)||ne(n.attributes.name).match(/^(og|twitter):/)||ne(n.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(ne(n.attributes.name)==="robots"||ne(n.attributes.name)==="googlebot"||ne(n.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&n.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(ne(n.attributes.name)==="author"||ne(n.attributes.name)==="generator"||ne(n.attributes.name)==="framework"||ne(n.attributes.name)==="publisher"||ne(n.attributes.name)==="progid"||ne(n.attributes.property).match(/^article:/)||ne(n.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(ne(n.attributes.name)==="google-site-verification"||ne(n.attributes.name)==="yandex-verification"||ne(n.attributes.name)==="csrf-token"||ne(n.attributes.name)==="p:domain_verify"||ne(n.attributes.name)==="verify-v1"||ne(n.attributes.name)==="verification"||ne(n.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Nn(n,e){const{doc:i,mirror:t,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:d=!1,inlineStylesheet:v=!0,maskInputOptions:p={},maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:k={},inlineImages:C=!1,recordCanvas:S=!1,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:_=5e3,onStylesheetLoad:T,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:K=()=>!1,newlyAddedElement:G=!1}=e;let{needsMask:V}=e,{preserveWhiteSpace:F=!0}=e;!V&&n.childNodes&&(V=qt(n,a,l,V===void 0));const oe=ka(n,{doc:i,mirror:t,blockClass:o,blockSelector:s,needsMask:V,inlineStylesheet:v,maskInputOptions:p,maskTextFn:g,maskInputFn:f,dataURLOptions:k,inlineImages:C,recordCanvas:S,keepIframeSrcFn:K,newlyAddedElement:G});if(!oe)return console.warn(n,"not serialized"),null;let ge;t.hasNode(n)?ge=t.getId(n):Aa(oe,y)||!F&&oe.type===le.Text&&!oe.isStyle&&!oe.textContent.replace(/^\s+|\s+$/gm,"").length?ge=Jn:ge=Kt();const U=Object.assign(oe,{id:ge});if(t.add(n,U),ge===Jn)return null;M&&M(n);let _e=!d;if(U.type===le.Element){_e=_e&&!U.needBlock,delete U.needBlock;const ue=n.shadowRoot;ue&&Zn(ue)&&(U.isShadowHost=!0)}if((U.type===le.Document||U.type===le.Element)&&_e){y.headWhitespace&&U.type===le.Element&&U.tagName==="head"&&(F=!1);const ue={doc:i,mirror:t,blockClass:o,blockSelector:s,needsMask:V,maskTextClass:a,maskTextSelector:l,skipChild:d,inlineStylesheet:v,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:k,inlineImages:C,recordCanvas:S,preserveWhiteSpace:F,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:_,onStylesheetLoad:T,stylesheetLoadTimeout:I,keepIframeSrcFn:K};if(!(U.type===le.Element&&U.tagName==="textarea"&&U.attributes.value!==void 0))for(const Te of Array.from(n.childNodes)){const Me=Nn(Te,ue);Me&&U.childNodes.push(Me)}if(Xs(n)&&n.shadowRoot)for(const Te of Array.from(n.shadowRoot.childNodes)){const Me=Nn(Te,ue);Me&&(Zn(n.shadowRoot)&&(Me.isShadow=!0),U.childNodes.push(Me))}}return n.parentNode&&Wn(n.parentNode)&&Zn(n.parentNode)&&(U.isShadow=!0),U.type===le.Element&&U.tagName==="iframe"&&Ca(n,()=>{const ue=n.contentDocument;if(ue&&A){const Te=Nn(ue,{doc:ue,mirror:t,blockClass:o,blockSelector:s,needsMask:V,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:v,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:k,inlineImages:C,recordCanvas:S,preserveWhiteSpace:F,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:_,onStylesheetLoad:T,stylesheetLoadTimeout:I,keepIframeSrcFn:K});Te&&A(n,Te)}},_),U.type===le.Element&&U.tagName==="link"&&typeof U.attributes.rel=="string"&&(U.attributes.rel==="stylesheet"||U.attributes.rel==="preload"&&typeof U.attributes.href=="string"&&jt(U.attributes.href)==="css")&&wa(n,()=>{if(T){const ue=Nn(n,{doc:i,mirror:t,blockClass:o,blockSelector:s,needsMask:V,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:v,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:k,inlineImages:C,recordCanvas:S,preserveWhiteSpace:F,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:_,onStylesheetLoad:T,stylesheetLoadTimeout:I,keepIframeSrcFn:K});ue&&T(n,ue)}},I),U}function xa(n,e){const{mirror:i=new Vt,blockClass:t="rr-block",blockSelector:o=null,maskTextClass:s="rr-mask",maskTextSelector:a=null,inlineStylesheet:l=!0,inlineImages:d=!1,recordCanvas:v=!1,maskAllInputs:p=!1,maskTextFn:g,maskInputFn:f,slimDOM:y=!1,dataURLOptions:k,preserveWhiteSpace:C,onSerialize:S,onIframeLoad:M,iframeLoadTimeout:A,onStylesheetLoad:_,stylesheetLoadTimeout:T,keepIframeSrcFn:I=()=>!1}=e||{};return Nn(n,{doc:n,mirror:i,blockClass:t,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p===!1?{password:!0}:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:y==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:y===!1?{}:y,dataURLOptions:k,inlineImages:d,recordCanvas:v,preserveWhiteSpace:C,onSerialize:S,onIframeLoad:M,iframeLoadTimeout:A,onStylesheetLoad:_,stylesheetLoadTimeout:T,keepIframeSrcFn:I,newlyAddedElement:!1})}function ke(n,e,i=document){const t={capture:!0,passive:!0};return i.addEventListener(n,e,t),()=>i.removeEventListener(n,e,t)}const Dn=`Please stop import mirror directly. Instead of that,\r
953
+ </div>`}renderTransactionIssuesComponent(){const e=document.querySelector("#main-header"),i=document.querySelector("#main-content"),t=document.querySelector("#main-footer");switch(e&&(e.style.display="none"),i&&i.classList.remove("box-container"),t&&(t.style.display="none"),this.currentStep){case 1:this.transactionIssuesForm=new Qs({container:this.container,uploadEvidenceFile:this.uploadEvidenceFile.bind(this),onAction:this.submitDisputeForm.bind(this),paymentResponse:this.paymentResponse}),this.transactionIssuesForm.renderComponent();break}this.attachListener()}}var le;(function(n){n[n.Document=0]="Document",n[n.DocumentType=1]="DocumentType",n[n.Element=2]="Element",n[n.Text=3]="Text",n[n.CDATA=4]="CDATA",n[n.Comment=5]="Comment"})(le||(le={}));function Xs(n){return n.nodeType===n.ELEMENT_NODE}function Wn(n){const e=n==null?void 0:n.host;return(e==null?void 0:e.shadowRoot)===n}function Zn(n){return Object.prototype.toString.call(n)==="[object ShadowRoot]"}function ea(n){return n.includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n}function na(n){const{cssText:e}=n;if(e.split('"').length<3)return e;const i=["@import",`url(${JSON.stringify(n.href)})`];return n.layerName===""?i.push("layer"):n.layerName&&i.push(`layer(${n.layerName})`),n.supportsText&&i.push(`supports(${n.supportsText})`),n.media.length&&i.push(n.media.mediaText),i.join(" ")+";"}function pi(n){try{const e=n.rules||n.cssRules;return e?ea(Array.from(e,Ot).join("")):null}catch{return null}}function Ot(n){let e;if(ta(n))try{e=pi(n.styleSheet)||na(n)}catch{}else if(oa(n)&&n.selectorText.includes(":"))return ia(n.cssText);return e||n.cssText}function ia(n){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(e,"$1\\$2")}function ta(n){return"styleSheet"in n}function oa(n){return"selectorText"in n}class Vt{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(e){var i;if(!e)return-1;const t=(i=this.getMeta(e))===null||i===void 0?void 0:i.id;return t??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const i=this.getId(e);this.idNodeMap.delete(i),e.childNodes&&e.childNodes.forEach(t=>this.removeNodeFromMap(t))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,i){const t=i.id;this.idNodeMap.set(t,e),this.nodeMetaMap.set(e,i)}replace(e,i){const t=this.getNode(e);if(t){const o=this.nodeMetaMap.get(t);o&&this.nodeMetaMap.set(i,o)}this.idNodeMap.set(e,i)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function sa(){return new Vt}function qi({element:n,maskInputOptions:e,tagName:i,type:t,value:o,maskInputFn:s}){let a=o||"";const l=t&&yn(t);return(e[i.toLowerCase()]||l&&e[l])&&(s?a=s(a,n):a="*".repeat(a.length)),a}function yn(n){return n.toLowerCase()}const Ut="__rrweb_original__";function aa(n){const e=n.getContext("2d");if(!e)return!0;const i=50;for(let t=0;t<n.width;t+=i)for(let o=0;o<n.height;o+=i){const s=e.getImageData,a=Ut in s?s[Ut]:s;if(new Uint32Array(a.call(e,t,o,Math.min(i,n.width-t),Math.min(i,n.height-o)).data.buffer).some(d=>d!==0))return!1}return!0}function Wi(n){const e=n.type;return n.hasAttribute("data-rr-is-password")?"password":e?yn(e):null}function jt(n,e){var i;let t;try{t=new URL(n,e??window.location.href)}catch{return null}const o=/\.([0-9a-z]+)(?:$)/i,s=t.pathname.match(o);return(i=s==null?void 0:s[1])!==null&&i!==void 0?i:null}let ra=1;const la=new RegExp("[^a-z0-9-_:]"),Jn=-2;function Kt(){return ra++}function da(n){if(n instanceof HTMLFormElement)return"form";const e=yn(n.tagName);return la.test(e)?"div":e}function ca(n){let e="";return n.indexOf("//")>-1?e=n.split("/").slice(0,3).join("/"):e=n.split("/")[0],e=e.split("?")[0],e}let In,Ft;const ua=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ha=/^(?:[a-z+]+:)?\/\//i,ma=/^www\..*/i,pa=/^(data:)([^,]*),(.*)/i;function vi(n,e){return(n||"").replace(ua,(i,t,o,s,a,l)=>{const d=o||a||l,v=t||s||"";if(!d)return i;if(ha.test(d)||ma.test(d))return`url(${v}${d}${v})`;if(pa.test(d))return`url(${v}${d}${v})`;if(d[0]==="/")return`url(${v}${ca(e)+d}${v})`;const p=e.split("/"),g=d.split("/");p.pop();for(const f of g)f!=="."&&(f===".."?p.pop():p.push(f));return`url(${v}${p.join("/")}${v})`})}const va=/^[^ \t\n\r\u000c]+/,ba=/^[, \t\n\r\u000c]+/;function fa(n,e){if(e.trim()==="")return e;let i=0;function t(s){let a;const l=s.exec(e.substring(i));return l?(a=l[0],i+=a.length,a):""}const o=[];for(;t(ba),!(i>=e.length);){let s=t(va);if(s.slice(-1)===",")s=Dn(n,s.substring(0,s.length-1)),o.push(s);else{let a="";s=Dn(n,s);let l=!1;for(;;){const d=e.charAt(i);if(d===""){o.push((s+a).trim());break}else if(l)d===")"&&(l=!1);else if(d===","){i+=1,o.push((s+a).trim());break}else d==="("&&(l=!0);a+=d,i+=1}}}return o.join(", ")}function Dn(n,e){if(!e||e.trim()==="")return e;const i=n.createElement("a");return i.href=e,i.href}function ga(n){return!!(n.tagName==="svg"||n.ownerSVGElement)}function Zi(){const n=document.createElement("a");return n.href="",n.href}function Gt(n,e,i,t){return t&&(i==="src"||i==="href"&&!(e==="use"&&t[0]==="#")||i==="xlink:href"&&t[0]!=="#"||i==="background"&&(e==="table"||e==="td"||e==="th")?Dn(n,t):i==="srcset"?fa(n,t):i==="style"?vi(t,Zi()):e==="object"&&i==="data"?Dn(n,t):t)}function zt(n,e,i){return(n==="video"||n==="audio")&&e==="autoplay"}function ya(n,e,i){try{if(typeof e=="string"){if(n.classList.contains(e))return!0}else for(let t=n.classList.length;t--;){const o=n.classList[t];if(e.test(o))return!0}if(i)return n.matches(i)}catch{}return!1}function bi(n,e,i){if(!n)return!1;if(n.nodeType!==n.ELEMENT_NODE)return i?bi(n.parentNode,e,i):!1;for(let t=n.classList.length;t--;){const o=n.classList[t];if(e.test(o))return!0}return i?bi(n.parentNode,e,i):!1}function qt(n,e,i,t){try{const o=n.nodeType===n.ELEMENT_NODE?n:n.parentElement;if(o===null)return!1;if(typeof e=="string"){if(t){if(o.closest(`.${e}`))return!0}else if(o.classList.contains(e))return!0}else if(bi(o,e,t))return!0;if(i){if(t){if(o.closest(i))return!0}else if(o.matches(i))return!0}}catch{}return!1}function Ca(n,e,i){const t=n.contentWindow;if(!t)return;let o=!1,s;try{s=t.document.readyState}catch{return}if(s!=="complete"){const l=setTimeout(()=>{o||(e(),o=!0)},i);n.addEventListener("load",()=>{clearTimeout(l),o=!0,e()});return}const a="about:blank";if(t.location.href!==a||n.src===a||n.src==="")return setTimeout(e,0),n.addEventListener("load",e);n.addEventListener("load",e)}function wa(n,e,i){let t=!1,o;try{o=n.sheet}catch{return}if(o)return;const s=setTimeout(()=>{t||(e(),t=!0)},i);n.addEventListener("load",()=>{clearTimeout(s),t=!0,e()})}function ka(n,e){const{doc:i,mirror:t,blockClass:o,blockSelector:s,needsMask:a,inlineStylesheet:l,maskInputOptions:d={},maskTextFn:v,maskInputFn:p,dataURLOptions:g={},inlineImages:f,recordCanvas:y,keepIframeSrcFn:k,newlyAddedElement:C=!1}=e,S=Sa(i,t);switch(n.nodeType){case n.DOCUMENT_NODE:return n.compatMode!=="CSS1Compat"?{type:le.Document,childNodes:[],compatMode:n.compatMode}:{type:le.Document,childNodes:[]};case n.DOCUMENT_TYPE_NODE:return{type:le.DocumentType,name:n.name,publicId:n.publicId,systemId:n.systemId,rootId:S};case n.ELEMENT_NODE:return Ma(n,{doc:i,blockClass:o,blockSelector:s,inlineStylesheet:l,maskInputOptions:d,maskInputFn:p,dataURLOptions:g,inlineImages:f,recordCanvas:y,keepIframeSrcFn:k,newlyAddedElement:C,rootId:S});case n.TEXT_NODE:return _a(n,{needsMask:a,maskTextFn:v,rootId:S});case n.CDATA_SECTION_NODE:return{type:le.CDATA,textContent:"",rootId:S};case n.COMMENT_NODE:return{type:le.Comment,textContent:n.textContent||"",rootId:S};default:return!1}}function Sa(n,e){if(!e.hasNode(n))return;const i=e.getId(n);return i===1?void 0:i}function _a(n,e){var i;const{needsMask:t,maskTextFn:o,rootId:s}=e,a=n.parentNode&&n.parentNode.tagName;let l=n.textContent;const d=a==="STYLE"?!0:void 0,v=a==="SCRIPT"?!0:void 0;if(d&&l){try{n.nextSibling||n.previousSibling||!((i=n.parentNode.sheet)===null||i===void 0)&&i.cssRules&&(l=pi(n.parentNode.sheet))}catch(p){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${p}`,n)}l=vi(l,Zi())}return v&&(l="SCRIPT_PLACEHOLDER"),!d&&!v&&l&&t&&(l=o?o(l,n.parentElement):l.replace(/[\S]/g,"*")),{type:le.Text,textContent:l||"",isStyle:d,rootId:s}}function Ma(n,e){const{doc:i,blockClass:t,blockSelector:o,inlineStylesheet:s,maskInputOptions:a={},maskInputFn:l,dataURLOptions:d={},inlineImages:v,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:f=!1,rootId:y}=e,k=ya(n,t,o),C=da(n);let S={};const M=n.attributes.length;for(let _=0;_<M;_++){const T=n.attributes[_];zt(C,T.name,T.value)||(S[T.name]=Gt(i,C,yn(T.name),T.value))}if(C==="link"&&s){const _=Array.from(i.styleSheets).find(I=>I.href===n.href);let T=null;_&&(T=pi(_)),T&&(delete S.rel,delete S.href,S._cssText=vi(T,_.href))}if(C==="style"&&n.sheet&&!(n.innerText||n.textContent||"").trim().length){const _=pi(n.sheet);_&&(S._cssText=vi(_,Zi()))}if(C==="input"||C==="textarea"||C==="select"){const _=n.value,T=n.checked;S.type!=="radio"&&S.type!=="checkbox"&&S.type!=="submit"&&S.type!=="button"&&_?S.value=qi({element:n,type:Wi(n),tagName:C,value:_,maskInputOptions:a,maskInputFn:l}):T&&(S.checked=T)}if(C==="option"&&(n.selected&&!a.select?S.selected=!0:delete S.selected),C==="canvas"&&p){if(n.__context==="2d")aa(n)||(S.rr_dataURL=n.toDataURL(d.type,d.quality));else if(!("__context"in n)){const _=n.toDataURL(d.type,d.quality),T=document.createElement("canvas");T.width=n.width,T.height=n.height;const I=T.toDataURL(d.type,d.quality);_!==I&&(S.rr_dataURL=_)}}if(C==="img"&&v){In||(In=i.createElement("canvas"),Ft=In.getContext("2d"));const _=n,T=_.crossOrigin;_.crossOrigin="anonymous";const I=()=>{_.removeEventListener("load",I);try{In.width=_.naturalWidth,In.height=_.naturalHeight,Ft.drawImage(_,0,0),S.rr_dataURL=In.toDataURL(d.type,d.quality)}catch(K){console.warn(`Cannot inline img src=${_.currentSrc}! Error: ${K}`)}T?S.crossOrigin=T:_.removeAttribute("crossorigin")};_.complete&&_.naturalWidth!==0?I():_.addEventListener("load",I)}if(C==="audio"||C==="video"){const _=S;_.rr_mediaState=n.paused?"paused":"played",_.rr_mediaCurrentTime=n.currentTime,_.rr_mediaPlaybackRate=n.playbackRate,_.rr_mediaMuted=n.muted,_.rr_mediaLoop=n.loop,_.rr_mediaVolume=n.volume}if(f||(n.scrollLeft&&(S.rr_scrollLeft=n.scrollLeft),n.scrollTop&&(S.rr_scrollTop=n.scrollTop)),k){const{width:_,height:T}=n.getBoundingClientRect();S={class:S.class,rr_width:`${_}px`,rr_height:`${T}px`}}C==="iframe"&&!g(S.src)&&(n.contentDocument||(S.rr_src=S.src),delete S.src);let A;try{customElements.get(C)&&(A=!0)}catch{}return{type:le.Element,tagName:C,attributes:S,childNodes:[],isSVG:ga(n)||void 0,needBlock:k,rootId:y,isCustom:A}}function ne(n){return n==null?"":n.toLowerCase()}function Aa(n,e){if(e.comment&&n.type===le.Comment)return!0;if(n.type===le.Element){if(e.script&&(n.tagName==="script"||n.tagName==="link"&&(n.attributes.rel==="preload"||n.attributes.rel==="modulepreload")&&n.attributes.as==="script"||n.tagName==="link"&&n.attributes.rel==="prefetch"&&typeof n.attributes.href=="string"&&jt(n.attributes.href)==="js"))return!0;if(e.headFavicon&&(n.tagName==="link"&&n.attributes.rel==="shortcut icon"||n.tagName==="meta"&&(ne(n.attributes.name).match(/^msapplication-tile(image|color)$/)||ne(n.attributes.name)==="application-name"||ne(n.attributes.rel)==="icon"||ne(n.attributes.rel)==="apple-touch-icon"||ne(n.attributes.rel)==="shortcut icon")))return!0;if(n.tagName==="meta"){if(e.headMetaDescKeywords&&ne(n.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(ne(n.attributes.property).match(/^(og|twitter|fb):/)||ne(n.attributes.name).match(/^(og|twitter):/)||ne(n.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(ne(n.attributes.name)==="robots"||ne(n.attributes.name)==="googlebot"||ne(n.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&n.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(ne(n.attributes.name)==="author"||ne(n.attributes.name)==="generator"||ne(n.attributes.name)==="framework"||ne(n.attributes.name)==="publisher"||ne(n.attributes.name)==="progid"||ne(n.attributes.property).match(/^article:/)||ne(n.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(ne(n.attributes.name)==="google-site-verification"||ne(n.attributes.name)==="yandex-verification"||ne(n.attributes.name)==="csrf-token"||ne(n.attributes.name)==="p:domain_verify"||ne(n.attributes.name)==="verify-v1"||ne(n.attributes.name)==="verification"||ne(n.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Bn(n,e){const{doc:i,mirror:t,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:d=!1,inlineStylesheet:v=!0,maskInputOptions:p={},maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:k={},inlineImages:C=!1,recordCanvas:S=!1,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:_=5e3,onStylesheetLoad:T,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:K=()=>!1,newlyAddedElement:G=!1}=e;let{needsMask:V}=e,{preserveWhiteSpace:F=!0}=e;!V&&n.childNodes&&(V=qt(n,a,l,V===void 0));const oe=ka(n,{doc:i,mirror:t,blockClass:o,blockSelector:s,needsMask:V,inlineStylesheet:v,maskInputOptions:p,maskTextFn:g,maskInputFn:f,dataURLOptions:k,inlineImages:C,recordCanvas:S,keepIframeSrcFn:K,newlyAddedElement:G});if(!oe)return console.warn(n,"not serialized"),null;let ge;t.hasNode(n)?ge=t.getId(n):Aa(oe,y)||!F&&oe.type===le.Text&&!oe.isStyle&&!oe.textContent.replace(/^\s+|\s+$/gm,"").length?ge=Jn:ge=Kt();const U=Object.assign(oe,{id:ge});if(t.add(n,U),ge===Jn)return null;M&&M(n);let _e=!d;if(U.type===le.Element){_e=_e&&!U.needBlock,delete U.needBlock;const ue=n.shadowRoot;ue&&Zn(ue)&&(U.isShadowHost=!0)}if((U.type===le.Document||U.type===le.Element)&&_e){y.headWhitespace&&U.type===le.Element&&U.tagName==="head"&&(F=!1);const ue={doc:i,mirror:t,blockClass:o,blockSelector:s,needsMask:V,maskTextClass:a,maskTextSelector:l,skipChild:d,inlineStylesheet:v,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:k,inlineImages:C,recordCanvas:S,preserveWhiteSpace:F,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:_,onStylesheetLoad:T,stylesheetLoadTimeout:I,keepIframeSrcFn:K};if(!(U.type===le.Element&&U.tagName==="textarea"&&U.attributes.value!==void 0))for(const Te of Array.from(n.childNodes)){const Me=Bn(Te,ue);Me&&U.childNodes.push(Me)}if(Xs(n)&&n.shadowRoot)for(const Te of Array.from(n.shadowRoot.childNodes)){const Me=Bn(Te,ue);Me&&(Zn(n.shadowRoot)&&(Me.isShadow=!0),U.childNodes.push(Me))}}return n.parentNode&&Wn(n.parentNode)&&Zn(n.parentNode)&&(U.isShadow=!0),U.type===le.Element&&U.tagName==="iframe"&&Ca(n,()=>{const ue=n.contentDocument;if(ue&&A){const Te=Bn(ue,{doc:ue,mirror:t,blockClass:o,blockSelector:s,needsMask:V,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:v,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:k,inlineImages:C,recordCanvas:S,preserveWhiteSpace:F,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:_,onStylesheetLoad:T,stylesheetLoadTimeout:I,keepIframeSrcFn:K});Te&&A(n,Te)}},_),U.type===le.Element&&U.tagName==="link"&&typeof U.attributes.rel=="string"&&(U.attributes.rel==="stylesheet"||U.attributes.rel==="preload"&&typeof U.attributes.href=="string"&&jt(U.attributes.href)==="css")&&wa(n,()=>{if(T){const ue=Bn(n,{doc:i,mirror:t,blockClass:o,blockSelector:s,needsMask:V,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:v,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:k,inlineImages:C,recordCanvas:S,preserveWhiteSpace:F,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:_,onStylesheetLoad:T,stylesheetLoadTimeout:I,keepIframeSrcFn:K});ue&&T(n,ue)}},I),U}function xa(n,e){const{mirror:i=new Vt,blockClass:t="rr-block",blockSelector:o=null,maskTextClass:s="rr-mask",maskTextSelector:a=null,inlineStylesheet:l=!0,inlineImages:d=!1,recordCanvas:v=!1,maskAllInputs:p=!1,maskTextFn:g,maskInputFn:f,slimDOM:y=!1,dataURLOptions:k,preserveWhiteSpace:C,onSerialize:S,onIframeLoad:M,iframeLoadTimeout:A,onStylesheetLoad:_,stylesheetLoadTimeout:T,keepIframeSrcFn:I=()=>!1}=e||{};return Bn(n,{doc:n,mirror:i,blockClass:t,blockSelector:o,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p===!1?{password:!0}:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:y==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:y===!1?{}:y,dataURLOptions:k,inlineImages:d,recordCanvas:v,preserveWhiteSpace:C,onSerialize:S,onIframeLoad:M,iframeLoadTimeout:A,onStylesheetLoad:_,stylesheetLoadTimeout:T,keepIframeSrcFn:I,newlyAddedElement:!1})}function ke(n,e,i=document){const t={capture:!0,passive:!0};return i.addEventListener(n,e,t),()=>i.removeEventListener(n,e,t)}const Nn=`Please stop import mirror directly. Instead of that,\r
954
954
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
955
- or you can use record.mirror to access the mirror instance during recording.`;let Wt={map:{},getId(){return console.error(Dn),-1},getNode(){return console.error(Dn),null},removeNodeFromMap(){console.error(Dn)},has(){return console.error(Dn),!1},reset(){console.error(Dn)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Wt=new Proxy(Wt,{get(n,e,i){return e==="map"&&console.error(Dn),Reflect.get(n,e,i)}}));function $n(n,e,i={}){let t=null,o=0;return function(...s){const a=Date.now();!o&&i.leading===!1&&(o=a);const l=e-(a-o),d=this;l<=0||l>e?(t&&(clearTimeout(t),t=null),o=a,n.apply(d,s)):!t&&i.trailing!==!1&&(t=setTimeout(()=>{o=i.leading===!1?0:Date.now(),t=null,n.apply(d,s)},l))}}function fi(n,e,i,t,o=window){const s=o.Object.getOwnPropertyDescriptor(n,e);return o.Object.defineProperty(n,e,t?i:{set(a){setTimeout(()=>{i.set.call(this,a)},0),s&&s.set&&s.set.call(this,a)}}),()=>fi(n,e,s||{},!0)}function Hn(n,e,i){try{if(!(e in n))return()=>{};const t=n[e],o=i(t);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:t}})),n[e]=o,()=>{n[e]=t}}catch{return()=>{}}}let gi=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(gi=()=>new Date().getTime());function Zt(n){var e,i,t,o,s,a;const l=n.document;return{left:l.scrollingElement?l.scrollingElement.scrollLeft:n.pageXOffset!==void 0?n.pageXOffset:(l==null?void 0:l.documentElement.scrollLeft)||((i=(e=l==null?void 0:l.body)===null||e===void 0?void 0:e.parentElement)===null||i===void 0?void 0:i.scrollLeft)||((t=l==null?void 0:l.body)===null||t===void 0?void 0:t.scrollLeft)||0,top:l.scrollingElement?l.scrollingElement.scrollTop:n.pageYOffset!==void 0?n.pageYOffset:(l==null?void 0:l.documentElement.scrollTop)||((s=(o=l==null?void 0:l.body)===null||o===void 0?void 0:o.parentElement)===null||s===void 0?void 0:s.scrollTop)||((a=l==null?void 0:l.body)===null||a===void 0?void 0:a.scrollTop)||0}}function Jt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function $t(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Yt(n){return n?n.nodeType===n.ELEMENT_NODE?n:n.parentElement:null}function Se(n,e,i,t){if(!n)return!1;const o=Yt(n);if(!o)return!1;try{if(typeof e=="string"){if(o.classList.contains(e)||t&&o.closest("."+e)!==null)return!0}else if(bi(o,e,t))return!0}catch{}return!!(i&&(o.matches(i)||t&&o.closest(i)!==null))}function La(n,e){return e.getId(n)!==-1}function Ji(n,e){return e.getId(n)===Jn}function Qt(n,e){if(Wn(n))return!1;const i=e.getId(n);return e.has(i)?n.parentNode&&n.parentNode.nodeType===n.DOCUMENT_NODE?!1:n.parentNode?Qt(n.parentNode,e):!0:!0}function $i(n){return!!n.changedTouches}function Ta(n=window){"NodeList"in n&&!n.NodeList.prototype.forEach&&(n.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in n&&!n.DOMTokenList.prototype.forEach&&(n.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let i=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===i)return!0;while(i=i&&i.parentNode);return!1})}function Xt(n,e){return!!(n.nodeName==="IFRAME"&&e.getMeta(n))}function eo(n,e){return!!(n.nodeName==="LINK"&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&n.getAttribute("rel")==="stylesheet"&&e.getMeta(n))}function Yi(n){return!!(n!=null&&n.shadowRoot)}class Ea{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var i;return(i=this.styleIDMap.get(e))!==null&&i!==void 0?i:-1}has(e){return this.styleIDMap.has(e)}add(e,i){if(this.has(e))return this.getId(e);let t;return i===void 0?t=this.id++:t=i,this.styleIDMap.set(e,t),this.idStyleMap.set(t,e),t}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function no(n){var e,i;let t=null;return((i=(e=n.getRootNode)===null||e===void 0?void 0:e.call(n))===null||i===void 0?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&n.getRootNode().host&&(t=n.getRootNode().host),t}function Pa(n){let e=n,i;for(;i=no(e);)e=i;return e}function Ia(n){const e=n.ownerDocument;if(!e)return!1;const i=Pa(n);return e.contains(i)}function io(n){const e=n.ownerDocument;return e?e.contains(n)||Ia(n):!1}var W=(n=>(n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n))(W||{}),z=(n=>(n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n))(z||{}),Le=(n=>(n[n.MouseUp=0]="MouseUp",n[n.MouseDown=1]="MouseDown",n[n.Click=2]="Click",n[n.ContextMenu=3]="ContextMenu",n[n.DblClick=4]="DblClick",n[n.Focus=5]="Focus",n[n.Blur=6]="Blur",n[n.TouchStart=7]="TouchStart",n[n.TouchMove_Departed=8]="TouchMove_Departed",n[n.TouchEnd=9]="TouchEnd",n[n.TouchCancel=10]="TouchCancel",n))(Le||{}),Je=(n=>(n[n.Mouse=0]="Mouse",n[n.Pen=1]="Pen",n[n.Touch=2]="Touch",n))(Je||{}),Rn=(n=>(n[n["2D"]=0]="2D",n[n.WebGL=1]="WebGL",n[n.WebGL2=2]="WebGL2",n))(Rn||{});function to(n){return"__ln"in n}class Ba{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let i=this.head;for(let t=0;t<e;t++)i=(i==null?void 0:i.next)||null;return i}addNode(e){const i={value:e,previous:null,next:null};if(e.__ln=i,e.previousSibling&&to(e.previousSibling)){const t=e.previousSibling.__ln.next;i.next=t,i.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=i,t&&(t.previous=i)}else if(e.nextSibling&&to(e.nextSibling)&&e.nextSibling.__ln.previous){const t=e.nextSibling.__ln.previous;i.previous=t,i.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=i,t&&(t.next=i)}else this.head&&(this.head.previous=i),i.next=this.head,this.head=i;i.next===null&&(this.tail=i),this.length++}removeNode(e){const i=e.__ln;this.head&&(i.previous?(i.previous.next=i.next,i.next?i.next.previous=i.previous:this.tail=i.previous):(this.head=i.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const oo=(n,e)=>`${n}@${e}`;class Na{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],i=new Set,t=new Ba,o=d=>{let v=d,p=Jn;for(;p===Jn;)v=v&&v.nextSibling,p=v&&this.mirror.getId(v);return p},s=d=>{if(!d.parentNode||!io(d)||d.parentNode.tagName==="TEXTAREA")return;const v=Wn(d.parentNode)?this.mirror.getId(no(d)):this.mirror.getId(d.parentNode),p=o(d);if(v===-1||p===-1)return t.addNode(d);const g=Nn(d,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{Xt(f,this.mirror)&&this.iframeManager.addIframe(f),eo(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Yi(d)&&this.shadowDomManager.addShadowRoot(d.shadowRoot,this.doc)},onIframeLoad:(f,y)=>{this.iframeManager.attachIframe(f,y),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,y)=>{this.stylesheetManager.attachLinkElement(f,y)}});g&&(e.push({parentId:v,nextId:p,node:g}),i.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const d of this.movedSet)so(this.removes,d,this.mirror)&&!this.movedSet.has(d.parentNode)||s(d);for(const d of this.addedSet)!ro(this.droppedSet,d)&&!so(this.removes,d,this.mirror)||ro(this.movedSet,d)?s(d):this.droppedSet.add(d);let a=null;for(;t.length;){let d=null;if(a){const v=this.mirror.getId(a.value.parentNode),p=o(a.value);v!==-1&&p!==-1&&(d=a)}if(!d){let v=t.tail;for(;v;){const p=v;if(v=v.previous,p){const g=this.mirror.getId(p.value.parentNode);if(o(p.value)===-1)continue;if(g!==-1){d=p;break}else{const y=p.value;if(y.parentNode&&y.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const k=y.parentNode.host;if(this.mirror.getId(k)!==-1){d=p;break}}}}}}if(!d){for(;t.head;)t.removeNode(t.head.value);break}a=d.previous,t.removeNode(d.value),s(d.value)}const l={texts:this.texts.map(d=>{const v=d.node;return v.parentNode&&v.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(v.parentNode),{id:this.mirror.getId(v),value:d.value}}).filter(d=>!i.has(d.id)).filter(d=>this.mirror.has(d.id)),attributes:this.attributes.map(d=>{const{attributes:v}=d;if(typeof v.style=="string"){const p=JSON.stringify(d.styleDiff),g=JSON.stringify(d._unchangedStyles);p.length<v.style.length&&(p+g).split("var(").length===v.style.split("var(").length&&(v.style=d.styleDiff)}return{id:this.mirror.getId(d.node),attributes:v}}).filter(d=>!i.has(d.id)).filter(d=>this.mirror.has(d.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.genTextAreaValueMutation=e=>{let i=this.attributeMap.get(e);i||(i={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e,i)),i.attributes.value=Array.from(e.childNodes,t=>t.textContent||"").join("")},this.processMutation=e=>{if(!Ji(e.target,this.mirror))switch(e.type){case"characterData":{const i=e.target.textContent;!Se(e.target,this.blockClass,this.blockSelector,!1)&&i!==e.oldValue&&this.texts.push({value:qt(e.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,Yt(e.target)):i.replace(/[\S]/g,"*"):i,node:e.target});break}case"attributes":{const i=e.target;let t=e.attributeName,o=e.target.getAttribute(t);if(t==="value"){const a=Wi(i);o=qi({element:i,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:a,value:o,maskInputFn:this.maskInputFn})}if(Se(e.target,this.blockClass,this.blockSelector,!1)||o===e.oldValue)return;let s=this.attributeMap.get(e.target);if(i.tagName==="IFRAME"&&t==="src"&&!this.keepIframeSrcFn(o))if(!i.contentDocument)t="rr_src";else return;if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),t==="type"&&i.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&i.setAttribute("data-rr-is-password","true"),!zt(i.tagName,t)&&(s.attributes[t]=Gt(this.doc,yn(i.tagName),yn(t),o),t==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(const l of Array.from(i.style)){const d=i.style.getPropertyValue(l),v=i.style.getPropertyPriority(l);d!==a.style.getPropertyValue(l)||v!==a.style.getPropertyPriority(l)?v===""?s.styleDiff[l]=d:s.styleDiff[l]=[d,v]:s._unchangedStyles[l]=[d,v]}for(const l of Array.from(a.style))i.style.getPropertyValue(l)===""&&(s.styleDiff[l]=!1)}break}case"childList":{if(Se(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(i=>this.genAdds(i,e.target)),e.removedNodes.forEach(i=>{const t=this.mirror.getId(i),o=Wn(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Se(e.target,this.blockClass,this.blockSelector,!1)||Ji(i,this.mirror)||!La(i,this.mirror)||(this.addedSet.has(i)?(Qi(this.addedSet,i),this.droppedSet.add(i)):this.addedSet.has(e.target)&&t===-1||Qt(e.target,this.mirror)||(this.movedSet.has(i)&&this.movedMap[oo(t,o)]?Qi(this.movedSet,i):this.removes.push({parentId:o,id:t,isShadow:Wn(e.target)&&Zn(e.target)?!0:void 0})),this.mapRemoves.push(i))});break}}},this.genAdds=(e,i)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ji(e,this.mirror))return;this.movedSet.add(e);let t=null;i&&this.mirror.hasNode(i)&&(t=this.mirror.getId(i)),t&&t!==-1&&(this.movedMap[oo(this.mirror.getId(e),t)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Se(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(t=>this.genAdds(t)),Yi(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(i=>{this[i]=e[i]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Qi(n,e){n.delete(e),e.childNodes.forEach(i=>Qi(n,i))}function so(n,e,i){return n.length===0?!1:ao(n,e,i)}function ao(n,e,i){const{parentNode:t}=e;if(!t)return!1;const o=i.getId(t);return n.some(s=>s.id===o)?!0:ao(n,t,i)}function ro(n,e){return n.size===0?!1:lo(n,e)}function lo(n,e){const{parentNode:i}=e;return i?n.has(i)?!0:lo(n,i):!1}let Yn;function Da(n){Yn=n}function Ha(){Yn=void 0}const q=n=>Yn?(...i)=>{try{return n(...i)}catch(t){if(Yn&&Yn(t)===!0)return;throw t}}:n,Cn=[];function Qn(n){try{if("composedPath"in n){const e=n.composedPath();if(e.length)return e[0]}else if("path"in n&&n.path.length)return n.path[0]}catch{}return n&&n.target}function co(n,e){var i,t;const o=new Na;Cn.push(o),o.init(n);let s=window.MutationObserver||window.__rrMutationObserver;const a=(t=(i=window==null?void 0:window.Zone)===null||i===void 0?void 0:i.__symbol__)===null||t===void 0?void 0:t.call(i,"MutationObserver");a&&window[a]&&(s=window[a]);const l=new s(q(o.processMutations.bind(o)));return l.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Ra({mousemoveCb:n,sampling:e,doc:i,mirror:t}){if(e.mousemove===!1)return()=>{};const o=typeof e.mousemove=="number"?e.mousemove:50,s=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let a=[],l;const d=$n(q(g=>{const f=Date.now()-l;n(a.map(y=>(y.timeOffset-=f,y)),g),a=[],l=null}),s),v=q($n(q(g=>{const f=Qn(g),{clientX:y,clientY:k}=$i(g)?g.changedTouches[0]:g;l||(l=gi()),a.push({x:y,y:k,id:t.getId(f),timeOffset:gi()-l}),d(typeof DragEvent<"u"&&g instanceof DragEvent?z.Drag:g instanceof MouseEvent?z.MouseMove:z.TouchMove)}),o,{trailing:!1})),p=[ke("mousemove",v,i),ke("touchmove",v,i),ke("drag",v,i)];return q(()=>{p.forEach(g=>g())})}function Oa({mouseInteractionCb:n,doc:e,mirror:i,blockClass:t,blockSelector:o,sampling:s}){if(s.mouseInteraction===!1)return()=>{};const a=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,l=[];let d=null;const v=p=>g=>{const f=Qn(g);if(Se(f,t,o,!0))return;let y=null,k=p;if("pointerType"in g){switch(g.pointerType){case"mouse":y=Je.Mouse;break;case"touch":y=Je.Touch;break;case"pen":y=Je.Pen;break}y===Je.Touch?Le[p]===Le.MouseDown?k="TouchStart":Le[p]===Le.MouseUp&&(k="TouchEnd"):Je.Pen}else $i(g)&&(y=Je.Touch);y!==null?(d=y,(k.startsWith("Touch")&&y===Je.Touch||k.startsWith("Mouse")&&y===Je.Mouse)&&(y=null)):Le[p]===Le.Click&&(y=d,d=null);const C=$i(g)?g.changedTouches[0]:g;if(!C)return;const S=i.getId(f),{clientX:M,clientY:A}=C;q(n)(Object.assign({type:Le[k],id:S,x:M,y:A},y!==null&&{pointerType:y}))};return Object.keys(Le).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&a[p]!==!1).forEach(p=>{let g=yn(p);const f=v(p);if(window.PointerEvent)switch(Le[p]){case Le.MouseDown:case Le.MouseUp:g=g.replace("mouse","pointer");break;case Le.TouchStart:case Le.TouchEnd:return}l.push(ke(g,f,e))}),q(()=>{l.forEach(p=>p())})}function uo({scrollCb:n,doc:e,mirror:i,blockClass:t,blockSelector:o,sampling:s}){const a=q($n(q(l=>{const d=Qn(l);if(!d||Se(d,t,o,!0))return;const v=i.getId(d);if(d===e&&e.defaultView){const p=Zt(e.defaultView);n({id:v,x:p.left,y:p.top})}else n({id:v,x:d.scrollLeft,y:d.scrollTop})}),s.scroll||100));return ke("scroll",a,e)}function Va({viewportResizeCb:n},{win:e}){let i=-1,t=-1;const o=q($n(q(()=>{const s=Jt(),a=$t();(i!==s||t!==a)&&(n({width:Number(a),height:Number(s)}),i=s,t=a)}),200));return ke("resize",o,e)}const Ua=["INPUT","TEXTAREA","SELECT"],ho=new WeakMap;function ja({inputCb:n,doc:e,mirror:i,blockClass:t,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:d,sampling:v,userTriggeredOnInput:p}){function g(A){let _=Qn(A);const T=A.isTrusted,I=_&&_.tagName;if(_&&I==="OPTION"&&(_=_.parentElement),!_||!I||Ua.indexOf(I)<0||Se(_,t,o,!0)||_.classList.contains(s)||a&&_.matches(a))return;let K=_.value,G=!1;const V=Wi(_)||"";V==="radio"||V==="checkbox"?G=_.checked:(l[I.toLowerCase()]||l[V])&&(K=qi({element:_,maskInputOptions:l,tagName:I,type:V,value:K,maskInputFn:d})),f(_,p?{text:K,isChecked:G,userTriggered:T}:{text:K,isChecked:G});const F=_.name;V==="radio"&&F&&G&&e.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach(oe=>{if(oe!==_){const ge=oe.value;f(oe,p?{text:ge,isChecked:!G,userTriggered:!1}:{text:ge,isChecked:!G})}})}function f(A,_){const T=ho.get(A);if(!T||T.text!==_.text||T.isChecked!==_.isChecked){ho.set(A,_);const I=i.getId(A);q(n)(Object.assign(Object.assign({},_),{id:I}))}}const k=(v.input==="last"?["change"]:["input","change"]).map(A=>ke(A,q(g),e)),C=e.defaultView;if(!C)return()=>{k.forEach(A=>A())};const S=C.Object.getOwnPropertyDescriptor(C.HTMLInputElement.prototype,"value"),M=[[C.HTMLInputElement.prototype,"value"],[C.HTMLInputElement.prototype,"checked"],[C.HTMLSelectElement.prototype,"value"],[C.HTMLTextAreaElement.prototype,"value"],[C.HTMLSelectElement.prototype,"selectedIndex"],[C.HTMLOptionElement.prototype,"selected"]];return S&&S.set&&k.push(...M.map(A=>fi(A[0],A[1],{set(){q(g)({target:this,isTrusted:!1})}},!1,C))),q(()=>{k.forEach(A=>A())})}function yi(n){const e=[];function i(t,o){if(Ci("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Ci("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Ci("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Ci("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const a=Array.from(t.parentRule.cssRules).indexOf(t);o.unshift(a)}else if(t.parentStyleSheet){const a=Array.from(t.parentStyleSheet.cssRules).indexOf(t);o.unshift(a)}return o}return i(n,e)}function rn(n,e,i){let t,o;return n?(n.ownerNode?t=e.getId(n.ownerNode):o=i.getId(n),{styleId:o,id:t}):{}}function Ka({styleSheetRuleCb:n,mirror:e,stylesheetManager:i},{win:t}){if(!t.CSSStyleSheet||!t.CSSStyleSheet.prototype)return()=>{};const o=t.CSSStyleSheet.prototype.insertRule;t.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:q((p,g,f)=>{const[y,k]=f,{id:C,styleId:S}=rn(g,e,i.styleMirror);return(C&&C!==-1||S&&S!==-1)&&n({id:C,styleId:S,adds:[{rule:y,index:k}]}),p.apply(g,f)})});const s=t.CSSStyleSheet.prototype.deleteRule;t.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:q((p,g,f)=>{const[y]=f,{id:k,styleId:C}=rn(g,e,i.styleMirror);return(k&&k!==-1||C&&C!==-1)&&n({id:k,styleId:C,removes:[{index:y}]}),p.apply(g,f)})});let a;t.CSSStyleSheet.prototype.replace&&(a=t.CSSStyleSheet.prototype.replace,t.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:q((p,g,f)=>{const[y]=f,{id:k,styleId:C}=rn(g,e,i.styleMirror);return(k&&k!==-1||C&&C!==-1)&&n({id:k,styleId:C,replace:y}),p.apply(g,f)})}));let l;t.CSSStyleSheet.prototype.replaceSync&&(l=t.CSSStyleSheet.prototype.replaceSync,t.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:q((p,g,f)=>{const[y]=f,{id:k,styleId:C}=rn(g,e,i.styleMirror);return(k&&k!==-1||C&&C!==-1)&&n({id:k,styleId:C,replaceSync:y}),p.apply(g,f)})}));const d={};wi("CSSGroupingRule")?d.CSSGroupingRule=t.CSSGroupingRule:(wi("CSSMediaRule")&&(d.CSSMediaRule=t.CSSMediaRule),wi("CSSConditionRule")&&(d.CSSConditionRule=t.CSSConditionRule),wi("CSSSupportsRule")&&(d.CSSSupportsRule=t.CSSSupportsRule));const v={};return Object.entries(d).forEach(([p,g])=>{v[p]={insertRule:g.prototype.insertRule,deleteRule:g.prototype.deleteRule},g.prototype.insertRule=new Proxy(v[p].insertRule,{apply:q((f,y,k)=>{const[C,S]=k,{id:M,styleId:A}=rn(y.parentStyleSheet,e,i.styleMirror);return(M&&M!==-1||A&&A!==-1)&&n({id:M,styleId:A,adds:[{rule:C,index:[...yi(y),S||0]}]}),f.apply(y,k)})}),g.prototype.deleteRule=new Proxy(v[p].deleteRule,{apply:q((f,y,k)=>{const[C]=k,{id:S,styleId:M}=rn(y.parentStyleSheet,e,i.styleMirror);return(S&&S!==-1||M&&M!==-1)&&n({id:S,styleId:M,removes:[{index:[...yi(y),C]}]}),f.apply(y,k)})})}),q(()=>{t.CSSStyleSheet.prototype.insertRule=o,t.CSSStyleSheet.prototype.deleteRule=s,a&&(t.CSSStyleSheet.prototype.replace=a),l&&(t.CSSStyleSheet.prototype.replaceSync=l),Object.entries(d).forEach(([p,g])=>{g.prototype.insertRule=v[p].insertRule,g.prototype.deleteRule=v[p].deleteRule})})}function mo({mirror:n,stylesheetManager:e},i){var t,o,s;let a=null;i.nodeName==="#document"?a=n.getId(i):a=n.getId(i.host);const l=i.nodeName==="#document"?(t=i.defaultView)===null||t===void 0?void 0:t.Document:(s=(o=i.ownerDocument)===null||o===void 0?void 0:o.defaultView)===null||s===void 0?void 0:s.ShadowRoot,d=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!l||!d?()=>{}:(Object.defineProperty(i,"adoptedStyleSheets",{configurable:d.configurable,enumerable:d.enumerable,get(){var v;return(v=d.get)===null||v===void 0?void 0:v.call(this)},set(v){var p;const g=(p=d.set)===null||p===void 0?void 0:p.call(this,v);if(a!==null&&a!==-1)try{e.adoptStyleSheets(v,a)}catch{}return g}}),q(()=>{Object.defineProperty(i,"adoptedStyleSheets",{configurable:d.configurable,enumerable:d.enumerable,get:d.get,set:d.set})}))}function Fa({styleDeclarationCb:n,mirror:e,ignoreCSSAttributes:i,stylesheetManager:t},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:q((l,d,v)=>{var p;const[g,f,y]=v;if(i.has(g))return s.apply(d,[g,f,y]);const{id:k,styleId:C}=rn((p=d.parentRule)===null||p===void 0?void 0:p.parentStyleSheet,e,t.styleMirror);return(k&&k!==-1||C&&C!==-1)&&n({id:k,styleId:C,set:{property:g,value:f,priority:y},index:yi(d.parentRule)}),l.apply(d,v)})});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:q((l,d,v)=>{var p;const[g]=v;if(i.has(g))return a.apply(d,[g]);const{id:f,styleId:y}=rn((p=d.parentRule)===null||p===void 0?void 0:p.parentStyleSheet,e,t.styleMirror);return(f&&f!==-1||y&&y!==-1)&&n({id:f,styleId:y,remove:{property:g},index:yi(d.parentRule)}),l.apply(d,v)})}),q(()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=a})}function Ga({mediaInteractionCb:n,blockClass:e,blockSelector:i,mirror:t,sampling:o,doc:s}){const a=q(d=>$n(q(v=>{const p=Qn(v);if(!p||Se(p,e,i,!0))return;const{currentTime:g,volume:f,muted:y,playbackRate:k,loop:C}=p;n({type:d,id:t.getId(p),currentTime:g,volume:f,muted:y,playbackRate:k,loop:C})}),o.media||500)),l=[ke("play",a(0),s),ke("pause",a(1),s),ke("seeked",a(2),s),ke("volumechange",a(3),s),ke("ratechange",a(4),s)];return q(()=>{l.forEach(d=>d())})}function za({fontCb:n,doc:e}){const i=e.defaultView;if(!i)return()=>{};const t=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(d,v,p){const g=new s(d,v,p);return o.set(g,{family:d,buffer:typeof v!="string",descriptors:p,fontSource:typeof v=="string"?v:JSON.stringify(Array.from(new Uint8Array(v)))}),g};const a=Hn(e.fonts,"add",function(l){return function(d){return setTimeout(q(()=>{const v=o.get(d);v&&(n(v),o.delete(d))}),0),l.apply(this,[d])}});return t.push(()=>{i.FontFace=s}),t.push(a),q(()=>{t.forEach(l=>l())})}function qa(n){const{doc:e,mirror:i,blockClass:t,blockSelector:o,selectionCb:s}=n;let a=!0;const l=q(()=>{const d=e.getSelection();if(!d||a&&(d!=null&&d.isCollapsed))return;a=d.isCollapsed||!1;const v=[],p=d.rangeCount||0;for(let g=0;g<p;g++){const f=d.getRangeAt(g),{startContainer:y,startOffset:k,endContainer:C,endOffset:S}=f;Se(y,t,o,!0)||Se(C,t,o,!0)||v.push({start:i.getId(y),startOffset:k,end:i.getId(C),endOffset:S})}s({ranges:v})});return l(),ke("selectionchange",l)}function Wa({doc:n,customElementCb:e}){const i=n.defaultView;return!i||!i.customElements?()=>{}:Hn(i.customElements,"define",function(o){return function(s,a,l){try{e({define:{name:s}})}catch{console.warn(`Custom element callback failed for ${s}`)}return o.apply(this,[s,a,l])}})}function Za(n,e){const{mutationCb:i,mousemoveCb:t,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:a,inputCb:l,mediaInteractionCb:d,styleSheetRuleCb:v,styleDeclarationCb:p,canvasMutationCb:g,fontCb:f,selectionCb:y,customElementCb:k}=n;n.mutationCb=(...C)=>{e.mutation&&e.mutation(...C),i(...C)},n.mousemoveCb=(...C)=>{e.mousemove&&e.mousemove(...C),t(...C)},n.mouseInteractionCb=(...C)=>{e.mouseInteraction&&e.mouseInteraction(...C),o(...C)},n.scrollCb=(...C)=>{e.scroll&&e.scroll(...C),s(...C)},n.viewportResizeCb=(...C)=>{e.viewportResize&&e.viewportResize(...C),a(...C)},n.inputCb=(...C)=>{e.input&&e.input(...C),l(...C)},n.mediaInteractionCb=(...C)=>{e.mediaInteaction&&e.mediaInteaction(...C),d(...C)},n.styleSheetRuleCb=(...C)=>{e.styleSheetRule&&e.styleSheetRule(...C),v(...C)},n.styleDeclarationCb=(...C)=>{e.styleDeclaration&&e.styleDeclaration(...C),p(...C)},n.canvasMutationCb=(...C)=>{e.canvasMutation&&e.canvasMutation(...C),g(...C)},n.fontCb=(...C)=>{e.font&&e.font(...C),f(...C)},n.selectionCb=(...C)=>{e.selection&&e.selection(...C),y(...C)},n.customElementCb=(...C)=>{e.customElement&&e.customElement(...C),k(...C)}}function Ja(n,e={}){const i=n.doc.defaultView;if(!i)return()=>{};Za(n,e);let t;n.recordDOM&&(t=co(n,n.doc));const o=Ra(n),s=Oa(n),a=uo(n),l=Va(n,{win:i}),d=ja(n),v=Ga(n);let p=()=>{},g=()=>{},f=()=>{},y=()=>{};n.recordDOM&&(p=Ka(n,{win:i}),g=mo(n,n.doc),f=Fa(n,{win:i}),n.collectFonts&&(y=za(n)));const k=qa(n),C=Wa(n),S=[];for(const M of n.plugins)S.push(M.observer(M.callback,i,M.options));return q(()=>{Cn.forEach(M=>M.reset()),t==null||t.disconnect(),o(),s(),a(),l(),d(),v(),p(),g(),f(),y(),k(),C(),S.forEach(M=>M())})}function Ci(n){return typeof window[n]<"u"}function wi(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}class po{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,i,t,o){const s=t||this.getIdToRemoteIdMap(e),a=o||this.getRemoteIdToIdMap(e);let l=s.get(i);return l||(l=this.generateIdFn(),s.set(i,l),a.set(l,i)),l}getIds(e,i){const t=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return i.map(s=>this.getId(e,s,t,o))}getRemoteId(e,i,t){const o=t||this.getRemoteIdToIdMap(e);if(typeof i!="number")return i;const s=o.get(i);return s||-1}getRemoteIds(e,i){const t=this.getRemoteIdToIdMap(e);return i.map(o=>this.getRemoteId(e,o,t))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let i=this.iframeIdToRemoteIdMap.get(e);return i||(i=new Map,this.iframeIdToRemoteIdMap.set(e,i)),i}getRemoteIdToIdMap(e){let i=this.iframeRemoteIdToIdMap.get(e);return i||(i=new Map,this.iframeRemoteIdToIdMap.set(e,i)),i}}class $a{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new po(Kt),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new po(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,i){var t;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(t=this.loadListener)===null||t===void 0||t.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const i=e;if(i.data.type!=="rrweb"||i.origin!==i.data.origin||!e.source)return;const o=this.crossOriginIframeMap.get(e.source);if(!o)return;const s=this.transformCrossOriginEvent(o,i.data.event);s&&this.wrappedEmit(s,i.data.isCheckout)}transformCrossOriginEvent(e,i){var t;switch(i.type){case W.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(i.data.node,e);const o=i.data.node.id;return this.crossOriginIframeRootIdMap.set(e,o),this.patchRootIdOnNode(i.data.node,o),{timestamp:i.timestamp,type:W.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:i.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case W.Meta:case W.Load:case W.DomContentLoaded:return!1;case W.Plugin:return i;case W.Custom:return this.replaceIds(i.data.payload,e,["id","parentId","previousId","nextId"]),i;case W.IncrementalSnapshot:switch(i.data.source){case z.Mutation:return i.data.adds.forEach(o=>{this.replaceIds(o,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,e);const s=this.crossOriginIframeRootIdMap.get(e);s&&this.patchRootIdOnNode(o.node,s)}),i.data.removes.forEach(o=>{this.replaceIds(o,e,["parentId","id"])}),i.data.attributes.forEach(o=>{this.replaceIds(o,e,["id"])}),i.data.texts.forEach(o=>{this.replaceIds(o,e,["id"])}),i;case z.Drag:case z.TouchMove:case z.MouseMove:return i.data.positions.forEach(o=>{this.replaceIds(o,e,["id"])}),i;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(i.data,e,["id"]),i;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(i.data,e,["id"]),this.replaceStyleIds(i.data,e,["styleId"]),i;case z.Font:return i;case z.Selection:return i.data.ranges.forEach(o=>{this.replaceIds(o,e,["start","end"])}),i;case z.AdoptedStyleSheet:return this.replaceIds(i.data,e,["id"]),this.replaceStyleIds(i.data,e,["styleIds"]),(t=i.data.styles)===null||t===void 0||t.forEach(o=>{this.replaceStyleIds(o,e,["styleId"])}),i}}return!1}replace(e,i,t,o){for(const s of o)!Array.isArray(i[s])&&typeof i[s]!="number"||(Array.isArray(i[s])?i[s]=e.getIds(t,i[s]):i[s]=e.getId(t,i[s]));return i}replaceIds(e,i,t){return this.replace(this.crossOriginIframeMirror,e,i,t)}replaceStyleIds(e,i,t){return this.replace(this.crossOriginIframeStyleMirror,e,i,t)}replaceIdOnNode(e,i){this.replaceIds(e,i,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(t=>{this.replaceIdOnNode(t,i)})}patchRootIdOnNode(e,i){e.type!==le.Document&&!e.rootId&&(e.rootId=i),"childNodes"in e&&e.childNodes.forEach(t=>{this.patchRootIdOnNode(t,i)})}}class Ya{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,i){if(!Zn(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const t=co(Object.assign(Object.assign({},this.bypassOptions),{doc:i,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>t.disconnect()),this.restoreHandlers.push(uo(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(mo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,i){const t=this;this.restoreHandlers.push(Hn(e.prototype,"attachShadow",function(o){return function(s){const a=o.call(this,s);return this.shadowRoot&&io(this)&&t.addShadowRoot(this.shadowRoot,i),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
955
+ or you can use record.mirror to access the mirror instance during recording.`;let Wt={map:{},getId(){return console.error(Nn),-1},getNode(){return console.error(Nn),null},removeNodeFromMap(){console.error(Nn)},has(){return console.error(Nn),!1},reset(){console.error(Nn)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Wt=new Proxy(Wt,{get(n,e,i){return e==="map"&&console.error(Nn),Reflect.get(n,e,i)}}));function $n(n,e,i={}){let t=null,o=0;return function(...s){const a=Date.now();!o&&i.leading===!1&&(o=a);const l=e-(a-o),d=this;l<=0||l>e?(t&&(clearTimeout(t),t=null),o=a,n.apply(d,s)):!t&&i.trailing!==!1&&(t=setTimeout(()=>{o=i.leading===!1?0:Date.now(),t=null,n.apply(d,s)},l))}}function fi(n,e,i,t,o=window){const s=o.Object.getOwnPropertyDescriptor(n,e);return o.Object.defineProperty(n,e,t?i:{set(a){setTimeout(()=>{i.set.call(this,a)},0),s&&s.set&&s.set.call(this,a)}}),()=>fi(n,e,s||{},!0)}function Hn(n,e,i){try{if(!(e in n))return()=>{};const t=n[e],o=i(t);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:t}})),n[e]=o,()=>{n[e]=t}}catch{return()=>{}}}let gi=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(gi=()=>new Date().getTime());function Zt(n){var e,i,t,o,s,a;const l=n.document;return{left:l.scrollingElement?l.scrollingElement.scrollLeft:n.pageXOffset!==void 0?n.pageXOffset:(l==null?void 0:l.documentElement.scrollLeft)||((i=(e=l==null?void 0:l.body)===null||e===void 0?void 0:e.parentElement)===null||i===void 0?void 0:i.scrollLeft)||((t=l==null?void 0:l.body)===null||t===void 0?void 0:t.scrollLeft)||0,top:l.scrollingElement?l.scrollingElement.scrollTop:n.pageYOffset!==void 0?n.pageYOffset:(l==null?void 0:l.documentElement.scrollTop)||((s=(o=l==null?void 0:l.body)===null||o===void 0?void 0:o.parentElement)===null||s===void 0?void 0:s.scrollTop)||((a=l==null?void 0:l.body)===null||a===void 0?void 0:a.scrollTop)||0}}function Jt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function $t(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Yt(n){return n?n.nodeType===n.ELEMENT_NODE?n:n.parentElement:null}function Se(n,e,i,t){if(!n)return!1;const o=Yt(n);if(!o)return!1;try{if(typeof e=="string"){if(o.classList.contains(e)||t&&o.closest("."+e)!==null)return!0}else if(bi(o,e,t))return!0}catch{}return!!(i&&(o.matches(i)||t&&o.closest(i)!==null))}function La(n,e){return e.getId(n)!==-1}function Ji(n,e){return e.getId(n)===Jn}function Qt(n,e){if(Wn(n))return!1;const i=e.getId(n);return e.has(i)?n.parentNode&&n.parentNode.nodeType===n.DOCUMENT_NODE?!1:n.parentNode?Qt(n.parentNode,e):!0:!0}function $i(n){return!!n.changedTouches}function Ta(n=window){"NodeList"in n&&!n.NodeList.prototype.forEach&&(n.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in n&&!n.DOMTokenList.prototype.forEach&&(n.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let i=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===i)return!0;while(i=i&&i.parentNode);return!1})}function Xt(n,e){return!!(n.nodeName==="IFRAME"&&e.getMeta(n))}function eo(n,e){return!!(n.nodeName==="LINK"&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&n.getAttribute("rel")==="stylesheet"&&e.getMeta(n))}function Yi(n){return!!(n!=null&&n.shadowRoot)}class Ea{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var i;return(i=this.styleIDMap.get(e))!==null&&i!==void 0?i:-1}has(e){return this.styleIDMap.has(e)}add(e,i){if(this.has(e))return this.getId(e);let t;return i===void 0?t=this.id++:t=i,this.styleIDMap.set(e,t),this.idStyleMap.set(t,e),t}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function no(n){var e,i;let t=null;return((i=(e=n.getRootNode)===null||e===void 0?void 0:e.call(n))===null||i===void 0?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&n.getRootNode().host&&(t=n.getRootNode().host),t}function Pa(n){let e=n,i;for(;i=no(e);)e=i;return e}function Ia(n){const e=n.ownerDocument;if(!e)return!1;const i=Pa(n);return e.contains(i)}function io(n){const e=n.ownerDocument;return e?e.contains(n)||Ia(n):!1}var W=(n=>(n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n))(W||{}),z=(n=>(n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n))(z||{}),Le=(n=>(n[n.MouseUp=0]="MouseUp",n[n.MouseDown=1]="MouseDown",n[n.Click=2]="Click",n[n.ContextMenu=3]="ContextMenu",n[n.DblClick=4]="DblClick",n[n.Focus=5]="Focus",n[n.Blur=6]="Blur",n[n.TouchStart=7]="TouchStart",n[n.TouchMove_Departed=8]="TouchMove_Departed",n[n.TouchEnd=9]="TouchEnd",n[n.TouchCancel=10]="TouchCancel",n))(Le||{}),Je=(n=>(n[n.Mouse=0]="Mouse",n[n.Pen=1]="Pen",n[n.Touch=2]="Touch",n))(Je||{}),Rn=(n=>(n[n["2D"]=0]="2D",n[n.WebGL=1]="WebGL",n[n.WebGL2=2]="WebGL2",n))(Rn||{});function to(n){return"__ln"in n}class Da{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let i=this.head;for(let t=0;t<e;t++)i=(i==null?void 0:i.next)||null;return i}addNode(e){const i={value:e,previous:null,next:null};if(e.__ln=i,e.previousSibling&&to(e.previousSibling)){const t=e.previousSibling.__ln.next;i.next=t,i.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=i,t&&(t.previous=i)}else if(e.nextSibling&&to(e.nextSibling)&&e.nextSibling.__ln.previous){const t=e.nextSibling.__ln.previous;i.previous=t,i.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=i,t&&(t.next=i)}else this.head&&(this.head.previous=i),i.next=this.head,this.head=i;i.next===null&&(this.tail=i),this.length++}removeNode(e){const i=e.__ln;this.head&&(i.previous?(i.previous.next=i.next,i.next?i.next.previous=i.previous:this.tail=i.previous):(this.head=i.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const oo=(n,e)=>`${n}@${e}`;class Ba{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],i=new Set,t=new Da,o=d=>{let v=d,p=Jn;for(;p===Jn;)v=v&&v.nextSibling,p=v&&this.mirror.getId(v);return p},s=d=>{if(!d.parentNode||!io(d)||d.parentNode.tagName==="TEXTAREA")return;const v=Wn(d.parentNode)?this.mirror.getId(no(d)):this.mirror.getId(d.parentNode),p=o(d);if(v===-1||p===-1)return t.addNode(d);const g=Bn(d,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:f=>{Xt(f,this.mirror)&&this.iframeManager.addIframe(f),eo(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Yi(d)&&this.shadowDomManager.addShadowRoot(d.shadowRoot,this.doc)},onIframeLoad:(f,y)=>{this.iframeManager.attachIframe(f,y),this.shadowDomManager.observeAttachShadow(f)},onStylesheetLoad:(f,y)=>{this.stylesheetManager.attachLinkElement(f,y)}});g&&(e.push({parentId:v,nextId:p,node:g}),i.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const d of this.movedSet)so(this.removes,d,this.mirror)&&!this.movedSet.has(d.parentNode)||s(d);for(const d of this.addedSet)!ro(this.droppedSet,d)&&!so(this.removes,d,this.mirror)||ro(this.movedSet,d)?s(d):this.droppedSet.add(d);let a=null;for(;t.length;){let d=null;if(a){const v=this.mirror.getId(a.value.parentNode),p=o(a.value);v!==-1&&p!==-1&&(d=a)}if(!d){let v=t.tail;for(;v;){const p=v;if(v=v.previous,p){const g=this.mirror.getId(p.value.parentNode);if(o(p.value)===-1)continue;if(g!==-1){d=p;break}else{const y=p.value;if(y.parentNode&&y.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const k=y.parentNode.host;if(this.mirror.getId(k)!==-1){d=p;break}}}}}}if(!d){for(;t.head;)t.removeNode(t.head.value);break}a=d.previous,t.removeNode(d.value),s(d.value)}const l={texts:this.texts.map(d=>{const v=d.node;return v.parentNode&&v.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(v.parentNode),{id:this.mirror.getId(v),value:d.value}}).filter(d=>!i.has(d.id)).filter(d=>this.mirror.has(d.id)),attributes:this.attributes.map(d=>{const{attributes:v}=d;if(typeof v.style=="string"){const p=JSON.stringify(d.styleDiff),g=JSON.stringify(d._unchangedStyles);p.length<v.style.length&&(p+g).split("var(").length===v.style.split("var(").length&&(v.style=d.styleDiff)}return{id:this.mirror.getId(d.node),attributes:v}}).filter(d=>!i.has(d.id)).filter(d=>this.mirror.has(d.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(l))},this.genTextAreaValueMutation=e=>{let i=this.attributeMap.get(e);i||(i={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e,i)),i.attributes.value=Array.from(e.childNodes,t=>t.textContent||"").join("")},this.processMutation=e=>{if(!Ji(e.target,this.mirror))switch(e.type){case"characterData":{const i=e.target.textContent;!Se(e.target,this.blockClass,this.blockSelector,!1)&&i!==e.oldValue&&this.texts.push({value:qt(e.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,Yt(e.target)):i.replace(/[\S]/g,"*"):i,node:e.target});break}case"attributes":{const i=e.target;let t=e.attributeName,o=e.target.getAttribute(t);if(t==="value"){const a=Wi(i);o=qi({element:i,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:a,value:o,maskInputFn:this.maskInputFn})}if(Se(e.target,this.blockClass,this.blockSelector,!1)||o===e.oldValue)return;let s=this.attributeMap.get(e.target);if(i.tagName==="IFRAME"&&t==="src"&&!this.keepIframeSrcFn(o))if(!i.contentDocument)t="rr_src";else return;if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),t==="type"&&i.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&i.setAttribute("data-rr-is-password","true"),!zt(i.tagName,t)&&(s.attributes[t]=Gt(this.doc,yn(i.tagName),yn(t),o),t==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(const l of Array.from(i.style)){const d=i.style.getPropertyValue(l),v=i.style.getPropertyPriority(l);d!==a.style.getPropertyValue(l)||v!==a.style.getPropertyPriority(l)?v===""?s.styleDiff[l]=d:s.styleDiff[l]=[d,v]:s._unchangedStyles[l]=[d,v]}for(const l of Array.from(a.style))i.style.getPropertyValue(l)===""&&(s.styleDiff[l]=!1)}break}case"childList":{if(Se(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(i=>this.genAdds(i,e.target)),e.removedNodes.forEach(i=>{const t=this.mirror.getId(i),o=Wn(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Se(e.target,this.blockClass,this.blockSelector,!1)||Ji(i,this.mirror)||!La(i,this.mirror)||(this.addedSet.has(i)?(Qi(this.addedSet,i),this.droppedSet.add(i)):this.addedSet.has(e.target)&&t===-1||Qt(e.target,this.mirror)||(this.movedSet.has(i)&&this.movedMap[oo(t,o)]?Qi(this.movedSet,i):this.removes.push({parentId:o,id:t,isShadow:Wn(e.target)&&Zn(e.target)?!0:void 0})),this.mapRemoves.push(i))});break}}},this.genAdds=(e,i)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ji(e,this.mirror))return;this.movedSet.add(e);let t=null;i&&this.mirror.hasNode(i)&&(t=this.mirror.getId(i)),t&&t!==-1&&(this.movedMap[oo(this.mirror.getId(e),t)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Se(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(t=>this.genAdds(t)),Yi(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(i=>{this[i]=e[i]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Qi(n,e){n.delete(e),e.childNodes.forEach(i=>Qi(n,i))}function so(n,e,i){return n.length===0?!1:ao(n,e,i)}function ao(n,e,i){const{parentNode:t}=e;if(!t)return!1;const o=i.getId(t);return n.some(s=>s.id===o)?!0:ao(n,t,i)}function ro(n,e){return n.size===0?!1:lo(n,e)}function lo(n,e){const{parentNode:i}=e;return i?n.has(i)?!0:lo(n,i):!1}let Yn;function Na(n){Yn=n}function Ha(){Yn=void 0}const q=n=>Yn?(...i)=>{try{return n(...i)}catch(t){if(Yn&&Yn(t)===!0)return;throw t}}:n,Cn=[];function Qn(n){try{if("composedPath"in n){const e=n.composedPath();if(e.length)return e[0]}else if("path"in n&&n.path.length)return n.path[0]}catch{}return n&&n.target}function co(n,e){var i,t;const o=new Ba;Cn.push(o),o.init(n);let s=window.MutationObserver||window.__rrMutationObserver;const a=(t=(i=window==null?void 0:window.Zone)===null||i===void 0?void 0:i.__symbol__)===null||t===void 0?void 0:t.call(i,"MutationObserver");a&&window[a]&&(s=window[a]);const l=new s(q(o.processMutations.bind(o)));return l.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),l}function Ra({mousemoveCb:n,sampling:e,doc:i,mirror:t}){if(e.mousemove===!1)return()=>{};const o=typeof e.mousemove=="number"?e.mousemove:50,s=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let a=[],l;const d=$n(q(g=>{const f=Date.now()-l;n(a.map(y=>(y.timeOffset-=f,y)),g),a=[],l=null}),s),v=q($n(q(g=>{const f=Qn(g),{clientX:y,clientY:k}=$i(g)?g.changedTouches[0]:g;l||(l=gi()),a.push({x:y,y:k,id:t.getId(f),timeOffset:gi()-l}),d(typeof DragEvent<"u"&&g instanceof DragEvent?z.Drag:g instanceof MouseEvent?z.MouseMove:z.TouchMove)}),o,{trailing:!1})),p=[ke("mousemove",v,i),ke("touchmove",v,i),ke("drag",v,i)];return q(()=>{p.forEach(g=>g())})}function Oa({mouseInteractionCb:n,doc:e,mirror:i,blockClass:t,blockSelector:o,sampling:s}){if(s.mouseInteraction===!1)return()=>{};const a=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,l=[];let d=null;const v=p=>g=>{const f=Qn(g);if(Se(f,t,o,!0))return;let y=null,k=p;if("pointerType"in g){switch(g.pointerType){case"mouse":y=Je.Mouse;break;case"touch":y=Je.Touch;break;case"pen":y=Je.Pen;break}y===Je.Touch?Le[p]===Le.MouseDown?k="TouchStart":Le[p]===Le.MouseUp&&(k="TouchEnd"):Je.Pen}else $i(g)&&(y=Je.Touch);y!==null?(d=y,(k.startsWith("Touch")&&y===Je.Touch||k.startsWith("Mouse")&&y===Je.Mouse)&&(y=null)):Le[p]===Le.Click&&(y=d,d=null);const C=$i(g)?g.changedTouches[0]:g;if(!C)return;const S=i.getId(f),{clientX:M,clientY:A}=C;q(n)(Object.assign({type:Le[k],id:S,x:M,y:A},y!==null&&{pointerType:y}))};return Object.keys(Le).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&a[p]!==!1).forEach(p=>{let g=yn(p);const f=v(p);if(window.PointerEvent)switch(Le[p]){case Le.MouseDown:case Le.MouseUp:g=g.replace("mouse","pointer");break;case Le.TouchStart:case Le.TouchEnd:return}l.push(ke(g,f,e))}),q(()=>{l.forEach(p=>p())})}function uo({scrollCb:n,doc:e,mirror:i,blockClass:t,blockSelector:o,sampling:s}){const a=q($n(q(l=>{const d=Qn(l);if(!d||Se(d,t,o,!0))return;const v=i.getId(d);if(d===e&&e.defaultView){const p=Zt(e.defaultView);n({id:v,x:p.left,y:p.top})}else n({id:v,x:d.scrollLeft,y:d.scrollTop})}),s.scroll||100));return ke("scroll",a,e)}function Va({viewportResizeCb:n},{win:e}){let i=-1,t=-1;const o=q($n(q(()=>{const s=Jt(),a=$t();(i!==s||t!==a)&&(n({width:Number(a),height:Number(s)}),i=s,t=a)}),200));return ke("resize",o,e)}const Ua=["INPUT","TEXTAREA","SELECT"],ho=new WeakMap;function ja({inputCb:n,doc:e,mirror:i,blockClass:t,blockSelector:o,ignoreClass:s,ignoreSelector:a,maskInputOptions:l,maskInputFn:d,sampling:v,userTriggeredOnInput:p}){function g(A){let _=Qn(A);const T=A.isTrusted,I=_&&_.tagName;if(_&&I==="OPTION"&&(_=_.parentElement),!_||!I||Ua.indexOf(I)<0||Se(_,t,o,!0)||_.classList.contains(s)||a&&_.matches(a))return;let K=_.value,G=!1;const V=Wi(_)||"";V==="radio"||V==="checkbox"?G=_.checked:(l[I.toLowerCase()]||l[V])&&(K=qi({element:_,maskInputOptions:l,tagName:I,type:V,value:K,maskInputFn:d})),f(_,p?{text:K,isChecked:G,userTriggered:T}:{text:K,isChecked:G});const F=_.name;V==="radio"&&F&&G&&e.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach(oe=>{if(oe!==_){const ge=oe.value;f(oe,p?{text:ge,isChecked:!G,userTriggered:!1}:{text:ge,isChecked:!G})}})}function f(A,_){const T=ho.get(A);if(!T||T.text!==_.text||T.isChecked!==_.isChecked){ho.set(A,_);const I=i.getId(A);q(n)(Object.assign(Object.assign({},_),{id:I}))}}const k=(v.input==="last"?["change"]:["input","change"]).map(A=>ke(A,q(g),e)),C=e.defaultView;if(!C)return()=>{k.forEach(A=>A())};const S=C.Object.getOwnPropertyDescriptor(C.HTMLInputElement.prototype,"value"),M=[[C.HTMLInputElement.prototype,"value"],[C.HTMLInputElement.prototype,"checked"],[C.HTMLSelectElement.prototype,"value"],[C.HTMLTextAreaElement.prototype,"value"],[C.HTMLSelectElement.prototype,"selectedIndex"],[C.HTMLOptionElement.prototype,"selected"]];return S&&S.set&&k.push(...M.map(A=>fi(A[0],A[1],{set(){q(g)({target:this,isTrusted:!1})}},!1,C))),q(()=>{k.forEach(A=>A())})}function yi(n){const e=[];function i(t,o){if(Ci("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Ci("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Ci("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Ci("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const a=Array.from(t.parentRule.cssRules).indexOf(t);o.unshift(a)}else if(t.parentStyleSheet){const a=Array.from(t.parentStyleSheet.cssRules).indexOf(t);o.unshift(a)}return o}return i(n,e)}function rn(n,e,i){let t,o;return n?(n.ownerNode?t=e.getId(n.ownerNode):o=i.getId(n),{styleId:o,id:t}):{}}function Ka({styleSheetRuleCb:n,mirror:e,stylesheetManager:i},{win:t}){if(!t.CSSStyleSheet||!t.CSSStyleSheet.prototype)return()=>{};const o=t.CSSStyleSheet.prototype.insertRule;t.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:q((p,g,f)=>{const[y,k]=f,{id:C,styleId:S}=rn(g,e,i.styleMirror);return(C&&C!==-1||S&&S!==-1)&&n({id:C,styleId:S,adds:[{rule:y,index:k}]}),p.apply(g,f)})});const s=t.CSSStyleSheet.prototype.deleteRule;t.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:q((p,g,f)=>{const[y]=f,{id:k,styleId:C}=rn(g,e,i.styleMirror);return(k&&k!==-1||C&&C!==-1)&&n({id:k,styleId:C,removes:[{index:y}]}),p.apply(g,f)})});let a;t.CSSStyleSheet.prototype.replace&&(a=t.CSSStyleSheet.prototype.replace,t.CSSStyleSheet.prototype.replace=new Proxy(a,{apply:q((p,g,f)=>{const[y]=f,{id:k,styleId:C}=rn(g,e,i.styleMirror);return(k&&k!==-1||C&&C!==-1)&&n({id:k,styleId:C,replace:y}),p.apply(g,f)})}));let l;t.CSSStyleSheet.prototype.replaceSync&&(l=t.CSSStyleSheet.prototype.replaceSync,t.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:q((p,g,f)=>{const[y]=f,{id:k,styleId:C}=rn(g,e,i.styleMirror);return(k&&k!==-1||C&&C!==-1)&&n({id:k,styleId:C,replaceSync:y}),p.apply(g,f)})}));const d={};wi("CSSGroupingRule")?d.CSSGroupingRule=t.CSSGroupingRule:(wi("CSSMediaRule")&&(d.CSSMediaRule=t.CSSMediaRule),wi("CSSConditionRule")&&(d.CSSConditionRule=t.CSSConditionRule),wi("CSSSupportsRule")&&(d.CSSSupportsRule=t.CSSSupportsRule));const v={};return Object.entries(d).forEach(([p,g])=>{v[p]={insertRule:g.prototype.insertRule,deleteRule:g.prototype.deleteRule},g.prototype.insertRule=new Proxy(v[p].insertRule,{apply:q((f,y,k)=>{const[C,S]=k,{id:M,styleId:A}=rn(y.parentStyleSheet,e,i.styleMirror);return(M&&M!==-1||A&&A!==-1)&&n({id:M,styleId:A,adds:[{rule:C,index:[...yi(y),S||0]}]}),f.apply(y,k)})}),g.prototype.deleteRule=new Proxy(v[p].deleteRule,{apply:q((f,y,k)=>{const[C]=k,{id:S,styleId:M}=rn(y.parentStyleSheet,e,i.styleMirror);return(S&&S!==-1||M&&M!==-1)&&n({id:S,styleId:M,removes:[{index:[...yi(y),C]}]}),f.apply(y,k)})})}),q(()=>{t.CSSStyleSheet.prototype.insertRule=o,t.CSSStyleSheet.prototype.deleteRule=s,a&&(t.CSSStyleSheet.prototype.replace=a),l&&(t.CSSStyleSheet.prototype.replaceSync=l),Object.entries(d).forEach(([p,g])=>{g.prototype.insertRule=v[p].insertRule,g.prototype.deleteRule=v[p].deleteRule})})}function mo({mirror:n,stylesheetManager:e},i){var t,o,s;let a=null;i.nodeName==="#document"?a=n.getId(i):a=n.getId(i.host);const l=i.nodeName==="#document"?(t=i.defaultView)===null||t===void 0?void 0:t.Document:(s=(o=i.ownerDocument)===null||o===void 0?void 0:o.defaultView)===null||s===void 0?void 0:s.ShadowRoot,d=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!l||!d?()=>{}:(Object.defineProperty(i,"adoptedStyleSheets",{configurable:d.configurable,enumerable:d.enumerable,get(){var v;return(v=d.get)===null||v===void 0?void 0:v.call(this)},set(v){var p;const g=(p=d.set)===null||p===void 0?void 0:p.call(this,v);if(a!==null&&a!==-1)try{e.adoptStyleSheets(v,a)}catch{}return g}}),q(()=>{Object.defineProperty(i,"adoptedStyleSheets",{configurable:d.configurable,enumerable:d.enumerable,get:d.get,set:d.set})}))}function Fa({styleDeclarationCb:n,mirror:e,ignoreCSSAttributes:i,stylesheetManager:t},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:q((l,d,v)=>{var p;const[g,f,y]=v;if(i.has(g))return s.apply(d,[g,f,y]);const{id:k,styleId:C}=rn((p=d.parentRule)===null||p===void 0?void 0:p.parentStyleSheet,e,t.styleMirror);return(k&&k!==-1||C&&C!==-1)&&n({id:k,styleId:C,set:{property:g,value:f,priority:y},index:yi(d.parentRule)}),l.apply(d,v)})});const a=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(a,{apply:q((l,d,v)=>{var p;const[g]=v;if(i.has(g))return a.apply(d,[g]);const{id:f,styleId:y}=rn((p=d.parentRule)===null||p===void 0?void 0:p.parentStyleSheet,e,t.styleMirror);return(f&&f!==-1||y&&y!==-1)&&n({id:f,styleId:y,remove:{property:g},index:yi(d.parentRule)}),l.apply(d,v)})}),q(()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=a})}function Ga({mediaInteractionCb:n,blockClass:e,blockSelector:i,mirror:t,sampling:o,doc:s}){const a=q(d=>$n(q(v=>{const p=Qn(v);if(!p||Se(p,e,i,!0))return;const{currentTime:g,volume:f,muted:y,playbackRate:k,loop:C}=p;n({type:d,id:t.getId(p),currentTime:g,volume:f,muted:y,playbackRate:k,loop:C})}),o.media||500)),l=[ke("play",a(0),s),ke("pause",a(1),s),ke("seeked",a(2),s),ke("volumechange",a(3),s),ke("ratechange",a(4),s)];return q(()=>{l.forEach(d=>d())})}function za({fontCb:n,doc:e}){const i=e.defaultView;if(!i)return()=>{};const t=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(d,v,p){const g=new s(d,v,p);return o.set(g,{family:d,buffer:typeof v!="string",descriptors:p,fontSource:typeof v=="string"?v:JSON.stringify(Array.from(new Uint8Array(v)))}),g};const a=Hn(e.fonts,"add",function(l){return function(d){return setTimeout(q(()=>{const v=o.get(d);v&&(n(v),o.delete(d))}),0),l.apply(this,[d])}});return t.push(()=>{i.FontFace=s}),t.push(a),q(()=>{t.forEach(l=>l())})}function qa(n){const{doc:e,mirror:i,blockClass:t,blockSelector:o,selectionCb:s}=n;let a=!0;const l=q(()=>{const d=e.getSelection();if(!d||a&&(d!=null&&d.isCollapsed))return;a=d.isCollapsed||!1;const v=[],p=d.rangeCount||0;for(let g=0;g<p;g++){const f=d.getRangeAt(g),{startContainer:y,startOffset:k,endContainer:C,endOffset:S}=f;Se(y,t,o,!0)||Se(C,t,o,!0)||v.push({start:i.getId(y),startOffset:k,end:i.getId(C),endOffset:S})}s({ranges:v})});return l(),ke("selectionchange",l)}function Wa({doc:n,customElementCb:e}){const i=n.defaultView;return!i||!i.customElements?()=>{}:Hn(i.customElements,"define",function(o){return function(s,a,l){try{e({define:{name:s}})}catch{console.warn(`Custom element callback failed for ${s}`)}return o.apply(this,[s,a,l])}})}function Za(n,e){const{mutationCb:i,mousemoveCb:t,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:a,inputCb:l,mediaInteractionCb:d,styleSheetRuleCb:v,styleDeclarationCb:p,canvasMutationCb:g,fontCb:f,selectionCb:y,customElementCb:k}=n;n.mutationCb=(...C)=>{e.mutation&&e.mutation(...C),i(...C)},n.mousemoveCb=(...C)=>{e.mousemove&&e.mousemove(...C),t(...C)},n.mouseInteractionCb=(...C)=>{e.mouseInteraction&&e.mouseInteraction(...C),o(...C)},n.scrollCb=(...C)=>{e.scroll&&e.scroll(...C),s(...C)},n.viewportResizeCb=(...C)=>{e.viewportResize&&e.viewportResize(...C),a(...C)},n.inputCb=(...C)=>{e.input&&e.input(...C),l(...C)},n.mediaInteractionCb=(...C)=>{e.mediaInteaction&&e.mediaInteaction(...C),d(...C)},n.styleSheetRuleCb=(...C)=>{e.styleSheetRule&&e.styleSheetRule(...C),v(...C)},n.styleDeclarationCb=(...C)=>{e.styleDeclaration&&e.styleDeclaration(...C),p(...C)},n.canvasMutationCb=(...C)=>{e.canvasMutation&&e.canvasMutation(...C),g(...C)},n.fontCb=(...C)=>{e.font&&e.font(...C),f(...C)},n.selectionCb=(...C)=>{e.selection&&e.selection(...C),y(...C)},n.customElementCb=(...C)=>{e.customElement&&e.customElement(...C),k(...C)}}function Ja(n,e={}){const i=n.doc.defaultView;if(!i)return()=>{};Za(n,e);let t;n.recordDOM&&(t=co(n,n.doc));const o=Ra(n),s=Oa(n),a=uo(n),l=Va(n,{win:i}),d=ja(n),v=Ga(n);let p=()=>{},g=()=>{},f=()=>{},y=()=>{};n.recordDOM&&(p=Ka(n,{win:i}),g=mo(n,n.doc),f=Fa(n,{win:i}),n.collectFonts&&(y=za(n)));const k=qa(n),C=Wa(n),S=[];for(const M of n.plugins)S.push(M.observer(M.callback,i,M.options));return q(()=>{Cn.forEach(M=>M.reset()),t==null||t.disconnect(),o(),s(),a(),l(),d(),v(),p(),g(),f(),y(),k(),C(),S.forEach(M=>M())})}function Ci(n){return typeof window[n]<"u"}function wi(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}class po{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,i,t,o){const s=t||this.getIdToRemoteIdMap(e),a=o||this.getRemoteIdToIdMap(e);let l=s.get(i);return l||(l=this.generateIdFn(),s.set(i,l),a.set(l,i)),l}getIds(e,i){const t=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return i.map(s=>this.getId(e,s,t,o))}getRemoteId(e,i,t){const o=t||this.getRemoteIdToIdMap(e);if(typeof i!="number")return i;const s=o.get(i);return s||-1}getRemoteIds(e,i){const t=this.getRemoteIdToIdMap(e);return i.map(o=>this.getRemoteId(e,o,t))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let i=this.iframeIdToRemoteIdMap.get(e);return i||(i=new Map,this.iframeIdToRemoteIdMap.set(e,i)),i}getRemoteIdToIdMap(e){let i=this.iframeRemoteIdToIdMap.get(e);return i||(i=new Map,this.iframeRemoteIdToIdMap.set(e,i)),i}}class $a{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new po(Kt),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new po(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,i){var t;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(t=this.loadListener)===null||t===void 0||t.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const i=e;if(i.data.type!=="rrweb"||i.origin!==i.data.origin||!e.source)return;const o=this.crossOriginIframeMap.get(e.source);if(!o)return;const s=this.transformCrossOriginEvent(o,i.data.event);s&&this.wrappedEmit(s,i.data.isCheckout)}transformCrossOriginEvent(e,i){var t;switch(i.type){case W.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(i.data.node,e);const o=i.data.node.id;return this.crossOriginIframeRootIdMap.set(e,o),this.patchRootIdOnNode(i.data.node,o),{timestamp:i.timestamp,type:W.IncrementalSnapshot,data:{source:z.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:i.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case W.Meta:case W.Load:case W.DomContentLoaded:return!1;case W.Plugin:return i;case W.Custom:return this.replaceIds(i.data.payload,e,["id","parentId","previousId","nextId"]),i;case W.IncrementalSnapshot:switch(i.data.source){case z.Mutation:return i.data.adds.forEach(o=>{this.replaceIds(o,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,e);const s=this.crossOriginIframeRootIdMap.get(e);s&&this.patchRootIdOnNode(o.node,s)}),i.data.removes.forEach(o=>{this.replaceIds(o,e,["parentId","id"])}),i.data.attributes.forEach(o=>{this.replaceIds(o,e,["id"])}),i.data.texts.forEach(o=>{this.replaceIds(o,e,["id"])}),i;case z.Drag:case z.TouchMove:case z.MouseMove:return i.data.positions.forEach(o=>{this.replaceIds(o,e,["id"])}),i;case z.ViewportResize:return!1;case z.MediaInteraction:case z.MouseInteraction:case z.Scroll:case z.CanvasMutation:case z.Input:return this.replaceIds(i.data,e,["id"]),i;case z.StyleSheetRule:case z.StyleDeclaration:return this.replaceIds(i.data,e,["id"]),this.replaceStyleIds(i.data,e,["styleId"]),i;case z.Font:return i;case z.Selection:return i.data.ranges.forEach(o=>{this.replaceIds(o,e,["start","end"])}),i;case z.AdoptedStyleSheet:return this.replaceIds(i.data,e,["id"]),this.replaceStyleIds(i.data,e,["styleIds"]),(t=i.data.styles)===null||t===void 0||t.forEach(o=>{this.replaceStyleIds(o,e,["styleId"])}),i}}return!1}replace(e,i,t,o){for(const s of o)!Array.isArray(i[s])&&typeof i[s]!="number"||(Array.isArray(i[s])?i[s]=e.getIds(t,i[s]):i[s]=e.getId(t,i[s]));return i}replaceIds(e,i,t){return this.replace(this.crossOriginIframeMirror,e,i,t)}replaceStyleIds(e,i,t){return this.replace(this.crossOriginIframeStyleMirror,e,i,t)}replaceIdOnNode(e,i){this.replaceIds(e,i,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(t=>{this.replaceIdOnNode(t,i)})}patchRootIdOnNode(e,i){e.type!==le.Document&&!e.rootId&&(e.rootId=i),"childNodes"in e&&e.childNodes.forEach(t=>{this.patchRootIdOnNode(t,i)})}}class Ya{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,i){if(!Zn(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const t=co(Object.assign(Object.assign({},this.bypassOptions),{doc:i,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(()=>t.disconnect()),this.restoreHandlers.push(uo(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(mo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,i){const t=this;this.restoreHandlers.push(Hn(e.prototype,"attachShadow",function(o){return function(s){const a=o.call(this,s);return this.shadowRoot&&io(this)&&t.addShadowRoot(this.shadowRoot,i),a}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
956
956
  Copyright (c) Microsoft Corporation.
957
957
 
958
958
  Permission to use, copy, modify, and/or distribute this software for any
@@ -980,13 +980,13 @@ or you can use record.mirror to access the mirror instance during recording.`;le
980
980
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
981
981
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
982
982
  PERFORMANCE OF THIS SOFTWARE.
983
- ***************************************************************************** */function n(v,p,g,f){function y(k){return k instanceof g?k:new g(function(C){C(k)})}return new(g||(g=Promise))(function(k,C){function S(_){try{A(f.next(_))}catch(T){C(T)}}function M(_){try{A(f.throw(_))}catch(T){C(T)}}function A(_){_.done?k(_.value):y(_.value).then(S,M)}A((f=f.apply(v,[])).next())})}for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=typeof Uint8Array>"u"?[]:new Uint8Array(256),t=0;t<e.length;t++)i[e.charCodeAt(t)]=t;var o=function(v){var p=new Uint8Array(v),g,f=p.length,y="";for(g=0;g<f;g+=3)y+=e[p[g]>>2],y+=e[(p[g]&3)<<4|p[g+1]>>4],y+=e[(p[g+1]&15)<<2|p[g+2]>>6],y+=e[p[g+2]&63];return f%3===2?y=y.substring(0,y.length-1)+"=":f%3===1&&(y=y.substring(0,y.length-2)+"=="),y};const s=new Map,a=new Map;function l(v,p,g){return n(this,void 0,void 0,function*(){const f=`${v}-${p}`;if("OffscreenCanvas"in globalThis){if(a.has(f))return a.get(f);const y=new OffscreenCanvas(v,p);y.getContext("2d");const C=yield(yield y.convertToBlob(g)).arrayBuffer(),S=o(C);return a.set(f,S),S}else return""})}const d=self;d.onmessage=function(v){return n(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:p,bitmap:g,width:f,height:y,dataURLOptions:k}=v.data,C=l(f,y,k),S=new OffscreenCanvas(f,y);S.getContext("2d").drawImage(g,0,0),g.close();const A=yield S.convertToBlob(k),_=A.type,T=yield A.arrayBuffer(),I=o(T);if(!s.has(p)&&(yield C)===I)return s.set(p,I),d.postMessage({id:p});if(s.get(p)===I)return d.postMessage({id:p});d.postMessage({id:p,type:_,base64:I,width:f,height:y}),s.set(p,I)}else return d.postMessage({id:v.data.id})})}})()});class cr{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(d,v)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(d)||this.pendingCanvasMutations.set(d,[]),this.pendingCanvasMutations.get(d).push(v)};const{sampling:i="all",win:t,blockClass:o,blockSelector:s,recordCanvas:a,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&i==="all"&&this.initCanvasMutationObserver(t,o,s),a&&typeof i=="number"&&this.initCanvasFPSObserver(i,t,o,s,{dataURLOptions:l})}initCanvasFPSObserver(e,i,t,o,s){const a=yo(i,t,o,!0),l=new Map,d=new dr;d.onmessage=k=>{const{id:C}=k.data;if(l.set(C,!1),!("base64"in k.data))return;const{base64:S,type:M,width:A,height:_}=k.data;this.mutationCb({id:C,type:Rn["2D"],commands:[{property:"clearRect",args:[0,0,A,_]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:S}],type:M}]},0,0]}]})};const v=1e3/e;let p=0,g;const f=()=>{const k=[];return i.document.querySelectorAll("canvas").forEach(C=>{Se(C,t,o,!0)||k.push(C)}),k},y=k=>{if(p&&k-p<v){g=requestAnimationFrame(y);return}p=k,f().forEach(C=>Xa(this,void 0,void 0,function*(){var S;const M=this.mirror.getId(C);if(l.get(M)||C.width===0||C.height===0)return;if(l.set(M,!0),["webgl","webgl2"].includes(C.__context)){const _=C.getContext(C.__context);((S=_==null?void 0:_.getContextAttributes())===null||S===void 0?void 0:S.preserveDrawingBuffer)===!1&&_.clear(_.COLOR_BUFFER_BIT)}const A=yield createImageBitmap(C);d.postMessage({id:M,bitmap:A,width:C.width,height:C.height,dataURLOptions:s.dataURLOptions},[A])})),g=requestAnimationFrame(y)};g=requestAnimationFrame(y),this.resetObservers=()=>{a(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,i,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=yo(e,i,t,!1),s=tr(this.processMutation.bind(this),e,i,t),a=sr(this.processMutation.bind(this),e,i,t,this.mirror);this.resetObservers=()=>{o(),s(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=i=>{this.rafStamps.latestId=i,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,i)=>{const t=this.mirror.getId(i);this.flushPendingCanvasMutationFor(i,t)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,i){if(this.frozen||this.locked)return;const t=this.pendingCanvasMutations.get(e);if(!t||i===-1)return;const o=t.map(a=>Qa(a,["type"])),{type:s}=t[0];this.mutationCb({id:i,type:s,commands:o}),this.pendingCanvasMutations.delete(e)}}class ur{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Ea,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,i){"_cssText"in i.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:i.id,attributes:i.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,i){if(e.length===0)return;const t={id:i,styleIds:[]},o=[];for(const s of e){let a;this.styleMirror.has(s)?a=this.styleMirror.getId(s):(a=this.styleMirror.add(s),o.push({styleId:a,rules:Array.from(s.rules||CSSRule,(l,d)=>({rule:Ot(l),index:d}))})),t.styleIds.push(a)}o.length>0&&(t.styles=o),this.adoptedStyleSheetCb(t)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class hr{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,i){const t=this.nodeMap.get(e);return t&&Array.from(t).some(o=>o!==i)}add(e,i){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(i))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function de(n){return Object.assign(Object.assign({},n),{timestamp:gi()})}let ae,_i,Xi,Mi=!1;const Ue=sa();function Xn(n={}){const{emit:e,checkoutEveryNms:i,checkoutEveryNth:t,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:d="rr-mask",maskTextSelector:v=null,inlineStylesheet:p=!0,maskAllInputs:g,maskInputOptions:f,slimDOMOptions:y,maskInputFn:k,maskTextFn:C,hooks:S,packFn:M,sampling:A={},dataURLOptions:_={},mousemoveWait:T,recordDOM:I=!0,recordCanvas:K=!1,recordCrossOriginIframes:G=!1,recordAfter:V=n.recordAfter==="DOMContentLoaded"?n.recordAfter:"load",userTriggeredOnInput:F=!1,collectFonts:oe=!1,inlineImages:ge=!1,plugins:U,keepIframeSrcFn:_e=()=>!1,ignoreCSSAttributes:ue=new Set([]),errorHandler:Te}=n;Da(Te);const Me=G?window.parent===window:!0;let en=!1;if(!Me)try{window.parent.document&&(en=!1)}catch{en=!0}if(Me&&!e)throw new Error("emit function is required");T!==void 0&&A.mousemove===void 0&&(A.mousemove=T),Ue.reset();const vn=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f!==void 0?f:{password:!0},nn=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};Ta();let _n,bn=0;const Ee=N=>{for(const he of U||[])he.eventProcessor&&(N=he.eventProcessor(N));return M&&!en&&(N=M(N)),N};ae=(N,he)=>{var Q;if(!((Q=Cn[0])===null||Q===void 0)&&Q.isFrozen()&&N.type!==W.FullSnapshot&&!(N.type===W.IncrementalSnapshot&&N.data.source===z.Mutation)&&Cn.forEach(me=>me.unfreeze()),Me)e==null||e(Ee(N),he);else if(en){const me={type:"rrweb",event:Ee(N),origin:window.location.origin,isCheckout:he};window.parent.postMessage(me,"*")}if(N.type===W.FullSnapshot)_n=N,bn=0;else if(N.type===W.IncrementalSnapshot){if(N.data.source===z.Mutation&&N.data.isAttachIframe)return;bn++;const me=t&&bn>=t,Ie=i&&N.timestamp-_n.timestamp>i;(me||Ie)&&_i(!0)}};const tn=N=>{ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.Mutation},N)}))},Mn=N=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.Scroll},N)})),re=N=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.CanvasMutation},N)})),fe=N=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.AdoptedStyleSheet},N)})),Re=new ur({mutationCb:tn,adoptedStyleSheetCb:fe}),Pe=new $a({mirror:Ue,mutationCb:tn,stylesheetManager:Re,recordCrossOriginIframes:G,wrappedEmit:ae});for(const N of U||[])N.getMirror&&N.getMirror({nodeMirror:Ue,crossOriginIframeMirror:Pe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Pe.crossOriginIframeStyleMirror});const we=new hr;Xi=new cr({recordCanvas:K,mutationCb:re,win:window,blockClass:o,blockSelector:s,mirror:Ue,sampling:A.canvas,dataURLOptions:_});const We=new Ya({mutationCb:tn,scrollCb:Mn,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:d,maskTextSelector:v,inlineStylesheet:p,maskInputOptions:vn,dataURLOptions:_,maskTextFn:C,maskInputFn:k,recordCanvas:K,inlineImages:ge,sampling:A,slimDOMOptions:nn,iframeManager:Pe,stylesheetManager:Re,canvasManager:Xi,keepIframeSrcFn:_e,processedNodeManager:we},mirror:Ue});_i=(N=!1)=>{if(!I)return;ae(de({type:W.Meta,data:{href:window.location.href,width:$t(),height:Jt()}}),N),Re.reset(),We.init(),Cn.forEach(Q=>Q.lock());const he=xa(document,{mirror:Ue,blockClass:o,blockSelector:s,maskTextClass:d,maskTextSelector:v,inlineStylesheet:p,maskAllInputs:vn,maskTextFn:C,slimDOM:nn,dataURLOptions:_,recordCanvas:K,inlineImages:ge,onSerialize:Q=>{Xt(Q,Ue)&&Pe.addIframe(Q),eo(Q,Ue)&&Re.trackLinkElement(Q),Yi(Q)&&We.addShadowRoot(Q.shadowRoot,document)},onIframeLoad:(Q,me)=>{Pe.attachIframe(Q,me),We.observeAttachShadow(Q)},onStylesheetLoad:(Q,me)=>{Re.attachLinkElement(Q,me)},keepIframeSrcFn:_e});if(!he)return console.warn("Failed to snapshot the document");ae(de({type:W.FullSnapshot,data:{node:he,initialOffset:Zt(window)}}),N),Cn.forEach(Q=>Q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Re.adoptStyleSheets(document.adoptedStyleSheets,Ue.getId(document))};try{const N=[],he=me=>{var Ie;return q(Ja)({mutationCb:tn,mousemoveCb:($,fn)=>ae(de({type:W.IncrementalSnapshot,data:{source:fn,positions:$}})),mouseInteractionCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.MouseInteraction},$)})),scrollCb:Mn,viewportResizeCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.ViewportResize},$)})),inputCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.Input},$)})),mediaInteractionCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.MediaInteraction},$)})),styleSheetRuleCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.StyleSheetRule},$)})),styleDeclarationCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.StyleDeclaration},$)})),canvasMutationCb:re,fontCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.Font},$)})),selectionCb:$=>{ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.Selection},$)}))},customElementCb:$=>{ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.CustomElement},$)}))},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:d,maskTextSelector:v,maskInputOptions:vn,inlineStylesheet:p,sampling:A,recordDOM:I,recordCanvas:K,inlineImages:ge,userTriggeredOnInput:F,collectFonts:oe,doc:me,maskInputFn:k,maskTextFn:C,keepIframeSrcFn:_e,blockSelector:s,slimDOMOptions:nn,dataURLOptions:_,mirror:Ue,iframeManager:Pe,stylesheetManager:Re,shadowDomManager:We,processedNodeManager:we,canvasManager:Xi,ignoreCSSAttributes:ue,plugins:((Ie=U==null?void 0:U.filter($=>$.observer))===null||Ie===void 0?void 0:Ie.map($=>({observer:$.observer,options:$.options,callback:fn=>ae(de({type:W.Plugin,data:{plugin:$.name,payload:fn}}))})))||[]},S)};Pe.addLoadListener(me=>{try{N.push(he(me.contentDocument))}catch(Ie){console.warn(Ie)}});const Q=()=>{_i(),N.push(he(document)),Mi=!0};return document.readyState==="interactive"||document.readyState==="complete"?Q():(N.push(ke("DOMContentLoaded",()=>{ae(de({type:W.DomContentLoaded,data:{}})),V==="DOMContentLoaded"&&Q()})),N.push(ke("load",()=>{ae(de({type:W.Load,data:{}})),V==="load"&&Q()},window))),()=>{N.forEach(me=>me()),we.destroy(),Mi=!1,Ha()}}catch(N){console.warn(N)}}Xn.addCustomEvent=(n,e)=>{if(!Mi)throw new Error("please add custom event after start recording");ae(de({type:W.Custom,data:{tag:n,payload:e}}))},Xn.freezePage=()=>{Cn.forEach(n=>n.freeze())},Xn.takeFullSnapshot=n=>{if(!Mi)throw new Error("please take full snapshot after start recording");_i(n)},Xn.mirror=Ue;var wo=(n=>(n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n))(wo||{}),Ge=(n=>(n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n))(Ge||{}),$e={DEBUG:!1,LIB_VERSION:"2.55.1"},D;if(typeof window>"u"){var ko={hostname:""};D={navigator:{userAgent:"",onLine:!0},document:{location:ko,referrer:""},screen:{width:0,height:0},location:ko}}else D=window;var ei=24*60*60*1e3,et=8*1e3,Ai=Array.prototype,mr=Function.prototype,So=Object.prototype,ln=Ai.slice,ni=So.toString,xi=So.hasOwnProperty,ce=D.console,dn=D.navigator,ee=D.document,Li=D.opera,Ti=D.screen,ze=dn.userAgent,nt=mr.bind,_o=Ai.forEach,Mo=Ai.indexOf,Ao=Ai.map,pr=Array.isArray,it={},m={trim:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},J={log:function(){if($e.DEBUG&&!m.isUndefined(ce)&&ce)try{ce.log.apply(ce,arguments)}catch{m.each(arguments,function(e){ce.log(e)})}},warn:function(){if($e.DEBUG&&!m.isUndefined(ce)&&ce){var n=["Mixpanel warning:"].concat(m.toArray(arguments));try{ce.warn.apply(ce,n)}catch{m.each(n,function(i){ce.warn(i)})}}},error:function(){if($e.DEBUG&&!m.isUndefined(ce)&&ce){var n=["Mixpanel error:"].concat(m.toArray(arguments));try{ce.error.apply(ce,n)}catch{m.each(n,function(i){ce.error(i)})}}},critical:function(){if(!m.isUndefined(ce)&&ce){var n=["Mixpanel error:"].concat(m.toArray(arguments));try{ce.error.apply(ce,n)}catch{m.each(n,function(i){ce.error(i)})}}}},tt=function(n,e){return function(){return arguments[0]="["+e+"] "+arguments[0],n.apply(J,arguments)}},Ei=function(n){return{log:tt(J.log,n),error:tt(J.error,n),critical:tt(J.critical,n)}};m.bind=function(n,e){var i,t;if(nt&&n.bind===nt)return nt.apply(n,ln.call(arguments,1));if(!m.isFunction(n))throw new TypeError;return i=ln.call(arguments,2),t=function(){if(!(this instanceof t))return n.apply(e,i.concat(ln.call(arguments)));var o={};o.prototype=n.prototype;var s=new o;o.prototype=null;var a=n.apply(s,i.concat(ln.call(arguments)));return Object(a)===a?a:s},t},m.each=function(n,e,i){if(n!=null){if(_o&&n.forEach===_o)n.forEach(e,i);else if(n.length===+n.length){for(var t=0,o=n.length;t<o;t++)if(t in n&&e.call(i,n[t],t,n)===it)return}else for(var s in n)if(xi.call(n,s)&&e.call(i,n[s],s,n)===it)return}},m.extend=function(n){return m.each(ln.call(arguments,1),function(e){for(var i in e)e[i]!==void 0&&(n[i]=e[i])}),n},m.isArray=pr||function(n){return ni.call(n)==="[object Array]"},m.isFunction=function(n){try{return/^\s*\bfunction\b/.test(n)}catch{return!1}},m.isArguments=function(n){return!!(n&&xi.call(n,"callee"))},m.toArray=function(n){return n?n.toArray?n.toArray():m.isArray(n)||m.isArguments(n)?ln.call(n):m.values(n):[]},m.map=function(n,e,i){if(Ao&&n.map===Ao)return n.map(e,i);var t=[];return m.each(n,function(o){t.push(e.call(i,o))}),t},m.keys=function(n){var e=[];return n===null||m.each(n,function(i,t){e[e.length]=t}),e},m.values=function(n){var e=[];return n===null||m.each(n,function(i){e[e.length]=i}),e},m.include=function(n,e){var i=!1;return n===null?i:Mo&&n.indexOf===Mo?n.indexOf(e)!=-1:(m.each(n,function(t){if(i||(i=t===e))return it}),i)},m.includes=function(n,e){return n.indexOf(e)!==-1},m.inherit=function(n,e){return n.prototype=new e,n.prototype.constructor=n,n.superclass=e.prototype,n},m.isObject=function(n){return n===Object(n)&&!m.isArray(n)},m.isEmptyObject=function(n){if(m.isObject(n)){for(var e in n)if(xi.call(n,e))return!1;return!0}return!1},m.isUndefined=function(n){return n===void 0},m.isString=function(n){return ni.call(n)=="[object String]"},m.isDate=function(n){return ni.call(n)=="[object Date]"},m.isNumber=function(n){return ni.call(n)=="[object Number]"},m.isElement=function(n){return!!(n&&n.nodeType===1)},m.encodeDates=function(n){return m.each(n,function(e,i){m.isDate(e)?n[i]=m.formatDate(e):m.isObject(e)&&(n[i]=m.encodeDates(e))}),n},m.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},m.formatDate=function(n){function e(i){return i<10?"0"+i:i}return n.getUTCFullYear()+"-"+e(n.getUTCMonth()+1)+"-"+e(n.getUTCDate())+"T"+e(n.getUTCHours())+":"+e(n.getUTCMinutes())+":"+e(n.getUTCSeconds())},m.strip_empty_properties=function(n){var e={};return m.each(n,function(i,t){m.isString(i)&&i.length>0&&(e[t]=i)}),e},m.truncate=function(n,e){var i;return typeof n=="string"?i=n.slice(0,e):m.isArray(n)?(i=[],m.each(n,function(t){i.push(m.truncate(t,e))})):m.isObject(n)?(i={},m.each(n,function(t,o){i[o]=m.truncate(t,e)})):i=n,i},m.JSONEncode=function(){return function(n){var e=n,i=function(o){var s=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return s.lastIndex=0,s.test(o)?'"'+o.replace(s,function(l){var d=a[l];return typeof d=="string"?d:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+o+'"'},t=function(o,s){var a="",l=" ",d=0,v="",p="",g=0,f=a,y=[],k=s[o];switch(k&&typeof k=="object"&&typeof k.toJSON=="function"&&(k=k.toJSON(o)),typeof k){case"string":return i(k);case"number":return isFinite(k)?String(k):"null";case"boolean":case"null":return String(k);case"object":if(!k)return"null";if(a+=l,y=[],ni.apply(k)==="[object Array]"){for(g=k.length,d=0;d<g;d+=1)y[d]=t(d,k)||"null";return p=y.length===0?"[]":a?`[
983
+ ***************************************************************************** */function n(v,p,g,f){function y(k){return k instanceof g?k:new g(function(C){C(k)})}return new(g||(g=Promise))(function(k,C){function S(_){try{A(f.next(_))}catch(T){C(T)}}function M(_){try{A(f.throw(_))}catch(T){C(T)}}function A(_){_.done?k(_.value):y(_.value).then(S,M)}A((f=f.apply(v,[])).next())})}for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=typeof Uint8Array>"u"?[]:new Uint8Array(256),t=0;t<e.length;t++)i[e.charCodeAt(t)]=t;var o=function(v){var p=new Uint8Array(v),g,f=p.length,y="";for(g=0;g<f;g+=3)y+=e[p[g]>>2],y+=e[(p[g]&3)<<4|p[g+1]>>4],y+=e[(p[g+1]&15)<<2|p[g+2]>>6],y+=e[p[g+2]&63];return f%3===2?y=y.substring(0,y.length-1)+"=":f%3===1&&(y=y.substring(0,y.length-2)+"=="),y};const s=new Map,a=new Map;function l(v,p,g){return n(this,void 0,void 0,function*(){const f=`${v}-${p}`;if("OffscreenCanvas"in globalThis){if(a.has(f))return a.get(f);const y=new OffscreenCanvas(v,p);y.getContext("2d");const C=yield(yield y.convertToBlob(g)).arrayBuffer(),S=o(C);return a.set(f,S),S}else return""})}const d=self;d.onmessage=function(v){return n(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:p,bitmap:g,width:f,height:y,dataURLOptions:k}=v.data,C=l(f,y,k),S=new OffscreenCanvas(f,y);S.getContext("2d").drawImage(g,0,0),g.close();const A=yield S.convertToBlob(k),_=A.type,T=yield A.arrayBuffer(),I=o(T);if(!s.has(p)&&(yield C)===I)return s.set(p,I),d.postMessage({id:p});if(s.get(p)===I)return d.postMessage({id:p});d.postMessage({id:p,type:_,base64:I,width:f,height:y}),s.set(p,I)}else return d.postMessage({id:v.data.id})})}})()});class cr{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(d,v)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(d)||this.pendingCanvasMutations.set(d,[]),this.pendingCanvasMutations.get(d).push(v)};const{sampling:i="all",win:t,blockClass:o,blockSelector:s,recordCanvas:a,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&i==="all"&&this.initCanvasMutationObserver(t,o,s),a&&typeof i=="number"&&this.initCanvasFPSObserver(i,t,o,s,{dataURLOptions:l})}initCanvasFPSObserver(e,i,t,o,s){const a=yo(i,t,o,!0),l=new Map,d=new dr;d.onmessage=k=>{const{id:C}=k.data;if(l.set(C,!1),!("base64"in k.data))return;const{base64:S,type:M,width:A,height:_}=k.data;this.mutationCb({id:C,type:Rn["2D"],commands:[{property:"clearRect",args:[0,0,A,_]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:S}],type:M}]},0,0]}]})};const v=1e3/e;let p=0,g;const f=()=>{const k=[];return i.document.querySelectorAll("canvas").forEach(C=>{Se(C,t,o,!0)||k.push(C)}),k},y=k=>{if(p&&k-p<v){g=requestAnimationFrame(y);return}p=k,f().forEach(C=>Xa(this,void 0,void 0,function*(){var S;const M=this.mirror.getId(C);if(l.get(M)||C.width===0||C.height===0)return;if(l.set(M,!0),["webgl","webgl2"].includes(C.__context)){const _=C.getContext(C.__context);((S=_==null?void 0:_.getContextAttributes())===null||S===void 0?void 0:S.preserveDrawingBuffer)===!1&&_.clear(_.COLOR_BUFFER_BIT)}const A=yield createImageBitmap(C);d.postMessage({id:M,bitmap:A,width:C.width,height:C.height,dataURLOptions:s.dataURLOptions},[A])})),g=requestAnimationFrame(y)};g=requestAnimationFrame(y),this.resetObservers=()=>{a(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,i,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=yo(e,i,t,!1),s=tr(this.processMutation.bind(this),e,i,t),a=sr(this.processMutation.bind(this),e,i,t,this.mirror);this.resetObservers=()=>{o(),s(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=i=>{this.rafStamps.latestId=i,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,i)=>{const t=this.mirror.getId(i);this.flushPendingCanvasMutationFor(i,t)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,i){if(this.frozen||this.locked)return;const t=this.pendingCanvasMutations.get(e);if(!t||i===-1)return;const o=t.map(a=>Qa(a,["type"])),{type:s}=t[0];this.mutationCb({id:i,type:s,commands:o}),this.pendingCanvasMutations.delete(e)}}class ur{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Ea,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,i){"_cssText"in i.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:i.id,attributes:i.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,i){if(e.length===0)return;const t={id:i,styleIds:[]},o=[];for(const s of e){let a;this.styleMirror.has(s)?a=this.styleMirror.getId(s):(a=this.styleMirror.add(s),o.push({styleId:a,rules:Array.from(s.rules||CSSRule,(l,d)=>({rule:Ot(l),index:d}))})),t.styleIds.push(a)}o.length>0&&(t.styles=o),this.adoptedStyleSheetCb(t)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class hr{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(e,i){const t=this.nodeMap.get(e);return t&&Array.from(t).some(o=>o!==i)}add(e,i){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(i))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function de(n){return Object.assign(Object.assign({},n),{timestamp:gi()})}let ae,_i,Xi,Mi=!1;const Ue=sa();function Xn(n={}){const{emit:e,checkoutEveryNms:i,checkoutEveryNth:t,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:d="rr-mask",maskTextSelector:v=null,inlineStylesheet:p=!0,maskAllInputs:g,maskInputOptions:f,slimDOMOptions:y,maskInputFn:k,maskTextFn:C,hooks:S,packFn:M,sampling:A={},dataURLOptions:_={},mousemoveWait:T,recordDOM:I=!0,recordCanvas:K=!1,recordCrossOriginIframes:G=!1,recordAfter:V=n.recordAfter==="DOMContentLoaded"?n.recordAfter:"load",userTriggeredOnInput:F=!1,collectFonts:oe=!1,inlineImages:ge=!1,plugins:U,keepIframeSrcFn:_e=()=>!1,ignoreCSSAttributes:ue=new Set([]),errorHandler:Te}=n;Na(Te);const Me=G?window.parent===window:!0;let en=!1;if(!Me)try{window.parent.document&&(en=!1)}catch{en=!0}if(Me&&!e)throw new Error("emit function is required");T!==void 0&&A.mousemove===void 0&&(A.mousemove=T),Ue.reset();const vn=g===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f!==void 0?f:{password:!0},nn=y===!0||y==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:y==="all",headMetaDescKeywords:y==="all"}:y||{};Ta();let _n,bn=0;const Ee=B=>{for(const he of U||[])he.eventProcessor&&(B=he.eventProcessor(B));return M&&!en&&(B=M(B)),B};ae=(B,he)=>{var Q;if(!((Q=Cn[0])===null||Q===void 0)&&Q.isFrozen()&&B.type!==W.FullSnapshot&&!(B.type===W.IncrementalSnapshot&&B.data.source===z.Mutation)&&Cn.forEach(me=>me.unfreeze()),Me)e==null||e(Ee(B),he);else if(en){const me={type:"rrweb",event:Ee(B),origin:window.location.origin,isCheckout:he};window.parent.postMessage(me,"*")}if(B.type===W.FullSnapshot)_n=B,bn=0;else if(B.type===W.IncrementalSnapshot){if(B.data.source===z.Mutation&&B.data.isAttachIframe)return;bn++;const me=t&&bn>=t,Ie=i&&B.timestamp-_n.timestamp>i;(me||Ie)&&_i(!0)}};const tn=B=>{ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.Mutation},B)}))},Mn=B=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.Scroll},B)})),re=B=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.CanvasMutation},B)})),fe=B=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.AdoptedStyleSheet},B)})),Re=new ur({mutationCb:tn,adoptedStyleSheetCb:fe}),Pe=new $a({mirror:Ue,mutationCb:tn,stylesheetManager:Re,recordCrossOriginIframes:G,wrappedEmit:ae});for(const B of U||[])B.getMirror&&B.getMirror({nodeMirror:Ue,crossOriginIframeMirror:Pe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Pe.crossOriginIframeStyleMirror});const we=new hr;Xi=new cr({recordCanvas:K,mutationCb:re,win:window,blockClass:o,blockSelector:s,mirror:Ue,sampling:A.canvas,dataURLOptions:_});const We=new Ya({mutationCb:tn,scrollCb:Mn,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:d,maskTextSelector:v,inlineStylesheet:p,maskInputOptions:vn,dataURLOptions:_,maskTextFn:C,maskInputFn:k,recordCanvas:K,inlineImages:ge,sampling:A,slimDOMOptions:nn,iframeManager:Pe,stylesheetManager:Re,canvasManager:Xi,keepIframeSrcFn:_e,processedNodeManager:we},mirror:Ue});_i=(B=!1)=>{if(!I)return;ae(de({type:W.Meta,data:{href:window.location.href,width:$t(),height:Jt()}}),B),Re.reset(),We.init(),Cn.forEach(Q=>Q.lock());const he=xa(document,{mirror:Ue,blockClass:o,blockSelector:s,maskTextClass:d,maskTextSelector:v,inlineStylesheet:p,maskAllInputs:vn,maskTextFn:C,slimDOM:nn,dataURLOptions:_,recordCanvas:K,inlineImages:ge,onSerialize:Q=>{Xt(Q,Ue)&&Pe.addIframe(Q),eo(Q,Ue)&&Re.trackLinkElement(Q),Yi(Q)&&We.addShadowRoot(Q.shadowRoot,document)},onIframeLoad:(Q,me)=>{Pe.attachIframe(Q,me),We.observeAttachShadow(Q)},onStylesheetLoad:(Q,me)=>{Re.attachLinkElement(Q,me)},keepIframeSrcFn:_e});if(!he)return console.warn("Failed to snapshot the document");ae(de({type:W.FullSnapshot,data:{node:he,initialOffset:Zt(window)}}),B),Cn.forEach(Q=>Q.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Re.adoptStyleSheets(document.adoptedStyleSheets,Ue.getId(document))};try{const B=[],he=me=>{var Ie;return q(Ja)({mutationCb:tn,mousemoveCb:($,fn)=>ae(de({type:W.IncrementalSnapshot,data:{source:fn,positions:$}})),mouseInteractionCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.MouseInteraction},$)})),scrollCb:Mn,viewportResizeCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.ViewportResize},$)})),inputCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.Input},$)})),mediaInteractionCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.MediaInteraction},$)})),styleSheetRuleCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.StyleSheetRule},$)})),styleDeclarationCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.StyleDeclaration},$)})),canvasMutationCb:re,fontCb:$=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.Font},$)})),selectionCb:$=>{ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.Selection},$)}))},customElementCb:$=>{ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:z.CustomElement},$)}))},blockClass:o,ignoreClass:a,ignoreSelector:l,maskTextClass:d,maskTextSelector:v,maskInputOptions:vn,inlineStylesheet:p,sampling:A,recordDOM:I,recordCanvas:K,inlineImages:ge,userTriggeredOnInput:F,collectFonts:oe,doc:me,maskInputFn:k,maskTextFn:C,keepIframeSrcFn:_e,blockSelector:s,slimDOMOptions:nn,dataURLOptions:_,mirror:Ue,iframeManager:Pe,stylesheetManager:Re,shadowDomManager:We,processedNodeManager:we,canvasManager:Xi,ignoreCSSAttributes:ue,plugins:((Ie=U==null?void 0:U.filter($=>$.observer))===null||Ie===void 0?void 0:Ie.map($=>({observer:$.observer,options:$.options,callback:fn=>ae(de({type:W.Plugin,data:{plugin:$.name,payload:fn}}))})))||[]},S)};Pe.addLoadListener(me=>{try{B.push(he(me.contentDocument))}catch(Ie){console.warn(Ie)}});const Q=()=>{_i(),B.push(he(document)),Mi=!0};return document.readyState==="interactive"||document.readyState==="complete"?Q():(B.push(ke("DOMContentLoaded",()=>{ae(de({type:W.DomContentLoaded,data:{}})),V==="DOMContentLoaded"&&Q()})),B.push(ke("load",()=>{ae(de({type:W.Load,data:{}})),V==="load"&&Q()},window))),()=>{B.forEach(me=>me()),we.destroy(),Mi=!1,Ha()}}catch(B){console.warn(B)}}Xn.addCustomEvent=(n,e)=>{if(!Mi)throw new Error("please add custom event after start recording");ae(de({type:W.Custom,data:{tag:n,payload:e}}))},Xn.freezePage=()=>{Cn.forEach(n=>n.freeze())},Xn.takeFullSnapshot=n=>{if(!Mi)throw new Error("please take full snapshot after start recording");_i(n)},Xn.mirror=Ue;var wo=(n=>(n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n))(wo||{}),Ge=(n=>(n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n))(Ge||{}),$e={DEBUG:!1,LIB_VERSION:"2.55.1"},N;if(typeof window>"u"){var ko={hostname:""};N={navigator:{userAgent:"",onLine:!0},document:{location:ko,referrer:""},screen:{width:0,height:0},location:ko}}else N=window;var ei=24*60*60*1e3,et=8*1e3,Ai=Array.prototype,mr=Function.prototype,So=Object.prototype,ln=Ai.slice,ni=So.toString,xi=So.hasOwnProperty,ce=N.console,dn=N.navigator,ee=N.document,Li=N.opera,Ti=N.screen,ze=dn.userAgent,nt=mr.bind,_o=Ai.forEach,Mo=Ai.indexOf,Ao=Ai.map,pr=Array.isArray,it={},m={trim:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},J={log:function(){if($e.DEBUG&&!m.isUndefined(ce)&&ce)try{ce.log.apply(ce,arguments)}catch{m.each(arguments,function(e){ce.log(e)})}},warn:function(){if($e.DEBUG&&!m.isUndefined(ce)&&ce){var n=["Mixpanel warning:"].concat(m.toArray(arguments));try{ce.warn.apply(ce,n)}catch{m.each(n,function(i){ce.warn(i)})}}},error:function(){if($e.DEBUG&&!m.isUndefined(ce)&&ce){var n=["Mixpanel error:"].concat(m.toArray(arguments));try{ce.error.apply(ce,n)}catch{m.each(n,function(i){ce.error(i)})}}},critical:function(){if(!m.isUndefined(ce)&&ce){var n=["Mixpanel error:"].concat(m.toArray(arguments));try{ce.error.apply(ce,n)}catch{m.each(n,function(i){ce.error(i)})}}}},tt=function(n,e){return function(){return arguments[0]="["+e+"] "+arguments[0],n.apply(J,arguments)}},Ei=function(n){return{log:tt(J.log,n),error:tt(J.error,n),critical:tt(J.critical,n)}};m.bind=function(n,e){var i,t;if(nt&&n.bind===nt)return nt.apply(n,ln.call(arguments,1));if(!m.isFunction(n))throw new TypeError;return i=ln.call(arguments,2),t=function(){if(!(this instanceof t))return n.apply(e,i.concat(ln.call(arguments)));var o={};o.prototype=n.prototype;var s=new o;o.prototype=null;var a=n.apply(s,i.concat(ln.call(arguments)));return Object(a)===a?a:s},t},m.each=function(n,e,i){if(n!=null){if(_o&&n.forEach===_o)n.forEach(e,i);else if(n.length===+n.length){for(var t=0,o=n.length;t<o;t++)if(t in n&&e.call(i,n[t],t,n)===it)return}else for(var s in n)if(xi.call(n,s)&&e.call(i,n[s],s,n)===it)return}},m.extend=function(n){return m.each(ln.call(arguments,1),function(e){for(var i in e)e[i]!==void 0&&(n[i]=e[i])}),n},m.isArray=pr||function(n){return ni.call(n)==="[object Array]"},m.isFunction=function(n){try{return/^\s*\bfunction\b/.test(n)}catch{return!1}},m.isArguments=function(n){return!!(n&&xi.call(n,"callee"))},m.toArray=function(n){return n?n.toArray?n.toArray():m.isArray(n)||m.isArguments(n)?ln.call(n):m.values(n):[]},m.map=function(n,e,i){if(Ao&&n.map===Ao)return n.map(e,i);var t=[];return m.each(n,function(o){t.push(e.call(i,o))}),t},m.keys=function(n){var e=[];return n===null||m.each(n,function(i,t){e[e.length]=t}),e},m.values=function(n){var e=[];return n===null||m.each(n,function(i){e[e.length]=i}),e},m.include=function(n,e){var i=!1;return n===null?i:Mo&&n.indexOf===Mo?n.indexOf(e)!=-1:(m.each(n,function(t){if(i||(i=t===e))return it}),i)},m.includes=function(n,e){return n.indexOf(e)!==-1},m.inherit=function(n,e){return n.prototype=new e,n.prototype.constructor=n,n.superclass=e.prototype,n},m.isObject=function(n){return n===Object(n)&&!m.isArray(n)},m.isEmptyObject=function(n){if(m.isObject(n)){for(var e in n)if(xi.call(n,e))return!1;return!0}return!1},m.isUndefined=function(n){return n===void 0},m.isString=function(n){return ni.call(n)=="[object String]"},m.isDate=function(n){return ni.call(n)=="[object Date]"},m.isNumber=function(n){return ni.call(n)=="[object Number]"},m.isElement=function(n){return!!(n&&n.nodeType===1)},m.encodeDates=function(n){return m.each(n,function(e,i){m.isDate(e)?n[i]=m.formatDate(e):m.isObject(e)&&(n[i]=m.encodeDates(e))}),n},m.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},m.formatDate=function(n){function e(i){return i<10?"0"+i:i}return n.getUTCFullYear()+"-"+e(n.getUTCMonth()+1)+"-"+e(n.getUTCDate())+"T"+e(n.getUTCHours())+":"+e(n.getUTCMinutes())+":"+e(n.getUTCSeconds())},m.strip_empty_properties=function(n){var e={};return m.each(n,function(i,t){m.isString(i)&&i.length>0&&(e[t]=i)}),e},m.truncate=function(n,e){var i;return typeof n=="string"?i=n.slice(0,e):m.isArray(n)?(i=[],m.each(n,function(t){i.push(m.truncate(t,e))})):m.isObject(n)?(i={},m.each(n,function(t,o){i[o]=m.truncate(t,e)})):i=n,i},m.JSONEncode=function(){return function(n){var e=n,i=function(o){var s=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return s.lastIndex=0,s.test(o)?'"'+o.replace(s,function(l){var d=a[l];return typeof d=="string"?d:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+o+'"'},t=function(o,s){var a="",l=" ",d=0,v="",p="",g=0,f=a,y=[],k=s[o];switch(k&&typeof k=="object"&&typeof k.toJSON=="function"&&(k=k.toJSON(o)),typeof k){case"string":return i(k);case"number":return isFinite(k)?String(k):"null";case"boolean":case"null":return String(k);case"object":if(!k)return"null";if(a+=l,y=[],ni.apply(k)==="[object Array]"){for(g=k.length,d=0;d<g;d+=1)y[d]=t(d,k)||"null";return p=y.length===0?"[]":a?`[
984
984
  `+a+y.join(`,
985
985
  `+a)+`
986
986
  `+f+"]":"["+y.join(",")+"]",a=f,p}for(v in k)xi.call(k,v)&&(p=t(v,k),p&&y.push(i(v)+(a?": ":":")+p));return p=y.length===0?"{}":a?"{"+y.join(",")+f+"}":"{"+y.join(",")+"}",a=f,p}};return t("",{"":e})}}(),m.JSONDecode=function(){var n,e,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
987
987
  `,r:"\r",t:" "},t,o=function(y){var k=new SyntaxError(y);throw k.at=n,k.text=t,k},s=function(y){return y&&y!==e&&o("Expected '"+y+"' instead of '"+e+"'"),e=t.charAt(n),n+=1,e},a=function(){var y,k="";for(e==="-"&&(k="-",s("-"));e>="0"&&e<="9";)k+=e,s();if(e===".")for(k+=".";s()&&e>="0"&&e<="9";)k+=e;if(e==="e"||e==="E")for(k+=e,s(),(e==="-"||e==="+")&&(k+=e,s());e>="0"&&e<="9";)k+=e,s();if(y=+k,!isFinite(y))o("Bad number");else return y},l=function(){var y,k,C="",S;if(e==='"')for(;s();){if(e==='"')return s(),C;if(e==="\\")if(s(),e==="u"){for(S=0,k=0;k<4&&(y=parseInt(s(),16),!!isFinite(y));k+=1)S=S*16+y;C+=String.fromCharCode(S)}else if(typeof i[e]=="string")C+=i[e];else break;else C+=e}o("Bad string")},d=function(){for(;e&&e<=" ";)s()},v=function(){switch(e){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null}o('Unexpected "'+e+'"')},p,g=function(){var y=[];if(e==="["){if(s("["),d(),e==="]")return s("]"),y;for(;e;){if(y.push(p()),d(),e==="]")return s("]"),y;s(","),d()}}o("Bad array")},f=function(){var y,k={};if(e==="{"){if(s("{"),d(),e==="}")return s("}"),k;for(;e;){if(y=l(),d(),s(":"),Object.hasOwnProperty.call(k,y)&&o('Duplicate key "'+y+'"'),k[y]=p(),d(),e==="}")return s("}"),k;s(","),d()}}o("Bad object")};return p=function(){switch(d(),e){case"{":return f();case"[":return g();case'"':return l();case"-":return a();default:return e>="0"&&e<="9"?a():v()}},function(y){var k;return t=y,n=0,e=" ",k=p(),d(),e&&o("Syntax error"),k}}(),m.base64Encode=function(n){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i,t,o,s,a,l,d,v,p=0,g=0,f="",y=[];if(!n)return n;n=m.utf8Encode(n);do i=n.charCodeAt(p++),t=n.charCodeAt(p++),o=n.charCodeAt(p++),v=i<<16|t<<8|o,s=v>>18&63,a=v>>12&63,l=v>>6&63,d=v&63,y[g++]=e.charAt(s)+e.charAt(a)+e.charAt(l)+e.charAt(d);while(p<n.length);switch(f=y.join(""),n.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"=";break}return f},m.utf8Encode=function(n){n=(n+"").replace(/\r\n/g,`
988
988
  `).replace(/\r/g,`
989
- `);var e="",i,t,o=0,s;for(i=t=0,o=n.length,s=0;s<o;s++){var a=n.charCodeAt(s),l=null;a<128?t++:a>127&&a<2048?l=String.fromCharCode(a>>6|192,a&63|128):l=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),l!==null&&(t>i&&(e+=n.substring(i,t)),e+=l,i=t=s+1)}return t>i&&(e+=n.substring(i,n.length)),e},m.UUID=function(){var n=function(){var t=1*new Date,o;if(D.performance&&D.performance.now)o=D.performance.now();else for(o=0;t==1*new Date;)o++;return t.toString(16)+Math.floor(o).toString(16)},e=function(){return Math.random().toString(16).replace(".","")},i=function(){var t=ze,o,s,a=[],l=0;function d(v,p){var g,f=0;for(g=0;g<p.length;g++)f|=a[g]<<g*8;return v^f}for(o=0;o<t.length;o++)s=t.charCodeAt(o),a.unshift(s&255),a.length>=4&&(l=d(l,a),a=[]);return a.length>0&&(l=d(l,a)),l.toString(16)};return function(){var t=(Ti.height*Ti.width).toString(16);return n()+"-"+e()+"-"+i()+"-"+t+"-"+n()}}();var xo=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];m.isBlockedUA=function(n){var e;for(n=n.toLowerCase(),e=0;e<xo.length;e++)if(n.indexOf(xo[e])!==-1)return!0;return!1},m.HTTPBuildQuery=function(n,e){var i,t,o=[];return m.isUndefined(e)&&(e="&"),m.each(n,function(s,a){i=encodeURIComponent(s.toString()),t=encodeURIComponent(a),o[o.length]=t+"="+i}),o.join(e)},m.getQueryParam=function(n,e){e=e.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var i="[\\?&]"+e+"=([^&#]*)",t=new RegExp(i),o=t.exec(n);if(o===null||o&&typeof o[1]!="string"&&o[1].length)return"";var s=o[1];try{s=decodeURIComponent(s)}catch{J.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},m.cookie={get:function(n){for(var e=n+"=",i=ee.cookie.split(";"),t=0;t<i.length;t++){for(var o=i[t];o.charAt(0)==" ";)o=o.substring(1,o.length);if(o.indexOf(e)===0)return decodeURIComponent(o.substring(e.length,o.length))}return null},parse:function(n){var e;try{e=m.JSONDecode(m.cookie.get(n))||{}}catch{}return e},set_seconds:function(n,e,i,t,o,s,a){var l="",d="",v="";if(a)l="; domain="+a;else if(t){var p=Lo(ee.location.hostname);l=p?"; domain=."+p:""}if(i){var g=new Date;g.setTime(g.getTime()+i*1e3),d="; expires="+g.toGMTString()}s&&(o=!0,v="; SameSite=None"),o&&(v+="; secure"),ee.cookie=n+"="+encodeURIComponent(e)+d+"; path=/"+l+v},set:function(n,e,i,t,o,s,a){var l="",d="",v="";if(a)l="; domain="+a;else if(t){var p=Lo(ee.location.hostname);l=p?"; domain=."+p:""}if(i){var g=new Date;g.setTime(g.getTime()+i*24*60*60*1e3),d="; expires="+g.toGMTString()}s&&(o=!0,v="; SameSite=None"),o&&(v+="; secure");var f=n+"="+encodeURIComponent(e)+d+"; path=/"+l+v;return ee.cookie=f,f},remove:function(n,e,i){m.cookie.set(n,"",-1,e,!1,!1,i)}};var ot=null,Pi=function(n,e){if(ot!==null&&!e)return ot;var i=!0;try{n=n||window.localStorage;var t="__mplss_"+st(8),o="xyz";n.setItem(t,o),n.getItem(t)!==o&&(i=!1),n.removeItem(t)}catch{i=!1}return ot=i,i};m.localStorage={is_supported:function(n){var e=Pi(null,n);return e||J.error("localStorage unsupported; falling back to cookie store"),e},error:function(n){J.error("localStorage error: "+n)},get:function(n){try{return window.localStorage.getItem(n)}catch(e){m.localStorage.error(e)}return null},parse:function(n){try{return m.JSONDecode(m.localStorage.get(n))||{}}catch{}return null},set:function(n,e){try{window.localStorage.setItem(n,e)}catch(i){m.localStorage.error(i)}},remove:function(n){try{window.localStorage.removeItem(n)}catch(e){m.localStorage.error(e)}}},m.register_event=function(){var n=function(t,o,s,a,l){if(!t){J.error("No valid element provided to register_event");return}if(t.addEventListener&&!a)t.addEventListener(o,s,!!l);else{var d="on"+o,v=t[d];t[d]=e(t,s,v)}};function e(t,o,s){var a=function(l){if(l=l||i(window.event),!!l){var d=!0,v,p;return m.isFunction(s)&&(v=s(l)),p=o.call(t,l),(v===!1||p===!1)&&(d=!1),d}};return a}function i(t){return t&&(t.preventDefault=i.preventDefault,t.stopPropagation=i.stopPropagation),t}return i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0},n}();var vr=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');m.dom_query=function(){function n(o){return o.all?o.all:o.getElementsByTagName("*")}var e=/[\t\r\n]/g;function i(o,s){var a=" "+s+" ";return(" "+o.className+" ").replace(e," ").indexOf(a)>=0}function t(o){if(!ee.getElementsByTagName)return[];var s=o.split(" "),a,l,d,v,p,g,f,y,k,C,S=[ee];for(g=0;g<s.length;g++){if(a=s[g].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){l=a.split("#"),d=l[0];var M=l[1],A=ee.getElementById(M);if(!A||d&&A.nodeName.toLowerCase()!=d)return[];S=[A];continue}if(a.indexOf(".")>-1){l=a.split("."),d=l[0];var _=l[1];for(d||(d="*"),v=[],p=0,f=0;f<S.length;f++)for(d=="*"?k=n(S[f]):k=S[f].getElementsByTagName(d),y=0;y<k.length;y++)v[p++]=k[y];for(S=[],C=0,f=0;f<v.length;f++)v[f].className&&m.isString(v[f].className)&&i(v[f],_)&&(S[C++]=v[f]);continue}var T=a.match(vr);if(T){d=T[1];var I=T[2],K=T[3],G=T[4];for(d||(d="*"),v=[],p=0,f=0;f<S.length;f++)for(d=="*"?k=n(S[f]):k=S[f].getElementsByTagName(d),y=0;y<k.length;y++)v[p++]=k[y];S=[],C=0;var V;switch(K){case"=":V=function(F){return F.getAttribute(I)==G};break;case"~":V=function(F){return F.getAttribute(I).match(new RegExp("\\b"+G+"\\b"))};break;case"|":V=function(F){return F.getAttribute(I).match(new RegExp("^"+G+"-?"))};break;case"^":V=function(F){return F.getAttribute(I).indexOf(G)===0};break;case"$":V=function(F){return F.getAttribute(I).lastIndexOf(G)==F.getAttribute(I).length-G.length};break;case"*":V=function(F){return F.getAttribute(I).indexOf(G)>-1};break;default:V=function(F){return F.getAttribute(I)}}for(S=[],C=0,f=0;f<v.length;f++)V(v[f])&&(S[C++]=v[f]);continue}for(d=a,v=[],p=0,f=0;f<S.length;f++)for(k=S[f].getElementsByTagName(d),y=0;y<k.length;y++)v[p++]=k[y];S=v}return S}return function(o){return m.isElement(o)?[o]:m.isObject(o)&&!m.isUndefined(o.length)?o:t.call(this,o)}}();var br=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],fr=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];m.info={campaignParams:function(n){var e="",i={};return m.each(br,function(t){e=m.getQueryParam(ee.URL,t),e.length?i[t]=e:n!==void 0&&(i[t]=n)}),i},clickParams:function(){var n="",e={};return m.each(fr,function(i){n=m.getQueryParam(ee.URL,i),n.length&&(e[i]=n)}),e},marketingParams:function(){return m.extend(m.info.campaignParams(),m.info.clickParams())},searchEngine:function(n){return n.search("https?://(.*)google.([^/?]*)")===0?"google":n.search("https?://(.*)bing.com")===0?"bing":n.search("https?://(.*)yahoo.com")===0?"yahoo":n.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(n){var e=m.info.searchEngine(n),i=e!="yahoo"?"q":"p",t={};if(e!==null){t.$search_engine=e;var o=m.getQueryParam(n,i);o.length&&(t.mp_keyword=o)}return t},browser:function(n,e,i){return e=e||"",i||m.includes(n," OPR/")?m.includes(n,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":m.includes(n,"IEMobile")||m.includes(n,"WPDesktop")?"Internet Explorer Mobile":m.includes(n,"SamsungBrowser/")?"Samsung Internet":m.includes(n,"Edge")||m.includes(n,"Edg/")?"Microsoft Edge":m.includes(n,"FBIOS")?"Facebook Mobile":m.includes(n,"Chrome")?"Chrome":m.includes(n,"CriOS")?"Chrome iOS":m.includes(n,"UCWEB")||m.includes(n,"UCBrowser")?"UC Browser":m.includes(n,"FxiOS")?"Firefox iOS":m.includes(e,"Apple")?m.includes(n,"Mobile")?"Mobile Safari":"Safari":m.includes(n,"Android")?"Android Mobile":m.includes(n,"Konqueror")?"Konqueror":m.includes(n,"Firefox")?"Firefox":m.includes(n,"MSIE")||m.includes(n,"Trident/")?"Internet Explorer":m.includes(n,"Gecko")?"Mozilla":""},browserVersion:function(n,e,i){var t=m.info.browser(n,e,i),o={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},s=o[t];if(s===void 0)return null;var a=n.match(s);return a?parseFloat(a[a.length-2]):null},os:function(){var n=ze;return/Windows/i.test(n)?/Phone/.test(n)||/WPDesktop/.test(n)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(n)?"iOS":/Android/.test(n)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Mac/i.test(n)?"Mac OS X":/Linux/.test(n)?"Linux":/CrOS/.test(n)?"Chrome OS":""},device:function(n){return/Windows Phone/i.test(n)||/WPDesktop/.test(n)?"Windows Phone":/iPad/.test(n)?"iPad":/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Android/.test(n)?"Android":""},referringDomain:function(n){var e=n.split("/");return e.length>=3?e[2]:""},currentUrl:function(){return D.location.href},properties:function(n){return typeof n!="object"&&(n={}),m.extend(m.strip_empty_properties({$os:m.info.os(),$browser:m.info.browser(ze,dn.vendor,Li),$referrer:ee.referrer,$referring_domain:m.info.referringDomain(ee.referrer),$device:m.info.device(ze)}),{$current_url:m.info.currentUrl(),$browser_version:m.info.browserVersion(ze,dn.vendor,Li),$screen_height:Ti.height,$screen_width:Ti.width,mp_lib:"web",$lib_version:$e.LIB_VERSION,$insert_id:st(),time:m.timestamp()/1e3},m.strip_empty_properties(n))},people_properties:function(){return m.extend(m.strip_empty_properties({$os:m.info.os(),$browser:m.info.browser(ze,dn.vendor,Li)}),{$browser_version:m.info.browserVersion(ze,dn.vendor,Li)})},mpPageViewProperties:function(){return m.strip_empty_properties({current_page_title:ee.title,current_domain:D.location.hostname,current_url_path:D.location.pathname,current_url_protocol:D.location.protocol,current_url_search:D.location.search})}};var st=function(n){var e=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return n?e.substring(0,n):e},gr=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,yr=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Lo=function(n){var e=yr,i=n.split("."),t=i[i.length-1];(t.length>4||t==="com"||t==="org")&&(e=gr);var o=n.match(e);return o?o[0]:""},Cr=function(){var n=D.navigator.onLine;return m.isUndefined(n)||n},Ii=null,Bi=null;typeof JSON<"u"&&(Ii=JSON.stringify,Bi=JSON.parse),Ii=Ii||m.JSONEncode,Bi=Bi||m.JSONDecode,m.toArray=m.toArray,m.isObject=m.isObject,m.JSONEncode=m.JSONEncode,m.JSONDecode=m.JSONDecode,m.isBlockedUA=m.isBlockedUA,m.isEmptyObject=m.isEmptyObject,m.info=m.info,m.info.device=m.info.device,m.info.browser=m.info.browser,m.info.browserVersion=m.info.browserVersion,m.info.properties=m.info.properties;var wr="__mp_opt_in_out_";function kr(n,e){Po(!0,n,e)}function Sr(n,e){Po(!1,n,e)}function _r(n,e){return Eo(n,e)==="1"}function To(n,e){if(Ar(e))return J.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var i=Eo(n,e)==="0";return i&&J.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),i}function cn(n){return lt(n,function(e){return this.get_config(e)})}function un(n){return lt(n,function(e){return this._get_config(e)})}function Vn(n){return lt(n,function(e){return this._get_config(e)})}function Mr(n,e){e=e||{},at(e).remove(rt(n,e),!!e.crossSubdomainCookie,e.cookieDomain)}function at(n){return n=n||{},n.persistenceType==="localStorage"?m.localStorage:m.cookie}function rt(n,e){return e=e||{},(e.persistencePrefix||wr)+n}function Eo(n,e){return at(e).get(rt(n,e))}function Ar(n){if(n&&n.ignoreDnt)return!1;var e=n&&n.window||D,i=e.navigator||{},t=!1;return m.each([i.doNotTrack,i.msDoNotTrack,e.doNotTrack],function(o){m.includes([!0,1,"1","yes"],o)&&(t=!0)}),t}function Po(n,e,i){if(!m.isString(e)||!e.length){J.error("gdpr."+(n?"optIn":"optOut")+" called with an invalid token");return}i=i||{},at(i).set(rt(e,i),n?1:0,m.isNumber(i.cookieExpiration)?i.cookieExpiration:null,!!i.crossSubdomainCookie,!!i.secureCookie,!!i.crossSiteCookie,i.cookieDomain),i.track&&n&&i.track(i.trackEventName||"$opt_in",i.trackProperties,{send_immediately:!0})}function lt(n,e){return function(){var i=!1;try{var t=e.call(this,"token"),o=e.call(this,"ignore_dnt"),s=e.call(this,"opt_out_tracking_persistence_type"),a=e.call(this,"opt_out_tracking_cookie_prefix"),l=e.call(this,"window");t&&(i=To(t,{ignoreDnt:o,persistenceType:s,persistencePrefix:a,window:l}))}catch(v){J.error("Unexpected error when checking tracking opt-out status: "+v)}if(!i)return n.apply(this,arguments);var d=arguments[arguments.length-1];typeof d=="function"&&d(0)}}var xr=Ei("lock"),Io=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||window.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3};Io.prototype.withLock=function(n,e,i){!i&&typeof e!="function"&&(i=e,e=null);var t=i||new Date().getTime()+"|"+Math.random(),o=new Date().getTime(),s=this.storageKey,a=this.pollIntervalMS,l=this.timeoutMS,d=this.storage,v=s+":X",p=s+":Y",g=s+":Z",f=function(A){e&&e(A)},y=function(A){if(new Date().getTime()-o>l){xr.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+t+"]"),d.removeItem(g),d.removeItem(p),S();return}setTimeout(function(){try{A()}catch(_){f(_)}},a*(Math.random()+.1))},k=function(A,_){A()?_():y(function(){k(A,_)})},C=function(){var A=d.getItem(p);if(A&&A!==t)return!1;if(d.setItem(p,t),d.getItem(p)===t)return!0;if(!Pi(d,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},S=function(){d.setItem(v,t),k(C,function(){if(d.getItem(v)===t){M();return}y(function(){if(d.getItem(p)!==t){S();return}k(function(){return!d.getItem(g)},M)})})},M=function(){d.setItem(g,"1");try{n()}finally{d.removeItem(g),d.getItem(p)===t&&d.removeItem(p),d.getItem(v)===t&&d.removeItem(v)}};try{if(Pi(d,!0))S();else throw new Error("localStorage support check failed")}catch(A){f(A)}};var Bo=Ei("batch"),hn=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||window.localStorage,this.reportError=e.errorReporter||m.bind(Bo.error,Bo),this.lock=new Io(n,{storage:this.storage}),this.usePersistence=e.usePersistence,this.pid=e.pid||null,this.memQueue=[]};hn.prototype.enqueue=function(n,e,i){var t={id:st(),flushAfter:new Date().getTime()+e*2,payload:n};this.usePersistence?this.lock.withLock(m.bind(function(){var s;try{var a=this.readFromStorage();a.push(t),s=this.saveToStorage(a),s&&this.memQueue.push(t)}catch{this.reportError("Error enqueueing item",n),s=!1}i&&i(s)},this),m.bind(function(s){this.reportError("Error acquiring storage lock",s),i&&i(!1)},this),this.pid):(this.memQueue.push(t),i&&i(!0))},hn.prototype.fillBatch=function(n){var e=this.memQueue.slice(0,n);if(this.usePersistence&&e.length<n){var i=this.readFromStorage();if(i.length){var t={};m.each(e,function(a){t[a.id]=!0});for(var o=0;o<i.length;o++){var s=i[o];if(new Date().getTime()>s.flushAfter&&!t[s.id]&&(s.orphaned=!0,e.push(s),e.length>=n))break}}}return e};var No=function(n,e){var i=[];return m.each(n,function(t){t.id&&!e[t.id]&&i.push(t)}),i};hn.prototype.removeItemsByID=function(n,e){var i={};if(m.each(n,function(o){i[o]=!0}),this.memQueue=No(this.memQueue,i),!this.usePersistence)e&&e(!0);else{var t=m.bind(function(){var o;try{var s=this.readFromStorage();if(s=No(s,i),o=this.saveToStorage(s),o){s=this.readFromStorage();for(var a=0;a<s.length;a++){var l=s[a];if(l.id&&i[l.id])return this.reportError("Item not removed from storage"),!1}}}catch{this.reportError("Error removing items",n),o=!1}return o},this);this.lock.withLock(function(){var s=t();e&&e(s)},m.bind(function(s){var a=!1;if(this.reportError("Error acquiring storage lock",s),!Pi(this.storage,!0)&&(a=t(),!a))try{this.storage.removeItem(this.storageKey)}catch(l){this.reportError("Error clearing queue",l)}e&&e(a)},this),this.pid)}};var Do=function(n,e){var i=[];return m.each(n,function(t){var o=t.id;if(o in e){var s=e[o];s!==null&&(t.payload=s,i.push(t))}else i.push(t)}),i};hn.prototype.updatePayloads=function(n,e){this.memQueue=Do(this.memQueue,n),this.usePersistence?this.lock.withLock(m.bind(function(){var t;try{var o=this.readFromStorage();o=Do(o,n),t=this.saveToStorage(o)}catch{this.reportError("Error updating items",n),t=!1}e&&e(t)},this),m.bind(function(t){this.reportError("Error acquiring storage lock",t),e&&e(!1)},this),this.pid):e&&e(!0)},hn.prototype.readFromStorage=function(){var n;try{n=this.storage.getItem(this.storageKey),n&&(n=Bi(n),m.isArray(n)||(this.reportError("Invalid storage entry:",n),n=null))}catch(e){this.reportError("Error retrieving queue",e),n=null}return n||[]},hn.prototype.saveToStorage=function(n){try{return this.storage.setItem(this.storageKey,Ii(n)),!0}catch(e){return this.reportError("Error saving queue",e),!1}},hn.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var Lr=10*60*1e3,ii=Ei("batch"),je=function(n,e){this.errorReporter=e.errorReporter,this.queue=new hn(n,{errorReporter:m.bind(this.reportError,this),storage:e.storage,usePersistence:e.usePersistence}),this.libConfig=e.libConfig,this.sendRequest=e.sendRequestFunc,this.beforeSendHook=e.beforeSendHook,this.stopAllBatching=e.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=e.flushOnlyOnInterval||!1};je.prototype.enqueue=function(n,e){this.queue.enqueue(n,this.flushInterval,e)},je.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},je.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},je.prototype.clear=function(){this.queue.clear()},je.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},je.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},je.prototype.scheduleFlush=function(n){this.flushInterval=n,this.stopped||(this.timeoutID=setTimeout(m.bind(function(){this.stopped||this.flush()},this),this.flushInterval))},je.prototype.flush=function(n){try{if(this.requestInProgress){ii.log("Flush: Request already in progress");return}n=n||{};var e=this.libConfig.batch_request_timeout_ms,i=new Date().getTime(),t=this.batchSize,o=this.queue.fillBatch(t),s=o.length===t,a=[],l={};if(m.each(o,function(p){var g=p.payload;if(this.beforeSendHook&&!p.orphaned&&(g=this.beforeSendHook(g)),g){g.event&&g.properties&&(g.properties=m.extend({},g.properties,{mp_sent_by_lib_version:$e.LIB_VERSION}));var f=!0,y=p.id;y?(this.itemIdsSentSuccessfully[y]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:p,batchSize:o.length,timesSent:this.itemIdsSentSuccessfully[y]}),f=!1):this.reportError("[dupe] found item with no ID",{item:p}),f&&a.push(g)}l[p.id]=g},this),a.length<1){this.resetFlush();return}this.requestInProgress=!0;var d=m.bind(function(p){this.requestInProgress=!1;try{var g=!1;if(n.unloading)this.queue.updatePayloads(l);else if(m.isObject(p)&&p.error==="timeout"&&new Date().getTime()-i>=e)this.reportError("Network timeout; retrying"),this.flush();else if(m.isObject(p)&&(p.httpStatusCode>=500||p.httpStatusCode===429||p.httpStatusCode<=0&&!Cr()||p.error==="timeout")){var f=this.flushInterval*2;p.retryAfter&&(f=parseInt(p.retryAfter,10)*1e3||f),f=Math.min(Lr,f),this.reportError("Error; retry in "+f+" ms"),this.scheduleFlush(f)}else if(m.isObject(p)&&p.httpStatusCode===413)if(o.length>1){var y=Math.max(1,Math.floor(t/2));this.batchSize=Math.min(this.batchSize,y,o.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",o),this.resetBatchSize(),g=!0;else g=!0;g&&(this.queue.removeItemsByID(m.map(o,function(k){return k.id}),m.bind(function(k){k?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!s?this.resetFlush():this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),m.each(o,m.bind(function(k){var C=k.id;C?(this.itemIdsSentSuccessfully[C]=this.itemIdsSentSuccessfully[C]||0,this.itemIdsSentSuccessfully[C]++,this.itemIdsSentSuccessfully[C]>5&&this.reportError("[dupe] item ID sent too many times",{item:k,batchSize:o.length,timesSent:this.itemIdsSentSuccessfully[C]})):this.reportError("[dupe] found item with no ID while removing",{item:k})},this)))}catch(k){this.reportError("Error handling API response",k),this.resetFlush()}},this),v={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};n.unloading&&(v.transport="sendBeacon"),ii.log("MIXPANEL REQUEST:",a),this.sendRequest(a,v,d)}catch(p){this.reportError("Error flushing request queue",p),this.resetFlush()}},je.prototype.reportError=function(n,e){if(ii.error.apply(ii.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(n)),this.errorReporter(n,e)}catch(i){ii.error(i)}};var wn=Ei("recorder"),Ho=D.CompressionStream,Tr={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},Er=new Set([Ge.MouseMove,Ge.MouseInteraction,Ge.Scroll,Ge.ViewportResize,Ge.Input,Ge.TouchMove,Ge.MediaInteraction,Ge.Drag,Ge.Selection]);function Pr(n){return n.type===wo.IncrementalSnapshot&&Er.has(n.data.source)}var Ke=function(n){this._mixpanel=n,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=ei,this.recordMinMs=0,this._initBatcher()};Ke.prototype._initBatcher=function(){this.batcher=new je("__mprec",{libConfig:Tr,sendRequestFunc:m.bind(this.flushEventsWithOptOut,this),errorReporter:m.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},Ke.prototype.get_config=function(n){return this._mixpanel.get_config(n)},Ke.prototype.startRecording=function(n){if(this._stopRecording!==null){wn.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>ei&&(this.recordMaxMs=ei,wn.critical("record_max_ms cannot be greater than "+ei+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>et&&(this.recordMinMs=et,wn.critical("record_min_ms cannot be greater than "+et+"ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=new Date().getTime(),this.replayId=m.UUID(),n||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var e=m.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(m.bind(function(){wn.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),this.get_config("record_idle_timeout_ms"))},this),i=this.get_config("record_block_selector");(i===""||i===null)&&(i=void 0),this._stopRecording=Xn({emit:m.bind(function(t){this.batcher.enqueue(t),Pr(t)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),e())},this),blockClass:this.get_config("record_block_class"),blockSelector:i,collectFonts:this.get_config("record_collect_fonts"),inlineImages:this.get_config("record_inline_images"),maskAllInputs:!0,maskTextClass:this.get_config("record_mask_text_class"),maskTextSelector:this.get_config("record_mask_text_selector")}),e(),this.maxTimeoutId=setTimeout(m.bind(this.resetRecording,this),this.recordMaxMs)},Ke.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},Ke.prototype.stopRecording=function(){this._stopRecording!==null&&(this._stopRecording(),this._stopRecording=null),this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),this.replayId=null,clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},Ke.prototype.flushEventsWithOptOut=function(n,e,i){this._flushEvents(n,e,i,m.bind(this._onOptOut,this))},Ke.prototype._onOptOut=function(n){n===0&&(this.recEvents=[],this.stopRecording())},Ke.prototype._sendRequest=function(n,e,i,t){var o=m.bind(function(s,a){s.status===200&&this.replayId===n&&this.seqNo++,t({status:0,httpStatusCode:s.status,responseBody:a,retryAfter:s.headers.get("Retry-After")})},this);D.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(e),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:i}).then(function(s){s.json().then(function(a){o(s,a)}).catch(function(a){t({error:a})})}).catch(function(s){t({error:s,httpStatusCode:0})})},Ke.prototype._flushEvents=cn(function(n,e,i){const t=n.length;if(t>0){var o=this.replayId,s=n[0].timestamp;(this.seqNo===0||!this.replayStartTime)&&(this.seqNo!==0&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=s);var a=n[t-1].timestamp-this.replayStartTime,l={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:s/1e3,replay_id:o,replay_length_ms:a,replay_start_time:this.replayStartTime/1e3},d=m.JSONEncode(n),v=this._mixpanel.get_property("$device_id");v&&(l.$device_id=v);var p=this._mixpanel.get_property("$user_id");if(p&&(l.$user_id=p),Ho){var g=new Blob([d],{type:"application/json"}).stream(),f=g.pipeThrough(new Ho("gzip"));new Response(f).blob().then(m.bind(function(y){l.format="gzip",this._sendRequest(o,l,y,i)},this))}else l.format="body",this._sendRequest(o,l,d,i)}}),Ke.prototype.reportError=function(n,e){wn.error.apply(wn.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,e)}catch(i){wn.error(i)}},D.__mp_recorder=Ke;var Ye=function(){};Ye.prototype.create_properties=function(){},Ye.prototype.event_handler=function(){},Ye.prototype.after_track_handler=function(){},Ye.prototype.init=function(n){return this.mp=n,this},Ye.prototype.track=function(n,e,i,t){var o=this,s=m.dom_query(n);if(s.length===0){J.error("The DOM query ("+n+") returned 0 elements");return}return m.each(s,function(a){m.register_event(a,this.override_event,function(l){var d={},v=o.create_properties(i,this),p=o.mp.get_config("track_links_timeout");o.event_handler(l,this,d),window.setTimeout(o.track_callback(t,v,d,!0),p),o.mp.track(e,v,o.track_callback(t,v,d))})},this),!0},Ye.prototype.track_callback=function(n,e,i,t){t=t||!1;var o=this;return function(){i.callback_fired||(i.callback_fired=!0,!(n&&n(t,e)===!1)&&o.after_track_handler(e,i,t))}},Ye.prototype.create_properties=function(n,e){var i;return typeof n=="function"?i=n(e):i=m.extend({},n),i};var Un=function(){this.override_event="click"};m.inherit(Un,Ye),Un.prototype.create_properties=function(n,e){var i=Un.superclass.create_properties.apply(this,arguments);return e.href&&(i.url=e.href),i},Un.prototype.event_handler=function(n,e,i){i.new_tab=n.which===2||n.metaKey||n.ctrlKey||e.target==="_blank",i.href=e.href,i.new_tab||n.preventDefault()},Un.prototype.after_track_handler=function(n,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var Ni=function(){this.override_event="submit"};m.inherit(Ni,Ye),Ni.prototype.event_handler=function(n,e,i){i.element=e,n.preventDefault()},Ni.prototype.after_track_handler=function(n,e){setTimeout(function(){e.element.submit()},0)};var mn="$set",jn="$set_once",Fe="$unset",kn="$add",qe="$append",Sn="$union",Qe="$remove",Ir="$delete",Ro={set_action:function(n,e){var i={},t={};return m.isObject(n)?m.each(n,function(o,s){this._is_reserved_property(s)||(t[s]=o)},this):t[n]=e,i[mn]=t,i},unset_action:function(n){var e={},i=[];return m.isArray(n)||(n=[n]),m.each(n,function(t){this._is_reserved_property(t)||i.push(t)},this),e[Fe]=i,e},set_once_action:function(n,e){var i={},t={};return m.isObject(n)?m.each(n,function(o,s){this._is_reserved_property(s)||(t[s]=o)},this):t[n]=e,i[jn]=t,i},union_action:function(n,e){var i={},t={};return m.isObject(n)?m.each(n,function(o,s){this._is_reserved_property(s)||(t[s]=m.isArray(o)?o:[o])},this):t[n]=m.isArray(e)?e:[e],i[Sn]=t,i},append_action:function(n,e){var i={},t={};return m.isObject(n)?m.each(n,function(o,s){this._is_reserved_property(s)||(t[s]=o)},this):t[n]=e,i[qe]=t,i},remove_action:function(n,e){var i={},t={};return m.isObject(n)?m.each(n,function(o,s){this._is_reserved_property(s)||(t[s]=o)},this):t[n]=e,i[Qe]=t,i},delete_action:function(){var n={};return n[Ir]="",n}},ie=function(){};m.extend(ie.prototype,Ro),ie.prototype._init=function(n,e,i){this._mixpanel=n,this._group_key=e,this._group_id=i},ie.prototype.set=Vn(function(n,e,i){var t=this.set_action(n,e);return m.isObject(n)&&(i=e),this._send_request(t,i)}),ie.prototype.set_once=Vn(function(n,e,i){var t=this.set_once_action(n,e);return m.isObject(n)&&(i=e),this._send_request(t,i)}),ie.prototype.unset=Vn(function(n,e){var i=this.unset_action(n);return this._send_request(i,e)}),ie.prototype.union=Vn(function(n,e,i){m.isObject(n)&&(i=e);var t=this.union_action(n,e);return this._send_request(t,i)}),ie.prototype.delete=Vn(function(n){var e=this.delete_action();return this._send_request(e,n)}),ie.prototype.remove=Vn(function(n,e,i){var t=this.remove_action(n,e);return this._send_request(t,i)}),ie.prototype._send_request=function(n,e){n.$group_key=this._group_key,n.$group_id=this._group_id,n.$token=this._get_config("token");var i=m.encodeDates(n);return this._mixpanel._track_or_batch({type:"groups",data:i,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},e)},ie.prototype._is_reserved_property=function(n){return n==="$group_key"||n==="$group_id"},ie.prototype._get_config=function(n){return this._mixpanel.get_config(n)},ie.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},ie.prototype.remove=ie.prototype.remove,ie.prototype.set=ie.prototype.set,ie.prototype.set_once=ie.prototype.set_once,ie.prototype.union=ie.prototype.union,ie.prototype.unset=ie.prototype.unset,ie.prototype.toString=ie.prototype.toString;var H=function(){};m.extend(H.prototype,Ro),H.prototype._init=function(n){this._mixpanel=n},H.prototype.set=un(function(n,e,i){var t=this.set_action(n,e);return m.isObject(n)&&(i=e),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),t[mn]=m.extend({},m.info.people_properties(),t[mn]),this._send_request(t,i)}),H.prototype.set_once=un(function(n,e,i){var t=this.set_once_action(n,e);return m.isObject(n)&&(i=e),this._send_request(t,i)}),H.prototype.unset=un(function(n,e){var i=this.unset_action(n);return this._send_request(i,e)}),H.prototype.increment=un(function(n,e,i){var t={},o={};return m.isObject(n)?(m.each(n,function(s,a){if(!this._is_reserved_property(a))if(isNaN(parseFloat(s))){J.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else o[a]=s},this),i=e):(m.isUndefined(e)&&(e=1),o[n]=e),t[kn]=o,this._send_request(t,i)}),H.prototype.append=un(function(n,e,i){m.isObject(n)&&(i=e);var t=this.append_action(n,e);return this._send_request(t,i)}),H.prototype.remove=un(function(n,e,i){m.isObject(n)&&(i=e);var t=this.remove_action(n,e);return this._send_request(t,i)}),H.prototype.union=un(function(n,e,i){m.isObject(n)&&(i=e);var t=this.union_action(n,e);return this._send_request(t,i)}),H.prototype.track_charge=un(function(n,e,i){if(!m.isNumber(n)&&(n=parseFloat(n),isNaN(n))){J.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",m.extend({$amount:n},e),i)}),H.prototype.clear_charges=function(n){return this.set("$transactions",[],n)},H.prototype.delete_user=function(){if(!this._identify_called()){J.error("mixpanel.people.delete_user() requires you to call identify() first");return}var n={$delete:this._mixpanel.get_distinct_id()};return this._send_request(n)},H.prototype.toString=function(){return this._mixpanel.toString()+".people"},H.prototype._send_request=function(n,e){n.$token=this._get_config("token"),n.$distinct_id=this._mixpanel.get_distinct_id();var i=this._mixpanel.get_property("$device_id"),t=this._mixpanel.get_property("$user_id"),o=this._mixpanel.get_property("$had_persisted_distinct_id");i&&(n.$device_id=i),t&&(n.$user_id=t),o&&(n.$had_persisted_distinct_id=o);var s=m.encodeDates(n);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:s,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},e):(this._enqueue(n),m.isUndefined(e)||(this._get_config("verbose")?e({status:-1,error:null}):e(-1)),m.truncate(s,255))},H.prototype._get_config=function(n){return this._mixpanel.get_config(n)},H.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},H.prototype._enqueue=function(n){mn in n?this._mixpanel.persistence._add_to_people_queue(mn,n):jn in n?this._mixpanel.persistence._add_to_people_queue(jn,n):Fe in n?this._mixpanel.persistence._add_to_people_queue(Fe,n):kn in n?this._mixpanel.persistence._add_to_people_queue(kn,n):qe in n?this._mixpanel.persistence._add_to_people_queue(qe,n):Qe in n?this._mixpanel.persistence._add_to_people_queue(Qe,n):Sn in n?this._mixpanel.persistence._add_to_people_queue(Sn,n):J.error("Invalid call to _enqueue():",n)},H.prototype._flush_one_queue=function(n,e,i,t){var o=this,s=m.extend({},this._mixpanel.persistence.load_queue(n)),a=s;!m.isUndefined(s)&&m.isObject(s)&&!m.isEmptyObject(s)&&(o._mixpanel.persistence._pop_from_people_queue(n,s),o._mixpanel.persistence.save(),t&&(a=t(s)),e.call(o,a,function(l,d){l===0&&o._mixpanel.persistence._add_to_people_queue(n,s),m.isUndefined(i)||i(l,d)}))},H.prototype._flush=function(n,e,i,t,o,s,a){var l=this;this._flush_one_queue(mn,this.set,n),this._flush_one_queue(jn,this.set_once,t),this._flush_one_queue(Fe,this.unset,s,function(S){return m.keys(S)}),this._flush_one_queue(kn,this.increment,e),this._flush_one_queue(Sn,this.union,o);var d=this._mixpanel.persistence.load_queue(qe);if(!m.isUndefined(d)&&m.isArray(d)&&d.length)for(var v,p=function(S,M){S===0&&l._mixpanel.persistence._add_to_people_queue(qe,v),m.isUndefined(i)||i(S,M)},g=d.length-1;g>=0;g--)d=this._mixpanel.persistence.load_queue(qe),v=d.pop(),l._mixpanel.persistence.save(),m.isEmptyObject(v)||l.append(v,p);var f=this._mixpanel.persistence.load_queue(Qe);if(!m.isUndefined(f)&&m.isArray(f)&&f.length)for(var y,k=function(S,M){S===0&&l._mixpanel.persistence._add_to_people_queue(Qe,y),m.isUndefined(a)||a(S,M)},C=f.length-1;C>=0;C--)f=this._mixpanel.persistence.load_queue(Qe),y=f.pop(),l._mixpanel.persistence.save(),m.isEmptyObject(y)||l.remove(y,k)},H.prototype._is_reserved_property=function(n){return n==="$distinct_id"||n==="$token"||n==="$device_id"||n==="$user_id"||n==="$had_persisted_distinct_id"},H.prototype.set=H.prototype.set,H.prototype.set_once=H.prototype.set_once,H.prototype.unset=H.prototype.unset,H.prototype.increment=H.prototype.increment,H.prototype.append=H.prototype.append,H.prototype.remove=H.prototype.remove,H.prototype.union=H.prototype.union,H.prototype.track_charge=H.prototype.track_charge,H.prototype.clear_charges=H.prototype.clear_charges,H.prototype.delete_user=H.prototype.delete_user,H.prototype.toString=H.prototype.toString;var dt="__mps",ct="__mpso",ut="__mpus",ht="__mpa",mt="__mpap",pt="__mpr",vt="__mpu",Oo="$people_distinct_id",Di="__alias",ti="__timers",Br=[dt,ct,ut,ht,mt,pt,vt,Oo,Di,ti],j=function(n){this.props={},this.campaign_params_saved=!1,n.persistence_name?this.name="mp_"+n.persistence_name:this.name="mp_"+n.token+"_mixpanel";var e=n.persistence;e!=="cookie"&&e!=="localStorage"&&(J.critical("Unknown persistence type "+e+"; falling back to cookie"),e=n.persistence="cookie"),e==="localStorage"&&m.localStorage.is_supported()?this.storage=m.localStorage:this.storage=m.cookie,this.load(),this.update_config(n),this.upgrade(),this.save()};j.prototype.properties=function(){var n={};return this.load(),m.each(this.props,function(e,i){m.include(Br,i)||(n[i]=e)}),n},j.prototype.load=function(){if(!this.disabled){var n=this.storage.parse(this.name);n&&(this.props=m.extend({},n))}},j.prototype.upgrade=function(){var n,e;this.storage===m.localStorage?(n=m.cookie.parse(this.name),m.cookie.remove(this.name),m.cookie.remove(this.name,!0),n&&this.register_once(n)):this.storage===m.cookie&&(e=m.localStorage.parse(this.name),m.localStorage.remove(this.name),e&&this.register_once(e))},j.prototype.save=function(){this.disabled||this.storage.set(this.name,m.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},j.prototype.load_prop=function(n){return this.load(),this.props[n]},j.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},j.prototype.clear=function(){this.remove(),this.props={}},j.prototype.register_once=function(n,e,i){return m.isObject(n)?(typeof e>"u"&&(e="None"),this.expire_days=typeof i>"u"?this.default_expiry:i,this.load(),m.each(n,function(t,o){(!this.props.hasOwnProperty(o)||this.props[o]===e)&&(this.props[o]=t)},this),this.save(),!0):!1},j.prototype.register=function(n,e){return m.isObject(n)?(this.expire_days=typeof e>"u"?this.default_expiry:e,this.load(),m.extend(this.props,n),this.save(),!0):!1},j.prototype.unregister=function(n){this.load(),n in this.props&&(delete this.props[n],this.save())},j.prototype.update_search_keyword=function(n){this.register(m.info.searchInfo(n))},j.prototype.update_referrer_info=function(n){this.register_once({$initial_referrer:n||"$direct",$initial_referring_domain:m.info.referringDomain(n)||"$direct"},"")},j.prototype.get_referrer_info=function(){return m.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},j.prototype.update_config=function(n){this.default_expiry=this.expire_days=n.cookie_expiration,this.set_disabled(n.disable_persistence),this.set_cookie_domain(n.cookie_domain),this.set_cross_site(n.cross_site_cookie),this.set_cross_subdomain(n.cross_subdomain_cookie),this.set_secure(n.secure_cookie)},j.prototype.set_disabled=function(n){this.disabled=n,this.disabled?this.remove():this.save()},j.prototype.set_cookie_domain=function(n){n!==this.cookie_domain&&(this.remove(),this.cookie_domain=n,this.save())},j.prototype.set_cross_site=function(n){n!==this.cross_site&&(this.cross_site=n,this.remove(),this.save())},j.prototype.set_cross_subdomain=function(n){n!==this.cross_subdomain&&(this.cross_subdomain=n,this.remove(),this.save())},j.prototype.get_cross_subdomain=function(){return this.cross_subdomain},j.prototype.set_secure=function(n){n!==this.secure&&(this.secure=!!n,this.remove(),this.save())},j.prototype._add_to_people_queue=function(n,e){var i=this._get_queue_key(n),t=e[n],o=this._get_or_create_queue(mn),s=this._get_or_create_queue(jn),a=this._get_or_create_queue(Fe),l=this._get_or_create_queue(kn),d=this._get_or_create_queue(Sn),v=this._get_or_create_queue(Qe,[]),p=this._get_or_create_queue(qe,[]);i===dt?(m.extend(o,t),this._pop_from_people_queue(kn,t),this._pop_from_people_queue(Sn,t),this._pop_from_people_queue(Fe,t)):i===ct?(m.each(t,function(g,f){f in s||(s[f]=g)}),this._pop_from_people_queue(Fe,t)):i===ut?m.each(t,function(g){m.each([o,s,l,d],function(f){g in f&&delete f[g]}),m.each(p,function(f){g in f&&delete f[g]}),a[g]=!0}):i===ht?(m.each(t,function(g,f){f in o?o[f]+=g:(f in l||(l[f]=0),l[f]+=g)},this),this._pop_from_people_queue(Fe,t)):i===vt?(m.each(t,function(g,f){m.isArray(g)&&(f in d||(d[f]=[]),d[f]=d[f].concat(g))}),this._pop_from_people_queue(Fe,t)):i===pt?(v.push(t),this._pop_from_people_queue(qe,t)):i===mt&&(p.push(t),this._pop_from_people_queue(Fe,t)),J.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),J.log(e),this.save()},j.prototype._pop_from_people_queue=function(n,e){var i=this.props[this._get_queue_key(n)];m.isUndefined(i)||m.each(e,function(t,o){n===qe||n===Qe?m.each(i,function(s){s[o]===t&&delete s[o]}):delete i[o]},this)},j.prototype.load_queue=function(n){return this.load_prop(this._get_queue_key(n))},j.prototype._get_queue_key=function(n){if(n===mn)return dt;if(n===jn)return ct;if(n===Fe)return ut;if(n===kn)return ht;if(n===qe)return mt;if(n===Qe)return pt;if(n===Sn)return vt;J.error("Invalid queue:",n)},j.prototype._get_or_create_queue=function(n,e){var i=this._get_queue_key(n);return e=m.isUndefined(e)?{}:e,this.props[i]||(this.props[i]=e)},j.prototype.set_event_timer=function(n,e){var i=this.load_prop(ti)||{};i[n]=e,this.props[ti]=i,this.save()},j.prototype.remove_event_timer=function(n){var e=this.load_prop(ti)||{},i=e[n];return m.isUndefined(i)||(delete this.props[ti][n],this.save()),i};var bt,Vo=function(n,e){throw new Error(n+" not available in this build.")},Ce,Uo=0,Nr=1,Dr=function(n){return n},oi=function(){},He="mixpanel",jo="base64",Hr="json",ft="$device:",Kn=D.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Ko=!Kn&&ze.indexOf("MSIE")===-1&&ze.indexOf("Mozilla")===-1,Hi=null;dn.sendBeacon&&(Hi=function(){return dn.sendBeacon.apply(dn,arguments)});var Fo={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},Go={api_host:"https://api-js.mixpanel.com",api_routes:Fo,api_method:"POST",api_transport:"XHR",api_payload_format:jo,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:oi,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:oi,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_collect_fonts:!1,record_idle_timeout_ms:30*60*1e3,record_inline_images:!1,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:ei,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},zo=!1,x=function(){},gt=function(n,e,i){var t,o=i===He?Ce:Ce[i];if(o&&bt===Uo)t=o;else{if(o&&!m.isArray(o)){J.error("You have already initialized "+i);return}t=new x}if(t._cached_groups={},t._init(n,e,i),t.people=new H,t.people._init(t),!t.get_config("skip_first_touch_marketing")){var s=m.info.campaignParams(null),a={},l=!1;m.each(s,function(d,v){a["initial_"+v]=d,d&&(l=!0)}),l&&t.people.set_once(a)}return $e.DEBUG=$e.DEBUG||t.get_config("debug"),!m.isUndefined(o)&&m.isArray(o)&&(t._execute_array.call(t.people,o.people),t._execute_array(o)),t};x.prototype.init=function(n,e,i){if(m.isUndefined(i)){this.report_error("You must name your new library: init(token, config, name)");return}if(i===He){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var t=gt(n,e,i);return Ce[i]=t,t._loaded(),t},x.prototype._init=function(n,e,i){e=e||{},this.__loaded=!0,this.config={};var t={};if(!("api_payload_format"in e)){var o=e.api_host||Go.api_host;o.match(/\.mixpanel\.com/)&&(t.api_payload_format=Hr)}if(this.set_config(m.extend({},Go,t,e,{name:i,token:n,callback_fn:(i===He?i:He+"."+i)+"._jsc"})),this._jsc=oi,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!m.localStorage.is_supported(!0)||!Kn)this._batch_requests=!1,J.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),m.each(this.get_batcher_configs(),function(d){J.log("Clearing batch queue "+d.queue_key),m.localStorage.remove(d.queue_key)});else if(this.init_batchers(),Hi&&D.addEventListener){var s=m.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);D.addEventListener("pagehide",function(d){d.persisted&&s()}),D.addEventListener("visibilitychange",function(){ee.visibilityState==="hidden"&&s()})}}this.persistence=this.cookie=new j(this.config),this.unpersisted_superprops={},this._gdpr_init();var a=m.UUID();this.get_distinct_id()||this.register_once({distinct_id:ft+a,$device_id:a},"");var l=this.get_config("track_pageview");l&&this._init_url_change_tracking(l),this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent")&&this.start_session_recording()},x.prototype.start_session_recording=cn(function(){if(!D.MutationObserver){J.critical("Browser does not support MutationObserver; skipping session recording");return}var n=m.bind(function(){this._recorder=this._recorder||new D.__mp_recorder(this),this._recorder.startRecording()},this);m.isUndefined(D.__mp_recorder)?Vo(this.get_config("recorder_src"),n):n()}),x.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():J.critical("Session recorder module not loaded")},x.prototype.get_session_recording_properties=function(){var n={};if(this._recorder){var e=this._recorder.replayId;e&&(n.$mp_replay_id=e)}return n},x.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var n=m.info.campaignParams(null);m.each(n,(function(e,i){this.unregister(i)}).bind(this))}},x.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(ee.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(m.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(ee.referrer)},x.prototype._dom_loaded=function(){m.each(this.__dom_loaded_queue,function(n){this._track_dom.apply(this,n)},this),this.has_opted_out_tracking()||m.each(this.__request_queue,function(n){this._send_request.apply(this,n)},this),delete this.__dom_loaded_queue,delete this.__request_queue},x.prototype._track_dom=function(n,e){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!zo)return this.__dom_loaded_queue.push([n,e]),!1;var i=new n().init(this);return i.track.apply(i,e)},x.prototype._init_url_change_tracking=function(n){var e="",i=this.track_pageview();if(i&&(e=m.info.currentUrl()),m.include(["full-url","url-with-path-and-query-string","url-with-path"],n)){D.addEventListener("popstate",function(){D.dispatchEvent(new Event("mp_locationchange"))}),D.addEventListener("hashchange",function(){D.dispatchEvent(new Event("mp_locationchange"))});var t=D.history.pushState;typeof t=="function"&&(D.history.pushState=function(s,a,l){t.call(D.history,s,a,l),D.dispatchEvent(new Event("mp_locationchange"))});var o=D.history.replaceState;typeof o=="function"&&(D.history.replaceState=function(s,a,l){o.call(D.history,s,a,l),D.dispatchEvent(new Event("mp_locationchange"))}),D.addEventListener("mp_locationchange",(function(){var s=m.info.currentUrl(),a=!1;if(n==="full-url"?a=s!==e:n==="url-with-path-and-query-string"?a=s.split("#")[0]!==e.split("#")[0]:n==="url-with-path"&&(a=s.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0]),a){var l=this.track_pageview();l&&(e=s)}}).bind(this))}},x.prototype._prepare_callback=function(n,e){if(m.isUndefined(n))return null;if(Kn){var i=function(a){n(a,e)};return i}else{var t=this._jsc,o=""+Math.floor(Math.random()*1e8),s=this.get_config("callback_fn")+"["+o+"]";return t[o]=function(a){delete t[o],n(a,e)},s}},x.prototype._send_request=function(n,e,i,t){var o=!0;if(Ko)return this.__request_queue.push(arguments),o;var s={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},a=null;!t&&(m.isFunction(i)||typeof i=="string")&&(t=i,i=null),i=m.extend(s,i||{}),Kn||(i.method="GET");var l=i.method==="POST",d=Hi&&l&&i.transport.toLowerCase()==="sendbeacon",v=i.verbose;e.verbose&&(v=!0),this.get_config("test")&&(e.test=1),v&&(e.verbose=1),this.get_config("img")&&(e.img=1),Kn||(t?e.callback=t:(v||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),l&&(a="data="+encodeURIComponent(e.data),delete e.data),n+="?"+m.HTTPBuildQuery(e);var p=this;if("img"in e){var g=ee.createElement("img");g.src=n,ee.body.appendChild(g)}else if(d){try{o=Hi(n,a)}catch(M){p.report_error(M),o=!1}try{t&&t(o?1:0)}catch(M){p.report_error(M)}}else if(Kn)try{var f=new XMLHttpRequest;f.open(i.method,n,!0);var y=this.get_config("xhr_headers");if(l&&(y["Content-Type"]="application/x-www-form-urlencoded"),m.each(y,function(M,A){f.setRequestHeader(A,M)}),i.timeout_ms&&typeof f.timeout<"u"){f.timeout=i.timeout_ms;var k=new Date().getTime()}f.withCredentials=!0,f.onreadystatechange=function(){if(f.readyState===4)if(f.status===200){if(t)if(v){var M;try{M=m.JSONDecode(f.responseText)}catch(T){if(p.report_error(T),i.ignore_json_errors)M=f.responseText;else return}t(M)}else t(Number(f.responseText))}else{var A;if(f.timeout&&!f.status&&new Date().getTime()-k>=f.timeout?A="timeout":A="Bad HTTP status: "+f.status+" "+f.statusText,p.report_error(A),t)if(v){var _=f.responseHeaders||{};t({status:0,httpStatusCode:f.status,error:A,retryAfter:_["Retry-After"]})}else t(0)}},f.send(a)}catch(M){p.report_error(M),o=!1}else{var C=ee.createElement("script");C.type="text/javascript",C.async=!0,C.defer=!0,C.src=n;var S=ee.getElementsByTagName("script")[0];S.parentNode.insertBefore(C,S)}return o},x.prototype._execute_array=function(n){var e,i=[],t=[],o=[];m.each(n,function(a){a&&(e=a[0],m.isArray(e)?o.push(a):typeof a=="function"?a.call(this):m.isArray(a)&&e==="alias"?i.push(a):m.isArray(a)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?o.push(a):t.push(a))},this);var s=function(a,l){m.each(a,function(d){if(m.isArray(d[0])){var v=l;m.each(d,function(p){v=v[p[0]].apply(v,p.slice(1))})}else this[d[0]].apply(this,d.slice(1))},l)};s(i,this),s(t,this),s(o,this)},x.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},x.prototype.get_batcher_configs=function(){var n="__mpq_"+this.get_config("token"),e=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+e.track,queue_key:n+"_ev"},people:{type:"people",endpoint:"/"+e.engage,queue_key:n+"_pp"},groups:{type:"groups",endpoint:"/"+e.groups,queue_key:n+"_gr"}},this._batcher_configs},x.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var n=m.bind(function(i){return new je(i.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:m.bind(function(t,o,s){this._send_request(this.get_config("api_host")+i.endpoint,this._encode_data_for_request(t),o,this._prepare_callback(s,t))},this),beforeSendHook:m.bind(function(t){return this._run_hook("before_send_"+i.type,t)},this),stopAllBatchingFunc:m.bind(this.stop_batch_senders,this),usePersistence:!0})},this),e=this.get_batcher_configs();this.request_batchers={events:n(e.events),people:n(e.people),groups:n(e.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},x.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,m.each(this.request_batchers,function(n){n.start()}))},x.prototype.stop_batch_senders=function(){this._batch_requests=!1,m.each(this.request_batchers,function(n){n.stop(),n.clear()})},x.prototype.push=function(n){this._execute_array([n])},x.prototype.disable=function(n){typeof n>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(n)},x.prototype._encode_data_for_request=function(n){var e=m.JSONEncode(n);return this.get_config("api_payload_format")===jo&&(e=m.base64Encode(e)),{data:e}},x.prototype._track_or_batch=function(n,e){var i=m.truncate(n.data,255),t=n.endpoint,o=n.batcher,s=n.should_send_immediately,a=n.send_request_options||{};e=e||oi;var l=!0,d=m.bind(function(){return a.skip_hooks||(i=this._run_hook("before_send_"+n.type,i)),i?(J.log("MIXPANEL REQUEST:"),J.log(i),this._send_request(t,this._encode_data_for_request(i),a,this._prepare_callback(e,i))):null},this);return this._batch_requests&&!s?o.enqueue(i,function(v){v?e(1,i):d()}):l=d(),l&&i},x.prototype.track=cn(function(n,e,i,t){!t&&typeof i=="function"&&(t=i,i=null),i=i||{};var o=i.transport;o&&(i.transport=o);var s=i.send_immediately;if(typeof t!="function"&&(t=oi),m.isUndefined(n)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(n)){t(0);return}e=m.extend({},e),e.token=this.get_config("token");var a=this.persistence.remove_event_timer(n);if(!m.isUndefined(a)){var l=new Date().getTime()-a;e.$duration=parseFloat((l/1e3).toFixed(3))}this._set_default_superprops();var d=this.get_config("track_marketing")?m.info.marketingParams():{};e=m.extend({},m.info.properties({mp_loader:this.get_config("mp_loader")}),d,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),e);var v=this.get_config("property_blacklist");m.isArray(v)?m.each(v,function(f){delete e[f]}):this.report_error("Invalid value for property_blacklist config: "+v);var p={event:n,properties:e},g=this._track_or_batch({type:"events",data:p,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:s,send_request_options:i},t);return g}),x.prototype.set_group=cn(function(n,e,i){m.isArray(e)||(e=[e]);var t={};return t[n]=e,this.register(t),this.people.set(n,e,i)}),x.prototype.add_group=cn(function(n,e,i){var t=this.get_property(n),o={};return t===void 0?(o[n]=[e],this.register(o)):t.indexOf(e)===-1&&(t.push(e),o[n]=t,this.register(o)),this.people.union(n,e,i)}),x.prototype.remove_group=cn(function(n,e,i){var t=this.get_property(n);if(t!==void 0){var o=t.indexOf(e);o>-1&&(t.splice(o,1),this.register({group_key:t})),t.length===0&&this.unregister(n)}return this.people.remove(n,e,i)}),x.prototype.track_with_groups=cn(function(n,e,i,t){var o=m.extend({},e||{});return m.each(i,function(s,a){s!=null&&(o[a]=s)}),this.track(n,o,t)}),x.prototype._create_map_key=function(n,e){return n+"_"+JSON.stringify(e)},x.prototype._remove_group_from_cache=function(n,e){delete this._cached_groups[this._create_map_key(n,e)]},x.prototype.get_group=function(n,e){var i=this._create_map_key(n,e),t=this._cached_groups[i];return(t===void 0||t._group_key!==n||t._group_id!==e)&&(t=new ie,t._init(this,n,e),this._cached_groups[i]=t),t},x.prototype.track_pageview=cn(function(n,e){typeof n!="object"&&(n={}),e=e||{};var i=e.event_name||"$mp_web_page_view",t=m.extend(m.info.mpPageViewProperties(),m.info.campaignParams(),m.info.clickParams()),o=m.extend({},t,n);return this.track(i,o)}),x.prototype.track_links=function(){return this._track_dom.call(this,Un,arguments)},x.prototype.track_forms=function(){return this._track_dom.call(this,Ni,arguments)},x.prototype.time_event=function(n){if(m.isUndefined(n)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(n)||this.persistence.set_event_timer(n,new Date().getTime())};var Rr={persistent:!0},yt=function(n){var e;return m.isObject(n)?e=n:m.isUndefined(n)?e={}:e={days:n},m.extend({},Rr,e)};x.prototype.register=function(n,e){var i=yt(e);i.persistent?this.persistence.register(n,i.days):m.extend(this.unpersisted_superprops,n)},x.prototype.register_once=function(n,e,i){var t=yt(i);t.persistent?this.persistence.register_once(n,e,t.days):(typeof e>"u"&&(e="None"),m.each(n,function(o,s){(!this.unpersisted_superprops.hasOwnProperty(s)||this.unpersisted_superprops[s]===e)&&(this.unpersisted_superprops[s]=o)},this))},x.prototype.unregister=function(n,e){e=yt(e),e.persistent?this.persistence.unregister(n):delete this.unpersisted_superprops[n]},x.prototype._register_single=function(n,e){var i={};i[n]=e,this.register(i)},x.prototype.identify=function(n,e,i,t,o,s,a,l){var d=this.get_distinct_id();if(n&&d!==n){if(typeof n=="string"&&n.indexOf(ft)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:n})}if(!this.get_property("$device_id")){var v=d;this.register_once({$had_persisted_distinct_id:!0,$device_id:v},"")}n!==d&&n!==this.get_property(Di)&&(this.unregister(Di),this.register({distinct_id:n})),this._flags.identify_called=!0,this.people._flush(e,i,t,o,s,a,l),n!==d&&this.track("$identify",{distinct_id:n,$anon_distinct_id:d},{skip_hooks:!0})},x.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var n=m.UUID();this.register_once({distinct_id:ft+n,$device_id:n},"")},x.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},x.prototype.alias=function(n,e){if(n===this.get_property(Oo))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var i=this;return m.isUndefined(e)&&(e=this.get_distinct_id()),n!==e?(this._register_single(Di,n),this.track("$create_alias",{alias:n,distinct_id:e},{skip_hooks:!0},function(){i.identify(n)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(n),-1)},x.prototype.name_tag=function(n){this._register_single("mp_name_tag",n)},x.prototype.set_config=function(n){if(m.isObject(n)){m.extend(this.config,n);var e=n.batch_size;e&&m.each(this.request_batchers,function(i){i.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),$e.DEBUG=$e.DEBUG||this.get_config("debug")}},x.prototype.get_config=function(n){return this.config[n]},x.prototype._run_hook=function(n){var e=(this.config.hooks[n]||Dr).apply(this,ln.call(arguments,1));return typeof e>"u"&&(this.report_error(n+" hook did not return a value"),e=null),e},x.prototype.get_property=function(n){return this.persistence.load_prop([n])},x.prototype.toString=function(){var n=this.get_config("name");return n!==He&&(n=He+"."+n),n},x.prototype._event_is_disabled=function(n){return m.isBlockedUA(ze)||this._flags.disable_all_events||m.include(this.__disabled_events,n)},x.prototype._gdpr_init=function(){var n=this.get_config("opt_out_tracking_persistence_type")==="localStorage";n&&m.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||m.cookie.get("mp_optout"))&&(m.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},x.prototype._gdpr_update_persistence=function(n){var e;if(n&&n.clear_persistence)e=!0;else if(n&&n.enable_persistence)e=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==e&&this.persistence.set_disabled(e),e?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()},x.prototype._gdpr_call_func=function(n,e){return e=m.extend({track:m.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},e),m.localStorage.is_supported()||(e.persistence_type="cookie"),n(this.get_config("token"),{track:e.track,trackEventName:e.track_event_name,trackProperties:e.track_properties,persistenceType:e.persistence_type,persistencePrefix:e.cookie_prefix,cookieDomain:e.cookie_domain,cookieExpiration:e.cookie_expiration,crossSiteCookie:e.cross_site_cookie,crossSubdomainCookie:e.cross_subdomain_cookie,secureCookie:e.secure_cookie,ignoreDnt:e.ignore_dnt})},x.prototype.opt_in_tracking=function(n){n=m.extend({enable_persistence:!0},n),this._gdpr_call_func(kr,n),this._gdpr_update_persistence(n)},x.prototype.opt_out_tracking=function(n){n=m.extend({clear_persistence:!0,delete_user:!0},n),n.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(Sr,n),this._gdpr_update_persistence(n)},x.prototype.has_opted_in_tracking=function(n){return this._gdpr_call_func(_r,n)},x.prototype.has_opted_out_tracking=function(n){return this._gdpr_call_func(To,n)},x.prototype.clear_opt_in_out_tracking=function(n){n=m.extend({enable_persistence:!0},n),this._gdpr_call_func(Mr,n),this._gdpr_update_persistence(n)},x.prototype.report_error=function(n,e){J.error.apply(J.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,e)}catch(i){J.error(i)}},x.prototype.init=x.prototype.init,x.prototype.reset=x.prototype.reset,x.prototype.disable=x.prototype.disable,x.prototype.time_event=x.prototype.time_event,x.prototype.track=x.prototype.track,x.prototype.track_links=x.prototype.track_links,x.prototype.track_forms=x.prototype.track_forms,x.prototype.track_pageview=x.prototype.track_pageview,x.prototype.register=x.prototype.register,x.prototype.register_once=x.prototype.register_once,x.prototype.unregister=x.prototype.unregister,x.prototype.identify=x.prototype.identify,x.prototype.alias=x.prototype.alias,x.prototype.name_tag=x.prototype.name_tag,x.prototype.set_config=x.prototype.set_config,x.prototype.get_config=x.prototype.get_config,x.prototype.get_property=x.prototype.get_property,x.prototype.get_distinct_id=x.prototype.get_distinct_id,x.prototype.toString=x.prototype.toString,x.prototype.opt_out_tracking=x.prototype.opt_out_tracking,x.prototype.opt_in_tracking=x.prototype.opt_in_tracking,x.prototype.has_opted_out_tracking=x.prototype.has_opted_out_tracking,x.prototype.has_opted_in_tracking=x.prototype.has_opted_in_tracking,x.prototype.clear_opt_in_out_tracking=x.prototype.clear_opt_in_out_tracking,x.prototype.get_group=x.prototype.get_group,x.prototype.set_group=x.prototype.set_group,x.prototype.add_group=x.prototype.add_group,x.prototype.remove_group=x.prototype.remove_group,x.prototype.track_with_groups=x.prototype.track_with_groups,x.prototype.start_batch_senders=x.prototype.start_batch_senders,x.prototype.stop_batch_senders=x.prototype.stop_batch_senders,x.prototype.start_session_recording=x.prototype.start_session_recording,x.prototype.stop_session_recording=x.prototype.stop_session_recording,x.prototype.get_session_recording_properties=x.prototype.get_session_recording_properties,x.prototype.DEFAULT_API_ROUTES=Fo,j.prototype.properties=j.prototype.properties,j.prototype.update_search_keyword=j.prototype.update_search_keyword,j.prototype.update_referrer_info=j.prototype.update_referrer_info,j.prototype.get_cross_subdomain=j.prototype.get_cross_subdomain,j.prototype.clear=j.prototype.clear;var Fn={},Or=function(){m.each(Fn,function(n,e){e!==He&&(Ce[e]=n)}),Ce._=m},Vr=function(){Ce.init=function(n,e,i){if(i)return Ce[i]||(Ce[i]=Fn[i]=gt(n,e,i),Ce[i]._loaded()),Ce[i];var t=Ce;Fn[He]?t=Fn[He]:n&&(t=gt(n,e,He),t._loaded(),Fn[He]=t),Ce=t,bt===Nr&&(D[He]=Ce),Or()}},Ur=function(){function n(){n.done||(n.done=!0,zo=!0,Ko=!1,m.each(Fn,function(t){t._dom_loaded()}))}function e(){try{ee.documentElement.doScroll("left")}catch{setTimeout(e,1);return}n()}if(ee.addEventListener)ee.readyState==="complete"?n():ee.addEventListener("DOMContentLoaded",n,!1);else if(ee.attachEvent){ee.attachEvent("onreadystatechange",n);var i=!1;try{i=D.frameElement===null}catch{}ee.documentElement.doScroll&&i&&e()}m.register_event(D,"load",n,!0)};function jr(n){return Vo=n,bt=Uo,Ce=new x,Vr(),Ce.init(),Ur(),Ce}function Kr(n,e){e()}var P=jr(Kr);const qo=`<div id="checkoutConfirmationEnd">
989
+ `);var e="",i,t,o=0,s;for(i=t=0,o=n.length,s=0;s<o;s++){var a=n.charCodeAt(s),l=null;a<128?t++:a>127&&a<2048?l=String.fromCharCode(a>>6|192,a&63|128):l=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),l!==null&&(t>i&&(e+=n.substring(i,t)),e+=l,i=t=s+1)}return t>i&&(e+=n.substring(i,n.length)),e},m.UUID=function(){var n=function(){var t=1*new Date,o;if(N.performance&&N.performance.now)o=N.performance.now();else for(o=0;t==1*new Date;)o++;return t.toString(16)+Math.floor(o).toString(16)},e=function(){return Math.random().toString(16).replace(".","")},i=function(){var t=ze,o,s,a=[],l=0;function d(v,p){var g,f=0;for(g=0;g<p.length;g++)f|=a[g]<<g*8;return v^f}for(o=0;o<t.length;o++)s=t.charCodeAt(o),a.unshift(s&255),a.length>=4&&(l=d(l,a),a=[]);return a.length>0&&(l=d(l,a)),l.toString(16)};return function(){var t=(Ti.height*Ti.width).toString(16);return n()+"-"+e()+"-"+i()+"-"+t+"-"+n()}}();var xo=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];m.isBlockedUA=function(n){var e;for(n=n.toLowerCase(),e=0;e<xo.length;e++)if(n.indexOf(xo[e])!==-1)return!0;return!1},m.HTTPBuildQuery=function(n,e){var i,t,o=[];return m.isUndefined(e)&&(e="&"),m.each(n,function(s,a){i=encodeURIComponent(s.toString()),t=encodeURIComponent(a),o[o.length]=t+"="+i}),o.join(e)},m.getQueryParam=function(n,e){e=e.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var i="[\\?&]"+e+"=([^&#]*)",t=new RegExp(i),o=t.exec(n);if(o===null||o&&typeof o[1]!="string"&&o[1].length)return"";var s=o[1];try{s=decodeURIComponent(s)}catch{J.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},m.cookie={get:function(n){for(var e=n+"=",i=ee.cookie.split(";"),t=0;t<i.length;t++){for(var o=i[t];o.charAt(0)==" ";)o=o.substring(1,o.length);if(o.indexOf(e)===0)return decodeURIComponent(o.substring(e.length,o.length))}return null},parse:function(n){var e;try{e=m.JSONDecode(m.cookie.get(n))||{}}catch{}return e},set_seconds:function(n,e,i,t,o,s,a){var l="",d="",v="";if(a)l="; domain="+a;else if(t){var p=Lo(ee.location.hostname);l=p?"; domain=."+p:""}if(i){var g=new Date;g.setTime(g.getTime()+i*1e3),d="; expires="+g.toGMTString()}s&&(o=!0,v="; SameSite=None"),o&&(v+="; secure"),ee.cookie=n+"="+encodeURIComponent(e)+d+"; path=/"+l+v},set:function(n,e,i,t,o,s,a){var l="",d="",v="";if(a)l="; domain="+a;else if(t){var p=Lo(ee.location.hostname);l=p?"; domain=."+p:""}if(i){var g=new Date;g.setTime(g.getTime()+i*24*60*60*1e3),d="; expires="+g.toGMTString()}s&&(o=!0,v="; SameSite=None"),o&&(v+="; secure");var f=n+"="+encodeURIComponent(e)+d+"; path=/"+l+v;return ee.cookie=f,f},remove:function(n,e,i){m.cookie.set(n,"",-1,e,!1,!1,i)}};var ot=null,Pi=function(n,e){if(ot!==null&&!e)return ot;var i=!0;try{n=n||window.localStorage;var t="__mplss_"+st(8),o="xyz";n.setItem(t,o),n.getItem(t)!==o&&(i=!1),n.removeItem(t)}catch{i=!1}return ot=i,i};m.localStorage={is_supported:function(n){var e=Pi(null,n);return e||J.error("localStorage unsupported; falling back to cookie store"),e},error:function(n){J.error("localStorage error: "+n)},get:function(n){try{return window.localStorage.getItem(n)}catch(e){m.localStorage.error(e)}return null},parse:function(n){try{return m.JSONDecode(m.localStorage.get(n))||{}}catch{}return null},set:function(n,e){try{window.localStorage.setItem(n,e)}catch(i){m.localStorage.error(i)}},remove:function(n){try{window.localStorage.removeItem(n)}catch(e){m.localStorage.error(e)}}},m.register_event=function(){var n=function(t,o,s,a,l){if(!t){J.error("No valid element provided to register_event");return}if(t.addEventListener&&!a)t.addEventListener(o,s,!!l);else{var d="on"+o,v=t[d];t[d]=e(t,s,v)}};function e(t,o,s){var a=function(l){if(l=l||i(window.event),!!l){var d=!0,v,p;return m.isFunction(s)&&(v=s(l)),p=o.call(t,l),(v===!1||p===!1)&&(d=!1),d}};return a}function i(t){return t&&(t.preventDefault=i.preventDefault,t.stopPropagation=i.stopPropagation),t}return i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0},n}();var vr=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');m.dom_query=function(){function n(o){return o.all?o.all:o.getElementsByTagName("*")}var e=/[\t\r\n]/g;function i(o,s){var a=" "+s+" ";return(" "+o.className+" ").replace(e," ").indexOf(a)>=0}function t(o){if(!ee.getElementsByTagName)return[];var s=o.split(" "),a,l,d,v,p,g,f,y,k,C,S=[ee];for(g=0;g<s.length;g++){if(a=s[g].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){l=a.split("#"),d=l[0];var M=l[1],A=ee.getElementById(M);if(!A||d&&A.nodeName.toLowerCase()!=d)return[];S=[A];continue}if(a.indexOf(".")>-1){l=a.split("."),d=l[0];var _=l[1];for(d||(d="*"),v=[],p=0,f=0;f<S.length;f++)for(d=="*"?k=n(S[f]):k=S[f].getElementsByTagName(d),y=0;y<k.length;y++)v[p++]=k[y];for(S=[],C=0,f=0;f<v.length;f++)v[f].className&&m.isString(v[f].className)&&i(v[f],_)&&(S[C++]=v[f]);continue}var T=a.match(vr);if(T){d=T[1];var I=T[2],K=T[3],G=T[4];for(d||(d="*"),v=[],p=0,f=0;f<S.length;f++)for(d=="*"?k=n(S[f]):k=S[f].getElementsByTagName(d),y=0;y<k.length;y++)v[p++]=k[y];S=[],C=0;var V;switch(K){case"=":V=function(F){return F.getAttribute(I)==G};break;case"~":V=function(F){return F.getAttribute(I).match(new RegExp("\\b"+G+"\\b"))};break;case"|":V=function(F){return F.getAttribute(I).match(new RegExp("^"+G+"-?"))};break;case"^":V=function(F){return F.getAttribute(I).indexOf(G)===0};break;case"$":V=function(F){return F.getAttribute(I).lastIndexOf(G)==F.getAttribute(I).length-G.length};break;case"*":V=function(F){return F.getAttribute(I).indexOf(G)>-1};break;default:V=function(F){return F.getAttribute(I)}}for(S=[],C=0,f=0;f<v.length;f++)V(v[f])&&(S[C++]=v[f]);continue}for(d=a,v=[],p=0,f=0;f<S.length;f++)for(k=S[f].getElementsByTagName(d),y=0;y<k.length;y++)v[p++]=k[y];S=v}return S}return function(o){return m.isElement(o)?[o]:m.isObject(o)&&!m.isUndefined(o.length)?o:t.call(this,o)}}();var br=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],fr=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];m.info={campaignParams:function(n){var e="",i={};return m.each(br,function(t){e=m.getQueryParam(ee.URL,t),e.length?i[t]=e:n!==void 0&&(i[t]=n)}),i},clickParams:function(){var n="",e={};return m.each(fr,function(i){n=m.getQueryParam(ee.URL,i),n.length&&(e[i]=n)}),e},marketingParams:function(){return m.extend(m.info.campaignParams(),m.info.clickParams())},searchEngine:function(n){return n.search("https?://(.*)google.([^/?]*)")===0?"google":n.search("https?://(.*)bing.com")===0?"bing":n.search("https?://(.*)yahoo.com")===0?"yahoo":n.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(n){var e=m.info.searchEngine(n),i=e!="yahoo"?"q":"p",t={};if(e!==null){t.$search_engine=e;var o=m.getQueryParam(n,i);o.length&&(t.mp_keyword=o)}return t},browser:function(n,e,i){return e=e||"",i||m.includes(n," OPR/")?m.includes(n,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":m.includes(n,"IEMobile")||m.includes(n,"WPDesktop")?"Internet Explorer Mobile":m.includes(n,"SamsungBrowser/")?"Samsung Internet":m.includes(n,"Edge")||m.includes(n,"Edg/")?"Microsoft Edge":m.includes(n,"FBIOS")?"Facebook Mobile":m.includes(n,"Chrome")?"Chrome":m.includes(n,"CriOS")?"Chrome iOS":m.includes(n,"UCWEB")||m.includes(n,"UCBrowser")?"UC Browser":m.includes(n,"FxiOS")?"Firefox iOS":m.includes(e,"Apple")?m.includes(n,"Mobile")?"Mobile Safari":"Safari":m.includes(n,"Android")?"Android Mobile":m.includes(n,"Konqueror")?"Konqueror":m.includes(n,"Firefox")?"Firefox":m.includes(n,"MSIE")||m.includes(n,"Trident/")?"Internet Explorer":m.includes(n,"Gecko")?"Mozilla":""},browserVersion:function(n,e,i){var t=m.info.browser(n,e,i),o={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},s=o[t];if(s===void 0)return null;var a=n.match(s);return a?parseFloat(a[a.length-2]):null},os:function(){var n=ze;return/Windows/i.test(n)?/Phone/.test(n)||/WPDesktop/.test(n)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(n)?"iOS":/Android/.test(n)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Mac/i.test(n)?"Mac OS X":/Linux/.test(n)?"Linux":/CrOS/.test(n)?"Chrome OS":""},device:function(n){return/Windows Phone/i.test(n)||/WPDesktop/.test(n)?"Windows Phone":/iPad/.test(n)?"iPad":/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":/Android/.test(n)?"Android":""},referringDomain:function(n){var e=n.split("/");return e.length>=3?e[2]:""},currentUrl:function(){return N.location.href},properties:function(n){return typeof n!="object"&&(n={}),m.extend(m.strip_empty_properties({$os:m.info.os(),$browser:m.info.browser(ze,dn.vendor,Li),$referrer:ee.referrer,$referring_domain:m.info.referringDomain(ee.referrer),$device:m.info.device(ze)}),{$current_url:m.info.currentUrl(),$browser_version:m.info.browserVersion(ze,dn.vendor,Li),$screen_height:Ti.height,$screen_width:Ti.width,mp_lib:"web",$lib_version:$e.LIB_VERSION,$insert_id:st(),time:m.timestamp()/1e3},m.strip_empty_properties(n))},people_properties:function(){return m.extend(m.strip_empty_properties({$os:m.info.os(),$browser:m.info.browser(ze,dn.vendor,Li)}),{$browser_version:m.info.browserVersion(ze,dn.vendor,Li)})},mpPageViewProperties:function(){return m.strip_empty_properties({current_page_title:ee.title,current_domain:N.location.hostname,current_url_path:N.location.pathname,current_url_protocol:N.location.protocol,current_url_search:N.location.search})}};var st=function(n){var e=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return n?e.substring(0,n):e},gr=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,yr=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Lo=function(n){var e=yr,i=n.split("."),t=i[i.length-1];(t.length>4||t==="com"||t==="org")&&(e=gr);var o=n.match(e);return o?o[0]:""},Cr=function(){var n=N.navigator.onLine;return m.isUndefined(n)||n},Ii=null,Di=null;typeof JSON<"u"&&(Ii=JSON.stringify,Di=JSON.parse),Ii=Ii||m.JSONEncode,Di=Di||m.JSONDecode,m.toArray=m.toArray,m.isObject=m.isObject,m.JSONEncode=m.JSONEncode,m.JSONDecode=m.JSONDecode,m.isBlockedUA=m.isBlockedUA,m.isEmptyObject=m.isEmptyObject,m.info=m.info,m.info.device=m.info.device,m.info.browser=m.info.browser,m.info.browserVersion=m.info.browserVersion,m.info.properties=m.info.properties;var wr="__mp_opt_in_out_";function kr(n,e){Po(!0,n,e)}function Sr(n,e){Po(!1,n,e)}function _r(n,e){return Eo(n,e)==="1"}function To(n,e){if(Ar(e))return J.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var i=Eo(n,e)==="0";return i&&J.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),i}function cn(n){return lt(n,function(e){return this.get_config(e)})}function un(n){return lt(n,function(e){return this._get_config(e)})}function Vn(n){return lt(n,function(e){return this._get_config(e)})}function Mr(n,e){e=e||{},at(e).remove(rt(n,e),!!e.crossSubdomainCookie,e.cookieDomain)}function at(n){return n=n||{},n.persistenceType==="localStorage"?m.localStorage:m.cookie}function rt(n,e){return e=e||{},(e.persistencePrefix||wr)+n}function Eo(n,e){return at(e).get(rt(n,e))}function Ar(n){if(n&&n.ignoreDnt)return!1;var e=n&&n.window||N,i=e.navigator||{},t=!1;return m.each([i.doNotTrack,i.msDoNotTrack,e.doNotTrack],function(o){m.includes([!0,1,"1","yes"],o)&&(t=!0)}),t}function Po(n,e,i){if(!m.isString(e)||!e.length){J.error("gdpr."+(n?"optIn":"optOut")+" called with an invalid token");return}i=i||{},at(i).set(rt(e,i),n?1:0,m.isNumber(i.cookieExpiration)?i.cookieExpiration:null,!!i.crossSubdomainCookie,!!i.secureCookie,!!i.crossSiteCookie,i.cookieDomain),i.track&&n&&i.track(i.trackEventName||"$opt_in",i.trackProperties,{send_immediately:!0})}function lt(n,e){return function(){var i=!1;try{var t=e.call(this,"token"),o=e.call(this,"ignore_dnt"),s=e.call(this,"opt_out_tracking_persistence_type"),a=e.call(this,"opt_out_tracking_cookie_prefix"),l=e.call(this,"window");t&&(i=To(t,{ignoreDnt:o,persistenceType:s,persistencePrefix:a,window:l}))}catch(v){J.error("Unexpected error when checking tracking opt-out status: "+v)}if(!i)return n.apply(this,arguments);var d=arguments[arguments.length-1];typeof d=="function"&&d(0)}}var xr=Ei("lock"),Io=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||window.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3};Io.prototype.withLock=function(n,e,i){!i&&typeof e!="function"&&(i=e,e=null);var t=i||new Date().getTime()+"|"+Math.random(),o=new Date().getTime(),s=this.storageKey,a=this.pollIntervalMS,l=this.timeoutMS,d=this.storage,v=s+":X",p=s+":Y",g=s+":Z",f=function(A){e&&e(A)},y=function(A){if(new Date().getTime()-o>l){xr.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+t+"]"),d.removeItem(g),d.removeItem(p),S();return}setTimeout(function(){try{A()}catch(_){f(_)}},a*(Math.random()+.1))},k=function(A,_){A()?_():y(function(){k(A,_)})},C=function(){var A=d.getItem(p);if(A&&A!==t)return!1;if(d.setItem(p,t),d.getItem(p)===t)return!0;if(!Pi(d,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},S=function(){d.setItem(v,t),k(C,function(){if(d.getItem(v)===t){M();return}y(function(){if(d.getItem(p)!==t){S();return}k(function(){return!d.getItem(g)},M)})})},M=function(){d.setItem(g,"1");try{n()}finally{d.removeItem(g),d.getItem(p)===t&&d.removeItem(p),d.getItem(v)===t&&d.removeItem(v)}};try{if(Pi(d,!0))S();else throw new Error("localStorage support check failed")}catch(A){f(A)}};var Do=Ei("batch"),hn=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||window.localStorage,this.reportError=e.errorReporter||m.bind(Do.error,Do),this.lock=new Io(n,{storage:this.storage}),this.usePersistence=e.usePersistence,this.pid=e.pid||null,this.memQueue=[]};hn.prototype.enqueue=function(n,e,i){var t={id:st(),flushAfter:new Date().getTime()+e*2,payload:n};this.usePersistence?this.lock.withLock(m.bind(function(){var s;try{var a=this.readFromStorage();a.push(t),s=this.saveToStorage(a),s&&this.memQueue.push(t)}catch{this.reportError("Error enqueueing item",n),s=!1}i&&i(s)},this),m.bind(function(s){this.reportError("Error acquiring storage lock",s),i&&i(!1)},this),this.pid):(this.memQueue.push(t),i&&i(!0))},hn.prototype.fillBatch=function(n){var e=this.memQueue.slice(0,n);if(this.usePersistence&&e.length<n){var i=this.readFromStorage();if(i.length){var t={};m.each(e,function(a){t[a.id]=!0});for(var o=0;o<i.length;o++){var s=i[o];if(new Date().getTime()>s.flushAfter&&!t[s.id]&&(s.orphaned=!0,e.push(s),e.length>=n))break}}}return e};var Bo=function(n,e){var i=[];return m.each(n,function(t){t.id&&!e[t.id]&&i.push(t)}),i};hn.prototype.removeItemsByID=function(n,e){var i={};if(m.each(n,function(o){i[o]=!0}),this.memQueue=Bo(this.memQueue,i),!this.usePersistence)e&&e(!0);else{var t=m.bind(function(){var o;try{var s=this.readFromStorage();if(s=Bo(s,i),o=this.saveToStorage(s),o){s=this.readFromStorage();for(var a=0;a<s.length;a++){var l=s[a];if(l.id&&i[l.id])return this.reportError("Item not removed from storage"),!1}}}catch{this.reportError("Error removing items",n),o=!1}return o},this);this.lock.withLock(function(){var s=t();e&&e(s)},m.bind(function(s){var a=!1;if(this.reportError("Error acquiring storage lock",s),!Pi(this.storage,!0)&&(a=t(),!a))try{this.storage.removeItem(this.storageKey)}catch(l){this.reportError("Error clearing queue",l)}e&&e(a)},this),this.pid)}};var No=function(n,e){var i=[];return m.each(n,function(t){var o=t.id;if(o in e){var s=e[o];s!==null&&(t.payload=s,i.push(t))}else i.push(t)}),i};hn.prototype.updatePayloads=function(n,e){this.memQueue=No(this.memQueue,n),this.usePersistence?this.lock.withLock(m.bind(function(){var t;try{var o=this.readFromStorage();o=No(o,n),t=this.saveToStorage(o)}catch{this.reportError("Error updating items",n),t=!1}e&&e(t)},this),m.bind(function(t){this.reportError("Error acquiring storage lock",t),e&&e(!1)},this),this.pid):e&&e(!0)},hn.prototype.readFromStorage=function(){var n;try{n=this.storage.getItem(this.storageKey),n&&(n=Di(n),m.isArray(n)||(this.reportError("Invalid storage entry:",n),n=null))}catch(e){this.reportError("Error retrieving queue",e),n=null}return n||[]},hn.prototype.saveToStorage=function(n){try{return this.storage.setItem(this.storageKey,Ii(n)),!0}catch(e){return this.reportError("Error saving queue",e),!1}},hn.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var Lr=10*60*1e3,ii=Ei("batch"),je=function(n,e){this.errorReporter=e.errorReporter,this.queue=new hn(n,{errorReporter:m.bind(this.reportError,this),storage:e.storage,usePersistence:e.usePersistence}),this.libConfig=e.libConfig,this.sendRequest=e.sendRequestFunc,this.beforeSendHook=e.beforeSendHook,this.stopAllBatching=e.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=e.flushOnlyOnInterval||!1};je.prototype.enqueue=function(n,e){this.queue.enqueue(n,this.flushInterval,e)},je.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},je.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},je.prototype.clear=function(){this.queue.clear()},je.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},je.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},je.prototype.scheduleFlush=function(n){this.flushInterval=n,this.stopped||(this.timeoutID=setTimeout(m.bind(function(){this.stopped||this.flush()},this),this.flushInterval))},je.prototype.flush=function(n){try{if(this.requestInProgress){ii.log("Flush: Request already in progress");return}n=n||{};var e=this.libConfig.batch_request_timeout_ms,i=new Date().getTime(),t=this.batchSize,o=this.queue.fillBatch(t),s=o.length===t,a=[],l={};if(m.each(o,function(p){var g=p.payload;if(this.beforeSendHook&&!p.orphaned&&(g=this.beforeSendHook(g)),g){g.event&&g.properties&&(g.properties=m.extend({},g.properties,{mp_sent_by_lib_version:$e.LIB_VERSION}));var f=!0,y=p.id;y?(this.itemIdsSentSuccessfully[y]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:p,batchSize:o.length,timesSent:this.itemIdsSentSuccessfully[y]}),f=!1):this.reportError("[dupe] found item with no ID",{item:p}),f&&a.push(g)}l[p.id]=g},this),a.length<1){this.resetFlush();return}this.requestInProgress=!0;var d=m.bind(function(p){this.requestInProgress=!1;try{var g=!1;if(n.unloading)this.queue.updatePayloads(l);else if(m.isObject(p)&&p.error==="timeout"&&new Date().getTime()-i>=e)this.reportError("Network timeout; retrying"),this.flush();else if(m.isObject(p)&&(p.httpStatusCode>=500||p.httpStatusCode===429||p.httpStatusCode<=0&&!Cr()||p.error==="timeout")){var f=this.flushInterval*2;p.retryAfter&&(f=parseInt(p.retryAfter,10)*1e3||f),f=Math.min(Lr,f),this.reportError("Error; retry in "+f+" ms"),this.scheduleFlush(f)}else if(m.isObject(p)&&p.httpStatusCode===413)if(o.length>1){var y=Math.max(1,Math.floor(t/2));this.batchSize=Math.min(this.batchSize,y,o.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",o),this.resetBatchSize(),g=!0;else g=!0;g&&(this.queue.removeItemsByID(m.map(o,function(k){return k.id}),m.bind(function(k){k?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!s?this.resetFlush():this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),m.each(o,m.bind(function(k){var C=k.id;C?(this.itemIdsSentSuccessfully[C]=this.itemIdsSentSuccessfully[C]||0,this.itemIdsSentSuccessfully[C]++,this.itemIdsSentSuccessfully[C]>5&&this.reportError("[dupe] item ID sent too many times",{item:k,batchSize:o.length,timesSent:this.itemIdsSentSuccessfully[C]})):this.reportError("[dupe] found item with no ID while removing",{item:k})},this)))}catch(k){this.reportError("Error handling API response",k),this.resetFlush()}},this),v={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};n.unloading&&(v.transport="sendBeacon"),ii.log("MIXPANEL REQUEST:",a),this.sendRequest(a,v,d)}catch(p){this.reportError("Error flushing request queue",p),this.resetFlush()}},je.prototype.reportError=function(n,e){if(ii.error.apply(ii.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(n)),this.errorReporter(n,e)}catch(i){ii.error(i)}};var wn=Ei("recorder"),Ho=N.CompressionStream,Tr={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},Er=new Set([Ge.MouseMove,Ge.MouseInteraction,Ge.Scroll,Ge.ViewportResize,Ge.Input,Ge.TouchMove,Ge.MediaInteraction,Ge.Drag,Ge.Selection]);function Pr(n){return n.type===wo.IncrementalSnapshot&&Er.has(n.data.source)}var Ke=function(n){this._mixpanel=n,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=ei,this.recordMinMs=0,this._initBatcher()};Ke.prototype._initBatcher=function(){this.batcher=new je("__mprec",{libConfig:Tr,sendRequestFunc:m.bind(this.flushEventsWithOptOut,this),errorReporter:m.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},Ke.prototype.get_config=function(n){return this._mixpanel.get_config(n)},Ke.prototype.startRecording=function(n){if(this._stopRecording!==null){wn.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>ei&&(this.recordMaxMs=ei,wn.critical("record_max_ms cannot be greater than "+ei+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>et&&(this.recordMinMs=et,wn.critical("record_min_ms cannot be greater than "+et+"ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=new Date().getTime(),this.replayId=m.UUID(),n||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var e=m.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(m.bind(function(){wn.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),this.get_config("record_idle_timeout_ms"))},this),i=this.get_config("record_block_selector");(i===""||i===null)&&(i=void 0),this._stopRecording=Xn({emit:m.bind(function(t){this.batcher.enqueue(t),Pr(t)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),e())},this),blockClass:this.get_config("record_block_class"),blockSelector:i,collectFonts:this.get_config("record_collect_fonts"),inlineImages:this.get_config("record_inline_images"),maskAllInputs:!0,maskTextClass:this.get_config("record_mask_text_class"),maskTextSelector:this.get_config("record_mask_text_selector")}),e(),this.maxTimeoutId=setTimeout(m.bind(this.resetRecording,this),this.recordMaxMs)},Ke.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},Ke.prototype.stopRecording=function(){this._stopRecording!==null&&(this._stopRecording(),this._stopRecording=null),this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),this.replayId=null,clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},Ke.prototype.flushEventsWithOptOut=function(n,e,i){this._flushEvents(n,e,i,m.bind(this._onOptOut,this))},Ke.prototype._onOptOut=function(n){n===0&&(this.recEvents=[],this.stopRecording())},Ke.prototype._sendRequest=function(n,e,i,t){var o=m.bind(function(s,a){s.status===200&&this.replayId===n&&this.seqNo++,t({status:0,httpStatusCode:s.status,responseBody:a,retryAfter:s.headers.get("Retry-After")})},this);N.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(e),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:i}).then(function(s){s.json().then(function(a){o(s,a)}).catch(function(a){t({error:a})})}).catch(function(s){t({error:s,httpStatusCode:0})})},Ke.prototype._flushEvents=cn(function(n,e,i){const t=n.length;if(t>0){var o=this.replayId,s=n[0].timestamp;(this.seqNo===0||!this.replayStartTime)&&(this.seqNo!==0&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=s);var a=n[t-1].timestamp-this.replayStartTime,l={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:s/1e3,replay_id:o,replay_length_ms:a,replay_start_time:this.replayStartTime/1e3},d=m.JSONEncode(n),v=this._mixpanel.get_property("$device_id");v&&(l.$device_id=v);var p=this._mixpanel.get_property("$user_id");if(p&&(l.$user_id=p),Ho){var g=new Blob([d],{type:"application/json"}).stream(),f=g.pipeThrough(new Ho("gzip"));new Response(f).blob().then(m.bind(function(y){l.format="gzip",this._sendRequest(o,l,y,i)},this))}else l.format="body",this._sendRequest(o,l,d,i)}}),Ke.prototype.reportError=function(n,e){wn.error.apply(wn.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,e)}catch(i){wn.error(i)}},N.__mp_recorder=Ke;var Ye=function(){};Ye.prototype.create_properties=function(){},Ye.prototype.event_handler=function(){},Ye.prototype.after_track_handler=function(){},Ye.prototype.init=function(n){return this.mp=n,this},Ye.prototype.track=function(n,e,i,t){var o=this,s=m.dom_query(n);if(s.length===0){J.error("The DOM query ("+n+") returned 0 elements");return}return m.each(s,function(a){m.register_event(a,this.override_event,function(l){var d={},v=o.create_properties(i,this),p=o.mp.get_config("track_links_timeout");o.event_handler(l,this,d),window.setTimeout(o.track_callback(t,v,d,!0),p),o.mp.track(e,v,o.track_callback(t,v,d))})},this),!0},Ye.prototype.track_callback=function(n,e,i,t){t=t||!1;var o=this;return function(){i.callback_fired||(i.callback_fired=!0,!(n&&n(t,e)===!1)&&o.after_track_handler(e,i,t))}},Ye.prototype.create_properties=function(n,e){var i;return typeof n=="function"?i=n(e):i=m.extend({},n),i};var Un=function(){this.override_event="click"};m.inherit(Un,Ye),Un.prototype.create_properties=function(n,e){var i=Un.superclass.create_properties.apply(this,arguments);return e.href&&(i.url=e.href),i},Un.prototype.event_handler=function(n,e,i){i.new_tab=n.which===2||n.metaKey||n.ctrlKey||e.target==="_blank",i.href=e.href,i.new_tab||n.preventDefault()},Un.prototype.after_track_handler=function(n,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var Bi=function(){this.override_event="submit"};m.inherit(Bi,Ye),Bi.prototype.event_handler=function(n,e,i){i.element=e,n.preventDefault()},Bi.prototype.after_track_handler=function(n,e){setTimeout(function(){e.element.submit()},0)};var mn="$set",jn="$set_once",Fe="$unset",kn="$add",qe="$append",Sn="$union",Qe="$remove",Ir="$delete",Ro={set_action:function(n,e){var i={},t={};return m.isObject(n)?m.each(n,function(o,s){this._is_reserved_property(s)||(t[s]=o)},this):t[n]=e,i[mn]=t,i},unset_action:function(n){var e={},i=[];return m.isArray(n)||(n=[n]),m.each(n,function(t){this._is_reserved_property(t)||i.push(t)},this),e[Fe]=i,e},set_once_action:function(n,e){var i={},t={};return m.isObject(n)?m.each(n,function(o,s){this._is_reserved_property(s)||(t[s]=o)},this):t[n]=e,i[jn]=t,i},union_action:function(n,e){var i={},t={};return m.isObject(n)?m.each(n,function(o,s){this._is_reserved_property(s)||(t[s]=m.isArray(o)?o:[o])},this):t[n]=m.isArray(e)?e:[e],i[Sn]=t,i},append_action:function(n,e){var i={},t={};return m.isObject(n)?m.each(n,function(o,s){this._is_reserved_property(s)||(t[s]=o)},this):t[n]=e,i[qe]=t,i},remove_action:function(n,e){var i={},t={};return m.isObject(n)?m.each(n,function(o,s){this._is_reserved_property(s)||(t[s]=o)},this):t[n]=e,i[Qe]=t,i},delete_action:function(){var n={};return n[Ir]="",n}},ie=function(){};m.extend(ie.prototype,Ro),ie.prototype._init=function(n,e,i){this._mixpanel=n,this._group_key=e,this._group_id=i},ie.prototype.set=Vn(function(n,e,i){var t=this.set_action(n,e);return m.isObject(n)&&(i=e),this._send_request(t,i)}),ie.prototype.set_once=Vn(function(n,e,i){var t=this.set_once_action(n,e);return m.isObject(n)&&(i=e),this._send_request(t,i)}),ie.prototype.unset=Vn(function(n,e){var i=this.unset_action(n);return this._send_request(i,e)}),ie.prototype.union=Vn(function(n,e,i){m.isObject(n)&&(i=e);var t=this.union_action(n,e);return this._send_request(t,i)}),ie.prototype.delete=Vn(function(n){var e=this.delete_action();return this._send_request(e,n)}),ie.prototype.remove=Vn(function(n,e,i){var t=this.remove_action(n,e);return this._send_request(t,i)}),ie.prototype._send_request=function(n,e){n.$group_key=this._group_key,n.$group_id=this._group_id,n.$token=this._get_config("token");var i=m.encodeDates(n);return this._mixpanel._track_or_batch({type:"groups",data:i,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},e)},ie.prototype._is_reserved_property=function(n){return n==="$group_key"||n==="$group_id"},ie.prototype._get_config=function(n){return this._mixpanel.get_config(n)},ie.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},ie.prototype.remove=ie.prototype.remove,ie.prototype.set=ie.prototype.set,ie.prototype.set_once=ie.prototype.set_once,ie.prototype.union=ie.prototype.union,ie.prototype.unset=ie.prototype.unset,ie.prototype.toString=ie.prototype.toString;var H=function(){};m.extend(H.prototype,Ro),H.prototype._init=function(n){this._mixpanel=n},H.prototype.set=un(function(n,e,i){var t=this.set_action(n,e);return m.isObject(n)&&(i=e),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),t[mn]=m.extend({},m.info.people_properties(),t[mn]),this._send_request(t,i)}),H.prototype.set_once=un(function(n,e,i){var t=this.set_once_action(n,e);return m.isObject(n)&&(i=e),this._send_request(t,i)}),H.prototype.unset=un(function(n,e){var i=this.unset_action(n);return this._send_request(i,e)}),H.prototype.increment=un(function(n,e,i){var t={},o={};return m.isObject(n)?(m.each(n,function(s,a){if(!this._is_reserved_property(a))if(isNaN(parseFloat(s))){J.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else o[a]=s},this),i=e):(m.isUndefined(e)&&(e=1),o[n]=e),t[kn]=o,this._send_request(t,i)}),H.prototype.append=un(function(n,e,i){m.isObject(n)&&(i=e);var t=this.append_action(n,e);return this._send_request(t,i)}),H.prototype.remove=un(function(n,e,i){m.isObject(n)&&(i=e);var t=this.remove_action(n,e);return this._send_request(t,i)}),H.prototype.union=un(function(n,e,i){m.isObject(n)&&(i=e);var t=this.union_action(n,e);return this._send_request(t,i)}),H.prototype.track_charge=un(function(n,e,i){if(!m.isNumber(n)&&(n=parseFloat(n),isNaN(n))){J.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",m.extend({$amount:n},e),i)}),H.prototype.clear_charges=function(n){return this.set("$transactions",[],n)},H.prototype.delete_user=function(){if(!this._identify_called()){J.error("mixpanel.people.delete_user() requires you to call identify() first");return}var n={$delete:this._mixpanel.get_distinct_id()};return this._send_request(n)},H.prototype.toString=function(){return this._mixpanel.toString()+".people"},H.prototype._send_request=function(n,e){n.$token=this._get_config("token"),n.$distinct_id=this._mixpanel.get_distinct_id();var i=this._mixpanel.get_property("$device_id"),t=this._mixpanel.get_property("$user_id"),o=this._mixpanel.get_property("$had_persisted_distinct_id");i&&(n.$device_id=i),t&&(n.$user_id=t),o&&(n.$had_persisted_distinct_id=o);var s=m.encodeDates(n);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:s,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},e):(this._enqueue(n),m.isUndefined(e)||(this._get_config("verbose")?e({status:-1,error:null}):e(-1)),m.truncate(s,255))},H.prototype._get_config=function(n){return this._mixpanel.get_config(n)},H.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},H.prototype._enqueue=function(n){mn in n?this._mixpanel.persistence._add_to_people_queue(mn,n):jn in n?this._mixpanel.persistence._add_to_people_queue(jn,n):Fe in n?this._mixpanel.persistence._add_to_people_queue(Fe,n):kn in n?this._mixpanel.persistence._add_to_people_queue(kn,n):qe in n?this._mixpanel.persistence._add_to_people_queue(qe,n):Qe in n?this._mixpanel.persistence._add_to_people_queue(Qe,n):Sn in n?this._mixpanel.persistence._add_to_people_queue(Sn,n):J.error("Invalid call to _enqueue():",n)},H.prototype._flush_one_queue=function(n,e,i,t){var o=this,s=m.extend({},this._mixpanel.persistence.load_queue(n)),a=s;!m.isUndefined(s)&&m.isObject(s)&&!m.isEmptyObject(s)&&(o._mixpanel.persistence._pop_from_people_queue(n,s),o._mixpanel.persistence.save(),t&&(a=t(s)),e.call(o,a,function(l,d){l===0&&o._mixpanel.persistence._add_to_people_queue(n,s),m.isUndefined(i)||i(l,d)}))},H.prototype._flush=function(n,e,i,t,o,s,a){var l=this;this._flush_one_queue(mn,this.set,n),this._flush_one_queue(jn,this.set_once,t),this._flush_one_queue(Fe,this.unset,s,function(S){return m.keys(S)}),this._flush_one_queue(kn,this.increment,e),this._flush_one_queue(Sn,this.union,o);var d=this._mixpanel.persistence.load_queue(qe);if(!m.isUndefined(d)&&m.isArray(d)&&d.length)for(var v,p=function(S,M){S===0&&l._mixpanel.persistence._add_to_people_queue(qe,v),m.isUndefined(i)||i(S,M)},g=d.length-1;g>=0;g--)d=this._mixpanel.persistence.load_queue(qe),v=d.pop(),l._mixpanel.persistence.save(),m.isEmptyObject(v)||l.append(v,p);var f=this._mixpanel.persistence.load_queue(Qe);if(!m.isUndefined(f)&&m.isArray(f)&&f.length)for(var y,k=function(S,M){S===0&&l._mixpanel.persistence._add_to_people_queue(Qe,y),m.isUndefined(a)||a(S,M)},C=f.length-1;C>=0;C--)f=this._mixpanel.persistence.load_queue(Qe),y=f.pop(),l._mixpanel.persistence.save(),m.isEmptyObject(y)||l.remove(y,k)},H.prototype._is_reserved_property=function(n){return n==="$distinct_id"||n==="$token"||n==="$device_id"||n==="$user_id"||n==="$had_persisted_distinct_id"},H.prototype.set=H.prototype.set,H.prototype.set_once=H.prototype.set_once,H.prototype.unset=H.prototype.unset,H.prototype.increment=H.prototype.increment,H.prototype.append=H.prototype.append,H.prototype.remove=H.prototype.remove,H.prototype.union=H.prototype.union,H.prototype.track_charge=H.prototype.track_charge,H.prototype.clear_charges=H.prototype.clear_charges,H.prototype.delete_user=H.prototype.delete_user,H.prototype.toString=H.prototype.toString;var dt="__mps",ct="__mpso",ut="__mpus",ht="__mpa",mt="__mpap",pt="__mpr",vt="__mpu",Oo="$people_distinct_id",Ni="__alias",ti="__timers",Dr=[dt,ct,ut,ht,mt,pt,vt,Oo,Ni,ti],j=function(n){this.props={},this.campaign_params_saved=!1,n.persistence_name?this.name="mp_"+n.persistence_name:this.name="mp_"+n.token+"_mixpanel";var e=n.persistence;e!=="cookie"&&e!=="localStorage"&&(J.critical("Unknown persistence type "+e+"; falling back to cookie"),e=n.persistence="cookie"),e==="localStorage"&&m.localStorage.is_supported()?this.storage=m.localStorage:this.storage=m.cookie,this.load(),this.update_config(n),this.upgrade(),this.save()};j.prototype.properties=function(){var n={};return this.load(),m.each(this.props,function(e,i){m.include(Dr,i)||(n[i]=e)}),n},j.prototype.load=function(){if(!this.disabled){var n=this.storage.parse(this.name);n&&(this.props=m.extend({},n))}},j.prototype.upgrade=function(){var n,e;this.storage===m.localStorage?(n=m.cookie.parse(this.name),m.cookie.remove(this.name),m.cookie.remove(this.name,!0),n&&this.register_once(n)):this.storage===m.cookie&&(e=m.localStorage.parse(this.name),m.localStorage.remove(this.name),e&&this.register_once(e))},j.prototype.save=function(){this.disabled||this.storage.set(this.name,m.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},j.prototype.load_prop=function(n){return this.load(),this.props[n]},j.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},j.prototype.clear=function(){this.remove(),this.props={}},j.prototype.register_once=function(n,e,i){return m.isObject(n)?(typeof e>"u"&&(e="None"),this.expire_days=typeof i>"u"?this.default_expiry:i,this.load(),m.each(n,function(t,o){(!this.props.hasOwnProperty(o)||this.props[o]===e)&&(this.props[o]=t)},this),this.save(),!0):!1},j.prototype.register=function(n,e){return m.isObject(n)?(this.expire_days=typeof e>"u"?this.default_expiry:e,this.load(),m.extend(this.props,n),this.save(),!0):!1},j.prototype.unregister=function(n){this.load(),n in this.props&&(delete this.props[n],this.save())},j.prototype.update_search_keyword=function(n){this.register(m.info.searchInfo(n))},j.prototype.update_referrer_info=function(n){this.register_once({$initial_referrer:n||"$direct",$initial_referring_domain:m.info.referringDomain(n)||"$direct"},"")},j.prototype.get_referrer_info=function(){return m.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},j.prototype.update_config=function(n){this.default_expiry=this.expire_days=n.cookie_expiration,this.set_disabled(n.disable_persistence),this.set_cookie_domain(n.cookie_domain),this.set_cross_site(n.cross_site_cookie),this.set_cross_subdomain(n.cross_subdomain_cookie),this.set_secure(n.secure_cookie)},j.prototype.set_disabled=function(n){this.disabled=n,this.disabled?this.remove():this.save()},j.prototype.set_cookie_domain=function(n){n!==this.cookie_domain&&(this.remove(),this.cookie_domain=n,this.save())},j.prototype.set_cross_site=function(n){n!==this.cross_site&&(this.cross_site=n,this.remove(),this.save())},j.prototype.set_cross_subdomain=function(n){n!==this.cross_subdomain&&(this.cross_subdomain=n,this.remove(),this.save())},j.prototype.get_cross_subdomain=function(){return this.cross_subdomain},j.prototype.set_secure=function(n){n!==this.secure&&(this.secure=!!n,this.remove(),this.save())},j.prototype._add_to_people_queue=function(n,e){var i=this._get_queue_key(n),t=e[n],o=this._get_or_create_queue(mn),s=this._get_or_create_queue(jn),a=this._get_or_create_queue(Fe),l=this._get_or_create_queue(kn),d=this._get_or_create_queue(Sn),v=this._get_or_create_queue(Qe,[]),p=this._get_or_create_queue(qe,[]);i===dt?(m.extend(o,t),this._pop_from_people_queue(kn,t),this._pop_from_people_queue(Sn,t),this._pop_from_people_queue(Fe,t)):i===ct?(m.each(t,function(g,f){f in s||(s[f]=g)}),this._pop_from_people_queue(Fe,t)):i===ut?m.each(t,function(g){m.each([o,s,l,d],function(f){g in f&&delete f[g]}),m.each(p,function(f){g in f&&delete f[g]}),a[g]=!0}):i===ht?(m.each(t,function(g,f){f in o?o[f]+=g:(f in l||(l[f]=0),l[f]+=g)},this),this._pop_from_people_queue(Fe,t)):i===vt?(m.each(t,function(g,f){m.isArray(g)&&(f in d||(d[f]=[]),d[f]=d[f].concat(g))}),this._pop_from_people_queue(Fe,t)):i===pt?(v.push(t),this._pop_from_people_queue(qe,t)):i===mt&&(p.push(t),this._pop_from_people_queue(Fe,t)),J.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),J.log(e),this.save()},j.prototype._pop_from_people_queue=function(n,e){var i=this.props[this._get_queue_key(n)];m.isUndefined(i)||m.each(e,function(t,o){n===qe||n===Qe?m.each(i,function(s){s[o]===t&&delete s[o]}):delete i[o]},this)},j.prototype.load_queue=function(n){return this.load_prop(this._get_queue_key(n))},j.prototype._get_queue_key=function(n){if(n===mn)return dt;if(n===jn)return ct;if(n===Fe)return ut;if(n===kn)return ht;if(n===qe)return mt;if(n===Qe)return pt;if(n===Sn)return vt;J.error("Invalid queue:",n)},j.prototype._get_or_create_queue=function(n,e){var i=this._get_queue_key(n);return e=m.isUndefined(e)?{}:e,this.props[i]||(this.props[i]=e)},j.prototype.set_event_timer=function(n,e){var i=this.load_prop(ti)||{};i[n]=e,this.props[ti]=i,this.save()},j.prototype.remove_event_timer=function(n){var e=this.load_prop(ti)||{},i=e[n];return m.isUndefined(i)||(delete this.props[ti][n],this.save()),i};var bt,Vo=function(n,e){throw new Error(n+" not available in this build.")},Ce,Uo=0,Br=1,Nr=function(n){return n},oi=function(){},He="mixpanel",jo="base64",Hr="json",ft="$device:",Kn=N.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Ko=!Kn&&ze.indexOf("MSIE")===-1&&ze.indexOf("Mozilla")===-1,Hi=null;dn.sendBeacon&&(Hi=function(){return dn.sendBeacon.apply(dn,arguments)});var Fo={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},Go={api_host:"https://api-js.mixpanel.com",api_routes:Fo,api_method:"POST",api_transport:"XHR",api_payload_format:jo,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:oi,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:oi,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_collect_fonts:!1,record_idle_timeout_ms:30*60*1e3,record_inline_images:!1,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:ei,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},zo=!1,x=function(){},gt=function(n,e,i){var t,o=i===He?Ce:Ce[i];if(o&&bt===Uo)t=o;else{if(o&&!m.isArray(o)){J.error("You have already initialized "+i);return}t=new x}if(t._cached_groups={},t._init(n,e,i),t.people=new H,t.people._init(t),!t.get_config("skip_first_touch_marketing")){var s=m.info.campaignParams(null),a={},l=!1;m.each(s,function(d,v){a["initial_"+v]=d,d&&(l=!0)}),l&&t.people.set_once(a)}return $e.DEBUG=$e.DEBUG||t.get_config("debug"),!m.isUndefined(o)&&m.isArray(o)&&(t._execute_array.call(t.people,o.people),t._execute_array(o)),t};x.prototype.init=function(n,e,i){if(m.isUndefined(i)){this.report_error("You must name your new library: init(token, config, name)");return}if(i===He){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var t=gt(n,e,i);return Ce[i]=t,t._loaded(),t},x.prototype._init=function(n,e,i){e=e||{},this.__loaded=!0,this.config={};var t={};if(!("api_payload_format"in e)){var o=e.api_host||Go.api_host;o.match(/\.mixpanel\.com/)&&(t.api_payload_format=Hr)}if(this.set_config(m.extend({},Go,t,e,{name:i,token:n,callback_fn:(i===He?i:He+"."+i)+"._jsc"})),this._jsc=oi,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!m.localStorage.is_supported(!0)||!Kn)this._batch_requests=!1,J.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),m.each(this.get_batcher_configs(),function(d){J.log("Clearing batch queue "+d.queue_key),m.localStorage.remove(d.queue_key)});else if(this.init_batchers(),Hi&&N.addEventListener){var s=m.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);N.addEventListener("pagehide",function(d){d.persisted&&s()}),N.addEventListener("visibilitychange",function(){ee.visibilityState==="hidden"&&s()})}}this.persistence=this.cookie=new j(this.config),this.unpersisted_superprops={},this._gdpr_init();var a=m.UUID();this.get_distinct_id()||this.register_once({distinct_id:ft+a,$device_id:a},"");var l=this.get_config("track_pageview");l&&this._init_url_change_tracking(l),this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent")&&this.start_session_recording()},x.prototype.start_session_recording=cn(function(){if(!N.MutationObserver){J.critical("Browser does not support MutationObserver; skipping session recording");return}var n=m.bind(function(){this._recorder=this._recorder||new N.__mp_recorder(this),this._recorder.startRecording()},this);m.isUndefined(N.__mp_recorder)?Vo(this.get_config("recorder_src"),n):n()}),x.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():J.critical("Session recorder module not loaded")},x.prototype.get_session_recording_properties=function(){var n={};if(this._recorder){var e=this._recorder.replayId;e&&(n.$mp_replay_id=e)}return n},x.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var n=m.info.campaignParams(null);m.each(n,(function(e,i){this.unregister(i)}).bind(this))}},x.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(ee.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(m.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(ee.referrer)},x.prototype._dom_loaded=function(){m.each(this.__dom_loaded_queue,function(n){this._track_dom.apply(this,n)},this),this.has_opted_out_tracking()||m.each(this.__request_queue,function(n){this._send_request.apply(this,n)},this),delete this.__dom_loaded_queue,delete this.__request_queue},x.prototype._track_dom=function(n,e){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!zo)return this.__dom_loaded_queue.push([n,e]),!1;var i=new n().init(this);return i.track.apply(i,e)},x.prototype._init_url_change_tracking=function(n){var e="",i=this.track_pageview();if(i&&(e=m.info.currentUrl()),m.include(["full-url","url-with-path-and-query-string","url-with-path"],n)){N.addEventListener("popstate",function(){N.dispatchEvent(new Event("mp_locationchange"))}),N.addEventListener("hashchange",function(){N.dispatchEvent(new Event("mp_locationchange"))});var t=N.history.pushState;typeof t=="function"&&(N.history.pushState=function(s,a,l){t.call(N.history,s,a,l),N.dispatchEvent(new Event("mp_locationchange"))});var o=N.history.replaceState;typeof o=="function"&&(N.history.replaceState=function(s,a,l){o.call(N.history,s,a,l),N.dispatchEvent(new Event("mp_locationchange"))}),N.addEventListener("mp_locationchange",(function(){var s=m.info.currentUrl(),a=!1;if(n==="full-url"?a=s!==e:n==="url-with-path-and-query-string"?a=s.split("#")[0]!==e.split("#")[0]:n==="url-with-path"&&(a=s.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0]),a){var l=this.track_pageview();l&&(e=s)}}).bind(this))}},x.prototype._prepare_callback=function(n,e){if(m.isUndefined(n))return null;if(Kn){var i=function(a){n(a,e)};return i}else{var t=this._jsc,o=""+Math.floor(Math.random()*1e8),s=this.get_config("callback_fn")+"["+o+"]";return t[o]=function(a){delete t[o],n(a,e)},s}},x.prototype._send_request=function(n,e,i,t){var o=!0;if(Ko)return this.__request_queue.push(arguments),o;var s={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},a=null;!t&&(m.isFunction(i)||typeof i=="string")&&(t=i,i=null),i=m.extend(s,i||{}),Kn||(i.method="GET");var l=i.method==="POST",d=Hi&&l&&i.transport.toLowerCase()==="sendbeacon",v=i.verbose;e.verbose&&(v=!0),this.get_config("test")&&(e.test=1),v&&(e.verbose=1),this.get_config("img")&&(e.img=1),Kn||(t?e.callback=t:(v||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),l&&(a="data="+encodeURIComponent(e.data),delete e.data),n+="?"+m.HTTPBuildQuery(e);var p=this;if("img"in e){var g=ee.createElement("img");g.src=n,ee.body.appendChild(g)}else if(d){try{o=Hi(n,a)}catch(M){p.report_error(M),o=!1}try{t&&t(o?1:0)}catch(M){p.report_error(M)}}else if(Kn)try{var f=new XMLHttpRequest;f.open(i.method,n,!0);var y=this.get_config("xhr_headers");if(l&&(y["Content-Type"]="application/x-www-form-urlencoded"),m.each(y,function(M,A){f.setRequestHeader(A,M)}),i.timeout_ms&&typeof f.timeout<"u"){f.timeout=i.timeout_ms;var k=new Date().getTime()}f.withCredentials=!0,f.onreadystatechange=function(){if(f.readyState===4)if(f.status===200){if(t)if(v){var M;try{M=m.JSONDecode(f.responseText)}catch(T){if(p.report_error(T),i.ignore_json_errors)M=f.responseText;else return}t(M)}else t(Number(f.responseText))}else{var A;if(f.timeout&&!f.status&&new Date().getTime()-k>=f.timeout?A="timeout":A="Bad HTTP status: "+f.status+" "+f.statusText,p.report_error(A),t)if(v){var _=f.responseHeaders||{};t({status:0,httpStatusCode:f.status,error:A,retryAfter:_["Retry-After"]})}else t(0)}},f.send(a)}catch(M){p.report_error(M),o=!1}else{var C=ee.createElement("script");C.type="text/javascript",C.async=!0,C.defer=!0,C.src=n;var S=ee.getElementsByTagName("script")[0];S.parentNode.insertBefore(C,S)}return o},x.prototype._execute_array=function(n){var e,i=[],t=[],o=[];m.each(n,function(a){a&&(e=a[0],m.isArray(e)?o.push(a):typeof a=="function"?a.call(this):m.isArray(a)&&e==="alias"?i.push(a):m.isArray(a)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?o.push(a):t.push(a))},this);var s=function(a,l){m.each(a,function(d){if(m.isArray(d[0])){var v=l;m.each(d,function(p){v=v[p[0]].apply(v,p.slice(1))})}else this[d[0]].apply(this,d.slice(1))},l)};s(i,this),s(t,this),s(o,this)},x.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},x.prototype.get_batcher_configs=function(){var n="__mpq_"+this.get_config("token"),e=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+e.track,queue_key:n+"_ev"},people:{type:"people",endpoint:"/"+e.engage,queue_key:n+"_pp"},groups:{type:"groups",endpoint:"/"+e.groups,queue_key:n+"_gr"}},this._batcher_configs},x.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var n=m.bind(function(i){return new je(i.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:m.bind(function(t,o,s){this._send_request(this.get_config("api_host")+i.endpoint,this._encode_data_for_request(t),o,this._prepare_callback(s,t))},this),beforeSendHook:m.bind(function(t){return this._run_hook("before_send_"+i.type,t)},this),stopAllBatchingFunc:m.bind(this.stop_batch_senders,this),usePersistence:!0})},this),e=this.get_batcher_configs();this.request_batchers={events:n(e.events),people:n(e.people),groups:n(e.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},x.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,m.each(this.request_batchers,function(n){n.start()}))},x.prototype.stop_batch_senders=function(){this._batch_requests=!1,m.each(this.request_batchers,function(n){n.stop(),n.clear()})},x.prototype.push=function(n){this._execute_array([n])},x.prototype.disable=function(n){typeof n>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(n)},x.prototype._encode_data_for_request=function(n){var e=m.JSONEncode(n);return this.get_config("api_payload_format")===jo&&(e=m.base64Encode(e)),{data:e}},x.prototype._track_or_batch=function(n,e){var i=m.truncate(n.data,255),t=n.endpoint,o=n.batcher,s=n.should_send_immediately,a=n.send_request_options||{};e=e||oi;var l=!0,d=m.bind(function(){return a.skip_hooks||(i=this._run_hook("before_send_"+n.type,i)),i?(J.log("MIXPANEL REQUEST:"),J.log(i),this._send_request(t,this._encode_data_for_request(i),a,this._prepare_callback(e,i))):null},this);return this._batch_requests&&!s?o.enqueue(i,function(v){v?e(1,i):d()}):l=d(),l&&i},x.prototype.track=cn(function(n,e,i,t){!t&&typeof i=="function"&&(t=i,i=null),i=i||{};var o=i.transport;o&&(i.transport=o);var s=i.send_immediately;if(typeof t!="function"&&(t=oi),m.isUndefined(n)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(n)){t(0);return}e=m.extend({},e),e.token=this.get_config("token");var a=this.persistence.remove_event_timer(n);if(!m.isUndefined(a)){var l=new Date().getTime()-a;e.$duration=parseFloat((l/1e3).toFixed(3))}this._set_default_superprops();var d=this.get_config("track_marketing")?m.info.marketingParams():{};e=m.extend({},m.info.properties({mp_loader:this.get_config("mp_loader")}),d,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),e);var v=this.get_config("property_blacklist");m.isArray(v)?m.each(v,function(f){delete e[f]}):this.report_error("Invalid value for property_blacklist config: "+v);var p={event:n,properties:e},g=this._track_or_batch({type:"events",data:p,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:s,send_request_options:i},t);return g}),x.prototype.set_group=cn(function(n,e,i){m.isArray(e)||(e=[e]);var t={};return t[n]=e,this.register(t),this.people.set(n,e,i)}),x.prototype.add_group=cn(function(n,e,i){var t=this.get_property(n),o={};return t===void 0?(o[n]=[e],this.register(o)):t.indexOf(e)===-1&&(t.push(e),o[n]=t,this.register(o)),this.people.union(n,e,i)}),x.prototype.remove_group=cn(function(n,e,i){var t=this.get_property(n);if(t!==void 0){var o=t.indexOf(e);o>-1&&(t.splice(o,1),this.register({group_key:t})),t.length===0&&this.unregister(n)}return this.people.remove(n,e,i)}),x.prototype.track_with_groups=cn(function(n,e,i,t){var o=m.extend({},e||{});return m.each(i,function(s,a){s!=null&&(o[a]=s)}),this.track(n,o,t)}),x.prototype._create_map_key=function(n,e){return n+"_"+JSON.stringify(e)},x.prototype._remove_group_from_cache=function(n,e){delete this._cached_groups[this._create_map_key(n,e)]},x.prototype.get_group=function(n,e){var i=this._create_map_key(n,e),t=this._cached_groups[i];return(t===void 0||t._group_key!==n||t._group_id!==e)&&(t=new ie,t._init(this,n,e),this._cached_groups[i]=t),t},x.prototype.track_pageview=cn(function(n,e){typeof n!="object"&&(n={}),e=e||{};var i=e.event_name||"$mp_web_page_view",t=m.extend(m.info.mpPageViewProperties(),m.info.campaignParams(),m.info.clickParams()),o=m.extend({},t,n);return this.track(i,o)}),x.prototype.track_links=function(){return this._track_dom.call(this,Un,arguments)},x.prototype.track_forms=function(){return this._track_dom.call(this,Bi,arguments)},x.prototype.time_event=function(n){if(m.isUndefined(n)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(n)||this.persistence.set_event_timer(n,new Date().getTime())};var Rr={persistent:!0},yt=function(n){var e;return m.isObject(n)?e=n:m.isUndefined(n)?e={}:e={days:n},m.extend({},Rr,e)};x.prototype.register=function(n,e){var i=yt(e);i.persistent?this.persistence.register(n,i.days):m.extend(this.unpersisted_superprops,n)},x.prototype.register_once=function(n,e,i){var t=yt(i);t.persistent?this.persistence.register_once(n,e,t.days):(typeof e>"u"&&(e="None"),m.each(n,function(o,s){(!this.unpersisted_superprops.hasOwnProperty(s)||this.unpersisted_superprops[s]===e)&&(this.unpersisted_superprops[s]=o)},this))},x.prototype.unregister=function(n,e){e=yt(e),e.persistent?this.persistence.unregister(n):delete this.unpersisted_superprops[n]},x.prototype._register_single=function(n,e){var i={};i[n]=e,this.register(i)},x.prototype.identify=function(n,e,i,t,o,s,a,l){var d=this.get_distinct_id();if(n&&d!==n){if(typeof n=="string"&&n.indexOf(ft)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:n})}if(!this.get_property("$device_id")){var v=d;this.register_once({$had_persisted_distinct_id:!0,$device_id:v},"")}n!==d&&n!==this.get_property(Ni)&&(this.unregister(Ni),this.register({distinct_id:n})),this._flags.identify_called=!0,this.people._flush(e,i,t,o,s,a,l),n!==d&&this.track("$identify",{distinct_id:n,$anon_distinct_id:d},{skip_hooks:!0})},x.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var n=m.UUID();this.register_once({distinct_id:ft+n,$device_id:n},"")},x.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},x.prototype.alias=function(n,e){if(n===this.get_property(Oo))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var i=this;return m.isUndefined(e)&&(e=this.get_distinct_id()),n!==e?(this._register_single(Ni,n),this.track("$create_alias",{alias:n,distinct_id:e},{skip_hooks:!0},function(){i.identify(n)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(n),-1)},x.prototype.name_tag=function(n){this._register_single("mp_name_tag",n)},x.prototype.set_config=function(n){if(m.isObject(n)){m.extend(this.config,n);var e=n.batch_size;e&&m.each(this.request_batchers,function(i){i.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),$e.DEBUG=$e.DEBUG||this.get_config("debug")}},x.prototype.get_config=function(n){return this.config[n]},x.prototype._run_hook=function(n){var e=(this.config.hooks[n]||Nr).apply(this,ln.call(arguments,1));return typeof e>"u"&&(this.report_error(n+" hook did not return a value"),e=null),e},x.prototype.get_property=function(n){return this.persistence.load_prop([n])},x.prototype.toString=function(){var n=this.get_config("name");return n!==He&&(n=He+"."+n),n},x.prototype._event_is_disabled=function(n){return m.isBlockedUA(ze)||this._flags.disable_all_events||m.include(this.__disabled_events,n)},x.prototype._gdpr_init=function(){var n=this.get_config("opt_out_tracking_persistence_type")==="localStorage";n&&m.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||m.cookie.get("mp_optout"))&&(m.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},x.prototype._gdpr_update_persistence=function(n){var e;if(n&&n.clear_persistence)e=!0;else if(n&&n.enable_persistence)e=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==e&&this.persistence.set_disabled(e),e?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()},x.prototype._gdpr_call_func=function(n,e){return e=m.extend({track:m.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},e),m.localStorage.is_supported()||(e.persistence_type="cookie"),n(this.get_config("token"),{track:e.track,trackEventName:e.track_event_name,trackProperties:e.track_properties,persistenceType:e.persistence_type,persistencePrefix:e.cookie_prefix,cookieDomain:e.cookie_domain,cookieExpiration:e.cookie_expiration,crossSiteCookie:e.cross_site_cookie,crossSubdomainCookie:e.cross_subdomain_cookie,secureCookie:e.secure_cookie,ignoreDnt:e.ignore_dnt})},x.prototype.opt_in_tracking=function(n){n=m.extend({enable_persistence:!0},n),this._gdpr_call_func(kr,n),this._gdpr_update_persistence(n)},x.prototype.opt_out_tracking=function(n){n=m.extend({clear_persistence:!0,delete_user:!0},n),n.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(Sr,n),this._gdpr_update_persistence(n)},x.prototype.has_opted_in_tracking=function(n){return this._gdpr_call_func(_r,n)},x.prototype.has_opted_out_tracking=function(n){return this._gdpr_call_func(To,n)},x.prototype.clear_opt_in_out_tracking=function(n){n=m.extend({enable_persistence:!0},n),this._gdpr_call_func(Mr,n),this._gdpr_update_persistence(n)},x.prototype.report_error=function(n,e){J.error.apply(J.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,e)}catch(i){J.error(i)}},x.prototype.init=x.prototype.init,x.prototype.reset=x.prototype.reset,x.prototype.disable=x.prototype.disable,x.prototype.time_event=x.prototype.time_event,x.prototype.track=x.prototype.track,x.prototype.track_links=x.prototype.track_links,x.prototype.track_forms=x.prototype.track_forms,x.prototype.track_pageview=x.prototype.track_pageview,x.prototype.register=x.prototype.register,x.prototype.register_once=x.prototype.register_once,x.prototype.unregister=x.prototype.unregister,x.prototype.identify=x.prototype.identify,x.prototype.alias=x.prototype.alias,x.prototype.name_tag=x.prototype.name_tag,x.prototype.set_config=x.prototype.set_config,x.prototype.get_config=x.prototype.get_config,x.prototype.get_property=x.prototype.get_property,x.prototype.get_distinct_id=x.prototype.get_distinct_id,x.prototype.toString=x.prototype.toString,x.prototype.opt_out_tracking=x.prototype.opt_out_tracking,x.prototype.opt_in_tracking=x.prototype.opt_in_tracking,x.prototype.has_opted_out_tracking=x.prototype.has_opted_out_tracking,x.prototype.has_opted_in_tracking=x.prototype.has_opted_in_tracking,x.prototype.clear_opt_in_out_tracking=x.prototype.clear_opt_in_out_tracking,x.prototype.get_group=x.prototype.get_group,x.prototype.set_group=x.prototype.set_group,x.prototype.add_group=x.prototype.add_group,x.prototype.remove_group=x.prototype.remove_group,x.prototype.track_with_groups=x.prototype.track_with_groups,x.prototype.start_batch_senders=x.prototype.start_batch_senders,x.prototype.stop_batch_senders=x.prototype.stop_batch_senders,x.prototype.start_session_recording=x.prototype.start_session_recording,x.prototype.stop_session_recording=x.prototype.stop_session_recording,x.prototype.get_session_recording_properties=x.prototype.get_session_recording_properties,x.prototype.DEFAULT_API_ROUTES=Fo,j.prototype.properties=j.prototype.properties,j.prototype.update_search_keyword=j.prototype.update_search_keyword,j.prototype.update_referrer_info=j.prototype.update_referrer_info,j.prototype.get_cross_subdomain=j.prototype.get_cross_subdomain,j.prototype.clear=j.prototype.clear;var Fn={},Or=function(){m.each(Fn,function(n,e){e!==He&&(Ce[e]=n)}),Ce._=m},Vr=function(){Ce.init=function(n,e,i){if(i)return Ce[i]||(Ce[i]=Fn[i]=gt(n,e,i),Ce[i]._loaded()),Ce[i];var t=Ce;Fn[He]?t=Fn[He]:n&&(t=gt(n,e,He),t._loaded(),Fn[He]=t),Ce=t,bt===Br&&(N[He]=Ce),Or()}},Ur=function(){function n(){n.done||(n.done=!0,zo=!0,Ko=!1,m.each(Fn,function(t){t._dom_loaded()}))}function e(){try{ee.documentElement.doScroll("left")}catch{setTimeout(e,1);return}n()}if(ee.addEventListener)ee.readyState==="complete"?n():ee.addEventListener("DOMContentLoaded",n,!1);else if(ee.attachEvent){ee.attachEvent("onreadystatechange",n);var i=!1;try{i=N.frameElement===null}catch{}ee.documentElement.doScroll&&i&&e()}m.register_event(N,"load",n,!0)};function jr(n){return Vo=n,bt=Uo,Ce=new x,Vr(),Ce.init(),Ur(),Ce}function Kr(n,e){e()}var P=jr(Kr);const qo=`<div id="checkoutConfirmationEnd">
990
990
  <div class="w-full">
991
991
  <div id="otp-content" class=" grid gap-4">
992
992
  <h5 class="text-black" id="otp-message">
@@ -1043,11 +1043,11 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1043
1043
 
1044
1044
  </div>
1045
1045
  </div>
1046
- </div>`;class Gr{constructor(e){h(this,"container");h(this,"onAction");h(this,"onSuccess");h(this,"ref");h(this,"token");h(this,"initialTime",300);h(this,"abortController");h(this,"timeLeft");h(this,"timer");h(this,"timerId",null);h(this,"rdtCode");h(this,"url");h(this,"callBackUrl");h(this,"setPaymentResponses");h(this,"step");h(this,"paymentMethod");this.container=e.container,this.timeLeft=this.initialTime,this.onAction=e.onAction,this.ref=e.ref,this.token=e.token,this.rdtCode=e.rdtCode,this.url=e.url,this.onSuccess=e.onSuccess,this.callBackUrl=e.callBackUrl,this.setPaymentResponses=e.setPaymentResponses,this.step=e.step,this.paymentMethod=e.paymentMethod}attachListeners(){this.initialTime=300,this.timeLeft=this.initialTime;const e=3e4;this.abortController=new AbortController,setTimeout(()=>{this.verifyCardPayment(this.token,e,({data:i,headers:t})=>{this.onAction(this.step.success),this.redirectTo(i,t,"success")},()=>{this.onAction(this.step.failed)})},5e3),this.startTimer()}async verifyCardPayment(e,i,t,o){let s=0,a=i,l=!0,d;this.abortController&&(d=this.abortController.signal);const v=async()=>{if(this.timeLeft<=0){l=!1,this.onAction(this.step.end);return}s+=1;try{const p=await an(e,this.ref,d,this.rdtCode,this.url);p.data.status==="failed"&&(l=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),this.setPaymentResponses(p.data,p.headers),P.track("verify_payment",{payment_method:this.paymentMethod,verification_status:"Failed"}),o(p)),p.data.status==="inProgress"&&(l&&(a=i*(s+1),this.timer=setTimeout(v,a)),this.setPaymentResponses(p.data,p.headers)),(p.data.status==="success"||p.data.status==="successful")&&(this.setPaymentResponses(p.data,p.headers),l=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),P.track("verify_payment",{payment_method:this.paymentMethod,verification_status:"Success"}),t(p))}catch{l&&(a=i*(s+1),this.timer=setTimeout(v,a))}};v()}redirectTo(e,i,t){const o=i.get("spf-redirect-url");this.callBackUrl=o||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status",e.status),s.searchParams.append("reference",e.reference),window.location.href=s.toString()},1800):t==="success"&&this.onSuccess(e)}startTimer(){const e=this.container.querySelector("#ctd-timer");this.stopTimer(),this.timerId=window.setInterval(()=>{this.timeLeft>0?(this.timeLeft-=1,e&&(e.innerHTML=zn(this.timeLeft),this.startTimer())):(this.stopTimer(),this.onAction(this.step.end))},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}renderComponent(){this.container.innerHTML=this.render(),this.attachListeners()}render(){return Fr}}class zr{constructor({amount:e,totalAmount:i,container:t,email:o,encryption:s,planId:a,token:l,currency:d,rdtCode:v,url:p,reference:g,onSuccess:f,callBackUrl:y,metadata:k,localCurrency:C,hidePaymentMethods:S,showPaymentMethods:M,onClose:A,restartTransactionProcess:_,retryingPayment:T}){h(this,"contents");h(this,"cardDetailForm");h(this,"cardOtpValidationForm");h(this,"merchantPlanDetail",{});h(this,"cardPinForm");h(this,"avsForm");h(this,"successScreen");h(this,"pageLoader");h(this,"warningScreen");h(this,"transactionIssuesScreen");h(this,"container");h(this,"onSuccess");h(this,"planId","");h(this,"email");h(this,"token");h(this,"amount");h(this,"totalAmount");h(this,"encryption");h(this,"currency");h(this,"_currentStep");h(this,"activeRef");h(this,"rdtCode");h(this,"url");h(this,"reference");h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"hidePaymentMethods");h(this,"showPaymentMethods");h(this,"onClose");h(this,"cardResponse");h(this,"cardResponseHeader");h(this,"confirmationEnd");h(this,"confirmationProgress");h(this,"restartTransactionProcess");h(this,"retryingPayment");h(this,"isMaxRetriesReached");h(this,"isMobile",!1);this.currency=d,this.onSuccess=f||(()=>null),this.container=t,this.encryption=s,this.token=l,this.email=o,this.planId=a,this.amount=e,this.totalAmount=i,this.rdtCode=v,this.url=p,this.reference=g,this.callBackUrl=y,this.metadata=k,this.localCurrency=C,this._currentStep=1,this.activeRef="",this.contents=this.container.querySelector("#payment-content-view"),this.cardResponse={},this.cardResponseHeader={},this.hidePaymentMethods=S,this.showPaymentMethods=M,this.onClose=A,this.restartTransactionProcess=_,this.retryingPayment=T,this.isMaxRetriesReached=!1,this.renderCardContent(),P.track("card_opens",{payment_method:"Card"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderCardContent()}async submitCardDetails(e,i){e.preventDefault(),P.track("input_cardDetails",{payment_method:"Card",authentication_type:"PIN"});const t=this.container.querySelector(".spinner"),o=this.container.querySelector("#details-form-button-text"),s=await js(JSON.stringify(i),this.encryption);t&&o&&(t.classList.remove("hidden"),o.classList.add("hidden")),(()=>{var l;if(this.retryingPayment){const d={channel:"card",reference:this.reference,encryptedCard:s};return ci(this.token,d,this.rdtCode,this.url)}else{const d={amount:this.amount,channel:"card",currency:this.currency||"USD",planId:this.planId,customer:{email:this.email},reference:this.reference,encryptedCard:s,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((l=this.merchantPlanDetail)==null?void 0:l.taxQuoteId)&&{taxQuoteId:this.merchantPlanDetail.taxQuoteId}};return As(this.token,d,this.rdtCode,this.url)}})().then(({data:l,headers:d})=>{var v,p,g,f,y,k,C,S;if(l.status==="failed")this.currentStep=4,this.reference=l.reference,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN"}),this.cardResponse=l,this.cardResponseHeader=d,l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(!["success","successful"].includes(l.status)&&l.status!=="failed")if(this.cardResponse=l,this.cardResponseHeader=d,l!=null&&l.authorization){if(this.activeRef=l.reference,((v=l==null?void 0:l.authorization)==null?void 0:v.mode)==="pin"){this.currentStep=2;return}if(((p=l==null?void 0:l.authorization)==null?void 0:p.mode)==="3DS"){(g=l==null?void 0:l.authorization)!=null&&g.redirectUrl&&this.redirectTo3DS((f=l==null?void 0:l.authorization)==null?void 0:f.redirectUrl),(y=l==null?void 0:l.authorization)!=null&&y.embeddedHtml&&this.redirectToPreciumDoc((k=l==null?void 0:l.authorization)==null?void 0:k.embeddedHtml);return}if(((C=l==null?void 0:l.authorization)==null?void 0:C.mode)==="otp"){this.cardResponse=l,this.currentStep=3;return}if(((S=l==null?void 0:l.authorization)==null?void 0:S.mode)==="avs"){this.currentStep=7;return}}else this.currentStep=4,l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Error with Payment"),this.warningScreen.hideReportIssue();else["success","successful"].includes(l.status)&&(this.currentStep=5,this.cardResponse=l,this.cardResponseHeader=d,P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN"}),this.redirectTo(l,d,"success"))}).catch(l=>{P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"PIN"}),l.code==="payment_max_retry_attempts"?(this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=4,this.warningScreen.setPaymentError("Maximum retries","You have reached the maximum number of retries allowed. Go back to merchant website to start the payment process again.","Go back to Merchant")):(this.currentStep=4,l.message?this.warningScreen.setPaymentError(l.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue())}).finally(()=>{t&&o&&(t.classList.add("hidden"),o.classList.remove("hidden"))})}handlePinRequest(e){if(e.length===4){const i={authorization:{pin:e},reference:this.activeRef};P.track("input_cardPin",{payment_method:"Card",authentication_type:"PIN"}),setTimeout(()=>{const t=this.container.querySelector("#pin-loader"),o=this.container.querySelector("#cancel-payment");t&&(t.innerHTML=`<svg class="animate-spin" width="40" height="40" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
1046
+ </div>`;class Gr{constructor(e){h(this,"container");h(this,"onAction");h(this,"onSuccess");h(this,"ref");h(this,"token");h(this,"initialTime",300);h(this,"abortController");h(this,"timeLeft");h(this,"timer");h(this,"timerId",null);h(this,"rdtCode");h(this,"url");h(this,"callBackUrl");h(this,"setPaymentResponses");h(this,"step");h(this,"paymentMethod");this.container=e.container,this.timeLeft=this.initialTime,this.onAction=e.onAction,this.ref=e.ref,this.token=e.token,this.rdtCode=e.rdtCode,this.url=e.url,this.onSuccess=e.onSuccess,this.callBackUrl=e.callBackUrl,this.setPaymentResponses=e.setPaymentResponses,this.step=e.step,this.paymentMethod=e.paymentMethod}attachListeners(){this.initialTime=300,this.timeLeft=this.initialTime;const e=3e4;this.abortController=new AbortController,setTimeout(()=>{this.verifyCardPayment(this.token,e,({data:i,headers:t})=>{this.onAction(this.step.success),this.redirectTo(i,t,"success")},()=>{this.onAction(this.step.failed)})},5e3),this.startTimer()}async verifyCardPayment(e,i,t,o){let s=0,a=i,l=!0,d;this.abortController&&(d=this.abortController.signal);const v=async()=>{if(this.timeLeft<=0){l=!1,this.onAction(this.step.end);return}s+=1;try{const p=await an(e,this.ref,d,this.rdtCode,this.url);p.data.status==="failed"&&(l=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),this.setPaymentResponses(p.data,p.headers),P.track("verify_payment",{payment_method:this.paymentMethod,verification_status:"Failed"}),o(p)),p.data.status==="inProgress"&&(l&&(a=i*(s+1),this.timer=setTimeout(v,a)),this.setPaymentResponses(p.data,p.headers)),(p.data.status==="success"||p.data.status==="successful")&&(this.setPaymentResponses(p.data,p.headers),l=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),P.track("verify_payment",{payment_method:this.paymentMethod,verification_status:"Success"}),t(p))}catch{l&&(a=i*(s+1),this.timer=setTimeout(v,a))}};v()}redirectTo(e,i,t){const o=i.get("spf-redirect-url");this.callBackUrl=o||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status",e.status),s.searchParams.append("reference",e.reference),window.location.href=s.toString()},1800):t==="success"&&this.onSuccess(e)}startTimer(){const e=this.container.querySelector("#ctd-timer");this.stopTimer(),this.timerId=window.setInterval(()=>{this.timeLeft>0?(this.timeLeft-=1,e&&(e.innerHTML=zn(this.timeLeft),this.startTimer())):(this.stopTimer(),this.onAction(this.step.end))},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}renderComponent(){this.container.innerHTML=this.render(),this.attachListeners()}render(){return Fr}}class zr{constructor({amount:e,totalAmount:i,container:t,customer:o,encryption:s,planId:a,token:l,currency:d,rdtCode:v,url:p,reference:g,onSuccess:f,callBackUrl:y,metadata:k,localCurrency:C,hidePaymentMethods:S,showPaymentMethods:M,onClose:A,restartTransactionProcess:_,retryingPayment:T}){h(this,"contents");h(this,"cardDetailForm");h(this,"cardOtpValidationForm");h(this,"merchantPlanDetail",{});h(this,"cardPinForm");h(this,"avsForm");h(this,"successScreen");h(this,"pageLoader");h(this,"warningScreen");h(this,"transactionIssuesScreen");h(this,"container");h(this,"onSuccess");h(this,"planId","");h(this,"customer");h(this,"token");h(this,"amount");h(this,"totalAmount");h(this,"encryption");h(this,"currency");h(this,"_currentStep");h(this,"activeRef");h(this,"rdtCode");h(this,"url");h(this,"reference");h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"hidePaymentMethods");h(this,"showPaymentMethods");h(this,"onClose");h(this,"cardResponse");h(this,"cardResponseHeader");h(this,"confirmationEnd");h(this,"confirmationProgress");h(this,"restartTransactionProcess");h(this,"retryingPayment");h(this,"isMaxRetriesReached");h(this,"isMobile",!1);this.currency=d,this.onSuccess=f||(()=>null),this.container=t,this.encryption=s,this.token=l,this.customer=o,this.planId=a,this.amount=e,this.totalAmount=i,this.rdtCode=v,this.url=p,this.reference=g,this.callBackUrl=y,this.metadata=k,this.localCurrency=C,this._currentStep=1,this.activeRef="",this.contents=this.container.querySelector("#payment-content-view"),this.cardResponse={},this.cardResponseHeader={},this.hidePaymentMethods=S,this.showPaymentMethods=M,this.onClose=A,this.restartTransactionProcess=_,this.retryingPayment=T,this.isMaxRetriesReached=!1,this.renderCardContent(),P.track("card_opens",{payment_method:"Card"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderCardContent()}async submitCardDetails(e,i){e.preventDefault(),P.track("input_cardDetails",{payment_method:"Card",authentication_type:"PIN"});const t=this.container.querySelector(".spinner"),o=this.container.querySelector("#details-form-button-text"),s=await js(JSON.stringify(i),this.encryption);t&&o&&(t.classList.remove("hidden"),o.classList.add("hidden")),(()=>{var l;if(this.retryingPayment){const d={channel:"card",reference:this.reference,encryptedCard:s};return ci(this.token,d,this.rdtCode,this.url)}else{const d={amount:this.amount,channel:"card",currency:this.currency||"USD",planId:this.planId,customer:this.customer,reference:this.reference,encryptedCard:s,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((l=this.merchantPlanDetail)==null?void 0:l.taxQuoteId)&&{taxQuoteId:this.merchantPlanDetail.taxQuoteId}};return As(this.token,d,this.rdtCode,this.url)}})().then(({data:l,headers:d})=>{var v,p,g,f,y,k,C,S;if(l.status==="failed")this.currentStep=4,this.reference=l.reference,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN"}),this.cardResponse=l,this.cardResponseHeader=d,l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(!["success","successful"].includes(l.status)&&l.status!=="failed")if(this.cardResponse=l,this.cardResponseHeader=d,l!=null&&l.authorization){if(this.activeRef=l.reference,((v=l==null?void 0:l.authorization)==null?void 0:v.mode)==="pin"){this.currentStep=2;return}if(((p=l==null?void 0:l.authorization)==null?void 0:p.mode)==="3DS"){(g=l==null?void 0:l.authorization)!=null&&g.redirectUrl&&this.redirectTo3DS((f=l==null?void 0:l.authorization)==null?void 0:f.redirectUrl),(y=l==null?void 0:l.authorization)!=null&&y.embeddedHtml&&this.redirectToPreciumDoc((k=l==null?void 0:l.authorization)==null?void 0:k.embeddedHtml);return}if(((C=l==null?void 0:l.authorization)==null?void 0:C.mode)==="otp"){this.cardResponse=l,this.currentStep=3;return}if(((S=l==null?void 0:l.authorization)==null?void 0:S.mode)==="avs"){this.currentStep=7;return}}else this.currentStep=4,l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Error with Payment"),this.warningScreen.hideReportIssue();else["success","successful"].includes(l.status)&&(this.currentStep=5,this.cardResponse=l,this.cardResponseHeader=d,P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN"}),this.redirectTo(l,d,"success"))}).catch(l=>{P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"PIN"}),l.code==="payment_max_retry_attempts"?(this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=4,this.warningScreen.setPaymentError("Maximum retries","You have reached the maximum number of retries allowed. Go back to merchant website to start the payment process again.","Go back to Merchant")):(this.currentStep=4,l.message?this.warningScreen.setPaymentError(l.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue())}).finally(()=>{t&&o&&(t.classList.add("hidden"),o.classList.remove("hidden"))})}handlePinRequest(e){if(e.length===4){const i={authorization:{pin:e},reference:this.activeRef};P.track("input_cardPin",{payment_method:"Card",authentication_type:"PIN"}),setTimeout(()=>{const t=this.container.querySelector("#pin-loader"),o=this.container.querySelector("#cancel-payment");t&&(t.innerHTML=`<svg class="animate-spin" width="40" height="40" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
1047
1047
  <path
1048
1048
  d="M62 32C62 38.6156 59.8132 45.0457 55.78 50.2897C51.7468 55.5336 46.0932 59.2974 39.6992 60.9952C33.3052 62.693 26.5293 62.2297 20.4258 59.6774C14.3224 57.1251 9.2338 52.6268 5.95186 46.8827C2.66993 41.1385 1.37873 34.4707 2.2792 27.9166C3.17967 21.3626 6.22129 15.29 10.9308 10.6438C15.6402 5.9976 21.7534 3.0384 28.3191 2.22668C34.8847 1.41496 41.5345 2.79623 47.2337 6.15557"
1049
1049
  stroke="black" stroke-width="4" stroke-linejoin="round" />
1050
- </svg>`),o&&o.classList.add("hidden"),di(this.token,i,this.rdtCode,this.url).then(({data:a,headers:l})=>{var d,v,p,g,f,y,k;if(a.status==="failed")P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN"}),this.currentStep=4,a.providerMessage?this.warningScreen.setPaymentError(a.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(["success","successful","failed"].includes(a.status))this.currentStep=5,this.redirectTo(a,l,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN"});else{if(((d=a==null?void 0:a.authorization)==null?void 0:d.mode)==="3DS"){(v=a==null?void 0:a.authorization)!=null&&v.redirectUrl&&this.redirectTo3DS((p=a==null?void 0:a.authorization)==null?void 0:p.redirectUrl),(g=a==null?void 0:a.authorization)!=null&&g.embeddedHtml&&this.redirectToPreciumDoc((f=a==null?void 0:a.authorization)==null?void 0:f.embeddedHtml);return}if(((y=a==null?void 0:a.authorization)==null?void 0:y.mode)==="otp"){this.cardResponse=a,this.currentStep=3;return}if(((k=a==null?void 0:a.authorization)==null?void 0:k.mode)==="avs"){this.currentStep=7;return}this.currentStep=10}}).catch(a=>{P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"PIN"}),this.currentStep=4,a.message?this.warningScreen.setPaymentError(a.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()})},300)}}showLoader(){this.pageLoader=new De(this.contents),this.pageLoader.mountLoader()}pinErrorStates(e,i,t){const o=this.container.querySelector("#pin-error");o&&(o.innerHTML=e||"Payment Failed"),t&&t.classList.remove("hidden"),i&&(i.innerHTML="")}setPaymentError(e){const i=this.container.querySelector("#payment-warning-text"),t=this.container.querySelector(".warning-list");i&&(i.textContent=e),t&&[{text:"Try again with your card",action:"go-to-card"},{text:"Try again with transfer",action:"go-to-transfer"}].forEach(({action:s,text:a})=>{const l=document.createElement("button");l.textContent=a,l.setAttribute("id",s),l.classList.add("warning-button");const d=document.createElement("div");d.appendChild(l),t.appendChild(d)})}validatedAVS(e,i){e.stopPropagation(),e.preventDefault();const t=this.container.querySelector(".spinner"),o=this.container.querySelector("#avs-form-button-text"),s={authorization:{avs:{state:i==null?void 0:i.state,city:i==null?void 0:i.city,country:i==null?void 0:i.country,address:i==null?void 0:i.address,zipCode:(i==null?void 0:i.code)||"-"}},reference:this.activeRef};P.track("input_address",{payment_method:"Card",authentication_type:"AVS"}),t&&o&&(t.classList.remove("hidden"),o.classList.add("hidden")),di(this.token,s,this.rdtCode,this.url).then(({data:l,headers:d})=>{var v,p,g,f,y,k,C;if(l.status==="failed")this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"AVS"}),l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(["success","successful","failed"].includes(l.status))["success","successful"].includes(l.status)&&(this.currentStep=5,this.redirectTo(l,d,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"AVS"}));else{if(((v=l==null?void 0:l.authorization)==null?void 0:v.mode)==="pin"){this.currentStep=2;return}if(((p=l==null?void 0:l.authorization)==null?void 0:p.mode)==="3DS"){(g=l==null?void 0:l.authorization)!=null&&g.redirectUrl&&this.redirectTo3DS((f=l==null?void 0:l.authorization)==null?void 0:f.redirectUrl),(y=l==null?void 0:l.authorization)!=null&&y.embeddedHtml&&this.redirectToPreciumDoc((k=l==null?void 0:l.authorization)==null?void 0:k.embeddedHtml);return}if(((C=l==null?void 0:l.authorization)==null?void 0:C.mode)==="otp"){this.cardResponse=l,this.currentStep=3;return}this.currentStep=10}}).catch(l=>{this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"AVS"}),l.message?this.warningScreen.setPaymentError(l.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()}).finally(()=>{t&&o&&(t.classList.add("hidden"),o.classList.remove("hidden"))})}submitOtp(e,i){e.preventDefault();const t={authorization:{otp:i},reference:this.activeRef};this.currentStep=6,this.showLoader(),P.track("input_cardOTP",{payment_method:"Card",authentication_type:"PIN+0TP"}),di(this.token,t,this.rdtCode,this.url).then(({data:s,headers:a})=>{var l,d,v,p,g,f,y;if(s.status==="failed")this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN+0TP"}),s.providerMessage?this.warningScreen.setPaymentError(s.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(["success","successful","failed"].includes(s.status))["success","successful"].includes(s.status)&&(this.currentStep=5,this.redirectTo(s,a,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN+0TP"}));else{if(this.activeRef=s.reference,((l=s==null?void 0:s.authorization)==null?void 0:l.mode)==="pin"){this.currentStep=2;return}if(((d=s==null?void 0:s.authorization)==null?void 0:d.mode)==="3DS"){(v=s==null?void 0:s.authorization)!=null&&v.redirectUrl&&this.redirectTo3DS((p=s==null?void 0:s.authorization)==null?void 0:p.redirectUrl),(g=s==null?void 0:s.authorization)!=null&&g.embeddedHtml&&this.redirectToPreciumDoc((f=s==null?void 0:s.authorization)==null?void 0:f.embeddedHtml);return}if(((y=s==null?void 0:s.authorization)==null?void 0:y.mode)==="avs"){this.currentStep=7;return}this.currentStep=10}}).catch(s=>{this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN+0TP"}),s.message?this.warningScreen.setPaymentError(s.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()})}redirectTo3DS(e){const i=window.open("","_blank");if(!i){alert("Please enable popups for this site to complete the authentication.");return}i.location.href=e,P.track("auth_redirect",{payment_method:"Card",authentication_type:"3DS"}),this.currentStep=6,this.showLoader();const t=setInterval(()=>{i.closed&&(clearInterval(t),this.verifyPayment(({data:o,headers:s})=>{this.currentStep=5,P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"3DS"}),this.redirectTo(o,s,"success")},({data:o})=>{this.currentStep=4,o.providerMessage?this.warningScreen.setPaymentError(o.providerMessage):this.warningScreen.setPaymentError("Payment transaction failed"),this.warningScreen.hideReportIssue(),P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"3DS"})}))},2e3)}redirectToPreciumDoc(e){const i=atob(e),t=new Blob([i],{type:"text/html"}),o=URL.createObjectURL(t),s=window.open(o,"_blank");if(s){s.document.close(),P.track("auth_redirect",{payment_method:"Card",authentication_type:"3DS"}),this.currentStep=6,this.showLoader();const a=setInterval(()=>{s.closed&&(clearInterval(a),this.verifyPayment(({data:l,headers:d})=>{this.currentStep=5,P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"3DS"}),this.redirectTo(l,d,"success")},({data:l})=>{this.currentStep=4,l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Payment transaction failed"),this.warningScreen.hideReportIssue(),P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"3DS"})}))},2e3)}else alert("Please enable popups for this site to complete the authentication.")}async verifyPayment(e,i){try{const t=await an(this.token,this.activeRef,void 0,this.rdtCode,this.url);t.data.status==="failed"?i(t):(["success","successful"].includes(t.data.status)&&e(t),t.data.status==="inProgress"&&(this.currentStep=10))}catch{this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"3DS"}),this.warningScreen.setPaymentError("Payment transaction failed"),this.warningScreen.hideReportIssue()}}async verifyPaymentProcess(){try{const e=await an(this.token,this.reference,void 0,this.rdtCode,this.url);this.cardResponse=e.data,this.cardResponseHeader=e.headers}catch{this.currentStep=4}}goBackToMerchant(){this.redirectTo(this.cardResponse,this.cardResponseHeader,this.callBackUrl)}renderCardContent(e){var t,o;e&&(this.merchantPlanDetail=e);const i=document.getElementById("go-back");if(this.currentStep!==1?(this.hidePaymentMethods(),i==null||i.classList.add("hidden")):this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.contents){switch(this.currentStep){case 1:this.cardDetailForm=new Ht({container:this.contents,onAction:a=>l=>this.submitCardDetails.bind(this)(a,l),merchantName:this.merchantPlanDetail.merchantName,currency:this.localCurrency!==this.currency?this.localCurrency:this.currency}),this.cardDetailForm.renderContent();break;case 2:this.cardPinForm=new qs({container:this.contents,onClose:this.onClose,onAction:a=>this.handlePinRequest.bind(this)(a)}),this.cardPinForm.renderComponent();break;case 3:this.cardOtpValidationForm=new Gs({container:this.contents,onClose:this.onClose,onAction:a=>l=>this.submitOtp.bind(this)(a,l),otpMessage:((t=this.cardResponse)==null?void 0:t.providerMessage)||"Please enter your OTP sent to your phone"}),this.cardOtpValidationForm.renderComponent();break;case 4:this.warningScreen=new gn({container:this.contents,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this),onReportIssue:()=>this.currentStep=8}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 5:this.successScreen=new qn({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(o=this.merchantPlanDetail)==null?void 0:o.rate.rate}),this.successScreen.renderComponent();break;case 6:this.pageLoader=new De(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 7:this.avsForm=new Js({container:this.contents,onAction:a=>l=>this.validatedAVS.bind(this)(a,l)}),this.avsForm.renderComponent();break;case 8:this.transactionIssuesScreen=new mi({container:this.contents,onAction:()=>{var a;this.currentStep=4,this.warningScreen.setPaymentError(((a=this.cardResponse)==null?void 0:a.providerMessage)||"Payment failed")},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"card",callBackUrl:this.callBackUrl,paymentResponse:this.cardResponse,paymentResponseHeaders:this.cardResponseHeader}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break;case 9:this.confirmationEnd=new Wo({container:this.contents,onAction:a=>{this.currentStep=a},ref:this.reference,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.cardResponse,paymentResponseHeaders:this.cardResponseHeader}),this.confirmationEnd.renderComponent();break;case 10:this.confirmationProgress=new Gr({container:this.contents,onAction:a=>{this.currentStep=a},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(a,l)=>{this.cardResponse=a,this.cardResponseHeader=l},step:{failed:4,success:5,end:9},paymentMethod:"Card"}),this.confirmationProgress.renderComponent();break;default:this.cardDetailForm=new Ht({container:this.contents,onAction:a=>l=>this.submitCardDetails.bind(this)(a,l),merchantName:this.merchantPlanDetail.merchantName,currency:this.localCurrency?this.localCurrency:this.currency}),this.cardDetailForm.renderContent();break}this.displayButtonText();const s=this.container.querySelector("#card-currency");s&&(s.textContent=`${this.localCurrency?this.localCurrency:this.currency} Card`)}}redirectTo(e,i,t){const o=i.get("spf-redirect-url");this.callBackUrl=o||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status",e.status),s.searchParams.append("reference",e.reference),window.location.href=s.toString()},1800):t==="success"&&this.onSuccess(e)}displayButtonText(e){var t,o,s,a;const i=this.container.querySelector("#details-form-button-text");if(i){const l=this.currency,d=l==="USD"?(o=(t=this.merchantPlanDetail)==null?void 0:t.rate)==null?void 0:o.from:l;e?i.textContent=e:i.textContent=`Continue to pay ${d} ${xe(this.totalAmount!==this.amount?this.totalAmount:(this.amount||0)*(l==="USD"?(a=(s=this.merchantPlanDetail)==null?void 0:s.rate)==null?void 0:a.rate:1),2)}`}}}const qr=`<div>
1050
+ </svg>`),o&&o.classList.add("hidden"),di(this.token,i,this.rdtCode,this.url).then(({data:a,headers:l})=>{var d,v,p,g,f,y,k;if(a.status==="failed")P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN"}),this.currentStep=4,a.providerMessage?this.warningScreen.setPaymentError(a.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(["success","successful","failed"].includes(a.status))this.currentStep=5,this.redirectTo(a,l,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN"});else{if(((d=a==null?void 0:a.authorization)==null?void 0:d.mode)==="3DS"){(v=a==null?void 0:a.authorization)!=null&&v.redirectUrl&&this.redirectTo3DS((p=a==null?void 0:a.authorization)==null?void 0:p.redirectUrl),(g=a==null?void 0:a.authorization)!=null&&g.embeddedHtml&&this.redirectToPreciumDoc((f=a==null?void 0:a.authorization)==null?void 0:f.embeddedHtml);return}if(((y=a==null?void 0:a.authorization)==null?void 0:y.mode)==="otp"){this.cardResponse=a,this.currentStep=3;return}if(((k=a==null?void 0:a.authorization)==null?void 0:k.mode)==="avs"){this.currentStep=7;return}this.currentStep=10}}).catch(a=>{P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"PIN"}),this.currentStep=4,a.message?this.warningScreen.setPaymentError(a.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()})},300)}}showLoader(){this.pageLoader=new Ne(this.contents),this.pageLoader.mountLoader()}pinErrorStates(e,i,t){const o=this.container.querySelector("#pin-error");o&&(o.innerHTML=e||"Payment Failed"),t&&t.classList.remove("hidden"),i&&(i.innerHTML="")}setPaymentError(e){const i=this.container.querySelector("#payment-warning-text"),t=this.container.querySelector(".warning-list");i&&(i.textContent=e),t&&[{text:"Try again with your card",action:"go-to-card"},{text:"Try again with transfer",action:"go-to-transfer"}].forEach(({action:s,text:a})=>{const l=document.createElement("button");l.textContent=a,l.setAttribute("id",s),l.classList.add("warning-button");const d=document.createElement("div");d.appendChild(l),t.appendChild(d)})}validatedAVS(e,i){e.stopPropagation(),e.preventDefault();const t=this.container.querySelector(".spinner"),o=this.container.querySelector("#avs-form-button-text"),s={authorization:{avs:{state:i==null?void 0:i.state,city:i==null?void 0:i.city,country:i==null?void 0:i.country,address:i==null?void 0:i.address,zipCode:(i==null?void 0:i.code)||"-"}},reference:this.activeRef};P.track("input_address",{payment_method:"Card",authentication_type:"AVS"}),t&&o&&(t.classList.remove("hidden"),o.classList.add("hidden")),di(this.token,s,this.rdtCode,this.url).then(({data:l,headers:d})=>{var v,p,g,f,y,k,C;if(l.status==="failed")this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"AVS"}),l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(["success","successful","failed"].includes(l.status))["success","successful"].includes(l.status)&&(this.currentStep=5,this.redirectTo(l,d,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"AVS"}));else{if(((v=l==null?void 0:l.authorization)==null?void 0:v.mode)==="pin"){this.currentStep=2;return}if(((p=l==null?void 0:l.authorization)==null?void 0:p.mode)==="3DS"){(g=l==null?void 0:l.authorization)!=null&&g.redirectUrl&&this.redirectTo3DS((f=l==null?void 0:l.authorization)==null?void 0:f.redirectUrl),(y=l==null?void 0:l.authorization)!=null&&y.embeddedHtml&&this.redirectToPreciumDoc((k=l==null?void 0:l.authorization)==null?void 0:k.embeddedHtml);return}if(((C=l==null?void 0:l.authorization)==null?void 0:C.mode)==="otp"){this.cardResponse=l,this.currentStep=3;return}this.currentStep=10}}).catch(l=>{this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"AVS"}),l.message?this.warningScreen.setPaymentError(l.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()}).finally(()=>{t&&o&&(t.classList.add("hidden"),o.classList.remove("hidden"))})}submitOtp(e,i){e.preventDefault();const t={authorization:{otp:i},reference:this.activeRef};this.currentStep=6,this.showLoader(),P.track("input_cardOTP",{payment_method:"Card",authentication_type:"PIN+0TP"}),di(this.token,t,this.rdtCode,this.url).then(({data:s,headers:a})=>{var l,d,v,p,g,f,y;if(s.status==="failed")this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN+0TP"}),s.providerMessage?this.warningScreen.setPaymentError(s.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue();else if(["success","successful","failed"].includes(s.status))["success","successful"].includes(s.status)&&(this.currentStep=5,this.redirectTo(s,a,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN+0TP"}));else{if(this.activeRef=s.reference,((l=s==null?void 0:s.authorization)==null?void 0:l.mode)==="pin"){this.currentStep=2;return}if(((d=s==null?void 0:s.authorization)==null?void 0:d.mode)==="3DS"){(v=s==null?void 0:s.authorization)!=null&&v.redirectUrl&&this.redirectTo3DS((p=s==null?void 0:s.authorization)==null?void 0:p.redirectUrl),(g=s==null?void 0:s.authorization)!=null&&g.embeddedHtml&&this.redirectToPreciumDoc((f=s==null?void 0:s.authorization)==null?void 0:f.embeddedHtml);return}if(((y=s==null?void 0:s.authorization)==null?void 0:y.mode)==="avs"){this.currentStep=7;return}this.currentStep=10}}).catch(s=>{this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN+0TP"}),s.message?this.warningScreen.setPaymentError(s.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()})}redirectTo3DS(e){const i=window.open("","_blank");if(!i){alert("Please enable popups for this site to complete the authentication.");return}i.location.href=e,P.track("auth_redirect",{payment_method:"Card",authentication_type:"3DS"}),this.currentStep=6,this.showLoader();const t=setInterval(()=>{i.closed&&(clearInterval(t),this.verifyPayment(({data:o,headers:s})=>{this.currentStep=5,P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"3DS"}),this.redirectTo(o,s,"success")},({data:o})=>{this.currentStep=4,o.providerMessage?this.warningScreen.setPaymentError(o.providerMessage):this.warningScreen.setPaymentError("Payment transaction failed"),this.warningScreen.hideReportIssue(),P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"3DS"})}))},2e3)}redirectToPreciumDoc(e){const i=atob(e),t=new Blob([i],{type:"text/html"}),o=URL.createObjectURL(t),s=window.open(o,"_blank");if(s){s.document.close(),P.track("auth_redirect",{payment_method:"Card",authentication_type:"3DS"}),this.currentStep=6,this.showLoader();const a=setInterval(()=>{s.closed&&(clearInterval(a),this.verifyPayment(({data:l,headers:d})=>{this.currentStep=5,P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"3DS"}),this.redirectTo(l,d,"success")},({data:l})=>{this.currentStep=4,l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Payment transaction failed"),this.warningScreen.hideReportIssue(),P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"3DS"})}))},2e3)}else alert("Please enable popups for this site to complete the authentication.")}async verifyPayment(e,i){try{const t=await an(this.token,this.activeRef,void 0,this.rdtCode,this.url);t.data.status==="failed"?i(t):(["success","successful"].includes(t.data.status)&&e(t),t.data.status==="inProgress"&&(this.currentStep=10))}catch{this.currentStep=4,P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"3DS"}),this.warningScreen.setPaymentError("Payment transaction failed"),this.warningScreen.hideReportIssue()}}async verifyPaymentProcess(){try{const e=await an(this.token,this.reference,void 0,this.rdtCode,this.url);this.cardResponse=e.data,this.cardResponseHeader=e.headers}catch{this.currentStep=4}}goBackToMerchant(){this.redirectTo(this.cardResponse,this.cardResponseHeader,this.callBackUrl)}renderCardContent(e){var t,o;e&&(this.merchantPlanDetail=e);const i=document.getElementById("go-back");if(this.currentStep!==1?(this.hidePaymentMethods(),i==null||i.classList.add("hidden")):this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.contents){switch(this.currentStep){case 1:this.cardDetailForm=new Ht({container:this.contents,onAction:a=>l=>this.submitCardDetails.bind(this)(a,l),merchantName:this.merchantPlanDetail.merchantName,currency:this.localCurrency!==this.currency?this.localCurrency:this.currency}),this.cardDetailForm.renderContent();break;case 2:this.cardPinForm=new qs({container:this.contents,onClose:this.onClose,onAction:a=>this.handlePinRequest.bind(this)(a)}),this.cardPinForm.renderComponent();break;case 3:this.cardOtpValidationForm=new Gs({container:this.contents,onClose:this.onClose,onAction:a=>l=>this.submitOtp.bind(this)(a,l),otpMessage:((t=this.cardResponse)==null?void 0:t.providerMessage)||"Please enter your OTP sent to your phone"}),this.cardOtpValidationForm.renderComponent();break;case 4:this.warningScreen=new gn({container:this.contents,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this),onReportIssue:()=>this.currentStep=8}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 5:this.successScreen=new qn({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(o=this.merchantPlanDetail)==null?void 0:o.rate.rate}),this.successScreen.renderComponent();break;case 6:this.pageLoader=new Ne(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 7:this.avsForm=new Js({container:this.contents,onAction:a=>l=>this.validatedAVS.bind(this)(a,l)}),this.avsForm.renderComponent();break;case 8:this.transactionIssuesScreen=new mi({container:this.contents,onAction:()=>{var a;this.currentStep=4,this.warningScreen.setPaymentError(((a=this.cardResponse)==null?void 0:a.providerMessage)||"Payment failed")},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"card",callBackUrl:this.callBackUrl,paymentResponse:this.cardResponse,paymentResponseHeaders:this.cardResponseHeader}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break;case 9:this.confirmationEnd=new Wo({container:this.contents,onAction:a=>{this.currentStep=a},ref:this.reference,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.cardResponse,paymentResponseHeaders:this.cardResponseHeader}),this.confirmationEnd.renderComponent();break;case 10:this.confirmationProgress=new Gr({container:this.contents,onAction:a=>{this.currentStep=a},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(a,l)=>{this.cardResponse=a,this.cardResponseHeader=l},step:{failed:4,success:5,end:9},paymentMethod:"Card"}),this.confirmationProgress.renderComponent();break;default:this.cardDetailForm=new Ht({container:this.contents,onAction:a=>l=>this.submitCardDetails.bind(this)(a,l),merchantName:this.merchantPlanDetail.merchantName,currency:this.localCurrency?this.localCurrency:this.currency}),this.cardDetailForm.renderContent();break}this.displayButtonText();const s=this.container.querySelector("#card-currency");s&&(s.textContent=`${this.localCurrency?this.localCurrency:this.currency} Card`)}}redirectTo(e,i,t){const o=i.get("spf-redirect-url");this.callBackUrl=o||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status",e.status),s.searchParams.append("reference",e.reference),window.location.href=s.toString()},1800):t==="success"&&this.onSuccess(e)}displayButtonText(e){var t,o,s,a;const i=this.container.querySelector("#details-form-button-text");if(i){const l=this.currency,d=l==="USD"?(o=(t=this.merchantPlanDetail)==null?void 0:t.rate)==null?void 0:o.from:l;e?i.textContent=e:i.textContent=`Continue to pay ${d} ${xe(this.totalAmount!==this.amount?this.totalAmount:(this.amount||0)*(l==="USD"?(a=(s=this.merchantPlanDetail)==null?void 0:s.rate)==null?void 0:a.rate:1),2)}`}}}const qr=`<div>
1051
1051
  <div class="container-center h-[40vh] hidden" id="loader">
1052
1052
  <img src="" alt="loader gif" />
1053
1053
  </div>
@@ -1144,8 +1144,8 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1144
1144
  *
1145
1145
  * Copyright 2020, Pusher
1146
1146
  * Released under the MIT licence.
1147
- */(function(n,e){(function(t,o){n.exports=o()})(window,function(){return function(i){var t={};function o(s){if(t[s])return t[s].exports;var a=t[s]={i:s,l:!1,exports:{}};return i[s].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=i,o.c=t,o.d=function(s,a,l){o.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:l})},o.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},o.t=function(s,a){if(a&1&&(s=o(s)),a&8||a&4&&typeof s=="object"&&s&&s.__esModule)return s;var l=Object.create(null);if(o.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:s}),a&2&&typeof s!="string")for(var d in s)o.d(l,d,(function(v){return s[v]}).bind(null,d));return l},o.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(a,"a",a),a},o.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},o.p="",o(o.s=2)}([function(i,t,o){var s=this&&this.__extends||function(){var C=function(S,M){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,_){A.__proto__=_}||function(A,_){for(var T in _)_.hasOwnProperty(T)&&(A[T]=_[T])},C(S,M)};return function(S,M){C(S,M);function A(){this.constructor=S}S.prototype=M===null?Object.create(M):(A.prototype=M.prototype,new A)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=256,l=function(){function C(S){S===void 0&&(S="="),this._paddingCharacter=S}return C.prototype.encodedLength=function(S){return this._paddingCharacter?(S+2)/3*4|0:(S*8+5)/6|0},C.prototype.encode=function(S){for(var M="",A=0;A<S.length-2;A+=3){var _=S[A]<<16|S[A+1]<<8|S[A+2];M+=this._encodeByte(_>>>3*6&63),M+=this._encodeByte(_>>>2*6&63),M+=this._encodeByte(_>>>1*6&63),M+=this._encodeByte(_>>>0*6&63)}var T=S.length-A;if(T>0){var _=S[A]<<16|(T===2?S[A+1]<<8:0);M+=this._encodeByte(_>>>3*6&63),M+=this._encodeByte(_>>>2*6&63),T===2?M+=this._encodeByte(_>>>1*6&63):M+=this._paddingCharacter||"",M+=this._paddingCharacter||""}return M},C.prototype.maxDecodedLength=function(S){return this._paddingCharacter?S/4*3|0:(S*6+7)/8|0},C.prototype.decodedLength=function(S){return this.maxDecodedLength(S.length-this._getPaddingLength(S))},C.prototype.decode=function(S){if(S.length===0)return new Uint8Array(0);for(var M=this._getPaddingLength(S),A=S.length-M,_=new Uint8Array(this.maxDecodedLength(A)),T=0,I=0,K=0,G=0,V=0,F=0,oe=0;I<A-4;I+=4)G=this._decodeChar(S.charCodeAt(I+0)),V=this._decodeChar(S.charCodeAt(I+1)),F=this._decodeChar(S.charCodeAt(I+2)),oe=this._decodeChar(S.charCodeAt(I+3)),_[T++]=G<<2|V>>>4,_[T++]=V<<4|F>>>2,_[T++]=F<<6|oe,K|=G&a,K|=V&a,K|=F&a,K|=oe&a;if(I<A-1&&(G=this._decodeChar(S.charCodeAt(I)),V=this._decodeChar(S.charCodeAt(I+1)),_[T++]=G<<2|V>>>4,K|=G&a,K|=V&a),I<A-2&&(F=this._decodeChar(S.charCodeAt(I+2)),_[T++]=V<<4|F>>>2,K|=F&a),I<A-3&&(oe=this._decodeChar(S.charCodeAt(I+3)),_[T++]=F<<6|oe,K|=oe&a),K!==0)throw new Error("Base64Coder: incorrect characters for decoding");return _},C.prototype._encodeByte=function(S){var M=S;return M+=65,M+=25-S>>>8&6,M+=51-S>>>8&-75,M+=61-S>>>8&-15,M+=62-S>>>8&3,String.fromCharCode(M)},C.prototype._decodeChar=function(S){var M=a;return M+=(42-S&S-44)>>>8&-a+S-43+62,M+=(46-S&S-48)>>>8&-a+S-47+63,M+=(47-S&S-58)>>>8&-a+S-48+52,M+=(64-S&S-91)>>>8&-a+S-65+0,M+=(96-S&S-123)>>>8&-a+S-97+26,M},C.prototype._getPaddingLength=function(S){var M=0;if(this._paddingCharacter){for(var A=S.length-1;A>=0&&S[A]===this._paddingCharacter;A--)M++;if(S.length<4||M>2)throw new Error("Base64Coder: incorrect padding")}return M},C}();t.Coder=l;var d=new l;function v(C){return d.encode(C)}t.encode=v;function p(C){return d.decode(C)}t.decode=p;var g=function(C){s(S,C);function S(){return C!==null&&C.apply(this,arguments)||this}return S.prototype._encodeByte=function(M){var A=M;return A+=65,A+=25-M>>>8&6,A+=51-M>>>8&-75,A+=61-M>>>8&-13,A+=62-M>>>8&49,String.fromCharCode(A)},S.prototype._decodeChar=function(M){var A=a;return A+=(44-M&M-46)>>>8&-a+M-45+62,A+=(94-M&M-96)>>>8&-a+M-95+63,A+=(47-M&M-58)>>>8&-a+M-48+52,A+=(64-M&M-91)>>>8&-a+M-65+0,A+=(96-M&M-123)>>>8&-a+M-97+26,A},S}(l);t.URLSafeCoder=g;var f=new g;function y(C){return f.encode(C)}t.encodeURLSafe=y;function k(C){return f.decode(C)}t.decodeURLSafe=k,t.encodedLength=function(C){return d.encodedLength(C)},t.maxDecodedLength=function(C){return d.maxDecodedLength(C)},t.decodedLength=function(C){return d.decodedLength(C)}},function(i,t,o){Object.defineProperty(t,"__esModule",{value:!0});var s="utf8: invalid string",a="utf8: invalid source encoding";function l(p){for(var g=new Uint8Array(d(p)),f=0,y=0;y<p.length;y++){var k=p.charCodeAt(y);k<128?g[f++]=k:k<2048?(g[f++]=192|k>>6,g[f++]=128|k&63):k<55296?(g[f++]=224|k>>12,g[f++]=128|k>>6&63,g[f++]=128|k&63):(y++,k=(k&1023)<<10,k|=p.charCodeAt(y)&1023,k+=65536,g[f++]=240|k>>18,g[f++]=128|k>>12&63,g[f++]=128|k>>6&63,g[f++]=128|k&63)}return g}t.encode=l;function d(p){for(var g=0,f=0;f<p.length;f++){var y=p.charCodeAt(f);if(y<128)g+=1;else if(y<2048)g+=2;else if(y<55296)g+=3;else if(y<=57343){if(f>=p.length-1)throw new Error(s);f++,g+=4}else throw new Error(s)}return g}t.encodedLength=d;function v(p){for(var g=[],f=0;f<p.length;f++){var y=p[f];if(y&128){var k=void 0;if(y<224){if(f>=p.length)throw new Error(a);var C=p[++f];if((C&192)!==128)throw new Error(a);y=(y&31)<<6|C&63,k=128}else if(y<240){if(f>=p.length-1)throw new Error(a);var C=p[++f],S=p[++f];if((C&192)!==128||(S&192)!==128)throw new Error(a);y=(y&15)<<12|(C&63)<<6|S&63,k=2048}else if(y<248){if(f>=p.length-2)throw new Error(a);var C=p[++f],S=p[++f],M=p[++f];if((C&192)!==128||(S&192)!==128||(M&192)!==128)throw new Error(a);y=(y&15)<<18|(C&63)<<12|(S&63)<<6|M&63,k=65536}else throw new Error(a);if(y<k||y>=55296&&y<=57343)throw new Error(a);if(y>=65536){if(y>1114111)throw new Error(a);y-=65536,g.push(String.fromCharCode(55296|y>>10)),y=56320|y&1023}}g.push(String.fromCharCode(y))}return g.join("")}t.decode=v},function(i,t,o){i.exports=o(3).default},function(i,t,o){o.r(t);class s{constructor(r,c){this.lastId=0,this.prefix=r,this.name=c}create(r){this.lastId++;var c=this.lastId,b=this.prefix+c,w=this.name+"["+c+"]",L=!1,E=function(){L||(r.apply(null,arguments),L=!0)};return this[c]=E,{number:c,id:b,name:w,callback:E}}remove(r){delete this[r.number]}}var a=new s("_pusher_script_","Pusher.ScriptReceivers"),l={VERSION:"8.4.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},d=l;class v{constructor(r){this.options=r,this.receivers=r.receivers||a,this.loading={}}load(r,c,b){var w=this;if(w.loading[r]&&w.loading[r].length>0)w.loading[r].push(b);else{w.loading[r]=[b];var L=O.createScriptRequest(w.getPath(r,c)),E=w.receivers.create(function(B){if(w.receivers.remove(E),w.loading[r]){var R=w.loading[r];delete w.loading[r];for(var Z=function(pe){pe||L.cleanup()},X=0;X<R.length;X++)R[X](B,Z)}});L.send(E)}}getRoot(r){var c,b=O.getDocument().location.protocol;return r&&r.useTLS||b==="https:"?c=this.options.cdn_https:c=this.options.cdn_http,c.replace(/\/*$/,"")+"/"+this.options.version}getPath(r,c){return this.getRoot(c)+"/"+r+this.options.suffix+".js"}}var p=new s("_pusher_dependencies","Pusher.DependenciesReceivers"),g=new v({cdn_http:d.cdn_http,cdn_https:d.cdn_https,version:d.VERSION,suffix:d.dependency_suffix,receivers:p});const f={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var k={buildLogSuffix:function(u){const r="See:",c=f.urls[u];if(!c)return"";let b;return c.fullUrl?b=c.fullUrl:c.path&&(b=f.baseUrl+c.path),b?`${r} ${b}`:""}},C;(function(u){u.UserAuthentication="user-authentication",u.ChannelAuthorization="channel-authorization"})(C||(C={}));class S extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class M extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class A extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class _ extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class T extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class I extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class K extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class G extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class V extends Error{constructor(r,c){super(c),this.status=r,Object.setPrototypeOf(this,new.target.prototype)}}var oe=function(u,r,c,b,w){const L=O.createXHR();L.open("POST",c.endpoint,!0),L.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var E in c.headers)L.setRequestHeader(E,c.headers[E]);if(c.headersProvider!=null){let B=c.headersProvider();for(var E in B)L.setRequestHeader(E,B[E])}return L.onreadystatechange=function(){if(L.readyState===4)if(L.status===200){let B,R=!1;try{B=JSON.parse(L.responseText),R=!0}catch{w(new V(200,`JSON returned from ${b.toString()} endpoint was invalid, yet status code was 200. Data was: ${L.responseText}`),null)}R&&w(null,B)}else{let B="";switch(b){case C.UserAuthentication:B=k.buildLogSuffix("authenticationEndpoint");break;case C.ChannelAuthorization:B=`Clients must be authorized to join private or presence channels. ${k.buildLogSuffix("authorizationEndpoint")}`;break}w(new V(L.status,`Unable to retrieve auth string from ${b.toString()} endpoint - received status: ${L.status} from ${c.endpoint}. ${B}`),null)}},L.send(r),L};function ge(u){return en(Te(u))}var U=String.fromCharCode,_e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ue=function(u){var r=u.charCodeAt(0);return r<128?u:r<2048?U(192|r>>>6)+U(128|r&63):U(224|r>>>12&15)+U(128|r>>>6&63)+U(128|r&63)},Te=function(u){return u.replace(/[^\x00-\x7F]/g,ue)},Me=function(u){var r=[0,2,1][u.length%3],c=u.charCodeAt(0)<<16|(u.length>1?u.charCodeAt(1):0)<<8|(u.length>2?u.charCodeAt(2):0),b=[_e.charAt(c>>>18),_e.charAt(c>>>12&63),r>=2?"=":_e.charAt(c>>>6&63),r>=1?"=":_e.charAt(c&63)];return b.join("")},en=window.btoa||function(u){return u.replace(/[\s\S]{1,3}/g,Me)};class vn{constructor(r,c,b,w){this.clear=c,this.timer=r(()=>{this.timer&&(this.timer=w(this.timer))},b)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var nn=vn;function _n(u){window.clearTimeout(u)}function bn(u){window.clearInterval(u)}class Ee extends nn{constructor(r,c){super(setTimeout,_n,r,function(b){return c(),null})}}class tn extends nn{constructor(r,c){super(setInterval,bn,r,function(b){return c(),b})}}var Mn={now(){return Date.now?Date.now():new Date().valueOf()},defer(u){return new Ee(0,u)},method(u,...r){var c=Array.prototype.slice.call(arguments,1);return function(b){return b[u].apply(b,c.concat(arguments))}}},re=Mn;function fe(u,...r){for(var c=0;c<r.length;c++){var b=r[c];for(var w in b)b[w]&&b[w].constructor&&b[w].constructor===Object?u[w]=fe(u[w]||{},b[w]):u[w]=b[w]}return u}function Re(){for(var u=["Pusher"],r=0;r<arguments.length;r++)typeof arguments[r]=="string"?u.push(arguments[r]):u.push(An(arguments[r]));return u.join(" : ")}function Pe(u,r){var c=Array.prototype.indexOf;if(u===null)return-1;if(c&&u.indexOf===c)return u.indexOf(r);for(var b=0,w=u.length;b<w;b++)if(u[b]===r)return b;return-1}function we(u,r){for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&r(u[c],c,u)}function We(u){var r=[];return we(u,function(c,b){r.push(b)}),r}function N(u){var r=[];return we(u,function(c){r.push(c)}),r}function he(u,r,c){for(var b=0;b<u.length;b++)r.call(c||window,u[b],b,u)}function Q(u,r){for(var c=[],b=0;b<u.length;b++)c.push(r(u[b],b,u,c));return c}function me(u,r){var c={};return we(u,function(b,w){c[w]=r(b)}),c}function Ie(u,r){r=r||function(w){return!!w};for(var c=[],b=0;b<u.length;b++)r(u[b],b,u,c)&&c.push(u[b]);return c}function $(u,r){var c={};return we(u,function(b,w){(r&&r(b,w,u,c)||b)&&(c[w]=b)}),c}function fn(u){var r=[];return we(u,function(c,b){r.push([b,c])}),r}function si(u,r){for(var c=0;c<u.length;c++)if(r(u[c],c,u))return!0;return!1}function Oi(u,r){for(var c=0;c<u.length;c++)if(!r(u[c],c,u))return!1;return!0}function Vi(u){return me(u,function(r){return typeof r=="object"&&(r=An(r)),encodeURIComponent(ge(r.toString()))})}function Ui(u){var r=$(u,function(b){return b!==void 0}),c=Q(fn(Vi(r)),re.method("join","=")).join("&");return c}function ji(u){var r=[],c=[];return function b(w,L){var E,B,R;switch(typeof w){case"object":if(!w)return null;for(E=0;E<r.length;E+=1)if(r[E]===w)return{$ref:c[E]};if(r.push(w),c.push(L),Object.prototype.toString.apply(w)==="[object Array]")for(R=[],E=0;E<w.length;E+=1)R[E]=b(w[E],L+"["+E+"]");else{R={};for(B in w)Object.prototype.hasOwnProperty.call(w,B)&&(R[B]=b(w[B],L+"["+JSON.stringify(B)+"]"))}return R;case"number":case"string":case"boolean":return w}}(u,"$")}function An(u){try{return JSON.stringify(u)}catch{return JSON.stringify(ji(u))}}class ai{constructor(){this.globalLog=r=>{window.console&&window.console.log&&window.console.log(r)}}debug(...r){this.log(this.globalLog,r)}warn(...r){this.log(this.globalLogWarn,r)}error(...r){this.log(this.globalLogError,r)}globalLogWarn(r){window.console&&window.console.warn?window.console.warn(r):this.globalLog(r)}globalLogError(r){window.console&&window.console.error?window.console.error(r):this.globalLogWarn(r)}log(r,...c){var b=Re.apply(this,arguments);Pt.log?Pt.log(b):Pt.logToConsole&&r.bind(this)(b)}}var se=new ai,El=function(u,r,c,b,w){(c.headers!==void 0||c.headersProvider!=null)&&se.warn(`To send headers with the ${b.toString()} request, you must use AJAX, rather than JSONP.`);var L=u.nextAuthCallbackID.toString();u.nextAuthCallbackID++;var E=u.getDocument(),B=E.createElement("script");u.auth_callbacks[L]=function(X){w(null,X)};var R="Pusher.auth_callbacks['"+L+"']";B.src=c.endpoint+"?callback="+encodeURIComponent(R)+"&"+r;var Z=E.getElementsByTagName("head")[0]||E.documentElement;Z.insertBefore(B,Z.firstChild)},Pl=El;class Il{constructor(r){this.src=r}send(r){var c=this,b="Error loading "+c.src;c.script=document.createElement("script"),c.script.id=r.id,c.script.src=c.src,c.script.type="text/javascript",c.script.charset="UTF-8",c.script.addEventListener?(c.script.onerror=function(){r.callback(b)},c.script.onload=function(){r.callback(null)}):c.script.onreadystatechange=function(){(c.script.readyState==="loaded"||c.script.readyState==="complete")&&r.callback(null)},c.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(c.errorScript=document.createElement("script"),c.errorScript.id=r.id+"_error",c.errorScript.text=r.name+"('"+b+"');",c.script.async=c.errorScript.async=!1):c.script.async=!0;var w=document.getElementsByTagName("head")[0];w.insertBefore(c.script,w.firstChild),c.errorScript&&w.insertBefore(c.errorScript,c.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Bl{constructor(r,c){this.url=r,this.data=c}send(r){if(!this.request){var c=Ui(this.data),b=this.url+"/"+r.number+"?"+c;this.request=O.createScriptRequest(b),this.request.send(r)}}cleanup(){this.request&&this.request.cleanup()}}var Nl=function(u,r){return function(c,b){var w="http"+(r?"s":"")+"://",L=w+(u.host||u.options.host)+u.options.path,E=O.createJSONPRequest(L,c),B=O.ScriptReceivers.create(function(R,Z){a.remove(B),E.cleanup(),Z&&Z.host&&(u.host=Z.host),b&&b(R,Z)});E.send(B)}},Dl={name:"jsonp",getAgent:Nl},Hl=Dl;function wt(u,r,c){var b=u+(r.useTLS?"s":""),w=r.useTLS?r.hostTLS:r.hostNonTLS;return b+"://"+w+c}function kt(u,r){var c="/app/"+u,b="?protocol="+d.PROTOCOL+"&client=js&version="+d.VERSION+(r?"&"+r:"");return c+b}var Rl={getInitial:function(u,r){var c=(r.httpPath||"")+kt(u,"flash=false");return wt("ws",r,c)}},Ol={getInitial:function(u,r){var c=(r.httpPath||"/pusher")+kt(u);return wt("http",r,c)}},Vl={getInitial:function(u,r){return wt("http",r,r.httpPath||"/pusher")},getPath:function(u,r){return kt(u)}};class Ul{constructor(){this._callbacks={}}get(r){return this._callbacks[St(r)]}add(r,c,b){var w=St(r);this._callbacks[w]=this._callbacks[w]||[],this._callbacks[w].push({fn:c,context:b})}remove(r,c,b){if(!r&&!c&&!b){this._callbacks={};return}var w=r?[St(r)]:We(this._callbacks);c||b?this.removeCallback(w,c,b):this.removeAllCallbacks(w)}removeCallback(r,c,b){he(r,function(w){this._callbacks[w]=Ie(this._callbacks[w]||[],function(L){return c&&c!==L.fn||b&&b!==L.context}),this._callbacks[w].length===0&&delete this._callbacks[w]},this)}removeAllCallbacks(r){he(r,function(c){delete this._callbacks[c]},this)}}function St(u){return"_"+u}class on{constructor(r){this.callbacks=new Ul,this.global_callbacks=[],this.failThrough=r}bind(r,c,b){return this.callbacks.add(r,c,b),this}bind_global(r){return this.global_callbacks.push(r),this}unbind(r,c,b){return this.callbacks.remove(r,c,b),this}unbind_global(r){return r?(this.global_callbacks=Ie(this.global_callbacks||[],c=>c!==r),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(r,c,b){for(var w=0;w<this.global_callbacks.length;w++)this.global_callbacks[w](r,c);var L=this.callbacks.get(r),E=[];if(b?E.push(c,b):c&&E.push(c),L&&L.length>0)for(var w=0;w<L.length;w++)L[w].fn.apply(L[w].context||window,E);else this.failThrough&&this.failThrough(r,c);return this}}class jl extends on{constructor(r,c,b,w,L){super(),this.initialize=O.transportConnectionInitializer,this.hooks=r,this.name=c,this.priority=b,this.key=w,this.options=L,this.state="new",this.timeline=L.timeline,this.activityTimeout=L.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var r=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(r,this.options)}catch(c){return re.defer(()=>{this.onError(c),this.changeState("closed")}),!1}return this.bindListeners(),se.debug("Connecting",{transport:this.name,url:r}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(r){return this.state==="open"?(re.defer(()=>{this.socket&&this.socket.send(r)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(r){this.emit("error",{type:"WebSocketError",error:r}),this.timeline.error(this.buildTimelineMessage({error:r.toString()}))}onClose(r){r?this.changeState("closed",{code:r.code,reason:r.reason,wasClean:r.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(r){this.emit("message",r)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=r=>{this.onError(r)},this.socket.onclose=r=>{this.onClose(r)},this.socket.onmessage=r=>{this.onMessage(r)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(r,c){this.state=r,this.timeline.info(this.buildTimelineMessage({state:r,params:c})),this.emit(r,c)}buildTimelineMessage(r){return fe({cid:this.id},r)}}class Gn{constructor(r){this.hooks=r}isSupported(r){return this.hooks.isSupported(r)}createConnection(r,c,b,w){return new jl(this.hooks,r,c,b,w)}}var Kl=new Gn({urls:Rl,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!O.getWebSocketAPI()},isSupported:function(){return!!O.getWebSocketAPI()},getSocket:function(u){return O.createWebSocket(u)}}),ss={urls:Ol,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},as=fe({getSocket:function(u){return O.HTTPFactory.createStreamingSocket(u)}},ss),rs=fe({getSocket:function(u){return O.HTTPFactory.createPollingSocket(u)}},ss),ls={isSupported:function(){return O.isXHRSupported()}},Fl=new Gn(fe({},as,ls)),Gl=new Gn(fe({},rs,ls)),zl={ws:Kl,xhr_streaming:Fl,xhr_polling:Gl},Ki=zl,ql=new Gn({file:"sockjs",urls:Vl,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(u,r){return new window.SockJS(u,null,{js_path:g.getPath("sockjs",{useTLS:r.useTLS}),ignore_null_origin:r.ignoreNullOrigin})},beforeOpen:function(u,r){u.send(JSON.stringify({path:r}))}}),ds={isSupported:function(u){var r=O.isXDRSupported(u.useTLS);return r}},Wl=new Gn(fe({},as,ds)),Zl=new Gn(fe({},rs,ds));Ki.xdr_streaming=Wl,Ki.xdr_polling=Zl,Ki.sockjs=ql;var Jl=Ki;class $l extends on{constructor(){super();var r=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){r.emit("online")},!1),window.addEventListener("offline",function(){r.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Yl=new $l;class Ql{constructor(r,c,b){this.manager=r,this.transport=c,this.minPingDelay=b.minPingDelay,this.maxPingDelay=b.maxPingDelay,this.pingDelay=void 0}createConnection(r,c,b,w){w=fe({},w,{activityTimeout:this.pingDelay});var L=this.transport.createConnection(r,c,b,w),E=null,B=function(){L.unbind("open",B),L.bind("closed",R),E=re.now()},R=Z=>{if(L.unbind("closed",R),Z.code===1002||Z.code===1003)this.manager.reportDeath();else if(!Z.wasClean&&E){var X=re.now()-E;X<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(X/2,this.minPingDelay))}};return L.bind("open",B),L}isSupported(r){return this.manager.isAlive()&&this.transport.isSupported(r)}}const cs={decodeMessage:function(u){try{var r=JSON.parse(u.data),c=r.data;if(typeof c=="string")try{c=JSON.parse(r.data)}catch{}var b={event:r.event,channel:r.channel,data:c};return r.user_id&&(b.user_id=r.user_id),b}catch(w){throw{type:"MessageParseError",error:w,data:u.data}}},encodeMessage:function(u){return JSON.stringify(u)},processHandshake:function(u){var r=cs.decodeMessage(u);if(r.event==="pusher:connection_established"){if(!r.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:r.data.socket_id,activityTimeout:r.data.activity_timeout*1e3}}else{if(r.event==="pusher:error")return{action:this.getCloseAction(r.data),error:this.getCloseError(r.data)};throw"Invalid handshake"}},getCloseAction:function(u){return u.code<4e3?u.code>=1002&&u.code<=1004?"backoff":null:u.code===4e3?"tls_only":u.code<4100?"refused":u.code<4200?"backoff":u.code<4300?"retry":"refused"},getCloseError:function(u){return u.code!==1e3&&u.code!==1001?{type:"PusherError",data:{code:u.code,message:u.reason||u.message}}:null}};var xn=cs;class Xl extends on{constructor(r,c){super(),this.id=r,this.transport=c,this.activityTimeout=c.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(r){return this.transport.send(r)}send_event(r,c,b){var w={event:r,data:c};return b&&(w.channel=b),se.debug("Event sent",w),this.send(xn.encodeMessage(w))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var r={message:b=>{var w;try{w=xn.decodeMessage(b)}catch(L){this.emit("error",{type:"MessageParseError",error:L,data:b.data})}if(w!==void 0){switch(se.debug("Event recd",w),w.event){case"pusher:error":this.emit("error",{type:"PusherError",data:w.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",w)}},activity:()=>{this.emit("activity")},error:b=>{this.emit("error",b)},closed:b=>{c(),b&&b.code&&this.handleCloseEvent(b),this.transport=null,this.emit("closed")}},c=()=>{we(r,(b,w)=>{this.transport.unbind(w,b)})};we(r,(b,w)=>{this.transport.bind(w,b)})}handleCloseEvent(r){var c=xn.getCloseAction(r),b=xn.getCloseError(r);b&&this.emit("error",b),c&&this.emit(c,{action:c,error:b})}}class ed{constructor(r,c){this.transport=r,this.callback=c,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=r=>{this.unbindListeners();var c;try{c=xn.processHandshake(r)}catch(b){this.finish("error",{error:b}),this.transport.close();return}c.action==="connected"?this.finish("connected",{connection:new Xl(c.id,this.transport),activityTimeout:c.activityTimeout}):(this.finish(c.action,{error:c.error}),this.transport.close())},this.onClosed=r=>{this.unbindListeners();var c=xn.getCloseAction(r)||"backoff",b=xn.getCloseError(r);this.finish(c,{error:b})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(r,c){this.callback(fe({transport:this.transport,action:r},c))}}class nd{constructor(r,c){this.timeline=r,this.options=c||{}}send(r,c){this.timeline.isEmpty()||this.timeline.send(O.TimelineTransport.getAgent(this,r),c)}}class _t extends on{constructor(r,c){super(function(b,w){se.debug("No callbacks on "+r+" for "+b)}),this.name=r,this.pusher=c,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(r,c){return c(null,{auth:""})}trigger(r,c){if(r.indexOf("client-")!==0)throw new S("Event '"+r+"' does not start with 'client-'");if(!this.subscribed){var b=k.buildLogSuffix("triggeringClientEvents");se.warn(`Client event triggered before channel 'subscription_succeeded' event . ${b}`)}return this.pusher.send_event(r,c,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(r){var c=r.event,b=r.data;if(c==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(r);else if(c==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(r);else if(c.indexOf("pusher_internal:")!==0){var w={};this.emit(c,b,w)}}handleSubscriptionSucceededEvent(r){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",r.data)}handleSubscriptionCountEvent(r){r.data.subscription_count&&(this.subscriptionCount=r.data.subscription_count),this.emit("pusher:subscription_count",r.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(r,c)=>{r?(this.subscriptionPending=!1,se.error(r.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:r.message},r instanceof V?{status:r.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:c.auth,channel_data:c.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class Mt extends _t{authorize(r,c){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:r},c)}}class id{constructor(){this.reset()}get(r){return Object.prototype.hasOwnProperty.call(this.members,r)?{id:r,info:this.members[r]}:null}each(r){we(this.members,(c,b)=>{r(this.get(b))})}setMyID(r){this.myID=r}onSubscription(r){this.members=r.presence.hash,this.count=r.presence.count,this.me=this.get(this.myID)}addMember(r){return this.get(r.user_id)===null&&this.count++,this.members[r.user_id]=r.user_info,this.get(r.user_id)}removeMember(r){var c=this.get(r.user_id);return c&&(delete this.members[r.user_id],this.count--),c}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var td=function(u,r,c,b){function w(L){return L instanceof c?L:new c(function(E){E(L)})}return new(c||(c=Promise))(function(L,E){function B(X){try{Z(b.next(X))}catch(pe){E(pe)}}function R(X){try{Z(b.throw(X))}catch(pe){E(pe)}}function Z(X){X.done?L(X.value):w(X.value).then(B,R)}Z((b=b.apply(u,r||[])).next())})};class od extends Mt{constructor(r,c){super(r,c),this.members=new id}authorize(r,c){super.authorize(r,(b,w)=>td(this,void 0,void 0,function*(){if(!b)if(w=w,w.channel_data!=null){var L=JSON.parse(w.channel_data);this.members.setMyID(L.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let E=k.buildLogSuffix("authorizationEndpoint");se.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${E}, or the user should be signed in.`),c("Invalid auth response");return}c(b,w)}))}handleEvent(r){var c=r.event;if(c.indexOf("pusher_internal:")===0)this.handleInternalEvent(r);else{var b=r.data,w={};r.user_id&&(w.user_id=r.user_id),this.emit(c,b,w)}}handleInternalEvent(r){var c=r.event,b=r.data;switch(c){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(r);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(r);break;case"pusher_internal:member_added":var w=this.members.addMember(b);this.emit("pusher:member_added",w);break;case"pusher_internal:member_removed":var L=this.members.removeMember(b);L&&this.emit("pusher:member_removed",L);break}}handleSubscriptionSucceededEvent(r){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(r.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var sd=o(1),At=o(0);class ad extends Mt{constructor(r,c,b){super(r,c),this.key=null,this.nacl=b}authorize(r,c){super.authorize(r,(b,w)=>{if(b){c(b,w);return}let L=w.shared_secret;if(!L){c(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(At.decode)(L),delete w.shared_secret,c(null,w)})}trigger(r,c){throw new I("Client events are not currently supported for encrypted channels")}handleEvent(r){var c=r.event,b=r.data;if(c.indexOf("pusher_internal:")===0||c.indexOf("pusher:")===0){super.handleEvent(r);return}this.handleEncryptedEvent(c,b)}handleEncryptedEvent(r,c){if(!this.key){se.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!c.ciphertext||!c.nonce){se.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+c);return}let b=Object(At.decode)(c.ciphertext);if(b.length<this.nacl.secretbox.overheadLength){se.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${b.length}`);return}let w=Object(At.decode)(c.nonce);if(w.length<this.nacl.secretbox.nonceLength){se.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${w.length}`);return}let L=this.nacl.secretbox.open(b,w,this.key);if(L===null){se.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(E,B)=>{if(E){se.error(`Failed to make a request to the authEndpoint: ${B}. Unable to fetch new key, so dropping encrypted event`);return}if(L=this.nacl.secretbox.open(b,w,this.key),L===null){se.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(r,this.getDataToEmit(L))});return}this.emit(r,this.getDataToEmit(L))}getDataToEmit(r){let c=Object(sd.decode)(r);try{return JSON.parse(c)}catch{return c}}}class rd extends on{constructor(r,c){super(),this.state="initialized",this.connection=null,this.key=r,this.options=c,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var b=O.getNetwork();b.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),b.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(r){return this.connection?this.connection.send(r):!1}send_event(r,c,b){return this.connection?this.connection.send_event(r,c,b):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var r=(c,b)=>{c?this.runner=this.strategy.connect(0,r):b.action==="error"?(this.emit("error",{type:"HandshakeError",error:b.error}),this.timeline.error({handshakeError:b.error})):(this.abortConnecting(),this.handshakeCallbacks[b.action](b))};this.runner=this.strategy.connect(0,r)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var r=this.abandonConnection();r.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(r){this.timeline.info({action:"retry",delay:r}),r>0&&this.emit("connecting_in",Math.round(r/1e3)),this.retryTimer=new Ee(r||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new Ee(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Ee(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Ee(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(r){return fe({},r,{message:c=>{this.resetActivityCheck(),this.emit("message",c)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:c=>{this.emit("error",c)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(r){return fe({},r,{connected:c=>{this.activityTimeout=Math.min(this.options.activityTimeout,c.activityTimeout,c.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(c.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let r=c=>b=>{b.error&&this.emit("error",{type:"WebSocketError",error:b.error}),c(b)};return{tls_only:r(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:r(()=>{this.disconnect()}),backoff:r(()=>{this.retryIn(1e3)}),retry:r(()=>{this.retryIn(0)})}}setConnection(r){this.connection=r;for(var c in this.connectionCallbacks)this.connection.bind(c,this.connectionCallbacks[c]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var r in this.connectionCallbacks)this.connection.unbind(r,this.connectionCallbacks[r]);var c=this.connection;return this.connection=null,c}}updateState(r,c){var b=this.state;if(this.state=r,b!==r){var w=r;w==="connected"&&(w+=" with new socket ID "+c.socket_id),se.debug("State changed",b+" -> "+w),this.timeline.info({state:r,params:c}),this.emit("state_change",{previous:b,current:r}),this.emit(r,c)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class ld{constructor(){this.channels={}}add(r,c){return this.channels[r]||(this.channels[r]=dd(r,c)),this.channels[r]}all(){return N(this.channels)}find(r){return this.channels[r]}remove(r){var c=this.channels[r];return delete this.channels[r],c}disconnect(){we(this.channels,function(r){r.disconnect()})}}function dd(u,r){if(u.indexOf("private-encrypted-")===0){if(r.config.nacl)return sn.createEncryptedChannel(u,r,r.config.nacl);let c="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",b=k.buildLogSuffix("encryptedChannelSupport");throw new I(`${c}. ${b}`)}else{if(u.indexOf("private-")===0)return sn.createPrivateChannel(u,r);if(u.indexOf("presence-")===0)return sn.createPresenceChannel(u,r);if(u.indexOf("#")===0)throw new M('Cannot create a channel with name "'+u+'".');return sn.createChannel(u,r)}}var cd={createChannels(){return new ld},createConnectionManager(u,r){return new rd(u,r)},createChannel(u,r){return new _t(u,r)},createPrivateChannel(u,r){return new Mt(u,r)},createPresenceChannel(u,r){return new od(u,r)},createEncryptedChannel(u,r,c){return new ad(u,r,c)},createTimelineSender(u,r){return new nd(u,r)},createHandshake(u,r){return new ed(u,r)},createAssistantToTheTransportManager(u,r,c){return new Ql(u,r,c)}},sn=cd;class us{constructor(r){this.options=r||{},this.livesLeft=this.options.lives||1/0}getAssistant(r){return sn.createAssistantToTheTransportManager(this,r,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Ln{constructor(r,c){this.strategies=r,this.loop=!!c.loop,this.failFast=!!c.failFast,this.timeout=c.timeout,this.timeoutLimit=c.timeoutLimit}isSupported(){return si(this.strategies,re.method("isSupported"))}connect(r,c){var b=this.strategies,w=0,L=this.timeout,E=null,B=(R,Z)=>{Z?c(null,Z):(w=w+1,this.loop&&(w=w%b.length),w<b.length?(L&&(L=L*2,this.timeoutLimit&&(L=Math.min(L,this.timeoutLimit))),E=this.tryStrategy(b[w],r,{timeout:L,failFast:this.failFast},B)):c(!0))};return E=this.tryStrategy(b[w],r,{timeout:L,failFast:this.failFast},B),{abort:function(){E.abort()},forceMinPriority:function(R){r=R,E&&E.forceMinPriority(R)}}}tryStrategy(r,c,b,w){var L=null,E=null;return b.timeout>0&&(L=new Ee(b.timeout,function(){E.abort(),w(!0)})),E=r.connect(c,function(B,R){B&&L&&L.isRunning()&&!b.failFast||(L&&L.ensureAborted(),w(B,R))}),{abort:function(){L&&L.ensureAborted(),E.abort()},forceMinPriority:function(B){E.forceMinPriority(B)}}}}class xt{constructor(r){this.strategies=r}isSupported(){return si(this.strategies,re.method("isSupported"))}connect(r,c){return ud(this.strategies,r,function(b,w){return function(L,E){if(w[b].error=L,L){hd(w)&&c(!0);return}he(w,function(B){B.forceMinPriority(E.transport.priority)}),c(null,E)}})}}function ud(u,r,c){var b=Q(u,function(w,L,E,B){return w.connect(r,c(L,B))});return{abort:function(){he(b,md)},forceMinPriority:function(w){he(b,function(L){L.forceMinPriority(w)})}}}function hd(u){return Oi(u,function(r){return!!r.error})}function md(u){!u.error&&!u.aborted&&(u.abort(),u.aborted=!0)}class pd{constructor(r,c,b){this.strategy=r,this.transports=c,this.ttl=b.ttl||1800*1e3,this.usingTLS=b.useTLS,this.timeline=b.timeline}isSupported(){return this.strategy.isSupported()}connect(r,c){var b=this.usingTLS,w=vd(b),L=w&&w.cacheSkipCount?w.cacheSkipCount:0,E=[this.strategy];if(w&&w.timestamp+this.ttl>=re.now()){var B=this.transports[w.transport];B&&(["ws","wss"].includes(w.transport)||L>3?(this.timeline.info({cached:!0,transport:w.transport,latency:w.latency}),E.push(new Ln([B],{timeout:w.latency*2+1e3,failFast:!0}))):L++)}var R=re.now(),Z=E.pop().connect(r,function X(pe,zi){pe?(hs(b),E.length>0?(R=re.now(),Z=E.pop().connect(r,X)):c(pe)):(bd(b,zi.transport.name,re.now()-R,L),c(null,zi))});return{abort:function(){Z.abort()},forceMinPriority:function(X){r=X,Z&&Z.forceMinPriority(X)}}}}function Lt(u){return"pusherTransport"+(u?"TLS":"NonTLS")}function vd(u){var r=O.getLocalStorage();if(r)try{var c=r[Lt(u)];if(c)return JSON.parse(c)}catch{hs(u)}return null}function bd(u,r,c,b){var w=O.getLocalStorage();if(w)try{w[Lt(u)]=An({timestamp:re.now(),transport:r,latency:c,cacheSkipCount:b})}catch{}}function hs(u){var r=O.getLocalStorage();if(r)try{delete r[Lt(u)]}catch{}}class Fi{constructor(r,{delay:c}){this.strategy=r,this.options={delay:c}}isSupported(){return this.strategy.isSupported()}connect(r,c){var b=this.strategy,w,L=new Ee(this.options.delay,function(){w=b.connect(r,c)});return{abort:function(){L.ensureAborted(),w&&w.abort()},forceMinPriority:function(E){r=E,w&&w.forceMinPriority(E)}}}}class ri{constructor(r,c,b){this.test=r,this.trueBranch=c,this.falseBranch=b}isSupported(){var r=this.test()?this.trueBranch:this.falseBranch;return r.isSupported()}connect(r,c){var b=this.test()?this.trueBranch:this.falseBranch;return b.connect(r,c)}}class fd{constructor(r){this.strategy=r}isSupported(){return this.strategy.isSupported()}connect(r,c){var b=this.strategy.connect(r,function(w,L){L&&b.abort(),c(w,L)});return b}}function li(u){return function(){return u.isSupported()}}var gd=function(u,r,c){var b={};function w(Ss,fc,gc,yc,Cc){var _s=c(u,Ss,fc,gc,yc,Cc);return b[Ss]=_s,_s}var L=Object.assign({},r,{hostNonTLS:u.wsHost+":"+u.wsPort,hostTLS:u.wsHost+":"+u.wssPort,httpPath:u.wsPath}),E=Object.assign({},L,{useTLS:!0}),B=Object.assign({},r,{hostNonTLS:u.httpHost+":"+u.httpPort,hostTLS:u.httpHost+":"+u.httpsPort,httpPath:u.httpPath}),R={loop:!0,timeout:15e3,timeoutLimit:6e4},Z=new us({minPingDelay:1e4,maxPingDelay:u.activityTimeout}),X=new us({lives:2,minPingDelay:1e4,maxPingDelay:u.activityTimeout}),pe=w("ws","ws",3,L,Z),zi=w("wss","ws",3,E,Z),hc=w("sockjs","sockjs",1,B),fs=w("xhr_streaming","xhr_streaming",1,B,X),mc=w("xdr_streaming","xdr_streaming",1,B,X),gs=w("xhr_polling","xhr_polling",1,B),pc=w("xdr_polling","xdr_polling",1,B),ys=new Ln([pe],R),vc=new Ln([zi],R),bc=new Ln([hc],R),Cs=new Ln([new ri(li(fs),fs,mc)],R),ws=new Ln([new ri(li(gs),gs,pc)],R),ks=new Ln([new ri(li(Cs),new xt([Cs,new Fi(ws,{delay:4e3})]),ws)],R),It=new ri(li(ks),ks,bc),Bt;return r.useTLS?Bt=new xt([ys,new Fi(It,{delay:2e3})]):Bt=new xt([ys,new Fi(vc,{delay:2e3}),new Fi(It,{delay:5e3})]),new pd(new fd(new ri(li(pe),Bt,It)),b,{ttl:18e5,timeline:r.timeline,useTLS:r.useTLS})},yd=gd,Cd=function(){var u=this;u.timeline.info(u.buildTimelineMessage({transport:u.name+(u.options.useTLS?"s":"")})),u.hooks.isInitialized()?u.changeState("initialized"):u.hooks.file?(u.changeState("initializing"),g.load(u.hooks.file,{useTLS:u.options.useTLS},function(r,c){u.hooks.isInitialized()?(u.changeState("initialized"),c(!0)):(r&&u.onError(r),u.onClose(),c(!1))})):u.onClose()},wd={getRequest:function(u){var r=new window.XDomainRequest;return r.ontimeout=function(){u.emit("error",new A),u.close()},r.onerror=function(c){u.emit("error",c),u.close()},r.onprogress=function(){r.responseText&&r.responseText.length>0&&u.onChunk(200,r.responseText)},r.onload=function(){r.responseText&&r.responseText.length>0&&u.onChunk(200,r.responseText),u.emit("finished",200),u.close()},r},abortRequest:function(u){u.ontimeout=u.onerror=u.onprogress=u.onload=null,u.abort()}},kd=wd;const Sd=256*1024;class _d extends on{constructor(r,c,b){super(),this.hooks=r,this.method=c,this.url=b}start(r){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},O.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(r)}close(){this.unloader&&(O.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(r,c){for(;;){var b=this.advanceBuffer(c);if(b)this.emit("chunk",{status:r,data:b});else break}this.isBufferTooLong(c)&&this.emit("buffer_too_long")}advanceBuffer(r){var c=r.slice(this.position),b=c.indexOf(`
1148
- `);return b!==-1?(this.position+=b+1,c.slice(0,b)):null}isBufferTooLong(r){return this.position===r.length&&r.length>Sd}}var Tt;(function(u){u[u.CONNECTING=0]="CONNECTING",u[u.OPEN=1]="OPEN",u[u.CLOSED=3]="CLOSED"})(Tt||(Tt={}));var Tn=Tt,Md=1;class Ad{constructor(r,c){this.hooks=r,this.session=ps(1e3)+"/"+Ed(8),this.location=xd(c),this.readyState=Tn.CONNECTING,this.openStream()}send(r){return this.sendRaw(JSON.stringify([r]))}ping(){this.hooks.sendHeartbeat(this)}close(r,c){this.onClose(r,c,!0)}sendRaw(r){if(this.readyState===Tn.OPEN)try{return O.createSocketRequest("POST",ms(Ld(this.location,this.session))).start(r),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(r,c,b){this.closeStream(),this.readyState=Tn.CLOSED,this.onclose&&this.onclose({code:r,reason:c,wasClean:b})}onChunk(r){if(r.status===200){this.readyState===Tn.OPEN&&this.onActivity();var c,b=r.data.slice(0,1);switch(b){case"o":c=JSON.parse(r.data.slice(1)||"{}"),this.onOpen(c);break;case"a":c=JSON.parse(r.data.slice(1)||"[]");for(var w=0;w<c.length;w++)this.onEvent(c[w]);break;case"m":c=JSON.parse(r.data.slice(1)||"null"),this.onEvent(c);break;case"h":this.hooks.onHeartbeat(this);break;case"c":c=JSON.parse(r.data.slice(1)||"[]"),this.onClose(c[0],c[1],!0);break}}}onOpen(r){this.readyState===Tn.CONNECTING?(r&&r.hostname&&(this.location.base=Td(this.location.base,r.hostname)),this.readyState=Tn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(r){this.readyState===Tn.OPEN&&this.onmessage&&this.onmessage({data:r})}onActivity(){this.onactivity&&this.onactivity()}onError(r){this.onerror&&this.onerror(r)}openStream(){this.stream=O.createSocketRequest("POST",ms(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",r=>{this.onChunk(r)}),this.stream.bind("finished",r=>{this.hooks.onFinished(this,r)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(r){re.defer(()=>{this.onError(r),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function xd(u){var r=/([^\?]*)\/*(\??.*)/.exec(u);return{base:r[1],queryString:r[2]}}function Ld(u,r){return u.base+"/"+r+"/xhr_send"}function ms(u){var r=u.indexOf("?")===-1?"?":"&";return u+r+"t="+ +new Date+"&n="+Md++}function Td(u,r){var c=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(u);return c[1]+r+c[3]}function ps(u){return O.randomInt(u)}function Ed(u){for(var r=[],c=0;c<u;c++)r.push(ps(32).toString(32));return r.join("")}var Pd=Ad,Id={getReceiveURL:function(u,r){return u.base+"/"+r+"/xhr_streaming"+u.queryString},onHeartbeat:function(u){u.sendRaw("[]")},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,r){u.onClose(1006,"Connection interrupted ("+r+")",!1)}},Bd=Id,Nd={getReceiveURL:function(u,r){return u.base+"/"+r+"/xhr"+u.queryString},onHeartbeat:function(){},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,r){r===200?u.reconnect():u.onClose(1006,"Connection interrupted ("+r+")",!1)}},Dd=Nd,Hd={getRequest:function(u){var r=O.getXHRAPI(),c=new r;return c.onreadystatechange=c.onprogress=function(){switch(c.readyState){case 3:c.responseText&&c.responseText.length>0&&u.onChunk(c.status,c.responseText);break;case 4:c.responseText&&c.responseText.length>0&&u.onChunk(c.status,c.responseText),u.emit("finished",c.status),u.close();break}},c},abortRequest:function(u){u.onreadystatechange=null,u.abort()}},Rd=Hd,Od={createStreamingSocket(u){return this.createSocket(Bd,u)},createPollingSocket(u){return this.createSocket(Dd,u)},createSocket(u,r){return new Pd(u,r)},createXHR(u,r){return this.createRequest(Rd,u,r)},createRequest(u,r,c){return new _d(u,r,c)}},vs=Od;vs.createXDR=function(u,r){return this.createRequest(kd,u,r)};var Vd=vs,Ud={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:a,DependenciesReceivers:p,getDefaultStrategy:yd,Transports:Jl,transportConnectionInitializer:Cd,HTTPFactory:Vd,TimelineTransport:Hl,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(u){window.Pusher=u;var r=()=>{this.onDocumentBody(u.ready)};window.JSON?r():g.load("json2",{},r)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:oe,jsonp:Pl}},onDocumentBody(u){document.body?u():setTimeout(()=>{this.onDocumentBody(u)},0)},createJSONPRequest(u,r){return new Bl(u,r)},createScriptRequest(u){return new Il(u)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var u=this.getXHRAPI();return new u},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Yl},createWebSocket(u){var r=this.getWebSocketAPI();return new r(u)},createSocketRequest(u,r){if(this.isXHRSupported())return this.HTTPFactory.createXHR(u,r);if(this.isXDRSupported(r.indexOf("https:")===0))return this.HTTPFactory.createXDR(u,r);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var u=this.getXHRAPI();return!!u&&new u().withCredentials!==void 0},isXDRSupported(u){var r=u?"https:":"http:",c=this.getProtocol();return!!window.XDomainRequest&&c===r},addUnloadListener(u){window.addEventListener!==void 0?window.addEventListener("unload",u,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",u)},removeUnloadListener(u){window.addEventListener!==void 0?window.removeEventListener("unload",u,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",u)},randomInt(u){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*u)}},O=Ud,Et;(function(u){u[u.ERROR=3]="ERROR",u[u.INFO=6]="INFO",u[u.DEBUG=7]="DEBUG"})(Et||(Et={}));var Gi=Et;class jd{constructor(r,c,b){this.key=r,this.session=c,this.events=[],this.options=b||{},this.sent=0,this.uniqueID=0}log(r,c){r<=this.options.level&&(this.events.push(fe({},c,{timestamp:re.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(r){this.log(Gi.ERROR,r)}info(r){this.log(Gi.INFO,r)}debug(r){this.log(Gi.DEBUG,r)}isEmpty(){return this.events.length===0}send(r,c){var b=fe({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],r(b,(w,L)=>{w||this.sent++,c&&c(w,L)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Kd{constructor(r,c,b,w){this.name=r,this.priority=c,this.transport=b,this.options=w||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(r,c){if(this.isSupported()){if(this.priority<r)return bs(new _,c)}else return bs(new G,c);var b=!1,w=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),L=null,E=function(){w.unbind("initialized",E),w.connect()},B=function(){L=sn.createHandshake(w,function(pe){b=!0,X(),c(null,pe)})},R=function(pe){X(),c(pe)},Z=function(){X();var pe;pe=An(w),c(new T(pe))},X=function(){w.unbind("initialized",E),w.unbind("open",B),w.unbind("error",R),w.unbind("closed",Z)};return w.bind("initialized",E),w.bind("open",B),w.bind("error",R),w.bind("closed",Z),w.initialize(),{abort:()=>{b||(X(),L?L.close():w.close())},forceMinPriority:pe=>{b||this.priority<pe&&(L?L.close():w.close())}}}}function bs(u,r){return re.defer(function(){r(u)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Fd}=O;var Gd=function(u,r,c,b,w,L){var E=Fd[c];if(!E)throw new K(c);var B=(!u.enabledTransports||Pe(u.enabledTransports,r)!==-1)&&(!u.disabledTransports||Pe(u.disabledTransports,r)===-1),R;return B?(w=Object.assign({ignoreNullOrigin:u.ignoreNullOrigin},w),R=new Kd(r,b,L?L.getAssistant(E):E,w)):R=zd,R},zd={isSupported:function(){return!1},connect:function(u,r){var c=re.defer(function(){r(new G)});return{abort:function(){c.ensureAborted()},forceMinPriority:function(){}}}};function qd(u){if(u==null)throw"You must pass an options object";if(u.cluster==null)throw"Options object must provide a cluster";"disableStats"in u&&se.warn("The disableStats option is deprecated in favor of enableStats")}const Wd=(u,r)=>{var c="socket_id="+encodeURIComponent(u.socketId);for(var b in r.params)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(r.params[b]);if(r.paramsProvider!=null){let w=r.paramsProvider();for(var b in w)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(w[b])}return c};var Zd=u=>{if(typeof O.getAuthorizers()[u.transport]>"u")throw`'${u.transport}' is not a recognized auth transport`;return(r,c)=>{const b=Wd(r,u);O.getAuthorizers()[u.transport](O,b,u,C.UserAuthentication,c)}};const Jd=(u,r)=>{var c="socket_id="+encodeURIComponent(u.socketId);c+="&channel_name="+encodeURIComponent(u.channelName);for(var b in r.params)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(r.params[b]);if(r.paramsProvider!=null){let w=r.paramsProvider();for(var b in w)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(w[b])}return c};var $d=u=>{if(typeof O.getAuthorizers()[u.transport]>"u")throw`'${u.transport}' is not a recognized auth transport`;return(r,c)=>{const b=Jd(r,u);O.getAuthorizers()[u.transport](O,b,u,C.ChannelAuthorization,c)}};const Yd=(u,r,c)=>{const b={authTransport:r.transport,authEndpoint:r.endpoint,auth:{params:r.params,headers:r.headers}};return(w,L)=>{const E=u.channel(w.channelName);c(E,b).authorize(w.socketId,L)}};function Qd(u,r){let c={activityTimeout:u.activityTimeout||d.activityTimeout,cluster:u.cluster,httpPath:u.httpPath||d.httpPath,httpPort:u.httpPort||d.httpPort,httpsPort:u.httpsPort||d.httpsPort,pongTimeout:u.pongTimeout||d.pongTimeout,statsHost:u.statsHost||d.stats_host,unavailableTimeout:u.unavailableTimeout||d.unavailableTimeout,wsPath:u.wsPath||d.wsPath,wsPort:u.wsPort||d.wsPort,wssPort:u.wssPort||d.wssPort,enableStats:tc(u),httpHost:Xd(u),useTLS:ic(u),wsHost:ec(u),userAuthenticator:oc(u),channelAuthorizer:ac(u,r)};return"disabledTransports"in u&&(c.disabledTransports=u.disabledTransports),"enabledTransports"in u&&(c.enabledTransports=u.enabledTransports),"ignoreNullOrigin"in u&&(c.ignoreNullOrigin=u.ignoreNullOrigin),"timelineParams"in u&&(c.timelineParams=u.timelineParams),"nacl"in u&&(c.nacl=u.nacl),c}function Xd(u){return u.httpHost?u.httpHost:u.cluster?`sockjs-${u.cluster}.pusher.com`:d.httpHost}function ec(u){return u.wsHost?u.wsHost:nc(u.cluster)}function nc(u){return`ws-${u}.pusher.com`}function ic(u){return O.getProtocol()==="https:"?!0:u.forceTLS!==!1}function tc(u){return"enableStats"in u?u.enableStats:"disableStats"in u?!u.disableStats:!1}function oc(u){const r=Object.assign(Object.assign({},d.userAuthentication),u.userAuthentication);return"customHandler"in r&&r.customHandler!=null?r.customHandler:Zd(r)}function sc(u,r){let c;return"channelAuthorization"in u?c=Object.assign(Object.assign({},d.channelAuthorization),u.channelAuthorization):(c={transport:u.authTransport||d.authTransport,endpoint:u.authEndpoint||d.authEndpoint},"auth"in u&&("params"in u.auth&&(c.params=u.auth.params),"headers"in u.auth&&(c.headers=u.auth.headers)),"authorizer"in u&&(c.customHandler=Yd(r,c,u.authorizer))),c}function ac(u,r){const c=sc(u,r);return"customHandler"in c&&c.customHandler!=null?c.customHandler:$d(c)}class rc extends on{constructor(r){super(function(c,b){se.debug(`No callbacks on watchlist events for ${c}`)}),this.pusher=r,this.bindWatchlistInternalEvent()}handleEvent(r){r.data.events.forEach(c=>{this.emit(c.name,c)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",r=>{var c=r.event;c==="pusher_internal:watchlist_events"&&this.handleEvent(r)})}}function lc(){let u,r;return{promise:new Promise((b,w)=>{u=b,r=w}),resolve:u,reject:r}}var dc=lc;class cc extends on{constructor(r){super(function(c,b){se.debug("No callbacks on user for "+c)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(c,b)=>{if(c){se.warn(`Error during signin: ${c}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:b.auth,user_data:b.user_data})},this.pusher=r,this.pusher.connection.bind("state_change",({previous:c,current:b})=>{c!=="connected"&&b==="connected"&&this._signin(),c==="connected"&&b!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new rc(r),this.pusher.connection.bind("message",c=>{var b=c.event;b==="pusher:signin_success"&&this._onSigninSuccess(c.data),this.serverToUserChannel&&this.serverToUserChannel.name===c.channel&&this.serverToUserChannel.handleEvent(c)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(r){try{this.user_data=JSON.parse(r.user_data)}catch{se.error(`Failed parsing user data after signin: ${r.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){se.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const r=c=>{c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.pusher.connection.state==="connected"&&c.subscribe()};this.serverToUserChannel=new _t(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((c,b)=>{c.indexOf("pusher_internal:")===0||c.indexOf("pusher:")===0||this.emit(c,b)}),r(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:r,resolve:c,reject:b}=dc();r.done=!1;const w=()=>{r.done=!0};r.then(w).catch(w),this.signinDonePromise=r,this._signinDoneResolve=c}}class ye{static ready(){ye.isReady=!0;for(var r=0,c=ye.instances.length;r<c;r++)ye.instances[r].connect()}static getClientFeatures(){return We($({ws:O.Transports.ws},function(r){return r.isSupported({})}))}constructor(r,c){uc(r),qd(c),this.key=r,this.config=Qd(c,this),this.channels=sn.createChannels(),this.global_emitter=new on,this.sessionID=O.randomInt(1e9),this.timeline=new jd(this.key,this.sessionID,{cluster:this.config.cluster,features:ye.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Gi.INFO,version:d.VERSION}),this.config.enableStats&&(this.timelineSender=sn.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+O.TimelineTransport.name}));var b=w=>O.getDefaultStrategy(this.config,w,Gd);this.connection=sn.createConnectionManager(this.key,{getStrategy:b,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",w=>{var L=w.event,E=L.indexOf("pusher_internal:")===0;if(w.channel){var B=this.channel(w.channel);B&&B.handleEvent(w)}E||this.global_emitter.emit(w.event,w.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",w=>{se.warn(w)}),ye.instances.push(this),this.timeline.info({instances:ye.instances.length}),this.user=new cc(this),ye.isReady&&this.connect()}channel(r){return this.channels.find(r)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var r=this.connection.isUsingTLS(),c=this.timelineSender;this.timelineSenderTimer=new tn(6e4,function(){c.send(r)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(r,c,b){return this.global_emitter.bind(r,c,b),this}unbind(r,c,b){return this.global_emitter.unbind(r,c,b),this}bind_global(r){return this.global_emitter.bind_global(r),this}unbind_global(r){return this.global_emitter.unbind_global(r),this}unbind_all(r){return this.global_emitter.unbind_all(),this}subscribeAll(){var r;for(r in this.channels.channels)this.channels.channels.hasOwnProperty(r)&&this.subscribe(r)}subscribe(r){var c=this.channels.add(r,this);return c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.connection.state==="connected"&&c.subscribe(),c}unsubscribe(r){var c=this.channels.find(r);c&&c.subscriptionPending?c.cancelSubscription():(c=this.channels.remove(r),c&&c.subscribed&&c.unsubscribe())}send_event(r,c,b){return this.connection.send_event(r,c,b)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}ye.instances=[],ye.isReady=!1,ye.logToConsole=!1,ye.Runtime=O,ye.ScriptReceivers=O.ScriptReceivers,ye.DependenciesReceivers=O.DependenciesReceivers,ye.auth_callbacks=O.auth_callbacks;var Pt=t.default=ye;function uc(u){if(u==null)throw"You must pass your app key when you instantiate Pusher."}O.setup(ye)}])})})(Zo);var Zr=Zo.exports;const Jr=Wr(Zr);class Jo{constructor(e){h(this,"container");h(this,"onAction");h(this,"onFail");h(this,"initialTime");h(this,"timeLeft");h(this,"timerId");h(this,"payment");this.container=e.container,this.onAction=e.onAction,this.onFail=e.onFail,this.initialTime=1800,this.timeLeft=this.initialTime,this.timerId=null}attachListener(){const e=this.container.querySelector("#transfer-acn"),i=this.container.querySelector("#copy-acn"),t=this.container.querySelector("#acn-tooltip"),o=this.container.querySelector("#transfer-amount"),s=this.container.querySelector("#copy-amount"),a=this.container.querySelector("#amount-tooltip"),l=this.container.querySelector("#transfer-button");i&&e&&i.addEventListener("click",()=>{P.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Started"}),t&&this.copyToClipboard(e.innerHTML,t)}),s&&o&&s.addEventListener("click",()=>{P.track("copy_transferAmount",{payment_method:"Transfer"}),a&&this.copyToClipboard(o.innerHTML.split(" ")[1].replace(/,/g,""),a)}),l&&l.addEventListener("click",()=>{this.onAction(5),P.track("initiate_payment_verification",{payment_method:"Transfer"})})}startTimer(e){this.stopTimer(),this.timerId=window.setInterval(()=>{if(this.timeLeft>0){this.timeLeft-=1;const i=this.container.querySelector("#time-left");i&&(i.innerHTML=zn(this.timeLeft))}else this.stopTimer(),e==="check"&&this.onAction(2)},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}copyToClipboard(e,i){navigator.clipboard.writeText(e).then(()=>{i.innerHTML="Copied!"}).catch(()=>{i.innerHTML="Failed to copy"})}renderComponent(e){var g,f,y,k,C,S;e&&(this.payment=e),this.container.innerHTML=this.render();const i=this.container.querySelector("#transfer-amount"),t=this.container.querySelector("#transfer-bank"),o=this.container.querySelector("#account-name"),s=this.container.querySelector("#transfer-acn"),a=this.container.querySelector("#time-left"),l=((g=this.payment)==null?void 0:g.currency)||"USD",d=l==="USD"?(f=this.payment)==null?void 0:f.localCurrency:l;if(i&&(i.innerHTML=`${d} ${xe(this.payment.totalTaxAmount?this.payment.totalLocalAmount:l==="USD"?(y=this.payment)==null?void 0:y.localAmount:(k=this.payment)==null?void 0:k.amount,2)}`),t&&this.payment.bankDetails&&(t.innerHTML=(C=this.payment.bankDetails)==null?void 0:C.bankName),o&&this.payment.bankDetails&&(o.innerHTML=(S=this.payment.bankDetails)==null?void 0:S.accountName),s&&this.payment.bankDetails&&(s.innerHTML=this.payment.bankDetails.accountNumber),a&&(a.innerHTML=zn(this.initialTime)),this.startTimer("poll"),e.status==="inProgress"){const M="45654f3ce4c9512ea9a4",A="us2";var v=new Jr(M,{cluster:A}),p=v.subscribe(e.reference);p.bind("payment_status",_=>{_.status==="successful"?(clearInterval(this.timerId||void 0),this.onAction(6),P.track("verify_payment",{payment_method:"Transfer",verification_status:"Success"}),_!=null&&_.redirectUrl&&setTimeout(()=>{const T=new URL(_.redirectUrl);T.searchParams.append("status",_.status),T.searchParams.append("reference",_.reference),window.location.href=T.toString()},1800)):_.status==="failed"&&(clearInterval(this.timerId||void 0),this.onFail(7,"Transfer failed"),P.track("verify_payment",{payment_method:"Transfer",verification_status:"Failed"}))})}this.attachListener()}render(){return qr}}const $r=`<div id="trasferConfirmationProgress">
1147
+ */(function(n,e){(function(t,o){n.exports=o()})(window,function(){return function(i){var t={};function o(s){if(t[s])return t[s].exports;var a=t[s]={i:s,l:!1,exports:{}};return i[s].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=i,o.c=t,o.d=function(s,a,l){o.o(s,a)||Object.defineProperty(s,a,{enumerable:!0,get:l})},o.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},o.t=function(s,a){if(a&1&&(s=o(s)),a&8||a&4&&typeof s=="object"&&s&&s.__esModule)return s;var l=Object.create(null);if(o.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:s}),a&2&&typeof s!="string")for(var d in s)o.d(l,d,(function(v){return s[v]}).bind(null,d));return l},o.n=function(s){var a=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(a,"a",a),a},o.o=function(s,a){return Object.prototype.hasOwnProperty.call(s,a)},o.p="",o(o.s=2)}([function(i,t,o){var s=this&&this.__extends||function(){var C=function(S,M){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,_){A.__proto__=_}||function(A,_){for(var T in _)_.hasOwnProperty(T)&&(A[T]=_[T])},C(S,M)};return function(S,M){C(S,M);function A(){this.constructor=S}S.prototype=M===null?Object.create(M):(A.prototype=M.prototype,new A)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=256,l=function(){function C(S){S===void 0&&(S="="),this._paddingCharacter=S}return C.prototype.encodedLength=function(S){return this._paddingCharacter?(S+2)/3*4|0:(S*8+5)/6|0},C.prototype.encode=function(S){for(var M="",A=0;A<S.length-2;A+=3){var _=S[A]<<16|S[A+1]<<8|S[A+2];M+=this._encodeByte(_>>>3*6&63),M+=this._encodeByte(_>>>2*6&63),M+=this._encodeByte(_>>>1*6&63),M+=this._encodeByte(_>>>0*6&63)}var T=S.length-A;if(T>0){var _=S[A]<<16|(T===2?S[A+1]<<8:0);M+=this._encodeByte(_>>>3*6&63),M+=this._encodeByte(_>>>2*6&63),T===2?M+=this._encodeByte(_>>>1*6&63):M+=this._paddingCharacter||"",M+=this._paddingCharacter||""}return M},C.prototype.maxDecodedLength=function(S){return this._paddingCharacter?S/4*3|0:(S*6+7)/8|0},C.prototype.decodedLength=function(S){return this.maxDecodedLength(S.length-this._getPaddingLength(S))},C.prototype.decode=function(S){if(S.length===0)return new Uint8Array(0);for(var M=this._getPaddingLength(S),A=S.length-M,_=new Uint8Array(this.maxDecodedLength(A)),T=0,I=0,K=0,G=0,V=0,F=0,oe=0;I<A-4;I+=4)G=this._decodeChar(S.charCodeAt(I+0)),V=this._decodeChar(S.charCodeAt(I+1)),F=this._decodeChar(S.charCodeAt(I+2)),oe=this._decodeChar(S.charCodeAt(I+3)),_[T++]=G<<2|V>>>4,_[T++]=V<<4|F>>>2,_[T++]=F<<6|oe,K|=G&a,K|=V&a,K|=F&a,K|=oe&a;if(I<A-1&&(G=this._decodeChar(S.charCodeAt(I)),V=this._decodeChar(S.charCodeAt(I+1)),_[T++]=G<<2|V>>>4,K|=G&a,K|=V&a),I<A-2&&(F=this._decodeChar(S.charCodeAt(I+2)),_[T++]=V<<4|F>>>2,K|=F&a),I<A-3&&(oe=this._decodeChar(S.charCodeAt(I+3)),_[T++]=F<<6|oe,K|=oe&a),K!==0)throw new Error("Base64Coder: incorrect characters for decoding");return _},C.prototype._encodeByte=function(S){var M=S;return M+=65,M+=25-S>>>8&6,M+=51-S>>>8&-75,M+=61-S>>>8&-15,M+=62-S>>>8&3,String.fromCharCode(M)},C.prototype._decodeChar=function(S){var M=a;return M+=(42-S&S-44)>>>8&-a+S-43+62,M+=(46-S&S-48)>>>8&-a+S-47+63,M+=(47-S&S-58)>>>8&-a+S-48+52,M+=(64-S&S-91)>>>8&-a+S-65+0,M+=(96-S&S-123)>>>8&-a+S-97+26,M},C.prototype._getPaddingLength=function(S){var M=0;if(this._paddingCharacter){for(var A=S.length-1;A>=0&&S[A]===this._paddingCharacter;A--)M++;if(S.length<4||M>2)throw new Error("Base64Coder: incorrect padding")}return M},C}();t.Coder=l;var d=new l;function v(C){return d.encode(C)}t.encode=v;function p(C){return d.decode(C)}t.decode=p;var g=function(C){s(S,C);function S(){return C!==null&&C.apply(this,arguments)||this}return S.prototype._encodeByte=function(M){var A=M;return A+=65,A+=25-M>>>8&6,A+=51-M>>>8&-75,A+=61-M>>>8&-13,A+=62-M>>>8&49,String.fromCharCode(A)},S.prototype._decodeChar=function(M){var A=a;return A+=(44-M&M-46)>>>8&-a+M-45+62,A+=(94-M&M-96)>>>8&-a+M-95+63,A+=(47-M&M-58)>>>8&-a+M-48+52,A+=(64-M&M-91)>>>8&-a+M-65+0,A+=(96-M&M-123)>>>8&-a+M-97+26,A},S}(l);t.URLSafeCoder=g;var f=new g;function y(C){return f.encode(C)}t.encodeURLSafe=y;function k(C){return f.decode(C)}t.decodeURLSafe=k,t.encodedLength=function(C){return d.encodedLength(C)},t.maxDecodedLength=function(C){return d.maxDecodedLength(C)},t.decodedLength=function(C){return d.decodedLength(C)}},function(i,t,o){Object.defineProperty(t,"__esModule",{value:!0});var s="utf8: invalid string",a="utf8: invalid source encoding";function l(p){for(var g=new Uint8Array(d(p)),f=0,y=0;y<p.length;y++){var k=p.charCodeAt(y);k<128?g[f++]=k:k<2048?(g[f++]=192|k>>6,g[f++]=128|k&63):k<55296?(g[f++]=224|k>>12,g[f++]=128|k>>6&63,g[f++]=128|k&63):(y++,k=(k&1023)<<10,k|=p.charCodeAt(y)&1023,k+=65536,g[f++]=240|k>>18,g[f++]=128|k>>12&63,g[f++]=128|k>>6&63,g[f++]=128|k&63)}return g}t.encode=l;function d(p){for(var g=0,f=0;f<p.length;f++){var y=p.charCodeAt(f);if(y<128)g+=1;else if(y<2048)g+=2;else if(y<55296)g+=3;else if(y<=57343){if(f>=p.length-1)throw new Error(s);f++,g+=4}else throw new Error(s)}return g}t.encodedLength=d;function v(p){for(var g=[],f=0;f<p.length;f++){var y=p[f];if(y&128){var k=void 0;if(y<224){if(f>=p.length)throw new Error(a);var C=p[++f];if((C&192)!==128)throw new Error(a);y=(y&31)<<6|C&63,k=128}else if(y<240){if(f>=p.length-1)throw new Error(a);var C=p[++f],S=p[++f];if((C&192)!==128||(S&192)!==128)throw new Error(a);y=(y&15)<<12|(C&63)<<6|S&63,k=2048}else if(y<248){if(f>=p.length-2)throw new Error(a);var C=p[++f],S=p[++f],M=p[++f];if((C&192)!==128||(S&192)!==128||(M&192)!==128)throw new Error(a);y=(y&15)<<18|(C&63)<<12|(S&63)<<6|M&63,k=65536}else throw new Error(a);if(y<k||y>=55296&&y<=57343)throw new Error(a);if(y>=65536){if(y>1114111)throw new Error(a);y-=65536,g.push(String.fromCharCode(55296|y>>10)),y=56320|y&1023}}g.push(String.fromCharCode(y))}return g.join("")}t.decode=v},function(i,t,o){i.exports=o(3).default},function(i,t,o){o.r(t);class s{constructor(r,c){this.lastId=0,this.prefix=r,this.name=c}create(r){this.lastId++;var c=this.lastId,b=this.prefix+c,w=this.name+"["+c+"]",L=!1,E=function(){L||(r.apply(null,arguments),L=!0)};return this[c]=E,{number:c,id:b,name:w,callback:E}}remove(r){delete this[r.number]}}var a=new s("_pusher_script_","Pusher.ScriptReceivers"),l={VERSION:"8.4.0",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},d=l;class v{constructor(r){this.options=r,this.receivers=r.receivers||a,this.loading={}}load(r,c,b){var w=this;if(w.loading[r]&&w.loading[r].length>0)w.loading[r].push(b);else{w.loading[r]=[b];var L=O.createScriptRequest(w.getPath(r,c)),E=w.receivers.create(function(D){if(w.receivers.remove(E),w.loading[r]){var R=w.loading[r];delete w.loading[r];for(var Z=function(pe){pe||L.cleanup()},X=0;X<R.length;X++)R[X](D,Z)}});L.send(E)}}getRoot(r){var c,b=O.getDocument().location.protocol;return r&&r.useTLS||b==="https:"?c=this.options.cdn_https:c=this.options.cdn_http,c.replace(/\/*$/,"")+"/"+this.options.version}getPath(r,c){return this.getRoot(c)+"/"+r+this.options.suffix+".js"}}var p=new s("_pusher_dependencies","Pusher.DependenciesReceivers"),g=new v({cdn_http:d.cdn_http,cdn_https:d.cdn_https,version:d.VERSION,suffix:d.dependency_suffix,receivers:p});const f={baseUrl:"https://pusher.com",urls:{authenticationEndpoint:{path:"/docs/channels/server_api/authenticating_users"},authorizationEndpoint:{path:"/docs/channels/server_api/authorizing-users/"},javascriptQuickStart:{path:"/docs/javascript_quick_start"},triggeringClientEvents:{path:"/docs/client_api_guide/client_events#trigger-events"},encryptedChannelSupport:{fullUrl:"https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support"}}};var k={buildLogSuffix:function(u){const r="See:",c=f.urls[u];if(!c)return"";let b;return c.fullUrl?b=c.fullUrl:c.path&&(b=f.baseUrl+c.path),b?`${r} ${b}`:""}},C;(function(u){u.UserAuthentication="user-authentication",u.ChannelAuthorization="channel-authorization"})(C||(C={}));class S extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class M extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class A extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class _ extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class T extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class I extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class K extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class G extends Error{constructor(r){super(r),Object.setPrototypeOf(this,new.target.prototype)}}class V extends Error{constructor(r,c){super(c),this.status=r,Object.setPrototypeOf(this,new.target.prototype)}}var oe=function(u,r,c,b,w){const L=O.createXHR();L.open("POST",c.endpoint,!0),L.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var E in c.headers)L.setRequestHeader(E,c.headers[E]);if(c.headersProvider!=null){let D=c.headersProvider();for(var E in D)L.setRequestHeader(E,D[E])}return L.onreadystatechange=function(){if(L.readyState===4)if(L.status===200){let D,R=!1;try{D=JSON.parse(L.responseText),R=!0}catch{w(new V(200,`JSON returned from ${b.toString()} endpoint was invalid, yet status code was 200. Data was: ${L.responseText}`),null)}R&&w(null,D)}else{let D="";switch(b){case C.UserAuthentication:D=k.buildLogSuffix("authenticationEndpoint");break;case C.ChannelAuthorization:D=`Clients must be authorized to join private or presence channels. ${k.buildLogSuffix("authorizationEndpoint")}`;break}w(new V(L.status,`Unable to retrieve auth string from ${b.toString()} endpoint - received status: ${L.status} from ${c.endpoint}. ${D}`),null)}},L.send(r),L};function ge(u){return en(Te(u))}var U=String.fromCharCode,_e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ue=function(u){var r=u.charCodeAt(0);return r<128?u:r<2048?U(192|r>>>6)+U(128|r&63):U(224|r>>>12&15)+U(128|r>>>6&63)+U(128|r&63)},Te=function(u){return u.replace(/[^\x00-\x7F]/g,ue)},Me=function(u){var r=[0,2,1][u.length%3],c=u.charCodeAt(0)<<16|(u.length>1?u.charCodeAt(1):0)<<8|(u.length>2?u.charCodeAt(2):0),b=[_e.charAt(c>>>18),_e.charAt(c>>>12&63),r>=2?"=":_e.charAt(c>>>6&63),r>=1?"=":_e.charAt(c&63)];return b.join("")},en=window.btoa||function(u){return u.replace(/[\s\S]{1,3}/g,Me)};class vn{constructor(r,c,b,w){this.clear=c,this.timer=r(()=>{this.timer&&(this.timer=w(this.timer))},b)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var nn=vn;function _n(u){window.clearTimeout(u)}function bn(u){window.clearInterval(u)}class Ee extends nn{constructor(r,c){super(setTimeout,_n,r,function(b){return c(),null})}}class tn extends nn{constructor(r,c){super(setInterval,bn,r,function(b){return c(),b})}}var Mn={now(){return Date.now?Date.now():new Date().valueOf()},defer(u){return new Ee(0,u)},method(u,...r){var c=Array.prototype.slice.call(arguments,1);return function(b){return b[u].apply(b,c.concat(arguments))}}},re=Mn;function fe(u,...r){for(var c=0;c<r.length;c++){var b=r[c];for(var w in b)b[w]&&b[w].constructor&&b[w].constructor===Object?u[w]=fe(u[w]||{},b[w]):u[w]=b[w]}return u}function Re(){for(var u=["Pusher"],r=0;r<arguments.length;r++)typeof arguments[r]=="string"?u.push(arguments[r]):u.push(An(arguments[r]));return u.join(" : ")}function Pe(u,r){var c=Array.prototype.indexOf;if(u===null)return-1;if(c&&u.indexOf===c)return u.indexOf(r);for(var b=0,w=u.length;b<w;b++)if(u[b]===r)return b;return-1}function we(u,r){for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&r(u[c],c,u)}function We(u){var r=[];return we(u,function(c,b){r.push(b)}),r}function B(u){var r=[];return we(u,function(c){r.push(c)}),r}function he(u,r,c){for(var b=0;b<u.length;b++)r.call(c||window,u[b],b,u)}function Q(u,r){for(var c=[],b=0;b<u.length;b++)c.push(r(u[b],b,u,c));return c}function me(u,r){var c={};return we(u,function(b,w){c[w]=r(b)}),c}function Ie(u,r){r=r||function(w){return!!w};for(var c=[],b=0;b<u.length;b++)r(u[b],b,u,c)&&c.push(u[b]);return c}function $(u,r){var c={};return we(u,function(b,w){(r&&r(b,w,u,c)||b)&&(c[w]=b)}),c}function fn(u){var r=[];return we(u,function(c,b){r.push([b,c])}),r}function si(u,r){for(var c=0;c<u.length;c++)if(r(u[c],c,u))return!0;return!1}function Oi(u,r){for(var c=0;c<u.length;c++)if(!r(u[c],c,u))return!1;return!0}function Vi(u){return me(u,function(r){return typeof r=="object"&&(r=An(r)),encodeURIComponent(ge(r.toString()))})}function Ui(u){var r=$(u,function(b){return b!==void 0}),c=Q(fn(Vi(r)),re.method("join","=")).join("&");return c}function ji(u){var r=[],c=[];return function b(w,L){var E,D,R;switch(typeof w){case"object":if(!w)return null;for(E=0;E<r.length;E+=1)if(r[E]===w)return{$ref:c[E]};if(r.push(w),c.push(L),Object.prototype.toString.apply(w)==="[object Array]")for(R=[],E=0;E<w.length;E+=1)R[E]=b(w[E],L+"["+E+"]");else{R={};for(D in w)Object.prototype.hasOwnProperty.call(w,D)&&(R[D]=b(w[D],L+"["+JSON.stringify(D)+"]"))}return R;case"number":case"string":case"boolean":return w}}(u,"$")}function An(u){try{return JSON.stringify(u)}catch{return JSON.stringify(ji(u))}}class ai{constructor(){this.globalLog=r=>{window.console&&window.console.log&&window.console.log(r)}}debug(...r){this.log(this.globalLog,r)}warn(...r){this.log(this.globalLogWarn,r)}error(...r){this.log(this.globalLogError,r)}globalLogWarn(r){window.console&&window.console.warn?window.console.warn(r):this.globalLog(r)}globalLogError(r){window.console&&window.console.error?window.console.error(r):this.globalLogWarn(r)}log(r,...c){var b=Re.apply(this,arguments);Pt.log?Pt.log(b):Pt.logToConsole&&r.bind(this)(b)}}var se=new ai,El=function(u,r,c,b,w){(c.headers!==void 0||c.headersProvider!=null)&&se.warn(`To send headers with the ${b.toString()} request, you must use AJAX, rather than JSONP.`);var L=u.nextAuthCallbackID.toString();u.nextAuthCallbackID++;var E=u.getDocument(),D=E.createElement("script");u.auth_callbacks[L]=function(X){w(null,X)};var R="Pusher.auth_callbacks['"+L+"']";D.src=c.endpoint+"?callback="+encodeURIComponent(R)+"&"+r;var Z=E.getElementsByTagName("head")[0]||E.documentElement;Z.insertBefore(D,Z.firstChild)},Pl=El;class Il{constructor(r){this.src=r}send(r){var c=this,b="Error loading "+c.src;c.script=document.createElement("script"),c.script.id=r.id,c.script.src=c.src,c.script.type="text/javascript",c.script.charset="UTF-8",c.script.addEventListener?(c.script.onerror=function(){r.callback(b)},c.script.onload=function(){r.callback(null)}):c.script.onreadystatechange=function(){(c.script.readyState==="loaded"||c.script.readyState==="complete")&&r.callback(null)},c.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(c.errorScript=document.createElement("script"),c.errorScript.id=r.id+"_error",c.errorScript.text=r.name+"('"+b+"');",c.script.async=c.errorScript.async=!1):c.script.async=!0;var w=document.getElementsByTagName("head")[0];w.insertBefore(c.script,w.firstChild),c.errorScript&&w.insertBefore(c.errorScript,c.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class Dl{constructor(r,c){this.url=r,this.data=c}send(r){if(!this.request){var c=Ui(this.data),b=this.url+"/"+r.number+"?"+c;this.request=O.createScriptRequest(b),this.request.send(r)}}cleanup(){this.request&&this.request.cleanup()}}var Bl=function(u,r){return function(c,b){var w="http"+(r?"s":"")+"://",L=w+(u.host||u.options.host)+u.options.path,E=O.createJSONPRequest(L,c),D=O.ScriptReceivers.create(function(R,Z){a.remove(D),E.cleanup(),Z&&Z.host&&(u.host=Z.host),b&&b(R,Z)});E.send(D)}},Nl={name:"jsonp",getAgent:Bl},Hl=Nl;function wt(u,r,c){var b=u+(r.useTLS?"s":""),w=r.useTLS?r.hostTLS:r.hostNonTLS;return b+"://"+w+c}function kt(u,r){var c="/app/"+u,b="?protocol="+d.PROTOCOL+"&client=js&version="+d.VERSION+(r?"&"+r:"");return c+b}var Rl={getInitial:function(u,r){var c=(r.httpPath||"")+kt(u,"flash=false");return wt("ws",r,c)}},Ol={getInitial:function(u,r){var c=(r.httpPath||"/pusher")+kt(u);return wt("http",r,c)}},Vl={getInitial:function(u,r){return wt("http",r,r.httpPath||"/pusher")},getPath:function(u,r){return kt(u)}};class Ul{constructor(){this._callbacks={}}get(r){return this._callbacks[St(r)]}add(r,c,b){var w=St(r);this._callbacks[w]=this._callbacks[w]||[],this._callbacks[w].push({fn:c,context:b})}remove(r,c,b){if(!r&&!c&&!b){this._callbacks={};return}var w=r?[St(r)]:We(this._callbacks);c||b?this.removeCallback(w,c,b):this.removeAllCallbacks(w)}removeCallback(r,c,b){he(r,function(w){this._callbacks[w]=Ie(this._callbacks[w]||[],function(L){return c&&c!==L.fn||b&&b!==L.context}),this._callbacks[w].length===0&&delete this._callbacks[w]},this)}removeAllCallbacks(r){he(r,function(c){delete this._callbacks[c]},this)}}function St(u){return"_"+u}class on{constructor(r){this.callbacks=new Ul,this.global_callbacks=[],this.failThrough=r}bind(r,c,b){return this.callbacks.add(r,c,b),this}bind_global(r){return this.global_callbacks.push(r),this}unbind(r,c,b){return this.callbacks.remove(r,c,b),this}unbind_global(r){return r?(this.global_callbacks=Ie(this.global_callbacks||[],c=>c!==r),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(r,c,b){for(var w=0;w<this.global_callbacks.length;w++)this.global_callbacks[w](r,c);var L=this.callbacks.get(r),E=[];if(b?E.push(c,b):c&&E.push(c),L&&L.length>0)for(var w=0;w<L.length;w++)L[w].fn.apply(L[w].context||window,E);else this.failThrough&&this.failThrough(r,c);return this}}class jl extends on{constructor(r,c,b,w,L){super(),this.initialize=O.transportConnectionInitializer,this.hooks=r,this.name=c,this.priority=b,this.key=w,this.options=L,this.state="new",this.timeline=L.timeline,this.activityTimeout=L.activityTimeout,this.id=this.timeline.generateUniqueID()}handlesActivityChecks(){return!!this.hooks.handlesActivityChecks}supportsPing(){return!!this.hooks.supportsPing}connect(){if(this.socket||this.state!=="initialized")return!1;var r=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(r,this.options)}catch(c){return re.defer(()=>{this.onError(c),this.changeState("closed")}),!1}return this.bindListeners(),se.debug("Connecting",{transport:this.name,url:r}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(r){return this.state==="open"?(re.defer(()=>{this.socket&&this.socket.send(r)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(r){this.emit("error",{type:"WebSocketError",error:r}),this.timeline.error(this.buildTimelineMessage({error:r.toString()}))}onClose(r){r?this.changeState("closed",{code:r.code,reason:r.reason,wasClean:r.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(r){this.emit("message",r)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=r=>{this.onError(r)},this.socket.onclose=r=>{this.onClose(r)},this.socket.onmessage=r=>{this.onMessage(r)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(r,c){this.state=r,this.timeline.info(this.buildTimelineMessage({state:r,params:c})),this.emit(r,c)}buildTimelineMessage(r){return fe({cid:this.id},r)}}class Gn{constructor(r){this.hooks=r}isSupported(r){return this.hooks.isSupported(r)}createConnection(r,c,b,w){return new jl(this.hooks,r,c,b,w)}}var Kl=new Gn({urls:Rl,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!O.getWebSocketAPI()},isSupported:function(){return!!O.getWebSocketAPI()},getSocket:function(u){return O.createWebSocket(u)}}),ss={urls:Ol,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},as=fe({getSocket:function(u){return O.HTTPFactory.createStreamingSocket(u)}},ss),rs=fe({getSocket:function(u){return O.HTTPFactory.createPollingSocket(u)}},ss),ls={isSupported:function(){return O.isXHRSupported()}},Fl=new Gn(fe({},as,ls)),Gl=new Gn(fe({},rs,ls)),zl={ws:Kl,xhr_streaming:Fl,xhr_polling:Gl},Ki=zl,ql=new Gn({file:"sockjs",urls:Vl,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(u,r){return new window.SockJS(u,null,{js_path:g.getPath("sockjs",{useTLS:r.useTLS}),ignore_null_origin:r.ignoreNullOrigin})},beforeOpen:function(u,r){u.send(JSON.stringify({path:r}))}}),ds={isSupported:function(u){var r=O.isXDRSupported(u.useTLS);return r}},Wl=new Gn(fe({},as,ds)),Zl=new Gn(fe({},rs,ds));Ki.xdr_streaming=Wl,Ki.xdr_polling=Zl,Ki.sockjs=ql;var Jl=Ki;class $l extends on{constructor(){super();var r=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){r.emit("online")},!1),window.addEventListener("offline",function(){r.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var Yl=new $l;class Ql{constructor(r,c,b){this.manager=r,this.transport=c,this.minPingDelay=b.minPingDelay,this.maxPingDelay=b.maxPingDelay,this.pingDelay=void 0}createConnection(r,c,b,w){w=fe({},w,{activityTimeout:this.pingDelay});var L=this.transport.createConnection(r,c,b,w),E=null,D=function(){L.unbind("open",D),L.bind("closed",R),E=re.now()},R=Z=>{if(L.unbind("closed",R),Z.code===1002||Z.code===1003)this.manager.reportDeath();else if(!Z.wasClean&&E){var X=re.now()-E;X<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(X/2,this.minPingDelay))}};return L.bind("open",D),L}isSupported(r){return this.manager.isAlive()&&this.transport.isSupported(r)}}const cs={decodeMessage:function(u){try{var r=JSON.parse(u.data),c=r.data;if(typeof c=="string")try{c=JSON.parse(r.data)}catch{}var b={event:r.event,channel:r.channel,data:c};return r.user_id&&(b.user_id=r.user_id),b}catch(w){throw{type:"MessageParseError",error:w,data:u.data}}},encodeMessage:function(u){return JSON.stringify(u)},processHandshake:function(u){var r=cs.decodeMessage(u);if(r.event==="pusher:connection_established"){if(!r.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:r.data.socket_id,activityTimeout:r.data.activity_timeout*1e3}}else{if(r.event==="pusher:error")return{action:this.getCloseAction(r.data),error:this.getCloseError(r.data)};throw"Invalid handshake"}},getCloseAction:function(u){return u.code<4e3?u.code>=1002&&u.code<=1004?"backoff":null:u.code===4e3?"tls_only":u.code<4100?"refused":u.code<4200?"backoff":u.code<4300?"retry":"refused"},getCloseError:function(u){return u.code!==1e3&&u.code!==1001?{type:"PusherError",data:{code:u.code,message:u.reason||u.message}}:null}};var xn=cs;class Xl extends on{constructor(r,c){super(),this.id=r,this.transport=c,this.activityTimeout=c.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(r){return this.transport.send(r)}send_event(r,c,b){var w={event:r,data:c};return b&&(w.channel=b),se.debug("Event sent",w),this.send(xn.encodeMessage(w))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var r={message:b=>{var w;try{w=xn.decodeMessage(b)}catch(L){this.emit("error",{type:"MessageParseError",error:L,data:b.data})}if(w!==void 0){switch(se.debug("Event recd",w),w.event){case"pusher:error":this.emit("error",{type:"PusherError",data:w.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",w)}},activity:()=>{this.emit("activity")},error:b=>{this.emit("error",b)},closed:b=>{c(),b&&b.code&&this.handleCloseEvent(b),this.transport=null,this.emit("closed")}},c=()=>{we(r,(b,w)=>{this.transport.unbind(w,b)})};we(r,(b,w)=>{this.transport.bind(w,b)})}handleCloseEvent(r){var c=xn.getCloseAction(r),b=xn.getCloseError(r);b&&this.emit("error",b),c&&this.emit(c,{action:c,error:b})}}class ed{constructor(r,c){this.transport=r,this.callback=c,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=r=>{this.unbindListeners();var c;try{c=xn.processHandshake(r)}catch(b){this.finish("error",{error:b}),this.transport.close();return}c.action==="connected"?this.finish("connected",{connection:new Xl(c.id,this.transport),activityTimeout:c.activityTimeout}):(this.finish(c.action,{error:c.error}),this.transport.close())},this.onClosed=r=>{this.unbindListeners();var c=xn.getCloseAction(r)||"backoff",b=xn.getCloseError(r);this.finish(c,{error:b})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(r,c){this.callback(fe({transport:this.transport,action:r},c))}}class nd{constructor(r,c){this.timeline=r,this.options=c||{}}send(r,c){this.timeline.isEmpty()||this.timeline.send(O.TimelineTransport.getAgent(this,r),c)}}class _t extends on{constructor(r,c){super(function(b,w){se.debug("No callbacks on "+r+" for "+b)}),this.name=r,this.pusher=c,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(r,c){return c(null,{auth:""})}trigger(r,c){if(r.indexOf("client-")!==0)throw new S("Event '"+r+"' does not start with 'client-'");if(!this.subscribed){var b=k.buildLogSuffix("triggeringClientEvents");se.warn(`Client event triggered before channel 'subscription_succeeded' event . ${b}`)}return this.pusher.send_event(r,c,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(r){var c=r.event,b=r.data;if(c==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(r);else if(c==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(r);else if(c.indexOf("pusher_internal:")!==0){var w={};this.emit(c,b,w)}}handleSubscriptionSucceededEvent(r){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",r.data)}handleSubscriptionCountEvent(r){r.data.subscription_count&&(this.subscriptionCount=r.data.subscription_count),this.emit("pusher:subscription_count",r.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(r,c)=>{r?(this.subscriptionPending=!1,se.error(r.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:r.message},r instanceof V?{status:r.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:c.auth,channel_data:c.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class Mt extends _t{authorize(r,c){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:r},c)}}class id{constructor(){this.reset()}get(r){return Object.prototype.hasOwnProperty.call(this.members,r)?{id:r,info:this.members[r]}:null}each(r){we(this.members,(c,b)=>{r(this.get(b))})}setMyID(r){this.myID=r}onSubscription(r){this.members=r.presence.hash,this.count=r.presence.count,this.me=this.get(this.myID)}addMember(r){return this.get(r.user_id)===null&&this.count++,this.members[r.user_id]=r.user_info,this.get(r.user_id)}removeMember(r){var c=this.get(r.user_id);return c&&(delete this.members[r.user_id],this.count--),c}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var td=function(u,r,c,b){function w(L){return L instanceof c?L:new c(function(E){E(L)})}return new(c||(c=Promise))(function(L,E){function D(X){try{Z(b.next(X))}catch(pe){E(pe)}}function R(X){try{Z(b.throw(X))}catch(pe){E(pe)}}function Z(X){X.done?L(X.value):w(X.value).then(D,R)}Z((b=b.apply(u,r||[])).next())})};class od extends Mt{constructor(r,c){super(r,c),this.members=new id}authorize(r,c){super.authorize(r,(b,w)=>td(this,void 0,void 0,function*(){if(!b)if(w=w,w.channel_data!=null){var L=JSON.parse(w.channel_data);this.members.setMyID(L.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let E=k.buildLogSuffix("authorizationEndpoint");se.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${E}, or the user should be signed in.`),c("Invalid auth response");return}c(b,w)}))}handleEvent(r){var c=r.event;if(c.indexOf("pusher_internal:")===0)this.handleInternalEvent(r);else{var b=r.data,w={};r.user_id&&(w.user_id=r.user_id),this.emit(c,b,w)}}handleInternalEvent(r){var c=r.event,b=r.data;switch(c){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(r);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(r);break;case"pusher_internal:member_added":var w=this.members.addMember(b);this.emit("pusher:member_added",w);break;case"pusher_internal:member_removed":var L=this.members.removeMember(b);L&&this.emit("pusher:member_removed",L);break}}handleSubscriptionSucceededEvent(r){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(r.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var sd=o(1),At=o(0);class ad extends Mt{constructor(r,c,b){super(r,c),this.key=null,this.nacl=b}authorize(r,c){super.authorize(r,(b,w)=>{if(b){c(b,w);return}let L=w.shared_secret;if(!L){c(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(At.decode)(L),delete w.shared_secret,c(null,w)})}trigger(r,c){throw new I("Client events are not currently supported for encrypted channels")}handleEvent(r){var c=r.event,b=r.data;if(c.indexOf("pusher_internal:")===0||c.indexOf("pusher:")===0){super.handleEvent(r);return}this.handleEncryptedEvent(c,b)}handleEncryptedEvent(r,c){if(!this.key){se.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!c.ciphertext||!c.nonce){se.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+c);return}let b=Object(At.decode)(c.ciphertext);if(b.length<this.nacl.secretbox.overheadLength){se.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${b.length}`);return}let w=Object(At.decode)(c.nonce);if(w.length<this.nacl.secretbox.nonceLength){se.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${w.length}`);return}let L=this.nacl.secretbox.open(b,w,this.key);if(L===null){se.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."),this.authorize(this.pusher.connection.socket_id,(E,D)=>{if(E){se.error(`Failed to make a request to the authEndpoint: ${D}. Unable to fetch new key, so dropping encrypted event`);return}if(L=this.nacl.secretbox.open(b,w,this.key),L===null){se.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(r,this.getDataToEmit(L))});return}this.emit(r,this.getDataToEmit(L))}getDataToEmit(r){let c=Object(sd.decode)(r);try{return JSON.parse(c)}catch{return c}}}class rd extends on{constructor(r,c){super(),this.state="initialized",this.connection=null,this.key=r,this.options=c,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var b=O.getNetwork();b.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),b.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(r){return this.connection?this.connection.send(r):!1}send_event(r,c,b){return this.connection?this.connection.send_event(r,c,b):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var r=(c,b)=>{c?this.runner=this.strategy.connect(0,r):b.action==="error"?(this.emit("error",{type:"HandshakeError",error:b.error}),this.timeline.error({handshakeError:b.error})):(this.abortConnecting(),this.handshakeCallbacks[b.action](b))};this.runner=this.strategy.connect(0,r)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var r=this.abandonConnection();r.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(r){this.timeline.info({action:"retry",delay:r}),r>0&&this.emit("connecting_in",Math.round(r/1e3)),this.retryTimer=new Ee(r||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new Ee(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Ee(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new Ee(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(r){return fe({},r,{message:c=>{this.resetActivityCheck(),this.emit("message",c)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:c=>{this.emit("error",c)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(r){return fe({},r,{connected:c=>{this.activityTimeout=Math.min(this.options.activityTimeout,c.activityTimeout,c.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(c.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let r=c=>b=>{b.error&&this.emit("error",{type:"WebSocketError",error:b.error}),c(b)};return{tls_only:r(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:r(()=>{this.disconnect()}),backoff:r(()=>{this.retryIn(1e3)}),retry:r(()=>{this.retryIn(0)})}}setConnection(r){this.connection=r;for(var c in this.connectionCallbacks)this.connection.bind(c,this.connectionCallbacks[c]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var r in this.connectionCallbacks)this.connection.unbind(r,this.connectionCallbacks[r]);var c=this.connection;return this.connection=null,c}}updateState(r,c){var b=this.state;if(this.state=r,b!==r){var w=r;w==="connected"&&(w+=" with new socket ID "+c.socket_id),se.debug("State changed",b+" -> "+w),this.timeline.info({state:r,params:c}),this.emit("state_change",{previous:b,current:r}),this.emit(r,c)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class ld{constructor(){this.channels={}}add(r,c){return this.channels[r]||(this.channels[r]=dd(r,c)),this.channels[r]}all(){return B(this.channels)}find(r){return this.channels[r]}remove(r){var c=this.channels[r];return delete this.channels[r],c}disconnect(){we(this.channels,function(r){r.disconnect()})}}function dd(u,r){if(u.indexOf("private-encrypted-")===0){if(r.config.nacl)return sn.createEncryptedChannel(u,r,r.config.nacl);let c="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",b=k.buildLogSuffix("encryptedChannelSupport");throw new I(`${c}. ${b}`)}else{if(u.indexOf("private-")===0)return sn.createPrivateChannel(u,r);if(u.indexOf("presence-")===0)return sn.createPresenceChannel(u,r);if(u.indexOf("#")===0)throw new M('Cannot create a channel with name "'+u+'".');return sn.createChannel(u,r)}}var cd={createChannels(){return new ld},createConnectionManager(u,r){return new rd(u,r)},createChannel(u,r){return new _t(u,r)},createPrivateChannel(u,r){return new Mt(u,r)},createPresenceChannel(u,r){return new od(u,r)},createEncryptedChannel(u,r,c){return new ad(u,r,c)},createTimelineSender(u,r){return new nd(u,r)},createHandshake(u,r){return new ed(u,r)},createAssistantToTheTransportManager(u,r,c){return new Ql(u,r,c)}},sn=cd;class us{constructor(r){this.options=r||{},this.livesLeft=this.options.lives||1/0}getAssistant(r){return sn.createAssistantToTheTransportManager(this,r,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Ln{constructor(r,c){this.strategies=r,this.loop=!!c.loop,this.failFast=!!c.failFast,this.timeout=c.timeout,this.timeoutLimit=c.timeoutLimit}isSupported(){return si(this.strategies,re.method("isSupported"))}connect(r,c){var b=this.strategies,w=0,L=this.timeout,E=null,D=(R,Z)=>{Z?c(null,Z):(w=w+1,this.loop&&(w=w%b.length),w<b.length?(L&&(L=L*2,this.timeoutLimit&&(L=Math.min(L,this.timeoutLimit))),E=this.tryStrategy(b[w],r,{timeout:L,failFast:this.failFast},D)):c(!0))};return E=this.tryStrategy(b[w],r,{timeout:L,failFast:this.failFast},D),{abort:function(){E.abort()},forceMinPriority:function(R){r=R,E&&E.forceMinPriority(R)}}}tryStrategy(r,c,b,w){var L=null,E=null;return b.timeout>0&&(L=new Ee(b.timeout,function(){E.abort(),w(!0)})),E=r.connect(c,function(D,R){D&&L&&L.isRunning()&&!b.failFast||(L&&L.ensureAborted(),w(D,R))}),{abort:function(){L&&L.ensureAborted(),E.abort()},forceMinPriority:function(D){E.forceMinPriority(D)}}}}class xt{constructor(r){this.strategies=r}isSupported(){return si(this.strategies,re.method("isSupported"))}connect(r,c){return ud(this.strategies,r,function(b,w){return function(L,E){if(w[b].error=L,L){hd(w)&&c(!0);return}he(w,function(D){D.forceMinPriority(E.transport.priority)}),c(null,E)}})}}function ud(u,r,c){var b=Q(u,function(w,L,E,D){return w.connect(r,c(L,D))});return{abort:function(){he(b,md)},forceMinPriority:function(w){he(b,function(L){L.forceMinPriority(w)})}}}function hd(u){return Oi(u,function(r){return!!r.error})}function md(u){!u.error&&!u.aborted&&(u.abort(),u.aborted=!0)}class pd{constructor(r,c,b){this.strategy=r,this.transports=c,this.ttl=b.ttl||1800*1e3,this.usingTLS=b.useTLS,this.timeline=b.timeline}isSupported(){return this.strategy.isSupported()}connect(r,c){var b=this.usingTLS,w=vd(b),L=w&&w.cacheSkipCount?w.cacheSkipCount:0,E=[this.strategy];if(w&&w.timestamp+this.ttl>=re.now()){var D=this.transports[w.transport];D&&(["ws","wss"].includes(w.transport)||L>3?(this.timeline.info({cached:!0,transport:w.transport,latency:w.latency}),E.push(new Ln([D],{timeout:w.latency*2+1e3,failFast:!0}))):L++)}var R=re.now(),Z=E.pop().connect(r,function X(pe,zi){pe?(hs(b),E.length>0?(R=re.now(),Z=E.pop().connect(r,X)):c(pe)):(bd(b,zi.transport.name,re.now()-R,L),c(null,zi))});return{abort:function(){Z.abort()},forceMinPriority:function(X){r=X,Z&&Z.forceMinPriority(X)}}}}function Lt(u){return"pusherTransport"+(u?"TLS":"NonTLS")}function vd(u){var r=O.getLocalStorage();if(r)try{var c=r[Lt(u)];if(c)return JSON.parse(c)}catch{hs(u)}return null}function bd(u,r,c,b){var w=O.getLocalStorage();if(w)try{w[Lt(u)]=An({timestamp:re.now(),transport:r,latency:c,cacheSkipCount:b})}catch{}}function hs(u){var r=O.getLocalStorage();if(r)try{delete r[Lt(u)]}catch{}}class Fi{constructor(r,{delay:c}){this.strategy=r,this.options={delay:c}}isSupported(){return this.strategy.isSupported()}connect(r,c){var b=this.strategy,w,L=new Ee(this.options.delay,function(){w=b.connect(r,c)});return{abort:function(){L.ensureAborted(),w&&w.abort()},forceMinPriority:function(E){r=E,w&&w.forceMinPriority(E)}}}}class ri{constructor(r,c,b){this.test=r,this.trueBranch=c,this.falseBranch=b}isSupported(){var r=this.test()?this.trueBranch:this.falseBranch;return r.isSupported()}connect(r,c){var b=this.test()?this.trueBranch:this.falseBranch;return b.connect(r,c)}}class fd{constructor(r){this.strategy=r}isSupported(){return this.strategy.isSupported()}connect(r,c){var b=this.strategy.connect(r,function(w,L){L&&b.abort(),c(w,L)});return b}}function li(u){return function(){return u.isSupported()}}var gd=function(u,r,c){var b={};function w(Ss,fc,gc,yc,Cc){var _s=c(u,Ss,fc,gc,yc,Cc);return b[Ss]=_s,_s}var L=Object.assign({},r,{hostNonTLS:u.wsHost+":"+u.wsPort,hostTLS:u.wsHost+":"+u.wssPort,httpPath:u.wsPath}),E=Object.assign({},L,{useTLS:!0}),D=Object.assign({},r,{hostNonTLS:u.httpHost+":"+u.httpPort,hostTLS:u.httpHost+":"+u.httpsPort,httpPath:u.httpPath}),R={loop:!0,timeout:15e3,timeoutLimit:6e4},Z=new us({minPingDelay:1e4,maxPingDelay:u.activityTimeout}),X=new us({lives:2,minPingDelay:1e4,maxPingDelay:u.activityTimeout}),pe=w("ws","ws",3,L,Z),zi=w("wss","ws",3,E,Z),hc=w("sockjs","sockjs",1,D),fs=w("xhr_streaming","xhr_streaming",1,D,X),mc=w("xdr_streaming","xdr_streaming",1,D,X),gs=w("xhr_polling","xhr_polling",1,D),pc=w("xdr_polling","xdr_polling",1,D),ys=new Ln([pe],R),vc=new Ln([zi],R),bc=new Ln([hc],R),Cs=new Ln([new ri(li(fs),fs,mc)],R),ws=new Ln([new ri(li(gs),gs,pc)],R),ks=new Ln([new ri(li(Cs),new xt([Cs,new Fi(ws,{delay:4e3})]),ws)],R),It=new ri(li(ks),ks,bc),Dt;return r.useTLS?Dt=new xt([ys,new Fi(It,{delay:2e3})]):Dt=new xt([ys,new Fi(vc,{delay:2e3}),new Fi(It,{delay:5e3})]),new pd(new fd(new ri(li(pe),Dt,It)),b,{ttl:18e5,timeline:r.timeline,useTLS:r.useTLS})},yd=gd,Cd=function(){var u=this;u.timeline.info(u.buildTimelineMessage({transport:u.name+(u.options.useTLS?"s":"")})),u.hooks.isInitialized()?u.changeState("initialized"):u.hooks.file?(u.changeState("initializing"),g.load(u.hooks.file,{useTLS:u.options.useTLS},function(r,c){u.hooks.isInitialized()?(u.changeState("initialized"),c(!0)):(r&&u.onError(r),u.onClose(),c(!1))})):u.onClose()},wd={getRequest:function(u){var r=new window.XDomainRequest;return r.ontimeout=function(){u.emit("error",new A),u.close()},r.onerror=function(c){u.emit("error",c),u.close()},r.onprogress=function(){r.responseText&&r.responseText.length>0&&u.onChunk(200,r.responseText)},r.onload=function(){r.responseText&&r.responseText.length>0&&u.onChunk(200,r.responseText),u.emit("finished",200),u.close()},r},abortRequest:function(u){u.ontimeout=u.onerror=u.onprogress=u.onload=null,u.abort()}},kd=wd;const Sd=256*1024;class _d extends on{constructor(r,c,b){super(),this.hooks=r,this.method=c,this.url=b}start(r){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},O.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(r)}close(){this.unloader&&(O.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(r,c){for(;;){var b=this.advanceBuffer(c);if(b)this.emit("chunk",{status:r,data:b});else break}this.isBufferTooLong(c)&&this.emit("buffer_too_long")}advanceBuffer(r){var c=r.slice(this.position),b=c.indexOf(`
1148
+ `);return b!==-1?(this.position+=b+1,c.slice(0,b)):null}isBufferTooLong(r){return this.position===r.length&&r.length>Sd}}var Tt;(function(u){u[u.CONNECTING=0]="CONNECTING",u[u.OPEN=1]="OPEN",u[u.CLOSED=3]="CLOSED"})(Tt||(Tt={}));var Tn=Tt,Md=1;class Ad{constructor(r,c){this.hooks=r,this.session=ps(1e3)+"/"+Ed(8),this.location=xd(c),this.readyState=Tn.CONNECTING,this.openStream()}send(r){return this.sendRaw(JSON.stringify([r]))}ping(){this.hooks.sendHeartbeat(this)}close(r,c){this.onClose(r,c,!0)}sendRaw(r){if(this.readyState===Tn.OPEN)try{return O.createSocketRequest("POST",ms(Ld(this.location,this.session))).start(r),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(r,c,b){this.closeStream(),this.readyState=Tn.CLOSED,this.onclose&&this.onclose({code:r,reason:c,wasClean:b})}onChunk(r){if(r.status===200){this.readyState===Tn.OPEN&&this.onActivity();var c,b=r.data.slice(0,1);switch(b){case"o":c=JSON.parse(r.data.slice(1)||"{}"),this.onOpen(c);break;case"a":c=JSON.parse(r.data.slice(1)||"[]");for(var w=0;w<c.length;w++)this.onEvent(c[w]);break;case"m":c=JSON.parse(r.data.slice(1)||"null"),this.onEvent(c);break;case"h":this.hooks.onHeartbeat(this);break;case"c":c=JSON.parse(r.data.slice(1)||"[]"),this.onClose(c[0],c[1],!0);break}}}onOpen(r){this.readyState===Tn.CONNECTING?(r&&r.hostname&&(this.location.base=Td(this.location.base,r.hostname)),this.readyState=Tn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(r){this.readyState===Tn.OPEN&&this.onmessage&&this.onmessage({data:r})}onActivity(){this.onactivity&&this.onactivity()}onError(r){this.onerror&&this.onerror(r)}openStream(){this.stream=O.createSocketRequest("POST",ms(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",r=>{this.onChunk(r)}),this.stream.bind("finished",r=>{this.hooks.onFinished(this,r)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(r){re.defer(()=>{this.onError(r),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function xd(u){var r=/([^\?]*)\/*(\??.*)/.exec(u);return{base:r[1],queryString:r[2]}}function Ld(u,r){return u.base+"/"+r+"/xhr_send"}function ms(u){var r=u.indexOf("?")===-1?"?":"&";return u+r+"t="+ +new Date+"&n="+Md++}function Td(u,r){var c=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(u);return c[1]+r+c[3]}function ps(u){return O.randomInt(u)}function Ed(u){for(var r=[],c=0;c<u;c++)r.push(ps(32).toString(32));return r.join("")}var Pd=Ad,Id={getReceiveURL:function(u,r){return u.base+"/"+r+"/xhr_streaming"+u.queryString},onHeartbeat:function(u){u.sendRaw("[]")},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,r){u.onClose(1006,"Connection interrupted ("+r+")",!1)}},Dd=Id,Bd={getReceiveURL:function(u,r){return u.base+"/"+r+"/xhr"+u.queryString},onHeartbeat:function(){},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,r){r===200?u.reconnect():u.onClose(1006,"Connection interrupted ("+r+")",!1)}},Nd=Bd,Hd={getRequest:function(u){var r=O.getXHRAPI(),c=new r;return c.onreadystatechange=c.onprogress=function(){switch(c.readyState){case 3:c.responseText&&c.responseText.length>0&&u.onChunk(c.status,c.responseText);break;case 4:c.responseText&&c.responseText.length>0&&u.onChunk(c.status,c.responseText),u.emit("finished",c.status),u.close();break}},c},abortRequest:function(u){u.onreadystatechange=null,u.abort()}},Rd=Hd,Od={createStreamingSocket(u){return this.createSocket(Dd,u)},createPollingSocket(u){return this.createSocket(Nd,u)},createSocket(u,r){return new Pd(u,r)},createXHR(u,r){return this.createRequest(Rd,u,r)},createRequest(u,r,c){return new _d(u,r,c)}},vs=Od;vs.createXDR=function(u,r){return this.createRequest(kd,u,r)};var Vd=vs,Ud={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:a,DependenciesReceivers:p,getDefaultStrategy:yd,Transports:Jl,transportConnectionInitializer:Cd,HTTPFactory:Vd,TimelineTransport:Hl,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(u){window.Pusher=u;var r=()=>{this.onDocumentBody(u.ready)};window.JSON?r():g.load("json2",{},r)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:oe,jsonp:Pl}},onDocumentBody(u){document.body?u():setTimeout(()=>{this.onDocumentBody(u)},0)},createJSONPRequest(u,r){return new Dl(u,r)},createScriptRequest(u){return new Il(u)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var u=this.getXHRAPI();return new u},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return Yl},createWebSocket(u){var r=this.getWebSocketAPI();return new r(u)},createSocketRequest(u,r){if(this.isXHRSupported())return this.HTTPFactory.createXHR(u,r);if(this.isXDRSupported(r.indexOf("https:")===0))return this.HTTPFactory.createXDR(u,r);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var u=this.getXHRAPI();return!!u&&new u().withCredentials!==void 0},isXDRSupported(u){var r=u?"https:":"http:",c=this.getProtocol();return!!window.XDomainRequest&&c===r},addUnloadListener(u){window.addEventListener!==void 0?window.addEventListener("unload",u,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",u)},removeUnloadListener(u){window.addEventListener!==void 0?window.removeEventListener("unload",u,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",u)},randomInt(u){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*u)}},O=Ud,Et;(function(u){u[u.ERROR=3]="ERROR",u[u.INFO=6]="INFO",u[u.DEBUG=7]="DEBUG"})(Et||(Et={}));var Gi=Et;class jd{constructor(r,c,b){this.key=r,this.session=c,this.events=[],this.options=b||{},this.sent=0,this.uniqueID=0}log(r,c){r<=this.options.level&&(this.events.push(fe({},c,{timestamp:re.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(r){this.log(Gi.ERROR,r)}info(r){this.log(Gi.INFO,r)}debug(r){this.log(Gi.DEBUG,r)}isEmpty(){return this.events.length===0}send(r,c){var b=fe({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],r(b,(w,L)=>{w||this.sent++,c&&c(w,L)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Kd{constructor(r,c,b,w){this.name=r,this.priority=c,this.transport=b,this.options=w||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(r,c){if(this.isSupported()){if(this.priority<r)return bs(new _,c)}else return bs(new G,c);var b=!1,w=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),L=null,E=function(){w.unbind("initialized",E),w.connect()},D=function(){L=sn.createHandshake(w,function(pe){b=!0,X(),c(null,pe)})},R=function(pe){X(),c(pe)},Z=function(){X();var pe;pe=An(w),c(new T(pe))},X=function(){w.unbind("initialized",E),w.unbind("open",D),w.unbind("error",R),w.unbind("closed",Z)};return w.bind("initialized",E),w.bind("open",D),w.bind("error",R),w.bind("closed",Z),w.initialize(),{abort:()=>{b||(X(),L?L.close():w.close())},forceMinPriority:pe=>{b||this.priority<pe&&(L?L.close():w.close())}}}}function bs(u,r){return re.defer(function(){r(u)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Fd}=O;var Gd=function(u,r,c,b,w,L){var E=Fd[c];if(!E)throw new K(c);var D=(!u.enabledTransports||Pe(u.enabledTransports,r)!==-1)&&(!u.disabledTransports||Pe(u.disabledTransports,r)===-1),R;return D?(w=Object.assign({ignoreNullOrigin:u.ignoreNullOrigin},w),R=new Kd(r,b,L?L.getAssistant(E):E,w)):R=zd,R},zd={isSupported:function(){return!1},connect:function(u,r){var c=re.defer(function(){r(new G)});return{abort:function(){c.ensureAborted()},forceMinPriority:function(){}}}};function qd(u){if(u==null)throw"You must pass an options object";if(u.cluster==null)throw"Options object must provide a cluster";"disableStats"in u&&se.warn("The disableStats option is deprecated in favor of enableStats")}const Wd=(u,r)=>{var c="socket_id="+encodeURIComponent(u.socketId);for(var b in r.params)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(r.params[b]);if(r.paramsProvider!=null){let w=r.paramsProvider();for(var b in w)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(w[b])}return c};var Zd=u=>{if(typeof O.getAuthorizers()[u.transport]>"u")throw`'${u.transport}' is not a recognized auth transport`;return(r,c)=>{const b=Wd(r,u);O.getAuthorizers()[u.transport](O,b,u,C.UserAuthentication,c)}};const Jd=(u,r)=>{var c="socket_id="+encodeURIComponent(u.socketId);c+="&channel_name="+encodeURIComponent(u.channelName);for(var b in r.params)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(r.params[b]);if(r.paramsProvider!=null){let w=r.paramsProvider();for(var b in w)c+="&"+encodeURIComponent(b)+"="+encodeURIComponent(w[b])}return c};var $d=u=>{if(typeof O.getAuthorizers()[u.transport]>"u")throw`'${u.transport}' is not a recognized auth transport`;return(r,c)=>{const b=Jd(r,u);O.getAuthorizers()[u.transport](O,b,u,C.ChannelAuthorization,c)}};const Yd=(u,r,c)=>{const b={authTransport:r.transport,authEndpoint:r.endpoint,auth:{params:r.params,headers:r.headers}};return(w,L)=>{const E=u.channel(w.channelName);c(E,b).authorize(w.socketId,L)}};function Qd(u,r){let c={activityTimeout:u.activityTimeout||d.activityTimeout,cluster:u.cluster,httpPath:u.httpPath||d.httpPath,httpPort:u.httpPort||d.httpPort,httpsPort:u.httpsPort||d.httpsPort,pongTimeout:u.pongTimeout||d.pongTimeout,statsHost:u.statsHost||d.stats_host,unavailableTimeout:u.unavailableTimeout||d.unavailableTimeout,wsPath:u.wsPath||d.wsPath,wsPort:u.wsPort||d.wsPort,wssPort:u.wssPort||d.wssPort,enableStats:tc(u),httpHost:Xd(u),useTLS:ic(u),wsHost:ec(u),userAuthenticator:oc(u),channelAuthorizer:ac(u,r)};return"disabledTransports"in u&&(c.disabledTransports=u.disabledTransports),"enabledTransports"in u&&(c.enabledTransports=u.enabledTransports),"ignoreNullOrigin"in u&&(c.ignoreNullOrigin=u.ignoreNullOrigin),"timelineParams"in u&&(c.timelineParams=u.timelineParams),"nacl"in u&&(c.nacl=u.nacl),c}function Xd(u){return u.httpHost?u.httpHost:u.cluster?`sockjs-${u.cluster}.pusher.com`:d.httpHost}function ec(u){return u.wsHost?u.wsHost:nc(u.cluster)}function nc(u){return`ws-${u}.pusher.com`}function ic(u){return O.getProtocol()==="https:"?!0:u.forceTLS!==!1}function tc(u){return"enableStats"in u?u.enableStats:"disableStats"in u?!u.disableStats:!1}function oc(u){const r=Object.assign(Object.assign({},d.userAuthentication),u.userAuthentication);return"customHandler"in r&&r.customHandler!=null?r.customHandler:Zd(r)}function sc(u,r){let c;return"channelAuthorization"in u?c=Object.assign(Object.assign({},d.channelAuthorization),u.channelAuthorization):(c={transport:u.authTransport||d.authTransport,endpoint:u.authEndpoint||d.authEndpoint},"auth"in u&&("params"in u.auth&&(c.params=u.auth.params),"headers"in u.auth&&(c.headers=u.auth.headers)),"authorizer"in u&&(c.customHandler=Yd(r,c,u.authorizer))),c}function ac(u,r){const c=sc(u,r);return"customHandler"in c&&c.customHandler!=null?c.customHandler:$d(c)}class rc extends on{constructor(r){super(function(c,b){se.debug(`No callbacks on watchlist events for ${c}`)}),this.pusher=r,this.bindWatchlistInternalEvent()}handleEvent(r){r.data.events.forEach(c=>{this.emit(c.name,c)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",r=>{var c=r.event;c==="pusher_internal:watchlist_events"&&this.handleEvent(r)})}}function lc(){let u,r;return{promise:new Promise((b,w)=>{u=b,r=w}),resolve:u,reject:r}}var dc=lc;class cc extends on{constructor(r){super(function(c,b){se.debug("No callbacks on user for "+c)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(c,b)=>{if(c){se.warn(`Error during signin: ${c}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:b.auth,user_data:b.user_data})},this.pusher=r,this.pusher.connection.bind("state_change",({previous:c,current:b})=>{c!=="connected"&&b==="connected"&&this._signin(),c==="connected"&&b!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new rc(r),this.pusher.connection.bind("message",c=>{var b=c.event;b==="pusher:signin_success"&&this._onSigninSuccess(c.data),this.serverToUserChannel&&this.serverToUserChannel.name===c.channel&&this.serverToUserChannel.handleEvent(c)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(r){try{this.user_data=JSON.parse(r.user_data)}catch{se.error(`Failed parsing user data after signin: ${r.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){se.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const r=c=>{c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.pusher.connection.state==="connected"&&c.subscribe()};this.serverToUserChannel=new _t(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((c,b)=>{c.indexOf("pusher_internal:")===0||c.indexOf("pusher:")===0||this.emit(c,b)}),r(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:r,resolve:c,reject:b}=dc();r.done=!1;const w=()=>{r.done=!0};r.then(w).catch(w),this.signinDonePromise=r,this._signinDoneResolve=c}}class ye{static ready(){ye.isReady=!0;for(var r=0,c=ye.instances.length;r<c;r++)ye.instances[r].connect()}static getClientFeatures(){return We($({ws:O.Transports.ws},function(r){return r.isSupported({})}))}constructor(r,c){uc(r),qd(c),this.key=r,this.config=Qd(c,this),this.channels=sn.createChannels(),this.global_emitter=new on,this.sessionID=O.randomInt(1e9),this.timeline=new jd(this.key,this.sessionID,{cluster:this.config.cluster,features:ye.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Gi.INFO,version:d.VERSION}),this.config.enableStats&&(this.timelineSender=sn.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+O.TimelineTransport.name}));var b=w=>O.getDefaultStrategy(this.config,w,Gd);this.connection=sn.createConnectionManager(this.key,{getStrategy:b,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",w=>{var L=w.event,E=L.indexOf("pusher_internal:")===0;if(w.channel){var D=this.channel(w.channel);D&&D.handleEvent(w)}E||this.global_emitter.emit(w.event,w.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",w=>{se.warn(w)}),ye.instances.push(this),this.timeline.info({instances:ye.instances.length}),this.user=new cc(this),ye.isReady&&this.connect()}channel(r){return this.channels.find(r)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var r=this.connection.isUsingTLS(),c=this.timelineSender;this.timelineSenderTimer=new tn(6e4,function(){c.send(r)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(r,c,b){return this.global_emitter.bind(r,c,b),this}unbind(r,c,b){return this.global_emitter.unbind(r,c,b),this}bind_global(r){return this.global_emitter.bind_global(r),this}unbind_global(r){return this.global_emitter.unbind_global(r),this}unbind_all(r){return this.global_emitter.unbind_all(),this}subscribeAll(){var r;for(r in this.channels.channels)this.channels.channels.hasOwnProperty(r)&&this.subscribe(r)}subscribe(r){var c=this.channels.add(r,this);return c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.connection.state==="connected"&&c.subscribe(),c}unsubscribe(r){var c=this.channels.find(r);c&&c.subscriptionPending?c.cancelSubscription():(c=this.channels.remove(r),c&&c.subscribed&&c.unsubscribe())}send_event(r,c,b){return this.connection.send_event(r,c,b)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}ye.instances=[],ye.isReady=!1,ye.logToConsole=!1,ye.Runtime=O,ye.ScriptReceivers=O.ScriptReceivers,ye.DependenciesReceivers=O.DependenciesReceivers,ye.auth_callbacks=O.auth_callbacks;var Pt=t.default=ye;function uc(u){if(u==null)throw"You must pass your app key when you instantiate Pusher."}O.setup(ye)}])})})(Zo);var Zr=Zo.exports;const Jr=Wr(Zr);class Jo{constructor(e){h(this,"container");h(this,"onAction");h(this,"onFail");h(this,"initialTime");h(this,"timeLeft");h(this,"timerId");h(this,"payment");this.container=e.container,this.onAction=e.onAction,this.onFail=e.onFail,this.initialTime=1800,this.timeLeft=this.initialTime,this.timerId=null}attachListener(){const e=this.container.querySelector("#transfer-acn"),i=this.container.querySelector("#copy-acn"),t=this.container.querySelector("#acn-tooltip"),o=this.container.querySelector("#transfer-amount"),s=this.container.querySelector("#copy-amount"),a=this.container.querySelector("#amount-tooltip"),l=this.container.querySelector("#transfer-button");i&&e&&i.addEventListener("click",()=>{P.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Started"}),t&&this.copyToClipboard(e.innerHTML,t)}),s&&o&&s.addEventListener("click",()=>{P.track("copy_transferAmount",{payment_method:"Transfer"}),a&&this.copyToClipboard(o.innerHTML.split(" ")[1].replace(/,/g,""),a)}),l&&l.addEventListener("click",()=>{this.onAction(5),P.track("initiate_payment_verification",{payment_method:"Transfer"})})}startTimer(e){this.stopTimer(),this.timerId=window.setInterval(()=>{if(this.timeLeft>0){this.timeLeft-=1;const i=this.container.querySelector("#time-left");i&&(i.innerHTML=zn(this.timeLeft))}else this.stopTimer(),e==="check"&&this.onAction(2)},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}copyToClipboard(e,i){navigator.clipboard.writeText(e).then(()=>{i.innerHTML="Copied!"}).catch(()=>{i.innerHTML="Failed to copy"})}renderComponent(e){var g,f,y,k,C,S;e&&(this.payment=e),this.container.innerHTML=this.render();const i=this.container.querySelector("#transfer-amount"),t=this.container.querySelector("#transfer-bank"),o=this.container.querySelector("#account-name"),s=this.container.querySelector("#transfer-acn"),a=this.container.querySelector("#time-left"),l=((g=this.payment)==null?void 0:g.currency)||"USD",d=l==="USD"?(f=this.payment)==null?void 0:f.localCurrency:l;if(i&&(i.innerHTML=`${d} ${xe(this.payment.totalTaxAmount?this.payment.totalLocalAmount:l==="USD"?(y=this.payment)==null?void 0:y.localAmount:(k=this.payment)==null?void 0:k.amount,2)}`),t&&this.payment.bankDetails&&(t.innerHTML=(C=this.payment.bankDetails)==null?void 0:C.bankName),o&&this.payment.bankDetails&&(o.innerHTML=(S=this.payment.bankDetails)==null?void 0:S.accountName),s&&this.payment.bankDetails&&(s.innerHTML=this.payment.bankDetails.accountNumber),a&&(a.innerHTML=zn(this.initialTime)),this.startTimer("poll"),e.status==="inProgress"){const M="45654f3ce4c9512ea9a4",A="us2";var v=new Jr(M,{cluster:A}),p=v.subscribe(e.reference);p.bind("payment_status",_=>{_.status==="successful"?(clearInterval(this.timerId||void 0),this.onAction(6),P.track("verify_payment",{payment_method:"Transfer",verification_status:"Success"}),_!=null&&_.redirectUrl&&setTimeout(()=>{const T=new URL(_.redirectUrl);T.searchParams.append("status",_.status),T.searchParams.append("reference",_.reference),window.location.href=T.toString()},1800)):_.status==="failed"&&(clearInterval(this.timerId||void 0),this.onFail(7,"Transfer failed"),P.track("verify_payment",{payment_method:"Transfer",verification_status:"Failed"}))})}this.attachListener()}render(){return qr}}const $r=`<div id="trasferConfirmationProgress">
1149
1149
  <div>
1150
1150
  <div>
1151
1151
  <div class=" grid grid-rows-[auto_1fr] gap-4 mx-5">
@@ -1249,7 +1249,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1249
1249
  </div> -->
1250
1250
  </div>
1251
1251
  </div>
1252
- </div>`;class Xr{constructor(e){h(this,"container");this.container=e.container}attachListeners(){}renderComponent(){this.container.innerHTML=this.render()}render(){return Qr}}class el{constructor({amount:e,totalAmount:i,closeModal:t,container:o,email:s,token:a,currency:l,rdtCode:d,url:v,reference:p,callBackUrl:g,metadata:f,localCurrency:y,disablePaymentMethods:k,restartTransactionProcess:C,hidePaymentMethods:S,retryingPayment:M}){h(this,"container");h(this,"contents");h(this,"closeModal");h(this,"email");h(this,"transferDetails");h(this,"transferConfirmationProgress");h(this,"transferConfirmationEnd");h(this,"transferExpired");h(this,"mainLoader");h(this,"warningScreen");h(this,"successScreen");h(this,"merchantPlanDetail",{});h(this,"token");h(this,"currency");h(this,"amount");h(this,"totalAmount");h(this,"rdtCode");h(this,"url");h(this,"reference");h(this,"_currentStep");h(this,"activeRef");h(this,"paymentResponse");h(this,"timerId");h(this,"abortController",null);h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"transactionIssuesScreen");h(this,"disablePaymentMethods");h(this,"paymentResponseHeaders");h(this,"restartTransactionProcess");h(this,"hidePaymentMethods");h(this,"retryingPayment");h(this,"isMaxRetriesReached");h(this,"isMobile",!1);this.currency=l,this.container=o,this.contents=this.container.querySelector("#payment-content-view"),this.closeModal=t,this.token=a,this.email=s,this.amount=e,this.totalAmount=i,this.rdtCode=d,this.url=v,this.reference=p,this._currentStep=1,this.callBackUrl=g,this.metadata=f,this.localCurrency=y,this.disablePaymentMethods=k,this.paymentResponse={},this.paymentResponseHeaders={},this.restartTransactionProcess=C,this.hidePaymentMethods=S,this.retryingPayment=M,this.isMaxRetriesReached=!1,this.renderTransferContent(),this.paymentResponse={},this.activeRef="",this.timerId=null,this.mainLoader=new De(this.contents),this.mainLoader.mountLoader("25dvh"),this.currentStep===1&&(this.abortController=new AbortController,this.createTransfer()),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderTransferContent(),e===1&&this.createTransfer()}attachInputListeners(){const e=this.container.querySelector("#transfer-try-again"),i=this.container.querySelector("#transfer-sent"),t=this.container.querySelector(".success-button");e&&e.addEventListener("click",()=>{this.currentStep=1}),i&&i.addEventListener("click",()=>{this.abortController&&(this.abortController.abort(),this.currentStep=5)}),t&&t.addEventListener("click",()=>{this.closeModal(),P.track("checkout_closes")})}onSentVerify(e){e!==2?this.abortController&&(this.abortController.abort(),this.currentStep=e):this.currentStep=2}async verifyTransfer(){try{const e=await an(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers}catch{this.currentStep=7}}async createTransfer(){requestAnimationFrame(()=>{const e=this.container.querySelector("#loader"),i=this.container.querySelector("#details-content");i&&(this.mainLoader=new De(this.contents),this.mainLoader.mountLoader("25dvh"),i.classList.add("hidden")),P.track("start_payment",{payment_method:"Transfer"}),(()=>{var o,s;if(this.retryingPayment){const a={channel:"bank_transfer",reference:this.reference};return ci(this.token,a,this.rdtCode,this.url)}else{const a={amount:this.amount,channel:"bank_transfer",currency:this.currency,customer:{email:this.email},reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((o=this.merchantPlanDetail)==null?void 0:o.taxQuoteId)&&{taxQuoteId:(s=this.merchantPlanDetail)==null?void 0:s.taxQuoteId}};return Nt(this.token,a,this.rdtCode,this.url)}})().then(({data:o,headers:s})=>{this.paymentResponse=o,this.paymentResponseHeaders=s,o.status==="failed"?(this.currentStep=7,o.providerMessage?this.warningScreen.setPaymentError(o.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue(),P.track("stop_transferProcess",{payment_method:"Transfer",verification_status:"Failed"})):(e&&i&&(e.classList.add("hidden"),i.classList.remove("hidden")),this.activeRef=o.reference,this.paymentResponse=o,o.bankDetails&&o.bankDetails.accountNumber?(this.transferDetails=new Jo({container:this.contents,onAction:a=>{this.onSentVerify.bind(this)(a)},onFail:(a,l)=>{this.currentStep=a,a===7&&l&&this.warningScreen.setPaymentError(l)}}),this.transferDetails.renderComponent(this.paymentResponse||o)):(this.currentStep=7,o.providerMessage?this.warningScreen.setPaymentError(o.providerMessage):this.warningScreen.setPaymentError("Error fetching bank details")))}).catch(o=>{P.track("verify_payment",{payment_method:"Transfer",verification_status:"Null"}),o.code==="payment_max_retry_attempts"?(this.isMaxRetriesReached=!0,this.verifyTransfer(),this.currentStep=7,this.warningScreen.setPaymentError("Maximum retries","You have reached the maximum number of retries allowed. Go back to merchant website to start the payment process again.","Go back to Merchant")):(this.currentStep=7,o.message?this.warningScreen.setPaymentError(o.message):this.warningScreen.setPaymentError("Payment failed")),this.warningScreen.hideReportIssue()})})}goBackToMerchant(){Ze(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}renderTransferContent(e){var t;e&&(this.merchantPlanDetail=e);const i=document.getElementById("go-back");if(this.isMobile&&this.hidePaymentMethods(),this.currentStep!==1?(i==null||i.classList.add("hidden"),this.disablePaymentMethods("bank_transfer")):i==null||i.addEventListener("click",()=>{this.restartTransactionProcess()}),this.contents){switch(this.currentStep){case 1:this.transferDetails=new Jo({container:this.contents,onAction:o=>{this.onSentVerify.bind(this)(o)},onFail:(o,s)=>{this.currentStep=o,o===7&&s&&this.warningScreen.setPaymentError(s)}});break;case 2:this.transferExpired=new Xr({container:this.contents}),this.transferExpired.renderComponent();break;case 5:this.transferConfirmationProgress=new Yr({container:this.contents,onAction:(o,s)=>{this.currentStep=o,o===7&&s&&this.warningScreen.setPaymentError(s)},ref:this.activeRef,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(o,s)=>{this.paymentResponse=o,this.paymentResponseHeaders=s}}),this.transferConfirmationProgress.renderComponent(this.paymentResponse);break;case 6:this.successScreen=new qn({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(t=this.merchantPlanDetail)==null?void 0:t.rate.rate}),this.successScreen.renderComponent();break;case 7:this.warningScreen=new gn({container:this.contents,onReportIssue:()=>this.currentStep=8,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this)}),this.contents.innerHTML=this.warningScreen.render();break;case 8:this.transferConfirmationEnd=new Wo({container:this.contents,onAction:o=>{this.currentStep=o},ref:this.reference,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transferConfirmationEnd.renderComponent();break;case 9:this.transactionIssuesScreen=new mi({container:this.contents,onAction:()=>{var o;this.currentStep=7,this.warningScreen.setPaymentError(((o=this.paymentResponse)==null?void 0:o.providerMessage)||"Payment failed")},token:this.token,rdtCode:this.rdtCode,url:this.url,paymentChannel:"bank_transfer",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break}this.attachInputListeners()}}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}stopProgressBar(){const e=this.container.querySelector(".progress-bar");e&&(e.style.animationPlayState="paused")}copyToClipboard(e,i){navigator.clipboard.writeText(e).then(()=>{i.innerHTML="Copied!"}).catch(()=>{i.innerHTML="Failed to copy"})}destroyTimer(){this.stopTimer()}stopPolling(){this.abortController&&this.abortController.abort()}}function $o(){return function(n,e){let i=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:()=>i,set:s=>{i=s}})}}class te extends Error{constructor(e,i){super(e),this.status=i,this.name="FetchError"}}class Xe extends Error{constructor(e){super(e),this.name="AuthorizationError"}}class Ct{constructor(e){h(this,"token");h(this,"baseurl","https://api.spotflow.co/api/v1");h(this,"headers");h(this,"rdtCode");h(this,"url");h(this,"getHeaders",(e,i)=>{if(!e)throw new Xe("Missing authorization token");const t=new Headers;return t.append("Content-Type","application/json"),t.append("Authorization",`Bearer ${e}`),i&&t.append("Spotflow-Payment-Code",i),t});this.token=e.token,this.rdtCode=e.rdtCode,this.url=e.url,this.headers=this.getHeaders(this.token,this.rdtCode)}}class Yo extends Ct{constructor(e){super(e)}async createCardPayment(e){try{const i=await fetch(`${ve(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!i.ok){const o=await i.json();throw o.message?new te(o.message,i.status):new te("Network response was not ok",i.status)}return await i.json()}catch(i){throw i instanceof te?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Xe?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}}async createUssdPayment(e){try{const i=await fetch(`${ve(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!i.ok){const o=await i.json();throw o.message?new te(o.message,i.status):new te("Network response was not ok",i.status)}return{data:await i.json(),headers:i.headers}}catch(i){throw i instanceof te?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Xe?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}}async validateCardPayment(e){try{const i=await fetch(`${ve(this.baseurl,this.url)}/payments/validate`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!i.ok){const o=await i.json();throw o.message?new te(o.message,i.status):new te("Network response was not ok",i.status)}return await i.json()}catch(i){throw i instanceof te?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Xe?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}}async authorizeCardPayment(e){try{const i=await fetch(`${ve(this.baseurl,this.url)}/payments/authorize`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!i.ok){const o=await i.json();throw o.message?new te(o.message,i.status):new te("Network response was not ok",i.status)}return await i.json()}catch(i){throw i instanceof te?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Xe?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}}async createTransferPayment(e){try{const i=await fetch(`${ve(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!i.ok){const o=await i.json();throw o.message?new te(o.message,i.status):new te("Network response was not ok",i.status)}return await i.json()}catch(i){throw i instanceof te?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Xe?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}}async verifyPayment(e,i){try{const t=await fetch(`${ve(this.baseurl,this.url)}/payments/verify?reference=${e}`,{method:"GET",headers:this.headers,signal:i});if(!t.ok){const s=await t.json();throw s.message?new te(s.message,t.status):new te("Network response was not ok",t.status)}return{data:await t.json(),headers:t.headers}}catch(t){throw t instanceof te?console.error(`FetchError: ${t.message} (status: ${t.status})`):t instanceof Xe?console.error(`AuthorizationError: ${t.message}`):console.error(`Unexpected error: ${t}`),t}}}class nl extends Ct{constructor(e){super(e)}async getMerchantConfig(e,i){try{const t=await fetch(`${ve(this.baseurl,this.url)}/checkout-configurations?currency=${i}&planId=${e||""}`,{headers:this.headers,method:"GET"});if(!t.ok){const o=await t.json();throw o.message?new te(o.message,t.status):new te("Network response was not ok",t.status)}return t.json()}catch(t){throw t instanceof te?console.error(`FetchError: ${t.message} (status: ${t.status})`):t instanceof Xe?console.error(`AuthorizationError: ${t.message}`):console.error(`Unexpected error: ${t}`),t}}}class il extends Ct{constructor(e){super(e)}async getBankList(){try{const e=await fetch(`${ve(this.baseurl,this.url)}/banks?ussd=true`,{headers:this.headers,method:"GET"});if(!e.ok){const i=await e.json();throw i.message?new te(i.message,e.status):new te("Network response was not ok",e.status)}return e.json()}catch(e){throw e instanceof te?(hi.showToast(e.message,"error",9e3),console.error(`FetchError: ${e.message} (status: ${e.status})`)):e instanceof Xe?console.error(`AuthorizationError: ${e.message}`):console.error(`Unexpected error: ${e}`),e}}}const tl=`<form id="ussdBanks">
1252
+ </div>`;class Xr{constructor(e){h(this,"container");this.container=e.container}attachListeners(){}renderComponent(){this.container.innerHTML=this.render()}render(){return Qr}}class el{constructor({amount:e,totalAmount:i,closeModal:t,container:o,customer:s,token:a,currency:l,rdtCode:d,url:v,reference:p,callBackUrl:g,metadata:f,localCurrency:y,disablePaymentMethods:k,restartTransactionProcess:C,hidePaymentMethods:S,retryingPayment:M}){h(this,"container");h(this,"contents");h(this,"closeModal");h(this,"customer");h(this,"transferDetails");h(this,"transferConfirmationProgress");h(this,"transferConfirmationEnd");h(this,"transferExpired");h(this,"mainLoader");h(this,"warningScreen");h(this,"successScreen");h(this,"merchantPlanDetail",{});h(this,"token");h(this,"currency");h(this,"amount");h(this,"totalAmount");h(this,"rdtCode");h(this,"url");h(this,"reference");h(this,"_currentStep");h(this,"activeRef");h(this,"paymentResponse");h(this,"timerId");h(this,"abortController",null);h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"transactionIssuesScreen");h(this,"disablePaymentMethods");h(this,"paymentResponseHeaders");h(this,"restartTransactionProcess");h(this,"hidePaymentMethods");h(this,"retryingPayment");h(this,"isMaxRetriesReached");h(this,"isMobile",!1);this.currency=l,this.container=o,this.contents=this.container.querySelector("#payment-content-view"),this.closeModal=t,this.token=a,this.customer=s,this.amount=e,this.totalAmount=i,this.rdtCode=d,this.url=v,this.reference=p,this._currentStep=1,this.callBackUrl=g,this.metadata=f,this.localCurrency=y,this.disablePaymentMethods=k,this.paymentResponse={},this.paymentResponseHeaders={},this.restartTransactionProcess=C,this.hidePaymentMethods=S,this.retryingPayment=M,this.isMaxRetriesReached=!1,this.renderTransferContent(),this.paymentResponse={},this.activeRef="",this.timerId=null,this.mainLoader=new Ne(this.contents),this.mainLoader.mountLoader("25dvh"),this.currentStep===1&&(this.abortController=new AbortController,this.createTransfer()),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderTransferContent(),e===1&&this.createTransfer()}attachInputListeners(){const e=this.container.querySelector("#transfer-try-again"),i=this.container.querySelector("#transfer-sent"),t=this.container.querySelector(".success-button");e&&e.addEventListener("click",()=>{this.currentStep=1}),i&&i.addEventListener("click",()=>{this.abortController&&(this.abortController.abort(),this.currentStep=5)}),t&&t.addEventListener("click",()=>{this.closeModal(),P.track("checkout_closes")})}onSentVerify(e){e!==2?this.abortController&&(this.abortController.abort(),this.currentStep=e):this.currentStep=2}async verifyTransfer(){try{const e=await an(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers}catch{this.currentStep=7}}async createTransfer(){requestAnimationFrame(()=>{const e=this.container.querySelector("#loader"),i=this.container.querySelector("#details-content");i&&(this.mainLoader=new Ne(this.contents),this.mainLoader.mountLoader("25dvh"),i.classList.add("hidden")),P.track("start_payment",{payment_method:"Transfer"}),(()=>{var o,s;if(this.retryingPayment){const a={channel:"bank_transfer",reference:this.reference};return ci(this.token,a,this.rdtCode,this.url)}else{const a={amount:this.amount,channel:"bank_transfer",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((o=this.merchantPlanDetail)==null?void 0:o.taxQuoteId)&&{taxQuoteId:(s=this.merchantPlanDetail)==null?void 0:s.taxQuoteId}};return Bt(this.token,a,this.rdtCode,this.url)}})().then(({data:o,headers:s})=>{this.paymentResponse=o,this.paymentResponseHeaders=s,o.status==="failed"?(this.currentStep=7,o.providerMessage?this.warningScreen.setPaymentError(o.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue(),P.track("stop_transferProcess",{payment_method:"Transfer",verification_status:"Failed"})):(e&&i&&(e.classList.add("hidden"),i.classList.remove("hidden")),this.activeRef=o.reference,this.paymentResponse=o,o.bankDetails&&o.bankDetails.accountNumber?(this.transferDetails=new Jo({container:this.contents,onAction:a=>{this.onSentVerify.bind(this)(a)},onFail:(a,l)=>{this.currentStep=a,a===7&&l&&this.warningScreen.setPaymentError(l)}}),this.transferDetails.renderComponent(this.paymentResponse||o)):(this.currentStep=7,o.providerMessage?this.warningScreen.setPaymentError(o.providerMessage):this.warningScreen.setPaymentError("Error fetching bank details")))}).catch(o=>{P.track("verify_payment",{payment_method:"Transfer",verification_status:"Null"}),o.code==="payment_max_retry_attempts"?(this.isMaxRetriesReached=!0,this.verifyTransfer(),this.currentStep=7,this.warningScreen.setPaymentError("Maximum retries","You have reached the maximum number of retries allowed. Go back to merchant website to start the payment process again.","Go back to Merchant")):(this.currentStep=7,o.message?this.warningScreen.setPaymentError(o.message):this.warningScreen.setPaymentError("Payment failed")),this.warningScreen.hideReportIssue()})})}goBackToMerchant(){Ze(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}renderTransferContent(e){var t;e&&(this.merchantPlanDetail=e);const i=document.getElementById("go-back");if(this.isMobile&&this.hidePaymentMethods(),this.currentStep!==1?(i==null||i.classList.add("hidden"),this.disablePaymentMethods("bank_transfer")):i==null||i.addEventListener("click",()=>{this.restartTransactionProcess()}),this.contents){switch(this.currentStep){case 1:this.transferDetails=new Jo({container:this.contents,onAction:o=>{this.onSentVerify.bind(this)(o)},onFail:(o,s)=>{this.currentStep=o,o===7&&s&&this.warningScreen.setPaymentError(s)}});break;case 2:this.transferExpired=new Xr({container:this.contents}),this.transferExpired.renderComponent();break;case 5:this.transferConfirmationProgress=new Yr({container:this.contents,onAction:(o,s)=>{this.currentStep=o,o===7&&s&&this.warningScreen.setPaymentError(s)},ref:this.activeRef,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(o,s)=>{this.paymentResponse=o,this.paymentResponseHeaders=s}}),this.transferConfirmationProgress.renderComponent(this.paymentResponse);break;case 6:this.successScreen=new qn({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(t=this.merchantPlanDetail)==null?void 0:t.rate.rate}),this.successScreen.renderComponent();break;case 7:this.warningScreen=new gn({container:this.contents,onReportIssue:()=>this.currentStep=8,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this)}),this.contents.innerHTML=this.warningScreen.render();break;case 8:this.transferConfirmationEnd=new Wo({container:this.contents,onAction:o=>{this.currentStep=o},ref:this.reference,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transferConfirmationEnd.renderComponent();break;case 9:this.transactionIssuesScreen=new mi({container:this.contents,onAction:()=>{var o;this.currentStep=7,this.warningScreen.setPaymentError(((o=this.paymentResponse)==null?void 0:o.providerMessage)||"Payment failed")},token:this.token,rdtCode:this.rdtCode,url:this.url,paymentChannel:"bank_transfer",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break}this.attachInputListeners()}}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}stopProgressBar(){const e=this.container.querySelector(".progress-bar");e&&(e.style.animationPlayState="paused")}copyToClipboard(e,i){navigator.clipboard.writeText(e).then(()=>{i.innerHTML="Copied!"}).catch(()=>{i.innerHTML="Failed to copy"})}destroyTimer(){this.stopTimer()}stopPolling(){this.abortController&&this.abortController.abort()}}function $o(){return function(n,e){let i=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:()=>i,set:s=>{i=s}})}}class te extends Error{constructor(e,i){super(e),this.status=i,this.name="FetchError"}}class Xe extends Error{constructor(e){super(e),this.name="AuthorizationError"}}class Ct{constructor(e){h(this,"token");h(this,"baseurl","https://api.spotflow.co/api/v1");h(this,"headers");h(this,"rdtCode");h(this,"url");h(this,"getHeaders",(e,i)=>{if(!e)throw new Xe("Missing authorization token");const t=new Headers;return t.append("Content-Type","application/json"),t.append("Authorization",`Bearer ${e}`),i&&t.append("Spotflow-Payment-Code",i),t});this.token=e.token,this.rdtCode=e.rdtCode,this.url=e.url,this.headers=this.getHeaders(this.token,this.rdtCode)}}class Yo extends Ct{constructor(e){super(e)}async createCardPayment(e){try{const i=await fetch(`${ve(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!i.ok){const o=await i.json();throw o.message?new te(o.message,i.status):new te("Network response was not ok",i.status)}return await i.json()}catch(i){throw i instanceof te?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Xe?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}}async createUssdPayment(e){try{const i=await fetch(`${ve(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!i.ok){const o=await i.json();throw o.message?new te(o.message,i.status):new te("Network response was not ok",i.status)}return{data:await i.json(),headers:i.headers}}catch(i){throw i instanceof te?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Xe?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}}async validateCardPayment(e){try{const i=await fetch(`${ve(this.baseurl,this.url)}/payments/validate`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!i.ok){const o=await i.json();throw o.message?new te(o.message,i.status):new te("Network response was not ok",i.status)}return await i.json()}catch(i){throw i instanceof te?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Xe?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}}async authorizeCardPayment(e){try{const i=await fetch(`${ve(this.baseurl,this.url)}/payments/authorize`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!i.ok){const o=await i.json();throw o.message?new te(o.message,i.status):new te("Network response was not ok",i.status)}return await i.json()}catch(i){throw i instanceof te?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Xe?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}}async createTransferPayment(e){try{const i=await fetch(`${ve(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(e)});if(!i.ok){const o=await i.json();throw o.message?new te(o.message,i.status):new te("Network response was not ok",i.status)}return await i.json()}catch(i){throw i instanceof te?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof Xe?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}}async verifyPayment(e,i){try{const t=await fetch(`${ve(this.baseurl,this.url)}/payments/verify?reference=${e}`,{method:"GET",headers:this.headers,signal:i});if(!t.ok){const s=await t.json();throw s.message?new te(s.message,t.status):new te("Network response was not ok",t.status)}return{data:await t.json(),headers:t.headers}}catch(t){throw t instanceof te?console.error(`FetchError: ${t.message} (status: ${t.status})`):t instanceof Xe?console.error(`AuthorizationError: ${t.message}`):console.error(`Unexpected error: ${t}`),t}}}class nl extends Ct{constructor(e){super(e)}async getMerchantConfig(e,i){try{const t=await fetch(`${ve(this.baseurl,this.url)}/checkout-configurations?currency=${i}&planId=${e||""}`,{headers:this.headers,method:"GET"});if(!t.ok){const o=await t.json();throw o.message?new te(o.message,t.status):new te("Network response was not ok",t.status)}return t.json()}catch(t){throw t instanceof te?console.error(`FetchError: ${t.message} (status: ${t.status})`):t instanceof Xe?console.error(`AuthorizationError: ${t.message}`):console.error(`Unexpected error: ${t}`),t}}}class il extends Ct{constructor(e){super(e)}async getBankList(){try{const e=await fetch(`${ve(this.baseurl,this.url)}/banks?ussd=true`,{headers:this.headers,method:"GET"});if(!e.ok){const i=await e.json();throw i.message?new te(i.message,e.status):new te("Network response was not ok",e.status)}return e.json()}catch(e){throw e instanceof te?(hi.showToast(e.message,"error",9e3),console.error(`FetchError: ${e.message} (status: ${e.status})`)):e instanceof Xe?console.error(`AuthorizationError: ${e.message}`):console.error(`Unexpected error: ${e}`),e}}}const tl=`<form id="ussdBanks">
1253
1253
  <div>
1254
1254
  <h5 class="text-grey-400 font-semibold text-sm">Please choose your bank to begin payment</h5>
1255
1255
  <div class="mt-2">
@@ -1321,7 +1321,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1321
1321
  payment</button>
1322
1322
  </div>
1323
1323
  </div>
1324
- </div>`;class sl{constructor(e){h(this,"container");h(this,"selected");h(this,"secret");h(this,"onAction");h(this,"paymentService");h(this,"currency");h(this,"amount");h(this,"ussd_detail");h(this,"reference");h(this,"email");h(this,"activeRef","");h(this,"pageLoader");h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"onError");this.container=e.container,this.selected=e.selected,this.onAction=e.onAction,this.secret=e.secret,this.paymentService=new Yo({token:this.secret,rdtCode:e.rdtCode,url:e.url}),this.currency=e.currency,this.amount=e.amount||0,this.email=e.email,this.reference=e.reference,this.callBackUrl=e.callBackUrl,this.metadata=e.metadata,this.localCurrency=e.localCurrency,this.onError=e.onError??(()=>null),this.pageLoader=new De(this.container),this.pageLoader.mountLoader("25dvh"),this.pageLoader.updateMessage("Fetching selected bank code detail")}makePayment(){var e;P.track("start_ussdProcess",{payment_method:"USSD"}),this.paymentService.createUssdPayment({amount:this.amount,currency:this.currency,channel:"ussd",customer:{email:this.email},bank:{code:((e=this.selected)==null?void 0:e.code)||""},reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0}).then(({data:i,headers:t})=>{var o;if(this.ussd_detail=i.ussd,this.activeRef=i.reference||"",i.status==="failed"){this.onError(i.providerMessage||"Payment failed"),P.track("stop_ussdProcess",{payment_method:"USSD"});const s=t.get("spf-redirect-url");this.callBackUrl=s||this.callBackUrl,this.callBackUrl&&setTimeout(()=>{const a=new URL(this.callBackUrl);a.searchParams.append("status",i.status),a.searchParams.append("reference",i.reference),window.location.href=a.toString()},1800);return}else if(i.status!=="success")if(i.ussd){this.container.innerHTML=this.render();const s=this.container.querySelectorAll(".bank-dial-code"),a=this.container.querySelector("#bank-dial-code");a&&(a.innerHTML=((o=i==null?void 0:i.ussd)==null?void 0:o.paymentCode)||"");const l=this.container.querySelector("#bank-name-ussd");l&&(l.innerHTML=this.selected.name),Array.from(s).forEach(v=>{var p;v.innerHTML=((p=i==null?void 0:i.ussd)==null?void 0:p.code)||""}),this.attachListener();return}else if(i.providerMessage){this.onError(i.providerMessage);return}else{this.onError("Unable to fetch bank details");return}this.container.innerHTML=this.render(),this.attachListener()}).catch(i=>{i!=null&&i.message?this.onError(i.message):this.onError("Payment failed")})}attachListener(){const e=this.container.querySelectorAll(".copy-code-button"),i=this.container.querySelectorAll(".copy-code-button-1"),t=this.container.querySelector("#bank-completed-payment");Array.from(e).forEach(a=>{a.addEventListener("click",l=>{var d;P.track("copy_ussdCode",{payment_method:"USSD"}),window.navigator.clipboard.writeText(((d=this.ussd_detail)==null?void 0:d.code)||"")})}),Array.from(i).forEach(a=>{a.addEventListener("click",l=>{var d;P.track("copy_ussdCode",{payment_method:"USSD"}),window.navigator.clipboard.writeText(((d=this.ussd_detail)==null?void 0:d.code)||"")})}),t&&t.addEventListener("click",a=>{a.preventDefault(),this.onAction(this.selected,this.activeRef)})}renderComponent(){this.makePayment(),this.attachListener()}render(){return ol}}var al=Object.defineProperty,rl=(n,e,i,t)=>{for(var o=void 0,s=n.length-1,a;s>=0;s--)(a=n[s])&&(o=a(e,i,o)||o);return o&&al(e,i,o),o};class Xo{constructor({container:e,onSuccess:i,secret:t,amount:o,totalAmount:s,currency:a,email:l,reference:d,rdtCode:v,url:p,callBackUrl:g,metadata:f,localCurrency:y,hidePaymentMethods:k,showPaymentMethods:C,disablePaymentMethods:S}){h(this,"contents");h(this,"selectedCode");h(this,"secret");h(this,"amount");h(this,"totalAmount");h(this,"currency");h(this,"email");h(this,"pageLoader");h(this,"reference");h(this,"onSuccess");h(this,"warningScreen");h(this,"bankDetail");h(this,"viewUssdCode");h(this,"_currentStep");h(this,"container");h(this,"paymentService");h(this,"successScreen");h(this,"activeRef","");h(this,"abortController");h(this,"_retry_count",10);h(this,"intervalPayment");h(this,"rdtCode");h(this,"url");h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"merchantDetails");h(this,"hidePaymentMethods");h(this,"showPaymentMethods");h(this,"disablePaymentMethods");this.onSuccess=i||(()=>null),this.container=e,this.secret=t,this.amount=o,this.totalAmount=s,this.currency=a,this.reference=d,this.email=l,this.rdtCode=v,this.url=p,this.callBackUrl=g,this.metadata=f,this.localCurrency=y,this.merchantDetails={},this.hidePaymentMethods=k,this.showPaymentMethods=C,this.disablePaymentMethods=S,this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.paymentService=new Yo({token:this.secret,rdtCode:this.rdtCode,url:this.url}),P.track("ussd_opens",{payment_method:"USSD"})}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderUssdContent()}onCodeSelect(e){this.selectedCode=e||"",this.currentStep=2}validate(){let e;if(this.abortController?e=this.abortController.signal:(this.abortController=new AbortController,e=this.abortController.signal),this._retry_count<=0){clearInterval(this.intervalPayment),this.currentStep=3;return}this.paymentService.verifyPayment(this.activeRef,e||this.abortController.signal).then(({data:i,headers:t})=>{i.status==="failed"?(this.currentStep=3,clearInterval(this.intervalPayment),this.redirectTo(i,t,"failed")):["successful","failed"].includes(i.status)?i.status==="inProgress"?this._retry_count-=1:["success","successful"].includes(i.status)&&(this.currentStep=5,clearInterval(this.intervalPayment),P.track("verify_payment",{payment_method:"USSD",verification_status:"Success"}),this.redirectTo(i,t,"success")):this._retry_count-=1}).catch(i=>{i.message?this.warningScreen.setPaymentError(i.message):this.warningScreen.setPaymentError("Payment failed"),this.currentStep=3,clearInterval(this.intervalPayment),P.track("verify_payment",{payment_method:"USSD",verification_status:"Failed"})})}redirectTo(e,i,t){const o=i.get("spf-redirect-url");this.callBackUrl=o||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status",e.status),s.searchParams.append("reference",e.reference),window.location.href=s.toString()},1800):t==="success"&&this.onSuccess(e)}renderUssdContent(e){var i;if(e&&(this.merchantDetails=e),this.currentStep===3||this.currentStep===5?this.hidePaymentMethods():this.showPaymentMethods(),this.currentStep===2&&this.disablePaymentMethods("ussd"),this.currentStep!==1){const t=document.getElementById("go-back");t&&(t.classList.remove("flex","items-center","gap-2","mb-2"),t.innerHTML="")}switch(this.currentStep){case 1:this.bankDetail=new Qo({container:this.contents,merchantKey:this.secret,onAction:this.onCodeSelect.bind(this),rdtCode:this.rdtCode,url:this.url,currency:this.currency,localCurrency:this.localCurrency,rate:e==null?void 0:e.rate.rate,amount:this.amount,totalAmount:this.totalAmount}),this.bankDetail.renderContent();break;case 2:this.viewUssdCode=new sl({container:this.contents,onAction:(t,o)=>{this.activeRef=o,this.currentStep=4,this.intervalPayment=setInterval(()=>{this.validate()},5e3)},selected:this.selectedCode||{},secret:this.secret,amount:this.amount,totalAmount:this.totalAmount,currency:this.currency,email:this.email||"",onError:t=>{this.currentStep=3,this.warningScreen.setPaymentError(t)},reference:this.reference,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency}),this.viewUssdCode.renderComponent();break;case 3:this.contents.innerHTML=Rt,this.warningScreen=new gn({container:this.contents});break;case 4:this.pageLoader=new De(this.contents),this.pageLoader.mountLoader("25vh"),this.pageLoader.updateMessage("We are confirming transaction status. This might take a few seconds.","Please do not refresh this page");break;case 5:this.successScreen=new qn({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(i=this.merchantDetails)==null?void 0:i.rate.rate}),this.successScreen.renderComponent();break;default:this.bankDetail=new Qo({container:this.contents,merchantKey:this.secret,onAction:this.onCodeSelect.bind(this),rdtCode:this.rdtCode,url:this.url,currency:this.currency,localCurrency:this.localCurrency,rate:e==null?void 0:e.rate.rate,amount:this.amount,totalAmount:this.totalAmount}),this.bankDetail.renderContent();break}}handleSelectChange(e){setTimeout(()=>{this.currentStep=2},400),this.currentStep=2}}rl([$o(),$o()],Xo.prototype,"selectedCode");const ll={NGN:"Nigerian Naira",USD:"US Dollar",GHS:"Ghanaian Cedi",GBP:"Pounds",ZAF:"South African Rand",USDT:"Tether",KSH:"Kenyan Shilling"},dl=n=>n==null?void 0:n.replace(/_/g," ");function cl(n){return n.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}const Ri=n=>{if(n){const e=dl(n);return cl(e)}return""},ul=`<div>
1324
+ </div>`;class sl{constructor(e){h(this,"container");h(this,"selected");h(this,"secret");h(this,"onAction");h(this,"paymentService");h(this,"currency");h(this,"amount");h(this,"ussd_detail");h(this,"reference");h(this,"customer");h(this,"activeRef","");h(this,"pageLoader");h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"onError");this.container=e.container,this.selected=e.selected,this.onAction=e.onAction,this.secret=e.secret,this.paymentService=new Yo({token:this.secret,rdtCode:e.rdtCode,url:e.url}),this.currency=e.currency,this.amount=e.amount||0,this.customer=e.customer,this.reference=e.reference,this.callBackUrl=e.callBackUrl,this.metadata=e.metadata,this.localCurrency=e.localCurrency,this.onError=e.onError??(()=>null),this.pageLoader=new Ne(this.container),this.pageLoader.mountLoader("25dvh"),this.pageLoader.updateMessage("Fetching selected bank code detail")}makePayment(){var e;P.track("start_ussdProcess",{payment_method:"USSD"}),this.paymentService.createUssdPayment({amount:this.amount,currency:this.currency,channel:"ussd",customer:this.customer,bank:{code:((e=this.selected)==null?void 0:e.code)||""},reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0}).then(({data:i,headers:t})=>{var o;if(this.ussd_detail=i.ussd,this.activeRef=i.reference||"",i.status==="failed"){this.onError(i.providerMessage||"Payment failed"),P.track("stop_ussdProcess",{payment_method:"USSD"});const s=t.get("spf-redirect-url");this.callBackUrl=s||this.callBackUrl,this.callBackUrl&&setTimeout(()=>{const a=new URL(this.callBackUrl);a.searchParams.append("status",i.status),a.searchParams.append("reference",i.reference),window.location.href=a.toString()},1800);return}else if(i.status!=="success")if(i.ussd){this.container.innerHTML=this.render();const s=this.container.querySelectorAll(".bank-dial-code"),a=this.container.querySelector("#bank-dial-code");a&&(a.innerHTML=((o=i==null?void 0:i.ussd)==null?void 0:o.paymentCode)||"");const l=this.container.querySelector("#bank-name-ussd");l&&(l.innerHTML=this.selected.name),Array.from(s).forEach(v=>{var p;v.innerHTML=((p=i==null?void 0:i.ussd)==null?void 0:p.code)||""}),this.attachListener();return}else if(i.providerMessage){this.onError(i.providerMessage);return}else{this.onError("Unable to fetch bank details");return}this.container.innerHTML=this.render(),this.attachListener()}).catch(i=>{i!=null&&i.message?this.onError(i.message):this.onError("Payment failed")})}attachListener(){const e=this.container.querySelectorAll(".copy-code-button"),i=this.container.querySelectorAll(".copy-code-button-1"),t=this.container.querySelector("#bank-completed-payment");Array.from(e).forEach(a=>{a.addEventListener("click",l=>{var d;P.track("copy_ussdCode",{payment_method:"USSD"}),window.navigator.clipboard.writeText(((d=this.ussd_detail)==null?void 0:d.code)||"")})}),Array.from(i).forEach(a=>{a.addEventListener("click",l=>{var d;P.track("copy_ussdCode",{payment_method:"USSD"}),window.navigator.clipboard.writeText(((d=this.ussd_detail)==null?void 0:d.code)||"")})}),t&&t.addEventListener("click",a=>{a.preventDefault(),this.onAction(this.selected,this.activeRef)})}renderComponent(){this.makePayment(),this.attachListener()}render(){return ol}}var al=Object.defineProperty,rl=(n,e,i,t)=>{for(var o=void 0,s=n.length-1,a;s>=0;s--)(a=n[s])&&(o=a(e,i,o)||o);return o&&al(e,i,o),o};class Xo{constructor({container:e,onSuccess:i,secret:t,amount:o,totalAmount:s,currency:a,customer:l,reference:d,rdtCode:v,url:p,callBackUrl:g,metadata:f,localCurrency:y,hidePaymentMethods:k,showPaymentMethods:C,disablePaymentMethods:S}){h(this,"contents");h(this,"selectedCode");h(this,"secret");h(this,"amount");h(this,"totalAmount");h(this,"currency");h(this,"customer");h(this,"pageLoader");h(this,"reference");h(this,"onSuccess");h(this,"warningScreen");h(this,"bankDetail");h(this,"viewUssdCode");h(this,"_currentStep");h(this,"container");h(this,"paymentService");h(this,"successScreen");h(this,"activeRef","");h(this,"abortController");h(this,"_retry_count",10);h(this,"intervalPayment");h(this,"rdtCode");h(this,"url");h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"merchantDetails");h(this,"hidePaymentMethods");h(this,"showPaymentMethods");h(this,"disablePaymentMethods");this.onSuccess=i||(()=>null),this.container=e,this.secret=t,this.amount=o,this.totalAmount=s,this.currency=a,this.reference=d,this.customer=l,this.rdtCode=v,this.url=p,this.callBackUrl=g,this.metadata=f,this.localCurrency=y,this.merchantDetails={},this.hidePaymentMethods=k,this.showPaymentMethods=C,this.disablePaymentMethods=S,this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.paymentService=new Yo({token:this.secret,rdtCode:this.rdtCode,url:this.url}),P.track("ussd_opens",{payment_method:"USSD"})}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderUssdContent()}onCodeSelect(e){this.selectedCode=e||"",this.currentStep=2}validate(){let e;if(this.abortController?e=this.abortController.signal:(this.abortController=new AbortController,e=this.abortController.signal),this._retry_count<=0){clearInterval(this.intervalPayment),this.currentStep=3;return}this.paymentService.verifyPayment(this.activeRef,e||this.abortController.signal).then(({data:i,headers:t})=>{i.status==="failed"?(this.currentStep=3,clearInterval(this.intervalPayment),this.redirectTo(i,t,"failed")):["successful","failed"].includes(i.status)?i.status==="inProgress"?this._retry_count-=1:["success","successful"].includes(i.status)&&(this.currentStep=5,clearInterval(this.intervalPayment),P.track("verify_payment",{payment_method:"USSD",verification_status:"Success"}),this.redirectTo(i,t,"success")):this._retry_count-=1}).catch(i=>{i.message?this.warningScreen.setPaymentError(i.message):this.warningScreen.setPaymentError("Payment failed"),this.currentStep=3,clearInterval(this.intervalPayment),P.track("verify_payment",{payment_method:"USSD",verification_status:"Failed"})})}redirectTo(e,i,t){const o=i.get("spf-redirect-url");this.callBackUrl=o||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status",e.status),s.searchParams.append("reference",e.reference),window.location.href=s.toString()},1800):t==="success"&&this.onSuccess(e)}renderUssdContent(e){var i;if(e&&(this.merchantDetails=e),this.currentStep===3||this.currentStep===5?this.hidePaymentMethods():this.showPaymentMethods(),this.currentStep===2&&this.disablePaymentMethods("ussd"),this.currentStep!==1){const t=document.getElementById("go-back");t&&(t.classList.remove("flex","items-center","gap-2","mb-2"),t.innerHTML="")}switch(this.currentStep){case 1:this.bankDetail=new Qo({container:this.contents,merchantKey:this.secret,onAction:this.onCodeSelect.bind(this),rdtCode:this.rdtCode,url:this.url,currency:this.currency,localCurrency:this.localCurrency,rate:e==null?void 0:e.rate.rate,amount:this.amount,totalAmount:this.totalAmount}),this.bankDetail.renderContent();break;case 2:this.viewUssdCode=new sl({container:this.contents,onAction:(t,o)=>{this.activeRef=o,this.currentStep=4,this.intervalPayment=setInterval(()=>{this.validate()},5e3)},selected:this.selectedCode||{},secret:this.secret,amount:this.amount,totalAmount:this.totalAmount,currency:this.currency,customer:this.customer,onError:t=>{this.currentStep=3,this.warningScreen.setPaymentError(t)},reference:this.reference,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency}),this.viewUssdCode.renderComponent();break;case 3:this.contents.innerHTML=Rt,this.warningScreen=new gn({container:this.contents});break;case 4:this.pageLoader=new Ne(this.contents),this.pageLoader.mountLoader("25vh"),this.pageLoader.updateMessage("We are confirming transaction status. This might take a few seconds.","Please do not refresh this page");break;case 5:this.successScreen=new qn({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(i=this.merchantDetails)==null?void 0:i.rate.rate}),this.successScreen.renderComponent();break;default:this.bankDetail=new Qo({container:this.contents,merchantKey:this.secret,onAction:this.onCodeSelect.bind(this),rdtCode:this.rdtCode,url:this.url,currency:this.currency,localCurrency:this.localCurrency,rate:e==null?void 0:e.rate.rate,amount:this.amount,totalAmount:this.totalAmount}),this.bankDetail.renderContent();break}}handleSelectChange(e){setTimeout(()=>{this.currentStep=2},400),this.currentStep=2}}rl([$o(),$o()],Xo.prototype,"selectedCode");const ll={NGN:"Nigerian Naira",USD:"US Dollar",GHS:"Ghanaian Cedi",GBP:"Pounds",ZAF:"South African Rand",USDT:"Tether",KSH:"Kenyan Shilling"},dl=n=>n==null?void 0:n.replace(/_/g," ");function cl(n){return n.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}const Ri=n=>{if(n){const e=dl(n);return cl(e)}return""},ul=`<div>
1325
1325
  <button id="go-back" class="md:hidden" aria-label="Go back">
1326
1326
  </button>
1327
1327
  </div>
@@ -1457,7 +1457,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1457
1457
 
1458
1458
  <!-- Tab options -->
1459
1459
  </div>
1460
- </div>`;class hl{constructor(e){h(this,"container");h(this,"email");h(this,"amount",0);h(this,"metadata");h(this,"currency");h(this,"localCurrency");h(this,"merchantDetail");h(this,"onAction");h(this,"isMobile");h(this,"onClose");h(this,"currentPaymentMethod");this.container=e.container,this.email=e.email,this.amount=e.amount||0,this.metadata=e.metadata,this.currency=e.currency,this.localCurrency=e.localCurrency,this.merchantDetail=e.merchantDetail,this.onAction=e.onAction,this.isMobile=e.isMobile,this.onClose=e.onClose,this.currentPaymentMethod=e.currentPaymentMethod}attachListeners(){const e=this.container.querySelectorAll(".tab-button");Array.from(e).forEach(s=>{const a=s.dataset.name||"",l=s.querySelector(".tab-button-icon"),d=s.querySelector(".tab-button-label");l&&(l.innerHTML=be[a].icon),d&&(d.textContent=be[a].label),s.addEventListener("click",v=>{v.preventDefault(),this.onAction(a)})});const t=this.container.querySelector("#close-btn");t&&t.addEventListener("click",()=>{this.onClose(!0)});const o=document.getElementById("go-back");o==null||o.addEventListener("click",()=>{this.onAction("")})}renderComponent(){var G,V,F,oe,ge,U,_e,ue,Te,Me,en,vn,nn,_n,bn,Ee,tn,Mn,re,fe,Re,Pe,we,We,N,he,Q,me,Ie,$,fn,si,Oi,Vi,Ui,ji,An;this.container.innerHTML=this.render(),this.amount=this.amount;const e=this.container.querySelector("#merchant-logo-container"),i=this.container.querySelector("#merchant-logo"),t=this.container.querySelector("#merchant-email"),o=this.container.querySelector("#merchant-email-mob"),s=this.container.querySelector("#plan-name"),a=this.container.querySelector("#plan-name-mob"),l=this.container.querySelector("#payment-fees"),d=this.container.querySelector("#currency-cursor"),v=this.container.querySelector("#currency-cursor-mob"),p=this.container.querySelector("#payment-rate-display"),g=this.container.querySelector("#payment-rate-display-mob"),f=this.container.querySelector("#designated-rate"),y=this.container.querySelector("#designated-rate-mob"),k=this.container.querySelector("#designated-rate-no-plan"),C=this.container.querySelector("#source-rate"),S=this.container.querySelector("#source-rate-mob"),M=this.container.querySelector("#tax-rate"),A=this.container.querySelector("#tax-rate-mob"),_=this.container.querySelector("#tooltip-localCurrency"),T=this.container.querySelector("#tooltip-localCurrency-mob");if((G=this.merchantDetail)!=null&&G.merchantLogo?i&&i.setAttribute("src",(V=this.merchantDetail)==null?void 0:V.merchantLogo):e&&(i==null||i.remove(),e.innerHTML=`<div class="font-semibold text-tone-100 rounded-2xl w-8 h-8 bg-tone-10 container-center uppercase">${this.merchantDetail.merchantName[0]}</div>`),t&&(t.innerHTML=this.email),o&&(o.innerHTML=this.email),s){if((oe=(F=this.merchantDetail)==null?void 0:F.plan)!=null&&oe.title){const ai=((U=(ge=this.merchantDetail)==null?void 0:ge.plan)==null?void 0:U.title)||"";s.textContent=Ri(ai)}(_e=this.metadata)!=null&&_e.productName&&(s.textContent=Ri(this.metadata.productName))}if(a){if((Te=(ue=this.merchantDetail)==null?void 0:ue.plan)!=null&&Te.title){const ai=((en=(Me=this.merchantDetail)==null?void 0:Me.plan)==null?void 0:en.title)||"";a.textContent=Ri(ai)}(vn=this.metadata)!=null&&vn.productName&&(a.textContent=Ri(this.metadata.productName))}d&&(this.currency==="USD"?p&&(p.innerHTML=`1 ${((_n=(nn=this.merchantDetail)==null?void 0:nn.rate)==null?void 0:_n.to)||"-"} = ${((Ee=(bn=this.merchantDetail)==null?void 0:bn.rate)==null?void 0:Ee.from)||"-"} ${xe(((tn=this.merchantDetail.rate)==null?void 0:tn.rate)||1,2)} `):d.innerHTML=""),v&&(this.currency==="USD"?g&&(g.innerHTML=`1 ${((re=(Mn=this.merchantDetail)==null?void 0:Mn.rate)==null?void 0:re.to)||"-"} = ${((Re=(fe=this.merchantDetail)==null?void 0:fe.rate)==null?void 0:Re.from)||"-"} ${xe(((Pe=this.merchantDetail.rate)==null?void 0:Pe.rate)||1,2)} `):v.innerHTML=""),(We=(we=this.merchantDetail)==null?void 0:we.plan)!=null&&We.title||(N=this.metadata)!=null&&N.productName?f&&(f.innerHTML=`${this.currency} ${xe(this.amount,2)}`):(k&&(k.innerHTML=`<span> ${this.currency} ${xe(this.amount,2)} </span>`),s&&a&&(s.remove(),a==null||a.remove()),this.localCurrency?f==null||f.remove():l&&l.remove()),y&&(y.innerHTML=`${this.currency} ${xe(this.amount,2)}`),C&&(this.localCurrency&&this.localCurrency!==this.currency?C.children[1].innerHTML=`${this.localCurrency} ${xe(this.amount*(((Q=(he=this.merchantDetail)==null?void 0:he.rate)==null?void 0:Q.rate)||1),2)}`:C.remove()),S&&(this.localCurrency&&this.localCurrency!==this.currency?S.children[1].innerHTML=`${this.localCurrency} ${xe(this.amount*(((Ie=(me=this.merchantDetail)==null?void 0:me.rate)==null?void 0:Ie.rate)||1),2)}`:S.remove());const I=this.localCurrency!==this.currency?this.amount*(((fn=($=this.merchantDetail)==null?void 0:$.rate)==null?void 0:fn.rate)||1):this.amount;M&&(si=this.merchantDetail)!=null&&si.taxQuoteId&&(Oi=this.merchantDetail)!=null&&Oi.totalAmount&&(M.classList.remove("hidden"),M.children[1].innerHTML=`${this.localCurrency!==this.currency?this.localCurrency:this.currency} ${xe(((Vi=this.merchantDetail)==null?void 0:Vi.totalAmount)-I,2)}`),A&&(Ui=this.merchantDetail)!=null&&Ui.taxQuoteId&&(ji=this.merchantDetail)!=null&&ji.totalAmount&&(A.classList.remove("hidden"),A.children[1].innerHTML=`${this.localCurrency!==this.currency?this.localCurrency:this.currency} ${xe(((An=this.merchantDetail)==null?void 0:An.totalAmount)-I,2)}`);const K=ll[this.localCurrency];_&&this.localCurrency&&(_.innerHTML=K?`${K} (${this.localCurrency})`:this.localCurrency),T&&this.localCurrency&&(T.innerHTML=K?`${K} (${this.localCurrency})`:this.localCurrency),this.renderPaymentOptions(this.container),this.attachListeners()}renderPaymentOptions(e){const i=e.querySelector(".payment-options"),t=this.localCurrency!==this.currency?this.localCurrency:this.currency;if(i){const o=this.merchantDetail.plan?[be.card]:this.merchantDetail.paymentMethods.filter(s=>s!=="ussd").map(s=>be[s]);if(this.isMobile){let s='<div class="">';o.forEach(a=>{s+=`
1460
+ </div>`;class hl{constructor(e){h(this,"container");h(this,"email");h(this,"amount",0);h(this,"metadata");h(this,"currency");h(this,"localCurrency");h(this,"merchantDetail");h(this,"onAction");h(this,"isMobile");h(this,"onClose");h(this,"currentPaymentMethod");this.container=e.container,this.email=e.email,this.amount=e.amount||0,this.metadata=e.metadata,this.currency=e.currency,this.localCurrency=e.localCurrency,this.merchantDetail=e.merchantDetail,this.onAction=e.onAction,this.isMobile=e.isMobile,this.onClose=e.onClose,this.currentPaymentMethod=e.currentPaymentMethod}attachListeners(){const e=this.container.querySelectorAll(".tab-button");Array.from(e).forEach(s=>{const a=s.dataset.name||"",l=s.querySelector(".tab-button-icon"),d=s.querySelector(".tab-button-label");l&&(l.innerHTML=be[a].icon),d&&(d.textContent=be[a].label),s.addEventListener("click",v=>{v.preventDefault(),this.onAction(a)})});const t=this.container.querySelector("#close-btn");t&&t.addEventListener("click",()=>{this.onClose(!0)});const o=document.getElementById("go-back");o==null||o.addEventListener("click",()=>{this.onAction("")})}renderComponent(){var G,V,F,oe,ge,U,_e,ue,Te,Me,en,vn,nn,_n,bn,Ee,tn,Mn,re,fe,Re,Pe,we,We,B,he,Q,me,Ie,$,fn,si,Oi,Vi,Ui,ji,An;this.container.innerHTML=this.render(),this.amount=this.amount;const e=this.container.querySelector("#merchant-logo-container"),i=this.container.querySelector("#merchant-logo"),t=this.container.querySelector("#merchant-email"),o=this.container.querySelector("#merchant-email-mob"),s=this.container.querySelector("#plan-name"),a=this.container.querySelector("#plan-name-mob"),l=this.container.querySelector("#payment-fees"),d=this.container.querySelector("#currency-cursor"),v=this.container.querySelector("#currency-cursor-mob"),p=this.container.querySelector("#payment-rate-display"),g=this.container.querySelector("#payment-rate-display-mob"),f=this.container.querySelector("#designated-rate"),y=this.container.querySelector("#designated-rate-mob"),k=this.container.querySelector("#designated-rate-no-plan"),C=this.container.querySelector("#source-rate"),S=this.container.querySelector("#source-rate-mob"),M=this.container.querySelector("#tax-rate"),A=this.container.querySelector("#tax-rate-mob"),_=this.container.querySelector("#tooltip-localCurrency"),T=this.container.querySelector("#tooltip-localCurrency-mob");if((G=this.merchantDetail)!=null&&G.merchantLogo?i&&i.setAttribute("src",(V=this.merchantDetail)==null?void 0:V.merchantLogo):e&&(i==null||i.remove(),e.innerHTML=`<div class="font-semibold text-tone-100 rounded-2xl w-8 h-8 bg-tone-10 container-center uppercase">${this.merchantDetail.merchantName[0]}</div>`),t&&(t.innerHTML=this.email),o&&(o.innerHTML=this.email),s){if((oe=(F=this.merchantDetail)==null?void 0:F.plan)!=null&&oe.title){const ai=((U=(ge=this.merchantDetail)==null?void 0:ge.plan)==null?void 0:U.title)||"";s.textContent=Ri(ai)}(_e=this.metadata)!=null&&_e.productName&&(s.textContent=Ri(this.metadata.productName))}if(a){if((Te=(ue=this.merchantDetail)==null?void 0:ue.plan)!=null&&Te.title){const ai=((en=(Me=this.merchantDetail)==null?void 0:Me.plan)==null?void 0:en.title)||"";a.textContent=Ri(ai)}(vn=this.metadata)!=null&&vn.productName&&(a.textContent=Ri(this.metadata.productName))}d&&(this.currency==="USD"?p&&(p.innerHTML=`1 ${((_n=(nn=this.merchantDetail)==null?void 0:nn.rate)==null?void 0:_n.to)||"-"} = ${((Ee=(bn=this.merchantDetail)==null?void 0:bn.rate)==null?void 0:Ee.from)||"-"} ${xe(((tn=this.merchantDetail.rate)==null?void 0:tn.rate)||1,2)} `):d.innerHTML=""),v&&(this.currency==="USD"?g&&(g.innerHTML=`1 ${((re=(Mn=this.merchantDetail)==null?void 0:Mn.rate)==null?void 0:re.to)||"-"} = ${((Re=(fe=this.merchantDetail)==null?void 0:fe.rate)==null?void 0:Re.from)||"-"} ${xe(((Pe=this.merchantDetail.rate)==null?void 0:Pe.rate)||1,2)} `):v.innerHTML=""),(We=(we=this.merchantDetail)==null?void 0:we.plan)!=null&&We.title||(B=this.metadata)!=null&&B.productName?f&&(f.innerHTML=`${this.currency} ${xe(this.amount,2)}`):(k&&(k.innerHTML=`<span> ${this.currency} ${xe(this.amount,2)} </span>`),s&&a&&(s.remove(),a==null||a.remove()),this.localCurrency?f==null||f.remove():l&&l.remove()),y&&(y.innerHTML=`${this.currency} ${xe(this.amount,2)}`),C&&(this.localCurrency&&this.localCurrency!==this.currency?C.children[1].innerHTML=`${this.localCurrency} ${xe(this.amount*(((Q=(he=this.merchantDetail)==null?void 0:he.rate)==null?void 0:Q.rate)||1),2)}`:C.remove()),S&&(this.localCurrency&&this.localCurrency!==this.currency?S.children[1].innerHTML=`${this.localCurrency} ${xe(this.amount*(((Ie=(me=this.merchantDetail)==null?void 0:me.rate)==null?void 0:Ie.rate)||1),2)}`:S.remove());const I=this.localCurrency!==this.currency?this.amount*(((fn=($=this.merchantDetail)==null?void 0:$.rate)==null?void 0:fn.rate)||1):this.amount;M&&(si=this.merchantDetail)!=null&&si.taxQuoteId&&(Oi=this.merchantDetail)!=null&&Oi.totalAmount&&(M.classList.remove("hidden"),M.children[1].innerHTML=`${this.localCurrency!==this.currency?this.localCurrency:this.currency} ${xe(((Vi=this.merchantDetail)==null?void 0:Vi.totalAmount)-I,2)}`),A&&(Ui=this.merchantDetail)!=null&&Ui.taxQuoteId&&(ji=this.merchantDetail)!=null&&ji.totalAmount&&(A.classList.remove("hidden"),A.children[1].innerHTML=`${this.localCurrency!==this.currency?this.localCurrency:this.currency} ${xe(((An=this.merchantDetail)==null?void 0:An.totalAmount)-I,2)}`);const K=ll[this.localCurrency];_&&this.localCurrency&&(_.innerHTML=K?`${K} (${this.localCurrency})`:this.localCurrency),T&&this.localCurrency&&(T.innerHTML=K?`${K} (${this.localCurrency})`:this.localCurrency),this.renderPaymentOptions(this.container),this.attachListeners()}renderPaymentOptions(e){const i=e.querySelector(".payment-options"),t=this.localCurrency!==this.currency?this.localCurrency:this.currency;if(i){const o=this.merchantDetail.plan?[be.card]:this.merchantDetail.paymentMethods.filter(s=>s!=="ussd").map(s=>be[s]);if(this.isMobile){let s='<div class="">';o.forEach(a=>{s+=`
1461
1461
  <div key=${a.key}>
1462
1462
  <button class="tab-button gap-2 mb-4 group" data-name="${a.key}">
1463
1463
  <div class="lg:block">${a.icon}</div>
@@ -1981,7 +1981,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1981
1981
  <path
1982
1982
  d="M62 32C62 38.6156 59.8132 45.0457 55.78 50.2897C51.7468 55.5336 46.0932 59.2974 39.6992 60.9952C33.3052 62.693 26.5293 62.2297 20.4258 59.6774C14.3224 57.1251 9.2338 52.6268 5.95186 46.8827C2.66993 41.1385 1.37873 34.4707 2.2792 27.9166C3.17967 21.3626 6.22129 15.29 10.9308 10.6438C15.6402 5.9976 21.7534 3.0384 28.3191 2.22668C34.8847 1.41496 41.5345 2.79623 47.2337 6.15557"
1983
1983
  stroke="black" stroke-width="4" stroke-linejoin="round" />
1984
- </svg>`),t&&t.classList.add("hidden"),i&&i.setAttribute("disabled","true"),e&&(e.value="",this.momoOtp="",e.setAttribute("disabled","true")),this.onClose(!1)})}handleOtpInput(e,i){const t=e.target,o=e.data;o&&this.momoOtp.length<6?this.momoOtp+=o:e.inputType==="deleteContentBackward"&&(this.momoOtp=this.momoOtp.slice(0,-1)),t.value="*".repeat(this.momoOtp.length),this.momoOtp.length>=6&&i&&i.removeAttribute("disabled");const s=this.container.querySelector("#otp-error");this.momoOtp.length<6&&(i&&i.setAttribute("disabled","true"),s&&(s.innerHTML=""))}renderComponent(){this.container.innerHTML=this.render();const e=this.container.querySelector("#otp-message");e&&(e.innerHTML=this.otpMessage),this.attachListener()}render(){return Cl}}class kl{constructor(e){h(this,"container");h(this,"onAction");h(this,"callBackUrl");h(this,"paymentResponse");h(this,"paymentResponseHeaders");this.container=e.container,this.onAction=e.onAction,this.callBackUrl=e.callBackUrl,this.paymentResponse=e.paymentResponse,this.paymentResponseHeaders=e.paymentResponseHeaders}attachListeners(){const e=this.container.querySelector(".details-form-button");e&&e.addEventListener("click",()=>{Ze(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)})}renderComponent(){this.container.innerHTML=this.render(),this.attachListeners()}render(){return qo}}class Sl{constructor({container:e,merchantKey:i,localCurrency:t,metadata:o,callBackUrl:s,rdtCode:a,reference:l,onSuccess:d,url:v,email:p,amount:g,totalAmount:f,token:y,currency:k,disablePaymentMethods:C,hidePaymentMethods:S,showPaymentMethods:M,onClose:A,restartTransactionProcess:_,retryingPayment:T,countryCode:I}){h(this,"contents");h(this,"mobileMoneyForm");h(this,"mobileMoneyValidationForm");h(this,"onSuccess");h(this,"mobileMoneyConfirmation");h(this,"mobileMoneyConfirmationEnd");h(this,"transactionIssuesScreen");h(this,"container");h(this,"pageLoader");h(this,"mainLoader");h(this,"_currentStep");h(this,"successScreen");h(this,"email");h(this,"activeRef");h(this,"warningScreen");h(this,"amount");h(this,"totalAmount");h(this,"url");h(this,"reference");h(this,"metadata");h(this,"currency");h(this,"localCurrency");h(this,"token");h(this,"callBackUrl");h(this,"rdtCode");h(this,"merchantDetails");h(this,"onClose");h(this,"hidePaymentMethods");h(this,"showPaymentMethods");h(this,"disablePaymentMethods");h(this,"paymentResponse");h(this,"paymentResponseHeaders");h(this,"restartTransactionProcess");h(this,"retryingPayment");h(this,"isMaxRetriesReached");h(this,"isMobile",!1);h(this,"countryCode");this.container=e,this.onSuccess=d||(()=>null),this.token=y,this.currency=k,this.amount=g,this.totalAmount=f,this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.activeRef="",this.token=i,this.email=p,this.metadata=o,this.localCurrency=t,this.callBackUrl=s,this.localCurrency=t,this.rdtCode=a,this.url=v,this.reference=l,this.merchantDetails={},this.disablePaymentMethods=C,this.hidePaymentMethods=S,this.showPaymentMethods=M,this.onClose=A,this.paymentResponse={},this.paymentResponseHeaders={},this.restartTransactionProcess=_,this.retryingPayment=T,this.isMaxRetriesReached=!1,this.countryCode=I,P.track("mobile_money_opens",{payment_method:"Mobile Money"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderMobileMoneyContent()}attachInputListeners(){}async createMobileMoney(e,i){e.stopPropagation(),e.preventDefault();const t=this.container.querySelector(".spinner"),o=this.container.querySelector("#mobile-money-button-text");t&&o&&(t.classList.remove("hidden"),o.classList.add("hidden")),(()=>{var a,l;if(this.retryingPayment){const d={channel:"mobile_money",reference:this.reference,mobileMoney:{code:i.code,phoneNumber:i.phoneNumber,...i.otp&&{otp:i.otp}}};return ci(this.token,d,this.rdtCode,this.url)}else{const d={amount:this.amount,channel:"mobile_money",currency:this.currency||"USD",customer:{email:this.email},reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,mobileMoney:{code:i.code,phoneNumber:i.phoneNumber,...i.otp&&{otp:i.otp}},...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((a=this.merchantDetails)==null?void 0:a.taxQuoteId)&&{taxQuoteId:(l=this.merchantDetails)==null?void 0:l.taxQuoteId},...this.countryCode&&{countryCode:this.countryCode}};return xs(this.token,d,this.rdtCode,this.url)}})().then(({data:a,headers:l})=>{var d;if(this.paymentResponse=a,this.paymentResponseHeaders=l,a.status==="failed"){this.currentStep=5,a.providerMessage?this.warningScreen.setPaymentError(a.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue(),P.track("start_payment_failed",{payment_method:"Mobile Money",verification_status:"Failed",payment_error:a.providerMessage||"Payment failed"});return}else if(a.status==="success"||a.status==="successful"){this.currentStep=4,P.track("start_payment_success",{payment_method:"Mobile Money",verification_status:"Success"}),Ze(a,l,a==null?void 0:a.callBackUrl);return}else if(((d=a==null?void 0:a.authorization)==null?void 0:d.mode)==="otp"){this.activeRef=a.reference,this.currentStep=6;return}else this.currentStep=3}).catch(a=>{P.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Null"}),a.code==="payment_max_retry_attempts"?(this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=5,this.warningScreen.setPaymentError("Maximum retries","You have reached the maximum number of retries allowed. Go back to merchant website to start the payment process again.","Go back to Merchant")):(this.currentStep=5,a.message?this.warningScreen.setPaymentError(a.message):this.warningScreen.setPaymentError("Payment failed")),this.warningScreen.hideReportIssue()}).finally(()=>{t&&o&&(t.classList.add("hidden"),o.classList.remove("hidden"))})}showLoader(){this.pageLoader=new De(this.contents),this.pageLoader.mountLoader()}submitOtp(e,i){e.preventDefault();const t=this.container.querySelector(".spinner"),o=this.container.querySelector("#mobile-money-button-text"),s={authorization:{otp:i},reference:this.activeRef};P.track("input_MobileMoneyOTP",{payment_method:"Mobile Money",authentication_type:"0TP"}),t&&o&&(t.classList.remove("hidden"),o.classList.add("hidden")),di(this.token,s,this.rdtCode,this.url).then(({data:l})=>{l.status==="failed"?(this.activeRef=l.reference,this.currentStep=3):["success","successful","failed"].includes(l.status)?["success","successful"].includes(l.status)&&(this.activeRef=l.reference,this.currentStep=3):(this.activeRef=l.reference,this.currentStep=3)}).catch(l=>{P.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Failed",authentication_type:"OTP"});const d=this.container.querySelector("#otp-error");l.code==="invalid_otp"?(d&&(d.innerHTML=l.message),P.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Failed",authentication_type:"OTP"})):this.currentStep=3}).finally(()=>{t&&o&&(t.classList.add("hidden"),o.classList.remove("hidden"))})}async verifyPaymentProcess(){try{const e=await an(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers}catch{this.currentStep=5}}goBackToMerchant(){Ze(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}renderMobileMoneyContent(e){var i;if(e&&(this.merchantDetails=e),this.currentStep===3&&this.disablePaymentMethods("mobile_money"),this.currentStep!==1){const t=document.getElementById("go-back");t&&(t.classList.remove("flex","items-center","gap-2","mb-2"),t.innerHTML="")}switch(this.currentStep===6?this.hidePaymentMethods():this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.currentStep){case 1:this.mobileMoneyForm=new yl({container:this.contents,merchantKey:this.token,url:this.url,onAction:t=>o=>this.createMobileMoney.bind(this)(t,o),ref:this.activeRef,switchScreen:t=>{this.currentStep=t},rdtCode:this.rdtCode,currency:this.currency,localCurrency:this.localCurrency,amount:this.amount,totalAmount:this.totalAmount,restartTransactionProcess:this.restartTransactionProcess.bind(this),merchantDetails:this.merchantDetails,countryCode:this.countryCode||""}),this.mobileMoneyForm.renderContent();break;case 2:this.mainLoader=new De(this.contents),this.mainLoader.mountLoader("25dvh"),this.mainLoader.updateMessage("Please wait");break;case 3:this.mobileMoneyConfirmation=new fl({container:this.contents,onAction:t=>{this.currentStep=t},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(t,o)=>{this.paymentResponse=t,this.paymentResponseHeaders=o}}),this.mobileMoneyConfirmation.renderComponent();break;case 4:this.successScreen=new qn({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:e==null?void 0:e.rate.rate}),this.successScreen.renderComponent();break;case 5:this.warningScreen=new gn({container:this.contents,onReportIssue:()=>this.currentStep=9,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this)}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 6:this.mobileMoneyValidationForm=new wl({container:this.contents,onClose:this.onClose,onAction:t=>o=>this.submitOtp.bind(this)(t,o),otpMessage:((i=this.paymentResponse)==null?void 0:i.providerMessage)||"Please enter your OTP sent to your phone"}),this.mobileMoneyValidationForm.renderComponent();break;case 7:this.pageLoader=new De(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 8:this.mobileMoneyConfirmationEnd=new kl({container:this.contents,onAction:t=>{this.currentStep=t},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.mobileMoneyConfirmationEnd.renderComponent();break;case 9:this.transactionIssuesScreen=new mi({container:this.contents,onAction:()=>{var t;this.currentStep=5,this.warningScreen.setPaymentError(((t=this.paymentResponse)==null?void 0:t.providerMessage)||"Payment failed")},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"mobile_money",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break}this.attachInputListeners()}}const _l=`<div id="eft-authenticate-container">
1984
+ </svg>`),t&&t.classList.add("hidden"),i&&i.setAttribute("disabled","true"),e&&(e.value="",this.momoOtp="",e.setAttribute("disabled","true")),this.onClose(!1)})}handleOtpInput(e,i){const t=e.target,o=e.data;o&&this.momoOtp.length<6?this.momoOtp+=o:e.inputType==="deleteContentBackward"&&(this.momoOtp=this.momoOtp.slice(0,-1)),t.value="*".repeat(this.momoOtp.length),this.momoOtp.length>=6&&i&&i.removeAttribute("disabled");const s=this.container.querySelector("#otp-error");this.momoOtp.length<6&&(i&&i.setAttribute("disabled","true"),s&&(s.innerHTML=""))}renderComponent(){this.container.innerHTML=this.render();const e=this.container.querySelector("#otp-message");e&&(e.innerHTML=this.otpMessage),this.attachListener()}render(){return Cl}}class kl{constructor(e){h(this,"container");h(this,"onAction");h(this,"callBackUrl");h(this,"paymentResponse");h(this,"paymentResponseHeaders");this.container=e.container,this.onAction=e.onAction,this.callBackUrl=e.callBackUrl,this.paymentResponse=e.paymentResponse,this.paymentResponseHeaders=e.paymentResponseHeaders}attachListeners(){const e=this.container.querySelector(".details-form-button");e&&e.addEventListener("click",()=>{Ze(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)})}renderComponent(){this.container.innerHTML=this.render(),this.attachListeners()}render(){return qo}}class Sl{constructor({container:e,merchantKey:i,localCurrency:t,metadata:o,callBackUrl:s,rdtCode:a,reference:l,onSuccess:d,url:v,customer:p,amount:g,totalAmount:f,token:y,currency:k,disablePaymentMethods:C,hidePaymentMethods:S,showPaymentMethods:M,onClose:A,restartTransactionProcess:_,retryingPayment:T,countryCode:I}){h(this,"contents");h(this,"mobileMoneyForm");h(this,"mobileMoneyValidationForm");h(this,"onSuccess");h(this,"mobileMoneyConfirmation");h(this,"mobileMoneyConfirmationEnd");h(this,"transactionIssuesScreen");h(this,"container");h(this,"pageLoader");h(this,"mainLoader");h(this,"_currentStep");h(this,"successScreen");h(this,"customer");h(this,"activeRef");h(this,"warningScreen");h(this,"amount");h(this,"totalAmount");h(this,"url");h(this,"reference");h(this,"metadata");h(this,"currency");h(this,"localCurrency");h(this,"token");h(this,"callBackUrl");h(this,"rdtCode");h(this,"merchantDetails");h(this,"onClose");h(this,"hidePaymentMethods");h(this,"showPaymentMethods");h(this,"disablePaymentMethods");h(this,"paymentResponse");h(this,"paymentResponseHeaders");h(this,"restartTransactionProcess");h(this,"retryingPayment");h(this,"isMaxRetriesReached");h(this,"isMobile",!1);h(this,"countryCode");this.container=e,this.onSuccess=d||(()=>null),this.token=y,this.currency=k,this.amount=g,this.totalAmount=f,this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.activeRef="",this.token=i,this.customer=p,this.metadata=o,this.localCurrency=t,this.callBackUrl=s,this.localCurrency=t,this.rdtCode=a,this.url=v,this.reference=l,this.merchantDetails={},this.disablePaymentMethods=C,this.hidePaymentMethods=S,this.showPaymentMethods=M,this.onClose=A,this.paymentResponse={},this.paymentResponseHeaders={},this.restartTransactionProcess=_,this.retryingPayment=T,this.isMaxRetriesReached=!1,this.countryCode=I,P.track("mobile_money_opens",{payment_method:"Mobile Money"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderMobileMoneyContent()}attachInputListeners(){}async createMobileMoney(e,i){e.stopPropagation(),e.preventDefault();const t=this.container.querySelector(".spinner"),o=this.container.querySelector("#mobile-money-button-text");t&&o&&(t.classList.remove("hidden"),o.classList.add("hidden")),(()=>{var a,l;if(this.retryingPayment){const d={channel:"mobile_money",reference:this.reference,mobileMoney:{code:i.code,phoneNumber:i.phoneNumber,...i.otp&&{otp:i.otp}}};return ci(this.token,d,this.rdtCode,this.url)}else{const d={amount:this.amount,channel:"mobile_money",currency:this.currency||"USD",customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,mobileMoney:{code:i.code,phoneNumber:i.phoneNumber,...i.otp&&{otp:i.otp}},...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((a=this.merchantDetails)==null?void 0:a.taxQuoteId)&&{taxQuoteId:(l=this.merchantDetails)==null?void 0:l.taxQuoteId},...this.countryCode&&{countryCode:this.countryCode}};return xs(this.token,d,this.rdtCode,this.url)}})().then(({data:a,headers:l})=>{var d;if(this.paymentResponse=a,this.paymentResponseHeaders=l,a.status==="failed"){this.currentStep=5,a.providerMessage?this.warningScreen.setPaymentError(a.providerMessage):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue(),P.track("start_payment_failed",{payment_method:"Mobile Money",verification_status:"Failed",payment_error:a.providerMessage||"Payment failed"});return}else if(a.status==="success"||a.status==="successful"){this.currentStep=4,P.track("start_payment_success",{payment_method:"Mobile Money",verification_status:"Success"}),Ze(a,l,a==null?void 0:a.callBackUrl);return}else if(((d=a==null?void 0:a.authorization)==null?void 0:d.mode)==="otp"){this.activeRef=a.reference,this.currentStep=6;return}else this.currentStep=3}).catch(a=>{P.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Null"}),a.code==="payment_max_retry_attempts"?(this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=5,this.warningScreen.setPaymentError("Maximum retries","You have reached the maximum number of retries allowed. Go back to merchant website to start the payment process again.","Go back to Merchant")):(this.currentStep=5,a.message?this.warningScreen.setPaymentError(a.message):this.warningScreen.setPaymentError("Payment failed")),this.warningScreen.hideReportIssue()}).finally(()=>{t&&o&&(t.classList.add("hidden"),o.classList.remove("hidden"))})}showLoader(){this.pageLoader=new Ne(this.contents),this.pageLoader.mountLoader()}submitOtp(e,i){e.preventDefault();const t=this.container.querySelector(".spinner"),o=this.container.querySelector("#mobile-money-button-text"),s={authorization:{otp:i},reference:this.activeRef};P.track("input_MobileMoneyOTP",{payment_method:"Mobile Money",authentication_type:"0TP"}),t&&o&&(t.classList.remove("hidden"),o.classList.add("hidden")),di(this.token,s,this.rdtCode,this.url).then(({data:l})=>{l.status==="failed"?(this.activeRef=l.reference,this.currentStep=3):["success","successful","failed"].includes(l.status)?["success","successful"].includes(l.status)&&(this.activeRef=l.reference,this.currentStep=3):(this.activeRef=l.reference,this.currentStep=3)}).catch(l=>{P.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Failed",authentication_type:"OTP"});const d=this.container.querySelector("#otp-error");l.code==="invalid_otp"?(d&&(d.innerHTML=l.message),P.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Failed",authentication_type:"OTP"})):this.currentStep=3}).finally(()=>{t&&o&&(t.classList.add("hidden"),o.classList.remove("hidden"))})}async verifyPaymentProcess(){try{const e=await an(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers}catch{this.currentStep=5}}goBackToMerchant(){Ze(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}renderMobileMoneyContent(e){var i;if(e&&(this.merchantDetails=e),this.currentStep===3&&this.disablePaymentMethods("mobile_money"),this.currentStep!==1){const t=document.getElementById("go-back");t&&(t.classList.remove("flex","items-center","gap-2","mb-2"),t.innerHTML="")}switch(this.currentStep===6?this.hidePaymentMethods():this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.currentStep){case 1:this.mobileMoneyForm=new yl({container:this.contents,merchantKey:this.token,url:this.url,onAction:t=>o=>this.createMobileMoney.bind(this)(t,o),ref:this.activeRef,switchScreen:t=>{this.currentStep=t},rdtCode:this.rdtCode,currency:this.currency,localCurrency:this.localCurrency,amount:this.amount,totalAmount:this.totalAmount,restartTransactionProcess:this.restartTransactionProcess.bind(this),merchantDetails:this.merchantDetails,countryCode:this.countryCode||""}),this.mobileMoneyForm.renderContent();break;case 2:this.mainLoader=new Ne(this.contents),this.mainLoader.mountLoader("25dvh"),this.mainLoader.updateMessage("Please wait");break;case 3:this.mobileMoneyConfirmation=new fl({container:this.contents,onAction:t=>{this.currentStep=t},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(t,o)=>{this.paymentResponse=t,this.paymentResponseHeaders=o}}),this.mobileMoneyConfirmation.renderComponent();break;case 4:this.successScreen=new qn({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:e==null?void 0:e.rate.rate}),this.successScreen.renderComponent();break;case 5:this.warningScreen=new gn({container:this.contents,onReportIssue:()=>this.currentStep=9,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this)}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 6:this.mobileMoneyValidationForm=new wl({container:this.contents,onClose:this.onClose,onAction:t=>o=>this.submitOtp.bind(this)(t,o),otpMessage:((i=this.paymentResponse)==null?void 0:i.providerMessage)||"Please enter your OTP sent to your phone"}),this.mobileMoneyValidationForm.renderComponent();break;case 7:this.pageLoader=new Ne(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 8:this.mobileMoneyConfirmationEnd=new kl({container:this.contents,onAction:t=>{this.currentStep=t},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.mobileMoneyConfirmationEnd.renderComponent();break;case 9:this.transactionIssuesScreen=new mi({container:this.contents,onAction:()=>{var t;this.currentStep=5,this.warningScreen.setPaymentError(((t=this.paymentResponse)==null?void 0:t.providerMessage)||"Payment failed")},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"mobile_money",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break}this.attachInputListeners()}}const _l=`<div id="eft-authenticate-container">
1985
1985
  <div class="pt-3">
1986
1986
  <div class="container-center">
1987
1987
  <svg width="98" height="32" viewBox="0 0 98 32" fill="none" xmlns="http://www.w3.org/2000/svg"
@@ -2018,12 +2018,12 @@ or you can use record.mirror to access the mirror instance during recording.`;le
2018
2018
  </div>
2019
2019
  </div>
2020
2020
 
2021
- </div>`;class ts{constructor(e){h(this,"container");h(this,"payment");h(this,"warningError");h(this,"pageLoader");h(this,"onAction");h(this,"restartTransactionProcess");this.container=e.container,this.onAction=e.onAction,this.restartTransactionProcess=e.restartTransactionProcess,this.warningError=new gn({container:this.container,onAction:this.restartTransactionProcess.bind(this)})}attachListener(){const e=this.container.querySelector("#authenticate-btn");e&&e.addEventListener("click",()=>{this.onAction(),P.track("start_payment",{payment_method:"EFT"})})}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return _l}}class Ml{constructor({amount:e,totalAmount:i,container:t,email:o,token:s,currency:a,rdtCode:l,url:d,reference:v,callBackUrl:p,metadata:g,localCurrency:f,hidePaymentMethods:y,showPaymentMethods:k,restartTransactionProcess:C,retryingPayment:S}){h(this,"contents");h(this,"eftAuthenticate");h(this,"successScreen");h(this,"pageLoader");h(this,"warningScreen");h(this,"transactionIssuesScreen");h(this,"container");h(this,"email");h(this,"token");h(this,"amount");h(this,"totalAmount");h(this,"currency");h(this,"_currentStep");h(this,"rdtCode");h(this,"url");h(this,"reference");h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"hidePaymentMethods");h(this,"showPaymentMethods");h(this,"merchantPlanDetail",{});h(this,"restartTransactionProcess");h(this,"retryingPayment");h(this,"isMaxRetriesReached");h(this,"isMobile",!1);h(this,"paymentResponse");h(this,"paymentResponseHeaders");this.currency=a,this.container=t,this.token=s,this.email=o,this.amount=e,this.totalAmount=i,this.rdtCode=l,this.url=d,this.reference=v,this.callBackUrl=p,this.metadata=g,this.localCurrency=f,this._currentStep=1,this.contents=this.container.querySelector("#payment-content-view"),this.hidePaymentMethods=y,this.showPaymentMethods=k,this.restartTransactionProcess=C,this.retryingPayment=S,this.isMaxRetriesReached=!1,this.paymentResponse={},this.paymentResponseHeaders={},this.renderEftContent(),P.track("eft_opens",{payment_method:"EFT"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderEftContent()}showLoader(){this.pageLoader=new De(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment")}setPaymentError(e){const i=this.container.querySelector("#payment-warning-text");i&&(i.textContent=e)}goBackToMerchant(){Ze(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}async createEftPayment(){const e=this.container.querySelector(".spinner"),i=this.container.querySelector("#authenticate-button-text");e&&i&&(e.classList.remove("hidden"),i.classList.add("hidden")),(()=>{var o,s;if(this.retryingPayment){const a={channel:"eft",reference:this.reference};return ci(this.token,a,this.rdtCode,this.url)}else{const a={amount:this.amount,channel:"eft",currency:this.currency,customer:{email:this.email},reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((o=this.merchantPlanDetail)==null?void 0:o.taxQuoteId)&&{taxQuoteId:(s=this.merchantPlanDetail)==null?void 0:s.taxQuoteId}};return Nt(this.token,a,this.rdtCode,this.url)}})().then(({data:o,headers:s})=>{var a,l,d;if(this.paymentResponse=o,this.paymentResponseHeaders=s,o.status==="failed"){this.currentStep=4,o.providerMessage?this.warningScreen.setPaymentError(o.providerMessage):this.warningScreen.setPaymentError("Payment failed"),P.track("start_payment",{payment_method:"EFT",verification_status:"Failed"});return}else if(((a=o==null?void 0:o.authorization)==null?void 0:a.mode)==="redirect"){(l=o==null?void 0:o.authorization)!=null&&l.redirectUrl&&this.redirectToOzow((d=o==null?void 0:o.authorization)==null?void 0:d.redirectUrl);return}else this.currentStep=4,o!=null&&o.providerMessage?this.warningScreen.setPaymentError(o==null?void 0:o.providerMessage):this.warningScreen.setPaymentError("Unable to get redirect URL")}).catch(o=>{o.code==="payment_max_retry_attempts"?(this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=4,this.warningScreen.setPaymentError("Maximum retries","You have reached the maximum number of retries allowed. Go back to merchant website to start the payment process again.","Go back to Merchant")):(this.currentStep=4,o.message?this.warningScreen.setPaymentError(o.message):this.warningScreen.setPaymentError("Payment failed"))}).finally(()=>{e&&i&&(e.classList.add("hidden"),i.classList.remove("hidden"))})}redirectToOzow(e){const i=window.open(e,"_blank");if(i){P.track("auth_redirect",{payment_method:"EFT",authentication_type:"Redirect",verification_status:"In Progress"}),this.currentStep=3,this.showLoader();const t=setInterval(()=>{i.closed&&(clearInterval(t),this.verifyPaymentProcess())},2e3)}}async verifyPaymentProcess(){try{const e=await an(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers;const i=this.paymentResponse.status;i==="successful"?(this.currentStep=2,P.track("verify_payment",{payment_method:"EFT",verification_status:"Success"}),Ze(this.paymentResponse,this.paymentResponseHeaders,"success")):i==="failed"?(this.currentStep=4,P.track("verify_payment",{payment_method:"EFT",verification_status:"Failed"}),this.paymentResponse.providerMessage?this.warningScreen.setPaymentError(this.paymentResponse.providerMessage):this.warningScreen.setPaymentError("Payment failed")):i==="cancelled"&&(this.isMaxRetriesReached=!0,this.currentStep=4,this.warningScreen.setPaymentError("Payment Cancelled","You have cancelled the payment. Go back to merchant website to start the payment process again.","Go back to Merchant"))}catch{this.currentStep=4,this.warningScreen.setPaymentError("Payment failed")}}renderEftContent(e){var t;e&&(this.merchantPlanDetail=e);const i=document.getElementById("go-back");if(this.currentStep!==1?(this.hidePaymentMethods(),i==null||i.classList.add("hidden")):this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.contents){switch(this.currentStep){case 1:this.eftAuthenticate=new ts({container:this.contents,onAction:this.createEftPayment.bind(this),restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.eftAuthenticate.renderComponent();break;case 2:this.successScreen=new qn({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(t=this.merchantPlanDetail)==null?void 0:t.rate.rate}),this.successScreen.renderComponent();break;case 3:this.pageLoader=new De(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 4:this.warningScreen=new gn({container:this.contents,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this),onReportIssue:()=>this.currentStep=5}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 5:this.transactionIssuesScreen=new mi({container:this.contents,onAction:()=>{var s;this.currentStep=4,this.warningScreen.setPaymentError(((s=this.paymentResponse)==null?void 0:s.providerMessage)||"Payment failed")},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"eft",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break;default:this.eftAuthenticate=new ts({container:this.contents,onAction:this.createEftPayment.bind(this),restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.eftAuthenticate.renderComponent();break}const o=this.container.querySelector("#card-currency");o&&(o.textContent=`${this.localCurrency?this.localCurrency:this.currency} Card`)}}}class Al{constructor({container:e,email:i,phoneNumber:t,code:o,encryption:s,merchantKey:a,modalContainer:l,amount:d,planId:v,rdtCode:p,url:g,reference:f,callBackUrl:y,metadata:k,localCurrency:C,closePayment:S,countryCode:M}){h(this,"validChannels",[]);h(this,"disabledChannels",[]);h(this,"selectedChannel");h(this,"modalContainer");h(this,"currentPaymentMethod");h(this,"mainLayout");h(this,"mainHeader");h(this,"mainFooter");h(this,"testCard");h(this,"merchantPlanDetail",{});h(this,"mainScreen");h(this,"currency");h(this,"card");h(this,"transfer");h(this,"ussd");h(this,"mobileMoney");h(this,"eft");h(this,"encryption");h(this,"merchantKey");h(this,"planId");h(this,"email");h(this,"phoneNumber");h(this,"code");h(this,"amount",0);h(this,"rdtCode");h(this,"url");h(this,"reference");h(this,"isMobile",!1);h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"closePayment");h(this,"retryingPayment");h(this,"totalAmount");h(this,"countryCode");this.validChannels=[],this.disabledChannels=[],this.selectedChannel="",this.modalContainer=l,this.encryption=s,this.planId=v||"",this.merchantKey=a,this.email=i,this.phoneNumber=t,this.code=o,this.amount=d||0,this.rdtCode=p||"",this.url=g||"",this.reference=f,this.mainLayout=e,this.callBackUrl=y,this.metadata=k||{},this.localCurrency=C||"",this.isMobile=window.matchMedia("(max-width: 767px)").matches,this.currentPaymentMethod="",this.currency="",this.closePayment=S,this.retryingPayment=!1,this.totalAmount=0,this.countryCode=M||""}mountScreen(e,i,t,o){var a,l;t&&(this.validChannels=t),o&&(this.disabledChannels=o),this.mainLayout.innerHTML=this.render(),this.merchantPlanDetail=e,this.currency=i;const s=(l=(a=this.merchantPlanDetail.plan)==null?void 0:a.pricingOptions)==null?void 0:l.find(d=>d.currency===this.currency);this.amount=(s==null?void 0:s.amount)||this.amount,this.totalAmount=this.merchantPlanDetail.totalAmount||this.amount,this.mainHeader=new hl({container:document.getElementById("main-header"),email:this.email,amount:this.amount,metadata:this.metadata,currency:this.currency,localCurrency:this.localCurrency,merchantDetail:e,onAction:this.switchTab.bind(this),isMobile:this.isMobile,onClose:d=>{this.closeBTN.bind(this)(d)},currentPaymentMethod:this.currentPaymentMethod}),this.mainHeader.renderComponent(),this.testCard=new es({container:document.getElementById("test-container"),closeCallback:()=>{const d=document.getElementById("test-container");d&&(d.innerHTML="",d.classList.add("hidden"))}}),this.mainFooter=new is({container:document.getElementById("main-footer"),testCardContainer:document.getElementById("test-container")}),document.addEventListener("DOMContentLoaded",()=>{const d=document.getElementById("main-footer"),v=document.getElementById("test-container");new is({container:d,testCardContainer:v}).renderComponent()}),this.mainFooter.renderComponent(),this.setupPaymentMethodButtons(),this.selectedChannel&&(this.currentPaymentMethod=this.selectedChannel),this.updatePaymentMethodView(this.merchantKey,this.email,this.amount,this.totalAmount,this.currency),this.renderPaymentMethodContent(),this.setCurrentPaymentMethod(this.currentPaymentMethod)}setupPaymentMethodButtons(){const e=document.querySelectorAll(".tab-button");e.forEach(t=>{t.removeAttribute("disabled"),t.classList.remove("hidden","disabled","limit-exceeded");const o=t.querySelector(".disabled-indicator");o&&t.removeChild(o)});const i=[...this.validChannels,...this.disabledChannels];e.forEach(t=>{const o=t.getAttribute("data-name");o&&!i.includes(o)&&t.classList.add("hidden")}),this.disabledChannels.forEach(t=>{const o=Array.from(e).find(s=>s.getAttribute("data-name")===t);if(o){o.setAttribute("disabled","true"),o.classList.add("disabled","limit-exceeded"),o.setAttribute("title","Transaction amount exceeds limit for this payment method");const s=document.createElement("span");s.classList.add("disabled-indicator"),s.style.fontSize="10px",s.style.color="#FF5733",s.style.display="block",o.appendChild(s)}})}attachListeners(){const e=document.getElementById("go-back"),i=document.getElementById("select-payment-method-text");this.isMobile&&(this.currentPaymentMethod?(e&&(e.classList.add("flex","items-center","gap-2","mb-2"),e.innerHTML=` <svg width="9" height="18" viewBox="0 0 9 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2021
+ </div>`;class ts{constructor(e){h(this,"container");h(this,"payment");h(this,"warningError");h(this,"pageLoader");h(this,"onAction");h(this,"restartTransactionProcess");this.container=e.container,this.onAction=e.onAction,this.restartTransactionProcess=e.restartTransactionProcess,this.warningError=new gn({container:this.container,onAction:this.restartTransactionProcess.bind(this)})}attachListener(){const e=this.container.querySelector("#authenticate-btn");e&&e.addEventListener("click",()=>{this.onAction(),P.track("start_payment",{payment_method:"EFT"})})}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return _l}}class Ml{constructor({amount:e,totalAmount:i,container:t,customer:o,token:s,currency:a,rdtCode:l,url:d,reference:v,callBackUrl:p,metadata:g,localCurrency:f,hidePaymentMethods:y,showPaymentMethods:k,restartTransactionProcess:C,retryingPayment:S}){h(this,"contents");h(this,"eftAuthenticate");h(this,"successScreen");h(this,"pageLoader");h(this,"warningScreen");h(this,"transactionIssuesScreen");h(this,"container");h(this,"customer");h(this,"token");h(this,"amount");h(this,"totalAmount");h(this,"currency");h(this,"_currentStep");h(this,"rdtCode");h(this,"url");h(this,"reference");h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"hidePaymentMethods");h(this,"showPaymentMethods");h(this,"merchantPlanDetail",{});h(this,"restartTransactionProcess");h(this,"retryingPayment");h(this,"isMaxRetriesReached");h(this,"isMobile",!1);h(this,"paymentResponse");h(this,"paymentResponseHeaders");this.currency=a,this.container=t,this.token=s,this.customer=o,this.amount=e,this.totalAmount=i,this.rdtCode=l,this.url=d,this.reference=v,this.callBackUrl=p,this.metadata=g,this.localCurrency=f,this._currentStep=1,this.contents=this.container.querySelector("#payment-content-view"),this.hidePaymentMethods=y,this.showPaymentMethods=k,this.restartTransactionProcess=C,this.retryingPayment=S,this.isMaxRetriesReached=!1,this.paymentResponse={},this.paymentResponseHeaders={},this.renderEftContent(),P.track("eft_opens",{payment_method:"EFT"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(e){this._currentStep=e,this.renderEftContent()}showLoader(){this.pageLoader=new Ne(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment")}setPaymentError(e){const i=this.container.querySelector("#payment-warning-text");i&&(i.textContent=e)}goBackToMerchant(){Ze(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}async createEftPayment(){const e=this.container.querySelector(".spinner"),i=this.container.querySelector("#authenticate-button-text");e&&i&&(e.classList.remove("hidden"),i.classList.add("hidden")),(()=>{var o,s;if(this.retryingPayment){const a={channel:"eft",reference:this.reference};return ci(this.token,a,this.rdtCode,this.url)}else{const a={amount:this.amount,channel:"eft",currency:this.currency,customer:this.customer,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0,...((o=this.merchantPlanDetail)==null?void 0:o.taxQuoteId)&&{taxQuoteId:(s=this.merchantPlanDetail)==null?void 0:s.taxQuoteId}};return Bt(this.token,a,this.rdtCode,this.url)}})().then(({data:o,headers:s})=>{var a,l,d;if(this.paymentResponse=o,this.paymentResponseHeaders=s,o.status==="failed"){this.currentStep=4,o.providerMessage?this.warningScreen.setPaymentError(o.providerMessage):this.warningScreen.setPaymentError("Payment failed"),P.track("start_payment",{payment_method:"EFT",verification_status:"Failed"});return}else if(((a=o==null?void 0:o.authorization)==null?void 0:a.mode)==="redirect"){(l=o==null?void 0:o.authorization)!=null&&l.redirectUrl&&this.redirectToOzow((d=o==null?void 0:o.authorization)==null?void 0:d.redirectUrl);return}else this.currentStep=4,o!=null&&o.providerMessage?this.warningScreen.setPaymentError(o==null?void 0:o.providerMessage):this.warningScreen.setPaymentError("Unable to get redirect URL")}).catch(o=>{o.code==="payment_max_retry_attempts"?(this.isMaxRetriesReached=!0,this.verifyPaymentProcess(),this.currentStep=4,this.warningScreen.setPaymentError("Maximum retries","You have reached the maximum number of retries allowed. Go back to merchant website to start the payment process again.","Go back to Merchant")):(this.currentStep=4,o.message?this.warningScreen.setPaymentError(o.message):this.warningScreen.setPaymentError("Payment failed"))}).finally(()=>{e&&i&&(e.classList.add("hidden"),i.classList.remove("hidden"))})}redirectToOzow(e){const i=window.open(e,"_blank");if(i){P.track("auth_redirect",{payment_method:"EFT",authentication_type:"Redirect",verification_status:"In Progress"}),this.currentStep=3,this.showLoader();const t=setInterval(()=>{i.closed&&(clearInterval(t),this.verifyPaymentProcess())},2e3)}}async verifyPaymentProcess(){try{const e=await an(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers;const i=this.paymentResponse.status;i==="successful"?(this.currentStep=2,P.track("verify_payment",{payment_method:"EFT",verification_status:"Success"}),Ze(this.paymentResponse,this.paymentResponseHeaders,"success")):i==="failed"?(this.currentStep=4,P.track("verify_payment",{payment_method:"EFT",verification_status:"Failed"}),this.paymentResponse.providerMessage?this.warningScreen.setPaymentError(this.paymentResponse.providerMessage):this.warningScreen.setPaymentError("Payment failed")):i==="cancelled"&&(this.isMaxRetriesReached=!0,this.currentStep=4,this.warningScreen.setPaymentError("Payment Cancelled","You have cancelled the payment. Go back to merchant website to start the payment process again.","Go back to Merchant"))}catch{this.currentStep=4,this.warningScreen.setPaymentError("Payment failed")}}renderEftContent(e){var t;e&&(this.merchantPlanDetail=e);const i=document.getElementById("go-back");if(this.currentStep!==1?(this.hidePaymentMethods(),i==null||i.classList.add("hidden")):this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.contents){switch(this.currentStep){case 1:this.eftAuthenticate=new ts({container:this.contents,onAction:this.createEftPayment.bind(this),restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.eftAuthenticate.renderComponent();break;case 2:this.successScreen=new qn({container:this.contents,amount:this.totalAmount,currency:this.currency,localCurrency:this.localCurrency,rate:(t=this.merchantPlanDetail)==null?void 0:t.rate.rate}),this.successScreen.renderComponent();break;case 3:this.pageLoader=new Ne(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 4:this.warningScreen=new gn({container:this.contents,onAction:this.isMaxRetriesReached?this.goBackToMerchant.bind(this):this.restartTransactionProcess.bind(this),onReportIssue:()=>this.currentStep=5}),this.contents.innerHTML=this.warningScreen.render(),this.warningScreen.attachListener();break;case 5:this.transactionIssuesScreen=new mi({container:this.contents,onAction:()=>{var s;this.currentStep=4,this.warningScreen.setPaymentError(((s=this.paymentResponse)==null?void 0:s.providerMessage)||"Payment failed")},url:this.url,rdtCode:this.rdtCode,token:this.token,paymentChannel:"eft",callBackUrl:this.callBackUrl,paymentResponse:this.paymentResponse,paymentResponseHeaders:this.paymentResponseHeaders}),this.transactionIssuesScreen.renderTransactionIssuesComponent();break;default:this.eftAuthenticate=new ts({container:this.contents,onAction:this.createEftPayment.bind(this),restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.eftAuthenticate.renderComponent();break}const o=this.container.querySelector("#card-currency");o&&(o.textContent=`${this.localCurrency?this.localCurrency:this.currency} Card`)}}}class Al{constructor({container:e,customerDetails:i,code:t,encryption:o,merchantKey:s,modalContainer:a,amount:l,planId:d,rdtCode:v,url:p,reference:g,callBackUrl:f,metadata:y,localCurrency:k,closePayment:C,countryCode:S}){h(this,"validChannels",[]);h(this,"disabledChannels",[]);h(this,"selectedChannel");h(this,"modalContainer");h(this,"currentPaymentMethod");h(this,"mainLayout");h(this,"mainHeader");h(this,"mainFooter");h(this,"testCard");h(this,"merchantPlanDetail",{});h(this,"mainScreen");h(this,"currency");h(this,"card");h(this,"transfer");h(this,"ussd");h(this,"mobileMoney");h(this,"eft");h(this,"encryption");h(this,"merchantKey");h(this,"planId");h(this,"customerDetails");h(this,"code");h(this,"amount",0);h(this,"rdtCode");h(this,"url");h(this,"reference");h(this,"isMobile",!1);h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"closePayment");h(this,"retryingPayment");h(this,"totalAmount");h(this,"countryCode");this.validChannels=[],this.disabledChannels=[],this.selectedChannel="",this.modalContainer=a,this.encryption=o,this.planId=d||"",this.merchantKey=s,this.code=t,this.amount=l||0,this.rdtCode=v||"",this.url=p||"",this.reference=g,this.mainLayout=e,this.callBackUrl=f,this.metadata=y||{},this.localCurrency=k||"",this.isMobile=window.matchMedia("(max-width: 767px)").matches,this.currentPaymentMethod="",this.currency="",this.closePayment=C,this.retryingPayment=!1,this.totalAmount=0,this.countryCode=S||"",this.customerDetails=i}mountScreen(e,i,t,o){var a,l;t&&(this.validChannels=t),o&&(this.disabledChannels=o),this.mainLayout.innerHTML=this.render(),this.merchantPlanDetail=e,this.currency=i;const s=(l=(a=this.merchantPlanDetail.plan)==null?void 0:a.pricingOptions)==null?void 0:l.find(d=>d.currency===this.currency);this.amount=(s==null?void 0:s.amount)||this.amount,this.totalAmount=this.merchantPlanDetail.totalAmount||this.amount,this.mainHeader=new hl({container:document.getElementById("main-header"),email:this.customerDetails.email,amount:this.amount,metadata:this.metadata,currency:this.currency,localCurrency:this.localCurrency,merchantDetail:e,onAction:this.switchTab.bind(this),isMobile:this.isMobile,onClose:d=>{this.closeBTN.bind(this)(d)},currentPaymentMethod:this.currentPaymentMethod}),this.mainHeader.renderComponent(),this.testCard=new es({container:document.getElementById("test-container"),closeCallback:()=>{const d=document.getElementById("test-container");d&&(d.innerHTML="",d.classList.add("hidden"))}}),this.mainFooter=new is({container:document.getElementById("main-footer"),testCardContainer:document.getElementById("test-container")}),document.addEventListener("DOMContentLoaded",()=>{const d=document.getElementById("main-footer"),v=document.getElementById("test-container");new is({container:d,testCardContainer:v}).renderComponent()}),this.mainFooter.renderComponent(),this.setupPaymentMethodButtons(),this.selectedChannel&&(this.currentPaymentMethod=this.selectedChannel),this.updatePaymentMethodView(this.merchantKey,this.customerDetails,this.amount,this.totalAmount,this.currency),this.renderPaymentMethodContent(),this.setCurrentPaymentMethod(this.currentPaymentMethod)}setupPaymentMethodButtons(){const e=document.querySelectorAll(".tab-button");e.forEach(t=>{t.removeAttribute("disabled"),t.classList.remove("hidden","disabled","limit-exceeded");const o=t.querySelector(".disabled-indicator");o&&t.removeChild(o)});const i=[...this.validChannels,...this.disabledChannels];e.forEach(t=>{const o=t.getAttribute("data-name");o&&!i.includes(o)&&t.classList.add("hidden")}),this.disabledChannels.forEach(t=>{const o=Array.from(e).find(s=>s.getAttribute("data-name")===t);if(o){o.setAttribute("disabled","true"),o.classList.add("disabled","limit-exceeded"),o.setAttribute("title","Transaction amount exceeds limit for this payment method");const s=document.createElement("span");s.classList.add("disabled-indicator"),s.style.fontSize="10px",s.style.color="#FF5733",s.style.display="block",o.appendChild(s)}})}attachListeners(){const e=document.getElementById("go-back"),i=document.getElementById("select-payment-method-text");this.isMobile&&(this.currentPaymentMethod?(e&&(e.classList.add("flex","items-center","gap-2","mb-2"),e.innerHTML=` <svg width="9" height="18" viewBox="0 0 9 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2022
2022
  <path d="M7.99984 16.9201L1.47984 10.4001C0.709844 9.63008 0.709844 8.37008 1.47984 7.60008L7.99984 1.08008" stroke="#0D0716" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
2023
2023
  </svg>
2024
2024
  <span class="text-tone-100 font-semibold">
2025
2025
  Go back
2026
- </span>`),i&&(i.innerHTML="Selected")):(e&&(e.classList.remove("flex","items-center","gap-2","mb-2"),e.innerHTML=""),i&&(i.innerHTML="Select your preferred")))}closeBTN(e){(()=>{this.cleanup(),e?(P.track("checkout_closes"),this.closeModal()):this.closePayment()})()}updatePaymentMethodView(e,i,t,o,s){switch(this.currentPaymentMethod){case"card":return this.card=new zr({container:this.modalContainer,amount:t,totalAmount:o,currency:s,token:e,email:i,planId:this.planId,rdtCode:this.rdtCode,url:this.url,reference:this.reference,encryption:this.encryption,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,switchTab:()=>this.switchTab("card"),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment});case"bank_transfer":return this.transfer=new el({amount:t,totalAmount:o,currency:s,closeModal:this.closeModal.bind(this),token:e,container:this.modalContainer,email:i,rdtCode:this.rdtCode,url:this.url,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,disablePaymentMethods:a=>{this.disablePaymentMethods.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),hidePaymentMethods:this.hidePaymentMethods.bind(this),retryingPayment:this.retryingPayment});case"ussd":return this.ussd=new Xo({container:this.modalContainer,amount:t,totalAmount:o,currency:s,secret:this.merchantKey,rdtCode:this.rdtCode,url:this.url,email:this.email,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,closeModal:()=>this.closeModal(),switchTab:a=>this.switchTab.bind(a),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),disablePaymentMethods:a=>{this.disablePaymentMethods.bind(this)(a)}});case"mobile_money":return this.mobileMoney=new Sl({container:this.modalContainer,email:this.email,currency:s,rdtCode:this.rdtCode,url:this.url,token:e,amount:this.amount,totalAmount:this.totalAmount,metadata:this.metadata,localCurrency:this.localCurrency,phoneNumber:this.phoneNumber,code:this.code,callBackUrl:this.callBackUrl,merchantKey:this.merchantKey,reference:this.reference,closeModal:()=>this.closeModal(),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),disablePaymentMethods:a=>{this.disablePaymentMethods.bind(this)(a)},onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment,countryCode:this.countryCode||""});case"eft":return this.eft=new Ml({container:this.modalContainer,amount:t,totalAmount:o,currency:s,token:e,email:i,rdtCode:this.rdtCode,url:this.url,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,switchTab:()=>this.switchTab("eft"),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment});default:return null}}renderPaymentMethodContent(){return(()=>{switch(this.currentPaymentMethod){case"card":return this.card.renderCardContent(this.merchantPlanDetail);case"bank_transfer":return this.transfer.renderTransferContent(this.merchantPlanDetail);case"ussd":return this.ussd.renderUssdContent(this.merchantPlanDetail);case"mobile_money":return this.mobileMoney.renderMobileMoneyContent(this.merchantPlanDetail);case"eft":return this.eft.renderEftContent(this.merchantPlanDetail);default:return this.defaultToEmptyContainer()}})()}setCurrentPaymentMethod(e){this.currentPaymentMethod=e;const i=document.querySelectorAll(".tab-button");i.forEach(o=>o.classList.remove("active"));const t=Array.from(i).find(o=>o.getAttribute("data-name")===e);t&&t.classList.add("active")}setToDefaultEmptyContainer(){this.currentPaymentMethod="",this.retryingPayment=!0,this.updatePaymentMethodView(this.merchantKey,this.email,this.amount,this.totalAmount,this.currency),this.cleanup(),this.switchTab(""),this.showPaymentMethods(),this.setupPaymentMethodButtons(),this.renderPaymentMethodContent(),P.track("retry_payment")}defaultToEmptyContainer(){const e=document.querySelector("#payment-content-view");e.innerHTML=""}switchTab(e){this.currentPaymentMethod===e&&e!==""||(this.currentPaymentMethod==="bank_transfer"&&this.currentPaymentMethod!==e&&this.setToDefaultEmptyContainer(),this.setCurrentPaymentMethod(e),this.updatePaymentMethodView(this.merchantKey,this.email,this.amount,this.totalAmount,this.currency),this.cleanup(),this.showPaymentMethods(),this.renderPaymentMethodContent(),this.attachListeners(),this.isMobile&&(document.querySelectorAll(".tab-button").forEach(t=>{const o=t.getAttribute("data-name");this.disabledChannels.includes(o)||t.removeAttribute("disabled")}),e?document.querySelectorAll(".tab-button").forEach(o=>{o.getAttribute("data-name")!==e&&o.classList.add("hidden")}):document.querySelectorAll(".tab-button").forEach(o=>{const s=o.getAttribute("data-name");[...this.validChannels,...this.disabledChannels].includes(s)&&o.classList.remove("hidden")})))}disablePaymentMethods(e){this.currentPaymentMethod=e;const i=document.querySelectorAll(".tab-button");i.forEach(o=>o.setAttribute("disabled","true"));const t=Array.from(i).find(o=>o.getAttribute("data-name")===e);t&&t.removeAttribute("disabled")}enablePaymentMethods(){const e=document.querySelectorAll(".tab-button");e.forEach(t=>{const o=t.getAttribute("data-name");o&&!this.disabledChannels.includes(o)&&t.removeAttribute("disabled")});const i=Array.from(e).find(t=>t.getAttribute("data-name")===this.currentPaymentMethod);i&&!this.disabledChannels.includes(this.currentPaymentMethod)&&i.removeAttribute("disabled")}hidePaymentMethods(){const e=document.querySelector("#payment-methods-container");e&&e.classList.add("hidden")}showPaymentMethods(){const e=document.querySelector("#payment-methods-container");e&&e.classList.remove("hidden")}cleanup(){this.transfer&&this.transfer.destroyTimer()}closeModal(e){this.modalContainer&&this.modalContainer.parentNode&&document.body.removeChild(this.modalContainer),e&&e()}setupParent(e){e&&e()}render(){return Ms}}class os{constructor(e){h(this,"container");this.container=e}renderContent(e){var t;this.container.innerHTML=this.render();const i=document.getElementById("error-action-container");e&&i&&(i.classList.remove("hidden"),(t=i.querySelector("#go-back"))==null||t.addEventListener("click",()=>{window.location.href=e}))}render(){return`
2026
+ </span>`),i&&(i.innerHTML="Selected")):(e&&(e.classList.remove("flex","items-center","gap-2","mb-2"),e.innerHTML=""),i&&(i.innerHTML="Select your preferred")))}closeBTN(e){(()=>{this.cleanup(),e?(P.track("checkout_closes"),this.closeModal()):this.closePayment()})()}updatePaymentMethodView(e,i,t,o,s){switch(this.currentPaymentMethod){case"card":return this.card=new zr({container:this.modalContainer,amount:t,totalAmount:o,currency:s,token:e,customer:i||this.customerDetails,planId:this.planId,rdtCode:this.rdtCode,url:this.url,reference:this.reference,encryption:this.encryption,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,switchTab:()=>this.switchTab("card"),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment});case"bank_transfer":return this.transfer=new el({amount:t,totalAmount:o,currency:s,closeModal:this.closeModal.bind(this),token:e,container:this.modalContainer,customer:i||this.customerDetails,rdtCode:this.rdtCode,url:this.url,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,disablePaymentMethods:a=>{this.disablePaymentMethods.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),hidePaymentMethods:this.hidePaymentMethods.bind(this),retryingPayment:this.retryingPayment});case"ussd":return this.ussd=new Xo({container:this.modalContainer,amount:t,totalAmount:o,currency:s,secret:this.merchantKey,rdtCode:this.rdtCode,url:this.url,customer:i||this.customerDetails,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,closeModal:()=>this.closeModal(),switchTab:a=>this.switchTab.bind(a),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),disablePaymentMethods:a=>{this.disablePaymentMethods.bind(this)(a)}});case"mobile_money":return this.mobileMoney=new Sl({container:this.modalContainer,customer:i||this.customerDetails,currency:s,rdtCode:this.rdtCode,url:this.url,token:e,amount:this.amount,totalAmount:this.totalAmount,metadata:this.metadata,localCurrency:this.localCurrency,code:this.code,callBackUrl:this.callBackUrl,merchantKey:this.merchantKey,reference:this.reference,closeModal:()=>this.closeModal(),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),disablePaymentMethods:a=>{this.disablePaymentMethods.bind(this)(a)},onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment,countryCode:this.countryCode||""});case"eft":return this.eft=new Ml({container:this.modalContainer,amount:t,totalAmount:o,currency:s,customer:i||this.customerDetails,token:e,rdtCode:this.rdtCode,url:this.url,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,switchTab:()=>this.switchTab("eft"),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),onClose:a=>{this.closeBTN.bind(this)(a)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment});default:return null}}renderPaymentMethodContent(){return(()=>{switch(this.currentPaymentMethod){case"card":return this.card.renderCardContent(this.merchantPlanDetail);case"bank_transfer":return this.transfer.renderTransferContent(this.merchantPlanDetail);case"ussd":return this.ussd.renderUssdContent(this.merchantPlanDetail);case"mobile_money":return this.mobileMoney.renderMobileMoneyContent(this.merchantPlanDetail);case"eft":return this.eft.renderEftContent(this.merchantPlanDetail);default:return this.defaultToEmptyContainer()}})()}setCurrentPaymentMethod(e){this.currentPaymentMethod=e;const i=document.querySelectorAll(".tab-button");i.forEach(o=>o.classList.remove("active"));const t=Array.from(i).find(o=>o.getAttribute("data-name")===e);t&&t.classList.add("active")}setToDefaultEmptyContainer(){this.currentPaymentMethod="",this.retryingPayment=!0,this.updatePaymentMethodView(this.merchantKey,this.customerDetails,this.amount,this.totalAmount,this.currency),this.cleanup(),this.switchTab(""),this.showPaymentMethods(),this.setupPaymentMethodButtons(),this.renderPaymentMethodContent(),P.track("retry_payment")}defaultToEmptyContainer(){const e=document.querySelector("#payment-content-view");e.innerHTML=""}switchTab(e){this.currentPaymentMethod===e&&e!==""||(this.currentPaymentMethod==="bank_transfer"&&this.currentPaymentMethod!==e&&this.setToDefaultEmptyContainer(),this.setCurrentPaymentMethod(e),this.updatePaymentMethodView(this.merchantKey,this.customerDetails,this.amount,this.totalAmount,this.currency),this.cleanup(),this.showPaymentMethods(),this.renderPaymentMethodContent(),this.attachListeners(),this.isMobile&&(document.querySelectorAll(".tab-button").forEach(t=>{const o=t.getAttribute("data-name");this.disabledChannels.includes(o)||t.removeAttribute("disabled")}),e?document.querySelectorAll(".tab-button").forEach(o=>{o.getAttribute("data-name")!==e&&o.classList.add("hidden")}):document.querySelectorAll(".tab-button").forEach(o=>{const s=o.getAttribute("data-name");[...this.validChannels,...this.disabledChannels].includes(s)&&o.classList.remove("hidden")})))}disablePaymentMethods(e){this.currentPaymentMethod=e;const i=document.querySelectorAll(".tab-button");i.forEach(o=>o.setAttribute("disabled","true"));const t=Array.from(i).find(o=>o.getAttribute("data-name")===e);t&&t.removeAttribute("disabled")}enablePaymentMethods(){const e=document.querySelectorAll(".tab-button");e.forEach(t=>{const o=t.getAttribute("data-name");o&&!this.disabledChannels.includes(o)&&t.removeAttribute("disabled")});const i=Array.from(e).find(t=>t.getAttribute("data-name")===this.currentPaymentMethod);i&&!this.disabledChannels.includes(this.currentPaymentMethod)&&i.removeAttribute("disabled")}hidePaymentMethods(){const e=document.querySelector("#payment-methods-container");e&&e.classList.add("hidden")}showPaymentMethods(){const e=document.querySelector("#payment-methods-container");e&&e.classList.remove("hidden")}cleanup(){this.transfer&&this.transfer.destroyTimer()}closeModal(e){this.modalContainer&&this.modalContainer.parentNode&&document.body.removeChild(this.modalContainer),e&&e()}setupParent(e){e&&e()}render(){return Ms}}class os{constructor(e){h(this,"container");this.container=e}renderContent(e){var t;this.container.innerHTML=this.render();const i=document.getElementById("error-action-container");e&&i&&(i.classList.remove("hidden"),(t=i.querySelector("#go-back"))==null||t.addEventListener("click",()=>{window.location.href=e}))}render(){return`
2027
2027
  <div class="box-container">
2028
2028
 
2029
2029
  <div class="container-center h-[40vh] hidden mx-auto" id="shared-error-container">
@@ -2057,4 +2057,4 @@ or you can use record.mirror to access the mirror instance during recording.`;le
2057
2057
 
2058
2058
  </div>
2059
2059
  </div>
2060
- `}}class Tl{constructor(){h(this,"modalContainer");h(this,"mainLayout");h(this,"encryption");h(this,"mainScreen");h(this,"merchantConfigService");h(this,"mainError");h(this,"mainLoader");h(this,"merchantPlanDetail",{});h(this,"merchantKey");h(this,"planId");h(this,"email");h(this,"amount");h(this,"rdtCode");h(this,"url");h(this,"phoneNumber");h(this,"code");h(this,"reference");h(this,"currency");h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"countryCode");this.merchantKey="",this.email="",this.amount=0,this.planId="",this.encryption="",this.phoneNumber="",this.code="",this.modalContainer=document.createElement("div"),this.rdtCode="",this.reference="",this.currency="",this.url="",this.callBackUrl="",this.metadata={},this.localCurrency="",this.countryCode="",this.modalContainer.innerHTML=En,P.init("11162d9a0801daeaf786f1200cd3112b",{debug:!1}),document.body.appendChild(this.modalContainer);const i=document.getElementById("main-layout-container-screen");if(!i)throw new Error("SDK Layout not available");this.mainLayout=i}closePayment(){const e={reference:this.reference};Ts(this.merchantKey,e,this.rdtCode,this.url).then(({headers:t})=>{const o=t.get("spf-redirect-url");this.callBackUrl=o||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status","cancelled"),s.searchParams.append("reference",this.reference),window.location.href=s.toString()},1800):this.closeModal(),P.track("canel_payment",{verification_status:"Cancelled"}),P.track("checkout_closes")}).catch(t=>{hi.showToast(t.message,"error")})}getDeviceType(){const e=navigator.userAgent;return/mobile/i.test(e)?"Mobile":/tablet/i.test(e)?"Tablet":"Desktop"}setup(e){const{email:i,encryptionKey:t,merchantKey:o,planId:s,amount:a,rdtCode:l,reference:d,currency:v,url:p,callBackUrl:g,metadata:f,localCurrency:y,countryCode:k}=e;if(this.merchantKey=o||"",this.email=i||"",this.amount=a||0,this.encryption=t||"",this.planId=s||"",this.rdtCode=l||"",this.reference=d||Ns(),this.url=p||"",this.callBackUrl=g||"",this.metadata=f||{},this.countryCode=k||"",!o||!i)throw this.mainError=new os(this.mainLayout),this.mainError.renderContent(this.callBackUrl),this.showErrorIcon(),new Error("Merchant key or email is required");this.currency=v||"",this.merchantConfigService=new nl({token:this.merchantKey,rdtCode:this.rdtCode,url:this.url}),this.localCurrency=y||"",this.mainScreen=new Al({container:this.mainLayout,modalContainer:this.modalContainer,merchantKey:o,email:i,encryption:this.encryption,planId:this.planId,amount:this.amount,rdtCode:this.rdtCode,url:this.url,phoneNumber:this.phoneNumber,code:this.code,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,countryCode:this.countryCode,closePayment:this.closePayment.bind(this)}),this.mainLoader=new De(this.mainLayout),this.mainError=new os(this.mainLayout),this.mainLoader.mountLoader(),this.getPlanDetails()}getAvailableChannels(){var s,a;const e=((s=this.merchantPlanDetail)==null?void 0:s.paymentMethods)??[],i=((a=this.merchantPlanDetail)==null?void 0:a.limits)??[],t=[],o=[];return e.forEach(l=>{const d=i.find(v=>v.channel===l);!d||this.amount<=d.amount?t.push(l):o.push(l)}),{validChannels:t,disabledChannels:o}}async getPlanDetails(){const e=this.currency==="USD"?this.localCurrency:this.currency;this.merchantConfigService.getMerchantConfig(this.planId,e).then(async i=>{var a,l;if(i.taxEnabled){const d=await Is(this.merchantKey,this.localCurrency!==this.currency?this.amount*i.rate.rate:this.amount,e,this.rdtCode,this.url);this.merchantPlanDetail={...i,totalAmount:d.totalAmount,taxQuoteId:d.id}}else this.merchantPlanDetail=i;P.register({device_type:this.getDeviceType(),session_id:this.reference,env:"Test",checkout_env:this.rdtCode?"Redirect":"SDK",merchant:this.merchantPlanDetail.merchantName}),P.track("checkout_opens");const{validChannels:t,disabledChannels:o}=this.getAvailableChannels();if(((a=this.merchantPlanDetail)==null?void 0:a.limits)&&this.merchantPlanDetail.limits.length>0&&(t.length===0||t[0]==="ussd"&&t.length===1)){const d=new Ll(this.mainLayout);this.mainError=d;let v=0;throw(l=this.merchantPlanDetail)!=null&&l.limits&&this.merchantPlanDetail.limits.length>0&&(v=Math.max(...this.merchantPlanDetail.limits.map(p=>p.amount))),d.setLimitInfo(e,v),this.mainError.renderContent(this.callBackUrl),this.showErrorIcon(),new Error("Transaction limit reached")}i.rate?this.mainScreen.mountScreen(this.merchantPlanDetail,this.currency,t,o):(this.mainError.renderContent(this.callBackUrl),this.showErrorIcon())}).catch(i=>{throw this.mainError.renderContent(this.callBackUrl),this.showErrorIcon(),new Error(i)})}showErrorIcon(){var i;const e=this.mainLayout.querySelector("#shared-error-container");e&&(e.classList.remove("hidden"),e.parentElement.classList.add("mx-auto"),e.classList.add("flex","flex-col","items-center","gap-2"),(i=e.querySelector("img"))==null||i.setAttribute("src",xl))}closeModal(){this.modalContainer&&this.modalContainer.parentNode&&document.body.removeChild(this.modalContainer),this.mainScreen.closeModal()}}Be.CheckoutForm=Tl,Object.defineProperty(Be,Symbol.toStringTag,{value:"Module"})});
2060
+ `}}class Tl{constructor(){h(this,"modalContainer");h(this,"mainLayout");h(this,"encryption");h(this,"mainScreen");h(this,"merchantConfigService");h(this,"mainError");h(this,"mainLoader");h(this,"merchantPlanDetail",{});h(this,"merchantKey");h(this,"planId");h(this,"email");h(this,"amount");h(this,"name");h(this,"rdtCode");h(this,"url");h(this,"phoneNumber");h(this,"code");h(this,"reference");h(this,"currency");h(this,"callBackUrl");h(this,"metadata");h(this,"localCurrency");h(this,"countryCode");this.merchantKey="",this.email="",this.amount=0,this.planId="",this.encryption="",this.phoneNumber="",this.code="",this.modalContainer=document.createElement("div"),this.rdtCode="",this.reference="",this.currency="",this.url="",this.callBackUrl="",this.metadata={},this.localCurrency="",this.countryCode="",this.modalContainer.innerHTML=En,P.init("11162d9a0801daeaf786f1200cd3112b",{debug:!1}),document.body.appendChild(this.modalContainer);const i=document.getElementById("main-layout-container-screen");if(!i)throw new Error("SDK Layout not available");this.mainLayout=i}closePayment(){const e={reference:this.reference};Ts(this.merchantKey,e,this.rdtCode,this.url).then(({headers:t})=>{const o=t.get("spf-redirect-url");this.callBackUrl=o||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status","cancelled"),s.searchParams.append("reference",this.reference),window.location.href=s.toString()},1800):this.closeModal(),P.track("canel_payment",{verification_status:"Cancelled"}),P.track("checkout_closes")}).catch(t=>{hi.showToast(t.message,"error")})}getDeviceType(){const e=navigator.userAgent;return/mobile/i.test(e)?"Mobile":/tablet/i.test(e)?"Tablet":"Desktop"}setup(e){const{email:i,encryptionKey:t,merchantKey:o,planId:s,amount:a,rdtCode:l,reference:d,currency:v,url:p,callBackUrl:g,metadata:f,localCurrency:y,countryCode:k,phoneNumber:C,name:S}=e;if(this.merchantKey=o||"",this.email=i||"",this.amount=a||0,this.encryption=t||"",this.planId=s||"",this.rdtCode=l||"",this.reference=d||Bs(),this.url=p||"",this.callBackUrl=g||"",this.metadata=f||{},this.countryCode=k||"",this.phoneNumber=C||"",this.name=S||"",!o||!i)throw this.mainError=new os(this.mainLayout),this.mainError.renderContent(this.callBackUrl),this.showErrorIcon(),new Error("Merchant key or email is required");this.currency=v||"",this.merchantConfigService=new nl({token:this.merchantKey,rdtCode:this.rdtCode,url:this.url}),this.localCurrency=y||"",this.mainScreen=new Al({container:this.mainLayout,modalContainer:this.modalContainer,merchantKey:o,encryption:this.encryption,planId:this.planId,amount:this.amount,rdtCode:this.rdtCode,url:this.url,code:this.code,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,countryCode:this.countryCode,customerDetails:{email:i||this.email,...this.name?{name:this.name}:{},...this.phoneNumber?{phoneNumber:this.phoneNumber}:{}},closePayment:this.closePayment.bind(this)}),this.mainLoader=new Ne(this.mainLayout),this.mainError=new os(this.mainLayout),this.mainLoader.mountLoader(),this.getPlanDetails()}getAvailableChannels(){var s,a;const e=((s=this.merchantPlanDetail)==null?void 0:s.paymentMethods)??[],i=((a=this.merchantPlanDetail)==null?void 0:a.limits)??[],t=[],o=[];return e.forEach(l=>{const d=i.find(v=>v.channel===l);!d||this.amount<=d.amount?t.push(l):o.push(l)}),{validChannels:t,disabledChannels:o}}async getPlanDetails(){const e=this.currency==="USD"?this.localCurrency:this.currency;this.merchantConfigService.getMerchantConfig(this.planId,e).then(async i=>{var a,l;if(i.taxEnabled){const d=await Is(this.merchantKey,this.localCurrency!==this.currency?this.amount*i.rate.rate:this.amount,e,this.rdtCode,this.url);this.merchantPlanDetail={...i,totalAmount:d.totalAmount,taxQuoteId:d.id}}else this.merchantPlanDetail=i;P.register({device_type:this.getDeviceType(),session_id:this.reference,env:"Test",checkout_env:this.rdtCode?"Redirect":"SDK",merchant:this.merchantPlanDetail.merchantName}),P.track("checkout_opens");const{validChannels:t,disabledChannels:o}=this.getAvailableChannels();if(((a=this.merchantPlanDetail)==null?void 0:a.limits)&&this.merchantPlanDetail.limits.length>0&&(t.length===0||t[0]==="ussd"&&t.length===1)){const d=new Ll(this.mainLayout);this.mainError=d;let v=0;throw(l=this.merchantPlanDetail)!=null&&l.limits&&this.merchantPlanDetail.limits.length>0&&(v=Math.max(...this.merchantPlanDetail.limits.map(p=>p.amount))),d.setLimitInfo(e,v),this.mainError.renderContent(this.callBackUrl),this.showErrorIcon(),new Error("Transaction limit reached")}i.rate?this.mainScreen.mountScreen(this.merchantPlanDetail,this.currency,t,o):(this.mainError.renderContent(this.callBackUrl),this.showErrorIcon())}).catch(i=>{throw this.mainError.renderContent(this.callBackUrl),this.showErrorIcon(),new Error(i)})}showErrorIcon(){var i;const e=this.mainLayout.querySelector("#shared-error-container");e&&(e.classList.remove("hidden"),e.parentElement.classList.add("mx-auto"),e.classList.add("flex","flex-col","items-center","gap-2"),(i=e.querySelector("img"))==null||i.setAttribute("src",xl))}closeModal(){this.modalContainer&&this.modalContainer.parentNode&&document.body.removeChild(this.modalContainer),this.mainScreen.closeModal()}}De.CheckoutForm=Tl,Object.defineProperty(De,Symbol.toStringTag,{value:"Module"})});