@bootpay/client-js 5.0.0-rc.5 → 5.0.0-rc.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode('.bootpay-progress-background{position:fixed;display:block;background-color:transparent;inset:0;text-align:center;z-index:200000;white-space:nowrap}.bootpay-progress-background.blur-off{background-color:transparent}.bootpay-progress-background:before{display:inline-block;height:100%;content:" ";vertical-align:middle}.bootpay-progress-background .progress-message-window{display:inline-block;text-align:center;max-width:600px;border-radius:3px;width:100%;background-color:transparent;padding:0;vertical-align:middle}@media (min-width: 600px){.bootpay-progress-background .progress-message-window{padding:1rem}}.bootpay-progress-background .progress-message-window .bootpay-spinner{display:inline-block;width:50px;height:50px;border-radius:50%;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2);border-left:2px solid #ffffff;animation:spin 1s infinite linear}.bootpay-progress-background .progress-message-window .alfred-text{margin-top:1rem}.bootpay-progress-background .progress-message-window .alfred-text span.alfred-inner-text{font-weight:400;color:#eee}@keyframes spin{0%{transform:rotate(0);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}50%{transform:rotate(180deg);border-left:3px solid #ffffff;border-top:2px solid rgba(255,255,255,.4);border-right:2px solid rgba(255,255,255,.4);border-bottom:2px solid rgba(255,255,255,.4)}to{transform:rotate(360deg);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}}body.bootpay-open{position:fixed!important;inset:0;padding:0;margin:0;height:100vh!important;overflow:hidden!important;-webkit-overflow-scrolling:auto!important}body.bootpay-open .bootpay-payment-background{position:fixed;inset:0;display:block;text-align:center;background-color:#000000b3;z-index:9999}body.bootpay-open .bootpay-payment-background:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:relative;display:inline-block;vertical-align:middle}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{max-width:470px;height:90%}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:absolute;inset:0;border-radius:0!important}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{position:absolute;max-width:inherit;inset:0;height:100%}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%!important;height:100%!important;border-radius:0}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{position:absolute;display:none;top:-32px;right:4px;color:#fff;font-size:32px;text-decoration:none;outline:none;box-shadow:none;border:0;background-color:transparent}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#fff!important}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{top:1rem;right:16px;color:#000;padding:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#000!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:relative;width:400px;height:600px;display:none;background-color:#fff;border-radius:5px;overflow:hidden}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:absolute;inset:0;width:100%;height:100%;border-radius:0}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header{position:absolute;left:0;right:0;top:0;height:50px;color:#333;background-color:#fff;text-align:left}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body{position:absolute;inset:50px 0 72px;padding:1rem;text-align:left;font-size:14px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-item-name-id{font-size:16px;color:#888;font-weight:400!important;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-price-id{font-size:36px;color:#333;font-weight:700;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>.agree-text{position:absolute;bottom:1rem;left:0;right:0;color:#888;font-size:14px;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer{position:absolute;left:0;right:0;bottom:0;height:72px;padding:0 1rem;margin:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button{display:block;width:100%;padding:1rem;outline:none;border:none;background-color:#507cf3;border-radius:5px;color:#fff;font-size:16px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:hover,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:active{outline:none;box-shadow:none}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%;height:100%;display:none;border:0!important;outline:0!important;border-radius:0;box-shadow:none}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:0;height:0;border:0;outline:0;border-radius:0!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{border-radius:0}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{width:0;height:0;border:0;outline:0;border-radius:20px!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-up{animation:__bootpay-slide-up .3s linear}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-down{animation:__bootpay-slide-down .3s linear}body.bootpay-open .bootpay-payment-background>.bootpay-confirm-window>iframe{display:none;width:1px;height:1px;background:transparent;border:0!important;outline:0!important}.bootpay-close-btn{position:absolute;box-shadow:none;background-color:#fff;outline:0;z-index:10001;right:8px;top:8px;height:21px;width:21px;border:0!important;outline:none!important}@media (min-width: 600px){.bootpay-close-btn{right:4px;top:-32px;width:25px;height:25px;background:transparent;outline:none!important;border:0!important}}.bootpay-close-btn.active,.bootpay-close-btn:focus{outline:none!important;border:0!important}.bootpay-close-btn:before,.bootpay-close-btn:after{position:absolute;left:8px;top:2px;content:" ";height:24px;width:1px;background-color:#333}@media (min-width: 600px){.bootpay-close-btn:before,.bootpay-close-btn:after{height:23px;top:0;width:2px;background-color:#fff}}.bootpay-close-btn:before{transform:rotate(45deg)}.bootpay-close-btn:after{transform:rotate(-45deg)}@keyframes __bootpay-slide-up{0%{transform:translateY(150%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes __bootpay-slide-down{0%{transform:translate(0);opacity:1}to{transform:translateY(150%);opacity:0}}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode('.bootpay-progress-background{position:fixed;display:block;background-color:transparent;inset:0;text-align:center;z-index:200000;white-space:nowrap}.bootpay-progress-background.blur-off{background-color:transparent}.bootpay-progress-background:before{display:inline-block;height:100%;content:" ";vertical-align:middle}.bootpay-progress-background .progress-message-window{display:inline-block;text-align:center;max-width:600px;border-radius:3px;width:100%;background-color:transparent;padding:0;vertical-align:middle}@media (min-width: 600px){.bootpay-progress-background .progress-message-window{padding:1rem}}.bootpay-progress-background .progress-message-window .bootpay-spinner{display:inline-block;width:50px;height:50px;border-radius:50%;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2);border-left:2px solid #ffffff;animation:spin 1s infinite linear}.bootpay-progress-background .progress-message-window .alfred-text{margin-top:1rem}.bootpay-progress-background .progress-message-window .alfred-text span.alfred-inner-text{font-weight:400;color:#eee}@keyframes spin{0%{transform:rotate(0);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}50%{transform:rotate(180deg);border-left:3px solid #ffffff;border-top:2px solid rgba(255,255,255,.4);border-right:2px solid rgba(255,255,255,.4);border-bottom:2px solid rgba(255,255,255,.4)}to{transform:rotate(360deg);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}}body.bootpay-open{position:fixed!important;inset:0;padding:0;margin:0;height:100vh!important;overflow:hidden!important;-webkit-overflow-scrolling:auto!important}body.bootpay-open .bootpay-payment-background{position:fixed;inset:0;display:block;text-align:center;background-color:#000000b3;z-index:9999}body.bootpay-open .bootpay-payment-background:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:relative;display:inline-block;vertical-align:middle}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{max-width:470px;height:90%}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:absolute;inset:0;border-radius:0!important}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{position:absolute;max-width:inherit;inset:0;height:100%}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%!important;height:100%!important;border-radius:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.transparent{background:transparent!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{position:absolute;display:none;top:-32px;right:4px;color:#fff;font-size:32px;text-decoration:none;outline:none;box-shadow:none;border:0;background-color:transparent}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#fff!important}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{top:1rem;right:16px;color:#000;padding:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#000!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:relative;width:400px;height:600px;display:none;background-color:#fff;border-radius:5px;overflow:hidden}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:absolute;inset:0;width:100%;height:100%;border-radius:0}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header{position:absolute;left:0;right:0;top:0;height:50px;color:#333;background-color:#fff;text-align:left}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body{position:absolute;inset:50px 0 72px;padding:1rem;text-align:left;font-size:14px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-item-name-id{font-size:16px;color:#888;font-weight:400!important;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-price-id{font-size:36px;color:#333;font-weight:700;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>.agree-text{position:absolute;bottom:1rem;left:0;right:0;color:#888;font-size:14px;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer{position:absolute;left:0;right:0;bottom:0;height:72px;padding:0 1rem;margin:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button{display:block;width:100%;padding:1rem;outline:none;border:none;background-color:#507cf3;border-radius:5px;color:#fff;font-size:16px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:hover,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:active{outline:none;box-shadow:none}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%;height:100%;display:none;border:0!important;outline:0!important;border-radius:0;box-shadow:none}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:0;height:0;border:0;outline:0;border-radius:0!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{border-radius:0}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{width:0;height:0;border:0;outline:0;border-radius:20px!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-up{animation:__bootpay-slide-up .3s linear}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-down{animation:__bootpay-slide-down .3s linear}body.bootpay-open .bootpay-payment-background>.bootpay-confirm-window>iframe{display:none;width:1px;height:1px;background:transparent;border:0!important;outline:0!important}.bootpay-close-btn{position:absolute;box-shadow:none;background-color:#fff;outline:0;z-index:10001;right:8px;top:8px;height:21px;width:21px;border:0!important;outline:none!important}@media (min-width: 600px){.bootpay-close-btn{right:4px;top:-32px;width:25px;height:25px;background:transparent;outline:none!important;border:0!important}}.bootpay-close-btn.active,.bootpay-close-btn:focus{outline:none!important;border:0!important}.bootpay-close-btn:before,.bootpay-close-btn:after{position:absolute;left:8px;top:2px;content:" ";height:24px;width:1px;background-color:#333}@media (min-width: 600px){.bootpay-close-btn:before,.bootpay-close-btn:after{height:23px;top:0;width:2px;background-color:#fff}}.bootpay-close-btn:before{transform:rotate(45deg)}.bootpay-close-btn:after{transform:rotate(-45deg)}@keyframes __bootpay-slide-up{0%{transform:translateY(150%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes __bootpay-slide-down{0%{transform:translate(0);opacity:1}to{transform:translateY(150%);opacity:0}}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
2
2
  var __defProp = Object.defineProperty;
3
3
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
@@ -1080,7 +1080,7 @@ class SessionStorageManager extends StorageManager {
1080
1080
  }
1081
1081
  const SessionStorage = new SessionStorageManager();
1082
1082
  const name = "@bootpay/client-js";
1083
- const version = "5.0.0-rc.5";
1083
+ const version = "5.0.0-rc.6";
1084
1084
  const main = "dist/index.es.js";
1085
1085
  const types = "dist/src/index.d.ts";
1086
1086
  const styles = "dist/index.css";
@@ -1362,15 +1362,17 @@ class TemplateManager extends BootpayManager {
1362
1362
  */
1363
1363
  createTemplateHtml() {
1364
1364
  if (this.byId(this.$windowId) === null) {
1365
- const body = document.querySelector("body");
1366
- if (this.$present(body.className)) {
1367
- body.className = `${body.className} bootpay-open`;
1368
- } else {
1369
- body.className = "bootpay-open";
1370
- }
1371
1365
  document.body.insertAdjacentHTML("beforeend", this.$template);
1372
1366
  }
1373
1367
  }
1368
+ bodyOpen() {
1369
+ const body = document.querySelector("body");
1370
+ if (this.$present(body.className)) {
1371
+ body.className = `${body.className} bootpay-open`;
1372
+ } else {
1373
+ body.className = "bootpay-open";
1374
+ }
1375
+ }
1374
1376
  templateResize(el, resizeData) {
1375
1377
  const element = this.byId(el);
1376
1378
  if (element !== void 0) {
@@ -4675,8 +4677,9 @@ class TemplatePaymentManager extends TemplateManager {
4675
4677
  data2.application_id,
4676
4678
  data2.tk
4677
4679
  );
4678
- AlfredProgress.showProgress(this.message("startProgress"));
4679
4680
  this.createTemplateHtml();
4681
+ this.bodyOpen();
4682
+ AlfredProgress.showProgress(this.message("startProgress"));
4680
4683
  const encrypted = Resource.encryptParams(Resource.objectKeyToUnderscore(data2));
4681
4684
  const form = this.byId(this.$formId);
4682
4685
  form.innerHTML = `
@@ -4742,6 +4745,7 @@ class TemplatePaymentManager extends TemplateManager {
4742
4745
  );
4743
4746
  AlfredProgress.showProgress(this.message("startProgress"));
4744
4747
  this.createTemplateHtml();
4748
+ this.bodyOpen();
4745
4749
  const form = this.byId(this.$formId);
4746
4750
  form.method = "GET";
4747
4751
  form.action = url;
@@ -5712,8 +5716,6 @@ const Bootpay = {
5712
5716
  * 환경 설정
5713
5717
  * Comment by GOSOMI
5714
5718
  * @date: 2021-05-11
5715
- * @param env: string
5716
- * @param hostname: string | undefined
5717
5719
  * @returns void
5718
5720
  */
5719
5721
  setEnvironmentMode(env, hostname = void 0) {
@@ -5973,6 +5975,7 @@ class UserTokenTemplateManager extends TemplateManager {
5973
5975
  request(requestType, userToken) {
5974
5976
  return new Promise((resolve, reject) => {
5975
5977
  this.createTemplateHtml();
5978
+ this.bodyOpen();
5976
5979
  this.$event.bind(resolve, reject);
5977
5980
  this.goiFrameUrl(
5978
5981
  "GET",
@@ -5992,6 +5995,7 @@ class UserTokenTemplateManager extends TemplateManager {
5992
5995
  addCard(userToken) {
5993
5996
  return new Promise((resolve, reject) => {
5994
5997
  this.createTemplateHtml();
5998
+ this.bodyOpen();
5995
5999
  this.$event.bind(resolve, reject);
5996
6000
  this.goiFrameUrl(
5997
6001
  "GET",
@@ -6008,6 +6012,7 @@ class UserTokenTemplateManager extends TemplateManager {
6008
6012
  wallets(userToken) {
6009
6013
  return new Promise((resolve, reject) => {
6010
6014
  this.createTemplateHtml();
6015
+ this.bodyOpen();
6011
6016
  this.$event.bind(resolve, reject);
6012
6017
  this.goiFrameUrl(
6013
6018
  "GET",
@@ -6028,6 +6033,7 @@ class UserTokenTemplateManager extends TemplateManager {
6028
6033
  destroyWallet(data2) {
6029
6034
  return new Promise((resolve, reject) => {
6030
6035
  this.createTemplateHtml();
6036
+ this.bodyOpen();
6031
6037
  this.$event.bind(resolve, reject);
6032
6038
  this.goiFrameUrl(
6033
6039
  "POST",
@@ -6051,6 +6057,7 @@ class UserTokenTemplateManager extends TemplateManager {
6051
6057
  createBiometricAuthenticate(biometricData) {
6052
6058
  return new Promise((resolve, reject) => {
6053
6059
  this.createTemplateHtml();
6060
+ this.bodyOpen();
6054
6061
  this.$event.bind(resolve, reject);
6055
6062
  this.goiFrameUrl(
6056
6063
  "POST",
@@ -6073,6 +6080,7 @@ class UserTokenTemplateManager extends TemplateManager {
6073
6080
  destroyBiometricAuthenticate(biometricData) {
6074
6081
  return new Promise((resolve, reject) => {
6075
6082
  this.createTemplateHtml();
6083
+ this.bodyOpen();
6076
6084
  this.$event.bind(resolve, reject);
6077
6085
  this.goiFrameUrl(
6078
6086
  "POST",
@@ -6094,6 +6102,7 @@ class UserTokenTemplateManager extends TemplateManager {
6094
6102
  requestWalletPayment(data2) {
6095
6103
  return new Promise((resolve, reject) => {
6096
6104
  this.createTemplateHtml();
6105
+ this.bodyOpen();
6097
6106
  this.$event.bind(resolve, reject);
6098
6107
  this.goiFrameUrl(
6099
6108
  "POST",
@@ -6570,7 +6579,7 @@ class OOpayTemplateManager extends TemplateManager {
6570
6579
  this.$oopayWindowId = "__bootpay-card-easy-window";
6571
6580
  this.$iFrameId = "__bootpay-card-easy-iframe";
6572
6581
  this.$windowId = "__bootpay-card-easy-container-window";
6573
- this.$additionalClass = Environment.isMobile() ? "" : "rounded-iframe";
6582
+ this.$additionalClass = Environment.isMobile() ? "transparent" : "rounded-iframe transparent";
6574
6583
  this.$template = this.template();
6575
6584
  this.$widgetStore = WidgetStore;
6576
6585
  }
@@ -6588,6 +6597,7 @@ class OOpayTemplateManager extends TemplateManager {
6588
6597
  const iframe = document.getElementById(this.$iFrameId);
6589
6598
  iframe == null ? void 0 : iframe.setAttribute("src", Environment.toWidget(`${url}`));
6590
6599
  iframe == null ? void 0 : iframe.style.setProperty("display", "block");
6600
+ this.bodyOpen();
6591
6601
  }
6592
6602
  addWallet() {
6593
6603
  this.createIFrame(`wallet/add/${this.$widgetStore.applicationId}`);
@@ -6644,6 +6654,7 @@ class ModalTemplateManager extends TemplateManager {
6644
6654
  iframe == null ? void 0 : iframe.setAttribute("src", url);
6645
6655
  iframe == null ? void 0 : iframe.classList.add("slide-up");
6646
6656
  iframe == null ? void 0 : iframe.style.setProperty("display", "block");
6657
+ this.bodyOpen();
6647
6658
  }
6648
6659
  destroy() {
6649
6660
  const iframe = document.getElementById(this.$iFrameId);
package/dist/index.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode('.bootpay-progress-background{position:fixed;display:block;background-color:transparent;inset:0;text-align:center;z-index:200000;white-space:nowrap}.bootpay-progress-background.blur-off{background-color:transparent}.bootpay-progress-background:before{display:inline-block;height:100%;content:" ";vertical-align:middle}.bootpay-progress-background .progress-message-window{display:inline-block;text-align:center;max-width:600px;border-radius:3px;width:100%;background-color:transparent;padding:0;vertical-align:middle}@media (min-width: 600px){.bootpay-progress-background .progress-message-window{padding:1rem}}.bootpay-progress-background .progress-message-window .bootpay-spinner{display:inline-block;width:50px;height:50px;border-radius:50%;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2);border-left:2px solid #ffffff;animation:spin 1s infinite linear}.bootpay-progress-background .progress-message-window .alfred-text{margin-top:1rem}.bootpay-progress-background .progress-message-window .alfred-text span.alfred-inner-text{font-weight:400;color:#eee}@keyframes spin{0%{transform:rotate(0);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}50%{transform:rotate(180deg);border-left:3px solid #ffffff;border-top:2px solid rgba(255,255,255,.4);border-right:2px solid rgba(255,255,255,.4);border-bottom:2px solid rgba(255,255,255,.4)}to{transform:rotate(360deg);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}}body.bootpay-open{position:fixed!important;inset:0;padding:0;margin:0;height:100vh!important;overflow:hidden!important;-webkit-overflow-scrolling:auto!important}body.bootpay-open .bootpay-payment-background{position:fixed;inset:0;display:block;text-align:center;background-color:#000000b3;z-index:9999}body.bootpay-open .bootpay-payment-background:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:relative;display:inline-block;vertical-align:middle}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{max-width:470px;height:90%}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:absolute;inset:0;border-radius:0!important}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{position:absolute;max-width:inherit;inset:0;height:100%}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%!important;height:100%!important;border-radius:0}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{position:absolute;display:none;top:-32px;right:4px;color:#fff;font-size:32px;text-decoration:none;outline:none;box-shadow:none;border:0;background-color:transparent}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#fff!important}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{top:1rem;right:16px;color:#000;padding:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#000!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:relative;width:400px;height:600px;display:none;background-color:#fff;border-radius:5px;overflow:hidden}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:absolute;inset:0;width:100%;height:100%;border-radius:0}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header{position:absolute;left:0;right:0;top:0;height:50px;color:#333;background-color:#fff;text-align:left}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body{position:absolute;inset:50px 0 72px;padding:1rem;text-align:left;font-size:14px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-item-name-id{font-size:16px;color:#888;font-weight:400!important;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-price-id{font-size:36px;color:#333;font-weight:700;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>.agree-text{position:absolute;bottom:1rem;left:0;right:0;color:#888;font-size:14px;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer{position:absolute;left:0;right:0;bottom:0;height:72px;padding:0 1rem;margin:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button{display:block;width:100%;padding:1rem;outline:none;border:none;background-color:#507cf3;border-radius:5px;color:#fff;font-size:16px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:hover,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:active{outline:none;box-shadow:none}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%;height:100%;display:none;border:0!important;outline:0!important;border-radius:0;box-shadow:none}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:0;height:0;border:0;outline:0;border-radius:0!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{border-radius:0}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{width:0;height:0;border:0;outline:0;border-radius:20px!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-up{animation:__bootpay-slide-up .3s linear}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-down{animation:__bootpay-slide-down .3s linear}body.bootpay-open .bootpay-payment-background>.bootpay-confirm-window>iframe{display:none;width:1px;height:1px;background:transparent;border:0!important;outline:0!important}.bootpay-close-btn{position:absolute;box-shadow:none;background-color:#fff;outline:0;z-index:10001;right:8px;top:8px;height:21px;width:21px;border:0!important;outline:none!important}@media (min-width: 600px){.bootpay-close-btn{right:4px;top:-32px;width:25px;height:25px;background:transparent;outline:none!important;border:0!important}}.bootpay-close-btn.active,.bootpay-close-btn:focus{outline:none!important;border:0!important}.bootpay-close-btn:before,.bootpay-close-btn:after{position:absolute;left:8px;top:2px;content:" ";height:24px;width:1px;background-color:#333}@media (min-width: 600px){.bootpay-close-btn:before,.bootpay-close-btn:after{height:23px;top:0;width:2px;background-color:#fff}}.bootpay-close-btn:before{transform:rotate(45deg)}.bootpay-close-btn:after{transform:rotate(-45deg)}@keyframes __bootpay-slide-up{0%{transform:translateY(150%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes __bootpay-slide-down{0%{transform:translate(0);opacity:1}to{transform:translateY(150%);opacity:0}}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Bootpay={})}(this,(function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,s=(e,r,i)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,o=(e,t,r)=>new Promise(((i,n)=>{var s=e=>{try{a(r.next(e))}catch(t){n(t)}},o=e=>{try{a(r.throw(e))}catch(t){n(t)}},a=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,o);a((r=r.apply(e,t)).next())}));const a={PLATFORM:{JS:1,ANDROID:2,IOS:3,REST:4},STORAGE_PREFIX:e=>`__bootpay_track_${e}__`},c=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),d=e=>{let t=!1;return t="string"==typeof e||Array.isArray(e)?0===e.length:null==e||u(e,"object")&&e.constructor===Object&&0===Object.keys(e).length,t},l=e=>!d(e),u=(e,t)=>typeof e===t;var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function m(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),r}var y={exports:{}};var f={exports:{}};const g=m(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var v;function _(){return v||(v=1,f.exports=(e=e||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==p&&p.crypto&&(r=p.crypto),!r)try{r=g}catch(f){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(f){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(f){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),s={},o=s.lib={},a=o.Base=function(){return{extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),c=o.WordArray=a.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,i=this.sigBytes,n=e.sigBytes;if(this.clamp(),i%4)for(var s=0;s<n;s++){var o=r[s>>>2]>>>24-s%4*8&255;t[i+s>>>2]|=o<<24-(i+s)%4*8}else for(var a=0;a<n;a+=4)t[i+a>>>2]=r[a>>>2];return this.sigBytes+=n,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(i());return new c.init(t,e)}}),d=s.enc={},l=d.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n<r;n++){var s=t[n>>>2]>>>24-n%4*8&255;i.push((s>>>4).toString(16)),i.push((15&s).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i+=2)r[i>>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new c.init(r,t/2)}},u=d.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n<r;n++){var s=t[n>>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(s))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new c.init(r,t)}},h=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},m=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,i=this._data,n=i.words,s=i.sigBytes,o=this.blockSize,a=s/(4*o),d=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,l=e.min(4*d,s);if(d){for(var u=0;u<d;u+=o)this._doProcessBlock(n,u);r=n.splice(0,d),i.sigBytes-=l}return new c.init(r,l)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=m.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new y.HMAC.init(e,r).finalize(t)}}});var y=s.algo={};return s}(Math),e)),f.exports;var e}y.exports=_().enc.Utf8;const w=h(y.exports);var b={exports:{}};!function(e,t){var r;e.exports=(r=_(),function(){var e=r,t=e.lib.WordArray;function i(e,r,i){for(var n=[],s=0,o=0;o<r;o++)if(o%4){var a=i[e.charCodeAt(o-1)]<<o%4*2|i[e.charCodeAt(o)]>>>6-o%4*2;n[s>>>2]|=a<<24-s%4*8,s++}return t.create(n,s)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,i=this._map;e.clamp();for(var n=[],s=0;s<r;s+=3)for(var o=(t[s>>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<r;a++)n.push(i.charAt(o>>>6*(3-a)&63));var c=i.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var s=0;s<r.length;s++)n[r.charCodeAt(s)]=s}var o=r.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return i(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64)}(b);var $=b.exports;const E=h($);class k{$blank(e){return d(e)}$present(e){return!this.$blank(e)}$type(e,t){return u(e,t)}$uuid(){return c()}$encrypt(e){return this.$type(e,"object")&&(e=JSON.stringify(e)),E.stringify(w.parse(e))}$decrypt(e){return w.stringify(E.parse(e))}getUserAgent(){return window.navigator.userAgent}}const P=1,I=2,S=3,T=4,O={level:S,setLogLevel(e){this.level=e},messageStringify(e,t){try{return`${e}: ${u(t,"object")?JSON.stringify(t):t}`}catch(r){console.error(`log parse error: ${r}`)}},debug(e,t){this.level<=P&&console.log(this.messageStringify(e,t))},info(e,t){this.level<=I&&console.info(this.messageStringify(e,t))},warn(e,t){this.level<=S&&console.warn(this.messageStringify(e,t))},error(e,t){this.level<=T&&console.error(this.messageStringify(e,t))}};class x extends k{constructor(){super(),this.$storage={}}get(e){let t="";try{t=window.localStorage.getItem(e)}catch(r){t=this.$storage[e]}return this.$present(t)?this.$decrypt(t):void 0}set(e,t){try{window.localStorage.setItem(e,this.$encrypt(t))}catch(r){this.$storage[e]=this.$encrypt(t)}return t}currentUserUUID(){const e=a.STORAGE_PREFIX("uuid"),t=this.get(e);return this.$blank(t)?this.set(e,this.$uuid()):t}setUUID(e){const t=a.STORAGE_PREFIX("uuid");return this.set(t,e)}getToJSON(e){const t=this.get(e);return this.$present(t)?this.caseMarshalToJson(t):t}setToJSON(e,t){return this.set(e,JSON.stringify(t)),t}caseMarshalToJson(e){try{return JSON.parse(e)}catch(t){return JSON.parse(e.replace(/\\\"/g,'"'))}}}const A=new class extends x{constructor(){super(),this.currentUserUUID()}currentSessionKey(){const e=Math.round((new Date).getTime()/1e3),t=a.STORAGE_PREFIX("session"),r=this.getToJSON(t);if(this.$blank(r)||r.time+1800<e){return this.setToJSON(t,{time:e,term:this.$blank(r)?-1:e-r.time,uuid:`${this.$uuid()}-${e}`}).uuid}return r.uuid}currentTimeTerm(){const e=a.STORAGE_PREFIX("session"),t=this.getToJSON(e);return this.$blank(t.term)?-1:t.term}currentTime(){const e=a.STORAGE_PREFIX("session"),t=this.getToJSON(e);return this.$blank(t.time)?-1:t.time}setTime(e){const t=Math.round((new Date).getTime()/1e3),r=a.STORAGE_PREFIX("session"),i=this.getToJSON(r),n=this.$blank(i)?{time:e>0?e:t,term:e>0?t-e:-1,uuid:`${this.$uuid()}-${t}`}:i;n.time=e,this.setToJSON(r,n)}generateKey(){return`${this.$uuid()}-${(new Date).getTime()}`}setUser(e){return this.set(a.STORAGE_PREFIX("user"),void 0===e?void 0:JSON.stringify(e)),e}getUser(){try{return JSON.parse(this.get(a.STORAGE_PREFIX("user")))}catch(e){return void O.error("User Storage",`사용자 정보를 추출하는데 실패하였습니다. [ ${e.message} ]`)}}},R="5.0.0-rc.5",U={mode:"production",locale:"ko",isSetLocale:!1,packageVersion:R,applicationId:"",API_URL:{development:"https://dev-api.bootpay.co.kr/v2",stage:"https://stage-api.bootpay.co.kr/v2",production:"https://api.bootpay.co.kr/v2"},ANALYTICS_URL:{development:"https://dev-analytics.bootpay.co.kr",stage:"https://stage-analytics.bootpay.co.kr",production:"https://analytics.bootpay.co.kr"},DOOR_URL:{development:"https://door-dev.bootpay.co.kr",stage:"https://door-stage.bootpay.co.kr",production:"https://door.bootpay.co.kr"},WIDGET_URL:{development:"https://dev-widget.bootpay.co.kr",stage:"https://stage-widget.bootpay.co.kr",production:"https://widget.bootpay.co.kr"},sdkNames:{android:100,android_react_native:101,android_flutter:102,android_unity:103,ios:200,ios_react_native:201,ios_flutter:202,ios_unity:203,ios_objc:204,ios_swift_ui:205,mac_swift:206,mac_flutter:207},sdkVersion:"",sdkName:0,set(e){this.mode=e},setApplicationId(e){return this.applicationId=e,this.currentApplicationId(void 0)},setLocale(e){this.locale=e,this.isSetLocale=!0},currentApplicationId(e=void 0){return void 0===e?this.applicationId:e},setDevelopmentHost(e){this.API_URL.development=this.API_URL.development.replace(/dev-api.bootpay.co.kr\/v2/gi,e)},setVersion(e,t,r=void 0){this.sdkName=void 0===this.sdkNames[t]?0:this.sdkNames[t],this.sdkVersion=e,this.packageVersion=void 0===r||""===r?R:r},toApi(e){return[this.API_URL[this.mode],e].join("/")},toDoor(e){return[this.DOOR_URL[this.mode],e].join("/")},toWidget(e){return[this.WIDGET_URL[this.mode],e].join("/")},isMobile(){if("undefined"==typeof window)return!1;const e=window.navigator.userAgent||window.navigator.vendor;return/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/.test(e)},isMobileSafari(){if("undefined"==typeof window)return!1;const e=window.navigator.userAgent;return(e.match(/iPad/i)||e.match(/iPhone/i))&&!e.match(/CriOS/i)},toAnalytics(e){return[this.ANALYTICS_URL[this.mode],e].join("/")}};class D extends Error{constructor(e){super(),this.name="BootpayEventError",this.eventMessage=e}}const B={__BOOTPAY_NAMESPACE:{},isBind:!1,initialize(){this.isBind||("undefined"!=typeof window&&(window.addBootpayEventListener=this.on,window.removeBootpayEventListener=this.off,window.resetBootpayEventListener=function(e,t,r){this.removeBootpayEventListener(e).addBootpayEventListener(e,t,r)}),"undefined"!=typeof document&&(document.addBootpayEventListener=this.on,document.removeBootpayEventListener=this.off,document.resetBootpayEventListener=function(e,t,r){this.removeBootpayEventListener(e).addBootpayEventListener(e,t,r)}),"undefined"!=typeof Element&&(Element.prototype.addBootpayEventListener=this.on,Element.prototype.removeBootpayEventListener=this.off,Element.prototype.resetBootpayEventListener=function(e,t,r){this.removeBootpayEventListener(e).addBootpayEventListener(e,t,r)}),this.isBind=!0)},on(e,t,r=void 0){return d(B.__BOOTPAY_NAMESPACE)&&(B.__BOOTPAY_NAMESPACE={}),this.addEventListener(e.split(".")[0],t,r||!1),B.__BOOTPAY_NAMESPACE[e]=t,this},off(e){return l(B.__BOOTPAY_NAMESPACE)&&l(B.__BOOTPAY_NAMESPACE[e])&&this.removeEventListener(e.split(".")[0],B.__BOOTPAY_NAMESPACE[e]),this}};class C extends k{constructor(){super(),this.$resolve=null,this.$reject=null,B.initialize()}reject(e){null!==this.$reject&&this.$reject(e)}resolve(e){null!==this.$resolve&&this.$resolve(e)}setCallbackFunction(e,t){this.$resolve=e,this.$reject=t}parseEvent(e){let t={};if(this.$present(e)&&this.$type(e,"string")){try{t=JSON.parse(e)}catch(r){O.info("json parsing failed",`data: ${e}, message: ${M(r)} JSON 파싱 형태가 아닌 이벤트 입니다.`)}return t.bootpay_event?(delete t.bootpay_event,t):null}return null}}const M=e=>"string"==typeof e?e.toUpperCase():e instanceof Error?e.message:e;class N extends k{constructor(){super(),this.$windowId="",this.$template=""}byId(e){return document.getElementById(e)}createTemplateHtml(){if(null===this.byId(this.$windowId)){const e=document.querySelector("body");this.$present(e.className)?e.className=`${e.className} bootpay-open`:e.className="bootpay-open",document.body.insertAdjacentHTML("beforeend",this.$template)}}templateResize(e,t){const r=this.byId(e);if(void 0!==r)for(let i in Object.keys(t)){let e=Object.keys(t)[i],n=t[e];this.$present(n)&&!String(n).match(/%/)&&(e.match(/width/)||e.match(/Width/)||e.match(/height/)||e.match(/Height/))&&(n=`${String(t[e]).replace(/px/gi,"")}px`),r.style.setProperty(e,n)}}}const F=new class extends N{constructor(){super(),this.$alfredId="bootpay-alfred-progress-id",this.$alfredTextId="__alfred-text-message__"}template(e){return`\n<div class="bootpay-progress-background" id="${this.$alfredId}" style="display: none;">\n<div class="progress-message-window">\n <div class="alfred-loading">\n <div class="bootpay-spinner"></div> \n </div>\n <div class="alfred-text">\n <span class="alfred-inner-text" id="${this.$alfredTextId}">${e}</span>\n </div>\n</div> \n</div>\n `}showProgress(e){this.$present(this.byId(this.$alfredId))?this.byId(this.$alfredTextId).innerText=e:document.body.insertAdjacentHTML("beforeend",this.template(e)),this.byId(this.$alfredId).style.setProperty("display","block")}hideProgress(){try{this.byId(this.$alfredId).outerHTML=""}catch(e){}}};var j={exports:{}},L=function(e,t){return function(){for(var r=new Array(arguments.length),i=0;i<r.length;i++)r[i]=arguments[i];return e.apply(t,r)}},W=L,H=Object.prototype.toString,q=function(e){return function(t){var r=H.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function z(e){return e=e.toLowerCase(),function(t){return q(t)===e}}function K(e){return Array.isArray(e)}function J(e){return void 0===e}var G=z("ArrayBuffer");function V(e){return null!==e&&"object"==typeof e}function Y(e){if("object"!==q(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var X=z("Date"),Q=z("File"),Z=z("Blob"),ee=z("FileList");function te(e){return"[object Function]"===H.call(e)}var re=z("URLSearchParams");function ie(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),K(e))for(var r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.call(null,e[n],n,e)}var ne=function(e){return function(t){return e&&t instanceof e}}("undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array)),se={isArray:K,isArrayBuffer:G,isBuffer:function(e){return null!==e&&!J(e)&&null!==e.constructor&&!J(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||H.call(e)===t||te(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&G(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:V,isPlainObject:Y,isUndefined:J,isDate:X,isFile:Q,isBlob:Z,isFunction:te,isStream:function(e){return V(e)&&te(e.pipe)},isURLSearchParams:re,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:ie,merge:function e(){var t={};function r(r,i){Y(t[i])&&Y(r)?t[i]=e(t[i],r):Y(r)?t[i]=e({},r):K(r)?t[i]=r.slice():t[i]=r}for(var i=0,n=arguments.length;i<n;i++)ie(arguments[i],r);return t},extend:function(e,t,r){return ie(t,(function(t,i){e[i]=r&&"function"==typeof t?W(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,i){e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r){var i,n,s,o={};t=t||{};do{for(n=(i=Object.getOwnPropertyNames(e)).length;n-- >0;)o[s=i[n]]||(t[s]=e[s],o[s]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:q,kindOfTest:z,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var i=e.indexOf(t,r);return-1!==i&&i===r},toArray:function(e){if(!e)return null;var t=e.length;if(J(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:ne,isFileList:ee},oe=se;function ae(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var ce=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(oe.isURLSearchParams(t))i=t.toString();else{var n=[];oe.forEach(t,(function(e,t){null!=e&&(oe.isArray(e)?t+="[]":e=[e],oe.forEach(e,(function(e){oe.isDate(e)?e=e.toISOString():oe.isObject(e)&&(e=JSON.stringify(e)),n.push(ae(t)+"="+ae(e))})))})),i=n.join("&")}if(i){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e},de=se;function le(){this.handlers=[]}le.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},le.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},le.prototype.forEach=function(e){de.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var ue=le,pe=se,he=se;function me(e,t,r,i,n){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n)}he.inherits(me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var ye=me.prototype,fe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){fe[e]={value:e}})),Object.defineProperties(me,fe),Object.defineProperty(ye,"isAxiosError",{value:!0}),me.from=function(e,t,r,i,n,s){var o=Object.create(ye);return he.toFlatObject(e,o,(function(e){return e!==Error.prototype})),me.call(o,e.message,t,r,i,n),o.name=e.name,s&&Object.assign(o,s),o};var ge=me,ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_e=se;var we,be,$e,Ee,ke=function(e,t){t=t||new FormData;var r=[];function i(e){return null===e?"":_e.isDate(e)?e.toISOString():_e.isArrayBuffer(e)||_e.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}return function e(n,s){if(_e.isPlainObject(n)||_e.isArray(n)){if(-1!==r.indexOf(n))throw Error("Circular reference detected in "+s);r.push(n),_e.forEach(n,(function(r,n){if(!_e.isUndefined(r)){var o,a=s?s+"."+n:n;if(r&&!s&&"object"==typeof r)if(_e.endsWith(n,"{}"))r=JSON.stringify(r);else if(_e.endsWith(n,"[]")&&(o=_e.toArray(r)))return void o.forEach((function(e){!_e.isUndefined(e)&&t.append(a,i(e))}));e(r,a)}})),r.pop()}else t.append(s,i(n))}(e),t};var Pe,Ie,Se,Te,Oe,xe,Ae,Re,Ue,De,Be,Ce,Me=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},Ne=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},Fe=function(e,t){return e&&!Me(t)?Ne(e,t):t};function je(){if(xe)return Oe;xe=1;var e=ge;function t(t){e.call(this,null==t?"canceled":t,e.ERR_CANCELED),this.name="CanceledError"}return se.inherits(t,e,{__CANCEL__:!0}),Oe=t}function Le(){if(De)return Ue;De=1;var e=se,t=function(){if(be)return we;be=1;var e=ge;return we=function(t,r,i){var n=i.config.validateStatus;i.status&&n&&!n(i.status)?r(new e("Request failed with status code "+i.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):t(i)}}(),r=function(){if(Ee)return $e;Ee=1;var e=se;return $e=e.isStandardBrowserEnv()?function(){return{write:function(t,r,i,n,s,o){var a=[];a.push(t+"="+encodeURIComponent(r)),e.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),e.isString(n)&&a.push("path="+n),e.isString(s)&&a.push("domain="+s),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()}(),i=ce,n=Fe,s=function(){if(Ie)return Pe;Ie=1;var e=se,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Pe=function(r){var i,n,s,o={};return r?(e.forEach(r.split("\n"),(function(r){if(s=r.indexOf(":"),i=e.trim(r.substr(0,s)).toLowerCase(),n=e.trim(r.substr(s+1)),i){if(o[i]&&t.indexOf(i)>=0)return;o[i]="set-cookie"===i?(o[i]?o[i]:[]).concat([n]):o[i]?o[i]+", "+n:n}})),o):o}}(),o=function(){if(Te)return Se;Te=1;var e=se;return Se=e.isStandardBrowserEnv()?function(){var t,r=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function n(e){var t=e;return r&&(i.setAttribute("href",t),t=i.href),i.setAttribute("href",t),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return t=n(window.location.href),function(r){var i=e.isString(r)?n(r):r;return i.protocol===t.protocol&&i.host===t.host}}():function(){return function(){return!0}}()}(),a=ve,c=ge,d=je(),l=Re?Ae:(Re=1,Ae=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""});return Ue=function(u){return new Promise((function(p,h){var m,y=u.data,f=u.headers,g=u.responseType;function v(){u.cancelToken&&u.cancelToken.unsubscribe(m),u.signal&&u.signal.removeEventListener("abort",m)}e.isFormData(y)&&e.isStandardBrowserEnv()&&delete f["Content-Type"];var _=new XMLHttpRequest;if(u.auth){var w=u.auth.username||"",b=u.auth.password?unescape(encodeURIComponent(u.auth.password)):"";f.Authorization="Basic "+btoa(w+":"+b)}var $=n(u.baseURL,u.url);function E(){if(_){var e="getAllResponseHeaders"in _?s(_.getAllResponseHeaders()):null,r={data:g&&"text"!==g&&"json"!==g?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:e,config:u,request:_};t((function(e){p(e),v()}),(function(e){h(e),v()}),r),_=null}}if(_.open(u.method.toUpperCase(),i($,u.params,u.paramsSerializer),!0),_.timeout=u.timeout,"onloadend"in _?_.onloadend=E:_.onreadystatechange=function(){_&&4===_.readyState&&(0!==_.status||_.responseURL&&0===_.responseURL.indexOf("file:"))&&setTimeout(E)},_.onabort=function(){_&&(h(new c("Request aborted",c.ECONNABORTED,u,_)),_=null)},_.onerror=function(){h(new c("Network Error",c.ERR_NETWORK,u,_,_)),_=null},_.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",t=u.transitional||a;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),h(new c(e,t.clarifyTimeoutError?c.ETIMEDOUT:c.ECONNABORTED,u,_)),_=null},e.isStandardBrowserEnv()){var k=(u.withCredentials||o($))&&u.xsrfCookieName?r.read(u.xsrfCookieName):void 0;k&&(f[u.xsrfHeaderName]=k)}"setRequestHeader"in _&&e.forEach(f,(function(e,t){void 0===y&&"content-type"===t.toLowerCase()?delete f[t]:_.setRequestHeader(t,e)})),e.isUndefined(u.withCredentials)||(_.withCredentials=!!u.withCredentials),g&&"json"!==g&&(_.responseType=u.responseType),"function"==typeof u.onDownloadProgress&&_.addEventListener("progress",u.onDownloadProgress),"function"==typeof u.onUploadProgress&&_.upload&&_.upload.addEventListener("progress",u.onUploadProgress),(u.cancelToken||u.signal)&&(m=function(e){_&&(h(!e||e&&e.type?new d:e),_.abort(),_=null)},u.cancelToken&&u.cancelToken.subscribe(m),u.signal&&(u.signal.aborted?m():u.signal.addEventListener("abort",m))),y||(y=null);var P=l($);P&&-1===["http","https","file"].indexOf(P)?h(new c("Unsupported protocol "+P+":",c.ERR_BAD_REQUEST,u)):_.send(y)}))}}var We=se,He=function(e,t){pe.forEach(e,(function(r,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[i])}))},qe=ge,ze=ke,Ke={"Content-Type":"application/x-www-form-urlencoded"};function Je(e,t){!We.isUndefined(e)&&We.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Ge,Ve={transitional:ve,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Ge=Le()),Ge),transformRequest:[function(e,t){if(He(t,"Accept"),He(t,"Content-Type"),We.isFormData(e)||We.isArrayBuffer(e)||We.isBuffer(e)||We.isStream(e)||We.isFile(e)||We.isBlob(e))return e;if(We.isArrayBufferView(e))return e.buffer;if(We.isURLSearchParams(e))return Je(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,i=We.isObject(e),n=t&&t["Content-Type"];if((r=We.isFileList(e))||i&&"multipart/form-data"===n){var s=this.env&&this.env.FormData;return ze(r?{"files[]":e}:e,s&&new s)}return i||"application/json"===n?(Je(t,"application/json"),function(e,t,r){if(We.isString(e))try{return(t||JSON.parse)(e),We.trim(e)}catch(i){if("SyntaxError"!==i.name)throw i}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Ve.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,n=!r&&"json"===this.responseType;if(n||i&&We.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(n){if("SyntaxError"===s.name)throw qe.from(s,qe.ERR_BAD_RESPONSE,this,null,this.response);throw s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ce?Be:(Ce=1,Be=null)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};We.forEach(["delete","get","head"],(function(e){Ve.headers[e]={}})),We.forEach(["post","put","patch"],(function(e){Ve.headers[e]=We.merge(Ke)}));var Ye,Xe,Qe=Ve,Ze=se,et=Qe;function tt(){return Xe?Ye:(Xe=1,Ye=function(e){return!(!e||!e.__CANCEL__)})}var rt=se,it=function(e,t,r){var i=this||et;return Ze.forEach(r,(function(r){e=r.call(i,e,t)})),e},nt=tt(),st=Qe,ot=je();function at(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ot}var ct,dt,lt=se,ut=function(e,t){t=t||{};var r={};function i(e,t){return lt.isPlainObject(e)&&lt.isPlainObject(t)?lt.merge(e,t):lt.isPlainObject(t)?lt.merge({},t):lt.isArray(t)?t.slice():t}function n(r){return lt.isUndefined(t[r])?lt.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function s(e){if(!lt.isUndefined(t[e]))return i(void 0,t[e])}function o(r){return lt.isUndefined(t[r])?lt.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function a(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return lt.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||n,i=t(e);lt.isUndefined(i)&&t!==a||(r[e]=i)})),r};function pt(){return dt?ct:(dt=1,ct={version:"0.27.2"})}var ht=pt().version,mt=ge,yt={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){yt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var ft={};yt.transitional=function(e,t,r){function i(e,t){return"[Axios v"+ht+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new mt(i(n," has been removed"+(t?" in "+t:"")),mt.ERR_DEPRECATED);return t&&!ft[n]&&(ft[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}};var gt,vt,_t,wt,bt,$t,Et=se,kt=ce,Pt=ue,It=function(e){return at(e),e.headers=e.headers||{},e.data=it.call(e,e.data,e.headers,e.transformRequest),e.headers=rt.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),rt.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||st.adapter)(e).then((function(t){return at(e),t.data=it.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return nt(t)||(at(e),t&&t.response&&(t.response.data=it.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},St=ut,Tt=Fe,Ot={assertOptions:function(e,t,r){if("object"!=typeof e)throw new mt("options must be an object",mt.ERR_BAD_OPTION_VALUE);for(var i=Object.keys(e),n=i.length;n-- >0;){var s=i[n],o=t[s];if(o){var a=e[s],c=void 0===a||o(a,s,e);if(!0!==c)throw new mt("option "+s+" must be "+c,mt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new mt("Unknown option "+s,mt.ERR_BAD_OPTION)}},validators:yt},xt=Ot.validators;function At(e){this.defaults=e,this.interceptors={request:new Pt,response:new Pt}}At.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=St(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&Ot.assertOptions(r,{silentJSONParsing:xt.transitional(xt.boolean),forcedJSONParsing:xt.transitional(xt.boolean),clarifyTimeoutError:xt.transitional(xt.boolean)},!1);var i=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));var s,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!n){var a=[It,void 0];for(Array.prototype.unshift.apply(a,i),a=a.concat(o),s=Promise.resolve(t);a.length;)s=s.then(a.shift(),a.shift());return s}for(var c=t;i.length;){var d=i.shift(),l=i.shift();try{c=d(c)}catch(u){l(u);break}}try{s=It(c)}catch(u){return Promise.reject(u)}for(;o.length;)s=s.then(o.shift(),o.shift());return s},At.prototype.getUri=function(e){e=St(this.defaults,e);var t=Tt(e.baseURL,e.url);return kt(t,e.params,e.paramsSerializer)},Et.forEach(["delete","get","head","options"],(function(e){At.prototype[e]=function(t,r){return this.request(St(r||{},{method:e,url:t,data:(r||{}).data}))}})),Et.forEach(["post","put","patch"],(function(e){function t(t){return function(r,i,n){return this.request(St(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}At.prototype[e]=t(),At.prototype[e+"Form"]=t(!0)}));var Rt=se,Ut=L,Dt=At,Bt=ut;var Ct=function e(t){var r=new Dt(t),i=Ut(Dt.prototype.request,r);return Rt.extend(i,Dt.prototype,r),Rt.extend(i,r),i.create=function(r){return e(Bt(t,r))},i}(Qe);Ct.Axios=Dt,Ct.CanceledError=je(),Ct.CancelToken=function(){if(vt)return gt;vt=1;var e=je();function t(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var r;this.promise=new Promise((function(e){r=e}));var i=this;this.promise.then((function(e){if(i._listeners){var t,r=i._listeners.length;for(t=0;t<r;t++)i._listeners[t](e);i._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){i.subscribe(e),t=e})).then(e);return r.cancel=function(){i.unsubscribe(t)},r},t((function(t){i.reason||(i.reason=new e(t),r(i.reason))}))}return t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},t.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},t.source=function(){var e;return{token:new t((function(t){e=t})),cancel:e}},gt=t}(),Ct.isCancel=tt(),Ct.VERSION=pt().version,Ct.toFormData=ke,Ct.AxiosError=ge,Ct.Cancel=Ct.CanceledError,Ct.all=function(e){return Promise.all(e)},Ct.spread=wt?_t:(wt=1,_t=function(e){return function(t){return e.apply(null,t)}}),Ct.isAxiosError=function(){if($t)return bt;$t=1;var e=se;return bt=function(t){return e.isObject(t)&&!0===t.isAxiosError}}(),j.exports=Ct,j.exports.default=Ct;const Mt=h(j.exports);var Nt,Ft={exports:{}},jt={exports:{}};function Lt(){return Nt||(Nt=1,function(e,t){var r;e.exports=(r=_(),function(e){var t=r,i=t.lib,n=i.WordArray,s=i.Hasher,o=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=o.MD5=s.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var i=t+r,n=e[i];e[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var s=this._hash.words,o=e[t+0],c=e[t+1],h=e[t+2],m=e[t+3],y=e[t+4],f=e[t+5],g=e[t+6],v=e[t+7],_=e[t+8],w=e[t+9],b=e[t+10],$=e[t+11],E=e[t+12],k=e[t+13],P=e[t+14],I=e[t+15],S=s[0],T=s[1],O=s[2],x=s[3];S=d(S,T,O,x,o,7,a[0]),x=d(x,S,T,O,c,12,a[1]),O=d(O,x,S,T,h,17,a[2]),T=d(T,O,x,S,m,22,a[3]),S=d(S,T,O,x,y,7,a[4]),x=d(x,S,T,O,f,12,a[5]),O=d(O,x,S,T,g,17,a[6]),T=d(T,O,x,S,v,22,a[7]),S=d(S,T,O,x,_,7,a[8]),x=d(x,S,T,O,w,12,a[9]),O=d(O,x,S,T,b,17,a[10]),T=d(T,O,x,S,$,22,a[11]),S=d(S,T,O,x,E,7,a[12]),x=d(x,S,T,O,k,12,a[13]),O=d(O,x,S,T,P,17,a[14]),S=l(S,T=d(T,O,x,S,I,22,a[15]),O,x,c,5,a[16]),x=l(x,S,T,O,g,9,a[17]),O=l(O,x,S,T,$,14,a[18]),T=l(T,O,x,S,o,20,a[19]),S=l(S,T,O,x,f,5,a[20]),x=l(x,S,T,O,b,9,a[21]),O=l(O,x,S,T,I,14,a[22]),T=l(T,O,x,S,y,20,a[23]),S=l(S,T,O,x,w,5,a[24]),x=l(x,S,T,O,P,9,a[25]),O=l(O,x,S,T,m,14,a[26]),T=l(T,O,x,S,_,20,a[27]),S=l(S,T,O,x,k,5,a[28]),x=l(x,S,T,O,h,9,a[29]),O=l(O,x,S,T,v,14,a[30]),S=u(S,T=l(T,O,x,S,E,20,a[31]),O,x,f,4,a[32]),x=u(x,S,T,O,_,11,a[33]),O=u(O,x,S,T,$,16,a[34]),T=u(T,O,x,S,P,23,a[35]),S=u(S,T,O,x,c,4,a[36]),x=u(x,S,T,O,y,11,a[37]),O=u(O,x,S,T,v,16,a[38]),T=u(T,O,x,S,b,23,a[39]),S=u(S,T,O,x,k,4,a[40]),x=u(x,S,T,O,o,11,a[41]),O=u(O,x,S,T,m,16,a[42]),T=u(T,O,x,S,g,23,a[43]),S=u(S,T,O,x,w,4,a[44]),x=u(x,S,T,O,E,11,a[45]),O=u(O,x,S,T,I,16,a[46]),S=p(S,T=u(T,O,x,S,h,23,a[47]),O,x,o,6,a[48]),x=p(x,S,T,O,v,10,a[49]),O=p(O,x,S,T,P,15,a[50]),T=p(T,O,x,S,f,21,a[51]),S=p(S,T,O,x,E,6,a[52]),x=p(x,S,T,O,m,10,a[53]),O=p(O,x,S,T,b,15,a[54]),T=p(T,O,x,S,c,21,a[55]),S=p(S,T,O,x,_,6,a[56]),x=p(x,S,T,O,I,10,a[57]),O=p(O,x,S,T,g,15,a[58]),T=p(T,O,x,S,k,21,a[59]),S=p(S,T,O,x,y,6,a[60]),x=p(x,S,T,O,$,10,a[61]),O=p(O,x,S,T,h,15,a[62]),T=p(T,O,x,S,w,21,a[63]),s[0]=s[0]+S|0,s[1]=s[1]+T|0,s[2]=s[2]+O|0,s[3]=s[3]+x|0},_doFinalize:function(){var t=this._data,r=t.words,i=8*this._nDataBytes,n=8*t.sigBytes;r[n>>>5]|=128<<24-n%32;var s=e.floor(i/4294967296),o=i;r[15+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),r[14+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,c=a.words,d=0;d<4;d++){var l=c[d];c[d]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});function d(e,t,r,i,n,s,o){var a=e+(t&r|~t&i)+n+o;return(a<<s|a>>>32-s)+t}function l(e,t,r,i,n,s,o){var a=e+(t&i|r&~i)+n+o;return(a<<s|a>>>32-s)+t}function u(e,t,r,i,n,s,o){var a=e+(t^r^i)+n+o;return(a<<s|a>>>32-s)+t}function p(e,t,r,i,n,s,o){var a=e+(r^(t|~i))+n+o;return(a<<s|a>>>32-s)+t}t.MD5=s._createHelper(c),t.HmacMD5=s._createHmacHelper(c)}(Math),r.MD5)}(jt)),jt.exports}var Wt,Ht={exports:{}},qt={exports:{}};function zt(){return Wt||(Wt=1,function(e,t){var r,i,n,s,o,a,c,d;e.exports=(d=_(),i=(r=d).lib,n=i.WordArray,s=i.Hasher,o=r.algo,a=[],c=o.SHA1=s.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],s=r[2],o=r[3],c=r[4],d=0;d<80;d++){if(d<16)a[d]=0|e[t+d];else{var l=a[d-3]^a[d-8]^a[d-14]^a[d-16];a[d]=l<<1|l>>>31}var u=(i<<5|i>>>27)+c+a[d];u+=d<20?1518500249+(n&s|~n&o):d<40?1859775393+(n^s^o):d<60?(n&s|n&o|s&o)-1894007588:(n^s^o)-899497514,c=o,o=s,s=n<<30|n>>>2,n=i,i=u}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+s|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(i+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=s._createHelper(c),r.HmacSHA1=s._createHmacHelper(c),d.SHA1)}(qt)),qt.exports}var Kt,Jt,Gt={exports:{}};function Vt(){return Jt||(Jt=1,function(e,t){var r,i,n,s,o,a,c,d;e.exports=(d=_(),zt(),Kt||(Kt=1,function(e,t){var r,i,n;e.exports=(i=(r=_()).lib.Base,n=r.enc.Utf8,void(r.algo.HMAC=i.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var r=e.blockSize,i=4*r;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var s=this._oKey=t.clone(),o=this._iKey=t.clone(),a=s.words,c=o.words,d=0;d<r;d++)a[d]^=1549556828,c[d]^=909522486;s.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))}(Gt)),Gt.exports,i=(r=d).lib,n=i.Base,s=i.WordArray,o=r.algo,a=o.MD5,c=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,i=this.cfg,n=i.hasher.create(),o=s.create(),a=o.words,c=i.keySize,d=i.iterations;a.length<c;){r&&n.update(r),r=n.update(e).finalize(t),n.reset();for(var l=1;l<d;l++)r=n.finalize(r),n.reset();o.concat(r)}return o.sigBytes=4*c,o}}),r.EvpKDF=function(e,t,r){return c.create(r).compute(e,t)},d.EvpKDF)}(Ht)),Ht.exports}var Yt,Xt={exports:{}};!function(e,t){var r;e.exports=(r=_(),Lt(),Vt(),Yt||(Yt=1,function(e,t){var r;e.exports=(r=_(),Vt(),void(r.lib.Cipher||function(e){var t=r,i=t.lib,n=i.Base,s=i.WordArray,o=i.BufferedBlockAlgorithm,a=t.enc;a.Utf8;var c=a.Base64,d=t.algo.EvpKDF,l=i.Cipher=o.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?_:g}return function(t){return{encrypt:function(r,i,n){return e(i).encrypt(t,r,i,n)},decrypt:function(r,i,n){return e(i).decrypt(t,r,i,n)}}}}()});i.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=t.mode={},p=i.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=u.CBC=function(){var t=p.extend();function r(t,r,i){var n,s=this._iv;s?(n=s,this._iv=e):n=this._prevBlock;for(var o=0;o<i;o++)t[r+o]^=n[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize;r.call(this,e,t,n),i.encryptBlock(e,t),this._prevBlock=e.slice(t,t+n)}}),t.Decryptor=t.extend({processBlock:function(e,t){var i=this._cipher,n=i.blockSize,s=e.slice(t,t+n);i.decryptBlock(e,t),r.call(this,e,t,n),this._prevBlock=s}}),t}(),m=(t.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,i=r-e.sigBytes%r,n=i<<24|i<<16|i<<8|i,o=[],a=0;a<i;a+=4)o.push(n);var c=s.create(o,i);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};i.BlockCipher=l.extend({cfg:l.cfg.extend({mode:h,padding:m}),reset:function(){var e;l.reset.call(this);var t=this.cfg,r=t.iv,i=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=i.createEncryptor:(e=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(i,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var y=i.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),f=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?s.create([1398893684,1701076831]).concat(r).concat(t):t).toString(c)},parse:function(e){var t,r=c.parse(e),i=r.words;return 1398893684==i[0]&&1701076831==i[1]&&(t=s.create(i.slice(2,4)),i.splice(0,4),r.sigBytes-=16),y.create({ciphertext:r,salt:t})}},g=i.SerializableCipher=n.extend({cfg:n.extend({format:f}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),s=n.finalize(t),o=n.cfg;return y.create({ciphertext:s,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,r,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(r,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=s.random(8));var n=d.create({keySize:t+r}).compute(e,i),o=s.create(n.words.slice(t),4*r);return n.sigBytes=4*t,y.create({key:n,iv:o,salt:i})}},_=i.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),encrypt:function(e,t,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,e.keySize,e.ivSize);i.iv=n.iv;var s=g.encrypt.call(this,e,t,n.key,i);return s.mixIn(n),s},decrypt:function(e,t,r,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var n=i.kdf.execute(r,e.keySize,e.ivSize,t.salt);return i.iv=n.iv,g.decrypt.call(this,e,t,n.key,i)}})}()))}(Xt)),function(){var e=r,t=e.lib.BlockCipher,i=e.algo,n=[],s=[],o=[],a=[],c=[],d=[],l=[],u=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,i=0;for(t=0;t<256;t++){var m=i^i<<1^i<<2^i<<3^i<<4;m=m>>>8^255&m^99,n[r]=m,s[m]=r;var y=e[r],f=e[y],g=e[f],v=257*e[m]^16843008*m;o[r]=v<<24|v>>>8,a[r]=v<<16|v>>>16,c[r]=v<<8|v>>>24,d[r]=v,v=16843009*g^65537*f^257*y^16843008*r,l[m]=v<<24|v>>>8,u[m]=v<<16|v>>>16,p[m]=v<<8|v>>>24,h[m]=v,r?(r=y^e[e[e[g^y]]],i^=e[e[i]]):r=i=1}}();var m=[0,1,2,4,8,16,32,64,128,27,54],y=i.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,i=4*((this._nRounds=r+6)+1),s=this._keySchedule=[],o=0;o<i;o++)o<r?s[o]=t[o]:(d=s[o-1],o%r?r>6&&o%r==4&&(d=n[d>>>24]<<24|n[d>>>16&255]<<16|n[d>>>8&255]<<8|n[255&d]):(d=n[(d=d<<8|d>>>24)>>>24]<<24|n[d>>>16&255]<<16|n[d>>>8&255]<<8|n[255&d],d^=m[o/r|0]<<24),s[o]=s[o-r]^d);for(var a=this._invKeySchedule=[],c=0;c<i;c++){if(o=i-c,c%4)var d=s[o];else d=s[o-4];a[c]=c<4||o<=4?d:l[n[d>>>24]]^u[n[d>>>16&255]]^p[n[d>>>8&255]]^h[n[255&d]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,c,d,n)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,u,p,h,s),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,s,o,a){for(var c=this._nRounds,d=e[t]^r[0],l=e[t+1]^r[1],u=e[t+2]^r[2],p=e[t+3]^r[3],h=4,m=1;m<c;m++){var y=i[d>>>24]^n[l>>>16&255]^s[u>>>8&255]^o[255&p]^r[h++],f=i[l>>>24]^n[u>>>16&255]^s[p>>>8&255]^o[255&d]^r[h++],g=i[u>>>24]^n[p>>>16&255]^s[d>>>8&255]^o[255&l]^r[h++],v=i[p>>>24]^n[d>>>16&255]^s[l>>>8&255]^o[255&u]^r[h++];d=y,l=f,u=g,p=v}y=(a[d>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&p])^r[h++],f=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[p>>>8&255]<<8|a[255&d])^r[h++],g=(a[u>>>24]<<24|a[p>>>16&255]<<16|a[d>>>8&255]<<8|a[255&l])^r[h++],v=(a[p>>>24]<<24|a[d>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^r[h++],e[t]=y,e[t+1]=f,e[t+2]=g,e[t+3]=v},keySize:8});e.AES=t._createHelper(y)}(),r.AES)}(Ft);const Qt=h(Ft.exports);class Zt{constructor(){this.$http=Mt.create({timeout:6e4})}static encryptParams(e){u(e,"object")&&(e=JSON.stringify(e));let t=Qt.encrypt(e,c());return{payload:t.ciphertext.toString(E),token:`${t.key.toString(E)}##${t.iv.toString(E)}`}}static toUnderscore(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}static toCamelcase(e){return e.replace(/(\_[a-z])/g,(function(e){return e.toUpperCase().replace(/_/g,"")}))}static objectKeyToUnderscore(e){let t;return l(e)&&(Array.isArray(e)?(t=[],e.forEach((e=>{let r={};Object.keys(e).forEach((t=>{r[this.toUnderscore(t)]=e[t]})),t.push(r)}))):(t={},Object.keys(e).forEach((r=>{t[this.toUnderscore(r)]=e[r]})))),t}static objectKeyToCamel(e){let t;return l(e)&&(Array.isArray(e)?(t=[],e.forEach((e=>{let r={};Object.keys(e).forEach((t=>{r[this.toCamelcase(t)]=e[t]})),t.push(r)}))):(t={},Object.keys(e).forEach((r=>{u(e[r],"object")&&Object.keys(e[r]).length>0?t[this.toCamelcase(r)]=this.objectKeyToCamel(e[r]):t[this.toCamelcase(r)]=e[r]})))),t}static axiosMultipayConfigure(){Mt.defaults.headers.common["Content-Type"]="application/json",Mt.defaults.headers.common.Accept="application/json",Mt.interceptors.request.use((e=>(l(e.data),this.isHttpBodyUsedMethod(e.method)&&(e.data=Zt.encryptParams(Zt.objectKeyToUnderscore(e.data))),void 0!==e.headers&&l(e.headers.progress)&&delete e.headers.progress,e)),(e=>Promise.reject(e))),Mt.interceptors.response.use((e=>e),(function(e){if(l(e.response)){let t=e.response.data;return t.status=e.response.status,Promise.reject(t)}return Promise.reject(e)}))}static isHttpBodyUsedMethod(e){return["post","put"].indexOf(e)>-1}}Zt.axiosMultipayConfigure();const er=new class extends Zt{constructor(){super()}pollingStatus(e,t,r,i){return o(this,null,(function*(){try{const n=yield this.$http.get([e,"s",t].join("/"),{params:{application_id:r,tk:i}});return Promise.resolve(n)}catch(n){return Promise.reject(n)}}))}};const tr=new class extends C{constructor(){super(),this.$messageEventName="message.BootpayPaymentEvent",this.$eventPrefix="bootpay",this.$pollingInterval=void 0,this.$pollingData={applicationId:"",gatewayUrl:"",receiptId:"",transactionKey:""},this.$pollingEvent=er,this.pollingInterval=3e3,this.isDone=!1}bind(e,t){this.isDone=!1,this.setCallbackFunction(e,t),window.resetBootpayEventListener(this.$messageEventName,(e=>{const t=this.parseEvent(e.data);if(O.debug("event received",JSON.stringify(t)),l(t))switch(O.debug("event",t),t.event){case"error":case"cancel":return this.reject({event:t.event,pg_error_code:t.pg_error_code,error_code:t.error_code,message:t.message,payload:t.payload});case"confirm":return this.resolve({event:t.event,receipt_id:t.receipt_id,gateway_url:t.gateway_url,order_id:t.order_id});case"redirect":return nr.destroy(),void(location.href=t.url);case"moveRedirectUrl":nr.hidePaymentiFrame(),F.showProgress("결제 진행 중입니다. 잠시만 기다려주세요."),location.replace(`${t.url}?${t.parameters}`),setTimeout((()=>{nr.destroy()}),5e3);break;case"polling":return void 0!==this.$pollingData&&(this.$pollingData.receiptId=t.receipt_id,this.$pollingData.gatewayUrl=t.gateway_url),this.startPollingEvent();case"issued":case"done":if(!this.isDone)return this.isDone=!0,this.clearPollingEvent(),this.resolve(t);break;case"iFrameStyle":nr.iFrameSetStyle(t.styles);break;case"windowStyle":nr.windowStyle(t.styles);break;case"hideProgress":F.hideProgress();break;case"showProgress":F.showProgress(t.message);break;case"resize":nr.iFrameResize(t.resizeData);break;case"hidePayment":nr.closePopup(),nr.hidePaymentiFrame();break;case"showPayment":nr.showPaymentiFrame(!!this.$present(t.showCloseButton)&&t.showCloseButton);break;case"popup":nr.createPopupButton({gatewayUrl:t.url,receiptId:t.receipt_id,name:t.name,price:t.price});break;case"close":nr.destroy();break;default:return}}))}setDefaultPaymentData(e,t){void 0!==this.$pollingData&&(this.$pollingData.applicationId=e,this.$pollingData.transactionKey=t)}callBootpayDOMEvent(e,t=void 0){document.dispatchEvent(new CustomEvent([this.$eventPrefix,e].join(""),{detail:t}))}startPollingEvent(){this.$pollingInterval=setInterval((()=>o(this,null,(function*(){if(void 0!==this.$pollingData)try{const e=yield this.$pollingEvent.pollingStatus(this.$pollingData.gatewayUrl,this.$pollingData.receiptId,this.$pollingData.applicationId,this.$pollingData.transactionKey);let t={bootpay_event:!0,event:"",data:e.data};if(void 0!==e.data){if(O.debug("polling event",`receive data: ${JSON.stringify(t)}`),1===e.data.status)return t.event="done",window.postMessage(JSON.stringify(t),"*");if(5===e.data.status)return t.event="issued",window.postMessage(JSON.stringify(t),"*")}}catch(e){return this.reject({error_code:"RC_RECEIPT_POLLING_INVALID",message:"결제 상태 체크에 실패하였습니다."})}}))),this.pollingInterval)}clearPollingEvent(){void 0!==this.$pollingInterval&&clearInterval(this.$pollingInterval),this.$pollingInterval=void 0,this.$pollingData={applicationId:"",gatewayUrl:"",receiptId:"",transactionKey:""}}allClearEvent(){this.clearPollingEvent(),window.removeBootpayEventListener(this.$messageEventName)}};const rr=new class extends Zt{constructor(){super(),this.$session=A,this.$applicationId=void 0,this.$tk=void 0,this.$platformType=1,this.$receiptId=void 0}setTokenKey(e){this.$tk=e}setReceiptId(e){this.$receiptId=e}clearInstance(){this.$applicationId=void 0,this.$receiptId=void 0}send(e){try{if(l(this.$applicationId))return e.application_id=this.$applicationId,e.status=l(e.status)?e.status:1,e.version=R,e.tk=this.$tk,O.debug("send event",`${JSON.stringify(e)} 전송됨`),this.$http.post(U.toAnalytics("event"),e)}catch(t){return}}sendError(e){e.status=-1,this.send(e)}setApplicationId(e){this.$applicationId=e}sendCloseEvent(){if(!l(this.$receiptId))return O.debug("receipt_id","undefined receipt_id"),Promise.resolve();try{return this.$http.put(U.toApi(`close/${this.$receiptId}`))}catch(e){return Promise.reject(e)}}},ir={startProgress:{PAYMENT:{ko:"결제를 시작합니다",en:"Start Payment..."},CARD_SUBSCRIPTION:{ko:"카드정기결제를 시작합니다",en:"Automatic payment will start..."},AUTH:{ko:"본인인증을 시작합니다",en:"Authentication will start..."}},popupLocaleMessage:{message:{ko:"구매 내역에 동의하면 결제를 진행해주세요",en:"If you agree with the purchase details, please proceed with the payment."},button:{ko:"결제계속하기",en:"Continue"}},popupMessage:{message:{PAYMENT:{ko:"구매 내역에 동의하면 결제를 진행해주세요",en:"If you agree with the purchase details, please proceed with the payment"},CARD_SUBSCRIPTION:{ko:'카드 자동결제에 동의하면 "계속하기" 버튼을 눌러 진행해주세요',en:'If you agree to automatic card payment, press the "Continue" button to proceed'},AUTH:{ko:'본인인증에 동의하면 "계속하기" 버튼을 눌러 진행해주세요',en:'If you agree to authenticate yourself, press the "Continue" button to proceed'}},button:{PAYMENT:{ko:"결제계속하기",en:"Continue"},CARD_SUBSCRIPTION:{ko:"계속하기",en:"Continue"},AUTH:{ko:"계속하기",en:"Continue"}}},closeMessage:{PAYMENT:{ko:"결제창을 닫았습니다",en:"Payment window is closed"},CARD_SUBSCRIPTION:{ko:"자동 결제창을 닫았습니다",en:"Automatic Payment window is closed"},AUTH:{ko:"본인인증 창을 닫았습니다",en:"Authenticate window is closed"}},confirmNotYet:{PAYMENT:{ko:"결제 승인준비가 되지 않았습니다",en:"Payment approval not ready "},CARD_SUBSCRIPTION:{ko:"자동결제 승인준비가 되지 않았습니다",en:"Automatic Payment approval not ready"},AUTH:{ko:"본인인증 승인준비가 되지 않았습니다",en:"Authenticate approval not ready"}},notSelectPayment:{ko:"어떤 방법으로 결제할지 선택해주세요",en:"Please, do select payment."},termsNotAgree:{ko:"필수 약관을 모두 동의해주세요",en:"Please agree to all required terms and conditions"},notSelectOOPay:{ko:"간편결제로 결제하려면, 등록된 카드 혹은 계좌를 선택해주세요",en:"Please select a registered card or account to pay with Easy Payment"},getLocaleMessage:(e,t)=>{const r=e.split(".").reduce(((e,t)=>e[t]),ir);return l(r)&&l(r[t])?r[t]:r.ko}};const nr=new class extends N{constructor(){super(),this.mode="PAYMENT",this.modeApiUrl={PAYMENT:"request/payment",CARD_SUBSCRIPTION:"request/subscribe",AUTH:"request/authentication"},this.$formId="bootpay-form",this.$iFrameId="bootpay-iframe-id",this.$windowId="bootpay-window-id",this.$paymentWindowId="bootpay-payment-window-id",this.$confirmFormId="bootpay-confirm-form-id",this.$confirmIFrame="bootpay-confirm-iframe-id",this.$popupWindow="bootpay-popup-window-id",this.$closeButton="bootpay-close-btn",this.$popupItemNameId="bootpay-item-name-id",this.$popupPriceId="bootpay-price-id",this.$popup=void 0,this.$popupWatcher=void 0,this.$popupUrl=void 0,this.$env=U,this.$template=this.template()}template(){return`\n<div id="${this.$windowId}" class="bootpay-payment-background">\n <div class="bootpay-payment-window ${U.isMobile()?"__mobile":""}" id="${this.$paymentWindowId}">\n <button class="bootpay-close-btn" id="${this.$closeButton}" style="display: none;" onclick="Bootpay.dismiss()"></button> \n <form id="${this.$formId}" method="POST">\n </form> \n <iframe id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>\n <div class="bootpay-popup-window" id="${this.$popupWindow}">\n <div class="header">\n <button class="bootpay-close-btn" onclick="Bootpay.dismiss(true)"></button>\n </div>\n <div class="body">\n <h5 id="${this.$popupItemNameId}"></h5>\n <p class="price" id="${this.$popupPriceId}"></p> \n <div class="agree-text">${this.message("popupMessage.message")}</div>\n </div>\n <div class="footer">\n <button class="bootpay-button" onclick="Bootpay.readyToPopup()">\n ${this.message("popupMessage.button")}\n </button> \n </div>\n </div>\n </div>\n <div class="bootpay-confirm-window">\n <form id="${this.$confirmFormId}" method="POST">\n <input type="hidden" name="_method" value="put" /> \n </form>\n <iframe id="${this.$confirmIFrame}" name="${this.$confirmIFrame}"></iframe>\n </div> \n</div>\n `}templateReload(){O.debug("template reload","template reload!"),this.$template=this.template()}start(e,t="PAYMENT"){return o(this,null,(function*(){return new Promise(((r,i)=>{this.mode=t,this.templateReload(),tr.clearPollingEvent(),tr.bind(r,i),tr.setDefaultPaymentData(e.application_id,e.tk),F.showProgress(this.message("startProgress")),this.createTemplateHtml();const n=Zt.encryptParams(Zt.objectKeyToUnderscore(e)),s=this.byId(this.$formId);s.innerHTML=`\n <input type="hidden" name="payload" value="${n.payload}" />\n <input type="hidden" name="token" value="${n.token}" />\n `,s.action=this.$env.toApi(this.apiUrl()),this.$present(e.extra)&&e.extra.popup,s.target=this.$iFrameId,s.submit()}))}))}setConfirmFormUrl(e){const t=this.byId(this.$confirmIFrame),r=this.byId(this.$confirmFormId);t.style.setProperty("display","block"),r.target=this.$confirmIFrame,r.action=e}confirm(){return new Promise(((e,t)=>{tr.bind(e,t);const r=this.byId(this.$confirmFormId);if(this.$blank(r.action))throw new D({event:"error",error_code:"RC_CONFIRM_READY_NOT_YET",message:this.message("confirmNotYet")});r.submit()}))}startPaymentUrl(e,t="PAYMENT"){return o(this,null,(function*(){return new Promise(((r,i)=>{this.mode=t,this.templateReload(),tr.clearPollingEvent(),tr.bind(r,i),tr.setDefaultPaymentData(null,null),F.showProgress(this.message("startProgress")),this.createTemplateHtml();const n=this.byId(this.$formId);n.method="GET",n.action=e,n.target=this.$iFrameId,n.submit()}))}))}createPopupButton(e){F.hideProgress(),this.hidePaymentiFrame(),this.showPopupMessage(e),this.$present(e.gatewayUrl)&&(this.$popupUrl=`${e.gatewayUrl}?popup=1`,rr.setReceiptId(e.receiptId))}readyToPopup(e=void 0){this.hidePopupMessage(),this.closePopup();this.$popup=window.open(this.getPopupUrl(e),"BootPayPopupInstance","width=750,height=500,top=0,left=0,scrollbars=yes,directories=no, status=no, menubar=no, fullscreen=no"),this.$popupWatcher=setInterval((()=>o(this,null,(function*(){if(void 0===this.$popup||this.$popup.closed){try{clearInterval(this.$popupWatcher),yield rr.sendCloseEvent()}catch(e){O.debug("popup",M(e))}return this.$popupUrl=void 0,tr.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:this.message("closeMessage")})}}))),500),this.bindParentEventOnPopup()}closePopup(){if(void 0!==this.$popupWatcher)try{clearInterval(this.$popupWatcher),O.debug("close popup","clear popup interval")}catch(e){O.info("clear popup watcher",M(e))}if(void 0!==this.$popup&&!this.$popup.closed)try{this.$popup.close(),O.debug("close popup","close popup instance")}catch(e){O.info("popup destroy",M(e))}}getPopupUrl(e){return this.$present(e)?e:this.$present(this.$popupUrl)?this.$popupUrl:"about:blank"}bindParentEventOnPopup(){let e="beforeunload.BootpayReloadWatcher";U.isMobileSafari()&&(e="pagehide.BootpayReloadWatcher"),window.resetBootpayEventListener(e,(()=>{if(void 0!==this.$popup&&!this.$popup.closed)try{this.$popup.close()}catch(e){O.info("popup destroy",M(e))}}))}showPaymentiFrame(e=!1){const t=this.byId(this.$iFrameId),r=this.byId(this.$closeButton);void 0!==t&&t.style.setProperty("display","block"),void 0!==r&&e&&r.style.setProperty("display","inline-block")}showPopupMessage(e){const t=this.byId(this.$popupWindow),r=this.byId(this.$popupItemNameId),i=this.byId(this.$popupPriceId);void 0!==t&&t.style.setProperty("display","block"),void 0!==r&&(r.innerText=e.name),void 0!==i&&(parseFloat(e.price)>0?i.innerText=String(e.price):i.remove())}hidePopupMessage(){this.byId(this.$popupWindow).style.setProperty("display","none")}destroy(){this.$present(document.querySelector("body").className)&&(document.querySelector("body").className=document.querySelector("body").className.replace(/bootpay-open/gi,"")),this.$present(this.byId(this.$windowId))&&(this.byId(this.$windowId).outerHTML=""),document.body.classList.remove("bootpay-open"),F.hideProgress(),this.closePopup(),tr.allClearEvent(),rr.clearInstance(),setTimeout((()=>tr.callBootpayDOMEvent("close")),300)}iFrameResize(e){const t=this.byId(this.$iFrameId);if(void 0!==t)for(let r in Object.keys(e)){let i=Object.keys(e)[r],n=e[i];this.$present(n)&&!String(n).match(/%/)&&(i.match(/width/)||i.match(/Width/)||i.match(/height/)||i.match(/Height/))&&(n=`${String(e[i]).replace(/px/gi,"")}px`),String(n).match(/%/)&&!this.byId(this.$paymentWindowId).className.match(/w-100/)&&(this.byId(this.$paymentWindowId).className+=" w-100"),t.style.setProperty(i,n)}}iFrameSetStyle(e){O.debug("change style",e);const t=this.byId(this.$iFrameId);for(let i in Object.keys(e)){let n=Object.keys(e)[i];try{O.debug(n,e[n]),t.style.setProperty(n,e[n])}catch(r){O.warn("iframe style",null==r?void 0:r.message)}}}windowStyle(e){O.debug("change style",e);const t=this.byId(this.$paymentWindowId);for(let i in Object.keys(e)){let n=Object.keys(e)[i];try{O.debug(n,e[n]),t.style.setProperty(n,e[n])}catch(r){O.warn("iframe style",null==r?void 0:r.message)}}}hidePaymentiFrame(){const e=this.byId(this.$iFrameId),t=this.byId(this.$closeButton);void 0!==e&&e.style.setProperty("display","none"),void 0!==t&&t.style.setProperty("display","none")}message(e){return ir.getLocaleMessage(`${e}.${this.mode}`,U.locale)}moveToUrl(e){const t=this.byId(this.$iFrameId);this.hidePaymentiFrame(),t.removeAttribute("style"),this.iFrameResize({width:U.isMobile()?"100%":400,height:U.isMobile()?"100%":700}),t.style.setProperty("display","block"),t.src=e}apiUrl(){return this.modeApiUrl[this.mode]}},sr=class e extends k{constructor(){super(),this.$session=A,this.$logger=O,this.$event=rr,this.platformType=a.PLATFORM.JS,this.$transactionKey="",this.extra={},this.browserBootpayFilter={instagram:/Instagram/i,kakaotalk:/KAKAOTALK/i,facebook:/FBAV/i,naver:/NAVER/i,mobile_safari:/(iPhone|iPad|iPod)/,mobile_chrome:[/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/,/Chrome/]}}requestPayment(t){return o(this,null,(function*(){var r;void 0===(null==(r=t.extra)?void 0:r.locale)||U.isSetLocale||U.setLocale(t.extra.locale),this.$event.clearInstance(),this.generateTransactionKey(),t.application_id=U.currentApplicationId(t.application_id),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(t.application_id),this.$event.send({step:"start",msg:"결제 요청 시작",request:t}),t.sdk=!0,t.platform_type=this.platformType,t.ver=U.packageVersion,t.sdk_version=U.sdkVersion,t.sdk_type=U.sdkName,t.locale=U.locale,t.price=parseFloat(String(t.price)),t.tax_free=parseFloat(String(t.tax_free)),t.deposit_price=parseFloat(String(t.deposit_price)),e.invalidRequestParamsData(t),e.invalidRequestItemsData(t.items,t.price),t.uuid=this.$session.currentUserUUID(),t.sk=this.$session.currentSessionKey(),t.ti=this.$session.currentTimeTerm(),t.tk=this.$transactionKey,t.env=this.getUserDeviceEnvironment(),t.extra=this.openTypeFilter(t.extra),this.extra=t.extra;try{const e=yield nr.start(t);return O.debug("confirm ready",e),nr.hidePaymentiFrame(),nr.closePopup(),-1===["done","issued"].indexOf(e.event)&&this.$event.send({step:e.event,msg:"",request:t,response:e}),nr.setConfirmFormUrl(`${e.gateway_url}/confirm/${e.receipt_id}?application_id=${t.application_id}`),Promise.resolve(e)}catch(i){return this.eventError(i),Promise.reject(i)}}))}confirm(){return o(this,null,(function*(){try{const e=yield nr.confirm();return Promise.resolve(e)}catch(e){return this.eventError(e),Promise.reject(e)}}))}eventDone(e,t=!0){this.$logger.debug(e.event,e),this.$event.send({step:e.event,msg:"done"===e.event?"결제완료":"가상계좌발급완료",request:{},response:e}),F.hideProgress(),this.$logger.debug("show result",this.isDisplaySuccessResult()),this.isDisplaySuccessResult()&&t?this.displayResultView(e.data.receipt_id):nr.destroy()}eventError(e){F.hideProgress(),nr.closePopup(),this.isDisplayErrorResult()&&"error"===e.event?this.displayResultErrorView(e):nr.destroy(),this.$logger.debug("done failed destroy and hide","payment"),this.$event.sendError({step:this.$present(e.event)?e.event:"error",msg:e.message,trace:function(){try{return e.stack}catch(t){return!1}}()})}generateTransactionKey(){return this.$transactionKey=`${this.$uuid()}-${1e3*(new Date).getTime()}`,this.$transactionKey}requestSubscription(e){return o(this,null,(function*(){this.$event.clearInstance(),this.generateTransactionKey(),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"정기결제 요청 시작",request:e}),e.extra=this.openTypeFilter(e.extra);const t={application_id:e.application_id,subscription_id:e.subscription_id,pg:e.pg,method:e.method,order_name:e.order_name,price:e.price,tax_free:e.tax_free,user_token:e.user_token,metadata:e.metadata,redirect_url:e.redirect_url,platform_type:this.platformType,ver:R,sdk_version:U.sdkVersion,sdk_type:U.sdkName,locale:U.locale,sdk:!0,uuid:this.$session.currentUserUUID(),sk:this.$session.currentSessionKey(),tk:this.$transactionKey,env:this.getUserDeviceEnvironment(),user:e.user,extra:e.extra};try{const r=yield nr.start(t,"CARD_SUBSCRIPTION");switch(O.debug("subscription success",r),this.$event.send({step:"confirm",msg:"결제승인전",request:{},response:r}),nr.hidePaymentiFrame(),nr.closePopup(),r.event){case"done":case"issued":break;case"confirm":nr.setConfirmFormUrl(`${r.gateway_url}/confirm/${r.receipt_id}?application_id=${e.application_id}`)}return Promise.resolve(r)}catch(r){return this.eventError(r),Promise.reject(r)}}))}requestAuthentication(e){return o(this,null,(function*(){this.$event.clearInstance(),this.generateTransactionKey(),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"본인인증 요청 시작",request:e}),e.extra=this.openTypeFilter(e.extra);const t={application_id:e.application_id,authentication_id:e.authentication_id,pg:e.pg,method:this.$present(e.method)?e.method:"auth",order_name:e.order_name,platform_type:this.platformType,ver:R,sdk_version:U.sdkVersion,sdk_type:U.sdkName,locale:U.locale,metadata:e.metadata,redirect_url:e.redirect_url,sdk:!0,uuid:this.$session.currentUserUUID(),sk:this.$session.currentSessionKey(),tk:this.$transactionKey,env:this.getUserDeviceEnvironment(),user:e.user,extra:e.extra};try{const r=yield nr.start(t,"AUTH");switch(O.debug("authentication success",r),this.$event.send({step:"confirm",msg:"본인인증 승인전",request:{},response:r}),nr.hidePaymentiFrame(),nr.closePopup(),r.event){case"done":case"issued":break;case"confirm":nr.setConfirmFormUrl(`${r.gateway_url}/confirm/${r.receipt_id}?application_id=${e.application_id}`)}return Promise.resolve(r)}catch(r){return this.eventError(r),Promise.reject(r)}}))}requestPaymentUrl(e){return o(this,null,(function*(){try{const t=yield nr.startPaymentUrl(e.url);return-1===["done","issued"].indexOf(t.event)&&this.$event.send({step:t.event,msg:"",request:{url:e.url},response:t}),nr.setConfirmFormUrl(`${t.gateway_url}/confirm/${t.receipt_id}?application_id=${e.application_id}`),Promise.resolve(t)}catch(t){return this.eventError(t),Promise.reject(t)}}))}getUserDeviceEnvironment(){return{width:window.innerWidth,height:window.innerHeight}}isDisplaySuccessResult(){return void 0!==this.extra&&void 0!==this.extra.display_success_result&&this.extra.display_success_result}isDisplayErrorResult(){return void 0!==this.extra&&void 0!==this.extra.display_error_result&&this.extra.display_error_result}displayResultView(e){nr.moveToUrl(U.toDoor(`result/${e}`))}displayResultErrorView(e){nr.moveToUrl(U.toDoor(`error?error_code=${e.error_code}&pg_error_code=${e.pg_error_code}&message=${e.message}`))}openTypeFilter(e){if(this.$present(e)&&void 0!==e.browser_open_type){const t=this.getUserAgent();for(let r in e.browser_open_type){const i=e.browser_open_type[r],n=this.$present(this.browserBootpayFilter[i.browser])?this.browserBootpayFilter[i.browser]:new RegExp(`${i.browser}`);if(t.match(n)){e.open_type=i.open_type;break}}}return e}static invalidRequestParamsData(t){if(d(t))throw new D({event:"error",error_code:"NEED_MORE_PARAMS",message:"결제 요청을 위한 최소한의 결제 정보를 입력해주세요."});Object.keys(e.invalidRequestParams).forEach((r=>{const i=t[r];if(d(i))throw new D({event:"error",error_code:"INVALID_REQUEST_PARAMS",message:e.invalidRequestParams[r]})}))}static invalidRequestItemsData(e,t){if(void 0!==e&&l(e)){let r=0;if(e.forEach(((t,i)=>{if(d(t.id))throw new D({event:"error",error_code:"NEED_ITEM_ID",message:`${i+1}번째 상품 고유 ID를 입력해주세요. [ key: id ]`});if(d(t.name))throw new D({event:"error",error_code:"NEED_ITEM_NAME",message:`${i+1}번째 상품명을 입력해주세요. [ key: name ]`});if(d(t.qty))throw new D({event:"error",error_code:"NEED_ITEM_QTY",message:`${i+1}번째 상품수량을 입력해주세요. [ key: qty ]`});if(d(t.price))throw new D({event:"error",error_code:"NEED_ITEM_PRICE",message:`${i+1}번째 상품금액을 입력해주세요. [ key: price ]`});e[i].price=parseFloat(String(e[i].price)),e[i].qty=parseFloat(String(e[i].qty)),r+=e[i].price*e[i].qty})),r!==t)throw new D({event:"error",error_code:"NEED_ITEM_TOTAL_PRICE_NOT_MATCH",message:`결제 금액과 상품 수량 및 상품 금액의 총합과 일치하지 않습니다. [ 요청금액: ${t} ${typeof t}, 상품 총합계 금액: ${r} ${typeof r} ]`})}}};sr.invalidRequestParams={application_id:"application_id를 입력해주세요. [ key: application_id ]",order_name:"판매할 상품명을 입력해주세요. [ key: order_name ]",price:"판매할 상품의 금액을 입력해주세요. [ key: price ]",order_id:"가맹점에서 설정할 주문 ID를 입력해주세요. [ key: order_id ]"};let or=sr;const ar=new or;const cr=new class extends Zt{constructor(){super(),this.$session=A}setAnalyticsData(e){this.$session.setTime(e.time),this.$session.setUUID(e.uuid)}send(e){return o(this,null,(function*(){const t=document.URL;if(void 0!==t&&-1===t.search(/bootapi.co.kr/)){const i=this.$session.getUser();e.application_id=U.currentApplicationId(e.application_id),e.sk=this.$session.currentSessionKey(),e.uuid=this.$session.currentUserUUID(),e.time=this.$session.currentTime(),e.url=t,e.referer=void 0!==document.referrer&&l(document.referrer)&&-1==document.referrer.search(new RegExp(window.location.hostname))?document.referrer:"",e.user_id=void 0===i||d(i)?void 0:i.id,e.items=this.generateItemKeyToVersion1(e.items);try{const t=yield this.$http.post(U.toAnalytics(`call?ver=${R}`),e);return 200===t.data.status?(O.info("Analytics Common Send","통계 데이터가 전송되었습니다."),Promise.resolve()):(O.warn("Analytics Common Send",`통계 데이터가 전송 실패. ${JSON.stringify(t.data)}`),Promise.reject())}catch(r){return O.error("Analytics Common Error",`데이터 전송 실패: ${r.message}`),Promise.reject()}}}))}login(e){return o(this,null,(function*(){if(e.application_id=U.currentApplicationId(e.application_id),d(e.application_id))return O.error("Analytics Params","application_id 값을 입력해주세요.");if(d(e.id))return O.error("Analytics Params","id 값을 입력해주세요.");try{const t=yield this.$http.post(U.toAnalytics(`login?ver=${R}`),e),{user_id:r}=t.data.data;return this.$session.setUser({id:r,time:(new Date).getTime()}),Promise.resolve()}catch(t){return O.error("Analytics Login Error",`데이터 전송 실패: ${t.message}`),Promise.reject()}}))}logout(){this.$session.setUser(void 0)}generateItemKeyToVersion1(e){return void 0!==e?e.map((e=>({cat1:e.cat1,cat2:e.cat2,cat3:e.cat3,item_img:e.img,item_name:e.name,unique:e.id,price:e.price}))):void 0}};!function(){if("undefined"==typeof window||"function"==typeof window.CustomEvent)return!1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let r=document.createEvent("CustomEvent");return r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r}e.prototype=window.Event.prototype,window.CustomEvent=e}();const dr={$payment:ar,$analytics:cr,$environment:U,requestPayment(e){return o(this,null,(function*(){return new Promise(((t,r)=>o(this,null,(function*(){try{void 0!==e.extra&&!0===e.extra.override_global_event&&(O.debug("override global event","override global event!"),dr.overrideGlobalInstance());const r=yield this.$payment.requestPayment(e);setTimeout((()=>{t(r),["done","issued"].indexOf(r.event)>-1&&this.$payment.eventDone(r)}),100)}catch(i){setTimeout((()=>{r(this.errorHandler(i))}),100)}}))))}))},confirm(){return o(this,null,(function*(){return new Promise(((e,t)=>o(this,null,(function*(){try{const t=yield this.$payment.confirm();setTimeout((()=>{e(t),this.$payment.eventDone(t)}),100)}catch(r){setTimeout((()=>t(this.errorHandler(r))),100)}}))))}))},requestSubscription(e){return o(this,null,(function*(){return new Promise(((t,r)=>o(this,null,(function*(){try{const r=yield this.$payment.requestSubscription(e);t(r),this.$payment.eventDone(r)}catch(i){return r(this.errorHandler(i))}}))))}))},requestAuthentication(e){return o(this,null,(function*(){return new Promise(((t,r)=>o(this,null,(function*(){try{const r=yield this.$payment.requestAuthentication(e);t(r),this.$payment.eventDone(r)}catch(i){return r(this.errorHandler(i))}}))))}))},requestPaymentUrl(e){return o(this,null,(function*(){return new Promise(((t,r)=>o(this,null,(function*(){try{const r=yield this.$payment.requestPaymentUrl(e);setTimeout((()=>{t(r),["done","issued"].indexOf(r.event)>-1&&this.$payment.eventDone(r)}),100)}catch(i){setTimeout((()=>{r(this.errorHandler(i))}),100)}}))))}))},setEnvironmentMode(e,t=void 0){this.$environment.set(e),void 0!==t&&this.$environment.setDevelopmentHost(t)},setApplicationId(e){return this.$environment.setApplicationId(e)},setVersion(e,t,r){return this.$environment.setVersion(e,t,r)},setDevice(e){switch(e){case"IOS":this.$payment.platformType=a.PLATFORM.IOS;break;case"ANDROID":this.$payment.platformType=a.PLATFORM.ANDROID;break;default:this.$payment.platformType=a.PLATFORM.JS}return this.$payment.platformType},errorHandler(e){let t;if(F.hideProgress(),"BootpayEventError"===e.name)t=e.eventMessage;else{if(!l(e.event))throw e;t=e}return t},readyToPopup(){nr.readyToPopup()},setLogLevel(e){O.setLogLevel(e)},setUUID:e=>A.setUUID(e),send(e=void 0){return this.$analytics.send(void 0!==e?e:{})},login(e){return this.$analytics.login(e)},logout(){return this.$analytics.logout()},setLocale(e){U.setLocale(e),nr.templateReload()},dismiss(e=!1){return o(this,null,(function*(){if(e)try{yield rr.sendCloseEvent()}catch(t){O.debug("error",t.message)}tr.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:"사용자가 결제창을 닫았습니다."})}))},getCurrentUUID:()=>A.currentUserUUID(),destroy(){nr.destroy()},overrideGlobalInstance(){window.Bootpay=dr}};"undefined"!=typeof window&&(window.Bootpay=dr);class lr extends C{constructor(){super(),this.$messageEventName="message.BootpayUserTokenEvent"}bind(e,t){this.setCallbackFunction(e,t),window.resetBootpayEventListener(this.$messageEventName,(e=>{const t=this.parseEvent(e.data);if(l(t))switch(O.debug("event",t),t.event){case"error":case"cancel":return this.reject({event:t.event,pg_error_code:t.pg_error_code,error_code:t.error_code,message:t.message,payload:t.payload});case"data":return this.resolve(t.data);case"confirmPasswordToken":return this.resolve(t.token);case"confirmAddCard":return this.resolve(t);case"resize":ur.iFrameResize(t.resizeData);break;default:return}}))}}const ur=new class extends N{constructor(){super(),this.$windowId="bootpay-user-token-background-id",this.$userWindowId="bootpay-user-token-window-id",this.$iFrameId="bootpay-user-token-iframe-id",this.$bootpaySdkFormId="bootpay-user-token-sdk-form",this.$template=this.template(),this.$event=new lr,this.$session=A,this.deviceType=a.PLATFORM.JS}setDevice(e){return this.deviceType=e,this.deviceType}template(){return`\n <div id="${this.$windowId}" class="bootpay-payment-background">\n <div class="bootpay-payment-window" id="${this.$userWindowId}">\n <iframe id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>\n <form name="${this.$bootpaySdkFormId}" id="${this.$bootpaySdkFormId}" method="GET"> \n </form>\n </div>\n </div>\n `}setParams(e,t){if(void 0!==t){const r=this.byId(this.$bootpaySdkFormId);if(["POST","PUT"].indexOf(e.toUpperCase())>-1){const e=Zt.encryptParams(Zt.objectKeyToUnderscore(t));r.innerHTML=`\n <input type="hidden" name="payload" value="${e.payload}" />\n <input type="hidden" name="token" value="${e.token}" /> \n `}else{let i="";"DELETE"===e.toUpperCase()&&(i+='<input type="hidden" name="_method" value="patch"/>'),Object.keys(t).forEach((e=>{i+=`<input type="hidden" name="${e}" value="${t[e]}"/>`})),r.innerHTML=i}}}request(e,t){return new Promise(((r,i)=>{this.createTemplateHtml(),this.$event.bind(r,i),this.goiFrameUrl("GET",U.toDoor(`sdk/password/${t}`),{type:e,uuid:this.$session.currentUserUUID()})}))}addCard(e){return new Promise(((t,r)=>{this.createTemplateHtml(),this.$event.bind(t,r),this.goiFrameUrl("GET",U.toDoor(`sdk/card/${e}`),{uuid:this.$session.currentUserUUID()})}))}wallets(e){return new Promise(((t,r)=>{this.createTemplateHtml(),this.$event.bind(t,r),this.goiFrameUrl("GET",U.toApi("sdk/easy/wallet"),{user_token:e,sdk:!0,uuid:this.$session.currentUserUUID()})}))}destroyWallet(e){return new Promise(((t,r)=>{this.createTemplateHtml(),this.$event.bind(t,r),this.goiFrameUrl("POST",U.toApi("sdk/easy/wallet"),{method:"DELETE",sdk:!0,user_token:e.user_token,wallet_id:e.wallet_id,token:e.token,uuid:this.$session.currentUserUUID()})}))}createBiometricAuthenticate(e){return new Promise(((t,r)=>{this.createTemplateHtml(),this.$event.bind(t,r),this.goiFrameUrl("POST",U.toApi("sdk/easy/biometric"),{user_token:e.userToken,sdk:!0,uuid:this.$session.currentUserUUID(),os:e.os,token:e.token})}))}destroyBiometricAuthenticate(e){return new Promise(((t,r)=>{this.createTemplateHtml(),this.$event.bind(t,r),this.goiFrameUrl("POST",U.toApi("sdk/easy/biometric"),{method:"DELETE",uuid:this.$session.currentUserUUID(),user_token:e.userToken,token:e.token})}))}requestWalletPayment(e){return new Promise(((t,r)=>{this.createTemplateHtml(),this.$event.bind(t,r),this.goiFrameUrl("POST",U.toApi("sdk/easy/card"),this.regenerateRequestPayment(e))}))}goiFrameUrl(e,t,r=void 0){this.setParams(e,r);const i=this.byId(this.$bootpaySdkFormId);i.method=this.toMethod(e),i.action=t,i.target=this.$iFrameId,i.submit(),this.show()}toMethod(e){switch(e.toUpperCase()){case"PUT":case"DELETE":return"POST";default:return e}}iFrameResize(e){const t=this.byId(this.$iFrameId);if(void 0!==t)for(let r in Object.keys(e)){let i=Object.keys(e)[r],n=e[i];this.$present(n)&&!String(n).match(/%/)&&(i.match(/width/)||i.match(/Width/)||i.match(/height/)||i.match(/Height/))&&(n=`${String(e[i]).replace(/px/gi,"")}px`),String(n).match(/%/)&&!this.byId(this.$userWindowId).className.match(/w-100/)&&(this.byId(this.$userWindowId).className+=" w-100"),t.style.setProperty(i,n)}}regenerateRequestPayment(e){return e.ver=R,e.platform_type=this.deviceType,e.sdk=!0,e.price=parseFloat(String(e.price)),e.tax_free=parseFloat(String(e.tax_free)),or.invalidRequestParamsData(e),or.invalidRequestItemsData(e.items,e.price),e.uuid=this.$session.currentUserUUID(),e.sk=this.$session.currentSessionKey(),e.ti=this.$session.currentTimeTerm(),e.tk=`${this.$uuid()}-${1e3*(new Date).getTime()}`,e}show(){const e=this.byId(this.$iFrameId);void 0!==e&&e.style.setProperty("display","block")}destroy(){this.$present(document.querySelector("body").className)&&(document.querySelector("body").className=document.querySelector("body").className.replace(/bootpay-open/gi,"")),this.$present(this.byId(this.$windowId))&&(this.byId(this.$windowId).outerHTML=""),document.body.classList.remove("bootpay-open"),tr.clearPollingEvent(),setTimeout((()=>tr.callBootpayDOMEvent("close")),300)}},pr={$templateUserToken:ur,requestPasswordToken(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.request("passwordToken",e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},requestChangePassword(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.request("changePasswordToken",e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},requestAddCard(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.addCard(e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},wallets(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.wallets(e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},destroyWallet(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.destroyWallet(e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},createBiometricAuthenticate(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.createBiometricAuthenticate(e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},destroyBiometricAuthenticate(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.destroyBiometricAuthenticate(e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},requestWalletPayment(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.requestWalletPayment(e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},setEnvironmentMode(e,t=void 0){U.set(e),void 0!==t&&U.setDevelopmentHost(t)},setDevice(e){let t=a.PLATFORM.JS;switch(e.toUpperCase()){case"IOS":t=a.PLATFORM.IOS;break;case"ANDROID":t=a.PLATFORM.ANDROID}return this.$templateUserToken.setDevice(t)},errorHandler(e){let t;if(F.hideProgress(),"BootpayEventError"===e.name)t=e.eventMessage;else{if(!l(e.event))throw e;t=e}return t},setLogLevel(e){O.setLogLevel(e)},setUUID:e=>A.setUUID(e),dismiss(){tr.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:"사용자가 결제창을 닫았습니다."})}};"undefined"!=typeof window&&(window.BootpaySDK=pr);const hr={el:void 0,applicationId:void 0,price:0,taxFree:0,depositPrice:0,currency:"KRW",userToken:void 0,pg:void 0,method:void 0,walletId:void 0,selectTerms:[],useOnlyOOpay:!1,termsPassed:!1,useTerms:!0,sandbox:!1,widgetKey:void 0,externalTerms:[],widgetExtra:{card_quota:[]},extra:{},setWidgetData(e){this.el=String(e.el).replace(/#/gi,""),this.applicationId=e.application_id,this.price=e.price,this.taxFree=e.tax_free,this.depositPrice=e.deposit_price,this.currency=e.currency,this.userToken=e.user_token,this.useOnlyOOpay=void 0!==e.use_only_oopay&&e.use_only_oopay,this.useTerms=!(!1===e.use_terms),this.walletId=e.wallet_id,this.externalTerms=e.external_terms,this.widgetExtra=e.widget_extra,this.widgetKey=e.widget_key,this.sandbox=!0===e.sandbox,this.termsPassed=!1,this.extra={}},setPayment(e,t,r,i=!1,n,s){this.pg=e,this.method=t,this.walletId=r,this.termsPassed=i,this.selectTerms=n,this.extra=s},updateOnProcessing(e){l(e.price)&&(this.price=e.price),l(e.tax_free)&&(this.taxFree=e.tax_free),l(e.currency)&&(this.currency=e.currency),void 0!==e.user_token&&(this.userToken=e.user_token),l(e.use_terms)&&(this.useTerms=!(!1===e.use_terms)),l(e.sandbox)&&(this.sandbox=!0===e.sandbox),l(e.widget_key)&&(this.widgetKey=e.widget_key),void 0!==e.external_terms&&(this.externalTerms=e.external_terms),void 0!==e.widget_key&&(this.widgetKey=e.widget_key)}};const mr=new class extends N{constructor(){super(),this.$iFrameId="bootpay-widget-iframe",this.$widgetStore=hr,this.$template=`\n <iframe id="${this.$iFrameId}" src="" frameborder="0" allowtransparency="true" scrolling="no" style="background: transparent; width: 100%; height: 100%;"></iframe> \n `}render(){const e=document.getElementById(this.$widgetStore.el);if(this.$blank(this.$widgetStore.el)||null===e)throw new Error("부트페이 위젯을 설정할 Element ID를 입력하지 않았거나 해당 Element DOM이 존재하지 않습니다.");this.templateRender()}templateRender(){const e=document.getElementById(this.$widgetStore.el);e.style.setProperty("height","0px"),e.innerHTML=this.$template;this.byId(this.$iFrameId).setAttribute("src",U.toWidget(`p/${this.$widgetStore.applicationId}`))}resize(e){this.templateResize(this.$widgetStore.el,e)}rerender(){this.postMessage("bootpayWidgetRerender")}destroy(){document.getElementById(this.$widgetStore.el).innerHTML=""}postMessage(e,t=void 0){var r;const i=this.byId(this.$iFrameId);null==(r=null==i?void 0:i.contentWindow)||r.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}isRendered(){const e=document.getElementById(this.$iFrameId);return O.debug("isRendered",`iFrameElement: ${e}`),null!==e&&null!==e.src&&""!==e.src}};const yr=new class extends N{constructor(){super(),this.$oopayWindowId="__bootpay-card-easy-window",this.$iFrameId="__bootpay-card-easy-iframe",this.$windowId="__bootpay-card-easy-container-window",this.$additionalClass=U.isMobile()?"":"rounded-iframe",this.$template=this.template(),this.$widgetStore=hr}template(){return`\n<div id="${this.$windowId}" class="bootpay-payment-background">\n <div class="bootpay-payment-window ${U.isMobile()?"__mobile":""}" id="${this.$oopayWindowId}"> \n <iframe class="${this.$additionalClass}" id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe> \n </div> \n</div>\n `}createIFrame(e){this.createTemplateHtml();const t=document.getElementById(this.$iFrameId);null==t||t.setAttribute("src",U.toWidget(`${e}`)),null==t||t.style.setProperty("display","block")}addWallet(){this.createIFrame(`wallet/add/${this.$widgetStore.applicationId}`)}removeWallet(e){this.createIFrame(`oopay/destroy/${this.$widgetStore.applicationId}/${e}`)}showCardInterestInformation(e){this.createIFrame(`card/interest/${this.$widgetStore.applicationId}`)}destroy(){const e=document.getElementById(this.$windowId);void 0!==e&&(e.outerHTML="",e.remove())}resize(e){O.debug("resize",e),this.templateResize(this.$iFrameId,e)}postMessage(e,t=void 0){var r;const i=this.byId(this.$iFrameId);null==(r=null==i?void 0:i.contentWindow)||r.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}};const fr=new class extends N{constructor(){super(),this.$windowId="__bootpay-modal-window-container",this.$modalWindowId="__bootpay-modal-window",this.$iFrameId="__bootpay-modal-iframe",this.$additionalClass=U.isMobile()?"":"rounded-iframe",this.$template=this.template()}template(){return`\n<div id="${this.$windowId}" class="bootpay-payment-background">\n <div class="bootpay-payment-window ${U.isMobile()?"__mobile":""}" id="${this.$modalWindowId}"> \n <iframe class="${this.$additionalClass}" id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe> \n </div> \n</div>\n `}createIFrame(e){this.createTemplateHtml();const t=document.getElementById(this.$iFrameId);null==t||t.setAttribute("src",e),null==t||t.classList.add("slide-up"),null==t||t.style.setProperty("display","block")}destroy(){const e=document.getElementById(this.$iFrameId);null==e||e.classList.remove("slide-up"),null==e||e.classList.add("slide-down"),setTimeout((()=>{const e=document.getElementById(this.$windowId);void 0!==e&&(e.outerHTML="",e.remove())}),300)}resize(e){O.debug("resize",e),this.templateResize(this.$iFrameId,e)}postMessage(e,t=void 0){var r;const i=this.byId(this.$iFrameId);null==(r=null==i?void 0:i.contentWindow)||r.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}};const gr=new class extends C{constructor(){super(),this.$messageEventName="message.BootpayWidgetEvent",this.$eventPrefix="bootpay"}bind(){window.resetBootpayEventListener(this.$messageEventName,(e=>{const t=this.parseEvent(e.data);if(l(t))switch(t.event){case"bootpayWidgetSelectMethod":return this.triggerGlobalChangeEvent(t.data),vr.selectPayment(t.data.pg,t.data.method,t.data.wallet_id,!0===t.data.term_passed,t.data.select_terms,t.data.extra);case"bootpayRequestGetEnvironment":return mr.postMessage("bootpayResponseGetEnvironment",{use_only_oopay:mr.$widgetStore.useOnlyOOpay,user_token:mr.$widgetStore.userToken,sandbox:mr.$widgetStore.sandbox,use_terms:mr.$widgetStore.useTerms,external_terms:mr.$widgetStore.externalTerms,key:mr.$widgetStore.widgetKey,log_level:O.level});case"bootpayRequestGetEnvironmentWidget":return mr.postMessage("bootpayWidgetGetEnvironmentWidget",t.data);case"bootpayWidgetResponseGetEnvironmentWidget":return yr.postMessage("bootpayResponseGetEnvironmentWidget",{use_only_oopay:mr.$widgetStore.useOnlyOOpay,user_token:mr.$widgetStore.userToken,sandbox:mr.$widgetStore.sandbox,use_terms:mr.$widgetStore.useTerms,platform:t.data.platform});case"bootpayRequestCurrentStores":return mr.postMessage("bootpayWidgetRequestCurrentStores",t.data);case"bootpayWidgetResponseCurrentStores":return yr.postMessage("bootpayResponseCurrentStores",t.data);case"bootpayWidgetError":default:return this.reject(t);case"bootpayWidgetOOpayReload":return mr.postMessage("bootpayWidgetOOpayReload",t.data);case"bootpayWidgetResize":return this.callBootpayDOMEvent("widget-resize",t.data),mr.resize(t.data);case"bootpayWidgetShowInterestInformation":return yr.showCardInterestInformation(t.data);case"bootpayWidgetAddWallet":return yr.addWallet();case"bootpayWidgetRemoveWallet":return yr.removeWallet(t.data.wallet_id);case"bootpayWidgetPaymentWindowResize":return yr.resize(t.data);case"bootpayWidgetOOpayWindowClose":return yr.destroy();case"bootpayWidgetModalOpen":return fr.createIFrame(t.data.url);case"bootpayWidgetModalClose":return fr.destroy();case"bootpayRequestModalCurrentStores":return mr.postMessage("bootpayWidgetRequestModalCurrentStores",t.data);case"bootpayRequestGetEnvironmentModalWidget":return mr.postMessage("bootpayWidgetGetEnvironmentModalWidget",t.data);case"bootpayWidgetResponseGetEnvironmentModalWidget":return fr.postMessage("bootpayResponseGetEnvironmentModalWidget",{application_id:mr.$widgetStore.applicationId,use_only_oopay:mr.$widgetStore.useOnlyOOpay,user_token:mr.$widgetStore.userToken,sandbox:mr.$widgetStore.sandbox,use_terms:mr.$widgetStore.useTerms,external_terms:mr.$widgetStore.externalTerms,key:mr.$widgetStore.widgetKey,platform:t.data.platform,log_level:O.level});case"bootpayWidgetModalResize":return fr.resize(t.data);case"bootpayWidgetPaymentGetStoreData":const{applicationId:e,price:o,widgetExtra:a,taxFree:c,userToken:d}=mr.$widgetStore;return mr.postMessage("bootpayWidgetResponseStoreData",{applicationId:e,price:o,widgetExtra:a,taxFree:c,userToken:d});case"bootpayWidgetTermAllAgree":return void this.callBootpayDOMEvent("all-agree-terms",t.data);case"bootpayWidgetSelectPayment":const{method_alias:l,payment_type:u,wallet_id:p}=t.data;return mr.postMessage("bootpayWidgetSelectPayment",{method_alias:l,payment_type:u,wallet_id:p});case"bootpayWidgetReady":this.callBootpayDOMEvent("widget-ready",t.data);break;case"bootpayWidgetUpdateStore":hr.updateOnProcessing(((e,t)=>{for(var o in t||(t={}))i.call(t,o)&&s(e,o,t[o]);if(r)for(var o of r(t))n.call(t,o)&&s(e,o,t[o]);return e})({},t.data))}}))}callBootpayDOMEvent(e,t=void 0){document.dispatchEvent(new CustomEvent([this.$eventPrefix,e].join("-"),{detail:t}))}destroyAllEvent(){window.removeBootpayEventListener(this.$messageEventName)}triggerGlobalChangeEvent(e){var t;e.completed=this.$present(e.pg)&&this.$present(e.method)&&(!0===e.term_passed||!hr.useTerms)&&(-1===["OOPAY_CARD","OOPAY_AUTOMATIC_TRANSFER"].indexOf(e.method)||void 0!==e.wallet_id),hr.pg===e.pg&&hr.method===e.method&&hr.walletId===e.wallet_id&&JSON.stringify(hr.extra)===JSON.stringify(e.extra)||this.callBootpayDOMEvent("widget-change-payment",e),JSON.stringify(null==(t=e.select_terms)?void 0:t.filter((e=>!0===e.agree)))!==JSON.stringify(hr.selectTerms.filter((e=>!0===e.agree)))&&this.callBootpayDOMEvent("widget-change-terms",e)}};const vr=new class extends k{constructor(){super(),this.message=ir}initialize(){hr.setWidgetData({el:void 0,application_id:void 0,price:0,tax_free:0,currency:"KRW",user_token:void 0,pg:void 0,method:void 0,widget_key:void 0})}render(e,t){if(this.$blank(null==t?void 0:t.price)||t.price<0)throw new Error("결제금액은 1원 이상을 입력해주세요.");if(this.$blank(null==t?void 0:t.application_id))throw new Error("application_id가 입력되지 않았습니다.");this.initialize(),hr.setWidgetData({el:e,application_id:t.application_id,price:t.price,tax_free:t.tax_free,currency:t.currency,user_token:t.user_token,use_only_oopay:t.use_only_oopay,external_terms:t.external_terms,widget_extra:t.extra,use_terms:t.use_terms,sandbox:t.sandbox,widget_key:t.key}),mr.render(),gr.bind()}update(e){const{price:t,tax_free:r,currency:i,user_token:n,use_only_oopay:s,use_terms:o,sandbox:a,key:c,external_terms:d}=e;hr.updateOnProcessing({price:t,tax_free:r,currency:i,user_token:n,use_only_oopay:s,use_terms:o,external_terms:d,sandbox:a,widget_key:c}),(this.$present(n)||this.$present(s)||this.$present(o)||this.$present(a))&&mr.postMessage("bootpayWidgetUpdateUserToken",{user_token:n,use_only_oopay:s,use_terms:o,external_terms:d,sandbox:a,key:c})}rerender(){mr.rerender()}destroy(){mr.destroy()}selectPayment(e,t,r,i=!1,n,s){hr.setPayment(e,t,r,i,n,s),O.debug("selectPayment",`pg: ${e}, method: ${t}, wallet_id: ${r}, terms: ${i}, select_terms: ${JSON.stringify(n)}, extra: ${JSON.stringify(s)}`)}currentTermsCondition(){return hr.selectTerms}requestPayment(e){return o(this,null,(function*(){if(this.$blank(hr.pg)||this.$blank(hr.method))throw new D({event:"error",error_code:"RC_PG_METHOD_NOT_SELECTED",message:this.message.getLocaleMessage("notSelectPayment","ko")});if(!hr.termsPassed&&hr.useTerms)throw new D({event:"error",error_code:"RC_TERMS_NOT_AGREE",message:this.message.getLocaleMessage("termsNotAgree","ko")});if(["OOPAY_CARD","OOPAY_AUTOMATIC_TRANSFER"].indexOf(hr.method)>-1&&void 0===hr.walletId)throw new D({event:"error",error_code:"RC_OOPAY_NEED_SELECT_WALLET",message:this.message.getLocaleMessage("notSelectOOPay","ko")});return e.application_id=hr.applicationId,e.price=hr.price,e.tax_free=hr.taxFree,e.deposit_price=hr.depositPrice,e.currency=hr.currency,e.pg=hr.pg,e.method=hr.method,e.wallet_id=hr.walletId,e.terms=hr.selectTerms,e.widget_sandbox=hr.sandbox,e.widget_key=hr.widgetKey,e.extra=this.mergeExtraOnStore(e.extra),e.widget=1,dr.requestPayment(e)}))}mergeExtraOnStore(e){return void 0===e?hr.extra:(void 0!==hr.extra&&Object.keys(hr.extra).forEach((t=>{e[t]=hr.extra[t]})),e)}isRendered(){return mr.isRendered()}synchronizedRealTimeTransfer(e){mr.postMessage("bootpayWidgetSynchronizedRealTimeTransfer",e)}sendSelectPayment(e){mr.postMessage("bootpayWidgetSelectPayment",e)}sendMessage(e,t){mr.postMessage(e,t)}},_r={render(e,t){vr.render(e,t)},rerender(){vr.rerender()},setEnvironmentMode(e,t){dr.setEnvironmentMode(e,t),U.set(e)},requestPayment(e){return o(this,null,(function*(){return new Promise(((t,r)=>o(this,null,(function*(){try{const r=yield vr.requestPayment(e);return t(r)}catch(i){return r(this.errorHandler(i))}}))))}))},errorHandler(e){let t;if(F.hideProgress(),"BootpayEventError"===e.name)t=e.eventMessage;else{if(!l(e.event))throw e;t=e}return t},update(e,t=!0){vr.update(e),t&&this.rerender()},currentTermsCondition:()=>vr.currentTermsCondition(),destroy(){vr.destroy()},isRendered:()=>vr.isRendered(),synchronizedRealTimeTransfer(e){vr.synchronizedRealTimeTransfer(e)},selectPayment(e){vr.sendSelectPayment(e)},setLogLevel(e){O.setLogLevel(e)},sendMessage(e,t=void 0){vr.sendMessage(e,t)}};"undefined"!=typeof window&&(window.BootpayWidget=_r),e.Bootpay=dr,e.BootpayEnvironment=U,e.BootpaySDK=pr,e.BootpayWidget=_r,e.default=dr,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ !function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode('.bootpay-progress-background{position:fixed;display:block;background-color:transparent;inset:0;text-align:center;z-index:200000;white-space:nowrap}.bootpay-progress-background.blur-off{background-color:transparent}.bootpay-progress-background:before{display:inline-block;height:100%;content:" ";vertical-align:middle}.bootpay-progress-background .progress-message-window{display:inline-block;text-align:center;max-width:600px;border-radius:3px;width:100%;background-color:transparent;padding:0;vertical-align:middle}@media (min-width: 600px){.bootpay-progress-background .progress-message-window{padding:1rem}}.bootpay-progress-background .progress-message-window .bootpay-spinner{display:inline-block;width:50px;height:50px;border-radius:50%;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2);border-left:2px solid #ffffff;animation:spin 1s infinite linear}.bootpay-progress-background .progress-message-window .alfred-text{margin-top:1rem}.bootpay-progress-background .progress-message-window .alfred-text span.alfred-inner-text{font-weight:400;color:#eee}@keyframes spin{0%{transform:rotate(0);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}50%{transform:rotate(180deg);border-left:3px solid #ffffff;border-top:2px solid rgba(255,255,255,.4);border-right:2px solid rgba(255,255,255,.4);border-bottom:2px solid rgba(255,255,255,.4)}to{transform:rotate(360deg);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}}body.bootpay-open{position:fixed!important;inset:0;padding:0;margin:0;height:100vh!important;overflow:hidden!important;-webkit-overflow-scrolling:auto!important}body.bootpay-open .bootpay-payment-background{position:fixed;inset:0;display:block;text-align:center;background-color:#000000b3;z-index:9999}body.bootpay-open .bootpay-payment-background:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:relative;display:inline-block;vertical-align:middle}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{max-width:470px;height:90%}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:absolute;inset:0;border-radius:0!important}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{position:absolute;max-width:inherit;inset:0;height:100%}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%!important;height:100%!important;border-radius:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.transparent{background:transparent!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{position:absolute;display:none;top:-32px;right:4px;color:#fff;font-size:32px;text-decoration:none;outline:none;box-shadow:none;border:0;background-color:transparent}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#fff!important}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{top:1rem;right:16px;color:#000;padding:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#000!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:relative;width:400px;height:600px;display:none;background-color:#fff;border-radius:5px;overflow:hidden}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:absolute;inset:0;width:100%;height:100%;border-radius:0}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header{position:absolute;left:0;right:0;top:0;height:50px;color:#333;background-color:#fff;text-align:left}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body{position:absolute;inset:50px 0 72px;padding:1rem;text-align:left;font-size:14px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-item-name-id{font-size:16px;color:#888;font-weight:400!important;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-price-id{font-size:36px;color:#333;font-weight:700;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>.agree-text{position:absolute;bottom:1rem;left:0;right:0;color:#888;font-size:14px;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer{position:absolute;left:0;right:0;bottom:0;height:72px;padding:0 1rem;margin:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button{display:block;width:100%;padding:1rem;outline:none;border:none;background-color:#507cf3;border-radius:5px;color:#fff;font-size:16px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:hover,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:active{outline:none;box-shadow:none}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%;height:100%;display:none;border:0!important;outline:0!important;border-radius:0;box-shadow:none}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:0;height:0;border:0;outline:0;border-radius:0!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{border-radius:0}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{width:0;height:0;border:0;outline:0;border-radius:20px!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-up{animation:__bootpay-slide-up .3s linear}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-down{animation:__bootpay-slide-down .3s linear}body.bootpay-open .bootpay-payment-background>.bootpay-confirm-window>iframe{display:none;width:1px;height:1px;background:transparent;border:0!important;outline:0!important}.bootpay-close-btn{position:absolute;box-shadow:none;background-color:#fff;outline:0;z-index:10001;right:8px;top:8px;height:21px;width:21px;border:0!important;outline:none!important}@media (min-width: 600px){.bootpay-close-btn{right:4px;top:-32px;width:25px;height:25px;background:transparent;outline:none!important;border:0!important}}.bootpay-close-btn.active,.bootpay-close-btn:focus{outline:none!important;border:0!important}.bootpay-close-btn:before,.bootpay-close-btn:after{position:absolute;left:8px;top:2px;content:" ";height:24px;width:1px;background-color:#333}@media (min-width: 600px){.bootpay-close-btn:before,.bootpay-close-btn:after{height:23px;top:0;width:2px;background-color:#fff}}.bootpay-close-btn:before{transform:rotate(45deg)}.bootpay-close-btn:after{transform:rotate(-45deg)}@keyframes __bootpay-slide-up{0%{transform:translateY(150%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes __bootpay-slide-down{0%{transform:translate(0);opacity:1}to{transform:translateY(150%);opacity:0}}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Bootpay={})}(this,(function(e){"use strict";var t=Object.defineProperty,r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,s=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,o=(e,t,r)=>new Promise(((n,i)=>{var s=e=>{try{a(r.next(e))}catch(t){i(t)}},o=e=>{try{a(r.throw(e))}catch(t){i(t)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(s,o);a((r=r.apply(e,t)).next())}));const a={PLATFORM:{JS:1,ANDROID:2,IOS:3,REST:4},STORAGE_PREFIX:e=>`__bootpay_track_${e}__`},c=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),d=e=>{let t=!1;return t="string"==typeof e||Array.isArray(e)?0===e.length:null==e||u(e,"object")&&e.constructor===Object&&0===Object.keys(e).length,t},l=e=>!d(e),u=(e,t)=>typeof e===t;var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function m(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var y={exports:{}};var f={exports:{}};const g=m(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var v;function _(){return v||(v=1,f.exports=(e=e||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==p&&p.crypto&&(r=p.crypto),!r)try{r=g}catch(f){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(f){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(f){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),s={},o=s.lib={},a=o.Base=function(){return{extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),c=o.WordArray=a.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var s=0;s<i;s++){var o=r[s>>>2]>>>24-s%4*8&255;t[n+s>>>2]|=o<<24-(n+s)%4*8}else for(var a=0;a<i;a+=4)t[n+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new c.init(t,e)}}),d=s.enc={},l=d.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var s=t[i>>>2]>>>24-i%4*8&255;n.push((s>>>4).toString(16)),n.push((15&s).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(r,t/2)}},u=d.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var s=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(s))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(r,t)}},h=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},m=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,s=n.sigBytes,o=this.blockSize,a=s/(4*o),d=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,l=e.min(4*d,s);if(d){for(var u=0;u<d;u+=o)this._doProcessBlock(i,u);r=i.splice(0,d),n.sigBytes-=l}return new c.init(r,l)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=m.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new y.HMAC.init(e,r).finalize(t)}}});var y=s.algo={};return s}(Math),e)),f.exports;var e}y.exports=_().enc.Utf8;const w=h(y.exports);var b={exports:{}};!function(e,t){var r;e.exports=(r=_(),function(){var e=r,t=e.lib.WordArray;function n(e,r,n){for(var i=[],s=0,o=0;o<r;o++)if(o%4){var a=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;i[s>>>2]|=a<<24-s%4*8,s++}return t.create(i,s)}e.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],s=0;s<r;s+=3)for(var o=(t[s>>>2]>>>24-s%4*8&255)<<16|(t[s+1>>>2]>>>24-(s+1)%4*8&255)<<8|t[s+2>>>2]>>>24-(s+2)%4*8&255,a=0;a<4&&s+.75*a<r;a++)i.push(n.charAt(o>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var s=0;s<r.length;s++)i[r.charCodeAt(s)]=s}var o=r.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return n(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64)}(b);var $=b.exports;const E=h($);class k{$blank(e){return d(e)}$present(e){return!this.$blank(e)}$type(e,t){return u(e,t)}$uuid(){return c()}$encrypt(e){return this.$type(e,"object")&&(e=JSON.stringify(e)),E.stringify(w.parse(e))}$decrypt(e){return w.stringify(E.parse(e))}getUserAgent(){return window.navigator.userAgent}}const P=1,I=2,S=3,T=4,O={level:S,setLogLevel(e){this.level=e},messageStringify(e,t){try{return`${e}: ${u(t,"object")?JSON.stringify(t):t}`}catch(r){console.error(`log parse error: ${r}`)}},debug(e,t){this.level<=P&&console.log(this.messageStringify(e,t))},info(e,t){this.level<=I&&console.info(this.messageStringify(e,t))},warn(e,t){this.level<=S&&console.warn(this.messageStringify(e,t))},error(e,t){this.level<=T&&console.error(this.messageStringify(e,t))}};class x extends k{constructor(){super(),this.$storage={}}get(e){let t="";try{t=window.localStorage.getItem(e)}catch(r){t=this.$storage[e]}return this.$present(t)?this.$decrypt(t):void 0}set(e,t){try{window.localStorage.setItem(e,this.$encrypt(t))}catch(r){this.$storage[e]=this.$encrypt(t)}return t}currentUserUUID(){const e=a.STORAGE_PREFIX("uuid"),t=this.get(e);return this.$blank(t)?this.set(e,this.$uuid()):t}setUUID(e){const t=a.STORAGE_PREFIX("uuid");return this.set(t,e)}getToJSON(e){const t=this.get(e);return this.$present(t)?this.caseMarshalToJson(t):t}setToJSON(e,t){return this.set(e,JSON.stringify(t)),t}caseMarshalToJson(e){try{return JSON.parse(e)}catch(t){return JSON.parse(e.replace(/\\\"/g,'"'))}}}const A=new class extends x{constructor(){super(),this.currentUserUUID()}currentSessionKey(){const e=Math.round((new Date).getTime()/1e3),t=a.STORAGE_PREFIX("session"),r=this.getToJSON(t);if(this.$blank(r)||r.time+1800<e){return this.setToJSON(t,{time:e,term:this.$blank(r)?-1:e-r.time,uuid:`${this.$uuid()}-${e}`}).uuid}return r.uuid}currentTimeTerm(){const e=a.STORAGE_PREFIX("session"),t=this.getToJSON(e);return this.$blank(t.term)?-1:t.term}currentTime(){const e=a.STORAGE_PREFIX("session"),t=this.getToJSON(e);return this.$blank(t.time)?-1:t.time}setTime(e){const t=Math.round((new Date).getTime()/1e3),r=a.STORAGE_PREFIX("session"),n=this.getToJSON(r),i=this.$blank(n)?{time:e>0?e:t,term:e>0?t-e:-1,uuid:`${this.$uuid()}-${t}`}:n;i.time=e,this.setToJSON(r,i)}generateKey(){return`${this.$uuid()}-${(new Date).getTime()}`}setUser(e){return this.set(a.STORAGE_PREFIX("user"),void 0===e?void 0:JSON.stringify(e)),e}getUser(){try{return JSON.parse(this.get(a.STORAGE_PREFIX("user")))}catch(e){return void O.error("User Storage",`사용자 정보를 추출하는데 실패하였습니다. [ ${e.message} ]`)}}},R="5.0.0-rc.6",U={mode:"production",locale:"ko",isSetLocale:!1,packageVersion:R,applicationId:"",API_URL:{development:"https://dev-api.bootpay.co.kr/v2",stage:"https://stage-api.bootpay.co.kr/v2",production:"https://api.bootpay.co.kr/v2"},ANALYTICS_URL:{development:"https://dev-analytics.bootpay.co.kr",stage:"https://stage-analytics.bootpay.co.kr",production:"https://analytics.bootpay.co.kr"},DOOR_URL:{development:"https://door-dev.bootpay.co.kr",stage:"https://door-stage.bootpay.co.kr",production:"https://door.bootpay.co.kr"},WIDGET_URL:{development:"https://dev-widget.bootpay.co.kr",stage:"https://stage-widget.bootpay.co.kr",production:"https://widget.bootpay.co.kr"},sdkNames:{android:100,android_react_native:101,android_flutter:102,android_unity:103,ios:200,ios_react_native:201,ios_flutter:202,ios_unity:203,ios_objc:204,ios_swift_ui:205,mac_swift:206,mac_flutter:207},sdkVersion:"",sdkName:0,set(e){this.mode=e},setApplicationId(e){return this.applicationId=e,this.currentApplicationId(void 0)},setLocale(e){this.locale=e,this.isSetLocale=!0},currentApplicationId(e=void 0){return void 0===e?this.applicationId:e},setDevelopmentHost(e){this.API_URL.development=this.API_URL.development.replace(/dev-api.bootpay.co.kr\/v2/gi,e)},setVersion(e,t,r=void 0){this.sdkName=void 0===this.sdkNames[t]?0:this.sdkNames[t],this.sdkVersion=e,this.packageVersion=void 0===r||""===r?R:r},toApi(e){return[this.API_URL[this.mode],e].join("/")},toDoor(e){return[this.DOOR_URL[this.mode],e].join("/")},toWidget(e){return[this.WIDGET_URL[this.mode],e].join("/")},isMobile(){if("undefined"==typeof window)return!1;const e=window.navigator.userAgent||window.navigator.vendor;return/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/.test(e)},isMobileSafari(){if("undefined"==typeof window)return!1;const e=window.navigator.userAgent;return(e.match(/iPad/i)||e.match(/iPhone/i))&&!e.match(/CriOS/i)},toAnalytics(e){return[this.ANALYTICS_URL[this.mode],e].join("/")}};class D extends Error{constructor(e){super(),this.name="BootpayEventError",this.eventMessage=e}}const B={__BOOTPAY_NAMESPACE:{},isBind:!1,initialize(){this.isBind||("undefined"!=typeof window&&(window.addBootpayEventListener=this.on,window.removeBootpayEventListener=this.off,window.resetBootpayEventListener=function(e,t,r){this.removeBootpayEventListener(e).addBootpayEventListener(e,t,r)}),"undefined"!=typeof document&&(document.addBootpayEventListener=this.on,document.removeBootpayEventListener=this.off,document.resetBootpayEventListener=function(e,t,r){this.removeBootpayEventListener(e).addBootpayEventListener(e,t,r)}),"undefined"!=typeof Element&&(Element.prototype.addBootpayEventListener=this.on,Element.prototype.removeBootpayEventListener=this.off,Element.prototype.resetBootpayEventListener=function(e,t,r){this.removeBootpayEventListener(e).addBootpayEventListener(e,t,r)}),this.isBind=!0)},on(e,t,r=void 0){return d(B.__BOOTPAY_NAMESPACE)&&(B.__BOOTPAY_NAMESPACE={}),this.addEventListener(e.split(".")[0],t,r||!1),B.__BOOTPAY_NAMESPACE[e]=t,this},off(e){return l(B.__BOOTPAY_NAMESPACE)&&l(B.__BOOTPAY_NAMESPACE[e])&&this.removeEventListener(e.split(".")[0],B.__BOOTPAY_NAMESPACE[e]),this}};class C extends k{constructor(){super(),this.$resolve=null,this.$reject=null,B.initialize()}reject(e){null!==this.$reject&&this.$reject(e)}resolve(e){null!==this.$resolve&&this.$resolve(e)}setCallbackFunction(e,t){this.$resolve=e,this.$reject=t}parseEvent(e){let t={};if(this.$present(e)&&this.$type(e,"string")){try{t=JSON.parse(e)}catch(r){O.info("json parsing failed",`data: ${e}, message: ${M(r)} JSON 파싱 형태가 아닌 이벤트 입니다.`)}return t.bootpay_event?(delete t.bootpay_event,t):null}return null}}const M=e=>"string"==typeof e?e.toUpperCase():e instanceof Error?e.message:e;class N extends k{constructor(){super(),this.$windowId="",this.$template=""}byId(e){return document.getElementById(e)}createTemplateHtml(){null===this.byId(this.$windowId)&&document.body.insertAdjacentHTML("beforeend",this.$template)}bodyOpen(){const e=document.querySelector("body");this.$present(e.className)?e.className=`${e.className} bootpay-open`:e.className="bootpay-open"}templateResize(e,t){const r=this.byId(e);if(void 0!==r)for(let n in Object.keys(t)){let e=Object.keys(t)[n],i=t[e];this.$present(i)&&!String(i).match(/%/)&&(e.match(/width/)||e.match(/Width/)||e.match(/height/)||e.match(/Height/))&&(i=`${String(t[e]).replace(/px/gi,"")}px`),r.style.setProperty(e,i)}}}const F=new class extends N{constructor(){super(),this.$alfredId="bootpay-alfred-progress-id",this.$alfredTextId="__alfred-text-message__"}template(e){return`\n<div class="bootpay-progress-background" id="${this.$alfredId}" style="display: none;">\n<div class="progress-message-window">\n <div class="alfred-loading">\n <div class="bootpay-spinner"></div> \n </div>\n <div class="alfred-text">\n <span class="alfred-inner-text" id="${this.$alfredTextId}">${e}</span>\n </div>\n</div> \n</div>\n `}showProgress(e){this.$present(this.byId(this.$alfredId))?this.byId(this.$alfredTextId).innerText=e:document.body.insertAdjacentHTML("beforeend",this.template(e)),this.byId(this.$alfredId).style.setProperty("display","block")}hideProgress(){try{this.byId(this.$alfredId).outerHTML=""}catch(e){}}};var j={exports:{}},L=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}},W=L,H=Object.prototype.toString,q=function(e){return function(t){var r=H.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function z(e){return e=e.toLowerCase(),function(t){return q(t)===e}}function K(e){return Array.isArray(e)}function J(e){return void 0===e}var G=z("ArrayBuffer");function V(e){return null!==e&&"object"==typeof e}function Y(e){if("object"!==q(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var X=z("Date"),Q=z("File"),Z=z("Blob"),ee=z("FileList");function te(e){return"[object Function]"===H.call(e)}var re=z("URLSearchParams");function ne(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),K(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var ie=function(e){return function(t){return e&&t instanceof e}}("undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array)),se={isArray:K,isArrayBuffer:G,isBuffer:function(e){return null!==e&&!J(e)&&null!==e.constructor&&!J(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||H.call(e)===t||te(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&G(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:V,isPlainObject:Y,isUndefined:J,isDate:X,isFile:Q,isBlob:Z,isFunction:te,isStream:function(e){return V(e)&&te(e.pipe)},isURLSearchParams:re,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:ne,merge:function e(){var t={};function r(r,n){Y(t[n])&&Y(r)?t[n]=e(t[n],r):Y(r)?t[n]=e({},r):K(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)ne(arguments[n],r);return t},extend:function(e,t,r){return ne(t,(function(t,n){e[n]=r&&"function"==typeof t?W(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,n){e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r){var n,i,s,o={};t=t||{};do{for(i=(n=Object.getOwnPropertyNames(e)).length;i-- >0;)o[s=n[i]]||(t[s]=e[s],o[s]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:q,kindOfTest:z,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;var t=e.length;if(J(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:ie,isFileList:ee},oe=se;function ae(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var ce=function(e,t,r){if(!t)return e;var n;if(r)n=r(t);else if(oe.isURLSearchParams(t))n=t.toString();else{var i=[];oe.forEach(t,(function(e,t){null!=e&&(oe.isArray(e)?t+="[]":e=[e],oe.forEach(e,(function(e){oe.isDate(e)?e=e.toISOString():oe.isObject(e)&&(e=JSON.stringify(e)),i.push(ae(t)+"="+ae(e))})))})),n=i.join("&")}if(n){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e},de=se;function le(){this.handlers=[]}le.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},le.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},le.prototype.forEach=function(e){de.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var ue=le,pe=se,he=se;function me(e,t,r,n,i){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}he.inherits(me,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var ye=me.prototype,fe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){fe[e]={value:e}})),Object.defineProperties(me,fe),Object.defineProperty(ye,"isAxiosError",{value:!0}),me.from=function(e,t,r,n,i,s){var o=Object.create(ye);return he.toFlatObject(e,o,(function(e){return e!==Error.prototype})),me.call(o,e.message,t,r,n,i),o.name=e.name,s&&Object.assign(o,s),o};var ge=me,ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_e=se;var we,be,$e,Ee,ke=function(e,t){t=t||new FormData;var r=[];function n(e){return null===e?"":_e.isDate(e)?e.toISOString():_e.isArrayBuffer(e)||_e.isTypedArray(e)?"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}return function e(i,s){if(_e.isPlainObject(i)||_e.isArray(i)){if(-1!==r.indexOf(i))throw Error("Circular reference detected in "+s);r.push(i),_e.forEach(i,(function(r,i){if(!_e.isUndefined(r)){var o,a=s?s+"."+i:i;if(r&&!s&&"object"==typeof r)if(_e.endsWith(i,"{}"))r=JSON.stringify(r);else if(_e.endsWith(i,"[]")&&(o=_e.toArray(r)))return void o.forEach((function(e){!_e.isUndefined(e)&&t.append(a,n(e))}));e(r,a)}})),r.pop()}else t.append(s,n(i))}(e),t};var Pe,Ie,Se,Te,Oe,xe,Ae,Re,Ue,De,Be,Ce,Me=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},Ne=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},Fe=function(e,t){return e&&!Me(t)?Ne(e,t):t};function je(){if(xe)return Oe;xe=1;var e=ge;function t(t){e.call(this,null==t?"canceled":t,e.ERR_CANCELED),this.name="CanceledError"}return se.inherits(t,e,{__CANCEL__:!0}),Oe=t}function Le(){if(De)return Ue;De=1;var e=se,t=function(){if(be)return we;be=1;var e=ge;return we=function(t,r,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?r(new e("Request failed with status code "+n.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}}(),r=function(){if(Ee)return $e;Ee=1;var e=se;return $e=e.isStandardBrowserEnv()?function(){return{write:function(t,r,n,i,s,o){var a=[];a.push(t+"="+encodeURIComponent(r)),e.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),e.isString(i)&&a.push("path="+i),e.isString(s)&&a.push("domain="+s),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()}(),n=ce,i=Fe,s=function(){if(Ie)return Pe;Ie=1;var e=se,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Pe=function(r){var n,i,s,o={};return r?(e.forEach(r.split("\n"),(function(r){if(s=r.indexOf(":"),n=e.trim(r.substr(0,s)).toLowerCase(),i=e.trim(r.substr(s+1)),n){if(o[n]&&t.indexOf(n)>=0)return;o[n]="set-cookie"===n?(o[n]?o[n]:[]).concat([i]):o[n]?o[n]+", "+i:i}})),o):o}}(),o=function(){if(Te)return Se;Te=1;var e=se;return Se=e.isStandardBrowserEnv()?function(){var t,r=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var t=e;return r&&(n.setAttribute("href",t),t=n.href),n.setAttribute("href",t),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=i(window.location.href),function(r){var n=e.isString(r)?i(r):r;return n.protocol===t.protocol&&n.host===t.host}}():function(){return function(){return!0}}()}(),a=ve,c=ge,d=je(),l=Re?Ae:(Re=1,Ae=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""});return Ue=function(u){return new Promise((function(p,h){var m,y=u.data,f=u.headers,g=u.responseType;function v(){u.cancelToken&&u.cancelToken.unsubscribe(m),u.signal&&u.signal.removeEventListener("abort",m)}e.isFormData(y)&&e.isStandardBrowserEnv()&&delete f["Content-Type"];var _=new XMLHttpRequest;if(u.auth){var w=u.auth.username||"",b=u.auth.password?unescape(encodeURIComponent(u.auth.password)):"";f.Authorization="Basic "+btoa(w+":"+b)}var $=i(u.baseURL,u.url);function E(){if(_){var e="getAllResponseHeaders"in _?s(_.getAllResponseHeaders()):null,r={data:g&&"text"!==g&&"json"!==g?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:e,config:u,request:_};t((function(e){p(e),v()}),(function(e){h(e),v()}),r),_=null}}if(_.open(u.method.toUpperCase(),n($,u.params,u.paramsSerializer),!0),_.timeout=u.timeout,"onloadend"in _?_.onloadend=E:_.onreadystatechange=function(){_&&4===_.readyState&&(0!==_.status||_.responseURL&&0===_.responseURL.indexOf("file:"))&&setTimeout(E)},_.onabort=function(){_&&(h(new c("Request aborted",c.ECONNABORTED,u,_)),_=null)},_.onerror=function(){h(new c("Network Error",c.ERR_NETWORK,u,_,_)),_=null},_.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",t=u.transitional||a;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),h(new c(e,t.clarifyTimeoutError?c.ETIMEDOUT:c.ECONNABORTED,u,_)),_=null},e.isStandardBrowserEnv()){var k=(u.withCredentials||o($))&&u.xsrfCookieName?r.read(u.xsrfCookieName):void 0;k&&(f[u.xsrfHeaderName]=k)}"setRequestHeader"in _&&e.forEach(f,(function(e,t){void 0===y&&"content-type"===t.toLowerCase()?delete f[t]:_.setRequestHeader(t,e)})),e.isUndefined(u.withCredentials)||(_.withCredentials=!!u.withCredentials),g&&"json"!==g&&(_.responseType=u.responseType),"function"==typeof u.onDownloadProgress&&_.addEventListener("progress",u.onDownloadProgress),"function"==typeof u.onUploadProgress&&_.upload&&_.upload.addEventListener("progress",u.onUploadProgress),(u.cancelToken||u.signal)&&(m=function(e){_&&(h(!e||e&&e.type?new d:e),_.abort(),_=null)},u.cancelToken&&u.cancelToken.subscribe(m),u.signal&&(u.signal.aborted?m():u.signal.addEventListener("abort",m))),y||(y=null);var P=l($);P&&-1===["http","https","file"].indexOf(P)?h(new c("Unsupported protocol "+P+":",c.ERR_BAD_REQUEST,u)):_.send(y)}))}}var We=se,He=function(e,t){pe.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))},qe=ge,ze=ke,Ke={"Content-Type":"application/x-www-form-urlencoded"};function Je(e,t){!We.isUndefined(e)&&We.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Ge,Ve={transitional:ve,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Ge=Le()),Ge),transformRequest:[function(e,t){if(He(t,"Accept"),He(t,"Content-Type"),We.isFormData(e)||We.isArrayBuffer(e)||We.isBuffer(e)||We.isStream(e)||We.isFile(e)||We.isBlob(e))return e;if(We.isArrayBufferView(e))return e.buffer;if(We.isURLSearchParams(e))return Je(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,n=We.isObject(e),i=t&&t["Content-Type"];if((r=We.isFileList(e))||n&&"multipart/form-data"===i){var s=this.env&&this.env.FormData;return ze(r?{"files[]":e}:e,s&&new s)}return n||"application/json"===i?(Je(t,"application/json"),function(e,t,r){if(We.isString(e))try{return(t||JSON.parse)(e),We.trim(e)}catch(n){if("SyntaxError"!==n.name)throw n}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Ve.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,i=!r&&"json"===this.responseType;if(i||n&&We.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(i){if("SyntaxError"===s.name)throw qe.from(s,qe.ERR_BAD_RESPONSE,this,null,this.response);throw s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ce?Be:(Ce=1,Be=null)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};We.forEach(["delete","get","head"],(function(e){Ve.headers[e]={}})),We.forEach(["post","put","patch"],(function(e){Ve.headers[e]=We.merge(Ke)}));var Ye,Xe,Qe=Ve,Ze=se,et=Qe;function tt(){return Xe?Ye:(Xe=1,Ye=function(e){return!(!e||!e.__CANCEL__)})}var rt=se,nt=function(e,t,r){var n=this||et;return Ze.forEach(r,(function(r){e=r.call(n,e,t)})),e},it=tt(),st=Qe,ot=je();function at(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ot}var ct,dt,lt=se,ut=function(e,t){t=t||{};var r={};function n(e,t){return lt.isPlainObject(e)&&lt.isPlainObject(t)?lt.merge(e,t):lt.isPlainObject(t)?lt.merge({},t):lt.isArray(t)?t.slice():t}function i(r){return lt.isUndefined(t[r])?lt.isUndefined(e[r])?void 0:n(void 0,e[r]):n(e[r],t[r])}function s(e){if(!lt.isUndefined(t[e]))return n(void 0,t[e])}function o(r){return lt.isUndefined(t[r])?lt.isUndefined(e[r])?void 0:n(void 0,e[r]):n(void 0,t[r])}function a(r){return r in t?n(e[r],t[r]):r in e?n(void 0,e[r]):void 0}var c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a};return lt.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||i,n=t(e);lt.isUndefined(n)&&t!==a||(r[e]=n)})),r};function pt(){return dt?ct:(dt=1,ct={version:"0.27.2"})}var ht=pt().version,mt=ge,yt={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){yt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var ft={};yt.transitional=function(e,t,r){function n(e,t){return"[Axios v"+ht+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,i,s){if(!1===e)throw new mt(n(i," has been removed"+(t?" in "+t:"")),mt.ERR_DEPRECATED);return t&&!ft[i]&&(ft[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,s)}};var gt,vt,_t,wt,bt,$t,Et=se,kt=ce,Pt=ue,It=function(e){return at(e),e.headers=e.headers||{},e.data=nt.call(e,e.data,e.headers,e.transformRequest),e.headers=rt.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),rt.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||st.adapter)(e).then((function(t){return at(e),t.data=nt.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return it(t)||(at(e),t&&t.response&&(t.response.data=nt.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},St=ut,Tt=Fe,Ot={assertOptions:function(e,t,r){if("object"!=typeof e)throw new mt("options must be an object",mt.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),i=n.length;i-- >0;){var s=n[i],o=t[s];if(o){var a=e[s],c=void 0===a||o(a,s,e);if(!0!==c)throw new mt("option "+s+" must be "+c,mt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new mt("Unknown option "+s,mt.ERR_BAD_OPTION)}},validators:yt},xt=Ot.validators;function At(e){this.defaults=e,this.interceptors={request:new Pt,response:new Pt}}At.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=St(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&Ot.assertOptions(r,{silentJSONParsing:xt.transitional(xt.boolean),forcedJSONParsing:xt.transitional(xt.boolean),clarifyTimeoutError:xt.transitional(xt.boolean)},!1);var n=[],i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var s,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!i){var a=[It,void 0];for(Array.prototype.unshift.apply(a,n),a=a.concat(o),s=Promise.resolve(t);a.length;)s=s.then(a.shift(),a.shift());return s}for(var c=t;n.length;){var d=n.shift(),l=n.shift();try{c=d(c)}catch(u){l(u);break}}try{s=It(c)}catch(u){return Promise.reject(u)}for(;o.length;)s=s.then(o.shift(),o.shift());return s},At.prototype.getUri=function(e){e=St(this.defaults,e);var t=Tt(e.baseURL,e.url);return kt(t,e.params,e.paramsSerializer)},Et.forEach(["delete","get","head","options"],(function(e){At.prototype[e]=function(t,r){return this.request(St(r||{},{method:e,url:t,data:(r||{}).data}))}})),Et.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(St(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}At.prototype[e]=t(),At.prototype[e+"Form"]=t(!0)}));var Rt=se,Ut=L,Dt=At,Bt=ut;var Ct=function e(t){var r=new Dt(t),n=Ut(Dt.prototype.request,r);return Rt.extend(n,Dt.prototype,r),Rt.extend(n,r),n.create=function(r){return e(Bt(t,r))},n}(Qe);Ct.Axios=Dt,Ct.CanceledError=je(),Ct.CancelToken=function(){if(vt)return gt;vt=1;var e=je();function t(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var r;this.promise=new Promise((function(e){r=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t<r;t++)n._listeners[t](e);n._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},t((function(t){n.reason||(n.reason=new e(t),r(n.reason))}))}return t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},t.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},t.source=function(){var e;return{token:new t((function(t){e=t})),cancel:e}},gt=t}(),Ct.isCancel=tt(),Ct.VERSION=pt().version,Ct.toFormData=ke,Ct.AxiosError=ge,Ct.Cancel=Ct.CanceledError,Ct.all=function(e){return Promise.all(e)},Ct.spread=wt?_t:(wt=1,_t=function(e){return function(t){return e.apply(null,t)}}),Ct.isAxiosError=function(){if($t)return bt;$t=1;var e=se;return bt=function(t){return e.isObject(t)&&!0===t.isAxiosError}}(),j.exports=Ct,j.exports.default=Ct;const Mt=h(j.exports);var Nt,Ft={exports:{}},jt={exports:{}};function Lt(){return Nt||(Nt=1,function(e,t){var r;e.exports=(r=_(),function(e){var t=r,n=t.lib,i=n.WordArray,s=n.Hasher,o=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=o.MD5=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var s=this._hash.words,o=e[t+0],c=e[t+1],h=e[t+2],m=e[t+3],y=e[t+4],f=e[t+5],g=e[t+6],v=e[t+7],_=e[t+8],w=e[t+9],b=e[t+10],$=e[t+11],E=e[t+12],k=e[t+13],P=e[t+14],I=e[t+15],S=s[0],T=s[1],O=s[2],x=s[3];S=d(S,T,O,x,o,7,a[0]),x=d(x,S,T,O,c,12,a[1]),O=d(O,x,S,T,h,17,a[2]),T=d(T,O,x,S,m,22,a[3]),S=d(S,T,O,x,y,7,a[4]),x=d(x,S,T,O,f,12,a[5]),O=d(O,x,S,T,g,17,a[6]),T=d(T,O,x,S,v,22,a[7]),S=d(S,T,O,x,_,7,a[8]),x=d(x,S,T,O,w,12,a[9]),O=d(O,x,S,T,b,17,a[10]),T=d(T,O,x,S,$,22,a[11]),S=d(S,T,O,x,E,7,a[12]),x=d(x,S,T,O,k,12,a[13]),O=d(O,x,S,T,P,17,a[14]),S=l(S,T=d(T,O,x,S,I,22,a[15]),O,x,c,5,a[16]),x=l(x,S,T,O,g,9,a[17]),O=l(O,x,S,T,$,14,a[18]),T=l(T,O,x,S,o,20,a[19]),S=l(S,T,O,x,f,5,a[20]),x=l(x,S,T,O,b,9,a[21]),O=l(O,x,S,T,I,14,a[22]),T=l(T,O,x,S,y,20,a[23]),S=l(S,T,O,x,w,5,a[24]),x=l(x,S,T,O,P,9,a[25]),O=l(O,x,S,T,m,14,a[26]),T=l(T,O,x,S,_,20,a[27]),S=l(S,T,O,x,k,5,a[28]),x=l(x,S,T,O,h,9,a[29]),O=l(O,x,S,T,v,14,a[30]),S=u(S,T=l(T,O,x,S,E,20,a[31]),O,x,f,4,a[32]),x=u(x,S,T,O,_,11,a[33]),O=u(O,x,S,T,$,16,a[34]),T=u(T,O,x,S,P,23,a[35]),S=u(S,T,O,x,c,4,a[36]),x=u(x,S,T,O,y,11,a[37]),O=u(O,x,S,T,v,16,a[38]),T=u(T,O,x,S,b,23,a[39]),S=u(S,T,O,x,k,4,a[40]),x=u(x,S,T,O,o,11,a[41]),O=u(O,x,S,T,m,16,a[42]),T=u(T,O,x,S,g,23,a[43]),S=u(S,T,O,x,w,4,a[44]),x=u(x,S,T,O,E,11,a[45]),O=u(O,x,S,T,I,16,a[46]),S=p(S,T=u(T,O,x,S,h,23,a[47]),O,x,o,6,a[48]),x=p(x,S,T,O,v,10,a[49]),O=p(O,x,S,T,P,15,a[50]),T=p(T,O,x,S,f,21,a[51]),S=p(S,T,O,x,E,6,a[52]),x=p(x,S,T,O,m,10,a[53]),O=p(O,x,S,T,b,15,a[54]),T=p(T,O,x,S,c,21,a[55]),S=p(S,T,O,x,_,6,a[56]),x=p(x,S,T,O,I,10,a[57]),O=p(O,x,S,T,g,15,a[58]),T=p(T,O,x,S,k,21,a[59]),S=p(S,T,O,x,y,6,a[60]),x=p(x,S,T,O,$,10,a[61]),O=p(O,x,S,T,h,15,a[62]),T=p(T,O,x,S,w,21,a[63]),s[0]=s[0]+S|0,s[1]=s[1]+T|0,s[2]=s[2]+O|0,s[3]=s[3]+x|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var s=e.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,c=a.words,d=0;d<4;d++){var l=c[d];c[d]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}});function d(e,t,r,n,i,s,o){var a=e+(t&r|~t&n)+i+o;return(a<<s|a>>>32-s)+t}function l(e,t,r,n,i,s,o){var a=e+(t&n|r&~n)+i+o;return(a<<s|a>>>32-s)+t}function u(e,t,r,n,i,s,o){var a=e+(t^r^n)+i+o;return(a<<s|a>>>32-s)+t}function p(e,t,r,n,i,s,o){var a=e+(r^(t|~n))+i+o;return(a<<s|a>>>32-s)+t}t.MD5=s._createHelper(c),t.HmacMD5=s._createHmacHelper(c)}(Math),r.MD5)}(jt)),jt.exports}var Wt,Ht={exports:{}},qt={exports:{}};function zt(){return Wt||(Wt=1,function(e,t){var r,n,i,s,o,a,c,d;e.exports=(d=_(),n=(r=d).lib,i=n.WordArray,s=n.Hasher,o=r.algo,a=[],c=o.SHA1=s.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],s=r[2],o=r[3],c=r[4],d=0;d<80;d++){if(d<16)a[d]=0|e[t+d];else{var l=a[d-3]^a[d-8]^a[d-14]^a[d-16];a[d]=l<<1|l>>>31}var u=(n<<5|n>>>27)+c+a[d];u+=d<20?1518500249+(i&s|~i&o):d<40?1859775393+(i^s^o):d<60?(i&s|i&o|s&o)-1894007588:(i^s^o)-899497514,c=o,o=s,s=i<<30|i>>>2,i=n,n=u}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+s|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=s._createHelper(c),r.HmacSHA1=s._createHmacHelper(c),d.SHA1)}(qt)),qt.exports}var Kt,Jt,Gt={exports:{}};function Vt(){return Jt||(Jt=1,function(e,t){var r,n,i,s,o,a,c,d;e.exports=(d=_(),zt(),Kt||(Kt=1,function(e,t){var r,n,i;e.exports=(n=(r=_()).lib.Base,i=r.enc.Utf8,void(r.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var s=this._oKey=t.clone(),o=this._iKey=t.clone(),a=s.words,c=o.words,d=0;d<r;d++)a[d]^=1549556828,c[d]^=909522486;s.sigBytes=o.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))}(Gt)),Gt.exports,n=(r=d).lib,i=n.Base,s=n.WordArray,o=r.algo,a=o.MD5,c=o.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,i=n.hasher.create(),o=s.create(),a=o.words,c=n.keySize,d=n.iterations;a.length<c;){r&&i.update(r),r=i.update(e).finalize(t),i.reset();for(var l=1;l<d;l++)r=i.finalize(r),i.reset();o.concat(r)}return o.sigBytes=4*c,o}}),r.EvpKDF=function(e,t,r){return c.create(r).compute(e,t)},d.EvpKDF)}(Ht)),Ht.exports}var Yt,Xt={exports:{}};!function(e,t){var r;e.exports=(r=_(),Lt(),Vt(),Yt||(Yt=1,function(e,t){var r;e.exports=(r=_(),Vt(),void(r.lib.Cipher||function(e){var t=r,n=t.lib,i=n.Base,s=n.WordArray,o=n.BufferedBlockAlgorithm,a=t.enc;a.Utf8;var c=a.Base64,d=t.algo.EvpKDF,l=n.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?_:g}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()});n.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=t.mode={},p=n.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),h=u.CBC=function(){var t=p.extend();function r(t,r,n){var i,s=this._iv;s?(i=s,this._iv=e):i=this._prevBlock;for(var o=0;o<n;o++)t[r+o]^=i[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize;r.call(this,e,t,i),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,s=e.slice(t,t+i);n.decryptBlock(e,t),r.call(this,e,t,i),this._prevBlock=s}}),t}(),m=(t.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,o=[],a=0;a<n;a+=4)o.push(i);var c=s.create(o,n);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};n.BlockCipher=l.extend({cfg:l.cfg.extend({mode:h,padding:m}),reset:function(){var e;l.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var y=n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),f=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?s.create([1398893684,1701076831]).concat(r).concat(t):t).toString(c)},parse:function(e){var t,r=c.parse(e),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=s.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),y.create({ciphertext:r,salt:t})}},g=n.SerializableCipher=i.extend({cfg:i.extend({format:f}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),s=i.finalize(t),o=i.cfg;return y.create({ciphertext:s,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),v=(t.kdf={}).OpenSSL={execute:function(e,t,r,n){n||(n=s.random(8));var i=d.create({keySize:t+r}).compute(e,n),o=s.create(i.words.slice(t),4*r);return i.sigBytes=4*t,y.create({key:i,iv:o,salt:n})}},_=n.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:v}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var s=g.encrypt.call(this,e,t,i.key,n);return s.mixIn(i),s},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,g.decrypt.call(this,e,t,i.key,n)}})}()))}(Xt)),function(){var e=r,t=e.lib.BlockCipher,n=e.algo,i=[],s=[],o=[],a=[],c=[],d=[],l=[],u=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var m=n^n<<1^n<<2^n<<3^n<<4;m=m>>>8^255&m^99,i[r]=m,s[m]=r;var y=e[r],f=e[y],g=e[f],v=257*e[m]^16843008*m;o[r]=v<<24|v>>>8,a[r]=v<<16|v>>>16,c[r]=v<<8|v>>>24,d[r]=v,v=16843009*g^65537*f^257*y^16843008*r,l[m]=v<<24|v>>>8,u[m]=v<<16|v>>>16,p[m]=v<<8|v>>>24,h[m]=v,r?(r=y^e[e[e[g^y]]],n^=e[e[n]]):r=n=1}}();var m=[0,1,2,4,8,16,32,64,128,27,54],y=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),s=this._keySchedule=[],o=0;o<n;o++)o<r?s[o]=t[o]:(d=s[o-1],o%r?r>6&&o%r==4&&(d=i[d>>>24]<<24|i[d>>>16&255]<<16|i[d>>>8&255]<<8|i[255&d]):(d=i[(d=d<<8|d>>>24)>>>24]<<24|i[d>>>16&255]<<16|i[d>>>8&255]<<8|i[255&d],d^=m[o/r|0]<<24),s[o]=s[o-r]^d);for(var a=this._invKeySchedule=[],c=0;c<n;c++){if(o=n-c,c%4)var d=s[o];else d=s[o-4];a[c]=c<4||o<=4?d:l[i[d>>>24]]^u[i[d>>>16&255]]^p[i[d>>>8&255]]^h[i[255&d]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,c,d,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,u,p,h,s),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,s,o,a){for(var c=this._nRounds,d=e[t]^r[0],l=e[t+1]^r[1],u=e[t+2]^r[2],p=e[t+3]^r[3],h=4,m=1;m<c;m++){var y=n[d>>>24]^i[l>>>16&255]^s[u>>>8&255]^o[255&p]^r[h++],f=n[l>>>24]^i[u>>>16&255]^s[p>>>8&255]^o[255&d]^r[h++],g=n[u>>>24]^i[p>>>16&255]^s[d>>>8&255]^o[255&l]^r[h++],v=n[p>>>24]^i[d>>>16&255]^s[l>>>8&255]^o[255&u]^r[h++];d=y,l=f,u=g,p=v}y=(a[d>>>24]<<24|a[l>>>16&255]<<16|a[u>>>8&255]<<8|a[255&p])^r[h++],f=(a[l>>>24]<<24|a[u>>>16&255]<<16|a[p>>>8&255]<<8|a[255&d])^r[h++],g=(a[u>>>24]<<24|a[p>>>16&255]<<16|a[d>>>8&255]<<8|a[255&l])^r[h++],v=(a[p>>>24]<<24|a[d>>>16&255]<<16|a[l>>>8&255]<<8|a[255&u])^r[h++],e[t]=y,e[t+1]=f,e[t+2]=g,e[t+3]=v},keySize:8});e.AES=t._createHelper(y)}(),r.AES)}(Ft);const Qt=h(Ft.exports);class Zt{constructor(){this.$http=Mt.create({timeout:6e4})}static encryptParams(e){u(e,"object")&&(e=JSON.stringify(e));let t=Qt.encrypt(e,c());return{payload:t.ciphertext.toString(E),token:`${t.key.toString(E)}##${t.iv.toString(E)}`}}static toUnderscore(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}static toCamelcase(e){return e.replace(/(\_[a-z])/g,(function(e){return e.toUpperCase().replace(/_/g,"")}))}static objectKeyToUnderscore(e){let t;return l(e)&&(Array.isArray(e)?(t=[],e.forEach((e=>{let r={};Object.keys(e).forEach((t=>{r[this.toUnderscore(t)]=e[t]})),t.push(r)}))):(t={},Object.keys(e).forEach((r=>{t[this.toUnderscore(r)]=e[r]})))),t}static objectKeyToCamel(e){let t;return l(e)&&(Array.isArray(e)?(t=[],e.forEach((e=>{let r={};Object.keys(e).forEach((t=>{r[this.toCamelcase(t)]=e[t]})),t.push(r)}))):(t={},Object.keys(e).forEach((r=>{u(e[r],"object")&&Object.keys(e[r]).length>0?t[this.toCamelcase(r)]=this.objectKeyToCamel(e[r]):t[this.toCamelcase(r)]=e[r]})))),t}static axiosMultipayConfigure(){Mt.defaults.headers.common["Content-Type"]="application/json",Mt.defaults.headers.common.Accept="application/json",Mt.interceptors.request.use((e=>(l(e.data),this.isHttpBodyUsedMethod(e.method)&&(e.data=Zt.encryptParams(Zt.objectKeyToUnderscore(e.data))),void 0!==e.headers&&l(e.headers.progress)&&delete e.headers.progress,e)),(e=>Promise.reject(e))),Mt.interceptors.response.use((e=>e),(function(e){if(l(e.response)){let t=e.response.data;return t.status=e.response.status,Promise.reject(t)}return Promise.reject(e)}))}static isHttpBodyUsedMethod(e){return["post","put"].indexOf(e)>-1}}Zt.axiosMultipayConfigure();const er=new class extends Zt{constructor(){super()}pollingStatus(e,t,r,n){return o(this,null,(function*(){try{const i=yield this.$http.get([e,"s",t].join("/"),{params:{application_id:r,tk:n}});return Promise.resolve(i)}catch(i){return Promise.reject(i)}}))}};const tr=new class extends C{constructor(){super(),this.$messageEventName="message.BootpayPaymentEvent",this.$eventPrefix="bootpay",this.$pollingInterval=void 0,this.$pollingData={applicationId:"",gatewayUrl:"",receiptId:"",transactionKey:""},this.$pollingEvent=er,this.pollingInterval=3e3,this.isDone=!1}bind(e,t){this.isDone=!1,this.setCallbackFunction(e,t),window.resetBootpayEventListener(this.$messageEventName,(e=>{const t=this.parseEvent(e.data);if(O.debug("event received",JSON.stringify(t)),l(t))switch(O.debug("event",t),t.event){case"error":case"cancel":return this.reject({event:t.event,pg_error_code:t.pg_error_code,error_code:t.error_code,message:t.message,payload:t.payload});case"confirm":return this.resolve({event:t.event,receipt_id:t.receipt_id,gateway_url:t.gateway_url,order_id:t.order_id});case"redirect":return ir.destroy(),void(location.href=t.url);case"moveRedirectUrl":ir.hidePaymentiFrame(),F.showProgress("결제 진행 중입니다. 잠시만 기다려주세요."),location.replace(`${t.url}?${t.parameters}`),setTimeout((()=>{ir.destroy()}),5e3);break;case"polling":return void 0!==this.$pollingData&&(this.$pollingData.receiptId=t.receipt_id,this.$pollingData.gatewayUrl=t.gateway_url),this.startPollingEvent();case"issued":case"done":if(!this.isDone)return this.isDone=!0,this.clearPollingEvent(),this.resolve(t);break;case"iFrameStyle":ir.iFrameSetStyle(t.styles);break;case"windowStyle":ir.windowStyle(t.styles);break;case"hideProgress":F.hideProgress();break;case"showProgress":F.showProgress(t.message);break;case"resize":ir.iFrameResize(t.resizeData);break;case"hidePayment":ir.closePopup(),ir.hidePaymentiFrame();break;case"showPayment":ir.showPaymentiFrame(!!this.$present(t.showCloseButton)&&t.showCloseButton);break;case"popup":ir.createPopupButton({gatewayUrl:t.url,receiptId:t.receipt_id,name:t.name,price:t.price});break;case"close":ir.destroy();break;default:return}}))}setDefaultPaymentData(e,t){void 0!==this.$pollingData&&(this.$pollingData.applicationId=e,this.$pollingData.transactionKey=t)}callBootpayDOMEvent(e,t=void 0){document.dispatchEvent(new CustomEvent([this.$eventPrefix,e].join(""),{detail:t}))}startPollingEvent(){this.$pollingInterval=setInterval((()=>o(this,null,(function*(){if(void 0!==this.$pollingData)try{const e=yield this.$pollingEvent.pollingStatus(this.$pollingData.gatewayUrl,this.$pollingData.receiptId,this.$pollingData.applicationId,this.$pollingData.transactionKey);let t={bootpay_event:!0,event:"",data:e.data};if(void 0!==e.data){if(O.debug("polling event",`receive data: ${JSON.stringify(t)}`),1===e.data.status)return t.event="done",window.postMessage(JSON.stringify(t),"*");if(5===e.data.status)return t.event="issued",window.postMessage(JSON.stringify(t),"*")}}catch(e){return this.reject({error_code:"RC_RECEIPT_POLLING_INVALID",message:"결제 상태 체크에 실패하였습니다."})}}))),this.pollingInterval)}clearPollingEvent(){void 0!==this.$pollingInterval&&clearInterval(this.$pollingInterval),this.$pollingInterval=void 0,this.$pollingData={applicationId:"",gatewayUrl:"",receiptId:"",transactionKey:""}}allClearEvent(){this.clearPollingEvent(),window.removeBootpayEventListener(this.$messageEventName)}};const rr=new class extends Zt{constructor(){super(),this.$session=A,this.$applicationId=void 0,this.$tk=void 0,this.$platformType=1,this.$receiptId=void 0}setTokenKey(e){this.$tk=e}setReceiptId(e){this.$receiptId=e}clearInstance(){this.$applicationId=void 0,this.$receiptId=void 0}send(e){try{if(l(this.$applicationId))return e.application_id=this.$applicationId,e.status=l(e.status)?e.status:1,e.version=R,e.tk=this.$tk,O.debug("send event",`${JSON.stringify(e)} 전송됨`),this.$http.post(U.toAnalytics("event"),e)}catch(t){return}}sendError(e){e.status=-1,this.send(e)}setApplicationId(e){this.$applicationId=e}sendCloseEvent(){if(!l(this.$receiptId))return O.debug("receipt_id","undefined receipt_id"),Promise.resolve();try{return this.$http.put(U.toApi(`close/${this.$receiptId}`))}catch(e){return Promise.reject(e)}}},nr={startProgress:{PAYMENT:{ko:"결제를 시작합니다",en:"Start Payment..."},CARD_SUBSCRIPTION:{ko:"카드정기결제를 시작합니다",en:"Automatic payment will start..."},AUTH:{ko:"본인인증을 시작합니다",en:"Authentication will start..."}},popupLocaleMessage:{message:{ko:"구매 내역에 동의하면 결제를 진행해주세요",en:"If you agree with the purchase details, please proceed with the payment."},button:{ko:"결제계속하기",en:"Continue"}},popupMessage:{message:{PAYMENT:{ko:"구매 내역에 동의하면 결제를 진행해주세요",en:"If you agree with the purchase details, please proceed with the payment"},CARD_SUBSCRIPTION:{ko:'카드 자동결제에 동의하면 "계속하기" 버튼을 눌러 진행해주세요',en:'If you agree to automatic card payment, press the "Continue" button to proceed'},AUTH:{ko:'본인인증에 동의하면 "계속하기" 버튼을 눌러 진행해주세요',en:'If you agree to authenticate yourself, press the "Continue" button to proceed'}},button:{PAYMENT:{ko:"결제계속하기",en:"Continue"},CARD_SUBSCRIPTION:{ko:"계속하기",en:"Continue"},AUTH:{ko:"계속하기",en:"Continue"}}},closeMessage:{PAYMENT:{ko:"결제창을 닫았습니다",en:"Payment window is closed"},CARD_SUBSCRIPTION:{ko:"자동 결제창을 닫았습니다",en:"Automatic Payment window is closed"},AUTH:{ko:"본인인증 창을 닫았습니다",en:"Authenticate window is closed"}},confirmNotYet:{PAYMENT:{ko:"결제 승인준비가 되지 않았습니다",en:"Payment approval not ready "},CARD_SUBSCRIPTION:{ko:"자동결제 승인준비가 되지 않았습니다",en:"Automatic Payment approval not ready"},AUTH:{ko:"본인인증 승인준비가 되지 않았습니다",en:"Authenticate approval not ready"}},notSelectPayment:{ko:"어떤 방법으로 결제할지 선택해주세요",en:"Please, do select payment."},termsNotAgree:{ko:"필수 약관을 모두 동의해주세요",en:"Please agree to all required terms and conditions"},notSelectOOPay:{ko:"간편결제로 결제하려면, 등록된 카드 혹은 계좌를 선택해주세요",en:"Please select a registered card or account to pay with Easy Payment"},getLocaleMessage:(e,t)=>{const r=e.split(".").reduce(((e,t)=>e[t]),nr);return l(r)&&l(r[t])?r[t]:r.ko}};const ir=new class extends N{constructor(){super(),this.mode="PAYMENT",this.modeApiUrl={PAYMENT:"request/payment",CARD_SUBSCRIPTION:"request/subscribe",AUTH:"request/authentication"},this.$formId="bootpay-form",this.$iFrameId="bootpay-iframe-id",this.$windowId="bootpay-window-id",this.$paymentWindowId="bootpay-payment-window-id",this.$confirmFormId="bootpay-confirm-form-id",this.$confirmIFrame="bootpay-confirm-iframe-id",this.$popupWindow="bootpay-popup-window-id",this.$closeButton="bootpay-close-btn",this.$popupItemNameId="bootpay-item-name-id",this.$popupPriceId="bootpay-price-id",this.$popup=void 0,this.$popupWatcher=void 0,this.$popupUrl=void 0,this.$env=U,this.$template=this.template()}template(){return`\n<div id="${this.$windowId}" class="bootpay-payment-background">\n <div class="bootpay-payment-window ${U.isMobile()?"__mobile":""}" id="${this.$paymentWindowId}">\n <button class="bootpay-close-btn" id="${this.$closeButton}" style="display: none;" onclick="Bootpay.dismiss()"></button> \n <form id="${this.$formId}" method="POST">\n </form> \n <iframe id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>\n <div class="bootpay-popup-window" id="${this.$popupWindow}">\n <div class="header">\n <button class="bootpay-close-btn" onclick="Bootpay.dismiss(true)"></button>\n </div>\n <div class="body">\n <h5 id="${this.$popupItemNameId}"></h5>\n <p class="price" id="${this.$popupPriceId}"></p> \n <div class="agree-text">${this.message("popupMessage.message")}</div>\n </div>\n <div class="footer">\n <button class="bootpay-button" onclick="Bootpay.readyToPopup()">\n ${this.message("popupMessage.button")}\n </button> \n </div>\n </div>\n </div>\n <div class="bootpay-confirm-window">\n <form id="${this.$confirmFormId}" method="POST">\n <input type="hidden" name="_method" value="put" /> \n </form>\n <iframe id="${this.$confirmIFrame}" name="${this.$confirmIFrame}"></iframe>\n </div> \n</div>\n `}templateReload(){O.debug("template reload","template reload!"),this.$template=this.template()}start(e,t="PAYMENT"){return o(this,null,(function*(){return new Promise(((r,n)=>{this.mode=t,this.templateReload(),tr.clearPollingEvent(),tr.bind(r,n),tr.setDefaultPaymentData(e.application_id,e.tk),this.createTemplateHtml(),this.bodyOpen(),F.showProgress(this.message("startProgress"));const i=Zt.encryptParams(Zt.objectKeyToUnderscore(e)),s=this.byId(this.$formId);s.innerHTML=`\n <input type="hidden" name="payload" value="${i.payload}" />\n <input type="hidden" name="token" value="${i.token}" />\n `,s.action=this.$env.toApi(this.apiUrl()),this.$present(e.extra)&&e.extra.popup,s.target=this.$iFrameId,s.submit()}))}))}setConfirmFormUrl(e){const t=this.byId(this.$confirmIFrame),r=this.byId(this.$confirmFormId);t.style.setProperty("display","block"),r.target=this.$confirmIFrame,r.action=e}confirm(){return new Promise(((e,t)=>{tr.bind(e,t);const r=this.byId(this.$confirmFormId);if(this.$blank(r.action))throw new D({event:"error",error_code:"RC_CONFIRM_READY_NOT_YET",message:this.message("confirmNotYet")});r.submit()}))}startPaymentUrl(e,t="PAYMENT"){return o(this,null,(function*(){return new Promise(((r,n)=>{this.mode=t,this.templateReload(),tr.clearPollingEvent(),tr.bind(r,n),tr.setDefaultPaymentData(null,null),F.showProgress(this.message("startProgress")),this.createTemplateHtml(),this.bodyOpen();const i=this.byId(this.$formId);i.method="GET",i.action=e,i.target=this.$iFrameId,i.submit()}))}))}createPopupButton(e){F.hideProgress(),this.hidePaymentiFrame(),this.showPopupMessage(e),this.$present(e.gatewayUrl)&&(this.$popupUrl=`${e.gatewayUrl}?popup=1`,rr.setReceiptId(e.receiptId))}readyToPopup(e=void 0){this.hidePopupMessage(),this.closePopup();this.$popup=window.open(this.getPopupUrl(e),"BootPayPopupInstance","width=750,height=500,top=0,left=0,scrollbars=yes,directories=no, status=no, menubar=no, fullscreen=no"),this.$popupWatcher=setInterval((()=>o(this,null,(function*(){if(void 0===this.$popup||this.$popup.closed){try{clearInterval(this.$popupWatcher),yield rr.sendCloseEvent()}catch(e){O.debug("popup",M(e))}return this.$popupUrl=void 0,tr.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:this.message("closeMessage")})}}))),500),this.bindParentEventOnPopup()}closePopup(){if(void 0!==this.$popupWatcher)try{clearInterval(this.$popupWatcher),O.debug("close popup","clear popup interval")}catch(e){O.info("clear popup watcher",M(e))}if(void 0!==this.$popup&&!this.$popup.closed)try{this.$popup.close(),O.debug("close popup","close popup instance")}catch(e){O.info("popup destroy",M(e))}}getPopupUrl(e){return this.$present(e)?e:this.$present(this.$popupUrl)?this.$popupUrl:"about:blank"}bindParentEventOnPopup(){let e="beforeunload.BootpayReloadWatcher";U.isMobileSafari()&&(e="pagehide.BootpayReloadWatcher"),window.resetBootpayEventListener(e,(()=>{if(void 0!==this.$popup&&!this.$popup.closed)try{this.$popup.close()}catch(e){O.info("popup destroy",M(e))}}))}showPaymentiFrame(e=!1){const t=this.byId(this.$iFrameId),r=this.byId(this.$closeButton);void 0!==t&&t.style.setProperty("display","block"),void 0!==r&&e&&r.style.setProperty("display","inline-block")}showPopupMessage(e){const t=this.byId(this.$popupWindow),r=this.byId(this.$popupItemNameId),n=this.byId(this.$popupPriceId);void 0!==t&&t.style.setProperty("display","block"),void 0!==r&&(r.innerText=e.name),void 0!==n&&(parseFloat(e.price)>0?n.innerText=String(e.price):n.remove())}hidePopupMessage(){this.byId(this.$popupWindow).style.setProperty("display","none")}destroy(){this.$present(document.querySelector("body").className)&&(document.querySelector("body").className=document.querySelector("body").className.replace(/bootpay-open/gi,"")),this.$present(this.byId(this.$windowId))&&(this.byId(this.$windowId).outerHTML=""),document.body.classList.remove("bootpay-open"),F.hideProgress(),this.closePopup(),tr.allClearEvent(),rr.clearInstance(),setTimeout((()=>tr.callBootpayDOMEvent("close")),300)}iFrameResize(e){const t=this.byId(this.$iFrameId);if(void 0!==t)for(let r in Object.keys(e)){let n=Object.keys(e)[r],i=e[n];this.$present(i)&&!String(i).match(/%/)&&(n.match(/width/)||n.match(/Width/)||n.match(/height/)||n.match(/Height/))&&(i=`${String(e[n]).replace(/px/gi,"")}px`),String(i).match(/%/)&&!this.byId(this.$paymentWindowId).className.match(/w-100/)&&(this.byId(this.$paymentWindowId).className+=" w-100"),t.style.setProperty(n,i)}}iFrameSetStyle(e){O.debug("change style",e);const t=this.byId(this.$iFrameId);for(let n in Object.keys(e)){let i=Object.keys(e)[n];try{O.debug(i,e[i]),t.style.setProperty(i,e[i])}catch(r){O.warn("iframe style",null==r?void 0:r.message)}}}windowStyle(e){O.debug("change style",e);const t=this.byId(this.$paymentWindowId);for(let n in Object.keys(e)){let i=Object.keys(e)[n];try{O.debug(i,e[i]),t.style.setProperty(i,e[i])}catch(r){O.warn("iframe style",null==r?void 0:r.message)}}}hidePaymentiFrame(){const e=this.byId(this.$iFrameId),t=this.byId(this.$closeButton);void 0!==e&&e.style.setProperty("display","none"),void 0!==t&&t.style.setProperty("display","none")}message(e){return nr.getLocaleMessage(`${e}.${this.mode}`,U.locale)}moveToUrl(e){const t=this.byId(this.$iFrameId);this.hidePaymentiFrame(),t.removeAttribute("style"),this.iFrameResize({width:U.isMobile()?"100%":400,height:U.isMobile()?"100%":700}),t.style.setProperty("display","block"),t.src=e}apiUrl(){return this.modeApiUrl[this.mode]}},sr=class e extends k{constructor(){super(),this.$session=A,this.$logger=O,this.$event=rr,this.platformType=a.PLATFORM.JS,this.$transactionKey="",this.extra={},this.browserBootpayFilter={instagram:/Instagram/i,kakaotalk:/KAKAOTALK/i,facebook:/FBAV/i,naver:/NAVER/i,mobile_safari:/(iPhone|iPad|iPod)/,mobile_chrome:[/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/,/Chrome/]}}requestPayment(t){return o(this,null,(function*(){var r;void 0===(null==(r=t.extra)?void 0:r.locale)||U.isSetLocale||U.setLocale(t.extra.locale),this.$event.clearInstance(),this.generateTransactionKey(),t.application_id=U.currentApplicationId(t.application_id),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(t.application_id),this.$event.send({step:"start",msg:"결제 요청 시작",request:t}),t.sdk=!0,t.platform_type=this.platformType,t.ver=U.packageVersion,t.sdk_version=U.sdkVersion,t.sdk_type=U.sdkName,t.locale=U.locale,t.price=parseFloat(String(t.price)),t.tax_free=parseFloat(String(t.tax_free)),t.deposit_price=parseFloat(String(t.deposit_price)),e.invalidRequestParamsData(t),e.invalidRequestItemsData(t.items,t.price),t.uuid=this.$session.currentUserUUID(),t.sk=this.$session.currentSessionKey(),t.ti=this.$session.currentTimeTerm(),t.tk=this.$transactionKey,t.env=this.getUserDeviceEnvironment(),t.extra=this.openTypeFilter(t.extra),this.extra=t.extra;try{const e=yield ir.start(t);return O.debug("confirm ready",e),ir.hidePaymentiFrame(),ir.closePopup(),-1===["done","issued"].indexOf(e.event)&&this.$event.send({step:e.event,msg:"",request:t,response:e}),ir.setConfirmFormUrl(`${e.gateway_url}/confirm/${e.receipt_id}?application_id=${t.application_id}`),Promise.resolve(e)}catch(n){return this.eventError(n),Promise.reject(n)}}))}confirm(){return o(this,null,(function*(){try{const e=yield ir.confirm();return Promise.resolve(e)}catch(e){return this.eventError(e),Promise.reject(e)}}))}eventDone(e,t=!0){this.$logger.debug(e.event,e),this.$event.send({step:e.event,msg:"done"===e.event?"결제완료":"가상계좌발급완료",request:{},response:e}),F.hideProgress(),this.$logger.debug("show result",this.isDisplaySuccessResult()),this.isDisplaySuccessResult()&&t?this.displayResultView(e.data.receipt_id):ir.destroy()}eventError(e){F.hideProgress(),ir.closePopup(),this.isDisplayErrorResult()&&"error"===e.event?this.displayResultErrorView(e):ir.destroy(),this.$logger.debug("done failed destroy and hide","payment"),this.$event.sendError({step:this.$present(e.event)?e.event:"error",msg:e.message,trace:function(){try{return e.stack}catch(t){return!1}}()})}generateTransactionKey(){return this.$transactionKey=`${this.$uuid()}-${1e3*(new Date).getTime()}`,this.$transactionKey}requestSubscription(e){return o(this,null,(function*(){this.$event.clearInstance(),this.generateTransactionKey(),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"정기결제 요청 시작",request:e}),e.extra=this.openTypeFilter(e.extra);const t={application_id:e.application_id,subscription_id:e.subscription_id,pg:e.pg,method:e.method,order_name:e.order_name,price:e.price,tax_free:e.tax_free,user_token:e.user_token,metadata:e.metadata,redirect_url:e.redirect_url,platform_type:this.platformType,ver:R,sdk_version:U.sdkVersion,sdk_type:U.sdkName,locale:U.locale,sdk:!0,uuid:this.$session.currentUserUUID(),sk:this.$session.currentSessionKey(),tk:this.$transactionKey,env:this.getUserDeviceEnvironment(),user:e.user,extra:e.extra};try{const r=yield ir.start(t,"CARD_SUBSCRIPTION");switch(O.debug("subscription success",r),this.$event.send({step:"confirm",msg:"결제승인전",request:{},response:r}),ir.hidePaymentiFrame(),ir.closePopup(),r.event){case"done":case"issued":break;case"confirm":ir.setConfirmFormUrl(`${r.gateway_url}/confirm/${r.receipt_id}?application_id=${e.application_id}`)}return Promise.resolve(r)}catch(r){return this.eventError(r),Promise.reject(r)}}))}requestAuthentication(e){return o(this,null,(function*(){this.$event.clearInstance(),this.generateTransactionKey(),this.$event.setTokenKey(this.$transactionKey),this.$event.setApplicationId(e.application_id),this.$event.send({step:"start",msg:"본인인증 요청 시작",request:e}),e.extra=this.openTypeFilter(e.extra);const t={application_id:e.application_id,authentication_id:e.authentication_id,pg:e.pg,method:this.$present(e.method)?e.method:"auth",order_name:e.order_name,platform_type:this.platformType,ver:R,sdk_version:U.sdkVersion,sdk_type:U.sdkName,locale:U.locale,metadata:e.metadata,redirect_url:e.redirect_url,sdk:!0,uuid:this.$session.currentUserUUID(),sk:this.$session.currentSessionKey(),tk:this.$transactionKey,env:this.getUserDeviceEnvironment(),user:e.user,extra:e.extra};try{const r=yield ir.start(t,"AUTH");switch(O.debug("authentication success",r),this.$event.send({step:"confirm",msg:"본인인증 승인전",request:{},response:r}),ir.hidePaymentiFrame(),ir.closePopup(),r.event){case"done":case"issued":break;case"confirm":ir.setConfirmFormUrl(`${r.gateway_url}/confirm/${r.receipt_id}?application_id=${e.application_id}`)}return Promise.resolve(r)}catch(r){return this.eventError(r),Promise.reject(r)}}))}requestPaymentUrl(e){return o(this,null,(function*(){try{const t=yield ir.startPaymentUrl(e.url);return-1===["done","issued"].indexOf(t.event)&&this.$event.send({step:t.event,msg:"",request:{url:e.url},response:t}),ir.setConfirmFormUrl(`${t.gateway_url}/confirm/${t.receipt_id}?application_id=${e.application_id}`),Promise.resolve(t)}catch(t){return this.eventError(t),Promise.reject(t)}}))}getUserDeviceEnvironment(){return{width:window.innerWidth,height:window.innerHeight}}isDisplaySuccessResult(){return void 0!==this.extra&&void 0!==this.extra.display_success_result&&this.extra.display_success_result}isDisplayErrorResult(){return void 0!==this.extra&&void 0!==this.extra.display_error_result&&this.extra.display_error_result}displayResultView(e){ir.moveToUrl(U.toDoor(`result/${e}`))}displayResultErrorView(e){ir.moveToUrl(U.toDoor(`error?error_code=${e.error_code}&pg_error_code=${e.pg_error_code}&message=${e.message}`))}openTypeFilter(e){if(this.$present(e)&&void 0!==e.browser_open_type){const t=this.getUserAgent();for(let r in e.browser_open_type){const n=e.browser_open_type[r],i=this.$present(this.browserBootpayFilter[n.browser])?this.browserBootpayFilter[n.browser]:new RegExp(`${n.browser}`);if(t.match(i)){e.open_type=n.open_type;break}}}return e}static invalidRequestParamsData(t){if(d(t))throw new D({event:"error",error_code:"NEED_MORE_PARAMS",message:"결제 요청을 위한 최소한의 결제 정보를 입력해주세요."});Object.keys(e.invalidRequestParams).forEach((r=>{const n=t[r];if(d(n))throw new D({event:"error",error_code:"INVALID_REQUEST_PARAMS",message:e.invalidRequestParams[r]})}))}static invalidRequestItemsData(e,t){if(void 0!==e&&l(e)){let r=0;if(e.forEach(((t,n)=>{if(d(t.id))throw new D({event:"error",error_code:"NEED_ITEM_ID",message:`${n+1}번째 상품 고유 ID를 입력해주세요. [ key: id ]`});if(d(t.name))throw new D({event:"error",error_code:"NEED_ITEM_NAME",message:`${n+1}번째 상품명을 입력해주세요. [ key: name ]`});if(d(t.qty))throw new D({event:"error",error_code:"NEED_ITEM_QTY",message:`${n+1}번째 상품수량을 입력해주세요. [ key: qty ]`});if(d(t.price))throw new D({event:"error",error_code:"NEED_ITEM_PRICE",message:`${n+1}번째 상품금액을 입력해주세요. [ key: price ]`});e[n].price=parseFloat(String(e[n].price)),e[n].qty=parseFloat(String(e[n].qty)),r+=e[n].price*e[n].qty})),r!==t)throw new D({event:"error",error_code:"NEED_ITEM_TOTAL_PRICE_NOT_MATCH",message:`결제 금액과 상품 수량 및 상품 금액의 총합과 일치하지 않습니다. [ 요청금액: ${t} ${typeof t}, 상품 총합계 금액: ${r} ${typeof r} ]`})}}};sr.invalidRequestParams={application_id:"application_id를 입력해주세요. [ key: application_id ]",order_name:"판매할 상품명을 입력해주세요. [ key: order_name ]",price:"판매할 상품의 금액을 입력해주세요. [ key: price ]",order_id:"가맹점에서 설정할 주문 ID를 입력해주세요. [ key: order_id ]"};let or=sr;const ar=new or;const cr=new class extends Zt{constructor(){super(),this.$session=A}setAnalyticsData(e){this.$session.setTime(e.time),this.$session.setUUID(e.uuid)}send(e){return o(this,null,(function*(){const t=document.URL;if(void 0!==t&&-1===t.search(/bootapi.co.kr/)){const n=this.$session.getUser();e.application_id=U.currentApplicationId(e.application_id),e.sk=this.$session.currentSessionKey(),e.uuid=this.$session.currentUserUUID(),e.time=this.$session.currentTime(),e.url=t,e.referer=void 0!==document.referrer&&l(document.referrer)&&-1==document.referrer.search(new RegExp(window.location.hostname))?document.referrer:"",e.user_id=void 0===n||d(n)?void 0:n.id,e.items=this.generateItemKeyToVersion1(e.items);try{const t=yield this.$http.post(U.toAnalytics(`call?ver=${R}`),e);return 200===t.data.status?(O.info("Analytics Common Send","통계 데이터가 전송되었습니다."),Promise.resolve()):(O.warn("Analytics Common Send",`통계 데이터가 전송 실패. ${JSON.stringify(t.data)}`),Promise.reject())}catch(r){return O.error("Analytics Common Error",`데이터 전송 실패: ${r.message}`),Promise.reject()}}}))}login(e){return o(this,null,(function*(){if(e.application_id=U.currentApplicationId(e.application_id),d(e.application_id))return O.error("Analytics Params","application_id 값을 입력해주세요.");if(d(e.id))return O.error("Analytics Params","id 값을 입력해주세요.");try{const t=yield this.$http.post(U.toAnalytics(`login?ver=${R}`),e),{user_id:r}=t.data.data;return this.$session.setUser({id:r,time:(new Date).getTime()}),Promise.resolve()}catch(t){return O.error("Analytics Login Error",`데이터 전송 실패: ${t.message}`),Promise.reject()}}))}logout(){this.$session.setUser(void 0)}generateItemKeyToVersion1(e){return void 0!==e?e.map((e=>({cat1:e.cat1,cat2:e.cat2,cat3:e.cat3,item_img:e.img,item_name:e.name,unique:e.id,price:e.price}))):void 0}};!function(){if("undefined"==typeof window||"function"==typeof window.CustomEvent)return!1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let r=document.createEvent("CustomEvent");return r.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r}e.prototype=window.Event.prototype,window.CustomEvent=e}();const dr={$payment:ar,$analytics:cr,$environment:U,requestPayment(e){return o(this,null,(function*(){return new Promise(((t,r)=>o(this,null,(function*(){try{void 0!==e.extra&&!0===e.extra.override_global_event&&(O.debug("override global event","override global event!"),dr.overrideGlobalInstance());const r=yield this.$payment.requestPayment(e);setTimeout((()=>{t(r),["done","issued"].indexOf(r.event)>-1&&this.$payment.eventDone(r)}),100)}catch(n){setTimeout((()=>{r(this.errorHandler(n))}),100)}}))))}))},confirm(){return o(this,null,(function*(){return new Promise(((e,t)=>o(this,null,(function*(){try{const t=yield this.$payment.confirm();setTimeout((()=>{e(t),this.$payment.eventDone(t)}),100)}catch(r){setTimeout((()=>t(this.errorHandler(r))),100)}}))))}))},requestSubscription(e){return o(this,null,(function*(){return new Promise(((t,r)=>o(this,null,(function*(){try{const r=yield this.$payment.requestSubscription(e);t(r),this.$payment.eventDone(r)}catch(n){return r(this.errorHandler(n))}}))))}))},requestAuthentication(e){return o(this,null,(function*(){return new Promise(((t,r)=>o(this,null,(function*(){try{const r=yield this.$payment.requestAuthentication(e);t(r),this.$payment.eventDone(r)}catch(n){return r(this.errorHandler(n))}}))))}))},requestPaymentUrl(e){return o(this,null,(function*(){return new Promise(((t,r)=>o(this,null,(function*(){try{const r=yield this.$payment.requestPaymentUrl(e);setTimeout((()=>{t(r),["done","issued"].indexOf(r.event)>-1&&this.$payment.eventDone(r)}),100)}catch(n){setTimeout((()=>{r(this.errorHandler(n))}),100)}}))))}))},setEnvironmentMode(e,t=void 0){this.$environment.set(e),void 0!==t&&this.$environment.setDevelopmentHost(t)},setApplicationId(e){return this.$environment.setApplicationId(e)},setVersion(e,t,r){return this.$environment.setVersion(e,t,r)},setDevice(e){switch(e){case"IOS":this.$payment.platformType=a.PLATFORM.IOS;break;case"ANDROID":this.$payment.platformType=a.PLATFORM.ANDROID;break;default:this.$payment.platformType=a.PLATFORM.JS}return this.$payment.platformType},errorHandler(e){let t;if(F.hideProgress(),"BootpayEventError"===e.name)t=e.eventMessage;else{if(!l(e.event))throw e;t=e}return t},readyToPopup(){ir.readyToPopup()},setLogLevel(e){O.setLogLevel(e)},setUUID:e=>A.setUUID(e),send(e=void 0){return this.$analytics.send(void 0!==e?e:{})},login(e){return this.$analytics.login(e)},logout(){return this.$analytics.logout()},setLocale(e){U.setLocale(e),ir.templateReload()},dismiss(e=!1){return o(this,null,(function*(){if(e)try{yield rr.sendCloseEvent()}catch(t){O.debug("error",t.message)}tr.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:"사용자가 결제창을 닫았습니다."})}))},getCurrentUUID:()=>A.currentUserUUID(),destroy(){ir.destroy()},overrideGlobalInstance(){window.Bootpay=dr}};"undefined"!=typeof window&&(window.Bootpay=dr);class lr extends C{constructor(){super(),this.$messageEventName="message.BootpayUserTokenEvent"}bind(e,t){this.setCallbackFunction(e,t),window.resetBootpayEventListener(this.$messageEventName,(e=>{const t=this.parseEvent(e.data);if(l(t))switch(O.debug("event",t),t.event){case"error":case"cancel":return this.reject({event:t.event,pg_error_code:t.pg_error_code,error_code:t.error_code,message:t.message,payload:t.payload});case"data":return this.resolve(t.data);case"confirmPasswordToken":return this.resolve(t.token);case"confirmAddCard":return this.resolve(t);case"resize":ur.iFrameResize(t.resizeData);break;default:return}}))}}const ur=new class extends N{constructor(){super(),this.$windowId="bootpay-user-token-background-id",this.$userWindowId="bootpay-user-token-window-id",this.$iFrameId="bootpay-user-token-iframe-id",this.$bootpaySdkFormId="bootpay-user-token-sdk-form",this.$template=this.template(),this.$event=new lr,this.$session=A,this.deviceType=a.PLATFORM.JS}setDevice(e){return this.deviceType=e,this.deviceType}template(){return`\n <div id="${this.$windowId}" class="bootpay-payment-background">\n <div class="bootpay-payment-window" id="${this.$userWindowId}">\n <iframe id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>\n <form name="${this.$bootpaySdkFormId}" id="${this.$bootpaySdkFormId}" method="GET"> \n </form>\n </div>\n </div>\n `}setParams(e,t){if(void 0!==t){const r=this.byId(this.$bootpaySdkFormId);if(["POST","PUT"].indexOf(e.toUpperCase())>-1){const e=Zt.encryptParams(Zt.objectKeyToUnderscore(t));r.innerHTML=`\n <input type="hidden" name="payload" value="${e.payload}" />\n <input type="hidden" name="token" value="${e.token}" /> \n `}else{let n="";"DELETE"===e.toUpperCase()&&(n+='<input type="hidden" name="_method" value="patch"/>'),Object.keys(t).forEach((e=>{n+=`<input type="hidden" name="${e}" value="${t[e]}"/>`})),r.innerHTML=n}}}request(e,t){return new Promise(((r,n)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(r,n),this.goiFrameUrl("GET",U.toDoor(`sdk/password/${t}`),{type:e,uuid:this.$session.currentUserUUID()})}))}addCard(e){return new Promise(((t,r)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,r),this.goiFrameUrl("GET",U.toDoor(`sdk/card/${e}`),{uuid:this.$session.currentUserUUID()})}))}wallets(e){return new Promise(((t,r)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,r),this.goiFrameUrl("GET",U.toApi("sdk/easy/wallet"),{user_token:e,sdk:!0,uuid:this.$session.currentUserUUID()})}))}destroyWallet(e){return new Promise(((t,r)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,r),this.goiFrameUrl("POST",U.toApi("sdk/easy/wallet"),{method:"DELETE",sdk:!0,user_token:e.user_token,wallet_id:e.wallet_id,token:e.token,uuid:this.$session.currentUserUUID()})}))}createBiometricAuthenticate(e){return new Promise(((t,r)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,r),this.goiFrameUrl("POST",U.toApi("sdk/easy/biometric"),{user_token:e.userToken,sdk:!0,uuid:this.$session.currentUserUUID(),os:e.os,token:e.token})}))}destroyBiometricAuthenticate(e){return new Promise(((t,r)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,r),this.goiFrameUrl("POST",U.toApi("sdk/easy/biometric"),{method:"DELETE",uuid:this.$session.currentUserUUID(),user_token:e.userToken,token:e.token})}))}requestWalletPayment(e){return new Promise(((t,r)=>{this.createTemplateHtml(),this.bodyOpen(),this.$event.bind(t,r),this.goiFrameUrl("POST",U.toApi("sdk/easy/card"),this.regenerateRequestPayment(e))}))}goiFrameUrl(e,t,r=void 0){this.setParams(e,r);const n=this.byId(this.$bootpaySdkFormId);n.method=this.toMethod(e),n.action=t,n.target=this.$iFrameId,n.submit(),this.show()}toMethod(e){switch(e.toUpperCase()){case"PUT":case"DELETE":return"POST";default:return e}}iFrameResize(e){const t=this.byId(this.$iFrameId);if(void 0!==t)for(let r in Object.keys(e)){let n=Object.keys(e)[r],i=e[n];this.$present(i)&&!String(i).match(/%/)&&(n.match(/width/)||n.match(/Width/)||n.match(/height/)||n.match(/Height/))&&(i=`${String(e[n]).replace(/px/gi,"")}px`),String(i).match(/%/)&&!this.byId(this.$userWindowId).className.match(/w-100/)&&(this.byId(this.$userWindowId).className+=" w-100"),t.style.setProperty(n,i)}}regenerateRequestPayment(e){return e.ver=R,e.platform_type=this.deviceType,e.sdk=!0,e.price=parseFloat(String(e.price)),e.tax_free=parseFloat(String(e.tax_free)),or.invalidRequestParamsData(e),or.invalidRequestItemsData(e.items,e.price),e.uuid=this.$session.currentUserUUID(),e.sk=this.$session.currentSessionKey(),e.ti=this.$session.currentTimeTerm(),e.tk=`${this.$uuid()}-${1e3*(new Date).getTime()}`,e}show(){const e=this.byId(this.$iFrameId);void 0!==e&&e.style.setProperty("display","block")}destroy(){this.$present(document.querySelector("body").className)&&(document.querySelector("body").className=document.querySelector("body").className.replace(/bootpay-open/gi,"")),this.$present(this.byId(this.$windowId))&&(this.byId(this.$windowId).outerHTML=""),document.body.classList.remove("bootpay-open"),tr.clearPollingEvent(),setTimeout((()=>tr.callBootpayDOMEvent("close")),300)}},pr={$templateUserToken:ur,requestPasswordToken(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.request("passwordToken",e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},requestChangePassword(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.request("changePasswordToken",e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},requestAddCard(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.addCard(e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},wallets(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.wallets(e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},destroyWallet(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.destroyWallet(e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},createBiometricAuthenticate(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.createBiometricAuthenticate(e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},destroyBiometricAuthenticate(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.destroyBiometricAuthenticate(e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},requestWalletPayment(e){return o(this,null,(function*(){try{const t=yield this.$templateUserToken.requestWalletPayment(e);return this.$templateUserToken.destroy(),Promise.resolve(t)}catch(t){return this.$templateUserToken.destroy(),Promise.reject(this.errorHandler(t))}}))},setEnvironmentMode(e,t=void 0){U.set(e),void 0!==t&&U.setDevelopmentHost(t)},setDevice(e){let t=a.PLATFORM.JS;switch(e.toUpperCase()){case"IOS":t=a.PLATFORM.IOS;break;case"ANDROID":t=a.PLATFORM.ANDROID}return this.$templateUserToken.setDevice(t)},errorHandler(e){let t;if(F.hideProgress(),"BootpayEventError"===e.name)t=e.eventMessage;else{if(!l(e.event))throw e;t=e}return t},setLogLevel(e){O.setLogLevel(e)},setUUID:e=>A.setUUID(e),dismiss(){tr.reject({event:"cancel",error_code:"RC_CLOSE_WINDOW",message:"사용자가 결제창을 닫았습니다."})}};"undefined"!=typeof window&&(window.BootpaySDK=pr);const hr={el:void 0,applicationId:void 0,price:0,taxFree:0,depositPrice:0,currency:"KRW",userToken:void 0,pg:void 0,method:void 0,walletId:void 0,selectTerms:[],useOnlyOOpay:!1,termsPassed:!1,useTerms:!0,sandbox:!1,widgetKey:void 0,externalTerms:[],widgetExtra:{card_quota:[]},extra:{},setWidgetData(e){this.el=String(e.el).replace(/#/gi,""),this.applicationId=e.application_id,this.price=e.price,this.taxFree=e.tax_free,this.depositPrice=e.deposit_price,this.currency=e.currency,this.userToken=e.user_token,this.useOnlyOOpay=void 0!==e.use_only_oopay&&e.use_only_oopay,this.useTerms=!(!1===e.use_terms),this.walletId=e.wallet_id,this.externalTerms=e.external_terms,this.widgetExtra=e.widget_extra,this.widgetKey=e.widget_key,this.sandbox=!0===e.sandbox,this.termsPassed=!1,this.extra={}},setPayment(e,t,r,n=!1,i,s){this.pg=e,this.method=t,this.walletId=r,this.termsPassed=n,this.selectTerms=i,this.extra=s},updateOnProcessing(e){l(e.price)&&(this.price=e.price),l(e.tax_free)&&(this.taxFree=e.tax_free),l(e.currency)&&(this.currency=e.currency),void 0!==e.user_token&&(this.userToken=e.user_token),l(e.use_terms)&&(this.useTerms=!(!1===e.use_terms)),l(e.sandbox)&&(this.sandbox=!0===e.sandbox),l(e.widget_key)&&(this.widgetKey=e.widget_key),void 0!==e.external_terms&&(this.externalTerms=e.external_terms),void 0!==e.widget_key&&(this.widgetKey=e.widget_key)}};const mr=new class extends N{constructor(){super(),this.$iFrameId="bootpay-widget-iframe",this.$widgetStore=hr,this.$template=`\n <iframe id="${this.$iFrameId}" src="" frameborder="0" allowtransparency="true" scrolling="no" style="background: transparent; width: 100%; height: 100%;"></iframe> \n `}render(){const e=document.getElementById(this.$widgetStore.el);if(this.$blank(this.$widgetStore.el)||null===e)throw new Error("부트페이 위젯을 설정할 Element ID를 입력하지 않았거나 해당 Element DOM이 존재하지 않습니다.");this.templateRender()}templateRender(){const e=document.getElementById(this.$widgetStore.el);e.style.setProperty("height","0px"),e.innerHTML=this.$template;this.byId(this.$iFrameId).setAttribute("src",U.toWidget(`p/${this.$widgetStore.applicationId}`))}resize(e){this.templateResize(this.$widgetStore.el,e)}rerender(){this.postMessage("bootpayWidgetRerender")}destroy(){document.getElementById(this.$widgetStore.el).innerHTML=""}postMessage(e,t=void 0){var r;const n=this.byId(this.$iFrameId);null==(r=null==n?void 0:n.contentWindow)||r.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}isRendered(){const e=document.getElementById(this.$iFrameId);return O.debug("isRendered",`iFrameElement: ${e}`),null!==e&&null!==e.src&&""!==e.src}};const yr=new class extends N{constructor(){super(),this.$oopayWindowId="__bootpay-card-easy-window",this.$iFrameId="__bootpay-card-easy-iframe",this.$windowId="__bootpay-card-easy-container-window",this.$additionalClass=U.isMobile()?"transparent":"rounded-iframe transparent",this.$template=this.template(),this.$widgetStore=hr}template(){return`\n<div id="${this.$windowId}" class="bootpay-payment-background">\n <div class="bootpay-payment-window ${U.isMobile()?"__mobile":""}" id="${this.$oopayWindowId}"> \n <iframe class="${this.$additionalClass}" id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe> \n </div> \n</div>\n `}createIFrame(e){this.createTemplateHtml();const t=document.getElementById(this.$iFrameId);null==t||t.setAttribute("src",U.toWidget(`${e}`)),null==t||t.style.setProperty("display","block"),this.bodyOpen()}addWallet(){this.createIFrame(`wallet/add/${this.$widgetStore.applicationId}`)}removeWallet(e){this.createIFrame(`oopay/destroy/${this.$widgetStore.applicationId}/${e}`)}showCardInterestInformation(e){this.createIFrame(`card/interest/${this.$widgetStore.applicationId}`)}destroy(){const e=document.getElementById(this.$windowId);void 0!==e&&(e.outerHTML="",e.remove())}resize(e){O.debug("resize",e),this.templateResize(this.$iFrameId,e)}postMessage(e,t=void 0){var r;const n=this.byId(this.$iFrameId);null==(r=null==n?void 0:n.contentWindow)||r.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}};const fr=new class extends N{constructor(){super(),this.$windowId="__bootpay-modal-window-container",this.$modalWindowId="__bootpay-modal-window",this.$iFrameId="__bootpay-modal-iframe",this.$additionalClass=U.isMobile()?"":"rounded-iframe",this.$template=this.template()}template(){return`\n<div id="${this.$windowId}" class="bootpay-payment-background">\n <div class="bootpay-payment-window ${U.isMobile()?"__mobile":""}" id="${this.$modalWindowId}"> \n <iframe class="${this.$additionalClass}" id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe> \n </div> \n</div>\n `}createIFrame(e){this.createTemplateHtml();const t=document.getElementById(this.$iFrameId);null==t||t.setAttribute("src",e),null==t||t.classList.add("slide-up"),null==t||t.style.setProperty("display","block"),this.bodyOpen()}destroy(){const e=document.getElementById(this.$iFrameId);null==e||e.classList.remove("slide-up"),null==e||e.classList.add("slide-down"),setTimeout((()=>{const e=document.getElementById(this.$windowId);void 0!==e&&(e.outerHTML="",e.remove())}),300)}resize(e){O.debug("resize",e),this.templateResize(this.$iFrameId,e)}postMessage(e,t=void 0){var r;const n=this.byId(this.$iFrameId);null==(r=null==n?void 0:n.contentWindow)||r.postMessage(JSON.stringify({bootpay_event:!0,event:e,data:t}),"*")}};const gr=new class extends C{constructor(){super(),this.$messageEventName="message.BootpayWidgetEvent",this.$eventPrefix="bootpay"}bind(){window.resetBootpayEventListener(this.$messageEventName,(e=>{const t=this.parseEvent(e.data);if(l(t))switch(t.event){case"bootpayWidgetSelectMethod":return this.triggerGlobalChangeEvent(t.data),vr.selectPayment(t.data.pg,t.data.method,t.data.wallet_id,!0===t.data.term_passed,t.data.select_terms,t.data.extra);case"bootpayRequestGetEnvironment":return mr.postMessage("bootpayResponseGetEnvironment",{use_only_oopay:mr.$widgetStore.useOnlyOOpay,user_token:mr.$widgetStore.userToken,sandbox:mr.$widgetStore.sandbox,use_terms:mr.$widgetStore.useTerms,external_terms:mr.$widgetStore.externalTerms,key:mr.$widgetStore.widgetKey,log_level:O.level});case"bootpayRequestGetEnvironmentWidget":return mr.postMessage("bootpayWidgetGetEnvironmentWidget",t.data);case"bootpayWidgetResponseGetEnvironmentWidget":return yr.postMessage("bootpayResponseGetEnvironmentWidget",{use_only_oopay:mr.$widgetStore.useOnlyOOpay,user_token:mr.$widgetStore.userToken,sandbox:mr.$widgetStore.sandbox,use_terms:mr.$widgetStore.useTerms,platform:t.data.platform});case"bootpayRequestCurrentStores":return mr.postMessage("bootpayWidgetRequestCurrentStores",t.data);case"bootpayWidgetResponseCurrentStores":return yr.postMessage("bootpayResponseCurrentStores",t.data);case"bootpayWidgetError":default:return this.reject(t);case"bootpayWidgetOOpayReload":return mr.postMessage("bootpayWidgetOOpayReload",t.data);case"bootpayWidgetResize":return this.callBootpayDOMEvent("widget-resize",t.data),mr.resize(t.data);case"bootpayWidgetShowInterestInformation":return yr.showCardInterestInformation(t.data);case"bootpayWidgetAddWallet":return yr.addWallet();case"bootpayWidgetRemoveWallet":return yr.removeWallet(t.data.wallet_id);case"bootpayWidgetPaymentWindowResize":return yr.resize(t.data);case"bootpayWidgetOOpayWindowClose":return yr.destroy();case"bootpayWidgetModalOpen":return fr.createIFrame(t.data.url);case"bootpayWidgetModalClose":return fr.destroy();case"bootpayRequestModalCurrentStores":return mr.postMessage("bootpayWidgetRequestModalCurrentStores",t.data);case"bootpayRequestGetEnvironmentModalWidget":return mr.postMessage("bootpayWidgetGetEnvironmentModalWidget",t.data);case"bootpayWidgetResponseGetEnvironmentModalWidget":return fr.postMessage("bootpayResponseGetEnvironmentModalWidget",{application_id:mr.$widgetStore.applicationId,use_only_oopay:mr.$widgetStore.useOnlyOOpay,user_token:mr.$widgetStore.userToken,sandbox:mr.$widgetStore.sandbox,use_terms:mr.$widgetStore.useTerms,external_terms:mr.$widgetStore.externalTerms,key:mr.$widgetStore.widgetKey,platform:t.data.platform,log_level:O.level});case"bootpayWidgetModalResize":return fr.resize(t.data);case"bootpayWidgetPaymentGetStoreData":const{applicationId:e,price:o,widgetExtra:a,taxFree:c,userToken:d}=mr.$widgetStore;return mr.postMessage("bootpayWidgetResponseStoreData",{applicationId:e,price:o,widgetExtra:a,taxFree:c,userToken:d});case"bootpayWidgetTermAllAgree":return void this.callBootpayDOMEvent("all-agree-terms",t.data);case"bootpayWidgetSelectPayment":const{method_alias:l,payment_type:u,wallet_id:p}=t.data;return mr.postMessage("bootpayWidgetSelectPayment",{method_alias:l,payment_type:u,wallet_id:p});case"bootpayWidgetReady":this.callBootpayDOMEvent("widget-ready",t.data);break;case"bootpayWidgetUpdateStore":hr.updateOnProcessing(((e,t)=>{for(var o in t||(t={}))n.call(t,o)&&s(e,o,t[o]);if(r)for(var o of r(t))i.call(t,o)&&s(e,o,t[o]);return e})({},t.data))}}))}callBootpayDOMEvent(e,t=void 0){document.dispatchEvent(new CustomEvent([this.$eventPrefix,e].join("-"),{detail:t}))}destroyAllEvent(){window.removeBootpayEventListener(this.$messageEventName)}triggerGlobalChangeEvent(e){var t;e.completed=this.$present(e.pg)&&this.$present(e.method)&&(!0===e.term_passed||!hr.useTerms)&&(-1===["OOPAY_CARD","OOPAY_AUTOMATIC_TRANSFER"].indexOf(e.method)||void 0!==e.wallet_id),hr.pg===e.pg&&hr.method===e.method&&hr.walletId===e.wallet_id&&JSON.stringify(hr.extra)===JSON.stringify(e.extra)||this.callBootpayDOMEvent("widget-change-payment",e),JSON.stringify(null==(t=e.select_terms)?void 0:t.filter((e=>!0===e.agree)))!==JSON.stringify(hr.selectTerms.filter((e=>!0===e.agree)))&&this.callBootpayDOMEvent("widget-change-terms",e)}};const vr=new class extends k{constructor(){super(),this.message=nr}initialize(){hr.setWidgetData({el:void 0,application_id:void 0,price:0,tax_free:0,currency:"KRW",user_token:void 0,pg:void 0,method:void 0,widget_key:void 0})}render(e,t){if(this.$blank(null==t?void 0:t.price)||t.price<0)throw new Error("결제금액은 1원 이상을 입력해주세요.");if(this.$blank(null==t?void 0:t.application_id))throw new Error("application_id가 입력되지 않았습니다.");this.initialize(),hr.setWidgetData({el:e,application_id:t.application_id,price:t.price,tax_free:t.tax_free,currency:t.currency,user_token:t.user_token,use_only_oopay:t.use_only_oopay,external_terms:t.external_terms,widget_extra:t.extra,use_terms:t.use_terms,sandbox:t.sandbox,widget_key:t.key}),mr.render(),gr.bind()}update(e){const{price:t,tax_free:r,currency:n,user_token:i,use_only_oopay:s,use_terms:o,sandbox:a,key:c,external_terms:d}=e;hr.updateOnProcessing({price:t,tax_free:r,currency:n,user_token:i,use_only_oopay:s,use_terms:o,external_terms:d,sandbox:a,widget_key:c}),(this.$present(i)||this.$present(s)||this.$present(o)||this.$present(a))&&mr.postMessage("bootpayWidgetUpdateUserToken",{user_token:i,use_only_oopay:s,use_terms:o,external_terms:d,sandbox:a,key:c})}rerender(){mr.rerender()}destroy(){mr.destroy()}selectPayment(e,t,r,n=!1,i,s){hr.setPayment(e,t,r,n,i,s),O.debug("selectPayment",`pg: ${e}, method: ${t}, wallet_id: ${r}, terms: ${n}, select_terms: ${JSON.stringify(i)}, extra: ${JSON.stringify(s)}`)}currentTermsCondition(){return hr.selectTerms}requestPayment(e){return o(this,null,(function*(){if(this.$blank(hr.pg)||this.$blank(hr.method))throw new D({event:"error",error_code:"RC_PG_METHOD_NOT_SELECTED",message:this.message.getLocaleMessage("notSelectPayment","ko")});if(!hr.termsPassed&&hr.useTerms)throw new D({event:"error",error_code:"RC_TERMS_NOT_AGREE",message:this.message.getLocaleMessage("termsNotAgree","ko")});if(["OOPAY_CARD","OOPAY_AUTOMATIC_TRANSFER"].indexOf(hr.method)>-1&&void 0===hr.walletId)throw new D({event:"error",error_code:"RC_OOPAY_NEED_SELECT_WALLET",message:this.message.getLocaleMessage("notSelectOOPay","ko")});return e.application_id=hr.applicationId,e.price=hr.price,e.tax_free=hr.taxFree,e.deposit_price=hr.depositPrice,e.currency=hr.currency,e.pg=hr.pg,e.method=hr.method,e.wallet_id=hr.walletId,e.terms=hr.selectTerms,e.widget_sandbox=hr.sandbox,e.widget_key=hr.widgetKey,e.extra=this.mergeExtraOnStore(e.extra),e.widget=1,dr.requestPayment(e)}))}mergeExtraOnStore(e){return void 0===e?hr.extra:(void 0!==hr.extra&&Object.keys(hr.extra).forEach((t=>{e[t]=hr.extra[t]})),e)}isRendered(){return mr.isRendered()}synchronizedRealTimeTransfer(e){mr.postMessage("bootpayWidgetSynchronizedRealTimeTransfer",e)}sendSelectPayment(e){mr.postMessage("bootpayWidgetSelectPayment",e)}sendMessage(e,t){mr.postMessage(e,t)}},_r={render(e,t){vr.render(e,t)},rerender(){vr.rerender()},setEnvironmentMode(e,t){dr.setEnvironmentMode(e,t),U.set(e)},requestPayment(e){return o(this,null,(function*(){return new Promise(((t,r)=>o(this,null,(function*(){try{const r=yield vr.requestPayment(e);return t(r)}catch(n){return r(this.errorHandler(n))}}))))}))},errorHandler(e){let t;if(F.hideProgress(),"BootpayEventError"===e.name)t=e.eventMessage;else{if(!l(e.event))throw e;t=e}return t},update(e,t=!0){vr.update(e),t&&this.rerender()},currentTermsCondition:()=>vr.currentTermsCondition(),destroy(){vr.destroy()},isRendered:()=>vr.isRendered(),synchronizedRealTimeTransfer(e){vr.synchronizedRealTimeTransfer(e)},selectPayment(e){vr.sendSelectPayment(e)},setLogLevel(e){O.setLogLevel(e)},sendMessage(e,t=void 0){vr.sendMessage(e,t)}};"undefined"!=typeof window&&(window.BootpayWidget=_r),e.Bootpay=dr,e.BootpayEnvironment=U,e.BootpaySDK=pr,e.BootpayWidget=_r,e.default=dr,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "@bootpay/client-js",
3
- "version": "5.0.0-rc.5",
3
+ "version": "5.0.0-rc.6",
4
4
  "main": "dist/index.es.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "styles": "dist/index.css",
@@ -10,5 +10,6 @@ export declare class TemplateManager extends BootpayManager {
10
10
  * @date: 2022-02-16
11
11
  */
12
12
  createTemplateHtml(): void;
13
+ bodyOpen(): void;
13
14
  templateResize(el: string, resizeData: any): void;
14
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bootpay/client-js",
3
- "version": "5.0.0-rc.5",
3
+ "version": "5.0.0-rc.6",
4
4
  "main": "dist/index.es.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "styles": "dist/index.css",