@spot-flow/checkout-inline-js 0.1.33-dev.4 → 0.1.33-dev.5

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,48 +1,48 @@
1
- (function(Ne,xe){typeof exports=="object"&&typeof module<"u"?xe(exports):typeof define=="function"&&define.amd?define(["exports"],xe):(Ne=typeof globalThis<"u"?globalThis:Ne||self,xe(Ne.SpotflowCheckout={}))})(this,function(Ne){"use strict";var pc=Object.defineProperty;var bc=(Ne,xe,Ln)=>xe in Ne?pc(Ne,xe,{enumerable:!0,configurable:!0,writable:!0,value:Ln}):Ne[xe]=Ln;var h=(Ne,xe,Ln)=>bc(Ne,typeof xe!="symbol"?xe+"":xe,Ln);var xe=document.createElement("style");xe.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}.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-\\[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 .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-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-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-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-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-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-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-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-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))}@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\\:underline:hover{text-decoration-line:underline}#checkout-modal .hover\\:opacity-100:hover{opacity:1}#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
- `,document.head.appendChild(xe);const Ln=`<div id="checkout-modal">
3
- <div role="dialog" class="relative z-10" aria-labelledby="modal-title" aria-modal="true">
4
- <div class="fixed inset-0 bg-black bg-opacity-30 transition-opacity" aria-hidden="true"></div>
5
-
6
- <div class="fixed top-0 left-0 w-full z-[3000] max-h-screen hide-scrollbar overflow-y-auto">
7
- <div
8
- class="relative flex min-h-full items-end justify-center text-center sm:items-center p-0 transition-transform duration-700 transform">
9
- <div id="main-layout-container-screen"
10
- class="relative transform overflow-hidden md:rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 w-full md:max-w-[600px] min-h-screen md:min-h-[70%] flex">
11
-
12
- </div>
13
- </div>
14
- </div>
15
- </div>
16
- </div>`,fs=`<div class="relative flex flex-1 flex-col gap-3 pb-5" id="main">
17
-
18
- <div class="relative px-4 md:px-7 lg:px-8 py-4 flex flex-col gap-1 flex-1">
19
- <!-- header -->
20
- <div id="main-header" class="header-container py-3 md:py-4 px-0 md:px-5 lg:px-7">
21
-
22
- </div>
23
- <!-- error container -->
24
-
25
- <div id="toast-container"></div>
26
-
27
- <div id="error-container-main" class=" hidden"></div>
28
- <!-- end of error container -->
29
-
30
- <!-- body -->
31
- <div class="box-container pt-0 flex-1" id="main-content">
32
- <div id="payment-content-view" class=" grid h-full"></div>
33
- </div>
34
-
35
- <div id="mob-container" class="md:hidden">
36
-
37
- </div>
38
- <!-- end of body -->
39
-
40
- <!-- footer -->
41
- <div class="gap-2 py-4 px-3 md:px-7" id="main-footer">
42
- </div>
43
- <!-- end of footer -->
44
- </div>
45
- </div>`,ve=(n,e)=>e||n;let ee=class extends Error{constructor(e,i){super(e),this.status=i,this.name="FetchError"}},De=class extends Error{constructor(e){super(e),this.name="AuthorizationError"}};const je=(n,e,i)=>{if(!n)throw new De("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",gs=async(n,e,i,t)=>{try{const o=je(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 ee("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof ee?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof De?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},oi=async(n,e,i,t)=>{try{const o=je(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 ee("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof ee?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof De?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},xt=async(n,e,i,t)=>{try{const o=je(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 ee("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof ee?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof De?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},ys=async(n,e,i,t)=>{try{const o=je(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 ee(l.message,s.status):new ee("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof ee?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof De?console.error(`AuthorizationError: ${o.message}`):console.error(`UnexpectedError: ${o}`),o}},vn=async(n,e,i,t,o)=>{try{const s=je(n,t),r=await fetch(`${ve(Ve,o)}/payments/verify?reference=${e}`,{method:"GET",headers:s,signal:i});if(!r.ok){const c=await r.json();throw c.message?new ee(c.message,r.status):new ee("Network response was not ok",r.status)}return{data:await r.json(),headers:r.headers}}catch(s){throw s instanceof ee?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof De?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}};async function ks(n,e,i,t,o){const s=je(n,i);try{const r=await fetch(`${ve(Ve,t)}/mobile-money/providers?currency=${o||e}`,{headers:s,method:"GET"});if(!r.ok){const l=await r.json();throw l.message?new ee(l.message,r.status):new ee("Network response was not okay",r.status)}return await r.json()}catch(r){throw r instanceof ee?console.error(`FetchError: ${r.message} (status: ${r.status})`):r instanceof De?console.error(`AuthorizationError: ${r.message}`):console.error(`Unexpected error: ${r}`),r}}const ws=async(n,e,i,t)=>{try{const o=je(n,i),s=await fetch(`${ve(Ve,t)}/payments/cancel`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const r=await s.json();throw r.message?new ee(r.message,s.status):new ee("Network response was not ok",s.status)}return{headers:s.headers}}catch(o){throw o instanceof ee?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof De?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},Cs=async(n,e,i,t)=>{try{const o=je(n,i,!0),s=await fetch(`${ve(Ve,t)}/disputes/upload-documents`,{method:"POST",headers:o,body:e});if(!s.ok){const r=await s.json();throw r.message?new ee(r.message,s.status):new ee("Network response was not ok",s.status)}return s.json()}catch(o){throw o instanceof ee?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof De?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},Ss=async(n,e,i,t)=>{try{const o=je(n,i),s=await fetch(`${ve(Ve,t)}/disputes/reference`,{method:"POST",headers:o,body:JSON.stringify(e)});if(!s.ok){const r=await s.json();throw r.message?new ee(r.message,s.status):new ee("Network response was not ok",s.status)}return s.json()}catch(o){throw o instanceof ee?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof De?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},si=async(n,e,i,t)=>{try{const o=je(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 ee("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof ee?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof De?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}},ke=(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)},pe={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">
1
+ (function(on,Xe){typeof exports=="object"&&typeof module<"u"?Xe(exports):typeof define=="function"&&define.amd?define(["exports"],Xe):(on=typeof globalThis<"u"?globalThis:on||self,Xe(on.SpotflowCheckout={}))})(this,function(on){"use strict";var Ry=Object.defineProperty;var Oy=(on,Xe,Mt)=>Xe in on?Ry(on,Xe,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):on[Xe]=Mt;var g=(on,Xe,Mt)=>Oy(on,typeof Xe!="symbol"?Xe+"":Xe,Mt);var Xe=document.createElement("style");Xe.textContent=`*,: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: }*:where(#checkout-modal,#checkout-modal *),:where(#checkout-modal,#checkout-modal *):before,:where(#checkout-modal,#checkout-modal *):after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:where(#checkout-modal,#checkout-modal *):before,:where(#checkout-modal,#checkout-modal *):after{--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}:where(#checkout-modal,#checkout-modal *) ::-webkit-inner-spin-button,:where(#checkout-modal,#checkout-modal *) ::-webkit-outer-spin-button{height:auto}[type=search]:where(#checkout-modal,#checkout-modal *){-webkit-appearance:textfield;outline-offset:-2px}:where(#checkout-modal,#checkout-modal *) ::-webkit-search-decoration{-webkit-appearance:none}:where(#checkout-modal,#checkout-modal *) ::-webkit-file-upload-button{-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}:where(#checkout-modal,#checkout-modal *) input::-moz-placeholder,:where(#checkout-modal,#checkout-modal *) textarea::-moz-placeholder{opacity:1;color:#9ca3af}:where(#checkout-modal,#checkout-modal *) input::placeholder,:where(#checkout-modal,#checkout-modal *) textarea::placeholder{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(:not([hidden=until-found])):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}.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, 1))}.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, 1));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, 1));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, 1));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, 1));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, 1))}.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, 1))}.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, 1));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, 1))}.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, 1))}#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, 1));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}.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~.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-\\[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 .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-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, 1))}#checkout-modal .border-\\[\\#D0D5DD\\]{--tw-border-opacity: 1;border-color:rgb(208 213 221 / var(--tw-border-opacity, 1))}#checkout-modal .border-\\[\\#D62020\\]{--tw-border-opacity: 1;border-color:rgb(214 32 32 / var(--tw-border-opacity, 1))}#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-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, 1))}#checkout-modal .bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}#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, 1))}#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-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-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, 1))}#checkout-modal .text-\\[\\#98A2B3\\]{--tw-text-opacity: 1;color:rgb(152 162 179 / var(--tw-text-opacity, 1))}#checkout-modal .text-\\[\\#D62020\\]{--tw-text-opacity: 1;color:rgb(214 32 32 / var(--tw-text-opacity, 1))}#checkout-modal .text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}#checkout-modal .text-error{color:hsl(var(--error))}#checkout-modal .text-error-dark{color:hsl(var(--error-dark))}#checkout-modal .text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}#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-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, 1))}#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-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, 1))}#checkout-modal *::-webkit-scrollbar-track{border-radius:100vh;--tw-bg-opacity: 1;background-color:rgb(153 146 146 / var(--tw-bg-opacity, 1))}#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, 1));--tw-bg-opacity: 1;background-color:rgb(224 203 203 / var(--tw-bg-opacity, 1))}#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))}@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, 1))}#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\\:underline:hover{text-decoration-line:underline}#checkout-modal .hover\\:opacity-100:hover{opacity:1}#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
+ /*$vite$:1*/`,document.head.appendChild(Xe);const Mt=`<div id="checkout-modal">\r
3
+ <div role="dialog" class="relative z-10" aria-labelledby="modal-title" aria-modal="true">\r
4
+ <div class="fixed inset-0 bg-black bg-opacity-30 transition-opacity" aria-hidden="true"></div>\r
5
+ \r
6
+ <div class="fixed top-0 left-0 w-full z-[3000] max-h-screen hide-scrollbar overflow-y-auto">\r
7
+ <div\r
8
+ class="relative flex min-h-full items-end justify-center text-center sm:items-center p-0 transition-transform duration-700 transform">\r
9
+ <div id="main-layout-container-screen"\r
10
+ class="relative transform overflow-hidden md:rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 w-full md:max-w-[600px] min-h-screen md:min-h-[70%] flex">\r
11
+ \r
12
+ </div>\r
13
+ </div>\r
14
+ </div>\r
15
+ </div>\r
16
+ </div>`,mh=`<div class="relative flex flex-1 flex-col gap-3 pb-5" id="main">\r
17
+ \r
18
+ <div class="relative px-4 md:px-7 lg:px-8 py-4 flex flex-col gap-1 flex-1">\r
19
+ <!-- header -->\r
20
+ <div id="main-header" class="header-container py-3 md:py-4 px-0 md:px-5 lg:px-7">\r
21
+ \r
22
+ </div>\r
23
+ <!-- error container -->\r
24
+ \r
25
+ <div id="toast-container"></div>\r
26
+ \r
27
+ <div id="error-container-main" class=" hidden"></div>\r
28
+ <!-- end of error container -->\r
29
+ \r
30
+ <!-- body -->\r
31
+ <div class="box-container pt-0 flex-1" id="main-content">\r
32
+ <div id="payment-content-view" class=" grid h-full"></div>\r
33
+ </div>\r
34
+ \r
35
+ <div id="mob-container" class="md:hidden">\r
36
+ \r
37
+ </div>\r
38
+ <!-- end of body -->\r
39
+ \r
40
+ <!-- footer -->\r
41
+ <div class="gap-2 py-4 px-3 md:px-7" id="main-footer">\r
42
+ </div>\r
43
+ <!-- end of footer -->\r
44
+ </div>\r
45
+ </div>`,He=(n,t)=>t||n;let be=class extends Error{constructor(t,r){super(t),this.status=r,this.name="FetchError"}},fn=class extends Error{constructor(t){super(t),this.name="AuthorizationError"}};const kn=(n,t,r)=>{if(!n)throw new fn("Missing authorization token");const e=new Headers;return r||e.append("Content-Type","application/json"),e.append("Authorization",`Bearer ${n}`),t&&e.append("Spotflow-Payment-Code",t),e},_n="https://api.spotflow.co/api/v1",fh=async(n,t,r,e)=>{try{const i=kn(n,r),o=await fetch(`${He(_n,e)}/payments`,{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok){const a=await o.json();throw a.message?a:new be("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(i){throw i instanceof be?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof fn?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}},Bi=async(n,t,r,e)=>{try{const i=kn(n,r),o=await fetch(`${He(_n,e)}/payments/authorize`,{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok){const a=await o.json();throw a.message?a:new be("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(i){throw i instanceof be?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof fn?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}},Ia=async(n,t,r,e)=>{try{const i=kn(n,r),o=await fetch(`${He(_n,e)}/payments`,{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok){const a=await o.json();throw a.message?a:new be("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(i){throw i instanceof be?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof fn?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}},ph=async(n,t,r,e)=>{try{const i=kn(n,r),o=await fetch(`${He(_n,e)}/payments`,{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok){const a=await o.json();throw a.message?new be(a.message,o.status):new be("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(i){throw i instanceof be?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof fn?console.error(`AuthorizationError: ${i.message}`):console.error(`UnexpectedError: ${i}`),i}},dt=async(n,t,r,e,i)=>{try{const o=kn(n,e),s=await fetch(`${He(_n,i)}/payments/verify?reference=${t}`,{method:"GET",headers:o,signal:r});if(!s.ok){const u=await s.json();throw u.message?new be(u.message,s.status):new be("Network response was not ok",s.status)}return{data:await s.json(),headers:s.headers}}catch(o){throw o instanceof be?console.error(`FetchError: ${o.message} (status: ${o.status})`):o instanceof fn?console.error(`AuthorizationError: ${o.message}`):console.error(`Unexpected error: ${o}`),o}};async function vh(n,t,r,e,i){const o=kn(n,r);try{const s=await fetch(`${He(_n,e)}/mobile-money/providers?currency=${i||t}`,{headers:o,method:"GET"});if(!s.ok){const a=await s.json();throw a.message?new be(a.message,s.status):new be("Network response was not okay",s.status)}return await s.json()}catch(s){throw s instanceof be?console.error(`FetchError: ${s.message} (status: ${s.status})`):s instanceof fn?console.error(`AuthorizationError: ${s.message}`):console.error(`Unexpected error: ${s}`),s}}const bh=async(n,t,r,e)=>{try{const i=kn(n,r),o=await fetch(`${He(_n,e)}/payments/cancel`,{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok){const s=await o.json();throw s.message?new be(s.message,o.status):new be("Network response was not ok",o.status)}return{headers:o.headers}}catch(i){throw i instanceof be?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof fn?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}},gh=async(n,t,r,e)=>{try{const i=kn(n,r,!0),o=await fetch(`${He(_n,e)}/disputes/upload-documents`,{method:"POST",headers:i,body:t});if(!o.ok){const s=await o.json();throw s.message?new be(s.message,o.status):new be("Network response was not ok",o.status)}return o.json()}catch(i){throw i instanceof be?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof fn?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}},yh=async(n,t,r,e)=>{try{const i=kn(n,r),o=await fetch(`${He(_n,e)}/disputes/reference`,{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok){const s=await o.json();throw s.message?new be(s.message,o.status):new be("Network response was not ok",o.status)}return o.json()}catch(i){throw i instanceof be?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof fn?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}},Di=async(n,t,r,e)=>{try{const i=kn(n,r),o=await fetch(`${He(_n,e)}/payments/retry`,{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok){const a=await o.json();throw a.message?a:new be("Network response was not ok",o.status)}return{data:await o.json(),headers:o.headers}}catch(i){throw i instanceof be?console.error(`FetchError: ${i.message} (status: ${i.status})`):i instanceof fn?console.error(`AuthorizationError: ${i.message}`):console.error(`Unexpected error: ${i}`),i}},ze=(n,t)=>{const r=new Intl.NumberFormat("ng-NG",{style:"decimal",maximumFractionDigits:t||0,minimumFractionDigits:t||0});return isNaN(parseFloat(r.format(n)))?"-":r.format(n)},Oe={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">
46
46
  <path d="M1.83398 6.16992H15.1673" stroke="currentColor" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
47
47
  <path d="M4.5 11.5034H5.83333" stroke="currentColor" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
48
48
  <path d="M7.5 11.5034H10.1667" stroke="currentColor" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
@@ -77,7 +77,7 @@
77
77
  <path d="M13.834 12.0002V7.3335" stroke="#0D0716" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
78
78
  <path d="M1.16602 14.6665H15.8327" stroke="#0D0716" stroke-width="1.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
79
79
  <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"/>
80
- </svg>`}};pe.card.label,pe.card.icon,pe.card.key,pe.bank_transfer.label,pe.bank_transfer.icon,pe.bank_transfer.key,pe.ussd.label,pe.ussd.icon,pe.ussd.key,pe.mobile_money.label,pe.mobile_money.icon,pe.mobile_money.key,pe.eft.label,pe.eft.icon,pe.eft.key;const Lt=[{name:"MasterCard",icon:`<svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg">
80
+ </svg>`}};Oe.card.label,Oe.card.icon,Oe.card.key,Oe.bank_transfer.label,Oe.bank_transfer.icon,Oe.bank_transfer.key,Oe.ussd.label,Oe.ussd.icon,Oe.ussd.key,Oe.mobile_money.label,Oe.mobile_money.icon,Oe.mobile_money.key,Oe.eft.label,Oe.eft.icon,Oe.eft.key;const Pa=[{name:"MasterCard",icon:`<svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg">
81
81
  <path d="M15.3295 1.73883H8.91364V12.2617H15.3295V1.73883Z" fill="#FF5F00"/>
82
82
  <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"/>
83
83
  <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"/>
@@ -123,7 +123,7 @@
123
123
  <path d="M10.0163 6.41102L11.366 0.60263H13.5249L12.1742 6.41102H10.0163ZM19.974 0.727841C19.5464 0.610166 18.8761 0.483887 18.0392 0.483887C15.9058 0.483887 14.4033 1.27168 14.3904 2.40075C14.3784 3.23536 15.4632 3.70099 16.2821 3.9788C17.1225 4.26358 17.4049 4.44511 17.4009 4.6993C17.3955 5.08867 16.7298 5.26646 16.1092 5.26646C15.2452 5.26646 14.7861 5.17842 14.0771 4.96165L13.7988 4.86934L13.4959 6.16958C14.0002 6.33179 14.9326 6.4722 15.9008 6.4795C18.1702 6.4795 19.6435 5.70069 19.6602 4.49495C19.6683 3.83418 19.0931 3.33141 17.8475 2.91682C17.0929 2.64812 16.6308 2.46881 16.6357 2.19673C16.6357 1.9553 17.0269 1.69713 17.8722 1.69713C18.578 1.68909 19.0895 1.80199 19.488 1.91966L19.6814 1.98669L19.974 0.727841ZM25.5296 0.602541H23.8614C23.3447 0.602541 22.9579 0.705974 22.731 1.08422L19.5247 6.40719H21.7917C21.7917 6.40719 22.1623 5.69149 22.2461 5.53433C22.4939 5.53433 24.6962 5.53682 25.011 5.53682C25.0756 5.74018 25.2737 6.40719 25.2737 6.40719H27.277L25.5296 0.602363V0.602541ZM22.8828 4.35325C23.0614 4.01859 23.743 2.72953 23.743 2.72953C23.7303 2.74499 23.9203 2.39324 24.0292 2.17516L24.1751 2.67595C24.1751 2.67595 24.5885 4.06244 24.6749 4.35316H22.8828V4.35325ZM8.18357 0.602541L6.06996 4.56361L5.8448 3.75867C5.45128 2.83074 4.22537 1.8254 2.85486 1.32209L4.78753 6.40176L7.07172 6.39989L10.4706 0.602481L8.18357 0.602452" fill="#0E4595"/>
124
124
  <path d="M4.09771 0.602448H0.616461L0.588867 0.723297C3.29725 1.20409 5.08928 2.36597 5.83334 3.7622L5.07637 1.093C4.94572 0.725196 4.56669 0.615413 4.09779 0.602596" fill="#F2AE14"/>
125
125
  </svg>
126
- `}],Tt=[{name:"GHS",dialCode:"+233",length:"9",cardTypes:["Visa","MasterCard","Gh-link"],icon:`<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-gh" viewBox="0 0 512 512">
126
+ `}],lo=[{name:"GHS",dialCode:"+233",length:"9",cardTypes:["Visa","MasterCard","Gh-link"],icon:`<svg xmlns="http://www.w3.org/2000/svg" id="flag-icons-gh" viewBox="0 0 512 512">
127
127
  <path fill="#006b3f" d="M0 0h512v512H0z"/>
128
128
  <path fill="#fcd116" d="M0 0h512v341.3H0z"/>
129
129
  <path fill="#ce1126" d="M0 0h512v170.7H0z"/>
@@ -175,91 +175,91 @@
175
175
  <path fill="#008753" d="M341.3 0H512v512H341.3zM0 0h170.7v512H0z"/>
176
176
  </g>
177
177
  </svg>
178
- `}],_s=`<div>
179
- <form id="checkoutcard">
180
- <div>
181
- <div class="container-between">
182
- <h5 class="text-grey-400 font-semibold text-sm">Enter your card details</h5>
183
- <div class="bg-tone-100 rounded-[40px] h-[22px] text-xxs text-white align-center px-2 md:hidden"> <span
184
- id="card-currency"></span> </div>
185
- </div>
186
- <div class="mt-3 mb-3 md:mb-5">
187
- <div id="card-details" class="flex border border-grey-100 rounded-lg p-4">
188
- <div class="grow relative flex gap-2">
189
- <div class="relative flex w-full">
190
- <div class="absolute left-0 top-1/2 -translate-y-2/4">
191
- <div id="card-type" class="align-center gap-2">
192
- <svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg">
193
- <path
194
- 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"
195
- fill="#B6B4B9" />
196
- </svg>
197
- </div>
198
- </div>
199
- <input class="details-input-container ml-9 grow" type="tel" id="card-number" name="number"
200
- placeholder="Card number" required minlength="17" maxlength="23" />
201
- </div>
202
- </div>
203
-
204
- <div class="relative w-14 md:w-20">
205
- <div class="w-4/5 md:w-3/5 ml-auto">
206
- <input class="details-input-container" type="tel" id="card-expiry" name="expiry" placeholder="MM/YY"
207
- required minlength="5" />
208
- </div>
209
- </div>
210
-
211
- <div class="relative w-12 md:w-16">
212
- <div class="w-4/5 md:w-3/5 ml-auto">
213
- <input class="details-input-container" type="tel" id="card-cvv" name="cvv" placeholder="CVV" required
214
- minlength="3" />
215
- </div>
216
- </div>
217
- </div>
218
- <div id="card-error" class="text-sm text-error font-semibold mt-2 hidden"></div>
219
-
220
-
221
- <div class="mt-4 md:mt-8">
222
- <button type="submit" disabled="true" class="details-form-button">
223
- <svg class="spinner hidden" viewBox="0 0 24 24">
224
- <path
225
- d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">
226
- </path>
227
- </svg>
228
- <span id="details-form-button-text"> Pay </span>
229
- </button>
230
- </div>
231
- </div>
232
- </div>
233
- </form>
234
-
235
- <div class="container-center mt-4 gap-1">
236
- <svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
237
- <path
238
- d="M4.884 0.68L1.384 2.235C1.024 2.395 0.789001 2.755 0.789001 3.15V5.5C0.789001 8.275 2.709 10.87 5.289 11.5C7.869 10.87 9.789 8.275 9.789 5.5V3.15C9.789 2.755 9.554 2.395 9.194 2.235L5.694 0.68C5.439 0.565 5.139 0.565 4.884 0.68ZM5.289 5.995H8.789C8.524 8.055 7.149 9.89 5.289 10.465V6H1.789V3.15L5.289 1.595V5.995Z"
239
- fill="#6D6A73" />
240
- </svg>
241
- <p class="text-xxs text-grey-100">
242
- PCI DSS Certified
243
- </p>
244
- </div>
245
- <div class="text-xs text-grey-400 mt-4">
246
- <p>
247
- By confirming this payment, you allow <span id="merchant-name">-</span> to charge your card for this payment and
248
- future payments in
249
- accordance with their terms.
250
- </p>
251
- </div>
252
- </div>`,Ms=()=>{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()},ai=(n="")=>n.replace(/\D+/g,""),As=n=>n.replace(/\D/g,""),xs=n=>n.replace(/\D/g,"").replace(/(\d{4})(?=\d)/g,"$1 ").trim(),Ls=n=>ai(n).slice(0,3),Ts=n=>{const e=ai(n);return e.length>=3?`${e.slice(0,2)}/${e.slice(2,4)}`:e},ri=n=>{const e=Math.floor(n/60),i=n%60;return`${String(e).padStart(2,"0")}:${String(i).padStart(2,"0")}`},Es=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|4[4-9]|22)/,UnionPay:/^62/,Verve:/^506099|^5061[0-8]|^50619|^6500[02]|^5078[6-9]|^65003[1-3]/};for(const[i,t]of Object.entries(e))if(t.test(n))return i;return"Unknown"},Ps={Visa:[16],MasterCard:[16],"American Express":[15],Discover:[16],UnionPay:[16],Verve:[16,19]},mn=class mn{};h(mn,"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"
178
+ `}],wh=`<div>\r
179
+ <form id="checkoutcard">\r
180
+ <div>\r
181
+ <div class="container-between">\r
182
+ <h5 class="text-grey-400 font-semibold text-sm">Enter your card details</h5>\r
183
+ <div class="bg-tone-100 rounded-[40px] h-[22px] text-xxs text-white align-center px-2 md:hidden"> <span\r
184
+ id="card-currency"></span> </div>\r
185
+ </div>\r
186
+ <div class="mt-3 mb-3 md:mb-5">\r
187
+ <div id="card-details" class="flex border border-grey-100 rounded-lg p-4">\r
188
+ <div class="grow relative flex gap-2">\r
189
+ <div class="relative flex w-full">\r
190
+ <div class="absolute left-0 top-1/2 -translate-y-2/4">\r
191
+ <div id="card-type" class="align-center gap-2">\r
192
+ <svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg">\r
193
+ <path\r
194
+ 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"\r
195
+ fill="#B6B4B9" />\r
196
+ </svg>\r
197
+ </div>\r
198
+ </div>\r
199
+ <input class="details-input-container ml-9 grow" type="tel" id="card-number" name="number"\r
200
+ placeholder="Card number" required minlength="17" maxlength="23" />\r
201
+ </div>\r
202
+ </div>\r
203
+ \r
204
+ <div class="relative w-14 md:w-20">\r
205
+ <div class="w-4/5 md:w-3/5 ml-auto">\r
206
+ <input class="details-input-container" type="tel" id="card-expiry" name="expiry" placeholder="MM/YY"\r
207
+ required minlength="5" />\r
208
+ </div>\r
209
+ </div>\r
210
+ \r
211
+ <div class="relative w-12 md:w-16">\r
212
+ <div class="w-4/5 md:w-3/5 ml-auto">\r
213
+ <input class="details-input-container" type="tel" id="card-cvv" name="cvv" placeholder="CVV" required\r
214
+ minlength="3" />\r
215
+ </div>\r
216
+ </div>\r
217
+ </div>\r
218
+ <div id="card-error" class="text-sm text-error font-semibold mt-2 hidden"></div>\r
219
+ \r
220
+ \r
221
+ <div class="mt-4 md:mt-8">\r
222
+ <button type="submit" disabled="true" class="details-form-button">\r
223
+ <svg class="spinner hidden" viewBox="0 0 24 24">\r
224
+ <path\r
225
+ d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">\r
226
+ </path>\r
227
+ </svg>\r
228
+ <span id="details-form-button-text"> Pay </span>\r
229
+ </button>\r
230
+ </div>\r
231
+ </div>\r
232
+ </div>\r
233
+ </form>\r
234
+ \r
235
+ <div class="container-center mt-4 gap-1">\r
236
+ <svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">\r
237
+ <path\r
238
+ d="M4.884 0.68L1.384 2.235C1.024 2.395 0.789001 2.755 0.789001 3.15V5.5C0.789001 8.275 2.709 10.87 5.289 11.5C7.869 10.87 9.789 8.275 9.789 5.5V3.15C9.789 2.755 9.554 2.395 9.194 2.235L5.694 0.68C5.439 0.565 5.139 0.565 4.884 0.68ZM5.289 5.995H8.789C8.524 8.055 7.149 9.89 5.289 10.465V6H1.789V3.15L5.289 1.595V5.995Z"\r
239
+ fill="#6D6A73" />\r
240
+ </svg>\r
241
+ <p class="text-xxs text-grey-100">\r
242
+ PCI DSS Certified\r
243
+ </p>\r
244
+ </div>\r
245
+ <div class="text-xs text-grey-400 mt-4">\r
246
+ <p>\r
247
+ By confirming this payment, you allow <span id="merchant-name">-</span> to charge your card for this payment and\r
248
+ future payments in\r
249
+ accordance with their terms.\r
250
+ </p>\r
251
+ </div>\r
252
+ </div>`,Ch=()=>{const n=Date.now().toString(36),t="xxxx-xxxx-xxx-xxxx".replace(/[x]/g,()=>Math.floor(Math.random()*16).toString(16));return`SPF-${n}-${t}`.toUpperCase()},Hi=(n="")=>n.replace(/\D+/g,""),Sh=n=>n.replace(/\D/g,""),kh=n=>n.replace(/\D/g,"").replace(/(\d{4})(?=\d)/g,"$1 ").trim(),_h=n=>Hi(n).slice(0,3),Ah=n=>{const t=Hi(n);return t.length>=3?`${t.slice(0,2)}/${t.slice(2,4)}`:t},Ui=n=>{const t=Math.floor(n/60),r=n%60;return`${String(t).padStart(2,"0")}:${String(r).padStart(2,"0")}`},xh=n=>{n=n.replace(/\D/g,"");const t={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[r,e]of Object.entries(t))if(e.test(n))return r;return"Unknown"},Mh={Visa:[16],MasterCard:[16],"American Express":[15],Discover:[16],UnionPay:[16],Verve:[16,17,18,19]},lt=class lt{};g(lt,"createToast",(t,r)=>{const e=document.createElement("div");e.classList.add("toast",r,"grid","grid-cols-[1fr_auto]");const i=document.createElement("span");i.classList.add("flex","items-center","gap-2","text-[10px]","justify-self-center"),i.innerHTML=["error","warning","info"].includes(r)?`<svg class=" inline-block mr-1" width="18" height="19" viewBox="0 0 18 19" fill="none"
253
253
  xmlns="http://www.w3.org/2000/svg">
254
254
  <path fill-rule="evenodd" clip-rule="evenodd"
255
255
  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"
256
256
  fill="white" />
257
257
  </svg>
258
- <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=()=>mn.removeToast(t),t.appendChild(s),t}),h(mn,"showToast",(e,i,t=3e3)=>{const o=document.getElementById("toast-container");if(o){const s=mn.createToast(e,i);o.appendChild(s),s.offsetHeight,s.classList.add("show"),setTimeout(()=>mn.removeToast(s),t)}}),h(mn,"removeToast",e=>{e.classList.remove("show"),e.addEventListener("transitionend",()=>{e.parentElement&&e.parentElement.removeChild(e)})});let li=mn;class Et{constructor(e){h(this,"container");h(this,"onAction");h(this,"cardDetailsValues");h(this,"creditCardTypes");h(this,"merchantName");this.container=e.container,this.onAction=e.onAction,this.creditCardTypes=[...Lt],this.cardDetailsValues={number:"",expiry:"",cvv:""},this.merchantName=e.merchantName}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(".details-form-button"),r=document.querySelector("#checkoutcard");i&&i.addEventListener("input",l=>this.handleInputChange(l,s)),t&&t.addEventListener("input",l=>this.handleInputChange(l,s)),o&&o.addEventListener("input",l=>this.handleInputChange(l,s)),r&&r.addEventListener("submit",l=>{var c,b;l.preventDefault(),this.onAction(l)({pan:As(this.cardDetailsValues.number),cvv:this.cardDetailsValues.cvv,expiryMonth:(c=this.cardDetailsValues)==null?void 0:c.expiry.split("/")[0].trim(),expiryYear:(b=this.cardDetailsValues)==null?void 0:b.expiry.split("/")[1].trim()})})}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,c,b;const t=e.target,{name:o,value:s}=t;let r=s;if(s.trim()===""){this.emptyCardState(t,o);return}if(o==="number"){r=xs(s);const p=r.replace(/\s+/g,""),g=this.validateCreditCard(p);this.filterCreditCardType(s);const f=(l=this.creditCardTypes[0])==null?void 0:l.name;if(f)if(f==="Visa"||f==="MasterCard"||f==="Verve"){const y=Ps[f];y.length>1?(p.length===y[0]&&this.checkInputValidity(g,t,"Your card number is invalid",p.length>=14&&p.length<=19),p.length===y[y.length-1]&&this.checkInputValidity(g,t,"Your card number is invalid",p.length>=14&&p.length<=19)):p.length===y[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;r=Ts(s);const g=r.split("/"),f=(c=g[0])==null?void 0:c.trim(),y=(b=g[1])==null?void 0:b.trim(),C=new Date().getFullYear()%100,k=p.getMonth()+1;let S=!0;(parseInt(y)===C&&parseInt(f)<k||parseInt(y)<C)&&(S=!1),(y==null?void 0:y.length)===2&&this.checkInputValidity(S,t,"Your card has expired",g.join("").length===4)}else o==="cvv"&&(r=Ls(s));if(this.cardDetailsValues={...this.cardDetailsValues,[o]:r},t.value=r,this.validateCard())i&&i.removeAttribute("disabled");else if(i){if(i.disabled)return;i.setAttribute("disabled","")}}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}}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">
258
+ <span id="custom-toast-msg">${t}</span>`:t,e.appendChild(i);const o=document.createElement("span");return o.textContent="×",o.classList.add("close-btn","opacity-0"),o.onclick=()=>lt.removeToast(e),e.appendChild(o),e}),g(lt,"showToast",(t,r,e=3e3)=>{const i=document.getElementById("toast-container");if(i){const o=lt.createToast(t,r);i.appendChild(o),o.offsetHeight,o.classList.add("show"),setTimeout(()=>lt.removeToast(o),e)}}),g(lt,"removeToast",t=>{t.classList.remove("show"),t.addEventListener("transitionend",()=>{t.parentElement&&t.parentElement.removeChild(t)})});let Fi=lt;class Ra{constructor(t){g(this,"container");g(this,"onAction");g(this,"cardDetailsValues");g(this,"creditCardTypes");g(this,"merchantName");g(this,"currency");this.container=t.container,this.onAction=t.onAction,this.creditCardTypes=[...Pa],this.cardDetailsValues={number:"",expiry:"",cvv:""},this.merchantName=t.merchantName,this.currency=t.currency}attachListener(){const t=document.querySelector("#pci-dss");t&&t.classList.remove("hidden");const r=document.querySelector('input[name="number"]'),e=document.querySelector('input[name="expiry"]'),i=document.querySelector('input[name="cvv"]'),o=document.querySelector(".details-form-button"),s=document.querySelector("#checkoutcard");r&&r.addEventListener("input",a=>this.handleInputChange(a,o)),e&&e.addEventListener("input",a=>this.handleInputChange(a,o)),i&&i.addEventListener("input",a=>this.handleInputChange(a,o)),s&&s.addEventListener("submit",a=>{var u,c;a.preventDefault(),this.onAction(a)({pan:Sh(this.cardDetailsValues.number),cvv:this.cardDetailsValues.cvv,expiryMonth:(u=this.cardDetailsValues)==null?void 0:u.expiry.split("/")[0].trim(),expiryYear:(c=this.cardDetailsValues)==null?void 0:c.expiry.split("/")[1].trim()})})}validateCreditCard(t){if(t=t.replace(/\D/g,""),!t||t.length===0||t.length<13||t.length>19)return!1;const r=t.split("").map(i=>parseInt(i,10));for(let i=r.length-2;i>=0;i-=2){let o=r[i]*2;o>9&&(o-=9),r[i]=o}return r.reduce((i,o)=>i+o,0)%10===0}handleInputChange(t,r){var a,u,c;const e=t.target,{name:i,value:o}=e;let s=o;if(o.trim()===""){this.emptyCardState(e,i);return}if(i==="number"){s=kh(o);const d=s.replace(/\s+/g,""),h=this.validateCreditCard(d);this.filterCreditCardType(o);const p=(a=this.creditCardTypes[0])==null?void 0:a.name;p&&lo.map(y=>{if(y.name===this.currency)if(y.cardTypes.includes(p)){const w=Mh[p];if(w.length>1){const k=w.some(b=>d.length===b);this.checkInputValidity(h,e,"Your card number is invalid",k)}else d.length===w[0]&&this.checkInputValidity(h,e,"Your card number is invalid",d.length>=14&&d.length<=19)}else this.checkInputValidity(!1,e,"Invalid card. Only locally issued cards are accepted.",o.trim().length>=14&&o.trim().length<=19)})}else if(i==="expiry"){const d=new Date;s=Ah(o);const h=s.split("/"),p=(u=h[0])==null?void 0:u.trim(),y=(c=h[1])==null?void 0:c.trim(),w=new Date().getFullYear()%100,k=d.getMonth()+1;let b=!0;(parseInt(y)===w&&parseInt(p)<k||parseInt(y)<w)&&(b=!1),(y==null?void 0:y.length)===2&&this.checkInputValidity(b,e,"Your card has expired",h.join("").length===4)}else i==="cvv"&&(s=_h(o));if(this.cardDetailsValues={...this.cardDetailsValues,[i]:s},e.value=s,this.validateCard())r&&r.removeAttribute("disabled");else if(r){if(r.disabled)return;r.setAttribute("disabled","")}}validateCard(){if(this.cardDetailsValues.expiry.split("/").length===2){const t=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&&t.length===2}}displayCardTypes(){requestAnimationFrame(()=>{const t=this.container.querySelector("#card-type");t.innerHTML="",this.creditCardTypes.length>0?this.creditCardTypes.forEach(r=>{const e=document.createElement("div");e.classList.add("card-type"),e.innerHTML=r.icon,t.appendChild(e)}):t.innerHTML=`<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg">
259
259
  <path
260
260
  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"
261
261
  fill="#B6B4B9" />
262
- </svg>`})}filterCreditCardType(e){e?(this.creditCardTypes=Lt.filter(i=>i.name===Es(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"),r=document.querySelector("#card-error"),l=document.querySelector("#card-details");if(e.style.color="#0D0716",l&&(l.style.border="1px solid #9E9BA1"),r&&(r.classList.remove("block"),r.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">
262
+ </svg>`})}filterCreditCardType(t){t?(this.creditCardTypes=Pa.filter(r=>r.name===xh(t)),this.displayCardTypes()):(this.creditCardTypes=[],this.displayCardTypes())}emptyCardState(t,r){t.style.border="";const e=document.getElementById("card-number-error"),i=document.getElementById("expiry-error"),o=this.container.querySelector("#card-type"),s=document.querySelector("#card-error"),a=document.querySelector("#card-details");if(t.style.color="#0D0716",a&&(a.style.border="1px solid #9E9BA1"),s&&(s.classList.remove("block"),s.classList.add("hidden")),i&&i.remove(),e&&e.remove(),this.cardDetailsValues={...this.cardDetailsValues,[r]:""},r==="number"&&(o.innerHTML=`<svg width="25" height="16" viewBox="0 0 25 16" fill="none" xmlns="http://www.w3.org/2000/svg">
263
263
  <path
264
264
  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"
265
265
  fill="#B6B4B9" />
@@ -727,480 +727,508 @@
727
727
 
728
728
  </div>
729
729
  </div>
730
- </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 Gs({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 zs(n){return n.nodeType===n.ELEMENT_NODE}function Gn(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 Fs(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 qs(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 ci(n){try{const e=n.rules||n.cssRules;return e?Fs(Array.from(e,Nt).join("")):null}catch{return null}}function Nt(n){let e;if(Zs(n))try{e=ci(n.styleSheet)||qs(n)}catch{}else if(Js(n)&&n.selectorText.includes(":"))return Ws(n.cssText);return e||n.cssText}function Ws(n){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(e,"$1\\$2")}function Zs(n){return"styleSheet"in n}function Js(n){return"selectorText"in n}class It{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 $s(){return new It}function Ui({element:n,maskInputOptions:e,tagName:i,type:t,value:o,maskInputFn:s}){let r=o||"";const l=t&&gn(t);return(e[i.toLowerCase()]||l&&e[l])&&(s?r=s(r,n):r="*".repeat(r.length)),r}function gn(n){return n.toLowerCase()}const Bt="__rrweb_original__";function Ys(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,r=Bt in s?s[Bt]:s;if(new Uint32Array(r.call(e,t,o,Math.min(i,n.width-t),Math.min(i,n.height-o)).data.buffer).some(c=>c!==0))return!1}return!0}function Ki(n){const e=n.type;return n.hasAttribute("data-rr-is-password")?"password":e?gn(e):null}function Rt(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 Qs=1;const Xs=new RegExp("[^a-z0-9-_:]"),Fn=-2;function Dt(){return Qs++}function ea(n){if(n instanceof HTMLFormElement)return"form";const e=gn(n.tagName);return Xs.test(e)?"div":e}function na(n){let e="";return n.indexOf("//")>-1?e=n.split("/").slice(0,3).join("/"):e=n.split("/")[0],e=e.split("?")[0],e}let Tn,Ot;const ia=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ta=/^(?:[a-z+]+:)?\/\//i,oa=/^www\..*/i,sa=/^(data:)([^,]*),(.*)/i;function ui(n,e){return(n||"").replace(ia,(i,t,o,s,r,l)=>{const c=o||r||l,b=t||s||"";if(!c)return i;if(ta.test(c)||oa.test(c))return`url(${b}${c}${b})`;if(sa.test(c))return`url(${b}${c}${b})`;if(c[0]==="/")return`url(${b}${na(e)+c}${b})`;const p=e.split("/"),g=c.split("/");p.pop();for(const f of g)f!=="."&&(f===".."?p.pop():p.push(f));return`url(${b}${p.join("/")}${b})`})}const aa=/^[^ \t\n\r\u000c]+/,ra=/^[, \t\n\r\u000c]+/;function la(n,e){if(e.trim()==="")return e;let i=0;function t(s){let r;const l=s.exec(e.substring(i));return l?(r=l[0],i+=r.length,r):""}const o=[];for(;t(ra),!(i>=e.length);){let s=t(aa);if(s.slice(-1)===",")s=En(n,s.substring(0,s.length-1)),o.push(s);else{let r="";s=En(n,s);let l=!1;for(;;){const c=e.charAt(i);if(c===""){o.push((s+r).trim());break}else if(l)c===")"&&(l=!1);else if(c===","){i+=1,o.push((s+r).trim());break}else c==="("&&(l=!0);r+=c,i+=1}}}return o.join(", ")}function En(n,e){if(!e||e.trim()==="")return e;const i=n.createElement("a");return i.href=e,i.href}function da(n){return!!(n.tagName==="svg"||n.ownerSVGElement)}function ji(){const n=document.createElement("a");return n.href="",n.href}function Ht(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")?En(n,t):i==="srcset"?la(n,t):i==="style"?ui(t,ji()):e==="object"&&i==="data"?En(n,t):t)}function Ut(n,e,i){return(n==="video"||n==="audio")&&e==="autoplay"}function ca(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 hi(n,e,i){if(!n)return!1;if(n.nodeType!==n.ELEMENT_NODE)return i?hi(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?hi(n.parentNode,e,i):!1}function Kt(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(hi(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 ua(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 r="about:blank";if(t.location.href!==r||n.src===r||n.src==="")return setTimeout(e,0),n.addEventListener("load",e);n.addEventListener("load",e)}function ha(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 ma(n,e){const{doc:i,mirror:t,blockClass:o,blockSelector:s,needsMask:r,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:b,maskInputFn:p,dataURLOptions:g={},inlineImages:f,recordCanvas:y,keepIframeSrcFn:C,newlyAddedElement:k=!1}=e,S=pa(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 va(n,{doc:i,blockClass:o,blockSelector:s,inlineStylesheet:l,maskInputOptions:c,maskInputFn:p,dataURLOptions:g,inlineImages:f,recordCanvas:y,keepIframeSrcFn:C,newlyAddedElement:k,rootId:S});case n.TEXT_NODE:return ba(n,{needsMask:r,maskTextFn:b,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 pa(n,e){if(!e.hasNode(n))return;const i=e.getId(n);return i===1?void 0:i}function ba(n,e){var i;const{needsMask:t,maskTextFn:o,rootId:s}=e,r=n.parentNode&&n.parentNode.tagName;let l=n.textContent;const c=r==="STYLE"?!0:void 0,b=r==="SCRIPT"?!0:void 0;if(c&&l){try{n.nextSibling||n.previousSibling||!((i=n.parentNode.sheet)===null||i===void 0)&&i.cssRules&&(l=ci(n.parentNode.sheet))}catch(p){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${p}`,n)}l=ui(l,ji())}return b&&(l="SCRIPT_PLACEHOLDER"),!c&&!b&&l&&t&&(l=o?o(l,n.parentElement):l.replace(/[\S]/g,"*")),{type:le.Text,textContent:l||"",isStyle:c,rootId:s}}function va(n,e){const{doc:i,blockClass:t,blockSelector:o,inlineStylesheet:s,maskInputOptions:r={},maskInputFn:l,dataURLOptions:c={},inlineImages:b,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:f=!1,rootId:y}=e,C=ca(n,t,o),k=ea(n);let S={};const M=n.attributes.length;for(let _=0;_<M;_++){const E=n.attributes[_];Ut(k,E.name,E.value)||(S[E.name]=Ht(i,k,gn(E.name),E.value))}if(k==="link"&&s){const _=Array.from(i.styleSheets).find(N=>N.href===n.href);let E=null;_&&(E=ci(_)),E&&(delete S.rel,delete S.href,S._cssText=ui(E,_.href))}if(k==="style"&&n.sheet&&!(n.innerText||n.textContent||"").trim().length){const _=ci(n.sheet);_&&(S._cssText=ui(_,ji()))}if(k==="input"||k==="textarea"||k==="select"){const _=n.value,E=n.checked;S.type!=="radio"&&S.type!=="checkbox"&&S.type!=="submit"&&S.type!=="button"&&_?S.value=Ui({element:n,type:Ki(n),tagName:k,value:_,maskInputOptions:r,maskInputFn:l}):E&&(S.checked=E)}if(k==="option"&&(n.selected&&!r.select?S.selected=!0:delete S.selected),k==="canvas"&&p){if(n.__context==="2d")Ys(n)||(S.rr_dataURL=n.toDataURL(c.type,c.quality));else if(!("__context"in n)){const _=n.toDataURL(c.type,c.quality),E=document.createElement("canvas");E.width=n.width,E.height=n.height;const N=E.toDataURL(c.type,c.quality);_!==N&&(S.rr_dataURL=_)}}if(k==="img"&&b){Tn||(Tn=i.createElement("canvas"),Ot=Tn.getContext("2d"));const _=n,E=_.crossOrigin;_.crossOrigin="anonymous";const N=()=>{_.removeEventListener("load",N);try{Tn.width=_.naturalWidth,Tn.height=_.naturalHeight,Ot.drawImage(_,0,0),S.rr_dataURL=Tn.toDataURL(c.type,c.quality)}catch(G){console.warn(`Cannot inline img src=${_.currentSrc}! Error: ${G}`)}E?S.crossOrigin=E:_.removeAttribute("crossorigin")};_.complete&&_.naturalWidth!==0?N():_.addEventListener("load",N)}if(k==="audio"||k==="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)),C){const{width:_,height:E}=n.getBoundingClientRect();S={class:S.class,rr_width:`${_}px`,rr_height:`${E}px`}}k==="iframe"&&!g(S.src)&&(n.contentDocument||(S.rr_src=S.src),delete S.src);let A;try{customElements.get(k)&&(A=!0)}catch{}return{type:le.Element,tagName:k,attributes:S,childNodes:[],isSVG:da(n)||void 0,needBlock:C,rootId:y,isCustom:A}}function ne(n){return n==null?"":n.toLowerCase()}function fa(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"&&Rt(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 Pn(n,e){const{doc:i,mirror:t,blockClass:o,blockSelector:s,maskTextClass:r,maskTextSelector:l,skipChild:c=!1,inlineStylesheet:b=!0,maskInputOptions:p={},maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:C={},inlineImages:k=!1,recordCanvas:S=!1,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:_=5e3,onStylesheetLoad:E,stylesheetLoadTimeout:N=5e3,keepIframeSrcFn:G=()=>!1,newlyAddedElement:z=!1}=e;let{needsMask:U}=e,{preserveWhiteSpace:V=!0}=e;!U&&n.childNodes&&(U=Kt(n,r,l,U===void 0));const oe=ma(n,{doc:i,mirror:t,blockClass:o,blockSelector:s,needsMask:U,inlineStylesheet:b,maskInputOptions:p,maskTextFn:g,maskInputFn:f,dataURLOptions:C,inlineImages:k,recordCanvas:S,keepIframeSrcFn:G,newlyAddedElement:z});if(!oe)return console.warn(n,"not serialized"),null;let fe;t.hasNode(n)?fe=t.getId(n):fa(oe,y)||!V&&oe.type===le.Text&&!oe.isStyle&&!oe.textContent.replace(/^\s+|\s+$/gm,"").length?fe=Fn:fe=Dt();const K=Object.assign(oe,{id:fe});if(t.add(n,K),fe===Fn)return null;M&&M(n);let Me=!c;if(K.type===le.Element){Me=Me&&!K.needBlock,delete K.needBlock;const ue=n.shadowRoot;ue&&zn(ue)&&(K.isShadowHost=!0)}if((K.type===le.Document||K.type===le.Element)&&Me){y.headWhitespace&&K.type===le.Element&&K.tagName==="head"&&(V=!1);const ue={doc:i,mirror:t,blockClass:o,blockSelector:s,needsMask:U,maskTextClass:r,maskTextSelector:l,skipChild:c,inlineStylesheet:b,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:C,inlineImages:k,recordCanvas:S,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:_,onStylesheetLoad:E,stylesheetLoadTimeout:N,keepIframeSrcFn:G};if(!(K.type===le.Element&&K.tagName==="textarea"&&K.attributes.value!==void 0))for(const Te of Array.from(n.childNodes)){const Ae=Pn(Te,ue);Ae&&K.childNodes.push(Ae)}if(zs(n)&&n.shadowRoot)for(const Te of Array.from(n.shadowRoot.childNodes)){const Ae=Pn(Te,ue);Ae&&(zn(n.shadowRoot)&&(Ae.isShadow=!0),K.childNodes.push(Ae))}}return n.parentNode&&Gn(n.parentNode)&&zn(n.parentNode)&&(K.isShadow=!0),K.type===le.Element&&K.tagName==="iframe"&&ua(n,()=>{const ue=n.contentDocument;if(ue&&A){const Te=Pn(ue,{doc:ue,mirror:t,blockClass:o,blockSelector:s,needsMask:U,maskTextClass:r,maskTextSelector:l,skipChild:!1,inlineStylesheet:b,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:C,inlineImages:k,recordCanvas:S,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:_,onStylesheetLoad:E,stylesheetLoadTimeout:N,keepIframeSrcFn:G});Te&&A(n,Te)}},_),K.type===le.Element&&K.tagName==="link"&&typeof K.attributes.rel=="string"&&(K.attributes.rel==="stylesheet"||K.attributes.rel==="preload"&&typeof K.attributes.href=="string"&&Rt(K.attributes.href)==="css")&&ha(n,()=>{if(E){const ue=Pn(n,{doc:i,mirror:t,blockClass:o,blockSelector:s,needsMask:U,maskTextClass:r,maskTextSelector:l,skipChild:!1,inlineStylesheet:b,maskInputOptions:p,maskTextFn:g,maskInputFn:f,slimDOMOptions:y,dataURLOptions:C,inlineImages:k,recordCanvas:S,preserveWhiteSpace:V,onSerialize:M,onIframeLoad:A,iframeLoadTimeout:_,onStylesheetLoad:E,stylesheetLoadTimeout:N,keepIframeSrcFn:G});ue&&E(n,ue)}},N),K}function ga(n,e){const{mirror:i=new It,blockClass:t="rr-block",blockSelector:o=null,maskTextClass:s="rr-mask",maskTextSelector:r=null,inlineStylesheet:l=!0,inlineImages:c=!1,recordCanvas:b=!1,maskAllInputs:p=!1,maskTextFn:g,maskInputFn:f,slimDOM:y=!1,dataURLOptions:C,preserveWhiteSpace:k,onSerialize:S,onIframeLoad:M,iframeLoadTimeout:A,onStylesheetLoad:_,stylesheetLoadTimeout:E,keepIframeSrcFn:N=()=>!1}=e||{};return Pn(n,{doc:n,mirror:i,blockClass:t,blockSelector:o,maskTextClass:s,maskTextSelector:r,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:C,inlineImages:c,recordCanvas:b,preserveWhiteSpace:k,onSerialize:S,onIframeLoad:M,iframeLoadTimeout:A,onStylesheetLoad:_,stylesheetLoadTimeout:E,keepIframeSrcFn:N,newlyAddedElement:!1})}function Se(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
730
+ </div>`}renderTransactionIssuesComponent(){const t=document.querySelector("#main-header"),r=document.querySelector("#main-content"),e=document.querySelector("#main-footer");switch(t&&(t.style.display="none"),r&&r.classList.remove("box-container"),e&&(e.style.display="none"),this.currentStep){case 1:this.transactionIssuesForm=new Uh({container:this.container,uploadEvidenceFile:this.uploadEvidenceFile.bind(this),onAction:this.submitDisputeForm.bind(this),paymentResponse:this.paymentResponse}),this.transactionIssuesForm.renderComponent();break}this.attachListener()}}var O;if(typeof window>"u"){var Na={hostname:""};O={crypto:{randomUUID:function(){throw Error("unsupported")}},navigator:{userAgent:"",onLine:!0},document:{createElement:function(){return{}},location:Na,referrer:""},screen:{width:0,height:0},location:Na,addEventListener:function(){},removeEventListener:function(){}}}else O=window;function Ba(n,t){(t==null||t>n.length)&&(t=n.length);for(var r=0,e=new Array(t);r<t;r++)e[r]=n[r];return e}function Da(n,t,r,e,i,o,s){try{var a=n[o](s),u=a.value}catch(c){r(c);return}a.done?t(u):Promise.resolve(u).then(e,i)}function co(n){return function(){var t=this,r=arguments;return new Promise(function(e,i){var o=n.apply(t,r);function s(u){Da(o,e,i,s,a,"next",u)}function a(u){Da(o,e,i,s,a,"throw",u)}s(void 0)})}}function Ki(n,t,r){return Ha()?Ki=Reflect.construct:Ki=function(i,o,s){var a=[null];a.push.apply(a,o);var u=Function.bind.apply(i,a),c=new u;return s&&ni(c,s.prototype),c},Ki.apply(null,arguments)}function Fh(n,t){for(var r=0;r<t.length;r++){var e=t[r];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function Ke(n,t,r){return t&&Fh(n.prototype,t),n}function re(){return re=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=r[e])}return n},re.apply(this,arguments)}function ho(n){return ho=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},ho(n)}function $e(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&ni(n,t)}function J(n,t){return t!=null&&typeof Symbol<"u"&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](n):n instanceof t}function Gh(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function ei(n,t){if(n==null)return{};var r={},e=Object.keys(n),i,o;for(o=0;o<e.length;o++)i=e[o],!(t.indexOf(i)>=0)&&(r[i]=n[i]);return r}function ni(n,t){return ni=Object.setPrototypeOf||function(e,i){return e.__proto__=i,e},ni(n,t)}function Q(n){"@swc/helpers - typeof";return n&&typeof Symbol<"u"&&n.constructor===Symbol?"symbol":typeof n}function Kh(n,t){if(n){if(typeof n=="string")return Ba(n,t);var r=Object.prototype.toString.call(n).slice(8,-1);if(r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ba(n,t)}}function ji(n){var t=typeof Map=="function"?new Map:void 0;return ji=function(e){if(e===null||!Gh(e))return e;if(typeof e!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return Ki(e,arguments,ho(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ni(i,e)},ji(n)}function Ha(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ha=function(){return!!n})()}function D(n,t){var r=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r)return(r=r.call(n)).next.bind(r);if(Array.isArray(n)||(r=Kh(n))||t){r&&(n=r);var e=0;return function(){return e>=n.length?{done:!0}:{done:!1,value:n[e++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ti(n,t){var r,e,i,o,s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(d){return u([c,d])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,e&&(i=c[0]&2?e.return:c[0]?e.throw||((i=e.return)&&i.call(e),0):e.next)&&!(i=i.call(e,c[1])).done)return i;switch(e=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,e=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1],i=c;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(c);break}i[2]&&s.ops.pop(),s.trys.pop();continue}c=t.call(n,s)}catch(d){c=[6,d],e=0}finally{r=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ua(n){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&n[t],e=0;if(r)return r.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&e>=n.length&&(n=void 0),{value:n&&n[e++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}var jh=Object.defineProperty,Vh=function(n,t,r){return t in n?jh(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r},R=function(n,t,r){return Vh(n,(typeof t>"u"?"undefined":Q(t))!=="symbol"?t+"":t,r)},Fa,zh=Object.defineProperty,$h=function(n,t,r){return t in n?zh(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r},Ga=function(n,t,r){return $h(n,(typeof t>"u"?"undefined":Q(t))!=="symbol"?t+"":t,r)},Ne=function(n){return 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",n}(Ne||{}),Ka={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ja={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Vi={},Wh=function(){return!!globalThis.Zone};function mo(n){if(Vi[n])return Vi[n];var t=globalThis[n],r=t.prototype,e=n in Ka?Ka[n]:void 0,i=!!(e&&e.every(function(d){var h,p;return!!((p=(h=Object.getOwnPropertyDescriptor(r,d))==null?void 0:h.get)!=null&&p.toString().includes("[native code]"))})),o=n in ja?ja[n]:void 0,s=!!(o&&o.every(function(d){var h;return typeof r[d]=="function"&&((h=r[d])==null?void 0:h.toString().includes("[native code]"))}));if(i&&s&&!Wh())return Vi[n]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return t.prototype;var c=u[n].prototype;return document.body.removeChild(a),c?Vi[n]=c:r}catch{return r}}var fo={};function Zn(n,t,r){var e,i=n+"."+String(r);if(fo[i])return fo[i].call(t);var o=mo(n),s=(e=Object.getOwnPropertyDescriptor(o,r))==null?void 0:e.get;return s?(fo[i]=s,s.call(t)):t[r]}var po={};function Va(n,t,r){var e=n+"."+String(r);if(po[e])return po[e].bind(t);var i=mo(n),o=i[r];return typeof o!="function"?t[r]:(po[e]=o,o.bind(t))}function qh(n){return Zn("Node",n,"childNodes")}function Zh(n){return Zn("Node",n,"parentNode")}function Jh(n){return Zn("Node",n,"parentElement")}function Yh(n){return Zn("Node",n,"textContent")}function Xh(n,t){return Va("Node",n,"contains")(t)}function Qh(n){return Va("Node",n,"getRootNode")()}function em(n){return!n||!("host"in n)?null:Zn("ShadowRoot",n,"host")}function nm(n){return n.styleSheets}function tm(n){return!n||!("shadowRoot"in n)?null:Zn("Element",n,"shadowRoot")}function im(n,t){return Zn("Element",n,"querySelector")(t)}function rm(n,t){return Zn("Element",n,"querySelectorAll")(t)}function om(){return mo("MutationObserver").constructor}var We={childNodes:qh,parentNode:Zh,parentElement:Jh,textContent:Yh,contains:Xh,getRootNode:Qh,host:em,styleSheets:nm,shadowRoot:tm,querySelector:im,querySelectorAll:rm,mutationObserver:om};function za(n){return n.nodeType===n.ELEMENT_NODE}function ii(n){var t=n&&"host"in n&&"mode"in n&&We.host(n)||null;return!!(t&&"shadowRoot"in t&&We.shadowRoot(t)===n)}function ri(n){return Object.prototype.toString.call(n)==="[object ShadowRoot]"}function sm(n){return n.includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),n}function am(n){var t=n.cssText;if(t.split('"').length<3)return t;var r=["@import","url("+JSON.stringify(n.href)+")"];return n.layerName===""?r.push("layer"):n.layerName&&r.push("layer("+n.layerName+")"),n.supportsText&&r.push("supports("+n.supportsText+")"),n.media.length&&r.push(n.media.mediaText),r.join(" ")+";"}function vo(n){try{var t=n.rules||n.cssRules;if(!t)return null;var r=n.href;!r&&n.ownerNode&&n.ownerNode.ownerDocument&&(r=n.ownerNode.ownerDocument.location.href);var e=Array.from(t,function(i){return $a(i,r)}).join("");return sm(e)}catch{return null}}function $a(n,t){if(lm(n)){var r;try{r=vo(n.styleSheet)||am(n)}catch{r=n.cssText}return n.styleSheet.href?zi(r,n.styleSheet.href):r}else{var e=n.cssText;return cm(n)&&n.selectorText.includes(":")&&(e=um(e)),t?zi(e,t):e}}function um(n){var t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return n.replace(t,"$1\\$2")}function lm(n){return"styleSheet"in n}function cm(n){return"selectorText"in n}var Wa=function(){function n(){Ga(this,"idNodeMap",new Map),Ga(this,"nodeMetaMap",new WeakMap)}var t=n.prototype;return t.getId=function(e){var i;if(!e)return-1;var o=(i=this.getMeta(e))==null?void 0:i.id;return o??-1},t.getNode=function(e){return this.idNodeMap.get(e)||null},t.getIds=function(){return Array.from(this.idNodeMap.keys())},t.getMeta=function(e){return this.nodeMetaMap.get(e)||null},t.removeNodeFromMap=function(e){var i=this,o=this.getId(e);this.idNodeMap.delete(o),e.childNodes&&e.childNodes.forEach(function(s){return i.removeNodeFromMap(s)})},t.has=function(e){return this.idNodeMap.has(e)},t.hasNode=function(e){return this.nodeMetaMap.has(e)},t.add=function(e,i){var o=i.id;this.idNodeMap.set(o,e),this.nodeMetaMap.set(e,i)},t.replace=function(e,i){var o=this.getNode(e);if(o){var s=this.nodeMetaMap.get(o);s&&this.nodeMetaMap.set(i,s)}this.idNodeMap.set(e,i)},t.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},n}();function dm(){return new Wa}function bo(n){var t=n.element,r=n.maskInputOptions,e=n.tagName,i=n.type,o=n.value,s=n.maskInputFn,a=o||"",u=i&&mt(i);return(r[e.toLowerCase()]||u&&r[u])&&(s?a=s(a,t):a="*".repeat(a.length)),a}function mt(n){return n.toLowerCase()}var qa="__rrweb_original__";function hm(n){var t=n.getContext("2d");if(!t)return!0;for(var r=50,e=0;e<n.width;e+=r)for(var i=0;i<n.height;i+=r){var o=t.getImageData,s=qa in o?o[qa]:o,a=new Uint32Array(s.call(t,e,i,Math.min(r,n.width-e),Math.min(r,n.height-i)).data.buffer);if(a.some(function(u){return u!==0}))return!1}return!0}function go(n){var t=n.type;return n.hasAttribute("data-rr-is-password")?"password":t?mt(t):null}function Za(n,t){var r;try{r=new URL(n,t??window.location.href)}catch{return null}var e=/\.([0-9a-z]+)(?:$)/i,i=r.pathname.match(e),o;return(o=i==null?void 0:i[1])!=null?o:null}function mm(n){var t="";return n.indexOf("//")>-1?t=n.split("/").slice(0,3).join("/"):t=n.split("/")[0],t=t.split("?")[0],t}var fm=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,pm=/^(?:[a-z+]+:)?\/\//i,vm=/^www\..*/i,bm=/^(data:)([^,]*),(.*)/i;function zi(n,t){return(n||"").replace(fm,function(r,e,i,o,s,a){var u=i||s||a,c=e||o||"";if(!u)return r;if(pm.test(u)||vm.test(u)||bm.test(u))return"url("+c+u+c+")";if(u[0]==="/")return"url("+c+(mm(t)+u)+c+")";var d=t.split("/"),h=u.split("/");d.pop();for(var p=D(h),y;!(y=p()).done;){var w=y.value;w!=="."&&(w===".."?d.pop():d.push(w))}return"url("+c+d.join("/")+c+")"})}function yo(n){return n.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function gm(n,t){var r=Array.from(t.childNodes),e=[];if(r.length>1&&n&&typeof n=="string"){for(var i=yo(n),o=1;o<r.length;o++)if(r[o].textContent&&typeof r[o].textContent=="string")for(var s=yo(r[o].textContent),a=3;a<s.length;a++){var u=s.substring(0,a);if(i.split(u).length===2){for(var c=i.indexOf(u),d=c;d<n.length;d++)if(yo(n.substring(0,d)).length===c){e.push(n.substring(0,d)),n=n.substring(d);break}break}}}return e.push(n),e}function ym(n,t){return gm(n,t).join("/* rr_split */")}var wm=1,Cm=new RegExp("[^a-z0-9-_:]"),oi=-2;function Ja(){return wm++}function Sm(n){if(J(n,HTMLFormElement))return"form";var t=mt(n.tagName);return Cm.test(t)?"div":t}var Et,Ya,km=/^[^ \t\n\r\u000c]+/,_m=/^[, \t\n\r\u000c]+/;function Am(n,t){if(t.trim()==="")return t;var r=0;function e(c){var d,h=c.exec(t.substring(r));return h?(d=h[0],r+=d.length,d):""}for(var i=[];e(_m),!(r>=t.length);){var o=e(km);if(o.slice(-1)===",")o=Lt(n,o.substring(0,o.length-1)),i.push(o);else{var s="";o=Lt(n,o);for(var a=!1;;){var u=t.charAt(r);if(u===""){i.push((o+s).trim());break}else if(a)u===")"&&(a=!1);else if(u===","){r+=1,i.push((o+s).trim());break}else u==="("&&(a=!0);s+=u,r+=1}}}return i.join(", ")}var Xa=new WeakMap;function Lt(n,t){return!t||t.trim()===""?t:wo(n,t)}function xm(n){return!!(n.tagName==="svg"||n.ownerSVGElement)}function wo(n,t){var r=Xa.get(n);if(r||(r=n.createElement("a"),Xa.set(n,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Qa(n,t,r,e){return e&&(r==="src"||r==="href"&&!(t==="use"&&e[0]==="#")||r==="xlink:href"&&e[0]!=="#"||r==="background"&&(t==="table"||t==="td"||t==="th")?Lt(n,e):r==="srcset"?Am(n,e):r==="style"?zi(e,wo(n)):t==="object"&&r==="data"?Lt(n,e):e)}function eu(n,t,r){return(n==="video"||n==="audio")&&t==="autoplay"}function Mm(n,t,r){try{if(typeof t=="string"){if(n.classList.contains(t))return!0}else for(var e=n.classList.length;e--;){var i=n.classList[e];if(t.test(i))return!0}if(r)return n.matches(r)}catch{}return!1}function $i(n,t,r){if(!n)return!1;if(n.nodeType!==n.ELEMENT_NODE)return r?$i(We.parentNode(n),t,r):!1;for(var e=n.classList.length;e--;){var i=n.classList[e];if(t.test(i))return!0}return r?$i(We.parentNode(n),t,r):!1}function nu(n,t,r,e){var i;if(za(n)){if(i=n,!We.childNodes(i).length)return!1}else{if(We.parentElement(n)===null)return!1;i=We.parentElement(n)}try{if(typeof t=="string"){if(e){if(i.closest("."+t))return!0}else if(i.classList.contains(t))return!0}else if($i(i,t,e))return!0;if(r){if(e){if(i.closest(r))return!0}else if(i.matches(r))return!0}}catch{}return!1}function Em(n,t,r){var e=n.contentWindow;if(e){var i=!1,o;try{o=e.document.readyState}catch{return}if(o!=="complete"){var s=setTimeout(function(){i||(t(),i=!0)},r);n.addEventListener("load",function(){clearTimeout(s),i=!0,t()});return}var a="about:blank";if(e.location.href!==a||n.src===a||n.src==="")return setTimeout(t,0),n.addEventListener("load",t);n.addEventListener("load",t)}}function Lm(n,t,r){var e=!1,i;try{i=n.sheet}catch{return}if(!i){var o=setTimeout(function(){e||(t(),e=!0)},r);n.addEventListener("load",function(){clearTimeout(o),e=!0,t()})}}function Tm(n,t){var r=t.doc,e=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.needsMask,a=t.inlineStylesheet,u=t.maskInputOptions,c=u===void 0?{}:u,d=t.maskTextFn,h=t.maskInputFn,p=t.dataURLOptions,y=p===void 0?{}:p,w=t.inlineImages,k=t.recordCanvas,b=t.keepIframeSrcFn,S=t.newlyAddedElement,A=S===void 0?!1:S,x=t.cssCaptured,E=x===void 0?!1:x,L=Im(r,e);switch(n.nodeType){case n.DOCUMENT_NODE:return n.compatMode!=="CSS1Compat"?{type:Ne.Document,childNodes:[],compatMode:n.compatMode}:{type:Ne.Document,childNodes:[]};case n.DOCUMENT_TYPE_NODE:return{type:Ne.DocumentType,name:n.name,publicId:n.publicId,systemId:n.systemId,rootId:L};case n.ELEMENT_NODE:return Rm(n,{doc:r,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:c,maskInputFn:h,dataURLOptions:y,inlineImages:w,recordCanvas:k,keepIframeSrcFn:b,newlyAddedElement:A,rootId:L});case n.TEXT_NODE:return Pm(n,{doc:r,needsMask:s,maskTextFn:d,rootId:L,cssCaptured:E});case n.CDATA_SECTION_NODE:return{type:Ne.CDATA,textContent:"",rootId:L};case n.COMMENT_NODE:return{type:Ne.Comment,textContent:We.textContent(n)||"",rootId:L};default:return!1}}function Im(n,t){if(t.hasNode(n)){var r=t.getId(n);return r===1?void 0:r}}function Pm(n,t){var r=t.needsMask,e=t.maskTextFn,i=t.rootId,o=t.cssCaptured,s=We.parentNode(n),a=s&&s.tagName,u="",c=a==="STYLE"?!0:void 0,d=a==="SCRIPT"?!0:void 0;return d?u="SCRIPT_PLACEHOLDER":o||(u=We.textContent(n),c&&u&&(u=zi(u,wo(t.doc)))),!c&&!d&&u&&r&&(u=e?e(u,We.parentElement(n)):u.replace(/[\S]/g,"*")),{type:Ne.Text,textContent:u||"",rootId:i}}function Rm(n,t){for(var r=t.doc,e=t.blockClass,i=t.blockSelector,o=t.inlineStylesheet,s=t.maskInputOptions,a=s===void 0?{}:s,u=t.maskInputFn,c=t.dataURLOptions,d=c===void 0?{}:c,h=t.inlineImages,p=t.recordCanvas,y=t.keepIframeSrcFn,w=t.newlyAddedElement,k=w===void 0?!1:w,b=t.rootId,S=Mm(n,e,i),A=Sm(n),x={},E=n.attributes.length,L=0;L<E;L++){var P=n.attributes[L];eu(A,P.name,P.value)||(x[P.name]=Qa(r,A,mt(P.name),P.value))}if(A==="link"&&o){var H=Array.from(r.styleSheets).find(function(Ge){return Ge.href===n.href}),N=null;H&&(N=vo(H)),N&&(delete x.rel,delete x.href,x._cssText=N)}if(A==="style"&&n.sheet){var F=vo(n.sheet);F&&(n.childNodes.length>1&&(F=ym(F,n)),x._cssText=F)}if(A==="input"||A==="textarea"||A==="select"){var z=n.value,G=n.checked;x.type!=="radio"&&x.type!=="checkbox"&&x.type!=="submit"&&x.type!=="button"&&z?x.value=bo({element:n,type:go(n),tagName:A,value:z,maskInputOptions:a,maskInputFn:u}):G&&(x.checked=G)}if(A==="option"&&(n.selected&&!a.select?x.selected=!0:delete x.selected),A==="dialog"&&n.open&&(x.rr_open_mode=n.matches("dialog:modal")?"modal":"non-modal"),A==="canvas"&&p){if(n.__context==="2d")hm(n)||(x.rr_dataURL=n.toDataURL(d.type,d.quality));else if(!("__context"in n)){var V=n.toDataURL(d.type,d.quality),X=r.createElement("canvas");X.width=n.width,X.height=n.height;var Be=X.toDataURL(d.type,d.quality);V!==Be&&(x.rr_dataURL=V)}}if(A==="img"&&h){Et||(Et=r.createElement("canvas"),Ya=Et.getContext("2d"));var te=n,Ue=te.currentSrc||te.getAttribute("src")||"<unknown-src>",Pe=te.crossOrigin,pe=function(){te.removeEventListener("load",pe);try{Et.width=te.naturalWidth,Et.height=te.naturalHeight,Ya.drawImage(te,0,0),x.rr_dataURL=Et.toDataURL(d.type,d.quality)}catch(Ge){if(te.crossOrigin!=="anonymous"){te.crossOrigin="anonymous",te.complete&&te.naturalWidth!==0?pe():te.addEventListener("load",pe);return}else console.warn("Cannot inline img src="+Ue+"! Error: "+Ge)}te.crossOrigin==="anonymous"&&(Pe?x.crossOrigin=Pe:te.removeAttribute("crossorigin"))};te.complete&&te.naturalWidth!==0?pe():te.addEventListener("load",pe)}if(A==="audio"||A==="video"){var xe=x;xe.rr_mediaState=n.paused?"paused":"played",xe.rr_mediaCurrentTime=n.currentTime,xe.rr_mediaPlaybackRate=n.playbackRate,xe.rr_mediaMuted=n.muted,xe.rr_mediaLoop=n.loop,xe.rr_mediaVolume=n.volume}if(k||(n.scrollLeft&&(x.rr_scrollLeft=n.scrollLeft),n.scrollTop&&(x.rr_scrollTop=n.scrollTop)),S){var Fe=n.getBoundingClientRect(),dn=Fe.width,Te=Fe.height;x={class:x.class,rr_width:""+dn+"px",rr_height:""+Te+"px"}}A==="iframe"&&!y(x.src)&&(n.contentDocument||(x.rr_src=x.src),delete x.src);var gn;try{customElements.get(A)&&(gn=!0)}catch{}return{type:Ne.Element,tagName:A,attributes:x,childNodes:[],isSVG:xm(n)||void 0,needBlock:S,rootId:b,isCustom:gn}}function ge(n){return n==null?"":n.toLowerCase()}function Om(n,t){if(t.comment&&n.type===Ne.Comment)return!0;if(n.type===Ne.Element){if(t.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"&&Za(n.attributes.href)==="js"))return!0;if(t.headFavicon&&(n.tagName==="link"&&n.attributes.rel==="shortcut icon"||n.tagName==="meta"&&(ge(n.attributes.name).match(/^msapplication-tile(image|color)$/)||ge(n.attributes.name)==="application-name"||ge(n.attributes.rel)==="icon"||ge(n.attributes.rel)==="apple-touch-icon"||ge(n.attributes.rel)==="shortcut icon")))return!0;if(n.tagName==="meta"){if(t.headMetaDescKeywords&&ge(n.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ge(n.attributes.property).match(/^(og|twitter|fb):/)||ge(n.attributes.name).match(/^(og|twitter):/)||ge(n.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ge(n.attributes.name)==="robots"||ge(n.attributes.name)==="googlebot"||ge(n.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&n.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ge(n.attributes.name)==="author"||ge(n.attributes.name)==="generator"||ge(n.attributes.name)==="framework"||ge(n.attributes.name)==="publisher"||ge(n.attributes.name)==="progid"||ge(n.attributes.property).match(/^article:/)||ge(n.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ge(n.attributes.name)==="google-site-verification"||ge(n.attributes.name)==="yandex-verification"||ge(n.attributes.name)==="csrf-token"||ge(n.attributes.name)==="p:domain_verify"||ge(n.attributes.name)==="verify-v1"||ge(n.attributes.name)==="verification"||ge(n.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Tt(n,t){var r=t.doc,e=t.mirror,i=t.blockClass,o=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,u=t.skipChild,c=u===void 0?!1:u,d=t.inlineStylesheet,h=d===void 0?!0:d,p=t.maskInputOptions,y=p===void 0?{}:p,w=t.maskTextFn,k=t.maskInputFn,b=t.slimDOMOptions,S=t.dataURLOptions,A=S===void 0?{}:S,x=t.inlineImages,E=x===void 0?!1:x,L=t.recordCanvas,P=L===void 0?!1:L,H=t.onSerialize,N=t.onIframeLoad,F=t.iframeLoadTimeout,z=F===void 0?5e3:F,G=t.onStylesheetLoad,V=t.stylesheetLoadTimeout,X=V===void 0?5e3:V,Be=t.keepIframeSrcFn,te=Be===void 0?function(){return!1}:Be,Ue=t.newlyAddedElement,Pe=Ue===void 0?!1:Ue,pe=t.cssCaptured,xe=pe===void 0?!1:pe,Fe=t.needsMask,dn=t.preserveWhiteSpace,Te=dn===void 0?!0:dn;if(!Fe){var gn=Fe===void 0;Fe=nu(n,s,a,gn)}var Ge=Tm(n,{doc:r,mirror:e,blockClass:i,blockSelector:o,needsMask:Fe,inlineStylesheet:h,maskInputOptions:y,maskTextFn:w,maskInputFn:k,dataURLOptions:A,inlineImages:E,recordCanvas:P,keepIframeSrcFn:te,newlyAddedElement:Pe,cssCaptured:xe});if(!Ge)return console.warn(n,"not serialized"),null;var ve;e.hasNode(n)?ve=e.getId(n):Om(Ge,b)||!Te&&Ge.type===Ne.Text&&!Ge.textContent.replace(/^\s+|\s+$/gm,"").length?ve=oi:ve=Ja();var K=Object.assign(Ge,{id:ve});if(e.add(n,K),ve===oi)return null;H&&H(n);var hn=!c;if(K.type===Ne.Element){hn=hn&&!K.needBlock,delete K.needBlock;var rn=We.shadowRoot(n);rn&&ri(rn)&&(K.isShadowHost=!0)}if((K.type===Ne.Document||K.type===Ne.Element)&&hn){b.headWhitespace&&K.type===Ne.Element&&K.tagName==="head"&&(Te=!1);var De={doc:r,mirror:e,blockClass:i,blockSelector:o,needsMask:Fe,maskTextClass:s,maskTextSelector:a,skipChild:c,inlineStylesheet:h,maskInputOptions:y,maskTextFn:w,maskInputFn:k,slimDOMOptions:b,dataURLOptions:A,inlineImages:E,recordCanvas:P,preserveWhiteSpace:Te,onSerialize:H,onIframeLoad:N,iframeLoadTimeout:z,onStylesheetLoad:G,stylesheetLoadTimeout:X,keepIframeSrcFn:te,cssCaptured:!1};if(!(K.type===Ne.Element&&K.tagName==="textarea"&&K.attributes.value!==void 0)){K.type===Ne.Element&&K.attributes._cssText!==void 0&&typeof K.attributes._cssText=="string"&&(De.cssCaptured=!0);for(var yn=D(Array.from(We.childNodes(n))),In;!(In=yn()).done;){var mn=In.value,wn=Tt(mn,De);wn&&K.childNodes.push(wn)}}var Pn=null;if(za(n)&&(Pn=We.shadowRoot(n)))for(var Rn=D(Array.from(We.childNodes(Pn))),Kn;!(Kn=Rn()).done;){var wt=Kn.value,jn=Tt(wt,De);jn&&(ri(Pn)&&(jn.isShadow=!0),K.childNodes.push(jn))}}var Vn=We.parentNode(n);return Vn&&ii(Vn)&&ri(Vn)&&(K.isShadow=!0),K.type===Ne.Element&&K.tagName==="iframe"&&Em(n,function(){var Cn=n.contentDocument;if(Cn&&N){var zn=Tt(Cn,{doc:Cn,mirror:e,blockClass:i,blockSelector:o,needsMask:Fe,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskTextFn:w,maskInputFn:k,slimDOMOptions:b,dataURLOptions:A,inlineImages:E,recordCanvas:P,preserveWhiteSpace:Te,onSerialize:H,onIframeLoad:N,iframeLoadTimeout:z,onStylesheetLoad:G,stylesheetLoadTimeout:X,keepIframeSrcFn:te});zn&&N(n,zn)}},z),K.type===Ne.Element&&K.tagName==="link"&&typeof K.attributes.rel=="string"&&(K.attributes.rel==="stylesheet"||K.attributes.rel==="preload"&&typeof K.attributes.href=="string"&&Za(K.attributes.href)==="css")&&Lm(n,function(){if(G){var Cn=Tt(n,{doc:r,mirror:e,blockClass:i,blockSelector:o,needsMask:Fe,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:h,maskInputOptions:y,maskTextFn:w,maskInputFn:k,slimDOMOptions:b,dataURLOptions:A,inlineImages:E,recordCanvas:P,preserveWhiteSpace:Te,onSerialize:H,onIframeLoad:N,iframeLoadTimeout:z,onStylesheetLoad:G,stylesheetLoadTimeout:X,keepIframeSrcFn:te});Cn&&G(n,Cn)}},X),K}function Nm(n,t){var r=t||{},e=r.mirror,i=e===void 0?new Wa:e,o=r.blockClass,s=o===void 0?"rr-block":o,a=r.blockSelector,u=a===void 0?null:a,c=r.maskTextClass,d=c===void 0?"rr-mask":c,h=r.maskTextSelector,p=h===void 0?null:h,y=r.inlineStylesheet,w=y===void 0?!0:y,k=r.inlineImages,b=k===void 0?!1:k,S=r.recordCanvas,A=S===void 0?!1:S,x=r.maskAllInputs,E=x===void 0?!1:x,L=r.maskTextFn,P=r.maskInputFn,H=r.slimDOM,N=H===void 0?!1:H,F=r.dataURLOptions,z=r.preserveWhiteSpace,G=r.onSerialize,V=r.onIframeLoad,X=r.iframeLoadTimeout,Be=r.onStylesheetLoad,te=r.stylesheetLoadTimeout,Ue=r.keepIframeSrcFn,Pe=Ue===void 0?function(){return!1}:Ue,pe=E===!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}:E===!1?{password:!0}:E,xe=N===!0||N==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:N==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:N===!1?{}:N;return Tt(n,{doc:n,mirror:i,blockClass:s,blockSelector:u,maskTextClass:d,maskTextSelector:p,skipChild:!1,inlineStylesheet:w,maskInputOptions:pe,maskTextFn:L,maskInputFn:P,slimDOMOptions:xe,dataURLOptions:F,inlineImages:b,recordCanvas:A,preserveWhiteSpace:z,onSerialize:G,onIframeLoad:V,iframeLoadTimeout:X,onStylesheetLoad:Be,stylesheetLoadTimeout:te,keepIframeSrcFn:Pe,newlyAddedElement:!1})}function Bm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Dm(n){if(n.__esModule)return n;var t=n.default;if(typeof t=="function"){var r=function e(){return J(this,e)?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(n).forEach(function(e){var i=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:function(){return n[e]}})}),r}var Co={exports:{}},ye=String,tu=function(){return{isColorSupported:!1,reset:ye,bold:ye,dim:ye,italic:ye,underline:ye,inverse:ye,hidden:ye,strikethrough:ye,black:ye,red:ye,green:ye,yellow:ye,blue:ye,magenta:ye,cyan:ye,white:ye,gray:ye,bgBlack:ye,bgRed:ye,bgGreen:ye,bgYellow:ye,bgBlue:ye,bgMagenta:ye,bgCyan:ye,bgWhite:ye}};Co.exports=tu(),Co.exports.createColors=tu;var Hm=Co.exports,Um={},Fm=Object.freeze(Object.defineProperty({__proto__:null,default:Um},Symbol.toStringTag,{value:"Module"})),Ee=Dm(Fm),iu=Hm,ru=Ee,So=function(n){$e(t,n);function t(e,i,o,s,a,u){var c;return c=n.call(this,e)||this,c.name="CssSyntaxError",c.reason=e,a&&(c.file=a),s&&(c.source=s),u&&(c.plugin=u),typeof i<"u"&&typeof o<"u"&&(typeof i=="number"?(c.line=i,c.column=o):(c.line=i.line,c.column=i.column,c.endLine=o.line,c.endColumn=o.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,t),c}var r=t.prototype;return r.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},r.showSourceCode=function(i){var o=this;if(!this.source)return"";var s=this.source;i==null&&(i=iu.isColorSupported),ru&&i&&(s=ru(s));var a=s.split(/\r?\n/),u=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),d=String(c).length,h,p;if(i){var y=iu.createColors(!0),w=y.bold,k=y.gray,b=y.red;h=function(S){return w(b(S))},p=function(S){return k(S)}}else h=p=function(S){return S};return a.slice(u,c).map(function(S,A){var x=u+1+A,E=" "+(" "+x).slice(-d)+" | ";if(x===o.line){var L=p(E.replace(/\d/g," "))+S.slice(0,o.column-1).replace(/[^\t]/g," ");return h(">")+p(E)+S+`
731
+ `+L+h("^")}return" "+p(E)+S}).join(`
732
+ `)},r.toString=function(){var i=this.showSourceCode();return i&&(i=`
733
+
734
+ `+i+`
735
+ `),this.name+": "+this.message+i},t}(ji(Error)),ko=So;So.default=So;var Jn={};Jn.isClean=Symbol("isClean"),Jn.my=Symbol("my");var ou={after:`
736
+ `,beforeClose:`
737
+ `,beforeComment:`
738
+ `,beforeDecl:`
739
+ `,beforeOpen:" ",beforeRule:`
740
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Gm(n){return n[0].toUpperCase()+n.slice(1)}var _o=function(){function n(r){this.builder=r}var t=n.prototype;return t.atrule=function(e,i){var o="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?o+=e.raws.afterName:s&&(o+=" "),e.nodes)this.block(e,o+s);else{var a=(e.raws.between||"")+(i?";":"");this.builder(o+s+a,e)}},t.beforeAfter=function(e,i){var o;e.type==="decl"?o=this.raw(e,null,"beforeDecl"):e.type==="comment"?o=this.raw(e,null,"beforeComment"):i==="before"?o=this.raw(e,null,"beforeRule"):o=this.raw(e,null,"beforeClose");for(var s=e.parent,a=0;s&&s.type!=="root";)a+=1,s=s.parent;if(o.includes(`
741
+ `)){var u=this.raw(e,null,"indent");if(u.length)for(var c=0;c<a;c++)o+=u}return o},t.block=function(e,i){var o=this.raw(e,"between","beforeOpen");this.builder(i+o+"{",e,"start");var s;e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,"after")):s=this.raw(e,"after","emptyBody"),s&&this.builder(s),this.builder("}",e,"end")},t.body=function(e){for(var i=e.nodes.length-1;i>0&&e.nodes[i].type==="comment";)i-=1;for(var o=this.raw(e,"semicolon"),s=0;s<e.nodes.length;s++){var a=e.nodes[s],u=this.raw(a,"before");u&&this.builder(u),this.stringify(a,i!==s||o)}},t.comment=function(e){var i=this.raw(e,"left","commentLeft"),o=this.raw(e,"right","commentRight");this.builder("/*"+i+e.text+o+"*/",e)},t.decl=function(e,i){var o=this.raw(e,"between","colon"),s=e.prop+o+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),i&&(s+=";"),this.builder(s,e)},t.document=function(e){this.body(e)},t.raw=function(e,i,o){var s;if(o||(o=i),i&&(s=e.raws[i],typeof s<"u"))return s;var a=e.parent;if(o==="before"&&(!a||a.type==="root"&&a.first===e||a&&a.type==="document"))return"";if(!a)return ou[o];var u=e.root();if(u.rawCache||(u.rawCache={}),typeof u.rawCache[o]<"u")return u.rawCache[o];if(o==="before"||o==="after")return this.beforeAfter(e,o);var c="raw"+Gm(o);return this[c]?s=this[c](u,e):u.walk(function(d){if(s=d.raws[i],typeof s<"u")return!1}),typeof s>"u"&&(s=ou[o]),u.rawCache[o]=s,s},t.rawBeforeClose=function(e){var i;return e.walk(function(o){if(o.nodes&&o.nodes.length>0&&typeof o.raws.after<"u")return i=o.raws.after,i.includes(`
742
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),i&&(i=i.replace(/\S/g,"")),i},t.rawBeforeComment=function(e,i){var o;return e.walkComments(function(s){if(typeof s.raws.before<"u")return o=s.raws.before,o.includes(`
743
+ `)&&(o=o.replace(/[^\n]+$/,"")),!1}),typeof o>"u"?o=this.raw(i,null,"beforeDecl"):o&&(o=o.replace(/\S/g,"")),o},t.rawBeforeDecl=function(e,i){var o;return e.walkDecls(function(s){if(typeof s.raws.before<"u")return o=s.raws.before,o.includes(`
744
+ `)&&(o=o.replace(/[^\n]+$/,"")),!1}),typeof o>"u"?o=this.raw(i,null,"beforeRule"):o&&(o=o.replace(/\S/g,"")),o},t.rawBeforeOpen=function(e){var i;return e.walk(function(o){if(o.type!=="decl"&&(i=o.raws.between,typeof i<"u"))return!1}),i},t.rawBeforeRule=function(e){var i;return e.walk(function(o){if(o.nodes&&(o.parent!==e||e.first!==o)&&typeof o.raws.before<"u")return i=o.raws.before,i.includes(`
745
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),i&&(i=i.replace(/\S/g,"")),i},t.rawColon=function(e){var i;return e.walkDecls(function(o){if(typeof o.raws.between<"u")return i=o.raws.between.replace(/[^\s:]/g,""),!1}),i},t.rawEmptyBody=function(e){var i;return e.walk(function(o){if(o.nodes&&o.nodes.length===0&&(i=o.raws.after,typeof i<"u"))return!1}),i},t.rawIndent=function(e){if(e.raws.indent)return e.raws.indent;var i;return e.walk(function(o){var s=o.parent;if(s&&s!==e&&s.parent&&s.parent===e&&typeof o.raws.before<"u"){var a=o.raws.before.split(`
746
+ `);return i=a[a.length-1],i=i.replace(/\S/g,""),!1}}),i},t.rawSemicolon=function(e){var i;return e.walk(function(o){if(o.nodes&&o.nodes.length&&o.last.type==="decl"&&(i=o.raws.semicolon,typeof i<"u"))return!1}),i},t.rawValue=function(e,i){var o=e[i],s=e.raws[i];return s&&s.value===o?s.raw:o},t.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},t.rule=function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")},t.stringify=function(e,i){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,i)},n}(),su=_o;_o.default=_o;var Km=su;function Ao(n,t){var r=new Km(t);r.stringify(n)}var Wi=Ao;Ao.default=Ao;var qi=Jn.isClean,jm=Jn.my,Vm=ko,zm=su,$m=Wi;function xo(n,t){var r=new n.constructor;for(var e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&e!=="proxyCache"){var i=n[e],o=typeof i>"u"?"undefined":Q(i);e==="parent"&&o==="object"?t&&(r[e]=t):e==="source"?r[e]=i:Array.isArray(i)?r[e]=i.map(function(s){return xo(s,r)}):(o==="object"&&i!==null&&(i=xo(i)),r[e]=i)}return r}var Mo=function(){function n(r){r===void 0&&(r={}),this.raws={},this[qi]=!1,this[jm]=!0;for(var e in r)if(e==="nodes"){this.nodes=[];for(var i=D(r[e]),o;!(o=i()).done;){var s=o.value;typeof s.clone=="function"?this.append(s.clone()):this.append(s)}}else this[e]=r[e]}var t=n.prototype;return t.addToError=function(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){var i=this.source;e.stack=e.stack.replace(/\n\s{4}at /,"$&"+i.input.from+":"+i.start.line+":"+i.start.column+"$&")}return e},t.after=function(e){return this.parent.insertAfter(this,e),this},t.assign=function(e){e===void 0&&(e={});for(var i in e)this[i]=e[i];return this},t.before=function(e){return this.parent.insertBefore(this,e),this},t.cleanRaws=function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between},t.clone=function(e){e===void 0&&(e={});var i=xo(this);for(var o in e)i[o]=e[o];return i},t.cloneAfter=function(e){e===void 0&&(e={});var i=this.clone(e);return this.parent.insertAfter(this,i),i},t.cloneBefore=function(e){e===void 0&&(e={});var i=this.clone(e);return this.parent.insertBefore(this,i),i},t.error=function(e,i){if(i===void 0&&(i={}),this.source){var o=this.rangeBy(i),s=o.end,a=o.start;return this.source.input.error(e,{column:a.column,line:a.line},{column:s.column,line:s.line},i)}return new Vm(e)},t.getProxyProcessor=function(){return{get:function(i,o){return o==="proxyOf"?i:o==="root"?function(){return i.root().toProxy()}:i[o]},set:function(i,o,s){return i[o]===s||(i[o]=s,(o==="prop"||o==="value"||o==="name"||o==="params"||o==="important"||o==="text")&&i.markDirty()),!0}}},t.markDirty=function(){if(this[qi]){this[qi]=!1;for(var e=this;e=e.parent;)e[qi]=!1}},t.next=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e+1]}},t.positionBy=function(e,i){var o=this.source.start;if(e.index)o=this.positionInside(e.index,i);else if(e.word){i=this.toString();var s=i.indexOf(e.word);s!==-1&&(o=this.positionInside(s,i))}return o},t.positionInside=function(e,i){for(var o=i||this.toString(),s=this.source.start.column,a=this.source.start.line,u=0;u<e;u++)o[u]===`
747
+ `?(s=1,a+=1):s+=1;return{column:s,line:a}},t.prev=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e-1]}},t.rangeBy=function(e){var i={column:this.source.start.column,line:this.source.start.line},o=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:i.column+1,line:i.line};if(e.word){var s=this.toString(),a=s.indexOf(e.word);a!==-1&&(i=this.positionInside(a,s),o=this.positionInside(a+e.word.length,s))}else e.start?i={column:e.start.column,line:e.start.line}:e.index&&(i=this.positionInside(e.index)),e.end?o={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?o=this.positionInside(e.endIndex):e.index&&(o=this.positionInside(e.index+1));return(o.line<i.line||o.line===i.line&&o.column<=i.column)&&(o={column:i.column+1,line:i.line}),{end:o,start:i}},t.raw=function(e,i){var o=new zm;return o.raw(this,e,i)},t.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},t.replaceWith=function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];if(this.parent){for(var s=this,a=!1,u=D(i),c;!(c=u()).done;){var d=c.value;d===this?a=!0:a?(this.parent.insertAfter(s,d),s=d):this.parent.insertBefore(s,d)}a||this.remove()}return this},t.root=function(){for(var e=this;e.parent&&e.parent.type!=="document";)e=e.parent;return e},t.toJSON=function(e,i){var o={},s=i==null;i=i||new Map;var a=0;for(var u in this)if(Object.prototype.hasOwnProperty.call(this,u)&&!(u==="parent"||u==="proxyCache")){var c=this[u];if(Array.isArray(c))o[u]=c.map(function(h){return(typeof h>"u"?"undefined":Q(h))==="object"&&h.toJSON?h.toJSON(null,i):h});else if((typeof c>"u"?"undefined":Q(c))==="object"&&c.toJSON)o[u]=c.toJSON(null,i);else if(u==="source"){var d=i.get(c.input);d==null&&(d=a,i.set(c.input,a),a++),o[u]={end:c.end,inputId:d,start:c.start}}else o[u]=c}return s&&(o.inputs=[].concat(i.keys()).map(function(h){return h.toJSON()})),o},t.toProxy=function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},t.toString=function(e){e===void 0&&(e=$m),e.stringify&&(e=e.stringify);var i="";return e(this,function(o){i+=o}),i},t.warn=function(e,i,o){var s={node:this};for(var a in o)s[a]=o[a];return e.warn(i,s)},Ke(n,[{key:"proxyOf",get:function(){return this}}]),n}(),Zi=Mo;Mo.default=Mo;var Wm=Zi,Eo=function(n){$e(t,n);function t(r){var e;return r&&typeof r.value<"u"&&typeof r.value!="string"&&(r=re({},r,{value:String(r.value)})),e=n.call(this,r)||this,e.type="decl",e}return Ke(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||this.prop[0]==="$"}}]),t}(Wm),Ji=Eo;Eo.default=Eo;var qm="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Zm=function(n){n===void 0&&(n=21);for(var t="",r=n;r--;)t+=qm[Math.random()*64|0];return t},Jm={nanoid:Zm},au=Ee.SourceMapConsumer,uu=Ee.SourceMapGenerator,Ym=Ee.existsSync,Xm=Ee.readFileSync,Lo=Ee.dirname,Qm=Ee.join;function ef(n){return Buffer?Buffer.from(n,"base64").toString():window.atob(n)}var To=function(){function n(r,e){if(e.map!==!1){this.loadAnnotation(r),this.inline=this.startWith(this.annotation,"data:");var i=e.map?e.map.prev:void 0,o=this.loadMap(e.from,i);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=Lo(this.mapFile)),o&&(this.text=o)}}var t=n.prototype;return t.consumer=function(){return this.consumerCache||(this.consumerCache=new au(this.text)),this.consumerCache},t.decodeInline=function(e){var i=/^data:application\/json;charset=utf-?8;base64,/,o=/^data:application\/json;base64,/,s=/^data:application\/json;charset=utf-?8,/,a=/^data:application\/json,/;if(s.test(e)||a.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(i.test(e)||o.test(e))return ef(e.substr(RegExp.lastMatch.length));var u=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+u)},t.getAnnotationURL=function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()},t.isMap=function(e){return(typeof e>"u"?"undefined":Q(e))!=="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)},t.loadAnnotation=function(e){var i=e.match(/\/\*\s*# sourceMappingURL=/gm);if(i){var o=e.lastIndexOf(i.pop()),s=e.indexOf("*/",o);o>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(o,s)))}},t.loadFile=function(e){if(this.root=Lo(e),Ym(e))return this.mapFile=e,Xm(e,"utf-8").toString().trim()},t.loadMap=function(e,i){if(i===!1)return!1;if(i){if(typeof i=="string")return i;if(typeof i=="function"){var o=i(e);if(o){var s=this.loadFile(o);if(!s)throw new Error("Unable to load previous source map: "+o.toString());return s}}else{if(J(i,au))return uu.fromSourceMap(i).toString();if(J(i,uu))return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var a=this.annotation;return e&&(a=Qm(Lo(e),a)),this.loadFile(a)}}},t.startWith=function(e,i){return e?e.substr(0,i.length)===i:!1},t.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},n}(),lu=To;To.default=To;var nf=Ee.SourceMapConsumer,tf=Ee.SourceMapGenerator,cu=Ee.fileURLToPath,Yi=Ee.pathToFileURL,Io=Ee.isAbsolute,Po=Ee.resolve,rf=Jm.nanoid,Ro=Ee,du=ko,of=lu,Oo=Symbol("fromOffsetCache"),sf=!!(nf&&tf),hu=!!(Po&&Io),Xi=function(){function n(r,e){if(e===void 0&&(e={}),r===null||typeof r>"u"||(typeof r>"u"?"undefined":Q(r))==="object"&&!r.toString)throw new Error("PostCSS received "+r+" instead of CSS string");if(this.css=r.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,e.from&&(!hu||/^\w+:\/\//.test(e.from)||Io(e.from)?this.file=e.from:this.file=Po(e.from)),hu&&sf){var i=new of(this.css,e);if(i.text){this.map=i;var o=i.consumer().file;!this.file&&o&&(this.file=this.mapResolve(o))}}this.file||(this.id="<input css "+rf(6)+">"),this.map&&(this.map.file=this.from)}var t=n.prototype;return t.error=function(e,i,o,s){s===void 0&&(s={});var a,u,c;if(i&&(typeof i>"u"?"undefined":Q(i))==="object"){var d=i,h=o;if(typeof d.offset=="number"){var p=this.fromOffset(d.offset);i=p.line,o=p.col}else i=d.line,o=d.column;if(typeof h.offset=="number"){var y=this.fromOffset(h.offset);u=y.line,c=y.col}else u=h.line,c=h.column}else if(!o){var w=this.fromOffset(i);i=w.line,o=w.col}var k=this.origin(i,o,u,c);return k?a=new du(e,k.endLine===void 0?k.line:{column:k.column,line:k.line},k.endLine===void 0?k.column:{column:k.endColumn,line:k.endLine},k.source,k.file,s.plugin):a=new du(e,u===void 0?i:{column:o,line:i},u===void 0?o:{column:c,line:u},this.css,this.file,s.plugin),a.input={column:o,endColumn:c,endLine:u,line:i,source:this.css},this.file&&(Yi&&(a.input.url=Yi(this.file).toString()),a.input.file=this.file),a},t.fromOffset=function(e){var i,o;if(this[Oo])o=this[Oo];else{var s=this.css.split(`
748
+ `);o=new Array(s.length);for(var a=0,u=0,c=s.length;u<c;u++)o[u]=a,a+=s[u].length+1;this[Oo]=o}i=o[o.length-1];var d=0;if(e>=i)d=o.length-1;else for(var h=o.length-2,p;d<h;)if(p=d+(h-d>>1),e<o[p])h=p-1;else if(e>=o[p+1])d=p+1;else{d=p;break}return{col:e-o[d]+1,line:d+1}},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:Po(this.map.consumer().sourceRoot||this.map.root||".",e)},t.origin=function(e,i,o,s){if(!this.map)return!1;var a=this.map.consumer(),u=a.originalPositionFor({column:i,line:e});if(!u.source)return!1;var c;typeof o=="number"&&(c=a.originalPositionFor({column:s,line:o}));var d;Io(u.source)?d=Yi(u.source):d=new URL(u.source,this.map.consumer().sourceRoot||Yi(this.map.mapFile));var h={column:u.column,endColumn:c&&c.column,endLine:c&&c.line,line:u.line,url:d.toString()};if(d.protocol==="file:")if(cu)h.file=cu(d);else throw new Error("file: protocol is not available in this PostCSS build");var p=a.sourceContentFor(u.source);return p&&(h.source=p),h},t.toJSON=function(){for(var e={},i=0,o=["hasBOM","css","file","id"];i<o.length;i++){var s=o[i];this[s]!=null&&(e[s]=this[s])}return this.map&&(e.map=re({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e},Ke(n,[{key:"from",get:function(){return this.file||this.id}}]),n}(),Qi=Xi;Xi.default=Xi,Ro&&Ro.registerInput&&Ro.registerInput(Xi);var mu=Ee.SourceMapConsumer,er=Ee.SourceMapGenerator,nr=Ee.dirname,fu=Ee.relative,pu=Ee.resolve,vu=Ee.sep,bu=Ee.pathToFileURL,af=Qi,uf=!!(mu&&er),lf=!!(nr&&pu&&fu&&vu),cf=function(){function n(r,e,i,o){this.stringify=r,this.mapOpts=i.map||{},this.root=e,this.opts=i,this.css=o,this.originalCSS=o,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var t=n.prototype;return t.addAnnotation=function(){var e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";var i=`
749
+ `;this.css.includes(`\r
750
+ `)&&(i=`\r
751
+ `),this.css+=i+"/*# sourceMappingURL="+e+" */"},t.applyPrevMaps=function(){for(var e=D(this.previous()),i;!(i=e()).done;){var o=i.value,s=this.toUrl(this.path(o.file)),a=o.root||nr(o.file),u=void 0;this.mapOpts.sourcesContent===!1?(u=new mu(o.text),u.sourcesContent&&(u.sourcesContent=null)):u=o.consumer(),this.map.applySourceMap(u,s,this.toUrl(this.path(a)))}},t.clearAnnotation=function(){if(this.mapOpts.annotation!==!1)if(this.root)for(var e,i=this.root.nodes.length-1;i>=0;i--)e=this.root.nodes[i],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(i);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))},t.generate=function(){if(this.clearAnnotation(),lf&&uf&&this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(i){e+=i}),[e]},t.generateMap=function(){if(this.root)this.generateString();else if(this.previous().length===1){var e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=er.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new er({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},t.generateString=function(){var e=this;this.css="",this.map=new er({file:this.outputFile(),ignoreInvalidMapping:!0});var i=1,o=1,s="<no source>",a={generated:{column:0,line:0},original:{column:0,line:0},source:""},u,c;this.stringify(this.root,function(d,h,p){if(e.css+=d,h&&p!=="end"&&(a.generated.line=i,a.generated.column=o-1,h.source&&h.source.start?(a.source=e.sourcePath(h),a.original.line=h.source.start.line,a.original.column=h.source.start.column-1,e.map.addMapping(a)):(a.source=s,a.original.line=1,a.original.column=0,e.map.addMapping(a))),u=d.match(/\n/g),u?(i+=u.length,c=d.lastIndexOf(`
752
+ `),o=d.length-c):o+=d.length,h&&p!=="start"){var y=h.parent||{raws:{}},w=h.type==="decl"||h.type==="atrule"&&!h.nodes;(!w||h!==y.last||y.raws.semicolon)&&(h.source&&h.source.end?(a.source=e.sourcePath(h),a.original.line=h.source.end.line,a.original.column=h.source.end.column-1,a.generated.line=i,a.generated.column=o-2,e.map.addMapping(a)):(a.source=s,a.original.line=1,a.original.column=0,a.generated.line=i,a.generated.column=o-1,e.map.addMapping(a)))}})},t.isAnnotation=function(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(function(e){return e.annotation}):!0},t.isInline=function(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;var e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(function(i){return i.inline}):!0},t.isMap=function(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0},t.isSourcesContent=function(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(function(e){return e.withContent()}):!0},t.outputFile=function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"},t.path=function(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;var i=this.memoizedPaths.get(e);if(i)return i;var o=this.opts.to?nr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(o=nr(pu(o,this.mapOpts.annotation)));var s=fu(o,e);return this.memoizedPaths.set(e,s),s},t.previous=function(){var e=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(o){if(o.source&&o.source.input.map){var s=o.source.input.map;e.previousMaps.includes(s)||e.previousMaps.push(s)}});else{var i=new af(this.originalCSS,this.opts);i.map&&this.previousMaps.push(i.map)}return this.previousMaps},t.setSourcesContent=function(){var e=this,i={};if(this.root)this.root.walk(function(s){if(s.source){var a=s.source.input.from;if(a&&!i[a]){i[a]=!0;var u=e.usesFileUrls?e.toFileUrl(a):e.toUrl(e.path(a));e.map.setSourceContent(u,s.source.input.css)}}});else if(this.css){var o=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(o,this.css)}},t.sourcePath=function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))},t.toBase64=function(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},t.toFileUrl=function(e){var i=this.memoizedFileURLs.get(e);if(i)return i;if(bu){var o=bu(e).toString();return this.memoizedFileURLs.set(e,o),o}else throw new Error("`map.absolute` option is not available in this PostCSS build")},t.toUrl=function(e){var i=this.memoizedURLs.get(e);if(i)return i;vu==="\\"&&(e=e.replace(/\\/g,"/"));var o=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,o),o},n}(),gu=cf,df=Zi,No=function(n){$e(t,n);function t(r){var e;return e=n.call(this,r)||this,e.type="comment",e}return t}(df),tr=No;No.default=No;var yu=Jn.isClean,wu=Jn.my,Cu=Ji,Su=tr,hf=Zi,ku,Bo,Do,_u;function Au(n){return n.map(function(t){return t.nodes&&(t.nodes=Au(t.nodes)),delete t.source,t})}function xu(n){if(n[yu]=!1,n.proxyOf.nodes)for(var t=D(n.proxyOf.nodes),r;!(r=t()).done;){var e=r.value;xu(e)}}var On=function(n){$e(t,n);function t(){return n.apply(this,arguments)||this}var r=t.prototype;return r.append=function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];for(var a=D(o),u;!(u=a()).done;)for(var c=u.value,d=this.normalize(c,this.last),h=D(d),p;!(p=h()).done;){var y=p.value;this.proxyOf.nodes.push(y)}return this.markDirty(),this},r.cleanRaws=function(i){if(n.prototype.cleanRaws.call(this,i),this.nodes)for(var o=D(this.nodes),s;!(s=o()).done;){var a=s.value;a.cleanRaws(i)}},r.each=function(i){if(this.proxyOf.nodes){for(var o=this.getIterator(),s,a;this.indexes[o]<this.proxyOf.nodes.length&&(s=this.indexes[o],a=i(this.proxyOf.nodes[s],s),a!==!1);)this.indexes[o]+=1;return delete this.indexes[o],a}},r.every=function(i){return this.nodes.every(i)},r.getIterator=function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var i=this.lastEach;return this.indexes[i]=0,i},r.getProxyProcessor=function(){return{get:function(o,s){return s==="proxyOf"?o:o[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];var d;return(d=o)[s].apply(d,[].concat(u.map(function(h){return typeof h=="function"?function(p,y){return h(p.toProxy(),y)}:h})))}:s==="every"||s==="some"?function(a){return o[s](function(u){for(var c=arguments.length,d=new Array(c>1?c-1:0),h=1;h<c;h++)d[h-1]=arguments[h];return a.apply(void 0,[].concat([u.toProxy()],d))})}:s==="root"?function(){return o.root().toProxy()}:s==="nodes"?o.nodes.map(function(a){return a.toProxy()}):s==="first"||s==="last"?o[s].toProxy():o[s]:o[s]},set:function(o,s,a){return o[s]===a||(o[s]=a,(s==="name"||s==="params"||s==="selector")&&o.markDirty()),!0}}},r.index=function(i){return typeof i=="number"?i:(i.proxyOf&&(i=i.proxyOf),this.proxyOf.nodes.indexOf(i))},r.insertAfter=function(i,o){var s=this.index(i),a=this.normalize(o,this.proxyOf.nodes[s]).reverse();s=this.index(i);for(var u=D(a),c;!(c=u()).done;){var d=c.value;this.proxyOf.nodes.splice(s+1,0,d)}var h;for(var p in this.indexes)h=this.indexes[p],s<h&&(this.indexes[p]=h+a.length);return this.markDirty(),this},r.insertBefore=function(i,o){var s=this.index(i),a=s===0?"prepend":!1,u=this.normalize(o,this.proxyOf.nodes[s],a).reverse();s=this.index(i);for(var c=D(u),d;!(d=c()).done;){var h=d.value;this.proxyOf.nodes.splice(s,0,h)}var p;for(var y in this.indexes)p=this.indexes[y],s<=p&&(this.indexes[y]=p+u.length);return this.markDirty(),this},r.normalize=function(i,o){var s=this;if(typeof i=="string")i=Au(ku(i).nodes);else if(typeof i>"u")i=[];else if(Array.isArray(i)){i=i.slice(0);for(var a=D(i),u;!(u=a()).done;){var c=u.value;c.parent&&c.parent.removeChild(c,"ignore")}}else if(i.type==="root"&&this.type!=="document"){i=i.nodes.slice(0);for(var d=D(i),h;!(h=d()).done;){var p=h.value;p.parent&&p.parent.removeChild(p,"ignore")}}else if(i.type)i=[i];else if(i.prop){if(typeof i.value>"u")throw new Error("Value field is missed in node creation");typeof i.value!="string"&&(i.value=String(i.value)),i=[new Cu(i)]}else if(i.selector)i=[new Bo(i)];else if(i.name)i=[new Do(i)];else if(i.text)i=[new Su(i)];else throw new Error("Unknown node type in node creation");var y=i.map(function(w){return w[wu]||t.rebuild(w),w=w.proxyOf,w.parent&&w.parent.removeChild(w),w[yu]&&xu(w),typeof w.raws.before>"u"&&o&&typeof o.raws.before<"u"&&(w.raws.before=o.raws.before.replace(/\S/g,"")),w.parent=s.proxyOf,w});return y},r.prepend=function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];o=o.reverse();for(var a=D(o),u;!(u=a()).done;){for(var c=u.value,d=this.normalize(c,this.first,"prepend").reverse(),h=D(d),p;!(p=h()).done;){var y=p.value;this.proxyOf.nodes.unshift(y)}for(var w in this.indexes)this.indexes[w]=this.indexes[w]+d.length}return this.markDirty(),this},r.push=function(i){return i.parent=this,this.proxyOf.nodes.push(i),this},r.removeAll=function(){for(var i=D(this.proxyOf.nodes),o;!(o=i()).done;){var s=o.value;s.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},r.removeChild=function(i){i=this.index(i),this.proxyOf.nodes[i].parent=void 0,this.proxyOf.nodes.splice(i,1);var o;for(var s in this.indexes)o=this.indexes[s],o>=i&&(this.indexes[s]=o-1);return this.markDirty(),this},r.replaceValues=function(i,o,s){return s||(s=o,o={}),this.walkDecls(function(a){o.props&&!o.props.includes(a.prop)||o.fast&&!a.value.includes(o.fast)||(a.value=a.value.replace(i,s))}),this.markDirty(),this},r.some=function(i){return this.nodes.some(i)},r.walk=function(i){return this.each(function(o,s){var a;try{a=i(o,s)}catch(u){throw o.addToError(u)}return a!==!1&&o.walk&&(a=o.walk(i)),a})},r.walkAtRules=function(i,o){return o?J(i,RegExp)?this.walk(function(s,a){if(s.type==="atrule"&&i.test(s.name))return o(s,a)}):this.walk(function(s,a){if(s.type==="atrule"&&s.name===i)return o(s,a)}):(o=i,this.walk(function(s,a){if(s.type==="atrule")return o(s,a)}))},r.walkComments=function(i){return this.walk(function(o,s){if(o.type==="comment")return i(o,s)})},r.walkDecls=function(i,o){return o?J(i,RegExp)?this.walk(function(s,a){if(s.type==="decl"&&i.test(s.prop))return o(s,a)}):this.walk(function(s,a){if(s.type==="decl"&&s.prop===i)return o(s,a)}):(o=i,this.walk(function(s,a){if(s.type==="decl")return o(s,a)}))},r.walkRules=function(i,o){return o?J(i,RegExp)?this.walk(function(s,a){if(s.type==="rule"&&i.test(s.selector))return o(s,a)}):this.walk(function(s,a){if(s.type==="rule"&&s.selector===i)return o(s,a)}):(o=i,this.walk(function(s,a){if(s.type==="rule")return o(s,a)}))},Ke(t,[{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),t}(hf);On.registerParse=function(n){ku=n},On.registerRule=function(n){Bo=n},On.registerAtRule=function(n){Do=n},On.registerRoot=function(n){_u=n};var ft=On;On.default=On,On.rebuild=function(n){n.type==="atrule"?Object.setPrototypeOf(n,Do.prototype):n.type==="rule"?Object.setPrototypeOf(n,Bo.prototype):n.type==="decl"?Object.setPrototypeOf(n,Cu.prototype):n.type==="comment"?Object.setPrototypeOf(n,Su.prototype):n.type==="root"&&Object.setPrototypeOf(n,_u.prototype),n[wu]=!0,n.nodes&&n.nodes.forEach(function(t){On.rebuild(t)})};var mf=ft,Mu,Eu,si=function(n){$e(t,n);function t(e){var i;return i=n.call(this,re({type:"document"},e))||this,i.nodes||(i.nodes=[]),i}var r=t.prototype;return r.toResult=function(i){i===void 0&&(i={});var o=new Mu(new Eu,this,i);return o.stringify()},t}(mf);si.registerLazyResult=function(n){Mu=n},si.registerProcessor=function(n){Eu=n};var Ho=si;si.default=si;var Lu={},Tu=function(t){Lu[t]||(Lu[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},Uo=function(){function n(r,e){if(e===void 0&&(e={}),this.type="warning",this.text=r,e.node&&e.node.source){var i=e.node.rangeBy(e);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(var o in e)this[o]=e[o]}var t=n.prototype;return t.toString=function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},n}(),Iu=Uo;Uo.default=Uo;var ff=Iu,Fo=function(){function n(r,e,i){this.processor=r,this.messages=[],this.root=e,this.opts=i,this.css=void 0,this.map=void 0}var t=n.prototype;return t.toString=function(){return this.css},t.warn=function(e,i){i===void 0&&(i={}),i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);var o=new ff(e,i);return this.messages.push(o),o},t.warnings=function(){return this.messages.filter(function(e){return e.type==="warning"})},Ke(n,[{key:"content",get:function(){return this.css}}]),n}(),Go=Fo;Fo.default=Fo;var Ko=39,Pu=34,ir=92,Ru=47,rr=10,ai=32,or=12,sr=9,ar=13,pf=91,vf=93,bf=40,gf=41,yf=123,wf=125,Cf=59,Sf=42,kf=58,_f=64,ur=/[\t\n\f\r "#'()/;[\\\]{}]/g,lr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Af=/.[\r\n"'(/\\]/,Ou=/[\da-f]/i,xf=function(t,r){r===void 0&&(r={});var e=t.css.valueOf(),i=r.ignoreErrors,o,s,a,u,c,d,h,p,y,w,k=e.length,b=0,S=[],A=[];function x(){return b}function E(N){throw t.error("Unclosed "+N,b)}function L(){return A.length===0&&b>=k}function P(N){if(A.length)return A.pop();if(!(b>=k)){var F=N?N.ignoreUnclosed:!1;switch(o=e.charCodeAt(b),o){case rr:case ai:case sr:case ar:case or:{s=b;do s+=1,o=e.charCodeAt(s);while(o===ai||o===rr||o===sr||o===ar||o===or);w=["space",e.slice(b,s)],b=s-1;break}case pf:case vf:case yf:case wf:case kf:case Cf:case gf:{var z=String.fromCharCode(o);w=[z,z,b];break}case bf:{if(p=S.length?S.pop()[1]:"",y=e.charCodeAt(b+1),p==="url"&&y!==Ko&&y!==Pu&&y!==ai&&y!==rr&&y!==sr&&y!==or&&y!==ar){s=b;do{if(d=!1,s=e.indexOf(")",s+1),s===-1)if(i||F){s=b;break}else E("bracket");for(h=s;e.charCodeAt(h-1)===ir;)h-=1,d=!d}while(d);w=["brackets",e.slice(b,s+1),b,s],b=s}else s=e.indexOf(")",b+1),u=e.slice(b,s+1),s===-1||Af.test(u)?w=["(","(",b]:(w=["brackets",u,b,s],b=s);break}case Ko:case Pu:{a=o===Ko?"'":'"',s=b;do{if(d=!1,s=e.indexOf(a,s+1),s===-1)if(i||F){s=b+1;break}else E("string");for(h=s;e.charCodeAt(h-1)===ir;)h-=1,d=!d}while(d);w=["string",e.slice(b,s+1),b,s],b=s;break}case _f:{ur.lastIndex=b+1,ur.test(e),ur.lastIndex===0?s=e.length-1:s=ur.lastIndex-2,w=["at-word",e.slice(b,s+1),b,s],b=s;break}case ir:{for(s=b,c=!0;e.charCodeAt(s+1)===ir;)s+=1,c=!c;if(o=e.charCodeAt(s+1),c&&o!==Ru&&o!==ai&&o!==rr&&o!==sr&&o!==ar&&o!==or&&(s+=1,Ou.test(e.charAt(s)))){for(;Ou.test(e.charAt(s+1));)s+=1;e.charCodeAt(s+1)===ai&&(s+=1)}w=["word",e.slice(b,s+1),b,s],b=s;break}default:{o===Ru&&e.charCodeAt(b+1)===Sf?(s=e.indexOf("*/",b+2)+1,s===0&&(i||F?s=e.length:E("comment")),w=["comment",e.slice(b,s+1),b,s],b=s):(lr.lastIndex=b+1,lr.test(e),lr.lastIndex===0?s=e.length-1:s=lr.lastIndex-2,w=["word",e.slice(b,s+1),b,s],S.push(w),b=s);break}}return b++,w}}function H(N){A.push(N)}return{back:H,endOfFile:L,nextToken:P,position:x}},Nu=ft,cr=function(n){$e(t,n);function t(e){var i;return i=n.call(this,e)||this,i.type="atrule",i}var r=t.prototype;return r.append=function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var a;return this.proxyOf.nodes||(this.nodes=[]),(a=n.prototype.append).call.apply(a,[].concat([this],o))},r.prepend=function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var a;return this.proxyOf.nodes||(this.nodes=[]),(a=n.prototype.prepend).call.apply(a,[].concat([this],o))},t}(Nu),jo=cr;cr.default=cr,Nu.registerAtRule(cr);var Bu=ft,Du,Hu,It=function(n){$e(t,n);function t(e){var i;return i=n.call(this,e)||this,i.type="root",i.nodes||(i.nodes=[]),i}var r=t.prototype;return r.normalize=function(i,o,s){var a=n.prototype.normalize.call(this,i);if(o){if(s==="prepend")this.nodes.length>1?o.raws.before=this.nodes[1].raws.before:delete o.raws.before;else if(this.first!==o)for(var u=D(a),c;!(c=u()).done;){var d=c.value;d.raws.before=o.raws.before}}return a},r.removeChild=function(i,o){var s=this.index(i);return!o&&s===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),n.prototype.removeChild.call(this,i)},r.toResult=function(i){i===void 0&&(i={});var o=new Du(new Hu,this,i);return o.stringify()},t}(Bu);It.registerLazyResult=function(n){Du=n},It.registerProcessor=function(n){Hu=n};var ui=It;It.default=It,Bu.registerRoot(It);var li={comma:function(t){return li.split(t,[","],!0)},space:function(t){var r=[" ",`
753
+ `," "];return li.split(t,r)},split:function(t,r,e){for(var i=[],o="",s=!1,a=0,u=!1,c="",d=!1,h=D(t),p;!(p=h()).done;){var y=p.value;d?d=!1:y==="\\"?d=!0:u?y===c&&(u=!1):y==='"'||y==="'"?(u=!0,c=y):y==="("?a+=1:y===")"?a>0&&(a-=1):a===0&&r.includes(y)&&(s=!0),s?(o!==""&&i.push(o.trim()),o="",s=!1):o+=y}return(e||o!=="")&&i.push(o.trim()),i}},Uu=li;li.default=li;var Fu=ft,Mf=Uu,dr=function(n){$e(t,n);function t(r){var e;return e=n.call(this,r)||this,e.type="rule",e.nodes||(e.nodes=[]),e}return Ke(t,[{key:"selectors",get:function(){return Mf.comma(this.selector)},set:function(e){var i=this.selector?this.selector.match(/,\s*/):null,o=i?i[0]:","+this.raw("between","beforeOpen");this.selector=e.join(o)}}]),t}(Fu),Vo=dr;dr.default=dr,Fu.registerRule(dr);var Ef=Ji,Lf=xf,Tf=tr,If=jo,Pf=ui,Gu=Vo,Ku={empty:!0,space:!0};function Rf(n){for(var t=n.length-1;t>=0;t--){var r=n[t],e=r[3]||r[2];if(e)return e}}var Of=function(){function n(r){this.input=r,this.root=new Pf,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:r,start:{column:1,line:1,offset:0}}}var t=n.prototype;return t.atrule=function(e){var i=new If;i.name=e[1].slice(1),i.name===""&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o,s,a,u=!1,c=!1,d=[],h=[];!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),o=e[0],o==="("||o==="["?h.push(o==="("?")":"]"):o==="{"&&h.length>0?h.push("}"):o===h[h.length-1]&&h.pop(),h.length===0)if(o===";"){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}else if(o==="{"){c=!0;break}else if(o==="}"){if(d.length>0){for(a=d.length-1,s=d[a];s&&s[0]==="space";)s=d[--a];s&&(i.source.end=this.getPosition(s[3]||s[2]),i.source.end.offset++)}this.end(e);break}else d.push(e);else d.push(e);if(this.tokenizer.endOfFile()){u=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(d),d.length?(i.raws.afterName=this.spacesAndCommentsFromStart(d),this.raw(i,"params",d),u&&(e=d[d.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),c&&(i.nodes=[],this.current=i)},t.checkMissedSemicolon=function(e){var i=this.colon(e);if(i!==!1){for(var o=0,s,a=i-1;a>=0&&(s=e[a],!(s[0]!=="space"&&(o+=1,o===2)));a--);throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}},t.colon=function(e){for(var i=0,o,s,a,u=D(e.entries()),c;!(c=u()).done;){var d=c.value,h=d[0],p=d[1];if(o=p,s=o[0],s==="("&&(i+=1),s===")"&&(i-=1),i===0&&s===":")if(!a)this.doubleColon(o);else{if(a[0]==="word"&&a[1]==="progid")continue;return h}a=o}return!1},t.comment=function(e){var i=new Tf;this.init(i,e[2]),i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++;var o=e[1].slice(2,-2);if(/^\s*$/.test(o))i.text="",i.raws.left=o,i.raws.right="";else{var s=o.match(/^(\s*)([^]*\S)(\s*)$/);i.text=s[2],i.raws.left=s[1],i.raws.right=s[3]}},t.createTokenizer=function(){this.tokenizer=Lf(this.input)},t.decl=function(e,i){var o=new Ef;this.init(o,e[0][2]);var s=e[e.length-1];for(s[0]===";"&&(this.semicolon=!0,e.pop()),o.source.end=this.getPosition(s[3]||s[2]||Rf(e)),o.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),o.raws.before+=e.shift()[1];for(o.source.start=this.getPosition(e[0][2]),o.prop="";e.length;){var a=e[0][0];if(a===":"||a==="space"||a==="comment")break;o.prop+=e.shift()[1]}o.raws.between="";for(var u;e.length;)if(u=e.shift(),u[0]===":"){o.raws.between+=u[1];break}else u[0]==="word"&&/\w/.test(u[1])&&this.unknownWord([u]),o.raws.between+=u[1];(o.prop[0]==="_"||o.prop[0]==="*")&&(o.raws.before+=o.prop[0],o.prop=o.prop.slice(1));for(var c=[],d;e.length&&(d=e[0][0],!(d!=="space"&&d!=="comment"));)c.push(e.shift());this.precheckMissedSemicolon(e);for(var h=e.length-1;h>=0;h--){if(u=e[h],u[1].toLowerCase()==="!important"){o.important=!0;var p=this.stringFrom(e,h);p=this.spacesFromEnd(e)+p,p!==" !important"&&(o.raws.important=p);break}else if(u[1].toLowerCase()==="important"){for(var y=e.slice(0),w="",k=h;k>0;k--){var b=y[k][0];if(w.trim().indexOf("!")===0&&b!=="space")break;w=y.pop()[1]+w}w.trim().indexOf("!")===0&&(o.important=!0,o.raws.important=w,e=y)}if(u[0]!=="space"&&u[0]!=="comment")break}var S=e.some(function(A){return A[0]!=="space"&&A[0]!=="comment"});S&&(o.raws.between+=c.map(function(A){return A[1]}).join(""),c=[]),this.raw(o,"value",c.concat(e),i),o.value.includes(":")&&!i&&this.checkMissedSemicolon(e)},t.doubleColon=function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})},t.emptyRule=function(e){var i=new Gu;this.init(i,e[2]),i.selector="",i.raws.between="",this.current=i},t.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)},t.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},t.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var i=this.current.nodes[this.current.nodes.length-1];i&&i.type==="rule"&&!i.raws.ownSemicolon&&(i.raws.ownSemicolon=this.spaces,this.spaces="")}},t.getPosition=function(e){var i=this.input.fromOffset(e);return{column:i.col,line:i.line,offset:e}},t.init=function(e,i){this.current.push(e),e.source={input:this.input,start:this.getPosition(i)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)},t.other=function(e){for(var i=!1,o=null,s=!1,a=null,u=[],c=e[1].startsWith("--"),d=[],h=e;h;){if(o=h[0],d.push(h),o==="("||o==="[")a||(a=h),u.push(o==="("?")":"]");else if(c&&s&&o==="{")a||(a=h),u.push("}");else if(u.length===0)if(o===";")if(s){this.decl(d,c);return}else break;else if(o==="{"){this.rule(d);return}else if(o==="}"){this.tokenizer.back(d.pop()),i=!0;break}else o===":"&&(s=!0);else o===u[u.length-1]&&(u.pop(),u.length===0&&(a=null));h=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(i=!0),u.length>0&&this.unclosedBracket(a),i&&s){if(!c)for(;d.length&&(h=d[d.length-1][0],!(h!=="space"&&h!=="comment"));)this.tokenizer.back(d.pop());this.decl(d,c)}else this.unknownWord(d)},t.parse=function(){for(var e;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()},t.precheckMissedSemicolon=function(){},t.raw=function(e,i,o,s){for(var a,u,c=o.length,d="",h=!0,p,y,w=0;w<c;w+=1)a=o[w],u=a[0],u==="space"&&w===c-1&&!s?h=!1:u==="comment"?(y=o[w-1]?o[w-1][0]:"empty",p=o[w+1]?o[w+1][0]:"empty",!Ku[y]&&!Ku[p]?d.slice(-1)===","?h=!1:d+=a[1]:h=!1):d+=a[1];if(!h){var k=o.reduce(function(b,S){return b+S[1]},"");e.raws[i]={raw:k,value:d}}e[i]=d},t.rule=function(e){e.pop();var i=new Gu;this.init(i,e[0][2]),i.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(i,"selector",e),this.current=i},t.spacesAndCommentsFromEnd=function(e){for(var i,o="";e.length&&(i=e[e.length-1][0],!(i!=="space"&&i!=="comment"));)o=e.pop()[1]+o;return o},t.spacesAndCommentsFromStart=function(e){for(var i,o="";e.length&&(i=e[0][0],!(i!=="space"&&i!=="comment"));)o+=e.shift()[1];return o},t.spacesFromEnd=function(e){for(var i,o="";e.length&&(i=e[e.length-1][0],i==="space");)o=e.pop()[1]+o;return o},t.stringFrom=function(e,i){for(var o="",s=i;s<e.length;s++)o+=e[s][1];return e.splice(i,e.length-i),o},t.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},t.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})},t.unexpectedClose=function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})},t.unknownWord=function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})},t.unnamedAtrule=function(e,i){throw this.input.error("At-rule without name",{offset:i[2]},{offset:i[2]+i[1].length})},n}(),Nf=Of,Bf=ft,Df=Nf,Hf=Qi;function hr(n,t){var r=new Hf(n,t),e=new Df(r);try{e.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
754
+ You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
755
+ You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
756
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return e.root}var zo=hr;hr.default=hr,Bf.registerParse(hr);var An=Jn.isClean,Uf=Jn.my,Ff=gu,Gf=Wi,Kf=ft,jf=Ho,Vf=Tu,ju=Go,zf=zo,$f=ui,Wf={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},qf={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Zf={Once:!0,postcssPlugin:!0,prepare:!0},Pt=0;function ci(n){return(typeof n>"u"?"undefined":Q(n))==="object"&&typeof n.then=="function"}function Vu(n){var t=!1,r=Wf[n.type];return n.type==="decl"?t=n.prop.toLowerCase():n.type==="atrule"&&(t=n.name.toLowerCase()),t&&n.append?[r,r+"-"+t,Pt,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:n.append?[r,Pt,r+"Exit"]:[r,r+"Exit"]}function zu(n){var t;return n.type==="document"?t=["Document",Pt,"DocumentExit"]:n.type==="root"?t=["Root",Pt,"RootExit"]:t=Vu(n),{eventIndex:0,events:t,iterator:0,node:n,visitorIndex:0,visitors:[]}}function $o(n){return n[An]=!1,n.nodes&&n.nodes.forEach(function(t){return $o(t)}),n}var Wo={},Rt=function(){function n(r,e,i){var o=this;this.stringified=!1,this.processed=!1;var s;if((typeof e>"u"?"undefined":Q(e))==="object"&&e!==null&&(e.type==="root"||e.type==="document"))s=$o(e);else if(J(e,n)||J(e,ju))s=$o(e.root),e.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=e.map);else{var a=zf;i.syntax&&(a=i.syntax.parse),i.parser&&(a=i.parser),a.parse&&(a=a.parse);try{s=a(e,i)}catch(u){this.processed=!0,this.error=u}s&&!s[Uf]&&Kf.rebuild(s)}this.result=new ju(r,s,i),this.helpers=re({},Wo,{postcss:Wo,result:this.result}),this.plugins=this.processor.plugins.map(function(u){return(typeof u>"u"?"undefined":Q(u))==="object"&&u.prepare?re({},u,u.prepare(o.result)):u})}var t=n.prototype;return t.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},t.handleError=function(e,i){var o=this.result.lastPlugin;try{if(i&&i.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=o.postcssPlugin,e.setMessage();else if(o.postcssVersion&&process.env.NODE_ENV!=="production"){var s=o.postcssPlugin,a=o.postcssVersion,u=this.result.processor.version,c=a.split("."),d=u.split(".");(c[0]!==d[0]||parseInt(c[1])>parseInt(d[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+u+", but "+s+" uses "+a+". Perhaps this is the source of the error below.")}}catch(h){console&&console.error&&console.error(h)}return e},t.prepareVisitors=function(){var e=this;this.listeners={};for(var i=function(d,h,p){e.listeners[h]||(e.listeners[h]=[]),e.listeners[h].push([d,p])},o=D(this.plugins),s;!(s=o()).done;){var a=s.value;if((typeof a>"u"?"undefined":Q(a))==="object")for(var u in a){if(!qf[u]&&/^[A-Z]/.test(u))throw new Error("Unknown event "+u+" in "+a.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!Zf[u])if(Q(a[u])==="object")for(var c in a[u])c==="*"?i(a,u,a[u][c]):i(a,u+"-"+c.toLowerCase(),a[u][c]);else typeof a[u]=="function"&&i(a,u,a[u])}}this.hasListener=Object.keys(this.listeners).length>0},t.runAsync=function(){var e=this;return co(function(){var i,o,s,a,u,c,d,h,p,y,w,k;return ti(this,function(b){switch(b.label){case 0:e.plugin=0,i=0,b.label=1;case 1:if(!(i<e.plugins.length))return[3,6];if(o=e.plugins[i],s=e.runOnRoot(o),!ci(s))return[3,5];b.label=2;case 2:return b.trys.push([2,4,,5]),[4,s];case 3:return b.sent(),[3,5];case 4:throw a=b.sent(),e.handleError(a);case 5:return i++,[3,1];case 6:if(e.prepareVisitors(),!e.hasListener)return[3,18];u=e.result.root,b.label=7;case 7:if(u[An])return[3,14];u[An]=!0,c=[zu(u)],b.label=8;case 8:if(!(c.length>0))return[3,13];if(d=e.visitTick(c),!ci(d))return[3,12];b.label=9;case 9:return b.trys.push([9,11,,12]),[4,d];case 10:return b.sent(),[3,12];case 11:throw h=b.sent(),p=c[c.length-1].node,e.handleError(h,p);case 12:return[3,8];case 13:return[3,7];case 14:if(!e.listeners.OnceExit)return[3,18];y=function(){var S,A,x,E,L;return ti(this,function(P){switch(P.label){case 0:S=k.value,A=S[0],x=S[1],e.result.lastPlugin=A,P.label=1;case 1:return P.trys.push([1,6,,7]),u.type!=="document"?[3,3]:(E=u.nodes.map(function(H){return x(H,e.helpers)}),[4,Promise.all(E)]);case 2:return P.sent(),[3,5];case 3:return[4,x(u,e.helpers)];case 4:P.sent(),P.label=5;case 5:return[3,7];case 6:throw L=P.sent(),e.handleError(L);case 7:return[2]}})},w=D(e.listeners.OnceExit),b.label=15;case 15:return(k=w()).done?[3,18]:[5,Ua(y())];case 16:b.sent(),b.label=17;case 17:return[3,15];case 18:return e.processed=!0,[2,e.stringify()]}})})()},t.runOnRoot=function(e){var i=this;this.result.lastPlugin=e;try{if((typeof e>"u"?"undefined":Q(e))==="object"&&e.Once){if(this.result.root.type==="document"){var o=this.result.root.nodes.map(function(s){return e.Once(s,i.helpers)});return ci(o[0])?Promise.all(o):o}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(s){throw this.handleError(s)}},t.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,i=Gf;e.syntax&&(i=e.syntax.stringify),e.stringifier&&(i=e.stringifier),i.stringify&&(i=i.stringify);var o=new Ff(i,this.result.root,this.result.opts),s=o.generate();return this.result.css=s[0],this.result.map=s[1],this.result},t.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e=D(this.plugins),i;!(i=e()).done;){var o=i.value,s=this.runOnRoot(o);if(ci(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var a=this.result.root;!a[An];)a[An]=!0,this.walkSync(a);if(this.listeners.OnceExit)if(a.type==="document")for(var u=D(a.nodes),c;!(c=u()).done;){var d=c.value;this.visitSync(this.listeners.OnceExit,d)}else this.visitSync(this.listeners.OnceExit,a)}return this.result},t.then=function(e,i){return process.env.NODE_ENV!=="production"&&("from"in this.opts||Vf("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,i)},t.toString=function(){return this.css},t.visitSync=function(e,i){for(var o=D(e),s;!(s=o()).done;){var a=s.value,u=a[0],c=a[1];this.result.lastPlugin=u;var d=void 0;try{d=c(i,this.helpers)}catch(h){throw this.handleError(h,i.proxyOf)}if(i.type!=="root"&&i.type!=="document"&&!i.parent)return!0;if(ci(d))throw this.getAsyncError()}},t.visitTick=function(e){var i=e[e.length-1],o=i.node,s=i.visitors;if(o.type!=="root"&&o.type!=="document"&&!o.parent){e.pop();return}if(s.length>0&&i.visitorIndex<s.length){var a=s[i.visitorIndex],u=a[0],c=a[1];i.visitorIndex+=1,i.visitorIndex===s.length&&(i.visitors=[],i.visitorIndex=0),this.result.lastPlugin=u;try{return c(o.toProxy(),this.helpers)}catch(w){throw this.handleError(w,o)}}if(i.iterator!==0){for(var d=i.iterator,h;h=o.nodes[o.indexes[d]];)if(o.indexes[d]+=1,!h[An]){h[An]=!0,e.push(zu(h));return}i.iterator=0,delete o.indexes[d]}for(var p=i.events;i.eventIndex<p.length;){var y=p[i.eventIndex];if(i.eventIndex+=1,y===Pt){o.nodes&&o.nodes.length&&(o[An]=!0,i.iterator=o.getIterator());return}else if(this.listeners[y]){i.visitors=this.listeners[y];return}}e.pop()},t.walkSync=function(e){var i=this;e[An]=!0;for(var o=Vu(e),s=D(o),a;!(a=s()).done;){var u=a.value;if(u===Pt)e.nodes&&e.each(function(d){d[An]||i.walkSync(d)});else{var c=this.listeners[u];if(c&&this.visitSync(c,e.toProxy()))return}}},t.warnings=function(){return this.sync().warnings()},Ke(n,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),n}();Rt.registerPostcss=function(n){Wo=n};var $u=Rt;Rt.default=Rt,$f.registerLazyResult(Rt),jf.registerLazyResult(Rt);var Jf=gu,Yf=Wi,Xf=Tu,Qf=zo,ep=Go,qo=function(){function n(r,e,i){e=e.toString(),this.stringified=!1,this._processor=r,this._css=e,this._opts=i,this._map=void 0;var o,s=Yf;this.result=new ep(this._processor,o,this._opts),this.result.css=e;var a=this;Object.defineProperty(this.result,"root",{get:function(){return a.root}});var u=new Jf(s,o,this._opts,e);if(u.isMap()){var c=u.generate(),d=c[0],h=c[1];d&&(this.result.css=d),h&&(this.result.map=h)}else u.clearAnnotation(),this.result.css=u.css}var t=n.prototype;return t.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.sync=function(){if(this.error)throw this.error;return this.result},t.then=function(e,i){return process.env.NODE_ENV!=="production"&&("from"in this._opts||Xf("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,i)},t.toString=function(){return this._css},t.warnings=function(){return[]},Ke(n,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,i=Qf;try{e=i(this._css,this._opts)}catch(o){this.error=o}if(this.error)throw this.error;return this._root=e,e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),n}(),np=qo;qo.default=qo;var tp=np,ip=$u,rp=Ho,op=ui,di=function(){function n(r){r===void 0&&(r=[]),this.version="8.4.38",this.plugins=this.normalize(r)}var t=n.prototype;return t.normalize=function(e){for(var i=[],o=D(e),s;!(s=o()).done;){var a=s.value;if(a.postcss===!0?a=a():a.postcss&&(a=a.postcss),(typeof a>"u"?"undefined":Q(a))==="object"&&Array.isArray(a.plugins))i=i.concat(a.plugins);else if((typeof a>"u"?"undefined":Q(a))==="object"&&a.postcssPlugin)i.push(a);else if(typeof a=="function")i.push(a);else if((typeof a>"u"?"undefined":Q(a))==="object"&&(a.parse||a.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(a+" is not a PostCSS plugin")}return i},t.process=function(e,i){return i===void 0&&(i={}),!this.plugins.length&&!i.parser&&!i.stringifier&&!i.syntax?new tp(this,e,i):new ip(this,e,i)},t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},n}(),sp=di;di.default=di,op.registerProcessor(di),rp.registerProcessor(di);var ap=Ji,up=lu,lp=tr,cp=jo,dp=Qi,hp=ui,mp=Vo;function hi(n,t){if(Array.isArray(n))return n.map(function(h){return hi(h)});var r=n.inputs,e=ei(n,["inputs"]);if(r){t=[];for(var i=D(r),o;!(o=i()).done;){var s=o.value,a=re({},s,{__proto__:dp.prototype});a.map&&(a.map=re({},a.map,{__proto__:up.prototype})),t.push(a)}}if(e.nodes&&(e.nodes=n.nodes.map(function(h){return hi(h,t)})),e.source){var u=e.source,c=u.inputId,d=ei(u,["inputId"]);e.source=d,c!=null&&(e.source.input=t[c])}if(e.type==="root")return new hp(e);if(e.type==="decl")return new ap(e);if(e.type==="rule")return new mp(e);if(e.type==="comment")return new lp(e);if(e.type==="atrule")return new cp(e);throw new Error("Unknown node type: "+n.type)}var fp=hi;hi.default=hi;var pp=ko,Wu=Ji,vp=$u,bp=ft,Zo=sp,gp=Wi,yp=fp,qu=Ho,wp=Iu,Zu=tr,Ju=jo,Cp=Go,Sp=Qi,kp=zo,_p=Uu,Yu=Vo,Xu=ui,Ap=Zi;function he(){for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Zo(t)}he.plugin=function(t,r){var e=!1;function i(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];console&&console.warn&&!e&&(e=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
757
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: 里面 postcss.plugin 被弃用. 迁移指南:
758
+ https://www.w3ctech.com/topic/2226`));var c=r.apply(void 0,[].concat(a));return c.postcssPlugin=t,c.postcssVersion=new Zo().version,c}var o;return Object.defineProperty(i,"postcss",{get:function(){return o||(o=i()),o}}),i.process=function(s,a,u){return he([i(u)]).process(s,a)},i},he.stringify=gp,he.parse=kp,he.fromJSON=yp,he.list=_p,he.comment=function(n){return new Zu(n)},he.atRule=function(n){return new Ju(n)},he.decl=function(n){return new Wu(n)},he.rule=function(n){return new Yu(n)},he.root=function(n){return new Xu(n)},he.document=function(n){return new qu(n)},he.CssSyntaxError=pp,he.Declaration=Wu,he.Container=bp,he.Processor=Zo,he.Document=qu,he.Comment=Zu,he.Warning=wp,he.AtRule=Ju,he.Result=Cp,he.Input=Sp,he.Rule=Yu,he.Root=Xu,he.Node=Ap,vp.registerPostcss(he);var xp=he;he.default=he;var ke=Bm(xp);ke.stringify,ke.fromJSON,ke.plugin,ke.parse,ke.list,ke.document,ke.comment,ke.atRule,ke.rule,ke.decl,ke.root,ke.CssSyntaxError,ke.Declaration,ke.Container,ke.Processor,ke.Document,ke.Comment,ke.Warning,ke.AtRule,ke.Result,ke.Input,ke.Rule,ke.Root,ke.Node;var Mp=Object.defineProperty,Ep=function(n,t,r){return t in n?Mp(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r},an=function(n,t,r){return Ep(n,(typeof t>"u"?"undefined":Q(t))!=="symbol"?t+"":t,r)};function Lp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Tp(n){if(n.__esModule)return n;var t=n.default;if(typeof t=="function"){var r=function e(){return J(this,e)?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(n).forEach(function(e){var i=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:function(){return n[e]}})}),r}var Jo={exports:{}},we=String,Qu=function(){return{isColorSupported:!1,reset:we,bold:we,dim:we,italic:we,underline:we,inverse:we,hidden:we,strikethrough:we,black:we,red:we,green:we,yellow:we,blue:we,magenta:we,cyan:we,white:we,gray:we,bgBlack:we,bgRed:we,bgGreen:we,bgYellow:we,bgBlue:we,bgMagenta:we,bgCyan:we,bgWhite:we}};Jo.exports=Qu(),Jo.exports.createColors=Qu;var Ip=Jo.exports,Pp={},Rp=Object.freeze(Object.defineProperty({__proto__:null,default:Pp},Symbol.toStringTag,{value:"Module"})),Le=Tp(Rp),el=Ip,nl=Le,Yo=function(n){$e(t,n);function t(e,i,o,s,a,u){var c;return c=n.call(this,e)||this,c.name="CssSyntaxError",c.reason=e,a&&(c.file=a),s&&(c.source=s),u&&(c.plugin=u),typeof i<"u"&&typeof o<"u"&&(typeof i=="number"?(c.line=i,c.column=o):(c.line=i.line,c.column=i.column,c.endLine=o.line,c.endColumn=o.column)),c.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(c,t),c}var r=t.prototype;return r.setMessage=function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason},r.showSourceCode=function(i){var o=this;if(!this.source)return"";var s=this.source;i==null&&(i=el.isColorSupported),nl&&i&&(s=nl(s));var a=s.split(/\r?\n/),u=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),d=String(c).length,h,p;if(i){var y=el.createColors(!0),w=y.bold,k=y.gray,b=y.red;h=function(S){return w(b(S))},p=function(S){return k(S)}}else h=p=function(S){return S};return a.slice(u,c).map(function(S,A){var x=u+1+A,E=" "+(" "+x).slice(-d)+" | ";if(x===o.line){var L=p(E.replace(/\d/g," "))+S.slice(0,o.column-1).replace(/[^\t]/g," ");return h(">")+p(E)+S+`
759
+ `+L+h("^")}return" "+p(E)+S}).join(`
760
+ `)},r.toString=function(){var i=this.showSourceCode();return i&&(i=`
761
+
762
+ `+i+`
763
+ `),this.name+": "+this.message+i},t}(ji(Error)),Xo=Yo;Yo.default=Yo;var Yn={};Yn.isClean=Symbol("isClean"),Yn.my=Symbol("my");var tl={after:`
764
+ `,beforeClose:`
765
+ `,beforeComment:`
766
+ `,beforeDecl:`
767
+ `,beforeOpen:" ",beforeRule:`
768
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Op(n){return n[0].toUpperCase()+n.slice(1)}var Qo=function(){function n(r){this.builder=r}var t=n.prototype;return t.atrule=function(e,i){var o="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?o+=e.raws.afterName:s&&(o+=" "),e.nodes)this.block(e,o+s);else{var a=(e.raws.between||"")+(i?";":"");this.builder(o+s+a,e)}},t.beforeAfter=function(e,i){var o;e.type==="decl"?o=this.raw(e,null,"beforeDecl"):e.type==="comment"?o=this.raw(e,null,"beforeComment"):i==="before"?o=this.raw(e,null,"beforeRule"):o=this.raw(e,null,"beforeClose");for(var s=e.parent,a=0;s&&s.type!=="root";)a+=1,s=s.parent;if(o.includes(`
769
+ `)){var u=this.raw(e,null,"indent");if(u.length)for(var c=0;c<a;c++)o+=u}return o},t.block=function(e,i){var o=this.raw(e,"between","beforeOpen");this.builder(i+o+"{",e,"start");var s;e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,"after")):s=this.raw(e,"after","emptyBody"),s&&this.builder(s),this.builder("}",e,"end")},t.body=function(e){for(var i=e.nodes.length-1;i>0&&e.nodes[i].type==="comment";)i-=1;for(var o=this.raw(e,"semicolon"),s=0;s<e.nodes.length;s++){var a=e.nodes[s],u=this.raw(a,"before");u&&this.builder(u),this.stringify(a,i!==s||o)}},t.comment=function(e){var i=this.raw(e,"left","commentLeft"),o=this.raw(e,"right","commentRight");this.builder("/*"+i+e.text+o+"*/",e)},t.decl=function(e,i){var o=this.raw(e,"between","colon"),s=e.prop+o+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),i&&(s+=";"),this.builder(s,e)},t.document=function(e){this.body(e)},t.raw=function(e,i,o){var s;if(o||(o=i),i&&(s=e.raws[i],typeof s<"u"))return s;var a=e.parent;if(o==="before"&&(!a||a.type==="root"&&a.first===e||a&&a.type==="document"))return"";if(!a)return tl[o];var u=e.root();if(u.rawCache||(u.rawCache={}),typeof u.rawCache[o]<"u")return u.rawCache[o];if(o==="before"||o==="after")return this.beforeAfter(e,o);var c="raw"+Op(o);return this[c]?s=this[c](u,e):u.walk(function(d){if(s=d.raws[i],typeof s<"u")return!1}),typeof s>"u"&&(s=tl[o]),u.rawCache[o]=s,s},t.rawBeforeClose=function(e){var i;return e.walk(function(o){if(o.nodes&&o.nodes.length>0&&typeof o.raws.after<"u")return i=o.raws.after,i.includes(`
770
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),i&&(i=i.replace(/\S/g,"")),i},t.rawBeforeComment=function(e,i){var o;return e.walkComments(function(s){if(typeof s.raws.before<"u")return o=s.raws.before,o.includes(`
771
+ `)&&(o=o.replace(/[^\n]+$/,"")),!1}),typeof o>"u"?o=this.raw(i,null,"beforeDecl"):o&&(o=o.replace(/\S/g,"")),o},t.rawBeforeDecl=function(e,i){var o;return e.walkDecls(function(s){if(typeof s.raws.before<"u")return o=s.raws.before,o.includes(`
772
+ `)&&(o=o.replace(/[^\n]+$/,"")),!1}),typeof o>"u"?o=this.raw(i,null,"beforeRule"):o&&(o=o.replace(/\S/g,"")),o},t.rawBeforeOpen=function(e){var i;return e.walk(function(o){if(o.type!=="decl"&&(i=o.raws.between,typeof i<"u"))return!1}),i},t.rawBeforeRule=function(e){var i;return e.walk(function(o){if(o.nodes&&(o.parent!==e||e.first!==o)&&typeof o.raws.before<"u")return i=o.raws.before,i.includes(`
773
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),i&&(i=i.replace(/\S/g,"")),i},t.rawColon=function(e){var i;return e.walkDecls(function(o){if(typeof o.raws.between<"u")return i=o.raws.between.replace(/[^\s:]/g,""),!1}),i},t.rawEmptyBody=function(e){var i;return e.walk(function(o){if(o.nodes&&o.nodes.length===0&&(i=o.raws.after,typeof i<"u"))return!1}),i},t.rawIndent=function(e){if(e.raws.indent)return e.raws.indent;var i;return e.walk(function(o){var s=o.parent;if(s&&s!==e&&s.parent&&s.parent===e&&typeof o.raws.before<"u"){var a=o.raws.before.split(`
774
+ `);return i=a[a.length-1],i=i.replace(/\S/g,""),!1}}),i},t.rawSemicolon=function(e){var i;return e.walk(function(o){if(o.nodes&&o.nodes.length&&o.last.type==="decl"&&(i=o.raws.semicolon,typeof i<"u"))return!1}),i},t.rawValue=function(e,i){var o=e[i],s=e.raws[i];return s&&s.value===o?s.raw:o},t.root=function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)},t.rule=function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")},t.stringify=function(e,i){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,i)},n}(),il=Qo;Qo.default=Qo;var Np=il;function es(n,t){var r=new Np(t);r.stringify(n)}var mr=es;es.default=es;var fr=Yn.isClean,Bp=Yn.my,Dp=Xo,Hp=il,Up=mr;function ns(n,t){var r=new n.constructor;for(var e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&e!=="proxyCache"){var i=n[e],o=typeof i>"u"?"undefined":Q(i);e==="parent"&&o==="object"?t&&(r[e]=t):e==="source"?r[e]=i:Array.isArray(i)?r[e]=i.map(function(s){return ns(s,r)}):(o==="object"&&i!==null&&(i=ns(i)),r[e]=i)}return r}var ts=function(){function n(r){r===void 0&&(r={}),this.raws={},this[fr]=!1,this[Bp]=!0;for(var e in r)if(e==="nodes"){this.nodes=[];for(var i=D(r[e]),o;!(o=i()).done;){var s=o.value;typeof s.clone=="function"?this.append(s.clone()):this.append(s)}}else this[e]=r[e]}var t=n.prototype;return t.addToError=function(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){var i=this.source;e.stack=e.stack.replace(/\n\s{4}at /,"$&"+i.input.from+":"+i.start.line+":"+i.start.column+"$&")}return e},t.after=function(e){return this.parent.insertAfter(this,e),this},t.assign=function(e){e===void 0&&(e={});for(var i in e)this[i]=e[i];return this},t.before=function(e){return this.parent.insertBefore(this,e),this},t.cleanRaws=function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between},t.clone=function(e){e===void 0&&(e={});var i=ns(this);for(var o in e)i[o]=e[o];return i},t.cloneAfter=function(e){e===void 0&&(e={});var i=this.clone(e);return this.parent.insertAfter(this,i),i},t.cloneBefore=function(e){e===void 0&&(e={});var i=this.clone(e);return this.parent.insertBefore(this,i),i},t.error=function(e,i){if(i===void 0&&(i={}),this.source){var o=this.rangeBy(i),s=o.end,a=o.start;return this.source.input.error(e,{column:a.column,line:a.line},{column:s.column,line:s.line},i)}return new Dp(e)},t.getProxyProcessor=function(){return{get:function(i,o){return o==="proxyOf"?i:o==="root"?function(){return i.root().toProxy()}:i[o]},set:function(i,o,s){return i[o]===s||(i[o]=s,(o==="prop"||o==="value"||o==="name"||o==="params"||o==="important"||o==="text")&&i.markDirty()),!0}}},t.markDirty=function(){if(this[fr]){this[fr]=!1;for(var e=this;e=e.parent;)e[fr]=!1}},t.next=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e+1]}},t.positionBy=function(e,i){var o=this.source.start;if(e.index)o=this.positionInside(e.index,i);else if(e.word){i=this.toString();var s=i.indexOf(e.word);s!==-1&&(o=this.positionInside(s,i))}return o},t.positionInside=function(e,i){for(var o=i||this.toString(),s=this.source.start.column,a=this.source.start.line,u=0;u<e;u++)o[u]===`
775
+ `?(s=1,a+=1):s+=1;return{column:s,line:a}},t.prev=function(){if(this.parent){var e=this.parent.index(this);return this.parent.nodes[e-1]}},t.rangeBy=function(e){var i={column:this.source.start.column,line:this.source.start.line},o=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:i.column+1,line:i.line};if(e.word){var s=this.toString(),a=s.indexOf(e.word);a!==-1&&(i=this.positionInside(a,s),o=this.positionInside(a+e.word.length,s))}else e.start?i={column:e.start.column,line:e.start.line}:e.index&&(i=this.positionInside(e.index)),e.end?o={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?o=this.positionInside(e.endIndex):e.index&&(o=this.positionInside(e.index+1));return(o.line<i.line||o.line===i.line&&o.column<=i.column)&&(o={column:i.column+1,line:i.line}),{end:o,start:i}},t.raw=function(e,i){var o=new Hp;return o.raw(this,e,i)},t.remove=function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this},t.replaceWith=function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];if(this.parent){for(var s=this,a=!1,u=D(i),c;!(c=u()).done;){var d=c.value;d===this?a=!0:a?(this.parent.insertAfter(s,d),s=d):this.parent.insertBefore(s,d)}a||this.remove()}return this},t.root=function(){for(var e=this;e.parent&&e.parent.type!=="document";)e=e.parent;return e},t.toJSON=function(e,i){var o={},s=i==null;i=i||new Map;var a=0;for(var u in this)if(Object.prototype.hasOwnProperty.call(this,u)&&!(u==="parent"||u==="proxyCache")){var c=this[u];if(Array.isArray(c))o[u]=c.map(function(h){return(typeof h>"u"?"undefined":Q(h))==="object"&&h.toJSON?h.toJSON(null,i):h});else if((typeof c>"u"?"undefined":Q(c))==="object"&&c.toJSON)o[u]=c.toJSON(null,i);else if(u==="source"){var d=i.get(c.input);d==null&&(d=a,i.set(c.input,a),a++),o[u]={end:c.end,inputId:d,start:c.start}}else o[u]=c}return s&&(o.inputs=[].concat(i.keys()).map(function(h){return h.toJSON()})),o},t.toProxy=function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache},t.toString=function(e){e===void 0&&(e=Up),e.stringify&&(e=e.stringify);var i="";return e(this,function(o){i+=o}),i},t.warn=function(e,i,o){var s={node:this};for(var a in o)s[a]=o[a];return e.warn(i,s)},Ke(n,[{key:"proxyOf",get:function(){return this}}]),n}(),pr=ts;ts.default=ts;var Fp=pr,is=function(n){$e(t,n);function t(r){var e;return r&&typeof r.value<"u"&&typeof r.value!="string"&&(r=re({},r,{value:String(r.value)})),e=n.call(this,r)||this,e.type="decl",e}return Ke(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||this.prop[0]==="$"}}]),t}(Fp),vr=is;is.default=is;var Gp="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Kp=function(n){n===void 0&&(n=21);for(var t="",r=n;r--;)t+=Gp[Math.random()*64|0];return t},jp={nanoid:Kp},rl=Le.SourceMapConsumer,ol=Le.SourceMapGenerator,Vp=Le.existsSync,zp=Le.readFileSync,rs=Le.dirname,$p=Le.join;function Wp(n){return Buffer?Buffer.from(n,"base64").toString():window.atob(n)}var os=function(){function n(r,e){if(e.map!==!1){this.loadAnnotation(r),this.inline=this.startWith(this.annotation,"data:");var i=e.map?e.map.prev:void 0,o=this.loadMap(e.from,i);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=rs(this.mapFile)),o&&(this.text=o)}}var t=n.prototype;return t.consumer=function(){return this.consumerCache||(this.consumerCache=new rl(this.text)),this.consumerCache},t.decodeInline=function(e){var i=/^data:application\/json;charset=utf-?8;base64,/,o=/^data:application\/json;base64,/,s=/^data:application\/json;charset=utf-?8,/,a=/^data:application\/json,/;if(s.test(e)||a.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(i.test(e)||o.test(e))return Wp(e.substr(RegExp.lastMatch.length));var u=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+u)},t.getAnnotationURL=function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()},t.isMap=function(e){return(typeof e>"u"?"undefined":Q(e))!=="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)},t.loadAnnotation=function(e){var i=e.match(/\/\*\s*# sourceMappingURL=/gm);if(i){var o=e.lastIndexOf(i.pop()),s=e.indexOf("*/",o);o>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(o,s)))}},t.loadFile=function(e){if(this.root=rs(e),Vp(e))return this.mapFile=e,zp(e,"utf-8").toString().trim()},t.loadMap=function(e,i){if(i===!1)return!1;if(i){if(typeof i=="string")return i;if(typeof i=="function"){var o=i(e);if(o){var s=this.loadFile(o);if(!s)throw new Error("Unable to load previous source map: "+o.toString());return s}}else{if(J(i,rl))return ol.fromSourceMap(i).toString();if(J(i,ol))return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){var a=this.annotation;return e&&(a=$p(rs(e),a)),this.loadFile(a)}}},t.startWith=function(e,i){return e?e.substr(0,i.length)===i:!1},t.withContent=function(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)},n}(),sl=os;os.default=os;var qp=Le.SourceMapConsumer,Zp=Le.SourceMapGenerator,al=Le.fileURLToPath,br=Le.pathToFileURL,ss=Le.isAbsolute,as=Le.resolve,Jp=jp.nanoid,us=Le,ul=Xo,Yp=sl,ls=Symbol("fromOffsetCache"),Xp=!!(qp&&Zp),ll=!!(as&&ss),gr=function(){function n(r,e){if(e===void 0&&(e={}),r===null||typeof r>"u"||(typeof r>"u"?"undefined":Q(r))==="object"&&!r.toString)throw new Error("PostCSS received "+r+" instead of CSS string");if(this.css=r.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,e.from&&(!ll||/^\w+:\/\//.test(e.from)||ss(e.from)?this.file=e.from:this.file=as(e.from)),ll&&Xp){var i=new Yp(this.css,e);if(i.text){this.map=i;var o=i.consumer().file;!this.file&&o&&(this.file=this.mapResolve(o))}}this.file||(this.id="<input css "+Jp(6)+">"),this.map&&(this.map.file=this.from)}var t=n.prototype;return t.error=function(e,i,o,s){s===void 0&&(s={});var a,u,c;if(i&&(typeof i>"u"?"undefined":Q(i))==="object"){var d=i,h=o;if(typeof d.offset=="number"){var p=this.fromOffset(d.offset);i=p.line,o=p.col}else i=d.line,o=d.column;if(typeof h.offset=="number"){var y=this.fromOffset(h.offset);u=y.line,c=y.col}else u=h.line,c=h.column}else if(!o){var w=this.fromOffset(i);i=w.line,o=w.col}var k=this.origin(i,o,u,c);return k?a=new ul(e,k.endLine===void 0?k.line:{column:k.column,line:k.line},k.endLine===void 0?k.column:{column:k.endColumn,line:k.endLine},k.source,k.file,s.plugin):a=new ul(e,u===void 0?i:{column:o,line:i},u===void 0?o:{column:c,line:u},this.css,this.file,s.plugin),a.input={column:o,endColumn:c,endLine:u,line:i,source:this.css},this.file&&(br&&(a.input.url=br(this.file).toString()),a.input.file=this.file),a},t.fromOffset=function(e){var i,o;if(this[ls])o=this[ls];else{var s=this.css.split(`
776
+ `);o=new Array(s.length);for(var a=0,u=0,c=s.length;u<c;u++)o[u]=a,a+=s[u].length+1;this[ls]=o}i=o[o.length-1];var d=0;if(e>=i)d=o.length-1;else for(var h=o.length-2,p;d<h;)if(p=d+(h-d>>1),e<o[p])h=p-1;else if(e>=o[p+1])d=p+1;else{d=p;break}return{col:e-o[d]+1,line:d+1}},t.mapResolve=function(e){return/^\w+:\/\//.test(e)?e:as(this.map.consumer().sourceRoot||this.map.root||".",e)},t.origin=function(e,i,o,s){if(!this.map)return!1;var a=this.map.consumer(),u=a.originalPositionFor({column:i,line:e});if(!u.source)return!1;var c;typeof o=="number"&&(c=a.originalPositionFor({column:s,line:o}));var d;ss(u.source)?d=br(u.source):d=new URL(u.source,this.map.consumer().sourceRoot||br(this.map.mapFile));var h={column:u.column,endColumn:c&&c.column,endLine:c&&c.line,line:u.line,url:d.toString()};if(d.protocol==="file:")if(al)h.file=al(d);else throw new Error("file: protocol is not available in this PostCSS build");var p=a.sourceContentFor(u.source);return p&&(h.source=p),h},t.toJSON=function(){for(var e={},i=0,o=["hasBOM","css","file","id"];i<o.length;i++){var s=o[i];this[s]!=null&&(e[s]=this[s])}return this.map&&(e.map=re({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e},Ke(n,[{key:"from",get:function(){return this.file||this.id}}]),n}(),yr=gr;gr.default=gr,us&&us.registerInput&&us.registerInput(gr);var cl=Le.SourceMapConsumer,wr=Le.SourceMapGenerator,Cr=Le.dirname,dl=Le.relative,hl=Le.resolve,ml=Le.sep,fl=Le.pathToFileURL,Qp=yr,ev=!!(cl&&wr),nv=!!(Cr&&hl&&dl&&ml),tv=function(){function n(r,e,i,o){this.stringify=r,this.mapOpts=i.map||{},this.root=e,this.opts=i,this.css=o,this.originalCSS=o,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}var t=n.prototype;return t.addAnnotation=function(){var e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";var i=`
777
+ `;this.css.includes(`\r
778
+ `)&&(i=`\r
779
+ `),this.css+=i+"/*# sourceMappingURL="+e+" */"},t.applyPrevMaps=function(){for(var e=D(this.previous()),i;!(i=e()).done;){var o=i.value,s=this.toUrl(this.path(o.file)),a=o.root||Cr(o.file),u=void 0;this.mapOpts.sourcesContent===!1?(u=new cl(o.text),u.sourcesContent&&(u.sourcesContent=null)):u=o.consumer(),this.map.applySourceMap(u,s,this.toUrl(this.path(a)))}},t.clearAnnotation=function(){if(this.mapOpts.annotation!==!1)if(this.root)for(var e,i=this.root.nodes.length-1;i>=0;i--)e=this.root.nodes[i],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(i);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))},t.generate=function(){if(this.clearAnnotation(),nv&&ev&&this.isMap())return this.generateMap();var e="";return this.stringify(this.root,function(i){e+=i}),[e]},t.generateMap=function(){if(this.root)this.generateString();else if(this.previous().length===1){var e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=wr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new wr({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]},t.generateString=function(){var e=this;this.css="",this.map=new wr({file:this.outputFile(),ignoreInvalidMapping:!0});var i=1,o=1,s="<no source>",a={generated:{column:0,line:0},original:{column:0,line:0},source:""},u,c;this.stringify(this.root,function(d,h,p){if(e.css+=d,h&&p!=="end"&&(a.generated.line=i,a.generated.column=o-1,h.source&&h.source.start?(a.source=e.sourcePath(h),a.original.line=h.source.start.line,a.original.column=h.source.start.column-1,e.map.addMapping(a)):(a.source=s,a.original.line=1,a.original.column=0,e.map.addMapping(a))),u=d.match(/\n/g),u?(i+=u.length,c=d.lastIndexOf(`
780
+ `),o=d.length-c):o+=d.length,h&&p!=="start"){var y=h.parent||{raws:{}},w=h.type==="decl"||h.type==="atrule"&&!h.nodes;(!w||h!==y.last||y.raws.semicolon)&&(h.source&&h.source.end?(a.source=e.sourcePath(h),a.original.line=h.source.end.line,a.original.column=h.source.end.column-1,a.generated.line=i,a.generated.column=o-2,e.map.addMapping(a)):(a.source=s,a.original.line=1,a.original.column=0,a.generated.line=i,a.generated.column=o-1,e.map.addMapping(a)))}})},t.isAnnotation=function(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(function(e){return e.annotation}):!0},t.isInline=function(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;var e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(function(i){return i.inline}):!0},t.isMap=function(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0},t.isSourcesContent=function(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(function(e){return e.withContent()}):!0},t.outputFile=function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"},t.path=function(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;var i=this.memoizedPaths.get(e);if(i)return i;var o=this.opts.to?Cr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(o=Cr(hl(o,this.mapOpts.annotation)));var s=dl(o,e);return this.memoizedPaths.set(e,s),s},t.previous=function(){var e=this;if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(function(o){if(o.source&&o.source.input.map){var s=o.source.input.map;e.previousMaps.includes(s)||e.previousMaps.push(s)}});else{var i=new Qp(this.originalCSS,this.opts);i.map&&this.previousMaps.push(i.map)}return this.previousMaps},t.setSourcesContent=function(){var e=this,i={};if(this.root)this.root.walk(function(s){if(s.source){var a=s.source.input.from;if(a&&!i[a]){i[a]=!0;var u=e.usesFileUrls?e.toFileUrl(a):e.toUrl(e.path(a));e.map.setSourceContent(u,s.source.input.css)}}});else if(this.css){var o=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(o,this.css)}},t.sourcePath=function(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))},t.toBase64=function(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))},t.toFileUrl=function(e){var i=this.memoizedFileURLs.get(e);if(i)return i;if(fl){var o=fl(e).toString();return this.memoizedFileURLs.set(e,o),o}else throw new Error("`map.absolute` option is not available in this PostCSS build")},t.toUrl=function(e){var i=this.memoizedURLs.get(e);if(i)return i;ml==="\\"&&(e=e.replace(/\\/g,"/"));var o=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,o),o},n}(),pl=tv,iv=pr,cs=function(n){$e(t,n);function t(r){var e;return e=n.call(this,r)||this,e.type="comment",e}return t}(iv),Sr=cs;cs.default=cs;var vl=Yn.isClean,bl=Yn.my,gl=vr,yl=Sr,rv=pr,wl,ds,hs,Cl;function Sl(n){return n.map(function(t){return t.nodes&&(t.nodes=Sl(t.nodes)),delete t.source,t})}function kl(n){if(n[vl]=!1,n.proxyOf.nodes)for(var t=D(n.proxyOf.nodes),r;!(r=t()).done;){var e=r.value;kl(e)}}var Nn=function(n){$e(t,n);function t(){return n.apply(this,arguments)||this}var r=t.prototype;return r.append=function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];for(var a=D(o),u;!(u=a()).done;)for(var c=u.value,d=this.normalize(c,this.last),h=D(d),p;!(p=h()).done;){var y=p.value;this.proxyOf.nodes.push(y)}return this.markDirty(),this},r.cleanRaws=function(i){if(n.prototype.cleanRaws.call(this,i),this.nodes)for(var o=D(this.nodes),s;!(s=o()).done;){var a=s.value;a.cleanRaws(i)}},r.each=function(i){if(this.proxyOf.nodes){for(var o=this.getIterator(),s,a;this.indexes[o]<this.proxyOf.nodes.length&&(s=this.indexes[o],a=i(this.proxyOf.nodes[s],s),a!==!1);)this.indexes[o]+=1;return delete this.indexes[o],a}},r.every=function(i){return this.nodes.every(i)},r.getIterator=function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var i=this.lastEach;return this.indexes[i]=0,i},r.getProxyProcessor=function(){return{get:function(o,s){return s==="proxyOf"?o:o[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];var d;return(d=o)[s].apply(d,[].concat(u.map(function(h){return typeof h=="function"?function(p,y){return h(p.toProxy(),y)}:h})))}:s==="every"||s==="some"?function(a){return o[s](function(u){for(var c=arguments.length,d=new Array(c>1?c-1:0),h=1;h<c;h++)d[h-1]=arguments[h];return a.apply(void 0,[].concat([u.toProxy()],d))})}:s==="root"?function(){return o.root().toProxy()}:s==="nodes"?o.nodes.map(function(a){return a.toProxy()}):s==="first"||s==="last"?o[s].toProxy():o[s]:o[s]},set:function(o,s,a){return o[s]===a||(o[s]=a,(s==="name"||s==="params"||s==="selector")&&o.markDirty()),!0}}},r.index=function(i){return typeof i=="number"?i:(i.proxyOf&&(i=i.proxyOf),this.proxyOf.nodes.indexOf(i))},r.insertAfter=function(i,o){var s=this.index(i),a=this.normalize(o,this.proxyOf.nodes[s]).reverse();s=this.index(i);for(var u=D(a),c;!(c=u()).done;){var d=c.value;this.proxyOf.nodes.splice(s+1,0,d)}var h;for(var p in this.indexes)h=this.indexes[p],s<h&&(this.indexes[p]=h+a.length);return this.markDirty(),this},r.insertBefore=function(i,o){var s=this.index(i),a=s===0?"prepend":!1,u=this.normalize(o,this.proxyOf.nodes[s],a).reverse();s=this.index(i);for(var c=D(u),d;!(d=c()).done;){var h=d.value;this.proxyOf.nodes.splice(s,0,h)}var p;for(var y in this.indexes)p=this.indexes[y],s<=p&&(this.indexes[y]=p+u.length);return this.markDirty(),this},r.normalize=function(i,o){var s=this;if(typeof i=="string")i=Sl(wl(i).nodes);else if(typeof i>"u")i=[];else if(Array.isArray(i)){i=i.slice(0);for(var a=D(i),u;!(u=a()).done;){var c=u.value;c.parent&&c.parent.removeChild(c,"ignore")}}else if(i.type==="root"&&this.type!=="document"){i=i.nodes.slice(0);for(var d=D(i),h;!(h=d()).done;){var p=h.value;p.parent&&p.parent.removeChild(p,"ignore")}}else if(i.type)i=[i];else if(i.prop){if(typeof i.value>"u")throw new Error("Value field is missed in node creation");typeof i.value!="string"&&(i.value=String(i.value)),i=[new gl(i)]}else if(i.selector)i=[new ds(i)];else if(i.name)i=[new hs(i)];else if(i.text)i=[new yl(i)];else throw new Error("Unknown node type in node creation");var y=i.map(function(w){return w[bl]||t.rebuild(w),w=w.proxyOf,w.parent&&w.parent.removeChild(w),w[vl]&&kl(w),typeof w.raws.before>"u"&&o&&typeof o.raws.before<"u"&&(w.raws.before=o.raws.before.replace(/\S/g,"")),w.parent=s.proxyOf,w});return y},r.prepend=function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];o=o.reverse();for(var a=D(o),u;!(u=a()).done;){for(var c=u.value,d=this.normalize(c,this.first,"prepend").reverse(),h=D(d),p;!(p=h()).done;){var y=p.value;this.proxyOf.nodes.unshift(y)}for(var w in this.indexes)this.indexes[w]=this.indexes[w]+d.length}return this.markDirty(),this},r.push=function(i){return i.parent=this,this.proxyOf.nodes.push(i),this},r.removeAll=function(){for(var i=D(this.proxyOf.nodes),o;!(o=i()).done;){var s=o.value;s.parent=void 0}return this.proxyOf.nodes=[],this.markDirty(),this},r.removeChild=function(i){i=this.index(i),this.proxyOf.nodes[i].parent=void 0,this.proxyOf.nodes.splice(i,1);var o;for(var s in this.indexes)o=this.indexes[s],o>=i&&(this.indexes[s]=o-1);return this.markDirty(),this},r.replaceValues=function(i,o,s){return s||(s=o,o={}),this.walkDecls(function(a){o.props&&!o.props.includes(a.prop)||o.fast&&!a.value.includes(o.fast)||(a.value=a.value.replace(i,s))}),this.markDirty(),this},r.some=function(i){return this.nodes.some(i)},r.walk=function(i){return this.each(function(o,s){var a;try{a=i(o,s)}catch(u){throw o.addToError(u)}return a!==!1&&o.walk&&(a=o.walk(i)),a})},r.walkAtRules=function(i,o){return o?J(i,RegExp)?this.walk(function(s,a){if(s.type==="atrule"&&i.test(s.name))return o(s,a)}):this.walk(function(s,a){if(s.type==="atrule"&&s.name===i)return o(s,a)}):(o=i,this.walk(function(s,a){if(s.type==="atrule")return o(s,a)}))},r.walkComments=function(i){return this.walk(function(o,s){if(o.type==="comment")return i(o,s)})},r.walkDecls=function(i,o){return o?J(i,RegExp)?this.walk(function(s,a){if(s.type==="decl"&&i.test(s.prop))return o(s,a)}):this.walk(function(s,a){if(s.type==="decl"&&s.prop===i)return o(s,a)}):(o=i,this.walk(function(s,a){if(s.type==="decl")return o(s,a)}))},r.walkRules=function(i,o){return o?J(i,RegExp)?this.walk(function(s,a){if(s.type==="rule"&&i.test(s.selector))return o(s,a)}):this.walk(function(s,a){if(s.type==="rule"&&s.selector===i)return o(s,a)}):(o=i,this.walk(function(s,a){if(s.type==="rule")return o(s,a)}))},Ke(t,[{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}]),t}(rv);Nn.registerParse=function(n){wl=n},Nn.registerRule=function(n){ds=n},Nn.registerAtRule=function(n){hs=n},Nn.registerRoot=function(n){Cl=n};var pt=Nn;Nn.default=Nn,Nn.rebuild=function(n){n.type==="atrule"?Object.setPrototypeOf(n,hs.prototype):n.type==="rule"?Object.setPrototypeOf(n,ds.prototype):n.type==="decl"?Object.setPrototypeOf(n,gl.prototype):n.type==="comment"?Object.setPrototypeOf(n,yl.prototype):n.type==="root"&&Object.setPrototypeOf(n,Cl.prototype),n[bl]=!0,n.nodes&&n.nodes.forEach(function(t){Nn.rebuild(t)})};var ov=pt,_l,Al,mi=function(n){$e(t,n);function t(e){var i;return i=n.call(this,re({type:"document"},e))||this,i.nodes||(i.nodes=[]),i}var r=t.prototype;return r.toResult=function(i){i===void 0&&(i={});var o=new _l(new Al,this,i);return o.stringify()},t}(ov);mi.registerLazyResult=function(n){_l=n},mi.registerProcessor=function(n){Al=n};var ms=mi;mi.default=mi;var xl={},Ml=function(t){xl[t]||(xl[t]=!0,typeof console<"u"&&console.warn&&console.warn(t))},fs=function(){function n(r,e){if(e===void 0&&(e={}),this.type="warning",this.text=r,e.node&&e.node.source){var i=e.node.rangeBy(e);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(var o in e)this[o]=e[o]}var t=n.prototype;return t.toString=function(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text},n}(),El=fs;fs.default=fs;var sv=El,ps=function(){function n(r,e,i){this.processor=r,this.messages=[],this.root=e,this.opts=i,this.css=void 0,this.map=void 0}var t=n.prototype;return t.toString=function(){return this.css},t.warn=function(e,i){i===void 0&&(i={}),i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);var o=new sv(e,i);return this.messages.push(o),o},t.warnings=function(){return this.messages.filter(function(e){return e.type==="warning"})},Ke(n,[{key:"content",get:function(){return this.css}}]),n}(),vs=ps;ps.default=ps;var bs=39,Ll=34,kr=92,Tl=47,_r=10,fi=32,Ar=12,xr=9,Mr=13,av=91,uv=93,lv=40,cv=41,dv=123,hv=125,mv=59,fv=42,pv=58,vv=64,Er=/[\t\n\f\r "#'()/;[\\\]{}]/g,Lr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bv=/.[\r\n"'(/\\]/,Il=/[\da-f]/i,gv=function(t,r){r===void 0&&(r={});var e=t.css.valueOf(),i=r.ignoreErrors,o,s,a,u,c,d,h,p,y,w,k=e.length,b=0,S=[],A=[];function x(){return b}function E(N){throw t.error("Unclosed "+N,b)}function L(){return A.length===0&&b>=k}function P(N){if(A.length)return A.pop();if(!(b>=k)){var F=N?N.ignoreUnclosed:!1;switch(o=e.charCodeAt(b),o){case _r:case fi:case xr:case Mr:case Ar:{s=b;do s+=1,o=e.charCodeAt(s);while(o===fi||o===_r||o===xr||o===Mr||o===Ar);w=["space",e.slice(b,s)],b=s-1;break}case av:case uv:case dv:case hv:case pv:case mv:case cv:{var z=String.fromCharCode(o);w=[z,z,b];break}case lv:{if(p=S.length?S.pop()[1]:"",y=e.charCodeAt(b+1),p==="url"&&y!==bs&&y!==Ll&&y!==fi&&y!==_r&&y!==xr&&y!==Ar&&y!==Mr){s=b;do{if(d=!1,s=e.indexOf(")",s+1),s===-1)if(i||F){s=b;break}else E("bracket");for(h=s;e.charCodeAt(h-1)===kr;)h-=1,d=!d}while(d);w=["brackets",e.slice(b,s+1),b,s],b=s}else s=e.indexOf(")",b+1),u=e.slice(b,s+1),s===-1||bv.test(u)?w=["(","(",b]:(w=["brackets",u,b,s],b=s);break}case bs:case Ll:{a=o===bs?"'":'"',s=b;do{if(d=!1,s=e.indexOf(a,s+1),s===-1)if(i||F){s=b+1;break}else E("string");for(h=s;e.charCodeAt(h-1)===kr;)h-=1,d=!d}while(d);w=["string",e.slice(b,s+1),b,s],b=s;break}case vv:{Er.lastIndex=b+1,Er.test(e),Er.lastIndex===0?s=e.length-1:s=Er.lastIndex-2,w=["at-word",e.slice(b,s+1),b,s],b=s;break}case kr:{for(s=b,c=!0;e.charCodeAt(s+1)===kr;)s+=1,c=!c;if(o=e.charCodeAt(s+1),c&&o!==Tl&&o!==fi&&o!==_r&&o!==xr&&o!==Mr&&o!==Ar&&(s+=1,Il.test(e.charAt(s)))){for(;Il.test(e.charAt(s+1));)s+=1;e.charCodeAt(s+1)===fi&&(s+=1)}w=["word",e.slice(b,s+1),b,s],b=s;break}default:{o===Tl&&e.charCodeAt(b+1)===fv?(s=e.indexOf("*/",b+2)+1,s===0&&(i||F?s=e.length:E("comment")),w=["comment",e.slice(b,s+1),b,s],b=s):(Lr.lastIndex=b+1,Lr.test(e),Lr.lastIndex===0?s=e.length-1:s=Lr.lastIndex-2,w=["word",e.slice(b,s+1),b,s],S.push(w),b=s);break}}return b++,w}}function H(N){A.push(N)}return{back:H,endOfFile:L,nextToken:P,position:x}},Pl=pt,Tr=function(n){$e(t,n);function t(e){var i;return i=n.call(this,e)||this,i.type="atrule",i}var r=t.prototype;return r.append=function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var a;return this.proxyOf.nodes||(this.nodes=[]),(a=n.prototype.append).call.apply(a,[].concat([this],o))},r.prepend=function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];var a;return this.proxyOf.nodes||(this.nodes=[]),(a=n.prototype.prepend).call.apply(a,[].concat([this],o))},t}(Pl),gs=Tr;Tr.default=Tr,Pl.registerAtRule(Tr);var Rl=pt,Ol,Nl,Ot=function(n){$e(t,n);function t(e){var i;return i=n.call(this,e)||this,i.type="root",i.nodes||(i.nodes=[]),i}var r=t.prototype;return r.normalize=function(i,o,s){var a=n.prototype.normalize.call(this,i);if(o){if(s==="prepend")this.nodes.length>1?o.raws.before=this.nodes[1].raws.before:delete o.raws.before;else if(this.first!==o)for(var u=D(a),c;!(c=u()).done;){var d=c.value;d.raws.before=o.raws.before}}return a},r.removeChild=function(i,o){var s=this.index(i);return!o&&s===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),n.prototype.removeChild.call(this,i)},r.toResult=function(i){i===void 0&&(i={});var o=new Ol(new Nl,this,i);return o.stringify()},t}(Rl);Ot.registerLazyResult=function(n){Ol=n},Ot.registerProcessor=function(n){Nl=n};var pi=Ot;Ot.default=Ot,Rl.registerRoot(Ot);var vi={comma:function(t){return vi.split(t,[","],!0)},space:function(t){var r=[" ",`
781
+ `," "];return vi.split(t,r)},split:function(t,r,e){for(var i=[],o="",s=!1,a=0,u=!1,c="",d=!1,h=D(t),p;!(p=h()).done;){var y=p.value;d?d=!1:y==="\\"?d=!0:u?y===c&&(u=!1):y==='"'||y==="'"?(u=!0,c=y):y==="("?a+=1:y===")"?a>0&&(a-=1):a===0&&r.includes(y)&&(s=!0),s?(o!==""&&i.push(o.trim()),o="",s=!1):o+=y}return(e||o!=="")&&i.push(o.trim()),i}},Bl=vi;vi.default=vi;var Dl=pt,yv=Bl,Ir=function(n){$e(t,n);function t(r){var e;return e=n.call(this,r)||this,e.type="rule",e.nodes||(e.nodes=[]),e}return Ke(t,[{key:"selectors",get:function(){return yv.comma(this.selector)},set:function(e){var i=this.selector?this.selector.match(/,\s*/):null,o=i?i[0]:","+this.raw("between","beforeOpen");this.selector=e.join(o)}}]),t}(Dl),ys=Ir;Ir.default=Ir,Dl.registerRule(Ir);var wv=vr,Cv=gv,Sv=Sr,kv=gs,_v=pi,Hl=ys,Ul={empty:!0,space:!0};function Av(n){for(var t=n.length-1;t>=0;t--){var r=n[t],e=r[3]||r[2];if(e)return e}}var xv=function(){function n(r){this.input=r,this.root=new _v,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:r,start:{column:1,line:1,offset:0}}}var t=n.prototype;return t.atrule=function(e){var i=new kv;i.name=e[1].slice(1),i.name===""&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o,s,a,u=!1,c=!1,d=[],h=[];!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),o=e[0],o==="("||o==="["?h.push(o==="("?")":"]"):o==="{"&&h.length>0?h.push("}"):o===h[h.length-1]&&h.pop(),h.length===0)if(o===";"){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}else if(o==="{"){c=!0;break}else if(o==="}"){if(d.length>0){for(a=d.length-1,s=d[a];s&&s[0]==="space";)s=d[--a];s&&(i.source.end=this.getPosition(s[3]||s[2]),i.source.end.offset++)}this.end(e);break}else d.push(e);else d.push(e);if(this.tokenizer.endOfFile()){u=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(d),d.length?(i.raws.afterName=this.spacesAndCommentsFromStart(d),this.raw(i,"params",d),u&&(e=d[d.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),c&&(i.nodes=[],this.current=i)},t.checkMissedSemicolon=function(e){var i=this.colon(e);if(i!==!1){for(var o=0,s,a=i-1;a>=0&&(s=e[a],!(s[0]!=="space"&&(o+=1,o===2)));a--);throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}},t.colon=function(e){for(var i=0,o,s,a,u=D(e.entries()),c;!(c=u()).done;){var d=c.value,h=d[0],p=d[1];if(o=p,s=o[0],s==="("&&(i+=1),s===")"&&(i-=1),i===0&&s===":")if(!a)this.doubleColon(o);else{if(a[0]==="word"&&a[1]==="progid")continue;return h}a=o}return!1},t.comment=function(e){var i=new Sv;this.init(i,e[2]),i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++;var o=e[1].slice(2,-2);if(/^\s*$/.test(o))i.text="",i.raws.left=o,i.raws.right="";else{var s=o.match(/^(\s*)([^]*\S)(\s*)$/);i.text=s[2],i.raws.left=s[1],i.raws.right=s[3]}},t.createTokenizer=function(){this.tokenizer=Cv(this.input)},t.decl=function(e,i){var o=new wv;this.init(o,e[0][2]);var s=e[e.length-1];for(s[0]===";"&&(this.semicolon=!0,e.pop()),o.source.end=this.getPosition(s[3]||s[2]||Av(e)),o.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),o.raws.before+=e.shift()[1];for(o.source.start=this.getPosition(e[0][2]),o.prop="";e.length;){var a=e[0][0];if(a===":"||a==="space"||a==="comment")break;o.prop+=e.shift()[1]}o.raws.between="";for(var u;e.length;)if(u=e.shift(),u[0]===":"){o.raws.between+=u[1];break}else u[0]==="word"&&/\w/.test(u[1])&&this.unknownWord([u]),o.raws.between+=u[1];(o.prop[0]==="_"||o.prop[0]==="*")&&(o.raws.before+=o.prop[0],o.prop=o.prop.slice(1));for(var c=[],d;e.length&&(d=e[0][0],!(d!=="space"&&d!=="comment"));)c.push(e.shift());this.precheckMissedSemicolon(e);for(var h=e.length-1;h>=0;h--){if(u=e[h],u[1].toLowerCase()==="!important"){o.important=!0;var p=this.stringFrom(e,h);p=this.spacesFromEnd(e)+p,p!==" !important"&&(o.raws.important=p);break}else if(u[1].toLowerCase()==="important"){for(var y=e.slice(0),w="",k=h;k>0;k--){var b=y[k][0];if(w.trim().indexOf("!")===0&&b!=="space")break;w=y.pop()[1]+w}w.trim().indexOf("!")===0&&(o.important=!0,o.raws.important=w,e=y)}if(u[0]!=="space"&&u[0]!=="comment")break}var S=e.some(function(A){return A[0]!=="space"&&A[0]!=="comment"});S&&(o.raws.between+=c.map(function(A){return A[1]}).join(""),c=[]),this.raw(o,"value",c.concat(e),i),o.value.includes(":")&&!i&&this.checkMissedSemicolon(e)},t.doubleColon=function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})},t.emptyRule=function(e){var i=new Hl;this.init(i,e[2]),i.selector="",i.raws.between="",this.current=i},t.end=function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)},t.endFile=function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())},t.freeSemicolon=function(e){if(this.spaces+=e[1],this.current.nodes){var i=this.current.nodes[this.current.nodes.length-1];i&&i.type==="rule"&&!i.raws.ownSemicolon&&(i.raws.ownSemicolon=this.spaces,this.spaces="")}},t.getPosition=function(e){var i=this.input.fromOffset(e);return{column:i.col,line:i.line,offset:e}},t.init=function(e,i){this.current.push(e),e.source={input:this.input,start:this.getPosition(i)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)},t.other=function(e){for(var i=!1,o=null,s=!1,a=null,u=[],c=e[1].startsWith("--"),d=[],h=e;h;){if(o=h[0],d.push(h),o==="("||o==="[")a||(a=h),u.push(o==="("?")":"]");else if(c&&s&&o==="{")a||(a=h),u.push("}");else if(u.length===0)if(o===";")if(s){this.decl(d,c);return}else break;else if(o==="{"){this.rule(d);return}else if(o==="}"){this.tokenizer.back(d.pop()),i=!0;break}else o===":"&&(s=!0);else o===u[u.length-1]&&(u.pop(),u.length===0&&(a=null));h=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(i=!0),u.length>0&&this.unclosedBracket(a),i&&s){if(!c)for(;d.length&&(h=d[d.length-1][0],!(h!=="space"&&h!=="comment"));)this.tokenizer.back(d.pop());this.decl(d,c)}else this.unknownWord(d)},t.parse=function(){for(var e;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()},t.precheckMissedSemicolon=function(){},t.raw=function(e,i,o,s){for(var a,u,c=o.length,d="",h=!0,p,y,w=0;w<c;w+=1)a=o[w],u=a[0],u==="space"&&w===c-1&&!s?h=!1:u==="comment"?(y=o[w-1]?o[w-1][0]:"empty",p=o[w+1]?o[w+1][0]:"empty",!Ul[y]&&!Ul[p]?d.slice(-1)===","?h=!1:d+=a[1]:h=!1):d+=a[1];if(!h){var k=o.reduce(function(b,S){return b+S[1]},"");e.raws[i]={raw:k,value:d}}e[i]=d},t.rule=function(e){e.pop();var i=new Hl;this.init(i,e[0][2]),i.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(i,"selector",e),this.current=i},t.spacesAndCommentsFromEnd=function(e){for(var i,o="";e.length&&(i=e[e.length-1][0],!(i!=="space"&&i!=="comment"));)o=e.pop()[1]+o;return o},t.spacesAndCommentsFromStart=function(e){for(var i,o="";e.length&&(i=e[0][0],!(i!=="space"&&i!=="comment"));)o+=e.shift()[1];return o},t.spacesFromEnd=function(e){for(var i,o="";e.length&&(i=e[e.length-1][0],i==="space");)o=e.pop()[1]+o;return o},t.stringFrom=function(e,i){for(var o="",s=i;s<e.length;s++)o+=e[s][1];return e.splice(i,e.length-i),o},t.unclosedBlock=function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)},t.unclosedBracket=function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})},t.unexpectedClose=function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})},t.unknownWord=function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})},t.unnamedAtrule=function(e,i){throw this.input.error("At-rule without name",{offset:i[2]},{offset:i[2]+i[1].length})},n}(),Mv=xv,Ev=pt,Lv=Mv,Tv=yr;function Pr(n,t){var r=new Tv(n,t),e=new Lv(r);try{e.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&t&&t.from&&(/\.scss$/i.test(t.from)?i.message+=`
782
+ You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(t.from)?i.message+=`
783
+ You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(t.from)&&(i.message+=`
784
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return e.root}var ws=Pr;Pr.default=Pr,Ev.registerParse(Pr);var xn=Yn.isClean,Iv=Yn.my,Pv=pl,Rv=mr,Ov=pt,Nv=ms,Bv=Ml,Fl=vs,Dv=ws,Hv=pi,Uv={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Fv={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Gv={Once:!0,postcssPlugin:!0,prepare:!0},Nt=0;function bi(n){return(typeof n>"u"?"undefined":Q(n))==="object"&&typeof n.then=="function"}function Gl(n){var t=!1,r=Uv[n.type];return n.type==="decl"?t=n.prop.toLowerCase():n.type==="atrule"&&(t=n.name.toLowerCase()),t&&n.append?[r,r+"-"+t,Nt,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:n.append?[r,Nt,r+"Exit"]:[r,r+"Exit"]}function Kl(n){var t;return n.type==="document"?t=["Document",Nt,"DocumentExit"]:n.type==="root"?t=["Root",Nt,"RootExit"]:t=Gl(n),{eventIndex:0,events:t,iterator:0,node:n,visitorIndex:0,visitors:[]}}function Cs(n){return n[xn]=!1,n.nodes&&n.nodes.forEach(function(t){return Cs(t)}),n}var Ss={},Bt=function(){function n(r,e,i){var o=this;this.stringified=!1,this.processed=!1;var s;if((typeof e>"u"?"undefined":Q(e))==="object"&&e!==null&&(e.type==="root"||e.type==="document"))s=Cs(e);else if(J(e,n)||J(e,Fl))s=Cs(e.root),e.map&&(typeof i.map>"u"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=e.map);else{var a=Dv;i.syntax&&(a=i.syntax.parse),i.parser&&(a=i.parser),a.parse&&(a=a.parse);try{s=a(e,i)}catch(u){this.processed=!0,this.error=u}s&&!s[Iv]&&Ov.rebuild(s)}this.result=new Fl(r,s,i),this.helpers=re({},Ss,{postcss:Ss,result:this.result}),this.plugins=this.processor.plugins.map(function(u){return(typeof u>"u"?"undefined":Q(u))==="object"&&u.prepare?re({},u,u.prepare(o.result)):u})}var t=n.prototype;return t.async=function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.getAsyncError=function(){throw new Error("Use process(css).then(cb) to work with async plugins")},t.handleError=function(e,i){var o=this.result.lastPlugin;try{if(i&&i.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=o.postcssPlugin,e.setMessage();else if(o.postcssVersion&&process.env.NODE_ENV!=="production"){var s=o.postcssPlugin,a=o.postcssVersion,u=this.result.processor.version,c=a.split("."),d=u.split(".");(c[0]!==d[0]||parseInt(c[1])>parseInt(d[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+u+", but "+s+" uses "+a+". Perhaps this is the source of the error below.")}}catch(h){console&&console.error&&console.error(h)}return e},t.prepareVisitors=function(){var e=this;this.listeners={};for(var i=function(d,h,p){e.listeners[h]||(e.listeners[h]=[]),e.listeners[h].push([d,p])},o=D(this.plugins),s;!(s=o()).done;){var a=s.value;if((typeof a>"u"?"undefined":Q(a))==="object")for(var u in a){if(!Fv[u]&&/^[A-Z]/.test(u))throw new Error("Unknown event "+u+" in "+a.postcssPlugin+". Try to update PostCSS ("+this.processor.version+" now).");if(!Gv[u])if(Q(a[u])==="object")for(var c in a[u])c==="*"?i(a,u,a[u][c]):i(a,u+"-"+c.toLowerCase(),a[u][c]);else typeof a[u]=="function"&&i(a,u,a[u])}}this.hasListener=Object.keys(this.listeners).length>0},t.runAsync=function(){var e=this;return co(function(){var i,o,s,a,u,c,d,h,p,y,w,k;return ti(this,function(b){switch(b.label){case 0:e.plugin=0,i=0,b.label=1;case 1:if(!(i<e.plugins.length))return[3,6];if(o=e.plugins[i],s=e.runOnRoot(o),!bi(s))return[3,5];b.label=2;case 2:return b.trys.push([2,4,,5]),[4,s];case 3:return b.sent(),[3,5];case 4:throw a=b.sent(),e.handleError(a);case 5:return i++,[3,1];case 6:if(e.prepareVisitors(),!e.hasListener)return[3,18];u=e.result.root,b.label=7;case 7:if(u[xn])return[3,14];u[xn]=!0,c=[Kl(u)],b.label=8;case 8:if(!(c.length>0))return[3,13];if(d=e.visitTick(c),!bi(d))return[3,12];b.label=9;case 9:return b.trys.push([9,11,,12]),[4,d];case 10:return b.sent(),[3,12];case 11:throw h=b.sent(),p=c[c.length-1].node,e.handleError(h,p);case 12:return[3,8];case 13:return[3,7];case 14:if(!e.listeners.OnceExit)return[3,18];y=function(){var S,A,x,E,L;return ti(this,function(P){switch(P.label){case 0:S=k.value,A=S[0],x=S[1],e.result.lastPlugin=A,P.label=1;case 1:return P.trys.push([1,6,,7]),u.type!=="document"?[3,3]:(E=u.nodes.map(function(H){return x(H,e.helpers)}),[4,Promise.all(E)]);case 2:return P.sent(),[3,5];case 3:return[4,x(u,e.helpers)];case 4:P.sent(),P.label=5;case 5:return[3,7];case 6:throw L=P.sent(),e.handleError(L);case 7:return[2]}})},w=D(e.listeners.OnceExit),b.label=15;case 15:return(k=w()).done?[3,18]:[5,Ua(y())];case 16:b.sent(),b.label=17;case 17:return[3,15];case 18:return e.processed=!0,[2,e.stringify()]}})})()},t.runOnRoot=function(e){var i=this;this.result.lastPlugin=e;try{if((typeof e>"u"?"undefined":Q(e))==="object"&&e.Once){if(this.result.root.type==="document"){var o=this.result.root.nodes.map(function(s){return e.Once(s,i.helpers)});return bi(o[0])?Promise.all(o):o}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(s){throw this.handleError(s)}},t.stringify=function(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,i=Rv;e.syntax&&(i=e.syntax.stringify),e.stringifier&&(i=e.stringifier),i.stringify&&(i=i.stringify);var o=new Pv(i,this.result.root,this.result.opts),s=o.generate();return this.result.css=s[0],this.result.map=s[1],this.result},t.sync=function(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e=D(this.plugins),i;!(i=e()).done;){var o=i.value,s=this.runOnRoot(o);if(bi(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){for(var a=this.result.root;!a[xn];)a[xn]=!0,this.walkSync(a);if(this.listeners.OnceExit)if(a.type==="document")for(var u=D(a.nodes),c;!(c=u()).done;){var d=c.value;this.visitSync(this.listeners.OnceExit,d)}else this.visitSync(this.listeners.OnceExit,a)}return this.result},t.then=function(e,i){return process.env.NODE_ENV!=="production"&&("from"in this.opts||Bv("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,i)},t.toString=function(){return this.css},t.visitSync=function(e,i){for(var o=D(e),s;!(s=o()).done;){var a=s.value,u=a[0],c=a[1];this.result.lastPlugin=u;var d=void 0;try{d=c(i,this.helpers)}catch(h){throw this.handleError(h,i.proxyOf)}if(i.type!=="root"&&i.type!=="document"&&!i.parent)return!0;if(bi(d))throw this.getAsyncError()}},t.visitTick=function(e){var i=e[e.length-1],o=i.node,s=i.visitors;if(o.type!=="root"&&o.type!=="document"&&!o.parent){e.pop();return}if(s.length>0&&i.visitorIndex<s.length){var a=s[i.visitorIndex],u=a[0],c=a[1];i.visitorIndex+=1,i.visitorIndex===s.length&&(i.visitors=[],i.visitorIndex=0),this.result.lastPlugin=u;try{return c(o.toProxy(),this.helpers)}catch(w){throw this.handleError(w,o)}}if(i.iterator!==0){for(var d=i.iterator,h;h=o.nodes[o.indexes[d]];)if(o.indexes[d]+=1,!h[xn]){h[xn]=!0,e.push(Kl(h));return}i.iterator=0,delete o.indexes[d]}for(var p=i.events;i.eventIndex<p.length;){var y=p[i.eventIndex];if(i.eventIndex+=1,y===Nt){o.nodes&&o.nodes.length&&(o[xn]=!0,i.iterator=o.getIterator());return}else if(this.listeners[y]){i.visitors=this.listeners[y];return}}e.pop()},t.walkSync=function(e){var i=this;e[xn]=!0;for(var o=Gl(e),s=D(o),a;!(a=s()).done;){var u=a.value;if(u===Nt)e.nodes&&e.each(function(d){d[xn]||i.walkSync(d)});else{var c=this.listeners[u];if(c&&this.visitSync(c,e.toProxy()))return}}},t.warnings=function(){return this.sync().warnings()},Ke(n,[{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}]),n}();Bt.registerPostcss=function(n){Ss=n};var jl=Bt;Bt.default=Bt,Hv.registerLazyResult(Bt),Nv.registerLazyResult(Bt);var Kv=pl,jv=mr,Vv=Ml,zv=ws,$v=vs,ks=function(){function n(r,e,i){e=e.toString(),this.stringified=!1,this._processor=r,this._css=e,this._opts=i,this._map=void 0;var o,s=jv;this.result=new $v(this._processor,o,this._opts),this.result.css=e;var a=this;Object.defineProperty(this.result,"root",{get:function(){return a.root}});var u=new Kv(s,o,this._opts,e);if(u.isMap()){var c=u.generate(),d=c[0],h=c[1];d&&(this.result.css=d),h&&(this.result.map=h)}else u.clearAnnotation(),this.result.css=u.css}var t=n.prototype;return t.async=function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)},t.catch=function(e){return this.async().catch(e)},t.finally=function(e){return this.async().then(e,e)},t.sync=function(){if(this.error)throw this.error;return this.result},t.then=function(e,i){return process.env.NODE_ENV!=="production"&&("from"in this._opts||Vv("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,i)},t.toString=function(){return this._css},t.warnings=function(){return[]},Ke(n,[{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,i=zv;try{e=i(this._css,this._opts)}catch(o){this.error=o}if(this.error)throw this.error;return this._root=e,e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),n}(),Wv=ks;ks.default=ks;var qv=Wv,Zv=jl,Jv=ms,Yv=pi,gi=function(){function n(r){r===void 0&&(r=[]),this.version="8.4.38",this.plugins=this.normalize(r)}var t=n.prototype;return t.normalize=function(e){for(var i=[],o=D(e),s;!(s=o()).done;){var a=s.value;if(a.postcss===!0?a=a():a.postcss&&(a=a.postcss),(typeof a>"u"?"undefined":Q(a))==="object"&&Array.isArray(a.plugins))i=i.concat(a.plugins);else if((typeof a>"u"?"undefined":Q(a))==="object"&&a.postcssPlugin)i.push(a);else if(typeof a=="function")i.push(a);else if((typeof a>"u"?"undefined":Q(a))==="object"&&(a.parse||a.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(a+" is not a PostCSS plugin")}return i},t.process=function(e,i){return i===void 0&&(i={}),!this.plugins.length&&!i.parser&&!i.stringifier&&!i.syntax?new qv(this,e,i):new Zv(this,e,i)},t.use=function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this},n}(),Xv=gi;gi.default=gi,Yv.registerProcessor(gi),Jv.registerProcessor(gi);var Qv=vr,eb=sl,nb=Sr,tb=gs,ib=yr,rb=pi,ob=ys;function yi(n,t){if(Array.isArray(n))return n.map(function(h){return yi(h)});var r=n.inputs,e=ei(n,["inputs"]);if(r){t=[];for(var i=D(r),o;!(o=i()).done;){var s=o.value,a=re({},s,{__proto__:ib.prototype});a.map&&(a.map=re({},a.map,{__proto__:eb.prototype})),t.push(a)}}if(e.nodes&&(e.nodes=n.nodes.map(function(h){return yi(h,t)})),e.source){var u=e.source,c=u.inputId,d=ei(u,["inputId"]);e.source=d,c!=null&&(e.source.input=t[c])}if(e.type==="root")return new rb(e);if(e.type==="decl")return new Qv(e);if(e.type==="rule")return new ob(e);if(e.type==="comment")return new nb(e);if(e.type==="atrule")return new tb(e);throw new Error("Unknown node type: "+n.type)}var sb=yi;yi.default=yi;var ab=Xo,Vl=vr,ub=jl,lb=pt,_s=Xv,cb=mr,db=sb,zl=ms,hb=El,$l=Sr,Wl=gs,mb=vs,fb=yr,pb=ws,vb=Bl,ql=ys,Zl=pi,bb=pr;function me(){for(var n=arguments.length,t=new Array(n),r=0;r<n;r++)t[r]=arguments[r];return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new _s(t)}me.plugin=function(t,r){var e=!1;function i(){for(var s=arguments.length,a=new Array(s),u=0;u<s;u++)a[u]=arguments[u];console&&console.warn&&!e&&(e=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
785
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: 里面 postcss.plugin 被弃用. 迁移指南:
786
+ https://www.w3ctech.com/topic/2226`));var c=r.apply(void 0,[].concat(a));return c.postcssPlugin=t,c.postcssVersion=new _s().version,c}var o;return Object.defineProperty(i,"postcss",{get:function(){return o||(o=i()),o}}),i.process=function(s,a,u){return me([i(u)]).process(s,a)},i},me.stringify=cb,me.parse=pb,me.fromJSON=db,me.list=vb,me.comment=function(n){return new $l(n)},me.atRule=function(n){return new Wl(n)},me.decl=function(n){return new Vl(n)},me.rule=function(n){return new ql(n)},me.root=function(n){return new Zl(n)},me.document=function(n){return new zl(n)},me.CssSyntaxError=ab,me.Declaration=Vl,me.Container=lb,me.Processor=_s,me.Document=zl,me.Comment=$l,me.Warning=hb,me.AtRule=Wl,me.Result=mb,me.Input=fb,me.Rule=ql,me.Root=Zl,me.Node=bb,ub.registerPostcss(me);var gb=me;me.default=me;var _e=Lp(gb);_e.stringify,_e.fromJSON,_e.plugin,_e.parse,_e.list,_e.document,_e.comment,_e.atRule,_e.rule,_e.decl,_e.root,_e.CssSyntaxError,_e.Declaration,_e.Container,_e.Processor,_e.Document,_e.Comment,_e.Warning,_e.AtRule,_e.Result,_e.Input,_e.Rule,_e.Root,_e.Node;var yb=function(){function n(){for(var r=arguments.length,e=new Array(r),i=0;i<r;i++)e[i]=arguments[i];an(this,"parentElement",null),an(this,"parentNode",null),an(this,"ownerDocument"),an(this,"firstChild",null),an(this,"lastChild",null),an(this,"previousSibling",null),an(this,"nextSibling",null),an(this,"ELEMENT_NODE",1),an(this,"TEXT_NODE",3),an(this,"nodeType"),an(this,"nodeName"),an(this,"RRNodeType")}var t=n.prototype;return t.contains=function(e){if(J(e,n)){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1},t.appendChild=function(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")},t.insertBefore=function(e,i){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")},t.removeChild=function(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")},t.toString=function(){return"RRNode"},Ke(n,[{key:"childNodes",get:function(){for(var e=[],i=this.firstChild;i;)e.push(i),i=i.nextSibling;return e}}]),n}(),Jl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Yl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Rr={},wb=function(){return!!globalThis.Zone};function As(n){if(Rr[n])return Rr[n];var t=globalThis[n],r=t.prototype,e=n in Jl?Jl[n]:void 0,i=!!(e&&e.every(function(d){var h,p;return!!((p=(h=Object.getOwnPropertyDescriptor(r,d))==null?void 0:h.get)!=null&&p.toString().includes("[native code]"))})),o=n in Yl?Yl[n]:void 0,s=!!(o&&o.every(function(d){var h;return typeof r[d]=="function"&&((h=r[d])==null?void 0:h.toString().includes("[native code]"))}));if(i&&s&&!wb())return Rr[n]=t.prototype,t.prototype;try{var a=document.createElement("iframe");document.body.appendChild(a);var u=a.contentWindow;if(!u)return t.prototype;var c=u[n].prototype;return document.body.removeChild(a),c?Rr[n]=c:r}catch{return r}}var xs={};function Xn(n,t,r){var e,i=n+"."+String(r);if(xs[i])return xs[i].call(t);var o=As(n),s=(e=Object.getOwnPropertyDescriptor(o,r))==null?void 0:e.get;return s?(xs[i]=s,s.call(t)):t[r]}var Ms={};function Xl(n,t,r){var e=n+"."+String(r);if(Ms[e])return Ms[e].bind(t);var i=As(n),o=i[r];return typeof o!="function"?t[r]:(Ms[e]=o,o.bind(t))}function Cb(n){return Xn("Node",n,"childNodes")}function Sb(n){return Xn("Node",n,"parentNode")}function kb(n){return Xn("Node",n,"parentElement")}function _b(n){return Xn("Node",n,"textContent")}function Ab(n,t){return Xl("Node",n,"contains")(t)}function xb(n){return Xl("Node",n,"getRootNode")()}function Mb(n){return!n||!("host"in n)?null:Xn("ShadowRoot",n,"host")}function Eb(n){return n.styleSheets}function Lb(n){return!n||!("shadowRoot"in n)?null:Xn("Element",n,"shadowRoot")}function Tb(n,t){return Xn("Element",n,"querySelector")(t)}function Ib(n,t){return Xn("Element",n,"querySelectorAll")(t)}function Ql(){return As("MutationObserver").constructor}var ee={childNodes:Cb,parentNode:Sb,parentElement:kb,textContent:_b,contains:Ab,getRootNode:xb,host:Mb,styleSheets:Eb,shadowRoot:Lb,querySelector:Tb,querySelectorAll:Ib,mutationObserver:Ql};function Je(n,t,r){r===void 0&&(r=document);var e={capture:!0,passive:!0};return r.addEventListener(n,t,e),function(){return r.removeEventListener(n,t,e)}}var Dt=`Please stop import mirror directly. Instead of that,\r
731
787
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
732
- or you can use record.mirror to access the mirror instance during recording.`;let jt={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&&(jt=new Proxy(jt,{get(n,e,i){return e==="map"&&console.error(Nn),Reflect.get(n,e,i)}}));function qn(n,e,i={}){let t=null,o=0;return function(...s){const r=Date.now();!o&&i.leading===!1&&(o=r);const l=e-(r-o),c=this;l<=0||l>e?(t&&(clearTimeout(t),t=null),o=r,n.apply(c,s)):!t&&i.trailing!==!1&&(t=setTimeout(()=>{o=i.leading===!1?0:Date.now(),t=null,n.apply(c,s)},l))}}function mi(n,e,i,t,o=window){const s=o.Object.getOwnPropertyDescriptor(n,e);return o.Object.defineProperty(n,e,t?i:{set(r){setTimeout(()=>{i.set.call(this,r)},0),s&&s.set&&s.set.call(this,r)}}),()=>mi(n,e,s||{},!0)}function In(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 pi=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(pi=()=>new Date().getTime());function Vt(n){var e,i,t,o,s,r;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)||((r=l==null?void 0:l.body)===null||r===void 0?void 0:r.scrollTop)||0}}function Gt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function zt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ft(n){return n?n.nodeType===n.ELEMENT_NODE?n:n.parentElement:null}function _e(n,e,i,t){if(!n)return!1;const o=Ft(n);if(!o)return!1;try{if(typeof e=="string"){if(o.classList.contains(e)||t&&o.closest("."+e)!==null)return!0}else if(hi(o,e,t))return!0}catch{}return!!(i&&(o.matches(i)||t&&o.closest(i)!==null))}function ya(n,e){return e.getId(n)!==-1}function Vi(n,e){return e.getId(n)===Fn}function qt(n,e){if(Gn(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 Gi(n){return!!n.changedTouches}function ka(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 Wt(n,e){return!!(n.nodeName==="IFRAME"&&e.getMeta(n))}function Zt(n,e){return!!(n.nodeName==="LINK"&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&n.getAttribute("rel")==="stylesheet"&&e.getMeta(n))}function zi(n){return!!(n!=null&&n.shadowRoot)}class wa{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 Jt(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 Ca(n){let e=n,i;for(;i=Jt(e);)e=i;return e}function Sa(n){const e=n.ownerDocument;if(!e)return!1;const i=Ca(n);return e.contains(i)}function $t(n){const e=n.ownerDocument;return e?e.contains(n)||Sa(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||{}),F=(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))(F||{}),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||{}),Ze=(n=>(n[n.Mouse=0]="Mouse",n[n.Pen=1]="Pen",n[n.Touch=2]="Touch",n))(Ze||{}),Bn=(n=>(n[n["2D"]=0]="2D",n[n.WebGL=1]="WebGL",n[n.WebGL2=2]="WebGL2",n))(Bn||{});function Yt(n){return"__ln"in n}class _a{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&&Yt(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&&Yt(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 Qt=(n,e)=>`${n}@${e}`;class Ma{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 _a,o=c=>{let b=c,p=Fn;for(;p===Fn;)b=b&&b.nextSibling,p=b&&this.mirror.getId(b);return p},s=c=>{if(!c.parentNode||!$t(c)||c.parentNode.tagName==="TEXTAREA")return;const b=Gn(c.parentNode)?this.mirror.getId(Jt(c)):this.mirror.getId(c.parentNode),p=o(c);if(b===-1||p===-1)return t.addNode(c);const g=Pn(c,{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=>{Wt(f,this.mirror)&&this.iframeManager.addIframe(f),Zt(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),zi(c)&&this.shadowDomManager.addShadowRoot(c.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:b,nextId:p,node:g}),i.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const c of this.movedSet)Xt(this.removes,c,this.mirror)&&!this.movedSet.has(c.parentNode)||s(c);for(const c of this.addedSet)!no(this.droppedSet,c)&&!Xt(this.removes,c,this.mirror)||no(this.movedSet,c)?s(c):this.droppedSet.add(c);let r=null;for(;t.length;){let c=null;if(r){const b=this.mirror.getId(r.value.parentNode),p=o(r.value);b!==-1&&p!==-1&&(c=r)}if(!c){let b=t.tail;for(;b;){const p=b;if(b=b.previous,p){const g=this.mirror.getId(p.value.parentNode);if(o(p.value)===-1)continue;if(g!==-1){c=p;break}else{const y=p.value;if(y.parentNode&&y.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const C=y.parentNode.host;if(this.mirror.getId(C)!==-1){c=p;break}}}}}}if(!c){for(;t.head;)t.removeNode(t.head.value);break}r=c.previous,t.removeNode(c.value),s(c.value)}const l={texts:this.texts.map(c=>{const b=c.node;return b.parentNode&&b.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(b.parentNode),{id:this.mirror.getId(b),value:c.value}}).filter(c=>!i.has(c.id)).filter(c=>this.mirror.has(c.id)),attributes:this.attributes.map(c=>{const{attributes:b}=c;if(typeof b.style=="string"){const p=JSON.stringify(c.styleDiff),g=JSON.stringify(c._unchangedStyles);p.length<b.style.length&&(p+g).split("var(").length===b.style.split("var(").length&&(b.style=c.styleDiff)}return{id:this.mirror.getId(c.node),attributes:b}}).filter(c=>!i.has(c.id)).filter(c=>this.mirror.has(c.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(!Vi(e.target,this.mirror))switch(e.type){case"characterData":{const i=e.target.textContent;!_e(e.target,this.blockClass,this.blockSelector,!1)&&i!==e.oldValue&&this.texts.push({value:Kt(e.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,Ft(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 r=Ki(i);o=Ui({element:i,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:r,value:o,maskInputFn:this.maskInputFn})}if(_e(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"),!Ut(i.tagName,t)&&(s.attributes[t]=Ht(this.doc,gn(i.tagName),gn(t),o),t==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const l of Array.from(i.style)){const c=i.style.getPropertyValue(l),b=i.style.getPropertyPriority(l);c!==r.style.getPropertyValue(l)||b!==r.style.getPropertyPriority(l)?b===""?s.styleDiff[l]=c:s.styleDiff[l]=[c,b]:s._unchangedStyles[l]=[c,b]}for(const l of Array.from(r.style))i.style.getPropertyValue(l)===""&&(s.styleDiff[l]=!1)}break}case"childList":{if(_e(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=Gn(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);_e(e.target,this.blockClass,this.blockSelector,!1)||Vi(i,this.mirror)||!ya(i,this.mirror)||(this.addedSet.has(i)?(Fi(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[Qt(t,o)]?Fi(this.movedSet,i):this.removes.push({parentId:o,id:t,isShadow:Gn(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(Vi(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[Qt(this.mirror.getId(e),t)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);_e(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(t=>this.genAdds(t)),zi(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 Fi(n,e){n.delete(e),e.childNodes.forEach(i=>Fi(n,i))}function Xt(n,e,i){return n.length===0?!1:eo(n,e,i)}function eo(n,e,i){const{parentNode:t}=e;if(!t)return!1;const o=i.getId(t);return n.some(s=>s.id===o)?!0:eo(n,t,i)}function no(n,e){return n.size===0?!1:io(n,e)}function io(n,e){const{parentNode:i}=e;return i?n.has(i)?!0:io(n,i):!1}let Wn;function Aa(n){Wn=n}function xa(){Wn=void 0}const q=n=>Wn?(...i)=>{try{return n(...i)}catch(t){if(Wn&&Wn(t)===!0)return;throw t}}:n,yn=[];function Zn(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 to(n,e){var i,t;const o=new Ma;yn.push(o),o.init(n);let s=window.MutationObserver||window.__rrMutationObserver;const r=(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");r&&window[r]&&(s=window[r]);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 La({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 r=[],l;const c=qn(q(g=>{const f=Date.now()-l;n(r.map(y=>(y.timeOffset-=f,y)),g),r=[],l=null}),s),b=q(qn(q(g=>{const f=Zn(g),{clientX:y,clientY:C}=Gi(g)?g.changedTouches[0]:g;l||(l=pi()),r.push({x:y,y:C,id:t.getId(f),timeOffset:pi()-l}),c(typeof DragEvent<"u"&&g instanceof DragEvent?F.Drag:g instanceof MouseEvent?F.MouseMove:F.TouchMove)}),o,{trailing:!1})),p=[Se("mousemove",b,i),Se("touchmove",b,i),Se("drag",b,i)];return q(()=>{p.forEach(g=>g())})}function Ta({mouseInteractionCb:n,doc:e,mirror:i,blockClass:t,blockSelector:o,sampling:s}){if(s.mouseInteraction===!1)return()=>{};const r=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,l=[];let c=null;const b=p=>g=>{const f=Zn(g);if(_e(f,t,o,!0))return;let y=null,C=p;if("pointerType"in g){switch(g.pointerType){case"mouse":y=Ze.Mouse;break;case"touch":y=Ze.Touch;break;case"pen":y=Ze.Pen;break}y===Ze.Touch?Le[p]===Le.MouseDown?C="TouchStart":Le[p]===Le.MouseUp&&(C="TouchEnd"):Ze.Pen}else Gi(g)&&(y=Ze.Touch);y!==null?(c=y,(C.startsWith("Touch")&&y===Ze.Touch||C.startsWith("Mouse")&&y===Ze.Mouse)&&(y=null)):Le[p]===Le.Click&&(y=c,c=null);const k=Gi(g)?g.changedTouches[0]:g;if(!k)return;const S=i.getId(f),{clientX:M,clientY:A}=k;q(n)(Object.assign({type:Le[C],id:S,x:M,y:A},y!==null&&{pointerType:y}))};return Object.keys(Le).filter(p=>Number.isNaN(Number(p))&&!p.endsWith("_Departed")&&r[p]!==!1).forEach(p=>{let g=gn(p);const f=b(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(Se(g,f,e))}),q(()=>{l.forEach(p=>p())})}function oo({scrollCb:n,doc:e,mirror:i,blockClass:t,blockSelector:o,sampling:s}){const r=q(qn(q(l=>{const c=Zn(l);if(!c||_e(c,t,o,!0))return;const b=i.getId(c);if(c===e&&e.defaultView){const p=Vt(e.defaultView);n({id:b,x:p.left,y:p.top})}else n({id:b,x:c.scrollLeft,y:c.scrollTop})}),s.scroll||100));return Se("scroll",r,e)}function Ea({viewportResizeCb:n},{win:e}){let i=-1,t=-1;const o=q(qn(q(()=>{const s=Gt(),r=zt();(i!==s||t!==r)&&(n({width:Number(r),height:Number(s)}),i=s,t=r)}),200));return Se("resize",o,e)}const Pa=["INPUT","TEXTAREA","SELECT"],so=new WeakMap;function Na({inputCb:n,doc:e,mirror:i,blockClass:t,blockSelector:o,ignoreClass:s,ignoreSelector:r,maskInputOptions:l,maskInputFn:c,sampling:b,userTriggeredOnInput:p}){function g(A){let _=Zn(A);const E=A.isTrusted,N=_&&_.tagName;if(_&&N==="OPTION"&&(_=_.parentElement),!_||!N||Pa.indexOf(N)<0||_e(_,t,o,!0)||_.classList.contains(s)||r&&_.matches(r))return;let G=_.value,z=!1;const U=Ki(_)||"";U==="radio"||U==="checkbox"?z=_.checked:(l[N.toLowerCase()]||l[U])&&(G=Ui({element:_,maskInputOptions:l,tagName:N,type:U,value:G,maskInputFn:c})),f(_,p?{text:G,isChecked:z,userTriggered:E}:{text:G,isChecked:z});const V=_.name;U==="radio"&&V&&z&&e.querySelectorAll(`input[type="radio"][name="${V}"]`).forEach(oe=>{if(oe!==_){const fe=oe.value;f(oe,p?{text:fe,isChecked:!z,userTriggered:!1}:{text:fe,isChecked:!z})}})}function f(A,_){const E=so.get(A);if(!E||E.text!==_.text||E.isChecked!==_.isChecked){so.set(A,_);const N=i.getId(A);q(n)(Object.assign(Object.assign({},_),{id:N}))}}const C=(b.input==="last"?["change"]:["input","change"]).map(A=>Se(A,q(g),e)),k=e.defaultView;if(!k)return()=>{C.forEach(A=>A())};const S=k.Object.getOwnPropertyDescriptor(k.HTMLInputElement.prototype,"value"),M=[[k.HTMLInputElement.prototype,"value"],[k.HTMLInputElement.prototype,"checked"],[k.HTMLSelectElement.prototype,"value"],[k.HTMLTextAreaElement.prototype,"value"],[k.HTMLSelectElement.prototype,"selectedIndex"],[k.HTMLOptionElement.prototype,"selected"]];return S&&S.set&&C.push(...M.map(A=>mi(A[0],A[1],{set(){q(g)({target:this,isTrusted:!1})}},!1,k))),q(()=>{C.forEach(A=>A())})}function bi(n){const e=[];function i(t,o){if(vi("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||vi("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||vi("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||vi("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const r=Array.from(t.parentRule.cssRules).indexOf(t);o.unshift(r)}else if(t.parentStyleSheet){const r=Array.from(t.parentStyleSheet.cssRules).indexOf(t);o.unshift(r)}return o}return i(n,e)}function an(n,e,i){let t,o;return n?(n.ownerNode?t=e.getId(n.ownerNode):o=i.getId(n),{styleId:o,id:t}):{}}function Ia({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,C]=f,{id:k,styleId:S}=an(g,e,i.styleMirror);return(k&&k!==-1||S&&S!==-1)&&n({id:k,styleId:S,adds:[{rule:y,index:C}]}),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:C,styleId:k}=an(g,e,i.styleMirror);return(C&&C!==-1||k&&k!==-1)&&n({id:C,styleId:k,removes:[{index:y}]}),p.apply(g,f)})});let r;t.CSSStyleSheet.prototype.replace&&(r=t.CSSStyleSheet.prototype.replace,t.CSSStyleSheet.prototype.replace=new Proxy(r,{apply:q((p,g,f)=>{const[y]=f,{id:C,styleId:k}=an(g,e,i.styleMirror);return(C&&C!==-1||k&&k!==-1)&&n({id:C,styleId:k,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:C,styleId:k}=an(g,e,i.styleMirror);return(C&&C!==-1||k&&k!==-1)&&n({id:C,styleId:k,replaceSync:y}),p.apply(g,f)})}));const c={};fi("CSSGroupingRule")?c.CSSGroupingRule=t.CSSGroupingRule:(fi("CSSMediaRule")&&(c.CSSMediaRule=t.CSSMediaRule),fi("CSSConditionRule")&&(c.CSSConditionRule=t.CSSConditionRule),fi("CSSSupportsRule")&&(c.CSSSupportsRule=t.CSSSupportsRule));const b={};return Object.entries(c).forEach(([p,g])=>{b[p]={insertRule:g.prototype.insertRule,deleteRule:g.prototype.deleteRule},g.prototype.insertRule=new Proxy(b[p].insertRule,{apply:q((f,y,C)=>{const[k,S]=C,{id:M,styleId:A}=an(y.parentStyleSheet,e,i.styleMirror);return(M&&M!==-1||A&&A!==-1)&&n({id:M,styleId:A,adds:[{rule:k,index:[...bi(y),S||0]}]}),f.apply(y,C)})}),g.prototype.deleteRule=new Proxy(b[p].deleteRule,{apply:q((f,y,C)=>{const[k]=C,{id:S,styleId:M}=an(y.parentStyleSheet,e,i.styleMirror);return(S&&S!==-1||M&&M!==-1)&&n({id:S,styleId:M,removes:[{index:[...bi(y),k]}]}),f.apply(y,C)})})}),q(()=>{t.CSSStyleSheet.prototype.insertRule=o,t.CSSStyleSheet.prototype.deleteRule=s,r&&(t.CSSStyleSheet.prototype.replace=r),l&&(t.CSSStyleSheet.prototype.replaceSync=l),Object.entries(c).forEach(([p,g])=>{g.prototype.insertRule=b[p].insertRule,g.prototype.deleteRule=b[p].deleteRule})})}function ao({mirror:n,stylesheetManager:e},i){var t,o,s;let r=null;i.nodeName==="#document"?r=n.getId(i):r=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,c=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!l||!c?()=>{}:(Object.defineProperty(i,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var b;return(b=c.get)===null||b===void 0?void 0:b.call(this)},set(b){var p;const g=(p=c.set)===null||p===void 0?void 0:p.call(this,b);if(r!==null&&r!==-1)try{e.adoptStyleSheets(b,r)}catch{}return g}}),q(()=>{Object.defineProperty(i,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))}function Ba({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,c,b)=>{var p;const[g,f,y]=b;if(i.has(g))return s.apply(c,[g,f,y]);const{id:C,styleId:k}=an((p=c.parentRule)===null||p===void 0?void 0:p.parentStyleSheet,e,t.styleMirror);return(C&&C!==-1||k&&k!==-1)&&n({id:C,styleId:k,set:{property:g,value:f,priority:y},index:bi(c.parentRule)}),l.apply(c,b)})});const r=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(r,{apply:q((l,c,b)=>{var p;const[g]=b;if(i.has(g))return r.apply(c,[g]);const{id:f,styleId:y}=an((p=c.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:bi(c.parentRule)}),l.apply(c,b)})}),q(()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=r})}function Ra({mediaInteractionCb:n,blockClass:e,blockSelector:i,mirror:t,sampling:o,doc:s}){const r=q(c=>qn(q(b=>{const p=Zn(b);if(!p||_e(p,e,i,!0))return;const{currentTime:g,volume:f,muted:y,playbackRate:C,loop:k}=p;n({type:c,id:t.getId(p),currentTime:g,volume:f,muted:y,playbackRate:C,loop:k})}),o.media||500)),l=[Se("play",r(0),s),Se("pause",r(1),s),Se("seeked",r(2),s),Se("volumechange",r(3),s),Se("ratechange",r(4),s)];return q(()=>{l.forEach(c=>c())})}function Da({fontCb:n,doc:e}){const i=e.defaultView;if(!i)return()=>{};const t=[],o=new WeakMap,s=i.FontFace;i.FontFace=function(c,b,p){const g=new s(c,b,p);return o.set(g,{family:c,buffer:typeof b!="string",descriptors:p,fontSource:typeof b=="string"?b:JSON.stringify(Array.from(new Uint8Array(b)))}),g};const r=In(e.fonts,"add",function(l){return function(c){return setTimeout(q(()=>{const b=o.get(c);b&&(n(b),o.delete(c))}),0),l.apply(this,[c])}});return t.push(()=>{i.FontFace=s}),t.push(r),q(()=>{t.forEach(l=>l())})}function Oa(n){const{doc:e,mirror:i,blockClass:t,blockSelector:o,selectionCb:s}=n;let r=!0;const l=q(()=>{const c=e.getSelection();if(!c||r&&(c!=null&&c.isCollapsed))return;r=c.isCollapsed||!1;const b=[],p=c.rangeCount||0;for(let g=0;g<p;g++){const f=c.getRangeAt(g),{startContainer:y,startOffset:C,endContainer:k,endOffset:S}=f;_e(y,t,o,!0)||_e(k,t,o,!0)||b.push({start:i.getId(y),startOffset:C,end:i.getId(k),endOffset:S})}s({ranges:b})});return l(),Se("selectionchange",l)}function Ha({doc:n,customElementCb:e}){const i=n.defaultView;return!i||!i.customElements?()=>{}:In(i.customElements,"define",function(o){return function(s,r,l){try{e({define:{name:s}})}catch{console.warn(`Custom element callback failed for ${s}`)}return o.apply(this,[s,r,l])}})}function Ua(n,e){const{mutationCb:i,mousemoveCb:t,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:r,inputCb:l,mediaInteractionCb:c,styleSheetRuleCb:b,styleDeclarationCb:p,canvasMutationCb:g,fontCb:f,selectionCb:y,customElementCb:C}=n;n.mutationCb=(...k)=>{e.mutation&&e.mutation(...k),i(...k)},n.mousemoveCb=(...k)=>{e.mousemove&&e.mousemove(...k),t(...k)},n.mouseInteractionCb=(...k)=>{e.mouseInteraction&&e.mouseInteraction(...k),o(...k)},n.scrollCb=(...k)=>{e.scroll&&e.scroll(...k),s(...k)},n.viewportResizeCb=(...k)=>{e.viewportResize&&e.viewportResize(...k),r(...k)},n.inputCb=(...k)=>{e.input&&e.input(...k),l(...k)},n.mediaInteractionCb=(...k)=>{e.mediaInteaction&&e.mediaInteaction(...k),c(...k)},n.styleSheetRuleCb=(...k)=>{e.styleSheetRule&&e.styleSheetRule(...k),b(...k)},n.styleDeclarationCb=(...k)=>{e.styleDeclaration&&e.styleDeclaration(...k),p(...k)},n.canvasMutationCb=(...k)=>{e.canvasMutation&&e.canvasMutation(...k),g(...k)},n.fontCb=(...k)=>{e.font&&e.font(...k),f(...k)},n.selectionCb=(...k)=>{e.selection&&e.selection(...k),y(...k)},n.customElementCb=(...k)=>{e.customElement&&e.customElement(...k),C(...k)}}function Ka(n,e={}){const i=n.doc.defaultView;if(!i)return()=>{};Ua(n,e);let t;n.recordDOM&&(t=to(n,n.doc));const o=La(n),s=Ta(n),r=oo(n),l=Ea(n,{win:i}),c=Na(n),b=Ra(n);let p=()=>{},g=()=>{},f=()=>{},y=()=>{};n.recordDOM&&(p=Ia(n,{win:i}),g=ao(n,n.doc),f=Ba(n,{win:i}),n.collectFonts&&(y=Da(n)));const C=Oa(n),k=Ha(n),S=[];for(const M of n.plugins)S.push(M.observer(M.callback,i,M.options));return q(()=>{yn.forEach(M=>M.reset()),t==null||t.disconnect(),o(),s(),r(),l(),c(),b(),p(),g(),f(),y(),C(),k(),S.forEach(M=>M())})}function vi(n){return typeof window[n]<"u"}function fi(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}class ro{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,i,t,o){const s=t||this.getIdToRemoteIdMap(e),r=o||this.getRemoteIdToIdMap(e);let l=s.get(i);return l||(l=this.generateIdFn(),s.set(i,l),r.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 ja{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ro(Dt),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ro(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:F.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 F.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 F.Drag:case F.TouchMove:case F.MouseMove:return i.data.positions.forEach(o=>{this.replaceIds(o,e,["id"])}),i;case F.ViewportResize:return!1;case F.MediaInteraction:case F.MouseInteraction:case F.Scroll:case F.CanvasMutation:case F.Input:return this.replaceIds(i.data,e,["id"]),i;case F.StyleSheetRule:case F.StyleDeclaration:return this.replaceIds(i.data,e,["id"]),this.replaceStyleIds(i.data,e,["styleId"]),i;case F.Font:return i;case F.Selection:return i.data.ranges.forEach(o=>{this.replaceIds(o,e,["start","end"])}),i;case F.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 Va{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=to(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(oo(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(ao({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(In(e.prototype,"attachShadow",function(o){return function(s){const r=o.call(this,s);return this.shadowRoot&&$t(this)&&t.addShadowRoot(this.shadowRoot,i),r}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}/*! *****************************************************************************
733
- Copyright (c) Microsoft Corporation.
734
-
735
- Permission to use, copy, modify, and/or distribute this software for any
736
- purpose with or without fee is hereby granted.
737
-
738
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
739
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
740
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
741
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
742
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
743
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
744
- PERFORMANCE OF THIS SOFTWARE.
745
- ***************************************************************************** */function Ga(n,e){var i={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&e.indexOf(t)<0&&(i[t]=n[t]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,t=Object.getOwnPropertySymbols(n);o<t.length;o++)e.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(n,t[o])&&(i[t[o]]=n[t[o]]);return i}function za(n,e,i,t){function o(s){return s instanceof i?s:new i(function(r){r(s)})}return new(i||(i=Promise))(function(s,r){function l(p){try{b(t.next(p))}catch(g){r(g)}}function c(p){try{b(t.throw(p))}catch(g){r(g)}}function b(p){p.done?s(p.value):o(p.value).then(l,c)}b((t=t.apply(n,[])).next())})}for(var Rn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fa=typeof Uint8Array>"u"?[]:new Uint8Array(256),gi=0;gi<Rn.length;gi++)Fa[Rn.charCodeAt(gi)]=gi;var qa=function(n){var e=new Uint8Array(n),i,t=e.length,o="";for(i=0;i<t;i+=3)o+=Rn[e[i]>>2],o+=Rn[(e[i]&3)<<4|e[i+1]>>4],o+=Rn[(e[i+1]&15)<<2|e[i+2]>>6],o+=Rn[e[i+2]&63];return t%3===2?o=o.substring(0,o.length-1)+"=":t%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const lo=new Map;function Wa(n,e){let i=lo.get(n);return i||(i=new Map,lo.set(n,i)),i.has(e)||i.set(e,[]),i.get(e)}const co=(n,e,i)=>{if(!n||!(ho(n,e)||typeof n=="object"))return;const t=n.constructor.name,o=Wa(i,t);let s=o.indexOf(n);return s===-1&&(s=o.length,o.push(n)),s};function yi(n,e,i){if(n instanceof Array)return n.map(t=>yi(t,e,i));if(n===null)return n;if(n instanceof Float32Array||n instanceof Float64Array||n instanceof Int32Array||n instanceof Uint32Array||n instanceof Uint8Array||n instanceof Uint16Array||n instanceof Int16Array||n instanceof Int8Array||n instanceof Uint8ClampedArray)return{rr_type:n.constructor.name,args:[Object.values(n)]};if(n instanceof ArrayBuffer){const t=n.constructor.name,o=qa(n);return{rr_type:t,base64:o}}else{if(n instanceof DataView)return{rr_type:n.constructor.name,args:[yi(n.buffer,e,i),n.byteOffset,n.byteLength]};if(n instanceof HTMLImageElement){const t=n.constructor.name,{src:o}=n;return{rr_type:t,src:o}}else if(n instanceof HTMLCanvasElement){const t="HTMLImageElement",o=n.toDataURL();return{rr_type:t,src:o}}else{if(n instanceof ImageData)return{rr_type:n.constructor.name,args:[yi(n.data,e,i),n.width,n.height]};if(ho(n,e)||typeof n=="object"){const t=n.constructor.name,o=co(n,e,i);return{rr_type:t,index:o}}}}return n}const uo=(n,e,i)=>n.map(t=>yi(t,e,i)),ho=(n,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof e[o]=="function").find(o=>n instanceof e[o]);function Za(n,e,i,t){const o=[],s=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const r of s)try{if(typeof e.CanvasRenderingContext2D.prototype[r]!="function")continue;const l=In(e.CanvasRenderingContext2D.prototype,r,function(c){return function(...b){return _e(this.canvas,i,t,!0)||setTimeout(()=>{const p=uo(b,e,this);n(this.canvas,{type:Bn["2D"],property:r,args:p})},0),c.apply(this,b)}});o.push(l)}catch{const c=mi(e.CanvasRenderingContext2D.prototype,r,{set(b){n(this.canvas,{type:Bn["2D"],property:r,args:[b],setter:!0})}});o.push(c)}return()=>{o.forEach(r=>r())}}function Ja(n){return n==="experimental-webgl"?"webgl":n}function mo(n,e,i,t){const o=[];try{const s=In(n.HTMLCanvasElement.prototype,"getContext",function(r){return function(l,...c){if(!_e(this,e,i,!0)){const b=Ja(l);if("__context"in this||(this.__context=b),t&&["webgl","webgl2"].includes(b))if(c[0]&&typeof c[0]=="object"){const p=c[0];p.preserveDrawingBuffer||(p.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return r.apply(this,[l,...c])}});o.push(s)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(s=>s())}}function po(n,e,i,t,o,s,r){const l=[],c=Object.getOwnPropertyNames(n);for(const b of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(b))try{if(typeof n[b]!="function")continue;const p=In(n,b,function(g){return function(...f){const y=g.apply(this,f);if(co(y,r,this),"tagName"in this.canvas&&!_e(this.canvas,t,o,!0)){const C=uo(f,r,this),k={type:e,property:b,args:C};i(this.canvas,k)}return y}});l.push(p)}catch{const g=mi(n,b,{set(f){i(this.canvas,{type:e,property:b,args:[f],setter:!0})}});l.push(g)}return l}function $a(n,e,i,t,o){const s=[];return s.push(...po(e.WebGLRenderingContext.prototype,Bn.WebGL,n,i,t,o,e)),typeof e.WebGL2RenderingContext<"u"&&s.push(...po(e.WebGL2RenderingContext.prototype,Bn.WebGL2,n,i,t,o,e)),()=>{s.forEach(r=>r())}}function Ya(n,e){var i=n.toString(),t=i.split(`
746
- `);t.pop(),t.shift();for(var o=t[0].search(/\S/),s=/(['"])__worker_loader_strict__(['"])/g,r=0,l=t.length;r<l;++r)t[r]=t[r].substring(o).replace(s,"$1use strict$2")+`
747
- `;return t}function Qa(n,e){var i=Ya(n),t=new Blob(i,{type:"application/javascript"});return URL.createObjectURL(t)}function Xa(n,e){var i;return function(o){return i=i||Qa(n),new Worker(i,o)}}var er=Xa(function(){(function(){"__worker_loader_strict__";/*! *****************************************************************************
748
- Copyright (c) Microsoft Corporation.
749
-
750
- Permission to use, copy, modify, and/or distribute this software for any
751
- purpose with or without fee is hereby granted.
752
-
753
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
754
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
755
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
756
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
757
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
758
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
759
- PERFORMANCE OF THIS SOFTWARE.
760
- ***************************************************************************** */function n(b,p,g,f){function y(C){return C instanceof g?C:new g(function(k){k(C)})}return new(g||(g=Promise))(function(C,k){function S(_){try{A(f.next(_))}catch(E){k(E)}}function M(_){try{A(f.throw(_))}catch(E){k(E)}}function A(_){_.done?C(_.value):y(_.value).then(S,M)}A((f=f.apply(b,[])).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(b){var p=new Uint8Array(b),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,r=new Map;function l(b,p,g){return n(this,void 0,void 0,function*(){const f=`${b}-${p}`;if("OffscreenCanvas"in globalThis){if(r.has(f))return r.get(f);const y=new OffscreenCanvas(b,p);y.getContext("2d");const k=yield(yield y.convertToBlob(g)).arrayBuffer(),S=o(k);return r.set(f,S),S}else return""})}const c=self;c.onmessage=function(b){return n(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:p,bitmap:g,width:f,height:y,dataURLOptions:C}=b.data,k=l(f,y,C),S=new OffscreenCanvas(f,y);S.getContext("2d").drawImage(g,0,0),g.close();const A=yield S.convertToBlob(C),_=A.type,E=yield A.arrayBuffer(),N=o(E);if(!s.has(p)&&(yield k)===N)return s.set(p,N),c.postMessage({id:p});if(s.get(p)===N)return c.postMessage({id:p});c.postMessage({id:p,type:_,base64:N,width:f,height:y}),s.set(p,N)}else return c.postMessage({id:b.data.id})})}})()});class nr{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=(c,b)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(c)||this.pendingCanvasMutations.set(c,[]),this.pendingCanvasMutations.get(c).push(b)};const{sampling:i="all",win:t,blockClass:o,blockSelector:s,recordCanvas:r,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,r&&i==="all"&&this.initCanvasMutationObserver(t,o,s),r&&typeof i=="number"&&this.initCanvasFPSObserver(i,t,o,s,{dataURLOptions:l})}initCanvasFPSObserver(e,i,t,o,s){const r=mo(i,t,o,!0),l=new Map,c=new er;c.onmessage=C=>{const{id:k}=C.data;if(l.set(k,!1),!("base64"in C.data))return;const{base64:S,type:M,width:A,height:_}=C.data;this.mutationCb({id:k,type:Bn["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 b=1e3/e;let p=0,g;const f=()=>{const C=[];return i.document.querySelectorAll("canvas").forEach(k=>{_e(k,t,o,!0)||C.push(k)}),C},y=C=>{if(p&&C-p<b){g=requestAnimationFrame(y);return}p=C,f().forEach(k=>za(this,void 0,void 0,function*(){var S;const M=this.mirror.getId(k);if(l.get(M)||k.width===0||k.height===0)return;if(l.set(M,!0),["webgl","webgl2"].includes(k.__context)){const _=k.getContext(k.__context);((S=_==null?void 0:_.getContextAttributes())===null||S===void 0?void 0:S.preserveDrawingBuffer)===!1&&_.clear(_.COLOR_BUFFER_BIT)}const A=yield createImageBitmap(k);c.postMessage({id:M,bitmap:A,width:k.width,height:k.height,dataURLOptions:s.dataURLOptions},[A])})),g=requestAnimationFrame(y)};g=requestAnimationFrame(y),this.resetObservers=()=>{r(),cancelAnimationFrame(g)}}initCanvasMutationObserver(e,i,t){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=mo(e,i,t,!1),s=Za(this.processMutation.bind(this),e,i,t),r=$a(this.processMutation.bind(this),e,i,t,this.mirror);this.resetObservers=()=>{o(),s(),r()}}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(r=>Ga(r,["type"])),{type:s}=t[0];this.mutationCb({id:i,type:s,commands:o}),this.pendingCanvasMutations.delete(e)}}class ir{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new wa,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 r;this.styleMirror.has(s)?r=this.styleMirror.getId(s):(r=this.styleMirror.add(s),o.push({styleId:r,rules:Array.from(s.rules||CSSRule,(l,c)=>({rule:Nt(l),index:c}))})),t.styleIds.push(r)}o.length>0&&(t.styles=o),this.adoptedStyleSheetCb(t)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class tr{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:pi()})}let ae,ki,qi,wi=!1;const Oe=$s();function Jn(n={}){const{emit:e,checkoutEveryNms:i,checkoutEveryNth:t,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:r="rr-ignore",ignoreSelector:l=null,maskTextClass:c="rr-mask",maskTextSelector:b=null,inlineStylesheet:p=!0,maskAllInputs:g,maskInputOptions:f,slimDOMOptions:y,maskInputFn:C,maskTextFn:k,hooks:S,packFn:M,sampling:A={},dataURLOptions:_={},mousemoveWait:E,recordDOM:N=!0,recordCanvas:G=!1,recordCrossOriginIframes:z=!1,recordAfter:U=n.recordAfter==="DOMContentLoaded"?n.recordAfter:"load",userTriggeredOnInput:V=!1,collectFonts:oe=!1,inlineImages:fe=!1,plugins:K,keepIframeSrcFn:Me=()=>!1,ignoreCSSAttributes:ue=new Set([]),errorHandler:Te}=n;Aa(Te);const Ae=z?window.parent===window:!0;let Xe=!1;if(!Ae)try{window.parent.document&&(Xe=!1)}catch{Xe=!0}if(Ae&&!e)throw new Error("emit function is required");E!==void 0&&A.mousemove===void 0&&(A.mousemove=E),Oe.reset();const pn=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},en=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||{};ka();let Sn,bn=0;const Ee=B=>{for(const he of K||[])he.eventProcessor&&(B=he.eventProcessor(B));return M&&!Xe&&(B=M(B)),B};ae=(B,he)=>{var $;if(!(($=yn[0])===null||$===void 0)&&$.isFrozen()&&B.type!==W.FullSnapshot&&!(B.type===W.IncrementalSnapshot&&B.data.source===F.Mutation)&&yn.forEach(ge=>ge.unfreeze()),Ae)e==null||e(Ee(B),he);else if(Xe){const ge={type:"rrweb",event:Ee(B),origin:window.location.origin,isCheckout:he};window.parent.postMessage(ge,"*")}if(B.type===W.FullSnapshot)Sn=B,bn=0;else if(B.type===W.IncrementalSnapshot){if(B.data.source===F.Mutation&&B.data.isAttachIframe)return;bn++;const ge=t&&bn>=t,We=i&&B.timestamp-Sn.timestamp>i;(ge||We)&&ki(!0)}};const nn=B=>{ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.Mutation},B)}))},_n=B=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.Scroll},B)})),re=B=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.CanvasMutation},B)})),be=B=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.AdoptedStyleSheet},B)})),Re=new ir({mutationCb:nn,adoptedStyleSheetCb:be}),Pe=new ja({mirror:Oe,mutationCb:nn,stylesheetManager:Re,recordCrossOriginIframes:z,wrappedEmit:ae});for(const B of K||[])B.getMirror&&B.getMirror({nodeMirror:Oe,crossOriginIframeMirror:Pe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Pe.crossOriginIframeStyleMirror});const Ce=new tr;qi=new nr({recordCanvas:G,mutationCb:re,win:window,blockClass:o,blockSelector:s,mirror:Oe,sampling:A.canvas,dataURLOptions:_});const qe=new Va({mutationCb:nn,scrollCb:_n,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:b,inlineStylesheet:p,maskInputOptions:pn,dataURLOptions:_,maskTextFn:k,maskInputFn:C,recordCanvas:G,inlineImages:fe,sampling:A,slimDOMOptions:en,iframeManager:Pe,stylesheetManager:Re,canvasManager:qi,keepIframeSrcFn:Me,processedNodeManager:Ce},mirror:Oe});ki=(B=!1)=>{if(!N)return;ae(de({type:W.Meta,data:{href:window.location.href,width:zt(),height:Gt()}}),B),Re.reset(),qe.init(),yn.forEach($=>$.lock());const he=ga(document,{mirror:Oe,blockClass:o,blockSelector:s,maskTextClass:c,maskTextSelector:b,inlineStylesheet:p,maskAllInputs:pn,maskTextFn:k,slimDOM:en,dataURLOptions:_,recordCanvas:G,inlineImages:fe,onSerialize:$=>{Wt($,Oe)&&Pe.addIframe($),Zt($,Oe)&&Re.trackLinkElement($),zi($)&&qe.addShadowRoot($.shadowRoot,document)},onIframeLoad:($,ge)=>{Pe.attachIframe($,ge),qe.observeAttachShadow($)},onStylesheetLoad:($,ge)=>{Re.attachLinkElement($,ge)},keepIframeSrcFn:Me});if(!he)return console.warn("Failed to snapshot the document");ae(de({type:W.FullSnapshot,data:{node:he,initialOffset:Vt(window)}}),B),yn.forEach($=>$.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Re.adoptStyleSheets(document.adoptedStyleSheets,Oe.getId(document))};try{const B=[],he=ge=>{var We;return q(Ka)({mutationCb:nn,mousemoveCb:(Q,ni)=>ae(de({type:W.IncrementalSnapshot,data:{source:ni,positions:Q}})),mouseInteractionCb:Q=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.MouseInteraction},Q)})),scrollCb:_n,viewportResizeCb:Q=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.ViewportResize},Q)})),inputCb:Q=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.Input},Q)})),mediaInteractionCb:Q=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.MediaInteraction},Q)})),styleSheetRuleCb:Q=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.StyleSheetRule},Q)})),styleDeclarationCb:Q=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.StyleDeclaration},Q)})),canvasMutationCb:re,fontCb:Q=>ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.Font},Q)})),selectionCb:Q=>{ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.Selection},Q)}))},customElementCb:Q=>{ae(de({type:W.IncrementalSnapshot,data:Object.assign({source:F.CustomElement},Q)}))},blockClass:o,ignoreClass:r,ignoreSelector:l,maskTextClass:c,maskTextSelector:b,maskInputOptions:pn,inlineStylesheet:p,sampling:A,recordDOM:N,recordCanvas:G,inlineImages:fe,userTriggeredOnInput:V,collectFonts:oe,doc:ge,maskInputFn:C,maskTextFn:k,keepIframeSrcFn:Me,blockSelector:s,slimDOMOptions:en,dataURLOptions:_,mirror:Oe,iframeManager:Pe,stylesheetManager:Re,shadowDomManager:qe,processedNodeManager:Ce,canvasManager:qi,ignoreCSSAttributes:ue,plugins:((We=K==null?void 0:K.filter(Q=>Q.observer))===null||We===void 0?void 0:We.map(Q=>({observer:Q.observer,options:Q.options,callback:ni=>ae(de({type:W.Plugin,data:{plugin:Q.name,payload:ni}}))})))||[]},S)};Pe.addLoadListener(ge=>{try{B.push(he(ge.contentDocument))}catch(We){console.warn(We)}});const $=()=>{ki(),B.push(he(document)),wi=!0};return document.readyState==="interactive"||document.readyState==="complete"?$():(B.push(Se("DOMContentLoaded",()=>{ae(de({type:W.DomContentLoaded,data:{}})),U==="DOMContentLoaded"&&$()})),B.push(Se("load",()=>{ae(de({type:W.Load,data:{}})),U==="load"&&$()},window))),()=>{B.forEach(ge=>ge()),Ce.destroy(),wi=!1,xa()}}catch(B){console.warn(B)}}Jn.addCustomEvent=(n,e)=>{if(!wi)throw new Error("please add custom event after start recording");ae(de({type:W.Custom,data:{tag:n,payload:e}}))},Jn.freezePage=()=>{yn.forEach(n=>n.freeze())},Jn.takeFullSnapshot=n=>{if(!wi)throw new Error("please take full snapshot after start recording");ki(n)},Jn.mirror=Oe;var bo=(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))(bo||{}),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||{}),Je={DEBUG:!1,LIB_VERSION:"2.55.1"},R;if(typeof window>"u"){var vo={hostname:""};R={navigator:{userAgent:"",onLine:!0},document:{location:vo,referrer:""},screen:{width:0,height:0},location:vo}}else R=window;var $n=24*60*60*1e3,Wi=8*1e3,Ci=Array.prototype,or=Function.prototype,fo=Object.prototype,rn=Ci.slice,Yn=fo.toString,Si=fo.hasOwnProperty,ce=R.console,ln=R.navigator,X=R.document,_i=R.opera,Mi=R.screen,ze=ln.userAgent,Zi=or.bind,go=Ci.forEach,yo=Ci.indexOf,ko=Ci.map,sr=Array.isArray,Ji={},m={trim:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},J={log:function(){if(Je.DEBUG&&!m.isUndefined(ce)&&ce)try{ce.log.apply(ce,arguments)}catch{m.each(arguments,function(e){ce.log(e)})}},warn:function(){if(Je.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(Je.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)})}}}},$i=function(n,e){return function(){return arguments[0]="["+e+"] "+arguments[0],n.apply(J,arguments)}},Ai=function(n){return{log:$i(J.log,n),error:$i(J.error,n),critical:$i(J.critical,n)}};m.bind=function(n,e){var i,t;if(Zi&&n.bind===Zi)return Zi.apply(n,rn.call(arguments,1));if(!m.isFunction(n))throw new TypeError;return i=rn.call(arguments,2),t=function(){if(!(this instanceof t))return n.apply(e,i.concat(rn.call(arguments)));var o={};o.prototype=n.prototype;var s=new o;o.prototype=null;var r=n.apply(s,i.concat(rn.call(arguments)));return Object(r)===r?r:s},t},m.each=function(n,e,i){if(n!=null){if(go&&n.forEach===go)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)===Ji)return}else for(var s in n)if(Si.call(n,s)&&e.call(i,n[s],s,n)===Ji)return}},m.extend=function(n){return m.each(rn.call(arguments,1),function(e){for(var i in e)e[i]!==void 0&&(n[i]=e[i])}),n},m.isArray=sr||function(n){return Yn.call(n)==="[object Array]"},m.isFunction=function(n){try{return/^\s*\bfunction\b/.test(n)}catch{return!1}},m.isArguments=function(n){return!!(n&&Si.call(n,"callee"))},m.toArray=function(n){return n?n.toArray?n.toArray():m.isArray(n)||m.isArguments(n)?rn.call(n):m.values(n):[]},m.map=function(n,e,i){if(ko&&n.map===ko)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:yo&&n.indexOf===yo?n.indexOf(e)!=-1:(m.each(n,function(t){if(i||(i=t===e))return Ji}),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(Si.call(n,e))return!1;return!0}return!1},m.isUndefined=function(n){return n===void 0},m.isString=function(n){return Yn.call(n)=="[object String]"},m.isDate=function(n){return Yn.call(n)=="[object Date]"},m.isNumber=function(n){return Yn.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,r={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return s.lastIndex=0,s.test(o)?'"'+o.replace(s,function(l){var c=r[l];return typeof c=="string"?c:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+o+'"'},t=function(o,s){var r="",l=" ",c=0,b="",p="",g=0,f=r,y=[],C=s[o];switch(C&&typeof C=="object"&&typeof C.toJSON=="function"&&(C=C.toJSON(o)),typeof C){case"string":return i(C);case"number":return isFinite(C)?String(C):"null";case"boolean":case"null":return String(C);case"object":if(!C)return"null";if(r+=l,y=[],Yn.apply(C)==="[object Array]"){for(g=C.length,c=0;c<g;c+=1)y[c]=t(c,C)||"null";return p=y.length===0?"[]":r?`[
761
- `+r+y.join(`,
762
- `+r)+`
763
- `+f+"]":"["+y.join(",")+"]",r=f,p}for(b in C)Si.call(C,b)&&(p=t(b,C),p&&y.push(i(b)+(r?": ":":")+p));return p=y.length===0?"{}":r?"{"+y.join(",")+f+"}":"{"+y.join(",")+"}",r=f,p}};return t("",{"":e})}}(),m.JSONDecode=function(){var n,e,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
764
- `,r:"\r",t:" "},t,o=function(y){var C=new SyntaxError(y);throw C.at=n,C.text=t,C},s=function(y){return y&&y!==e&&o("Expected '"+y+"' instead of '"+e+"'"),e=t.charAt(n),n+=1,e},r=function(){var y,C="";for(e==="-"&&(C="-",s("-"));e>="0"&&e<="9";)C+=e,s();if(e===".")for(C+=".";s()&&e>="0"&&e<="9";)C+=e;if(e==="e"||e==="E")for(C+=e,s(),(e==="-"||e==="+")&&(C+=e,s());e>="0"&&e<="9";)C+=e,s();if(y=+C,!isFinite(y))o("Bad number");else return y},l=function(){var y,C,k="",S;if(e==='"')for(;s();){if(e==='"')return s(),k;if(e==="\\")if(s(),e==="u"){for(S=0,C=0;C<4&&(y=parseInt(s(),16),!!isFinite(y));C+=1)S=S*16+y;k+=String.fromCharCode(S)}else if(typeof i[e]=="string")k+=i[e];else break;else k+=e}o("Bad string")},c=function(){for(;e&&e<=" ";)s()},b=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("["),c(),e==="]")return s("]"),y;for(;e;){if(y.push(p()),c(),e==="]")return s("]"),y;s(","),c()}}o("Bad array")},f=function(){var y,C={};if(e==="{"){if(s("{"),c(),e==="}")return s("}"),C;for(;e;){if(y=l(),c(),s(":"),Object.hasOwnProperty.call(C,y)&&o('Duplicate key "'+y+'"'),C[y]=p(),c(),e==="}")return s("}"),C;s(","),c()}}o("Bad object")};return p=function(){switch(c(),e){case"{":return f();case"[":return g();case'"':return l();case"-":return r();default:return e>="0"&&e<="9"?r():b()}},function(y){var C;return t=y,n=0,e=" ",C=p(),c(),e&&o("Syntax error"),C}}(),m.base64Encode=function(n){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i,t,o,s,r,l,c,b,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++),b=i<<16|t<<8|o,s=b>>18&63,r=b>>12&63,l=b>>6&63,c=b&63,y[g++]=e.charAt(s)+e.charAt(r)+e.charAt(l)+e.charAt(c);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,`
788
+ or you can use record.mirror to access the mirror instance during recording.`,ec={map:{},getId:function(){return console.error(Dt),-1},getNode:function(){return console.error(Dt),null},removeNodeFromMap:function(){console.error(Dt)},has:function(){return console.error(Dt),!1},reset:function(){console.error(Dt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ec=new Proxy(ec,{get:function(t,r,e){return r==="map"&&console.error(Dt),Reflect.get(t,r,e)}}));function wi(n,t,r){r===void 0&&(r={});var e=null,i=0;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];var u=Date.now();!i&&r.leading===!1&&(i=u);var c=t-(u-i),d=this;c<=0||c>t?(e&&(clearTimeout(e),e=null),i=u,n.apply(d,s)):!e&&r.trailing!==!1&&(e=setTimeout(function(){i=r.leading===!1?0:Date.now(),e=null,n.apply(d,s)},c))}}function Or(n,t,r,e,i){i===void 0&&(i=window);var o=i.Object.getOwnPropertyDescriptor(n,t);return i.Object.defineProperty(n,t,e?r:{set:function(a){var u=this;setTimeout(function(){r.set.call(u,a)},0),o&&o.set&&o.set.call(this,a)}}),function(){return Or(n,t,o||{},!0)}}function Ht(n,t,r){try{if(!(t in n))return function(){};var e=n[t],i=r(e);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:e}})),n[t]=i,function(){n[t]=e}}catch{return function(){}}}var Nr=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Nr=function(){return new Date().getTime()});function nc(n){var t,r,e,i,o=n.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:n.pageXOffset!==void 0?n.pageXOffset:o.documentElement.scrollLeft||(o==null?void 0:o.body)&&((t=ee.parentElement(o.body))==null?void 0:t.scrollLeft)||((r=o==null?void 0:o.body)==null?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:n.pageYOffset!==void 0?n.pageYOffset:(o==null?void 0:o.documentElement.scrollTop)||(o==null?void 0:o.body)&&((e=ee.parentElement(o.body))==null?void 0:e.scrollTop)||((i=o==null?void 0:o.body)==null?void 0:i.scrollTop)||0}}function tc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ic(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function rc(n){if(!n)return null;var t=n.nodeType===n.ELEMENT_NODE?n:ee.parentElement(n);return t}function Ye(n,t,r,e){if(!n)return!1;var i=rc(n);if(!i)return!1;try{if(typeof t=="string"){if(i.classList.contains(t)||e&&i.closest("."+t)!==null)return!0}else if($i(i,t,e))return!0}catch{}return!!(r&&(i.matches(r)||e&&i.closest(r)!==null))}function Pb(n,t){return t.getId(n)!==-1}function Es(n,t,r){return n.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(n)===oi}function oc(n,t){if(ii(n))return!1;var r=t.getId(n);if(!t.has(r))return!0;var e=ee.parentNode(n);return e&&e.nodeType===n.DOCUMENT_NODE?!1:e?oc(e,t):!0}function Ls(n){return!!n.changedTouches}function Rb(n){n===void 0&&(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)}function sc(n,t){return!!(n.nodeName==="IFRAME"&&t.getMeta(n))}function ac(n,t){return!!(n.nodeName==="LINK"&&n.nodeType===n.ELEMENT_NODE&&n.getAttribute&&n.getAttribute("rel")==="stylesheet"&&t.getMeta(n))}function Ts(n){return n?J(n,yb)&&"shadowRoot"in n?!!n.shadowRoot:!!ee.shadowRoot(n):!1}var Ob=function(){function n(){R(this,"id",1),R(this,"styleIDMap",new WeakMap),R(this,"idStyleMap",new Map)}var t=n.prototype;return t.getId=function(e){var i;return(i=this.styleIDMap.get(e))!=null?i:-1},t.has=function(e){return this.styleIDMap.has(e)},t.add=function(e,i){if(this.has(e))return this.getId(e);var o;return i===void 0?o=this.id++:o=i,this.styleIDMap.set(e,o),this.idStyleMap.set(o,e),o},t.getStyle=function(e){return this.idStyleMap.get(e)||null},t.reset=function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1},t.generateId=function(){return this.id++},n}();function uc(n){var t,r=null;return"getRootNode"in n&&((t=ee.getRootNode(n))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&ee.host(ee.getRootNode(n))&&(r=ee.host(ee.getRootNode(n))),r}function Nb(n){for(var t=n,r;r=uc(t);)t=r;return t}function Bb(n){var t=n.ownerDocument;if(!t)return!1;var r=Nb(n);return ee.contains(t,r)}function lc(n){var t=n.ownerDocument;return t?ee.contains(t,n)||Bb(n):!1}var ne=function(n){return 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}(ne||{}),$=function(n){return 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}($||{}),Qe=function(n){return 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}(Qe||{}),Bn=function(n){return n[n.Mouse=0]="Mouse",n[n.Pen=1]="Pen",n[n.Touch=2]="Touch",n}(Bn||{}),Ut=function(n){return n[n["2D"]=0]="2D",n[n.WebGL=1]="WebGL",n[n.WebGL2=2]="WebGL2",n}(Ut||{}),Ft=function(n){return n[n.Play=0]="Play",n[n.Pause=1]="Pause",n[n.Seeked=2]="Seeked",n[n.VolumeChange=3]="VolumeChange",n[n.RateChange=4]="RateChange",n}(Ft||{}),cc=function(n){return 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",n}(cc||{});function dc(n){return"__ln"in n}var Db=function(){function n(){R(this,"length",0),R(this,"head",null),R(this,"tail",null)}var t=n.prototype;return t.get=function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var i=this.head,o=0;o<e;o++)i=(i==null?void 0:i.next)||null;return i},t.addNode=function(e){var i={value:e,previous:null,next:null};if(e.__ln=i,e.previousSibling&&dc(e.previousSibling)){var o=e.previousSibling.__ln.next;i.next=o,i.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=i,o&&(o.previous=i)}else if(e.nextSibling&&dc(e.nextSibling)&&e.nextSibling.__ln.previous){var s=e.nextSibling.__ln.previous;i.previous=s,i.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=i,s&&(s.next=i)}else this.head&&(this.head.previous=i),i.next=this.head,this.head=i;i.next===null&&(this.tail=i),this.length++},t.removeNode=function(e){var 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--)},n}(),hc=function(n,t){return n+"@"+t},Hb=function(){function n(){var r=this;R(this,"frozen",!1),R(this,"locked",!1),R(this,"texts",[]),R(this,"attributes",[]),R(this,"attributeMap",new WeakMap),R(this,"removes",[]),R(this,"mapRemoves",[]),R(this,"movedMap",{}),R(this,"addedSet",new Set),R(this,"movedSet",new Set),R(this,"droppedSet",new Set),R(this,"removesSubTreeCache",new Set),R(this,"mutationCb"),R(this,"blockClass"),R(this,"blockSelector"),R(this,"maskTextClass"),R(this,"maskTextSelector"),R(this,"inlineStylesheet"),R(this,"maskInputOptions"),R(this,"maskTextFn"),R(this,"maskInputFn"),R(this,"keepIframeSrcFn"),R(this,"recordCanvas"),R(this,"inlineImages"),R(this,"slimDOMOptions"),R(this,"dataURLOptions"),R(this,"doc"),R(this,"mirror"),R(this,"iframeManager"),R(this,"stylesheetManager"),R(this,"shadowDomManager"),R(this,"canvasManager"),R(this,"processedNodeManager"),R(this,"unattachedDoc"),R(this,"processMutations",function(e){e.forEach(r.processMutation),r.emit()}),R(this,"emit",function(){if(!(r.frozen||r.locked)){for(var e=[],i=new Set,o=new Db,s=function(G){for(var V=G,X=oi;X===oi;)V=V&&V.nextSibling,X=V&&r.mirror.getId(V);return X},a=function(G){var V=ee.parentNode(G);if(!(!V||!lc(G))){var X=!1;if(G.nodeType===Node.TEXT_NODE){var Be=V.tagName;if(Be==="TEXTAREA")return;Be==="STYLE"&&r.addedSet.has(V)&&(X=!0)}var te=ii(V)?r.mirror.getId(uc(G)):r.mirror.getId(V),Ue=s(G);if(te===-1||Ue===-1)return o.addNode(G);var Pe=Tt(G,{doc:r.doc,mirror:r.mirror,blockClass:r.blockClass,blockSelector:r.blockSelector,maskTextClass:r.maskTextClass,maskTextSelector:r.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:r.inlineStylesheet,maskInputOptions:r.maskInputOptions,maskTextFn:r.maskTextFn,maskInputFn:r.maskInputFn,slimDOMOptions:r.slimDOMOptions,dataURLOptions:r.dataURLOptions,recordCanvas:r.recordCanvas,inlineImages:r.inlineImages,onSerialize:function(pe){sc(pe,r.mirror)&&r.iframeManager.addIframe(pe),ac(pe,r.mirror)&&r.stylesheetManager.trackLinkElement(pe),Ts(G)&&r.shadowDomManager.addShadowRoot(ee.shadowRoot(G),r.doc)},onIframeLoad:function(pe,xe){r.iframeManager.attachIframe(pe,xe),r.shadowDomManager.observeAttachShadow(pe)},onStylesheetLoad:function(pe,xe){r.stylesheetManager.attachLinkElement(pe,xe)},cssCaptured:X});Pe&&(e.push({parentId:te,nextId:Ue,node:Pe}),i.add(Pe.id))}};r.mapRemoves.length;)r.mirror.removeNodeFromMap(r.mapRemoves.shift());for(var u=D(r.movedSet),c;!(c=u()).done;){var d=c.value;mc(r.removesSubTreeCache,d,r.mirror)&&!r.movedSet.has(ee.parentNode(d))||a(d)}for(var h=D(r.addedSet),p;!(p=h()).done;){var y=p.value;!fc(r.droppedSet,y)&&!mc(r.removesSubTreeCache,y,r.mirror)||fc(r.movedSet,y)?a(y):r.droppedSet.add(y)}for(var w=null;o.length;){var k=null;if(w){var b=r.mirror.getId(ee.parentNode(w.value)),S=s(w.value);b!==-1&&S!==-1&&(k=w)}if(!k)for(var A=o.tail;A;){var x=A;if(A=A.previous,x){var E=r.mirror.getId(ee.parentNode(x.value)),L=s(x.value);if(L===-1)continue;if(E!==-1){k=x;break}else{var P=x.value,H=ee.parentNode(P);if(H&&H.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var N=ee.host(H),F=r.mirror.getId(N);if(F!==-1){k=x;break}}}}}if(!k){for(;o.head;)o.removeNode(o.head.value);break}w=k.previous,o.removeNode(k.value),a(k.value)}var z={texts:r.texts.map(function(G){var V=G.node,X=ee.parentNode(V);return X&&X.tagName==="TEXTAREA"&&r.genTextAreaValueMutation(X),{id:r.mirror.getId(V),value:G.value}}).filter(function(G){return!i.has(G.id)}).filter(function(G){return r.mirror.has(G.id)}),attributes:r.attributes.map(function(G){var V=G.attributes;if(typeof V.style=="string"){var X=JSON.stringify(G.styleDiff),Be=JSON.stringify(G._unchangedStyles);X.length<V.style.length&&(X+Be).split("var(").length===V.style.split("var(").length&&(V.style=G.styleDiff)}return{id:r.mirror.getId(G.node),attributes:V}}).filter(function(G){return!i.has(G.id)}).filter(function(G){return r.mirror.has(G.id)}),removes:r.removes,adds:e};!z.texts.length&&!z.attributes.length&&!z.removes.length&&!z.adds.length||(r.texts=[],r.attributes=[],r.attributeMap=new WeakMap,r.removes=[],r.addedSet=new Set,r.movedSet=new Set,r.droppedSet=new Set,r.removesSubTreeCache=new Set,r.movedMap={},r.mutationCb(z))}}),R(this,"genTextAreaValueMutation",function(e){var i=r.attributeMap.get(e);i||(i={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},r.attributes.push(i),r.attributeMap.set(e,i)),i.attributes.value=Array.from(ee.childNodes(e),function(o){return ee.textContent(o)||""}).join("")}),R(this,"processMutation",function(e){if(!Es(e.target,r.mirror,r.slimDOMOptions))switch(e.type){case"characterData":{var i=ee.textContent(e.target);!Ye(e.target,r.blockClass,r.blockSelector,!1)&&i!==e.oldValue&&r.texts.push({value:nu(e.target,r.maskTextClass,r.maskTextSelector,!0)&&i?r.maskTextFn?r.maskTextFn(i,rc(e.target)):i.replace(/[\S]/g,"*"):i,node:e.target});break}case"attributes":{var o=e.target,s=e.attributeName,a=e.target.getAttribute(s);if(s==="value"){var u=go(o);a=bo({element:o,maskInputOptions:r.maskInputOptions,tagName:o.tagName,type:u,value:a,maskInputFn:r.maskInputFn})}if(Ye(e.target,r.blockClass,r.blockSelector,!1)||a===e.oldValue)return;var c=r.attributeMap.get(e.target);if(o.tagName==="IFRAME"&&s==="src"&&!r.keepIframeSrcFn(a))if(!o.contentDocument)s="rr_src";else return;if(c||(c={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},r.attributes.push(c),r.attributeMap.set(e.target,c)),s==="type"&&o.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&o.setAttribute("data-rr-is-password","true"),!eu(o.tagName,s))if(c.attributes[s]=Qa(r.doc,mt(o.tagName),mt(s),a),s==="style"){if(!r.unattachedDoc)try{r.unattachedDoc=document.implementation.createHTMLDocument()}catch{r.unattachedDoc=r.doc}var d=r.unattachedDoc.createElement("span");e.oldValue&&d.setAttribute("style",e.oldValue);for(var h=D(Array.from(o.style)),p;!(p=h()).done;){var y=p.value,w=o.style.getPropertyValue(y),k=o.style.getPropertyPriority(y);w!==d.style.getPropertyValue(y)||k!==d.style.getPropertyPriority(y)?k===""?c.styleDiff[y]=w:c.styleDiff[y]=[w,k]:c._unchangedStyles[y]=[w,k]}for(var b=D(Array.from(d.style)),S;!(S=b()).done;){var A=S.value;o.style.getPropertyValue(A)===""&&(c.styleDiff[A]=!1)}}else s==="open"&&o.tagName==="DIALOG"&&(o.matches("dialog:modal")?c.attributes.rr_open_mode="modal":c.attributes.rr_open_mode="non-modal");break}case"childList":{if(Ye(e.target,r.blockClass,r.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){r.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(function(x){return r.genAdds(x,e.target)}),e.removedNodes.forEach(function(x){var E=r.mirror.getId(x),L=ii(e.target)?r.mirror.getId(ee.host(e.target)):r.mirror.getId(e.target);Ye(e.target,r.blockClass,r.blockSelector,!1)||Es(x,r.mirror,r.slimDOMOptions)||!Pb(x,r.mirror)||(r.addedSet.has(x)?(Is(r.addedSet,x),r.droppedSet.add(x)):r.addedSet.has(e.target)&&E===-1||oc(e.target,r.mirror)||(r.movedSet.has(x)&&r.movedMap[hc(E,L)]?Is(r.movedSet,x):(r.removes.push({parentId:L,id:E,isShadow:ii(e.target)&&ri(e.target)?!0:void 0}),Ub(x,r.removesSubTreeCache))),r.mapRemoves.push(x))});break}}}),R(this,"genAdds",function(e,i){if(!r.processedNodeManager.inOtherBuffer(e,r)&&!(r.addedSet.has(e)||r.movedSet.has(e))){if(r.mirror.hasNode(e)){if(Es(e,r.mirror,r.slimDOMOptions))return;r.movedSet.add(e);var o=null;i&&r.mirror.hasNode(i)&&(o=r.mirror.getId(i)),o&&o!==-1&&(r.movedMap[hc(r.mirror.getId(e),o)]=!0)}else r.addedSet.add(e),r.droppedSet.delete(e);Ye(e,r.blockClass,r.blockSelector,!1)||(ee.childNodes(e).forEach(function(s){return r.genAdds(s)}),Ts(e)&&ee.childNodes(ee.shadowRoot(e)).forEach(function(s){r.processedNodeManager.add(s,r),r.genAdds(s,e)}))}})}var t=n.prototype;return t.init=function(e){var i=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(o){i[o]=e[o]})},t.freeze=function(){this.frozen=!0,this.canvasManager.freeze()},t.unfreeze=function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()},t.isFrozen=function(){return this.frozen},t.lock=function(){this.locked=!0,this.canvasManager.lock()},t.unlock=function(){this.locked=!1,this.canvasManager.unlock(),this.emit()},t.reset=function(){this.shadowDomManager.reset(),this.canvasManager.reset()},n}();function Is(n,t){n.delete(t),ee.childNodes(t).forEach(function(r){return Is(n,r)})}function Ub(n,t){for(var r=[n];r.length;){var e=r.pop();t.has(e)||(t.add(e),ee.childNodes(e).forEach(function(i){return r.push(i)}))}}function mc(n,t,r){return n.size===0?!1:Fb(n,t)}function Fb(n,t,r){var e=ee.parentNode(t);return e?n.has(e):!1}function fc(n,t){return n.size===0?!1:pc(n,t)}function pc(n,t){var r=ee.parentNode(t);return r?n.has(r)?!0:pc(n,r):!1}var Ci;function Gb(n){Ci=n}function Kb(){Ci=void 0}var ie=function(n){if(!Ci)return n;var t=function(){for(var r=arguments.length,e=new Array(r),i=0;i<r;i++)e[i]=arguments[i];try{return n.apply(void 0,[].concat(e))}catch(o){if(Ci&&Ci(o)===!0)return;throw o}};return t},vt=[];function Si(n){try{if("composedPath"in n){var t=n.composedPath();if(t.length)return t[0]}else if("path"in n&&n.path.length)return n.path[0]}catch{}return n&&n.target}function vc(n,t){var r=new Hb;vt.push(r),r.init(n);var e=new(Ql())(ie(r.processMutations.bind(r)));return e.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),e}function jb(n){var t=n.mousemoveCb,r=n.sampling,e=n.doc,i=n.mirror;if(r.mousemove===!1)return function(){};var o=typeof r.mousemove=="number"?r.mousemove:50,s=typeof r.mousemoveCallback=="number"?r.mousemoveCallback:500,a=[],u,c=wi(ie(function(p){var y=Date.now()-u;t(a.map(function(w){return w.timeOffset-=y,w}),p),a=[],u=null}),s),d=ie(wi(ie(function(p){var y=Si(p),w=Ls(p)?p.changedTouches[0]:p,k=w.clientX,b=w.clientY;u||(u=Nr()),a.push({x:k,y:b,id:i.getId(y),timeOffset:Nr()-u}),c(typeof DragEvent<"u"&&J(p,DragEvent)?$.Drag:J(p,MouseEvent)?$.MouseMove:$.TouchMove)}),o,{trailing:!1})),h=[Je("mousemove",d,e),Je("touchmove",d,e),Je("drag",d,e)];return ie(function(){h.forEach(function(p){return p()})})}function Vb(n){var t=n.mouseInteractionCb,r=n.doc,e=n.mirror,i=n.blockClass,o=n.blockSelector,s=n.sampling;if(s.mouseInteraction===!1)return function(){};var a=s.mouseInteraction===!0||s.mouseInteraction===void 0?{}:s.mouseInteraction,u=[],c=null,d=function(h){return function(p){var y=Si(p);if(!Ye(y,i,o,!0)){var w=null,k=h;if("pointerType"in p){switch(p.pointerType){case"mouse":w=Bn.Mouse;break;case"touch":w=Bn.Touch;break;case"pen":w=Bn.Pen;break}w===Bn.Touch?Qe[h]===Qe.MouseDown?k="TouchStart":Qe[h]===Qe.MouseUp&&(k="TouchEnd"):Bn.Pen}else Ls(p)&&(w=Bn.Touch);w!==null?(c=w,(k.startsWith("Touch")&&w===Bn.Touch||k.startsWith("Mouse")&&w===Bn.Mouse)&&(w=null)):Qe[h]===Qe.Click&&(w=c,c=null);var b=Ls(p)?p.changedTouches[0]:p;if(b){var S=e.getId(y),A=b.clientX,x=b.clientY;ie(t)(re({type:Qe[k],id:S,x:A,y:x},w!==null&&{pointerType:w}))}}}};return Object.keys(Qe).filter(function(h){return Number.isNaN(Number(h))&&!h.endsWith("_Departed")&&a[h]!==!1}).forEach(function(h){var p=mt(h),y=d(h);if(window.PointerEvent)switch(Qe[h]){case Qe.MouseDown:case Qe.MouseUp:p=p.replace("mouse","pointer");break;case Qe.TouchStart:case Qe.TouchEnd:return}u.push(Je(p,y,r))}),ie(function(){u.forEach(function(h){return h()})})}function bc(n){var t=n.scrollCb,r=n.doc,e=n.mirror,i=n.blockClass,o=n.blockSelector,s=n.sampling,a=ie(wi(ie(function(u){var c=Si(u);if(!(!c||Ye(c,i,o,!0))){var d=e.getId(c);if(c===r&&r.defaultView){var h=nc(r.defaultView);t({id:d,x:h.left,y:h.top})}else t({id:d,x:c.scrollLeft,y:c.scrollTop})}}),s.scroll||100));return Je("scroll",a,r)}function zb(n,t){var r=n.viewportResizeCb,e=t.win,i=-1,o=-1,s=ie(wi(ie(function(){var a=tc(),u=ic();(i!==a||o!==u)&&(r({width:Number(u),height:Number(a)}),i=a,o=u)}),200));return Je("resize",s,e)}var $b=["INPUT","TEXTAREA","SELECT"],gc=new WeakMap;function Wb(n){var t=n.inputCb,r=n.doc,e=n.mirror,i=n.blockClass,o=n.blockSelector,s=n.ignoreClass,a=n.ignoreSelector,u=n.maskInputOptions,c=n.maskInputFn,d=n.sampling,h=n.userTriggeredOnInput;function p(E){var L=Si(E),P=E.isTrusted,H=L&&L.tagName;if(L&&H==="OPTION"&&(L=ee.parentElement(L)),!(!L||!H||$b.indexOf(H)<0||Ye(L,i,o,!0))&&!(L.classList.contains(s)||a&&L.matches(a))){var N=L.value,F=!1,z=go(L)||"";z==="radio"||z==="checkbox"?F=L.checked:(u[H.toLowerCase()]||u[z])&&(N=bo({element:L,maskInputOptions:u,tagName:H,type:z,value:N,maskInputFn:c})),y(L,h?{text:N,isChecked:F,userTriggered:P}:{text:N,isChecked:F});var G=L.name;z==="radio"&&G&&F&&r.querySelectorAll('input[type="radio"][name="'+G+'"]').forEach(function(V){if(V!==L){var X=V.value;y(V,h?{text:X,isChecked:!F,userTriggered:!1}:{text:X,isChecked:!F})}})}}function y(E,L){var P=gc.get(E);if(!P||P.text!==L.text||P.isChecked!==L.isChecked){gc.set(E,L);var H=e.getId(E);ie(t)(re({},L,{id:H}))}}var w=d.input==="last"?["change"]:["input","change"],k=w.map(function(E){return Je(E,ie(p),r)}),b=r.defaultView;if(!b)return function(){k.forEach(function(E){return E()})};var S=b.Object.getOwnPropertyDescriptor(b.HTMLInputElement.prototype,"value"),A=[[b.HTMLInputElement.prototype,"value"],[b.HTMLInputElement.prototype,"checked"],[b.HTMLSelectElement.prototype,"value"],[b.HTMLTextAreaElement.prototype,"value"],[b.HTMLSelectElement.prototype,"selectedIndex"],[b.HTMLOptionElement.prototype,"selected"]];if(S&&S.set){var x;(x=k).push.apply(x,[].concat(A.map(function(E){return Or(E[0],E[1],{set:function(){ie(p)({target:this,isTrusted:!1})}},!1,b)})))}return ie(function(){k.forEach(function(E){return E()})})}function Br(n){var t=[];function r(e,i){if(Dr("CSSGroupingRule")&&J(e.parentRule,CSSGroupingRule)||Dr("CSSMediaRule")&&J(e.parentRule,CSSMediaRule)||Dr("CSSSupportsRule")&&J(e.parentRule,CSSSupportsRule)||Dr("CSSConditionRule")&&J(e.parentRule,CSSConditionRule)){var o=Array.from(e.parentRule.cssRules),s=o.indexOf(e);i.unshift(s)}else if(e.parentStyleSheet){var a=Array.from(e.parentStyleSheet.cssRules),u=a.indexOf(e);i.unshift(u)}return i}return r(n,t)}function Qn(n,t,r){var e,i;return n?(n.ownerNode?e=t.getId(n.ownerNode):i=r.getId(n),{styleId:i,id:e}):{}}function qb(n,t){var r=n.styleSheetRuleCb,e=n.mirror,i=n.stylesheetManager,o=t.win;if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return function(){};var s=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:ie(function(p,y,w){var k=w[0],b=w[1],S=Qn(y,e,i.styleMirror),A=S.id,x=S.styleId;return(A&&A!==-1||x&&x!==-1)&&r({id:A,styleId:x,adds:[{rule:k,index:b}]}),p.apply(y,w)})}),o.CSSStyleSheet.prototype.addRule=function(p,y,w){w===void 0&&(w=this.cssRules.length);var k=p+" { "+y+" }";return o.CSSStyleSheet.prototype.insertRule.apply(this,[k,w])};var a=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:ie(function(p,y,w){var k=w[0],b=Qn(y,e,i.styleMirror),S=b.id,A=b.styleId;return(S&&S!==-1||A&&A!==-1)&&r({id:S,styleId:A,removes:[{index:k}]}),p.apply(y,w)})}),o.CSSStyleSheet.prototype.removeRule=function(p){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[p])};var u;o.CSSStyleSheet.prototype.replace&&(u=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(u,{apply:ie(function(p,y,w){var k=w[0],b=Qn(y,e,i.styleMirror),S=b.id,A=b.styleId;return(S&&S!==-1||A&&A!==-1)&&r({id:S,styleId:A,replace:k}),p.apply(y,w)})}));var c;o.CSSStyleSheet.prototype.replaceSync&&(c=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:ie(function(p,y,w){var k=w[0],b=Qn(y,e,i.styleMirror),S=b.id,A=b.styleId;return(S&&S!==-1||A&&A!==-1)&&r({id:S,styleId:A,replaceSync:k}),p.apply(y,w)})}));var d={};Hr("CSSGroupingRule")?d.CSSGroupingRule=o.CSSGroupingRule:(Hr("CSSMediaRule")&&(d.CSSMediaRule=o.CSSMediaRule),Hr("CSSConditionRule")&&(d.CSSConditionRule=o.CSSConditionRule),Hr("CSSSupportsRule")&&(d.CSSSupportsRule=o.CSSSupportsRule));var h={};return Object.entries(d).forEach(function(p){var y=p[0],w=p[1];h[y]={insertRule:w.prototype.insertRule,deleteRule:w.prototype.deleteRule},w.prototype.insertRule=new Proxy(h[y].insertRule,{apply:ie(function(k,b,S){var A=S[0],x=S[1],E=Qn(b.parentStyleSheet,e,i.styleMirror),L=E.id,P=E.styleId;return(L&&L!==-1||P&&P!==-1)&&r({id:L,styleId:P,adds:[{rule:A,index:[].concat(Br(b),[x||0])}]}),k.apply(b,S)})}),w.prototype.deleteRule=new Proxy(h[y].deleteRule,{apply:ie(function(k,b,S){var A=S[0],x=Qn(b.parentStyleSheet,e,i.styleMirror),E=x.id,L=x.styleId;return(E&&E!==-1||L&&L!==-1)&&r({id:E,styleId:L,removes:[{index:[].concat(Br(b),[A])}]}),k.apply(b,S)})})}),ie(function(){o.CSSStyleSheet.prototype.insertRule=s,o.CSSStyleSheet.prototype.deleteRule=a,u&&(o.CSSStyleSheet.prototype.replace=u),c&&(o.CSSStyleSheet.prototype.replaceSync=c),Object.entries(d).forEach(function(p){var y=p[0],w=p[1];w.prototype.insertRule=h[y].insertRule,w.prototype.deleteRule=h[y].deleteRule})})}function yc(n,t){var r=n.mirror,e=n.stylesheetManager,i,o,s,a=null;t.nodeName==="#document"?a=r.getId(t):a=r.getId(ee.host(t));var u=t.nodeName==="#document"?(i=t.defaultView)==null?void 0:i.Document:(s=(o=t.ownerDocument)==null?void 0:o.defaultView)==null?void 0:s.ShadowRoot,c=u!=null&&u.prototype?Object.getOwnPropertyDescriptor(u==null?void 0:u.prototype,"adoptedStyleSheets"):void 0;return a===null||a===-1||!u||!c?function(){}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:function(){var h;return(h=c.get)==null?void 0:h.call(this)},set:function(h){var p,y=(p=c.set)==null?void 0:p.call(this,h);if(a!==null&&a!==-1)try{e.adoptStyleSheets(h,a)}catch{}return y}}),ie(function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}))}function Zb(n,t){var r=n.styleDeclarationCb,e=n.mirror,i=n.ignoreCSSAttributes,o=n.stylesheetManager,s=t.win,a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:ie(function(c,d,h){var p,y=h[0],w=h[1],k=h[2];if(i.has(y))return a.apply(d,[y,w,k]);var b=Qn((p=d.parentRule)==null?void 0:p.parentStyleSheet,e,o.styleMirror),S=b.id,A=b.styleId;return(S&&S!==-1||A&&A!==-1)&&r({id:S,styleId:A,set:{property:y,value:w,priority:k},index:Br(d.parentRule)}),c.apply(d,h)})});var u=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(u,{apply:ie(function(c,d,h){var p,y=h[0];if(i.has(y))return u.apply(d,[y]);var w=Qn((p=d.parentRule)==null?void 0:p.parentStyleSheet,e,o.styleMirror),k=w.id,b=w.styleId;return(k&&k!==-1||b&&b!==-1)&&r({id:k,styleId:b,remove:{property:y},index:Br(d.parentRule)}),c.apply(d,h)})}),ie(function(){s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=u})}function Jb(n){var t=n.mediaInteractionCb,r=n.blockClass,e=n.blockSelector,i=n.mirror,o=n.sampling,s=n.doc,a=ie(function(c){return wi(ie(function(d){var h=Si(d);if(!(!h||Ye(h,r,e,!0))){var p=h.currentTime,y=h.volume,w=h.muted,k=h.playbackRate,b=h.loop;t({type:c,id:i.getId(h),currentTime:p,volume:y,muted:w,playbackRate:k,loop:b})}}),o.media||500)}),u=[Je("play",a(Ft.Play),s),Je("pause",a(Ft.Pause),s),Je("seeked",a(Ft.Seeked),s),Je("volumechange",a(Ft.VolumeChange),s),Je("ratechange",a(Ft.RateChange),s)];return ie(function(){u.forEach(function(c){return c()})})}function Yb(n){var t=n.fontCb,r=n.doc,e=r.defaultView;if(!e)return function(){};var i=[],o=new WeakMap,s=e.FontFace;e.FontFace=function(c,d,h){var p=new s(c,d,h);return o.set(p,{family:c,buffer:typeof d!="string",descriptors:h,fontSource:typeof d=="string"?d:JSON.stringify(Array.from(new Uint8Array(d)))}),p};var a=Ht(r.fonts,"add",function(u){return function(c){return setTimeout(ie(function(){var d=o.get(c);d&&(t(d),o.delete(c))}),0),u.apply(this,[c])}});return i.push(function(){e.FontFace=s}),i.push(a),ie(function(){i.forEach(function(u){return u()})})}function Xb(n){var t=n.doc,r=n.mirror,e=n.blockClass,i=n.blockSelector,o=n.selectionCb,s=!0,a=ie(function(){var u=t.getSelection();if(!(!u||s&&(u!=null&&u.isCollapsed))){s=u.isCollapsed||!1;for(var c=[],d=u.rangeCount||0,h=0;h<d;h++){var p=u.getRangeAt(h),y=p.startContainer,w=p.startOffset,k=p.endContainer,b=p.endOffset,S=Ye(y,e,i,!0)||Ye(k,e,i,!0);S||c.push({start:r.getId(y),startOffset:w,end:r.getId(k),endOffset:b})}o({ranges:c})}});return a(),Je("selectionchange",a)}function Qb(n){var t=n.doc,r=n.customElementCb,e=t.defaultView;if(!e||!e.customElements)return function(){};var i=Ht(e.customElements,"define",function(o){return function(s,a,u){try{r({define:{name:s}})}catch{console.warn("Custom element callback failed for "+s)}return o.apply(this,[s,a,u])}});return i}function e1(n,t){var r=n.mutationCb,e=n.mousemoveCb,i=n.mouseInteractionCb,o=n.scrollCb,s=n.viewportResizeCb,a=n.inputCb,u=n.mediaInteractionCb,c=n.styleSheetRuleCb,d=n.styleDeclarationCb,h=n.canvasMutationCb,p=n.fontCb,y=n.selectionCb,w=n.customElementCb;n.mutationCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.mutation){var A;(A=t).mutation.apply(A,[].concat(b))}r.apply(void 0,[].concat(b))},n.mousemoveCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.mousemove){var A;(A=t).mousemove.apply(A,[].concat(b))}e.apply(void 0,[].concat(b))},n.mouseInteractionCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.mouseInteraction){var A;(A=t).mouseInteraction.apply(A,[].concat(b))}i.apply(void 0,[].concat(b))},n.scrollCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.scroll){var A;(A=t).scroll.apply(A,[].concat(b))}o.apply(void 0,[].concat(b))},n.viewportResizeCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.viewportResize){var A;(A=t).viewportResize.apply(A,[].concat(b))}s.apply(void 0,[].concat(b))},n.inputCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.input){var A;(A=t).input.apply(A,[].concat(b))}a.apply(void 0,[].concat(b))},n.mediaInteractionCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.mediaInteaction){var A;(A=t).mediaInteaction.apply(A,[].concat(b))}u.apply(void 0,[].concat(b))},n.styleSheetRuleCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.styleSheetRule){var A;(A=t).styleSheetRule.apply(A,[].concat(b))}c.apply(void 0,[].concat(b))},n.styleDeclarationCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.styleDeclaration){var A;(A=t).styleDeclaration.apply(A,[].concat(b))}d.apply(void 0,[].concat(b))},n.canvasMutationCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.canvasMutation){var A;(A=t).canvasMutation.apply(A,[].concat(b))}h.apply(void 0,[].concat(b))},n.fontCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.font){var A;(A=t).font.apply(A,[].concat(b))}p.apply(void 0,[].concat(b))},n.selectionCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.selection){var A;(A=t).selection.apply(A,[].concat(b))}y.apply(void 0,[].concat(b))},n.customElementCb=function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];if(t.customElement){var A;(A=t).customElement.apply(A,[].concat(b))}w.apply(void 0,[].concat(b))}}function n1(n,t){t===void 0&&(t={});var r=n.doc.defaultView;if(!r)return function(){};e1(n,t);var e;n.recordDOM&&(e=vc(n,n.doc));var i=jb(n),o=Vb(n),s=bc(n),a=zb(n,{win:r}),u=Wb(n),c=Jb(n),d=function(){},h=function(){},p=function(){},y=function(){};n.recordDOM&&(d=qb(n,{win:r}),h=yc(n,n.doc),p=Zb(n,{win:r}),n.collectFonts&&(y=Yb(n)));for(var w=Xb(n),k=Qb(n),b=[],S=D(n.plugins),A;!(A=S()).done;){var x=A.value;b.push(x.observer(x.callback,r,x.options))}return ie(function(){vt.forEach(function(E){return E.reset()}),e==null||e.disconnect(),i(),o(),s(),a(),u(),c(),d(),h(),p(),y(),w(),k(),b.forEach(function(E){return E()})})}function Dr(n){return typeof window[n]<"u"}function Hr(n){return!!(typeof window[n]<"u"&&window[n].prototype&&"insertRule"in window[n].prototype&&"deleteRule"in window[n].prototype)}for(var wc=function(){function n(r){R(this,"iframeIdToRemoteIdMap",new WeakMap),R(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=r}var t=n.prototype;return t.getId=function(e,i,o,s){var a=o||this.getIdToRemoteIdMap(e),u=s||this.getRemoteIdToIdMap(e),c=a.get(i);return c||(c=this.generateIdFn(),a.set(i,c),u.set(c,i)),c},t.getIds=function(e,i){var o=this,s=this.getIdToRemoteIdMap(e),a=this.getRemoteIdToIdMap(e);return i.map(function(u){return o.getId(e,u,s,a)})},t.getRemoteId=function(e,i,o){var s=o||this.getRemoteIdToIdMap(e);if(typeof i!="number")return i;var a=s.get(i);return a||-1},t.getRemoteIds=function(e,i){var o=this,s=this.getRemoteIdToIdMap(e);return i.map(function(a){return o.getRemoteId(e,a,s)})},t.reset=function(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)},t.getIdToRemoteIdMap=function(e){var i=this.iframeIdToRemoteIdMap.get(e);return i||(i=new Map,this.iframeIdToRemoteIdMap.set(e,i)),i},t.getRemoteIdToIdMap=function(e){var i=this.iframeRemoteIdToIdMap.get(e);return i||(i=new Map,this.iframeRemoteIdToIdMap.set(e,i)),i},n}(),t1=function(){function n(r){R(this,"iframes",new WeakMap),R(this,"crossOriginIframeMap",new WeakMap),R(this,"crossOriginIframeMirror",new wc(Ja)),R(this,"crossOriginIframeStyleMirror"),R(this,"crossOriginIframeRootIdMap",new WeakMap),R(this,"mirror"),R(this,"mutationCb"),R(this,"wrappedEmit"),R(this,"loadListener"),R(this,"stylesheetManager"),R(this,"recordCrossOriginIframes"),this.mutationCb=r.mutationCb,this.wrappedEmit=r.wrappedEmit,this.stylesheetManager=r.stylesheetManager,this.recordCrossOriginIframes=r.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new wc(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=r.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}var t=n.prototype;return t.addIframe=function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)},t.addLoadListener=function(e){this.loadListener=e},t.attachIframe=function(e,i){var o,s;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((o=e.contentWindow)==null||o.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))},t.handleMessage=function(e){var i=e;if(!(i.data.type!=="rrweb"||i.origin!==i.data.origin)){var o=e.source;if(o){var s=this.crossOriginIframeMap.get(e.source);if(s){var a=this.transformCrossOriginEvent(s,i.data.event);a&&this.wrappedEmit(a,i.data.isCheckout)}}}},t.transformCrossOriginEvent=function(e,i){var o=this,s;switch(i.type){case ne.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(i.data.node,e);var a=i.data.node.id;return this.crossOriginIframeRootIdMap.set(e,a),this.patchRootIdOnNode(i.data.node,a),{timestamp:i.timestamp,type:ne.IncrementalSnapshot,data:{source:$.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:i.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ne.Meta:case ne.Load:case ne.DomContentLoaded:return!1;case ne.Plugin:return i;case ne.Custom:return this.replaceIds(i.data.payload,e,["id","parentId","previousId","nextId"]),i;case ne.IncrementalSnapshot:switch(i.data.source){case $.Mutation:return i.data.adds.forEach(function(u){o.replaceIds(u,e,["parentId","nextId","previousId"]),o.replaceIdOnNode(u.node,e);var c=o.crossOriginIframeRootIdMap.get(e);c&&o.patchRootIdOnNode(u.node,c)}),i.data.removes.forEach(function(u){o.replaceIds(u,e,["parentId","id"])}),i.data.attributes.forEach(function(u){o.replaceIds(u,e,["id"])}),i.data.texts.forEach(function(u){o.replaceIds(u,e,["id"])}),i;case $.Drag:case $.TouchMove:case $.MouseMove:return i.data.positions.forEach(function(u){o.replaceIds(u,e,["id"])}),i;case $.ViewportResize:return!1;case $.MediaInteraction:case $.MouseInteraction:case $.Scroll:case $.CanvasMutation:case $.Input:return this.replaceIds(i.data,e,["id"]),i;case $.StyleSheetRule:case $.StyleDeclaration:return this.replaceIds(i.data,e,["id"]),this.replaceStyleIds(i.data,e,["styleId"]),i;case $.Font:return i;case $.Selection:return i.data.ranges.forEach(function(u){o.replaceIds(u,e,["start","end"])}),i;case $.AdoptedStyleSheet:return this.replaceIds(i.data,e,["id"]),this.replaceStyleIds(i.data,e,["styleIds"]),(s=i.data.styles)==null||s.forEach(function(u){o.replaceStyleIds(u,e,["styleId"])}),i}}return!1},t.replace=function(e,i,o,s){for(var a=D(s),u;!(u=a()).done;){var c=u.value;!Array.isArray(i[c])&&typeof i[c]!="number"||(Array.isArray(i[c])?i[c]=e.getIds(o,i[c]):i[c]=e.getId(o,i[c]))}return i},t.replaceIds=function(e,i,o){return this.replace(this.crossOriginIframeMirror,e,i,o)},t.replaceStyleIds=function(e,i,o){return this.replace(this.crossOriginIframeStyleMirror,e,i,o)},t.replaceIdOnNode=function(e,i){var o=this;this.replaceIds(e,i,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(function(s){o.replaceIdOnNode(s,i)})},t.patchRootIdOnNode=function(e,i){var o=this;e.type!==cc.Document&&!e.rootId&&(e.rootId=i),"childNodes"in e&&e.childNodes.forEach(function(s){o.patchRootIdOnNode(s,i)})},n}(),i1=function(){function n(r){R(this,"shadowDoms",new WeakSet),R(this,"mutationCb"),R(this,"scrollCb"),R(this,"bypassOptions"),R(this,"mirror"),R(this,"restoreHandlers",[]),this.mutationCb=r.mutationCb,this.scrollCb=r.scrollCb,this.bypassOptions=r.bypassOptions,this.mirror=r.mirror,this.init()}var t=n.prototype;return t.init=function(){this.reset(),this.patchAttachShadow(Element,document)},t.addShadowRoot=function(e,i){var o=this;if(ri(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var s=vc(re({},this.bypassOptions,{doc:i,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push(function(){return s.disconnect()}),this.restoreHandlers.push(bc(re({},this.bypassOptions,{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&o.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,o.mirror.getId(ee.host(e))),o.restoreHandlers.push(yc({mirror:o.mirror,stylesheetManager:o.bypassOptions.stylesheetManager},e))},0)}},t.observeAttachShadow=function(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)},t.patchAttachShadow=function(e,i){var o=this;this.restoreHandlers.push(Ht(e.prototype,"attachShadow",function(s){return function(a){var u=s.call(this,a),c=ee.shadowRoot(this);return c&&lc(this)&&o.addShadowRoot(c,i),u}}))},t.reset=function(){this.restoreHandlers.forEach(function(e){try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet},n}(),Gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r1=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ur=0;Ur<Gt.length;Ur++)r1[Gt.charCodeAt(Ur)]=Ur;var o1=function(t){var r=new Uint8Array(t),e,i=r.length,o="";for(e=0;e<i;e+=3)o+=Gt[r[e]>>2],o+=Gt[(r[e]&3)<<4|r[e+1]>>4],o+=Gt[(r[e+1]&15)<<2|r[e+2]>>6],o+=Gt[r[e+2]&63];return i%3===2?o=o.substring(0,o.length-1)+"=":i%3===1&&(o=o.substring(0,o.length-2)+"=="),o},Cc=new Map;function s1(n,t){var r=Cc.get(n);return r||(r=new Map,Cc.set(n,r)),r.has(t)||r.set(t,[]),r.get(t)}var Sc=function(n,t,r){if(!(!n||!(_c(n,t)||(typeof n>"u"?"undefined":Q(n))==="object"))){var e=n.constructor.name,i=s1(r,e),o=i.indexOf(n);return o===-1&&(o=i.length,i.push(n)),o}};function Fr(n,t,r){if(J(n,Array))return n.map(function(w){return Fr(w,t,r)});if(n===null)return n;if(J(n,Float32Array)||J(n,Float64Array)||J(n,Int32Array)||J(n,Uint32Array)||J(n,Uint8Array)||J(n,Uint16Array)||J(n,Int16Array)||J(n,Int8Array)||J(n,Uint8ClampedArray)){var e=n.constructor.name;return{rr_type:e,args:[Object.values(n)]}}else if(J(n,ArrayBuffer)){var i=n.constructor.name,o=o1(n);return{rr_type:i,base64:o}}else if(J(n,DataView)){var s=n.constructor.name;return{rr_type:s,args:[Fr(n.buffer,t,r),n.byteOffset,n.byteLength]}}else if(J(n,HTMLImageElement)){var a=n.constructor.name,u=n.src;return{rr_type:a,src:u}}else if(J(n,HTMLCanvasElement)){var c="HTMLImageElement",d=n.toDataURL();return{rr_type:c,src:d}}else if(J(n,ImageData)){var h=n.constructor.name;return{rr_type:h,args:[Fr(n.data,t,r),n.width,n.height]}}else if(_c(n,t)||(typeof n>"u"?"undefined":Q(n))==="object"){var p=n.constructor.name,y=Sc(n,t,r);return{rr_type:p,index:y}}return n}var kc=function(n,t,r){return n.map(function(e){return Fr(e,t,r)})},_c=function(n,t){var r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"],e=r.filter(function(i){return typeof t[i]=="function"});return!!e.find(function(i){return J(n,t[i])})};function a1(n,t,r,e){for(var i=function(){var c=u.value;try{if(typeof t.CanvasRenderingContext2D.prototype[c]!="function")return"continue";var d=Ht(t.CanvasRenderingContext2D.prototype,c,function(p){return function(){for(var y=this,w=arguments.length,k=new Array(w),b=0;b<w;b++)k[b]=arguments[b];return Ye(this.canvas,r,e,!0)||setTimeout(function(){var S=kc(k,t,y);n(y.canvas,{type:Ut["2D"],property:c,args:S})},0),p.apply(this,k)}});o.push(d)}catch{var h=Or(t.CanvasRenderingContext2D.prototype,c,{set:function(w){n(this.canvas,{type:Ut["2D"],property:c,args:[w],setter:!0})}});o.push(h)}},o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype),a=D(s),u;!(u=a()).done;)i();return function(){o.forEach(function(c){return c()})}}function u1(n){return n==="experimental-webgl"?"webgl":n}function Ac(n,t,r,e){var i=[];try{var o=Ht(n.HTMLCanvasElement.prototype,"getContext",function(s){return function(a){for(var u=arguments.length,c=new Array(u>1?u-1:0),d=1;d<u;d++)c[d-1]=arguments[d];if(!Ye(this,t,r,!0)){var h=u1(a);if("__context"in this||(this.__context=h),e&&["webgl","webgl2"].includes(h))if(c[0]&&Q(c[0])==="object"){var p=c[0];p.preserveDrawingBuffer||(p.preserveDrawingBuffer=!0)}else c.splice(0,1,{preserveDrawingBuffer:!0})}return s.apply(this,[].concat([a],c))}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){i.forEach(function(s){return s()})}}function xc(n,t,r,e,i,o){for(var s=function(){var h=d.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(h))return"continue";try{if(typeof n[h]!="function")return"continue";var p=Ht(n,h,function(w){return function(){for(var k=arguments.length,b=new Array(k),S=0;S<k;S++)b[S]=arguments[S];var A=w.apply(this,b);if(Sc(A,o,this),"tagName"in this.canvas&&!Ye(this.canvas,e,i,!0)){var x=kc(b,o,this),E={type:t,property:h,args:x};r(this.canvas,E)}return A}});a.push(p)}catch{var y=Or(n,h,{set:function(b){r(this.canvas,{type:t,property:h,args:[b],setter:!0})}});a.push(y)}},a=[],u=Object.getOwnPropertyNames(n),c=D(u),d;!(d=c()).done;)s();return a}function l1(n,t,r,e){var i,o=[];if((i=o).push.apply(i,[].concat(xc(t.WebGLRenderingContext.prototype,Ut.WebGL,n,r,e,t))),typeof t.WebGL2RenderingContext<"u"){var s;(s=o).push.apply(s,[].concat(xc(t.WebGL2RenderingContext.prototype,Ut.WebGL2,n,r,e,t)))}return function(){o.forEach(function(a){return a()})}}var Mc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",c1=function(n){return Uint8Array.from(atob(n),function(t){return t.charCodeAt(0)})},Ec=typeof window<"u"&&window.Blob&&new Blob([c1(Mc)],{type:"text/javascript;charset=utf-8"});function d1(n){var t;try{if(t=Ec&&(window.URL||window.webkitURL).createObjectURL(Ec),!t)throw"";var r=new Worker(t,{name:n==null?void 0:n.name});return r.addEventListener("error",function(){(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;base64,"+Mc,{name:n==null?void 0:n.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}var h1=function(){function n(r){var e=this;R(this,"pendingCanvasMutations",new Map),R(this,"rafStamps",{latestId:0,invokeId:null}),R(this,"mirror"),R(this,"mutationCb"),R(this,"resetObservers"),R(this,"frozen",!1),R(this,"locked",!1),R(this,"processMutation",function(h,p){var y=e.rafStamps.invokeId&&e.rafStamps.latestId!==e.rafStamps.invokeId;(y||!e.rafStamps.invokeId)&&(e.rafStamps.invokeId=e.rafStamps.latestId),e.pendingCanvasMutations.has(h)||e.pendingCanvasMutations.set(h,[]),e.pendingCanvasMutations.get(h).push(p)});var i=r.sampling,o=i===void 0?"all":i,s=r.win,a=r.blockClass,u=r.blockSelector,c=r.recordCanvas,d=r.dataURLOptions;this.mutationCb=r.mutationCb,this.mirror=r.mirror,c&&o==="all"&&this.initCanvasMutationObserver(s,a,u),c&&typeof o=="number"&&this.initCanvasFPSObserver(o,s,a,u,{dataURLOptions:d})}var t=n.prototype;return t.reset=function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()},t.freeze=function(){this.frozen=!0},t.unfreeze=function(){this.frozen=!1},t.lock=function(){this.locked=!0},t.unlock=function(){this.locked=!1},t.initCanvasFPSObserver=function(e,i,o,s,a){var u=this,c=Ac(i,o,s,!0),d=new Map,h=new d1;h.onmessage=function(S){var A=S.data.id;if(d.set(A,!1),"base64"in S.data){var x=S.data,E=x.base64,L=x.type,P=x.width,H=x.height;u.mutationCb({id:A,type:Ut["2D"],commands:[{property:"clearRect",args:[0,0,P,H]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:E}],type:L}]},0,0]}]})}};var p=1e3/e,y=0,w,k=function(){var S=[];return i.document.querySelectorAll("canvas").forEach(function(A){Ye(A,o,s,!0)||S.push(A)}),S},b=function(S){if(y&&S-y<p){w=requestAnimationFrame(b);return}y=S;var A=u;k().forEach(co(function(x){var E,L,P,H;return ti(this,function(N){switch(N.label){case 0:return L=A.mirror.getId(x),d.get(L)?[2]:x.width===0||x.height===0?[2]:(d.set(L,!0),["webgl","webgl2"].includes(x.__context)&&(P=x.getContext(x.__context),((E=P==null?void 0:P.getContextAttributes())==null?void 0:E.preserveDrawingBuffer)===!1&&P.clear(P.COLOR_BUFFER_BIT)),[4,createImageBitmap(x)]);case 1:return H=N.sent(),h.postMessage({id:L,bitmap:H,width:x.width,height:x.height,dataURLOptions:a.dataURLOptions},[H]),[2]}})})),w=requestAnimationFrame(b)};w=requestAnimationFrame(b),this.resetObservers=function(){c(),cancelAnimationFrame(w)}},t.initCanvasMutationObserver=function(e,i,o){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var s=Ac(e,i,o,!1),a=a1(this.processMutation.bind(this),e,i,o),u=l1(this.processMutation.bind(this),e,i,o);this.resetObservers=function(){s(),a(),u()}},t.startPendingCanvasMutationFlusher=function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},t.startRAFTimestamping=function(){var e=this,i=function(o){e.rafStamps.latestId=o,requestAnimationFrame(i)};requestAnimationFrame(i)},t.flushPendingCanvasMutations=function(){var e=this;this.pendingCanvasMutations.forEach(function(i,o){var s=e.mirror.getId(o);e.flushPendingCanvasMutationFor(o,s)}),requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})},t.flushPendingCanvasMutationFor=function(e,i){if(!(this.frozen||this.locked)){var o=this.pendingCanvasMutations.get(e);if(!(!o||i===-1)){var s=o.map(function(u){u.type;var c=ei(u,["type"]);return c}),a=o[0].type;this.mutationCb({id:i,type:a,commands:s}),this.pendingCanvasMutations.delete(e)}}},n}(),m1=function(){function n(r){R(this,"trackedLinkElements",new WeakSet),R(this,"mutationCb"),R(this,"adoptedStyleSheetCb"),R(this,"styleMirror",new Ob),this.mutationCb=r.mutationCb,this.adoptedStyleSheetCb=r.adoptedStyleSheetCb}var t=n.prototype;return t.attachLinkElement=function(e,i){"_cssText"in i.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:i.id,attributes:i.attributes}]}),this.trackLinkElement(e)},t.trackLinkElement=function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))},t.adoptStyleSheets=function(e,i){var o,s=function(){var h=d.value,p=void 0;o.styleMirror.has(h)?p=o.styleMirror.getId(h):(p=o.styleMirror.add(h),u.push({styleId:p,rules:Array.from(h.rules||CSSRule,function(y,w){return{rule:$a(y,h.href),index:w}})})),a.styleIds.push(p)};if(e.length!==0){for(var a={id:i,styleIds:[]},u=[],c=D(e),d;!(d=c()).done;)o=this,s();u.length>0&&(a.styles=u),this.adoptedStyleSheetCb(a)}},t.reset=function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet},t.trackStylesheetInLinkElement=function(e){},n}(),f1=function(){function n(){R(this,"nodeMap",new WeakMap),R(this,"active",!1)}var t=n.prototype;return t.inOtherBuffer=function(e,i){var o=this.nodeMap.get(e);return o&&Array.from(o).some(function(s){return s!==i})},t.add=function(e,i){var o=this;this.active||(this.active=!0,requestAnimationFrame(function(){o.nodeMap=new WeakMap,o.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(i))},t.destroy=function(){},n}(),Me,Gr,Ps,Kr=!1;try{if(Array.from([1],function(n){return n*2})[0]!==2){var Rs=document.createElement("iframe");document.body.appendChild(Rs),Array.from=((Fa=Rs.contentWindow)==null?void 0:Fa.Array.from)||Array.from,document.body.removeChild(Rs)}}catch(n){console.debug("Unable to override Array.from",n)}var pn=dm();function et(n){n===void 0&&(n={});var t=n.emit,r=n.checkoutEveryNms,e=n.checkoutEveryNth,i=n.blockClass,o=i===void 0?"rr-block":i,s=n.blockSelector,a=s===void 0?null:s,u=n.ignoreClass,c=u===void 0?"rr-ignore":u,d=n.ignoreSelector,h=d===void 0?null:d,p=n.maskTextClass,y=p===void 0?"rr-mask":p,w=n.maskTextSelector,k=w===void 0?null:w,b=n.inlineStylesheet,S=b===void 0?!0:b,A=n.maskAllInputs,x=n.maskInputOptions,E=n.slimDOMOptions,L=n.maskInputFn,P=n.maskTextFn,H=n.hooks,N=n.packFn,F=n.sampling,z=F===void 0?{}:F,G=n.dataURLOptions,V=G===void 0?{}:G,X=n.mousemoveWait,Be=n.recordDOM,te=Be===void 0?!0:Be,Ue=n.recordCanvas,Pe=Ue===void 0?!1:Ue,pe=n.recordCrossOriginIframes,xe=pe===void 0?!1:pe,Fe=n.recordAfter,dn=Fe===void 0?n.recordAfter==="DOMContentLoaded"?n.recordAfter:"load":Fe,Te=n.userTriggeredOnInput,gn=Te===void 0?!1:Te,Ge=n.collectFonts,ve=Ge===void 0?!1:Ge,K=n.inlineImages,hn=K===void 0?!1:K,rn=n.plugins,De=n.keepIframeSrcFn,yn=De===void 0?function(){return!1}:De,In=n.ignoreCSSAttributes,mn=In===void 0?new Set([]):In,wn=n.errorHandler;Gb(wn);var Pn=xe?window.parent===window:!0,Rn=!1;if(!Pn)try{window.parent.document&&(Rn=!1)}catch{Rn=!0}if(Pn&&!t)throw new Error("emit function is required");if(!Pn&&!Rn)return function(){};X!==void 0&&z.mousemove===void 0&&(z.mousemove=X),pn.reset();var Kn=A===!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}:x!==void 0?x:{password:!0},wt=E===!0||E==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:E==="all",headMetaDescKeywords:E==="all",headTitleMutations:E==="all"}:E||{};Rb();var jn,Vn=0,Cn=function(de){for(var nn=D(rn||[]),j;!(j=nn()).done;){var Se=j.value;Se.eventProcessor&&(de=Se.eventProcessor(de))}return N&&!Rn&&(de=N(de)),de};Me=function(de,nn){var j,Se=de;if(Se.timestamp=Nr(),(j=vt[0])!=null&&j.isFrozen()&&Se.type!==ne.FullSnapshot&&!(Se.type===ne.IncrementalSnapshot&&Se.data.source===$.Mutation)&&vt.forEach(function(ct){return ct.unfreeze()}),Pn)t==null||t(Cn(Se),nn);else if(Rn){var Ri={type:"rrweb",event:Cn(Se),origin:window.location.origin,isCheckout:nn};window.parent.postMessage(Ri,"*")}if(Se.type===ne.FullSnapshot)jn=Se,Vn=0;else if(Se.type===ne.IncrementalSnapshot){if(Se.data.source===$.Mutation&&Se.data.isAttachIframe)return;Vn++;var Sn=e&&Vn>=e,wa=r&&Se.timestamp-jn.timestamp>r;(Sn||wa)&&Gr(!0)}};for(var zn=function(de){Me({type:ne.IncrementalSnapshot,data:re({source:$.Mutation},de)})},to=function(de){return Me({type:ne.IncrementalSnapshot,data:re({source:$.Scroll},de)})},Ct=function(de){return Me({type:ne.IncrementalSnapshot,data:re({source:$.CanvasMutation},de)})},ga=function(de){return Me({type:ne.IncrementalSnapshot,data:re({source:$.AdoptedStyleSheet},de)})},ce=new m1({mutationCb:zn,adoptedStyleSheetCb:ga}),$n=new t1({mirror:pn,mutationCb:zn,stylesheetManager:ce,recordCrossOriginIframes:xe,wrappedEmit:Me}),ya=D(rn||[]),io;!(io=ya()).done;){var ro=io.value;ro.getMirror&&ro.getMirror({nodeMirror:pn,crossOriginIframeMirror:$n.crossOriginIframeMirror,crossOriginIframeStyleMirror:$n.crossOriginIframeStyleMirror})}var Pi=new f1;Ps=new h1({recordCanvas:Pe,mutationCb:Ct,win:window,blockClass:o,blockSelector:a,mirror:pn,sampling:z.canvas,dataURLOptions:V});var Yt=new i1({mutationCb:zn,scrollCb:to,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:y,maskTextSelector:k,inlineStylesheet:S,maskInputOptions:Kn,dataURLOptions:V,maskTextFn:P,maskInputFn:L,recordCanvas:Pe,inlineImages:hn,sampling:z,slimDOMOptions:wt,iframeManager:$n,stylesheetManager:ce,canvasManager:Ps,keepIframeSrcFn:yn,processedNodeManager:Pi},mirror:pn});Gr=function(de){if(de===void 0&&(de=!1),!!te){Me({type:ne.Meta,data:{href:window.location.href,width:ic(),height:tc()}},de),ce.reset(),Yt.init(),vt.forEach(function(j){return j.lock()});var nn=Nm(document,{mirror:pn,blockClass:o,blockSelector:a,maskTextClass:y,maskTextSelector:k,inlineStylesheet:S,maskAllInputs:Kn,maskTextFn:P,maskInputFn:L,slimDOM:wt,dataURLOptions:V,recordCanvas:Pe,inlineImages:hn,onSerialize:function(j){sc(j,pn)&&$n.addIframe(j),ac(j,pn)&&ce.trackLinkElement(j),Ts(j)&&Yt.addShadowRoot(ee.shadowRoot(j),document)},onIframeLoad:function(j,Se){$n.attachIframe(j,Se),Yt.observeAttachShadow(j)},onStylesheetLoad:function(j,Se){ce.attachLinkElement(j,Se)},keepIframeSrcFn:yn});if(!nn)return console.warn("Failed to snapshot the document");Me({type:ne.FullSnapshot,data:{node:nn,initialOffset:nc(window)}},de),vt.forEach(function(j){return j.unlock()}),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ce.adoptStyleSheets(document.adoptedStyleSheets,pn.getId(document))}};try{var St=[],Xt=function(de){var nn;return ie(n1)({mutationCb:zn,mousemoveCb:function(j,Se){return Me({type:ne.IncrementalSnapshot,data:{source:Se,positions:j}})},mouseInteractionCb:function(j){return Me({type:ne.IncrementalSnapshot,data:re({source:$.MouseInteraction},j)})},scrollCb:to,viewportResizeCb:function(j){return Me({type:ne.IncrementalSnapshot,data:re({source:$.ViewportResize},j)})},inputCb:function(j){return Me({type:ne.IncrementalSnapshot,data:re({source:$.Input},j)})},mediaInteractionCb:function(j){return Me({type:ne.IncrementalSnapshot,data:re({source:$.MediaInteraction},j)})},styleSheetRuleCb:function(j){return Me({type:ne.IncrementalSnapshot,data:re({source:$.StyleSheetRule},j)})},styleDeclarationCb:function(j){return Me({type:ne.IncrementalSnapshot,data:re({source:$.StyleDeclaration},j)})},canvasMutationCb:Ct,fontCb:function(j){return Me({type:ne.IncrementalSnapshot,data:re({source:$.Font},j)})},selectionCb:function(j){Me({type:ne.IncrementalSnapshot,data:re({source:$.Selection},j)})},customElementCb:function(j){Me({type:ne.IncrementalSnapshot,data:re({source:$.CustomElement},j)})},blockClass:o,ignoreClass:c,ignoreSelector:h,maskTextClass:y,maskTextSelector:k,maskInputOptions:Kn,inlineStylesheet:S,sampling:z,recordDOM:te,recordCanvas:Pe,inlineImages:hn,userTriggeredOnInput:gn,collectFonts:ve,doc:de,maskInputFn:L,maskTextFn:P,keepIframeSrcFn:yn,blockSelector:a,slimDOMOptions:wt,dataURLOptions:V,mirror:pn,iframeManager:$n,stylesheetManager:ce,shadowDomManager:Yt,processedNodeManager:Pi,canvasManager:Ps,ignoreCSSAttributes:mn,plugins:((nn=rn==null?void 0:rn.filter(function(j){return j.observer}))==null?void 0:nn.map(function(j){return{observer:j.observer,options:j.options,callback:function(Se){return Me({type:ne.Plugin,data:{plugin:j.name,payload:Se}})}}}))||[]},H)};$n.addLoadListener(function(de){try{St.push(Xt(de.contentDocument))}catch(nn){console.warn(nn)}});var kt=function(){Gr(),St.push(Xt(document)),Kr=!0};return document.readyState==="interactive"||document.readyState==="complete"?kt():(St.push(Je("DOMContentLoaded",function(){Me({type:ne.DomContentLoaded,data:{}}),dn==="DOMContentLoaded"&&kt()})),St.push(Je("load",function(){Me({type:ne.Load,data:{}}),dn==="load"&&kt()},window))),function(){St.forEach(function(de){return de()}),Pi.destroy(),Kr=!1,Kb()}}catch(de){console.warn(de)}}et.addCustomEvent=function(n,t){if(!Kr)throw new Error("please add custom event after start recording");Me({type:ne.Custom,data:{tag:n,payload:t}})},et.freezePage=function(){vt.forEach(function(n){return n.freeze()})},et.takeFullSnapshot=function(n){if(!Kr)throw new Error("please take full snapshot after start recording");Gr(n)},et.mirror=pn;var Lc;(function(n){n[n.NotStarted=0]="NotStarted",n[n.Running=1]="Running",n[n.Stopped=2]="Stopped"})(Lc||(Lc={})),et.addCustomEvent,et.freezePage,et.takeFullSnapshot;var Tc=O.setImmediate,nt,Os,Ns,Ic=Object.prototype.toString,p1=typeof Tc<"u"?function(t){return Tc(t)}:setTimeout;try{Object.defineProperty({},"x",{}),nt=function(t,r,e,i){return Object.defineProperty(t,r,{value:e,writable:!0,configurable:i!==!1})}}catch{nt=function(r,e,i){return r[e]=i,r}}Ns=function(){var t,r,e;function i(o,s){this.fn=o,this.self=s,this.next=void 0}return{add:function(s,a){e=new i(s,a),r?r.next=e:t=e,r=e,e=void 0},drain:function(){var s=t;for(t=r=Os=void 0;s;)s.fn.call(s.self),s=s.next}}}();function jr(n,t){Ns.add(n,t),Os||(Os=p1(Ns.drain))}function Pc(n){var t,r=typeof n;return n!==null&&(r==="object"||r==="function")&&(t=n.then),typeof t=="function"?t:!1}function Bs(){for(var n=0;n<this.chain.length;n++)v1(this,this.state===1?this.chain[n].success:this.chain[n].failure,this.chain[n]);this.chain.length=0}function v1(n,t,r){var e,i;try{t===!1?r.reject(n.msg):(t===!0?e=n.msg:e=t.call(void 0,n.msg),e===r.promise?r.reject(TypeError("Promise-chain cycle")):(i=Pc(e))?i.call(e,r.resolve,r.reject):r.resolve(e))}catch(o){r.reject(o)}}function Rc(n){var t,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(t=Pc(n))?jr(function(){var e=new Nc(r);try{t.call(n,function(){Rc.apply(e,arguments)},function(){ki.apply(e,arguments)})}catch(i){ki.call(e,i)}}):(r.msg=n,r.state=1,r.chain.length>0&&jr(Bs,r))}catch(e){ki.call(new Nc(r),e)}}}function ki(n){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=n,t.state=2,t.chain.length>0&&jr(Bs,t))}function Oc(n,t,r,e){for(var i=0;i<t.length;i++)(function(s){n.resolve(t[s]).then(function(u){r(s,u)},e)})(i)}function Nc(n){this.def=n,this.triggered=!1}function b1(n){this.promise=n,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function tt(n){if(typeof n!="function")throw TypeError("Not a function");if(this.__NPO__!==0)throw TypeError("Not a promise");this.__NPO__=1;var t=new b1(this);this.then=function(e,i){var o={success:typeof e=="function"?e:!0,failure:typeof i=="function"?i:!1};return o.promise=new this.constructor(function(a,u){if(typeof a!="function"||typeof u!="function")throw TypeError("Not a function");o.resolve=a,o.reject=u}),t.chain.push(o),t.state!==0&&jr(Bs,t),o.promise},this.catch=function(e){return this.then(void 0,e)};try{n.call(void 0,function(e){Rc.call(t,e)},function(e){ki.call(t,e)})}catch(r){ki.call(t,r)}}var Bc=nt({},"constructor",tt,!1);tt.prototype=Bc,nt(Bc,"__NPO__",0,!1),nt(tt,"resolve",function(t){var r=this;return t&&typeof t=="object"&&t.__NPO__===1?t:new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");i(t)})}),nt(tt,"reject",function(t){return new this(function(e,i){if(typeof e!="function"||typeof i!="function")throw TypeError("Not a function");i(t)})}),nt(tt,"all",function(t){var r=this;return Ic.call(t)!=="[object Array]"?r.reject(TypeError("Not an array")):t.length===0?r.resolve([]):new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");var s=t.length,a=Array(s),u=0;Oc(r,t,function(d,h){a[d]=h,++u===s&&i(a)},o)})}),nt(tt,"race",function(t){var r=this;return Ic.call(t)!=="[object Array]"?r.reject(TypeError("Not an array")):new r(function(i,o){if(typeof i!="function"||typeof o!="function")throw TypeError("Not a function");Oc(r,t,function(a,u){i(u)},o)})});var le;typeof Promise<"u"&&Promise.toString().indexOf("[native code]")!==-1?le=Promise:le=tt;var vn={DEBUG:!1,LIB_VERSION:"2.65.0"},_i=24*60*60*1e3,Ds=8*1e3,Vr=Array.prototype,g1=Function.prototype,Dc=Object.prototype,it=Vr.slice,Ai=Dc.toString,zr=Dc.hasOwnProperty,Ie=O.console,rt=O.navigator,oe=O.document,$r=O.opera,Hc=O.screen,Dn=rt.userAgent,Hs=g1.bind,Uc=Vr.forEach,Fc=Vr.indexOf,Gc=Vr.map,y1=Array.isArray,Us={},v={trim:function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},se={log:function(){if(vn.DEBUG&&!v.isUndefined(Ie)&&Ie)try{Ie.log.apply(Ie,arguments)}catch{v.each(arguments,function(t){Ie.log(t)})}},warn:function(){if(vn.DEBUG&&!v.isUndefined(Ie)&&Ie){var n=["Mixpanel warning:"].concat(v.toArray(arguments));try{Ie.warn.apply(Ie,n)}catch{v.each(n,function(r){Ie.warn(r)})}}},error:function(){if(vn.DEBUG&&!v.isUndefined(Ie)&&Ie){var n=["Mixpanel error:"].concat(v.toArray(arguments));try{Ie.error.apply(Ie,n)}catch{v.each(n,function(r){Ie.error(r)})}}},critical:function(){if(!v.isUndefined(Ie)&&Ie){var n=["Mixpanel error:"].concat(v.toArray(arguments));try{Ie.error.apply(Ie,n)}catch{v.each(n,function(r){Ie.error(r)})}}}},Fs=function(n,t){return function(){return arguments[0]="["+t+"] "+arguments[0],n.apply(se,arguments)}},bt=function(n){return{log:Fs(se.log,n),error:Fs(se.error,n),critical:Fs(se.critical,n)}},Gs=function(n){return function(){try{return n.apply(this,arguments)}catch(t){se.critical("Implementation error. Please turn on debug and contact support@mixpanel.com."),vn.DEBUG&&se.critical(t)}}},Kc=function(n){var t=n.prototype;for(var r in t)typeof t[r]=="function"&&(t[r]=Gs(t[r]))};v.bind=function(n,t){var r,e;if(Hs&&n.bind===Hs)return Hs.apply(n,it.call(arguments,1));if(!v.isFunction(n))throw new TypeError;return r=it.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(it.call(arguments)));var i={};i.prototype=n.prototype;var o=new i;i.prototype=null;var s=n.apply(o,r.concat(it.call(arguments)));return Object(s)===s?s:o},e},v.each=function(n,t,r){if(n!=null){if(Uc&&n.forEach===Uc)n.forEach(t,r);else if(n.length===+n.length){for(var e=0,i=n.length;e<i;e++)if(e in n&&t.call(r,n[e],e,n)===Us)return}else for(var o in n)if(zr.call(n,o)&&t.call(r,n[o],o,n)===Us)return}},v.extend=function(n){return v.each(it.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(n[r]=t[r])}),n},v.isArray=y1||function(n){return Ai.call(n)==="[object Array]"},v.isFunction=function(n){try{return/^\s*\bfunction\b/.test(n)}catch{return!1}},v.isArguments=function(n){return!!(n&&zr.call(n,"callee"))},v.toArray=function(n){return n?n.toArray?n.toArray():v.isArray(n)||v.isArguments(n)?it.call(n):v.values(n):[]},v.map=function(n,t,r){if(Gc&&n.map===Gc)return n.map(t,r);var e=[];return v.each(n,function(i){e.push(t.call(r,i))}),e},v.keys=function(n){var t=[];return n===null||v.each(n,function(r,e){t[t.length]=e}),t},v.values=function(n){var t=[];return n===null||v.each(n,function(r){t[t.length]=r}),t},v.include=function(n,t){var r=!1;return n===null?r:Fc&&n.indexOf===Fc?n.indexOf(t)!=-1:(v.each(n,function(e){if(r||(r=e===t))return Us}),r)},v.includes=function(n,t){return n.indexOf(t)!==-1},v.inherit=function(n,t){return n.prototype=new t,n.prototype.constructor=n,n.superclass=t.prototype,n},v.isObject=function(n){return n===Object(n)&&!v.isArray(n)},v.isEmptyObject=function(n){if(v.isObject(n)){for(var t in n)if(zr.call(n,t))return!1;return!0}return!1},v.isUndefined=function(n){return n===void 0},v.isString=function(n){return Ai.call(n)=="[object String]"},v.isDate=function(n){return Ai.call(n)=="[object Date]"},v.isNumber=function(n){return Ai.call(n)=="[object Number]"},v.isElement=function(n){return!!(n&&n.nodeType===1)},v.encodeDates=function(n){return v.each(n,function(t,r){v.isDate(t)?n[r]=v.formatDate(t):v.isObject(t)&&(n[r]=v.encodeDates(t))}),n},v.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},v.formatDate=function(n){function t(r){return r<10?"0"+r:r}return n.getUTCFullYear()+"-"+t(n.getUTCMonth()+1)+"-"+t(n.getUTCDate())+"T"+t(n.getUTCHours())+":"+t(n.getUTCMinutes())+":"+t(n.getUTCSeconds())},v.strip_empty_properties=function(n){var t={};return v.each(n,function(r,e){v.isString(r)&&r.length>0&&(t[e]=r)}),t},v.truncate=function(n,t){var r;return typeof n=="string"?r=n.slice(0,t):v.isArray(n)?(r=[],v.each(n,function(e){r.push(v.truncate(e,t))})):v.isObject(n)?(r={},v.each(n,function(e,i){r[i]=v.truncate(e,t)})):r=n,r},v.JSONEncode=function(){return function(n){var t=n,r=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(a){var u=s[a];return typeof u=="string"?u:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},e=function(i,o){var s="",a=" ",u=0,c="",d="",h=0,p=s,y=[],w=o[i];switch(w&&typeof w=="object"&&typeof w.toJSON=="function"&&(w=w.toJSON(i)),typeof w){case"string":return r(w);case"number":return isFinite(w)?String(w):"null";case"boolean":case"null":return String(w);case"object":if(!w)return"null";if(s+=a,y=[],Ai.apply(w)==="[object Array]"){for(h=w.length,u=0;u<h;u+=1)y[u]=e(u,w)||"null";return d=y.length===0?"[]":s?`[
789
+ `+s+y.join(`,
790
+ `+s)+`
791
+ `+p+"]":"["+y.join(",")+"]",s=p,d}for(c in w)zr.call(w,c)&&(d=e(c,w),d&&y.push(r(c)+(s?": ":":")+d));return d=y.length===0?"{}":s?"{"+y.join(",")+p+"}":"{"+y.join(",")+"}",s=p,d}};return e("",{"":t})}}(),v.JSONDecode=function(){var n,t,r={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
792
+ `,r:"\r",t:" "},e,i=function(y){var w=new SyntaxError(y);throw w.at=n,w.text=e,w},o=function(y){return y&&y!==t&&i("Expected '"+y+"' instead of '"+t+"'"),t=e.charAt(n),n+=1,t},s=function(){var y,w="";for(t==="-"&&(w="-",o("-"));t>="0"&&t<="9";)w+=t,o();if(t===".")for(w+=".";o()&&t>="0"&&t<="9";)w+=t;if(t==="e"||t==="E")for(w+=t,o(),(t==="-"||t==="+")&&(w+=t,o());t>="0"&&t<="9";)w+=t,o();if(y=+w,!isFinite(y))i("Bad number");else return y},a=function(){var y,w,k="",b;if(t==='"')for(;o();){if(t==='"')return o(),k;if(t==="\\")if(o(),t==="u"){for(b=0,w=0;w<4&&(y=parseInt(o(),16),!!isFinite(y));w+=1)b=b*16+y;k+=String.fromCharCode(b)}else if(typeof r[t]=="string")k+=r[t];else break;else k+=t}i("Bad string")},u=function(){for(;t&&t<=" ";)o()},c=function(){switch(t){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}i('Unexpected "'+t+'"')},d,h=function(){var y=[];if(t==="["){if(o("["),u(),t==="]")return o("]"),y;for(;t;){if(y.push(d()),u(),t==="]")return o("]"),y;o(","),u()}}i("Bad array")},p=function(){var y,w={};if(t==="{"){if(o("{"),u(),t==="}")return o("}"),w;for(;t;){if(y=a(),u(),o(":"),Object.hasOwnProperty.call(w,y)&&i('Duplicate key "'+y+'"'),w[y]=d(),u(),t==="}")return o("}"),w;o(","),u()}}i("Bad object")};return d=function(){switch(u(),t){case"{":return p();case"[":return h();case'"':return a();case"-":return s();default:return t>="0"&&t<="9"?s():c()}},function(y){var w;return e=y,n=0,t=" ",w=d(),u(),t&&i("Syntax error"),w}}(),v.base64Encode=function(n){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,e,i,o,s,a,u,c,d=0,h=0,p="",y=[];if(!n)return n;n=v.utf8Encode(n);do r=n.charCodeAt(d++),e=n.charCodeAt(d++),i=n.charCodeAt(d++),c=r<<16|e<<8|i,o=c>>18&63,s=c>>12&63,a=c>>6&63,u=c&63,y[h++]=t.charAt(o)+t.charAt(s)+t.charAt(a)+t.charAt(u);while(d<n.length);switch(p=y.join(""),n.length%3){case 1:p=p.slice(0,-2)+"==";break;case 2:p=p.slice(0,-1)+"=";break}return p},v.utf8Encode=function(n){n=(n+"").replace(/\r\n/g,`
765
793
  `).replace(/\r/g,`
766
- `);var e="",i,t,o=0,s;for(i=t=0,o=n.length,s=0;s<o;s++){var r=n.charCodeAt(s),l=null;r<128?t++:r>127&&r<2048?l=String.fromCharCode(r>>6|192,r&63|128):l=String.fromCharCode(r>>12|224,r>>6&63|128,r&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(R.performance&&R.performance.now)o=R.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,r=[],l=0;function c(b,p){var g,f=0;for(g=0;g<p.length;g++)f|=r[g]<<g*8;return b^f}for(o=0;o<t.length;o++)s=t.charCodeAt(o),r.unshift(s&255),r.length>=4&&(l=c(l,r),r=[]);return r.length>0&&(l=c(l,r)),l.toString(16)};return function(){var t=(Mi.height*Mi.width).toString(16);return n()+"-"+e()+"-"+i()+"-"+t+"-"+n()}}();var wo=["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<wo.length;e++)if(n.indexOf(wo[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,r){i=encodeURIComponent(s.toString()),t=encodeURIComponent(r),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=X.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,r){var l="",c="",b="";if(r)l="; domain="+r;else if(t){var p=Co(X.location.hostname);l=p?"; domain=."+p:""}if(i){var g=new Date;g.setTime(g.getTime()+i*1e3),c="; expires="+g.toGMTString()}s&&(o=!0,b="; SameSite=None"),o&&(b+="; secure"),X.cookie=n+"="+encodeURIComponent(e)+c+"; path=/"+l+b},set:function(n,e,i,t,o,s,r){var l="",c="",b="";if(r)l="; domain="+r;else if(t){var p=Co(X.location.hostname);l=p?"; domain=."+p:""}if(i){var g=new Date;g.setTime(g.getTime()+i*24*60*60*1e3),c="; expires="+g.toGMTString()}s&&(o=!0,b="; SameSite=None"),o&&(b+="; secure");var f=n+"="+encodeURIComponent(e)+c+"; path=/"+l+b;return X.cookie=f,f},remove:function(n,e,i){m.cookie.set(n,"",-1,e,!1,!1,i)}};var Yi=null,xi=function(n,e){if(Yi!==null&&!e)return Yi;var i=!0;try{n=n||window.localStorage;var t="__mplss_"+Qi(8),o="xyz";n.setItem(t,o),n.getItem(t)!==o&&(i=!1),n.removeItem(t)}catch{i=!1}return Yi=i,i};m.localStorage={is_supported:function(n){var e=xi(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,r,l){if(!t){J.error("No valid element provided to register_event");return}if(t.addEventListener&&!r)t.addEventListener(o,s,!!l);else{var c="on"+o,b=t[c];t[c]=e(t,s,b)}};function e(t,o,s){var r=function(l){if(l=l||i(window.event),!!l){var c=!0,b,p;return m.isFunction(s)&&(b=s(l)),p=o.call(t,l),(b===!1||p===!1)&&(c=!1),c}};return r}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 ar=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 r=" "+s+" ";return(" "+o.className+" ").replace(e," ").indexOf(r)>=0}function t(o){if(!X.getElementsByTagName)return[];var s=o.split(" "),r,l,c,b,p,g,f,y,C,k,S=[X];for(g=0;g<s.length;g++){if(r=s[g].replace(/^\s+/,"").replace(/\s+$/,""),r.indexOf("#")>-1){l=r.split("#"),c=l[0];var M=l[1],A=X.getElementById(M);if(!A||c&&A.nodeName.toLowerCase()!=c)return[];S=[A];continue}if(r.indexOf(".")>-1){l=r.split("."),c=l[0];var _=l[1];for(c||(c="*"),b=[],p=0,f=0;f<S.length;f++)for(c=="*"?C=n(S[f]):C=S[f].getElementsByTagName(c),y=0;y<C.length;y++)b[p++]=C[y];for(S=[],k=0,f=0;f<b.length;f++)b[f].className&&m.isString(b[f].className)&&i(b[f],_)&&(S[k++]=b[f]);continue}var E=r.match(ar);if(E){c=E[1];var N=E[2],G=E[3],z=E[4];for(c||(c="*"),b=[],p=0,f=0;f<S.length;f++)for(c=="*"?C=n(S[f]):C=S[f].getElementsByTagName(c),y=0;y<C.length;y++)b[p++]=C[y];S=[],k=0;var U;switch(G){case"=":U=function(V){return V.getAttribute(N)==z};break;case"~":U=function(V){return V.getAttribute(N).match(new RegExp("\\b"+z+"\\b"))};break;case"|":U=function(V){return V.getAttribute(N).match(new RegExp("^"+z+"-?"))};break;case"^":U=function(V){return V.getAttribute(N).indexOf(z)===0};break;case"$":U=function(V){return V.getAttribute(N).lastIndexOf(z)==V.getAttribute(N).length-z.length};break;case"*":U=function(V){return V.getAttribute(N).indexOf(z)>-1};break;default:U=function(V){return V.getAttribute(N)}}for(S=[],k=0,f=0;f<b.length;f++)U(b[f])&&(S[k++]=b[f]);continue}for(c=r,b=[],p=0,f=0;f<S.length;f++)for(C=S[f].getElementsByTagName(c),y=0;y<C.length;y++)b[p++]=C[y];S=b}return S}return function(o){return m.isElement(o)?[o]:m.isObject(o)&&!m.isUndefined(o.length)?o:t.call(this,o)}}();var rr=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],lr=["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(rr,function(t){e=m.getQueryParam(X.URL,t),e.length?i[t]=e:n!==void 0&&(i[t]=n)}),i},clickParams:function(){var n="",e={};return m.each(lr,function(i){n=m.getQueryParam(X.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 r=n.match(s);return r?parseFloat(r[r.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 R.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,ln.vendor,_i),$referrer:X.referrer,$referring_domain:m.info.referringDomain(X.referrer),$device:m.info.device(ze)}),{$current_url:m.info.currentUrl(),$browser_version:m.info.browserVersion(ze,ln.vendor,_i),$screen_height:Mi.height,$screen_width:Mi.width,mp_lib:"web",$lib_version:Je.LIB_VERSION,$insert_id:Qi(),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,ln.vendor,_i)}),{$browser_version:m.info.browserVersion(ze,ln.vendor,_i)})},mpPageViewProperties:function(){return m.strip_empty_properties({current_page_title:X.title,current_domain:R.location.hostname,current_url_path:R.location.pathname,current_url_protocol:R.location.protocol,current_url_search:R.location.search})}};var Qi=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},dr=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,cr=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Co=function(n){var e=cr,i=n.split("."),t=i[i.length-1];(t.length>4||t==="com"||t==="org")&&(e=dr);var o=n.match(e);return o?o[0]:""},ur=function(){var n=R.navigator.onLine;return m.isUndefined(n)||n},Li=null,Ti=null;typeof JSON<"u"&&(Li=JSON.stringify,Ti=JSON.parse),Li=Li||m.JSONEncode,Ti=Ti||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 hr="__mp_opt_in_out_";function mr(n,e){Mo(!0,n,e)}function pr(n,e){Mo(!1,n,e)}function br(n,e){return _o(n,e)==="1"}function So(n,e){if(fr(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=_o(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 dn(n){return nt(n,function(e){return this.get_config(e)})}function cn(n){return nt(n,function(e){return this._get_config(e)})}function Dn(n){return nt(n,function(e){return this._get_config(e)})}function vr(n,e){e=e||{},Xi(e).remove(et(n,e),!!e.crossSubdomainCookie,e.cookieDomain)}function Xi(n){return n=n||{},n.persistenceType==="localStorage"?m.localStorage:m.cookie}function et(n,e){return e=e||{},(e.persistencePrefix||hr)+n}function _o(n,e){return Xi(e).get(et(n,e))}function fr(n){if(n&&n.ignoreDnt)return!1;var e=n&&n.window||R,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 Mo(n,e,i){if(!m.isString(e)||!e.length){J.error("gdpr."+(n?"optIn":"optOut")+" called with an invalid token");return}i=i||{},Xi(i).set(et(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 nt(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"),r=e.call(this,"opt_out_tracking_cookie_prefix"),l=e.call(this,"window");t&&(i=So(t,{ignoreDnt:o,persistenceType:s,persistencePrefix:r,window:l}))}catch(b){J.error("Unexpected error when checking tracking opt-out status: "+b)}if(!i)return n.apply(this,arguments);var c=arguments[arguments.length-1];typeof c=="function"&&c(0)}}var gr=Ai("lock"),Ao=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||window.localStorage,this.pollIntervalMS=e.pollIntervalMS||100,this.timeoutMS=e.timeoutMS||2e3};Ao.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,r=this.pollIntervalMS,l=this.timeoutMS,c=this.storage,b=s+":X",p=s+":Y",g=s+":Z",f=function(A){e&&e(A)},y=function(A){if(new Date().getTime()-o>l){gr.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+t+"]"),c.removeItem(g),c.removeItem(p),S();return}setTimeout(function(){try{A()}catch(_){f(_)}},r*(Math.random()+.1))},C=function(A,_){A()?_():y(function(){C(A,_)})},k=function(){var A=c.getItem(p);if(A&&A!==t)return!1;if(c.setItem(p,t),c.getItem(p)===t)return!0;if(!xi(c,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},S=function(){c.setItem(b,t),C(k,function(){if(c.getItem(b)===t){M();return}y(function(){if(c.getItem(p)!==t){S();return}C(function(){return!c.getItem(g)},M)})})},M=function(){c.setItem(g,"1");try{n()}finally{c.removeItem(g),c.getItem(p)===t&&c.removeItem(p),c.getItem(b)===t&&c.removeItem(b)}};try{if(xi(c,!0))S();else throw new Error("localStorage support check failed")}catch(A){f(A)}};var xo=Ai("batch"),un=function(n,e){e=e||{},this.storageKey=n,this.storage=e.storage||window.localStorage,this.reportError=e.errorReporter||m.bind(xo.error,xo),this.lock=new Ao(n,{storage:this.storage}),this.usePersistence=e.usePersistence,this.pid=e.pid||null,this.memQueue=[]};un.prototype.enqueue=function(n,e,i){var t={id:Qi(),flushAfter:new Date().getTime()+e*2,payload:n};this.usePersistence?this.lock.withLock(m.bind(function(){var s;try{var r=this.readFromStorage();r.push(t),s=this.saveToStorage(r),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))},un.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(r){t[r.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 Lo=function(n,e){var i=[];return m.each(n,function(t){t.id&&!e[t.id]&&i.push(t)}),i};un.prototype.removeItemsByID=function(n,e){var i={};if(m.each(n,function(o){i[o]=!0}),this.memQueue=Lo(this.memQueue,i),!this.usePersistence)e&&e(!0);else{var t=m.bind(function(){var o;try{var s=this.readFromStorage();if(s=Lo(s,i),o=this.saveToStorage(s),o){s=this.readFromStorage();for(var r=0;r<s.length;r++){var l=s[r];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 r=!1;if(this.reportError("Error acquiring storage lock",s),!xi(this.storage,!0)&&(r=t(),!r))try{this.storage.removeItem(this.storageKey)}catch(l){this.reportError("Error clearing queue",l)}e&&e(r)},this),this.pid)}};var To=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};un.prototype.updatePayloads=function(n,e){this.memQueue=To(this.memQueue,n),this.usePersistence?this.lock.withLock(m.bind(function(){var t;try{var o=this.readFromStorage();o=To(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)},un.prototype.readFromStorage=function(){var n;try{n=this.storage.getItem(this.storageKey),n&&(n=Ti(n),m.isArray(n)||(this.reportError("Invalid storage entry:",n),n=null))}catch(e){this.reportError("Error retrieving queue",e),n=null}return n||[]},un.prototype.saveToStorage=function(n){try{return this.storage.setItem(this.storageKey,Li(n)),!0}catch(e){return this.reportError("Error saving queue",e),!1}},un.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var yr=10*60*1e3,Qn=Ai("batch"),He=function(n,e){this.errorReporter=e.errorReporter,this.queue=new un(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};He.prototype.enqueue=function(n,e){this.queue.enqueue(n,this.flushInterval,e)},He.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},He.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},He.prototype.clear=function(){this.queue.clear()},He.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},He.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},He.prototype.scheduleFlush=function(n){this.flushInterval=n,this.stopped||(this.timeoutID=setTimeout(m.bind(function(){this.stopped||this.flush()},this),this.flushInterval))},He.prototype.flush=function(n){try{if(this.requestInProgress){Qn.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,r=[],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:Je.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&&r.push(g)}l[p.id]=g},this),r.length<1){this.resetFlush();return}this.requestInProgress=!0;var c=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&&!ur()||p.error==="timeout")){var f=this.flushInterval*2;p.retryAfter&&(f=parseInt(p.retryAfter,10)*1e3||f),f=Math.min(yr,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(C){return C.id}),m.bind(function(C){C?(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(C){var k=C.id;k?(this.itemIdsSentSuccessfully[k]=this.itemIdsSentSuccessfully[k]||0,this.itemIdsSentSuccessfully[k]++,this.itemIdsSentSuccessfully[k]>5&&this.reportError("[dupe] item ID sent too many times",{item:C,batchSize:o.length,timesSent:this.itemIdsSentSuccessfully[k]})):this.reportError("[dupe] found item with no ID while removing",{item:C})},this)))}catch(C){this.reportError("Error handling API response",C),this.resetFlush()}},this),b={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:e};n.unloading&&(b.transport="sendBeacon"),Qn.log("MIXPANEL REQUEST:",r),this.sendRequest(r,b,c)}catch(p){this.reportError("Error flushing request queue",p),this.resetFlush()}},He.prototype.reportError=function(n,e){if(Qn.error.apply(Qn.error,arguments),this.errorReporter)try{e instanceof Error||(e=new Error(n)),this.errorReporter(n,e)}catch(i){Qn.error(i)}};var kn=Ai("recorder"),Eo=R.CompressionStream,kr={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},wr=new Set([Ge.MouseMove,Ge.MouseInteraction,Ge.Scroll,Ge.ViewportResize,Ge.Input,Ge.TouchMove,Ge.MediaInteraction,Ge.Drag,Ge.Selection]);function Cr(n){return n.type===bo.IncrementalSnapshot&&wr.has(n.data.source)}var Ue=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=$n,this.recordMinMs=0,this._initBatcher()};Ue.prototype._initBatcher=function(){this.batcher=new He("__mprec",{libConfig:kr,sendRequestFunc:m.bind(this.flushEventsWithOptOut,this),errorReporter:m.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},Ue.prototype.get_config=function(n){return this._mixpanel.get_config(n)},Ue.prototype.startRecording=function(n){if(this._stopRecording!==null){kn.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>$n&&(this.recordMaxMs=$n,kn.critical("record_max_ms cannot be greater than "+$n+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>Wi&&(this.recordMinMs=Wi,kn.critical("record_min_ms cannot be greater than "+Wi+"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(){kn.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=Jn({emit:m.bind(function(t){this.batcher.enqueue(t),Cr(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)},Ue.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},Ue.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)},Ue.prototype.flushEventsWithOptOut=function(n,e,i){this._flushEvents(n,e,i,m.bind(this._onOptOut,this))},Ue.prototype._onOptOut=function(n){n===0&&(this.recEvents=[],this.stopRecording())},Ue.prototype._sendRequest=function(n,e,i,t){var o=m.bind(function(s,r){s.status===200&&this.replayId===n&&this.seqNo++,t({status:0,httpStatusCode:s.status,responseBody:r,retryAfter:s.headers.get("Retry-After")})},this);R.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(r){o(s,r)}).catch(function(r){t({error:r})})}).catch(function(s){t({error:s,httpStatusCode:0})})},Ue.prototype._flushEvents=dn(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 r=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:r,replay_start_time:this.replayStartTime/1e3},c=m.JSONEncode(n),b=this._mixpanel.get_property("$device_id");b&&(l.$device_id=b);var p=this._mixpanel.get_property("$user_id");if(p&&(l.$user_id=p),Eo){var g=new Blob([c],{type:"application/json"}).stream(),f=g.pipeThrough(new Eo("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,c,i)}}),Ue.prototype.reportError=function(n,e){kn.error.apply(kn.error,arguments);try{!e&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,e)}catch(i){kn.error(i)}},R.__mp_recorder=Ue;var $e=function(){};$e.prototype.create_properties=function(){},$e.prototype.event_handler=function(){},$e.prototype.after_track_handler=function(){},$e.prototype.init=function(n){return this.mp=n,this},$e.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(r){m.register_event(r,this.override_event,function(l){var c={},b=o.create_properties(i,this),p=o.mp.get_config("track_links_timeout");o.event_handler(l,this,c),window.setTimeout(o.track_callback(t,b,c,!0),p),o.mp.track(e,b,o.track_callback(t,b,c))})},this),!0},$e.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))}},$e.prototype.create_properties=function(n,e){var i;return typeof n=="function"?i=n(e):i=m.extend({},n),i};var On=function(){this.override_event="click"};m.inherit(On,$e),On.prototype.create_properties=function(n,e){var i=On.superclass.create_properties.apply(this,arguments);return e.href&&(i.url=e.href),i},On.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()},On.prototype.after_track_handler=function(n,e){e.new_tab||setTimeout(function(){window.location=e.href},0)};var Ei=function(){this.override_event="submit"};m.inherit(Ei,$e),Ei.prototype.event_handler=function(n,e,i){i.element=e,n.preventDefault()},Ei.prototype.after_track_handler=function(n,e){setTimeout(function(){e.element.submit()},0)};var hn="$set",Hn="$set_once",Ke="$unset",wn="$add",Fe="$append",Cn="$union",Ye="$remove",Sr="$delete",Po={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[hn]=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[Ke]=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[Hn]=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[Cn]=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[Fe]=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[Ye]=t,i},delete_action:function(){var n={};return n[Sr]="",n}},ie=function(){};m.extend(ie.prototype,Po),ie.prototype._init=function(n,e,i){this._mixpanel=n,this._group_key=e,this._group_id=i},ie.prototype.set=Dn(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=Dn(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=Dn(function(n,e){var i=this.unset_action(n);return this._send_request(i,e)}),ie.prototype.union=Dn(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=Dn(function(n){var e=this.delete_action();return this._send_request(e,n)}),ie.prototype.remove=Dn(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 D=function(){};m.extend(D.prototype,Po),D.prototype._init=function(n){this._mixpanel=n},D.prototype.set=cn(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[hn]=m.extend({},m.info.people_properties(),t[hn]),this._send_request(t,i)}),D.prototype.set_once=cn(function(n,e,i){var t=this.set_once_action(n,e);return m.isObject(n)&&(i=e),this._send_request(t,i)}),D.prototype.unset=cn(function(n,e){var i=this.unset_action(n);return this._send_request(i,e)}),D.prototype.increment=cn(function(n,e,i){var t={},o={};return m.isObject(n)?(m.each(n,function(s,r){if(!this._is_reserved_property(r))if(isNaN(parseFloat(s))){J.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else o[r]=s},this),i=e):(m.isUndefined(e)&&(e=1),o[n]=e),t[wn]=o,this._send_request(t,i)}),D.prototype.append=cn(function(n,e,i){m.isObject(n)&&(i=e);var t=this.append_action(n,e);return this._send_request(t,i)}),D.prototype.remove=cn(function(n,e,i){m.isObject(n)&&(i=e);var t=this.remove_action(n,e);return this._send_request(t,i)}),D.prototype.union=cn(function(n,e,i){m.isObject(n)&&(i=e);var t=this.union_action(n,e);return this._send_request(t,i)}),D.prototype.track_charge=cn(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)}),D.prototype.clear_charges=function(n){return this.set("$transactions",[],n)},D.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)},D.prototype.toString=function(){return this._mixpanel.toString()+".people"},D.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))},D.prototype._get_config=function(n){return this._mixpanel.get_config(n)},D.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},D.prototype._enqueue=function(n){hn in n?this._mixpanel.persistence._add_to_people_queue(hn,n):Hn in n?this._mixpanel.persistence._add_to_people_queue(Hn,n):Ke in n?this._mixpanel.persistence._add_to_people_queue(Ke,n):wn in n?this._mixpanel.persistence._add_to_people_queue(wn,n):Fe in n?this._mixpanel.persistence._add_to_people_queue(Fe,n):Ye in n?this._mixpanel.persistence._add_to_people_queue(Ye,n):Cn in n?this._mixpanel.persistence._add_to_people_queue(Cn,n):J.error("Invalid call to _enqueue():",n)},D.prototype._flush_one_queue=function(n,e,i,t){var o=this,s=m.extend({},this._mixpanel.persistence.load_queue(n)),r=s;!m.isUndefined(s)&&m.isObject(s)&&!m.isEmptyObject(s)&&(o._mixpanel.persistence._pop_from_people_queue(n,s),o._mixpanel.persistence.save(),t&&(r=t(s)),e.call(o,r,function(l,c){l===0&&o._mixpanel.persistence._add_to_people_queue(n,s),m.isUndefined(i)||i(l,c)}))},D.prototype._flush=function(n,e,i,t,o,s,r){var l=this;this._flush_one_queue(hn,this.set,n),this._flush_one_queue(Hn,this.set_once,t),this._flush_one_queue(Ke,this.unset,s,function(S){return m.keys(S)}),this._flush_one_queue(wn,this.increment,e),this._flush_one_queue(Cn,this.union,o);var c=this._mixpanel.persistence.load_queue(Fe);if(!m.isUndefined(c)&&m.isArray(c)&&c.length)for(var b,p=function(S,M){S===0&&l._mixpanel.persistence._add_to_people_queue(Fe,b),m.isUndefined(i)||i(S,M)},g=c.length-1;g>=0;g--)c=this._mixpanel.persistence.load_queue(Fe),b=c.pop(),l._mixpanel.persistence.save(),m.isEmptyObject(b)||l.append(b,p);var f=this._mixpanel.persistence.load_queue(Ye);if(!m.isUndefined(f)&&m.isArray(f)&&f.length)for(var y,C=function(S,M){S===0&&l._mixpanel.persistence._add_to_people_queue(Ye,y),m.isUndefined(r)||r(S,M)},k=f.length-1;k>=0;k--)f=this._mixpanel.persistence.load_queue(Ye),y=f.pop(),l._mixpanel.persistence.save(),m.isEmptyObject(y)||l.remove(y,C)},D.prototype._is_reserved_property=function(n){return n==="$distinct_id"||n==="$token"||n==="$device_id"||n==="$user_id"||n==="$had_persisted_distinct_id"},D.prototype.set=D.prototype.set,D.prototype.set_once=D.prototype.set_once,D.prototype.unset=D.prototype.unset,D.prototype.increment=D.prototype.increment,D.prototype.append=D.prototype.append,D.prototype.remove=D.prototype.remove,D.prototype.union=D.prototype.union,D.prototype.track_charge=D.prototype.track_charge,D.prototype.clear_charges=D.prototype.clear_charges,D.prototype.delete_user=D.prototype.delete_user,D.prototype.toString=D.prototype.toString;var it="__mps",tt="__mpso",ot="__mpus",st="__mpa",at="__mpap",rt="__mpr",lt="__mpu",No="$people_distinct_id",Pi="__alias",Xn="__timers",_r=[it,tt,ot,st,at,rt,lt,No,Pi,Xn],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(_r,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(hn),s=this._get_or_create_queue(Hn),r=this._get_or_create_queue(Ke),l=this._get_or_create_queue(wn),c=this._get_or_create_queue(Cn),b=this._get_or_create_queue(Ye,[]),p=this._get_or_create_queue(Fe,[]);i===it?(m.extend(o,t),this._pop_from_people_queue(wn,t),this._pop_from_people_queue(Cn,t),this._pop_from_people_queue(Ke,t)):i===tt?(m.each(t,function(g,f){f in s||(s[f]=g)}),this._pop_from_people_queue(Ke,t)):i===ot?m.each(t,function(g){m.each([o,s,l,c],function(f){g in f&&delete f[g]}),m.each(p,function(f){g in f&&delete f[g]}),r[g]=!0}):i===st?(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(Ke,t)):i===lt?(m.each(t,function(g,f){m.isArray(g)&&(f in c||(c[f]=[]),c[f]=c[f].concat(g))}),this._pop_from_people_queue(Ke,t)):i===rt?(b.push(t),this._pop_from_people_queue(Fe,t)):i===at&&(p.push(t),this._pop_from_people_queue(Ke,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===Fe||n===Ye?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===hn)return it;if(n===Hn)return tt;if(n===Ke)return ot;if(n===wn)return st;if(n===Fe)return at;if(n===Ye)return rt;if(n===Cn)return lt;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(Xn)||{};i[n]=e,this.props[Xn]=i,this.save()},j.prototype.remove_event_timer=function(n){var e=this.load_prop(Xn)||{},i=e[n];return m.isUndefined(i)||(delete this.props[Xn][n],this.save()),i};var dt,Io=function(n,e){throw new Error(n+" not available in this build.")},we,Bo=0,Mr=1,Ar=function(n){return n},ei=function(){},Be="mixpanel",Ro="base64",xr="json",ct="$device:",Un=R.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Do=!Un&&ze.indexOf("MSIE")===-1&&ze.indexOf("Mozilla")===-1,Ni=null;ln.sendBeacon&&(Ni=function(){return ln.sendBeacon.apply(ln,arguments)});var Oo={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},Ho={api_host:"https://api-js.mixpanel.com",api_routes:Oo,api_method:"POST",api_transport:"XHR",api_payload_format:Ro,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:ei,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:ei,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:$n,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},Uo=!1,x=function(){},ut=function(n,e,i){var t,o=i===Be?we:we[i];if(o&&dt===Bo)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 D,t.people._init(t),!t.get_config("skip_first_touch_marketing")){var s=m.info.campaignParams(null),r={},l=!1;m.each(s,function(c,b){r["initial_"+b]=c,c&&(l=!0)}),l&&t.people.set_once(r)}return Je.DEBUG=Je.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===Be){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var t=ut(n,e,i);return we[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||Ho.api_host;o.match(/\.mixpanel\.com/)&&(t.api_payload_format=xr)}if(this.set_config(m.extend({},Ho,t,e,{name:i,token:n,callback_fn:(i===Be?i:Be+"."+i)+"._jsc"})),this._jsc=ei,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)||!Un)this._batch_requests=!1,J.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),m.each(this.get_batcher_configs(),function(c){J.log("Clearing batch queue "+c.queue_key),m.localStorage.remove(c.queue_key)});else if(this.init_batchers(),Ni&&R.addEventListener){var s=m.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);R.addEventListener("pagehide",function(c){c.persisted&&s()}),R.addEventListener("visibilitychange",function(){X.visibilityState==="hidden"&&s()})}}this.persistence=this.cookie=new j(this.config),this.unpersisted_superprops={},this._gdpr_init();var r=m.UUID();this.get_distinct_id()||this.register_once({distinct_id:ct+r,$device_id:r},"");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=dn(function(){if(!R.MutationObserver){J.critical("Browser does not support MutationObserver; skipping session recording");return}var n=m.bind(function(){this._recorder=this._recorder||new R.__mp_recorder(this),this._recorder.startRecording()},this);m.isUndefined(R.__mp_recorder)?Io(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(X.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(X.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(!Uo)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)){R.addEventListener("popstate",function(){R.dispatchEvent(new Event("mp_locationchange"))}),R.addEventListener("hashchange",function(){R.dispatchEvent(new Event("mp_locationchange"))});var t=R.history.pushState;typeof t=="function"&&(R.history.pushState=function(s,r,l){t.call(R.history,s,r,l),R.dispatchEvent(new Event("mp_locationchange"))});var o=R.history.replaceState;typeof o=="function"&&(R.history.replaceState=function(s,r,l){o.call(R.history,s,r,l),R.dispatchEvent(new Event("mp_locationchange"))}),R.addEventListener("mp_locationchange",(function(){var s=m.info.currentUrl(),r=!1;if(n==="full-url"?r=s!==e:n==="url-with-path-and-query-string"?r=s.split("#")[0]!==e.split("#")[0]:n==="url-with-path"&&(r=s.split("#")[0].split("?")[0]!==e.split("#")[0].split("?")[0]),r){var l=this.track_pageview();l&&(e=s)}}).bind(this))}},x.prototype._prepare_callback=function(n,e){if(m.isUndefined(n))return null;if(Un){var i=function(r){n(r,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(r){delete t[o],n(r,e)},s}},x.prototype._send_request=function(n,e,i,t){var o=!0;if(Do)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")},r=null;!t&&(m.isFunction(i)||typeof i=="string")&&(t=i,i=null),i=m.extend(s,i||{}),Un||(i.method="GET");var l=i.method==="POST",c=Ni&&l&&i.transport.toLowerCase()==="sendbeacon",b=i.verbose;e.verbose&&(b=!0),this.get_config("test")&&(e.test=1),b&&(e.verbose=1),this.get_config("img")&&(e.img=1),Un||(t?e.callback=t:(b||this.get_config("test"))&&(e.callback="(function(){})")),e.ip=this.get_config("ip")?1:0,e._=new Date().getTime().toString(),l&&(r="data="+encodeURIComponent(e.data),delete e.data),n+="?"+m.HTTPBuildQuery(e);var p=this;if("img"in e){var g=X.createElement("img");g.src=n,X.body.appendChild(g)}else if(c){try{o=Ni(n,r)}catch(M){p.report_error(M),o=!1}try{t&&t(o?1:0)}catch(M){p.report_error(M)}}else if(Un)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 C=new Date().getTime()}f.withCredentials=!0,f.onreadystatechange=function(){if(f.readyState===4)if(f.status===200){if(t)if(b){var M;try{M=m.JSONDecode(f.responseText)}catch(E){if(p.report_error(E),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()-C>=f.timeout?A="timeout":A="Bad HTTP status: "+f.status+" "+f.statusText,p.report_error(A),t)if(b){var _=f.responseHeaders||{};t({status:0,httpStatusCode:f.status,error:A,retryAfter:_["Retry-After"]})}else t(0)}},f.send(r)}catch(M){p.report_error(M),o=!1}else{var k=X.createElement("script");k.type="text/javascript",k.async=!0,k.defer=!0,k.src=n;var S=X.getElementsByTagName("script")[0];S.parentNode.insertBefore(k,S)}return o},x.prototype._execute_array=function(n){var e,i=[],t=[],o=[];m.each(n,function(r){r&&(e=r[0],m.isArray(e)?o.push(r):typeof r=="function"?r.call(this):m.isArray(r)&&e==="alias"?i.push(r):m.isArray(r)&&e.indexOf("track")!==-1&&typeof this[e]=="function"?o.push(r):t.push(r))},this);var s=function(r,l){m.each(r,function(c){if(m.isArray(c[0])){var b=l;m.each(c,function(p){b=b[p[0]].apply(b,p.slice(1))})}else this[c[0]].apply(this,c.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 He(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")===Ro&&(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,r=n.send_request_options||{};e=e||ei;var l=!0,c=m.bind(function(){return r.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),r,this._prepare_callback(e,i))):null},this);return this._batch_requests&&!s?o.enqueue(i,function(b){b?e(1,i):c()}):l=c(),l&&i},x.prototype.track=dn(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=ei),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 r=this.persistence.remove_event_timer(n);if(!m.isUndefined(r)){var l=new Date().getTime()-r;e.$duration=parseFloat((l/1e3).toFixed(3))}this._set_default_superprops();var c=this.get_config("track_marketing")?m.info.marketingParams():{};e=m.extend({},m.info.properties({mp_loader:this.get_config("mp_loader")}),c,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),e);var b=this.get_config("property_blacklist");m.isArray(b)?m.each(b,function(f){delete e[f]}):this.report_error("Invalid value for property_blacklist config: "+b);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=dn(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=dn(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=dn(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=dn(function(n,e,i,t){var o=m.extend({},e||{});return m.each(i,function(s,r){s!=null&&(o[r]=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=dn(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,On,arguments)},x.prototype.track_forms=function(){return this._track_dom.call(this,Ei,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 Lr={persistent:!0},ht=function(n){var e;return m.isObject(n)?e=n:m.isUndefined(n)?e={}:e={days:n},m.extend({},Lr,e)};x.prototype.register=function(n,e){var i=ht(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=ht(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=ht(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,r,l){var c=this.get_distinct_id();if(n&&c!==n){if(typeof n=="string"&&n.indexOf(ct)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:n})}if(!this.get_property("$device_id")){var b=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:b},"")}n!==c&&n!==this.get_property(Pi)&&(this.unregister(Pi),this.register({distinct_id:n})),this._flags.identify_called=!0,this.people._flush(e,i,t,o,s,r,l),n!==c&&this.track("$identify",{distinct_id:n,$anon_distinct_id:c},{skip_hooks:!0})},x.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var n=m.UUID();this.register_once({distinct_id:ct+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(No))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(Pi,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),Je.DEBUG=Je.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]||Ar).apply(this,rn.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!==Be&&(n=Be+"."+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(mr,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(pr,n),this._gdpr_update_persistence(n)},x.prototype.has_opted_in_tracking=function(n){return this._gdpr_call_func(br,n)},x.prototype.has_opted_out_tracking=function(n){return this._gdpr_call_func(So,n)},x.prototype.clear_opt_in_out_tracking=function(n){n=m.extend({enable_persistence:!0},n),this._gdpr_call_func(vr,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=Oo,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 Kn={},Tr=function(){m.each(Kn,function(n,e){e!==Be&&(we[e]=n)}),we._=m},Er=function(){we.init=function(n,e,i){if(i)return we[i]||(we[i]=Kn[i]=ut(n,e,i),we[i]._loaded()),we[i];var t=we;Kn[Be]?t=Kn[Be]:n&&(t=ut(n,e,Be),t._loaded(),Kn[Be]=t),we=t,dt===Mr&&(R[Be]=we),Tr()}},Pr=function(){function n(){n.done||(n.done=!0,Uo=!0,Do=!1,m.each(Kn,function(t){t._dom_loaded()}))}function e(){try{X.documentElement.doScroll("left")}catch{setTimeout(e,1);return}n()}if(X.addEventListener)X.readyState==="complete"?n():X.addEventListener("DOMContentLoaded",n,!1);else if(X.attachEvent){X.attachEvent("onreadystatechange",n);var i=!1;try{i=R.frameElement===null}catch{}X.documentElement.doScroll&&i&&e()}m.register_event(R,"load",n,!0)};function Nr(n){return Io=n,dt=Bo,we=new x,Er(),we.init(),Pr(),we}function Ir(n,e){e()}var P=Nr(Ir);const Ko=`<div id="checkoutConfirmationEnd">
767
- <div class="w-full">
768
- <div id="otp-content" class=" grid gap-4">
769
- <h5 class="text-black" id="otp-message">
770
-
771
- </h5>
772
-
773
- <div class="">
774
- <div class="w-11/12 mx-auto">
775
- <p class="text-center">Your transaction is being processed and is taking longer than usual to
776
- confirm. You don’t need to
777
- stay on this page—<br /> <span class="font-bold">we will notify you once it is confirmed.</span>
778
- </p>
779
- </div>
780
- <div class="py-5">
781
- <div class="mt-2">
782
- <button class="details-form-button" id="goback-to-merchant" type="button">
783
- <svg class="spinner hidden" id="spinner" viewBox="0 0 24 24">
784
- <path
785
- d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">
786
- </path>
787
- </svg>
788
- <span id="mobile-money-button-text"> Go back to Merchant </span>
789
- </button>
790
- </div>
791
- </div>
792
- </div>
793
- </div>
794
- </div>`;class jo{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("#goback-to-merchant");e&&e.addEventListener("click",()=>{sn(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)})}renderComponent(){this.container.innerHTML=this.render(),this.attachListeners()}render(){return Ko}}class Br{constructor({amount:e,container:i,email:t,encryption:o,planId:s,token:r,currency:l,rdtCode:c,url:b,reference:p,onSuccess:g,callBackUrl:f,metadata:y,localCurrency:C,hidePaymentMethods:k,showPaymentMethods:S,onClose:M,restartTransactionProcess:A,retryingPayment:_}){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,"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,"restartTransactionProcess");h(this,"retryingPayment");h(this,"isMaxRetriesReached");h(this,"isMobile",!1);this.currency=l,this.onSuccess=g||(()=>null),this.container=i,this.encryption=o,this.token=r,this.email=t,this.planId=s,this.amount=e,this.rdtCode=c,this.url=b,this.reference=p,this.callBackUrl=f,this.metadata=y,this.localCurrency=C,this._currentStep=1,this.activeRef="",this.contents=this.container.querySelector("#payment-content-view"),this.cardResponse={},this.cardResponseHeader={},this.hidePaymentMethods=k,this.showPaymentMethods=S,this.onClose=M,this.restartTransactionProcess=A,this.retryingPayment=_,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 Ns(JSON.stringify(i),this.encryption);t&&o&&(t.classList.remove("hidden"),o.classList.add("hidden")),(()=>{if(this.retryingPayment){const l={channel:"card",reference:this.reference,encryptedCard:s};return si(this.token,l,this.rdtCode,this.url)}else{const l={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};return gs(this.token,l,this.rdtCode,this.url)}})().then(({data:l,headers:c})=>{var b,p,g,f,y,C;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=c,l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Payment failed");else if(!["success","successful"].includes(l.status)&&l.status!=="failed")if(this.cardResponse=l,this.cardResponseHeader=c,l!=null&&l.authorization){if(this.activeRef=l.reference,((b=l==null?void 0:l.authorization)==null?void 0:b.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);return}if(((y=l==null?void 0:l.authorization)==null?void 0:y.mode)==="otp"){this.cardResponse=l,this.currentStep=3;return}if(((C=l==null?void 0:l.authorization)==null?void 0:C.mode)==="avs"){this.currentStep=7;return}}else this.currentStep=4,l.providerMessage?this.warningScreen.setPaymentError(l.providerMessage):this.warningScreen.setPaymentError("Error with Payment");else["success","successful"].includes(l.status)&&(this.currentStep=5,this.cardResponse=l,this.cardResponseHeader=c,P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN"}),this.redirectTo(l,c,"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">
794
+ `);var t="",r,e,i=0,o;for(r=e=0,i=n.length,o=0;o<i;o++){var s=n.charCodeAt(o),a=null;s<128?e++:s>127&&s<2048?a=String.fromCharCode(s>>6|192,s&63|128):a=String.fromCharCode(s>>12|224,s>>6&63|128,s&63|128),a!==null&&(e>r&&(t+=n.substring(r,e)),t+=a,r=e=o+1)}return e>r&&(t+=n.substring(r,n.length)),t},v.UUID=function(){try{return O.crypto.randomUUID()}catch{for(var n=new Array(36),t=0;t<36;t++)n[t]=Math.floor(Math.random()*16);return n[14]=4,n[19]=n[19]&=-5,n[19]=n[19]|=8,n[8]=n[13]=n[18]=n[23]="-",v.map(n,function(e){return e.toString(16)}).join("")}};var jc=["ahrefsbot","ahrefssiteaudit","amazonbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandex","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];v.isBlockedUA=function(n){var t;for(n=n.toLowerCase(),t=0;t<jc.length;t++)if(n.indexOf(jc[t])!==-1)return!0;return!1},v.HTTPBuildQuery=function(n,t){var r,e,i=[];return v.isUndefined(t)&&(t="&"),v.each(n,function(o,s){r=encodeURIComponent(o.toString()),e=encodeURIComponent(s),i[i.length]=e+"="+r}),i.join(t)},v.getQueryParam=function(n,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var r="[\\?&]"+t+"=([^&#]*)",e=new RegExp(r),i=e.exec(n);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch{se.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},v.cookie={get:function(n){for(var t=n+"=",r=oe.cookie.split(";"),e=0;e<r.length;e++){for(var i=r[e];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(n){var t;try{t=v.JSONDecode(v.cookie.get(n))||{}}catch{}return t},set_seconds:function(n,t,r,e,i,o,s){var a="",u="",c="";if(s)a="; domain="+s;else if(e){var d=$c(oe.location.hostname);a=d?"; domain=."+d:""}if(r){var h=new Date;h.setTime(h.getTime()+r*1e3),u="; expires="+h.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure"),oe.cookie=n+"="+encodeURIComponent(t)+u+"; path=/"+a+c},set:function(n,t,r,e,i,o,s){var a="",u="",c="";if(s)a="; domain="+s;else if(e){var d=$c(oe.location.hostname);a=d?"; domain=."+d:""}if(r){var h=new Date;h.setTime(h.getTime()+r*24*60*60*1e3),u="; expires="+h.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure");var p=n+"="+encodeURIComponent(t)+u+"; path=/"+a+c;return oe.cookie=p,p},remove:function(n,t,r){v.cookie.set(n,"",-1,t,!1,!1,r)}};var Vc=function(n){var t=!0;try{var r="__mplss_"+Vs(8),e="xyz";n.setItem(r,e),n.getItem(r)!==e&&(t=!1),n.removeItem(r)}catch{t=!1}return t},Ks=null,xi=function(n,t){return Ks!==null&&!t?Ks:Ks=Vc(n||O.localStorage)},js=null,w1=function(n,t){return js!==null&&!t?js:js=Vc(n||O.sessionStorage)};function zc(n,t,r){var e=function(i){se.error(t+" error: "+i)};return{is_supported:function(i){var o=r(n,i);return o||se.error(t+" unsupported"),o},error:e,get:function(i){try{return n.getItem(i)}catch(o){e(o)}return null},parse:function(i){try{return v.JSONDecode(n.getItem(i))||{}}catch{}return null},set:function(i,o){try{n.setItem(i,o)}catch(s){e(s)}},remove:function(i){try{n.removeItem(i)}catch(o){e(o)}}}}v.localStorage=zc(O.localStorage,"localStorage",xi),v.sessionStorage=zc(O.sessionStorage,"sessionStorage",w1),v.register_event=function(){var n=function(e,i,o,s,a){if(!e){se.error("No valid element provided to register_event");return}if(e.addEventListener&&!s)e.addEventListener(i,o,!!a);else{var u="on"+i,c=e[u];e[u]=t(e,o,c)}};function t(e,i,o){var s=function(a){if(a=a||r(O.event),!!a){var u=!0,c,d;return v.isFunction(o)&&(c=o(a)),d=i.call(e,a),(c===!1||d===!1)&&(u=!1),u}};return s}function r(e){return e&&(e.preventDefault=r.preventDefault,e.stopPropagation=r.stopPropagation),e}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},n}();var C1=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');v.dom_query=function(){function n(i){return i.all?i.all:i.getElementsByTagName("*")}var t=/[\t\r\n]/g;function r(i,o){var s=" "+o+" ";return(" "+i.className+" ").replace(t," ").indexOf(s)>=0}function e(i){if(!oe.getElementsByTagName)return[];var o=i.split(" "),s,a,u,c,d,h,p,y,w,k,b=[oe];for(h=0;h<o.length;h++){if(s=o[h].replace(/^\s+/,"").replace(/\s+$/,""),s.indexOf("#")>-1){a=s.split("#"),u=a[0];var S=a[1],A=oe.getElementById(S);if(!A||u&&A.nodeName.toLowerCase()!=u)return[];b=[A];continue}if(s.indexOf(".")>-1){a=s.split("."),u=a[0];var x=a[1];for(u||(u="*"),c=[],d=0,p=0;p<b.length;p++)for(u=="*"?w=n(b[p]):w=b[p].getElementsByTagName(u),y=0;y<w.length;y++)c[d++]=w[y];for(b=[],k=0,p=0;p<c.length;p++)c[p].className&&v.isString(c[p].className)&&r(c[p],x)&&(b[k++]=c[p]);continue}var E=s.match(C1);if(E){u=E[1];var L=E[2],P=E[3],H=E[4];for(u||(u="*"),c=[],d=0,p=0;p<b.length;p++)for(u=="*"?w=n(b[p]):w=b[p].getElementsByTagName(u),y=0;y<w.length;y++)c[d++]=w[y];b=[],k=0;var N;switch(P){case"=":N=function(F){return F.getAttribute(L)==H};break;case"~":N=function(F){return F.getAttribute(L).match(new RegExp("\\b"+H+"\\b"))};break;case"|":N=function(F){return F.getAttribute(L).match(new RegExp("^"+H+"-?"))};break;case"^":N=function(F){return F.getAttribute(L).indexOf(H)===0};break;case"$":N=function(F){return F.getAttribute(L).lastIndexOf(H)==F.getAttribute(L).length-H.length};break;case"*":N=function(F){return F.getAttribute(L).indexOf(H)>-1};break;default:N=function(F){return F.getAttribute(L)}}for(b=[],k=0,p=0;p<c.length;p++)N(c[p])&&(b[k++]=c[p]);continue}for(u=s,c=[],d=0,p=0;p<b.length;p++)for(w=b[p].getElementsByTagName(u),y=0;y<w.length;y++)c[d++]=w[y];b=c}return b}return function(i){return v.isElement(i)?[i]:v.isObject(i)&&!v.isUndefined(i.length)?i:e.call(this,i)}}();var S1=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],k1=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];v.info={campaignParams:function(n){var t="",r={};return v.each(S1,function(e){t=v.getQueryParam(oe.URL,e),t.length?r[e]=t:n!==void 0&&(r[e]=n)}),r},clickParams:function(){var n="",t={};return v.each(k1,function(r){n=v.getQueryParam(oe.URL,r),n.length&&(t[r]=n)}),t},marketingParams:function(){return v.extend(v.info.campaignParams(),v.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 t=v.info.searchEngine(n),r=t!="yahoo"?"q":"p",e={};if(t!==null){e.$search_engine=t;var i=v.getQueryParam(n,r);i.length&&(e.mp_keyword=i)}return e},browser:function(n,t,r){return t=t||"",r||v.includes(n," OPR/")?v.includes(n,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(n)?"BlackBerry":v.includes(n,"IEMobile")||v.includes(n,"WPDesktop")?"Internet Explorer Mobile":v.includes(n,"SamsungBrowser/")?"Samsung Internet":v.includes(n,"Edge")||v.includes(n,"Edg/")?"Microsoft Edge":v.includes(n,"FBIOS")?"Facebook Mobile":v.includes(n,"Whale/")?"Whale Browser":v.includes(n,"Chrome")?"Chrome":v.includes(n,"CriOS")?"Chrome iOS":v.includes(n,"UCWEB")||v.includes(n,"UCBrowser")?"UC Browser":v.includes(n,"FxiOS")?"Firefox iOS":v.includes(t,"Apple")?v.includes(n,"Mobile")?"Mobile Safari":"Safari":v.includes(n,"Android")?"Android Mobile":v.includes(n,"Konqueror")?"Konqueror":v.includes(n,"Firefox")?"Firefox":v.includes(n,"MSIE")||v.includes(n,"Trident/")?"Internet Explorer":v.includes(n,"Gecko")?"Mozilla":""},browserVersion:function(n,t,r){var e=v.info.browser(n,t,r),i={"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+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/},o=i[e];if(o===void 0)return null;var s=n.match(o);return s?parseFloat(s[s.length-2]):null},os:function(){var n=Dn;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 t=n.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return O.location.href},properties:function(n){return typeof n!="object"&&(n={}),v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(Dn,rt.vendor,$r),$referrer:oe.referrer,$referring_domain:v.info.referringDomain(oe.referrer),$device:v.info.device(Dn)}),{$current_url:v.info.currentUrl(),$browser_version:v.info.browserVersion(Dn,rt.vendor,$r),$screen_height:Hc.height,$screen_width:Hc.width,mp_lib:"web",$lib_version:vn.LIB_VERSION,$insert_id:Vs(),time:v.timestamp()/1e3},v.strip_empty_properties(n))},people_properties:function(){return v.extend(v.strip_empty_properties({$os:v.info.os(),$browser:v.info.browser(Dn,rt.vendor,$r)}),{$browser_version:v.info.browserVersion(Dn,rt.vendor,$r)})},mpPageViewProperties:function(){return v.strip_empty_properties({current_page_title:oe.title,current_domain:O.location.hostname,current_url_path:O.location.pathname,current_url_protocol:O.location.protocol,current_url_search:O.location.search})}};var _1=function(n,t){var r=null,e=[];return function(i){var o=this;return e.push(i),r||(r=new le(function(s){setTimeout(function(){var a=n.apply(o,[e]);r=null,e=[],s(a)},t)})),r}},Vs=function(n){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return n?t.substring(0,n):t},A1=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,x1=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,$c=function(n){var t=x1,r=n.split("."),e=r[r.length-1];(e.length>4||e==="com"||e==="org")&&(t=A1);var i=n.match(t);return i?i[0]:""},M1=function(){var n=O.navigator.onLine;return v.isUndefined(n)||n},ot=function(){},Kt=null,Wr=null;typeof JSON<"u"&&(Kt=JSON.stringify,Wr=JSON.parse),Kt=Kt||v.JSONEncode,Wr=Wr||v.JSONDecode,v.info=v.info,v.info.browser=v.info.browser,v.info.browserVersion=v.info.browserVersion,v.info.device=v.info.device,v.info.properties=v.info.properties,v.isBlockedUA=v.isBlockedUA,v.isEmptyObject=v.isEmptyObject,v.isObject=v.isObject,v.JSONDecode=v.JSONDecode,v.JSONEncode=v.JSONEncode,v.toArray=v.toArray,v.NPO=tt;var E1="mixpanelBrowserDb",Wc="mixpanelRecordingEvents",zs="mixpanelRecordingRegistry",L1=1,T1=[Wc,zs],Mn=function(n){this.dbPromise=null,this.storeName=n};Mn.prototype._openDb=function(){return new le(function(n,t){var r=O.indexedDB.open(E1,L1);r.onerror=function(){t(r.error)},r.onsuccess=function(){n(r.result)},r.onupgradeneeded=function(e){var i=e.target.result;T1.forEach(function(o){i.createObjectStore(o)})}})},Mn.prototype.init=function(){return O.indexedDB?(this.dbPromise||(this.dbPromise=this._openDb()),this.dbPromise.then(function(n){return n instanceof O.IDBDatabase?le.resolve():le.reject(n)})):le.reject("indexedDB is not supported in this browser")},Mn.prototype.makeTransaction=function(n,t){var r=this.storeName,e=function(i){return new le(function(o,s){var a=i.transaction(r,n);a.oncomplete=function(){o(a)},a.onabort=a.onerror=function(){s(a.error)},t(a.objectStore(r))})};return this.dbPromise.then(e).catch((function(i){return i&&i.name==="InvalidStateError"?(this.dbPromise=this._openDb(),this.dbPromise.then(e)):le.reject(i)}).bind(this))},Mn.prototype.setItem=function(n,t){return this.makeTransaction("readwrite",function(r){r.put(t,n)})},Mn.prototype.getItem=function(n){var t;return this.makeTransaction("readonly",function(r){t=r.get(n)}).then(function(){return t.result})},Mn.prototype.removeItem=function(n){return this.makeTransaction("readwrite",function(t){t.delete(n)})},Mn.prototype.getAll=function(){var n;return this.makeTransaction("readonly",function(t){n=t.getAll()}).then(function(){return n.result})};var I1="__mp_opt_in_out_";function P1(n,t){Jc(!0,n,t)}function R1(n,t){Jc(!1,n,t)}function O1(n,t){return Zc(n,t)==="1"}function qc(n,t){if(B1(t))return se.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 r=Zc(n,t)==="0";return r&&se.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function st(n){return qs(n,function(t){return this.get_config(t)})}function at(n){return qs(n,function(t){return this._get_config(t)})}function jt(n){return qs(n,function(t){return this._get_config(t)})}function N1(n,t){t=t||{},$s(t).remove(Ws(n,t),!!t.crossSubdomainCookie,t.cookieDomain)}function $s(n){return n=n||{},n.persistenceType==="localStorage"?v.localStorage:v.cookie}function Ws(n,t){return t=t||{},(t.persistencePrefix||I1)+n}function Zc(n,t){return $s(t).get(Ws(n,t))}function B1(n){if(n&&n.ignoreDnt)return!1;var t=n&&n.window||O,r=t.navigator||{},e=!1;return v.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],function(i){v.includes([!0,1,"1","yes"],i)&&(e=!0)}),e}function Jc(n,t,r){if(!v.isString(t)||!t.length){se.error("gdpr."+(n?"optIn":"optOut")+" called with an invalid token");return}r=r||{},$s(r).set(Ws(t,r),n?1:0,v.isNumber(r.cookieExpiration)?r.cookieExpiration:null,!!r.crossSubdomainCookie,!!r.secureCookie,!!r.crossSiteCookie,r.cookieDomain),r.track&&n&&r.track(r.trackEventName||"$opt_in",r.trackProperties,{send_immediately:!0})}function qs(n,t){return function(){var r=!1;try{var e=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),a=t.call(this,"window");e&&(r=qc(e,{ignoreDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(c){se.error("Unexpected error when checking tracking opt-out status: "+c)}if(!r)return n.apply(this,arguments);var u=arguments[arguments.length-1];typeof u=="function"&&u(0)}}var D1=bt("lock"),Yc=function(n,t){t=t||{},this.storageKey=n,this.storage=t.storage||O.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3,this.promiseImpl=t.promiseImpl||le};Yc.prototype.withLock=function(n,t){var r=this.promiseImpl;return new r(v.bind(function(e,i){var o=t||new Date().getTime()+"|"+Math.random(),s=new Date().getTime(),a=this.storageKey,u=this.pollIntervalMS,c=this.timeoutMS,d=this.storage,h=a+":X",p=a+":Y",y=a+":Z",w=function(x){if(new Date().getTime()-s>c){D1.error("Timeout waiting for mutex on "+a+"; clearing lock. ["+o+"]"),d.removeItem(y),d.removeItem(p),S();return}setTimeout(function(){try{x()}catch(E){i(E)}},u*(Math.random()+.1))},k=function(x,E){x()?E():w(function(){k(x,E)})},b=function(){var x=d.getItem(p);return x&&x!==o?!1:(d.setItem(p,o),d.getItem(p)===o?!0:(xi(d,!0)||i(new Error("localStorage support dropped while acquiring lock")),!1))},S=function(){d.setItem(h,o),k(b,function(){if(d.getItem(h)===o){A();return}w(function(){if(d.getItem(p)!==o){S();return}k(function(){return!d.getItem(y)},A)})})},A=function(){d.setItem(y,"1");var x=function(){d.removeItem(y),d.getItem(p)===o&&d.removeItem(p),d.getItem(h)===o&&d.removeItem(h)};n().then(function(E){x(),e(E)}).catch(function(E){x(),i(E)})};try{if(xi(d,!0))S();else throw new Error("localStorage support check failed")}catch(x){i(x)}},this))};var Mi=function(n){this.storage=n||O.localStorage};Mi.prototype.init=function(){return le.resolve()},Mi.prototype.setItem=function(n,t){return new le(v.bind(function(r,e){try{this.storage.setItem(n,Kt(t))}catch(i){e(i)}r()},this))},Mi.prototype.getItem=function(n){return new le(v.bind(function(t,r){var e;try{e=Wr(this.storage.getItem(n))}catch(i){r(i)}t(e)},this))},Mi.prototype.removeItem=function(n){return new le(v.bind(function(t,r){try{this.storage.removeItem(n)}catch(e){r(e)}t()},this))};var Xc=bt("batch"),En=function(n,t){t=t||{},this.storageKey=n,this.usePersistence=t.usePersistence,this.usePersistence&&(this.queueStorage=t.queueStorage||new Mi,this.lock=new Yc(n,{storage:t.sharedLockStorage||O.localStorage,timeoutMS:t.sharedLockTimeoutMS})),this.reportError=t.errorReporter||v.bind(Xc.error,Xc),this.pid=t.pid||null,this.memQueue=[],this.initialized=!1,t.enqueueThrottleMs?this.enqueuePersisted=_1(v.bind(this._enqueuePersisted,this),t.enqueueThrottleMs):this.enqueuePersisted=v.bind(function(r){return this._enqueuePersisted([r])},this)};En.prototype.ensureInit=function(){return this.initialized?le.resolve():this.queueStorage.init().then(v.bind(function(){this.initialized=!0},this)).catch(v.bind(function(n){this.reportError("Error initializing queue persistence. Disabling persistence",n),this.initialized=!0,this.usePersistence=!1},this))},En.prototype.enqueue=function(n,t){var r={id:Vs(),flushAfter:new Date().getTime()+t*2,payload:n};return this.usePersistence?this.enqueuePersisted(r):(this.memQueue.push(r),le.resolve(!0))},En.prototype._enqueuePersisted=function(n){var t=v.bind(function(){return this.ensureInit().then(v.bind(function(){return this.readFromStorage()},this)).then(v.bind(function(r){return this.saveToStorage(r.concat(n))},this)).then(v.bind(function(r){return r&&(this.memQueue=this.memQueue.concat(n)),r},this)).catch(v.bind(function(r){return this.reportError("Error enqueueing items",r,n),!1},this))},this);return this.lock.withLock(t,this.pid).catch(v.bind(function(r){return this.reportError("Error acquiring storage lock",r),!1},this))},En.prototype.fillBatch=function(n){var t=this.memQueue.slice(0,n);return this.usePersistence&&t.length<n?this.ensureInit().then(v.bind(function(){return this.readFromStorage()},this)).then(v.bind(function(r){if(r.length){var e={};v.each(t,function(s){e[s.id]=!0});for(var i=0;i<r.length;i++){var o=r[i];if(new Date().getTime()>o.flushAfter&&!e[o.id]&&(o.orphaned=!0,t.push(o),t.length>=n))break}}return t},this)):le.resolve(t)};var Qc=function(n,t){var r=[];return v.each(n,function(e){e.id&&!t[e.id]&&r.push(e)}),r};En.prototype.removeItemsByID=function(n){var t={};if(v.each(n,function(e){t[e]=!0}),this.memQueue=Qc(this.memQueue,t),this.usePersistence){var r=v.bind(function(){return this.ensureInit().then(v.bind(function(){return this.readFromStorage()},this)).then(v.bind(function(e){return e=Qc(e,t),this.saveToStorage(e)},this)).then(v.bind(function(){return this.readFromStorage()},this)).then(v.bind(function(e){for(var i=0;i<e.length;i++){var o=e[i];if(o.id&&t[o.id])throw new Error("Item not removed from storage")}return!0},this)).catch(v.bind(function(e){return this.reportError("Error removing items",e,n),!1},this))},this);return this.lock.withLock(r,this.pid).catch(v.bind(function(e){return this.reportError("Error acquiring storage lock",e),xi(this.lock.storage,!0)?!1:r().then(v.bind(function(i){return i||this.queueStorage.removeItem(this.storageKey).then(function(){return i})},this)).catch(v.bind(function(i){return this.reportError("Error clearing queue",i),!1},this))},this))}else return le.resolve(!0)};var ed=function(n,t){var r=[];return v.each(n,function(e){var i=e.id;if(i in t){var o=t[i];o!==null&&(e.payload=o,r.push(e))}else r.push(e)}),r};En.prototype.updatePayloads=function(n){return this.memQueue=ed(this.memQueue,n),this.usePersistence?this.lock.withLock(v.bind(function(){return this.ensureInit().then(v.bind(function(){return this.readFromStorage()},this)).then(v.bind(function(r){return r=ed(r,n),this.saveToStorage(r)},this)).catch(v.bind(function(r){return this.reportError("Error updating items",n,r),!1},this))},this),this.pid).catch(v.bind(function(t){return this.reportError("Error acquiring storage lock",t),!1},this)):le.resolve(!0)},En.prototype.readFromStorage=function(){return this.ensureInit().then(v.bind(function(){return this.queueStorage.getItem(this.storageKey)},this)).then(v.bind(function(n){return n&&(v.isArray(n)||(this.reportError("Invalid storage entry:",n),n=null)),n||[]},this)).catch(v.bind(function(n){return this.reportError("Error retrieving queue",n),[]},this))},En.prototype.saveToStorage=function(n){return this.ensureInit().then(v.bind(function(){return this.queueStorage.setItem(this.storageKey,n)},this)).then(function(){return!0}).catch(v.bind(function(t){return this.reportError("Error saving queue",t),!1},this))},En.prototype.clear=function(){return this.memQueue=[],this.usePersistence?this.ensureInit().then(v.bind(function(){return this.queueStorage.removeItem(this.storageKey)},this)):le.resolve()};var H1=10*60*1e3,Ei=bt("batch"),un=function(n,t){this.errorReporter=t.errorReporter,this.queue=new En(n,{errorReporter:v.bind(this.reportError,this),queueStorage:t.queueStorage,sharedLockStorage:t.sharedLockStorage,sharedLockTimeoutMS:t.sharedLockTimeoutMS,usePersistence:t.usePersistence,enqueueThrottleMs:t.enqueueThrottleMs}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.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=t.flushOnlyOnInterval||!1,this._flushPromise=null};un.prototype.enqueue=function(n){return this.queue.enqueue(n,this.flushInterval)},un.prototype.start=function(){return this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},un.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},un.prototype.clear=function(){return this.queue.clear()},un.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},un.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},un.prototype.scheduleFlush=function(n){this.flushInterval=n,this.stopped||(this.timeoutID=setTimeout(v.bind(function(){this.stopped||(this._flushPromise=this.flush())},this),this.flushInterval))},un.prototype.sendRequestPromise=function(n,t){return new le(v.bind(function(r){this.sendRequest(n,t,r)},this))},un.prototype.flush=function(n){if(this.requestInProgress)return Ei.log("Flush: Request already in progress"),le.resolve();this.requestInProgress=!0,n=n||{};var t=this.libConfig.batch_request_timeout_ms,r=new Date().getTime(),e=this.batchSize;return this.queue.fillBatch(e).then(v.bind(function(i){var o=i.length===e,s=[],a={};if(v.each(i,function(h){var p=h.payload;if(this.beforeSendHook&&!h.orphaned&&(p=this.beforeSendHook(p)),p){p.event&&p.properties&&(p.properties=v.extend({},p.properties,{mp_sent_by_lib_version:vn.LIB_VERSION}));var y=!0,w=h.id;w?(this.itemIdsSentSuccessfully[w]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:h,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[w]}),y=!1):this.reportError("[dupe] found item with no ID",{item:h}),y&&s.push(p)}a[h.id]=p},this),s.length<1)return this.requestInProgress=!1,this.resetFlush(),le.resolve();var u=v.bind(function(){return this.queue.removeItemsByID(v.map(i,function(h){return h.id})).then(v.bind(function(h){return v.each(i,v.bind(function(p){var y=p.id;y?(this.itemIdsSentSuccessfully[y]=this.itemIdsSentSuccessfully[y]||0,this.itemIdsSentSuccessfully[y]++,this.itemIdsSentSuccessfully[y]>5&&this.reportError("[dupe] item ID sent too many times",{item:p,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[y]})):this.reportError("[dupe] found item with no ID while removing",{item:p})},this)),h?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?(this.resetFlush(),le.resolve()):this.flush()):(++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush(),le.resolve())},this))},this),c=v.bind(function(h){this.requestInProgress=!1;try{if(n.unloading)return this.queue.updatePayloads(a);if(v.isObject(h)&&h.error==="timeout"&&new Date().getTime()-r>=t)return this.reportError("Network timeout; retrying"),this.flush();if(v.isObject(h)&&(h.httpStatusCode>=500||h.httpStatusCode===429||h.httpStatusCode<=0&&!M1()||h.error==="timeout")){var p=this.flushInterval*2;return h.retryAfter&&(p=parseInt(h.retryAfter,10)*1e3||p),p=Math.min(H1,p),this.reportError("Error; retry in "+p+" ms"),this.scheduleFlush(p),le.resolve()}else if(v.isObject(h)&&h.httpStatusCode===413)if(i.length>1){var y=Math.max(1,Math.floor(e/2));return this.batchSize=Math.min(this.batchSize,y,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush(),le.resolve()}else return this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),u();else return u()}catch(w){this.reportError("Error handling API response",w),this.resetFlush()}},this),d={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};return n.unloading&&(d.transport="sendBeacon"),Ei.log("MIXPANEL REQUEST:",s),this.sendRequestPromise(s,d).then(c)},this)).catch(v.bind(function(i){this.reportError("Error flushing request queue",i),this.resetFlush()},this))},un.prototype.reportError=function(n,t){if(Ei.error.apply(Ei.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(n)),this.errorReporter(n,t)}catch(r){Ei.error(r)}};var Zs=function(n){var t=Date.now();return!n||t>n.maxExpires||t>n.idleExpires},U1=250,Vt=bt("recorder"),nd=O.CompressionStream,F1={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},G1=new Set([$.MouseMove,$.MouseInteraction,$.Scroll,$.ViewportResize,$.Input,$.TouchMove,$.MediaInteraction,$.Drag,$.Selection]);function K1(n){return n.type===ne.IncrementalSnapshot&&G1.has(n.data.source)}var qe=function(n){this._mixpanel=n.mixpanelInstance,this._onIdleTimeout=n.onIdleTimeout||ot,this._onMaxLengthReached=n.onMaxLengthReached||ot,this._onBatchSent=n.onBatchSent||ot,this._rrwebRecord=n.rrwebRecord||null,this._stopRecording=null,this.replayId=n.replayId,this.batchStartUrl=n.batchStartUrl||null,this.replayStartUrl=n.replayStartUrl||null,this.idleExpires=n.idleExpires||null,this.maxExpires=n.maxExpires||null,this.replayStartTime=n.replayStartTime||null,this.seqNo=n.seqNo||0,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=_i,this.recordMinMs=0;var t=xi(n.sharedLockStorage,!0);this.batcherKey="__mprec_"+this.getConfig("name")+"_"+this.getConfig("token")+"_"+this.replayId,this.queueStorage=new Mn(Wc),this.batcher=new un(this.batcherKey,{errorReporter:this.reportError.bind(this),flushOnlyOnInterval:!0,libConfig:F1,sendRequestFunc:this.flushEventsWithOptOut.bind(this),queueStorage:this.queueStorage,sharedLockStorage:n.sharedLockStorage,usePersistence:t,stopAllBatchingFunc:this.stopRecording.bind(this),enqueueThrottleMs:U1,sharedLockTimeoutMS:10*1e3})};qe.prototype.unloadPersistedData=function(){return this.batcher.stop(),this.batcher.flush().then((function(){return this.queueStorage.removeItem(this.batcherKey)}).bind(this))},qe.prototype.getConfig=function(n){return this._mixpanel.get_config(n)},qe.prototype.get_config=function(n){return this.getConfig(n)},qe.prototype.startRecording=function(n){if(this._rrwebRecord===null){this.reportError("rrweb record function not provided. ");return}if(this._stopRecording!==null){Vt.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.getConfig("record_max_ms"),this.recordMaxMs>_i&&(this.recordMaxMs=_i,Vt.critical("record_max_ms cannot be greater than "+_i+"ms. Capping value.")),this.maxExpires||(this.maxExpires=new Date().getTime()+this.recordMaxMs),this.recordMinMs=this.getConfig("record_min_ms"),this.recordMinMs>Ds&&(this.recordMinMs=Ds,Vt.critical("record_min_ms cannot be greater than "+Ds+"ms. Capping value.")),this.replayStartTime||(this.replayStartTime=new Date().getTime(),this.batchStartUrl=v.info.currentUrl(),this.replayStartUrl=v.info.currentUrl()),n||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=(function(){clearTimeout(this.idleTimeoutId);var i=this.getConfig("record_idle_timeout_ms");this.idleTimeoutId=setTimeout(this._onIdleTimeout,i),this.idleExpires=new Date().getTime()+i}).bind(this);t();var r=this.getConfig("record_block_selector");(r===""||r===null)&&(r=void 0);try{this._stopRecording=this._rrwebRecord({emit:(function(i){if(this.idleExpires&&this.idleExpires<i.timestamp){this._onIdleTimeout();return}K1(i)&&(this.batcher.stopped&&new Date().getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t()),this.__enqueuePromise=this.batcher.enqueue(i)}).bind(this),blockClass:this.getConfig("record_block_class"),blockSelector:r,collectFonts:this.getConfig("record_collect_fonts"),dataURLOptions:{type:"image/webp",quality:.6},maskAllInputs:!0,maskTextClass:this.getConfig("record_mask_text_class"),maskTextSelector:this.getConfig("record_mask_text_selector"),recordCanvas:this.getConfig("record_canvas"),sampling:{canvas:15}})}catch(i){this.reportError("Unexpected error when starting rrweb recording.",i)}if(typeof this._stopRecording!="function"){this.reportError("rrweb failed to start, skipping this recording."),this._stopRecording=null,this.stopRecording();return}var e=this.maxExpires-new Date().getTime();this.maxTimeoutId=setTimeout(this._onMaxLengthReached.bind(this),e)},qe.prototype.stopRecording=function(n){if(!this.isRrwebStopped()){try{this._stopRecording()}catch(r){this.reportError("Error with rrweb stopRecording",r)}this._stopRecording=null}var t;return this.batcher.stopped?t=this.batcher.clear():n||(t=this.batcher.flush()),this.batcher.stop(),clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId),t},qe.prototype.isRrwebStopped=function(){return this._stopRecording===null},qe.prototype.flushEventsWithOptOut=function(n,t,r){var e=(function(i){i===0&&(this.stopRecording(),r({error:"Tracking has been opted out, stopping recording."}))}).bind(this);this._flushEvents(n,t,r,e)},qe.prototype.serialize=function(){var n;try{n=this._mixpanel.get_tab_id()}catch(t){this.reportError("Error getting tab ID for serialization ",t),n=null}return{replayId:this.replayId,seqNo:this.seqNo,replayStartTime:this.replayStartTime,batchStartUrl:this.batchStartUrl,replayStartUrl:this.replayStartUrl,idleExpires:this.idleExpires,maxExpires:this.maxExpires,tabId:n}},qe.deserialize=function(n,t){var r=new qe(v.extend({},t,{replayId:n.replayId,batchStartUrl:n.batchStartUrl,replayStartUrl:n.replayStartUrl,idleExpires:n.idleExpires,maxExpires:n.maxExpires,replayStartTime:n.replayStartTime,seqNo:n.seqNo,sharedLockStorage:t.sharedLockStorage}));return r},qe.prototype._sendRequest=function(n,t,r,e){var i=(function(o,s){o.status===200&&this.replayId===n&&(this.seqNo++,this.batchStartUrl=v.info.currentUrl()),this._onBatchSent(),e({status:0,httpStatusCode:o.status,responseBody:s,retryAfter:o.headers.get("Retry-After")})}).bind(this);O.fetch(this.getConfig("api_host")+"/"+this.getConfig("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.getConfig("token")+":"),"Content-Type":"application/octet-stream"},body:r}).then(function(o){o.json().then(function(s){i(o,s)}).catch(function(s){e({error:s})})}).catch(function(o){e({error:o,httpStatusCode:0})})},qe.prototype._flushEvents=st(function(n,t,r){var e=n.length;if(e>0){for(var i=this.replayId,o=1/0,s=-1/0,a=!1,u=0;u<e;u++)o=Math.min(o,n[u].timestamp),s=Math.max(s,n[u].timestamp),n[u].type===ne.FullSnapshot&&(a=!0);if(this.seqNo===0){if(!a){r({error:"First batch does not contain a full snapshot. Aborting recording."}),this.stopRecording(!0);return}this.replayStartTime=o}else this.replayStartTime||(this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=o);var c=s-this.replayStartTime,d={$current_url:this.batchStartUrl,$lib_version:vn.LIB_VERSION,batch_start_time:o/1e3,distinct_id:String(this._mixpanel.get_distinct_id()),mp_lib:"web",replay_id:i,replay_length_ms:c,replay_start_time:this.replayStartTime/1e3,replay_start_url:this.replayStartUrl,seq:this.seqNo},h=JSON.stringify(n),p=this._mixpanel.get_property("$device_id");p&&(d.$device_id=p);var y=this._mixpanel.get_property("$user_id");if(y&&(d.$user_id=y),nd){var w=new Blob([h],{type:"application/json"}).stream(),k=w.pipeThrough(new nd("gzip"));new Response(k).blob().then((function(b){d.format="gzip",this._sendRequest(i,d,b,r)}).bind(this))}else d.format="body",this._sendRequest(i,d,h,r)}}),qe.prototype.reportError=function(n,t){Vt.error.apply(Vt.error,arguments);try{!t&&!(n instanceof Error)&&(n=new Error(n)),this.getConfig("error_reporter")(n,t)}catch(r){Vt.error(r)}};var zt=function(n){this.idb=new Mn(zs),this.errorReporter=n.errorReporter,this.mixpanelInstance=n.mixpanelInstance,this.sharedLockStorage=n.sharedLockStorage};zt.prototype.handleError=function(n){this.errorReporter("IndexedDB error: ",n)},zt.prototype.setActiveRecording=function(n){var t=n.tabId;return t?this.idb.init().then((function(){return this.idb.setItem(t,n)}).bind(this)).catch(this.handleError.bind(this)):(console.warn("No tab ID is set, cannot persist recording metadata."),le.resolve())},zt.prototype.getActiveRecording=function(){return this.idb.init().then((function(){return this.idb.getItem(this.mixpanelInstance.get_tab_id())}).bind(this)).then((function(n){return Zs(n)?null:n}).bind(this)).catch(this.handleError.bind(this))},zt.prototype.clearActiveRecording=function(){return this.getActiveRecording().then((function(n){if(n)return n.maxExpires=0,this.setActiveRecording(n)}).bind(this)).catch(this.handleError.bind(this))},zt.prototype.flushInactiveRecordings=function(){return this.idb.init().then((function(){return this.idb.getAll()}).bind(this)).then((function(n){var t=n.filter(function(r){return Zs(r)}).map((function(r){var e=qe.deserialize(r,{mixpanelInstance:this.mixpanelInstance,sharedLockStorage:this.sharedLockStorage});return e.unloadPersistedData().then((function(){return this.idb.removeItem(r.tabId)}).bind(this)).catch(this.handleError.bind(this))}).bind(this));return le.all(t)}).bind(this)).catch(this.handleError.bind(this))};var Li=bt("recorder"),Hn=function(n,t,r){this.mixpanelInstance=n,this.rrwebRecord=t||et,this.sharedLockStorage=r,this.recordingRegistry=new zt({mixpanelInstance:this.mixpanelInstance,errorReporter:Li.error,sharedLockStorage:r}),this._flushInactivePromise=this.recordingRegistry.flushInactiveRecordings(),this.activeRecording=null};Hn.prototype.startRecording=function(n){if(n=n||{},this.activeRecording&&!this.activeRecording.isRrwebStopped()){Li.log("Recording already in progress, skipping startRecording.");return}var t=(function(){Li.log("Idle timeout reached, restarting recording."),this.resetRecording()}).bind(this),r=(function(){Li.log("Max recording length reached, stopping recording."),this.resetRecording()}).bind(this),e=(function(){this.recordingRegistry.setActiveRecording(this.activeRecording.serialize()),this.__flushPromise=this.activeRecording.batcher._flushPromise}).bind(this),i={mixpanelInstance:this.mixpanelInstance,onBatchSent:e,onIdleTimeout:t,onMaxLengthReached:r,replayId:v.UUID(),rrwebRecord:this.rrwebRecord,sharedLockStorage:this.sharedLockStorage};return n.activeSerializedRecording?this.activeRecording=qe.deserialize(n.activeSerializedRecording,i):this.activeRecording=new qe(i),this.activeRecording.startRecording(n.shouldStopBatcher),this.recordingRegistry.setActiveRecording(this.activeRecording.serialize())},Hn.prototype.stopRecording=function(){var n=this._stopCurrentRecording(!1);return this.recordingRegistry.clearActiveRecording(),this.activeRecording=null,n},Hn.prototype.pauseRecording=function(){return this._stopCurrentRecording(!1)},Hn.prototype._stopCurrentRecording=function(n){return this.activeRecording?this.activeRecording.stopRecording(n):le.resolve()},Hn.prototype.resumeRecording=function(n){return this.activeRecording&&this.activeRecording.isRrwebStopped()?(this.activeRecording.startRecording(!1),le.resolve(null)):this.recordingRegistry.getActiveRecording().then((function(t){return t?this.startRecording({activeSerializedRecording:t}):n?this.startRecording({shouldStopBatcher:!1}):(Li.log("No resumable recording found."),null)}).bind(this))},Hn.prototype.resetRecording=function(){this.stopRecording(),this.startRecording({shouldStopBatcher:!0})},Hn.prototype.getActiveReplayId=function(){return this.activeRecording&&!this.activeRecording.isRrwebStopped()?this.activeRecording.replayId:null},Object.defineProperty(Hn.prototype,"replayId",{get:function(){return this.getActiveReplayId()}}),O.__mp_recorder=Hn;var qr="change",Ti="click",td="hashchange",$t="mp_locationchange",id="popstate",rd="scrollend",Js="submit",j1=["clientX","clientY","offsetX","offsetY","pageX","pageY","screenX","screenY","x","y"],od=["mp-include"],Ys=["mp-no-track"],sd=Ys.concat(["mp-sensitive"]),V1=["aria-label","aria-labelledby","aria-describedby","href","name","role","title","type"],en=bt("autocapture");function Xs(n){for(var t={},r=ad(n).split(" "),e=0;e<r.length;e++){var i=r[e];i&&(t[i]=!0)}return t}function ad(n){switch(typeof n.className){case"string":return n.className;case"object":return n.className.baseVal||n.getAttribute("class")||"";default:return""}}function z1(n){if(n.previousElementSibling)return n.previousElementSibling;do n=n.previousSibling;while(n&&!cd(n));return n}function ud(n,t,r,e,i,o){var s={$classes:ad(n).split(" "),$tag_name:n.tagName.toLowerCase()},a=n.id;a&&(s.$id=a),na(n,t,i,o)&&v.each(V1.concat(e),function(h){if(n.hasAttribute(h)&&!r[h]){var p=n.getAttribute(h);Zr(p)&&(s["$attr-"+h]=p)}});for(var u=1,c=1,d=n;d=z1(d);)u++,d.tagName===n.tagName&&c++;return s.$nth_child=u,s.$nth_of_type=c,s}function $1(n,t){var r=t.allowElementCallback,e=t.allowSelectors||[],i=t.blockAttrs||[],o=t.blockElementCallback,s=t.blockSelectors||[],a=t.captureTextContent||!1,u=t.captureExtraAttrs||[],c=t.capturedForHeatMap||!1,d={};v.each(i,function(L){d[L]=!0});var h=null,p=typeof n.target>"u"?n.srcElement:n.target;if(dd(p)&&(p=p.parentNode),Z1(p,n)&&Qs(p,n,r,e)&&!ea(p,n,o,s)){for(var y=[p],w=p;w.parentNode&&!Ln(w,"body");)y.push(w.parentNode),w=w.parentNode;var k=[],b,S=!1;if(v.each(y,function(L){var P=na(L,n,r,e);!d.href&&L.tagName.toLowerCase()==="a"&&(b=L.getAttribute("href"),b=P&&Zr(b)&&b),ea(L,n,o,s)&&(S=!0),k.push(ud(L,n,d,u,r,e))},this),!S){var A=oe.documentElement;if(h={$event_type:n.type,$host:O.location.host,$pathname:O.location.pathname,$elements:k,$el_attr__href:b,$viewportHeight:Math.max(A.clientHeight,O.innerHeight||0),$viewportWidth:Math.max(A.clientWidth,O.innerWidth||0),$pageHeight:oe.body.offsetHeight||0,$pageWidth:oe.body.offsetWidth||0},v.each(u,function(L){if(!d[L]&&p.hasAttribute(L)){var P=p.getAttribute(L);Zr(P)&&(h["$el_attr__"+L]=P)}}),a&&(x=ld(p,n,r,e),x&&x.length&&(h.$el_text=x)),n.type===Ti&&(v.each(j1,function(L){L in n&&(h["$"+L]=n[L])}),c&&(h.$captured_for_heatmap=!0),p=W1(n)),a){var x=ld(p,n,r,e);x&&x.length&&(h.$el_text=x)}if(p){if(!Qs(p,n,r,e)||ea(p,n,o,s))return null;var E=ud(p,n,d,u,r,e);h.$target=E,h.$el_classes=E.$classes,v.extend(h,v.strip_empty_properties({$el_id:E.$id,$el_tag_name:E.$tag_name}))}}}return h}function ld(n,t,r,e){var i="";return na(n,t,r,e)&&n.childNodes&&n.childNodes.length&&v.each(n.childNodes,function(o){dd(o)&&o.textContent&&(i+=v.trim(o.textContent).split(/(\s+)/).filter(Zr).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),v.trim(i)}function W1(n){for(var t=n.target,r=n.composedPath(),e=0;e<r.length;e++){var i=r[e];if(Ln(i,"a")||Ln(i,"button")||Ln(i,"input")||Ln(i,"select")||i.getAttribute&&i.getAttribute("role")==="button"){t=i;break}if(i===t)break}return t}function Qs(n,t,r,e){if(r)try{if(!r(n,t))return!1}catch(s){return en.critical("Error while checking element in allowElementCallback",s),!1}if(!e.length)return!0;for(var i=0;i<e.length;i++){var o=e[i];try{if(n.matches(o))return!0}catch(s){en.critical("Error while checking selector: "+o,s)}}return!1}function ea(n,t,r,e){var i;if(r)try{if(r(n,t))return!0}catch(a){return en.critical("Error while checking element in blockElementCallback",a),!0}if(e&&e.length)for(i=0;i<e.length;i++){var o=e[i];try{if(n.matches(o))return!0}catch(a){en.critical("Error while checking selector: "+o,a)}}var s=Xs(n);for(i=0;i<Ys.length;i++)if(s[Ys[i]])return!0;return!1}function cd(n){return n&&n.nodeType===1}function Ln(n,t){return n&&n.tagName&&n.tagName.toLowerCase()===t.toLowerCase()}function dd(n){return n&&n.nodeType===3}function q1(){try{var n=oe.createElement("div");return!!n.matches}catch{return!1}}function Z1(n,t){if(!n||Ln(n,"html")||!cd(n))return!1;var r=n.tagName.toLowerCase();switch(r){case"form":return t.type===Js;case"input":return["button","submit"].indexOf(n.getAttribute("type"))===-1?t.type===qr:t.type===Ti;case"select":case"textarea":return t.type===qr;default:return t.type===Ti}}function na(n,t,r,e){var i;if(!Qs(n,t,r,e))return!1;for(var o=n;o.parentNode&&!Ln(o,"body");o=o.parentNode){var s=Xs(o);for(i=0;i<sd.length;i++)if(s[sd[i]])return!1}var a=Xs(n);for(i=0;i<od.length;i++)if(a[od[i]])return!0;if(Ln(n,"input")||Ln(n,"select")||Ln(n,"textarea")||n.getAttribute("contenteditable")==="true")return!1;var u=n.type||"";if(typeof u=="string")switch(u.toLowerCase()){case"hidden":return!1;case"password":return!1}var c=n.name||n.id||"";if(typeof c=="string"){var d=/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i;if(d.test(c.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Zr(n){if(n===null||v.isUndefined(n))return!1;if(typeof n=="string"){n=v.trim(n);var t=/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/;if(t.test((n||"").replace(/[- ]/g,"")))return!1;var r=/(^\d{3}-?\d{2}-?\d{4}$)/;if(r.test(n))return!1}return!0}var hd="autocapture",J1="track_pageview",md="full-url",Y1="url-with-path-and-query-string",X1="url-with-path",Q1="allow_element_callback",fd="allow_selectors",pd="allow_url_regexes",vd="block_attrs",bd="block_element_callback",gd="block_selectors",yd="block_url_regexes",wd="capture_extra_attrs",Cd="capture_text_content",Sd="scroll_capture_all",kd="scroll_depth_percent_checkpoints",Jr="click",ta="input",_d="pageview",ia="scroll",ra="submit",je={};je[fd]=[],je[pd]=[],je[vd]=[],je[bd]=null,je[gd]=[],je[yd]=[],je[wd]=[],je[Cd]=!1,je[Sd]=!1,je[kd]=[25,50,75,100],je[Jr]=!0,je[ta]=!0,je[_d]=md,je[ia]=!0,je[ra]=!0;var Yr={$mp_autocapture:!0},Ad="$mp_click",eg="$mp_input_change",ng="$mp_scroll",tg="$mp_submit",tn=function(n){this.mp=n};tn.prototype.init=function(){if(!q1()){en.critical("Autocapture unavailable: missing required DOM APIs");return}this.initPageviewTracking(),this.initClickTracking(),this.initInputTracking(),this.initScrollTracking(),this.initSubmitTracking()},tn.prototype.getFullConfig=function(){var n=this.mp.get_config(hd);return n?v.isObject(n)?v.extend({},je,n):je:{}},tn.prototype.getConfig=function(n){return this.getFullConfig()[n]},tn.prototype.currentUrlBlocked=function(){var n,t=v.info.currentUrl(),r=this.getConfig(pd)||[];if(r.length){var e=!1;for(n=0;n<r.length;n++){var i=r[n];try{if(t.match(i)){e=!0;break}}catch(s){return en.critical("Error while checking block URL regex: "+i,s),!0}}if(!e)return!0}var o=this.getConfig(yd)||[];if(!o||!o.length)return!1;for(n=0;n<o.length;n++)try{if(t.match(o[n]))return!0}catch(s){return en.critical("Error while checking block URL regex: "+o[n],s),!0}return!1},tn.prototype.pageviewTrackingConfig=function(){return this.mp.get_config(hd)?this.getConfig(_d):this.mp.get_config(J1)},tn.prototype.trackDomEvent=function(n,t){if(!this.currentUrlBlocked()){var r=$1(n,{allowElementCallback:this.getConfig(Q1),allowSelectors:this.getConfig(fd),blockAttrs:this.getConfig(vd),blockElementCallback:this.getConfig(bd),blockSelectors:this.getConfig(gd),captureExtraAttrs:this.getConfig(wd),captureTextContent:this.getConfig(Cd),capturedForHeatMap:t===Ad&&!this.getConfig(Jr)&&this.mp.is_recording_heatmap_data()});r&&(v.extend(r,Yr),this.mp.track(t,r))}},tn.prototype.initClickTracking=function(){O.removeEventListener(Ti,this.listenerClick),!(!this.getConfig(Jr)&&!this.mp.get_config("record_heatmap_data"))&&(en.log("Initializing click tracking"),this.listenerClick=O.addEventListener(Ti,(function(n){!this.getConfig(Jr)&&!this.mp.is_recording_heatmap_data()||this.trackDomEvent(n,Ad)}).bind(this)))},tn.prototype.initInputTracking=function(){O.removeEventListener(qr,this.listenerChange),this.getConfig(ta)&&(en.log("Initializing input tracking"),this.listenerChange=O.addEventListener(qr,(function(n){this.getConfig(ta)&&this.trackDomEvent(n,eg)}).bind(this)))},tn.prototype.initPageviewTracking=function(){if(O.removeEventListener(id,this.listenerPopstate),O.removeEventListener(td,this.listenerHashchange),O.removeEventListener($t,this.listenerLocationchange),!!this.pageviewTrackingConfig()){en.log("Initializing pageview tracking");var n="",t=!1;this.currentUrlBlocked()||(t=this.mp.track_pageview(Yr)),t&&(n=v.info.currentUrl()),this.listenerPopstate=O.addEventListener(id,function(){O.dispatchEvent(new Event($t))}),this.listenerHashchange=O.addEventListener(td,function(){O.dispatchEvent(new Event($t))});var r=O.history.pushState;typeof r=="function"&&(O.history.pushState=function(i,o,s){r.call(O.history,i,o,s),O.dispatchEvent(new Event($t))});var e=O.history.replaceState;typeof e=="function"&&(O.history.replaceState=function(i,o,s){e.call(O.history,i,o,s),O.dispatchEvent(new Event($t))}),this.listenerLocationchange=O.addEventListener($t,Gs((function(){if(!this.currentUrlBlocked()){var i=v.info.currentUrl(),o=!1,s=i.split("#")[0].split("?")[0]!==n.split("#")[0].split("?")[0],a=this.pageviewTrackingConfig();if(a===md?o=i!==n:a===Y1?o=i.split("#")[0]!==n.split("#")[0]:a===X1&&(o=s),o){var u=this.mp.track_pageview(Yr);u&&(n=i),s&&(this.lastScrollCheckpoint=0,en.log("Path change: re-initializing scroll depth checkpoints"))}}}).bind(this)))}},tn.prototype.initScrollTracking=function(){O.removeEventListener(rd,this.listenerScroll),this.getConfig(ia)&&(en.log("Initializing scroll tracking"),this.lastScrollCheckpoint=0,this.listenerScroll=O.addEventListener(rd,Gs((function(){if(this.getConfig(ia)&&!this.currentUrlBlocked()){var n=this.getConfig(Sd),t=(this.getConfig(kd)||[]).slice().sort(function(u,c){return u-c}),r=O.scrollY,e=v.extend({$scroll_top:r},Yr);try{var i=oe.body.scrollHeight,o=Math.round(r/(i-O.innerHeight)*100);if(e.$scroll_height=i,e.$scroll_percentage=o,o>this.lastScrollCheckpoint)for(var s=0;s<t.length;s++){var a=t[s];o>=a&&this.lastScrollCheckpoint<a&&(e.$scroll_checkpoint=a,this.lastScrollCheckpoint=a,n=!0)}}catch(u){en.critical("Error while calculating scroll percentage",u)}n&&this.mp.track(ng,e)}}).bind(this))))},tn.prototype.initSubmitTracking=function(){O.removeEventListener(Js,this.listenerSubmit),this.getConfig(ra)&&(en.log("Initializing submit tracking"),this.listenerSubmit=O.addEventListener(Js,(function(n){this.getConfig(ra)&&this.trackDomEvent(n,tg)}).bind(this)))},Kc(tn);var ig=O.fetch,ln=bt("flags"),xd="flags",Md="context",oa={};oa[Md]={};var ae=function(n){this.getMpConfig=n.getConfigFunc,this.getDistinctId=n.getDistinctIdFunc,this.track=n.trackingFunc};ae.prototype.init=function(){if(!rg()){ln.critical("Feature Flags unavailable: missing minimum required APIs");return}this.flags=null,this.fetchFlags(),this.trackedFeatures=new Set},ae.prototype.getFullConfig=function(){var n=this.getMpConfig(xd);return n?v.isObject(n)?v.extend({},oa,n):oa:{}},ae.prototype.getConfig=function(n){return this.getFullConfig()[n]},ae.prototype.isSystemEnabled=function(){return!!this.getMpConfig(xd)},ae.prototype.areFlagsReady=function(){return this.isSystemEnabled()||ln.error("Feature Flags not enabled"),!!this.flags},ae.prototype.fetchFlags=function(){if(this.isSystemEnabled()){var n=this.getDistinctId();ln.log("Fetching flags for distinct ID: "+n);var t={context:v.extend({distinct_id:n},this.getConfig(Md))};this.fetchPromise=O.fetch(this.getMpConfig("api_host")+"/"+this.getMpConfig("api_routes").flags,{method:"POST",headers:{Authorization:"Basic "+btoa(this.getMpConfig("token")+":"),"Content-Type":"application/octet-stream"},body:JSON.stringify(t)}).then((function(r){return r.json().then((function(e){var i=e.flags;if(!i)throw new Error("No flags in API response");var o=new Map;v.each(i,function(s,a){o.set(a,{key:s.variant_key,value:s.variant_value})}),this.flags=o}).bind(this)).catch(function(e){ln.error(e)})}).bind(this)).catch(function(){})}},ae.prototype.getVariant=function(n,t){return this.fetchPromise?this.fetchPromise.then((function(){return this.getVariantSync(n,t)}).bind(this)).catch(function(r){return ln.error(r),t}):new Promise(function(r){ln.critical("Feature Flags not initialized"),r(t)})},ae.prototype.getVariantSync=function(n,t){if(!this.areFlagsReady())return ln.log("Flags not loaded yet"),t;var r=this.flags.get(n);return r?(this.trackFeatureCheck(n,r),r):(ln.log('No flag found: "'+n+'"'),t)},ae.prototype.getVariantValue=function(n,t){return this.getVariant(n,{value:t}).then(function(r){return r.value}).catch(function(r){return ln.error(r),t})},ae.prototype.getFeatureData=function(n,t){return ln.critical("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead."),this.getVariantValue(n,t)},ae.prototype.getVariantValueSync=function(n,t){return this.getVariantSync(n,{value:t}).value},ae.prototype.isEnabled=function(n,t){return this.getVariantValue(n).then((function(){return this.isEnabledSync(n,t)}).bind(this)).catch(function(r){return ln.error(r),t})},ae.prototype.isEnabledSync=function(n,t){t=t||!1;var r=this.getVariantValueSync(n,t);return r!==!0&&r!==!1&&(ln.error('Feature flag "'+n+'" value: '+r+" is not a boolean; returning fallback value: "+t),r=t),r},ae.prototype.trackFeatureCheck=function(n,t){this.trackedFeatures.has(n)||(this.trackedFeatures.add(n),this.track("$experiment_started",{"Experiment name":n,"Variant name":t.key,$experiment_type:"feature_flag"}))};function rg(){return!!ig&&typeof Promise<"u"&&typeof Map<"u"&&typeof Set<"u"}Kc(ae),ae.prototype.are_flags_ready=ae.prototype.areFlagsReady,ae.prototype.get_variant=ae.prototype.getVariant,ae.prototype.get_variant_sync=ae.prototype.getVariantSync,ae.prototype.get_variant_value=ae.prototype.getVariantValue,ae.prototype.get_variant_value_sync=ae.prototype.getVariantValueSync,ae.prototype.is_enabled=ae.prototype.isEnabled,ae.prototype.is_enabled_sync=ae.prototype.isEnabledSync,ae.prototype.get_feature_data=ae.prototype.getFeatureData;var Un=function(){};Un.prototype.create_properties=function(){},Un.prototype.event_handler=function(){},Un.prototype.after_track_handler=function(){},Un.prototype.init=function(n){return this.mp=n,this},Un.prototype.track=function(n,t,r,e){var i=this,o=v.dom_query(n);if(o.length===0){se.error("The DOM query ("+n+") returned 0 elements");return}return v.each(o,function(s){v.register_event(s,this.override_event,function(a){var u={},c=i.create_properties(r,this),d=i.mp.get_config("track_links_timeout");i.event_handler(a,this,u),window.setTimeout(i.track_callback(e,c,u,!0),d),i.mp.track(t,c,i.track_callback(e,c,u))})},this),!0},Un.prototype.track_callback=function(n,t,r,e){e=e||!1;var i=this;return function(){r.callback_fired||(r.callback_fired=!0,!(n&&n(e,t)===!1)&&i.after_track_handler(t,r,e))}},Un.prototype.create_properties=function(n,t){var r;return typeof n=="function"?r=n(t):r=v.extend({},n),r};var Wt=function(){this.override_event="click"};v.inherit(Wt,Un),Wt.prototype.create_properties=function(n,t){var r=Wt.superclass.create_properties.apply(this,arguments);return t.href&&(r.url=t.href),r},Wt.prototype.event_handler=function(n,t,r){r.new_tab=n.which===2||n.metaKey||n.ctrlKey||t.target==="_blank",r.href=t.href,r.new_tab||n.preventDefault()},Wt.prototype.after_track_handler=function(n,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var Xr=function(){this.override_event="submit"};v.inherit(Xr,Un),Xr.prototype.event_handler=function(n,t,r){r.element=t,n.preventDefault()},Xr.prototype.after_track_handler=function(n,t){setTimeout(function(){t.element.submit()},0)};var ut="$set",qt="$set_once",bn="$unset",gt="$add",Tn="$append",yt="$union",Fn="$remove",og="$delete",Ed={set_action:function(n,t){var r={},e={};return v.isObject(n)?v.each(n,function(i,o){this._is_reserved_property(o)||(e[o]=i)},this):e[n]=t,r[ut]=e,r},unset_action:function(n){var t={},r=[];return v.isArray(n)||(n=[n]),v.each(n,function(e){this._is_reserved_property(e)||r.push(e)},this),t[bn]=r,t},set_once_action:function(n,t){var r={},e={};return v.isObject(n)?v.each(n,function(i,o){this._is_reserved_property(o)||(e[o]=i)},this):e[n]=t,r[qt]=e,r},union_action:function(n,t){var r={},e={};return v.isObject(n)?v.each(n,function(i,o){this._is_reserved_property(o)||(e[o]=v.isArray(i)?i:[i])},this):e[n]=v.isArray(t)?t:[t],r[yt]=e,r},append_action:function(n,t){var r={},e={};return v.isObject(n)?v.each(n,function(i,o){this._is_reserved_property(o)||(e[o]=i)},this):e[n]=t,r[Tn]=e,r},remove_action:function(n,t){var r={},e={};return v.isObject(n)?v.each(n,function(i,o){this._is_reserved_property(o)||(e[o]=i)},this):e[n]=t,r[Fn]=e,r},delete_action:function(){var n={};return n[og]="",n}},Ce=function(){};v.extend(Ce.prototype,Ed),Ce.prototype._init=function(n,t,r){this._mixpanel=n,this._group_key=t,this._group_id=r},Ce.prototype.set=jt(function(n,t,r){var e=this.set_action(n,t);return v.isObject(n)&&(r=t),this._send_request(e,r)}),Ce.prototype.set_once=jt(function(n,t,r){var e=this.set_once_action(n,t);return v.isObject(n)&&(r=t),this._send_request(e,r)}),Ce.prototype.unset=jt(function(n,t){var r=this.unset_action(n);return this._send_request(r,t)}),Ce.prototype.union=jt(function(n,t,r){v.isObject(n)&&(r=t);var e=this.union_action(n,t);return this._send_request(e,r)}),Ce.prototype.delete=jt(function(n){var t=this.delete_action();return this._send_request(t,n)}),Ce.prototype.remove=jt(function(n,t,r){var e=this.remove_action(n,t);return this._send_request(e,r)}),Ce.prototype._send_request=function(n,t){n.$group_key=this._group_key,n.$group_id=this._group_id,n.$token=this._get_config("token");var r=v.encodeDates(n);return this._mixpanel._track_or_batch({type:"groups",data:r,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},Ce.prototype._is_reserved_property=function(n){return n==="$group_key"||n==="$group_id"},Ce.prototype._get_config=function(n){return this._mixpanel.get_config(n)},Ce.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},Ce.prototype.remove=Ce.prototype.remove,Ce.prototype.set=Ce.prototype.set,Ce.prototype.set_once=Ce.prototype.set_once,Ce.prototype.union=Ce.prototype.union,Ce.prototype.unset=Ce.prototype.unset,Ce.prototype.toString=Ce.prototype.toString;var W=function(){};v.extend(W.prototype,Ed),W.prototype._init=function(n){this._mixpanel=n},W.prototype.set=at(function(n,t,r){var e=this.set_action(n,t);return v.isObject(n)&&(r=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),e[ut]=v.extend({},v.info.people_properties(),e[ut]),this._send_request(e,r)}),W.prototype.set_once=at(function(n,t,r){var e=this.set_once_action(n,t);return v.isObject(n)&&(r=t),this._send_request(e,r)}),W.prototype.unset=at(function(n,t){var r=this.unset_action(n);return this._send_request(r,t)}),W.prototype.increment=at(function(n,t,r){var e={},i={};return v.isObject(n)?(v.each(n,function(o,s){if(!this._is_reserved_property(s))if(isNaN(parseFloat(o))){se.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[s]=o},this),r=t):(v.isUndefined(t)&&(t=1),i[n]=t),e[gt]=i,this._send_request(e,r)}),W.prototype.append=at(function(n,t,r){v.isObject(n)&&(r=t);var e=this.append_action(n,t);return this._send_request(e,r)}),W.prototype.remove=at(function(n,t,r){v.isObject(n)&&(r=t);var e=this.remove_action(n,t);return this._send_request(e,r)}),W.prototype.union=at(function(n,t,r){v.isObject(n)&&(r=t);var e=this.union_action(n,t);return this._send_request(e,r)}),W.prototype.track_charge=at(function(){se.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")}),W.prototype.clear_charges=function(n){return this.set("$transactions",[],n)},W.prototype.delete_user=function(){if(!this._identify_called()){se.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)},W.prototype.toString=function(){return this._mixpanel.toString()+".people"},W.prototype._send_request=function(n,t){n.$token=this._get_config("token"),n.$distinct_id=this._mixpanel.get_distinct_id();var r=this._mixpanel.get_property("$device_id"),e=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");r&&(n.$device_id=r),e&&(n.$user_id=e),i&&(n.$had_persisted_distinct_id=i);var o=v.encodeDates(n);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(n),v.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),v.truncate(o,255))},W.prototype._get_config=function(n){return this._mixpanel.get_config(n)},W.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0},W.prototype._enqueue=function(n){ut in n?this._mixpanel.persistence._add_to_people_queue(ut,n):qt in n?this._mixpanel.persistence._add_to_people_queue(qt,n):bn in n?this._mixpanel.persistence._add_to_people_queue(bn,n):gt in n?this._mixpanel.persistence._add_to_people_queue(gt,n):Tn in n?this._mixpanel.persistence._add_to_people_queue(Tn,n):Fn in n?this._mixpanel.persistence._add_to_people_queue(Fn,n):yt in n?this._mixpanel.persistence._add_to_people_queue(yt,n):se.error("Invalid call to _enqueue():",n)},W.prototype._flush_one_queue=function(n,t,r,e){var i=this,o=v.extend({},this._mixpanel.persistence.load_queue(n)),s=o;!v.isUndefined(o)&&v.isObject(o)&&!v.isEmptyObject(o)&&(i._mixpanel.persistence._pop_from_people_queue(n,o),i._mixpanel.persistence.save(),e&&(s=e(o)),t.call(i,s,function(a,u){a===0&&i._mixpanel.persistence._add_to_people_queue(n,o),v.isUndefined(r)||r(a,u)}))},W.prototype._flush=function(n,t,r,e,i,o,s){var a=this;this._flush_one_queue(ut,this.set,n),this._flush_one_queue(qt,this.set_once,e),this._flush_one_queue(bn,this.unset,o,function(b){return v.keys(b)}),this._flush_one_queue(gt,this.increment,t),this._flush_one_queue(yt,this.union,i);var u=this._mixpanel.persistence.load_queue(Tn);if(!v.isUndefined(u)&&v.isArray(u)&&u.length)for(var c,d=function(b,S){b===0&&a._mixpanel.persistence._add_to_people_queue(Tn,c),v.isUndefined(r)||r(b,S)},h=u.length-1;h>=0;h--)u=this._mixpanel.persistence.load_queue(Tn),c=u.pop(),a._mixpanel.persistence.save(),v.isEmptyObject(c)||a.append(c,d);var p=this._mixpanel.persistence.load_queue(Fn);if(!v.isUndefined(p)&&v.isArray(p)&&p.length)for(var y,w=function(b,S){b===0&&a._mixpanel.persistence._add_to_people_queue(Fn,y),v.isUndefined(s)||s(b,S)},k=p.length-1;k>=0;k--)p=this._mixpanel.persistence.load_queue(Fn),y=p.pop(),a._mixpanel.persistence.save(),v.isEmptyObject(y)||a.remove(y,w)},W.prototype._is_reserved_property=function(n){return n==="$distinct_id"||n==="$token"||n==="$device_id"||n==="$user_id"||n==="$had_persisted_distinct_id"},W.prototype.set=W.prototype.set,W.prototype.set_once=W.prototype.set_once,W.prototype.unset=W.prototype.unset,W.prototype.increment=W.prototype.increment,W.prototype.append=W.prototype.append,W.prototype.remove=W.prototype.remove,W.prototype.union=W.prototype.union,W.prototype.track_charge=W.prototype.track_charge,W.prototype.clear_charges=W.prototype.clear_charges,W.prototype.delete_user=W.prototype.delete_user,W.prototype.toString=W.prototype.toString;var sa="__mps",aa="__mpso",ua="__mpus",la="__mpa",ca="__mpap",da="__mpr",ha="__mpu",Ld="$people_distinct_id",Qr="__alias",Ii="__timers",sg=[sa,aa,ua,la,ca,da,ha,Ld,Qr,Ii],Y=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 t=n.persistence;t!=="cookie"&&t!=="localStorage"&&(se.critical("Unknown persistence type "+t+"; falling back to cookie"),t=n.persistence="cookie"),t==="localStorage"&&v.localStorage.is_supported()?this.storage=v.localStorage:this.storage=v.cookie,this.load(),this.update_config(n),this.upgrade(),this.save()};Y.prototype.properties=function(){var n={};return this.load(),v.each(this.props,function(t,r){v.include(sg,r)||(n[r]=t)}),n},Y.prototype.load=function(){if(!this.disabled){var n=this.storage.parse(this.name);n&&(this.props=v.extend({},n))}},Y.prototype.upgrade=function(){var n,t;this.storage===v.localStorage?(n=v.cookie.parse(this.name),v.cookie.remove(this.name),v.cookie.remove(this.name,!0),n&&this.register_once(n)):this.storage===v.cookie&&(t=v.localStorage.parse(this.name),v.localStorage.remove(this.name),t&&this.register_once(t))},Y.prototype.save=function(){this.disabled||this.storage.set(this.name,Kt(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},Y.prototype.load_prop=function(n){return this.load(),this.props[n]},Y.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},Y.prototype.clear=function(){this.remove(),this.props={}},Y.prototype.register_once=function(n,t,r){return v.isObject(n)?(typeof t>"u"&&(t="None"),this.expire_days=typeof r>"u"?this.default_expiry:r,this.load(),v.each(n,function(e,i){(!this.props.hasOwnProperty(i)||this.props[i]===t)&&(this.props[i]=e)},this),this.save(),!0):!1},Y.prototype.register=function(n,t){return v.isObject(n)?(this.expire_days=typeof t>"u"?this.default_expiry:t,this.load(),v.extend(this.props,n),this.save(),!0):!1},Y.prototype.unregister=function(n){this.load(),n in this.props&&(delete this.props[n],this.save())},Y.prototype.update_search_keyword=function(n){this.register(v.info.searchInfo(n))},Y.prototype.update_referrer_info=function(n){this.register_once({$initial_referrer:n||"$direct",$initial_referring_domain:v.info.referringDomain(n)||"$direct"},"")},Y.prototype.get_referrer_info=function(){return v.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},Y.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)},Y.prototype.set_disabled=function(n){this.disabled=n,this.disabled?this.remove():this.save()},Y.prototype.set_cookie_domain=function(n){n!==this.cookie_domain&&(this.remove(),this.cookie_domain=n,this.save())},Y.prototype.set_cross_site=function(n){n!==this.cross_site&&(this.cross_site=n,this.remove(),this.save())},Y.prototype.set_cross_subdomain=function(n){n!==this.cross_subdomain&&(this.cross_subdomain=n,this.remove(),this.save())},Y.prototype.get_cross_subdomain=function(){return this.cross_subdomain},Y.prototype.set_secure=function(n){n!==this.secure&&(this.secure=!!n,this.remove(),this.save())},Y.prototype._add_to_people_queue=function(n,t){var r=this._get_queue_key(n),e=t[n],i=this._get_or_create_queue(ut),o=this._get_or_create_queue(qt),s=this._get_or_create_queue(bn),a=this._get_or_create_queue(gt),u=this._get_or_create_queue(yt),c=this._get_or_create_queue(Fn,[]),d=this._get_or_create_queue(Tn,[]);r===sa?(v.extend(i,e),this._pop_from_people_queue(gt,e),this._pop_from_people_queue(yt,e),this._pop_from_people_queue(bn,e)):r===aa?(v.each(e,function(h,p){p in o||(o[p]=h)}),this._pop_from_people_queue(bn,e)):r===ua?v.each(e,function(h){v.each([i,o,a,u],function(p){h in p&&delete p[h]}),v.each(d,function(p){h in p&&delete p[h]}),s[h]=!0}):r===la?(v.each(e,function(h,p){p in i?i[p]+=h:(p in a||(a[p]=0),a[p]+=h)},this),this._pop_from_people_queue(bn,e)):r===ha?(v.each(e,function(h,p){v.isArray(h)&&(p in u||(u[p]=[]),v.each(h,function(y){v.include(u[p],y)||u[p].push(y)}))}),this._pop_from_people_queue(bn,e)):r===da?(c.push(e),this._pop_from_people_queue(Tn,e)):r===ca&&(d.push(e),this._pop_from_people_queue(bn,e)),se.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),se.log(t),this.save()},Y.prototype._pop_from_people_queue=function(n,t){var r=this.props[this._get_queue_key(n)];v.isUndefined(r)||v.each(t,function(e,i){n===Tn||n===Fn?v.each(r,function(o){o[i]===e&&delete o[i]}):delete r[i]},this)},Y.prototype.load_queue=function(n){return this.load_prop(this._get_queue_key(n))},Y.prototype._get_queue_key=function(n){if(n===ut)return sa;if(n===qt)return aa;if(n===bn)return ua;if(n===gt)return la;if(n===Tn)return ca;if(n===Fn)return da;if(n===yt)return ha;se.error("Invalid queue:",n)},Y.prototype._get_or_create_queue=function(n,t){var r=this._get_queue_key(n);return t=v.isUndefined(t)?{}:t,this.props[r]||(this.props[r]=t)},Y.prototype.set_event_timer=function(n,t){var r=this.load_prop(Ii)||{};r[n]=t,this.props[Ii]=r,this.save()},Y.prototype.remove_event_timer=function(n){var t=this.load_prop(Ii)||{},r=t[n];return v.isUndefined(r)||(delete this.props[Ii][n],this.save()),r};var ma,Td=function(n,t){throw new Error(n+" not available in this build.")},Ze,Id=0,ag=1,ug=function(n){return n},cn="mixpanel",Pd="base64",lg="json",fa="$device:",Zt=O.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Rd=!Zt&&Dn.indexOf("MSIE")===-1&&Dn.indexOf("Mozilla")===-1,eo=null;rt.sendBeacon&&(eo=function(){return rt.sendBeacon.apply(rt,arguments)});var Od={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},Nd={api_host:"https://api-js.mixpanel.com",api_routes:Od,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:Pd,app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:ot,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:ot,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_canvas:!1,record_collect_fonts:!1,record_heatmap_data:!1,record_idle_timeout_ms:30*60*1e3,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:_i,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},Bd=!1,M=function(){},pa=function(n,t,r){var e,i=r===cn?Ze:Ze[r];if(i&&ma===Id)e=i;else{if(i&&!v.isArray(i)){se.error("You have already initialized "+r);return}e=new M}if(e._cached_groups={},e._init(n,t,r),e.people=new W,e.people._init(e),!e.get_config("skip_first_touch_marketing")){var o=v.info.campaignParams(null),s={},a=!1;v.each(o,function(u,c){s["initial_"+c]=u,u&&(a=!0)}),a&&e.people.set_once(s)}return vn.DEBUG=vn.DEBUG||e.get_config("debug"),!v.isUndefined(i)&&v.isArray(i)&&(e._execute_array.call(e.people,i.people),e._execute_array(i)),e};M.prototype.init=function(n,t,r){if(v.isUndefined(r)){this.report_error("You must name your new library: init(token, config, name)");return}if(r===cn){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var e=pa(n,t,r);return Ze[r]=e,e._loaded(),e},M.prototype._init=function(n,t,r){t=t||{},this.__loaded=!0,this.config={};var e={};if(!("api_payload_format"in t)){var i=t.api_host||Nd.api_host;i.match(/\.mixpanel\.com/)&&(e.api_payload_format=lg)}if(this.set_config(v.extend({},Nd,e,t,{name:r,token:n,callback_fn:(r===cn?r:cn+"."+r)+"._jsc"})),this._jsc=ot,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(!v.localStorage.is_supported(!0)||!Zt)this._batch_requests=!1,se.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),v.each(this.get_batcher_configs(),function(a){se.log("Clearing batch queue "+a.queue_key),v.localStorage.remove(a.queue_key)});else if(this.init_batchers(),eo&&O.addEventListener){var o=v.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);O.addEventListener("pagehide",function(a){a.persisted&&o()}),O.addEventListener("visibilitychange",function(){oe.visibilityState==="hidden"&&o()})}}this.persistence=this.cookie=new Y(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=v.UUID();this.get_distinct_id()||this.register_once({distinct_id:fa+s,$device_id:s},""),this.flags=new ae({getConfigFunc:v.bind(this.get_config,this),getDistinctIdFunc:v.bind(this.get_distinct_id,this),trackingFunc:v.bind(this.track,this)}),this.flags.init(),this.flags=this.flags,this.autocapture=new tn(this),this.autocapture.init(),this._init_tab_id(),this._check_and_start_session_recording()},M.prototype._init_tab_id=function(){if(v.sessionStorage.is_supported())try{var n=this.get_config("name")+"_"+this.get_config("token"),t="mp_tab_id_"+n,r="mp_gen_new_tab_id_"+n;(v.sessionStorage.get(r)||!v.sessionStorage.get(t))&&v.sessionStorage.set(t,"$tab-"+v.UUID()),v.sessionStorage.set(r,"1"),this.tab_id=v.sessionStorage.get(t),O.addEventListener("beforeunload",function(){v.sessionStorage.remove(r)})}catch(e){this.report_error("Error initializing tab id",e)}else this.report_error("Session storage is not supported, cannot keep track of unique tab ID.")},M.prototype.get_tab_id=function(){return this.tab_id||null},M.prototype._should_load_recorder=function(){var n=new Mn(zs),t=this.get_tab_id();return n.init().then(function(){return n.getAll()}).then(function(r){for(var e=0;e<r.length;e++)if(Zs(r[e])||r[e].tabId===t)return!0;return!1}).catch(v.bind(function(r){this.report_error("Error checking recording registry",r)},this))},M.prototype._check_and_start_session_recording=st(function(n){if(!O.MutationObserver){se.critical("Browser does not support MutationObserver; skipping session recording");return}var t=v.bind(function(e){var i=v.bind(function(){this._recorder=this._recorder||new O.__mp_recorder(this),this._recorder.resumeRecording(e)},this);v.isUndefined(O.__mp_recorder)?Td(this.get_config("recorder_src"),i):i()},this),r=this.get_config("record_sessions_percent")>0&&Math.random()*100<=this.get_config("record_sessions_percent");n||r?t(!0):this._should_load_recorder().then(function(e){e&&t(!1)})}),M.prototype.start_session_recording=function(){this._check_and_start_session_recording(!0)},M.prototype.stop_session_recording=function(){this._recorder&&this._recorder.stopRecording()},M.prototype.pause_session_recording=function(){this._recorder&&this._recorder.pauseRecording()},M.prototype.resume_session_recording=function(){this._recorder&&this._recorder.resumeRecording()},M.prototype.is_recording_heatmap_data=function(){return this._get_session_replay_id()&&this.get_config("record_heatmap_data")},M.prototype.get_session_recording_properties=function(){var n={},t=this._get_session_replay_id();return t&&(n.$mp_replay_id=t),n},M.prototype.get_session_replay_url=function(){var n=null,t=this._get_session_replay_id();if(t){var r=v.HTTPBuildQuery({replay_id:t,distinct_id:this.get_distinct_id(),token:this.get_config("token")});n="https://mixpanel.com/projects/replay-redirect?"+r}return n},M.prototype._get_session_replay_id=function(){var n=null;return this._recorder&&(n=this._recorder.replayId),n||null},M.prototype.__get_recorder=function(){return this._recorder},M.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=v.info.campaignParams(null);v.each(n,(function(t,r){this.unregister(r)}).bind(this))}},M.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(oe.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(v.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(oe.referrer)},M.prototype._dom_loaded=function(){v.each(this.__dom_loaded_queue,function(n){this._track_dom.apply(this,n)},this),this.has_opted_out_tracking()||v.each(this.__request_queue,function(n){this._send_request.apply(this,n)},this),delete this.__dom_loaded_queue,delete this.__request_queue},M.prototype._track_dom=function(n,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!Bd)return this.__dom_loaded_queue.push([n,t]),!1;var r=new n().init(this);return r.track.apply(r,t)},M.prototype._prepare_callback=function(n,t){if(v.isUndefined(n))return null;if(Zt){var r=function(s){n(s,t)};return r}else{var e=this._jsc,i=""+Math.floor(Math.random()*1e8),o=this.get_config("callback_fn")+"["+i+"]";return e[i]=function(s){delete e[i],n(s,t)},o}},M.prototype._send_request=function(n,t,r,e){var i=!0;if(Rd)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;!e&&(v.isFunction(r)||typeof r=="string")&&(e=r,r=null),r=v.extend(o,r||{}),Zt||(r.method="GET");var a=r.method==="POST",u=eo&&a&&r.transport.toLowerCase()==="sendbeacon",c=r.verbose;t.verbose&&(c=!0),this.get_config("test")&&(t.test=1),c&&(t.verbose=1),this.get_config("img")&&(t.img=1),Zt||(e?t.callback=e:(c||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=new Date().getTime().toString(),a&&(s="data="+encodeURIComponent(t.data),delete t.data),v.extend(t,this.get_config("api_extra_query_params")),n+="?"+v.HTTPBuildQuery(t);var d=this;if("img"in t){var h=oe.createElement("img");h.src=n,oe.body.appendChild(h)}else if(u){try{i=eo(n,s)}catch(S){d.report_error(S),i=!1}try{e&&e(i?1:0)}catch(S){d.report_error(S)}}else if(Zt)try{var p=new XMLHttpRequest;p.open(r.method,n,!0);var y=this.get_config("xhr_headers");if(a&&(y["Content-Type"]="application/x-www-form-urlencoded"),v.each(y,function(S,A){p.setRequestHeader(A,S)}),r.timeout_ms&&typeof p.timeout<"u"){p.timeout=r.timeout_ms;var w=new Date().getTime()}p.withCredentials=!0,p.onreadystatechange=function(){if(p.readyState===4)if(p.status===200){if(e)if(c){var S;try{S=v.JSONDecode(p.responseText)}catch(E){if(d.report_error(E),r.ignore_json_errors)S=p.responseText;else return}e(S)}else e(Number(p.responseText))}else{var A;if(p.timeout&&!p.status&&new Date().getTime()-w>=p.timeout?A="timeout":A="Bad HTTP status: "+p.status+" "+p.statusText,d.report_error(A),e)if(c){var x=p.responseHeaders||{};e({status:0,httpStatusCode:p.status,error:A,retryAfter:x["Retry-After"]})}else e(0)}},p.send(s)}catch(S){d.report_error(S),i=!1}else{var k=oe.createElement("script");k.type="text/javascript",k.async=!0,k.defer=!0,k.src=n;var b=oe.getElementsByTagName("script")[0];b.parentNode.insertBefore(k,b)}return i},M.prototype._execute_array=function(n){var t,r=[],e=[],i=[];v.each(n,function(s){s&&(t=s[0],v.isArray(t)?i.push(s):typeof s=="function"?s.call(this):v.isArray(s)&&t==="alias"?r.push(s):v.isArray(s)&&t.indexOf("track")!==-1&&typeof this[t]=="function"?i.push(s):e.push(s))},this);var o=function(s,a){v.each(s,function(u){if(v.isArray(u[0])){var c=a;v.each(u,function(d){c=c[d[0]].apply(c,d.slice(1))})}else this[u[0]].apply(this,u.slice(1))},a)};o(r,this),o(e,this),o(i,this)},M.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},M.prototype.get_batcher_configs=function(){var n="__mpq_"+this.get_config("token"),t=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+t.track,queue_key:n+"_ev"},people:{type:"people",endpoint:"/"+t.engage,queue_key:n+"_pp"},groups:{type:"groups",endpoint:"/"+t.groups,queue_key:n+"_gr"}},this._batcher_configs},M.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var n=v.bind(function(r){return new un(r.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:v.bind(function(e,i,o){this._send_request(this.get_config("api_host")+r.endpoint,this._encode_data_for_request(e),i,this._prepare_callback(o,e))},this),beforeSendHook:v.bind(function(e){return this._run_hook("before_send_"+r.type,e)},this),stopAllBatchingFunc:v.bind(this.stop_batch_senders,this),usePersistence:!0})},this),t=this.get_batcher_configs();this.request_batchers={events:n(t.events),people:n(t.people),groups:n(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},M.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,v.each(this.request_batchers,function(n){n.start()}))},M.prototype.stop_batch_senders=function(){this._batch_requests=!1,v.each(this.request_batchers,function(n){n.stop(),n.clear()})},M.prototype.push=function(n){this._execute_array([n])},M.prototype.disable=function(n){typeof n>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(n)},M.prototype._encode_data_for_request=function(n){var t=Kt(n);return this.get_config("api_payload_format")===Pd&&(t=v.base64Encode(t)),{data:t}},M.prototype._track_or_batch=function(n,t){var r=v.truncate(n.data,255),e=n.endpoint,i=n.batcher,o=n.should_send_immediately,s=n.send_request_options||{};t=t||ot;var a=!0,u=v.bind(function(){return s.skip_hooks||(r=this._run_hook("before_send_"+n.type,r)),r?(se.log("MIXPANEL REQUEST:"),se.log(r),this._send_request(e,this._encode_data_for_request(r),s,this._prepare_callback(t,r))):null},this);return this._batch_requests&&!o?i.enqueue(r).then(function(c){c?t(1,r):u()}):a=u(),a&&r},M.prototype.track=st(function(n,t,r,e){!e&&typeof r=="function"&&(e=r,r=null),r=r||{};var i=r.transport;i&&(r.transport=i);var o=r.send_immediately;if(typeof e!="function"&&(e=ot),v.isUndefined(n)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(n)){e(0);return}t=v.extend({},t),t.token=this.get_config("token");var s=this.persistence.remove_event_timer(n);if(!v.isUndefined(s)){var a=new Date().getTime()-s;t.$duration=parseFloat((a/1e3).toFixed(3))}this._set_default_superprops();var u=this.get_config("track_marketing")?v.info.marketingParams():{};t=v.extend({},v.info.properties({mp_loader:this.get_config("mp_loader")}),u,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var c=this.get_config("property_blacklist");v.isArray(c)?v.each(c,function(p){delete t[p]}):this.report_error("Invalid value for property_blacklist config: "+c);var d={event:n,properties:t},h=this._track_or_batch({type:"events",data:d,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:r},e);return h}),M.prototype.set_group=st(function(n,t,r){v.isArray(t)||(t=[t]);var e={};return e[n]=t,this.register(e),this.people.set(n,t,r)}),M.prototype.add_group=st(function(n,t,r){var e=this.get_property(n),i={};return e===void 0?(i[n]=[t],this.register(i)):e.indexOf(t)===-1&&(e.push(t),i[n]=e,this.register(i)),this.people.union(n,t,r)}),M.prototype.remove_group=st(function(n,t,r){var e=this.get_property(n);if(e!==void 0){var i=e.indexOf(t);i>-1&&(e.splice(i,1),this.register({group_key:e})),e.length===0&&this.unregister(n)}return this.people.remove(n,t,r)}),M.prototype.track_with_groups=st(function(n,t,r,e){var i=v.extend({},t||{});return v.each(r,function(o,s){o!=null&&(i[s]=o)}),this.track(n,i,e)}),M.prototype._create_map_key=function(n,t){return n+"_"+JSON.stringify(t)},M.prototype._remove_group_from_cache=function(n,t){delete this._cached_groups[this._create_map_key(n,t)]},M.prototype.get_group=function(n,t){var r=this._create_map_key(n,t),e=this._cached_groups[r];return(e===void 0||e._group_key!==n||e._group_id!==t)&&(e=new Ce,e._init(this,n,t),this._cached_groups[r]=e),e},M.prototype.track_pageview=st(function(n,t){typeof n!="object"&&(n={}),t=t||{};var r=t.event_name||"$mp_web_page_view",e=v.extend(v.info.mpPageViewProperties(),v.info.campaignParams(),v.info.clickParams()),i=v.extend({},e,n);return this.track(r,i)}),M.prototype.track_links=function(){return this._track_dom.call(this,Wt,arguments)},M.prototype.track_forms=function(){return this._track_dom.call(this,Xr,arguments)},M.prototype.time_event=function(n){if(v.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 cg={persistent:!0},va=function(n){var t;return v.isObject(n)?t=n:v.isUndefined(n)?t={}:t={days:n},v.extend({},cg,t)};M.prototype.register=function(n,t){var r=va(t);r.persistent?this.persistence.register(n,r.days):v.extend(this.unpersisted_superprops,n)},M.prototype.register_once=function(n,t,r){var e=va(r);e.persistent?this.persistence.register_once(n,t,e.days):(typeof t>"u"&&(t="None"),v.each(n,function(i,o){(!this.unpersisted_superprops.hasOwnProperty(o)||this.unpersisted_superprops[o]===t)&&(this.unpersisted_superprops[o]=i)},this))},M.prototype.unregister=function(n,t){t=va(t),t.persistent?this.persistence.unregister(n):delete this.unpersisted_superprops[n]},M.prototype._register_single=function(n,t){var r={};r[n]=t,this.register(r)},M.prototype.identify=function(n,t,r,e,i,o,s,a){var u=this.get_distinct_id();if(n&&u!==n){if(typeof n=="string"&&n.indexOf(fa)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:n})}if(!this.get_property("$device_id")){var c=u;this.register_once({$had_persisted_distinct_id:!0,$device_id:c},"")}n!==u&&n!==this.get_property(Qr)&&(this.unregister(Qr),this.register({distinct_id:n})),this._flags.identify_called=!0,this.people._flush(t,r,e,i,o,s,a),n!==u&&this.track("$identify",{distinct_id:n,$anon_distinct_id:u},{skip_hooks:!0}),n!==u&&this.flags.fetchFlags()},M.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var n=v.UUID();this.register_once({distinct_id:fa+n,$device_id:n},""),this.stop_session_recording(),this._check_and_start_session_recording()},M.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},M.prototype.alias=function(n,t){if(n===this.get_property(Ld))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var r=this;return v.isUndefined(t)&&(t=this.get_distinct_id()),n!==t?(this._register_single(Qr,n),this.track("$create_alias",{alias:n,distinct_id:t},{skip_hooks:!0},function(){r.identify(n)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(n),-1)},M.prototype.name_tag=function(n){this._register_single("mp_name_tag",n)},M.prototype.set_config=function(n){if(v.isObject(n)){v.extend(this.config,n);var t=n.batch_size;t&&v.each(this.request_batchers,function(r){r.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),vn.DEBUG=vn.DEBUG||this.get_config("debug"),("autocapture"in n||"record_heatmap_data"in n)&&this.autocapture&&this.autocapture.init()}},M.prototype.get_config=function(n){return this.config[n]},M.prototype._run_hook=function(n){var t=(this.config.hooks[n]||ug).apply(this,it.call(arguments,1));return typeof t>"u"&&(this.report_error(n+" hook did not return a value"),t=null),t},M.prototype.get_property=function(n){return this.persistence.load_prop([n])},M.prototype.toString=function(){var n=this.get_config("name");return n!==cn&&(n=cn+"."+n),n},M.prototype._event_is_disabled=function(n){return v.isBlockedUA(Dn)||this._flags.disable_all_events||v.include(this.__disabled_events,n)},M.prototype._gdpr_init=function(){var n=this.get_config("opt_out_tracking_persistence_type")==="localStorage";n&&v.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")||v.cookie.get("mp_optout"))&&(v.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},M.prototype._gdpr_update_persistence=function(n){var t;if(n&&n.clear_persistence)t=!0;else if(n&&n.enable_persistence)t=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==t&&this.persistence.set_disabled(t),t?(this.stop_batch_senders(),this.stop_session_recording()):this._batchers_were_started&&this.start_batch_senders()},M.prototype._gdpr_call_func=function(n,t){return t=v.extend({track:v.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")},t),v.localStorage.is_supported()||(t.persistence_type="cookie"),n(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},M.prototype.opt_in_tracking=function(n){n=v.extend({enable_persistence:!0},n),this._gdpr_call_func(P1,n),this._gdpr_update_persistence(n)},M.prototype.opt_out_tracking=function(n){n=v.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(R1,n),this._gdpr_update_persistence(n)},M.prototype.has_opted_in_tracking=function(n){return this._gdpr_call_func(O1,n)},M.prototype.has_opted_out_tracking=function(n){return this._gdpr_call_func(qc,n)},M.prototype.clear_opt_in_out_tracking=function(n){n=v.extend({enable_persistence:!0},n),this._gdpr_call_func(N1,n),this._gdpr_update_persistence(n)},M.prototype.report_error=function(n,t){se.error.apply(se.error,arguments);try{!t&&!(n instanceof Error)&&(n=new Error(n)),this.get_config("error_reporter")(n,t)}catch(r){se.error(r)}},M.prototype.init=M.prototype.init,M.prototype.reset=M.prototype.reset,M.prototype.disable=M.prototype.disable,M.prototype.time_event=M.prototype.time_event,M.prototype.track=M.prototype.track,M.prototype.track_links=M.prototype.track_links,M.prototype.track_forms=M.prototype.track_forms,M.prototype.track_pageview=M.prototype.track_pageview,M.prototype.register=M.prototype.register,M.prototype.register_once=M.prototype.register_once,M.prototype.unregister=M.prototype.unregister,M.prototype.identify=M.prototype.identify,M.prototype.alias=M.prototype.alias,M.prototype.name_tag=M.prototype.name_tag,M.prototype.set_config=M.prototype.set_config,M.prototype.get_config=M.prototype.get_config,M.prototype.get_property=M.prototype.get_property,M.prototype.get_distinct_id=M.prototype.get_distinct_id,M.prototype.toString=M.prototype.toString,M.prototype.opt_out_tracking=M.prototype.opt_out_tracking,M.prototype.opt_in_tracking=M.prototype.opt_in_tracking,M.prototype.has_opted_out_tracking=M.prototype.has_opted_out_tracking,M.prototype.has_opted_in_tracking=M.prototype.has_opted_in_tracking,M.prototype.clear_opt_in_out_tracking=M.prototype.clear_opt_in_out_tracking,M.prototype.get_group=M.prototype.get_group,M.prototype.set_group=M.prototype.set_group,M.prototype.add_group=M.prototype.add_group,M.prototype.remove_group=M.prototype.remove_group,M.prototype.track_with_groups=M.prototype.track_with_groups,M.prototype.start_batch_senders=M.prototype.start_batch_senders,M.prototype.stop_batch_senders=M.prototype.stop_batch_senders,M.prototype.start_session_recording=M.prototype.start_session_recording,M.prototype.stop_session_recording=M.prototype.stop_session_recording,M.prototype.pause_session_recording=M.prototype.pause_session_recording,M.prototype.resume_session_recording=M.prototype.resume_session_recording,M.prototype.get_session_recording_properties=M.prototype.get_session_recording_properties,M.prototype.get_session_replay_url=M.prototype.get_session_replay_url,M.prototype.get_tab_id=M.prototype.get_tab_id,M.prototype.DEFAULT_API_ROUTES=Od,M.prototype.__get_recorder=M.prototype.__get_recorder,Y.prototype.properties=Y.prototype.properties,Y.prototype.update_search_keyword=Y.prototype.update_search_keyword,Y.prototype.update_referrer_info=Y.prototype.update_referrer_info,Y.prototype.get_cross_subdomain=Y.prototype.get_cross_subdomain,Y.prototype.clear=Y.prototype.clear;var Jt={},dg=function(){v.each(Jt,function(n,t){t!==cn&&(Ze[t]=n)}),Ze._=v},hg=function(){Ze.init=function(n,t,r){if(r)return Ze[r]||(Ze[r]=Jt[r]=pa(n,t,r),Ze[r]._loaded()),Ze[r];var e=Ze;Jt[cn]?e=Jt[cn]:n&&(e=pa(n,t,cn),e._loaded(),Jt[cn]=e),Ze=e,ma===ag&&(O[cn]=Ze),dg()}},mg=function(){function n(){n.done||(n.done=!0,Bd=!0,Rd=!1,v.each(Jt,function(e){e._dom_loaded()}))}function t(){try{oe.documentElement.doScroll("left")}catch{setTimeout(t,1);return}n()}if(oe.addEventListener)oe.readyState==="complete"?n():oe.addEventListener("DOMContentLoaded",n,!1);else if(oe.attachEvent){oe.attachEvent("onreadystatechange",n);var r=!1;try{r=O.frameElement===null}catch{}oe.documentElement.doScroll&&r&&t()}v.register_event(O,"load",n,!0)};function fg(n){return Td=n,ma=Id,Ze=new M,hg(),Ze.init(),mg(),Ze}function pg(n,t){t()}var B=fg(pg);const Dd=`<div id="checkoutConfirmationEnd">\r
795
+ <div class="w-full">\r
796
+ <div id="otp-content" class=" grid gap-4">\r
797
+ <h5 class="text-black" id="otp-message">\r
798
+ \r
799
+ </h5>\r
800
+ \r
801
+ <div class="">\r
802
+ <div class="w-11/12 mx-auto">\r
803
+ <p class="text-center">Your transaction is being processed and is taking longer than usual to\r
804
+ confirm. You don’t need to\r
805
+ stay on this page—<br /> <span class="font-bold">we will notify you once it is confirmed.</span>\r
806
+ </p>\r
807
+ </div>\r
808
+ <div class="py-5">\r
809
+ <div class="mt-2">\r
810
+ <button class="details-form-button" id="goback-to-merchant" type="button">\r
811
+ <svg class="spinner hidden" id="spinner" viewBox="0 0 24 24">\r
812
+ <path\r
813
+ d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">\r
814
+ </path>\r
815
+ </svg>\r
816
+ <span id="mobile-money-button-text"> Go back to Merchant </span>\r
817
+ </button>\r
818
+ </div>\r
819
+ </div>\r
820
+ </div>\r
821
+ </div>\r
822
+ </div>`;class Hd{constructor(t){g(this,"container");g(this,"onAction");g(this,"callBackUrl");g(this,"paymentResponse");g(this,"paymentResponseHeaders");this.container=t.container,this.onAction=t.onAction,this.callBackUrl=t.callBackUrl,this.paymentResponse=t.paymentResponse,this.paymentResponseHeaders=t.paymentResponseHeaders}attachListeners(){const t=this.container.querySelector("#goback-to-merchant");t&&t.addEventListener("click",()=>{qn(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)})}renderComponent(){this.container.innerHTML=this.render(),this.attachListeners()}render(){return Dd}}class vg{constructor({amount:t,container:r,email:e,encryption:i,planId:o,token:s,currency:a,rdtCode:u,url:c,reference:d,onSuccess:h,callBackUrl:p,metadata:y,localCurrency:w,hidePaymentMethods:k,showPaymentMethods:b,onClose:S,restartTransactionProcess:A,retryingPayment:x}){g(this,"contents");g(this,"cardDetailForm");g(this,"cardOtpValidationForm");g(this,"merchantPlanDetail",{});g(this,"cardPinForm");g(this,"avsForm");g(this,"successScreen");g(this,"pageLoader");g(this,"warningScreen");g(this,"transactionIssuesScreen");g(this,"container");g(this,"onSuccess");g(this,"planId","");g(this,"email");g(this,"token");g(this,"amount");g(this,"encryption");g(this,"currency");g(this,"_currentStep");g(this,"activeRef");g(this,"rdtCode");g(this,"url");g(this,"reference");g(this,"callBackUrl");g(this,"metadata");g(this,"localCurrency");g(this,"hidePaymentMethods");g(this,"showPaymentMethods");g(this,"onClose");g(this,"cardResponse");g(this,"cardResponseHeader");g(this,"confirmationEnd");g(this,"restartTransactionProcess");g(this,"retryingPayment");g(this,"isMaxRetriesReached");g(this,"isMobile",!1);this.currency=a,this.onSuccess=h||(()=>null),this.container=r,this.encryption=i,this.token=s,this.email=e,this.planId=o,this.amount=t,this.rdtCode=u,this.url=c,this.reference=d,this.callBackUrl=p,this.metadata=y,this.localCurrency=w,this._currentStep=1,this.activeRef="",this.contents=this.container.querySelector("#payment-content-view"),this.cardResponse={},this.cardResponseHeader={},this.hidePaymentMethods=k,this.showPaymentMethods=b,this.onClose=S,this.restartTransactionProcess=A,this.retryingPayment=x,this.isMaxRetriesReached=!1,this.renderCardContent(),B.track("card_opens",{payment_method:"Card"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(t){this._currentStep=t,this.renderCardContent()}async submitCardDetails(t,r){t.preventDefault(),B.track("input_cardDetails",{payment_method:"Card",authentication_type:"PIN"});const e=this.container.querySelector(".spinner"),i=this.container.querySelector("#details-form-button-text"),o=await Eh(JSON.stringify(r),this.encryption);e&&i&&(e.classList.remove("hidden"),i.classList.add("hidden")),(()=>{if(this.retryingPayment){const a={channel:"card",reference:this.reference,encryptedCard:o};return Di(this.token,a,this.rdtCode,this.url)}else{const a={amount:this.amount,channel:"card",currency:this.currency||"USD",planId:this.planId,customer:{email:this.email},reference:this.reference,encryptedCard:o,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0};return fh(this.token,a,this.rdtCode,this.url)}})().then(({data:a,headers:u})=>{var c,d,h,p,y,w;if(a.status==="failed")this.currentStep=4,this.reference=a.reference,B.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN"}),this.cardResponse=a,this.cardResponseHeader=u,a.providerMessage?this.warningScreen.setPaymentError(a.providerMessage):this.warningScreen.setPaymentError("Payment failed");else if(!["success","successful"].includes(a.status)&&a.status!=="failed")if(this.cardResponse=a,this.cardResponseHeader=u,a!=null&&a.authorization){if(this.activeRef=a.reference,((c=a==null?void 0:a.authorization)==null?void 0:c.mode)==="pin"){this.currentStep=2;return}if(((d=a==null?void 0:a.authorization)==null?void 0:d.mode)==="3DS"){(h=a==null?void 0:a.authorization)!=null&&h.redirectUrl&&this.redirectTo3DS((p=a==null?void 0:a.authorization)==null?void 0:p.redirectUrl);return}if(((y=a==null?void 0:a.authorization)==null?void 0:y.mode)==="otp"){this.cardResponse=a,this.currentStep=3;return}if(((w=a==null?void 0:a.authorization)==null?void 0:w.mode)==="avs"){this.currentStep=7;return}}else this.currentStep=4,a.providerMessage?this.warningScreen.setPaymentError(a.providerMessage):this.warningScreen.setPaymentError("Error with Payment");else["success","successful"].includes(a.status)&&(this.currentStep=5,this.cardResponse=a,this.cardResponseHeader=u,B.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN"}),this.redirectTo(a,u,"success"))}).catch(a=>{B.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"PIN"}),a.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,a.message?this.warningScreen.setPaymentError(a.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue())}).finally(()=>{e&&i&&(e.classList.add("hidden"),i.classList.remove("hidden"))})}handlePinRequest(t){if(t.length===4){const r={authorization:{pin:t},reference:this.activeRef};B.track("input_cardPin",{payment_method:"Card",authentication_type:"PIN"}),setTimeout(()=>{const e=this.container.querySelector("#pin-loader"),i=this.container.querySelector("#cancel-payment");e&&(e.innerHTML=`<svg class="animate-spin" width="40" height="40" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
795
823
  <path
796
824
  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"
797
825
  stroke="black" stroke-width="4" stroke-linejoin="round" />
798
- </svg>`),o&&o.classList.add("hidden"),oi(this.token,i,this.rdtCode,this.url).then(({data:r,headers:l})=>{var c,b,p,g,f;if(r.status==="failed")P.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN"}),this.currentStep=4,r.providerMessage?this.warningScreen.setPaymentError(r.providerMessage):this.warningScreen.setPaymentError("Payment failed");else if(["success","successful","failed"].includes(r.status))this.currentStep=5,this.redirectTo(r,l,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN"});else{if(((c=r==null?void 0:r.authorization)==null?void 0:c.mode)==="3DS"){(b=r==null?void 0:r.authorization)!=null&&b.redirectUrl&&this.redirectTo3DS((p=r==null?void 0:r.authorization)==null?void 0:p.redirectUrl);return}if(((g=r==null?void 0:r.authorization)==null?void 0:g.mode)==="otp"){this.cardResponse=r,this.currentStep=3;return}if(((f=r==null?void 0:r.authorization)==null?void 0:f.mode)==="avs"){this.currentStep=7;return}}}).catch(r=>{P.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"PIN"}),this.currentStep=4,r.message?this.warningScreen.setPaymentError(r.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()})},300)}}showLoader(){this.pageLoader=new Ie(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:r})=>{const l=document.createElement("button");l.textContent=r,l.setAttribute("id",s),l.classList.add("warning-button");const c=document.createElement("div");c.appendChild(l),t.appendChild(c)})}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")),oi(this.token,s,this.rdtCode,this.url).then(({data:l,headers:c})=>{var b,p,g,f,y;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");else if(["success","successful","failed"].includes(l.status))["success","successful"].includes(l.status)&&(this.currentStep=5,this.redirectTo(l,c,"success"),P.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"AVS"}));else{if(((b=l==null?void 0:l.authorization)==null?void 0:b.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),this.currentStep=6;return}if(((y=l==null?void 0:l.authorization)==null?void 0:y.mode)==="otp"){this.cardResponse=l,this.currentStep=3;return}}}).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"}),oi(this.token,t,this.rdtCode,this.url).then(({data:s,headers:r})=>{var l,c,b,p,g,f;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");else if(["success","successful","failed"].includes(s.status))["success","successful"].includes(s.status)&&(this.currentStep=5,this.redirectTo(s,r,"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(((c=s==null?void 0:s.authorization)==null?void 0:c.mode)==="3DS"){(b=s==null?void 0:s.authorization)!=null&&b.redirectUrl&&this.redirectTo3DS((p=s==null?void 0:s.authorization)==null?void 0:p.redirectUrl);return}if(((g=s==null?void 0:s.authorization)==null?void 0:g.mode)==="otp"){this.cardResponse=s,this.currentStep=3;return}if(((f=s==null?void 0:s.authorization)==null?void 0:f.mode)==="avs"){this.currentStep=7;return}this.currentStep=9}}).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")})}redirectTo3DS(e){const i=window.open(e,"_blank");if(i){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"),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 vn(this.token,this.activeRef,void 0,this.rdtCode,this.url);t.data.status==="failed"?i(t):["success","successful"].includes(t.data.status)&&e(t)}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 vn(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 Et({container:this.contents,onAction:r=>l=>this.submitCardDetails.bind(this)(r,l),merchantName:this.merchantPlanDetail.merchantName}),this.cardDetailForm.renderContent();break;case 2:this.cardPinForm=new Os({container:this.contents,onClose:this.onClose,onAction:r=>this.handlePinRequest.bind(this)(r)}),this.cardPinForm.renderComponent();break;case 3:this.cardOtpValidationForm=new Rs({container:this.contents,onClose:this.onClose,onAction:r=>l=>this.submitOtp.bind(this)(r,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 fn({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 Vn({container:this.contents,amount:this.amount,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 Ie(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 7:this.avsForm=new Ks({container:this.contents,onAction:r=>l=>this.validatedAVS.bind(this)(r,l)}),this.avsForm.renderComponent();break;case 8:this.transactionIssuesScreen=new di({container:this.contents,onAction:()=>{var r;this.currentStep=4,this.warningScreen.setPaymentError(((r=this.cardResponse)==null?void 0:r.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 jo({container:this.contents,onAction:r=>{this.currentStep=r},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;default:this.cardDetailForm=new Et({container:this.contents,onAction:r=>l=>this.submitCardDetails.bind(this)(r,l),merchantName:this.merchantPlanDetail.merchantName}),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,r;const i=this.container.querySelector("#details-form-button-text");if(i){const l=this.currency,c=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 ${c} ${ke((this.amount||0)*(l==="USD"?(r=(s=this.merchantPlanDetail)==null?void 0:s.rate)==null?void 0:r.rate:1),2)}`}}}const Rr=`<div>
799
- <div class="container-center h-[40vh] hidden" id="loader">
800
- <img src="" alt="loader gif" />
801
- </div>
802
- <div id="details-content" class="grid gap-5">
803
- <h5 class="text-sm text-tone-100 text-center font-semibold md:w-4/5 mx-auto">
804
- Make a single bank transfer from your bank to this account
805
- before it expires.
806
- </h5>
807
- <div class="border border-grey-100 rounded-lg text-black px-6 py-5 grid gap-4">
808
- <div class="text-sm grid grid-cols-[1fr_auto] gap-3">
809
- <div>
810
- <p class="text-sm">Amount</p>
811
- </div>
812
-
813
- <div class="align-center gap-2">
814
- <p class="font-bold transfer-curr-amount" id="transfer-amount"></p>
815
-
816
- <button type="button" class="relative group" id="copy-amount">
817
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
818
- <path
819
- d="M9.33268 7.52502V9.97502C9.33268 12.0167 8.51602 12.8334 6.47435 12.8334H4.02435C1.98268 12.8334 1.16602 12.0167 1.16602 9.97502V7.52502C1.16602 5.48335 1.98268 4.66669 4.02435 4.66669H6.47435C8.51602 4.66669 9.33268 5.48335 9.33268 7.52502Z"
820
- stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
821
- <path
822
- d="M12.8327 4.02502V6.47502C12.8327 8.51669 12.016 9.33335 9.97435 9.33335H9.33268V7.52502C9.33268 5.48335 8.51602 4.66669 6.47435 4.66669H4.66602V4.02502C4.66602 1.98335 5.48268 1.16669 7.52435 1.16669H9.97435C12.016 1.16669 12.8327 1.98335 12.8327 4.02502Z"
823
- stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
824
- </svg>
825
-
826
-
827
- <div class="tooltip">
828
- <div class="tooltip-textbox">
829
- <p class="tooltip-text" id="amount-tooltip">Copy</p>
830
- </div>
831
- </div>
832
- </button>
833
- </div>
834
- </div>
835
-
836
- <div class="grid grid-cols-[1fr_auto] gap-3 text-sm">
837
- <div>
838
- <p class="text-sm">Account Number</p>
839
- </div>
840
-
841
- <div class="align-center gap-2">
842
- <p class="font-bold" id="transfer-acn"></p>
843
-
844
- <button type="button" class="relative group" id="copy-acn">
845
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
846
- <path
847
- d="M9.33268 7.52502V9.97502C9.33268 12.0167 8.51602 12.8334 6.47435 12.8334H4.02435C1.98268 12.8334 1.16602 12.0167 1.16602 9.97502V7.52502C1.16602 5.48335 1.98268 4.66669 4.02435 4.66669H6.47435C8.51602 4.66669 9.33268 5.48335 9.33268 7.52502Z"
848
- stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
849
- <path
850
- d="M12.8327 4.02502V6.47502C12.8327 8.51669 12.016 9.33335 9.97435 9.33335H9.33268V7.52502C9.33268 5.48335 8.51602 4.66669 6.47435 4.66669H4.66602V4.02502C4.66602 1.98335 5.48268 1.16669 7.52435 1.16669H9.97435C12.016 1.16669 12.8327 1.98335 12.8327 4.02502Z"
851
- stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
852
- </svg>
853
-
854
-
855
- <div class="tooltip">
856
- <div class="tooltip-textbox">
857
- <p class="tooltip-text" id="acn-tooltip">Copy</p>
858
- </div>
859
- </div>
860
- </button>
861
- </div>
862
- </div>
863
-
864
- <div class="grid grid-cols-[1fr_auto] gap-3 text-sm">
865
- <p>Bank name</p>
866
- <p class="font-semibold" id="transfer-bank"></p>
867
- </div>
868
-
869
-
870
- <div class="grid grid-cols-[1fr_auto] gap-3 text-sm">
871
- <p>Beneficiary</p>
872
- <p class="font-semibold" id="account-name"></p>
873
- </div>
874
- </div>
875
-
876
- <div class="mt-3">
877
- <button type="button" id="transfer-button" class="details-form-button">I have made this bank transfer</button>
878
- </div>
879
-
880
- <div class="mt-5">
881
- <div class="w-9/12 mx-auto">
882
- <div class="bg-[#FEF7ED] text-[#816039] text-sm text-center rounded-lg p-2">
883
- This account is for this transaction only and
884
- expires in <span class="font-semibold" id="time-left"></span><span class="font-semibold">s</span>
885
- </div>
886
- </div>
887
- </div>
888
- </div>
889
- </div>`;function Dr(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Vo={exports:{}};/*!
826
+ </svg>`),i&&i.classList.add("hidden"),Bi(this.token,r,this.rdtCode,this.url).then(({data:s,headers:a})=>{var u,c,d,h,p;if(s.status==="failed")B.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN"}),this.currentStep=4,s.providerMessage?this.warningScreen.setPaymentError(s.providerMessage):this.warningScreen.setPaymentError("Payment failed");else if(["success","successful","failed"].includes(s.status))this.currentStep=5,this.redirectTo(s,a,"success"),B.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN"});else{if(((u=s==null?void 0:s.authorization)==null?void 0:u.mode)==="3DS"){(c=s==null?void 0:s.authorization)!=null&&c.redirectUrl&&this.redirectTo3DS((d=s==null?void 0:s.authorization)==null?void 0:d.redirectUrl);return}if(((h=s==null?void 0:s.authorization)==null?void 0:h.mode)==="otp"){this.cardResponse=s,this.currentStep=3;return}if(((p=s==null?void 0:s.authorization)==null?void 0:p.mode)==="avs"){this.currentStep=7;return}}}).catch(s=>{B.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"PIN"}),this.currentStep=4,s.message?this.warningScreen.setPaymentError(s.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()})},300)}}showLoader(){this.pageLoader=new sn(this.contents),this.pageLoader.mountLoader()}pinErrorStates(t,r,e){const i=this.container.querySelector("#pin-error");i&&(i.innerHTML=t||"Payment Failed"),e&&e.classList.remove("hidden"),r&&(r.innerHTML="")}setPaymentError(t){const r=this.container.querySelector("#payment-warning-text"),e=this.container.querySelector(".warning-list");r&&(r.textContent=t),e&&[{text:"Try again with your card",action:"go-to-card"},{text:"Try again with transfer",action:"go-to-transfer"}].forEach(({action:o,text:s})=>{const a=document.createElement("button");a.textContent=s,a.setAttribute("id",o),a.classList.add("warning-button");const u=document.createElement("div");u.appendChild(a),e.appendChild(u)})}validatedAVS(t,r){t.stopPropagation(),t.preventDefault();const e=this.container.querySelector(".spinner"),i=this.container.querySelector("#avs-form-button-text"),o={authorization:{avs:{state:r==null?void 0:r.state,city:r==null?void 0:r.city,country:r==null?void 0:r.country,address:r==null?void 0:r.address,zipCode:(r==null?void 0:r.code)||"-"}},reference:this.activeRef};B.track("input_address",{payment_method:"Card",authentication_type:"AVS"}),e&&i&&(e.classList.remove("hidden"),i.classList.add("hidden")),Bi(this.token,o,this.rdtCode,this.url).then(({data:a,headers:u})=>{var c,d,h,p,y;if(a.status==="failed")this.currentStep=4,B.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"AVS"}),a.providerMessage?this.warningScreen.setPaymentError(a.providerMessage):this.warningScreen.setPaymentError("Payment failed");else if(["success","successful","failed"].includes(a.status))["success","successful"].includes(a.status)&&(this.currentStep=5,this.redirectTo(a,u,"success"),B.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"AVS"}));else{if(((c=a==null?void 0:a.authorization)==null?void 0:c.mode)==="pin"){this.currentStep=2;return}if(((d=a==null?void 0:a.authorization)==null?void 0:d.mode)==="3DS"){(h=a==null?void 0:a.authorization)!=null&&h.redirectUrl&&this.redirectTo3DS((p=a==null?void 0:a.authorization)==null?void 0:p.redirectUrl),this.currentStep=6;return}if(((y=a==null?void 0:a.authorization)==null?void 0:y.mode)==="otp"){this.cardResponse=a,this.currentStep=3;return}}}).catch(a=>{this.currentStep=4,B.track("verify_payment",{payment_method:"Card",verification_status:"Null",authentication_type:"AVS"}),a.message?this.warningScreen.setPaymentError(a.message):this.warningScreen.setPaymentError("Payment failed"),this.warningScreen.hideReportIssue()}).finally(()=>{e&&i&&(e.classList.add("hidden"),i.classList.remove("hidden"))})}submitOtp(t,r){t.preventDefault();const e={authorization:{otp:r},reference:this.activeRef};this.currentStep=6,this.showLoader(),B.track("input_cardOTP",{payment_method:"Card",authentication_type:"PIN+0TP"}),Bi(this.token,e,this.rdtCode,this.url).then(({data:o,headers:s})=>{var a,u,c,d,h,p;if(o.status==="failed")this.currentStep=4,B.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN+0TP"}),o.providerMessage?this.warningScreen.setPaymentError(o.providerMessage):this.warningScreen.setPaymentError("Payment failed");else if(["success","successful","failed"].includes(o.status))["success","successful"].includes(o.status)&&(this.currentStep=5,this.redirectTo(o,s,"success"),B.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"PIN+0TP"}));else{if(this.activeRef=o.reference,((a=o==null?void 0:o.authorization)==null?void 0:a.mode)==="pin"){this.currentStep=2;return}if(((u=o==null?void 0:o.authorization)==null?void 0:u.mode)==="3DS"){(c=o==null?void 0:o.authorization)!=null&&c.redirectUrl&&this.redirectTo3DS((d=o==null?void 0:o.authorization)==null?void 0:d.redirectUrl);return}if(((h=o==null?void 0:o.authorization)==null?void 0:h.mode)==="otp"){this.cardResponse=o,this.currentStep=3;return}if(((p=o==null?void 0:o.authorization)==null?void 0:p.mode)==="avs"){this.currentStep=7;return}this.currentStep=9}}).catch(o=>{this.currentStep=4,B.track("verify_payment",{payment_method:"Card",verification_status:"Failed",authentication_type:"PIN+0TP"}),o.message?this.warningScreen.setPaymentError(o.message):this.warningScreen.setPaymentError("Payment failed")})}redirectTo3DS(t){const r=window.open(t,"_blank");if(r){B.track("auth_redirect",{payment_method:"Card",authentication_type:"3DS"}),this.currentStep=6,this.showLoader();const e=setInterval(()=>{r.closed&&(clearInterval(e),this.verifyPayment(({data:i,headers:o})=>{this.currentStep=5,B.track("verify_payment",{payment_method:"Card",verification_status:"Success",authentication_type:"3DS"}),this.redirectTo(i,o,"success")},({data:i})=>{this.currentStep=4,i.providerMessage?this.warningScreen.setPaymentError(i.providerMessage):this.warningScreen.setPaymentError("Payment transaction failed"),B.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(t,r){try{const e=await dt(this.token,this.activeRef,void 0,this.rdtCode,this.url);e.data.status==="failed"?r(e):["success","successful"].includes(e.data.status)&&t(e)}catch{this.currentStep=4,B.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 t=await dt(this.token,this.reference,void 0,this.rdtCode,this.url);this.cardResponse=t.data,this.cardResponseHeader=t.headers}catch{this.currentStep=4}}goBackToMerchant(){this.redirectTo(this.cardResponse,this.cardResponseHeader,this.callBackUrl)}renderCardContent(t){var e,i;t&&(this.merchantPlanDetail=t);const r=document.getElementById("go-back");if(this.currentStep!==1?(this.hidePaymentMethods(),r==null||r.classList.add("hidden")):this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.contents){switch(this.currentStep){case 1:this.cardDetailForm=new Ra({container:this.contents,onAction:s=>a=>this.submitCardDetails.bind(this)(s,a),merchantName:this.merchantPlanDetail.merchantName,currency:this.localCurrency?this.localCurrency:this.currency}),this.cardDetailForm.renderContent();break;case 2:this.cardPinForm=new Rh({container:this.contents,onClose:this.onClose,onAction:s=>this.handlePinRequest.bind(this)(s)}),this.cardPinForm.renderComponent();break;case 3:this.cardOtpValidationForm=new Ih({container:this.contents,onClose:this.onClose,onAction:s=>a=>this.submitOtp.bind(this)(s,a),otpMessage:((e=this.cardResponse)==null?void 0:e.providerMessage)||"Please enter your OTP sent to your phone"}),this.cardOtpValidationForm.renderComponent();break;case 4:this.warningScreen=new ht({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 Qt({container:this.contents,amount:this.amount,currency:this.currency,localCurrency:this.localCurrency,rate:(i=this.merchantPlanDetail)==null?void 0:i.rate.rate}),this.successScreen.renderComponent();break;case 6:this.pageLoader=new sn(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 7:this.avsForm=new Bh({container:this.contents,onAction:s=>a=>this.validatedAVS.bind(this)(s,a)}),this.avsForm.renderComponent();break;case 8:this.transactionIssuesScreen=new Gi({container:this.contents,onAction:()=>{var s;this.currentStep=4,this.warningScreen.setPaymentError(((s=this.cardResponse)==null?void 0:s.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 Hd({container:this.contents,onAction:s=>{this.currentStep=s},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;default:this.cardDetailForm=new Ra({container:this.contents,onAction:s=>a=>this.submitCardDetails.bind(this)(s,a),merchantName:this.merchantPlanDetail.merchantName,currency:this.localCurrency?this.localCurrency:this.currency}),this.cardDetailForm.renderContent();break}this.displayButtonText();const o=this.container.querySelector("#card-currency");o&&(o.textContent=`${this.localCurrency?this.localCurrency:this.currency} Card`)}}redirectTo(t,r,e){const i=r.get("spf-redirect-url");this.callBackUrl=i||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const o=new URL(this.callBackUrl);o.searchParams.append("status",t.status),o.searchParams.append("reference",t.reference),window.location.href=o.toString()},1800):e==="success"&&this.onSuccess(t)}displayButtonText(t){var e,i,o,s;const r=this.container.querySelector("#details-form-button-text");if(r){const a=this.currency,u=a==="USD"?(i=(e=this.merchantPlanDetail)==null?void 0:e.rate)==null?void 0:i.from:a;t?r.textContent=t:r.textContent=`Continue to pay ${u} ${ze((this.amount||0)*(a==="USD"?(s=(o=this.merchantPlanDetail)==null?void 0:o.rate)==null?void 0:s.rate:1),2)}`}}}const bg=`<div>\r
827
+ <div class="container-center h-[40vh] hidden" id="loader">\r
828
+ <img src="" alt="loader gif" />\r
829
+ </div>\r
830
+ <div id="details-content" class="grid gap-5">\r
831
+ <h5 class="text-sm text-tone-100 text-center font-semibold md:w-4/5 mx-auto">\r
832
+ Make a single bank transfer from your bank to this account\r
833
+ before it expires.\r
834
+ </h5>\r
835
+ <div class="border border-grey-100 rounded-lg text-black px-6 py-5 grid gap-4">\r
836
+ <div class="text-sm grid grid-cols-[1fr_auto] gap-3">\r
837
+ <div>\r
838
+ <p class="text-sm">Amount</p>\r
839
+ </div>\r
840
+ \r
841
+ <div class="align-center gap-2">\r
842
+ <p class="font-bold transfer-curr-amount" id="transfer-amount"></p>\r
843
+ \r
844
+ <button type="button" class="relative group" id="copy-amount">\r
845
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">\r
846
+ <path\r
847
+ d="M9.33268 7.52502V9.97502C9.33268 12.0167 8.51602 12.8334 6.47435 12.8334H4.02435C1.98268 12.8334 1.16602 12.0167 1.16602 9.97502V7.52502C1.16602 5.48335 1.98268 4.66669 4.02435 4.66669H6.47435C8.51602 4.66669 9.33268 5.48335 9.33268 7.52502Z"\r
848
+ stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />\r
849
+ <path\r
850
+ d="M12.8327 4.02502V6.47502C12.8327 8.51669 12.016 9.33335 9.97435 9.33335H9.33268V7.52502C9.33268 5.48335 8.51602 4.66669 6.47435 4.66669H4.66602V4.02502C4.66602 1.98335 5.48268 1.16669 7.52435 1.16669H9.97435C12.016 1.16669 12.8327 1.98335 12.8327 4.02502Z"\r
851
+ stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />\r
852
+ </svg>\r
853
+ \r
854
+ \r
855
+ <div class="tooltip">\r
856
+ <div class="tooltip-textbox">\r
857
+ <p class="tooltip-text" id="amount-tooltip">Copy</p>\r
858
+ </div>\r
859
+ </div>\r
860
+ </button>\r
861
+ </div>\r
862
+ </div>\r
863
+ \r
864
+ <div class="grid grid-cols-[1fr_auto] gap-3 text-sm">\r
865
+ <div>\r
866
+ <p class="text-sm">Account Number</p>\r
867
+ </div>\r
868
+ \r
869
+ <div class="align-center gap-2">\r
870
+ <p class="font-bold" id="transfer-acn"></p>\r
871
+ \r
872
+ <button type="button" class="relative group" id="copy-acn">\r
873
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">\r
874
+ <path\r
875
+ d="M9.33268 7.52502V9.97502C9.33268 12.0167 8.51602 12.8334 6.47435 12.8334H4.02435C1.98268 12.8334 1.16602 12.0167 1.16602 9.97502V7.52502C1.16602 5.48335 1.98268 4.66669 4.02435 4.66669H6.47435C8.51602 4.66669 9.33268 5.48335 9.33268 7.52502Z"\r
876
+ stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />\r
877
+ <path\r
878
+ d="M12.8327 4.02502V6.47502C12.8327 8.51669 12.016 9.33335 9.97435 9.33335H9.33268V7.52502C9.33268 5.48335 8.51602 4.66669 6.47435 4.66669H4.66602V4.02502C4.66602 1.98335 5.48268 1.16669 7.52435 1.16669H9.97435C12.016 1.16669 12.8327 1.98335 12.8327 4.02502Z"\r
879
+ stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />\r
880
+ </svg>\r
881
+ \r
882
+ \r
883
+ <div class="tooltip">\r
884
+ <div class="tooltip-textbox">\r
885
+ <p class="tooltip-text" id="acn-tooltip">Copy</p>\r
886
+ </div>\r
887
+ </div>\r
888
+ </button>\r
889
+ </div>\r
890
+ </div>\r
891
+ \r
892
+ <div class="grid grid-cols-[1fr_auto] gap-3 text-sm">\r
893
+ <p>Bank name</p>\r
894
+ <p class="font-semibold" id="transfer-bank"></p>\r
895
+ </div>\r
896
+ \r
897
+ \r
898
+ <div class="grid grid-cols-[1fr_auto] gap-3 text-sm">\r
899
+ <p>Beneficiary</p>\r
900
+ <p class="font-semibold" id="account-name"></p>\r
901
+ </div>\r
902
+ </div>\r
903
+ \r
904
+ <div class="mt-3">\r
905
+ <button type="button" id="transfer-button" class="details-form-button">I have made this bank transfer</button>\r
906
+ </div>\r
907
+ \r
908
+ <div class="mt-5">\r
909
+ <div class="w-9/12 mx-auto">\r
910
+ <div class="bg-[#FEF7ED] text-[#816039] text-sm text-center rounded-lg p-2">\r
911
+ This account is for this transaction only and\r
912
+ expires in <span class="font-semibold" id="time-left"></span><span class="font-semibold">s</span>\r
913
+ </div>\r
914
+ </div>\r
915
+ </div>\r
916
+ </div>\r
917
+ </div>`;function gg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ud={exports:{}};/*!
890
918
  * Pusher JavaScript Library v8.4.0
891
919
  * https://pusher.com/
892
920
  *
893
921
  * Copyright 2020, Pusher
894
922
  * Released under the MIT licence.
895
- */(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 r=t[s]={i:s,l:!1,exports:{}};return i[s].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=i,o.c=t,o.d=function(s,r,l){o.o(s,r)||Object.defineProperty(s,r,{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,r){if(r&1&&(s=o(s)),r&8||r&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}),r&2&&typeof s!="string")for(var c in s)o.d(l,c,(function(b){return s[b]}).bind(null,c));return l},o.n=function(s){var r=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(r,"a",r),r},o.o=function(s,r){return Object.prototype.hasOwnProperty.call(s,r)},o.p="",o(o.s=2)}([function(i,t,o){var s=this&&this.__extends||function(){var k=function(S,M){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,_){A.__proto__=_}||function(A,_){for(var E in _)_.hasOwnProperty(E)&&(A[E]=_[E])},k(S,M)};return function(S,M){k(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 r=256,l=function(){function k(S){S===void 0&&(S="="),this._paddingCharacter=S}return k.prototype.encodedLength=function(S){return this._paddingCharacter?(S+2)/3*4|0:(S*8+5)/6|0},k.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 E=S.length-A;if(E>0){var _=S[A]<<16|(E===2?S[A+1]<<8:0);M+=this._encodeByte(_>>>3*6&63),M+=this._encodeByte(_>>>2*6&63),E===2?M+=this._encodeByte(_>>>1*6&63):M+=this._paddingCharacter||"",M+=this._paddingCharacter||""}return M},k.prototype.maxDecodedLength=function(S){return this._paddingCharacter?S/4*3|0:(S*6+7)/8|0},k.prototype.decodedLength=function(S){return this.maxDecodedLength(S.length-this._getPaddingLength(S))},k.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)),E=0,N=0,G=0,z=0,U=0,V=0,oe=0;N<A-4;N+=4)z=this._decodeChar(S.charCodeAt(N+0)),U=this._decodeChar(S.charCodeAt(N+1)),V=this._decodeChar(S.charCodeAt(N+2)),oe=this._decodeChar(S.charCodeAt(N+3)),_[E++]=z<<2|U>>>4,_[E++]=U<<4|V>>>2,_[E++]=V<<6|oe,G|=z&r,G|=U&r,G|=V&r,G|=oe&r;if(N<A-1&&(z=this._decodeChar(S.charCodeAt(N)),U=this._decodeChar(S.charCodeAt(N+1)),_[E++]=z<<2|U>>>4,G|=z&r,G|=U&r),N<A-2&&(V=this._decodeChar(S.charCodeAt(N+2)),_[E++]=U<<4|V>>>2,G|=V&r),N<A-3&&(oe=this._decodeChar(S.charCodeAt(N+3)),_[E++]=V<<6|oe,G|=oe&r),G!==0)throw new Error("Base64Coder: incorrect characters for decoding");return _},k.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)},k.prototype._decodeChar=function(S){var M=r;return M+=(42-S&S-44)>>>8&-r+S-43+62,M+=(46-S&S-48)>>>8&-r+S-47+63,M+=(47-S&S-58)>>>8&-r+S-48+52,M+=(64-S&S-91)>>>8&-r+S-65+0,M+=(96-S&S-123)>>>8&-r+S-97+26,M},k.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},k}();t.Coder=l;var c=new l;function b(k){return c.encode(k)}t.encode=b;function p(k){return c.decode(k)}t.decode=p;var g=function(k){s(S,k);function S(){return k!==null&&k.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=r;return A+=(44-M&M-46)>>>8&-r+M-45+62,A+=(94-M&M-96)>>>8&-r+M-95+63,A+=(47-M&M-58)>>>8&-r+M-48+52,A+=(64-M&M-91)>>>8&-r+M-65+0,A+=(96-M&M-123)>>>8&-r+M-97+26,A},S}(l);t.URLSafeCoder=g;var f=new g;function y(k){return f.encode(k)}t.encodeURLSafe=y;function C(k){return f.decode(k)}t.decodeURLSafe=C,t.encodedLength=function(k){return c.encodedLength(k)},t.maxDecodedLength=function(k){return c.maxDecodedLength(k)},t.decodedLength=function(k){return c.decodedLength(k)}},function(i,t,o){Object.defineProperty(t,"__esModule",{value:!0});var s="utf8: invalid string",r="utf8: invalid source encoding";function l(p){for(var g=new Uint8Array(c(p)),f=0,y=0;y<p.length;y++){var C=p.charCodeAt(y);C<128?g[f++]=C:C<2048?(g[f++]=192|C>>6,g[f++]=128|C&63):C<55296?(g[f++]=224|C>>12,g[f++]=128|C>>6&63,g[f++]=128|C&63):(y++,C=(C&1023)<<10,C|=p.charCodeAt(y)&1023,C+=65536,g[f++]=240|C>>18,g[f++]=128|C>>12&63,g[f++]=128|C>>6&63,g[f++]=128|C&63)}return g}t.encode=l;function c(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=c;function b(p){for(var g=[],f=0;f<p.length;f++){var y=p[f];if(y&128){var C=void 0;if(y<224){if(f>=p.length)throw new Error(r);var k=p[++f];if((k&192)!==128)throw new Error(r);y=(y&31)<<6|k&63,C=128}else if(y<240){if(f>=p.length-1)throw new Error(r);var k=p[++f],S=p[++f];if((k&192)!==128||(S&192)!==128)throw new Error(r);y=(y&15)<<12|(k&63)<<6|S&63,C=2048}else if(y<248){if(f>=p.length-2)throw new Error(r);var k=p[++f],S=p[++f],M=p[++f];if((k&192)!==128||(S&192)!==128||(M&192)!==128)throw new Error(r);y=(y&15)<<18|(k&63)<<12|(S&63)<<6|M&63,C=65536}else throw new Error(r);if(y<C||y>=55296&&y<=57343)throw new Error(r);if(y>=65536){if(y>1114111)throw new Error(r);y-=65536,g.push(String.fromCharCode(55296|y>>10)),y=56320|y&1023}}g.push(String.fromCharCode(y))}return g.join("")}t.decode=b},function(i,t,o){i.exports=o(3).default},function(i,t,o){o.r(t);class s{constructor(a,d){this.lastId=0,this.prefix=a,this.name=d}create(a){this.lastId++;var d=this.lastId,v=this.prefix+d,w=this.name+"["+d+"]",L=!1,T=function(){L||(a.apply(null,arguments),L=!0)};return this[d]=T,{number:d,id:v,name:w,callback:T}}remove(a){delete this[a.number]}}var r=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:""},c=l;class b{constructor(a){this.options=a,this.receivers=a.receivers||r,this.loading={}}load(a,d,v){var w=this;if(w.loading[a]&&w.loading[a].length>0)w.loading[a].push(v);else{w.loading[a]=[v];var L=H.createScriptRequest(w.getPath(a,d)),T=w.receivers.create(function(I){if(w.receivers.remove(T),w.loading[a]){var O=w.loading[a];delete w.loading[a];for(var Z=function(me){me||L.cleanup()},Y=0;Y<O.length;Y++)O[Y](I,Z)}});L.send(T)}}getRoot(a){var d,v=H.getDocument().location.protocol;return a&&a.useTLS||v==="https:"?d=this.options.cdn_https:d=this.options.cdn_http,d.replace(/\/*$/,"")+"/"+this.options.version}getPath(a,d){return this.getRoot(d)+"/"+a+this.options.suffix+".js"}}var p=new s("_pusher_dependencies","Pusher.DependenciesReceivers"),g=new b({cdn_http:c.cdn_http,cdn_https:c.cdn_https,version:c.VERSION,suffix:c.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 C={buildLogSuffix:function(u){const a="See:",d=f.urls[u];if(!d)return"";let v;return d.fullUrl?v=d.fullUrl:d.path&&(v=f.baseUrl+d.path),v?`${a} ${v}`:""}},k;(function(u){u.UserAuthentication="user-authentication",u.ChannelAuthorization="channel-authorization"})(k||(k={}));class S extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class M extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class A extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class _ extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class E extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class N extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class G extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class z extends Error{constructor(a){super(a),Object.setPrototypeOf(this,new.target.prototype)}}class U extends Error{constructor(a,d){super(d),this.status=a,Object.setPrototypeOf(this,new.target.prototype)}}var oe=function(u,a,d,v,w){const L=H.createXHR();L.open("POST",d.endpoint,!0),L.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var T in d.headers)L.setRequestHeader(T,d.headers[T]);if(d.headersProvider!=null){let I=d.headersProvider();for(var T in I)L.setRequestHeader(T,I[T])}return L.onreadystatechange=function(){if(L.readyState===4)if(L.status===200){let I,O=!1;try{I=JSON.parse(L.responseText),O=!0}catch{w(new U(200,`JSON returned from ${v.toString()} endpoint was invalid, yet status code was 200. Data was: ${L.responseText}`),null)}O&&w(null,I)}else{let I="";switch(v){case k.UserAuthentication:I=C.buildLogSuffix("authenticationEndpoint");break;case k.ChannelAuthorization:I=`Clients must be authorized to join private or presence channels. ${C.buildLogSuffix("authorizationEndpoint")}`;break}w(new U(L.status,`Unable to retrieve auth string from ${v.toString()} endpoint - received status: ${L.status} from ${d.endpoint}. ${I}`),null)}},L.send(a),L};function fe(u){return Xe(Te(u))}var K=String.fromCharCode,Me="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ue=function(u){var a=u.charCodeAt(0);return a<128?u:a<2048?K(192|a>>>6)+K(128|a&63):K(224|a>>>12&15)+K(128|a>>>6&63)+K(128|a&63)},Te=function(u){return u.replace(/[^\x00-\x7F]/g,ue)},Ae=function(u){var a=[0,2,1][u.length%3],d=u.charCodeAt(0)<<16|(u.length>1?u.charCodeAt(1):0)<<8|(u.length>2?u.charCodeAt(2):0),v=[Me.charAt(d>>>18),Me.charAt(d>>>12&63),a>=2?"=":Me.charAt(d>>>6&63),a>=1?"=":Me.charAt(d&63)];return v.join("")},Xe=window.btoa||function(u){return u.replace(/[\s\S]{1,3}/g,Ae)};class pn{constructor(a,d,v,w){this.clear=d,this.timer=a(()=>{this.timer&&(this.timer=w(this.timer))},v)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var en=pn;function Sn(u){window.clearTimeout(u)}function bn(u){window.clearInterval(u)}class Ee extends en{constructor(a,d){super(setTimeout,Sn,a,function(v){return d(),null})}}class nn extends en{constructor(a,d){super(setInterval,bn,a,function(v){return d(),v})}}var _n={now(){return Date.now?Date.now():new Date().valueOf()},defer(u){return new Ee(0,u)},method(u,...a){var d=Array.prototype.slice.call(arguments,1);return function(v){return v[u].apply(v,d.concat(arguments))}}},re=_n;function be(u,...a){for(var d=0;d<a.length;d++){var v=a[d];for(var w in v)v[w]&&v[w].constructor&&v[w].constructor===Object?u[w]=be(u[w]||{},v[w]):u[w]=v[w]}return u}function Re(){for(var u=["Pusher"],a=0;a<arguments.length;a++)typeof arguments[a]=="string"?u.push(arguments[a]):u.push(Bi(arguments[a]));return u.join(" : ")}function Pe(u,a){var d=Array.prototype.indexOf;if(u===null)return-1;if(d&&u.indexOf===d)return u.indexOf(a);for(var v=0,w=u.length;v<w;v++)if(u[v]===a)return v;return-1}function Ce(u,a){for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&a(u[d],d,u)}function qe(u){var a=[];return Ce(u,function(d,v){a.push(v)}),a}function B(u){var a=[];return Ce(u,function(d){a.push(d)}),a}function he(u,a,d){for(var v=0;v<u.length;v++)a.call(d||window,u[v],v,u)}function $(u,a){for(var d=[],v=0;v<u.length;v++)d.push(a(u[v],v,u,d));return d}function ge(u,a){var d={};return Ce(u,function(v,w){d[w]=a(v)}),d}function We(u,a){a=a||function(w){return!!w};for(var d=[],v=0;v<u.length;v++)a(u[v],v,u,d)&&d.push(u[v]);return d}function Q(u,a){var d={};return Ce(u,function(v,w){(a&&a(v,w,u,d)||v)&&(d[w]=v)}),d}function ni(u){var a=[];return Ce(u,function(d,v){a.push([v,d])}),a}function $o(u,a){for(var d=0;d<u.length;d++)if(a(u[d],d,u))return!0;return!1}function gl(u,a){for(var d=0;d<u.length;d++)if(!a(u[d],d,u))return!1;return!0}function yl(u){return ge(u,function(a){return typeof a=="object"&&(a=Bi(a)),encodeURIComponent(fe(a.toString()))})}function kl(u){var a=Q(u,function(v){return v!==void 0}),d=$(ni(yl(a)),re.method("join","=")).join("&");return d}function wl(u){var a=[],d=[];return function v(w,L){var T,I,O;switch(typeof w){case"object":if(!w)return null;for(T=0;T<a.length;T+=1)if(a[T]===w)return{$ref:d[T]};if(a.push(w),d.push(L),Object.prototype.toString.apply(w)==="[object Array]")for(O=[],T=0;T<w.length;T+=1)O[T]=v(w[T],L+"["+T+"]");else{O={};for(I in w)Object.prototype.hasOwnProperty.call(w,I)&&(O[I]=v(w[I],L+"["+JSON.stringify(I)+"]"))}return O;case"number":case"string":case"boolean":return w}}(u,"$")}function Bi(u){try{return JSON.stringify(u)}catch{return JSON.stringify(wl(u))}}class Cl{constructor(){this.globalLog=a=>{window.console&&window.console.log&&window.console.log(a)}}debug(...a){this.log(this.globalLog,a)}warn(...a){this.log(this.globalLogWarn,a)}error(...a){this.log(this.globalLogError,a)}globalLogWarn(a){window.console&&window.console.warn?window.console.warn(a):this.globalLog(a)}globalLogError(a){window.console&&window.console.error?window.console.error(a):this.globalLogWarn(a)}log(a,...d){var v=Re.apply(this,arguments);_t.log?_t.log(v):_t.logToConsole&&a.bind(this)(v)}}var se=new Cl,Sl=function(u,a,d,v,w){(d.headers!==void 0||d.headersProvider!=null)&&se.warn(`To send headers with the ${v.toString()} request, you must use AJAX, rather than JSONP.`);var L=u.nextAuthCallbackID.toString();u.nextAuthCallbackID++;var T=u.getDocument(),I=T.createElement("script");u.auth_callbacks[L]=function(Y){w(null,Y)};var O="Pusher.auth_callbacks['"+L+"']";I.src=d.endpoint+"?callback="+encodeURIComponent(O)+"&"+a;var Z=T.getElementsByTagName("head")[0]||T.documentElement;Z.insertBefore(I,Z.firstChild)},_l=Sl;class Ml{constructor(a){this.src=a}send(a){var d=this,v="Error loading "+d.src;d.script=document.createElement("script"),d.script.id=a.id,d.script.src=d.src,d.script.type="text/javascript",d.script.charset="UTF-8",d.script.addEventListener?(d.script.onerror=function(){a.callback(v)},d.script.onload=function(){a.callback(null)}):d.script.onreadystatechange=function(){(d.script.readyState==="loaded"||d.script.readyState==="complete")&&a.callback(null)},d.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(d.errorScript=document.createElement("script"),d.errorScript.id=a.id+"_error",d.errorScript.text=a.name+"('"+v+"');",d.script.async=d.errorScript.async=!1):d.script.async=!0;var w=document.getElementsByTagName("head")[0];w.insertBefore(d.script,w.firstChild),d.errorScript&&w.insertBefore(d.errorScript,d.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 Al{constructor(a,d){this.url=a,this.data=d}send(a){if(!this.request){var d=kl(this.data),v=this.url+"/"+a.number+"?"+d;this.request=H.createScriptRequest(v),this.request.send(a)}}cleanup(){this.request&&this.request.cleanup()}}var xl=function(u,a){return function(d,v){var w="http"+(a?"s":"")+"://",L=w+(u.host||u.options.host)+u.options.path,T=H.createJSONPRequest(L,d),I=H.ScriptReceivers.create(function(O,Z){r.remove(I),T.cleanup(),Z&&Z.host&&(u.host=Z.host),v&&v(O,Z)});T.send(I)}},Ll={name:"jsonp",getAgent:xl},Tl=Ll;function pt(u,a,d){var v=u+(a.useTLS?"s":""),w=a.useTLS?a.hostTLS:a.hostNonTLS;return v+"://"+w+d}function bt(u,a){var d="/app/"+u,v="?protocol="+c.PROTOCOL+"&client=js&version="+c.VERSION+(a?"&"+a:"");return d+v}var El={getInitial:function(u,a){var d=(a.httpPath||"")+bt(u,"flash=false");return pt("ws",a,d)}},Pl={getInitial:function(u,a){var d=(a.httpPath||"/pusher")+bt(u);return pt("http",a,d)}},Nl={getInitial:function(u,a){return pt("http",a,a.httpPath||"/pusher")},getPath:function(u,a){return bt(u)}};class Il{constructor(){this._callbacks={}}get(a){return this._callbacks[vt(a)]}add(a,d,v){var w=vt(a);this._callbacks[w]=this._callbacks[w]||[],this._callbacks[w].push({fn:d,context:v})}remove(a,d,v){if(!a&&!d&&!v){this._callbacks={};return}var w=a?[vt(a)]:qe(this._callbacks);d||v?this.removeCallback(w,d,v):this.removeAllCallbacks(w)}removeCallback(a,d,v){he(a,function(w){this._callbacks[w]=We(this._callbacks[w]||[],function(L){return d&&d!==L.fn||v&&v!==L.context}),this._callbacks[w].length===0&&delete this._callbacks[w]},this)}removeAllCallbacks(a){he(a,function(d){delete this._callbacks[d]},this)}}function vt(u){return"_"+u}class tn{constructor(a){this.callbacks=new Il,this.global_callbacks=[],this.failThrough=a}bind(a,d,v){return this.callbacks.add(a,d,v),this}bind_global(a){return this.global_callbacks.push(a),this}unbind(a,d,v){return this.callbacks.remove(a,d,v),this}unbind_global(a){return a?(this.global_callbacks=We(this.global_callbacks||[],d=>d!==a),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(a,d,v){for(var w=0;w<this.global_callbacks.length;w++)this.global_callbacks[w](a,d);var L=this.callbacks.get(a),T=[];if(v?T.push(d,v):d&&T.push(d),L&&L.length>0)for(var w=0;w<L.length;w++)L[w].fn.apply(L[w].context||window,T);else this.failThrough&&this.failThrough(a,d);return this}}class Bl extends tn{constructor(a,d,v,w,L){super(),this.initialize=H.transportConnectionInitializer,this.hooks=a,this.name=d,this.priority=v,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 a=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(a,this.options)}catch(d){return re.defer(()=>{this.onError(d),this.changeState("closed")}),!1}return this.bindListeners(),se.debug("Connecting",{transport:this.name,url:a}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(a){return this.state==="open"?(re.defer(()=>{this.socket&&this.socket.send(a)}),!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(a){this.emit("error",{type:"WebSocketError",error:a}),this.timeline.error(this.buildTimelineMessage({error:a.toString()}))}onClose(a){a?this.changeState("closed",{code:a.code,reason:a.reason,wasClean:a.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(a){this.emit("message",a)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=a=>{this.onError(a)},this.socket.onclose=a=>{this.onClose(a)},this.socket.onmessage=a=>{this.onMessage(a)},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(a,d){this.state=a,this.timeline.info(this.buildTimelineMessage({state:a,params:d})),this.emit(a,d)}buildTimelineMessage(a){return be({cid:this.id},a)}}class jn{constructor(a){this.hooks=a}isSupported(a){return this.hooks.isSupported(a)}createConnection(a,d,v,w){return new Bl(this.hooks,a,d,v,w)}}var Rl=new jn({urls:El,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!H.getWebSocketAPI()},isSupported:function(){return!!H.getWebSocketAPI()},getSocket:function(u){return H.createWebSocket(u)}}),Yo={urls:Pl,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},Qo=be({getSocket:function(u){return H.HTTPFactory.createStreamingSocket(u)}},Yo),Xo=be({getSocket:function(u){return H.HTTPFactory.createPollingSocket(u)}},Yo),es={isSupported:function(){return H.isXHRSupported()}},Dl=new jn(be({},Qo,es)),Ol=new jn(be({},Xo,es)),Hl={ws:Rl,xhr_streaming:Dl,xhr_polling:Ol},Ri=Hl,Ul=new jn({file:"sockjs",urls:Nl,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(u,a){return new window.SockJS(u,null,{js_path:g.getPath("sockjs",{useTLS:a.useTLS}),ignore_null_origin:a.ignoreNullOrigin})},beforeOpen:function(u,a){u.send(JSON.stringify({path:a}))}}),ns={isSupported:function(u){var a=H.isXDRSupported(u.useTLS);return a}},Kl=new jn(be({},Qo,ns)),jl=new jn(be({},Xo,ns));Ri.xdr_streaming=Kl,Ri.xdr_polling=jl,Ri.sockjs=Ul;var Vl=Ri;class Gl extends tn{constructor(){super();var a=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){a.emit("online")},!1),window.addEventListener("offline",function(){a.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var zl=new Gl;class Fl{constructor(a,d,v){this.manager=a,this.transport=d,this.minPingDelay=v.minPingDelay,this.maxPingDelay=v.maxPingDelay,this.pingDelay=void 0}createConnection(a,d,v,w){w=be({},w,{activityTimeout:this.pingDelay});var L=this.transport.createConnection(a,d,v,w),T=null,I=function(){L.unbind("open",I),L.bind("closed",O),T=re.now()},O=Z=>{if(L.unbind("closed",O),Z.code===1002||Z.code===1003)this.manager.reportDeath();else if(!Z.wasClean&&T){var Y=re.now()-T;Y<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(Y/2,this.minPingDelay))}};return L.bind("open",I),L}isSupported(a){return this.manager.isAlive()&&this.transport.isSupported(a)}}const is={decodeMessage:function(u){try{var a=JSON.parse(u.data),d=a.data;if(typeof d=="string")try{d=JSON.parse(a.data)}catch{}var v={event:a.event,channel:a.channel,data:d};return a.user_id&&(v.user_id=a.user_id),v}catch(w){throw{type:"MessageParseError",error:w,data:u.data}}},encodeMessage:function(u){return JSON.stringify(u)},processHandshake:function(u){var a=is.decodeMessage(u);if(a.event==="pusher:connection_established"){if(!a.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:a.data.socket_id,activityTimeout:a.data.activity_timeout*1e3}}else{if(a.event==="pusher:error")return{action:this.getCloseAction(a.data),error:this.getCloseError(a.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 Mn=is;class ql extends tn{constructor(a,d){super(),this.id=a,this.transport=d,this.activityTimeout=d.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(a){return this.transport.send(a)}send_event(a,d,v){var w={event:a,data:d};return v&&(w.channel=v),se.debug("Event sent",w),this.send(Mn.encodeMessage(w))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var a={message:v=>{var w;try{w=Mn.decodeMessage(v)}catch(L){this.emit("error",{type:"MessageParseError",error:L,data:v.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:v=>{this.emit("error",v)},closed:v=>{d(),v&&v.code&&this.handleCloseEvent(v),this.transport=null,this.emit("closed")}},d=()=>{Ce(a,(v,w)=>{this.transport.unbind(w,v)})};Ce(a,(v,w)=>{this.transport.bind(w,v)})}handleCloseEvent(a){var d=Mn.getCloseAction(a),v=Mn.getCloseError(a);v&&this.emit("error",v),d&&this.emit(d,{action:d,error:v})}}class Wl{constructor(a,d){this.transport=a,this.callback=d,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=a=>{this.unbindListeners();var d;try{d=Mn.processHandshake(a)}catch(v){this.finish("error",{error:v}),this.transport.close();return}d.action==="connected"?this.finish("connected",{connection:new ql(d.id,this.transport),activityTimeout:d.activityTimeout}):(this.finish(d.action,{error:d.error}),this.transport.close())},this.onClosed=a=>{this.unbindListeners();var d=Mn.getCloseAction(a)||"backoff",v=Mn.getCloseError(a);this.finish(d,{error:v})},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(a,d){this.callback(be({transport:this.transport,action:a},d))}}class Zl{constructor(a,d){this.timeline=a,this.options=d||{}}send(a,d){this.timeline.isEmpty()||this.timeline.send(H.TimelineTransport.getAgent(this,a),d)}}class ft extends tn{constructor(a,d){super(function(v,w){se.debug("No callbacks on "+a+" for "+v)}),this.name=a,this.pusher=d,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(a,d){return d(null,{auth:""})}trigger(a,d){if(a.indexOf("client-")!==0)throw new S("Event '"+a+"' does not start with 'client-'");if(!this.subscribed){var v=C.buildLogSuffix("triggeringClientEvents");se.warn(`Client event triggered before channel 'subscription_succeeded' event . ${v}`)}return this.pusher.send_event(a,d,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(a){var d=a.event,v=a.data;if(d==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(a);else if(d==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(a);else if(d.indexOf("pusher_internal:")!==0){var w={};this.emit(d,v,w)}}handleSubscriptionSucceededEvent(a){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",a.data)}handleSubscriptionCountEvent(a){a.data.subscription_count&&(this.subscriptionCount=a.data.subscription_count),this.emit("pusher:subscription_count",a.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(a,d)=>{a?(this.subscriptionPending=!1,se.error(a.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:a.message},a instanceof U?{status:a.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:d.auth,channel_data:d.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 gt extends ft{authorize(a,d){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:a},d)}}class Jl{constructor(){this.reset()}get(a){return Object.prototype.hasOwnProperty.call(this.members,a)?{id:a,info:this.members[a]}:null}each(a){Ce(this.members,(d,v)=>{a(this.get(v))})}setMyID(a){this.myID=a}onSubscription(a){this.members=a.presence.hash,this.count=a.presence.count,this.me=this.get(this.myID)}addMember(a){return this.get(a.user_id)===null&&this.count++,this.members[a.user_id]=a.user_info,this.get(a.user_id)}removeMember(a){var d=this.get(a.user_id);return d&&(delete this.members[a.user_id],this.count--),d}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var $l=function(u,a,d,v){function w(L){return L instanceof d?L:new d(function(T){T(L)})}return new(d||(d=Promise))(function(L,T){function I(Y){try{Z(v.next(Y))}catch(me){T(me)}}function O(Y){try{Z(v.throw(Y))}catch(me){T(me)}}function Z(Y){Y.done?L(Y.value):w(Y.value).then(I,O)}Z((v=v.apply(u,a||[])).next())})};class Yl extends gt{constructor(a,d){super(a,d),this.members=new Jl}authorize(a,d){super.authorize(a,(v,w)=>$l(this,void 0,void 0,function*(){if(!v)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 T=C.buildLogSuffix("authorizationEndpoint");se.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${T}, or the user should be signed in.`),d("Invalid auth response");return}d(v,w)}))}handleEvent(a){var d=a.event;if(d.indexOf("pusher_internal:")===0)this.handleInternalEvent(a);else{var v=a.data,w={};a.user_id&&(w.user_id=a.user_id),this.emit(d,v,w)}}handleInternalEvent(a){var d=a.event,v=a.data;switch(d){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(a);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(a);break;case"pusher_internal:member_added":var w=this.members.addMember(v);this.emit("pusher:member_added",w);break;case"pusher_internal:member_removed":var L=this.members.removeMember(v);L&&this.emit("pusher:member_removed",L);break}}handleSubscriptionSucceededEvent(a){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(a.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var Ql=o(1),yt=o(0);class Xl extends gt{constructor(a,d,v){super(a,d),this.key=null,this.nacl=v}authorize(a,d){super.authorize(a,(v,w)=>{if(v){d(v,w);return}let L=w.shared_secret;if(!L){d(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(yt.decode)(L),delete w.shared_secret,d(null,w)})}trigger(a,d){throw new N("Client events are not currently supported for encrypted channels")}handleEvent(a){var d=a.event,v=a.data;if(d.indexOf("pusher_internal:")===0||d.indexOf("pusher:")===0){super.handleEvent(a);return}this.handleEncryptedEvent(d,v)}handleEncryptedEvent(a,d){if(!this.key){se.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!d.ciphertext||!d.nonce){se.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+d);return}let v=Object(yt.decode)(d.ciphertext);if(v.length<this.nacl.secretbox.overheadLength){se.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${v.length}`);return}let w=Object(yt.decode)(d.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(v,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,(T,I)=>{if(T){se.error(`Failed to make a request to the authEndpoint: ${I}. Unable to fetch new key, so dropping encrypted event`);return}if(L=this.nacl.secretbox.open(v,w,this.key),L===null){se.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(a,this.getDataToEmit(L))});return}this.emit(a,this.getDataToEmit(L))}getDataToEmit(a){let d=Object(Ql.decode)(a);try{return JSON.parse(d)}catch{return d}}}class ed extends tn{constructor(a,d){super(),this.state="initialized",this.connection=null,this.key=a,this.options=d,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 v=H.getNetwork();v.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),v.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(a){return this.connection?this.connection.send(a):!1}send_event(a,d,v){return this.connection?this.connection.send_event(a,d,v):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var a=(d,v)=>{d?this.runner=this.strategy.connect(0,a):v.action==="error"?(this.emit("error",{type:"HandshakeError",error:v.error}),this.timeline.error({handshakeError:v.error})):(this.abortConnecting(),this.handshakeCallbacks[v.action](v))};this.runner=this.strategy.connect(0,a)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var a=this.abandonConnection();a.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(a){this.timeline.info({action:"retry",delay:a}),a>0&&this.emit("connecting_in",Math.round(a/1e3)),this.retryTimer=new Ee(a||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(a){return be({},a,{message:d=>{this.resetActivityCheck(),this.emit("message",d)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:d=>{this.emit("error",d)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(a){return be({},a,{connected:d=>{this.activityTimeout=Math.min(this.options.activityTimeout,d.activityTimeout,d.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(d.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let a=d=>v=>{v.error&&this.emit("error",{type:"WebSocketError",error:v.error}),d(v)};return{tls_only:a(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:a(()=>{this.disconnect()}),backoff:a(()=>{this.retryIn(1e3)}),retry:a(()=>{this.retryIn(0)})}}setConnection(a){this.connection=a;for(var d in this.connectionCallbacks)this.connection.bind(d,this.connectionCallbacks[d]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var a in this.connectionCallbacks)this.connection.unbind(a,this.connectionCallbacks[a]);var d=this.connection;return this.connection=null,d}}updateState(a,d){var v=this.state;if(this.state=a,v!==a){var w=a;w==="connected"&&(w+=" with new socket ID "+d.socket_id),se.debug("State changed",v+" -> "+w),this.timeline.info({state:a,params:d}),this.emit("state_change",{previous:v,current:a}),this.emit(a,d)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class nd{constructor(){this.channels={}}add(a,d){return this.channels[a]||(this.channels[a]=id(a,d)),this.channels[a]}all(){return B(this.channels)}find(a){return this.channels[a]}remove(a){var d=this.channels[a];return delete this.channels[a],d}disconnect(){Ce(this.channels,function(a){a.disconnect()})}}function id(u,a){if(u.indexOf("private-encrypted-")===0){if(a.config.nacl)return on.createEncryptedChannel(u,a,a.config.nacl);let d="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",v=C.buildLogSuffix("encryptedChannelSupport");throw new N(`${d}. ${v}`)}else{if(u.indexOf("private-")===0)return on.createPrivateChannel(u,a);if(u.indexOf("presence-")===0)return on.createPresenceChannel(u,a);if(u.indexOf("#")===0)throw new M('Cannot create a channel with name "'+u+'".');return on.createChannel(u,a)}}var td={createChannels(){return new nd},createConnectionManager(u,a){return new ed(u,a)},createChannel(u,a){return new ft(u,a)},createPrivateChannel(u,a){return new gt(u,a)},createPresenceChannel(u,a){return new Yl(u,a)},createEncryptedChannel(u,a,d){return new Xl(u,a,d)},createTimelineSender(u,a){return new Zl(u,a)},createHandshake(u,a){return new Wl(u,a)},createAssistantToTheTransportManager(u,a,d){return new Fl(u,a,d)}},on=td;class ts{constructor(a){this.options=a||{},this.livesLeft=this.options.lives||1/0}getAssistant(a){return on.createAssistantToTheTransportManager(this,a,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class An{constructor(a,d){this.strategies=a,this.loop=!!d.loop,this.failFast=!!d.failFast,this.timeout=d.timeout,this.timeoutLimit=d.timeoutLimit}isSupported(){return $o(this.strategies,re.method("isSupported"))}connect(a,d){var v=this.strategies,w=0,L=this.timeout,T=null,I=(O,Z)=>{Z?d(null,Z):(w=w+1,this.loop&&(w=w%v.length),w<v.length?(L&&(L=L*2,this.timeoutLimit&&(L=Math.min(L,this.timeoutLimit))),T=this.tryStrategy(v[w],a,{timeout:L,failFast:this.failFast},I)):d(!0))};return T=this.tryStrategy(v[w],a,{timeout:L,failFast:this.failFast},I),{abort:function(){T.abort()},forceMinPriority:function(O){a=O,T&&T.forceMinPriority(O)}}}tryStrategy(a,d,v,w){var L=null,T=null;return v.timeout>0&&(L=new Ee(v.timeout,function(){T.abort(),w(!0)})),T=a.connect(d,function(I,O){I&&L&&L.isRunning()&&!v.failFast||(L&&L.ensureAborted(),w(I,O))}),{abort:function(){L&&L.ensureAborted(),T.abort()},forceMinPriority:function(I){T.forceMinPriority(I)}}}}class kt{constructor(a){this.strategies=a}isSupported(){return $o(this.strategies,re.method("isSupported"))}connect(a,d){return od(this.strategies,a,function(v,w){return function(L,T){if(w[v].error=L,L){sd(w)&&d(!0);return}he(w,function(I){I.forceMinPriority(T.transport.priority)}),d(null,T)}})}}function od(u,a,d){var v=$(u,function(w,L,T,I){return w.connect(a,d(L,I))});return{abort:function(){he(v,ad)},forceMinPriority:function(w){he(v,function(L){L.forceMinPriority(w)})}}}function sd(u){return gl(u,function(a){return!!a.error})}function ad(u){!u.error&&!u.aborted&&(u.abort(),u.aborted=!0)}class rd{constructor(a,d,v){this.strategy=a,this.transports=d,this.ttl=v.ttl||1800*1e3,this.usingTLS=v.useTLS,this.timeline=v.timeline}isSupported(){return this.strategy.isSupported()}connect(a,d){var v=this.usingTLS,w=ld(v),L=w&&w.cacheSkipCount?w.cacheSkipCount:0,T=[this.strategy];if(w&&w.timestamp+this.ttl>=re.now()){var I=this.transports[w.transport];I&&(["ws","wss"].includes(w.transport)||L>3?(this.timeline.info({cached:!0,transport:w.transport,latency:w.latency}),T.push(new An([I],{timeout:w.latency*2+1e3,failFast:!0}))):L++)}var O=re.now(),Z=T.pop().connect(a,function Y(me,Hi){me?(os(v),T.length>0?(O=re.now(),Z=T.pop().connect(a,Y)):d(me)):(dd(v,Hi.transport.name,re.now()-O,L),d(null,Hi))});return{abort:function(){Z.abort()},forceMinPriority:function(Y){a=Y,Z&&Z.forceMinPriority(Y)}}}}function wt(u){return"pusherTransport"+(u?"TLS":"NonTLS")}function ld(u){var a=H.getLocalStorage();if(a)try{var d=a[wt(u)];if(d)return JSON.parse(d)}catch{os(u)}return null}function dd(u,a,d,v){var w=H.getLocalStorage();if(w)try{w[wt(u)]=Bi({timestamp:re.now(),transport:a,latency:d,cacheSkipCount:v})}catch{}}function os(u){var a=H.getLocalStorage();if(a)try{delete a[wt(u)]}catch{}}class Di{constructor(a,{delay:d}){this.strategy=a,this.options={delay:d}}isSupported(){return this.strategy.isSupported()}connect(a,d){var v=this.strategy,w,L=new Ee(this.options.delay,function(){w=v.connect(a,d)});return{abort:function(){L.ensureAborted(),w&&w.abort()},forceMinPriority:function(T){a=T,w&&w.forceMinPriority(T)}}}}class ii{constructor(a,d,v){this.test=a,this.trueBranch=d,this.falseBranch=v}isSupported(){var a=this.test()?this.trueBranch:this.falseBranch;return a.isSupported()}connect(a,d){var v=this.test()?this.trueBranch:this.falseBranch;return v.connect(a,d)}}class cd{constructor(a){this.strategy=a}isSupported(){return this.strategy.isSupported()}connect(a,d){var v=this.strategy.connect(a,function(w,L){L&&v.abort(),d(w,L)});return v}}function ti(u){return function(){return u.isSupported()}}var ud=function(u,a,d){var v={};function w(bs,cc,uc,hc,mc){var vs=d(u,bs,cc,uc,hc,mc);return v[bs]=vs,vs}var L=Object.assign({},a,{hostNonTLS:u.wsHost+":"+u.wsPort,hostTLS:u.wsHost+":"+u.wssPort,httpPath:u.wsPath}),T=Object.assign({},L,{useTLS:!0}),I=Object.assign({},a,{hostNonTLS:u.httpHost+":"+u.httpPort,hostTLS:u.httpHost+":"+u.httpsPort,httpPath:u.httpPath}),O={loop:!0,timeout:15e3,timeoutLimit:6e4},Z=new ts({minPingDelay:1e4,maxPingDelay:u.activityTimeout}),Y=new ts({lives:2,minPingDelay:1e4,maxPingDelay:u.activityTimeout}),me=w("ws","ws",3,L,Z),Hi=w("wss","ws",3,T,Z),sc=w("sockjs","sockjs",1,I),ds=w("xhr_streaming","xhr_streaming",1,I,Y),ac=w("xdr_streaming","xdr_streaming",1,I,Y),cs=w("xhr_polling","xhr_polling",1,I),rc=w("xdr_polling","xdr_polling",1,I),us=new An([me],O),lc=new An([Hi],O),dc=new An([sc],O),hs=new An([new ii(ti(ds),ds,ac)],O),ms=new An([new ii(ti(cs),cs,rc)],O),ps=new An([new ii(ti(hs),new kt([hs,new Di(ms,{delay:4e3})]),ms)],O),Mt=new ii(ti(ps),ps,dc),At;return a.useTLS?At=new kt([us,new Di(Mt,{delay:2e3})]):At=new kt([us,new Di(lc,{delay:2e3}),new Di(Mt,{delay:5e3})]),new rd(new cd(new ii(ti(me),At,Mt)),v,{ttl:18e5,timeline:a.timeline,useTLS:a.useTLS})},hd=ud,md=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(a,d){u.hooks.isInitialized()?(u.changeState("initialized"),d(!0)):(a&&u.onError(a),u.onClose(),d(!1))})):u.onClose()},pd={getRequest:function(u){var a=new window.XDomainRequest;return a.ontimeout=function(){u.emit("error",new A),u.close()},a.onerror=function(d){u.emit("error",d),u.close()},a.onprogress=function(){a.responseText&&a.responseText.length>0&&u.onChunk(200,a.responseText)},a.onload=function(){a.responseText&&a.responseText.length>0&&u.onChunk(200,a.responseText),u.emit("finished",200),u.close()},a},abortRequest:function(u){u.ontimeout=u.onerror=u.onprogress=u.onload=null,u.abort()}},bd=pd;const vd=256*1024;class fd extends tn{constructor(a,d,v){super(),this.hooks=a,this.method=d,this.url=v}start(a){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},H.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(a)}close(){this.unloader&&(H.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(a,d){for(;;){var v=this.advanceBuffer(d);if(v)this.emit("chunk",{status:a,data:v});else break}this.isBufferTooLong(d)&&this.emit("buffer_too_long")}advanceBuffer(a){var d=a.slice(this.position),v=d.indexOf(`
896
- `);return v!==-1?(this.position+=v+1,d.slice(0,v)):null}isBufferTooLong(a){return this.position===a.length&&a.length>vd}}var Ct;(function(u){u[u.CONNECTING=0]="CONNECTING",u[u.OPEN=1]="OPEN",u[u.CLOSED=3]="CLOSED"})(Ct||(Ct={}));var xn=Ct,gd=1;class yd{constructor(a,d){this.hooks=a,this.session=as(1e3)+"/"+Sd(8),this.location=kd(d),this.readyState=xn.CONNECTING,this.openStream()}send(a){return this.sendRaw(JSON.stringify([a]))}ping(){this.hooks.sendHeartbeat(this)}close(a,d){this.onClose(a,d,!0)}sendRaw(a){if(this.readyState===xn.OPEN)try{return H.createSocketRequest("POST",ss(wd(this.location,this.session))).start(a),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(a,d,v){this.closeStream(),this.readyState=xn.CLOSED,this.onclose&&this.onclose({code:a,reason:d,wasClean:v})}onChunk(a){if(a.status===200){this.readyState===xn.OPEN&&this.onActivity();var d,v=a.data.slice(0,1);switch(v){case"o":d=JSON.parse(a.data.slice(1)||"{}"),this.onOpen(d);break;case"a":d=JSON.parse(a.data.slice(1)||"[]");for(var w=0;w<d.length;w++)this.onEvent(d[w]);break;case"m":d=JSON.parse(a.data.slice(1)||"null"),this.onEvent(d);break;case"h":this.hooks.onHeartbeat(this);break;case"c":d=JSON.parse(a.data.slice(1)||"[]"),this.onClose(d[0],d[1],!0);break}}}onOpen(a){this.readyState===xn.CONNECTING?(a&&a.hostname&&(this.location.base=Cd(this.location.base,a.hostname)),this.readyState=xn.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(a){this.readyState===xn.OPEN&&this.onmessage&&this.onmessage({data:a})}onActivity(){this.onactivity&&this.onactivity()}onError(a){this.onerror&&this.onerror(a)}openStream(){this.stream=H.createSocketRequest("POST",ss(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",a=>{this.onChunk(a)}),this.stream.bind("finished",a=>{this.hooks.onFinished(this,a)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(a){re.defer(()=>{this.onError(a),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function kd(u){var a=/([^\?]*)\/*(\??.*)/.exec(u);return{base:a[1],queryString:a[2]}}function wd(u,a){return u.base+"/"+a+"/xhr_send"}function ss(u){var a=u.indexOf("?")===-1?"?":"&";return u+a+"t="+ +new Date+"&n="+gd++}function Cd(u,a){var d=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(u);return d[1]+a+d[3]}function as(u){return H.randomInt(u)}function Sd(u){for(var a=[],d=0;d<u;d++)a.push(as(32).toString(32));return a.join("")}var _d=yd,Md={getReceiveURL:function(u,a){return u.base+"/"+a+"/xhr_streaming"+u.queryString},onHeartbeat:function(u){u.sendRaw("[]")},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,a){u.onClose(1006,"Connection interrupted ("+a+")",!1)}},Ad=Md,xd={getReceiveURL:function(u,a){return u.base+"/"+a+"/xhr"+u.queryString},onHeartbeat:function(){},sendHeartbeat:function(u){u.sendRaw("[]")},onFinished:function(u,a){a===200?u.reconnect():u.onClose(1006,"Connection interrupted ("+a+")",!1)}},Ld=xd,Td={getRequest:function(u){var a=H.getXHRAPI(),d=new a;return d.onreadystatechange=d.onprogress=function(){switch(d.readyState){case 3:d.responseText&&d.responseText.length>0&&u.onChunk(d.status,d.responseText);break;case 4:d.responseText&&d.responseText.length>0&&u.onChunk(d.status,d.responseText),u.emit("finished",d.status),u.close();break}},d},abortRequest:function(u){u.onreadystatechange=null,u.abort()}},Ed=Td,Pd={createStreamingSocket(u){return this.createSocket(Ad,u)},createPollingSocket(u){return this.createSocket(Ld,u)},createSocket(u,a){return new _d(u,a)},createXHR(u,a){return this.createRequest(Ed,u,a)},createRequest(u,a,d){return new fd(u,a,d)}},rs=Pd;rs.createXDR=function(u,a){return this.createRequest(bd,u,a)};var Nd=rs,Id={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:r,DependenciesReceivers:p,getDefaultStrategy:hd,Transports:Vl,transportConnectionInitializer:md,HTTPFactory:Nd,TimelineTransport:Tl,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(u){window.Pusher=u;var a=()=>{this.onDocumentBody(u.ready)};window.JSON?a():g.load("json2",{},a)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:oe,jsonp:_l}},onDocumentBody(u){document.body?u():setTimeout(()=>{this.onDocumentBody(u)},0)},createJSONPRequest(u,a){return new Al(u,a)},createScriptRequest(u){return new Ml(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 zl},createWebSocket(u){var a=this.getWebSocketAPI();return new a(u)},createSocketRequest(u,a){if(this.isXHRSupported())return this.HTTPFactory.createXHR(u,a);if(this.isXDRSupported(a.indexOf("https:")===0))return this.HTTPFactory.createXDR(u,a);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var u=this.getXHRAPI();return!!u&&new u().withCredentials!==void 0},isXDRSupported(u){var a=u?"https:":"http:",d=this.getProtocol();return!!window.XDomainRequest&&d===a},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)}},H=Id,St;(function(u){u[u.ERROR=3]="ERROR",u[u.INFO=6]="INFO",u[u.DEBUG=7]="DEBUG"})(St||(St={}));var Oi=St;class Bd{constructor(a,d,v){this.key=a,this.session=d,this.events=[],this.options=v||{},this.sent=0,this.uniqueID=0}log(a,d){a<=this.options.level&&(this.events.push(be({},d,{timestamp:re.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(a){this.log(Oi.ERROR,a)}info(a){this.log(Oi.INFO,a)}debug(a){this.log(Oi.DEBUG,a)}isEmpty(){return this.events.length===0}send(a,d){var v=be({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=[],a(v,(w,L)=>{w||this.sent++,d&&d(w,L)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class Rd{constructor(a,d,v,w){this.name=a,this.priority=d,this.transport=v,this.options=w||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(a,d){if(this.isSupported()){if(this.priority<a)return ls(new _,d)}else return ls(new z,d);var v=!1,w=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),L=null,T=function(){w.unbind("initialized",T),w.connect()},I=function(){L=on.createHandshake(w,function(me){v=!0,Y(),d(null,me)})},O=function(me){Y(),d(me)},Z=function(){Y();var me;me=Bi(w),d(new E(me))},Y=function(){w.unbind("initialized",T),w.unbind("open",I),w.unbind("error",O),w.unbind("closed",Z)};return w.bind("initialized",T),w.bind("open",I),w.bind("error",O),w.bind("closed",Z),w.initialize(),{abort:()=>{v||(Y(),L?L.close():w.close())},forceMinPriority:me=>{v||this.priority<me&&(L?L.close():w.close())}}}}function ls(u,a){return re.defer(function(){a(u)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:Dd}=H;var Od=function(u,a,d,v,w,L){var T=Dd[d];if(!T)throw new G(d);var I=(!u.enabledTransports||Pe(u.enabledTransports,a)!==-1)&&(!u.disabledTransports||Pe(u.disabledTransports,a)===-1),O;return I?(w=Object.assign({ignoreNullOrigin:u.ignoreNullOrigin},w),O=new Rd(a,v,L?L.getAssistant(T):T,w)):O=Hd,O},Hd={isSupported:function(){return!1},connect:function(u,a){var d=re.defer(function(){a(new z)});return{abort:function(){d.ensureAborted()},forceMinPriority:function(){}}}};function Ud(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 Kd=(u,a)=>{var d="socket_id="+encodeURIComponent(u.socketId);for(var v in a.params)d+="&"+encodeURIComponent(v)+"="+encodeURIComponent(a.params[v]);if(a.paramsProvider!=null){let w=a.paramsProvider();for(var v in w)d+="&"+encodeURIComponent(v)+"="+encodeURIComponent(w[v])}return d};var jd=u=>{if(typeof H.getAuthorizers()[u.transport]>"u")throw`'${u.transport}' is not a recognized auth transport`;return(a,d)=>{const v=Kd(a,u);H.getAuthorizers()[u.transport](H,v,u,k.UserAuthentication,d)}};const Vd=(u,a)=>{var d="socket_id="+encodeURIComponent(u.socketId);d+="&channel_name="+encodeURIComponent(u.channelName);for(var v in a.params)d+="&"+encodeURIComponent(v)+"="+encodeURIComponent(a.params[v]);if(a.paramsProvider!=null){let w=a.paramsProvider();for(var v in w)d+="&"+encodeURIComponent(v)+"="+encodeURIComponent(w[v])}return d};var Gd=u=>{if(typeof H.getAuthorizers()[u.transport]>"u")throw`'${u.transport}' is not a recognized auth transport`;return(a,d)=>{const v=Vd(a,u);H.getAuthorizers()[u.transport](H,v,u,k.ChannelAuthorization,d)}};const zd=(u,a,d)=>{const v={authTransport:a.transport,authEndpoint:a.endpoint,auth:{params:a.params,headers:a.headers}};return(w,L)=>{const T=u.channel(w.channelName);d(T,v).authorize(w.socketId,L)}};function Fd(u,a){let d={activityTimeout:u.activityTimeout||c.activityTimeout,cluster:u.cluster,httpPath:u.httpPath||c.httpPath,httpPort:u.httpPort||c.httpPort,httpsPort:u.httpsPort||c.httpsPort,pongTimeout:u.pongTimeout||c.pongTimeout,statsHost:u.statsHost||c.stats_host,unavailableTimeout:u.unavailableTimeout||c.unavailableTimeout,wsPath:u.wsPath||c.wsPath,wsPort:u.wsPort||c.wsPort,wssPort:u.wssPort||c.wssPort,enableStats:$d(u),httpHost:qd(u),useTLS:Jd(u),wsHost:Wd(u),userAuthenticator:Yd(u),channelAuthorizer:Xd(u,a)};return"disabledTransports"in u&&(d.disabledTransports=u.disabledTransports),"enabledTransports"in u&&(d.enabledTransports=u.enabledTransports),"ignoreNullOrigin"in u&&(d.ignoreNullOrigin=u.ignoreNullOrigin),"timelineParams"in u&&(d.timelineParams=u.timelineParams),"nacl"in u&&(d.nacl=u.nacl),d}function qd(u){return u.httpHost?u.httpHost:u.cluster?`sockjs-${u.cluster}.pusher.com`:c.httpHost}function Wd(u){return u.wsHost?u.wsHost:Zd(u.cluster)}function Zd(u){return`ws-${u}.pusher.com`}function Jd(u){return H.getProtocol()==="https:"?!0:u.forceTLS!==!1}function $d(u){return"enableStats"in u?u.enableStats:"disableStats"in u?!u.disableStats:!1}function Yd(u){const a=Object.assign(Object.assign({},c.userAuthentication),u.userAuthentication);return"customHandler"in a&&a.customHandler!=null?a.customHandler:jd(a)}function Qd(u,a){let d;return"channelAuthorization"in u?d=Object.assign(Object.assign({},c.channelAuthorization),u.channelAuthorization):(d={transport:u.authTransport||c.authTransport,endpoint:u.authEndpoint||c.authEndpoint},"auth"in u&&("params"in u.auth&&(d.params=u.auth.params),"headers"in u.auth&&(d.headers=u.auth.headers)),"authorizer"in u&&(d.customHandler=zd(a,d,u.authorizer))),d}function Xd(u,a){const d=Qd(u,a);return"customHandler"in d&&d.customHandler!=null?d.customHandler:Gd(d)}class ec extends tn{constructor(a){super(function(d,v){se.debug(`No callbacks on watchlist events for ${d}`)}),this.pusher=a,this.bindWatchlistInternalEvent()}handleEvent(a){a.data.events.forEach(d=>{this.emit(d.name,d)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",a=>{var d=a.event;d==="pusher_internal:watchlist_events"&&this.handleEvent(a)})}}function nc(){let u,a;return{promise:new Promise((v,w)=>{u=v,a=w}),resolve:u,reject:a}}var ic=nc;class tc extends tn{constructor(a){super(function(d,v){se.debug("No callbacks on user for "+d)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(d,v)=>{if(d){se.warn(`Error during signin: ${d}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:v.auth,user_data:v.user_data})},this.pusher=a,this.pusher.connection.bind("state_change",({previous:d,current:v})=>{d!=="connected"&&v==="connected"&&this._signin(),d==="connected"&&v!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new ec(a),this.pusher.connection.bind("message",d=>{var v=d.event;v==="pusher:signin_success"&&this._onSigninSuccess(d.data),this.serverToUserChannel&&this.serverToUserChannel.name===d.channel&&this.serverToUserChannel.handleEvent(d)})}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(a){try{this.user_data=JSON.parse(a.user_data)}catch{se.error(`Failed parsing user data after signin: ${a.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 a=d=>{d.subscriptionPending&&d.subscriptionCancelled?d.reinstateSubscription():!d.subscriptionPending&&this.pusher.connection.state==="connected"&&d.subscribe()};this.serverToUserChannel=new ft(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((d,v)=>{d.indexOf("pusher_internal:")===0||d.indexOf("pusher:")===0||this.emit(d,v)}),a(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:a,resolve:d,reject:v}=ic();a.done=!1;const w=()=>{a.done=!0};a.then(w).catch(w),this.signinDonePromise=a,this._signinDoneResolve=d}}class ye{static ready(){ye.isReady=!0;for(var a=0,d=ye.instances.length;a<d;a++)ye.instances[a].connect()}static getClientFeatures(){return qe(Q({ws:H.Transports.ws},function(a){return a.isSupported({})}))}constructor(a,d){oc(a),Ud(d),this.key=a,this.config=Fd(d,this),this.channels=on.createChannels(),this.global_emitter=new tn,this.sessionID=H.randomInt(1e9),this.timeline=new Bd(this.key,this.sessionID,{cluster:this.config.cluster,features:ye.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:Oi.INFO,version:c.VERSION}),this.config.enableStats&&(this.timelineSender=on.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+H.TimelineTransport.name}));var v=w=>H.getDefaultStrategy(this.config,w,Od);this.connection=on.createConnectionManager(this.key,{getStrategy:v,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,T=L.indexOf("pusher_internal:")===0;if(w.channel){var I=this.channel(w.channel);I&&I.handleEvent(w)}T||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 tc(this),ye.isReady&&this.connect()}channel(a){return this.channels.find(a)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var a=this.connection.isUsingTLS(),d=this.timelineSender;this.timelineSenderTimer=new nn(6e4,function(){d.send(a)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(a,d,v){return this.global_emitter.bind(a,d,v),this}unbind(a,d,v){return this.global_emitter.unbind(a,d,v),this}bind_global(a){return this.global_emitter.bind_global(a),this}unbind_global(a){return this.global_emitter.unbind_global(a),this}unbind_all(a){return this.global_emitter.unbind_all(),this}subscribeAll(){var a;for(a in this.channels.channels)this.channels.channels.hasOwnProperty(a)&&this.subscribe(a)}subscribe(a){var d=this.channels.add(a,this);return d.subscriptionPending&&d.subscriptionCancelled?d.reinstateSubscription():!d.subscriptionPending&&this.connection.state==="connected"&&d.subscribe(),d}unsubscribe(a){var d=this.channels.find(a);d&&d.subscriptionPending?d.cancelSubscription():(d=this.channels.remove(a),d&&d.subscribed&&d.unsubscribe())}send_event(a,d,v){return this.connection.send_event(a,d,v)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}ye.instances=[],ye.isReady=!1,ye.logToConsole=!1,ye.Runtime=H,ye.ScriptReceivers=H.ScriptReceivers,ye.DependenciesReceivers=H.DependenciesReceivers,ye.auth_callbacks=H.auth_callbacks;var _t=t.default=ye;function oc(u){if(u==null)throw"You must pass your app key when you instantiate Pusher."}H.setup(ye)}])})})(Vo);var Or=Vo.exports;const Hr=Dr(Or);class Go{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"),r=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"}),r&&this.copyToClipboard(o.innerHTML.split(" ")[1].replace(/,/g,""),r)}),l&&l.addEventListener("click",()=>{this.onAction(5)})}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=ri(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,C,k,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"),r=this.container.querySelector("#time-left"),l=((g=this.payment)==null?void 0:g.currency)||"USD",c=l==="USD"?(f=this.payment)==null?void 0:f.localCurrency:l;if(i&&(i.innerHTML=`${c} ${ke(l==="USD"?(y=this.payment)==null?void 0:y.localAmount:(C=this.payment)==null?void 0:C.amount,2)}`),t&&this.payment.bankDetails&&(t.innerHTML=(k=this.payment.bankDetails)==null?void 0:k.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),r&&(r.innerHTML=ri(this.initialTime)),this.startTimer("poll"),e.status==="inProgress"){const M="45654f3ce4c9512ea9a4",A="us2";var b=new Hr(M,{cluster:A}),p=b.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 E=new URL(_.redirectUrl);E.searchParams.append("status",_.status),E.searchParams.append("reference",_.reference),window.location.href=E.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 Rr}}const Ur=`<div id="trasferConfirmationProgress">
897
- <div>
898
- <div>
899
- <div class=" grid grid-rows-[auto_1fr] gap-4 mx-5">
900
- <div class="items-center justify-self-center flex flex-col relative ">
901
- <svg class="animate-spin" width="40" height="40" viewBox="0 0 64 64" fill="none"
902
- xmlns="http://www.w3.org/2000/svg">
903
- <path
904
- 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"
905
- stroke="black" stroke-width="4" stroke-linejoin="round" />
906
- </svg>
907
- <!-- <div class="relative w-12 h-12">
908
- <svg viewBox="0 0 100 100" width="100" height="100" class="h-full w-full">
909
- <circle stroke-width="10" stroke="#E6E6E7" stroke-linecap="round" cx="50" cy="50"
910
- class="circle-progress-bg" r="40" fill="transparent"></circle>
911
- <circle stroke-width="11" stroke="#000000" stroke-linecap="round" cx="50" cy="50" r="40"
912
- class="circle-progress" fill="transparent" stroke-dasharray="" stroke-dashoffset=""
913
- transform="rotate(-90 50 50)"></circle>
914
- </svg>
915
-
916
- </div> -->
917
- </div>
918
- </div>
919
- </div>
920
- <div class="text-center w-11/12 md:w-4/5 mx-auto grid gap-4 mb-8">
921
- <h5 class="text-center text-sm text-grey-400">
922
- We are confirming transaction status.
923
- <br>
924
- This can take a few minutes.
925
- </h5>
926
-
927
- <div>
928
- <p class="text-grey-400 text-sm">
929
- Please wait for <span id="ctd-timer" class="font-bold"> </span> minutes
930
- </p>
931
- </div>
932
-
933
- </div>
934
-
935
- <div>
936
- <div class="border border-tone-10 rounded-lg text-black px-4 py-4 grid gap-2">
937
-
938
- <div class="grid grid-cols-[1fr_auto] gap-3">
939
- <div>
940
- <p class="text-xs">Account details</p>
941
- </div>
942
-
943
- <div class="align-center gap-2">
944
- <p class="font-medium text-xs" id="transfer-acn-pr"></p>
945
-
946
- <button type="button" class="relative group" id="copy-acn-pr">
947
- <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
948
- <path
949
- d="M9.33268 7.52502V9.97502C9.33268 12.0167 8.51602 12.8334 6.47435 12.8334H4.02435C1.98268 12.8334 1.16602 12.0167 1.16602 9.97502V7.52502C1.16602 5.48335 1.98268 4.66669 4.02435 4.66669H6.47435C8.51602 4.66669 9.33268 5.48335 9.33268 7.52502Z"
950
- stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
951
- <path
952
- d="M12.8327 4.02502V6.47502C12.8327 8.51669 12.016 9.33335 9.97435 9.33335H9.33268V7.52502C9.33268 5.48335 8.51602 4.66669 6.47435 4.66669H4.66602V4.02502C4.66602 1.98335 5.48268 1.16669 7.52435 1.16669H9.97435C12.016 1.16669 12.8327 1.98335 12.8327 4.02502Z"
953
- stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
954
- </svg>
955
-
956
- <div class="tooltip">
957
- <div class="tooltip-textbox">
958
- <p class="tooltip-text" id="acn-tooltip-pr">Copy</p>
959
- </div>
960
- </div>
961
- </button>
962
- </div>
963
- </div>
964
-
965
- <div class="grid grid-cols-[1fr_auto] gap-3 text-xxs">
966
- <p class="text-xs">Bank name</p>
967
- <p class="font-medium text-xs" id="transfer-bank"></p>
968
- </div>
969
-
970
- <div class="grid grid-cols-[1fr_auto] gap-3 text-xxs">
971
- <p class="text-xs">Beneficiary</p>
972
- <p class="font-medium text-xs" id="account-name"></p>
973
- </div>
974
- </div>
975
- </div>
976
- </div>
977
- </div>`;class Kr{constructor(e){h(this,"container");h(this,"onAction");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,"payment");h(this,"setPaymentResponses");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.callBackUrl=e.callBackUrl,this.setPaymentResponses=e.setPaymentResponses}attachListeners(){const e=this.container.querySelector("#show-acn");e&&e.addEventListener("click",()=>{this.onAction(1),clearTimeout(this.timer)});const i=this.container.querySelector("#transfer-acn-pr"),t=this.container.querySelector("#copy-acn-pr"),o=this.container.querySelector("#acn-tooltip-pr");t&&i&&t.addEventListener("click",()=>{P.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Verification"}),o&&this.copyToClipboard(i.innerHTML,o)}),this.initialTime=300,this.timeLeft=this.initialTime;const s=3e4;this.abortController=new AbortController,setTimeout(()=>{this.verifyTransfer(this.token,s,({data:r,headers:l})=>{this.onAction(6),this.redirectTo(r,l)})},5e3),this.startTimer()}updateProgressTimerContent(){const i=2*Math.PI*40,o=(this.initialTime-this.timeLeft)/this.initialTime*100/100*i,s=this.container.querySelector(".circle-progress");s&&(s.setAttribute("stroke-dasharray",`${i}`),s.setAttribute("stroke-dashoffset",`${o}`))}async verifyTransfer(e,i,t){let o=0,s=i,r=!0,l;this.abortController&&(l=this.abortController.signal);const c=async()=>{if(this.timeLeft<=0){r=!1,this.onAction(8),P.track("verify_payment",{payment_method:"Transfer",verification_status:"In Progress"});return}o+=1;try{const b=await vn(e,this.ref,l,this.rdtCode,this.url);b.data.status==="inProgress"?(r&&(s=i*(o+1),this.timer=setTimeout(c,s)),this.setPaymentResponses(b.data,b.headers)):b.data.status==="successful"||b.data.status==="success"?(this.setPaymentResponses(b.data,b.headers),r=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),P.track("verify_payment",{payment_method:"Transfer",verification_status:"Success"}),t(b)):b.data.status==="failed"&&(this.setPaymentResponses(b.data,b.headers),r=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),this.onAction(7,"Transfer failed"),P.track("verify_payment",{payment_method:"Transfer",verification_status:"Failed"}))}catch{r&&(s=i*(o+1),this.timer=setTimeout(c,s))}};c()}redirectTo(e,i){const t=i.get("spf-redirect-url");this.callBackUrl=t||this.callBackUrl,this.callBackUrl&&setTimeout(()=>{const o=new URL(this.callBackUrl);o.searchParams.append("status",e.status),o.searchParams.append("reference",e.reference),window.location.href=o.toString()},1800)}startTimer(){const e=this.container.querySelector("#ctd-timer");this.stopTimer(),this.timerId=window.setInterval(()=>{this.timeLeft>0?(this.timeLeft-=1,e&&(e.innerHTML=ri(this.timeLeft),this.startTimer()),this.updateProgressTimerContent()):(this.stopTimer(),this.onAction(8))},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}renderTransferDetailsComponent(e){var s,r;e&&(this.payment=e),this.container.innerHTML=this.render();const i=this.container.querySelector("#transfer-bank"),t=this.container.querySelector("#transfer-acn-pr"),o=this.container.querySelector("#account-name");i&&e.bankDetails&&(i.innerHTML=(s=e.bankDetails)==null?void 0:s.bankName),t&&e.bankDetails&&(t.innerHTML=e.bankDetails.accountNumber),o&&e.bankDetails&&(o.innerHTML=(r=e.bankDetails)==null?void 0:r.accountName)}copyToClipboard(e,i){navigator.clipboard.writeText(e).then(()=>{i.innerHTML="Copied!"}).catch(()=>{i.innerHTML="Failed to copy"})}renderComponent(e){this.container.innerHTML=this.render(),this.renderTransferDetailsComponent(e),this.attachListeners()}render(){return Ur}}const jr=`<div id="paymenExpired">
978
- <div class="container-center min-h-[30dvh]">
979
- <div>
980
- <div class="container-center mb-5">
981
- <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
982
- <path
983
- d="M32.5172 9.74998L22.6172 4.03331C21.0005 3.09998 19.0005 3.09998 17.3672 4.03331L7.48385 9.74998C5.86719 10.6833 4.86719 12.4166 4.86719 14.3V25.7C4.86719 27.5666 5.86719 29.3 7.48385 30.25L17.3839 35.9666C19.0005 36.9 21.0005 36.9 22.6339 35.9666L32.5339 30.25C34.1505 29.3166 35.1505 27.5833 35.1505 25.7V14.3C35.1339 12.4166 34.1339 10.7 32.5172 9.74998ZM18.7505 12.9166C18.7505 12.2333 19.3172 11.6666 20.0005 11.6666C20.6839 11.6666 21.2505 12.2333 21.2505 12.9166V21.6666C21.2505 22.35 20.6839 22.9166 20.0005 22.9166C19.3172 22.9166 18.7505 22.35 18.7505 21.6666V12.9166ZM21.5339 27.7166C21.4505 27.9166 21.3339 28.1 21.1839 28.2666C20.8672 28.5833 20.4505 28.75 20.0005 28.75C19.7839 28.75 19.5672 28.7 19.3672 28.6166C19.1505 28.5333 18.9839 28.4166 18.8172 28.2666C18.6672 28.1 18.5505 27.9166 18.4505 27.7166C18.3672 27.5166 18.3339 27.3 18.3339 27.0833C18.3339 26.65 18.5005 26.2166 18.8172 25.9C18.9839 25.75 19.1505 25.6333 19.3672 25.55C19.9839 25.2833 20.7172 25.4333 21.1839 25.9C21.3339 26.0666 21.4505 26.2333 21.5339 26.45C21.6172 26.65 21.6672 26.8666 21.6672 27.0833C21.6672 27.3 21.6172 27.5166 21.5339 27.7166Z"
984
- fill="#D62020" />
985
- </svg>
986
- </div>
987
- <h5 class="text-tone-100 font-semibold text-xl text-center mb-1" id="payment-warning-text">
988
- Account Expired
989
- </h5>
990
-
991
- <p class="w-11/12 mx-auto text-sm text-center">
992
- Looks like your account is not valid. Please confirm and try again
993
- </p>
994
-
995
- <!-- <div class="mt-8 container-center">
996
- <button type="button" id="payment-expired" class="button-outline w-60">I have made the payment</button>
997
- </div> -->
998
- </div>
999
- </div>
1000
- </div>`;class Vr{constructor(e){h(this,"container");this.container=e.container}attachListeners(){}renderComponent(){this.container.innerHTML=this.render()}render(){return jr}}class Gr{constructor({amount:e,closeModal:i,container:t,email:o,token:s,currency:r,rdtCode:l,url:c,reference:b,callBackUrl:p,metadata:g,localCurrency:f,disablePaymentMethods:y,restartTransactionProcess:C,hidePaymentMethods:k,retryingPayment:S}){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,"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=r,this.container=t,this.contents=this.container.querySelector("#payment-content-view"),this.closeModal=i,this.token=s,this.email=o,this.amount=e,this.rdtCode=l,this.url=c,this.reference=b,this._currentStep=1,this.callBackUrl=p,this.metadata=g,this.localCurrency=f,this.disablePaymentMethods=y,this.paymentResponse={},this.paymentResponseHeaders={},this.restartTransactionProcess=C,this.hidePaymentMethods=k,this.retryingPayment=S,this.isMaxRetriesReached=!1,this.renderTransferContent(),this.paymentResponse={},this.activeRef="",this.timerId=null,this.mainLoader=new Ie(this.contents),P.track("transfer_opens",{payment_method:"Transfer"}),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 vn(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 Ie(this.contents),this.mainLoader.mountLoader("25dvh"),i.classList.add("hidden")),P.track("start_transferProcess",{payment_method:"Transfer"}),(()=>{if(this.retryingPayment){const o={channel:"bank_transfer",reference:this.reference};return si(this.token,o,this.rdtCode,this.url)}else{const o={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};return xt(this.token,o,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"),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 Go({container:this.contents,onAction:r=>{this.onSentVerify.bind(this)(r)},onFail:(r,l)=>{this.currentStep=r,r===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(){sn(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 Go({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 Vr({container:this.contents}),this.transferExpired.renderComponent();break;case 5:this.transferConfirmationProgress=new Kr({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 Vn({container:this.contents,amount:this.amount,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 fn({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 jo({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 di({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 zo(){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 Qe extends Error{constructor(e){super(e),this.name="AuthorizationError"}}class mt{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 Qe("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 Fo extends mt{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 Qe?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 Qe?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 Qe?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 Qe?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 Qe?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 Qe?console.error(`AuthorizationError: ${t.message}`):console.error(`Unexpected error: ${t}`),t}}}class zr extends mt{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 Qe?console.error(`AuthorizationError: ${t.message}`):console.error(`Unexpected error: ${t}`),t}}}class Fr extends mt{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?(li.showToast(e.message,"error",9e3),console.error(`FetchError: ${e.message} (status: ${e.status})`)):e instanceof Qe?console.error(`AuthorizationError: ${e.message}`):console.error(`Unexpected error: ${e}`),e}}}const qr=`<form id="ussdBanks">
1001
- <div>
1002
- <h5 class="text-grey-400 font-semibold text-sm">Please choose your bank to begin payment</h5>
1003
- <div class="mt-2">
1004
- <div class="relative">
1005
- <div class="relative bank-select-relative">
1006
- <div class="relative w-full">
1007
- <span class="absolute text-xs left-0 top-1 text-grey-100 pt-1 pb-1 px-3 tracking-[0.5px]">Bank</span>
1008
- <div>
1009
- <select class="avs-input-container appearance-none pr-7" id="bank-search-input" name="bank"
1010
- placeholder="Select your bank" required></select>
1011
- </div>
1012
- <div class="absolute right-4 top-1/2 -translate-y-2/4">
1013
- <svg id="bank-dropdown" width="14" height="8" viewBox="0 0 14 8" fill="none"
1014
- xmlns="http://www.w3.org/2000/svg">
1015
- <path d="M1 1L7 7L13 1" stroke="#9E9BA1" stroke-width="2" stroke-linecap="round"
1016
- stroke-linejoin="round" />
1017
- </svg>
1018
- </div>
1019
- </div>
1020
- </div>
1021
-
1022
- <div class="mt-4">
1023
- <button type="submit" disabled="true" class="details-form-button" id="ussd-bank-button">
1024
- <svg class="spinner hidden" viewBox="0 0 24 24">
1025
- <path
1026
- d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">
1027
- </path>
1028
- </svg>
1029
- <span id="ussd-bank-button-text"> Pay </span>
1030
- </button>
1031
- </div>
1032
- </div>
1033
- </div>
1034
- </div>
1035
- </form>`;class qo{constructor(e){h(this,"container");h(this,"bank_service");h(this,"bank_list");h(this,"onAction");h(this,"selectedBank");h(this,"currency");h(this,"localCurrency");h(this,"rate");h(this,"amount");this.container=e.container,this.currency=e.currency,this.localCurrency=e.localCurrency,this.rate=e.rate,this.amount=e.amount,this.bank_list=[],this.bank_service=new Fr({token:e.merchantKey,rdtCode:e.rdtCode,url:e.url}),this.selectedBank={code:"",name:""},this.onAction=e.onAction?e.onAction:()=>null}attachListerner(){const e=document.getElementById("bank-search-input"),i=document.querySelectorAll(".select-option-tag"),t=document.querySelector("#ussd-bank-button"),o=document.querySelector("#ussdBanks");e&&e.addEventListener("change",s=>{var r,l;if(s.stopPropagation(),this.selectedBank={code:e.value,name:((l=(r=this.bank_list.filter(c=>c.code==e.value))==null?void 0:r[0])==null?void 0:l.name)||""},this.validateForm())t&&t.removeAttribute("disabled");else if(t){if(t.disabled)return;t.setAttribute("disabled","")}}),i&&Array.from(i).forEach(r=>{r.addEventListener("click",function(l){P.track("select_bank",{payment_method:"USSD"}),l.stopPropagation()})}),o&&o.addEventListener("submit",s=>{s.preventDefault(),this.onAction(this.selectedBank)})}validateForm(){return!!this.selectedBank.code}displayButtonText(e){const i=this.container.querySelector("#ussd-bank-button-text");i&&(this.localCurrency&&this.localCurrency!==this.currency?i.textContent=`Continue to pay ${this.localCurrency} ${ke((this.amount||0)*(this.rate||1),2)}`:i.textContent=`Continue to pay ${this.currency} ${ke(this.amount||0,2)}`)}renderContent(){this.container.innerHTML=this.render();const e=this.container.querySelector("#bank-search-input");if(e){const i=new Option("Select your bank","",!0,!0);i.disabled=!0,e.appendChild(i),e.classList.remove("text-tone-100"),e.classList.add("text-tone-50")}this.bank_service.getBankList().then(i=>{this.bank_list=i,e&&i.forEach(t=>{const o=new Option(t.name,t.code);e.appendChild(o),e.classList.remove("text-tone-50"),e.classList.add("text-tone-100")})}),this.displayButtonText(),this.attachListerner()}render(){return qr}}const Wr=`<div id="viewCode">
1036
- <div class="grid gap-4">
1037
- <div class="text-center">
1038
- <div class="md:w-4/5 mx-auto grid gap-3">
1039
- <h5 class="text-sm text-center text-grey-400">
1040
- Dial the <span id="bank-name-ussd" class="font-semibold"></span>
1041
- code below on your mobile phone
1042
- to complete the payment
1043
-
1044
- </h5>
1045
- </div>
1046
- </div>
1047
-
1048
- <div class="container-center">
1049
- <div>
1050
- <p class="bank-dial-code text-2xl font-bold text-tone-100">*901*000*8812#</p>
1051
- <button type="button" class="copy-code-button text-sm text-tone-100 container-center gap-2 text-center w-full">
1052
- <span class="font-semibold mt-1">COPY USSD CODE</span>
1053
-
1054
- <svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg">
1055
- <path
1056
- d="M9.33268 8.02502V10.475C9.33268 12.5167 8.51602 13.3334 6.47435 13.3334H4.02435C1.98268 13.3334 1.16602 12.5167 1.16602 10.475V8.02502C1.16602 5.98335 1.98268 5.16669 4.02435 5.16669H6.47435C8.51602 5.16669 9.33268 5.98335 9.33268 8.02502Z"
1057
- stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
1058
- <path
1059
- d="M12.8327 4.52502V6.97502C12.8327 9.01669 12.016 9.83335 9.97435 9.83335H9.33268V8.02502C9.33268 5.98335 8.51602 5.16669 6.47435 5.16669H4.66602V4.52502C4.66602 2.48335 5.48268 1.66669 7.52435 1.66669H9.97435C12.016 1.66669 12.8327 2.48335 12.8327 4.52502Z"
1060
- stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
1061
- </svg>
1062
-
1063
- </button>
1064
- </div>
1065
- </div>
1066
-
1067
- <div class="mt-4">
1068
- <button type="button" id="bank-completed-payment" class="details-form-button">I have made this
1069
- payment</button>
1070
- </div>
1071
- </div>
1072
- </div>`;class Zr{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,"abortController");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.abortController=new AbortController,this.paymentService=new Fo({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 Ie(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 r=new URL(this.callBackUrl);r.searchParams.append("status",i.status),r.searchParams.append("reference",i.reference),window.location.href=r.toString()},1800);return}else if(i.status!=="success")if(i.ussd){this.container.innerHTML=this.render();const s=this.container.querySelectorAll(".bank-dial-code"),r=this.container.querySelector("#bank-dial-code");r&&(r.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(b=>{var p;b.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(r=>{r.addEventListener("click",l=>{var c;P.track("copy_ussdCode",{payment_method:"USSD"}),window.navigator.clipboard.writeText(((c=this.ussd_detail)==null?void 0:c.code)||"")})}),Array.from(i).forEach(r=>{r.addEventListener("click",l=>{var c;P.track("copy_ussdCode",{payment_method:"USSD"}),window.navigator.clipboard.writeText(((c=this.ussd_detail)==null?void 0:c.code)||"")})}),t&&t.addEventListener("click",r=>{r.preventDefault(),this.onAction(this.selected,this.activeRef)})}verifyPayment(){let e;this.abortController?e=this.abortController.signal:e=new AbortController().signal,console.log({signal:e})}renderComponent(){this.makePayment(),this.attachListener()}render(){return Wr}}var Jr=Object.defineProperty,$r=(n,e,i,t)=>{for(var o=void 0,s=n.length-1,r;s>=0;s--)(r=n[s])&&(o=r(e,i,o)||o);return o&&Jr(e,i,o),o};class Wo{constructor({container:e,onSuccess:i,secret:t,amount:o,currency:s,email:r,reference:l,rdtCode:c,url:b,callBackUrl:p,metadata:g,localCurrency:f,hidePaymentMethods:y,showPaymentMethods:C,disablePaymentMethods:k}){h(this,"contents");h(this,"selectedCode");h(this,"secret");h(this,"amount");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.currency=s,this.reference=l,this.email=r,this.rdtCode=c,this.url=b,this.callBackUrl=p,this.metadata=g,this.localCurrency=f,this.merchantDetails={},this.hidePaymentMethods=y,this.showPaymentMethods=C,this.disablePaymentMethods=k,this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.paymentService=new Fo({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,P.track("verify_payment",{payment_method:"USSD",verification_status:"In Progress"});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}),this.bankDetail.renderContent();break;case 2:this.viewUssdCode=new Zr({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,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=Pt,this.warningScreen=new fn({container:this.contents});break;case 4:this.pageLoader=new Ie(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 Vn({container:this.contents,amount:this.amount,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}),this.bankDetail.renderContent();break}}handleSelectChange(e){setTimeout(()=>{this.currentStep=2},400),this.currentStep=2}}$r([zo(),zo()],Wo.prototype,"selectedCode");const Yr={NGN:"Nigerian Naira",USD:"US Dollar",GHS:"Ghanaian Cedi",GBP:"Pounds",ZAF:"South African Rand",USDT:"Tether",KSH:"Kenyan Shilling"},Qr=n=>n==null?void 0:n.replace(/_/g," ");function Xr(n){return n.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}const Ii=n=>{if(n){const e=Qr(n);return Xr(e)}return""},el=`<div>
1073
- <button id="go-back" class="md:hidden" aria-label="Go back">
1074
- </button>
1075
- </div>
1076
-
1077
- <div class="container-between gap-3 py-3 border-b border-b-grey-faint">
1078
- <div class="" id="merchant-logo-container">
1079
- <img src="" alt="logo" id="merchant-logo" class="flex max-w-[200px] h-8 object-contain" />
1080
- </div>
1081
- <!-- <button id="close-btn">
1082
- <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
1083
- <path d="M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5" stroke="#55515B" stroke-width="1.5" stroke-linecap="round"
1084
- stroke-linejoin="round" />
1085
- </svg>
1086
-
1087
- </button> -->
1088
- </div>
1089
-
1090
- <div class="py-5 md:py-3 border-b border-b-grey-faint" id="payment-details-header">
1091
- <div class="hidden md:block" id="payment-details">
1092
- <div class="container-between gap-3">
1093
- <p class="text-xs break-words whitespace-normal" id="plan-name">-</p>
1094
- <p class="whitespace-nowrap mb-1 text-2xl font-bold" id="designated-rate-no-plan">
1095
-
1096
- </p>
1097
- <p class="text-xs text-left" id="merchant-email"></p>
1098
- </div>
1099
- <div class="flex justify-between items-start gap-4 py-1" id="payment-fees">
1100
- <div>
1101
- <p class="whitespace-nowrap mb-1 text-2xl font-bold">
1102
- <span id="designated-rate" class="inline-block"> USD 0</span>
1103
- </p>
1104
- <div class="text-sm" id="source-rate">
1105
- <span> To pay: </span>
1106
- <span class="ml-1 font-bold"> NGN 1</span>
1107
- </div>
1108
- </div>
1109
- <div id="currency-cursor" class="flex items-center relative">
1110
- <p class="text-sm mr-1 whitespace-nowrap" id="payment-rate-display">USD 1 = NGN 1</p>
1111
- <div class="group flex flex-col items-center cursor-pointer">
1112
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1113
- <path
1114
- d="M8.00065 14.6668C11.6673 14.6668 14.6673 11.6668 14.6673 8.00016C14.6673 4.3335 11.6673 1.3335 8.00065 1.3335C4.33398 1.3335 1.33398 4.3335 1.33398 8.00016C1.33398 11.6668 4.33398 14.6668 8.00065 14.6668Z"
1115
- stroke="#101010" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" />
1116
- <path d="M8 5.3335V8.66683" stroke="#101010" stroke-width="1.2" stroke-linecap="round"
1117
- stroke-linejoin="round" />
1118
- <path d="M7.99609 10.6665H8.00208" stroke="#101010" stroke-width="1.2" stroke-linecap="round"
1119
- stroke-linejoin="round" />
1120
- </svg>
1121
-
1122
-
1123
- <div
1124
- class="text-xs w-0 absolute transition-all duration-500 hidden rotate-45 left-0 top-5 z-30 text-[#98A2B3] hover:block bg-white p-3 rounded-lg lg:max-w-[20rem] translate-x-[-45%] min-w-[15rem] md:min-w-[18rem] shadow before:h-4 before:w-4 before:absolute before:-top-0 before:left-0 before:translate-x-[-45%] before:-translate-y-1 before:bg-white before:rotate-45 group-hover:rotate-0 hover:rotate-0 hover:opacity-100 group-hover:block group-hover:w-full hover:w-full">
1125
- <p class="text-black font-medium text-xs">
1126
- What is this?
1127
- </p>
1128
- <p class="text-xs">
1129
- This rate reflects the current exchange rate for
1130
- converting United States Dollars (USD) to <span id="tooltip-localCurrency"> Nigerian Naira
1131
- (NGN) </span>. Please note that exchange rates are subject to
1132
- change and may vary slightly at the time of the
1133
- transaction.
1134
- </p>
1135
- </div>
1136
- </div>
1137
- </div>
1138
-
1139
-
1140
- </div>
1141
- </div>
1142
- <div class="block md:hidden" id="payment-details-mob">
1143
- <div class="mb-3">
1144
- <p class="text-sm text-left mb-1" id="merchant-email-mob"></p>
1145
- <div id="currency-cursor-mob" class="flex items-center relative">
1146
- <p class="text-sm mr-1 whitespace-nowrap" id="payment-rate-display-mob">USD 1 = NGN 1</p>
1147
- <div class="group flex flex-col items-center cursor-pointer">
1148
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1149
- <path
1150
- d="M8.00065 14.6668C11.6673 14.6668 14.6673 11.6668 14.6673 8.00016C14.6673 4.3335 11.6673 1.3335 8.00065 1.3335C4.33398 1.3335 1.33398 4.3335 1.33398 8.00016C1.33398 11.6668 4.33398 14.6668 8.00065 14.6668Z"
1151
- stroke="#101010" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" />
1152
- <path d="M8 5.3335V8.66683" stroke="#101010" stroke-width="1.2" stroke-linecap="round"
1153
- stroke-linejoin="round" />
1154
- <path d="M7.99609 10.6665H8.00208" stroke="#101010" stroke-width="1.2" stroke-linecap="round"
1155
- stroke-linejoin="round" />
1156
- </svg>
1157
-
1158
-
1159
- <div
1160
- class="text-xs w-0 absolute transition-all duration-500 hidden rotate-45 left-0 top-5 z-30 text-[#98A2B3] hover:block bg-white p-3 rounded-lg translate-x-[0%] min-w-[15rem] shadow before:h-4 before:w-4 before:absolute before:-top-0 before:left-0 before:translate-x-[0%] before:-translate-y-1 before:bg-white before:rotate-45 group-hover:rotate-0 hover:rotate-0 hover:opacity-100 group-hover:block group-hover:w-4/5 hover:w-full">
1161
- <p class="text-black font-medium text-xs">
1162
- What is this?
1163
- </p>
1164
- <p class="text-xs">
1165
- This rate reflects the current exchange rate for
1166
- converting United States Dollars (USD) to <span id="tooltip-localCurrency-mob"> Nigerian Naira
1167
- (NGN) </span>. Please note that exchange rates are subject to
1168
- change and may vary slightly at the time of the
1169
- transaction.
1170
- </p>
1171
- </div>
1172
- </div>
1173
- </div>
1174
- </div>
1175
- <div>
1176
- <p class="text-base font-semibold break-words whitespace-normal" id="plan-name-mob">-</p>
1177
-
1178
- <div>
1179
- <p class="whitespace-nowrap mb-1 text-2xl font-bold">
1180
- <span id="designated-rate-mob" class="inline-block"> USD 0</span>
1181
- </p>
1182
- <div class="text-sm" id="source-rate-mob">
1183
- <span> To pay: </span>
1184
- <span class="ml-1 font-bold"> NGN 1</span>
1185
- </div>
1186
- </div>
1187
- </div>
1188
- </div>
1189
-
1190
- </div>
1191
-
1192
- <div class="pt-5 pb-4 border-b border-b-grey-faint" id="payment-methods-container">
1193
- <h3 class="mb-3 text-sm md:text-xs text-grey-400 font-semibold"><span id="select-payment-method-text">Select your
1194
- preferred</span> payment method</h3>
1195
-
1196
- <div class="payment-options">
1197
-
1198
- <!-- Tab options -->
1199
- </div>
1200
- </div>`;class nl{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 r=s.dataset.name||"",l=s.querySelector(".tab-button-icon"),c=s.querySelector(".tab-button-label");l&&(l.innerHTML=pe[r].icon),c&&(c.textContent=pe[r].label),s.addEventListener("click",b=>{b.preventDefault(),this.onAction(r)})});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 E,N,G,z,U,V,oe,fe,K,Me,ue,Te,Ae,Xe,pn,en,Sn,bn,Ee,nn,_n,re,be,Re,Pe,Ce,qe,B,he;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"),r=this.container.querySelector("#plan-name-mob"),l=this.container.querySelector("#payment-fees"),c=this.container.querySelector("#currency-cursor"),b=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"),C=this.container.querySelector("#designated-rate-no-plan"),k=this.container.querySelector("#source-rate"),S=this.container.querySelector("#source-rate-mob"),M=this.container.querySelector("#tooltip-localCurrency"),A=this.container.querySelector("#tooltip-localCurrency-mob");if((E=this.merchantDetail)!=null&&E.merchantLogo?i&&i.setAttribute("src",(N=this.merchantDetail)==null?void 0:N.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((z=(G=this.merchantDetail)==null?void 0:G.plan)!=null&&z.title){const $=((V=(U=this.merchantDetail)==null?void 0:U.plan)==null?void 0:V.title)||"";s.textContent=Ii($)}(oe=this.metadata)!=null&&oe.productName&&(s.textContent=Ii(this.metadata.productName))}if(r){if((K=(fe=this.merchantDetail)==null?void 0:fe.plan)!=null&&K.title){const $=((ue=(Me=this.merchantDetail)==null?void 0:Me.plan)==null?void 0:ue.title)||"";r.textContent=Ii($)}(Te=this.metadata)!=null&&Te.productName&&(r.textContent=Ii(this.metadata.productName))}c&&(this.currency==="USD"?p&&(p.innerHTML=`1 ${((Xe=(Ae=this.merchantDetail)==null?void 0:Ae.rate)==null?void 0:Xe.to)||"-"} = ${((en=(pn=this.merchantDetail)==null?void 0:pn.rate)==null?void 0:en.from)||"-"} ${ke(((Sn=this.merchantDetail.rate)==null?void 0:Sn.rate)||1,2)} `):c.innerHTML=""),b&&(this.currency==="USD"?g&&(g.innerHTML=`1 ${((Ee=(bn=this.merchantDetail)==null?void 0:bn.rate)==null?void 0:Ee.to)||"-"} = ${((_n=(nn=this.merchantDetail)==null?void 0:nn.rate)==null?void 0:_n.from)||"-"} ${ke(((re=this.merchantDetail.rate)==null?void 0:re.rate)||1,2)} `):b.innerHTML=""),(Re=(be=this.merchantDetail)==null?void 0:be.plan)!=null&&Re.title||(Pe=this.metadata)!=null&&Pe.productName?f&&(f.innerHTML=`${this.currency} ${ke(this.amount,2)}`):(C&&(C.innerHTML=`<span> ${this.currency} ${ke(this.amount,2)} </span>`),s&&r&&(s.remove(),r==null||r.remove()),this.localCurrency?f==null||f.remove():l&&l.remove()),y&&(y.innerHTML=`${this.currency} ${ke(this.amount,2)}`),k&&(this.localCurrency&&this.localCurrency!==this.currency?k.children[1].innerHTML=`${this.localCurrency} ${ke(this.amount*(((qe=(Ce=this.merchantDetail)==null?void 0:Ce.rate)==null?void 0:qe.rate)||1),2)}`:k.remove()),S&&(this.localCurrency&&this.localCurrency!==this.currency?S.children[1].innerHTML=`${this.localCurrency} ${ke(this.amount*(((he=(B=this.merchantDetail)==null?void 0:B.rate)==null?void 0:he.rate)||1),2)}`:S.remove());const _=Yr[this.localCurrency];M&&this.localCurrency&&(M.innerHTML=_?`${_} (${this.localCurrency})`:this.localCurrency),A&&this.localCurrency&&(A.innerHTML=_?`${_} (${this.localCurrency})`:this.localCurrency),this.renderPaymentOptions(this.container),this.attachListeners()}renderPaymentOptions(e){const i=e.querySelector(".payment-options"),t=this.localCurrency?this.localCurrency:this.currency;if(i){const o=this.merchantDetail.plan?[pe.card]:this.merchantDetail.paymentMethods.filter(s=>s!=="ussd").map(s=>pe[s]);if(this.isMobile){let s='<div class="">';o.forEach(r=>{s+=`
1201
- <div key=${r.key}>
1202
- <button class="tab-button gap-2 mb-4 group" data-name="${r.key}">
1203
- <div class="lg:block">${r.icon}</div>
923
+ */(function(n,t){(function(e,i){n.exports=i()})(window,function(){return function(r){var e={};function i(o){if(e[o])return e[o].exports;var s=e[o]={i:o,l:!1,exports:{}};return r[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=e,i.d=function(o,s,a){i.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:a})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,s){if(s&1&&(o=i(o)),s&8||s&4&&typeof o=="object"&&o&&o.__esModule)return o;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:o}),s&2&&typeof o!="string")for(var u in o)i.d(a,u,(function(c){return o[c]}).bind(null,u));return a},i.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(s,"a",s),s},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.p="",i(i.s=2)}([function(r,e,i){var o=this&&this.__extends||function(){var k=function(b,S){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,x){A.__proto__=x}||function(A,x){for(var E in x)x.hasOwnProperty(E)&&(A[E]=x[E])},k(b,S)};return function(b,S){k(b,S);function A(){this.constructor=b}b.prototype=S===null?Object.create(S):(A.prototype=S.prototype,new A)}}();Object.defineProperty(e,"__esModule",{value:!0});var s=256,a=function(){function k(b){b===void 0&&(b="="),this._paddingCharacter=b}return k.prototype.encodedLength=function(b){return this._paddingCharacter?(b+2)/3*4|0:(b*8+5)/6|0},k.prototype.encode=function(b){for(var S="",A=0;A<b.length-2;A+=3){var x=b[A]<<16|b[A+1]<<8|b[A+2];S+=this._encodeByte(x>>>3*6&63),S+=this._encodeByte(x>>>2*6&63),S+=this._encodeByte(x>>>1*6&63),S+=this._encodeByte(x>>>0*6&63)}var E=b.length-A;if(E>0){var x=b[A]<<16|(E===2?b[A+1]<<8:0);S+=this._encodeByte(x>>>3*6&63),S+=this._encodeByte(x>>>2*6&63),E===2?S+=this._encodeByte(x>>>1*6&63):S+=this._paddingCharacter||"",S+=this._paddingCharacter||""}return S},k.prototype.maxDecodedLength=function(b){return this._paddingCharacter?b/4*3|0:(b*6+7)/8|0},k.prototype.decodedLength=function(b){return this.maxDecodedLength(b.length-this._getPaddingLength(b))},k.prototype.decode=function(b){if(b.length===0)return new Uint8Array(0);for(var S=this._getPaddingLength(b),A=b.length-S,x=new Uint8Array(this.maxDecodedLength(A)),E=0,L=0,P=0,H=0,N=0,F=0,z=0;L<A-4;L+=4)H=this._decodeChar(b.charCodeAt(L+0)),N=this._decodeChar(b.charCodeAt(L+1)),F=this._decodeChar(b.charCodeAt(L+2)),z=this._decodeChar(b.charCodeAt(L+3)),x[E++]=H<<2|N>>>4,x[E++]=N<<4|F>>>2,x[E++]=F<<6|z,P|=H&s,P|=N&s,P|=F&s,P|=z&s;if(L<A-1&&(H=this._decodeChar(b.charCodeAt(L)),N=this._decodeChar(b.charCodeAt(L+1)),x[E++]=H<<2|N>>>4,P|=H&s,P|=N&s),L<A-2&&(F=this._decodeChar(b.charCodeAt(L+2)),x[E++]=N<<4|F>>>2,P|=F&s),L<A-3&&(z=this._decodeChar(b.charCodeAt(L+3)),x[E++]=F<<6|z,P|=z&s),P!==0)throw new Error("Base64Coder: incorrect characters for decoding");return x},k.prototype._encodeByte=function(b){var S=b;return S+=65,S+=25-b>>>8&6,S+=51-b>>>8&-75,S+=61-b>>>8&-15,S+=62-b>>>8&3,String.fromCharCode(S)},k.prototype._decodeChar=function(b){var S=s;return S+=(42-b&b-44)>>>8&-s+b-43+62,S+=(46-b&b-48)>>>8&-s+b-47+63,S+=(47-b&b-58)>>>8&-s+b-48+52,S+=(64-b&b-91)>>>8&-s+b-65+0,S+=(96-b&b-123)>>>8&-s+b-97+26,S},k.prototype._getPaddingLength=function(b){var S=0;if(this._paddingCharacter){for(var A=b.length-1;A>=0&&b[A]===this._paddingCharacter;A--)S++;if(b.length<4||S>2)throw new Error("Base64Coder: incorrect padding")}return S},k}();e.Coder=a;var u=new a;function c(k){return u.encode(k)}e.encode=c;function d(k){return u.decode(k)}e.decode=d;var h=function(k){o(b,k);function b(){return k!==null&&k.apply(this,arguments)||this}return b.prototype._encodeByte=function(S){var A=S;return A+=65,A+=25-S>>>8&6,A+=51-S>>>8&-75,A+=61-S>>>8&-13,A+=62-S>>>8&49,String.fromCharCode(A)},b.prototype._decodeChar=function(S){var A=s;return A+=(44-S&S-46)>>>8&-s+S-45+62,A+=(94-S&S-96)>>>8&-s+S-95+63,A+=(47-S&S-58)>>>8&-s+S-48+52,A+=(64-S&S-91)>>>8&-s+S-65+0,A+=(96-S&S-123)>>>8&-s+S-97+26,A},b}(a);e.URLSafeCoder=h;var p=new h;function y(k){return p.encode(k)}e.encodeURLSafe=y;function w(k){return p.decode(k)}e.decodeURLSafe=w,e.encodedLength=function(k){return u.encodedLength(k)},e.maxDecodedLength=function(k){return u.maxDecodedLength(k)},e.decodedLength=function(k){return u.decodedLength(k)}},function(r,e,i){Object.defineProperty(e,"__esModule",{value:!0});var o="utf8: invalid string",s="utf8: invalid source encoding";function a(d){for(var h=new Uint8Array(u(d)),p=0,y=0;y<d.length;y++){var w=d.charCodeAt(y);w<128?h[p++]=w:w<2048?(h[p++]=192|w>>6,h[p++]=128|w&63):w<55296?(h[p++]=224|w>>12,h[p++]=128|w>>6&63,h[p++]=128|w&63):(y++,w=(w&1023)<<10,w|=d.charCodeAt(y)&1023,w+=65536,h[p++]=240|w>>18,h[p++]=128|w>>12&63,h[p++]=128|w>>6&63,h[p++]=128|w&63)}return h}e.encode=a;function u(d){for(var h=0,p=0;p<d.length;p++){var y=d.charCodeAt(p);if(y<128)h+=1;else if(y<2048)h+=2;else if(y<55296)h+=3;else if(y<=57343){if(p>=d.length-1)throw new Error(o);p++,h+=4}else throw new Error(o)}return h}e.encodedLength=u;function c(d){for(var h=[],p=0;p<d.length;p++){var y=d[p];if(y&128){var w=void 0;if(y<224){if(p>=d.length)throw new Error(s);var k=d[++p];if((k&192)!==128)throw new Error(s);y=(y&31)<<6|k&63,w=128}else if(y<240){if(p>=d.length-1)throw new Error(s);var k=d[++p],b=d[++p];if((k&192)!==128||(b&192)!==128)throw new Error(s);y=(y&15)<<12|(k&63)<<6|b&63,w=2048}else if(y<248){if(p>=d.length-2)throw new Error(s);var k=d[++p],b=d[++p],S=d[++p];if((k&192)!==128||(b&192)!==128||(S&192)!==128)throw new Error(s);y=(y&15)<<18|(k&63)<<12|(b&63)<<6|S&63,w=65536}else throw new Error(s);if(y<w||y>=55296&&y<=57343)throw new Error(s);if(y>=65536){if(y>1114111)throw new Error(s);y-=65536,h.push(String.fromCharCode(55296|y>>10)),y=56320|y&1023}}h.push(String.fromCharCode(y))}return h.join("")}e.decode=c},function(r,e,i){r.exports=i(3).default},function(r,e,i){i.r(e);class o{constructor(l,m){this.lastId=0,this.prefix=l,this.name=m}create(l){this.lastId++;var m=this.lastId,C=this.prefix+m,_=this.name+"["+m+"]",T=!1,I=function(){T||(l.apply(null,arguments),T=!0)};return this[m]=I,{number:m,id:C,name:_,callback:I}}remove(l){delete this[l.number]}}var s=new o("_pusher_script_","Pusher.ScriptReceivers"),a={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:""},u=a;class c{constructor(l){this.options=l,this.receivers=l.receivers||s,this.loading={}}load(l,m,C){var _=this;if(_.loading[l]&&_.loading[l].length>0)_.loading[l].push(C);else{_.loading[l]=[C];var T=Z.createScriptRequest(_.getPath(l,m)),I=_.receivers.create(function(U){if(_.receivers.remove(I),_.loading[l]){var q=_.loading[l];delete _.loading[l];for(var ue=function(Re){Re||T.cleanup()},fe=0;fe<q.length;fe++)q[fe](U,ue)}});T.send(I)}}getRoot(l){var m,C=Z.getDocument().location.protocol;return l&&l.useTLS||C==="https:"?m=this.options.cdn_https:m=this.options.cdn_http,m.replace(/\/*$/,"")+"/"+this.options.version}getPath(l,m){return this.getRoot(m)+"/"+l+this.options.suffix+".js"}}var d=new o("_pusher_dependencies","Pusher.DependenciesReceivers"),h=new c({cdn_http:u.cdn_http,cdn_https:u.cdn_https,version:u.VERSION,suffix:u.dependency_suffix,receivers:d});const p={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 w={buildLogSuffix:function(f){const l="See:",m=p.urls[f];if(!m)return"";let C;return m.fullUrl?C=m.fullUrl:m.path&&(C=p.baseUrl+m.path),C?`${l} ${C}`:""}},k;(function(f){f.UserAuthentication="user-authentication",f.ChannelAuthorization="channel-authorization"})(k||(k={}));class b extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class S extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class A extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class x extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class E extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class L extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class P extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class H extends Error{constructor(l){super(l),Object.setPrototypeOf(this,new.target.prototype)}}class N extends Error{constructor(l,m){super(m),this.status=l,Object.setPrototypeOf(this,new.target.prototype)}}var z=function(f,l,m,C,_){const T=Z.createXHR();T.open("POST",m.endpoint,!0),T.setRequestHeader("Content-Type","application/x-www-form-urlencoded");for(var I in m.headers)T.setRequestHeader(I,m.headers[I]);if(m.headersProvider!=null){let U=m.headersProvider();for(var I in U)T.setRequestHeader(I,U[I])}return T.onreadystatechange=function(){if(T.readyState===4)if(T.status===200){let U,q=!1;try{U=JSON.parse(T.responseText),q=!0}catch{_(new N(200,`JSON returned from ${C.toString()} endpoint was invalid, yet status code was 200. Data was: ${T.responseText}`),null)}q&&_(null,U)}else{let U="";switch(C){case k.UserAuthentication:U=w.buildLogSuffix("authenticationEndpoint");break;case k.ChannelAuthorization:U=`Clients must be authorized to join private or presence channels. ${w.buildLogSuffix("authorizationEndpoint")}`;break}_(new N(T.status,`Unable to retrieve auth string from ${C.toString()} endpoint - received status: ${T.status} from ${m.endpoint}. ${U}`),null)}},T.send(l),T};function G(f){return Pe(te(f))}var V=String.fromCharCode,X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Be=function(f){var l=f.charCodeAt(0);return l<128?f:l<2048?V(192|l>>>6)+V(128|l&63):V(224|l>>>12&15)+V(128|l>>>6&63)+V(128|l&63)},te=function(f){return f.replace(/[^\x00-\x7F]/g,Be)},Ue=function(f){var l=[0,2,1][f.length%3],m=f.charCodeAt(0)<<16|(f.length>1?f.charCodeAt(1):0)<<8|(f.length>2?f.charCodeAt(2):0),C=[X.charAt(m>>>18),X.charAt(m>>>12&63),l>=2?"=":X.charAt(m>>>6&63),l>=1?"=":X.charAt(m&63)];return C.join("")},Pe=window.btoa||function(f){return f.replace(/[\s\S]{1,3}/g,Ue)};class pe{constructor(l,m,C,_){this.clear=m,this.timer=l(()=>{this.timer&&(this.timer=_(this.timer))},C)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var xe=pe;function Fe(f){window.clearTimeout(f)}function dn(f){window.clearInterval(f)}class Te extends xe{constructor(l,m){super(setTimeout,Fe,l,function(C){return m(),null})}}class gn extends xe{constructor(l,m){super(setInterval,dn,l,function(C){return m(),C})}}var Ge={now(){return Date.now?Date.now():new Date().valueOf()},defer(f){return new Te(0,f)},method(f,...l){var m=Array.prototype.slice.call(arguments,1);return function(C){return C[f].apply(C,m.concat(arguments))}}},ve=Ge;function K(f,...l){for(var m=0;m<l.length;m++){var C=l[m];for(var _ in C)C[_]&&C[_].constructor&&C[_].constructor===Object?f[_]=K(f[_]||{},C[_]):f[_]=C[_]}return f}function hn(){for(var f=["Pusher"],l=0;l<arguments.length;l++)typeof arguments[l]=="string"?f.push(arguments[l]):f.push(Ct(arguments[l]));return f.join(" : ")}function rn(f,l){var m=Array.prototype.indexOf;if(f===null)return-1;if(m&&f.indexOf===m)return f.indexOf(l);for(var C=0,_=f.length;C<_;C++)if(f[C]===l)return C;return-1}function De(f,l){for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&l(f[m],m,f)}function yn(f){var l=[];return De(f,function(m,C){l.push(C)}),l}function In(f){var l=[];return De(f,function(m){l.push(m)}),l}function mn(f,l,m){for(var C=0;C<f.length;C++)l.call(m||window,f[C],C,f)}function wn(f,l){for(var m=[],C=0;C<f.length;C++)m.push(l(f[C],C,f,m));return m}function Pn(f,l){var m={};return De(f,function(C,_){m[_]=l(C)}),m}function Rn(f,l){l=l||function(_){return!!_};for(var m=[],C=0;C<f.length;C++)l(f[C],C,f,m)&&m.push(f[C]);return m}function Kn(f,l){var m={};return De(f,function(C,_){(l&&l(C,_,f,m)||C)&&(m[_]=C)}),m}function wt(f){var l=[];return De(f,function(m,C){l.push([C,m])}),l}function jn(f,l){for(var m=0;m<f.length;m++)if(l(f[m],m,f))return!0;return!1}function Vn(f,l){for(var m=0;m<f.length;m++)if(!l(f[m],m,f))return!1;return!0}function Cn(f){return Pn(f,function(l){return typeof l=="object"&&(l=Ct(l)),encodeURIComponent(G(l.toString()))})}function zn(f){var l=Kn(f,function(C){return C!==void 0}),m=wn(wt(Cn(l)),ve.method("join","=")).join("&");return m}function to(f){var l=[],m=[];return function C(_,T){var I,U,q;switch(typeof _){case"object":if(!_)return null;for(I=0;I<l.length;I+=1)if(l[I]===_)return{$ref:m[I]};if(l.push(_),m.push(T),Object.prototype.toString.apply(_)==="[object Array]")for(q=[],I=0;I<_.length;I+=1)q[I]=C(_[I],T+"["+I+"]");else{q={};for(U in _)Object.prototype.hasOwnProperty.call(_,U)&&(q[U]=C(_[U],T+"["+JSON.stringify(U)+"]"))}return q;case"number":case"string":case"boolean":return _}}(f,"$")}function Ct(f){try{return JSON.stringify(f)}catch{return JSON.stringify(to(f))}}class ga{constructor(){this.globalLog=l=>{window.console&&window.console.log&&window.console.log(l)}}debug(...l){this.log(this.globalLog,l)}warn(...l){this.log(this.globalLogWarn,l)}error(...l){this.log(this.globalLogError,l)}globalLogWarn(l){window.console&&window.console.warn?window.console.warn(l):this.globalLog(l)}globalLogError(l){window.console&&window.console.error?window.console.error(l):this.globalLogWarn(l)}log(l,...m){var C=hn.apply(this,arguments);Ea.log?Ea.log(C):Ea.logToConsole&&l.bind(this)(C)}}var ce=new ga,$n=function(f,l,m,C,_){(m.headers!==void 0||m.headersProvider!=null)&&ce.warn(`To send headers with the ${C.toString()} request, you must use AJAX, rather than JSONP.`);var T=f.nextAuthCallbackID.toString();f.nextAuthCallbackID++;var I=f.getDocument(),U=I.createElement("script");f.auth_callbacks[T]=function(fe){_(null,fe)};var q="Pusher.auth_callbacks['"+T+"']";U.src=m.endpoint+"?callback="+encodeURIComponent(q)+"&"+l;var ue=I.getElementsByTagName("head")[0]||I.documentElement;ue.insertBefore(U,ue.firstChild)},ya=$n;class io{constructor(l){this.src=l}send(l){var m=this,C="Error loading "+m.src;m.script=document.createElement("script"),m.script.id=l.id,m.script.src=m.src,m.script.type="text/javascript",m.script.charset="UTF-8",m.script.addEventListener?(m.script.onerror=function(){l.callback(C)},m.script.onload=function(){l.callback(null)}):m.script.onreadystatechange=function(){(m.script.readyState==="loaded"||m.script.readyState==="complete")&&l.callback(null)},m.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(m.errorScript=document.createElement("script"),m.errorScript.id=l.id+"_error",m.errorScript.text=l.name+"('"+C+"');",m.script.async=m.errorScript.async=!1):m.script.async=!0;var _=document.getElementsByTagName("head")[0];_.insertBefore(m.script,_.firstChild),m.errorScript&&_.insertBefore(m.errorScript,m.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 ro{constructor(l,m){this.url=l,this.data=m}send(l){if(!this.request){var m=zn(this.data),C=this.url+"/"+l.number+"?"+m;this.request=Z.createScriptRequest(C),this.request.send(l)}}cleanup(){this.request&&this.request.cleanup()}}var Pi=function(f,l){return function(m,C){var _="http"+(l?"s":"")+"://",T=_+(f.host||f.options.host)+f.options.path,I=Z.createJSONPRequest(T,m),U=Z.ScriptReceivers.create(function(q,ue){s.remove(U),I.cleanup(),ue&&ue.host&&(f.host=ue.host),C&&C(q,ue)});I.send(U)}},Yt={name:"jsonp",getAgent:Pi},St=Yt;function Xt(f,l,m){var C=f+(l.useTLS?"s":""),_=l.useTLS?l.hostTLS:l.hostNonTLS;return C+"://"+_+m}function kt(f,l){var m="/app/"+f,C="?protocol="+u.PROTOCOL+"&client=js&version="+u.VERSION+(l?"&"+l:"");return m+C}var de={getInitial:function(f,l){var m=(l.httpPath||"")+kt(f,"flash=false");return Xt("ws",l,m)}},nn={getInitial:function(f,l){var m=(l.httpPath||"/pusher")+kt(f);return Xt("http",l,m)}},j={getInitial:function(f,l){return Xt("http",l,l.httpPath||"/pusher")},getPath:function(f,l){return kt(f)}};class Se{constructor(){this._callbacks={}}get(l){return this._callbacks[Ri(l)]}add(l,m,C){var _=Ri(l);this._callbacks[_]=this._callbacks[_]||[],this._callbacks[_].push({fn:m,context:C})}remove(l,m,C){if(!l&&!m&&!C){this._callbacks={};return}var _=l?[Ri(l)]:yn(this._callbacks);m||C?this.removeCallback(_,m,C):this.removeAllCallbacks(_)}removeCallback(l,m,C){mn(l,function(_){this._callbacks[_]=Rn(this._callbacks[_]||[],function(T){return m&&m!==T.fn||C&&C!==T.context}),this._callbacks[_].length===0&&delete this._callbacks[_]},this)}removeAllCallbacks(l){mn(l,function(m){delete this._callbacks[m]},this)}}function Ri(f){return"_"+f}class Sn{constructor(l){this.callbacks=new Se,this.global_callbacks=[],this.failThrough=l}bind(l,m,C){return this.callbacks.add(l,m,C),this}bind_global(l){return this.global_callbacks.push(l),this}unbind(l,m,C){return this.callbacks.remove(l,m,C),this}unbind_global(l){return l?(this.global_callbacks=Rn(this.global_callbacks||[],m=>m!==l),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(l,m,C){for(var _=0;_<this.global_callbacks.length;_++)this.global_callbacks[_](l,m);var T=this.callbacks.get(l),I=[];if(C?I.push(m,C):m&&I.push(m),T&&T.length>0)for(var _=0;_<T.length;_++)T[_].fn.apply(T[_].context||window,I);else this.failThrough&&this.failThrough(l,m);return this}}class wa extends Sn{constructor(l,m,C,_,T){super(),this.initialize=Z.transportConnectionInitializer,this.hooks=l,this.name=m,this.priority=C,this.key=_,this.options=T,this.state="new",this.timeline=T.timeline,this.activityTimeout=T.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 l=this.hooks.urls.getInitial(this.key,this.options);try{this.socket=this.hooks.getSocket(l,this.options)}catch(m){return ve.defer(()=>{this.onError(m),this.changeState("closed")}),!1}return this.bindListeners(),ce.debug("Connecting",{transport:this.name,url:l}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(l){return this.state==="open"?(ve.defer(()=>{this.socket&&this.socket.send(l)}),!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(l){this.emit("error",{type:"WebSocketError",error:l}),this.timeline.error(this.buildTimelineMessage({error:l.toString()}))}onClose(l){l?this.changeState("closed",{code:l.code,reason:l.reason,wasClean:l.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(l){this.emit("message",l)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=l=>{this.onError(l)},this.socket.onclose=l=>{this.onClose(l)},this.socket.onmessage=l=>{this.onMessage(l)},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(l,m){this.state=l,this.timeline.info(this.buildTimelineMessage({state:l,params:m})),this.emit(l,m)}buildTimelineMessage(l){return K({cid:this.id},l)}}class ct{constructor(l){this.hooks=l}isSupported(l){return this.hooks.isSupported(l)}createConnection(l,m,C,_){return new wa(this.hooks,l,m,C,_)}}var e0=new ct({urls:de,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!Z.getWebSocketAPI()},isSupported:function(){return!!Z.getWebSocketAPI()},getSocket:function(f){return Z.createWebSocket(f)}}),Wd={urls:nn,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},qd=K({getSocket:function(f){return Z.HTTPFactory.createStreamingSocket(f)}},Wd),Zd=K({getSocket:function(f){return Z.HTTPFactory.createPollingSocket(f)}},Wd),Jd={isSupported:function(){return Z.isXHRSupported()}},n0=new ct(K({},qd,Jd)),t0=new ct(K({},Zd,Jd)),i0={ws:e0,xhr_streaming:n0,xhr_polling:t0},oo=i0,r0=new ct({file:"sockjs",urls:j,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(f,l){return new window.SockJS(f,null,{js_path:h.getPath("sockjs",{useTLS:l.useTLS}),ignore_null_origin:l.ignoreNullOrigin})},beforeOpen:function(f,l){f.send(JSON.stringify({path:l}))}}),Yd={isSupported:function(f){var l=Z.isXDRSupported(f.useTLS);return l}},o0=new ct(K({},qd,Yd)),s0=new ct(K({},Zd,Yd));oo.xdr_streaming=o0,oo.xdr_polling=s0,oo.sockjs=r0;var a0=oo;class u0 extends Sn{constructor(){super();var l=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){l.emit("online")},!1),window.addEventListener("offline",function(){l.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var l0=new u0;class c0{constructor(l,m,C){this.manager=l,this.transport=m,this.minPingDelay=C.minPingDelay,this.maxPingDelay=C.maxPingDelay,this.pingDelay=void 0}createConnection(l,m,C,_){_=K({},_,{activityTimeout:this.pingDelay});var T=this.transport.createConnection(l,m,C,_),I=null,U=function(){T.unbind("open",U),T.bind("closed",q),I=ve.now()},q=ue=>{if(T.unbind("closed",q),ue.code===1002||ue.code===1003)this.manager.reportDeath();else if(!ue.wasClean&&I){var fe=ve.now()-I;fe<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(fe/2,this.minPingDelay))}};return T.bind("open",U),T}isSupported(l){return this.manager.isAlive()&&this.transport.isSupported(l)}}const Xd={decodeMessage:function(f){try{var l=JSON.parse(f.data),m=l.data;if(typeof m=="string")try{m=JSON.parse(l.data)}catch{}var C={event:l.event,channel:l.channel,data:m};return l.user_id&&(C.user_id=l.user_id),C}catch(_){throw{type:"MessageParseError",error:_,data:f.data}}},encodeMessage:function(f){return JSON.stringify(f)},processHandshake:function(f){var l=Xd.decodeMessage(f);if(l.event==="pusher:connection_established"){if(!l.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:l.data.socket_id,activityTimeout:l.data.activity_timeout*1e3}}else{if(l.event==="pusher:error")return{action:this.getCloseAction(l.data),error:this.getCloseError(l.data)};throw"Invalid handshake"}},getCloseAction:function(f){return f.code<4e3?f.code>=1002&&f.code<=1004?"backoff":null:f.code===4e3?"tls_only":f.code<4100?"refused":f.code<4200?"backoff":f.code<4300?"retry":"refused"},getCloseError:function(f){return f.code!==1e3&&f.code!==1001?{type:"PusherError",data:{code:f.code,message:f.reason||f.message}}:null}};var _t=Xd;class d0 extends Sn{constructor(l,m){super(),this.id=l,this.transport=m,this.activityTimeout=m.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(l){return this.transport.send(l)}send_event(l,m,C){var _={event:l,data:m};return C&&(_.channel=C),ce.debug("Event sent",_),this.send(_t.encodeMessage(_))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var l={message:C=>{var _;try{_=_t.decodeMessage(C)}catch(T){this.emit("error",{type:"MessageParseError",error:T,data:C.data})}if(_!==void 0){switch(ce.debug("Event recd",_),_.event){case"pusher:error":this.emit("error",{type:"PusherError",data:_.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",_)}},activity:()=>{this.emit("activity")},error:C=>{this.emit("error",C)},closed:C=>{m(),C&&C.code&&this.handleCloseEvent(C),this.transport=null,this.emit("closed")}},m=()=>{De(l,(C,_)=>{this.transport.unbind(_,C)})};De(l,(C,_)=>{this.transport.bind(_,C)})}handleCloseEvent(l){var m=_t.getCloseAction(l),C=_t.getCloseError(l);C&&this.emit("error",C),m&&this.emit(m,{action:m,error:C})}}class h0{constructor(l,m){this.transport=l,this.callback=m,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=l=>{this.unbindListeners();var m;try{m=_t.processHandshake(l)}catch(C){this.finish("error",{error:C}),this.transport.close();return}m.action==="connected"?this.finish("connected",{connection:new d0(m.id,this.transport),activityTimeout:m.activityTimeout}):(this.finish(m.action,{error:m.error}),this.transport.close())},this.onClosed=l=>{this.unbindListeners();var m=_t.getCloseAction(l)||"backoff",C=_t.getCloseError(l);this.finish(m,{error:C})},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(l,m){this.callback(K({transport:this.transport,action:l},m))}}class m0{constructor(l,m){this.timeline=l,this.options=m||{}}send(l,m){this.timeline.isEmpty()||this.timeline.send(Z.TimelineTransport.getAgent(this,l),m)}}class Ca extends Sn{constructor(l,m){super(function(C,_){ce.debug("No callbacks on "+l+" for "+C)}),this.name=l,this.pusher=m,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(l,m){return m(null,{auth:""})}trigger(l,m){if(l.indexOf("client-")!==0)throw new b("Event '"+l+"' does not start with 'client-'");if(!this.subscribed){var C=w.buildLogSuffix("triggeringClientEvents");ce.warn(`Client event triggered before channel 'subscription_succeeded' event . ${C}`)}return this.pusher.send_event(l,m,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(l){var m=l.event,C=l.data;if(m==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(l);else if(m==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(l);else if(m.indexOf("pusher_internal:")!==0){var _={};this.emit(m,C,_)}}handleSubscriptionSucceededEvent(l){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",l.data)}handleSubscriptionCountEvent(l){l.data.subscription_count&&(this.subscriptionCount=l.data.subscription_count),this.emit("pusher:subscription_count",l.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(l,m)=>{l?(this.subscriptionPending=!1,ce.error(l.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:l.message},l instanceof N?{status:l.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:m.auth,channel_data:m.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 Sa extends Ca{authorize(l,m){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:l},m)}}class f0{constructor(){this.reset()}get(l){return Object.prototype.hasOwnProperty.call(this.members,l)?{id:l,info:this.members[l]}:null}each(l){De(this.members,(m,C)=>{l(this.get(C))})}setMyID(l){this.myID=l}onSubscription(l){this.members=l.presence.hash,this.count=l.presence.count,this.me=this.get(this.myID)}addMember(l){return this.get(l.user_id)===null&&this.count++,this.members[l.user_id]=l.user_info,this.get(l.user_id)}removeMember(l){var m=this.get(l.user_id);return m&&(delete this.members[l.user_id],this.count--),m}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var p0=function(f,l,m,C){function _(T){return T instanceof m?T:new m(function(I){I(T)})}return new(m||(m=Promise))(function(T,I){function U(fe){try{ue(C.next(fe))}catch(Re){I(Re)}}function q(fe){try{ue(C.throw(fe))}catch(Re){I(Re)}}function ue(fe){fe.done?T(fe.value):_(fe.value).then(U,q)}ue((C=C.apply(f,l||[])).next())})};class v0 extends Sa{constructor(l,m){super(l,m),this.members=new f0}authorize(l,m){super.authorize(l,(C,_)=>p0(this,void 0,void 0,function*(){if(!C)if(_=_,_.channel_data!=null){var T=JSON.parse(_.channel_data);this.members.setMyID(T.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 I=w.buildLogSuffix("authorizationEndpoint");ce.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${I}, or the user should be signed in.`),m("Invalid auth response");return}m(C,_)}))}handleEvent(l){var m=l.event;if(m.indexOf("pusher_internal:")===0)this.handleInternalEvent(l);else{var C=l.data,_={};l.user_id&&(_.user_id=l.user_id),this.emit(m,C,_)}}handleInternalEvent(l){var m=l.event,C=l.data;switch(m){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(l);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(l);break;case"pusher_internal:member_added":var _=this.members.addMember(C);this.emit("pusher:member_added",_);break;case"pusher_internal:member_removed":var T=this.members.removeMember(C);T&&this.emit("pusher:member_removed",T);break}}handleSubscriptionSucceededEvent(l){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(l.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var b0=i(1),ka=i(0);class g0 extends Sa{constructor(l,m,C){super(l,m),this.key=null,this.nacl=C}authorize(l,m){super.authorize(l,(C,_)=>{if(C){m(C,_);return}let T=_.shared_secret;if(!T){m(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(ka.decode)(T),delete _.shared_secret,m(null,_)})}trigger(l,m){throw new L("Client events are not currently supported for encrypted channels")}handleEvent(l){var m=l.event,C=l.data;if(m.indexOf("pusher_internal:")===0||m.indexOf("pusher:")===0){super.handleEvent(l);return}this.handleEncryptedEvent(m,C)}handleEncryptedEvent(l,m){if(!this.key){ce.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!m.ciphertext||!m.nonce){ce.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+m);return}let C=Object(ka.decode)(m.ciphertext);if(C.length<this.nacl.secretbox.overheadLength){ce.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${C.length}`);return}let _=Object(ka.decode)(m.nonce);if(_.length<this.nacl.secretbox.nonceLength){ce.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${_.length}`);return}let T=this.nacl.secretbox.open(C,_,this.key);if(T===null){ce.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,(I,U)=>{if(I){ce.error(`Failed to make a request to the authEndpoint: ${U}. Unable to fetch new key, so dropping encrypted event`);return}if(T=this.nacl.secretbox.open(C,_,this.key),T===null){ce.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(l,this.getDataToEmit(T))});return}this.emit(l,this.getDataToEmit(T))}getDataToEmit(l){let m=Object(b0.decode)(l);try{return JSON.parse(m)}catch{return m}}}class y0 extends Sn{constructor(l,m){super(),this.state="initialized",this.connection=null,this.key=l,this.options=m,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 C=Z.getNetwork();C.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),C.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(l){return this.connection?this.connection.send(l):!1}send_event(l,m,C){return this.connection?this.connection.send_event(l,m,C):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var l=(m,C)=>{m?this.runner=this.strategy.connect(0,l):C.action==="error"?(this.emit("error",{type:"HandshakeError",error:C.error}),this.timeline.error({handshakeError:C.error})):(this.abortConnecting(),this.handshakeCallbacks[C.action](C))};this.runner=this.strategy.connect(0,l)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var l=this.abandonConnection();l.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(l){this.timeline.info({action:"retry",delay:l}),l>0&&this.emit("connecting_in",Math.round(l/1e3)),this.retryTimer=new Te(l||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new Te(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new Te(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 Te(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(l){return K({},l,{message:m=>{this.resetActivityCheck(),this.emit("message",m)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:m=>{this.emit("error",m)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(l){return K({},l,{connected:m=>{this.activityTimeout=Math.min(this.options.activityTimeout,m.activityTimeout,m.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(m.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let l=m=>C=>{C.error&&this.emit("error",{type:"WebSocketError",error:C.error}),m(C)};return{tls_only:l(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:l(()=>{this.disconnect()}),backoff:l(()=>{this.retryIn(1e3)}),retry:l(()=>{this.retryIn(0)})}}setConnection(l){this.connection=l;for(var m in this.connectionCallbacks)this.connection.bind(m,this.connectionCallbacks[m]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var l in this.connectionCallbacks)this.connection.unbind(l,this.connectionCallbacks[l]);var m=this.connection;return this.connection=null,m}}updateState(l,m){var C=this.state;if(this.state=l,C!==l){var _=l;_==="connected"&&(_+=" with new socket ID "+m.socket_id),ce.debug("State changed",C+" -> "+_),this.timeline.info({state:l,params:m}),this.emit("state_change",{previous:C,current:l}),this.emit(l,m)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class w0{constructor(){this.channels={}}add(l,m){return this.channels[l]||(this.channels[l]=C0(l,m)),this.channels[l]}all(){return In(this.channels)}find(l){return this.channels[l]}remove(l){var m=this.channels[l];return delete this.channels[l],m}disconnect(){De(this.channels,function(l){l.disconnect()})}}function C0(f,l){if(f.indexOf("private-encrypted-")===0){if(l.config.nacl)return Wn.createEncryptedChannel(f,l,l.config.nacl);let m="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",C=w.buildLogSuffix("encryptedChannelSupport");throw new L(`${m}. ${C}`)}else{if(f.indexOf("private-")===0)return Wn.createPrivateChannel(f,l);if(f.indexOf("presence-")===0)return Wn.createPresenceChannel(f,l);if(f.indexOf("#")===0)throw new S('Cannot create a channel with name "'+f+'".');return Wn.createChannel(f,l)}}var S0={createChannels(){return new w0},createConnectionManager(f,l){return new y0(f,l)},createChannel(f,l){return new Ca(f,l)},createPrivateChannel(f,l){return new Sa(f,l)},createPresenceChannel(f,l){return new v0(f,l)},createEncryptedChannel(f,l,m){return new g0(f,l,m)},createTimelineSender(f,l){return new m0(f,l)},createHandshake(f,l){return new h0(f,l)},createAssistantToTheTransportManager(f,l,m){return new c0(f,l,m)}},Wn=S0;class Qd{constructor(l){this.options=l||{},this.livesLeft=this.options.lives||1/0}getAssistant(l){return Wn.createAssistantToTheTransportManager(this,l,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class At{constructor(l,m){this.strategies=l,this.loop=!!m.loop,this.failFast=!!m.failFast,this.timeout=m.timeout,this.timeoutLimit=m.timeoutLimit}isSupported(){return jn(this.strategies,ve.method("isSupported"))}connect(l,m){var C=this.strategies,_=0,T=this.timeout,I=null,U=(q,ue)=>{ue?m(null,ue):(_=_+1,this.loop&&(_=_%C.length),_<C.length?(T&&(T=T*2,this.timeoutLimit&&(T=Math.min(T,this.timeoutLimit))),I=this.tryStrategy(C[_],l,{timeout:T,failFast:this.failFast},U)):m(!0))};return I=this.tryStrategy(C[_],l,{timeout:T,failFast:this.failFast},U),{abort:function(){I.abort()},forceMinPriority:function(q){l=q,I&&I.forceMinPriority(q)}}}tryStrategy(l,m,C,_){var T=null,I=null;return C.timeout>0&&(T=new Te(C.timeout,function(){I.abort(),_(!0)})),I=l.connect(m,function(U,q){U&&T&&T.isRunning()&&!C.failFast||(T&&T.ensureAborted(),_(U,q))}),{abort:function(){T&&T.ensureAborted(),I.abort()},forceMinPriority:function(U){I.forceMinPriority(U)}}}}class _a{constructor(l){this.strategies=l}isSupported(){return jn(this.strategies,ve.method("isSupported"))}connect(l,m){return k0(this.strategies,l,function(C,_){return function(T,I){if(_[C].error=T,T){_0(_)&&m(!0);return}mn(_,function(U){U.forceMinPriority(I.transport.priority)}),m(null,I)}})}}function k0(f,l,m){var C=wn(f,function(_,T,I,U){return _.connect(l,m(T,U))});return{abort:function(){mn(C,A0)},forceMinPriority:function(_){mn(C,function(T){T.forceMinPriority(_)})}}}function _0(f){return Vn(f,function(l){return!!l.error})}function A0(f){!f.error&&!f.aborted&&(f.abort(),f.aborted=!0)}class x0{constructor(l,m,C){this.strategy=l,this.transports=m,this.ttl=C.ttl||1800*1e3,this.usingTLS=C.useTLS,this.timeline=C.timeline}isSupported(){return this.strategy.isSupported()}connect(l,m){var C=this.usingTLS,_=M0(C),T=_&&_.cacheSkipCount?_.cacheSkipCount:0,I=[this.strategy];if(_&&_.timestamp+this.ttl>=ve.now()){var U=this.transports[_.transport];U&&(["ws","wss"].includes(_.transport)||T>3?(this.timeline.info({cached:!0,transport:_.transport,latency:_.latency}),I.push(new At([U],{timeout:_.latency*2+1e3,failFast:!0}))):T++)}var q=ve.now(),ue=I.pop().connect(l,function fe(Re,uo){Re?(eh(C),I.length>0?(q=ve.now(),ue=I.pop().connect(l,fe)):m(Re)):(E0(C,uo.transport.name,ve.now()-q,T),m(null,uo))});return{abort:function(){ue.abort()},forceMinPriority:function(fe){l=fe,ue&&ue.forceMinPriority(fe)}}}}function Aa(f){return"pusherTransport"+(f?"TLS":"NonTLS")}function M0(f){var l=Z.getLocalStorage();if(l)try{var m=l[Aa(f)];if(m)return JSON.parse(m)}catch{eh(f)}return null}function E0(f,l,m,C){var _=Z.getLocalStorage();if(_)try{_[Aa(f)]=Ct({timestamp:ve.now(),transport:l,latency:m,cacheSkipCount:C})}catch{}}function eh(f){var l=Z.getLocalStorage();if(l)try{delete l[Aa(f)]}catch{}}class so{constructor(l,{delay:m}){this.strategy=l,this.options={delay:m}}isSupported(){return this.strategy.isSupported()}connect(l,m){var C=this.strategy,_,T=new Te(this.options.delay,function(){_=C.connect(l,m)});return{abort:function(){T.ensureAborted(),_&&_.abort()},forceMinPriority:function(I){l=I,_&&_.forceMinPriority(I)}}}}class Oi{constructor(l,m,C){this.test=l,this.trueBranch=m,this.falseBranch=C}isSupported(){var l=this.test()?this.trueBranch:this.falseBranch;return l.isSupported()}connect(l,m){var C=this.test()?this.trueBranch:this.falseBranch;return C.connect(l,m)}}class L0{constructor(l){this.strategy=l}isSupported(){return this.strategy.isSupported()}connect(l,m){var C=this.strategy.connect(l,function(_,T){T&&C.abort(),m(_,T)});return C}}function Ni(f){return function(){return f.isSupported()}}var T0=function(f,l,m){var C={};function _(dh,Ly,Ty,Iy,Py){var hh=m(f,dh,Ly,Ty,Iy,Py);return C[dh]=hh,hh}var T=Object.assign({},l,{hostNonTLS:f.wsHost+":"+f.wsPort,hostTLS:f.wsHost+":"+f.wssPort,httpPath:f.wsPath}),I=Object.assign({},T,{useTLS:!0}),U=Object.assign({},l,{hostNonTLS:f.httpHost+":"+f.httpPort,hostTLS:f.httpHost+":"+f.httpsPort,httpPath:f.httpPath}),q={loop:!0,timeout:15e3,timeoutLimit:6e4},ue=new Qd({minPingDelay:1e4,maxPingDelay:f.activityTimeout}),fe=new Qd({lives:2,minPingDelay:1e4,maxPingDelay:f.activityTimeout}),Re=_("ws","ws",3,T,ue),uo=_("wss","ws",3,I,ue),_y=_("sockjs","sockjs",1,U),oh=_("xhr_streaming","xhr_streaming",1,U,fe),Ay=_("xdr_streaming","xdr_streaming",1,U,fe),sh=_("xhr_polling","xhr_polling",1,U),xy=_("xdr_polling","xdr_polling",1,U),ah=new At([Re],q),My=new At([uo],q),Ey=new At([_y],q),uh=new At([new Oi(Ni(oh),oh,Ay)],q),lh=new At([new Oi(Ni(sh),sh,xy)],q),ch=new At([new Oi(Ni(uh),new _a([uh,new so(lh,{delay:4e3})]),lh)],q),La=new Oi(Ni(ch),ch,Ey),Ta;return l.useTLS?Ta=new _a([ah,new so(La,{delay:2e3})]):Ta=new _a([ah,new so(My,{delay:2e3}),new so(La,{delay:5e3})]),new x0(new L0(new Oi(Ni(Re),Ta,La)),C,{ttl:18e5,timeline:l.timeline,useTLS:l.useTLS})},I0=T0,P0=function(){var f=this;f.timeline.info(f.buildTimelineMessage({transport:f.name+(f.options.useTLS?"s":"")})),f.hooks.isInitialized()?f.changeState("initialized"):f.hooks.file?(f.changeState("initializing"),h.load(f.hooks.file,{useTLS:f.options.useTLS},function(l,m){f.hooks.isInitialized()?(f.changeState("initialized"),m(!0)):(l&&f.onError(l),f.onClose(),m(!1))})):f.onClose()},R0={getRequest:function(f){var l=new window.XDomainRequest;return l.ontimeout=function(){f.emit("error",new A),f.close()},l.onerror=function(m){f.emit("error",m),f.close()},l.onprogress=function(){l.responseText&&l.responseText.length>0&&f.onChunk(200,l.responseText)},l.onload=function(){l.responseText&&l.responseText.length>0&&f.onChunk(200,l.responseText),f.emit("finished",200),f.close()},l},abortRequest:function(f){f.ontimeout=f.onerror=f.onprogress=f.onload=null,f.abort()}},O0=R0;const N0=256*1024;class B0 extends Sn{constructor(l,m,C){super(),this.hooks=l,this.method=m,this.url=C}start(l){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},Z.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(l)}close(){this.unloader&&(Z.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(l,m){for(;;){var C=this.advanceBuffer(m);if(C)this.emit("chunk",{status:l,data:C});else break}this.isBufferTooLong(m)&&this.emit("buffer_too_long")}advanceBuffer(l){var m=l.slice(this.position),C=m.indexOf(`
924
+ `);return C!==-1?(this.position+=C+1,m.slice(0,C)):null}isBufferTooLong(l){return this.position===l.length&&l.length>N0}}var xa;(function(f){f[f.CONNECTING=0]="CONNECTING",f[f.OPEN=1]="OPEN",f[f.CLOSED=3]="CLOSED"})(xa||(xa={}));var xt=xa,D0=1;class H0{constructor(l,m){this.hooks=l,this.session=th(1e3)+"/"+K0(8),this.location=U0(m),this.readyState=xt.CONNECTING,this.openStream()}send(l){return this.sendRaw(JSON.stringify([l]))}ping(){this.hooks.sendHeartbeat(this)}close(l,m){this.onClose(l,m,!0)}sendRaw(l){if(this.readyState===xt.OPEN)try{return Z.createSocketRequest("POST",nh(F0(this.location,this.session))).start(l),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(l,m,C){this.closeStream(),this.readyState=xt.CLOSED,this.onclose&&this.onclose({code:l,reason:m,wasClean:C})}onChunk(l){if(l.status===200){this.readyState===xt.OPEN&&this.onActivity();var m,C=l.data.slice(0,1);switch(C){case"o":m=JSON.parse(l.data.slice(1)||"{}"),this.onOpen(m);break;case"a":m=JSON.parse(l.data.slice(1)||"[]");for(var _=0;_<m.length;_++)this.onEvent(m[_]);break;case"m":m=JSON.parse(l.data.slice(1)||"null"),this.onEvent(m);break;case"h":this.hooks.onHeartbeat(this);break;case"c":m=JSON.parse(l.data.slice(1)||"[]"),this.onClose(m[0],m[1],!0);break}}}onOpen(l){this.readyState===xt.CONNECTING?(l&&l.hostname&&(this.location.base=G0(this.location.base,l.hostname)),this.readyState=xt.OPEN,this.onopen&&this.onopen()):this.onClose(1006,"Server lost session",!0)}onEvent(l){this.readyState===xt.OPEN&&this.onmessage&&this.onmessage({data:l})}onActivity(){this.onactivity&&this.onactivity()}onError(l){this.onerror&&this.onerror(l)}openStream(){this.stream=Z.createSocketRequest("POST",nh(this.hooks.getReceiveURL(this.location,this.session))),this.stream.bind("chunk",l=>{this.onChunk(l)}),this.stream.bind("finished",l=>{this.hooks.onFinished(this,l)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(l){ve.defer(()=>{this.onError(l),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function U0(f){var l=/([^\?]*)\/*(\??.*)/.exec(f);return{base:l[1],queryString:l[2]}}function F0(f,l){return f.base+"/"+l+"/xhr_send"}function nh(f){var l=f.indexOf("?")===-1?"?":"&";return f+l+"t="+ +new Date+"&n="+D0++}function G0(f,l){var m=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(f);return m[1]+l+m[3]}function th(f){return Z.randomInt(f)}function K0(f){for(var l=[],m=0;m<f;m++)l.push(th(32).toString(32));return l.join("")}var j0=H0,V0={getReceiveURL:function(f,l){return f.base+"/"+l+"/xhr_streaming"+f.queryString},onHeartbeat:function(f){f.sendRaw("[]")},sendHeartbeat:function(f){f.sendRaw("[]")},onFinished:function(f,l){f.onClose(1006,"Connection interrupted ("+l+")",!1)}},z0=V0,$0={getReceiveURL:function(f,l){return f.base+"/"+l+"/xhr"+f.queryString},onHeartbeat:function(){},sendHeartbeat:function(f){f.sendRaw("[]")},onFinished:function(f,l){l===200?f.reconnect():f.onClose(1006,"Connection interrupted ("+l+")",!1)}},W0=$0,q0={getRequest:function(f){var l=Z.getXHRAPI(),m=new l;return m.onreadystatechange=m.onprogress=function(){switch(m.readyState){case 3:m.responseText&&m.responseText.length>0&&f.onChunk(m.status,m.responseText);break;case 4:m.responseText&&m.responseText.length>0&&f.onChunk(m.status,m.responseText),f.emit("finished",m.status),f.close();break}},m},abortRequest:function(f){f.onreadystatechange=null,f.abort()}},Z0=q0,J0={createStreamingSocket(f){return this.createSocket(z0,f)},createPollingSocket(f){return this.createSocket(W0,f)},createSocket(f,l){return new j0(f,l)},createXHR(f,l){return this.createRequest(Z0,f,l)},createRequest(f,l,m){return new B0(f,l,m)}},ih=J0;ih.createXDR=function(f,l){return this.createRequest(O0,f,l)};var Y0=ih,X0={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:s,DependenciesReceivers:d,getDefaultStrategy:I0,Transports:a0,transportConnectionInitializer:P0,HTTPFactory:Y0,TimelineTransport:St,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(f){window.Pusher=f;var l=()=>{this.onDocumentBody(f.ready)};window.JSON?l():h.load("json2",{},l)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:z,jsonp:ya}},onDocumentBody(f){document.body?f():setTimeout(()=>{this.onDocumentBody(f)},0)},createJSONPRequest(f,l){return new ro(f,l)},createScriptRequest(f){return new io(f)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var f=this.getXHRAPI();return new f},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return l0},createWebSocket(f){var l=this.getWebSocketAPI();return new l(f)},createSocketRequest(f,l){if(this.isXHRSupported())return this.HTTPFactory.createXHR(f,l);if(this.isXDRSupported(l.indexOf("https:")===0))return this.HTTPFactory.createXDR(f,l);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var f=this.getXHRAPI();return!!f&&new f().withCredentials!==void 0},isXDRSupported(f){var l=f?"https:":"http:",m=this.getProtocol();return!!window.XDomainRequest&&m===l},addUnloadListener(f){window.addEventListener!==void 0?window.addEventListener("unload",f,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",f)},removeUnloadListener(f){window.addEventListener!==void 0?window.removeEventListener("unload",f,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",f)},randomInt(f){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*f)}},Z=X0,Ma;(function(f){f[f.ERROR=3]="ERROR",f[f.INFO=6]="INFO",f[f.DEBUG=7]="DEBUG"})(Ma||(Ma={}));var ao=Ma;class Q0{constructor(l,m,C){this.key=l,this.session=m,this.events=[],this.options=C||{},this.sent=0,this.uniqueID=0}log(l,m){l<=this.options.level&&(this.events.push(K({},m,{timestamp:ve.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(l){this.log(ao.ERROR,l)}info(l){this.log(ao.INFO,l)}debug(l){this.log(ao.DEBUG,l)}isEmpty(){return this.events.length===0}send(l,m){var C=K({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=[],l(C,(_,T)=>{_||this.sent++,m&&m(_,T)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class ey{constructor(l,m,C,_){this.name=l,this.priority=m,this.transport=C,this.options=_||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(l,m){if(this.isSupported()){if(this.priority<l)return rh(new x,m)}else return rh(new H,m);var C=!1,_=this.transport.createConnection(this.name,this.priority,this.options.key,this.options),T=null,I=function(){_.unbind("initialized",I),_.connect()},U=function(){T=Wn.createHandshake(_,function(Re){C=!0,fe(),m(null,Re)})},q=function(Re){fe(),m(Re)},ue=function(){fe();var Re;Re=Ct(_),m(new E(Re))},fe=function(){_.unbind("initialized",I),_.unbind("open",U),_.unbind("error",q),_.unbind("closed",ue)};return _.bind("initialized",I),_.bind("open",U),_.bind("error",q),_.bind("closed",ue),_.initialize(),{abort:()=>{C||(fe(),T?T.close():_.close())},forceMinPriority:Re=>{C||this.priority<Re&&(T?T.close():_.close())}}}}function rh(f,l){return ve.defer(function(){l(f)}),{abort:function(){},forceMinPriority:function(){}}}const{Transports:ny}=Z;var ty=function(f,l,m,C,_,T){var I=ny[m];if(!I)throw new P(m);var U=(!f.enabledTransports||rn(f.enabledTransports,l)!==-1)&&(!f.disabledTransports||rn(f.disabledTransports,l)===-1),q;return U?(_=Object.assign({ignoreNullOrigin:f.ignoreNullOrigin},_),q=new ey(l,C,T?T.getAssistant(I):I,_)):q=iy,q},iy={isSupported:function(){return!1},connect:function(f,l){var m=ve.defer(function(){l(new H)});return{abort:function(){m.ensureAborted()},forceMinPriority:function(){}}}};function ry(f){if(f==null)throw"You must pass an options object";if(f.cluster==null)throw"Options object must provide a cluster";"disableStats"in f&&ce.warn("The disableStats option is deprecated in favor of enableStats")}const oy=(f,l)=>{var m="socket_id="+encodeURIComponent(f.socketId);for(var C in l.params)m+="&"+encodeURIComponent(C)+"="+encodeURIComponent(l.params[C]);if(l.paramsProvider!=null){let _=l.paramsProvider();for(var C in _)m+="&"+encodeURIComponent(C)+"="+encodeURIComponent(_[C])}return m};var sy=f=>{if(typeof Z.getAuthorizers()[f.transport]>"u")throw`'${f.transport}' is not a recognized auth transport`;return(l,m)=>{const C=oy(l,f);Z.getAuthorizers()[f.transport](Z,C,f,k.UserAuthentication,m)}};const ay=(f,l)=>{var m="socket_id="+encodeURIComponent(f.socketId);m+="&channel_name="+encodeURIComponent(f.channelName);for(var C in l.params)m+="&"+encodeURIComponent(C)+"="+encodeURIComponent(l.params[C]);if(l.paramsProvider!=null){let _=l.paramsProvider();for(var C in _)m+="&"+encodeURIComponent(C)+"="+encodeURIComponent(_[C])}return m};var uy=f=>{if(typeof Z.getAuthorizers()[f.transport]>"u")throw`'${f.transport}' is not a recognized auth transport`;return(l,m)=>{const C=ay(l,f);Z.getAuthorizers()[f.transport](Z,C,f,k.ChannelAuthorization,m)}};const ly=(f,l,m)=>{const C={authTransport:l.transport,authEndpoint:l.endpoint,auth:{params:l.params,headers:l.headers}};return(_,T)=>{const I=f.channel(_.channelName);m(I,C).authorize(_.socketId,T)}};function cy(f,l){let m={activityTimeout:f.activityTimeout||u.activityTimeout,cluster:f.cluster,httpPath:f.httpPath||u.httpPath,httpPort:f.httpPort||u.httpPort,httpsPort:f.httpsPort||u.httpsPort,pongTimeout:f.pongTimeout||u.pongTimeout,statsHost:f.statsHost||u.stats_host,unavailableTimeout:f.unavailableTimeout||u.unavailableTimeout,wsPath:f.wsPath||u.wsPath,wsPort:f.wsPort||u.wsPort,wssPort:f.wssPort||u.wssPort,enableStats:py(f),httpHost:dy(f),useTLS:fy(f),wsHost:hy(f),userAuthenticator:vy(f),channelAuthorizer:gy(f,l)};return"disabledTransports"in f&&(m.disabledTransports=f.disabledTransports),"enabledTransports"in f&&(m.enabledTransports=f.enabledTransports),"ignoreNullOrigin"in f&&(m.ignoreNullOrigin=f.ignoreNullOrigin),"timelineParams"in f&&(m.timelineParams=f.timelineParams),"nacl"in f&&(m.nacl=f.nacl),m}function dy(f){return f.httpHost?f.httpHost:f.cluster?`sockjs-${f.cluster}.pusher.com`:u.httpHost}function hy(f){return f.wsHost?f.wsHost:my(f.cluster)}function my(f){return`ws-${f}.pusher.com`}function fy(f){return Z.getProtocol()==="https:"?!0:f.forceTLS!==!1}function py(f){return"enableStats"in f?f.enableStats:"disableStats"in f?!f.disableStats:!1}function vy(f){const l=Object.assign(Object.assign({},u.userAuthentication),f.userAuthentication);return"customHandler"in l&&l.customHandler!=null?l.customHandler:sy(l)}function by(f,l){let m;return"channelAuthorization"in f?m=Object.assign(Object.assign({},u.channelAuthorization),f.channelAuthorization):(m={transport:f.authTransport||u.authTransport,endpoint:f.authEndpoint||u.authEndpoint},"auth"in f&&("params"in f.auth&&(m.params=f.auth.params),"headers"in f.auth&&(m.headers=f.auth.headers)),"authorizer"in f&&(m.customHandler=ly(l,m,f.authorizer))),m}function gy(f,l){const m=by(f,l);return"customHandler"in m&&m.customHandler!=null?m.customHandler:uy(m)}class yy extends Sn{constructor(l){super(function(m,C){ce.debug(`No callbacks on watchlist events for ${m}`)}),this.pusher=l,this.bindWatchlistInternalEvent()}handleEvent(l){l.data.events.forEach(m=>{this.emit(m.name,m)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",l=>{var m=l.event;m==="pusher_internal:watchlist_events"&&this.handleEvent(l)})}}function wy(){let f,l;return{promise:new Promise((C,_)=>{f=C,l=_}),resolve:f,reject:l}}var Cy=wy;class Sy extends Sn{constructor(l){super(function(m,C){ce.debug("No callbacks on user for "+m)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(m,C)=>{if(m){ce.warn(`Error during signin: ${m}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:C.auth,user_data:C.user_data})},this.pusher=l,this.pusher.connection.bind("state_change",({previous:m,current:C})=>{m!=="connected"&&C==="connected"&&this._signin(),m==="connected"&&C!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new yy(l),this.pusher.connection.bind("message",m=>{var C=m.event;C==="pusher:signin_success"&&this._onSigninSuccess(m.data),this.serverToUserChannel&&this.serverToUserChannel.name===m.channel&&this.serverToUserChannel.handleEvent(m)})}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(l){try{this.user_data=JSON.parse(l.user_data)}catch{ce.error(`Failed parsing user data after signin: ${l.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){ce.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const l=m=>{m.subscriptionPending&&m.subscriptionCancelled?m.reinstateSubscription():!m.subscriptionPending&&this.pusher.connection.state==="connected"&&m.subscribe()};this.serverToUserChannel=new Ca(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((m,C)=>{m.indexOf("pusher_internal:")===0||m.indexOf("pusher:")===0||this.emit(m,C)}),l(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:l,resolve:m}=Cy();l.done=!1;const C=()=>{l.done=!0};l.then(C).catch(C),this.signinDonePromise=l,this._signinDoneResolve=m}}class Ve{static ready(){Ve.isReady=!0;for(var l=0,m=Ve.instances.length;l<m;l++)Ve.instances[l].connect()}static getClientFeatures(){return yn(Kn({ws:Z.Transports.ws},function(l){return l.isSupported({})}))}constructor(l,m){ky(l),ry(m),this.key=l,this.config=cy(m,this),this.channels=Wn.createChannels(),this.global_emitter=new Sn,this.sessionID=Z.randomInt(1e9),this.timeline=new Q0(this.key,this.sessionID,{cluster:this.config.cluster,features:Ve.getClientFeatures(),params:this.config.timelineParams||{},limit:50,level:ao.INFO,version:u.VERSION}),this.config.enableStats&&(this.timelineSender=Wn.createTimelineSender(this.timeline,{host:this.config.statsHost,path:"/timeline/v2/"+Z.TimelineTransport.name}));var C=_=>Z.getDefaultStrategy(this.config,_,ty);this.connection=Wn.createConnectionManager(this.key,{getStrategy:C,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",_=>{var T=_.event,I=T.indexOf("pusher_internal:")===0;if(_.channel){var U=this.channel(_.channel);U&&U.handleEvent(_)}I||this.global_emitter.emit(_.event,_.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",_=>{ce.warn(_)}),Ve.instances.push(this),this.timeline.info({instances:Ve.instances.length}),this.user=new Sy(this),Ve.isReady&&this.connect()}channel(l){return this.channels.find(l)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var l=this.connection.isUsingTLS(),m=this.timelineSender;this.timelineSenderTimer=new gn(6e4,function(){m.send(l)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(l,m,C){return this.global_emitter.bind(l,m,C),this}unbind(l,m,C){return this.global_emitter.unbind(l,m,C),this}bind_global(l){return this.global_emitter.bind_global(l),this}unbind_global(l){return this.global_emitter.unbind_global(l),this}unbind_all(l){return this.global_emitter.unbind_all(),this}subscribeAll(){var l;for(l in this.channels.channels)this.channels.channels.hasOwnProperty(l)&&this.subscribe(l)}subscribe(l){var m=this.channels.add(l,this);return m.subscriptionPending&&m.subscriptionCancelled?m.reinstateSubscription():!m.subscriptionPending&&this.connection.state==="connected"&&m.subscribe(),m}unsubscribe(l){var m=this.channels.find(l);m&&m.subscriptionPending?m.cancelSubscription():(m=this.channels.remove(l),m&&m.subscribed&&m.unsubscribe())}send_event(l,m,C){return this.connection.send_event(l,m,C)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}Ve.instances=[],Ve.isReady=!1,Ve.logToConsole=!1,Ve.Runtime=Z,Ve.ScriptReceivers=Z.ScriptReceivers,Ve.DependenciesReceivers=Z.DependenciesReceivers,Ve.auth_callbacks=Z.auth_callbacks;var Ea=e.default=Ve;function ky(f){if(f==null)throw"You must pass your app key when you instantiate Pusher."}Z.setup(Ve)}])})})(Ud);var yg=Ud.exports;const wg=gg(yg);class Fd{constructor(t){g(this,"container");g(this,"onAction");g(this,"onFail");g(this,"initialTime");g(this,"timeLeft");g(this,"timerId");g(this,"payment");this.container=t.container,this.onAction=t.onAction,this.onFail=t.onFail,this.initialTime=1800,this.timeLeft=this.initialTime,this.timerId=null}attachListener(){const t=this.container.querySelector("#transfer-acn"),r=this.container.querySelector("#copy-acn"),e=this.container.querySelector("#acn-tooltip"),i=this.container.querySelector("#transfer-amount"),o=this.container.querySelector("#copy-amount"),s=this.container.querySelector("#amount-tooltip"),a=this.container.querySelector("#transfer-button");r&&t&&r.addEventListener("click",()=>{B.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Started"}),e&&this.copyToClipboard(t.innerHTML,e)}),o&&i&&o.addEventListener("click",()=>{B.track("copy_transferAmount",{payment_method:"Transfer"}),s&&this.copyToClipboard(i.innerHTML.split(" ")[1].replace(/,/g,""),s)}),a&&a.addEventListener("click",()=>{this.onAction(5)})}startTimer(t){this.stopTimer(),this.timerId=window.setInterval(()=>{if(this.timeLeft>0){this.timeLeft-=1;const r=this.container.querySelector("#time-left");r&&(r.innerHTML=Ui(this.timeLeft))}else this.stopTimer(),t==="check"&&this.onAction(2)},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}copyToClipboard(t,r){navigator.clipboard.writeText(t).then(()=>{r.innerHTML="Copied!"}).catch(()=>{r.innerHTML="Failed to copy"})}renderComponent(t){var h,p,y,w,k,b;t&&(this.payment=t),this.container.innerHTML=this.render();const r=this.container.querySelector("#transfer-amount"),e=this.container.querySelector("#transfer-bank"),i=this.container.querySelector("#account-name"),o=this.container.querySelector("#transfer-acn"),s=this.container.querySelector("#time-left"),a=((h=this.payment)==null?void 0:h.currency)||"USD",u=a==="USD"?(p=this.payment)==null?void 0:p.localCurrency:a;if(r&&(r.innerHTML=`${u} ${ze(a==="USD"?(y=this.payment)==null?void 0:y.localAmount:(w=this.payment)==null?void 0:w.amount,2)}`),e&&this.payment.bankDetails&&(e.innerHTML=(k=this.payment.bankDetails)==null?void 0:k.bankName),i&&this.payment.bankDetails&&(i.innerHTML=(b=this.payment.bankDetails)==null?void 0:b.accountName),o&&this.payment.bankDetails&&(o.innerHTML=this.payment.bankDetails.accountNumber),s&&(s.innerHTML=Ui(this.initialTime)),this.startTimer("poll"),t.status==="inProgress"){const S="45654f3ce4c9512ea9a4",A="us2";var c=new wg(S,{cluster:A}),d=c.subscribe(t.reference);d.bind("payment_status",x=>{x.status==="successful"?(clearInterval(this.timerId||void 0),this.onAction(6),B.track("verify_payment",{payment_method:"Transfer",verification_status:"Success"}),x!=null&&x.redirectUrl&&setTimeout(()=>{const E=new URL(x.redirectUrl);E.searchParams.append("status",x.status),E.searchParams.append("reference",x.reference),window.location.href=E.toString()},1800)):x.status==="failed"&&(clearInterval(this.timerId||void 0),this.onFail(7,"Transfer failed"),B.track("verify_payment",{payment_method:"Transfer",verification_status:"Failed"}))})}this.attachListener()}render(){return bg}}const Cg=`<div id="trasferConfirmationProgress">\r
925
+ <div>\r
926
+ <div>\r
927
+ <div class=" grid grid-rows-[auto_1fr] gap-4 mx-5">\r
928
+ <div class="items-center justify-self-center flex flex-col relative ">\r
929
+ <svg class="animate-spin" width="40" height="40" viewBox="0 0 64 64" fill="none"\r
930
+ xmlns="http://www.w3.org/2000/svg">\r
931
+ <path\r
932
+ 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"\r
933
+ stroke="black" stroke-width="4" stroke-linejoin="round" />\r
934
+ </svg>\r
935
+ <!-- <div class="relative w-12 h-12">\r
936
+ <svg viewBox="0 0 100 100" width="100" height="100" class="h-full w-full">\r
937
+ <circle stroke-width="10" stroke="#E6E6E7" stroke-linecap="round" cx="50" cy="50"\r
938
+ class="circle-progress-bg" r="40" fill="transparent"></circle>\r
939
+ <circle stroke-width="11" stroke="#000000" stroke-linecap="round" cx="50" cy="50" r="40"\r
940
+ class="circle-progress" fill="transparent" stroke-dasharray="" stroke-dashoffset=""\r
941
+ transform="rotate(-90 50 50)"></circle>\r
942
+ </svg>\r
943
+ \r
944
+ </div> -->\r
945
+ </div>\r
946
+ </div>\r
947
+ </div>\r
948
+ <div class="text-center w-11/12 md:w-4/5 mx-auto grid gap-4 mb-8">\r
949
+ <h5 class="text-center text-sm text-grey-400">\r
950
+ We are confirming transaction status.\r
951
+ <br>\r
952
+ This can take a few minutes.\r
953
+ </h5>\r
954
+ \r
955
+ <div>\r
956
+ <p class="text-grey-400 text-sm">\r
957
+ Please wait for <span id="ctd-timer" class="font-bold"> </span> minutes\r
958
+ </p>\r
959
+ </div>\r
960
+ \r
961
+ </div>\r
962
+ \r
963
+ <div>\r
964
+ <div class="border border-tone-10 rounded-lg text-black px-4 py-4 grid gap-2">\r
965
+ \r
966
+ <div class="grid grid-cols-[1fr_auto] gap-3">\r
967
+ <div>\r
968
+ <p class="text-xs">Account details</p>\r
969
+ </div>\r
970
+ \r
971
+ <div class="align-center gap-2">\r
972
+ <p class="font-medium text-xs" id="transfer-acn-pr"></p>\r
973
+ \r
974
+ <button type="button" class="relative group" id="copy-acn-pr">\r
975
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">\r
976
+ <path\r
977
+ d="M9.33268 7.52502V9.97502C9.33268 12.0167 8.51602 12.8334 6.47435 12.8334H4.02435C1.98268 12.8334 1.16602 12.0167 1.16602 9.97502V7.52502C1.16602 5.48335 1.98268 4.66669 4.02435 4.66669H6.47435C8.51602 4.66669 9.33268 5.48335 9.33268 7.52502Z"\r
978
+ stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />\r
979
+ <path\r
980
+ d="M12.8327 4.02502V6.47502C12.8327 8.51669 12.016 9.33335 9.97435 9.33335H9.33268V7.52502C9.33268 5.48335 8.51602 4.66669 6.47435 4.66669H4.66602V4.02502C4.66602 1.98335 5.48268 1.16669 7.52435 1.16669H9.97435C12.016 1.16669 12.8327 1.98335 12.8327 4.02502Z"\r
981
+ stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />\r
982
+ </svg>\r
983
+ \r
984
+ <div class="tooltip">\r
985
+ <div class="tooltip-textbox">\r
986
+ <p class="tooltip-text" id="acn-tooltip-pr">Copy</p>\r
987
+ </div>\r
988
+ </div>\r
989
+ </button>\r
990
+ </div>\r
991
+ </div>\r
992
+ \r
993
+ <div class="grid grid-cols-[1fr_auto] gap-3 text-xxs">\r
994
+ <p class="text-xs">Bank name</p>\r
995
+ <p class="font-medium text-xs" id="transfer-bank"></p>\r
996
+ </div>\r
997
+ \r
998
+ <div class="grid grid-cols-[1fr_auto] gap-3 text-xxs">\r
999
+ <p class="text-xs">Beneficiary</p>\r
1000
+ <p class="font-medium text-xs" id="account-name"></p>\r
1001
+ </div>\r
1002
+ </div>\r
1003
+ </div>\r
1004
+ </div>\r
1005
+ </div>`;class Sg{constructor(t){g(this,"container");g(this,"onAction");g(this,"ref");g(this,"token");g(this,"initialTime",300);g(this,"abortController");g(this,"timeLeft");g(this,"timer");g(this,"timerId",null);g(this,"rdtCode");g(this,"url");g(this,"callBackUrl");g(this,"payment");g(this,"setPaymentResponses");this.container=t.container,this.timeLeft=this.initialTime,this.onAction=t.onAction,this.ref=t.ref,this.token=t.token,this.rdtCode=t.rdtCode,this.url=t.url,this.callBackUrl=t.callBackUrl,this.setPaymentResponses=t.setPaymentResponses}attachListeners(){const t=this.container.querySelector("#show-acn");t&&t.addEventListener("click",()=>{this.onAction(1),clearTimeout(this.timer)});const r=this.container.querySelector("#transfer-acn-pr"),e=this.container.querySelector("#copy-acn-pr"),i=this.container.querySelector("#acn-tooltip-pr");e&&r&&e.addEventListener("click",()=>{B.track("copy_transferBank",{payment_method:"Transfer",payment_process:"Payment Verification"}),i&&this.copyToClipboard(r.innerHTML,i)}),this.initialTime=300,this.timeLeft=this.initialTime;const o=3e4;this.abortController=new AbortController,setTimeout(()=>{this.verifyTransfer(this.token,o,({data:s,headers:a})=>{this.onAction(6),this.redirectTo(s,a)})},5e3),this.startTimer()}updateProgressTimerContent(){const r=2*Math.PI*40,i=(this.initialTime-this.timeLeft)/this.initialTime*100/100*r,o=this.container.querySelector(".circle-progress");o&&(o.setAttribute("stroke-dasharray",`${r}`),o.setAttribute("stroke-dashoffset",`${i}`))}async verifyTransfer(t,r,e){let i=0,o=r,s=!0,a;this.abortController&&(a=this.abortController.signal);const u=async()=>{if(this.timeLeft<=0){s=!1,this.onAction(8),B.track("verify_payment",{payment_method:"Transfer",verification_status:"In Progress"});return}i+=1;try{const c=await dt(t,this.ref,a,this.rdtCode,this.url);c.data.status==="inProgress"?(s&&(o=r*(i+1),this.timer=setTimeout(u,o)),this.setPaymentResponses(c.data,c.headers)):c.data.status==="successful"||c.data.status==="success"?(this.setPaymentResponses(c.data,c.headers),s=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),B.track("verify_payment",{payment_method:"Transfer",verification_status:"Success"}),e(c)):c.data.status==="failed"&&(this.setPaymentResponses(c.data,c.headers),s=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),this.onAction(7,"Transfer failed"),B.track("verify_payment",{payment_method:"Transfer",verification_status:"Failed"}))}catch{s&&(o=r*(i+1),this.timer=setTimeout(u,o))}};u()}redirectTo(t,r){const e=r.get("spf-redirect-url");this.callBackUrl=e||this.callBackUrl,this.callBackUrl&&setTimeout(()=>{const i=new URL(this.callBackUrl);i.searchParams.append("status",t.status),i.searchParams.append("reference",t.reference),window.location.href=i.toString()},1800)}startTimer(){const t=this.container.querySelector("#ctd-timer");this.stopTimer(),this.timerId=window.setInterval(()=>{this.timeLeft>0?(this.timeLeft-=1,t&&(t.innerHTML=Ui(this.timeLeft),this.startTimer()),this.updateProgressTimerContent()):(this.stopTimer(),this.onAction(8))},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}renderTransferDetailsComponent(t){var o,s;t&&(this.payment=t),this.container.innerHTML=this.render();const r=this.container.querySelector("#transfer-bank"),e=this.container.querySelector("#transfer-acn-pr"),i=this.container.querySelector("#account-name");r&&t.bankDetails&&(r.innerHTML=(o=t.bankDetails)==null?void 0:o.bankName),e&&t.bankDetails&&(e.innerHTML=t.bankDetails.accountNumber),i&&t.bankDetails&&(i.innerHTML=(s=t.bankDetails)==null?void 0:s.accountName)}copyToClipboard(t,r){navigator.clipboard.writeText(t).then(()=>{r.innerHTML="Copied!"}).catch(()=>{r.innerHTML="Failed to copy"})}renderComponent(t){this.container.innerHTML=this.render(),this.renderTransferDetailsComponent(t),this.attachListeners()}render(){return Cg}}const kg=`<div id="paymenExpired">\r
1006
+ <div class="container-center min-h-[30dvh]">\r
1007
+ <div>\r
1008
+ <div class="container-center mb-5">\r
1009
+ <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">\r
1010
+ <path\r
1011
+ d="M32.5172 9.74998L22.6172 4.03331C21.0005 3.09998 19.0005 3.09998 17.3672 4.03331L7.48385 9.74998C5.86719 10.6833 4.86719 12.4166 4.86719 14.3V25.7C4.86719 27.5666 5.86719 29.3 7.48385 30.25L17.3839 35.9666C19.0005 36.9 21.0005 36.9 22.6339 35.9666L32.5339 30.25C34.1505 29.3166 35.1505 27.5833 35.1505 25.7V14.3C35.1339 12.4166 34.1339 10.7 32.5172 9.74998ZM18.7505 12.9166C18.7505 12.2333 19.3172 11.6666 20.0005 11.6666C20.6839 11.6666 21.2505 12.2333 21.2505 12.9166V21.6666C21.2505 22.35 20.6839 22.9166 20.0005 22.9166C19.3172 22.9166 18.7505 22.35 18.7505 21.6666V12.9166ZM21.5339 27.7166C21.4505 27.9166 21.3339 28.1 21.1839 28.2666C20.8672 28.5833 20.4505 28.75 20.0005 28.75C19.7839 28.75 19.5672 28.7 19.3672 28.6166C19.1505 28.5333 18.9839 28.4166 18.8172 28.2666C18.6672 28.1 18.5505 27.9166 18.4505 27.7166C18.3672 27.5166 18.3339 27.3 18.3339 27.0833C18.3339 26.65 18.5005 26.2166 18.8172 25.9C18.9839 25.75 19.1505 25.6333 19.3672 25.55C19.9839 25.2833 20.7172 25.4333 21.1839 25.9C21.3339 26.0666 21.4505 26.2333 21.5339 26.45C21.6172 26.65 21.6672 26.8666 21.6672 27.0833C21.6672 27.3 21.6172 27.5166 21.5339 27.7166Z"\r
1012
+ fill="#D62020" />\r
1013
+ </svg>\r
1014
+ </div>\r
1015
+ <h5 class="text-tone-100 font-semibold text-xl text-center mb-1" id="payment-warning-text">\r
1016
+ Account Expired\r
1017
+ </h5>\r
1018
+ \r
1019
+ <p class="w-11/12 mx-auto text-sm text-center">\r
1020
+ Looks like your account is not valid. Please confirm and try again\r
1021
+ </p>\r
1022
+ \r
1023
+ <!-- <div class="mt-8 container-center">\r
1024
+ <button type="button" id="payment-expired" class="button-outline w-60">I have made the payment</button>\r
1025
+ </div> -->\r
1026
+ </div>\r
1027
+ </div>\r
1028
+ </div>`;class _g{constructor(t){g(this,"container");this.container=t.container}attachListeners(){}renderComponent(){this.container.innerHTML=this.render()}render(){return kg}}class Ag{constructor({amount:t,closeModal:r,container:e,email:i,token:o,currency:s,rdtCode:a,url:u,reference:c,callBackUrl:d,metadata:h,localCurrency:p,disablePaymentMethods:y,restartTransactionProcess:w,hidePaymentMethods:k,retryingPayment:b}){g(this,"container");g(this,"contents");g(this,"closeModal");g(this,"email");g(this,"transferDetails");g(this,"transferConfirmationProgress");g(this,"transferConfirmationEnd");g(this,"transferExpired");g(this,"mainLoader");g(this,"warningScreen");g(this,"successScreen");g(this,"merchantPlanDetail",{});g(this,"token");g(this,"currency");g(this,"amount");g(this,"rdtCode");g(this,"url");g(this,"reference");g(this,"_currentStep");g(this,"activeRef");g(this,"paymentResponse");g(this,"timerId");g(this,"abortController",null);g(this,"callBackUrl");g(this,"metadata");g(this,"localCurrency");g(this,"transactionIssuesScreen");g(this,"disablePaymentMethods");g(this,"paymentResponseHeaders");g(this,"restartTransactionProcess");g(this,"hidePaymentMethods");g(this,"retryingPayment");g(this,"isMaxRetriesReached");g(this,"isMobile",!1);this.currency=s,this.container=e,this.contents=this.container.querySelector("#payment-content-view"),this.closeModal=r,this.token=o,this.email=i,this.amount=t,this.rdtCode=a,this.url=u,this.reference=c,this._currentStep=1,this.callBackUrl=d,this.metadata=h,this.localCurrency=p,this.disablePaymentMethods=y,this.paymentResponse={},this.paymentResponseHeaders={},this.restartTransactionProcess=w,this.hidePaymentMethods=k,this.retryingPayment=b,this.isMaxRetriesReached=!1,this.renderTransferContent(),this.paymentResponse={},this.activeRef="",this.timerId=null,this.mainLoader=new sn(this.contents),B.track("transfer_opens",{payment_method:"Transfer"}),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(t){this._currentStep=t,this.renderTransferContent(),t===1&&this.createTransfer()}attachInputListeners(){const t=this.container.querySelector("#transfer-try-again"),r=this.container.querySelector("#transfer-sent"),e=this.container.querySelector(".success-button");t&&t.addEventListener("click",()=>{this.currentStep=1}),r&&r.addEventListener("click",()=>{this.abortController&&(this.abortController.abort(),this.currentStep=5)}),e&&e.addEventListener("click",()=>{this.closeModal(),B.track("checkout_closes")})}onSentVerify(t){t!==2?this.abortController&&(this.abortController.abort(),this.currentStep=t):this.currentStep=2}async verifyTransfer(){try{const t=await dt(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=t.data,this.paymentResponseHeaders=t.headers}catch{this.currentStep=7}}async createTransfer(){requestAnimationFrame(()=>{const t=this.container.querySelector("#loader"),r=this.container.querySelector("#details-content");r&&(this.mainLoader=new sn(this.contents),this.mainLoader.mountLoader("25dvh"),r.classList.add("hidden")),B.track("start_transferProcess",{payment_method:"Transfer"}),(()=>{if(this.retryingPayment){const i={channel:"bank_transfer",reference:this.reference};return Di(this.token,i,this.rdtCode,this.url)}else{const i={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};return Ia(this.token,i,this.rdtCode,this.url)}})().then(({data:i,headers:o})=>{this.paymentResponse=i,this.paymentResponseHeaders=o,i.status==="failed"?(this.currentStep=7,i.providerMessage?this.warningScreen.setPaymentError(i.providerMessage):this.warningScreen.setPaymentError("Payment failed"),B.track("stop_transferProcess",{payment_method:"Transfer",verification_status:"Failed"})):(t&&r&&(t.classList.add("hidden"),r.classList.remove("hidden")),this.activeRef=i.reference,this.paymentResponse=i,i.bankDetails&&i.bankDetails.accountNumber?(this.transferDetails=new Fd({container:this.contents,onAction:s=>{this.onSentVerify.bind(this)(s)},onFail:(s,a)=>{this.currentStep=s,s===7&&a&&this.warningScreen.setPaymentError(a)}}),this.transferDetails.renderComponent(this.paymentResponse||i)):(this.currentStep=7,i.providerMessage?this.warningScreen.setPaymentError(i.providerMessage):this.warningScreen.setPaymentError("Error fetching bank details")))}).catch(i=>{B.track("verify_payment",{payment_method:"Transfer",verification_status:"Null"}),i.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,i.message?this.warningScreen.setPaymentError(i.message):this.warningScreen.setPaymentError("Payment failed")),this.warningScreen.hideReportIssue()})})}goBackToMerchant(){qn(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}renderTransferContent(t){var e;t&&(this.merchantPlanDetail=t);const r=document.getElementById("go-back");if(this.isMobile&&this.hidePaymentMethods(),this.currentStep!==1?(r==null||r.classList.add("hidden"),this.disablePaymentMethods("bank_transfer")):r==null||r.addEventListener("click",()=>{this.restartTransactionProcess()}),this.contents){switch(this.currentStep){case 1:this.transferDetails=new Fd({container:this.contents,onAction:i=>{this.onSentVerify.bind(this)(i)},onFail:(i,o)=>{this.currentStep=i,i===7&&o&&this.warningScreen.setPaymentError(o)}});break;case 2:this.transferExpired=new _g({container:this.contents}),this.transferExpired.renderComponent();break;case 5:this.transferConfirmationProgress=new Sg({container:this.contents,onAction:(i,o)=>{this.currentStep=i,i===7&&o&&this.warningScreen.setPaymentError(o)},ref:this.activeRef,token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(i,o)=>{this.paymentResponse=i,this.paymentResponseHeaders=o}}),this.transferConfirmationProgress.renderComponent(this.paymentResponse);break;case 6:this.successScreen=new Qt({container:this.contents,amount:this.amount,currency:this.currency,localCurrency:this.localCurrency,rate:(e=this.merchantPlanDetail)==null?void 0:e.rate.rate}),this.successScreen.renderComponent();break;case 7:this.warningScreen=new ht({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 Hd({container:this.contents,onAction:i=>{this.currentStep=i},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 Gi({container:this.contents,onAction:()=>{var i;this.currentStep=7,this.warningScreen.setPaymentError(((i=this.paymentResponse)==null?void 0:i.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 t=this.container.querySelector(".progress-bar");t&&(t.style.animationPlayState="paused")}copyToClipboard(t,r){navigator.clipboard.writeText(t).then(()=>{r.innerHTML="Copied!"}).catch(()=>{r.innerHTML="Failed to copy"})}destroyTimer(){this.stopTimer()}stopPolling(){this.abortController&&this.abortController.abort()}}function Gd(){return function(n,t){let r=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:()=>r,set:o=>{r=o}})}}class Ae extends Error{constructor(t,r){super(t),this.status=r,this.name="FetchError"}}class Gn extends Error{constructor(t){super(t),this.name="AuthorizationError"}}class ba{constructor(t){g(this,"token");g(this,"baseurl","https://api.spotflow.co/api/v1");g(this,"headers");g(this,"rdtCode");g(this,"url");g(this,"getHeaders",(t,r)=>{if(!t)throw new Gn("Missing authorization token");const e=new Headers;return e.append("Content-Type","application/json"),e.append("Authorization",`Bearer ${t}`),r&&e.append("Spotflow-Payment-Code",r),e});this.token=t.token,this.rdtCode=t.rdtCode,this.url=t.url,this.headers=this.getHeaders(this.token,this.rdtCode)}}class Kd extends ba{constructor(t){super(t)}async createCardPayment(t){try{const r=await fetch(`${He(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(t)});if(!r.ok){const i=await r.json();throw i.message?new Ae(i.message,r.status):new Ae("Network response was not ok",r.status)}return await r.json()}catch(r){throw r instanceof Ae?console.error(`FetchError: ${r.message} (status: ${r.status})`):r instanceof Gn?console.error(`AuthorizationError: ${r.message}`):console.error(`Unexpected error: ${r}`),r}}async createUssdPayment(t){try{const r=await fetch(`${He(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(t)});if(!r.ok){const i=await r.json();throw i.message?new Ae(i.message,r.status):new Ae("Network response was not ok",r.status)}return{data:await r.json(),headers:r.headers}}catch(r){throw r instanceof Ae?console.error(`FetchError: ${r.message} (status: ${r.status})`):r instanceof Gn?console.error(`AuthorizationError: ${r.message}`):console.error(`Unexpected error: ${r}`),r}}async validateCardPayment(t){try{const r=await fetch(`${He(this.baseurl,this.url)}/payments/validate`,{method:"POST",headers:this.headers,body:JSON.stringify(t)});if(!r.ok){const i=await r.json();throw i.message?new Ae(i.message,r.status):new Ae("Network response was not ok",r.status)}return await r.json()}catch(r){throw r instanceof Ae?console.error(`FetchError: ${r.message} (status: ${r.status})`):r instanceof Gn?console.error(`AuthorizationError: ${r.message}`):console.error(`Unexpected error: ${r}`),r}}async authorizeCardPayment(t){try{const r=await fetch(`${He(this.baseurl,this.url)}/payments/authorize`,{method:"POST",headers:this.headers,body:JSON.stringify(t)});if(!r.ok){const i=await r.json();throw i.message?new Ae(i.message,r.status):new Ae("Network response was not ok",r.status)}return await r.json()}catch(r){throw r instanceof Ae?console.error(`FetchError: ${r.message} (status: ${r.status})`):r instanceof Gn?console.error(`AuthorizationError: ${r.message}`):console.error(`Unexpected error: ${r}`),r}}async createTransferPayment(t){try{const r=await fetch(`${He(this.baseurl,this.url)}/payments`,{method:"POST",headers:this.headers,body:JSON.stringify(t)});if(!r.ok){const i=await r.json();throw i.message?new Ae(i.message,r.status):new Ae("Network response was not ok",r.status)}return await r.json()}catch(r){throw r instanceof Ae?console.error(`FetchError: ${r.message} (status: ${r.status})`):r instanceof Gn?console.error(`AuthorizationError: ${r.message}`):console.error(`Unexpected error: ${r}`),r}}async verifyPayment(t,r){try{const e=await fetch(`${He(this.baseurl,this.url)}/payments/verify?reference=${t}`,{method:"GET",headers:this.headers,signal:r});if(!e.ok){const o=await e.json();throw o.message?new Ae(o.message,e.status):new Ae("Network response was not ok",e.status)}return{data:await e.json(),headers:e.headers}}catch(e){throw e instanceof Ae?console.error(`FetchError: ${e.message} (status: ${e.status})`):e instanceof Gn?console.error(`AuthorizationError: ${e.message}`):console.error(`Unexpected error: ${e}`),e}}}class xg extends ba{constructor(t){super(t)}async getMerchantConfig(t,r){try{const e=await fetch(`${He(this.baseurl,this.url)}/checkout-configurations?currency=${r}&planId=${t||""}`,{headers:this.headers,method:"GET"});if(!e.ok){const i=await e.json();throw i.message?new Ae(i.message,e.status):new Ae("Network response was not ok",e.status)}return e.json()}catch(e){throw e instanceof Ae?console.error(`FetchError: ${e.message} (status: ${e.status})`):e instanceof Gn?console.error(`AuthorizationError: ${e.message}`):console.error(`Unexpected error: ${e}`),e}}}class Mg extends ba{constructor(t){super(t)}async getBankList(){try{const t=await fetch(`${He(this.baseurl,this.url)}/banks?ussd=true`,{headers:this.headers,method:"GET"});if(!t.ok){const r=await t.json();throw r.message?new Ae(r.message,t.status):new Ae("Network response was not ok",t.status)}return t.json()}catch(t){throw t instanceof Ae?(Fi.showToast(t.message,"error",9e3),console.error(`FetchError: ${t.message} (status: ${t.status})`)):t instanceof Gn?console.error(`AuthorizationError: ${t.message}`):console.error(`Unexpected error: ${t}`),t}}}const Eg=`<form id="ussdBanks">\r
1029
+ <div>\r
1030
+ <h5 class="text-grey-400 font-semibold text-sm">Please choose your bank to begin payment</h5>\r
1031
+ <div class="mt-2">\r
1032
+ <div class="relative">\r
1033
+ <div class="relative bank-select-relative">\r
1034
+ <div class="relative w-full">\r
1035
+ <span class="absolute text-xs left-0 top-1 text-grey-100 pt-1 pb-1 px-3 tracking-[0.5px]">Bank</span>\r
1036
+ <div>\r
1037
+ <select class="avs-input-container appearance-none pr-7" id="bank-search-input" name="bank"\r
1038
+ placeholder="Select your bank" required></select>\r
1039
+ </div>\r
1040
+ <div class="absolute right-4 top-1/2 -translate-y-2/4">\r
1041
+ <svg id="bank-dropdown" width="14" height="8" viewBox="0 0 14 8" fill="none"\r
1042
+ xmlns="http://www.w3.org/2000/svg">\r
1043
+ <path d="M1 1L7 7L13 1" stroke="#9E9BA1" stroke-width="2" stroke-linecap="round"\r
1044
+ stroke-linejoin="round" />\r
1045
+ </svg>\r
1046
+ </div>\r
1047
+ </div>\r
1048
+ </div>\r
1049
+ \r
1050
+ <div class="mt-4">\r
1051
+ <button type="submit" disabled="true" class="details-form-button" id="ussd-bank-button">\r
1052
+ <svg class="spinner hidden" viewBox="0 0 24 24">\r
1053
+ <path\r
1054
+ d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">\r
1055
+ </path>\r
1056
+ </svg>\r
1057
+ <span id="ussd-bank-button-text"> Pay </span>\r
1058
+ </button>\r
1059
+ </div>\r
1060
+ </div>\r
1061
+ </div>\r
1062
+ </div>\r
1063
+ </form>`;class jd{constructor(t){g(this,"container");g(this,"bank_service");g(this,"bank_list");g(this,"onAction");g(this,"selectedBank");g(this,"currency");g(this,"localCurrency");g(this,"rate");g(this,"amount");this.container=t.container,this.currency=t.currency,this.localCurrency=t.localCurrency,this.rate=t.rate,this.amount=t.amount,this.bank_list=[],this.bank_service=new Mg({token:t.merchantKey,rdtCode:t.rdtCode,url:t.url}),this.selectedBank={code:"",name:""},this.onAction=t.onAction?t.onAction:()=>null}attachListerner(){const t=document.getElementById("bank-search-input"),r=document.querySelectorAll(".select-option-tag"),e=document.querySelector("#ussd-bank-button"),i=document.querySelector("#ussdBanks");t&&t.addEventListener("change",o=>{var s,a;if(o.stopPropagation(),this.selectedBank={code:t.value,name:((a=(s=this.bank_list.filter(u=>u.code==t.value))==null?void 0:s[0])==null?void 0:a.name)||""},this.validateForm())e&&e.removeAttribute("disabled");else if(e){if(e.disabled)return;e.setAttribute("disabled","")}}),r&&Array.from(r).forEach(s=>{s.addEventListener("click",function(a){B.track("select_bank",{payment_method:"USSD"}),a.stopPropagation()})}),i&&i.addEventListener("submit",o=>{o.preventDefault(),this.onAction(this.selectedBank)})}validateForm(){return!!this.selectedBank.code}displayButtonText(t){const r=this.container.querySelector("#ussd-bank-button-text");r&&(this.localCurrency&&this.localCurrency!==this.currency?r.textContent=`Continue to pay ${this.localCurrency} ${ze((this.amount||0)*(this.rate||1),2)}`:r.textContent=`Continue to pay ${this.currency} ${ze(this.amount||0,2)}`)}renderContent(){this.container.innerHTML=this.render();const t=this.container.querySelector("#bank-search-input");if(t){const r=new Option("Select your bank","",!0,!0);r.disabled=!0,t.appendChild(r),t.classList.remove("text-tone-100"),t.classList.add("text-tone-50")}this.bank_service.getBankList().then(r=>{this.bank_list=r,t&&r.forEach(e=>{const i=new Option(e.name,e.code);t.appendChild(i),t.classList.remove("text-tone-50"),t.classList.add("text-tone-100")})}),this.displayButtonText(),this.attachListerner()}render(){return Eg}}const Lg=`<div id="viewCode">\r
1064
+ <div class="grid gap-4">\r
1065
+ <div class="text-center">\r
1066
+ <div class="md:w-4/5 mx-auto grid gap-3">\r
1067
+ <h5 class="text-sm text-center text-grey-400">\r
1068
+ Dial the <span id="bank-name-ussd" class="font-semibold"></span>\r
1069
+ code below on your mobile phone\r
1070
+ to complete the payment\r
1071
+ \r
1072
+ </h5>\r
1073
+ </div>\r
1074
+ </div>\r
1075
+ \r
1076
+ <div class="container-center">\r
1077
+ <div>\r
1078
+ <p class="bank-dial-code text-2xl font-bold text-tone-100">*901*000*8812#</p>\r
1079
+ <button type="button" class="copy-code-button text-sm text-tone-100 container-center gap-2 text-center w-full">\r
1080
+ <span class="font-semibold mt-1">COPY USSD CODE</span>\r
1081
+ \r
1082
+ <svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg">\r
1083
+ <path\r
1084
+ d="M9.33268 8.02502V10.475C9.33268 12.5167 8.51602 13.3334 6.47435 13.3334H4.02435C1.98268 13.3334 1.16602 12.5167 1.16602 10.475V8.02502C1.16602 5.98335 1.98268 5.16669 4.02435 5.16669H6.47435C8.51602 5.16669 9.33268 5.98335 9.33268 8.02502Z"\r
1085
+ stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />\r
1086
+ <path\r
1087
+ d="M12.8327 4.52502V6.97502C12.8327 9.01669 12.016 9.83335 9.97435 9.83335H9.33268V8.02502C9.33268 5.98335 8.51602 5.16669 6.47435 5.16669H4.66602V4.52502C4.66602 2.48335 5.48268 1.66669 7.52435 1.66669H9.97435C12.016 1.66669 12.8327 2.48335 12.8327 4.52502Z"\r
1088
+ stroke="#0D0716" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />\r
1089
+ </svg>\r
1090
+ \r
1091
+ </button>\r
1092
+ </div>\r
1093
+ </div>\r
1094
+ \r
1095
+ <div class="mt-4">\r
1096
+ <button type="button" id="bank-completed-payment" class="details-form-button">I have made this\r
1097
+ payment</button>\r
1098
+ </div>\r
1099
+ </div>\r
1100
+ </div>`;class Tg{constructor(t){g(this,"container");g(this,"selected");g(this,"secret");g(this,"onAction");g(this,"paymentService");g(this,"currency");g(this,"amount");g(this,"ussd_detail");g(this,"reference");g(this,"email");g(this,"abortController");g(this,"activeRef","");g(this,"pageLoader");g(this,"callBackUrl");g(this,"metadata");g(this,"localCurrency");g(this,"onError");this.container=t.container,this.selected=t.selected,this.onAction=t.onAction,this.secret=t.secret,this.abortController=new AbortController,this.paymentService=new Kd({token:this.secret,rdtCode:t.rdtCode,url:t.url}),this.currency=t.currency,this.amount=t.amount||0,this.email=t.email,this.reference=t.reference,this.callBackUrl=t.callBackUrl,this.metadata=t.metadata,this.localCurrency=t.localCurrency,this.onError=t.onError??(()=>null),this.pageLoader=new sn(this.container),this.pageLoader.mountLoader("25dvh"),this.pageLoader.updateMessage("Fetching selected bank code detail")}makePayment(){var t;B.track("start_ussdProcess",{payment_method:"USSD"}),this.paymentService.createUssdPayment({amount:this.amount,currency:this.currency,channel:"ussd",customer:{email:this.email},bank:{code:((t=this.selected)==null?void 0:t.code)||""},reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0}).then(({data:r,headers:e})=>{var i;if(this.ussd_detail=r.ussd,this.activeRef=r.reference||"",r.status==="failed"){this.onError(r.providerMessage||"Payment failed"),B.track("stop_ussdProcess",{payment_method:"USSD"});const o=e.get("spf-redirect-url");this.callBackUrl=o||this.callBackUrl,this.callBackUrl&&setTimeout(()=>{const s=new URL(this.callBackUrl);s.searchParams.append("status",r.status),s.searchParams.append("reference",r.reference),window.location.href=s.toString()},1800);return}else if(r.status!=="success")if(r.ussd){this.container.innerHTML=this.render();const o=this.container.querySelectorAll(".bank-dial-code"),s=this.container.querySelector("#bank-dial-code");s&&(s.innerHTML=((i=r==null?void 0:r.ussd)==null?void 0:i.paymentCode)||"");const a=this.container.querySelector("#bank-name-ussd");a&&(a.innerHTML=this.selected.name),Array.from(o).forEach(c=>{var d;c.innerHTML=((d=r==null?void 0:r.ussd)==null?void 0:d.code)||""}),this.attachListener();return}else if(r.providerMessage){this.onError(r.providerMessage);return}else{this.onError("Unable to fetch bank details");return}this.container.innerHTML=this.render(),this.attachListener()}).catch(r=>{r!=null&&r.message?this.onError(r.message):this.onError("Payment failed")})}attachListener(){const t=this.container.querySelectorAll(".copy-code-button"),r=this.container.querySelectorAll(".copy-code-button-1"),e=this.container.querySelector("#bank-completed-payment");Array.from(t).forEach(s=>{s.addEventListener("click",a=>{var u;B.track("copy_ussdCode",{payment_method:"USSD"}),window.navigator.clipboard.writeText(((u=this.ussd_detail)==null?void 0:u.code)||"")})}),Array.from(r).forEach(s=>{s.addEventListener("click",a=>{var u;B.track("copy_ussdCode",{payment_method:"USSD"}),window.navigator.clipboard.writeText(((u=this.ussd_detail)==null?void 0:u.code)||"")})}),e&&e.addEventListener("click",s=>{s.preventDefault(),this.onAction(this.selected,this.activeRef)})}verifyPayment(){let t;this.abortController?t=this.abortController.signal:t=new AbortController().signal,console.log({signal:t})}renderComponent(){this.makePayment(),this.attachListener()}render(){return Lg}}var Ig=Object.defineProperty,Pg=(n,t,r,e)=>{for(var i=void 0,o=n.length-1,s;o>=0;o--)(s=n[o])&&(i=s(t,r,i)||i);return i&&Ig(t,r,i),i};class Vd{constructor({container:t,onSuccess:r,secret:e,amount:i,currency:o,email:s,reference:a,rdtCode:u,url:c,callBackUrl:d,metadata:h,localCurrency:p,hidePaymentMethods:y,showPaymentMethods:w,disablePaymentMethods:k}){g(this,"contents");g(this,"selectedCode");g(this,"secret");g(this,"amount");g(this,"currency");g(this,"email");g(this,"pageLoader");g(this,"reference");g(this,"onSuccess");g(this,"warningScreen");g(this,"bankDetail");g(this,"viewUssdCode");g(this,"_currentStep");g(this,"container");g(this,"paymentService");g(this,"successScreen");g(this,"activeRef","");g(this,"abortController");g(this,"_retry_count",10);g(this,"intervalPayment");g(this,"rdtCode");g(this,"url");g(this,"callBackUrl");g(this,"metadata");g(this,"localCurrency");g(this,"merchantDetails");g(this,"hidePaymentMethods");g(this,"showPaymentMethods");g(this,"disablePaymentMethods");this.onSuccess=r||(()=>null),this.container=t,this.secret=e,this.amount=i,this.currency=o,this.reference=a,this.email=s,this.rdtCode=u,this.url=c,this.callBackUrl=d,this.metadata=h,this.localCurrency=p,this.merchantDetails={},this.hidePaymentMethods=y,this.showPaymentMethods=w,this.disablePaymentMethods=k,this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.paymentService=new Kd({token:this.secret,rdtCode:this.rdtCode,url:this.url}),B.track("ussd_opens",{payment_method:"USSD"})}get currentStep(){return this._currentStep}set currentStep(t){this._currentStep=t,this.renderUssdContent()}onCodeSelect(t){this.selectedCode=t||"",this.currentStep=2}validate(){let t;if(this.abortController?t=this.abortController.signal:(this.abortController=new AbortController,t=this.abortController.signal),this._retry_count<=0){clearInterval(this.intervalPayment),this.currentStep=3,B.track("verify_payment",{payment_method:"USSD",verification_status:"In Progress"});return}this.paymentService.verifyPayment(this.activeRef,t||this.abortController.signal).then(({data:r,headers:e})=>{r.status==="failed"?(this.currentStep=3,clearInterval(this.intervalPayment),this.redirectTo(r,e,"failed")):["successful","failed"].includes(r.status)?r.status==="inProgress"?this._retry_count-=1:["success","successful"].includes(r.status)&&(this.currentStep=5,clearInterval(this.intervalPayment),B.track("verify_payment",{payment_method:"USSD",verification_status:"Success"}),this.redirectTo(r,e,"success")):this._retry_count-=1}).catch(r=>{r.message?this.warningScreen.setPaymentError(r.message):this.warningScreen.setPaymentError("Payment failed"),this.currentStep=3,clearInterval(this.intervalPayment),B.track("verify_payment",{payment_method:"USSD",verification_status:"Failed"})})}redirectTo(t,r,e){const i=r.get("spf-redirect-url");this.callBackUrl=i||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const o=new URL(this.callBackUrl);o.searchParams.append("status",t.status),o.searchParams.append("reference",t.reference),window.location.href=o.toString()},1800):e==="success"&&this.onSuccess(t)}renderUssdContent(t){var r;if(t&&(this.merchantDetails=t),this.currentStep===3||this.currentStep===5?this.hidePaymentMethods():this.showPaymentMethods(),this.currentStep===2&&this.disablePaymentMethods("ussd"),this.currentStep!==1){const e=document.getElementById("go-back");e&&(e.classList.remove("flex","items-center","gap-2","mb-2"),e.innerHTML="")}switch(this.currentStep){case 1:this.bankDetail=new jd({container:this.contents,merchantKey:this.secret,onAction:this.onCodeSelect.bind(this),rdtCode:this.rdtCode,url:this.url,currency:this.currency,localCurrency:this.localCurrency,rate:t==null?void 0:t.rate.rate,amount:this.amount}),this.bankDetail.renderContent();break;case 2:this.viewUssdCode=new Tg({container:this.contents,onAction:(e,i)=>{this.activeRef=i,this.currentStep=4,this.intervalPayment=setInterval(()=>{this.validate()},5e3)},selected:this.selectedCode||{},secret:this.secret,amount:this.amount,currency:this.currency,email:this.email||"",onError:e=>{this.currentStep=3,this.warningScreen.setPaymentError(e)},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=Oa,this.warningScreen=new ht({container:this.contents});break;case 4:this.pageLoader=new sn(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 Qt({container:this.contents,amount:this.amount,currency:this.currency,localCurrency:this.localCurrency,rate:(r=this.merchantDetails)==null?void 0:r.rate.rate}),this.successScreen.renderComponent();break;default:this.bankDetail=new jd({container:this.contents,merchantKey:this.secret,onAction:this.onCodeSelect.bind(this),rdtCode:this.rdtCode,url:this.url,currency:this.currency,localCurrency:this.localCurrency,rate:t==null?void 0:t.rate.rate,amount:this.amount}),this.bankDetail.renderContent();break}}handleSelectChange(t){setTimeout(()=>{this.currentStep=2},400),this.currentStep=2}}Pg([Gd(),Gd()],Vd.prototype,"selectedCode");const Rg={NGN:"Nigerian Naira",USD:"US Dollar",GHS:"Ghanaian Cedi",GBP:"Pounds",ZAF:"South African Rand",USDT:"Tether",KSH:"Kenyan Shilling"},Og=n=>n==null?void 0:n.replace(/_/g," ");function Ng(n){return n.split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const no=n=>{if(n){const t=Og(n);return Ng(t)}return""},Bg=`<div>\r
1101
+ <button id="go-back" class="md:hidden" aria-label="Go back">\r
1102
+ </button>\r
1103
+ </div>\r
1104
+ \r
1105
+ <div class="container-between gap-3 py-3 border-b border-b-grey-faint">\r
1106
+ <div class="" id="merchant-logo-container">\r
1107
+ <img src="" alt="logo" id="merchant-logo" class="flex max-w-[200px] h-8 object-contain" />\r
1108
+ </div>\r
1109
+ <!-- <button id="close-btn">\r
1110
+ <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">\r
1111
+ <path d="M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5" stroke="#55515B" stroke-width="1.5" stroke-linecap="round"\r
1112
+ stroke-linejoin="round" />\r
1113
+ </svg>\r
1114
+ \r
1115
+ </button> -->\r
1116
+ </div>\r
1117
+ \r
1118
+ <div class="py-5 md:py-3 border-b border-b-grey-faint" id="payment-details-header">\r
1119
+ <div class="hidden md:block" id="payment-details">\r
1120
+ <div class="container-between gap-3">\r
1121
+ <p class="text-xs break-words whitespace-normal" id="plan-name">-</p>\r
1122
+ <p class="whitespace-nowrap mb-1 text-2xl font-bold" id="designated-rate-no-plan">\r
1123
+ \r
1124
+ </p>\r
1125
+ <p class="text-xs text-left" id="merchant-email"></p>\r
1126
+ </div>\r
1127
+ <div class="flex justify-between items-start gap-4 py-1" id="payment-fees">\r
1128
+ <div>\r
1129
+ <p class="whitespace-nowrap mb-1 text-2xl font-bold">\r
1130
+ <span id="designated-rate" class="inline-block"> USD 0</span>\r
1131
+ </p>\r
1132
+ <div class="text-sm" id="source-rate">\r
1133
+ <span> To pay: </span>\r
1134
+ <span class="ml-1 font-bold"> NGN 1</span>\r
1135
+ </div>\r
1136
+ </div>\r
1137
+ <div id="currency-cursor" class="flex items-center relative">\r
1138
+ <p class="text-sm mr-1 whitespace-nowrap" id="payment-rate-display">USD 1 = NGN 1</p>\r
1139
+ <div class="group flex flex-col items-center cursor-pointer">\r
1140
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\r
1141
+ <path\r
1142
+ d="M8.00065 14.6668C11.6673 14.6668 14.6673 11.6668 14.6673 8.00016C14.6673 4.3335 11.6673 1.3335 8.00065 1.3335C4.33398 1.3335 1.33398 4.3335 1.33398 8.00016C1.33398 11.6668 4.33398 14.6668 8.00065 14.6668Z"\r
1143
+ stroke="#101010" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" />\r
1144
+ <path d="M8 5.3335V8.66683" stroke="#101010" stroke-width="1.2" stroke-linecap="round"\r
1145
+ stroke-linejoin="round" />\r
1146
+ <path d="M7.99609 10.6665H8.00208" stroke="#101010" stroke-width="1.2" stroke-linecap="round"\r
1147
+ stroke-linejoin="round" />\r
1148
+ </svg>\r
1149
+ \r
1150
+ \r
1151
+ <div\r
1152
+ class="text-xs w-0 absolute transition-all duration-500 hidden rotate-45 left-0 top-5 z-30 text-[#98A2B3] hover:block bg-white p-3 rounded-lg lg:max-w-[20rem] translate-x-[-45%] min-w-[15rem] md:min-w-[18rem] shadow before:h-4 before:w-4 before:absolute before:-top-0 before:left-0 before:translate-x-[-45%] before:-translate-y-1 before:bg-white before:rotate-45 group-hover:rotate-0 hover:rotate-0 hover:opacity-100 group-hover:block group-hover:w-full hover:w-full">\r
1153
+ <p class="text-gray-700 font-medium text-xs">\r
1154
+ What is this?\r
1155
+ </p>\r
1156
+ <p class="text-xs text-tone-100 font-normal">\r
1157
+ This rate reflects the current exchange rate for\r
1158
+ converting United States Dollars (USD) to <span id="tooltip-localCurrency"> Nigerian Naira\r
1159
+ (NGN) </span>. <span class="font-semibold">Please note that exchange rates are subject to\r
1160
+ change and may vary slightly at the time of the\r
1161
+ transaction.</span>\r
1162
+ </p>\r
1163
+ </div>\r
1164
+ </div>\r
1165
+ </div>\r
1166
+ \r
1167
+ \r
1168
+ </div>\r
1169
+ </div>\r
1170
+ <div class="block md:hidden" id="payment-details-mob">\r
1171
+ <div class="mb-3">\r
1172
+ <p class="text-sm text-left mb-1" id="merchant-email-mob"></p>\r
1173
+ <div id="currency-cursor-mob" class="flex items-center relative">\r
1174
+ <p class="text-sm mr-1 whitespace-nowrap" id="payment-rate-display-mob">USD 1 = NGN 1</p>\r
1175
+ <div class="group flex flex-col items-center cursor-pointer">\r
1176
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\r
1177
+ <path\r
1178
+ d="M8.00065 14.6668C11.6673 14.6668 14.6673 11.6668 14.6673 8.00016C14.6673 4.3335 11.6673 1.3335 8.00065 1.3335C4.33398 1.3335 1.33398 4.3335 1.33398 8.00016C1.33398 11.6668 4.33398 14.6668 8.00065 14.6668Z"\r
1179
+ stroke="#101010" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" />\r
1180
+ <path d="M8 5.3335V8.66683" stroke="#101010" stroke-width="1.2" stroke-linecap="round"\r
1181
+ stroke-linejoin="round" />\r
1182
+ <path d="M7.99609 10.6665H8.00208" stroke="#101010" stroke-width="1.2" stroke-linecap="round"\r
1183
+ stroke-linejoin="round" />\r
1184
+ </svg>\r
1185
+ \r
1186
+ \r
1187
+ <div\r
1188
+ class="text-xs w-0 absolute transition-all duration-500 hidden rotate-45 left-0 top-5 z-30 text-[#98A2B3] hover:block bg-white p-3 rounded-lg translate-x-[0%] min-w-[15rem] shadow before:h-4 before:w-4 before:absolute before:-top-0 before:left-0 before:translate-x-[0%] before:-translate-y-1 before:bg-white before:rotate-45 group-hover:rotate-0 hover:rotate-0 hover:opacity-100 group-hover:block group-hover:w-4/5 hover:w-full">\r
1189
+ <p class="text-black font-medium text-xs">\r
1190
+ What is this?\r
1191
+ </p>\r
1192
+ <p class="text-xs">\r
1193
+ This rate reflects the current exchange rate for\r
1194
+ converting United States Dollars (USD) to <span id="tooltip-localCurrency-mob"> Nigerian Naira\r
1195
+ (NGN) </span>. Please note that exchange rates are subject to\r
1196
+ change and may vary slightly at the time of the\r
1197
+ transaction.\r
1198
+ </p>\r
1199
+ </div>\r
1200
+ </div>\r
1201
+ </div>\r
1202
+ </div>\r
1203
+ <div>\r
1204
+ <p class="text-base font-semibold break-words whitespace-normal" id="plan-name-mob">-</p>\r
1205
+ \r
1206
+ <div>\r
1207
+ <p class="whitespace-nowrap mb-1 text-2xl font-bold">\r
1208
+ <span id="designated-rate-mob" class="inline-block"> USD 0</span>\r
1209
+ </p>\r
1210
+ <div class="text-sm" id="source-rate-mob">\r
1211
+ <span> To pay: </span>\r
1212
+ <span class="ml-1 font-bold"> NGN 1</span>\r
1213
+ </div>\r
1214
+ </div>\r
1215
+ </div>\r
1216
+ </div>\r
1217
+ \r
1218
+ </div>\r
1219
+ \r
1220
+ <div class="pt-5 pb-4 border-b border-b-grey-faint" id="payment-methods-container">\r
1221
+ <h3 class="mb-3 text-sm md:text-xs text-grey-400 font-semibold"><span id="select-payment-method-text">Select your\r
1222
+ preferred</span> payment method</h3>\r
1223
+ \r
1224
+ <div class="payment-options">\r
1225
+ \r
1226
+ <!-- Tab options -->\r
1227
+ </div>\r
1228
+ </div>`;class Dg{constructor(t){g(this,"container");g(this,"email");g(this,"amount",0);g(this,"metadata");g(this,"currency");g(this,"localCurrency");g(this,"merchantDetail");g(this,"onAction");g(this,"isMobile");g(this,"onClose");g(this,"currentPaymentMethod");this.container=t.container,this.email=t.email,this.amount=t.amount||0,this.metadata=t.metadata,this.currency=t.currency,this.localCurrency=t.localCurrency,this.merchantDetail=t.merchantDetail,this.onAction=t.onAction,this.isMobile=t.isMobile,this.onClose=t.onClose,this.currentPaymentMethod=t.currentPaymentMethod}attachListeners(){const t=this.container.querySelectorAll(".tab-button");Array.from(t).forEach(o=>{const s=o.dataset.name||"",a=o.querySelector(".tab-button-icon"),u=o.querySelector(".tab-button-label");a&&(a.innerHTML=Oe[s].icon),u&&(u.textContent=Oe[s].label),o.addEventListener("click",c=>{c.preventDefault(),this.onAction(s)})});const e=this.container.querySelector("#close-btn");e&&e.addEventListener("click",()=>{this.onClose(!0)});const i=document.getElementById("go-back");i==null||i.addEventListener("click",()=>{this.onAction("")})}renderComponent(){var E,L,P,H,N,F,z,G,V,X,Be,te,Ue,Pe,pe,xe,Fe,dn,Te,gn,Ge,ve,K,hn,rn,De,yn,In,mn;this.container.innerHTML=this.render(),this.amount=this.amount;const t=this.container.querySelector("#merchant-logo-container"),r=this.container.querySelector("#merchant-logo"),e=this.container.querySelector("#merchant-email"),i=this.container.querySelector("#merchant-email-mob"),o=this.container.querySelector("#plan-name"),s=this.container.querySelector("#plan-name-mob"),a=this.container.querySelector("#payment-fees"),u=this.container.querySelector("#currency-cursor"),c=this.container.querySelector("#currency-cursor-mob"),d=this.container.querySelector("#payment-rate-display"),h=this.container.querySelector("#payment-rate-display-mob"),p=this.container.querySelector("#designated-rate"),y=this.container.querySelector("#designated-rate-mob"),w=this.container.querySelector("#designated-rate-no-plan"),k=this.container.querySelector("#source-rate"),b=this.container.querySelector("#source-rate-mob"),S=this.container.querySelector("#tooltip-localCurrency"),A=this.container.querySelector("#tooltip-localCurrency-mob");if((E=this.merchantDetail)!=null&&E.merchantLogo?r&&r.setAttribute("src",(L=this.merchantDetail)==null?void 0:L.merchantLogo):t&&(r==null||r.remove(),t.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>`),e&&(e.innerHTML=this.email),i&&(i.innerHTML=this.email),o){if((H=(P=this.merchantDetail)==null?void 0:P.plan)!=null&&H.title){const wn=((F=(N=this.merchantDetail)==null?void 0:N.plan)==null?void 0:F.title)||"";o.textContent=no(wn)}(z=this.metadata)!=null&&z.productName&&(o.textContent=no(this.metadata.productName))}if(s){if((V=(G=this.merchantDetail)==null?void 0:G.plan)!=null&&V.title){const wn=((Be=(X=this.merchantDetail)==null?void 0:X.plan)==null?void 0:Be.title)||"";s.textContent=no(wn)}(te=this.metadata)!=null&&te.productName&&(s.textContent=no(this.metadata.productName))}u&&(this.currency==="USD"?d&&(d.innerHTML=`1 ${((Pe=(Ue=this.merchantDetail)==null?void 0:Ue.rate)==null?void 0:Pe.to)||"-"} = ${((xe=(pe=this.merchantDetail)==null?void 0:pe.rate)==null?void 0:xe.from)||"-"} ${ze(((Fe=this.merchantDetail.rate)==null?void 0:Fe.rate)||1,2)} `):u.innerHTML=""),c&&(this.currency==="USD"?h&&(h.innerHTML=`1 ${((Te=(dn=this.merchantDetail)==null?void 0:dn.rate)==null?void 0:Te.to)||"-"} = ${((Ge=(gn=this.merchantDetail)==null?void 0:gn.rate)==null?void 0:Ge.from)||"-"} ${ze(((ve=this.merchantDetail.rate)==null?void 0:ve.rate)||1,2)} `):c.innerHTML=""),(hn=(K=this.merchantDetail)==null?void 0:K.plan)!=null&&hn.title||(rn=this.metadata)!=null&&rn.productName?p&&(p.innerHTML=`${this.currency} ${ze(this.amount,2)}`):(w&&(w.innerHTML=`<span> ${this.currency} ${ze(this.amount,2)} </span>`),o&&s&&(o.remove(),s==null||s.remove()),this.localCurrency?p==null||p.remove():a&&a.remove()),y&&(y.innerHTML=`${this.currency} ${ze(this.amount,2)}`),k&&(this.localCurrency&&this.localCurrency!==this.currency?k.children[1].innerHTML=`${this.localCurrency} ${ze(this.amount*(((yn=(De=this.merchantDetail)==null?void 0:De.rate)==null?void 0:yn.rate)||1),2)}`:k.remove()),b&&(this.localCurrency&&this.localCurrency!==this.currency?b.children[1].innerHTML=`${this.localCurrency} ${ze(this.amount*(((mn=(In=this.merchantDetail)==null?void 0:In.rate)==null?void 0:mn.rate)||1),2)}`:b.remove());const x=Rg[this.localCurrency];S&&this.localCurrency&&(S.innerHTML=x?`${x} (${this.localCurrency})`:this.localCurrency),A&&this.localCurrency&&(A.innerHTML=x?`${x} (${this.localCurrency})`:this.localCurrency),this.renderPaymentOptions(this.container),this.attachListeners()}renderPaymentOptions(t){const r=t.querySelector(".payment-options"),e=this.localCurrency?this.localCurrency:this.currency;if(r){const i=this.merchantDetail.plan?[Oe.card]:this.merchantDetail.paymentMethods.filter(o=>o!=="ussd").map(o=>Oe[o]);if(this.isMobile){let o='<div class="">';i.forEach(s=>{o+=`
1229
+ <div key=${s.key}>
1230
+ <button class="tab-button gap-2 mb-4 group" data-name="${s.key}">
1231
+ <div class="lg:block">${s.icon}</div>
1204
1232
  <div class="flex items-center gap-2">
1205
1233
  <span>${s.label} </span>
1206
1234
  ${s.key==="card"?` <div class="bg-tone-100 rounded-[40px] h-[22px] text-xxs text-white align-center px-2"> ${e} Card </div>`:""}
@@ -1237,210 +1265,210 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1237
1265
  </div>
1238
1266
  </button>
1239
1267
  </div>
1240
- `;r+="</div>"}r+="</div>"}r+="</div>",i.innerHTML=r}}}render(){return el}}const il=`<div class="flex items-center justify-center md:justify-between w-full text-xxs mt-5">
1241
- <div class="text-tone-60"><span>Powered by</span> <span class="font-bold">Spotflow</span></div>
1242
- <div class="align-center text-tone-60 hidden md:flex gap-4">
1243
- <a href="https://ribbon-scowl-35f.notion.site/Terms-Conditions-940742f0a1b144498ffc1786c5bc6a08?pvs=4" target="_blank" class="hover:font-bold">Terms</a>
1244
- <a href="https://ribbon-scowl-35f.notion.site/Privacy-Policy-Spotflow-3997ee8d923d4cd39a3dc43b7249b713" target="_blank" class="hover:font-bold">Privacy</a>
1245
- <a href="mailto:hello@spotflow.one" class="hover:font-bold">Contact</a>
1246
- </div>
1247
- </div>`;class tl{constructor(e){h(this,"container");this.container=e.container}attachListener(){}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return il}}const ol=`<div id="mobileConfirmationProgress">
1248
- <div>
1249
- <div>
1250
- <div class=" grid grid-rows-[auto_1fr] gap-4 mx-5">
1251
- <div class="items-center justify-self-center flex flex-col relative ">
1252
- <svg class="animate-spin" width="40" height="40" viewBox="0 0 64 64" fill="none"
1253
- xmlns="http://www.w3.org/2000/svg">
1254
- <path
1255
- 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"
1256
- stroke="black" stroke-width="4" stroke-linejoin="round" />
1257
- </svg>
1258
- <!-- <div class="relative w-12 h-12">
1259
- <svg viewBox="0 0 100 100" width="100" height="100" class="h-full w-full">
1260
- <circle stroke-width="10" stroke="#E6E6E7" stroke-linecap="round" cx="50" cy="50"
1261
- class="circle-progress-bg" r="40" fill="transparent"></circle>
1262
- <circle stroke-width="11" stroke="#000000" stroke-linecap="round" cx="50" cy="50" r="40"
1263
- class="circle-progress" fill="transparent" stroke-dasharray="" stroke-dashoffset=""
1264
- transform="rotate(-90 50 50)"></circle>
1265
- </svg>
1266
-
1267
- </div> -->
1268
- </div>
1269
- </div>
1270
- </div>
1271
- <div class="text-center w-11/12 md:w-4/5 mx-auto grid gap-4">
1272
- <h5 class="text-center text-sm text-grey-400">
1273
- We are confirming transaction status.
1274
- <br>
1275
- This can take a few minutes.
1276
- </h5>
1277
-
1278
- <div>
1279
- <p class="text-grey-400 text-sm">
1280
- Please wait for <span id="ctd-timer" class="font-bold"> </span> minutes
1281
- </p>
1282
- </div>
1283
-
1284
- </div>
1285
- </div>
1286
- </div>`;class sl{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");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}attachListeners(){this.initialTime=300,this.timeLeft=this.initialTime;const e=3e4;this.abortController=new AbortController,setTimeout(()=>{this.verifyMobileMoney(this.token,e,({data:i,headers:t})=>{this.onAction(4),this.redirectTo(i,t,"success")},()=>{this.onAction(5)})},5e3),this.startTimer()}async verifyMobileMoney(e,i,t,o){let s=0,r=i,l=!0,c;this.abortController&&(c=this.abortController.signal);const b=async()=>{if(this.timeLeft<=0){l=!1,this.onAction(8);return}s+=1;try{const p=await vn(e,this.ref,c,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:"Mobile Money",verification_status:"Failed"}),o(p)),p.data.status==="inProgress"&&(l&&(r=i*(s+1),this.timer=setTimeout(b,r)),this.setPaymentResponses(p.data,p.headers),P.track("verify_payment",{payment_method:"Mobile Money",verification_status:"In Progress"})),(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:"Mobile Money",verification_status:"Success"}),t(p))}catch{l&&(r=i*(s+1),this.timer=setTimeout(b,r))}};b()}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=ri(this.timeLeft),this.startTimer())):(this.stopTimer(),this.onAction(8))},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}renderComponent(){this.container.innerHTML=this.render(),this.attachListeners()}render(){return ol}}const al=`<form id="mobile-money-form">
1287
- <div>
1288
- <h5 class="text-grey-400 font-semibold text-sm">Please enter your Mobile Money details to begin payment</h5>
1289
-
1290
- <div class="mt-2 flex flex-col gap-4">
1291
- <div class="relative bank-select-relative">
1292
- <div class="relative w-full">
1293
- <span class="absolute text-xs left-0 top-1 text-grey-100 pt-1 pb-1 px-3 tracking-[0.5px]">Network</span>
1294
- <div>
1295
- <select class="mm-input-container appearance-none pr-7" id="network-search-input" name="network"
1296
- placeholder="Select Network" required></select>
1297
- </div>
1298
- <div class="absolute right-4 top-1/2 -translate-y-2/4">
1299
- <svg id="bank-dropdown" width="14" height="8" viewBox="0 0 14 8" fill="none"
1300
- xmlns="http://www.w3.org/2000/svg">
1301
- <path d="M1 1L7 7L13 1" stroke="#9E9BA1" stroke-width="2" stroke-linecap="round"
1302
- stroke-linejoin="round" />
1303
- </svg>
1304
- </div>
1305
- </div>
1306
- </div>
1307
-
1308
- <div class="relative w-full">
1309
- <!-- <span class="absolute text-xs left-0 top-1 text-grey-100 pt-1 pb-1 px-3 tracking-[0.5px]">Mobile number</span> -->
1310
- <div class="flex border border-tone-40 rounded-lg" id="phone-number-container">
1311
- <div class="grow relative flex gap-2">
1312
- <div class="relative flex w-full">
1313
- <div class="absolute left-0 top-1/2 -translate-y-2/4 border-r py-4 pl-4 pr-2 border-tone-40">
1314
- <div id="region-code" class="align-center gap-2">
1315
- </div>
1316
- </div>
1317
- <input class="details-input-container ml-20 mr-11 grow py-4 pl-4 pr-2 font-normal placeholder:text-tone-50" type="tel" id="phone-number-input" name="number"
1318
- placeholder="Enter your mobile number" required />
1319
- </div>
1320
- </div>
1321
- </div>
1322
- <div id="phone-number-error" class="text-sm text-error font-semibold mt-2 hidden"></div>
1323
- </div>
1324
-
1325
- </div>
1326
- <div class="mt-4">
1327
- <button type="submit" class="details-form-button">
1328
- <svg class="spinner hidden" id="spinner" viewBox="0 0 24 24">
1329
- <path
1330
- d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">
1331
- </path>
1332
- </svg>
1333
- <span id="mobile-money-button-text"> </span>
1334
- </button>
1335
- </div>
1336
- </div>
1337
- <div class="container-center mt-4 gap-1" id="pci-dsss">
1338
- <svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">
1339
- <path
1340
- d="M4.884 0.68L1.384 2.235C1.024 2.395 0.789001 2.755 0.789001 3.15V5.5C0.789001 8.275 2.709 10.87 5.289 11.5C7.869 10.87 9.789 8.275 9.789 5.5V3.15C9.789 2.755 9.554 2.395 9.194 2.235L5.694 0.68C5.439 0.565 5.139 0.565 4.884 0.68ZM5.289 5.995H8.789C8.524 8.055 7.149 9.89 5.289 10.465V6H1.789V3.15L5.289 1.595V5.995Z"
1341
- fill="#6D6A73" />
1342
- </svg>
1343
-
1344
- <p class="text-[10px] text-grey-100">
1345
- PCI DSS Certified
1346
- </p>
1347
- </div>
1348
-
1349
- <div class="w-9/12 mx-auto mt-5">
1350
- <div class="bg-[#FEF7ED] text-[#816039] text-sm text-center rounded-lg p-2">
1351
- This payment may incur a 1% E-Levy, as mandated by the
1352
- Ghana Revenue Authority (GRA).
1353
- </div>
1354
- </div>
1355
- </form>`;class rl{constructor(e){h(this,"container");h(this,"payment");h(this,"warningError");h(this,"pageLoader");h(this,"localCurrency");h(this,"rate");h(this,"amount");h(this,"onAction");h(this,"switchScreen");h(this,"merchantKey");h(this,"rdtCode");h(this,"url");h(this,"currency");h(this,"restartTransactionProcess");this.container=e.container,this.onAction=e.onAction,this.switchScreen=e.switchScreen,this.url=e.url,this.merchantKey=e.merchantKey,this.rdtCode=e.rdtCode,this.currency=e.currency,this.localCurrency=e.localCurrency,this.rate=e.rate,this.amount=e.amount,this.restartTransactionProcess=e.restartTransactionProcess,this.warningError=new fn({container:this.container,onAction:this.restartTransactionProcess.bind(this)})}validateForm(){const e=this.container.querySelector("#phone-number-input"),i=this.container.querySelector("#network-search-input"),t=this.container.querySelector(".details-form-button"),o=this.container.querySelector("#phone-number-container"),s=this.container.querySelector("#phone-number-error");if(!e||!i||!t)return;const r=this.localCurrency?this.localCurrency:this.currency,l=Tt.find(c=>c.name===r);e.value.length>Number((l==null?void 0:l.length)||"9")?(o&&(o.classList.remove("border-tone-40"),o.classList.add("border-[#D62020]"),e.classList.remove("text-tone-100"),e.classList.add("text-[#D62020]")),s&&(s.classList.remove("hidden"),s.classList.add("block"),s.innerHTML="Please enter a valid Ghana Mobile Money number.")):(o&&(o.classList.remove("border-[#D62020]"),o.classList.add("border-tone-40"),e.classList.remove("text-[#D62020]"),e.classList.add("text-tone-100")),s&&(s.classList.remove("block"),s.classList.add("hidden"))),e.value.length>0&&e.value.length===Number((l==null?void 0:l.length)||"9")&&i.value?t.disabled=!1:t.disabled=!0}attachListener(){const e=document.querySelector("#mobile-money-form"),i=document.querySelector("#pci-dss"),t=this.container.querySelector("#phone-number-input"),o=this.container.querySelector("#network-search-input"),s=this.container.querySelector(".details-form-button");s&&(s.disabled=!0),t&&o&&(t.addEventListener("input",r=>{const l=r.target;l.value=l.value.replace(/\D/g,""),this.validateForm()}),o.addEventListener("change",()=>this.validateForm())),i&&i.classList.add("hidden"),!(!o||!t||!s)&&e&&e.addEventListener("submit",r=>{r.preventDefault();const l=`0${t.value}`,c=o.value;this.onAction(r)({code:c,phoneNumber:l}),P.track("start_payment",{payment_method:"Mobile Money"})})}displayButtonText(e){const i=this.container.querySelector("#mobile-money-button-text");i&&(this.localCurrency&&this.localCurrency!==this.currency?i.textContent=`Continue to pay ${this.localCurrency} ${ke((this.amount||0)*(this.rate||1),2)}`:i.textContent=`Continue to to pay ${this.currency} ${ke(this.amount||0,2)}`)}renderComponent(e){this.container.innerHTML=this.render();const i=this.container.querySelector("#network-search-input");if(i){const r=new Option("Select your network","",!0,!0);r.disabled=!0,i.appendChild(r),i.classList.remove("text-tone-100"),i.classList.add("text-tone-50"),i&&e.forEach(l=>{const c=new Option(l.name,l.code);i.appendChild(c),i.classList.remove("text-tone-50"),i.classList.add("text-tone-100")})}const t=this.container.querySelector("#region-code"),o=this.localCurrency?this.localCurrency:this.currency,s=Tt.find(r=>r.name===o);if(t){t.innerHTML=`
1356
- ${s==null?void 0:s.icon}
1357
- <span class="text-tone-100 text-sm font-semibold">${s==null?void 0:s.dialCode}</span>
1358
- `;const r=t.querySelector("svg");r&&(r.setAttribute("width","20"),r.setAttribute("height","20"))}this.displayButtonText(),this.attachListener()}renderContent(){this.switchScreen(2),ks(this.merchantKey,this.currency,this.rdtCode,this.url,this.localCurrency).then(e=>{this.renderComponent(e)}).catch(e=>{this.switchScreen(5),e.message?this.warningError.setPaymentError(e.message):this.warningError.setPaymentError("Unable to fetch network providers at this time.")})}render(){return al}}const ll=`<div id="checkoutMobileOtp">
1359
- <div class="w-full">
1360
- <div id="otp-content" class=" grid gap-4">
1361
- <h5 class="text-black" id="otp-message">
1362
-
1363
- </h5>
1364
-
1365
- <div class="">
1366
- <div class="relative w-full">
1367
- <input class="otp-input text-center" type="tel" id="card-otp" name="otp" required />
1368
- <div id="otp-error-container" class="mt-2">
1369
- <p id="otp-error" class="text-sm font-semibold text-error"></p>
1370
- </div>
1371
-
1372
- <div class="mt-4 md:mt-6">
1373
- <button type="button" class="otp-button container-center" disabled="true">
1374
- <svg class="spinner hidden" id="spinner" viewBox="0 0 24 24">
1375
- <path
1376
- d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">
1377
- </path>
1378
- </svg>
1379
- <span id="mobile-money-button-text">Authorize</span>
1380
- </button>
1381
- </div>
1382
-
1383
- </div>
1384
-
1385
- <div class="py-5">
1386
- <div class="container-center">
1387
- <div id="otp-loader"></div>
1388
- <button type="button" id="cancel-payment" class="text-sm text-tone-100 font-semibold">
1389
-
1390
-
1391
- Cancel
1392
- payment</button>
1393
- </div>
1394
- </div>
1395
- </div>
1396
- </div>
1397
- </div>`;class dl{constructor(e){h(this,"container");h(this,"momoOtp");h(this,"onAction");h(this,"onClose");h(this,"otpMessage");this.container=e.container,this.onAction=e.onAction,this.onClose=e.onClose,this.momoOtp="",this.otpMessage=e.otpMessage}attachListener(){const e=this.container.querySelector(".otp-input"),i=this.container.querySelector(".otp-button"),t=this.container.querySelector("#cancel-payment");e&&e.addEventListener("input",o=>this.handleOtpInput(o,i)),i&&i.addEventListener("click",o=>{this.onAction(o)(this.momoOtp)}),t&&t.addEventListener("click",()=>{const o=this.container.querySelector("#otp-loader");o&&(o.innerHTML=`<svg class="animate-spin" width="40" height="40" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
1268
+ `;s+="</div>"}s+="</div>"}s+="</div>",r.innerHTML=s}}}render(){return Bg}}const Hg=`<div class="flex items-center justify-center md:justify-between w-full text-xxs mt-5">\r
1269
+ <div class="text-tone-60"><span>Powered by</span> <span class="font-bold">Spotflow</span></div>\r
1270
+ <div class="align-center text-tone-60 hidden md:flex gap-4">\r
1271
+ <a href="https://ribbon-scowl-35f.notion.site/Terms-Conditions-940742f0a1b144498ffc1786c5bc6a08?pvs=4" target="_blank" class="hover:font-bold">Terms</a>\r
1272
+ <a href="https://ribbon-scowl-35f.notion.site/Privacy-Policy-Spotflow-3997ee8d923d4cd39a3dc43b7249b713" target="_blank" class="hover:font-bold">Privacy</a>\r
1273
+ <a href="mailto:hello@spotflow.one" class="hover:font-bold">Contact</a>\r
1274
+ </div>\r
1275
+ </div>`;class Ug{constructor(t){g(this,"container");this.container=t.container}attachListener(){}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return Hg}}const Fg=`<div id="mobileConfirmationProgress">\r
1276
+ <div>\r
1277
+ <div>\r
1278
+ <div class=" grid grid-rows-[auto_1fr] gap-4 mx-5">\r
1279
+ <div class="items-center justify-self-center flex flex-col relative ">\r
1280
+ <svg class="animate-spin" width="40" height="40" viewBox="0 0 64 64" fill="none"\r
1281
+ xmlns="http://www.w3.org/2000/svg">\r
1282
+ <path\r
1283
+ 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"\r
1284
+ stroke="black" stroke-width="4" stroke-linejoin="round" />\r
1285
+ </svg>\r
1286
+ <!-- <div class="relative w-12 h-12">\r
1287
+ <svg viewBox="0 0 100 100" width="100" height="100" class="h-full w-full">\r
1288
+ <circle stroke-width="10" stroke="#E6E6E7" stroke-linecap="round" cx="50" cy="50"\r
1289
+ class="circle-progress-bg" r="40" fill="transparent"></circle>\r
1290
+ <circle stroke-width="11" stroke="#000000" stroke-linecap="round" cx="50" cy="50" r="40"\r
1291
+ class="circle-progress" fill="transparent" stroke-dasharray="" stroke-dashoffset=""\r
1292
+ transform="rotate(-90 50 50)"></circle>\r
1293
+ </svg>\r
1294
+ \r
1295
+ </div> -->\r
1296
+ </div>\r
1297
+ </div>\r
1298
+ </div>\r
1299
+ <div class="text-center w-11/12 md:w-4/5 mx-auto grid gap-4">\r
1300
+ <h5 class="text-center text-sm text-grey-400">\r
1301
+ We are confirming transaction status.\r
1302
+ <br>\r
1303
+ This can take a few minutes.\r
1304
+ </h5>\r
1305
+ \r
1306
+ <div>\r
1307
+ <p class="text-grey-400 text-sm">\r
1308
+ Please wait for <span id="ctd-timer" class="font-bold"> </span> minutes\r
1309
+ </p>\r
1310
+ </div>\r
1311
+ \r
1312
+ </div>\r
1313
+ </div>\r
1314
+ </div>`;class Gg{constructor(t){g(this,"container");g(this,"onAction");g(this,"onSuccess");g(this,"ref");g(this,"token");g(this,"initialTime",300);g(this,"abortController");g(this,"timeLeft");g(this,"timer");g(this,"timerId",null);g(this,"rdtCode");g(this,"url");g(this,"callBackUrl");g(this,"setPaymentResponses");this.container=t.container,this.timeLeft=this.initialTime,this.onAction=t.onAction,this.ref=t.ref,this.token=t.token,this.rdtCode=t.rdtCode,this.url=t.url,this.onSuccess=t.onSuccess,this.callBackUrl=t.callBackUrl,this.setPaymentResponses=t.setPaymentResponses}attachListeners(){this.initialTime=300,this.timeLeft=this.initialTime;const t=3e4;this.abortController=new AbortController,setTimeout(()=>{this.verifyMobileMoney(this.token,t,({data:r,headers:e})=>{this.onAction(4),this.redirectTo(r,e,"success")},()=>{this.onAction(5)})},5e3),this.startTimer()}async verifyMobileMoney(t,r,e,i){let o=0,s=r,a=!0,u;this.abortController&&(u=this.abortController.signal);const c=async()=>{if(this.timeLeft<=0){a=!1,this.onAction(8);return}o+=1;try{const d=await dt(t,this.ref,u,this.rdtCode,this.url);d.data.status==="failed"&&(a=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),this.setPaymentResponses(d.data,d.headers),B.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Failed"}),i(d)),d.data.status==="inProgress"&&(a&&(s=r*(o+1),this.timer=setTimeout(c,s)),this.setPaymentResponses(d.data,d.headers),B.track("verify_payment",{payment_method:"Mobile Money",verification_status:"In Progress"})),(d.data.status==="success"||d.data.status==="successful")&&(this.setPaymentResponses(d.data,d.headers),a=!1,clearTimeout(this.timer),clearInterval(this.timerId||void 0),B.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Success"}),e(d))}catch{a&&(s=r*(o+1),this.timer=setTimeout(c,s))}};c()}redirectTo(t,r,e){const i=r.get("spf-redirect-url");this.callBackUrl=i||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const o=new URL(this.callBackUrl);o.searchParams.append("status",t.status),o.searchParams.append("reference",t.reference),window.location.href=o.toString()},1800):e==="success"&&this.onSuccess(t)}startTimer(){const t=this.container.querySelector("#ctd-timer");this.stopTimer(),this.timerId=window.setInterval(()=>{this.timeLeft>0?(this.timeLeft-=1,t&&(t.innerHTML=Ui(this.timeLeft),this.startTimer())):(this.stopTimer(),this.onAction(8))},1e3)}stopTimer(){this.timerId!==null&&(clearInterval(this.timerId),this.timerId=null)}renderComponent(){this.container.innerHTML=this.render(),this.attachListeners()}render(){return Fg}}const Kg=`<form id="mobile-money-form">\r
1315
+ <div>\r
1316
+ <h5 class="text-grey-400 font-semibold text-sm">Please enter your Mobile Money details to begin payment</h5>\r
1317
+ \r
1318
+ <div class="mt-2 flex flex-col gap-4">\r
1319
+ <div class="relative bank-select-relative">\r
1320
+ <div class="relative w-full">\r
1321
+ <span class="absolute text-xs left-0 top-1 text-grey-100 pt-1 pb-1 px-3 tracking-[0.5px]">Network</span>\r
1322
+ <div>\r
1323
+ <select class="mm-input-container appearance-none pr-7" id="network-search-input" name="network"\r
1324
+ placeholder="Select Network" required></select>\r
1325
+ </div>\r
1326
+ <div class="absolute right-4 top-1/2 -translate-y-2/4">\r
1327
+ <svg id="bank-dropdown" width="14" height="8" viewBox="0 0 14 8" fill="none"\r
1328
+ xmlns="http://www.w3.org/2000/svg">\r
1329
+ <path d="M1 1L7 7L13 1" stroke="#9E9BA1" stroke-width="2" stroke-linecap="round"\r
1330
+ stroke-linejoin="round" />\r
1331
+ </svg>\r
1332
+ </div>\r
1333
+ </div>\r
1334
+ </div>\r
1335
+ \r
1336
+ <div class="relative w-full">\r
1337
+ <!-- <span class="absolute text-xs left-0 top-1 text-grey-100 pt-1 pb-1 px-3 tracking-[0.5px]">Mobile number</span> -->\r
1338
+ <div class="flex border border-tone-40 rounded-lg" id="phone-number-container">\r
1339
+ <div class="grow relative flex gap-2">\r
1340
+ <div class="relative flex w-full">\r
1341
+ <div class="absolute left-0 top-1/2 -translate-y-2/4 border-r py-4 pl-4 pr-2 border-tone-40">\r
1342
+ <div id="region-code" class="align-center gap-2">\r
1343
+ </div>\r
1344
+ </div>\r
1345
+ <input class="details-input-container ml-20 mr-11 grow py-4 pl-4 pr-2 font-normal placeholder:text-tone-50" type="tel" id="phone-number-input" name="number"\r
1346
+ placeholder="Enter your mobile number" required />\r
1347
+ </div>\r
1348
+ </div>\r
1349
+ </div>\r
1350
+ <div id="phone-number-error" class="text-sm text-error font-semibold mt-2 hidden"></div>\r
1351
+ </div>\r
1352
+ \r
1353
+ </div>\r
1354
+ <div class="mt-4">\r
1355
+ <button type="submit" class="details-form-button">\r
1356
+ <svg class="spinner hidden" id="spinner" viewBox="0 0 24 24">\r
1357
+ <path\r
1358
+ d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">\r
1359
+ </path>\r
1360
+ </svg>\r
1361
+ <span id="mobile-money-button-text"> </span>\r
1362
+ </button>\r
1363
+ </div>\r
1364
+ </div>\r
1365
+ <div class="container-center mt-4 gap-1" id="pci-dsss">\r
1366
+ <svg width="10" height="12" viewBox="0 0 10 12" fill="none" xmlns="http://www.w3.org/2000/svg">\r
1367
+ <path\r
1368
+ d="M4.884 0.68L1.384 2.235C1.024 2.395 0.789001 2.755 0.789001 3.15V5.5C0.789001 8.275 2.709 10.87 5.289 11.5C7.869 10.87 9.789 8.275 9.789 5.5V3.15C9.789 2.755 9.554 2.395 9.194 2.235L5.694 0.68C5.439 0.565 5.139 0.565 4.884 0.68ZM5.289 5.995H8.789C8.524 8.055 7.149 9.89 5.289 10.465V6H1.789V3.15L5.289 1.595V5.995Z"\r
1369
+ fill="#6D6A73" />\r
1370
+ </svg>\r
1371
+ \r
1372
+ <p class="text-[10px] text-grey-100">\r
1373
+ PCI DSS Certified\r
1374
+ </p>\r
1375
+ </div>\r
1376
+ \r
1377
+ <div class="w-9/12 mx-auto mt-5">\r
1378
+ <div class="bg-[#FEF7ED] text-[#816039] text-sm text-center rounded-lg p-2">\r
1379
+ This payment may incur a 1% E-Levy, as mandated by the\r
1380
+ Ghana Revenue Authority (GRA).\r
1381
+ </div>\r
1382
+ </div>\r
1383
+ </form>`;class jg{constructor(t){g(this,"container");g(this,"payment");g(this,"warningError");g(this,"pageLoader");g(this,"localCurrency");g(this,"rate");g(this,"amount");g(this,"onAction");g(this,"switchScreen");g(this,"merchantKey");g(this,"rdtCode");g(this,"url");g(this,"currency");g(this,"restartTransactionProcess");this.container=t.container,this.onAction=t.onAction,this.switchScreen=t.switchScreen,this.url=t.url,this.merchantKey=t.merchantKey,this.rdtCode=t.rdtCode,this.currency=t.currency,this.localCurrency=t.localCurrency,this.rate=t.rate,this.amount=t.amount,this.restartTransactionProcess=t.restartTransactionProcess,this.warningError=new ht({container:this.container,onAction:this.restartTransactionProcess.bind(this)})}validateForm(){const t=this.container.querySelector("#phone-number-input"),r=this.container.querySelector("#network-search-input"),e=this.container.querySelector(".details-form-button"),i=this.container.querySelector("#phone-number-container"),o=this.container.querySelector("#phone-number-error");if(!t||!r||!e)return;const s=this.localCurrency?this.localCurrency:this.currency,a=lo.find(u=>u.name===s);t.value.length>Number((a==null?void 0:a.length)||"9")?(i&&(i.classList.remove("border-tone-40"),i.classList.add("border-[#D62020]"),t.classList.remove("text-tone-100"),t.classList.add("text-[#D62020]")),o&&(o.classList.remove("hidden"),o.classList.add("block"),o.innerHTML="Please enter a valid Ghana Mobile Money number.")):(i&&(i.classList.remove("border-[#D62020]"),i.classList.add("border-tone-40"),t.classList.remove("text-[#D62020]"),t.classList.add("text-tone-100")),o&&(o.classList.remove("block"),o.classList.add("hidden"))),t.value.length>0&&t.value.length===Number((a==null?void 0:a.length)||"9")&&r.value?e.disabled=!1:e.disabled=!0}attachListener(){const t=document.querySelector("#mobile-money-form"),r=document.querySelector("#pci-dss"),e=this.container.querySelector("#phone-number-input"),i=this.container.querySelector("#network-search-input"),o=this.container.querySelector(".details-form-button");o&&(o.disabled=!0),e&&i&&(e.addEventListener("input",s=>{const a=s.target;a.value=a.value.replace(/\D/g,""),this.validateForm()}),i.addEventListener("change",()=>this.validateForm())),r&&r.classList.add("hidden"),!(!i||!e||!o)&&t&&t.addEventListener("submit",s=>{s.preventDefault();const a=`0${e.value}`,u=i.value;this.onAction(s)({code:u,phoneNumber:a}),B.track("start_payment",{payment_method:"Mobile Money"})})}displayButtonText(t){const r=this.container.querySelector("#mobile-money-button-text");r&&(this.localCurrency&&this.localCurrency!==this.currency?r.textContent=`Continue to pay ${this.localCurrency} ${ze((this.amount||0)*(this.rate||1),2)}`:r.textContent=`Continue to to pay ${this.currency} ${ze(this.amount||0,2)}`)}renderComponent(t){this.container.innerHTML=this.render();const r=this.container.querySelector("#network-search-input");if(r){const s=new Option("Select your network","",!0,!0);s.disabled=!0,r.appendChild(s),r.classList.remove("text-tone-100"),r.classList.add("text-tone-50"),r&&t.forEach(a=>{const u=new Option(a.name,a.code);r.appendChild(u),r.classList.remove("text-tone-50"),r.classList.add("text-tone-100")})}const e=this.container.querySelector("#region-code"),i=this.localCurrency?this.localCurrency:this.currency,o=lo.find(s=>s.name===i);if(e){e.innerHTML=`
1384
+ ${o==null?void 0:o.icon}
1385
+ <span class="text-tone-100 text-sm font-semibold">${o==null?void 0:o.dialCode}</span>
1386
+ `;const s=e.querySelector("svg");s&&(s.setAttribute("width","20"),s.setAttribute("height","20"))}this.displayButtonText(),this.attachListener()}renderContent(){this.switchScreen(2),vh(this.merchantKey,this.currency,this.rdtCode,this.url,this.localCurrency).then(t=>{this.renderComponent(t)}).catch(t=>{this.switchScreen(5),t.message?this.warningError.setPaymentError(t.message):this.warningError.setPaymentError("Unable to fetch network providers at this time.")})}render(){return Kg}}const Vg=`<div id="checkoutMobileOtp">\r
1387
+ <div class="w-full">\r
1388
+ <div id="otp-content" class=" grid gap-4">\r
1389
+ <h5 class="text-black" id="otp-message">\r
1390
+ \r
1391
+ </h5>\r
1392
+ \r
1393
+ <div class="">\r
1394
+ <div class="relative w-full">\r
1395
+ <input class="otp-input text-center" type="tel" id="card-otp" name="otp" required />\r
1396
+ <div id="otp-error-container" class="mt-2">\r
1397
+ <p id="otp-error" class="text-sm font-semibold text-error"></p>\r
1398
+ </div>\r
1399
+ \r
1400
+ <div class="mt-4 md:mt-6">\r
1401
+ <button type="button" class="otp-button container-center" disabled="true">\r
1402
+ <svg class="spinner hidden" id="spinner" viewBox="0 0 24 24">\r
1403
+ <path\r
1404
+ d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">\r
1405
+ </path>\r
1406
+ </svg>\r
1407
+ <span id="mobile-money-button-text">Authorize</span>\r
1408
+ </button>\r
1409
+ </div>\r
1410
+ \r
1411
+ </div>\r
1412
+ \r
1413
+ <div class="py-5">\r
1414
+ <div class="container-center">\r
1415
+ <div id="otp-loader"></div>\r
1416
+ <button type="button" id="cancel-payment" class="text-sm text-tone-100 font-semibold">\r
1417
+ \r
1418
+ \r
1419
+ Cancel\r
1420
+ payment</button>\r
1421
+ </div>\r
1422
+ </div>\r
1423
+ </div>\r
1424
+ </div>\r
1425
+ </div>`;class zg{constructor(t){g(this,"container");g(this,"momoOtp");g(this,"onAction");g(this,"onClose");g(this,"otpMessage");this.container=t.container,this.onAction=t.onAction,this.onClose=t.onClose,this.momoOtp="",this.otpMessage=t.otpMessage}attachListener(){const t=this.container.querySelector(".otp-input"),r=this.container.querySelector(".otp-button"),e=this.container.querySelector("#cancel-payment");t&&t.addEventListener("input",i=>this.handleOtpInput(i,r)),r&&r.addEventListener("click",i=>{this.onAction(i)(this.momoOtp)}),e&&e.addEventListener("click",()=>{const i=this.container.querySelector("#otp-loader");i&&(i.innerHTML=`<svg class="animate-spin" width="40" height="40" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
1398
1426
  <path
1399
1427
  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"
1400
1428
  stroke="black" stroke-width="4" stroke-linejoin="round" />
1401
- </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 ll}}class cl{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",()=>{sn(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)})}renderComponent(){this.container.innerHTML=this.render(),this.attachListeners()}render(){return Ko}}class ul{constructor({container:e,merchantKey:i,localCurrency:t,metadata:o,callBackUrl:s,rdtCode:r,reference:l,onSuccess:c,url:b,email:p,amount:g,token:f,currency:y,disablePaymentMethods:C,hidePaymentMethods:k,showPaymentMethods:S,onClose:M,restartTransactionProcess:A,retryingPayment:_}){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,"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);this.container=e,this.onSuccess=c||(()=>null),this.token=f,this.currency=y,this.amount=g,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=r,this.url=b,this.reference=l,this.merchantDetails={},this.disablePaymentMethods=C,this.hidePaymentMethods=k,this.showPaymentMethods=S,this.onClose=M,this.paymentResponse={},this.paymentResponseHeaders={},this.restartTransactionProcess=A,this.retryingPayment=_,this.isMaxRetriesReached=!1,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")),(()=>{if(this.retryingPayment){const r={channel:"mobile_money",reference:this.reference,mobileMoney:{code:i.code,phoneNumber:i.phoneNumber}};return si(this.token,r,this.rdtCode,this.url)}else{const r={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},...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0};return ys(this.token,r,this.rdtCode,this.url)}})().then(({data:r,headers:l})=>{var c;if(this.paymentResponse=r,this.paymentResponseHeaders=l,r.status==="failed"){this.currentStep=5,r.providerMessage?this.warningScreen.setPaymentError(r.providerMessage):this.warningScreen.setPaymentError("Payment failed"),P.track("start_payment",{payment_method:"Mobile Money",verification_status:"Failed"});return}else if(((c=r==null?void 0:r.authorization)==null?void 0:c.mode)==="otp"){this.activeRef=r.reference,this.currentStep=6;return}else this.currentStep=3}).catch(r=>{P.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Null"}),r.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,r.message?this.warningScreen.setPaymentError(r.message):this.warningScreen.setPaymentError("Payment failed")),this.warningScreen.hideReportIssue()}).finally(()=>{t&&o&&(t.classList.add("hidden"),o.classList.remove("hidden"))})}showLoader(){this.pageLoader=new Ie(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")),oi(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 c=this.container.querySelector("#otp-error");l.code==="invalid_otp"?c&&(c.innerHTML=l.message):this.currentStep=3}).finally(()=>{t&&o&&(t.classList.add("hidden"),o.classList.remove("hidden"))})}async verifyPaymentProcess(){try{const e=await vn(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=e.data,this.paymentResponseHeaders=e.headers}catch{this.currentStep=5}}goBackToMerchant(){sn(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}renderMobileMoneyContent(e){var i,t;if(e&&(this.merchantDetails=e),this.currentStep===3&&this.disablePaymentMethods("mobile_money"),this.currentStep!==1){const o=document.getElementById("go-back");o&&(o.classList.remove("flex","items-center","gap-2","mb-2"),o.innerHTML="")}switch(this.currentStep===6?this.hidePaymentMethods():this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.currentStep){case 1:this.mobileMoneyForm=new rl({container:this.contents,merchantKey:this.token,url:this.url,onAction:o=>s=>this.createMobileMoney.bind(this)(o,s),ref:this.activeRef,switchScreen:o=>{this.currentStep=o},rdtCode:this.rdtCode,currency:this.currency,localCurrency:this.localCurrency,amount:this.amount,rate:e==null?void 0:e.rate.rate,restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.mobileMoneyForm.renderContent();break;case 2:this.mainLoader=new Ie(this.contents),this.mainLoader.mountLoader("25dvh"),this.mainLoader.updateMessage("Please wait");break;case 3:this.mobileMoneyConfirmation=new sl({container:this.contents,onAction:o=>{this.currentStep=o},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(o,s)=>{this.paymentResponse=o,this.paymentResponseHeaders=s}}),this.mobileMoneyConfirmation.renderComponent();break;case 4:this.successScreen=new Vn({container:this.contents,amount:this.amount,currency:this.currency,localCurrency:this.localCurrency,rate:(i=this.merchantDetails)==null?void 0:i.rate.rate}),this.successScreen.renderComponent();break;case 5:this.warningScreen=new fn({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 dl({container:this.contents,onClose:this.onClose,onAction:o=>s=>this.submitOtp.bind(this)(o,s),otpMessage:((t=this.paymentResponse)==null?void 0:t.providerMessage)||"Please enter your OTP sent to your phone"}),this.mobileMoneyValidationForm.renderComponent();break;case 7:this.pageLoader=new Ie(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 8:this.mobileMoneyConfirmationEnd=new cl({container:this.contents,onAction:o=>{this.currentStep=o},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 di({container:this.contents,onAction:()=>{var o;this.currentStep=5,this.warningScreen.setPaymentError(((o=this.paymentResponse)==null?void 0:o.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 hl=`<div id="eft-authenticate-container">
1402
- <div class="pt-3">
1403
- <div class="container-center">
1404
- <svg width="98" height="32" viewBox="0 0 98 32" fill="none" xmlns="http://www.w3.org/2000/svg"
1405
- xmlns:xlink="http://www.w3.org/1999/xlink">
1406
- <rect width="98" height="32" fill="url(#pattern0_13486_80257)" />
1407
- <defs>
1408
- <pattern id="pattern0_13486_80257" patternContentUnits="objectBoundingBox" width="1" height="1">
1409
- <use xlink:href="#image0_13486_80257" transform="scale(0.00666667 0.0204167)" />
1410
- </pattern>
1411
- <image id="image0_13486_80257" width="150" height="49" preserveAspectRatio="none"
1412
- xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAxCAYAAAA4GFC0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDkuMC1jMDAwIDc5LjE3MWMyN2ZhYiwgMjAyMi8wOC8xNi0yMjozNTo0MSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QjkwOTc5QTUwRjM0MTFFRUE5ODhCMTQxOUUyMjMyQTIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QjkwOTc5QTQwRjM0MTFFRUE5ODhCMTQxOUUyMjMyQTIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI0LjAgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0ZCODQ4MjcwRjMyMTFFRTk3MjBBOTZDQkQyQzdEQzYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0ZCODQ4MjgwRjMyMTFFRTk3MjBBOTZDQkQyQzdEQzYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7SP/CfAAARUklEQVR42uxdCZgUxRV+NQO7y7ILLDdKomAAEUQFAx54gbcC4okGFaMoBolG8YwmaDwTEENUjCCIJx5EQEVBUCLILWcExOUUlJuFhWVld6bzXtXr7pqa6pnZhe8Lcft939vqrq4+purv9/73qmZWOI4DoYRyqCUSdkEoIbBCCYEVSgisUEI55FLNrBBrnw1uLZjoOyKxXlYL91hd/Hsu1p2M203kAWrviE24vRjLKag7vOtI1bdR49p2KhF4PDcLGt/5OtSYtwZi9fLCEf0fyfrCRamBdRDSDrUL6qmov8ZRb8ajn3B/1MtRZ6F+ifp1OCRVxGJVwpX2RvD0k2ByRDXPerllPGH/KCxJr5R2zoG5WLyC9W/hfkk4HCHHIunFrm2MtFJxBpXu2silgevSdPcmS/wjTsFyBOoSrLw+HI6qbbHqoA6XwHKEwbmIhIk5uEEOdzXqj6jFqDWxvjEC7hjcPgnLTlhW9wAI8CssX8PyMtQ7UTeGQ1O1gNUKAfA+AqJtgrtziDuh5XLgddwpTCDejkbwhQsk0Rz3r8btmxlULkAvx/qOuHUJ6tJweKqGK2yPAz/LB5XUUtz/E+63weN/xv1CiOMlA9UD3BrUp1Hb4P5A1N2am2yKOpsDgVCqgMX6O4KormepHFiAf29DXejzKWl1oioqROsG0Bw1G7VMuTcxF9stVoEieU04gMUQ3PlYcS3ozNYtFw+Ox60zmH8F5RvSpyRCOcyB5Yhl+Lcz86IJ+Lcnlo7m9tDSALm236C28N2g8N1hHMrxL7pA+AActmJ0LOKslCCi6NCBa/l6+Vh+iNoa6/bZnwk1ilQtWk3zuaEcnsAKtgAD8NhqHD9KIAxVVsrzpA+j3ot1tZJTDKAnOzFyFD2R43/gRY8ScBEFDMe5DgEntMDgF6iUiuhhf/ooiOL9ECn5CQGW1qvnoB6LSgFEQ9TdqOtQl6MWVaCvnIPo658yaFeAehzq0ajYn7CFA6GVac7P5rK8Avdyz6NzyNMcqACFioIa6Wq8XVJZVxhDHaKAQKCQA0mZ9TckH9KBoog68a+1uFGCZQ2saYn6A+oweS61F0BknQKC4VhXBEIisjfukwvtyNfsjiUBa0LSE9WvBTXHfgW581dDWZM6Qc9NidpbGJxtLMc3SlcMQGmT2QHX6ID6T8/uVk4I2FNR7w44TjTgBg5cjrAcJ49B9GAk6gbL8cdRL0At5XtR8PMI6toUz0TPciMDKov7gnKM+1Oc80fU7jKqV5ioKccU4KXUwBIpXkg6FI8qYAk4EvemSWAkRIjic9wYi/uTcX+benNEFtZTZ+2SqvgYgWqcskxOD+kK45EyvD897FVYvwaPR1UoKZ7C7URg0Tqy6tUhnp0F4kAZR5xJTzyQO7dWio5qylyR9DnubMeSYulwCDzEFksdDRDNo92R5tzjWQegDpKcN/kFOd5oT1y3XQrrNZCNgyvU9hzUSQHt72cA60LWdGL6qLAMsVZu06hScltCWoF5OPittAhxPWo3rO+KSknPDaj7UeMIJLJeazxQqfbttfnBTqiTNLdJ5w7S5hJb432uTZhPJEBt2AH5UxZDrKCmDVQvo/4tDahMuQt1Jrsj01ofCjFnFxqhzskAVCbI6QV40ainPOAeo64lWyCbnGGAypWg9uR1HrTU/4M9URpgxRA8sYhFo8oiCYce5lO2QO7AL2Ckf+RxLwWAbNVO5Er3R9chi+cP/AqNtZyLbfsp4Mm65+Qb7gcAv00AVhT5VdF+yF65CZzsrOQIFqBvJQf/NHa7et98wymSg5V9hqX6WKZxKie3o/5V2ydvMMXSrlvA+RcE1J/PrtSU01FrG3XEzT7MjLzL5LmTilhOxoFtqQ04TSSfKf2yn6eizurPYKutOtSZhu1HYTlDtos4ZJXOQyVSmscAfVK6USLTjtiL5WgsH2AAn4VKZP57ZVkxiqidB7E6NSGyeZf+Uagjf2959jjzwcl8jbr8fDdYLBS9zU+x6SfZxp/xZm5bGkAU1rH1Od5ynID5gLY/OMC97mDr8wUHFUcxCHpb2t7LvM0F1LsWi9OVeZAZWfcIGGOiOGdxP+lysaXtl0EvnDDXvIuVzwcBqxF23Qw82EID1TwenBLPSgE8hPpEYvY9oRyEwHpU2++D5WjtmthZYjBv09Kb+Vp0SQM7yiXu+W9Nh3ovTQInFw2jigopwvmOo0kwLM7VHAGacgRbOJsLoFzcqgpYkbNR36OnM+oJyKdoLqMtk3FTKAK+B3Wz5Vg7Bk4rC2BbsrvOZ7Jez2jTk4m/K7QCZVaKzzFGjosvUe6H5ka7/q5LNpfNZJp5byqJOoHK41SwGLcxOnB0UPXH8gl/IlpXb3J6kLRCPthexb//0QKAHto5S7Bcp7nckz3AZmVD9qpNEN2zD5xqnnvtbgHVejbvywM+2w8yWLC7kX4VANXFbGVMUJE5vdDgIb+znD+Rc4CbA66/lD/HJqO+uWZNaF52uuXcK4z9y9J8lvOZU+kW3ATVAYtVqxCwGspOd2jaxs1RSSCgpXK2eIlOMqGOeDYxbyVewRJDfTEsAVzKzbTW2r6mHe+AZWN5HwfKcHuVf54k+erdjESRtNfC20dUhBhs3vvbyKVFbrFET+fz25pO2lvTIaq3LjVAnW3hN/s4Kk0nGzjASMWjPrIcv5CtWTre5UoTdoeuXGppM5sjwkoBqykO5DyV/fYSn8ipxKl4ZpGsK4+6lucamQvxQdCPB+sVoBULjhbVSYCKPoqTUWJUzNaIOb4peD/hWcYvtGM/6InRaNFecKpHdXPd1nj+VUyQMxFyV+MsrvCYNOe1VNbcmhPsZnE5rSxv/7spLJUp4yx5rBPAX1E50RId1mfKAuySWxvHKW9VloKDXRrgtqEywGrGHXaUBpYFbHb3+pGi9uF84MzXEoqulRoro0k/M8/JSnnt7agHOGdF+008d0ihtQNDsX6E55oK8iC6aiPk/XsJxOp52YRcS9SysIKR1lxLcHNEmiz5R5wCMKVXQD7Idr05FXhG6pUFlhSEGxrvDLjvJWms+rwAK9jKwuv2p8h1pcy8H8kJzhbaWiuaPO6C9cVQHvEtjw+cGlrmfYfHmXz+pSUI5X6WZonKZejqcOfQSlS3mYMRmIC7JRjdy8TikLNiPYgyPK1Gtv6SmC9K6UGkA1zJStH+X+DOiyYKBRnvBJyTlUF+K52YmXFtMKR8yMDWxV0tco6lj17laaTTjeiwNc8ImDID0qyZi9ijP/GeByrFfebgY5+uQBV1p2N8UCkt1IByJu4fa4CqmSTX/jW/9/tD1JYu0E+IbtMslsFaKONeDfKnLQJRWmZ2ttnhx1VwwGxpgq0Bbd/lKNA2TTIqxT1s12t7kM9ZariyTy3ukJKx91lc+1TuaRtluJMjSlugARUF1jWSQ/kZ8jnSjDr4VpHrU/OA3Tkn09AHmBjvA40SojKT3osjSloJQfmvAo2kj1UWTW63lUuV1TG0TWJN8kvIUisXshYVQvVN2yGWn2tGKd9ZSHWmg1bdEi1tDCCowziSNIWmj4amuc8qzovpcrn9w1qlQwCX1GcHdloiNiLvz1ii1gkaGf/eOHYr6kUWEFcCWGqOzkX/fE6w7VTuT378u+TDOOIpmXD0XCKR/MjbWhqBLNTbMl/jsMvwvyZGb8dnmjW7QnORhXLyWk9TeM+GFXXzIQv5VTaqk5eUIP7C4uqfzXDAHuJkpBn5FBt19EINsJxP93k8g/vshOTJbnKnAzN8zsGWcZseYFEzcalu5vwnS8rFBvbpFgBmAiz4BAfzddSpuH2G9P+u+1OdOlRzZ5Q576IN/o1ycPWEqEPEUv8SBUVJ4ip5a+UqT5JzjP41J4G5fMNd1pyTBWL9Vsj7ahmUN6wjuZYlUjF51XnsmlJZhP6gJnZNGWHsX8+pEl1oQB7lxGamMsJSR9MzfdOM1ZsW97uXAyNTpjCIU8lUSJwYH5fBs7+fyQe0kfcYk0/ei7rYvV92atz8AgW8iHUnYgMcUKdM5UxouTFGcGoKxgXYZpXRlQnSUu86tNzCDxCo3WiZagALx6pWDSK7dkLOsrUQz7FyarrH0xaQ3MR860W2ajvkNJKa/e8bEClNk1Y1EaCjLe2+5QjpQnanNkCQfq2lCSiS/MogyyQvc45rJLffx66rC4P/ZMv1/4K63VK/h93htSnG/x2Lxd/I9MUmpQGJ5AymdJa/4AOHUgrqRb9P+mdHQNL3Bh2PX/VUKx+8b0sXIHgov1JXrmmXUxhiq/9NZ3k6TeX0kf2uXN8oD9SxiLaQkNfEZFcHUR6HRo+NhNxF30J5gzqKzCebb+KFHQM+cxErzZ81SNGBx4G/lokI72IGo61tTgZ9vYVnBtywnhYdLkkRdW7haLEgIJ0BDM7OKe7Zi+mITYrZ9e8y6unluz3gnCkQMHmdfkpHAiqqVFmSRyygug3LGSo7Lt3cZWxWG0gwSFCIXdIfK341Ddts5Xo370J8rI9a9Ads0cQAeX1574jh5rHcXwZO/QIourIrRHfvRRt5ADzrlug4L4Lgb/nQvY9OAao453zWGjm9oO/vZwIqNyrTl52sZKClat8sBagWWoi1KR+ncIefWUBFMv5g3aAdWLGo/8UIARfj4D+mJT4pkdlXmmxaxgL8GwxyOCJdsY4+7L2csU/8ho4CaRNQS5yxnfC/lyjXa0lwlhgpCuNpsX7LDijt2Aa23H8jRHcV8yI/YSPIXQOmN1IJPT9N0H5u4VGHQkwQTmZ3WNGvuo1n11ycpl1xikTmhIB6WrHwo6WeeO8nlQeWk5CfapBYRysNxEgGWqF84+KRbRpHQkARCRVL+Y0YwpHSYM6tLMXjw+Sb6F+zmHMlcyWgZSLUuY5D4xb2NOZ+2HNTN9h+a0+I7C2xkXhg3tGN+dWCNP1QyJa5kyUD7faTw9YsVkkNStjOYq5HvDDdmq95HED0zICY60lcU3ZD8FRXaYDVmgoV+CJxMsda8nJilph+X8GR5Bw4DfEggmmIclHUz5FGWIzBNhckkHo9Mx/Xybj2CzMgpkuSTwTYX8t1i5y+Ucc3cTIw0WTTM+fmyDnDJncPhZxv10OsTr4+GW2T09gaHcuWg7L96zil8nmaLH0OuyUXXJW1VtsCrIEruUzUCWi/5OCKnms5pyjmVOK+gq8HnEStAf4XNIKE3P6J2oxAHj/D9qATTI6VDKzFI0wLRsuCF2KZo4HmDtQXeL26W0c/DnIHAqRTMsAADI62QEVACKB4AtDobXzNm0+klCmtdLBmq/GEhvWg5sTp0PiZMVDWsG7mKcZQDrmk/xmjZH6zAsfwJqx/Wzv+vIqUnIFoveL8XrzBeaTTsP25CvGiIW6jKRH75DQNyPVVZFJpwWAs4fexVNj8cKIrJjIfNKWC5+3YDSWd20PJlLmQs2I1xGrnhyN8mEimX/8ay5ZjqG99xB8k8RRwD1qdmQw4BJkzE+tmanN9kST3kUjQyeQ+iUC5yLBylHR8IeVTlSE26+RBnCaiY/FwNA8jqchvNzyHA95f40JUdpTWRzj0YyBne6sZYhH9V/ni3nZihEjJvuG4vSABVCrH9WBAJjw5SiwrB1Ees0WGofwfWCwteSZoHm+4/BE1yYMkEHorjiWjlkmgfs+BJpJ3sktztPzRCZx/6cy/86BHnUQOadnue+HQVC1gAecy2iEYnkbg3J4wUUwWTFkxQhytryrSuFstcNdgJZN5Kt/EkiZiN4fDUrVcoS572LIQkEbJL6bGjR+qVb/TUN9TfdmyDyoCH83C0+Kz3iGoqrbF0mW+UgfJd6S7ysFQzguaapPMfhSnwLQZy2VySkhN93wTDkMIrCBZjaih5TQUNRbIpTC0rFVZKloZ+hOCaKtawEdAFNvDrv95iwj/SVMohxPHCiWUEFihhMAK5Wci/xVgAK25UHDJFPJYAAAAAElFTkSuQmCC" />
1413
- </defs>
1414
- </svg>
1415
- </div>
1416
- <div class="md:w-4/6 mx-auto mt-4">
1417
-
1418
- <p class="text-lg font-medium text-center">
1419
- Please click the button below to
1420
- authenticate your payment
1421
- </p>
1422
- </div>
1423
- <div class="mt-8">
1424
- <button class="details-form-button" id="authenticate-btn">
1425
- <svg class="spinner hidden" id="spinner" viewBox="0 0 24 24">
1426
- <path
1427
- d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">
1428
- </path>
1429
- </svg>
1430
- <span id="authenticate-button-text">
1431
- Authenticate
1432
-
1433
- </span>
1434
- </button>
1435
- </div>
1436
- </div>
1437
-
1438
- </div>`;class Zo{constructor(e){h(this,"container");h(this,"payment");h(this,"warningError");h(this,"pageLoader");h(this,"localCurrency");h(this,"rate");h(this,"amount");h(this,"merchantKey");h(this,"rdtCode");h(this,"url");h(this,"currency");h(this,"onAction");h(this,"restartTransactionProcess");this.container=e.container,this.localCurrency=e.localCurrency,this.rate=e.rate,this.amount=e.amount,this.url=e.url,this.merchantKey=e.merchantKey,this.rdtCode=e.rdtCode,this.currency=e.currency,this.onAction=e.onAction,this.restartTransactionProcess=e.restartTransactionProcess,this.warningError=new fn({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 hl}}class ml{constructor({amount:e,container:i,email:t,token:o,currency:s,rdtCode:r,url:l,reference:c,callBackUrl:b,metadata:p,localCurrency:g,hidePaymentMethods:f,showPaymentMethods:y,restartTransactionProcess:C,retryingPayment:k}){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,"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,"merchantPlanDetail",{});h(this,"restartTransactionProcess");h(this,"retryingPayment");h(this,"isMaxRetriesReached");h(this,"isMobile",!1);h(this,"paymentResponse");h(this,"paymentResponseHeaders");this.currency=s,this.container=i,this.token=o,this.email=t,this.amount=e,this.rdtCode=r,this.url=l,this.reference=c,this.callBackUrl=b,this.metadata=p,this.localCurrency=g,this._currentStep=1,this.activeRef="",this.contents=this.container.querySelector("#payment-content-view"),this.hidePaymentMethods=f,this.showPaymentMethods=y,this.restartTransactionProcess=C,this.retryingPayment=k,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 Ie(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(){sn(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")),(()=>{if(this.retryingPayment){const o={channel:"eft",reference:this.reference};return si(this.token,o,this.rdtCode,this.url)}else{const o={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};return xt(this.token,o,this.rdtCode,this.url)}})().then(({data:o,headers:s})=>{var r,l,c;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(((r=o==null?void 0:o.authorization)==null?void 0:r.mode)==="redirect"){this.activeRef=o.reference,(l=o==null?void 0:o.authorization)!=null&&l.redirectUrl&&this.redirectToOzow((c=o==null?void 0:o.authorization)==null?void 0:c.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 vn(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"}),sn(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 Zo({container:this.contents,merchantKey:this.token,url:this.url,onAction:this.createEftPayment.bind(this),ref:this.activeRef,rdtCode:this.rdtCode,currency:this.currency,localCurrency:this.localCurrency,amount:this.amount,rate:e==null?void 0:e.rate.rate,restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.eftAuthenticate.renderComponent();break;case 2:this.successScreen=new Vn({container:this.contents,amount:this.amount,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 Ie(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 4:this.warningScreen=new fn({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 di({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 Zo({container:this.contents,merchantKey:this.token,url:this.url,onAction:this.createEftPayment.bind(this),ref:this.activeRef,rdtCode:this.rdtCode,currency:this.currency,localCurrency:this.localCurrency,amount:this.amount,rate:e==null?void 0:e.rate.rate,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 pl{constructor({container:e,email:i,phoneNumber:t,code:o,encryption:s,merchantKey:r,modalContainer:l,amount:c,planId:b,rdtCode:p,url:g,reference:f,callBackUrl:y,metadata:C,localCurrency:k,closePayment: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,"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");this.validChannels=[],this.disabledChannels=[],this.selectedChannel="",this.modalContainer=l,this.encryption=s,this.planId=b||"",this.merchantKey=r,this.email=i,this.phoneNumber=t,this.code=o,this.amount=c||0,this.rdtCode=p||"",this.url=g||"",this.reference=f,this.mainLayout=e,this.callBackUrl=y,this.metadata=C||{},this.localCurrency=k||"",this.isMobile=window.matchMedia("(max-width: 767px)").matches,this.currentPaymentMethod="",this.currency="",this.closePayment=S,this.retryingPayment=!1}mountScreen(e,i,t,o){var r,l;t&&(this.validChannels=t),o&&(this.disabledChannels=o),this.mainLayout.innerHTML=this.render(),this.merchantPlanDetail=e,this.currency=i;const s=(l=(r=this.merchantPlanDetail.plan)==null?void 0:r.pricingOptions)==null?void 0:l.find(c=>c.currency===this.currency);this.amount=(s==null?void 0:s.amount)||this.amount,this.mainHeader=new nl({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:c=>{this.closeBTN.bind(this)(c)},currentPaymentMethod:this.currentPaymentMethod}),this.mainHeader.renderComponent(),this.mainFooter=new tl({container:document.getElementById("main-footer")}),this.mainFooter.renderComponent(),this.setupPaymentMethodButtons(),this.selectedChannel&&(this.currentPaymentMethod=this.selectedChannel),this.updatePaymentMethodView(this.merchantKey,this.email,this.amount,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">
1429
+ </svg>`),e&&e.classList.add("hidden"),r&&r.setAttribute("disabled","true"),t&&(t.value="",this.momoOtp="",t.setAttribute("disabled","true")),this.onClose(!1)})}handleOtpInput(t,r){const e=t.target,i=t.data;i&&this.momoOtp.length<6?this.momoOtp+=i:t.inputType==="deleteContentBackward"&&(this.momoOtp=this.momoOtp.slice(0,-1)),e.value="*".repeat(this.momoOtp.length),this.momoOtp.length>=6&&r&&r.removeAttribute("disabled");const o=this.container.querySelector("#otp-error");this.momoOtp.length<6&&(r&&r.setAttribute("disabled","true"),o&&(o.innerHTML=""))}renderComponent(){this.container.innerHTML=this.render();const t=this.container.querySelector("#otp-message");t&&(t.innerHTML=this.otpMessage),this.attachListener()}render(){return Vg}}class $g{constructor(t){g(this,"container");g(this,"onAction");g(this,"callBackUrl");g(this,"paymentResponse");g(this,"paymentResponseHeaders");this.container=t.container,this.onAction=t.onAction,this.callBackUrl=t.callBackUrl,this.paymentResponse=t.paymentResponse,this.paymentResponseHeaders=t.paymentResponseHeaders}attachListeners(){const t=this.container.querySelector(".details-form-button");t&&t.addEventListener("click",()=>{qn(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)})}renderComponent(){this.container.innerHTML=this.render(),this.attachListeners()}render(){return Dd}}class Wg{constructor({container:t,merchantKey:r,localCurrency:e,metadata:i,callBackUrl:o,rdtCode:s,reference:a,onSuccess:u,url:c,email:d,amount:h,token:p,currency:y,disablePaymentMethods:w,hidePaymentMethods:k,showPaymentMethods:b,onClose:S,restartTransactionProcess:A,retryingPayment:x}){g(this,"contents");g(this,"mobileMoneyForm");g(this,"mobileMoneyValidationForm");g(this,"onSuccess");g(this,"mobileMoneyConfirmation");g(this,"mobileMoneyConfirmationEnd");g(this,"transactionIssuesScreen");g(this,"container");g(this,"pageLoader");g(this,"mainLoader");g(this,"_currentStep");g(this,"successScreen");g(this,"email");g(this,"activeRef");g(this,"warningScreen");g(this,"amount");g(this,"url");g(this,"reference");g(this,"metadata");g(this,"currency");g(this,"localCurrency");g(this,"token");g(this,"callBackUrl");g(this,"rdtCode");g(this,"merchantDetails");g(this,"onClose");g(this,"hidePaymentMethods");g(this,"showPaymentMethods");g(this,"disablePaymentMethods");g(this,"paymentResponse");g(this,"paymentResponseHeaders");g(this,"restartTransactionProcess");g(this,"retryingPayment");g(this,"isMaxRetriesReached");g(this,"isMobile",!1);this.container=t,this.onSuccess=u||(()=>null),this.token=p,this.currency=y,this.amount=h,this.contents=this.container.querySelector("#payment-content-view"),this._currentStep=1,this.activeRef="",this.token=r,this.email=d,this.metadata=i,this.localCurrency=e,this.callBackUrl=o,this.localCurrency=e,this.rdtCode=s,this.url=c,this.reference=a,this.merchantDetails={},this.disablePaymentMethods=w,this.hidePaymentMethods=k,this.showPaymentMethods=b,this.onClose=S,this.paymentResponse={},this.paymentResponseHeaders={},this.restartTransactionProcess=A,this.retryingPayment=x,this.isMaxRetriesReached=!1,B.track("mobile_money_opens",{payment_method:"Mobile Money"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(t){this._currentStep=t,this.renderMobileMoneyContent()}attachInputListeners(){}async createMobileMoney(t,r){t.stopPropagation(),t.preventDefault();const e=this.container.querySelector(".spinner"),i=this.container.querySelector("#mobile-money-button-text");e&&i&&(e.classList.remove("hidden"),i.classList.add("hidden")),(()=>{if(this.retryingPayment){const s={channel:"mobile_money",reference:this.reference,mobileMoney:{code:r.code,phoneNumber:r.phoneNumber}};return Di(this.token,s,this.rdtCode,this.url)}else{const s={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:r.code,phoneNumber:r.phoneNumber},...this.localCurrency&&{localCurrency:this.localCurrency},isCheckout:!0};return ph(this.token,s,this.rdtCode,this.url)}})().then(({data:s,headers:a})=>{var u;if(this.paymentResponse=s,this.paymentResponseHeaders=a,s.status==="failed"){this.currentStep=5,s.providerMessage?this.warningScreen.setPaymentError(s.providerMessage):this.warningScreen.setPaymentError("Payment failed"),B.track("start_payment",{payment_method:"Mobile Money",verification_status:"Failed"});return}else if(((u=s==null?void 0:s.authorization)==null?void 0:u.mode)==="otp"){this.activeRef=s.reference,this.currentStep=6;return}else this.currentStep=3}).catch(s=>{B.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Null"}),s.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,s.message?this.warningScreen.setPaymentError(s.message):this.warningScreen.setPaymentError("Payment failed")),this.warningScreen.hideReportIssue()}).finally(()=>{e&&i&&(e.classList.add("hidden"),i.classList.remove("hidden"))})}showLoader(){this.pageLoader=new sn(this.contents),this.pageLoader.mountLoader()}submitOtp(t,r){t.preventDefault();const e=this.container.querySelector(".spinner"),i=this.container.querySelector("#mobile-money-button-text"),o={authorization:{otp:r},reference:this.activeRef};B.track("input_MobileMoneyOTP",{payment_method:"Mobile Money",authentication_type:"0TP"}),e&&i&&(e.classList.remove("hidden"),i.classList.add("hidden")),Bi(this.token,o,this.rdtCode,this.url).then(({data:a})=>{a.status==="failed"?(this.activeRef=a.reference,this.currentStep=3):["success","successful","failed"].includes(a.status)?["success","successful"].includes(a.status)&&(this.activeRef=a.reference,this.currentStep=3):(this.activeRef=a.reference,this.currentStep=3)}).catch(a=>{B.track("verify_payment",{payment_method:"Mobile Money",verification_status:"Failed",authentication_type:"OTP"});const u=this.container.querySelector("#otp-error");a.code==="invalid_otp"?u&&(u.innerHTML=a.message):this.currentStep=3}).finally(()=>{e&&i&&(e.classList.add("hidden"),i.classList.remove("hidden"))})}async verifyPaymentProcess(){try{const t=await dt(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=t.data,this.paymentResponseHeaders=t.headers}catch{this.currentStep=5}}goBackToMerchant(){qn(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}renderMobileMoneyContent(t){var r,e;if(t&&(this.merchantDetails=t),this.currentStep===3&&this.disablePaymentMethods("mobile_money"),this.currentStep!==1){const i=document.getElementById("go-back");i&&(i.classList.remove("flex","items-center","gap-2","mb-2"),i.innerHTML="")}switch(this.currentStep===6?this.hidePaymentMethods():this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.currentStep){case 1:this.mobileMoneyForm=new jg({container:this.contents,merchantKey:this.token,url:this.url,onAction:i=>o=>this.createMobileMoney.bind(this)(i,o),ref:this.activeRef,switchScreen:i=>{this.currentStep=i},rdtCode:this.rdtCode,currency:this.currency,localCurrency:this.localCurrency,amount:this.amount,rate:t==null?void 0:t.rate.rate,restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.mobileMoneyForm.renderContent();break;case 2:this.mainLoader=new sn(this.contents),this.mainLoader.mountLoader("25dvh"),this.mainLoader.updateMessage("Please wait");break;case 3:this.mobileMoneyConfirmation=new Gg({container:this.contents,onAction:i=>{this.currentStep=i},ref:this.reference,onSuccess:this.onSuccess.bind(this),token:this.token,rdtCode:this.rdtCode,url:this.url,callBackUrl:this.callBackUrl,setPaymentResponses:(i,o)=>{this.paymentResponse=i,this.paymentResponseHeaders=o}}),this.mobileMoneyConfirmation.renderComponent();break;case 4:this.successScreen=new Qt({container:this.contents,amount:this.amount,currency:this.currency,localCurrency:this.localCurrency,rate:(r=this.merchantDetails)==null?void 0:r.rate.rate}),this.successScreen.renderComponent();break;case 5:this.warningScreen=new ht({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 zg({container:this.contents,onClose:this.onClose,onAction:i=>o=>this.submitOtp.bind(this)(i,o),otpMessage:((e=this.paymentResponse)==null?void 0:e.providerMessage)||"Please enter your OTP sent to your phone"}),this.mobileMoneyValidationForm.renderComponent();break;case 7:this.pageLoader=new sn(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 8:this.mobileMoneyConfirmationEnd=new $g({container:this.contents,onAction:i=>{this.currentStep=i},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 Gi({container:this.contents,onAction:()=>{var i;this.currentStep=5,this.warningScreen.setPaymentError(((i=this.paymentResponse)==null?void 0:i.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 qg=`<div id="eft-authenticate-container">\r
1430
+ <div class="pt-3">\r
1431
+ <div class="container-center">\r
1432
+ <svg width="98" height="32" viewBox="0 0 98 32" fill="none" xmlns="http://www.w3.org/2000/svg"\r
1433
+ xmlns:xlink="http://www.w3.org/1999/xlink">\r
1434
+ <rect width="98" height="32" fill="url(#pattern0_13486_80257)" />\r
1435
+ <defs>\r
1436
+ <pattern id="pattern0_13486_80257" patternContentUnits="objectBoundingBox" width="1" height="1">\r
1437
+ <use xlink:href="#image0_13486_80257" transform="scale(0.00666667 0.0204167)" />\r
1438
+ </pattern>\r
1439
+ <image id="image0_13486_80257" width="150" height="49" preserveAspectRatio="none"\r
1440
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAxCAYAAAA4GFC0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDkuMC1jMDAwIDc5LjE3MWMyN2ZhYiwgMjAyMi8wOC8xNi0yMjozNTo0MSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QjkwOTc5QTUwRjM0MTFFRUE5ODhCMTQxOUUyMjMyQTIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QjkwOTc5QTQwRjM0MTFFRUE5ODhCMTQxOUUyMjMyQTIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDI0LjAgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6N0ZCODQ4MjcwRjMyMTFFRTk3MjBBOTZDQkQyQzdEQzYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6N0ZCODQ4MjgwRjMyMTFFRTk3MjBBOTZDQkQyQzdEQzYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz7SP/CfAAARUklEQVR42uxdCZgUxRV+NQO7y7ILLDdKomAAEUQFAx54gbcC4okGFaMoBolG8YwmaDwTEENUjCCIJx5EQEVBUCLILWcExOUUlJuFhWVld6bzXtXr7pqa6pnZhe8Lcft939vqrq4+purv9/73qmZWOI4DoYRyqCUSdkEoIbBCCYEVSgisUEI55FLNrBBrnw1uLZjoOyKxXlYL91hd/Hsu1p2M203kAWrviE24vRjLKag7vOtI1bdR49p2KhF4PDcLGt/5OtSYtwZi9fLCEf0fyfrCRamBdRDSDrUL6qmov8ZRb8ajn3B/1MtRZ6F+ifp1OCRVxGJVwpX2RvD0k2ByRDXPerllPGH/KCxJr5R2zoG5WLyC9W/hfkk4HCHHIunFrm2MtFJxBpXu2silgevSdPcmS/wjTsFyBOoSrLw+HI6qbbHqoA6XwHKEwbmIhIk5uEEOdzXqj6jFqDWxvjEC7hjcPgnLTlhW9wAI8CssX8PyMtQ7UTeGQ1O1gNUKAfA+AqJtgrtziDuh5XLgddwpTCDejkbwhQsk0Rz3r8btmxlULkAvx/qOuHUJ6tJweKqGK2yPAz/LB5XUUtz/E+63weN/xv1CiOMlA9UD3BrUp1Hb4P5A1N2am2yKOpsDgVCqgMX6O4KormepHFiAf29DXejzKWl1oioqROsG0Bw1G7VMuTcxF9stVoEieU04gMUQ3PlYcS3ozNYtFw+Ox60zmH8F5RvSpyRCOcyB5Yhl+Lcz86IJ+Lcnlo7m9tDSALm236C28N2g8N1hHMrxL7pA+AActmJ0LOKslCCi6NCBa/l6+Vh+iNoa6/bZnwk1ilQtWk3zuaEcnsAKtgAD8NhqHD9KIAxVVsrzpA+j3ot1tZJTDKAnOzFyFD2R43/gRY8ScBEFDMe5DgEntMDgF6iUiuhhf/ooiOL9ECn5CQGW1qvnoB6LSgFEQ9TdqOtQl6MWVaCvnIPo658yaFeAehzq0ajYn7CFA6GVac7P5rK8Avdyz6NzyNMcqACFioIa6Wq8XVJZVxhDHaKAQKCQA0mZ9TckH9KBoog68a+1uFGCZQ2saYn6A+oweS61F0BknQKC4VhXBEIisjfukwvtyNfsjiUBa0LSE9WvBTXHfgW581dDWZM6Qc9NidpbGJxtLMc3SlcMQGmT2QHX6ID6T8/uVk4I2FNR7w44TjTgBg5cjrAcJ49B9GAk6gbL8cdRL0At5XtR8PMI6toUz0TPciMDKov7gnKM+1Oc80fU7jKqV5ioKccU4KXUwBIpXkg6FI8qYAk4EvemSWAkRIjic9wYi/uTcX+benNEFtZTZ+2SqvgYgWqcskxOD+kK45EyvD897FVYvwaPR1UoKZ7C7URg0Tqy6tUhnp0F4kAZR5xJTzyQO7dWio5qylyR9DnubMeSYulwCDzEFksdDRDNo92R5tzjWQegDpKcN/kFOd5oT1y3XQrrNZCNgyvU9hzUSQHt72cA60LWdGL6qLAMsVZu06hScltCWoF5OPittAhxPWo3rO+KSknPDaj7UeMIJLJeazxQqfbttfnBTqiTNLdJ5w7S5hJb432uTZhPJEBt2AH5UxZDrKCmDVQvo/4tDahMuQt1Jrsj01ofCjFnFxqhzskAVCbI6QV40ainPOAeo64lWyCbnGGAypWg9uR1HrTU/4M9URpgxRA8sYhFo8oiCYce5lO2QO7AL2Ckf+RxLwWAbNVO5Er3R9chi+cP/AqNtZyLbfsp4Mm65+Qb7gcAv00AVhT5VdF+yF65CZzsrOQIFqBvJQf/NHa7et98wymSg5V9hqX6WKZxKie3o/5V2ydvMMXSrlvA+RcE1J/PrtSU01FrG3XEzT7MjLzL5LmTilhOxoFtqQ04TSSfKf2yn6eizurPYKutOtSZhu1HYTlDtos4ZJXOQyVSmscAfVK6USLTjtiL5WgsH2AAn4VKZP57ZVkxiqidB7E6NSGyeZf+Uagjf2959jjzwcl8jbr8fDdYLBS9zU+x6SfZxp/xZm5bGkAU1rH1Od5ynID5gLY/OMC97mDr8wUHFUcxCHpb2t7LvM0F1LsWi9OVeZAZWfcIGGOiOGdxP+lysaXtl0EvnDDXvIuVzwcBqxF23Qw82EID1TwenBLPSgE8hPpEYvY9oRyEwHpU2++D5WjtmthZYjBv09Kb+Vp0SQM7yiXu+W9Nh3ovTQInFw2jigopwvmOo0kwLM7VHAGacgRbOJsLoFzcqgpYkbNR36OnM+oJyKdoLqMtk3FTKAK+B3Wz5Vg7Bk4rC2BbsrvOZ7Jez2jTk4m/K7QCZVaKzzFGjosvUe6H5ka7/q5LNpfNZJp5byqJOoHK41SwGLcxOnB0UPXH8gl/IlpXb3J6kLRCPthexb//0QKAHto5S7Bcp7nckz3AZmVD9qpNEN2zD5xqnnvtbgHVejbvywM+2w8yWLC7kX4VANXFbGVMUJE5vdDgIb+znD+Rc4CbA66/lD/HJqO+uWZNaF52uuXcK4z9y9J8lvOZU+kW3ATVAYtVqxCwGspOd2jaxs1RSSCgpXK2eIlOMqGOeDYxbyVewRJDfTEsAVzKzbTW2r6mHe+AZWN5HwfKcHuVf54k+erdjESRtNfC20dUhBhs3vvbyKVFbrFET+fz25pO2lvTIaq3LjVAnW3hN/s4Kk0nGzjASMWjPrIcv5CtWTre5UoTdoeuXGppM5sjwkoBqykO5DyV/fYSn8ipxKl4ZpGsK4+6lucamQvxQdCPB+sVoBULjhbVSYCKPoqTUWJUzNaIOb4peD/hWcYvtGM/6InRaNFecKpHdXPd1nj+VUyQMxFyV+MsrvCYNOe1VNbcmhPsZnE5rSxv/7spLJUp4yx5rBPAX1E50RId1mfKAuySWxvHKW9VloKDXRrgtqEywGrGHXaUBpYFbHb3+pGi9uF84MzXEoqulRoro0k/M8/JSnnt7agHOGdF+008d0ihtQNDsX6E55oK8iC6aiPk/XsJxOp52YRcS9SysIKR1lxLcHNEmiz5R5wCMKVXQD7Idr05FXhG6pUFlhSEGxrvDLjvJWms+rwAK9jKwuv2p8h1pcy8H8kJzhbaWiuaPO6C9cVQHvEtjw+cGlrmfYfHmXz+pSUI5X6WZonKZejqcOfQSlS3mYMRmIC7JRjdy8TikLNiPYgyPK1Gtv6SmC9K6UGkA1zJStH+X+DOiyYKBRnvBJyTlUF+K52YmXFtMKR8yMDWxV0tco6lj17laaTTjeiwNc8ImDID0qyZi9ijP/GeByrFfebgY5+uQBV1p2N8UCkt1IByJu4fa4CqmSTX/jW/9/tD1JYu0E+IbtMslsFaKONeDfKnLQJRWmZ2ttnhx1VwwGxpgq0Bbd/lKNA2TTIqxT1s12t7kM9ZariyTy3ukJKx91lc+1TuaRtluJMjSlugARUF1jWSQ/kZ8jnSjDr4VpHrU/OA3Tkn09AHmBjvA40SojKT3osjSloJQfmvAo2kj1UWTW63lUuV1TG0TWJN8kvIUisXshYVQvVN2yGWn2tGKd9ZSHWmg1bdEi1tDCCowziSNIWmj4amuc8qzovpcrn9w1qlQwCX1GcHdloiNiLvz1ii1gkaGf/eOHYr6kUWEFcCWGqOzkX/fE6w7VTuT378u+TDOOIpmXD0XCKR/MjbWhqBLNTbMl/jsMvwvyZGb8dnmjW7QnORhXLyWk9TeM+GFXXzIQv5VTaqk5eUIP7C4uqfzXDAHuJkpBn5FBt19EINsJxP93k8g/vshOTJbnKnAzN8zsGWcZseYFEzcalu5vwnS8rFBvbpFgBmAiz4BAfzddSpuH2G9P+u+1OdOlRzZ5Q576IN/o1ycPWEqEPEUv8SBUVJ4ip5a+UqT5JzjP41J4G5fMNd1pyTBWL9Vsj7ahmUN6wjuZYlUjF51XnsmlJZhP6gJnZNGWHsX8+pEl1oQB7lxGamMsJSR9MzfdOM1ZsW97uXAyNTpjCIU8lUSJwYH5fBs7+fyQe0kfcYk0/ei7rYvV92atz8AgW8iHUnYgMcUKdM5UxouTFGcGoKxgXYZpXRlQnSUu86tNzCDxCo3WiZagALx6pWDSK7dkLOsrUQz7FyarrH0xaQ3MR860W2ajvkNJKa/e8bEClNk1Y1EaCjLe2+5QjpQnanNkCQfq2lCSiS/MogyyQvc45rJLffx66rC4P/ZMv1/4K63VK/h93htSnG/x2Lxd/I9MUmpQGJ5AymdJa/4AOHUgrqRb9P+mdHQNL3Bh2PX/VUKx+8b0sXIHgov1JXrmmXUxhiq/9NZ3k6TeX0kf2uXN8oD9SxiLaQkNfEZFcHUR6HRo+NhNxF30J5gzqKzCebb+KFHQM+cxErzZ81SNGBx4G/lokI72IGo61tTgZ9vYVnBtywnhYdLkkRdW7haLEgIJ0BDM7OKe7Zi+mITYrZ9e8y6unluz3gnCkQMHmdfkpHAiqqVFmSRyygug3LGSo7Lt3cZWxWG0gwSFCIXdIfK341Ddts5Xo370J8rI9a9Ads0cQAeX1574jh5rHcXwZO/QIourIrRHfvRRt5ADzrlug4L4Lgb/nQvY9OAao453zWGjm9oO/vZwIqNyrTl52sZKClat8sBagWWoi1KR+ncIefWUBFMv5g3aAdWLGo/8UIARfj4D+mJT4pkdlXmmxaxgL8GwxyOCJdsY4+7L2csU/8ho4CaRNQS5yxnfC/lyjXa0lwlhgpCuNpsX7LDijt2Aa23H8jRHcV8yI/YSPIXQOmN1IJPT9N0H5u4VGHQkwQTmZ3WNGvuo1n11ycpl1xikTmhIB6WrHwo6WeeO8nlQeWk5CfapBYRysNxEgGWqF84+KRbRpHQkARCRVL+Y0YwpHSYM6tLMXjw+Sb6F+zmHMlcyWgZSLUuY5D4xb2NOZ+2HNTN9h+a0+I7C2xkXhg3tGN+dWCNP1QyJa5kyUD7faTw9YsVkkNStjOYq5HvDDdmq95HED0zICY60lcU3ZD8FRXaYDVmgoV+CJxMsda8nJilph+X8GR5Bw4DfEggmmIclHUz5FGWIzBNhckkHo9Mx/Xybj2CzMgpkuSTwTYX8t1i5y+Ucc3cTIw0WTTM+fmyDnDJncPhZxv10OsTr4+GW2T09gaHcuWg7L96zil8nmaLH0OuyUXXJW1VtsCrIEruUzUCWi/5OCKnms5pyjmVOK+gq8HnEStAf4XNIKE3P6J2oxAHj/D9qATTI6VDKzFI0wLRsuCF2KZo4HmDtQXeL26W0c/DnIHAqRTMsAADI62QEVACKB4AtDobXzNm0+klCmtdLBmq/GEhvWg5sTp0PiZMVDWsG7mKcZQDrmk/xmjZH6zAsfwJqx/Wzv+vIqUnIFoveL8XrzBeaTTsP25CvGiIW6jKRH75DQNyPVVZFJpwWAs4fexVNj8cKIrJjIfNKWC5+3YDSWd20PJlLmQs2I1xGrnhyN8mEimX/8ay5ZjqG99xB8k8RRwD1qdmQw4BJkzE+tmanN9kST3kUjQyeQ+iUC5yLBylHR8IeVTlSE26+RBnCaiY/FwNA8jqchvNzyHA95f40JUdpTWRzj0YyBne6sZYhH9V/ni3nZihEjJvuG4vSABVCrH9WBAJjw5SiwrB1Ees0WGofwfWCwteSZoHm+4/BE1yYMkEHorjiWjlkmgfs+BJpJ3sktztPzRCZx/6cy/86BHnUQOadnue+HQVC1gAecy2iEYnkbg3J4wUUwWTFkxQhytryrSuFstcNdgJZN5Kt/EkiZiN4fDUrVcoS572LIQkEbJL6bGjR+qVb/TUN9TfdmyDyoCH83C0+Kz3iGoqrbF0mW+UgfJd6S7ysFQzguaapPMfhSnwLQZy2VySkhN93wTDkMIrCBZjaih5TQUNRbIpTC0rFVZKloZ+hOCaKtawEdAFNvDrv95iwj/SVMohxPHCiWUEFihhMAK5Wci/xVgAK25UHDJFPJYAAAAAElFTkSuQmCC" />\r
1441
+ </defs>\r
1442
+ </svg>\r
1443
+ </div>\r
1444
+ <div class="md:w-4/6 mx-auto mt-4">\r
1445
+ \r
1446
+ <p class="text-lg font-medium text-center">\r
1447
+ Please click the button below to\r
1448
+ authenticate your payment\r
1449
+ </p>\r
1450
+ </div>\r
1451
+ <div class="mt-8">\r
1452
+ <button class="details-form-button" id="authenticate-btn">\r
1453
+ <svg class="spinner hidden" id="spinner" viewBox="0 0 24 24">\r
1454
+ <path\r
1455
+ d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z">\r
1456
+ </path>\r
1457
+ </svg>\r
1458
+ <span id="authenticate-button-text">\r
1459
+ Authenticate\r
1460
+ \r
1461
+ </span>\r
1462
+ </button>\r
1463
+ </div>\r
1464
+ </div>\r
1465
+ \r
1466
+ </div>`;class zd{constructor(t){g(this,"container");g(this,"payment");g(this,"warningError");g(this,"pageLoader");g(this,"localCurrency");g(this,"rate");g(this,"amount");g(this,"merchantKey");g(this,"rdtCode");g(this,"url");g(this,"currency");g(this,"onAction");g(this,"restartTransactionProcess");this.container=t.container,this.localCurrency=t.localCurrency,this.rate=t.rate,this.amount=t.amount,this.url=t.url,this.merchantKey=t.merchantKey,this.rdtCode=t.rdtCode,this.currency=t.currency,this.onAction=t.onAction,this.restartTransactionProcess=t.restartTransactionProcess,this.warningError=new ht({container:this.container,onAction:this.restartTransactionProcess.bind(this)})}attachListener(){const t=this.container.querySelector("#authenticate-btn");t&&t.addEventListener("click",()=>{this.onAction(),B.track("start_payment",{payment_method:"EFT"})})}renderComponent(){this.container.innerHTML=this.render(),this.attachListener()}render(){return qg}}class Zg{constructor({amount:t,container:r,email:e,token:i,currency:o,rdtCode:s,url:a,reference:u,callBackUrl:c,metadata:d,localCurrency:h,hidePaymentMethods:p,showPaymentMethods:y,restartTransactionProcess:w,retryingPayment:k}){g(this,"contents");g(this,"eftAuthenticate");g(this,"successScreen");g(this,"pageLoader");g(this,"warningScreen");g(this,"transactionIssuesScreen");g(this,"container");g(this,"email");g(this,"token");g(this,"amount");g(this,"currency");g(this,"_currentStep");g(this,"activeRef");g(this,"rdtCode");g(this,"url");g(this,"reference");g(this,"callBackUrl");g(this,"metadata");g(this,"localCurrency");g(this,"hidePaymentMethods");g(this,"showPaymentMethods");g(this,"merchantPlanDetail",{});g(this,"restartTransactionProcess");g(this,"retryingPayment");g(this,"isMaxRetriesReached");g(this,"isMobile",!1);g(this,"paymentResponse");g(this,"paymentResponseHeaders");this.currency=o,this.container=r,this.token=i,this.email=e,this.amount=t,this.rdtCode=s,this.url=a,this.reference=u,this.callBackUrl=c,this.metadata=d,this.localCurrency=h,this._currentStep=1,this.activeRef="",this.contents=this.container.querySelector("#payment-content-view"),this.hidePaymentMethods=p,this.showPaymentMethods=y,this.restartTransactionProcess=w,this.retryingPayment=k,this.isMaxRetriesReached=!1,this.paymentResponse={},this.paymentResponseHeaders={},this.renderEftContent(),B.track("eft_opens",{payment_method:"EFT"}),this.isMobile=window.matchMedia("(max-width: 767px)").matches}get currentStep(){return this._currentStep}set currentStep(t){this._currentStep=t,this.renderEftContent()}showLoader(){this.pageLoader=new sn(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment")}setPaymentError(t){const r=this.container.querySelector("#payment-warning-text");r&&(r.textContent=t)}goBackToMerchant(){qn(this.paymentResponse,this.paymentResponseHeaders,this.callBackUrl)}async createEftPayment(){const t=this.container.querySelector(".spinner"),r=this.container.querySelector("#authenticate-button-text");t&&r&&(t.classList.remove("hidden"),r.classList.add("hidden")),(()=>{if(this.retryingPayment){const i={channel:"eft",reference:this.reference};return Di(this.token,i,this.rdtCode,this.url)}else{const i={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};return Ia(this.token,i,this.rdtCode,this.url)}})().then(({data:i,headers:o})=>{var s,a,u;if(this.paymentResponse=i,this.paymentResponseHeaders=o,i.status==="failed"){this.currentStep=4,i.providerMessage?this.warningScreen.setPaymentError(i.providerMessage):this.warningScreen.setPaymentError("Payment failed"),B.track("start_payment",{payment_method:"EFT",verification_status:"Failed"});return}else if(((s=i==null?void 0:i.authorization)==null?void 0:s.mode)==="redirect"){this.activeRef=i.reference,(a=i==null?void 0:i.authorization)!=null&&a.redirectUrl&&this.redirectToOzow((u=i==null?void 0:i.authorization)==null?void 0:u.redirectUrl);return}else this.currentStep=4,i!=null&&i.providerMessage?this.warningScreen.setPaymentError(i==null?void 0:i.providerMessage):this.warningScreen.setPaymentError("Unable to get redirect URL")}).catch(i=>{i.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,i.message?this.warningScreen.setPaymentError(i.message):this.warningScreen.setPaymentError("Payment failed"))}).finally(()=>{t&&r&&(t.classList.add("hidden"),r.classList.remove("hidden"))})}redirectToOzow(t){const r=window.open(t,"_blank");if(r){B.track("auth_redirect",{payment_method:"EFT",authentication_type:"Redirect",verification_status:"In Progress"}),this.currentStep=3,this.showLoader();const e=setInterval(()=>{r.closed&&(clearInterval(e),this.verifyPaymentProcess())},2e3)}}async verifyPaymentProcess(){try{const t=await dt(this.token,this.reference,void 0,this.rdtCode,this.url);this.paymentResponse=t.data,this.paymentResponseHeaders=t.headers;const r=this.paymentResponse.status;r==="successful"?(this.currentStep=2,B.track("verify_payment",{payment_method:"EFT",verification_status:"Success"}),qn(this.paymentResponse,this.paymentResponseHeaders,"success")):r==="failed"?(this.currentStep=4,B.track("verify_payment",{payment_method:"EFT",verification_status:"Failed"}),this.paymentResponse.providerMessage?this.warningScreen.setPaymentError(this.paymentResponse.providerMessage):this.warningScreen.setPaymentError("Payment failed")):r==="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(t){var e;t&&(this.merchantPlanDetail=t);const r=document.getElementById("go-back");if(this.currentStep!==1?(this.hidePaymentMethods(),r==null||r.classList.add("hidden")):this.showPaymentMethods(),this.isMobile&&this.hidePaymentMethods(),this.contents){switch(this.currentStep){case 1:this.eftAuthenticate=new zd({container:this.contents,merchantKey:this.token,url:this.url,onAction:this.createEftPayment.bind(this),ref:this.activeRef,rdtCode:this.rdtCode,currency:this.currency,localCurrency:this.localCurrency,amount:this.amount,rate:t==null?void 0:t.rate.rate,restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.eftAuthenticate.renderComponent();break;case 2:this.successScreen=new Qt({container:this.contents,amount:this.amount,currency:this.currency,localCurrency:this.localCurrency,rate:(e=this.merchantPlanDetail)==null?void 0:e.rate.rate}),this.successScreen.renderComponent();break;case 3:this.pageLoader=new sn(this.contents),this.pageLoader.mountLoader(),this.pageLoader.updateMessage("Verifying Payment");break;case 4:this.warningScreen=new ht({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 Gi({container:this.contents,onAction:()=>{var o;this.currentStep=4,this.warningScreen.setPaymentError(((o=this.paymentResponse)==null?void 0:o.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 zd({container:this.contents,merchantKey:this.token,url:this.url,onAction:this.createEftPayment.bind(this),ref:this.activeRef,rdtCode:this.rdtCode,currency:this.currency,localCurrency:this.localCurrency,amount:this.amount,rate:t==null?void 0:t.rate.rate,restartTransactionProcess:this.restartTransactionProcess.bind(this)}),this.eftAuthenticate.renderComponent();break}const i=this.container.querySelector("#card-currency");i&&(i.textContent=`${this.localCurrency?this.localCurrency:this.currency} Card`)}}}class Jg{constructor({container:t,email:r,phoneNumber:e,code:i,encryption:o,merchantKey:s,modalContainer:a,amount:u,planId:c,rdtCode:d,url:h,reference:p,callBackUrl:y,metadata:w,localCurrency:k,closePayment:b}){g(this,"validChannels",[]);g(this,"disabledChannels",[]);g(this,"selectedChannel");g(this,"modalContainer");g(this,"currentPaymentMethod");g(this,"mainLayout");g(this,"mainHeader");g(this,"mainFooter");g(this,"merchantPlanDetail",{});g(this,"mainScreen");g(this,"currency");g(this,"card");g(this,"transfer");g(this,"ussd");g(this,"mobileMoney");g(this,"eft");g(this,"encryption");g(this,"merchantKey");g(this,"planId");g(this,"email");g(this,"phoneNumber");g(this,"code");g(this,"amount",0);g(this,"rdtCode");g(this,"url");g(this,"reference");g(this,"isMobile",!1);g(this,"callBackUrl");g(this,"metadata");g(this,"localCurrency");g(this,"closePayment");g(this,"retryingPayment");this.validChannels=[],this.disabledChannels=[],this.selectedChannel="",this.modalContainer=a,this.encryption=o,this.planId=c||"",this.merchantKey=s,this.email=r,this.phoneNumber=e,this.code=i,this.amount=u||0,this.rdtCode=d||"",this.url=h||"",this.reference=p,this.mainLayout=t,this.callBackUrl=y,this.metadata=w||{},this.localCurrency=k||"",this.isMobile=window.matchMedia("(max-width: 767px)").matches,this.currentPaymentMethod="",this.currency="",this.closePayment=b,this.retryingPayment=!1}mountScreen(t,r,e,i){var s,a;e&&(this.validChannels=e),i&&(this.disabledChannels=i),this.mainLayout.innerHTML=this.render(),this.merchantPlanDetail=t,this.currency=r;const o=(a=(s=this.merchantPlanDetail.plan)==null?void 0:s.pricingOptions)==null?void 0:a.find(u=>u.currency===this.currency);this.amount=(o==null?void 0:o.amount)||this.amount,this.mainHeader=new Dg({container:document.getElementById("main-header"),email:this.email,amount:this.amount,metadata:this.metadata,currency:this.currency,localCurrency:this.localCurrency,merchantDetail:t,onAction:this.switchTab.bind(this),isMobile:this.isMobile,onClose:u=>{this.closeBTN.bind(this)(u)},currentPaymentMethod:this.currentPaymentMethod}),this.mainHeader.renderComponent(),this.mainFooter=new Ug({container:document.getElementById("main-footer")}),this.mainFooter.renderComponent(),this.setupPaymentMethodButtons(),this.selectedChannel&&(this.currentPaymentMethod=this.selectedChannel),this.updatePaymentMethodView(this.merchantKey,this.email,this.amount,this.currency),this.renderPaymentMethodContent(),this.setCurrentPaymentMethod(this.currentPaymentMethod)}setupPaymentMethodButtons(){const t=document.querySelectorAll(".tab-button");t.forEach(e=>{e.removeAttribute("disabled"),e.classList.remove("hidden","disabled","limit-exceeded");const i=e.querySelector(".disabled-indicator");i&&e.removeChild(i)});const r=[...this.validChannels,...this.disabledChannels];t.forEach(e=>{const i=e.getAttribute("data-name");i&&!r.includes(i)&&e.classList.add("hidden")}),this.disabledChannels.forEach(e=>{const i=Array.from(t).find(o=>o.getAttribute("data-name")===e);if(i){i.setAttribute("disabled","true"),i.classList.add("disabled","limit-exceeded"),i.setAttribute("title","Transaction amount exceeds limit for this payment method");const o=document.createElement("span");o.classList.add("disabled-indicator"),o.style.fontSize="10px",o.style.color="#FF5733",o.style.display="block",i.appendChild(o)}})}attachListeners(){const t=document.getElementById("go-back"),r=document.getElementById("select-payment-method-text");this.isMobile&&(this.currentPaymentMethod?(t&&(t.classList.add("flex","items-center","gap-2","mb-2"),t.innerHTML=` <svg width="9" height="18" viewBox="0 0 9 18" fill="none" xmlns="http://www.w3.org/2000/svg">
1439
1467
  <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"/>
1440
1468
  </svg>
1441
1469
  <span class="text-tone-100 font-semibold">
1442
1470
  Go back
1443
- </span>`),r&&(r.innerHTML="Selected")):(t&&(t.classList.remove("flex","items-center","gap-2","mb-2"),t.innerHTML=""),r&&(r.innerHTML="Select your preferred")))}closeBTN(t){(()=>{this.cleanup(),t?(B.track("checkout_closes"),this.closeModal()):this.closePayment()})()}updatePaymentMethodView(t,r,e,i){switch(this.currentPaymentMethod){case"card":return this.card=new vg({container:this.modalContainer,amount:e,currency:i,token:t,email:r,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:o=>{this.closeBTN.bind(this)(o)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment});case"bank_transfer":return this.transfer=new Ag({amount:e,currency:i,closeModal:this.closeModal.bind(this),token:t,container:this.modalContainer,email:r,rdtCode:this.rdtCode,url:this.url,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,disablePaymentMethods:o=>{this.disablePaymentMethods.bind(this)(o)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),hidePaymentMethods:this.hidePaymentMethods.bind(this),retryingPayment:this.retryingPayment});case"ussd":return this.ussd=new jd({container:this.modalContainer,amount:e,currency:i,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:o=>this.switchTab.bind(o),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),disablePaymentMethods:o=>{this.disablePaymentMethods.bind(this)(o)}});case"mobile_money":return this.mobileMoney=new Wg({container:this.modalContainer,email:this.email,currency:i,rdtCode:this.rdtCode,url:this.url,token:t,amount:this.amount,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:o=>{this.disablePaymentMethods.bind(this)(o)},onClose:o=>{this.closeBTN.bind(this)(o)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment});case"eft":return this.eft=new Zg({container:this.modalContainer,amount:e,currency:i,token:t,email:r,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:o=>{this.closeBTN.bind(this)(o)},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(t){this.currentPaymentMethod=t;const r=document.querySelectorAll(".tab-button");r.forEach(i=>i.classList.remove("active"));const e=Array.from(r).find(i=>i.getAttribute("data-name")===t);e&&e.classList.add("active")}setToDefaultEmptyContainer(){this.currentPaymentMethod="",this.retryingPayment=!0,this.updatePaymentMethodView(this.merchantKey,this.email,this.amount,this.currency),this.cleanup(),this.switchTab(""),this.showPaymentMethods(),this.setupPaymentMethodButtons(),this.renderPaymentMethodContent(),B.track("retry_payment")}defaultToEmptyContainer(){const t=document.querySelector("#payment-content-view");t.innerHTML=""}switchTab(t){this.currentPaymentMethod===t&&t!==""||(this.currentPaymentMethod==="bank_transfer"&&this.currentPaymentMethod!==t&&this.setToDefaultEmptyContainer(),this.setCurrentPaymentMethod(t),this.updatePaymentMethodView(this.merchantKey,this.email,this.amount,this.currency),this.cleanup(),this.showPaymentMethods(),this.renderPaymentMethodContent(),this.attachListeners(),this.isMobile&&(document.querySelectorAll(".tab-button").forEach(e=>{const i=e.getAttribute("data-name");this.disabledChannels.includes(i)||e.removeAttribute("disabled")}),t?document.querySelectorAll(".tab-button").forEach(i=>{i.getAttribute("data-name")!==t&&i.classList.add("hidden")}):document.querySelectorAll(".tab-button").forEach(i=>{const o=i.getAttribute("data-name");[...this.validChannels,...this.disabledChannels].includes(o)&&i.classList.remove("hidden")})))}disablePaymentMethods(t){this.currentPaymentMethod=t;const r=document.querySelectorAll(".tab-button");r.forEach(i=>i.setAttribute("disabled","true"));const e=Array.from(r).find(i=>i.getAttribute("data-name")===t);e&&e.removeAttribute("disabled")}enablePaymentMethods(){const t=document.querySelectorAll(".tab-button");t.forEach(e=>{const i=e.getAttribute("data-name");i&&!this.disabledChannels.includes(i)&&e.removeAttribute("disabled")});const r=Array.from(t).find(e=>e.getAttribute("data-name")===this.currentPaymentMethod);r&&!this.disabledChannels.includes(this.currentPaymentMethod)&&r.removeAttribute("disabled")}hidePaymentMethods(){const t=document.querySelector("#payment-methods-container");t&&t.classList.add("hidden")}showPaymentMethods(){const t=document.querySelector("#payment-methods-container");t&&t.classList.remove("hidden")}cleanup(){this.transfer&&this.transfer.destroyTimer()}closeModal(t){this.modalContainer&&this.modalContainer.parentNode&&document.body.removeChild(this.modalContainer),t&&t()}setupParent(t){t&&t()}render(){return mh}}class $d{constructor(t){g(this,"container");this.container=t}renderContent(t){var e;this.container.innerHTML=this.render();const r=document.getElementById("error-action-container");t&&r&&(r.classList.remove("hidden"),(e=r.querySelector("#go-back"))==null||e.addEventListener("click",()=>{window.location.href=t}))}render(){return`
1471
+ </span>`),r&&(r.innerHTML="Selected")):(t&&(t.classList.remove("flex","items-center","gap-2","mb-2"),t.innerHTML=""),r&&(r.innerHTML="Select your preferred")))}closeBTN(t){(()=>{this.cleanup(),t?(B.track("checkout_closes"),this.closeModal()):this.closePayment()})()}updatePaymentMethodView(t,r,e,i){switch(this.currentPaymentMethod){case"card":return this.card=new vg({container:this.modalContainer,amount:e,currency:i,token:t,email:r,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:o=>{this.closeBTN.bind(this)(o)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment});case"bank_transfer":return this.transfer=new Ag({amount:e,currency:i,closeModal:this.closeModal.bind(this),token:t,container:this.modalContainer,email:r,rdtCode:this.rdtCode,url:this.url,reference:this.reference,callBackUrl:this.callBackUrl,metadata:this.metadata,localCurrency:this.localCurrency,disablePaymentMethods:o=>{this.disablePaymentMethods.bind(this)(o)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),hidePaymentMethods:this.hidePaymentMethods.bind(this),retryingPayment:this.retryingPayment});case"ussd":return this.ussd=new Vd({container:this.modalContainer,amount:e,currency:i,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:o=>this.switchTab.bind(o),hidePaymentMethods:this.hidePaymentMethods.bind(this),showPaymentMethods:this.showPaymentMethods.bind(this),disablePaymentMethods:o=>{this.disablePaymentMethods.bind(this)(o)}});case"mobile_money":return this.mobileMoney=new Wg({container:this.modalContainer,email:this.email,currency:i,rdtCode:this.rdtCode,url:this.url,token:t,amount:this.amount,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:o=>{this.disablePaymentMethods.bind(this)(o)},onClose:o=>{this.closeBTN.bind(this)(o)},restartTransactionProcess:this.setToDefaultEmptyContainer.bind(this),retryingPayment:this.retryingPayment});case"eft":return this.eft=new Zg({container:this.modalContainer,amount:e,currency:i,token:t,email:r,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:o=>{this.closeBTN.bind(this)(o)},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(t){this.currentPaymentMethod=t;const r=document.querySelectorAll(".tab-button");r.forEach(i=>i.classList.remove("active"));const e=Array.from(r).find(i=>i.getAttribute("data-name")===t);e&&e.classList.add("active")}setToDefaultEmptyContainer(){this.currentPaymentMethod="",this.retryingPayment=!0,this.updatePaymentMethodView(this.merchantKey,this.email,this.amount,this.currency),this.cleanup(),this.switchTab(""),this.showPaymentMethods(),this.setupPaymentMethodButtons(),this.renderPaymentMethodContent(),B.track("retry_payment")}defaultToEmptyContainer(){const t=document.querySelector("#payment-content-view");t.innerHTML=""}switchTab(t){this.currentPaymentMethod===t&&t!==""||(this.currentPaymentMethod==="bank_transfer"&&this.currentPaymentMethod!==t&&this.setToDefaultEmptyContainer(),this.setCurrentPaymentMethod(t),this.updatePaymentMethodView(this.merchantKey,this.email,this.amount,this.currency),this.cleanup(),this.showPaymentMethods(),this.renderPaymentMethodContent(),this.attachListeners(),this.isMobile&&(document.querySelectorAll(".tab-button").forEach(e=>{const i=e.getAttribute("data-name");this.disabledChannels.includes(i)||e.removeAttribute("disabled")}),t?document.querySelectorAll(".tab-button").forEach(i=>{i.getAttribute("data-name")!==t&&i.classList.add("hidden")}):document.querySelectorAll(".tab-button").forEach(i=>{const o=i.getAttribute("data-name");[...this.validChannels,...this.disabledChannels].includes(o)&&i.classList.remove("hidden")})))}disablePaymentMethods(t){this.currentPaymentMethod=t;const r=document.querySelectorAll(".tab-button");r.forEach(i=>i.setAttribute("disabled","true"));const e=Array.from(r).find(i=>i.getAttribute("data-name")===t);e&&e.removeAttribute("disabled")}enablePaymentMethods(){const t=document.querySelectorAll(".tab-button");t.forEach(e=>{const i=e.getAttribute("data-name");i&&!this.disabledChannels.includes(i)&&e.removeAttribute("disabled")});const r=Array.from(t).find(e=>e.getAttribute("data-name")===this.currentPaymentMethod);r&&!this.disabledChannels.includes(this.currentPaymentMethod)&&r.removeAttribute("disabled")}hidePaymentMethods(){const t=document.querySelector("#payment-methods-container");t&&t.classList.add("hidden")}showPaymentMethods(){const t=document.querySelector("#payment-methods-container");t&&t.classList.remove("hidden")}cleanup(){this.transfer&&this.transfer.destroyTimer()}closeModal(t){this.modalContainer&&this.modalContainer.parentNode&&document.body.removeChild(this.modalContainer),t&&t()}setupParent(t){t&&t()}render(){return mh}}class $d{constructor(t){g(this,"container");this.container=t}renderContent(t){var e;this.container.innerHTML=this.render();const r=document.getElementById("error-action-container");t&&r&&(r.classList.remove("hidden"),(e=r.querySelector("#go-back"))==null||e.addEventListener("click",()=>{window.location.href=t}))}render(){return`
1444
1472
  <div class="box-container">
1445
1473
 
1446
1474
  <div class="container-center h-[40vh] hidden mx-auto" id="shared-error-container">
@@ -1457,7 +1485,7 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1457
1485
 
1458
1486
  </div>
1459
1487
  </div>
1460
- `}}const Jg="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='10'%20y='11.6667'%20width='20'%20height='18.3333'%20fill='white'/%3e%3cpath%20d='M19.9955%2036.6666C15.5754%2036.6706%2011.3352%2034.9161%208.20965%2031.7898C5.08414%2028.6635%203.33001%2024.4222%203.33399%2020.0009V19.6676C3.47026%2012.9884%207.57901%207.0353%2013.7747%204.54029C19.9704%202.04528%2027.0568%203.49007%2031.7819%208.21164C36.5512%2012.9782%2037.9786%2020.1498%2035.398%2026.38C32.8174%2032.6101%2026.7375%2036.6706%2019.9955%2036.6666ZM19.9955%2022.3508L24.3109%2026.6672L26.6601%2024.3174L22.3448%2020.0009L26.6601%2015.6845L24.3109%2013.3347L19.9955%2017.6511L15.6802%2013.3347L13.3309%2015.6845L17.6463%2020.0009L13.3309%2024.3174L15.6802%2026.6672L19.9955%2022.3525V22.3508Z'%20fill='%23D62020'/%3e%3c/svg%3e";class Xg{constructor(t){g(this,"container");g(this,"currency","");g(this,"maxAmount","");this.container=t}setLimitInfo(t,r){this.currency=t,this.maxAmount=typeof r=="number"?r.toLocaleString():r}renderContent(t){var e;this.container.innerHTML=this.render();const r=document.getElementById("error-action-container");t&&r&&(r.classList.remove("hidden"),(e=r.querySelector("#go-back"))==null||e.addEventListener("click",()=>{window.location.href=t}))}render(){return`
1488
+ `}}const Yg="data:image/svg+xml,%3csvg%20width='40'%20height='40'%20viewBox='0%200%2040%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='10'%20y='11.6667'%20width='20'%20height='18.3333'%20fill='white'/%3e%3cpath%20d='M19.9955%2036.6666C15.5754%2036.6706%2011.3352%2034.9161%208.20965%2031.7898C5.08414%2028.6635%203.33001%2024.4222%203.33399%2020.0009V19.6676C3.47026%2012.9884%207.57901%207.0353%2013.7747%204.54029C19.9704%202.04528%2027.0568%203.49007%2031.7819%208.21164C36.5512%2012.9782%2037.9786%2020.1498%2035.398%2026.38C32.8174%2032.6101%2026.7375%2036.6706%2019.9955%2036.6666ZM19.9955%2022.3508L24.3109%2026.6672L26.6601%2024.3174L22.3448%2020.0009L26.6601%2015.6845L24.3109%2013.3347L19.9955%2017.6511L15.6802%2013.3347L13.3309%2015.6845L17.6463%2020.0009L13.3309%2024.3174L15.6802%2026.6672L19.9955%2022.3525V22.3508Z'%20fill='%23D62020'/%3e%3c/svg%3e";class Xg{constructor(t){g(this,"container");g(this,"currency","");g(this,"maxAmount","");this.container=t}setLimitInfo(t,r){this.currency=t,this.maxAmount=typeof r=="number"?r.toLocaleString():r}renderContent(t){var e;this.container.innerHTML=this.render();const r=document.getElementById("error-action-container");t&&r&&(r.classList.remove("hidden"),(e=r.querySelector("#go-back"))==null||e.addEventListener("click",()=>{window.location.href=t}))}render(){return`
1461
1489
  <div class="box-container">
1462
1490
 
1463
1491
  <div class="container-center h-[40vh] hidden mx-auto" id="shared-error-container">
@@ -1474,4 +1502,4 @@ or you can use record.mirror to access the mirror instance during recording.`;le
1474
1502
 
1475
1503
  </div>
1476
1504
  </div>
1477
- `}}class Qg{constructor(){g(this,"modalContainer");g(this,"mainLayout");g(this,"encryption");g(this,"mainScreen");g(this,"merchantConfigService");g(this,"mainError");g(this,"mainLoader");g(this,"merchantPlanDetail",{});g(this,"merchantKey");g(this,"planId");g(this,"email");g(this,"amount");g(this,"rdtCode");g(this,"url");g(this,"phoneNumber");g(this,"code");g(this,"reference");g(this,"currency");g(this,"callBackUrl");g(this,"metadata");g(this,"localCurrency");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.modalContainer.innerHTML=Mt,B.init("11162d9a0801daeaf786f1200cd3112b",{debug:!1}),document.body.appendChild(this.modalContainer);const r=document.getElementById("main-layout-container-screen");if(!r)throw new Error("SDK Layout not available");this.mainLayout=r}closePayment(){const t={reference:this.reference};bh(this.merchantKey,t,this.rdtCode,this.url).then(({headers:e})=>{const i=e.get("spf-redirect-url");this.callBackUrl=i||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const o=new URL(this.callBackUrl);o.searchParams.append("status","cancelled"),o.searchParams.append("reference",this.reference),window.location.href=o.toString()},1800):this.closeModal(),B.track("canel_payment",{verification_status:"Cancelled"}),B.track("checkout_closes")}).catch(e=>{Fi.showToast(e.message,"error")})}getDeviceType(){const t=navigator.userAgent;return/mobile/i.test(t)?"Mobile":/tablet/i.test(t)?"Tablet":"Desktop"}setup(t){const{email:r,encryptionKey:e,merchantKey:i,planId:o,amount:s,rdtCode:a,reference:u,currency:c,url:d,callBackUrl:h,metadata:p,localCurrency:y}=t;if(this.merchantKey=i||"",this.email=r||"",this.amount=s||0,this.encryption=e||"",this.planId=o||"",this.rdtCode=a||"",this.reference=u||Ch(),this.url=d||"",this.callBackUrl=h||"",this.metadata=p||{},!i||!r)throw this.mainError=new $d(this.mainLayout),this.mainError.renderContent(this.callBackUrl),this.showErrorIcon(),new Error("Merchant key or email is required");this.currency=c||"",this.merchantConfigService=new xg({token:this.merchantKey,rdtCode:this.rdtCode,url:this.url}),this.localCurrency=y||"",this.mainScreen=new Yg({container:this.mainLayout,modalContainer:this.modalContainer,merchantKey:i,email:r,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,closePayment:this.closePayment.bind(this)}),this.mainLoader=new sn(this.mainLayout),this.mainError=new $d(this.mainLayout),this.mainLoader.mountLoader(),this.getPlanDetails()}getAvailableChannels(){var o,s;const t=((o=this.merchantPlanDetail)==null?void 0:o.paymentMethods)??[],r=((s=this.merchantPlanDetail)==null?void 0:s.limits)??[],e=[],i=[];return t.forEach(a=>{const u=r.find(c=>c.channel===a);!u||this.amount<=u.amount?e.push(a):i.push(a)}),{validChannels:e,disabledChannels:i}}async getPlanDetails(){const t=this.currency==="USD"?this.localCurrency:this.currency;this.merchantConfigService.getMerchantConfig(this.planId,t).then(r=>{var o;this.merchantPlanDetail=r,B.register({device_type:this.getDeviceType(),session_id:this.reference,env:"Test",checkout_env:this.rdtCode?"Redirect":"SDK",merchant:this.merchantPlanDetail.merchantName}),B.track("checkout_opens");const{validChannels:e,disabledChannels:i}=this.getAvailableChannels();if(e.length===0||e[0]==="ussd"&&e.length===1){const s=new Xg(this.mainLayout);this.mainError=s;let a=0;throw(o=this.merchantPlanDetail)!=null&&o.limits&&this.merchantPlanDetail.limits.length>0&&(a=Math.max(...this.merchantPlanDetail.limits.map(u=>u.amount))),s.setLimitInfo(t,a),this.mainError.renderContent(this.callBackUrl),this.showErrorIcon(),new Error("Transaction limit reached")}r.rate?this.mainScreen.mountScreen(this.merchantPlanDetail,this.currency,e,i):(this.mainError.renderContent(this.callBackUrl),this.showErrorIcon())}).catch(r=>{throw this.mainError.renderContent(this.callBackUrl),this.showErrorIcon(),new Error(r)})}showErrorIcon(){var r;const t=this.mainLayout.querySelector("#shared-error-container");t&&(t.classList.remove("hidden"),t.parentElement.classList.add("mx-auto"),t.classList.add("flex","flex-col","items-center","gap-2"),(r=t.querySelector("img"))==null||r.setAttribute("src",Jg))}closeModal(){this.modalContainer&&this.modalContainer.parentNode&&document.body.removeChild(this.modalContainer),this.mainScreen.closeModal()}}on.CheckoutForm=Qg,Object.defineProperty(on,Symbol.toStringTag,{value:"Module"})});
1505
+ `}}class Qg{constructor(){g(this,"modalContainer");g(this,"mainLayout");g(this,"encryption");g(this,"mainScreen");g(this,"merchantConfigService");g(this,"mainError");g(this,"mainLoader");g(this,"merchantPlanDetail",{});g(this,"merchantKey");g(this,"planId");g(this,"email");g(this,"amount");g(this,"rdtCode");g(this,"url");g(this,"phoneNumber");g(this,"code");g(this,"reference");g(this,"currency");g(this,"callBackUrl");g(this,"metadata");g(this,"localCurrency");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.modalContainer.innerHTML=Mt,B.init("11162d9a0801daeaf786f1200cd3112b",{debug:!1}),document.body.appendChild(this.modalContainer);const r=document.getElementById("main-layout-container-screen");if(!r)throw new Error("SDK Layout not available");this.mainLayout=r}closePayment(){const t={reference:this.reference};bh(this.merchantKey,t,this.rdtCode,this.url).then(({headers:e})=>{const i=e.get("spf-redirect-url");this.callBackUrl=i||this.callBackUrl,this.callBackUrl?setTimeout(()=>{const o=new URL(this.callBackUrl);o.searchParams.append("status","cancelled"),o.searchParams.append("reference",this.reference),window.location.href=o.toString()},1800):this.closeModal(),B.track("canel_payment",{verification_status:"Cancelled"}),B.track("checkout_closes")}).catch(e=>{Fi.showToast(e.message,"error")})}getDeviceType(){const t=navigator.userAgent;return/mobile/i.test(t)?"Mobile":/tablet/i.test(t)?"Tablet":"Desktop"}setup(t){const{email:r,encryptionKey:e,merchantKey:i,planId:o,amount:s,rdtCode:a,reference:u,currency:c,url:d,callBackUrl:h,metadata:p,localCurrency:y}=t;if(this.merchantKey=i||"",this.email=r||"",this.amount=s||0,this.encryption=e||"",this.planId=o||"",this.rdtCode=a||"",this.reference=u||Ch(),this.url=d||"",this.callBackUrl=h||"",this.metadata=p||{},!i||!r)throw this.mainError=new $d(this.mainLayout),this.mainError.renderContent(this.callBackUrl),this.showErrorIcon(),new Error("Merchant key or email is required");this.currency=c||"",this.merchantConfigService=new xg({token:this.merchantKey,rdtCode:this.rdtCode,url:this.url}),this.localCurrency=y||"",this.mainScreen=new Jg({container:this.mainLayout,modalContainer:this.modalContainer,merchantKey:i,email:r,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,closePayment:this.closePayment.bind(this)}),this.mainLoader=new sn(this.mainLayout),this.mainError=new $d(this.mainLayout),this.mainLoader.mountLoader(),this.getPlanDetails()}getAvailableChannels(){var o,s;const t=((o=this.merchantPlanDetail)==null?void 0:o.paymentMethods)??[],r=((s=this.merchantPlanDetail)==null?void 0:s.limits)??[],e=[],i=[];return t.forEach(a=>{const u=r.find(c=>c.channel===a);!u||this.amount<=u.amount?e.push(a):i.push(a)}),{validChannels:e,disabledChannels:i}}async getPlanDetails(){const t=this.currency==="USD"?this.localCurrency:this.currency;this.merchantConfigService.getMerchantConfig(this.planId,t).then(r=>{var o;this.merchantPlanDetail=r,B.register({device_type:this.getDeviceType(),session_id:this.reference,env:"Test",checkout_env:this.rdtCode?"Redirect":"SDK",merchant:this.merchantPlanDetail.merchantName}),B.track("checkout_opens");const{validChannels:e,disabledChannels:i}=this.getAvailableChannels();if(e.length===0||e[0]==="ussd"&&e.length===1){const s=new Xg(this.mainLayout);this.mainError=s;let a=0;throw(o=this.merchantPlanDetail)!=null&&o.limits&&this.merchantPlanDetail.limits.length>0&&(a=Math.max(...this.merchantPlanDetail.limits.map(u=>u.amount))),s.setLimitInfo(t,a),this.mainError.renderContent(this.callBackUrl),this.showErrorIcon(),new Error("Transaction limit reached")}r.rate?this.mainScreen.mountScreen(this.merchantPlanDetail,this.currency,e,i):(this.mainError.renderContent(this.callBackUrl),this.showErrorIcon())}).catch(r=>{throw this.mainError.renderContent(this.callBackUrl),this.showErrorIcon(),new Error(r)})}showErrorIcon(){var r;const t=this.mainLayout.querySelector("#shared-error-container");t&&(t.classList.remove("hidden"),t.parentElement.classList.add("mx-auto"),t.classList.add("flex","flex-col","items-center","gap-2"),(r=t.querySelector("img"))==null||r.setAttribute("src",Yg))}closeModal(){this.modalContainer&&this.modalContainer.parentNode&&document.body.removeChild(this.modalContainer),this.mainScreen.closeModal()}}on.CheckoutForm=Qg,Object.defineProperty(on,Symbol.toStringTag,{value:"Module"})});