} */\n this.params = outerParams;\n\n /** @type {boolean} */\n this.isAwaitingPromise = false;\n _classPrivateFieldSet(this, _promise, this._main(currentInstance.params));\n }\n _main(userParams) {\n let mixinParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n showWarningsForParams(Object.assign({}, mixinParams, userParams));\n if (globalState.currentInstance) {\n globalState.currentInstance._destroy();\n if (isModal()) {\n unsetAriaHidden();\n }\n }\n globalState.currentInstance = currentInstance;\n const innerParams = prepareParams(userParams, mixinParams);\n setParameters(innerParams);\n Object.freeze(innerParams);\n\n // clear the previous timer\n if (globalState.timeout) {\n globalState.timeout.stop();\n delete globalState.timeout;\n }\n\n // clear the restore focus timeout\n clearTimeout(globalState.restoreFocusTimeout);\n const domCache = populateDomCache(currentInstance);\n render(currentInstance, innerParams);\n privateProps.innerParams.set(currentInstance, innerParams);\n return swalPromise(currentInstance, domCache, innerParams);\n }\n\n // `catch` cannot be the name of a module export, so we define our thenable methods here instead\n then(onFulfilled) {\n return _classPrivateFieldGet(this, _promise).then(onFulfilled);\n }\n finally(onFinally) {\n return _classPrivateFieldGet(this, _promise).finally(onFinally);\n }\n }\n\n /**\n * @param {SweetAlert} instance\n * @param {DomCache} domCache\n * @param {SweetAlertOptions} innerParams\n * @returns {Promise}\n */\n const swalPromise = (instance, domCache, innerParams) => {\n return new Promise((resolve, reject) => {\n // functions to handle all closings/dismissals\n /**\n * @param {DismissReason} dismiss\n */\n const dismissWith = dismiss => {\n instance.close({\n isDismissed: true,\n dismiss\n });\n };\n privateMethods.swalPromiseResolve.set(instance, resolve);\n privateMethods.swalPromiseReject.set(instance, reject);\n domCache.confirmButton.onclick = () => {\n handleConfirmButtonClick(instance);\n };\n domCache.denyButton.onclick = () => {\n handleDenyButtonClick(instance);\n };\n domCache.cancelButton.onclick = () => {\n handleCancelButtonClick(instance, dismissWith);\n };\n domCache.closeButton.onclick = () => {\n dismissWith(DismissReason.close);\n };\n handlePopupClick(instance, domCache, dismissWith);\n addKeydownHandler(instance, globalState, innerParams, dismissWith);\n handleInputOptionsAndValue(instance, innerParams);\n openPopup(innerParams);\n setupTimer(globalState, innerParams, dismissWith);\n initFocus(domCache, innerParams);\n\n // Scroll container to top on open (#1247, #1946)\n setTimeout(() => {\n domCache.container.scrollTop = 0;\n });\n });\n };\n\n /**\n * @param {SweetAlertOptions} userParams\n * @param {SweetAlertOptions} mixinParams\n * @returns {SweetAlertOptions}\n */\n const prepareParams = (userParams, mixinParams) => {\n const templateParams = getTemplateParams(userParams);\n const params = Object.assign({}, defaultParams, mixinParams, templateParams, userParams); // precedence is described in #2131\n params.showClass = Object.assign({}, defaultParams.showClass, params.showClass);\n params.hideClass = Object.assign({}, defaultParams.hideClass, params.hideClass);\n return params;\n };\n\n /**\n * @param {SweetAlert} instance\n * @returns {DomCache}\n */\n const populateDomCache = instance => {\n const domCache = {\n popup: getPopup(),\n container: getContainer(),\n actions: getActions(),\n confirmButton: getConfirmButton(),\n denyButton: getDenyButton(),\n cancelButton: getCancelButton(),\n loader: getLoader(),\n closeButton: getCloseButton(),\n validationMessage: getValidationMessage(),\n progressSteps: getProgressSteps()\n };\n privateProps.domCache.set(instance, domCache);\n return domCache;\n };\n\n /**\n * @param {GlobalState} globalState\n * @param {SweetAlertOptions} innerParams\n * @param {Function} dismissWith\n */\n const setupTimer = (globalState, innerParams, dismissWith) => {\n const timerProgressBar = getTimerProgressBar();\n hide(timerProgressBar);\n if (innerParams.timer) {\n globalState.timeout = new Timer(() => {\n dismissWith('timer');\n delete globalState.timeout;\n }, innerParams.timer);\n if (innerParams.timerProgressBar) {\n show(timerProgressBar);\n applyCustomClass(timerProgressBar, innerParams, 'timerProgressBar');\n setTimeout(() => {\n if (globalState.timeout && globalState.timeout.running) {\n // timer can be already stopped or unset at this point\n animateTimerProgressBar(innerParams.timer);\n }\n });\n }\n }\n };\n\n /**\n * @param {DomCache} domCache\n * @param {SweetAlertOptions} innerParams\n */\n const initFocus = (domCache, innerParams) => {\n if (innerParams.toast) {\n return;\n }\n if (!callIfFunction(innerParams.allowEnterKey)) {\n blurActiveElement();\n return;\n }\n if (!focusButton(domCache, innerParams)) {\n setFocus(-1, 1);\n }\n };\n\n /**\n * @param {DomCache} domCache\n * @param {SweetAlertOptions} innerParams\n * @returns {boolean}\n */\n const focusButton = (domCache, innerParams) => {\n if (innerParams.focusDeny && isVisible$1(domCache.denyButton)) {\n domCache.denyButton.focus();\n return true;\n }\n if (innerParams.focusCancel && isVisible$1(domCache.cancelButton)) {\n domCache.cancelButton.focus();\n return true;\n }\n if (innerParams.focusConfirm && isVisible$1(domCache.confirmButton)) {\n domCache.confirmButton.focus();\n return true;\n }\n return false;\n };\n const blurActiveElement = () => {\n if (document.activeElement instanceof HTMLElement && typeof document.activeElement.blur === 'function') {\n document.activeElement.blur();\n }\n };\n\n // Dear russian users visiting russian sites. Let's have fun.\n if (typeof window !== 'undefined' && /^ru\\b/.test(navigator.language) && location.host.match(/\\.(ru|su|by|xn--p1ai)$/)) {\n const now = new Date();\n const initiationDate = localStorage.getItem('swal-initiation');\n if (!initiationDate) {\n localStorage.setItem('swal-initiation', \"\".concat(now));\n } else if ((now.getTime() - Date.parse(initiationDate)) / (1000 * 60 * 60 * 24) > 3) {\n setTimeout(() => {\n document.body.style.pointerEvents = 'none';\n const ukrainianAnthem = document.createElement('audio');\n ukrainianAnthem.src = 'https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3';\n ukrainianAnthem.loop = true;\n document.body.appendChild(ukrainianAnthem);\n setTimeout(() => {\n ukrainianAnthem.play().catch(() => {\n // ignore\n });\n }, 2500);\n }, 500);\n }\n }\n\n // Assign instance methods from src/instanceMethods/*.js to prototype\n SweetAlert.prototype.disableButtons = disableButtons;\n SweetAlert.prototype.enableButtons = enableButtons;\n SweetAlert.prototype.getInput = getInput;\n SweetAlert.prototype.disableInput = disableInput;\n SweetAlert.prototype.enableInput = enableInput;\n SweetAlert.prototype.hideLoading = hideLoading;\n SweetAlert.prototype.disableLoading = hideLoading;\n SweetAlert.prototype.showValidationMessage = showValidationMessage;\n SweetAlert.prototype.resetValidationMessage = resetValidationMessage;\n SweetAlert.prototype.close = close;\n SweetAlert.prototype.closePopup = close;\n SweetAlert.prototype.closeModal = close;\n SweetAlert.prototype.closeToast = close;\n SweetAlert.prototype.rejectPromise = rejectPromise;\n SweetAlert.prototype.update = update;\n SweetAlert.prototype._destroy = _destroy;\n\n // Assign static methods from src/staticMethods/*.js to constructor\n Object.assign(SweetAlert, staticMethods);\n\n // Proxy to instance methods to constructor, for now, for backwards compatibility\n Object.keys(instanceMethods).forEach(key => {\n /**\n * @param {...any} args\n * @returns {any | undefined}\n */\n SweetAlert[key] = function () {\n if (currentInstance && currentInstance[key]) {\n return currentInstance[key](...arguments);\n }\n return null;\n };\n });\n SweetAlert.DismissReason = DismissReason;\n SweetAlert.version = '11.7.27';\n\n const Swal = SweetAlert;\n // @ts-ignore\n Swal.default = Swal;\n\n return Swal;\n\n}));\nif (typeof this !== 'undefined' && this.Sweetalert2){this.swal = this.sweetAlert = this.Swal = this.SweetAlert = this.Sweetalert2}\n\"undefined\"!=typeof document&&function(e,t){var n=e.createElement(\"style\");if(e.getElementsByTagName(\"head\")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,\".swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:\\\"top-start top top-end\\\" \\\"center-start center center-end\\\" \\\"bottom-start bottom-center bottom-end\\\";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:\\\"!\\\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}\");","/*!\n * Toastify js 1.12.0\n * https://github.com/apvarun/toastify-js\n * @license MIT licensed\n *\n * Copyright (C) 2018 Varun A P\n */\n(function(root, factory) {\n if (typeof module === \"object\" && module.exports) {\n module.exports = factory();\n } else {\n root.Toastify = factory();\n }\n})(this, function(global) {\n // Object initialization\n var Toastify = function(options) {\n // Returning a new init object\n return new Toastify.lib.init(options);\n },\n // Library version\n version = \"1.12.0\";\n\n // Set the default global options\n Toastify.defaults = {\n oldestFirst: true,\n text: \"Toastify is awesome!\",\n node: undefined,\n duration: 3000,\n selector: undefined,\n callback: function () {\n },\n destination: undefined,\n newWindow: false,\n close: false,\n gravity: \"toastify-top\",\n positionLeft: false,\n position: '',\n backgroundColor: '',\n avatar: \"\",\n className: \"\",\n stopOnFocus: true,\n onClick: function () {\n },\n offset: {x: 0, y: 0},\n escapeMarkup: true,\n ariaLive: 'polite',\n style: {background: ''}\n };\n\n // Defining the prototype of the object\n Toastify.lib = Toastify.prototype = {\n toastify: version,\n\n constructor: Toastify,\n\n // Initializing the object with required parameters\n init: function(options) {\n // Verifying and validating the input object\n if (!options) {\n options = {};\n }\n\n // Creating the options object\n this.options = {};\n\n this.toastElement = null;\n\n // Validating the options\n this.options.text = options.text || Toastify.defaults.text; // Display message\n this.options.node = options.node || Toastify.defaults.node; // Display content as node\n this.options.duration = options.duration === 0 ? 0 : options.duration || Toastify.defaults.duration; // Display duration\n this.options.selector = options.selector || Toastify.defaults.selector; // Parent selector\n this.options.callback = options.callback || Toastify.defaults.callback; // Callback after display\n this.options.destination = options.destination || Toastify.defaults.destination; // On-click destination\n this.options.newWindow = options.newWindow || Toastify.defaults.newWindow; // Open destination in new window\n this.options.close = options.close || Toastify.defaults.close; // Show toast close icon\n this.options.gravity = options.gravity === \"bottom\" ? \"toastify-bottom\" : Toastify.defaults.gravity; // toast position - top or bottom\n this.options.positionLeft = options.positionLeft || Toastify.defaults.positionLeft; // toast position - left or right\n this.options.position = options.position || Toastify.defaults.position; // toast position - left or right\n this.options.backgroundColor = options.backgroundColor || Toastify.defaults.backgroundColor; // toast background color\n this.options.avatar = options.avatar || Toastify.defaults.avatar; // img element src - url or a path\n this.options.className = options.className || Toastify.defaults.className; // additional class names for the toast\n this.options.stopOnFocus = options.stopOnFocus === undefined ? Toastify.defaults.stopOnFocus : options.stopOnFocus; // stop timeout on focus\n this.options.onClick = options.onClick || Toastify.defaults.onClick; // Callback after click\n this.options.offset = options.offset || Toastify.defaults.offset; // toast offset\n this.options.escapeMarkup = options.escapeMarkup !== undefined ? options.escapeMarkup : Toastify.defaults.escapeMarkup;\n this.options.ariaLive = options.ariaLive || Toastify.defaults.ariaLive;\n this.options.style = options.style || Toastify.defaults.style;\n if(options.backgroundColor) {\n this.options.style.background = options.backgroundColor;\n }\n\n // Returning the current object for chaining functions\n return this;\n },\n\n // Building the DOM element\n buildToast: function() {\n // Validating if the options are defined\n if (!this.options) {\n throw \"Toastify is not initialized\";\n }\n\n // Creating the DOM object\n var divElement = document.createElement(\"div\");\n divElement.className = \"toastify on \" + this.options.className;\n\n // Positioning toast to left or right or center\n if (!!this.options.position) {\n divElement.className += \" toastify-\" + this.options.position;\n } else {\n // To be depreciated in further versions\n if (this.options.positionLeft === true) {\n divElement.className += \" toastify-left\";\n console.warn('Property `positionLeft` will be depreciated in further versions. Please use `position` instead.')\n } else {\n // Default position\n divElement.className += \" toastify-right\";\n }\n }\n\n // Assigning gravity of element\n divElement.className += \" \" + this.options.gravity;\n\n if (this.options.backgroundColor) {\n // This is being deprecated in favor of using the style HTML DOM property\n console.warn('DEPRECATION NOTICE: \"backgroundColor\" is being deprecated. Please use the \"style.background\" property.');\n }\n\n // Loop through our style object and apply styles to divElement\n for (var property in this.options.style) {\n divElement.style[property] = this.options.style[property];\n }\n\n // Announce the toast to screen readers\n if (this.options.ariaLive) {\n divElement.setAttribute('aria-live', this.options.ariaLive)\n }\n\n // Adding the toast message/node\n if (this.options.node && this.options.node.nodeType === Node.ELEMENT_NODE) {\n // If we have a valid node, we insert it\n divElement.appendChild(this.options.node)\n } else {\n if (this.options.escapeMarkup) {\n divElement.innerText = this.options.text;\n } else {\n divElement.innerHTML = this.options.text;\n }\n\n if (this.options.avatar !== \"\") {\n var avatarElement = document.createElement(\"img\");\n avatarElement.src = this.options.avatar;\n\n avatarElement.className = \"toastify-avatar\";\n\n if (this.options.position == \"left\" || this.options.positionLeft === true) {\n // Adding close icon on the left of content\n divElement.appendChild(avatarElement);\n } else {\n // Adding close icon on the right of content\n divElement.insertAdjacentElement(\"afterbegin\", avatarElement);\n }\n }\n }\n\n // Adding a close icon to the toast\n if (this.options.close === true) {\n // Create a span for close element\n var closeElement = document.createElement(\"button\");\n closeElement.type = \"button\";\n closeElement.setAttribute(\"aria-label\", \"Close\");\n closeElement.className = \"toast-close\";\n closeElement.innerHTML = \"✖\";\n\n // Triggering the removal of toast from DOM on close click\n closeElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n this.removeElement(this.toastElement);\n window.clearTimeout(this.toastElement.timeOutValue);\n }.bind(this)\n );\n\n //Calculating screen width\n var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n // Adding the close icon to the toast element\n // Display on the right if screen width is less than or equal to 360px\n if ((this.options.position == \"left\" || this.options.positionLeft === true) && width > 360) {\n // Adding close icon on the left of content\n divElement.insertAdjacentElement(\"afterbegin\", closeElement);\n } else {\n // Adding close icon on the right of content\n divElement.appendChild(closeElement);\n }\n }\n\n // Clear timeout while toast is focused\n if (this.options.stopOnFocus && this.options.duration > 0) {\n var self = this;\n // stop countdown\n divElement.addEventListener(\n \"mouseover\",\n function(event) {\n window.clearTimeout(divElement.timeOutValue);\n }\n )\n // add back the timeout\n divElement.addEventListener(\n \"mouseleave\",\n function() {\n divElement.timeOutValue = window.setTimeout(\n function() {\n // Remove the toast from DOM\n self.removeElement(divElement);\n },\n self.options.duration\n )\n }\n )\n }\n\n // Adding an on-click destination path\n if (typeof this.options.destination !== \"undefined\") {\n divElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n if (this.options.newWindow === true) {\n window.open(this.options.destination, \"_blank\");\n } else {\n window.location = this.options.destination;\n }\n }.bind(this)\n );\n }\n\n if (typeof this.options.onClick === \"function\" && typeof this.options.destination === \"undefined\") {\n divElement.addEventListener(\n \"click\",\n function(event) {\n event.stopPropagation();\n this.options.onClick();\n }.bind(this)\n );\n }\n\n // Adding offset\n if(typeof this.options.offset === \"object\") {\n\n var x = getAxisOffsetAValue(\"x\", this.options);\n var y = getAxisOffsetAValue(\"y\", this.options);\n\n var xOffset = this.options.position == \"left\" ? x : \"-\" + x;\n var yOffset = this.options.gravity == \"toastify-top\" ? y : \"-\" + y;\n\n divElement.style.transform = \"translate(\" + xOffset + \",\" + yOffset + \")\";\n\n }\n\n // Returning the generated element\n return divElement;\n },\n\n // Displaying the toast\n showToast: function() {\n // Creating the DOM object for the toast\n this.toastElement = this.buildToast();\n\n // Getting the root element to with the toast needs to be added\n var rootElement;\n if (typeof this.options.selector === \"string\") {\n rootElement = document.getElementById(this.options.selector);\n } else if (this.options.selector instanceof HTMLElement || (typeof ShadowRoot !== 'undefined' && this.options.selector instanceof ShadowRoot)) {\n rootElement = this.options.selector;\n } else {\n rootElement = document.body;\n }\n\n // Validating if root element is present in DOM\n if (!rootElement) {\n throw \"Root element is not defined\";\n }\n\n // Adding the DOM element\n var elementToInsert = Toastify.defaults.oldestFirst ? rootElement.firstChild : rootElement.lastChild;\n rootElement.insertBefore(this.toastElement, elementToInsert);\n\n // Repositioning the toasts in case multiple toasts are present\n Toastify.reposition();\n\n if (this.options.duration > 0) {\n this.toastElement.timeOutValue = window.setTimeout(\n function() {\n // Remove the toast from DOM\n this.removeElement(this.toastElement);\n }.bind(this),\n this.options.duration\n ); // Binding `this` for function invocation\n }\n\n // Supporting function chaining\n return this;\n },\n\n hideToast: function() {\n if (this.toastElement.timeOutValue) {\n clearTimeout(this.toastElement.timeOutValue);\n }\n this.removeElement(this.toastElement);\n },\n\n // Removing the element from the DOM\n removeElement: function(toastElement) {\n // Hiding the element\n // toastElement.classList.remove(\"on\");\n toastElement.className = toastElement.className.replace(\" on\", \"\");\n\n // Removing the element from DOM after transition end\n window.setTimeout(\n function() {\n // remove options node if any\n if (this.options.node && this.options.node.parentNode) {\n this.options.node.parentNode.removeChild(this.options.node);\n }\n\n // Remove the element from the DOM, only when the parent node was not removed before.\n if (toastElement.parentNode) {\n toastElement.parentNode.removeChild(toastElement);\n }\n\n // Calling the callback function\n this.options.callback.call(toastElement);\n\n // Repositioning the toasts again\n Toastify.reposition();\n }.bind(this),\n 400\n ); // Binding `this` for function invocation\n },\n };\n\n // Positioning the toasts on the DOM\n Toastify.reposition = function() {\n\n // Top margins with gravity\n var topLeftOffsetSize = {\n top: 15,\n bottom: 15,\n };\n var topRightOffsetSize = {\n top: 15,\n bottom: 15,\n };\n var offsetSize = {\n top: 15,\n bottom: 15,\n };\n\n // Get all toast messages on the DOM\n var allToasts = document.getElementsByClassName(\"toastify\");\n\n var classUsed;\n\n // Modifying the position of each toast element\n for (var i = 0; i < allToasts.length; i++) {\n // Getting the applied gravity\n if (containsClass(allToasts[i], \"toastify-top\") === true) {\n classUsed = \"toastify-top\";\n } else {\n classUsed = \"toastify-bottom\";\n }\n\n var height = allToasts[i].offsetHeight;\n classUsed = classUsed.substr(9, classUsed.length-1)\n // Spacing between toasts\n var offset = 15;\n\n var width = window.innerWidth > 0 ? window.innerWidth : screen.width;\n\n // Show toast in center if screen with less than or equal to 360px\n if (width <= 360) {\n // Setting the position\n allToasts[i].style[classUsed] = offsetSize[classUsed] + \"px\";\n\n offsetSize[classUsed] += height + offset;\n } else {\n if (containsClass(allToasts[i], \"toastify-left\") === true) {\n // Setting the position\n allToasts[i].style[classUsed] = topLeftOffsetSize[classUsed] + \"px\";\n\n topLeftOffsetSize[classUsed] += height + offset;\n } else {\n // Setting the position\n allToasts[i].style[classUsed] = topRightOffsetSize[classUsed] + \"px\";\n\n topRightOffsetSize[classUsed] += height + offset;\n }\n }\n }\n\n // Supporting function chaining\n return this;\n };\n\n // Helper function to get offset.\n function getAxisOffsetAValue(axis, options) {\n\n if(options.offset[axis]) {\n if(isNaN(options.offset[axis])) {\n return options.offset[axis];\n }\n else {\n return options.offset[axis] + 'px';\n }\n }\n\n return '0px';\n\n }\n\n function containsClass(elem, yourClass) {\n if (!elem || typeof yourClass !== \"string\") {\n return false;\n } else if (\n elem.className &&\n elem.className\n .trim()\n .split(/\\s+/gi)\n .indexOf(yourClass) > -1\n ) {\n return true;\n } else {\n return false;\n }\n }\n\n // Setting up the prototype for the init object\n Toastify.lib.init.prototype = Toastify.lib;\n\n // Returning the Toastify function to be assigned to the window object/module\n return Toastify;\n});\n","/**\n * Server Communication & Requets Protocol.\n */\n\nclass Post {\n constructor(thisClass) {\n this.setup_hooks(thisClass);\n }\n setup_hooks(thisClass) {\n this.eventElements = [];\n }\n /**\n * @param {FormData} data arguments that should be transsferred to server.\n * @param {MasterClass} thisClass to handle root scripts\n * @returns json || Error\n */\n sendToServer(data, thisClass, args = {}) {\n const PostClass = this;const $ = jQuery;\n args = Object.assign({}, {\n data: data,\n cache: false,\n type: \"POST\",\n dataType: 'json',\n contentType: false,\n processData: false,\n url: thisClass.ajaxUrl,\n }, {...args});\n // PostClass.eventElements = [];\n return new Promise((resolve, reject) => {\n // console.log('Before');\n if (args.eventStream && !!window.EventSource) {\n var source = new EventSource(args.url);\n\n source.addEventListener('message', (event) => {\n // console.log(event, event.data);\n PostClass.do('event-message', event);\n if (event.data) {\n try {\n event.json = JSON.parse(event.data.trim());\n if (event.json?.hook && event.json.hook.includes('close_event')) {\n PostClass.do('event-finish', event);\n source.close();resolve(event.json);\n }\n if (event.json?.progress) {\n event.percentComplete = event.json.progress;\n PostClass.do('event-progress', event);\n }\n } catch (error) {\n console.error(error);\n }\n }\n }, false);\n \n source.addEventListener('open', event => PostClass.do('event-open', event), false);\n source.addEventListener('join', event => PostClass.do('event-join', event));\n source.addEventListener('leave', event => PostClass.do('event-leave', event));\n source.addEventListener(\"notice\", event => PostClass.do('event-notice', event));\n source.addEventListener(\"update\", event => PostClass.do('event-update', event));\n\n source.addEventListener('error', (event) => {\n PostClass.do('event-error', event);\n if (event.readyState == EventSource.CLOSED) {\n // console.log('Connection was closed.', event);\n source.close();reject(event);\n } else if (event.readyState == EventSource.CONNECTING) {\n // console.log('Reconnecting...', event);\n } else {\n }\n }, false);\n } else {\n // Result to xhr polling :(\n // https://api.jquery.com/jQuery.ajax/\n $.ajax({\n xhr: function() {\n // console.log('xhr');\n var xhr = $.ajaxSettings.xhr();\n // Upload progress\n xhr.upload.onprogress = (event) => {\n // console.log('upload.onprogress', event);\n if (event.lengthComputable) {event.percentComplete = (event.loaded / event.total) * 100;}\n PostClass.do('upload-progress', event);\n };\n // Download progress\n xhr.onprogress = (event) => {\n // console.log('onprogress', event);\n if (event.lengthComputable) {event.percentComplete = (event.loaded / event.total) * 100;}\n PostClass.do('progress', event);\n };\n return xhr;\n },\n success: (json, status, jqXHR) => {\n // console.log('Success', json);\n thisClass.lastJson = json?.data??json;\n // Handle success logic (toasts, hooks, etc.)\n const message = PostClass.extractMessage(json, thisClass);\n if (message) {\n thisClass.toastify({\n text: message,\n duration: 3000,\n className: \"info\",\n stopOnFocus: true,\n style: {\n background: json.success\n ? 'linear-gradient(to right, rgb(255 197 47), rgb(251 229 174))'\n : 'linear-gradient(to right, rgb(222 66 75), rgb(249 144 150))',\n },\n }).showToast();\n }\n if (json.data?.hooks) {\n json.data.hooks.forEach((hook) => {\n if (hook == 'event_registered') {\n PostClass.sendToServer(data, thisClass, {\n eventStream: true,\n url: `${thisClass.config?.site_url??location.origin}wp-json/sospopsproject/event/stream/run`\n });\n } else {\n document.body.dispatchEvent(new Event(hook));\n }\n \n });\n }\n PostClass.do('success', {json: json, status: status, jqXHR: jqXHR});\n resolve(json.data); // Resolve with the parsed data\n },\n error: (jqXHR, status, err) => {\n console.error('Error', err);\n const errorText = PostClass.formatErrorText(err, thisClass); // Refactored for clarity\n PostClass.do('error', err);\n thisClass.toastify({\n text: errorText, className: \"info\",\n style: {background: \"linear-gradient(to right, rgb(222 66 75), rgb(249 144 150))\"},\n }).showToast();\n reject(err); // Reject with the error\n },\n beforeSend: (xhr) => {\n // Effective for event-stream.\n // xhr.setRequestHeader(\"Range\", \"bytes=\" + lastPosition + \"-\");\n // console.log('before send');\n // Show the progress bar.\n PostClass.do('beforesend', {});\n },\n complete: () => {\n // console.log('complete');\n // Hide the progress bar.\n PostClass.do('complete', {});\n },\n xhrFields: {\n // Getting on progress streaming response\n onprogress: (event) => {\n // console.log('onprogress', event);\n if (event.lengthComputable) {event.percentComplete = (event.loaded / event.total) * 100;}\n PostClass.do('progress', event);\n }\n },\n ...args\n }).done(data => {\n PostClass.do('done', data);\n PostClass.do('success', data);\n resolve(data);\n }).fail(error => {\n PostClass.do('fail', error);\n PostClass.do('error', error);\n reject(error);\n }).always((data = {}) => {\n PostClass.do('done', data);\n PostClass.do('success', data);\n });\n }\n \n });\n }\n extractMessage(json, thisClass) {\n return ((json?.data??false)&&typeof json.data==='string')?json.data:(\n (typeof json.data?.message==='string')?json.data.message:false\n );\n }\n formatErrorText(err, thisClass) {\n if (err.responseText && err.responseText !== '') {\n return err.responseText; // Prioritize response text if available\n }\n return thisClass.i18n?.somethingwentwrong??'Something went wrong!'; // Default fallback message\n }\n on(hooks, element, callback) {\n if (element === false) {\n element = document.createElement('div');\n }\n if (typeof element === \"string\") {\n element = document.querySelector(element);\n }\n if (!element) {\n console.warn(`Element not found for hook \"${hook}\"`);\n return;\n }\n if (typeof hooks !== 'object') {\n hooks = [hooks];\n }\n hooks.forEach(hook => {\n this.eventElements.push({hook: hook, element: element, callback: callback});\n element.addEventListener(hook, callback);\n });\n \n }\n off(hook, element, callback) {\n const index = this.eventElements.findIndex(\n (row) => row.hook === hook && row.element === element\n );\n if (index !== -1) {\n this.eventElements.splice(index, 1); // Remove the matching row\n } else {\n console.warn('No hook found with hook \"' + hook + '\" and element', element);\n }\n }\n do(hook, event = {}) {\n // if (!(event instanceof Object)) {event = {...event};}\n this.eventElements.filter(row => row.hook == hook).forEach(row => row.element.dispatchEvent(new CustomEvent(hook, {\n detail: {\n event: event,\n },\n })));\n }\n event(event) {\n return (event?.detail && event.detail?.event)?event.detail.event:event;\n }\n\n example() {\n // PostClass.sendToServer(formdata, thisClass)\n // .then((response) => {console.log(\"Success:\", response);})\n // .catch((err) => {console.error(\"Error:\", err);});\n }\n \n}\nexport default Post;","/**\n * Autocomplete classes for SoS project.\n */\n\n export class AutoCom {\n constructor(thisClass) {\n this.setup_hooks(thisClass);\n }\n setup_hooks(thisClass) {\n this.sos_hero__searchable(thisClass);\n }\n sos_hero__searchable(thisClass) {\n const AutoComClass = this;\n var formdata = new FormData();\n formdata.append('action', 'sospopsproject/ajax/suggested/categories');\n formdata.append('category_id', AutoComClass.lastCategoryID);\n formdata.append('_nonce', thisClass.ajaxNonce);\n thisClass.sendToServer(formdata);\n document.body.addEventListener('suggested_categories_success', (event) => {\n AutoComClass.storedList = thisClass.lastJson?.terms??[];\n document.querySelectorAll('.sos_hero__searchable__select:not([data-select-handled])').forEach((select) => {\n select.dataset.selectHandled = true;\n AutoComClass.autocomplete = new thisClass.SlimSelect({\n select: select,\n settings: {\n // alwaysOpen: false,\n showSearch: true,\n openPosition: 'auto',\n searchHighlight: true,\n placeholderText: thisClass.i18n?.whtsnurtdlist??'What’s on your to-do list?',\n searchText: thisClass.i18n?.srctext??'Sorry nothing to see here',\n searchPlaceholder: thisClass.i18n?.srcurtdlist??'Search your to-do list.'\n },\n events: {\n beforeChange: (newVal, oldVal) => {\n if(newVal[0] && newVal[0]?.value) {\n document.querySelectorAll('.sos_hero__wrap').forEach((el) => el.action = newVal[0]?.value??'');\n }\n },\n search: async (search, callback) => await AutoComClass.fetchSearchable(search, callback, thisClass),\n // search: function (search, callback) {\n // formdata.append('search', search);\n // thisClass.Post.sendToServer(formdata, thisClass).then((response) => {\n // console.log(response);\n // callback(response.terms);\n // }).catch(err => {\n // console.error(\"Error:\", err);\n // callback(thisClass.lastJson?.terms??[]);\n // });\n // },\n },\n data: AutoComClass.get_stored_list(),\n });\n });\n });\n \n }\n async fetchSearchable(search, callback, thisClass) {\n const AutoComClass = this;\n if (search.length < 3) {\n const msg = 'Need 3 characters';\n if (typeof callback === 'function') {callback(msg);}\n return AutoComClass.get_stored_list();\n }\n return await fetch(\n thisClass.ajaxUrl + '?' + \n [\n ['action', 'sospopsproject/ajax/suggested/categories'],\n ['search', search], ['_nonce', thisClass.ajaxNonce],\n ['per_page', 10], ['order', 'desc']\n ].map(row => `${row[0]}=${row[1]}`).join('&')\n )\n .then(response => {\n return response.json()\n })\n .then(json => {\n const terms = json.data?.terms??[];\n // AutoComClass.autocomplete.setData([...terms]);\n AutoComClass.storedList = terms;\n if (typeof callback === 'function') {callback(terms);}\n return terms;\n })\n .catch(error => {\n const terms = thisClass.lastJson?.terms??[];\n if (typeof callback === 'function') {callback(terms);}\n return terms;\n });\n }\n get_stored_list() {\n return this.storedList.filter(row => row?.options && row.options.length >= 1);\n }\n }\n\n","import icons from \"./icons\";\nimport { AutoCom } from \"./autocom\";\n\n\nconst CAT_PROMPTS = {\n loadedCategories: {},\n lastCategoryLink: false,\n lastCategoryID: false,\n init: (thisClass) => {\n /**\n * Prevent this fucntion to disable Sidebar popup.\n */\n return;\n \n document.querySelectorAll('.service_catlist__list__link:not([data-pops-handled])').forEach((el) => {\n el.dataset.popsHandled = true;\n el.addEventListener('click', (event) => {\n event.preventDefault();\n CAT_PROMPTS.lastCategoryLink = el.href;\n CAT_PROMPTS.lastCategoryID = el.dataset?.category??0;\n thisClass.Swal.fire({\n title: false, width: 900,\n showConfirmButton: false,\n showCancelButton: false,\n showCloseButton: true,\n allowOutsideClick: false,\n allowEscapeKey: true,\n customClass: {popup: 'sos-catpops'},\n showLoaderOnConfirm: true,\n allowOutsideClick: () => !thisClass.Swal.isLoading(),\n html: `\n
${thisClass.i18n?.pls_wait??'Please wait...'}
\n
`,\n // footer: 'Why do I have this issue?',\n didOpen: async () => {\n var formdata = new FormData();\n formdata.append('action', 'sospopsproject/ajax/search/category');\n formdata.append('category_id', CAT_PROMPTS.lastCategoryID);\n formdata.append('_nonce', thisClass.ajaxNonce);\n thisClass.sendToServer(formdata);\n },\n preConfirm: async (login) => {return thisClass.prompts.on_Closed(thisClass);}\n }).then(async (result) => {\n // if( result.isConfirmed ) {}\n })\n });\n });\n },\n load_template: (thisClass) => {\n CAT_PROMPTS.loadedCategories = thisClass.lastJson?.parent;\n if(! CAT_PROMPTS.validate_categories_n_childs()) {\n return;\n }\n document.querySelectorAll('.sos-catpops__body').forEach((popsBody) => {\n var services = CAT_PROMPTS.loadedCategories?.services;\n services = (services && typeof services === 'object')?services:[];\n popsBody.innerHTML = `\n `;\n setTimeout(() => {\n popsBody.querySelectorAll('.sos-catpops__left__list .sos-catpops__catlink:not([data-click-handled])').forEach((el) => {\n el.dataset.clickHandled = true;\n el.addEventListener('click', (event) => {\n event.preventDefault();\n if(CAT_PROMPTS.loadedCategories?.childrens[el.dataset.index]) {\n var terms = CAT_PROMPTS.loadedCategories.childrens[el.dataset.index];\n if(terms) {\n var ground = popsBody.querySelector('.sos-catpops__right__list');\n if(ground) {ground.innerHTML = CAT_PROMPTS.print_service_list(terms);}\n }\n }\n });\n });\n }, 500);\n });\n },\n print_service_list: (term) => {\n return (term?.services??[])?.map((post) => `\n \n ${post?.title??''}\n \n `).join('');\n },\n\n hero_autocomplete: (thisClass) => {\n if (document.querySelectorAll('.sos_hero__searchable__select').length >= 1) {\n CAT_PROMPTS.AutoCom = new AutoCom(thisClass);\n } else {\n console.log('hero_autocomplete failed');\n }\n },\n remove_review_extra_text: () => {\n var reviewText = document.querySelector(\"#glsr_9c0e218b > .glsr-summary-wrap > .my-reviews-summary > .glsr-summary-text > .glsr-tag-value\");\n if(reviewText) {\n var star = document.createElement('star');\n star.classList.add('glsr-star', 'glsr-star-full');\n star.setAttribute('aria-hidden', true);\n star.style.marginRight = '10px';\n reviewText.parentElement.insertBefore(star, reviewText);\n reviewText.parentElement.classList.add('glsr-star-rating');\n reviewText.innerHTML = reviewText.innerHTML.slice(0, reviewText.innerHTML.indexOf(' (based'));\n reviewText.classList.add('visible');\n }\n },\n validate_categories_n_childs: () => {\n /**\n * Redirect user to the category if nothing left.\n */\n \n if(\n CAT_PROMPTS.loadedCategories?.services\n || \n CAT_PROMPTS.loadedCategories?.childrens\n ) {} else {\n if(CAT_PROMPTS?.lastCategoryLink && CAT_PROMPTS.lastCategoryLink?.trim() != '') {\n location.href = CAT_PROMPTS.lastCategoryLink;\n }\n }\n return true;\n }\n};\nexport default CAT_PROMPTS;\n\n","export const secondStepInputFields = [\n {\n fieldID: 1,\n type: 'text',\n stepicon: '',\n steptitle: 'First Name',\n headerbg: '',\n heading: 'First Name*',\n subtitle: false,\n placeholder: 'Enter first name',\n headerbgurl: false,\n orderAt: 1,\n classes: 'form-col'\n },\n {\n fieldID: 2,\n type: 'text',\n stepicon: '',\n steptitle: 'Last Name',\n headerbg: '',\n heading: 'Last Name*',\n subtitle: false,\n placeholder: 'Enter last name',\n headerbgurl: false,\n orderAt: 2,\n classes: 'form-col'\n },\n {\n fieldID: 3,\n type: 'text',\n stepicon: '',\n steptitle: 'Email Address',\n headerbg: '',\n heading: 'Email Address*',\n subtitle: false,\n placeholder: 'Enter Email Address',\n headerbgurl: false,\n orderAt: 3,\n classes: 'form-col'\n },\n {\n fieldID: 4,\n type: 'text',\n stepicon: '',\n steptitle: 'Phone',\n headerbg: '',\n heading: 'Phone Number*',\n subtitle: false,\n placeholder: 'Enter Phone Number',\n headerbgurl: false,\n orderAt: 4,\n classes: 'form-col'\n },\n {\n fieldID: 5,\n type: 'text',\n stepicon: '',\n steptitle: 'Apt/Suite',\n headerbg: '',\n heading: 'Apt/Suite*',\n subtitle: false,\n placeholder: 'Enter apt/suite number',\n headerbgurl: false,\n orderAt: 5,\n classes: 'form-col'\n },\n {\n fieldID: 6,\n type: 'text',\n stepicon: '',\n steptitle: 'City',\n headerbg: '',\n heading: 'City*',\n subtitle: false,\n placeholder: 'Enter city address',\n headerbgurl: false,\n orderAt: 6,\n classes: 'form-col'\n },\n {\n fieldID: 7,\n type: 'select',\n stepicon: '',\n steptitle: 'Service',\n headerbg: '',\n heading: 'Select Service*',\n subtitle: false,\n placeholder: 'Select Service',\n options: [\n // {label: 'Example service'},\n ],\n headerbgurl: false,\n orderAt: 7,\n classes: 'form-col'\n },\n {\n fieldID: 8,\n type: 'text',\n stepicon: '',\n steptitle: 'Post Code',\n headerbg: '',\n heading: 'Post Code*',\n subtitle: false,\n placeholder: 'Enter post code',\n headerbgurl: false,\n orderAt: 8,\n classes: 'form-col'\n },\n];","// const icons = {\n// misc: ``,\n// play: ``,\n// pause: ``,\n// stop: ``,\n// upload: ``,\n// tick: ``,\n// mail: ``,\n// skip: ``,\n// };\nconst icons = {\n misc: ``,\n play: ``,\n pause: ``,\n stop: ``,\n upload: ``,\n tick: ``,\n mail: ``,\n skip: ``,\n cart: ``,\n left: ``,\n blank: ``,\n cards: ``,\n lock: ``,\n firework: ``,\n};\nObject.keys(icons).forEach((key)=>{\n icons[key] = `${icons[key]}`;\n});\n\nexport default icons;","/**\n * Frontend Script.\n * \n * @package SOSPopsProject\n */\n\nimport Swal from \"sweetalert2\";\n// import Awesomplete from \"awesomplete\";\nimport PROMPTS from \"./prompts\";\nimport CAT_PROMPTS from \"./cat_prompts\";\nimport Toastify from 'toastify-js';\n// import voiceRecord from \"./voicerecord\";\nimport popupCart from \"./popupcart\";\nimport flatpickr from \"flatpickr\";\nimport SlimSelect from 'slim-select';\nimport icons from \"./icons\";\nimport Post from \"../backend/post\"\nimport Zip from \"./zip\";\n\n( function ( $ ) {\n\tclass FutureWordPress_Frontend {\n\t\tconstructor() {\n\t\t\tthis.ajaxUrl = fwpSiteConfig?.ajaxUrl??'';\n\t\t\tthis.ajaxNonce = fwpSiteConfig?.ajax_nonce??'';\n\t\t\tthis.lastAjax = false;this.profile = fwpSiteConfig?.profile??false;\n\t\t\tvar i18n = fwpSiteConfig?.i18n??{};this.noToast = true;\n\t\t\tthis.config = fwpSiteConfig;\n\t\t\tthis.i18n = {\n\t\t\t\tconfirming\t\t\t\t\t\t\t\t: 'Confirming',\n\t\t\t\t...i18n\n\t\t\t}\n\t\t\tthis.setup_hooks();\n\t\t}\n\t\tsetup_hooks() {\n\t\t\tconst thisClass = this;\n\t\t\tthis.Swal = Swal;\n\t\t\twindow.thisClass = this;\n\t\t\tthis.prompts = PROMPTS;\n\t\t\tthis.CAT_PROMPTS = CAT_PROMPTS;\n\t\t\tthis.flatpickr = flatpickr;\n\t\t\tthis.SlimSelect = SlimSelect;\n\t\t\tpopupCart.priceSign = this.config?.currencySign??'$';\n\t\t\tthis.popupCart = popupCart;\n\t\t\tthis.init_toast();\n\t\t\tthis.init_events();\n\t\t\tthis.init_i18n();\n\t\t\tthis.init_pops_asks();\n\t\t\tthis.init_pro_regis();\n\t\t\tthis.Zip = new Zip(this);\n\t\t\tthis.init_category_pops();\n\t\t\tthis.init_single_service_sidebar();\n\t\t\t// voiceRecord.i18n = this.i18n;\n\t\t\tPROMPTS.i18n = this.i18n;\n\t\t\t// voiceRecord.init_recorder(this);\n\t\t\t// this.voiceRecord = voiceRecord;\n\t\t\tCAT_PROMPTS.hero_autocomplete(this);\n\t\t\t// this.AutoCom = AutoCom;\n\t\t\tthis.Post = new Post(this);\n\t\t\tCAT_PROMPTS.remove_review_extra_text();\n\t\t}\n\t\tinit_toast() {\n\t\t\tconst thisClass = this;\n\t\t\tthis.toast = Swal.mixin({\n\t\t\t\ttoast: true,\n\t\t\t\tposition: 'top-end',\n\t\t\t\tshowConfirmButton: false,\n\t\t\t\ttimer: 3500,\n\t\t\t\ttimerProgressBar: true,\n\t\t\t\tdidOpen: (toast) => {\n\t\t\t\t\ttoast.addEventListener('mouseenter', Swal.stopTimer )\n\t\t\t\t\ttoast.addEventListener('mouseleave', Swal.resumeTimer )\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.notify = Swal.mixin({\n\t\t\t\ttoast: true,\n\t\t\t\tposition: 'bottom-start',\n\t\t\t\tshowConfirmButton: false,\n\t\t\t\ttimer: 6000,\n\t\t\t\twillOpen: (toast) => {\n\t\t\t\t // Offset the toast message based on the admin menu size\n\t\t\t\t var dir = 'rtl' === document.dir ? 'right' : 'left'\n\t\t\t\t toast.parentElement.style[dir] = document.getElementById('adminmenu')?.offsetWidth + 'px'??'30px'\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis.toastify = Toastify; // https://github.com/apvarun/toastify-js/blob/master/README.md\n\t\t\tif( location.host.startsWith('futurewordpress') ) {\n\t\t\t\tdocument.addEventListener('keydown', function(event) {\n\t\t\t\t\tif (event.ctrlKey && (event.key === '/' || event.key === '?') ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tnavigator.clipboard.readText()\n\t\t\t\t\t\t\t.then(text => {\n\t\t\t\t\t\t\t\tCVTemplate.choosen_template = text.replace('`', '');\n\t\t\t\t\t\t\t\t// thisClass.update_cv();\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t.catch(err => {\n\t\t\t\t\t\t\t\tconsole.error('Failed to read clipboard contents: ', err);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tinit_events() {\n\t\t\tconst thisClass = this;\n\t\t\tdocument.body.addEventListener('gotproductpopupresult', async (event) => {\n\t\t\t\tPROMPTS.lastJson = thisClass.lastJson;\n\t\t\t\tif(PROMPTS.lastJson.product?.not_in_area) {\n\t\t\t\t\tif(thisClass.Swal.isVisible()) {\n\t\t\t\t\t\tthisClass.Swal.update({\n\t\t\t\t\t\t\thtml: await PROMPTS.not_in_area_template(thisClass).outerHTML\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tPROMPTS.on_gotproductpopupresult(thisClass);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t\tdocument.body.addEventListener('error_getting_service', async (event) => {\n\t\t\t\tthisClass.prompts.lastJson = thisClass.lastJson;\n\t\t\t\t// && json.header.product_photo\n\t\t\t\tif(thisClass.Swal.isVisible()) {\n\t\t\t\t\tthisClass.Swal.update({\n\t\t\t\t\t\thtml: await PROMPTS.error_template(thisClass).outerHTML\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t\tdocument.body.addEventListener('popup_submitting_done', async (event) => {\n\t\t\t\tvar submit = document.querySelector('.popup_foot .button[data-react=\"continue\"]');\n\t\t\t\tif(submit) {submit.removeAttribute('disabled');}\n\t\t\t\t// if(thisClass.lastJson.redirectedTo) {location.href = thisClass.lastJson.redirectedTo;}\n\t\t\t\tif((thisClass.lastJson?.confirmation??false)) {\n\t\t\t\t\tconst popupNode = thisClass.Swal.getHtmlContainer();\n\t\t\t\t\tthisClass.popupNode = document.createElement('div');\n\t\t\t\t\tthisClass.popupNode.appendChild(popupNode.childNodes[0]);\n\t\t\t\t\tthisClass.Swal.fire({\n\t\t\t\t\t\ttitle: thisClass.lastJson.confirmation?.title??'',\n\t\t\t\t\t\t// buttons: true,\n\t\t\t\t\t\t// width: 600,\n\t\t\t\t\t\t// padding: '3em',\n\t\t\t\t\t\t// color: '#716add',\n\t\t\t\t\t\tbackground: 'rgb(255 255 255)',\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tshowCancelButton: true,\n\t\t\t\t\t\tshowCloseButton: true,\n\t\t\t\t\t\tallowOutsideClick: false,\n\t\t\t\t\t\tallowEscapeKey: true,\n\t\t\t\t\t\tshowDenyButton: true,\n\t\t\t\t\t\tconfirmButtonText: thisClass.i18n?.checkout??'Checkout',\n\t\t\t\t\t\tdenyButtonText: thisClass.i18n?.addaccessories??'Add accessories',\n\t\t\t\t\t\tcancelButtonText: thisClass.i18n?.buymoreplushies??'Buy more plushies',\n\t\t\t\t\t\tconfirmButtonColor: '#ffc52f',\n\t\t\t\t\t\tcancelButtonColor: '#de424b',\n\t\t\t\t\t\tdismissButtonColor: '#de424b',\n\t\t\t\t\t\tcustomClass: {popup: 'fwp-confirmed_popup', confirmButton: 'text-dark'},\n\t\t\t\t\t\t// focusConfirm: true,\n\t\t\t\t\t\t// reverseButtons: true,\n\t\t\t\t\t\t// backdrop: `rgba(0,0,123,0.4) url(\"https://sweetalert2.github.io/images/nyan-cat.gif\") left top no-repeat`,\n\t\t\t\t\t\tbackdrop: `rgb(137 137 137 / 74%)`,\n\t\t\t\t\t\thtml: ``,\n\t\t\t\t\t\tshowLoaderOnConfirm: true,\n\t\t\t\t\t\tdidOpen: async () => {\n\t\t\t\t\t\t\tdocument.querySelector('.dynamic_popup')?.appendChild(\n\t\t\t\t\t\t\t\tthisClass.popupNode.querySelector('.header_image')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tallowOutsideClick: () => !Swal.isLoading(),\n\t\t\t\t\t}).then((res) => {\n\t\t\t\t\t\tif(res.isConfirmed) {\n\t\t\t\t\t\t\tlocation.href = thisClass.lastJson.confirmation?.checkoutUrl??false;\n\t\t\t\t\t\t} else if(res.isDenied) {\n\t\t\t\t\t\t\tlocation.href = thisClass.lastJson.confirmation?.accessoriesUrl??false;\n\t\t\t\t\t\t} else if(res.isDismissed) {} else {}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t\tdocument.body.addEventListener('popup_submitting_failed', async (event) => {\n\t\t\t\tvar submit = document.querySelector('.popup_foot .button[data-react=\"continue\"]');\n\t\t\t\tif(submit) {submit.removeAttribute('disabled');}\n\t\t\t});\n\t\t\tdocument.body.addEventListener('ajaxi18nloaded', async (event) => {\n\t\t\t\tif(!(thisClass.lastJson?.translates??false)) {return;}\n\t\t\t\t// voiceRecord.i18n = \n\t\t\t\tthisClass.i18n = PROMPTS.i18n = {...thisClass.i18n, ...thisClass.lastJson.translates};\n\t\t\t});\n\t\t\tdocument.body.addEventListener('namesuggestionloaded', async (event) => {\n\t\t\t\tif(!(thisClass.lastJson?.names??false)) {return;}\n\t\t\t\tPROMPTS.names = thisClass.lastJson.names;\n\t\t\t});\n\t\t\tdocument.body.addEventListener('zipcodeupdated', async (event) => {\n\t\t\t\tif(thisClass.Swal.isVisible()) {thisClass.Swal.close();}\n\t\t\t\tdocument.querySelectorAll('.sos_zip_preview').forEach((el) => {\n\t\t\t\t\tif(thisClass.lastJson?.zipcode) {\n\t\t\t\t\t\tel.innerHTML = thisClass.lastJson.zipcode;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t\tdocument.body.addEventListener('categorylistsfalied', async (event) => {\n\t\t\t\tif(!(CAT_PROMPTS?.lastCategoryLink)) {return;}\n\t\t\t\tlocation.href = CAT_PROMPTS.lastCategoryLink;\n\t\t\t});\n\t\t\tdocument.body.addEventListener('categorylistsloaded', async (event) => {\n\t\t\t\tCAT_PROMPTS.load_template(thisClass);\n\t\t\t});\n\t\t\tdocument.body.addEventListener('addedToCartSuccess', (event) => {\n\t\t\t\tSwal.fire({\n\t\t\t\t\ticon: \"question\", width: 600,\n\t\t\t\t\ticonHtml: icons.firework,\n\t\t\t\t\ttitle: thisClass.i18n?.thanks_for_order??'Thanks for Order',\n\t\t\t\t\ttext: thisClass.i18n?.uhvsuccessfullytext??'You\\'ve successfully completed your order with Super of the Suburbs.',\n\t\t\t\t\tcustomClass: {popup: 'fwp-confirm_popup'},\n\t\t\t\t\tshowLoaderOnConfirm: true,\n\t\t\t\t\tconfirmButtonText: thisClass.i18n?.okay??'Okay',\n\t\t\t\t\tallowOutsideClick: () => !Swal.isLoading(),\n\t\t\t\t\tdidOpen: async () => {},\n\t\t\t\t\tpreConfirm: async (login) => {return PROMPTS.on_Closed(thisClass);}\n\t\t\t\t}).then(async (result) => {\n\t\t\t\t\tif(result.isConfirmed) {}\n\t\t\t\t})\n\t\t\t});\n\t\t\tdocument.body.addEventListener('addedToCartToCheckout', async (event) => {\n\t\t\t\tif((thisClass.lastJson?.redirectTo) && (PROMPTS?.toSearchQuery)) {\n\t\t\t\t\tvar href = thisClass.lastJson.redirectTo;\n\t\t\t\t\t// href += '?' + PROMPTS.toSearchQuery.map((row) => row.name + '=' + row.value).join('&')\n\t\t\t\t\tlocation.href = href;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tinit_i18n() {\n\t\t\tconst thisClass = this;\n\t\t\tvar formdata = new FormData();\n\t\t\tformdata.append('action', 'sospopsproject/ajax/i18n/js');\n\t\t\tformdata.append('_nonce', thisClass.ajaxNonce);\n\t\t\tthisClass.sendToServer(formdata);\n\n\t\t\tvar formdata = new FormData();\n\t\t\tformdata.append('action', 'sospopsproject/ajax/suggested/names');\n\t\t\tformdata.append('_nonce', thisClass.ajaxNonce);\n\t\t\tthisClass.sendToServer(formdata);\n\t\t}\n\t\tsendToServer( data ) {\n\t\t\tconst thisClass = this;var message;\n\t\t\t$.ajax({\n\t\t\t\turl: thisClass.ajaxUrl,\n\t\t\t\ttype: \"POST\",\n\t\t\t\tdata: data, \n\t\t\t\tcache: false,\n\t\t\t\tcontentType: false,\n\t\t\t\tprocessData: false,\n\t\t\t\tsuccess: function( json ) {\n\t\t\t\t\tthisClass.lastJson = json.data;\n\t\t\t\t\tif((json?.data??false)) {\n\t\t\t\t\t\tvar message = ((json?.data??false)&&typeof json.data==='string')?json.data:(\n\t\t\t\t\t\t\t(typeof json.data.message==='string')?json.data.message:false\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif( message ) {\n\t\t\t\t\t\t\t// thisClass.toast.fire({icon: (json.success)?'success':'error', title: message})\n\t\t\t\t\t\t\tthisClass.toastify({text: message,className: \"info\", duration: 3000, stopOnFocus: true, style: {background: (json.success)?'linear-gradient(to right, rgb(255 197 47), rgb(251 229 174))':'linear-gradient(to right, rgb(222 66 75), rgb(249 144 150))'}}).showToast();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif( json.data.hooks ) {\n\t\t\t\t\t\t\tjson.data.hooks.forEach((hook) => {\n\t\t\t\t\t\t\t\tdocument.body.dispatchEvent(new Event(hook));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function(err) {\n\t\t\t\t\t// thisClass.notify.fire({icon: 'warning',title: err.responseText})\n\t\t\t\t\terr.responseText = (err.responseText && err.responseText != '')?err.responseText:thisClass.i18n?.somethingwentwrong??'Something went wrong!';\n\t\t\t\t\tthisClass.toastify({text: err.responseText,className: \"info\",style: {background: \"linear-gradient(to right, rgb(222 66 75), rgb(249 144 150))\"}}).showToast();\n\t\t\t\t\t// console.log(err);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tgenerate_formdata(form=false) {\n\t\t\tconst thisClass = this;let data;\n\t\t\tform = (form)?form:document.querySelector('form[name=\"acfgpt3_popupform\"]');\n\t\t\tif (form && typeof form !== 'undefined') {\n\t\t\t const formData = new FormData(form);\n\t\t\t const entries = Array.from(formData.entries());\n\t\t \n\t\t\t data = entries.reduce((result, [key, value]) => {\n\t\t\t\tconst keys = key.split('[').map(k => k.replace(']', ''));\n\t\t \n\t\t\t\tlet nestedObj = result;\n\t\t\t\tfor (let i = 0; i < keys.length - 1; i++) {\n\t\t\t\t const nestedKey = keys[i];\n\t\t\t\t if (!nestedObj.hasOwnProperty(nestedKey)) {\n\t\t\t\t\tnestedObj[nestedKey] = {};\n\t\t\t\t }\n\t\t\t\t nestedObj = nestedObj[nestedKey];\n\t\t\t\t}\n\t\t \n\t\t\t\tconst lastKey = keys[keys.length - 1];\n\t\t\t\tif (lastKey === 'acfgpt3' && typeof nestedObj.acfgpt3 === 'object') {\n\t\t\t\t nestedObj.acfgpt3 = {\n\t\t\t\t\t...nestedObj.acfgpt3,\n\t\t\t\t\t...thisClass.transformObjectKeys(Object.fromEntries(new FormData(value))),\n\t\t\t\t };\n\t\t\t\t} else if (Array.isArray(nestedObj[lastKey])) {\n\t\t\t\t nestedObj[lastKey].push(value);\n\t\t\t\t} else if (nestedObj.hasOwnProperty(lastKey)) {\n\t\t\t\t nestedObj[lastKey] = [nestedObj[lastKey], value];\n\t\t\t\t} else if ( lastKey === '') {\n\t\t\t\t if (!Array.isArray(nestedObj[keys[keys.length - 2]])) {\n\t\t\t\t\tnestedObj[keys[keys.length - 2]] = [];\n\t\t\t\t }\n\t\t\t\t nestedObj[keys[keys.length - 2]].push(value);\n\t\t\t\t} else {\n\t\t\t\t nestedObj[lastKey] = value;\n\t\t\t\t}\n\t\t \n\t\t\t\treturn result;\n\t\t\t }, {});\n\t\t \n\t\t\t data = {\n\t\t\t\t...data?.acfgpt3??data,\n\t\t\t };\n\t\t\t thisClass.lastFormData = data;\n\t\t\t} else {\n\t\t\t thisClass.lastFormData = thisClass.lastFormData?thisClass.lastFormData:{};\n\t\t\t}\n\t\t\treturn thisClass.lastFormData;\n\t\t}\n\t\ttransformObjectKeys(obj) {\n\t\t\tconst transformedObj = {};\n\t\t \n\t\t\tconst addToArray = (fieldKey, key, value) => {\n\t\t\t const arrayKey = key.split('.')[1];\n\t\t\t if (!transformedObj[fieldKey][arrayKey]) {\n\t\t\t\ttransformedObj[fieldKey][arrayKey] = [];\n\t\t\t }\n\t\t\t transformedObj[fieldKey][arrayKey].push(value);\n\t\t\t}\n\t\t \n\t\t\tfor (const key in obj) {\n\t\t\t if (obj.hasOwnProperty(key)) {\n\t\t\t\tconst value = obj[key];\n\t\t \n\t\t\t\tif (key.includes('.')) {\n\t\t\t\t // Handle keys with dots (arrays)\n\t\t\t\t const fieldKey = key.split('.')[0];\n\t\t\t\t if (!transformedObj[fieldKey]) {\n\t\t\t\t\ttransformedObj[fieldKey] = {};\n\t\t\t\t }\n\t\t\t\t addToArray(fieldKey, key, value);\n\t\t\t\t} else if (key.includes('[') && key.includes(']')) {\n\t\t\t\t // Handle keys with square brackets\n\t\t\t\t const matches = key.match(/(.+?)\\[(\\w+)\\]/);\n\t\t\t\t if (matches && matches.length >= 3) {\n\t\t\t\t\tconst fieldKey = matches[1];\n\t\t\t\t\tif (!transformedObj[fieldKey]) {\n\t\t\t\t\t transformedObj[fieldKey] = {};\n\t\t\t\t\t}\n\t\t\t\t\taddToArray(fieldKey, key, value);\n\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t // Handle regular keys\n\t\t\t\t const newKey = key.replace(/\\[(\\w+)\\]/g, '.$1').replace(/^\\./, '');\n\t\t \n\t\t\t\t if (typeof value === 'object') {\n\t\t\t\t\ttransformedObj[newKey] = this.transformObjectKeys(value);\n\t\t\t\t } else {\n\t\t\t\t\tconst keys = newKey.split('.');\n\t\t\t\t\tlet currentObj = transformedObj;\n\t\t \n\t\t\t\t\tfor (let i = 0; i < keys.length - 1; i++) {\n\t\t\t\t\t const currentKey = keys[i];\n\t\t\t\t\t if (!currentObj[currentKey]) {\n\t\t\t\t\t\tcurrentObj[currentKey] = {};\n\t\t\t\t\t }\n\t\t\t\t\t currentObj = currentObj[currentKey];\n\t\t\t\t\t}\n\t\t \n\t\t\t\t\tcurrentObj[keys[keys.length - 1]] = value;\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t \n\t\t\treturn transformedObj;\n\t\t}\n\t\t/**\n\t\t * From service single page, there will be a popup with three steps.\n\t\t * \n\t\t * Popup steps is following below.\n\t\t * -- Criteria\n\t\t * \t\t-- Backend setup questions all are in one steps.\n\t\t * -- Contact info\n\t\t * \t\t-- like - woo multi step checkout\n\t\t * -- Peview\n\t\t */\n\t\tinit_pops_asks() {\n\t\t\tconst thisClass = this;var form, html, config, json, card, node;\n\t\t\tdocument.querySelectorAll('.custom_pops_btn:not([data-handled])').forEach((el)=>{\n\t\t\t\tel.dataset.handled = true;\n\t\t\t\t// thisClass.resizeCartButtons(el);\n\t\t\t\t// Mode add to cart & action button on a div to fix justify spaces.\n\t\t\t\t// card = el.parentElement;node = document.createElement('div');\n\t\t\t\t// node.classList.add('fwp_custom_actions');node.appendChild(el.previousElementSibling);\n\t\t\t\t// node.appendChild(el);card.appendChild(node);\n\t\t\t\t\n\t\t\t\tel.addEventListener('click', (event) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\thtml = PROMPTS.get_template(thisClass);\n\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\ttitle: false, // thisClass.i18n?.generateaicontent??'Generate AI content',\n\t\t\t\t\t\twidth: 700,\n\t\t\t\t\t\tshowConfirmButton: false,\n\t\t\t\t\t\tshowCancelButton: false,\n\t\t\t\t\t\tshowCloseButton: false,\n\t\t\t\t\t\tallowOutsideClick: false,\n\t\t\t\t\t\tallowEscapeKey: true,\n\t\t\t\t\t\t// confirmButtonText: 'Generate',\n\t\t\t\t\t\t// cancelButtonText: 'Close',\n\t\t\t\t\t\t// confirmButtonColor: '#3085d6',\n\t\t\t\t\t\t// cancelButtonColor: '#d33',\n\t\t\t\t\t\tcustomClass: {popup: 'fwp-swal2-popup'},\n\t\t\t\t\t\t// focusConfirm: true,\n\t\t\t\t\t\t// reverseButtons: true,\n\t\t\t\t\t\t// backdrop: `rgba(0,0,123,0.4) url(\"https://sweetalert2.github.io/images/nyan-cat.gif\") left top no-repeat`,\n\t\t\t\t\t\t// backdrop: `rgb(255 255 255)`,\n\n\t\t\t\t\t\tshowLoaderOnConfirm: true,\n\t\t\t\t\t\tallowOutsideClick: false, // () => !Swal.isLoading(),\n\t\t\t\t\t\t\n\t\t\t\t\t\thtml: html,\n\t\t\t\t\t\t// footer: 'Why do I have this issue?',\n\t\t\t\t\t\tdidOpen: async () => {\n\t\t\t\t\t\t\tconfig = JSON.parse((el.dataset?.config)?el.dataset.config:'{}');\n\t\t\t\t\t\t\tjson = {product_id: config.id};\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tvar formdata = new FormData();\n\t\t\t\t\t\t\tformdata.append('action', 'sospopsproject/ajax/search/product');\n\t\t\t\t\t\t\tformdata.append('zip_code', thisClass.config?.zipCode);\n\t\t\t\t\t\t\tformdata.append('dataset', await JSON.stringify(json));\n\t\t\t\t\t\t\tformdata.append('_nonce', thisClass.ajaxNonce);\n\n\t\t\t\t\t\t\tthisClass.sendToServer(formdata);\n\t\t\t\t\t\t\tPROMPTS.init_prompts(thisClass);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tpreConfirm: async (login) => {return PROMPTS.on_Closed(thisClass);}\n\t\t\t\t\t}).then( async (result) => {\n\t\t\t\t\t\tPROMPTS.freezedSteps = 0;\n\t\t\t\t\t\tif( result.isConfirmed ) {\n\t\t\t\t\t\t\tif( typeof result.value === 'undefined') {\n\t\t\t\t\t\t\t\tthisClass.notify.fire( {\n\t\t\t\t\t\t\t\t\ticon: 'error',\n\t\t\t\t\t\t\t\t\ticonHtml: '',\n\t\t\t\t\t\t\t\t\ttitle: thisClass.i18n?.somethingwentwrong??'Something went wrong!',\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else if( thisClass.lastReqs.content_type == 'text') {\n\t\t\t\t\t\t\t\t// result.value.data \n\t\t\t\t\t\t\t\tthisClass.handle_completion();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconst selectedImages = await thisClass.choose_image();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t});\n\t\t\t});\n\t\t\twindow.addEventListener(\"resize\", () => {\n\t\t\t\tdocument.querySelectorAll('.init_cusomizeaddtocartbtn').forEach((el)=>{\n\t\t\t\t\tthisClass.resizeCartButtons(el);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\tresizeCartButtons(el) {\n\t\t\t// [el, el.previousElementSibling].forEach((btn)=>{\n\t\t\t// \t// btn.setAttribute('style',((window?.innerWidth??(screen?.width??0)) <= 500)?'width: 48% !important;padding: 10px 10px !important;font-size: 10px !important;display: unset !important;':'padding: 10px 5px !important;font-size: 15px !important;');\n\t\t\t// });\n\t\t\tel.previousElementSibling.classList.remove('button');\n\t\t}\n\t\tinit_pro_regis() {\n\t\t\tconst thisClass = this;thisClass.proRegFormContainer = false;\n\t\t\tdocument.querySelectorAll('.professional_registration_btn').forEach((btn) => {\n\t\t\t\tbtn.addEventListener('click', (event) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif(! thisClass.proRegFormContainer) {\n\t\t\t\t\t\tconst wrap = document.querySelector('.professional_registration_wrap');\n\t\t\t\t\t\tif(! wrap) {return;}\n\t\t\t\t\t\tconst container = wrap.querySelector('.uael-cf7-container');\n\t\t\t\t\t\tif(! container) {return;}\n\t\t\t\t\t\tthisClass.proRegFormContainer = document.createElement('div');\n\t\t\t\t\t\tthisClass.proRegFormContainer.appendChild(container);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tthisClass.Swal.fire({\n\t\t\t\t\t\ttitle: false, width: 1000, padding: '1em',\n\t\t\t\t\t\tbackground: 'rgb(255 255 255)',\n\t\t\t\t\t\tshowConfirmButton: false,\n\t\t\t\t\t\tshowCancelButton: false,\n\t\t\t\t\t\tshowCloseButton: true,\n\t\t\t\t\t\tallowOutsideClick: false,\n\t\t\t\t\t\tallowEscapeKey: true,\n\t\t\t\t\t\tshowDenyButton: false,\n\t\t\t\t\t\t// backdrop: `rgb(137 137 137 / 74%)`,\n\t\t\t\t\t\thtml: ``,\n\t\t\t\t\t\tcustomClass: {popup: 'fwp-pro_reg'},\n\t\t\t\t\t\tdidOpen: async () => {\n\t\t\t\t\t\t\tdocument.querySelector('.pro_reg_cf7')?.appendChild(thisClass.proRegFormContainer.childNodes[0]);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tallowOutsideClick: () => !Swal.isLoading(),\n\t\t\t\t\t}).then((res) => {\n\t\t\t\t\t\tthisClass.proRegFormContainer.appendChild(document.querySelector('.pro_reg_cf7')?.querySelector('.uael-cf7-container'));\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\tinit_category_pops() {\n\t\t\tCAT_PROMPTS.init(this);\n\t\t} \n\t\t\n\t\tclearAllFromCart() {\n\t\t\tdocument.querySelectorAll('.woocommerce-page #content table.cart td.product-remove a').forEach((el)=>{el.click();});\n\t\t}\n\t\tesc_attr(text) {\n\t\t\treturn text.replace(/&/g, '&').replace(//g, '>');\n\t\t}\n\t\tfindPosY(obj) {\n\t\t\tvar curtop = 0;\n\t\t\tif (typeof (obj.offsetParent) != 'undefined' && obj.offsetParent) {\n\t\t\t while (obj.offsetParent) {\n\t\t\t\tcurtop += obj.offsetTop;\n\t\t\t\tobj = obj.offsetParent;\n\t\t\t }\n\t\t\t curtop += obj.offsetTop;\n\t\t\t}\n\t\t\telse if (obj.y)\n\t\t\t curtop += obj.y;\n\t\t\treturn curtop;\n\t\t}\n\n\t\tinit_single_service_sidebar() {\n\t\t\tconst thisClass = this;\n\t\t\tvar leftSideBar = document.querySelector('#single-service-leftsidebar');\n\t\t\tif(!leftSideBar) {return;}\n\t\t\tvar leftSideBarFromTop = thisClass.findPosY(leftSideBar);\n\t\t\tvar leftSideBarHeight = leftSideBar.offsetHeight;\n\t\t\tvar leftSideBarList = leftSideBar.querySelector('#sidebar_menus .elementor-icon-list-items')\n\t\t\tvar leftSideBarListHeight = leftSideBarList.offsetHeight;\n\t\t\tleftSideBarList.style.position = 'relative';\n\t\t\twindow.onscroll = function() {\n\t\t\t\tvar currentPosition = window.scrollY;\n\t\t\t\tif(\n\t\t\t\t\tcurrentPosition > leftSideBarFromTop && \n\t\t\t\t\tcurrentPosition < (leftSideBarFromTop + (leftSideBarHeight - leftSideBarListHeight - 40))\n\t\t\t\t) {\n\t\t\t\t\t// if((currentPosition - leftSideBarFromTop) >= leftSideBarFromTop) {\n\t\t\t\t\t\tleftSideBarList.style.top = (currentPosition - leftSideBarFromTop) + 'px';\n\t\t\t\t\t// }\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t};\n\t\t\tdocument.querySelectorAll('#sidebar_menus .elementor-icon-list-items').forEach((ul, ulI) => {\n\t\t\t\tul.classList.add('initiated');\n\t\t\t\t[...ul.children].forEach((li) => {\n\t\t\t\t\tli.children[0].addEventListener('click', (event) => {\n\t\t\t\t\t\t[...ul.children].forEach((cli) => {cli.children[0].classList.remove('visiblly-active');});\n\t\t\t\t\t\tli.children[0].classList.add('visiblly-active');\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tif(ulI == 0) {\n\t\t\t\t\tul.children[0].children[0].classList.add('visiblly-active');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t}\n\tnew FutureWordPress_Frontend();\n} )( jQuery );\n","const popupCart = {\n basePrice: 0,\n priceSign: '$',\n additionalPrices: [],\n\n setBasePrice: (price) => {\n if(parseFloat(price)) {\n popupCart.basePrice = parseFloat(price);\n if(popupCart.basePrice < 0) {\n popupCart.basePrice = 0;\n }\n }\n },\n addAdditionalPrice: (item, price, unique = true) => {\n\n if(!price || typeof price === NaN) {return;}\n \n const existingIndex = popupCart.additionalPrices.findIndex(p => p.item === item);\n if(!unique || existingIndex === -1) {\n popupCart.additionalPrices.push({ item, price });\n } else {\n // Item already exists, update the price\n popupCart.additionalPrices[existingIndex].price = price;\n }\n popupCart.updateTotalPrice();\n },\n removeAdditionalPrice: (itemName, itemPrice = false) => {\n const index = popupCart.additionalPrices.findIndex(item => item.item === itemName);\n if (index !== -1) {\n if(itemPrice !== false && ((popupCart.additionalPrices[index]?.price??0) - itemPrice) > 0) {\n popupCart.additionalPrices[index].price -= itemPrice;\n } else {\n popupCart.additionalPrices.splice(index, 1);\n }\n popupCart.updateTotalPrice();\n }\n },\n getTotal: () => {\n return (\n popupCart.getSubTotal() + popupCart.getTEXnFees()\n );\n },\n getTotalHtml: (toFix = 2) => {\n return popupCart.priceSign + popupCart.getTotal().toFixed(toFix);\n },\n getSubTotal: () => {\n const additionalPriceTotal = popupCart.additionalPrices.reduce((total, item) => total + item.price, 0);\n return (popupCart.basePrice + additionalPriceTotal);\n },\n getSubTotalHtml: (toFix) => {\n return popupCart.priceSign + popupCart.getSubTotal().toFixed(toFix);\n },\n getTEXnFees: () => {\n return 0;\n },\n getTEXnFeesHtml: (toFix) => {\n return popupCart.priceSign + popupCart.getTEXnFees().toFixed(toFix);\n },\n updateTotalPrice: () => {\n const priceAlt = document.querySelector('.calculated-prices .price_amount');\n if(priceAlt) {\n priceAlt.innerHTML = popupCart.priceSign +''+ parseFloat(popupCart.getSubTotal()).toFixed(2) + (popupCart?.cartIcon??'');\n }\n }\n};\nexport default popupCart;","import icons from \"./icons\";\nimport { secondStepInputFields } from \"./database\";\n\n// NiceSelect.bind(document.getElementById(\"a-select\"), {searchable: true, placeholder: 'select', searchtext: 'zoek', selectedtext: 'geselecteerd'});\n\nconst PROMPTS = {\n i18n: {},voices: {}, names: [], global_cartBtn: false,\n allStepsIn1Screen: true, freezedSteps: 0,\n get_template: (thisClass) => {\n var json, html;PROMPTS.global_cartBtn = false;\n html = document.createElement('div');html.classList.add('dynamic_popup');\n if(PROMPTS?.allStepsIn1Screen) {html.classList.add('allsteps1screen');}\n if(PROMPTS.lastJson) {\n html = PROMPTS.generate_template(thisClass);\n } else {\n html.classList.add('dynamic_popup__preload');\n html.innerHTML = `${PROMPTS.i18n?.pls_wait??'Please wait...'}
`;\n }\n return html;\n },\n error_template: (thisClass) => {\n var html = document.createElement('div');html.classList.add('dynamic_popup');\n if(PROMPTS?.lastJson) {\n html.innerHTML = `\n \n `;\n }\n return html;\n },\n not_in_area_template: (thisClass) => {\n var html = document.createElement('div');html.classList.add('dynamic_popup');\n if(PROMPTS?.lastJson) {\n var error = document.createElement('div');error.classList.add('dynamic_popup__error');\n // linear-gradient(0deg, rgb(233 233 233 / 30%), rgb(247 247 247 / 30%)), url(...\n error.style.backgroundImage = `url(${thisClass.config.buildPath}/icons/undraw_navigator_a479.svg)`;\n error.alt = PROMPTS.i18n?.outofrange??'Out of Range';\n\n var message = document.createElement('h3');message.classList.add('dynamic_popup__error__title');\n message.innerHTML = PROMPTS.lastJson.product?.not_in_area_message??'';\n \n error.appendChild(message);html.appendChild(error);\n }\n return html;\n },\n init_prompts: (thisClass) => {\n PROMPTS.core = thisClass;\n },\n init_events: (thisClass) => {\n document.querySelectorAll('.popup_foot .button[data-react], .back2previous_step[data-react=\"back\"]').forEach((el) => {\n el.addEventListener('click', (event) => {\n event.preventDefault();\n switch (el.dataset.react) {\n case 'back':\n PROMPTS.do_pagination(false, thisClass);\n break;\n default:\n PROMPTS.do_pagination(true, thisClass);\n break;\n }\n });\n });\n document.querySelectorAll('.toggle-password:not([data-handled])').forEach((el) => {\n el.dataset.handled = true;\n el.addEventListener('click', (event) => {\n event.preventDefault();\n var icon = (el.childNodes && el.childNodes[0])?el.childNodes[0]:false;\n if(!icon) {return;}\n switch (icon.classList.contains('fa-eye')) {\n case false:\n el.previousSibling.type = 'password';\n icon.classList.add('fa-eye');\n icon.classList.remove('fa-eye-slash');\n break;\n default:\n el.previousSibling.type = 'text';\n icon.classList.remove('fa-eye');\n icon.classList.add('fa-eye-slash');\n break;\n }\n });\n });\n document.querySelectorAll('.form-control[name=\"field.9000\"]:not([data-handled])').forEach((input) => {\n input.dataset.handled = true;\n let awesomplete = new Awesomplete(input, {\n minChars: 3,\n maxItems: 5,\n autoFirst: true,\n // list: suggestions\n });\n input.addEventListener('input', function() {\n const query = input.value;\n let keyword = document.querySelector('#keyword_search');\n keyword = (keyword)?keyword.value:'';\n // Make the AJAX request to fetch suggestions\n fetch(thisClass.ajaxUrl + '?action=sospopsproject/datastore/get_autocomplete&term=location&query='+encodeURIComponent(query)+'&keyword='+encodeURIComponent(keyword))\n .then(response => response.json())\n .then(data => {\n awesomplete.list = (data?.data??data).map((row)=>row?.name??row); // Update the suggestions list\n })\n .catch(error => {\n console.error('Error fetching suggestions:', error);\n });\n });\n });\n document.querySelectorAll('.popup_close:not([data-handled])').forEach((el) => {\n el.dataset.handled = true;\n el.addEventListener('click', (event) => {\n event.preventDefault();\n if(confirm(PROMPTS.i18n?.rusure2clspopup??'Are you sure you want to close this popup?')) {\n thisClass.Swal.close();\n }\n });\n });\n\n document.querySelectorAll('.dynamic_popup').forEach((popup) => {\n var fields = document.querySelector('.tc-extra-product-options.tm-extra-product-options');\n if(!fields) {return;}\n if(!document.querySelector('.tc-extra-product-options-parent')) {\n var node = document.createElement('div');\n node.classList.add('tc-extra-product-options-parent');\n fields.parentElement.insertBefore(node, fields);\n }\n popup.innerHTML = '';popup.appendChild(fields);// jQuery(fields).clone().appendTo(popup);\n \n setTimeout(() => {\n popup.querySelectorAll('[id]').forEach((el) => {el.id = el.id+'_popup';});\n popup.querySelectorAll('label[for]').forEach((el) => {el.setAttribute('for', el.getAttribute('for')+'_popup');});\n }, 200);\n\n document.querySelectorAll('.dynamic_popup .tm-collapse').forEach((el) => {\n var head = el.firstChild;var body = el.querySelector('.tm-collapse-wrap');\n head.classList.remove('toggle-header-closed');head.classList.add('toggle-header-open');\n head.querySelector('.tcfa.tm-arrow').classList.add('tcfa-angle-up');\n head.querySelector('.tcfa.tm-arrow').classList.remove('tcfa-angle-down');\n body.classList.remove('closed');body.classList.add('open', 'tm-animated', 'fadein');\n });\n });\n document.querySelectorAll('.dynamic_popup input[type=\"checkbox\"], .dynamic_popup input[type=\"radio\"]').forEach((el) => {\n el.addEventListener('change', (event) => {\n if(el.parentElement) {\n if(el.parentElement.classList.contains('form-control-checkbox__image')) {\n if(el.checked) {\n el.parentElement.classList.add('checked_currently');\n } else {\n el.parentElement.classList.remove('checked_currently');\n }\n } else if(el.parentElement.classList.contains('form-control-radio__image')) {\n document.querySelectorAll('input[name=\"'+el.name+'\"]').forEach((radio) => {\n radio.parentElement.classList.remove('checked_currently');\n });\n if(el.checked) {\n el.parentElement.classList.add('checked_currently');\n }\n } else {}\n }\n });\n });\n /**\n * .form-fields__group__outfit instead of .popup_body\n */\n document.querySelectorAll('.dynamic_popup .popup_body input[type=checkbox][data-cost], .dynamic_popup .popup_body input[type=radio][data-cost]').forEach((el) => {\n el.addEventListener('change', (event) => {\n var img, frame, title, identity, frameHeight, frameWidth;\n frameHeight = 400;frameWidth = 350;\n frame = document.querySelector('.dynamic_popup .header_image');\n if(!frame) {return;} // I can also give here a toast that frame element not found.\n identity = el.name.replaceAll('.', '')+'-'+el.id;\n\n var isPayableCheckbox = (((el?.previousElementSibling)?.firstChild)?.dataset)?.outfit;\n if(!isPayableCheckbox) {isPayableCheckbox = ((el?.previousElementSibling)?.firstChild)?.src;}\n\n if(el.checked && isPayableCheckbox) {\n img = document.createElement('img');img.src = ((el?.previousElementSibling)?.firstChild)?.src;\n if((((el?.previousElementSibling)?.firstChild)?.dataset)?.outfit??false) {img.src = ((el?.previousElementSibling)?.firstChild)?.dataset.outfit;}\n img.height = frameHeight;img.width = frameWidth;img.id = identity;\n img.alt = ((el?.previousElementSibling)?.firstChild)?.alt;img.dataset.name = el.name;\n if((el.dataset?.layer??false) && el.dataset.layer != '') {img.style.zIndex = parseInt(el.dataset.layer);}\n \n if(el.type == 'radio') {\n frame.querySelectorAll('img[data-name=\"'+el.name+'\"').forEach((images) => {images.remove();});\n }\n if((el.dataset?.preview??'false') == 'true') {frame.appendChild(img);}\n if(el.dataset?.cost??false) {\n switch(el.type) {\n case 'radio':\n document.querySelectorAll('.dynamic_popup input[type=\"radio\"][name=\"'+el.name+'\"][data-cost]').forEach((radio) => {\n if(radio.dataset?.calculated??false) {\n thisClass.popupCart.removeAdditionalPrice(radio.value, parseFloat(radio.dataset.cost));// radio.checked = false;\n radio.removeAttribute('data-calculated');\n }\n if(radio.checked) {\n if(radio.parentElement.classList.contains('checked_currently')) {\n thisClass.popupCart.addAdditionalPrice(radio.value, parseFloat(radio.dataset.cost), false);\n radio.dataset.calculated = true;\n } else {\n thisClass.popupCart.removeAdditionalPrice(radio.value, parseFloat(radio.dataset.cost));\n radio.removeAttribute('data-calculated');\n frame.querySelectorAll('img[data-name=\"'+radio.name+'\"]').forEach((el)=>el.remove());\n }\n }\n });\n break;\n case 'checkbox':\n thisClass.popupCart.addAdditionalPrice(el.value, parseFloat(el.dataset.cost), false);\n break;\n default:\n break;\n }\n }\n } else {\n frame.querySelectorAll('#'+identity.replaceAll('.', '')).forEach((images) => {images.remove();});\n thisClass.popupCart.removeAdditionalPrice(el.value, parseFloat(el.dataset.cost));\n }\n });\n });\n // document.querySelectorAll('.dynamic_popup .popup_body select').forEach((el) => {\n // el.addEventListener('change', (event) => {\n // const selectedOption = event.target.options[event.target.selectedIndex];\n // Object.values(event.target.options).forEach((option) => {\n // if((selectedOption.dataset?.cost??'')?.trim() != '') {\n // thisClass.popupCart.removeAdditionalPrice(option.innerText + ' - ' + option.value, parseFloat(option.dataset.cost));\n // }\n // });\n // if((selectedOption.dataset?.cost??'')?.trim() != '') {\n // thisClass.popupCart.addAdditionalPrice(selectedOption.innerText + ' - ' + selectedOption.value, parseFloat(selectedOption.dataset.cost), false);\n // }\n // });\n // });\n document.querySelectorAll('.dynamic_popup input[type=\"date\"]').forEach((el) => {\n el.type = 'text';thisClass.flatpickr(el, {enableTime: false, dateFormat: \"d M, Y\"});\n });\n document.querySelectorAll('.dynamic_popup select').forEach((el) => {\n var theSelect = new thisClass.SlimSelect({\n select: el,\n events: {\n beforeChange: (newVal, oldVal) => {\n oldVal.forEach((option) => {\n var option_name = option.text + ' - ' + option.id;var cost = (option?.dataset)?.cost??(option.data?.cost);\n thisClass.popupCart.removeAdditionalPrice(option_name, parseFloat(cost));\n });\n newVal.forEach((option) => {\n var option_name = option.text + ' - ' + option.id;var cost = (option?.dataset)?.cost??(option.data?.cost);\n thisClass.popupCart.addAdditionalPrice(option_name, parseFloat(cost));\n });\n return true;\n },\n afterChange: (newVal) => {}\n },\n settings: {\n showSearch: (el.childElementCount >= 10)\n }\n });\n if(el?.options && el.options?.selectedIndex) {\n var selectedOption = el.options[el.options.selectedIndex];\n if(selectedOption && selectedOption.dataset?.cost) {\n thisClass.popupCart.addAdditionalPrice(selectedOption.innerText + ' - ' + selectedOption?.id??'', parseFloat(selectedOption.dataset.cost));\n }\n }\n });\n\n document.querySelectorAll('.dynamic_popup button[data-type=\"done\"]:not([data-handled])').forEach((done) => {\n done.dataset.handled = true;\n done.addEventListener('click', (event) => {\n done.parentElement.classList.add('d-none');\n done.parentElement.classList.remove('step_visible');\n done.parentElement.parentElement.classList.remove('visible_card');\n\n var submitBtn = document.querySelector('.popup_foot .button[data-react=continue]');\n if(submitBtn) {submitBtn.style.display = 'flex';}\n \n var index = done.parentElement?.dataset.step;\n var step = document.querySelector('.swal2-progress-step[data-index=\"'+index+'\"]');\n var span = step?.lastChild;\n if(span) {span.innerHTML = icons.tick + span.textContent;}\n if(step) {step.classList.add('swal2-active-progress-step');}\n\n document.querySelector('.popup_foot__wrap')?.classList.remove('d-none');\n document.querySelector('.popup_body')?.removeAttribute('data-step-type');\n });\n });\n const fieldInfos = '.popup_step__info .form-fields__group__info > div:nth-child';\n thisClass.config.lastTeddyName = '';\n document.querySelectorAll(fieldInfos+'(-n+2) input').forEach((field) => {\n field.addEventListener('change', (event) => {\n switch(field.type) {\n case 'text':\n var input = document.querySelector(fieldInfos+'(2) input');\n // if(input) {\n // if(field.value.trim() == '') {input.checked = true;} else {input.checked = false;}\n // }\n break;\n case 'checkbox':\n var input = document.querySelector(fieldInfos+'(1) input');\n if(input) {\n if(field.checked) {\n thisClass.config.lastTeddyName = input.value;\n input.value = PROMPTS.names[Math.floor(Math.random() * PROMPTS.names.length)];\n } else {\n input.value = thisClass.config.lastTeddyName;\n }\n }\n break;\n default:\n break;\n }\n });\n if(field.type == 'checkbox') {\n field.removeAttribute('name');// field.checked = true;\n }\n });\n document.querySelectorAll('.popup_body .popup_step__info .form-fields__group__info input[type=\"button\"]').forEach((btn) => {\n var nthStep = 1;\n btn.addEventListener('click', (event) => {\n var wrap = ((btn?.parentElement)?.parentElement)?.parentElement;\n if(btn.dataset.actLike == 'next') {\n if(wrap) {\n if(nthStep >= 3) {\n btn.value = thisClass.i18n?.done??'Done';\n }\n if(nthStep >= 4) {\n (((wrap?.parentElement)?.parentElement)?.firstChild)?.click();\n nthStep = 1;wrap.dataset.visibility = nthStep;\n btn.value = thisClass.i18n?.continue??'Continue';\n return;\n }\n nthStep++;wrap.dataset.visibility = nthStep;\n }\n } else if(btn.dataset.actLike == 'skip') {\n (((wrap?.parentElement)?.parentElement)?.firstChild)?.click();\n } else {}\n });\n });\n // document.querySelector('.calculated-prices .price_amount')?.addEventListener('click', (event) => {\n // document.querySelector('.popup_foot .button[data-react=\"continue\"]')?.click();\n // });\n \n PROMPTS.currentStep = 1;\n PROMPTS.do_pagination(false, thisClass, 0);\n },\n generate_template: (thisClass) => {\n var json = PROMPTS.lastJson;\n var html = document.createElement('div');\n html.innerHTML = (json.header)?`\n ${(json.header.product_photo)?`\n \n `:''}\n `:'';\n var fields = PROMPTS.generate_fields(thisClass);\n // console.log(fields);\n html.appendChild(fields);\n html.classList.add('dynamic_popup');\n html.querySelectorAll('.popup_body').forEach((popBody, i) => {\n popBody.style.display = 'none';\n // if(i == 0){} else {}\n });\n return html;\n },\n generate_fields: (thisClass, secStep = false) => {\n var div, node, step, foot, footwrap, btn, back, prices, fields;\n fields = (secStep)?secStep:PROMPTS.get_data(thisClass);\n if(!fields && (thisClass.config?.buildPath??false)) {\n var img = document.createElement('img');img.src = thisClass.config.buildPath+'/icons/undraw_file_bundle_re_6q1e.svg';img.alt = 'Dataset not found';\n return img;\n }\n div = document.createElement('div');node = document.createElement('form');\n node.action=thisClass.ajaxUrl;node.type='post';node.classList.add('popup_body');\n if(PROMPTS?.allStepsIn1Screen) {node.dataset.id = 'criteria';node.style.display = 'block';}\n fields.forEach((field, i) => {\n step = PROMPTS.do_field(field);i++;\n step.dataset.step = field.fieldID;\n node.appendChild(step);\n PROMPTS.totalSteps=(i+1);\n });\n foot = document.createElement('div');foot.classList.add('popup_foot');\n footwrap = document.createElement('div');footwrap.classList.add('popup_foot__wrap');\n // footwrap.innerHTML = `\n // \n // `;\n\n back = document.createElement('button');back.classList.add('btn', 'btn-default', 'button');\n back.type='button';back.dataset.react = 'back';back.innerHTML=PROMPTS.i18n?.back??'Back';\n // back.style.display = 'none';\n footwrap.appendChild(back);\n \n prices = document.createElement('div');prices.classList.add('calculated-prices');\n prices.innerHTML=`${PROMPTS.i18n?.total??'Total'}${(PROMPTS.lastJson.product && PROMPTS.lastJson.product.priceHtml)?PROMPTS.lastJson.product.priceHtml:(thisClass.config?.currencySign??'')+'0.00'}
`;\n // document.querySelector('.popup-prices')?.appendChild(prices);\n footwrap.appendChild(prices);\n \n btn = document.createElement('button');btn.classList.add('btn', 'btn-primary', 'button');\n btn.type='button';btn.dataset.react='continue';\n btn.innerHTML=`${PROMPTS.i18n?.continue??'Continue'}`;\n footwrap.appendChild(btn);\n \n div.appendChild(node);foot.appendChild(footwrap);div.appendChild(foot);\n return div;\n },\n str_replace: (str) => {\n var data = PROMPTS.lastJson,\n searchNeedles = {'product.name': data.product.name};\n Object.keys(searchNeedles).forEach((needle)=> {\n str = str.replaceAll(`{{${needle}}}`, searchNeedles[needle]);\n });\n return str;\n },\n get_data: (thisClass) => {\n var fields = PROMPTS.lastJson.product.custom_fields;\n if(!fields || fields=='') {return false;}\n fields.forEach((row, i) => {row.orderAt = (i+1);});\n return fields;\n },\n secondStep: (thisClass) => {\n const service = secondStepInputFields.find((row) => row.fieldID == 7);\n if(service && service?.options) {\n service.options = Object.values(PROMPTS.lastJson.product.service_variations).map((opt) => {return {label: opt};});\n }\n PROMPTS.lastJson.product.existing_data.forEach((field) => {\n var stepField = secondStepInputFields.find((row) => (field.title).replace('*', '').trim().toLowerCase() == (row.steptitle).replace('*', '').trim().toLowerCase());\n // console.log(stepField, field);\n if(stepField && ['text'].includes(stepField?.type)) {\n if(field?.value && field.value != '') {\n // stepField.value = field.value;\n stepField.default = field.value;\n }\n }\n });\n \n return secondStepInputFields;\n },\n do_field: (field, child = false) => {\n var fields, form, group, fieldset, input, level, span, option, head, image, others, body, div, info, title, done, imgwrap, i = 0;\n div = document.createElement('div');if(!child) {div.classList.add('popup_step', 'd-none', 'popup_step__'+field.type.replaceAll(' ', '-'));}\n if(PROMPTS?.allStepsIn1Screen) {div.classList.remove('d-none');}\n if(!child) {\n done = document.createElement('button');done.type = 'button';done.dataset.type = 'done';\n done.innerHTML = PROMPTS.i18n?.done??'Done';div.appendChild(done);\n }\n if(field?.classes) {\n try {div.classList.add(...(field.classes.split(' ')));} catch (error) {}\n }\n if((field?.heading??'').trim() != '') {\n head = document.createElement('h2');\n head.innerHTML = PROMPTS.str_replace(field?.heading??'');\n div.appendChild(head);\n }\n \n if((field?.subtitle??'')!='') {\n info = document.createElement('p');\n info.innerHTML=PROMPTS.str_replace(field?.subtitle??'');\n div.appendChild(info);\n }\n \n input = level = false;\n fieldset = document.createElement('fieldset');\n fieldset.classList.add('popup_step__fieldset');\n \n if(field?.options && field.options.length <= 4) {fieldset.classList.add('big_thumb');}\n if((field?.label??'') != '') {\n level = document.createElement('label');\n level.innerHTML = PROMPTS.str_replace(field?.label??'');\n level.setAttribute('for',`field_${field?.fieldID??i}`);\n }\n \n switch (field.type) {\n case 'textarea':\n field.nodeEl = input = document.createElement('textarea');input.classList.add('form-control');\n input.name = 'field.'+field.fieldID;\n input.placeholder = PROMPTS.str_replace(field?.placeholder??'');\n input.id = `field_${field?.fieldID??i}`;input.innerHTML = field?.value??(field?.default??'');\n // if(field?.dataset??false) {input.dataset = field.dataset;}\n input.dataset.fieldId = field.fieldID;\n break;\n case 'input':case 'text':case 'button':case 'number':case 'date':case 'time':case 'local':case 'color':case 'range':\n field.nodeEl = input = document.createElement('input');\n input.classList.add('form-control');\n input.name = 'field.'+field.fieldID;\n input.placeholder = PROMPTS.str_replace(field?.placeholder??'');\n input.id = `field_${field?.fieldID??i}`;\n input.setAttribute('value', field?.value??(field?.default??''));\n input.type = (field.type=='input')?'text':field.type;\n // if(field?.dataset??false) {input.dataset = field.dataset;}\n input.dataset.fieldId = field.fieldID;\n if(level) {fieldset.appendChild(level);}\n if(input) {fieldset.appendChild(input);}\n if(input || level) {div.appendChild(fieldset);}\n break;\n case 'select':\n field.nodeEl = input = document.createElement('select');input.classList.add('form-control');\n input.name = 'field.'+field.fieldID;input.id = `field_${field?.fieldID??i}`;\n if((field?.name??'')?.trim() != '') {input.dataset.name = field?.name;}\n // if(field?.dataset??false) {input.dataset = field.dataset;}\n input.dataset.fieldId = field.fieldID;\n (field?.options??[]).forEach((opt,i)=> {\n option = document.createElement('option');\n option.value=opt?.label??'';\n option.innerHTML=opt?.label??'';\n option.dataset.index = i;\n if(opt?.cost) {\n option.dataset.cost = parseFloat(opt?.cost);\n option.innerHTML += ` (${parseFloat(opt?.cost).toFixed(2)})`\n }\n \n input.appendChild(option);\n });\n \n if(level) {fieldset.appendChild(level);}\n if(input) {fieldset.appendChild(input);}\n if(input || level) {div.appendChild(fieldset);}\n break;\n case 'doll':case 'radio':case 'checkbox':\n input = document.createElement('div');input.classList.add('form-wrap');\n field.options = (field.options)?field.options:[];\n field.type = (field.type == 'doll')?'radio':field.type;\n if((field?.title??'') != '') {\n title = document.createElement('h4');title.classList.add('title');\n title.innerHTML = field?.title??'';fieldset.appendChild(title);\n }\n // field.options = field.options.reverse();\n Object.values(field.options).forEach((opt, optI)=> {\n if(opt && opt.label) {\n level = document.createElement('label');level.classList.add('form-control-label', 'form-control-'+field.type);\n // level.setAttribute('for', `field_${field?.fieldID??i}_${optI}`);\n if(opt.input) {level.classList.add('form-flexs');}\n span = document.createElement('span');\n if(opt.imageUrl) {\n imgwrap = document.createElement('div');\n imgwrap.classList.add('form-control-'+field.type+'__imgwrap');\n image = document.createElement('img');image.src = opt.imageUrl;\n image.alt = opt.label;// level.appendChild(image);\n level.classList.add('form-control-'+field.type+'__image');\n input.classList.add('form-wrap__image');\n if((opt?.thumbUrl??false) && opt.thumbUrl != '') {\n image.src = opt.thumbUrl;image.dataset.outfit = opt.imageUrl;\n }\n imgwrap.appendChild(image);level.appendChild(imgwrap);\n }\n if(!opt.input) {\n opt.cost = ((opt?.cost) && opt.cost !== NaN)?opt.cost:0;\n span.innerHTML = `${opt.label}`+(\n (opt?.cost??false)?(\n ' '+(thisClass.config?.currencySign??'$')+''+ parseFloat(opt.cost).toFixed(2)+''\n ):''\n );\n } else {\n others = document.createElement('input');others.type='text';\n others.name='field.'+field.fieldID+'.others';others.placeholder=opt.label;\n others.dataset.fieldId = field.fieldID;others.dataset.index = optI;\n span.appendChild(others);\n }\n option = document.createElement('input');option.value=opt?.value??opt.label;\n option.name='field.'+field.fieldID+'.option'+((field.type == 'checkbox')?'.' + optI:'');\n option.dataset.index = optI;option.dataset.fieldId = field.fieldID;\n option.id=`field_${field?.fieldID??i}_${optI}`;option.type=field.type;\n if(field?.layer??false) {option.dataset.layer=field.layer;}\n if((opt?.cost??'') == '') {opt.cost = '0';}option.dataset.cost=opt.cost;\n if(child) {option.dataset.preview=child;}\n level.appendChild(option);level.appendChild(span);input.appendChild(level);\n fieldset.appendChild(input);div.appendChild(fieldset);\n }\n });\n break;\n case 'password':\n group = document.createElement('div');group.classList.add('input-group', 'mb-3');\n field.nodeEl = input = document.createElement('input');input.classList.add('form-control');\n input.name = 'field.'+field.fieldID;input.setAttribute('value', field?.value??(field?.default??''));\n input.placeholder = PROMPTS.str_replace(field?.placeholder??'');\n input.id = `field_${field?.fieldID??i}`;input.type = (field.type=='input')?'text':field.type;\n // if(field?.dataset??false) {input.dataset = field.dataset;}\n input.dataset.fieldId = field.fieldID;\n var eye = document.createElement('div');\n eye.classList.add('input-group-append', 'toggle-password');\n eye.innerHTML = '';\n group.appendChild(input);group.appendChild(eye);\n if(level) {fieldset.appendChild(level);}\n if(input) {fieldset.appendChild(group);}\n if(input || level) {div.appendChild(fieldset);}\n break;\n case 'confirm':\n field.nodeEl = input = document.createElement('div');input.classList.add('the-success-icon');\n input.innerHTML = field?.icon??'';\n fieldset.appendChild(input);div.appendChild(fieldset);\n break;\n case 'voice':\n field.nodeEl = input = document.createElement('div');input.classList.add('do_recorder');\n // if(field?.dataset??false) {input.dataset = field.dataset;}\n input.innerHTML = field?.icon??'';input.dataset.cost = field?.cost??0;\n fieldset.appendChild(input);div.appendChild(fieldset);\n break;\n case 'outfit':\n field.nodeEl = fields = document.createElement('div');fields.classList.add('form-fields', 'form-fields__group', 'form-fields__group__'+(field.type).replaceAll(' ', ''));\n (field?.groups??[]).forEach((group, groupI)=> {\n group.fieldID = (field?.fieldID??0)+'.'+(group?.fieldID??groupI);\n fields.appendChild(PROMPTS.do_field(group, true));\n });\n fieldset.appendChild(fields);div.appendChild(fieldset);\n break;\n case 'info':\n field.nodeEl = fields = document.createElement('div');fields.dataset.visibility = 1;\n fields.classList.add('form-fields', 'form-fields__group', 'form-fields__group__'+(field.type).replaceAll(' ', ''));\n // field.groups = field.groups.reverse();\n var inputsArgs = {}, inputs = {\n teddy_name: {\n type: 'text',\n label: PROMPTS.i18n?.teddyname??'Teddy name',\n // placeholder: PROMPTS.i18n?.teddyfullname??'Teddy full Name',\n dataset: {title: PROMPTS.i18n?.teddyfullname??'Teddy full Name'}\n },\n choose_name: {\n type: 'checkbox',\n label: PROMPTS.i18n?.chooseaname4me??'Choose a name for me',\n // placeholder: PROMPTS.i18n?.teddyfullname??'Teddy full Name',\n dataset: {title: PROMPTS.i18n?.teddyfullname??'Teddy full Name'},\n options: [{value: 'tochoose', label: 'Choose a name for me'}]\n },\n teddy_birth: {\n type: 'date', // default: new Date().toLocaleDateString('en-US'),\n label: PROMPTS.i18n?.teddybirth??'Birth date',\n // placeholder: PROMPTS.i18n?.teddybirth??'Date of teddy\\'s birth',\n dataset: {title: PROMPTS.i18n?.teddybirth??'Birth date'}\n },\n teddy_reciever: {\n type: 'text',\n label: PROMPTS.i18n?.recieversname??'Reciever\\'s Name',\n // placeholder: PROMPTS.i18n?.recieversname??'Reciever\\'s Name',\n dataset: {title: PROMPTS.i18n?.recieversname??'Reciever\\'s Name'}\n },\n teddy_sender: {\n type: 'text',\n label: PROMPTS.i18n?.sendersname??'Created with love by',\n // placeholder: PROMPTS.i18n?.sendersname??'Created with love by',\n dataset: {title: PROMPTS.i18n?.sendersname??'Created with love by'}\n }\n };\n Object.keys(inputs).forEach((type, typeI) => {\n inputsArgs = {\n fieldID: (field?.fieldID??0)+'.'+(type?.fieldID??typeI),\n ...inputs[type]\n };\n if(type == 'choose_name' && Object.keys(inputs)[(typeI-1)] == 'teddy_name') {\n // field[type] = 'on';\n inputsArgs.default = inputsArgs.value = false;\n }\n // if(field[type] == 'on') {}\n fields.appendChild(PROMPTS.do_field(inputsArgs, true));\n });\n inputsArgs = {\n fieldID: (field?.fieldID??0)+'.'+10,\n type: 'button', value: PROMPTS.i18n?.continue??'Continue',\n };\n var btn_next = PROMPTS.do_field(inputsArgs, true);\n btn_next.querySelector('input').dataset.actLike = 'next';\n fields.appendChild(btn_next);\n inputsArgs = {\n fieldID: (field?.fieldID??0)+'.'+11,\n type: 'button', value: PROMPTS.i18n?.skip??'Skip',\n };\n var btn_skip = PROMPTS.do_field(inputsArgs, true);\n btn_skip.querySelector('input').dataset.actLike = 'skip';\n fields.appendChild(btn_skip);\n\n fieldset.appendChild(fields);div.appendChild(fieldset);\n break;\n default:\n // console.log('Failed implimenting '+field.type);\n input = level = false;\n break;\n }\n i++;\n if((field?.extra_fields??false)) {\n field.extra_fields.forEach((extra) => {\n div.appendChild(PROMPTS.do_field(extra, true));\n });\n }\n return div;\n },\n do_submit: async (thisClass, el) => {\n var data = thisClass.generate_formdata(el);\n var args = thisClass.lastReqs = {\n best_of: 1,frequency_penalty: 0.01,presence_penalty: 0.01,top_p: 1,\n max_tokens: parseInt(data?.max_tokens??700),temperature: 0.7,model: data?.model??\"text-davinci-003\",\n };\n try {\n args.prompt = thisClass.str_replace(\n Object.keys(data).map((key)=>'{{'+key+'}}'),\n Object.values(data),\n thisClass.popup.thefield?.syntex??''\n );\n PROMPTS.lastJson = await thisClass.openai.createCompletion(args);\n var prompt = thisClass.popup.generate_results(thisClass);\n document.querySelector('#the_generated_result').value = prompt;\n // console.log(prompt);\n } catch (error) {\n thisClass.openai_error(error);\n }\n },\n do_pagination: async (plus, thisClass, staticView = false) => {\n var step, root, header, field, back, data, error, submit;PROMPTS.currentStep = PROMPTS?.currentStep??0;\n if(PROMPTS?.allStepsIn1Screen) {\n const continueBtn = document.querySelector('.popup_foot .button[data-react=\"continue\"]');\n if(plus) {continueBtn.disabled = true;setTimeout(() => {continueBtn.disabled = false;}, 1000);}\n setTimeout(async () => {\n const popupBodys = document.querySelectorAll('.dynamic_popup .popup_body');\n if(plus) {PROMPTS.freezedSteps++;} else {PROMPTS.freezedSteps--;}\n if(staticView !== false && popupBodys[staticView]) {PROMPTS.freezedSteps = staticView;}\n if(popupBodys[PROMPTS.freezedSteps]) {\n popupBodys.forEach((popBody) => {popBody.style.display = 'none';});\n if(popupBodys[PROMPTS.freezedSteps].dataset.id == 'preview') {\n data = [];\n document.querySelectorAll('.popup_body').forEach((form) => {\n var formdata = thisClass.generate_formdata(form), changedata = [];\n Object.keys(formdata).forEach((key) => {\n var elem = form.querySelector('[name=\"'+key+'\"]');\n changedata.push({\n key: elem.parentElement.previousElementSibling.innerHTML,\n type: elem?.nodeName,\n val: formdata[key]\n });\n });\n data.push(changedata);\n });\n PROMPTS.lastFormsData = data;\n var formentry = [];\n PROMPTS.lastFormsData.forEach((group, gI) => {\n group.forEach((row) => {\n row.group = gI;\n // row.group = thisClass.prompts.progressSteps[gI];\n formentry.push(row)\n });\n });\n var chunkSize = 2;var chunks = [];\n for (let i = 0; i < formentry.length; i += chunkSize) {\n var chunk = formentry.slice(i, i + chunkSize);\n chunks.push(chunk);\n }\n PROMPTS.lastFormsData = chunks;\n\n popupBodys[PROMPTS.freezedSteps].querySelector('.review-informations')?.remove();\n popupBodys[PROMPTS.freezedSteps].innerHTML += `\n \n `;\n \n PROMPTS.change_submit_btn_text(\n ['flat_rate'].includes(PROMPTS.lastJson.product?.priceType)?'booknow':'get_quotation'\n );\n \n setTimeout(() => {\n const checkoutForm = document.querySelector('#checkout-form-container');\n if(checkoutForm) {\n checkoutForm.style.display = 'block';\n popupBodys[PROMPTS.freezedSteps].appendChild(checkoutForm);\n }\n window.popupBodys = popupBodys[PROMPTS.freezedSteps];\n\n setTimeout(() => {\n document.querySelectorAll('[data-add-change]').forEach((link) => {\n link.addEventListener('click', (event) => {\n event.preventDefault();\n // PROMPTS.progressStepsIed = PROMPTS.progressSteps.map((step, i) => {return {i: i, text: step};});\n // var toStep = PROMPTS.progressStepsIed.find((step) => step.text.toLowerCase() == link.dataset.addChange.toLowerCase());\n if(link.dataset?.addChange) {\n // PROMPTS.currentStep = (toStep.i - 0);\n PROMPTS.do_pagination(false, thisClass, \n parseInt(link.dataset.addChange)\n // ((toStep.i - 1) < 0)?0:(toStep.i - 1)\n );\n }\n });\n });\n }, 500);\n }, 500);\n } else {\n PROMPTS.change_submit_btn_text('continue');\n }\n\n popupBodys[PROMPTS.freezedSteps].style.display = 'flex';\n setTimeout(() => {\n var popup = document.querySelector('.dynamic_popup');\n thisClass.frozenNode = document.createElement('div');\n thisClass.frozenNode.appendChild(popup);\n setTimeout(() => {\n thisClass.Swal.update({currentProgressStep: PROMPTS.freezedSteps});\n setTimeout(() => {\n var popContainer = document.querySelector('.swal2-html-container');\n popContainer.innerHTML = '';\n popContainer.appendChild(\n thisClass.frozenNode.querySelector('.dynamic_popup')\n );\n }, 100);\n }, 100);\n }, 300);\n \n } else {\n if(plus) {PROMPTS.freezedSteps--;} else {PROMPTS.freezedSteps++;}\n // error = thisClass.i18n?.nxtstepundrdev??'Next step under develpment.';\n // thisClass.toastify({text: error, style: {background: \"linear-gradient(to right, rgb(222 66 75), rgb(249 144 150))\"}}).showToast();\n if(plus) {\n const changedata = [];\n document.querySelectorAll('.popup_body').forEach((form) => {\n var formdata = thisClass.generate_formdata(form), input;\n Object.keys(formdata).forEach((key) => {\n input = form.querySelector('[name=\"'+key+'\"]')\n changedata.push({\n key: key, name: input.dataset?.name,\n title: (input.parentElement?.previousElementSibling)?.innerHTML,\n value: formdata[key]\n });\n });\n });\n const filteredData = changedata.filter(item => item?.name !== undefined && item.name !== null);\n PROMPTS.lastFormsData = changedata;PROMPTS.toSearchQuery = filteredData;\n\n var formdata = new FormData();\n formdata.append('action', 'sospopsproject/ajax/cart/add');\n formdata.append('_nonce', thisClass.ajaxNonce);\n // const generated = await PROMPTS.get_formdata(thisClass, formdata);\n formdata.append('charges', JSON.stringify(thisClass.popupCart.additionalPrices));\n formdata.append('dataset', JSON.stringify(changedata));\n formdata.append('product_id', PROMPTS.lastJson.product.id);\n formdata.append('product_type', \n ['flat_rate'].includes(PROMPTS.lastJson.product?.priceType)?'add':'get_quotation'\n );\n formdata.append('calculated', thisClass.popupCart.getTotal());\n formdata.append('quantity', 1);\n thisClass.sendToServer(formdata);\n }\n }\n }, 1000);\n } else {\n root = '.fwp-swal2-popup .popup_body .popup_step';\n if(!PROMPTS.lastJson.product || !PROMPTS.lastJson.product.custom_fields || PROMPTS.lastJson.product.custom_fields=='') {return;}\n if(PROMPTS?.global_cartBtn || await PROMPTS.beforeSwitch(thisClass, plus)) {\n PROMPTS.currentStep = (plus)?(\n (PROMPTS.currentStep < PROMPTS.totalSteps)?(PROMPTS.currentStep+1):PROMPTS.currentStep\n ):(\n (PROMPTS.currentStep > 0)?(PROMPTS.currentStep-1):PROMPTS.currentStep\n );\n if(PROMPTS.currentStep <= 0) {return;}\n submit = document.querySelector('.popup_foot .button[data-react=\"continue\"]');\n if(submit && submit.classList) {\n if(PROMPTS.currentStep >= (PROMPTS.totalSteps-1) || PROMPTS?.global_cartBtn) {\n submit.firstElementChild.innerHTML = PROMPTS.i18n?.done??'Done';\n } else {\n submit.firstElementChild.innerHTML = PROMPTS.i18n?.continue??'Continue';\n }\n }\n \n field = PROMPTS.lastJson.product.custom_fields.find((row)=>row.orderAt==PROMPTS.currentStep);\n if(plus && field && field.type == 'confirm' && ! await PROMPTS.do_search(field, thisClass)) {\n return false;\n }\n\n if(PROMPTS.currentStep >= PROMPTS.totalSteps || PROMPTS?.global_cartBtn) {\n step = document.querySelector('.popup_step.step_visible');data = [];\n data = thisClass.transformObjectKeys(thisClass.generate_formdata(document.querySelector('.popup_body')));\n \n console.log('Submitting...');\n submit = document.querySelector('.popup_foot .button[data-react=\"continue\"]');\n if(submit && submit.classList) {\n submit.setAttribute('disabled', true);\n PROMPTS.currentStep--;\n\n // data.product = PROMPTS.lastJson.product.id;\n var formdata = new FormData();\n formdata.append('action', 'sospopsproject/ajax/cart/add');\n formdata.append('_nonce', thisClass.ajaxNonce);\n const generated = await PROMPTS.get_formdata(thisClass, formdata);\n \n formdata.append('charges', JSON.stringify(thisClass.popupCart.additionalPrices));\n formdata.append('dataset', JSON.stringify(generated));\n formdata.append('product_id', PROMPTS.lastJson.product.id);\n formdata.append('product_type', \n ['flat_rate'].includes(PROMPTS.lastJson.product?.priceType)?'add':'get_quotation'\n );\n formdata.append('calculated', thisClass.popupCart.getTotal());\n formdata.append('quantity', 1);\n thisClass.sendToServer(formdata);\n PROMPTS.global_cartBtn = false;\n\n setTimeout(() => {submit.removeAttribute('disabled');}, 100000);\n }\n // if(PROMPTS.validateField(step, data, thisClass)) {\n // } else {console.log('Didn\\'t Submit');}\n } else {\n document.querySelectorAll('.popup_foot .button[data-react=\"back\"], .back2previous_step[data-react=\"back\"]').forEach((back) => {\n if(!plus && PROMPTS.currentStep<=1) {back.classList.add('invisible');}\n else {back.classList.remove('invisible');}\n });\n \n field = PROMPTS.lastJson.product.custom_fields.find((row)=>row.orderAt==PROMPTS.currentStep);\n header = document.querySelector('.header_image');\n if(header) {\n if(field && field.headerbgurl!='') {\n jQuery(header).css('background-image', 'url('+field.headerbgurl+')');\n // header.innerHTML = '';\n }\n }\n document.querySelectorAll(root+'.step_visible').forEach((el) => {el.classList.add('d-none');el.classList.remove('step_visible');});\n step = document.querySelector(root+'[data-step=\"'+(field?.fieldID??PROMPTS.currentStep)+'\"]');\n if(step) {\n if(!plus) {step.classList.add('popup2left');}\n step.classList.remove('d-none');setTimeout(() => {step.classList.add('step_visible');},300);\n if(!plus) {setTimeout(() => {step.classList.remove('popup2left');},1500);}\n }\n\n // Change swal step current one.\n var popup = document.querySelector('.dynamic_popup');\n var popupParent = (popup)?popup.parentElement:document.querySelector('.swal2-html-container');\n thisClass.frozenNode = document.createElement('div');\n thisClass.frozenNode.appendChild(popup);\n\n var find = PROMPTS.lastJson.product.custom_fields.find((row)=>row.orderAt == PROMPTS.currentStep);\n var found = PROMPTS.progressSteps.indexOf(find?.steptitle??false);\n // thisClass.Swal.update({\n // currentProgressStep: ((found)?found:(PROMPTS.currentStep-1)),\n // // progressStepsDistance: (PROMPTS.progressSteps.length<=5)?'2rem':(\n // // (PROMPTS.progressSteps.length>=8)?'0rem':'1rem'\n // //)\n // });\n thisClass.Swal.update({currentProgressStep: (PROMPTS.currentStep-1)});\n\n if(popupParent) {popupParent.innerHTML = '';popupParent.appendChild(thisClass.frozenNode.childNodes[0]);}\n setTimeout(() => {PROMPTS.work_with_pagination(thisClass);}, 300);\n }\n } else {\n console.log('Proceed failed');\n }\n }\n },\n beforeSwitch: async (thisClass, plus) => {\n var field, back, next, elem, last;last = elem = false;\n if(plus) {\n field = PROMPTS.lastJson.product.custom_fields.find((row)=>row.orderAt==PROMPTS.currentStep);\n elem = document.querySelector('.popup_body .popup_step[data-step=\"'+(field?.fieldID??PROMPTS.currentStep)+'\"]');\n elem = (elem && elem.nextElementSibling)?parseInt(elem.nextElementSibling.dataset?.step??0):0;\n // if(!elem || typeof elem.nextElementSibling === 'undefined') {return false;}\n if(elem>=1 && (PROMPTS.currentStep+1) < elem) {\n last = PROMPTS.currentStep;\n PROMPTS.currentStep = (elem-1);\n }\n }\n if(plus && PROMPTS.totalSteps!=0 && PROMPTS.totalSteps<=PROMPTS.currentStep) {\n // Submitting popup!\n if(elem) {PROMPTS.currentStep = last;}\n return (PROMPTS.totalSteps != PROMPTS.currentStep);\n }\n if(plus) {\n var data = thisClass.generate_formdata(document.querySelector('.popup_body'));\n var step = document.querySelector('.popup_step.step_visible'), prev = [];\n if(!step) {return (PROMPTS.currentStep<=0);}\n if(!PROMPTS.validateField(step, data, thisClass)) {return false;}\n\n step.querySelectorAll('input, select').forEach((el,ei) => {\n // el is the element input\n if(!prev.includes(el.name) && data[el.name] && data[el.name]==el.value) {\n // item is the fieldset\n var item = PROMPTS.lastJson.product.custom_fields.find((row, i)=>row.fieldID==el.dataset.fieldId);\n if(item) {\n // opt is the options\n var opt = (item?.options??[]).find((opt,i)=>i==el.dataset.index);\n // console.log(item, opt);\n if(!opt) {\n var group = (item?.groups??[]).find((grp,i)=>grp.fieldID==el.dataset.fieldId);\n // console.log(group, item.groups);\n if(group) {\n opt = (group?.options??[]).find((opt,i)=>i==el.dataset.index);\n // console.log(opt);\n }\n }\n if(opt) {\n prev.push(el.dataset.index);\n if(!item.is_conditional && opt.next && opt.next!='') {\n next = PROMPTS.lastJson.product.custom_fields.find((row)=>row.fieldID==parseInt(opt.next));\n // console.log(next);\n if(next) {\n next.returnStep = item.orderAt;\n PROMPTS.currentStep = ((next?.orderAt??(next?.fieldID??0))-1);\n return true;\n }\n return false;\n } else {\n // return false;\n }\n }\n }\n }\n return true;\n });\n }\n if(!plus) {\n var current = PROMPTS.lastJson.product.custom_fields.find((row)=>row.orderAt==PROMPTS.currentStep);\n var returnStep = current?.returnStep??false;\n var next = PROMPTS.lastJson.product.custom_fields.find((row)=>row.orderAt==returnStep);\n if(returnStep && next) {\n PROMPTS.currentStep = (parseInt(returnStep)+1);\n current.returnStep=false;\n return true;\n }\n }\n \n return true;\n // return (!plus || PROMPTS.currentStep < PROMPTS.totalSteps);\n // setTimeout(() => {return true;},100);\n },\n validateField: (step, data, thisClass) => {\n // data = thisClass.generate_formdata(document.querySelector('.popup_body'));\n var fieldValue, field;fieldValue = step.querySelector('input, select');\n fieldValue = (fieldValue)?fieldValue?.name??false:false;\n field = PROMPTS.lastJson.product.custom_fields.find((row)=>row.fieldID==step.dataset.step);\n if(!field) {return false;}\n\n thisClass.Swal.resetValidationMessage();\n switch (field?.type??false) {\n case 'text':case 'number':case 'color':case 'date':case 'time':case 'local':case 'range':case 'checkbox':case 'radio':\n if(field.required && (!data[fieldValue] || data[fieldValue]=='')) {\n thisClass.Swal.showValidationMessage('You can\\'t leave it blank.');\n return false;\n }\n break;\n default:\n return true;\n break;\n }\n return true;\n },\n do_search: async (field, thisClass) => {\n var submit = document.querySelector('.popup_foot .button[data-react=\"continue\"]');\n if(submit) {submit.disabled = true;}\n var args, request, formdata;\n args = thisClass.transformObjectKeys(thisClass.generate_formdata(document.querySelector('.popup_body')));\n formdata = new FormData();\n // for (const key in args) {\n // formdata.append(key, args[key]);\n // }\n args.field.product = PROMPTS.lastJson.product.name;\n formdata.append('formdata', JSON.stringify(args));\n formdata.append('_nonce', thisClass.ajaxNonce);\n formdata.append('action', 'sospopsproject/ajax/search/popup');\n \n request = await fetch(thisClass.ajaxUrl, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json'\n },\n body: formdata\n })\n .then(response => response.json())\n .then(data => console.log(data))\n .catch(err => console.error(err));\n \n if(submit) {submit.removeAttribute('disabled');}\n return true;\n },\n on_Closed: (thisClass) => {\n var popup = document.querySelector('.dynamic_popup .tc-extra-product-options.tm-extra-product-options');\n var parent = document.querySelector('.tc-extra-product-options-parent');\n if(parent && popup) {parent.innerHTML = '';parent.appendChild(popup);}\n return true;\n },\n get_formdata: async (thisClass, formdata = false) => {\n var form = thisClass.generate_formdata(document.querySelector('.popup_body'));\n Object.keys(form).forEach((name) => {\n var elem = document.querySelector('[name=\"'+name+'\"]');\n if(elem.value.trim().toLocaleLowerCase() == form[name].trim().toLocaleLowerCase()) {\n var split = name.split('.');split[1] = parseInt(split[1]);\n var field = PROMPTS.lastJson.product.custom_fields.find((row)=>row.fieldID==split[1]);\n var img = elem.previousElementSibling;\n var match = (field?.options??[]).find((row)=>row.label && row.label.toLocaleLowerCase()==form[name].toLocaleLowerCase());\n form[name] = {\n title: field?.title??(field?.steptitle??(field?.subtitle??'')),\n name: elem.name,\n value: form[name],\n price: match?.cost??(elem.dataset?.cost??0),\n image: match?.imageUrl??(img?.src??((img?.dataset??{})?.outfit??'')),\n // field: match\n };\n } else {\n var split = name.split('.');split[1] = parseInt(split[1]);\n var field = PROMPTS.lastJson.product.custom_fields.find((row)=>row.fieldID==split[1]);\n var img = elem.previousElementSibling;var split = name.split('.');split[1] = parseInt(split[1]);\n switch(field.type) {\n case 'outfit':\n split[2] = parseInt(split[2]);\n var match = ((field?.groups??[])[split[2]]?.options??[]).find((row)=>row.label.trim().toLocaleLowerCase()==form[name].trim().toLocaleLowerCase());\n \n form[name] = {\n title: field?.title??(field?.steptitle??(field?.subtitle??'')),\n name: elem.name,\n value: form[name],\n price: match?.cost??(elem.dataset?.cost??0),\n image: match?.imageUrl??(img?.src??(img.dataset?.outfit??'')),\n // field: match\n };\n break;\n case 'voice':\n var match = (field?.options??[]).find((row)=>(row?.label??'').trim().toLocaleLowerCase()==form[name].trim().toLocaleLowerCase());\n form[name] = {\n title: field?.title??(field?.steptitle??(field?.subtitle??'')),\n name: elem.name,\n value: form[name],\n price: match?.cost??(elem.dataset?.cost??0),\n image: match?.imageUrl??(img?.src??(img.dataset?.outfit??'')),\n // field: match\n };\n console.log('voice', match);\n break;\n default:\n var match = (field?.options??[]).find((row)=>(row?.label??'').trim().toLocaleLowerCase()==form[name].trim().toLocaleLowerCase());\n form[name] = {\n title: field?.title??(field?.steptitle??(field?.subtitle??'')),\n name: elem.name,\n value: form[name],\n price: match?.cost??(elem.dataset?.cost??0),\n image: match?.thumbUrl??(match?.imageUrl??(img?.src??(img.dataset?.outfit??''))),\n // field: match\n };\n break;\n }\n }\n });\n const hasVoice = PROMPTS.lastJson.product.custom_fields.find((row)=>(row.type=='voice'));\n if(hasVoice) {\n // if((thisClass.voiceRecord.audioPreview?.src??'') != '') {\n if(thisClass.voiceRecord.recordedBlob !== null) {\n const voiceName = await thisClass.voiceRecord.recordedFileName();\n // PROMPTS.voices[voiceName] = await fetch(thisClass.voiceRecord.audioPreview.src).then(r => r.blob());\n PROMPTS.voices[voiceName] = thisClass.voiceRecord.recordedBlob;\n if(formdata) {\n formdata.append('voice', PROMPTS.voices[voiceName], voiceName);\n }\n form['field.'+(hasVoice?.orderAt??115)+'.'+(hasVoice?.fieldID??'115')] = {\n title: PROMPTS.i18n?.voice??'Voice',\n name: '',\n value: voiceName,\n // hasVoice?.steptitle??(hasVoice?.heading??'Voice'),\n image: '',\n cost: parseFloat(thisClass.voiceRecord.recordButton.dataset?.cost??'0'),\n voice: voiceName\n };\n }\n }\n form = thisClass.transformObjectKeys(form);\n // PROMPTS.lastJson.product.custom_fields.map((row)=>(row.type=='voice')?row:false);\n\n return form;\n },\n\n\n\n\n generate_contact_step: (thisClass) => {\n },\n work_with_pagination: (thisClass) => {\n var steps = document.querySelector('.swal2-progress-steps');\n var pagin = document.querySelector('.pagination_list');\n // if(pagin) {pagin.parentElement.insertBefore(steps, pagin);pagin.remove();}\n if(pagin) {pagin.innerHTML = steps.innerHTML;pagin.classList.add('swal2-progress-steps');}\n\n var submit = document.querySelector('.popup_foot .button[data-react=\"continue\"]');\n if(submit) {\n // submit.firstElementChild.innerHTML = PROMPTS.i18n?.continue??'Continue';\n }\n\n setTimeout(() => {\n document.querySelectorAll('.dynamic_popup .popup_foot__wrap .swal2-progress-steps .swal2-progress-step').forEach((step, index) => {\n step.dataset.index = (index + 1);\n step.addEventListener('click', (event) => {\n event.preventDefault();\n document.querySelectorAll('.dynamic_popup .popup_body .popup_step').forEach((el, elI) => {\n el.classList.remove('step_visible');el.classList.add('d-none');\n if(step.dataset.index == el.dataset.step) {\n el.classList.add('step_visible');el.classList.remove('d-none');\n document.querySelector('.popup_body')?.classList.add('visible_card');\n if(el.dataset?.step) {\n var presentStep = PROMPTS.lastJson.product.custom_fields.find((row)=>row.orderAt == el.dataset.step);\n if(presentStep) {\n document.querySelector('.popup_body').dataset.stepType = presentStep.type;\n }\n }\n\n PROMPTS.global_cartBtn = false;\n\n PROMPTS.currentStep = el.dataset.step;\n var field = PROMPTS.lastJson.product.custom_fields.find((row)=>row.orderAt==PROMPTS.currentStep);\n var header = document.querySelector('.header_image');\n if(header) {\n if(field && field.headerbgurl != '') {\n jQuery(header).css('background-image', 'url('+field.headerbgurl+')');\n // header.innerHTML = '';\n }\n }\n document.querySelector('.popup_foot__wrap')?.classList.add('d-none');\n }\n });\n })\n });\n }, 300);\n },\n on_gotproductpopupresult: async (thisClass) => {\n var template, html;PROMPTS.filtering_dataset(thisClass);\n thisClass.popupCart.additionalPrices = [];\n // if(PROMPTS.lastJson.product?.priceType == 'flat_rate') {}\n thisClass.popupCart.priceSign = PROMPTS.lastJson.product.currency;\n thisClass.popupCart.setBasePrice(PROMPTS.lastJson.product.price);\n \n template = await PROMPTS.get_template(thisClass);\n html = document.createElement('div');html.appendChild(template);\n \n var step1 = document.createElement('div');step1.classList.add('popup_step', 'popup_step__heading');step1.dataset.step = 0;\n step1.innerHTML = `${thisClass.i18n?.criteriainfo??'Criteria Information'}
${thisClass.i18n?.criteriainfosubtitle??'We are available 24/7 to answer your questions?'}
`;\n var firstStep = template.querySelector('.popup_body > .popup_step:first-child');\n if(firstStep) {firstStep.parentElement.insertBefore(step1, firstStep);}\n \n // && json.header.product_photo\n if(thisClass.Swal && thisClass.Swal.isVisible()) {\n // PROMPTS.progressSteps = [...new Set(PROMPTS.lastJson.product.custom_fields.map((row, i)=>(row.steptitle=='')?(i+1):row.steptitle))];\n if(PROMPTS?.allStepsIn1Screen) {\n // PROMPTS.freezedSteps = document.createElement('div');\n PROMPTS.progressSteps = [\n thisClass.i18n?.criteria??'Criteria',\n thisClass.i18n?.contact??'Contact',\n thisClass.i18n?.preview??'Preview'\n ];\n \n /** Contact Step */\n var step2 = document.createElement('form'), fields = PROMPTS.secondStep(thisClass), step, foot;\n step2.action=thisClass.ajaxUrl;step2.type='post';step2.classList.add('popup_body', 'popup_body__row');step2.dataset.id = 'contact';\n\n /** Heading fields */\n var heading = document.createElement('div');heading.classList.add('popup_step', 'popup_step__heading');heading.dataset.step = 0;\n heading.innerHTML = `${thisClass.i18n?.criteriainfo??'Contact Information'}
${thisClass.i18n?.criteriainfosubtitle??'We are available 24/7 to answer your questions?'}
`;\n step2.appendChild(heading);\n\n /** Fields field */\n fields.forEach((field, i) => {\n step = PROMPTS.do_field(field);i++;\n step.dataset.step = field.fieldID;\n // field.fieldID++;\n step2.appendChild(step);\n PROMPTS.totalSteps=(i+1);\n });\n \n /** Preview Step */\n // foot.parentElement?.insertBefore(node, foot);\n var step3 = document.createElement('form');step3.action = thisClass.ajaxUrl;\n step3.type='post';step3.classList.add('popup_body', 'popup_body__row');step3.dataset.id = 'preview';\n var heading = document.createElement('div');heading.classList.add('popup_step', 'popup_step__heading');heading.dataset.step = 0;\n heading.innerHTML = `${thisClass.i18n?.criteriainfo??'Review Information'}
${thisClass.i18n?.criteriainfosubtitle??'We are available 24/7 to answer your questions?'}
`;\n step3.appendChild(heading);\n\n var foot = template?.querySelector('.popup_foot');\n if(foot) {\n foot.parentElement.insertBefore(step2, foot);\n foot.parentElement.insertBefore(step3, foot);\n // setTimeout(() => {}, 200);\n }\n } else {\n PROMPTS.progressSteps = [...new Set(\n PROMPTS.lastJson.product.custom_fields.map((row, i)=>(row.steptitle=='')?(i+1):(\n `${(row?.stepicon)?`${row.stepicon}
`:``}\n ${row.steptitle}`\n ))\n )];\n }\n thisClass.Swal.update({\n progressSteps: PROMPTS.progressSteps,\n currentProgressStep: 0,\n html: html.innerHTML\n });\n PROMPTS.lastJson = thisClass.lastJson;\n if(thisClass.lastJson?.product && thisClass.lastJson.product?.toast) {\n thisClass.toastify({\n text: thisClass.lastJson.product.toast.replace(/(<([^>]+)>)/gi, \"\"),\n duration: 45000, close: true,\n gravity: \"top\", // `top` or `bottom`\n position: \"left\", // `left`, `center` or `right`\n stopOnFocus: true, // Prevents dismissing of toast on hover\n style: {background: 'linear-gradient(to right, #4b44bc, #8181be)'},\n onClick: () => {} // Callback after click\n }).showToast();\n }\n setTimeout(() => {\n var fields = PROMPTS.get_data(thisClass);\n var voice = fields.find((row)=>row.type=='voice');\n if(voice) {\n voice.cost = (voice.cost == '')?0:voice.cost;\n // voiceRecord.meta_tag = voice.steptitle;\n // voiceRecord.duration = parseFloat((voice.duration == '')?'20':voice.duration);\n // popupCart.addAdditionalPrice(voice.steptitle, parseFloat(voice.cost));\n }\n PROMPTS.init_events(thisClass);\n }, 300);\n }\n },\n change_submit_btn_text: (type) => {\n document.querySelectorAll('.popup_foot .button[data-react=\"continue\"] > span:first-child').forEach((span) => {\n switch(type.toLowerCase()) {\n case 'continue':\n span.innerHTML = PROMPTS.i18n?.continue??'Continue';\n span.parentElement.parentElement.dataset.current = 'continue';\n break;\n case 'booknow':\n span.innerHTML = PROMPTS.i18n?.booknow??'Book Now';\n span.parentElement.parentElement.dataset.current = 'booknow';\n break;\n case 'get_quotation':\n span.innerHTML = PROMPTS.i18n?.get_quotation??'Get Quotation';\n span.parentElement.parentElement.dataset.current = 'get_quotation';\n break;\n default:\n break;\n }\n });\n },\n filtering_dataset: (thisClass) => {\n PROMPTS.lastJson.product.custom_fields.forEach((field, i) => {\n if(field?.type == 'select' && field?.options) {\n if(\n field.options[0] && field.options[0]?.cost && field.options[0].cost != ''\n ) {\n PROMPTS.lastJson.product.custom_fields[i].options = [\n {\n image: '', thumb: '',\n next: false, cost: '',\n label: PROMPTS.i18n?.selecturservice??'Select Your Service'\n },\n ...field.options\n ];\n }\n }\n });\n }\n};\nexport default PROMPTS;","class Zip {\n constructor(thisClass) {\n this.setup_hooks(thisClass);\n }\n setup_hooks(thisClass) {\n this.init_zip_picker(thisClass);\n }\n /**\n * Asks user for give her location only once.\n * Asks from a hompage button or listing list screen.\n */\n init_zip_picker(thisClass) {\n const zipClass = this;var form, html, config, json, card, node, error;\n document.querySelectorAll(zipClass.classes_zip_picker()).forEach((el)=>{\n el.dataset.handled = true;\n el.addEventListener('click', (event) => {\n event.preventDefault();\n zipClass.launch_zip_prompts(thisClass);\n });\n });\n if (thisClass.config?.showPrompts) {\n setTimeout(() => {\n zipClass.launch_zip_prompts(thisClass);\n }, 5000);\n }\n }\n classes_zip_picker() {\n var classes = ['.elementor-element-3ba3ce1 .elementor-icon-list-item', '.custom_zip_btn'];\n return classes.map((clas) => clas + ':not([data-handled])').join(', ');\n }\n zip_template(thisClass) {\n const html = `\n ${\n thisClass.i18n?.findsupersrvcinarea??'Simply Enter Your Location or Zip Code'\n }
\n \n `;\n return html;\n }\n launch_zip_prompts(thisClass) {\n const zipClass = this;\n var html = zipClass.zip_template(thisClass);\n thisClass.Swal.fire({\n title: thisClass.i18n?.findsupersrvcinarea??'Discover Local Services',\n html: html, width: 600,\n showConfirmButton: false,\n showCancelButton: false,\n showCloseButton: true,\n allowOutsideClick: false,\n allowEscapeKey: true,\n // confirmButtonText: 'Generate',\n // cancelButtonText: 'Close',\n // confirmButtonColor: '#3085d6',\n // cancelButtonColor: '#d33',\n customClass: {popup: 'fwp-zip_popup'},\n // focusConfirm: true,\n // reverseButtons: true,\n // backdrop: `rgba(0,0,123,0.4) url(\"https://sweetalert2.github.io/images/nyan-cat.gif\") left top no-repeat`,\n // backdrop: `rgb(255 255 255)`,\n\n showLoaderOnConfirm: true,\n allowOutsideClick: false, // () => !Swal.isLoading(),\n \n // html: html,\n // footer: 'Why do I have this issue?',\n didOpen: async () => {\n const locationIcon = document.querySelector('.location-picker .icon-container');\n const locationIconFa = locationIcon.querySelector('.fas');\n const zipCodeResult = document.querySelector('.location-picker .zip-code');\n const findButton = document.querySelector('.location-picker .submit-button');\n const locateMe = document.querySelector('.location-locateme .locate-me');\n locationIcon?.addEventListener(\"click\", (event) => {\n event.preventDefault();\n // Check if geolocation is supported by the browser\n if(\"geolocation\" in navigator) {\n locationIconFa.classList.remove('fa-map-marker-alt');\n locationIconFa.classList.add('fa-spinner', 'fa-spin');\n navigator.geolocation.getCurrentPosition(async (position) => {\n try {\n // Get the user's latitude and longitude\n const { latitude, longitude } = position.coords;\n if(thisClass?.responsedZipCode) {\n zipCodeResult.value = thisClass?.responsedZipCode;\n // return;\n }\n const response = await fetch(\n `https://nominatim.openstreetmap.org/reverse?format=jsonv2&zoom=10&lat=${latitude}&lon=${longitude}`\n ).then((response) => response.json()).then((json) => {\n if(json?.address && json.address?.postcode) {\n const zipCode = json.address.postcode;\n thisClass.responsedZipCode = zipCode;\n zipCodeResult.value = zipCode;\n } else {\n throw new Error('ZIP Code not found')\n }\n }).catch ((error) => {\n console.error(error);\n thisClass.toastify({text: error, style: {background: \"linear-gradient(to right, rgb(222 66 75), rgb(249 144 150))\"}}).showToast();\n });\n } catch (error) {\n thisClass.toastify({text: error, style: {background: \"linear-gradient(to right, rgb(222 66 75), rgb(249 144 150))\"}}).showToast();\n console.error(error);\n }\n // replacing icon removing preloader\n locationIconFa.classList.add('fa-map-marker-alt');\n locationIconFa.classList.remove('fa-spinner', 'fa-spin');\n });\n } else {\n error = thisClass.i18n?.geonotsupport??'Geolocation is not supported by your browser';\n thisClass.toastify({text: error, style: {background: \"linear-gradient(to right, rgb(222 66 75), rgb(249 144 150))\"}}).showToast();\n }\n });\n findButton?.addEventListener(\"click\", (event) => {\n event.preventDefault();\n if(zipCodeResult.value?.trim() != '') {\n var formdata = new FormData();\n formdata.append('action', 'sospopsproject/ajax/update/zipcode');\n formdata.append('_zipcode', zipCodeResult.value);\n formdata.append('_nonce', thisClass.ajaxNonce);\n thisClass.sendToServer(formdata);\n } else {\n error = thisClass.i18n?.plsvalidzip??'Please input a valid zip code.';\n thisClass.toastify({text: error, style: {background: \"linear-gradient(to right, rgb(222 66 75), rgb(249 144 150))\"}}).showToast();\n }\n });\n locateMe?.addEventListener(\"click\", (event) => {\n locationIcon?.click();\n });\n },\n preConfirm: async (login) => {return thisClass.prompts.on_Closed(thisClass);}\n }).then(async (result) => {\n if( result.isConfirmed ) {\n if( typeof result.value === 'undefined') {\n thisClass.notify.fire( {\n icon: 'error',\n iconHtml: '',\n title: thisClass.i18n?.somethingwentwrong??'Something went wrong!',\n });\n } else if( thisClass.lastReqs.content_type == 'text') {\n // result.value.data \n thisClass.handle_completion();\n } else {\n const selectedImages = await thisClass.choose_image();\n }\n }\n })\n }\n}\n\nexport default Zip;","import './frontend'\n// import './frontend/map';\n// import './modules/dropzone';\n// import './modules/videojs';\n// import './modules/flatpickr';\n// import './modules/sweetalert2';\n// import './modules/datatables';\n// import './modules/chatgpt';\n// import './modules/youtube';\n\n// Styles\nimport '../sass/main.scss';\n\n// Images.\n// import '../img/cats.jpg';\n// import '../img/patterns/cover.jpg';\n\n// Icons\n// import '../icons/quicklogin.svg';\n","// extracted by mini-css-extract-plugin"],"sourceRoot":""}