@bootpay/client-js 5.4.0 → 5.5.2
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/README.md +45 -28
- package/dist/chunks/bootpay-DVdQIYCS.mjs +3966 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +514 -8525
- package/dist/index.umd.js +37 -41
- package/dist/payment.d.ts +3 -0
- package/dist/payment.mjs +5 -0
- package/dist/src/bootpay.d.ts +2 -1
- package/dist/src/lib/event/onboarding.d.ts +17 -0
- package/dist/src/lib/event/polling.d.ts +1 -1
- package/dist/src/lib/locale/message.d.ts +28 -0
- package/dist/src/lib/template/iframe-allow.d.ts +11 -0
- package/dist/src/lib/template/onboarding.d.ts +40 -0
- package/dist/src/lib/template/payment.d.ts +35 -0
- package/dist/src/payment.d.ts +10 -0
- package/dist/src/support/environment.d.ts +2 -0
- package/dist/src/types/bootpay-interface.d.ts +31 -1
- package/dist/src/vendor/mixins/resource.d.ts +42 -4
- package/package.json +16 -4
- package/vite.config.ts +46 -22
|
@@ -0,0 +1,3966 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(':root{--bootpay-progress-bg-overlay: transparent;--bootpay-progress-accent: #3a5fd9;--bootpay-progress-accent-light: rgba(58, 95, 217, .5);--bootpay-progress-accent-glow: rgba(58, 95, 217, .8);--bootpay-progress-text: rgba(255, 255, 255, .95);--bootpay-progress-text-sub: rgba(255, 255, 255, .6)}.bootpay-progress-background{position:fixed;display:flex!important;align-items:center;justify-content:center;background:var(--bootpay-progress-bg-overlay);left:0;right:0;top:0;bottom:0;width:100%;height:100%;z-index:200000;opacity:0;animation:bootpay-fade-in .25s ease-out forwards}.bootpay-progress-background.blur-off{background-color:transparent}.bootpay-progress-background .progress-message-window{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:28px 36px 24px;background:transparent;border-radius:20px;animation:bootpay-card-in .35s ease-out forwards}@media (min-width: 600px){.bootpay-progress-background .progress-message-window{padding:32px 44px 28px;border-radius:24px}}.bootpay-progress-background .progress-message-window .alfred-loading{position:relative;display:flex;align-items:center;justify-content:center;height:48px}@media (min-width: 600px){.bootpay-progress-background .progress-message-window .alfred-loading{height:56px}}.bootpay-progress-background .progress-message-window .bootpay-spinner{display:flex;align-items:center;justify-content:center;gap:10px}@media (min-width: 600px){.bootpay-progress-background .progress-message-window .bootpay-spinner{gap:12px}}.bootpay-progress-background .progress-message-window .bootpay-dot{display:block;width:10px;height:10px;border-radius:50%;background:var(--bootpay-progress-accent);box-shadow:0 0 10px var(--bootpay-progress-accent-glow);animation:bootpay-bounce 1.4s ease-in-out infinite}@media (min-width: 600px){.bootpay-progress-background .progress-message-window .bootpay-dot{width:12px;height:12px}}.bootpay-progress-background .progress-message-window .bootpay-dot:nth-child(1){animation-delay:0s}.bootpay-progress-background .progress-message-window .bootpay-dot:nth-child(2){animation-delay:.16s}.bootpay-progress-background .progress-message-window .bootpay-dot:nth-child(3){animation-delay:.32s}.bootpay-progress-background .progress-message-window .alfred-text{margin-top:10px;text-align:center;opacity:0;transform:translateY(6px);animation:bootpay-text-in .4s ease-out .2s forwards}@media (min-width: 600px){.bootpay-progress-background .progress-message-window .alfred-text{margin-top:12px}}.bootpay-progress-background .progress-message-window .alfred-text span.alfred-inner-text{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:13px;font-weight:400;color:var(--bootpay-progress-text-sub);letter-spacing:.02em}@media (min-width: 600px){.bootpay-progress-background .progress-message-window .alfred-text span.alfred-inner-text{font-size:14px}}@keyframes bootpay-fade-in{0%{opacity:0}to{opacity:1}}@keyframes bootpay-card-in{0%{opacity:0;transform:scale(.92)}to{opacity:1;transform:scale(1)}}@keyframes bootpay-bounce{0%,80%,to{transform:translateY(0);opacity:.4;box-shadow:0 0 6px var(--bootpay-progress-accent-light)}40%{transform:translateY(-18px);opacity:1;box-shadow:0 0 16px var(--bootpay-progress-accent-glow)}}@keyframes bootpay-text-in{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}:root{--bootpay-popup-bottom: 72px;--bootpay-primary: #507cf3;--bootpay-primary-hover: #3f6be2;--bootpay-white: #ffffff;--bootpay-black: #000000;--bootpay-gray-dark: #333333;--bootpay-gray-light: #888888;--bootpay-gray-bg: #f2f2f2;--bootpay-overlay: rgba(0, 0, 0, .7);--bootpay-radius: 12px;--bootpay-radius-sm: 5px;--bootpay-radius-lg: 16px;--bootpay-radius-xl: 20px;--bootpay-radius-xxl: 24px;--bootpay-shadow: 0 0 10px rgba(0, 0, 0, .1);--bootpay-z-modal: 9999;--bootpay-z-spinner: 200000;--bootpay-z-close: 10001;--bootpay-blur: blur(5px)}body.bootpay-open{position:fixed!important;left:0;right:0;bottom:0;top:0;padding:0;margin:0;height:100vh!important;overflow:hidden!important;-webkit-overflow-scrolling:auto!important}body.bootpay-inherit .fade-in,body.bootpay-open .fade-in{animation:__bootpay-fade-in .1s linear}body.bootpay-inherit .fade-out,body.bootpay-open .fade-out{animation:__bootpay-fade-out .1s linear}body.bootpay-inherit .slide-up,body.bootpay-open .slide-up{animation:__bootpay-slide-up .3s cubic-bezier(.25,.46,.45,.94) forwards!important}@media (max-width: 600px){body.bootpay-inherit .slide-up,body.bootpay-open .slide-up{animation:__bootpay-slide-up-mobile .1s cubic-bezier(.25,.46,.45,.94) forwards!important}}body.bootpay-inherit .slide-static-up,body.bootpay-open .slide-static-up{animation:__bootpay-slide-up-mobile .1s cubic-bezier(.25,.46,.45,.94) forwards!important}body.bootpay-inherit .slide-down,body.bootpay-open .slide-down{animation:__bootpay-slide-down .1s ease-in forwards!important}@media (max-width: 600px){body.bootpay-inherit .slide-down,body.bootpay-open .slide-down{animation:__bootpay-slide-down-mobile .1s ease-in forwards!important}}body.bootpay-inherit .slide-static-down,body.bootpay-open .slide-static-down{animation:__bootpay-slide-down-mobile .1s ease-in forwards!important}body.bootpay-inherit.bootpay-mobile .bootpay-payment-background,body.bootpay-open.bootpay-mobile .bootpay-payment-background{background-color:transparent}@media (min-width: 600px){body.bootpay-inherit.bootpay-mobile .bootpay-payment-background,body.bootpay-open.bootpay-mobile .bootpay-payment-background{background-color:var(--bootpay-overlay)}}body.bootpay-inherit .bootpay-transparent-background,body.bootpay-open .bootpay-transparent-background{position:relative;height:100%;z-index:var(--bootpay-z-modal)}body.bootpay-inherit .bootpay-transparent-background.__overflow-y,body.bootpay-open .bootpay-transparent-background.__overflow-y{overflow-y:auto}body.bootpay-inherit .bootpay-transparent-background>.bootpay-payment-window,body.bootpay-open .bootpay-transparent-background>.bootpay-payment-window{position:relative;display:block;width:500px;height:auto}@media (max-width: 768px){body.bootpay-inherit .bootpay-transparent-background>.bootpay-payment-window,body.bootpay-open .bootpay-transparent-background>.bootpay-payment-window{width:100%}}body.bootpay-inherit .bootpay-transparent-background>.bootpay-payment-window.__mobile,body.bootpay-open .bootpay-transparent-background>.bootpay-payment-window.__mobile{max-width:470px;height:90%}body.bootpay-inherit .bootpay-transparent-background>.bootpay-payment-window>iframe,body.bootpay-open .bootpay-transparent-background>.bootpay-payment-window>iframe{width:100%!important;border-radius:0}body.bootpay-inherit .bootpay-transparent-background>.bootpay-payment-window>iframe.transparent,body.bootpay-open .bootpay-transparent-background>.bootpay-payment-window>iframe.transparent{background:transparent!important}body.bootpay-inherit .bootpay-payment-background,body.bootpay-open .bootpay-payment-background{position:fixed;left:0;right:0;top:0;bottom:0;display:block;text-align:center;background-color:var(--bootpay-overlay);z-index:var(--bootpay-z-modal);backdrop-filter:var(--bootpay-blur);-webkit-backdrop-filter:var(--bootpay-blur);overflow:hidden}@media (max-height: 850px){body.bootpay-inherit .bootpay-payment-background,body.bootpay-open .bootpay-payment-background{overflow-y:auto}}body.bootpay-inherit .bootpay-payment-background:before,body.bootpay-open .bootpay-payment-background:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-inherit .bootpay-payment-background.__alert,body.bootpay-open .bootpay-payment-background.__alert{padding:1rem}body.bootpay-inherit .bootpay-payment-background.__alert:before,body.bootpay-open .bootpay-payment-background.__alert:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-inherit .bootpay-payment-background.__alert>.slider-window,body.bootpay-open .bootpay-payment-background.__alert>.slider-window{max-width:480px;position:absolute;width:100%;background-color:var(--bootpay-white);border-radius:24px;left:50%;top:50%;transform:translate(-50%,-50%);overflow:hidden;box-shadow:0 10px 40px #00000014,0 4px 12px #0000000a;border:1px solid #f1f5f9}body.bootpay-inherit .bootpay-payment-background.__alert>.slider-window.__bootpay-hidden,body.bootpay-open .bootpay-payment-background.__alert>.slider-window.__bootpay-hidden{display:none}@media (max-width: 600px){body.bootpay-inherit .bootpay-payment-background.__alert>.slider-window,body.bootpay-open .bootpay-payment-background.__alert>.slider-window{left:0;right:0;bottom:0;width:100%;max-width:inherit;top:auto;border-bottom-left-radius:0;border-bottom-right-radius:0;transform:translateY(0) translate(0)}}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window{position:absolute;max-width:400px;width:100%;background-color:var(--bootpay-white);border-radius:var(--bootpay-radius-xl);left:50%;top:50%;transform:translate(-50%,-50%);overflow:hidden;box-shadow:0 10px 40px #00000014,0 4px 12px #0000000a;border:1px solid #f1f5f9}@media (max-width: 768px){body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window{left:1rem;right:1rem;width:auto;top:50%;transform:translateY(-50%)}}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header{display:flex;align-items:center;gap:.75rem;padding:1.5rem 1.5rem .75rem;text-align:left;position:relative;background-color:var(--bootpay-white)}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay__alert-icon,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay__alert-icon{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:40px;height:40px;border-radius:50%;color:var(--bootpay-primary);background-color:#507cf31a}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay__alert-icon>svg,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay__alert-icon>svg{width:22px;height:22px}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay__alert-title,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay__alert-title{flex:1;font-size:18px;font-weight:700;line-height:1.4;color:#1e293b}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn{top:1rem;right:1rem;width:32px;height:32px;padding:0;border-radius:8px;background-color:transparent;transition:background-color .15s ease}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:hover,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:hover{background-color:#f1f5f9}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:before,body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:after,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:before,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:after{left:50%;top:50%;width:1.5px;height:16px;background-color:#64748b}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:before,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:before{transform:translate(-50%,-50%) rotate(45deg)}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:after,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:after{transform:translate(-50%,-50%) rotate(-45deg)}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-body,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-body{padding:.25rem 1.5rem 1.25rem;text-align:left;font-size:15px;line-height:1.6;color:#475569;background:transparent}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer{display:flex;gap:.75rem;padding:.75rem 1.5rem 1.5rem;background-color:#f8fafc}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close{flex:1;padding:.875rem 1rem;border-radius:var(--bootpay-radius);background-color:var(--bootpay-white);border:1px solid #e2e8f0;color:#475569;font-size:15px;font-weight:600;cursor:pointer;outline:none;transition:all .2s ease}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close:hover,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close:hover{background-color:#f1f5f9;border-color:#cbd5e1}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.bootpay-primary,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.bootpay-primary{background-color:var(--bootpay-primary);border-color:var(--bootpay-primary);color:var(--bootpay-white);box-shadow:0 4px 12px #507cf340}body.bootpay-inherit .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.bootpay-primary:hover,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.bootpay-primary:hover{background-color:var(--bootpay-primary-hover);border-color:var(--bootpay-primary-hover)}body.bootpay-inherit .bootpay-payment-background.__alert .slider-window>.bootpay__slider-icon,body.bootpay-open .bootpay-payment-background.__alert .slider-window>.bootpay__slider-icon{display:flex;align-items:center;justify-content:center;width:64px;height:64px;margin:1.5rem auto 1.25rem;border-radius:50%;color:var(--bootpay-primary);background-color:#507cf31a;box-shadow:0 0 0 6px #507cf30f}body.bootpay-inherit .bootpay-payment-background.__alert .slider-window>.bootpay__slider-icon>svg,body.bootpay-open .bootpay-payment-background.__alert .slider-window>.bootpay__slider-icon>svg{width:32px;height:32px}body.bootpay-inherit .bootpay-payment-background.__alert .slider-window>.bootpay__alert-header,body.bootpay-open .bootpay-payment-background.__alert .slider-window>.bootpay__alert-header{padding:0 2rem .5rem;text-align:center;font-size:20px;font-weight:700;line-height:1.4;color:#1e293b;background-color:var(--bootpay-white)}body.bootpay-inherit .bootpay-payment-background.__alert .slider-window>.bootpay__alert-header.__text-center,body.bootpay-open .bootpay-payment-background.__alert .slider-window>.bootpay__alert-header.__text-center{text-align:center}body.bootpay-inherit .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body,body.bootpay-open .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body{padding:.5rem 1rem 1.5rem;text-align:center;font-size:16px;color:var(--bootpay-gray-dark);line-height:1.5;background:transparent}body.bootpay-inherit .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body.slider-body,body.bootpay-open .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body.slider-body{padding:.5rem 1.5rem 1.75rem;background:transparent}body.bootpay-inherit .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body button.bootpay__slider-button,body.bootpay-open .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body button.bootpay__slider-button{display:block;width:100%;height:52px;padding:0 1.5rem;color:#4e5968;font-size:16px;font-weight:600;border-radius:14px;outline:none;border:0;cursor:pointer;margin-top:.5rem;background-color:#f2f4f6;transition:background-color .2s ease,transform .1s ease}body.bootpay-inherit .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body button.bootpay__slider-button:first-child,body.bootpay-open .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body button.bootpay__slider-button:first-child{margin-top:0}body.bootpay-inherit .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body button.bootpay__slider-button:hover,body.bootpay-open .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body button.bootpay__slider-button:hover{background-color:#e5e8eb}body.bootpay-inherit .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body button.bootpay__slider-button:active,body.bootpay-open .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body button.bootpay__slider-button:active{transform:scale(.98)}body.bootpay-inherit .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body button.bootpay__slider-button.active,body.bootpay-open .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body button.bootpay__slider-button.active{color:var(--bootpay-white);background-color:var(--bootpay-primary);box-shadow:0 4px 12px #507cf340}body.bootpay-inherit .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body button.bootpay__slider-button.active:hover,body.bootpay-open .bootpay-payment-background.__alert .slider-window>.bootpay__alert-body button.bootpay__slider-button.active:hover{background-color:var(--bootpay-primary-hover)}body.bootpay-inherit .bootpay-payment-background>.bootpay-confirm-form,body.bootpay-open .bootpay-payment-background>.bootpay-confirm-form{position:absolute;right:0;bottom:0;height:0;line-height:0}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:relative;display:inline-block;vertical-align:middle}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window.__mobile,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{max-width:470px;height:90%}@media (max-width: 1120px){body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window.bootpay-commerce-invoice,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.bootpay-commerce-invoice{position:absolute;left:0;right:0;top:0;bottom:0;border-radius:0!important}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window.bootpay-commerce-invoice>iframe,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.bootpay-commerce-invoice>iframe{width:100%!important;height:100%!important;border-radius:0}}@media (max-height: 1020px){body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window.bootpay-commerce-invoice,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.bootpay-commerce-invoice{position:absolute;left:0;right:0;top:0;bottom:0;border-radius:0!important}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window.bootpay-commerce-invoice>iframe,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.bootpay-commerce-invoice>iframe{width:100%!important;height:100%!important;border-radius:0}}@media (max-width: 768px){body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:absolute;left:0;right:0;top:0;bottom:0;border-radius:0!important}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window.__mobile,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{position:absolute;max-width:inherit;left:0;right:0;top:0;bottom:0;height:100%}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>iframe,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%!important;height:100%!important;border-radius:0}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>iframe.transparent,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.transparent{background:transparent!important}}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{position:absolute;display:none;top:-32px;right:4px;color:var(--bootpay-white);font-size:32px;text-decoration:none;outline:none;box-shadow:none;border:0;background-color:transparent}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after,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:var(--bootpay-white)!important}@media (max-width: 768px){body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{top:1rem;right:16px;color:var(--bootpay-black);padding:0}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after,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:var(--bootpay-black)!important}}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{--bootpay-popup-accent: var(--bootpay-primary);--bootpay-popup-accent-hover: var(--bootpay-primary-hover);--bootpay-popup-accent-soft: rgba(80, 124, 243, .08);--bootpay-popup-accent-text: #3f6be2;--bootpay-popup-on-accent: var(--bootpay-white);position:relative;width:400px;height:600px;display:none;background-color:var(--bootpay-white);border-radius:var(--bootpay-radius-lg);box-shadow:0 24px 48px -12px #0f172a47;overflow:hidden}@media (max-width: 768px){body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:absolute;left:0;top:0;bottom:0;right:0;width:100%;height:100%;border-radius:0;box-shadow:none}}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header{position:absolute;left:0;right:0;top:0;height:56px;color:var(--bootpay-gray-dark);background-color:var(--bootpay-white);text-align:left}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn{top:12px;right:12px;width:32px;height:32px;padding:0;border-radius:8px;cursor:pointer;transition:background-color .15s ease}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn:hover,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn:hover{background-color:var(--bootpay-gray-bg)}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn:focus-visible,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn:focus-visible{outline:2px solid var(--bootpay-popup-accent)!important;outline-offset:2px}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn:before,body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn:after,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn:after{left:50%;top:50%;width:1.5px;height:16px;background-color:var(--bootpay-gray-light)}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn:before{transform:translate(-50%,-50%) rotate(45deg)}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn:after,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header>.bootpay-close-btn:after{transform:translate(-50%,-50%) rotate(-45deg)}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body{position:absolute;left:0;right:0;top:56px;bottom:var(--bootpay-popup-bottom);display:flex;flex-direction:column;align-items:center;padding:1rem 1.5rem;text-align:center;font-size:14px}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-item-name-id,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-item-name-id{max-width:100%;margin:auto 0 .5rem;font-size:15px;line-height:1.4;color:var(--bootpay-gray-light);font-weight:500!important;text-wrap:balance;word-break:keep-all;overflow-wrap:anywhere}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-price-id,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-price-id{margin:0;font-size:36px;color:var(--bootpay-gray-dark);font-weight:700;letter-spacing:-.02em;line-height:1.2;font-variant-numeric:tabular-nums}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>.agree-text,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>.agree-text{display:flex;align-items:flex-start;gap:8px;width:100%;margin-top:auto;padding:12px 14px;border-radius:var(--bootpay-radius);background-color:var(--bootpay-popup-accent-soft);color:var(--bootpay-popup-accent-text);font-size:14px;font-weight:500;line-height:1.5;text-align:left;word-break:keep-all;box-sizing:border-box}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>.agree-text>svg,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>.agree-text>svg{flex:none;width:18px;height:18px;margin-top:1px}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:flex-start;height:var(--bootpay-popup-bottom);padding:0 1.5rem;margin:0;box-sizing:border-box}@media (max-width: 768px){body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer{height:calc(var(--bootpay-popup-bottom) + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px)}}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button{display:block;width:100%;height:52px;padding:0 1rem;outline:none;border:none;background-color:var(--bootpay-popup-accent);border-radius:var(--bootpay-radius);color:var(--bootpay-popup-on-accent);font-size:16px;font-weight:600;cursor:pointer;transition:background-color .2s ease,transform .1s ease}body.bootpay-inherit .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:hover{background-color:var(--bootpay-popup-accent-hover)}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:active,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:active{transform:scale(.98)}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:hover,body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:active,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{box-shadow:none}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:focus-visible,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:focus-visible{outline:2px solid var(--bootpay-popup-accent);outline-offset:2px}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>iframe.bootpay-commerce-checkout-iframe,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.bootpay-commerce-checkout-iframe{width:100%;height:100%;display:none;border:0!important;outline:0!important;border-radius:0;box-shadow:none}@media (max-width: 1100px){body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>iframe.bootpay-commerce-checkout-iframe,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.bootpay-commerce-checkout-iframe{width:100%!important;height:100%!important;overflow-y:auto}}@media (min-width: 1100px){body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>iframe.bootpay-commerce-checkout-iframe,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.bootpay-commerce-checkout-iframe{width:0;height:0;border:0;outline:0;border-radius:0;box-shadow:none!important}}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>iframe,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-inherit .bootpay-payment-background>.bootpay-payment-window>iframe,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:0;height:0;border:0;outline:0;border-radius:0;box-shadow:none!important}}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{border-radius:0}@media (min-width: 600px){body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{width:0;height:0;border:0;outline:0;border-radius:var(--bootpay-radius-sm)!important;box-shadow:none!important}}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window #__bootpay-modal-iframe.slide-up,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window #__bootpay-modal-iframe.slide-up{animation:__bootpay-slide-up .3s linear}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window #__bootpay-modal-iframe.slide-down,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window #__bootpay-modal-iframe.slide-down{animation:__bootpay-slide-down .3s linear}body.bootpay-inherit .bootpay-payment-background>.bootpay-payment-window>.bootpay-confirm-window>iframe,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.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:transparent;outline:0;z-index:var(--bootpay-z-close);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:var(--bootpay-gray-dark)}@media (min-width: 600px){.bootpay-close-btn:before,.bootpay-close-btn:after{height:23px;top:0;width:2px;background-color:var(--bootpay-white)}}.bootpay-close-btn:before{transform:rotate(45deg)}.bootpay-close-btn:after{transform:rotate(-45deg)}@keyframes __bootpay-slide-up{0%{transform:translate(-50%,150%);opacity:1}to{transform:translate(-50%,-50%);opacity:1}}@keyframes __bootpay-slide-down{0%{transform:translate(-50%,-50%);opacity:1}to{transform:translate(-50%,150%);opacity:1}}@keyframes __bootpay-slide-up-mobile{0%{transform:translateY(100%);opacity:1}to{transform:translateY(0);opacity:1}}@keyframes __bootpay-slide-down-mobile{0%{transform:translateY(0);opacity:1}to{transform:translateY(100%);opacity:1}}@keyframes __bootpay-fade-in{0%{opacity:0;scale:.9}to{opacity:1;scale:1}}@keyframes __bootpay-fade-out{0%{opacity:1;scale:1}to{opacity:0;scale:.9}}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
const H = {
|
|
3
|
+
PLATFORM: {
|
|
4
|
+
JS: 1,
|
|
5
|
+
ANDROID: 2,
|
|
6
|
+
IOS: 3,
|
|
7
|
+
REST: 4
|
|
8
|
+
},
|
|
9
|
+
STORAGE_PREFIX(s) {
|
|
10
|
+
return `__bootpay_track_${s}__`;
|
|
11
|
+
}
|
|
12
|
+
}, ke = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (s) => {
|
|
13
|
+
let e = Math.random() * 16 | 0;
|
|
14
|
+
return (s == "x" ? e : e & 3 | 8).toString(16);
|
|
15
|
+
}), q = (s) => {
|
|
16
|
+
let e = !1;
|
|
17
|
+
return typeof s == "string" || Array.isArray(s) ? e = s.length === 0 : e = s == null || oe(s, "object") && s.constructor === Object && Object.keys(s).length === 0, e;
|
|
18
|
+
}, M = (s) => !q(s), oe = (s, e) => typeof s === e, De = (s, e = void 0) => {
|
|
19
|
+
if (M(e)) {
|
|
20
|
+
const t = typeof e != "string" ? new URLSearchParams(JSON.parse(JSON.stringify(e))).toString() : e;
|
|
21
|
+
return /\?/.test(s) ? `${s.replace(/&/g, "&")}&${t}` : `${s.replace(/&/g, "&")}?${t}`;
|
|
22
|
+
} else
|
|
23
|
+
return s;
|
|
24
|
+
}, xt = (s, e) => {
|
|
25
|
+
for (let t in e)
|
|
26
|
+
e.hasOwnProperty(t) && (s[t] = e[t]);
|
|
27
|
+
return s;
|
|
28
|
+
};
|
|
29
|
+
var z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
30
|
+
function le(s) {
|
|
31
|
+
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
32
|
+
}
|
|
33
|
+
function Fe(s) {
|
|
34
|
+
if (s.__esModule) return s;
|
|
35
|
+
var e = s.default;
|
|
36
|
+
if (typeof e == "function") {
|
|
37
|
+
var t = function r() {
|
|
38
|
+
return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
|
|
39
|
+
};
|
|
40
|
+
t.prototype = e.prototype;
|
|
41
|
+
} else t = {};
|
|
42
|
+
return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(s).forEach(function(r) {
|
|
43
|
+
var i = Object.getOwnPropertyDescriptor(s, r);
|
|
44
|
+
Object.defineProperty(t, r, i.get ? i : {
|
|
45
|
+
enumerable: !0,
|
|
46
|
+
get: function() {
|
|
47
|
+
return s[r];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}), t;
|
|
51
|
+
}
|
|
52
|
+
var Se = { exports: {} };
|
|
53
|
+
function Le(s) {
|
|
54
|
+
throw new Error('Could not dynamically require "' + s + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
55
|
+
}
|
|
56
|
+
var ue = { exports: {} };
|
|
57
|
+
const Me = {}, je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
58
|
+
__proto__: null,
|
|
59
|
+
default: Me
|
|
60
|
+
}, Symbol.toStringTag, { value: "Module" })), He = /* @__PURE__ */ Fe(je);
|
|
61
|
+
var _e;
|
|
62
|
+
function Z() {
|
|
63
|
+
return _e || (_e = 1, function(s, e) {
|
|
64
|
+
(function(t, r) {
|
|
65
|
+
s.exports = r();
|
|
66
|
+
})(z, function() {
|
|
67
|
+
var t = t || function(r, i) {
|
|
68
|
+
var c;
|
|
69
|
+
if (typeof window < "u" && window.crypto && (c = window.crypto), typeof self < "u" && self.crypto && (c = self.crypto), typeof globalThis < "u" && globalThis.crypto && (c = globalThis.crypto), !c && typeof window < "u" && window.msCrypto && (c = window.msCrypto), !c && typeof z < "u" && z.crypto && (c = z.crypto), !c && typeof Le == "function")
|
|
70
|
+
try {
|
|
71
|
+
c = He;
|
|
72
|
+
} catch {
|
|
73
|
+
}
|
|
74
|
+
var x = function() {
|
|
75
|
+
if (c) {
|
|
76
|
+
if (typeof c.getRandomValues == "function")
|
|
77
|
+
try {
|
|
78
|
+
return c.getRandomValues(new Uint32Array(1))[0];
|
|
79
|
+
} catch {
|
|
80
|
+
}
|
|
81
|
+
if (typeof c.randomBytes == "function")
|
|
82
|
+
try {
|
|
83
|
+
return c.randomBytes(4).readInt32LE();
|
|
84
|
+
} catch {
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
throw new Error("Native crypto module could not be used to get secure random number.");
|
|
88
|
+
}, w = Object.create || /* @__PURE__ */ function() {
|
|
89
|
+
function p() {
|
|
90
|
+
}
|
|
91
|
+
return function(o) {
|
|
92
|
+
var l;
|
|
93
|
+
return p.prototype = o, l = new p(), p.prototype = null, l;
|
|
94
|
+
};
|
|
95
|
+
}(), B = {}, n = B.lib = {}, I = n.Base = /* @__PURE__ */ function() {
|
|
96
|
+
return {
|
|
97
|
+
/**
|
|
98
|
+
* Creates a new object that inherits from this object.
|
|
99
|
+
*
|
|
100
|
+
* @param {Object} overrides Properties to copy into the new object.
|
|
101
|
+
*
|
|
102
|
+
* @return {Object} The new object.
|
|
103
|
+
*
|
|
104
|
+
* @static
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
*
|
|
108
|
+
* var MyType = CryptoJS.lib.Base.extend({
|
|
109
|
+
* field: 'value',
|
|
110
|
+
*
|
|
111
|
+
* method: function () {
|
|
112
|
+
* }
|
|
113
|
+
* });
|
|
114
|
+
*/
|
|
115
|
+
extend: function(p) {
|
|
116
|
+
var o = w(this);
|
|
117
|
+
return p && o.mixIn(p), (!o.hasOwnProperty("init") || this.init === o.init) && (o.init = function() {
|
|
118
|
+
o.$super.init.apply(this, arguments);
|
|
119
|
+
}), o.init.prototype = o, o.$super = this, o;
|
|
120
|
+
},
|
|
121
|
+
/**
|
|
122
|
+
* Extends this object and runs the init method.
|
|
123
|
+
* Arguments to create() will be passed to init().
|
|
124
|
+
*
|
|
125
|
+
* @return {Object} The new object.
|
|
126
|
+
*
|
|
127
|
+
* @static
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
*
|
|
131
|
+
* var instance = MyType.create();
|
|
132
|
+
*/
|
|
133
|
+
create: function() {
|
|
134
|
+
var p = this.extend();
|
|
135
|
+
return p.init.apply(p, arguments), p;
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* Initializes a newly created object.
|
|
139
|
+
* Override this method to add some logic when your objects are created.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
*
|
|
143
|
+
* var MyType = CryptoJS.lib.Base.extend({
|
|
144
|
+
* init: function () {
|
|
145
|
+
* // ...
|
|
146
|
+
* }
|
|
147
|
+
* });
|
|
148
|
+
*/
|
|
149
|
+
init: function() {
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* Copies properties into this object.
|
|
153
|
+
*
|
|
154
|
+
* @param {Object} properties The properties to mix in.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
*
|
|
158
|
+
* MyType.mixIn({
|
|
159
|
+
* field: 'value'
|
|
160
|
+
* });
|
|
161
|
+
*/
|
|
162
|
+
mixIn: function(p) {
|
|
163
|
+
for (var o in p)
|
|
164
|
+
p.hasOwnProperty(o) && (this[o] = p[o]);
|
|
165
|
+
p.hasOwnProperty("toString") && (this.toString = p.toString);
|
|
166
|
+
},
|
|
167
|
+
/**
|
|
168
|
+
* Creates a copy of this object.
|
|
169
|
+
*
|
|
170
|
+
* @return {Object} The clone.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
*
|
|
174
|
+
* var clone = instance.clone();
|
|
175
|
+
*/
|
|
176
|
+
clone: function() {
|
|
177
|
+
return this.init.prototype.extend(this);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
}(), k = n.WordArray = I.extend({
|
|
181
|
+
/**
|
|
182
|
+
* Initializes a newly created word array.
|
|
183
|
+
*
|
|
184
|
+
* @param {Array} words (Optional) An array of 32-bit words.
|
|
185
|
+
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
*
|
|
189
|
+
* var wordArray = CryptoJS.lib.WordArray.create();
|
|
190
|
+
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
|
|
191
|
+
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
|
|
192
|
+
*/
|
|
193
|
+
init: function(p, o) {
|
|
194
|
+
p = this.words = p || [], o != i ? this.sigBytes = o : this.sigBytes = p.length * 4;
|
|
195
|
+
},
|
|
196
|
+
/**
|
|
197
|
+
* Converts this word array to a string.
|
|
198
|
+
*
|
|
199
|
+
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
|
|
200
|
+
*
|
|
201
|
+
* @return {string} The stringified word array.
|
|
202
|
+
*
|
|
203
|
+
* @example
|
|
204
|
+
*
|
|
205
|
+
* var string = wordArray + '';
|
|
206
|
+
* var string = wordArray.toString();
|
|
207
|
+
* var string = wordArray.toString(CryptoJS.enc.Utf8);
|
|
208
|
+
*/
|
|
209
|
+
toString: function(p) {
|
|
210
|
+
return (p || b).stringify(this);
|
|
211
|
+
},
|
|
212
|
+
/**
|
|
213
|
+
* Concatenates a word array to this word array.
|
|
214
|
+
*
|
|
215
|
+
* @param {WordArray} wordArray The word array to append.
|
|
216
|
+
*
|
|
217
|
+
* @return {WordArray} This word array.
|
|
218
|
+
*
|
|
219
|
+
* @example
|
|
220
|
+
*
|
|
221
|
+
* wordArray1.concat(wordArray2);
|
|
222
|
+
*/
|
|
223
|
+
concat: function(p) {
|
|
224
|
+
var o = this.words, l = p.words, g = this.sigBytes, P = p.sigBytes;
|
|
225
|
+
if (this.clamp(), g % 4)
|
|
226
|
+
for (var A = 0; A < P; A++) {
|
|
227
|
+
var F = l[A >>> 2] >>> 24 - A % 4 * 8 & 255;
|
|
228
|
+
o[g + A >>> 2] |= F << 24 - (g + A) % 4 * 8;
|
|
229
|
+
}
|
|
230
|
+
else
|
|
231
|
+
for (var D = 0; D < P; D += 4)
|
|
232
|
+
o[g + D >>> 2] = l[D >>> 2];
|
|
233
|
+
return this.sigBytes += P, this;
|
|
234
|
+
},
|
|
235
|
+
/**
|
|
236
|
+
* Removes insignificant bits.
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
*
|
|
240
|
+
* wordArray.clamp();
|
|
241
|
+
*/
|
|
242
|
+
clamp: function() {
|
|
243
|
+
var p = this.words, o = this.sigBytes;
|
|
244
|
+
p[o >>> 2] &= 4294967295 << 32 - o % 4 * 8, p.length = r.ceil(o / 4);
|
|
245
|
+
},
|
|
246
|
+
/**
|
|
247
|
+
* Creates a copy of this word array.
|
|
248
|
+
*
|
|
249
|
+
* @return {WordArray} The clone.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
*
|
|
253
|
+
* var clone = wordArray.clone();
|
|
254
|
+
*/
|
|
255
|
+
clone: function() {
|
|
256
|
+
var p = I.clone.call(this);
|
|
257
|
+
return p.words = this.words.slice(0), p;
|
|
258
|
+
},
|
|
259
|
+
/**
|
|
260
|
+
* Creates a word array filled with random bytes.
|
|
261
|
+
*
|
|
262
|
+
* @param {number} nBytes The number of random bytes to generate.
|
|
263
|
+
*
|
|
264
|
+
* @return {WordArray} The random word array.
|
|
265
|
+
*
|
|
266
|
+
* @static
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
*
|
|
270
|
+
* var wordArray = CryptoJS.lib.WordArray.random(16);
|
|
271
|
+
*/
|
|
272
|
+
random: function(p) {
|
|
273
|
+
for (var o = [], l = 0; l < p; l += 4)
|
|
274
|
+
o.push(x());
|
|
275
|
+
return new k.init(o, p);
|
|
276
|
+
}
|
|
277
|
+
}), d = B.enc = {}, b = d.Hex = {
|
|
278
|
+
/**
|
|
279
|
+
* Converts a word array to a hex string.
|
|
280
|
+
*
|
|
281
|
+
* @param {WordArray} wordArray The word array.
|
|
282
|
+
*
|
|
283
|
+
* @return {string} The hex string.
|
|
284
|
+
*
|
|
285
|
+
* @static
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
*
|
|
289
|
+
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
|
|
290
|
+
*/
|
|
291
|
+
stringify: function(p) {
|
|
292
|
+
for (var o = p.words, l = p.sigBytes, g = [], P = 0; P < l; P++) {
|
|
293
|
+
var A = o[P >>> 2] >>> 24 - P % 4 * 8 & 255;
|
|
294
|
+
g.push((A >>> 4).toString(16)), g.push((A & 15).toString(16));
|
|
295
|
+
}
|
|
296
|
+
return g.join("");
|
|
297
|
+
},
|
|
298
|
+
/**
|
|
299
|
+
* Converts a hex string to a word array.
|
|
300
|
+
*
|
|
301
|
+
* @param {string} hexStr The hex string.
|
|
302
|
+
*
|
|
303
|
+
* @return {WordArray} The word array.
|
|
304
|
+
*
|
|
305
|
+
* @static
|
|
306
|
+
*
|
|
307
|
+
* @example
|
|
308
|
+
*
|
|
309
|
+
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
|
|
310
|
+
*/
|
|
311
|
+
parse: function(p) {
|
|
312
|
+
for (var o = p.length, l = [], g = 0; g < o; g += 2)
|
|
313
|
+
l[g >>> 3] |= parseInt(p.substr(g, 2), 16) << 24 - g % 8 * 4;
|
|
314
|
+
return new k.init(l, o / 2);
|
|
315
|
+
}
|
|
316
|
+
}, S = d.Latin1 = {
|
|
317
|
+
/**
|
|
318
|
+
* Converts a word array to a Latin1 string.
|
|
319
|
+
*
|
|
320
|
+
* @param {WordArray} wordArray The word array.
|
|
321
|
+
*
|
|
322
|
+
* @return {string} The Latin1 string.
|
|
323
|
+
*
|
|
324
|
+
* @static
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
*
|
|
328
|
+
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
|
|
329
|
+
*/
|
|
330
|
+
stringify: function(p) {
|
|
331
|
+
for (var o = p.words, l = p.sigBytes, g = [], P = 0; P < l; P++) {
|
|
332
|
+
var A = o[P >>> 2] >>> 24 - P % 4 * 8 & 255;
|
|
333
|
+
g.push(String.fromCharCode(A));
|
|
334
|
+
}
|
|
335
|
+
return g.join("");
|
|
336
|
+
},
|
|
337
|
+
/**
|
|
338
|
+
* Converts a Latin1 string to a word array.
|
|
339
|
+
*
|
|
340
|
+
* @param {string} latin1Str The Latin1 string.
|
|
341
|
+
*
|
|
342
|
+
* @return {WordArray} The word array.
|
|
343
|
+
*
|
|
344
|
+
* @static
|
|
345
|
+
*
|
|
346
|
+
* @example
|
|
347
|
+
*
|
|
348
|
+
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
|
|
349
|
+
*/
|
|
350
|
+
parse: function(p) {
|
|
351
|
+
for (var o = p.length, l = [], g = 0; g < o; g++)
|
|
352
|
+
l[g >>> 2] |= (p.charCodeAt(g) & 255) << 24 - g % 4 * 8;
|
|
353
|
+
return new k.init(l, o);
|
|
354
|
+
}
|
|
355
|
+
}, _ = d.Utf8 = {
|
|
356
|
+
/**
|
|
357
|
+
* Converts a word array to a UTF-8 string.
|
|
358
|
+
*
|
|
359
|
+
* @param {WordArray} wordArray The word array.
|
|
360
|
+
*
|
|
361
|
+
* @return {string} The UTF-8 string.
|
|
362
|
+
*
|
|
363
|
+
* @static
|
|
364
|
+
*
|
|
365
|
+
* @example
|
|
366
|
+
*
|
|
367
|
+
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
|
|
368
|
+
*/
|
|
369
|
+
stringify: function(p) {
|
|
370
|
+
try {
|
|
371
|
+
return decodeURIComponent(escape(S.stringify(p)));
|
|
372
|
+
} catch {
|
|
373
|
+
throw new Error("Malformed UTF-8 data");
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
/**
|
|
377
|
+
* Converts a UTF-8 string to a word array.
|
|
378
|
+
*
|
|
379
|
+
* @param {string} utf8Str The UTF-8 string.
|
|
380
|
+
*
|
|
381
|
+
* @return {WordArray} The word array.
|
|
382
|
+
*
|
|
383
|
+
* @static
|
|
384
|
+
*
|
|
385
|
+
* @example
|
|
386
|
+
*
|
|
387
|
+
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
|
|
388
|
+
*/
|
|
389
|
+
parse: function(p) {
|
|
390
|
+
return S.parse(unescape(encodeURIComponent(p)));
|
|
391
|
+
}
|
|
392
|
+
}, E = n.BufferedBlockAlgorithm = I.extend({
|
|
393
|
+
/**
|
|
394
|
+
* Resets this block algorithm's data buffer to its initial state.
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
*
|
|
398
|
+
* bufferedBlockAlgorithm.reset();
|
|
399
|
+
*/
|
|
400
|
+
reset: function() {
|
|
401
|
+
this._data = new k.init(), this._nDataBytes = 0;
|
|
402
|
+
},
|
|
403
|
+
/**
|
|
404
|
+
* Adds new data to this block algorithm's buffer.
|
|
405
|
+
*
|
|
406
|
+
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
|
|
407
|
+
*
|
|
408
|
+
* @example
|
|
409
|
+
*
|
|
410
|
+
* bufferedBlockAlgorithm._append('data');
|
|
411
|
+
* bufferedBlockAlgorithm._append(wordArray);
|
|
412
|
+
*/
|
|
413
|
+
_append: function(p) {
|
|
414
|
+
typeof p == "string" && (p = _.parse(p)), this._data.concat(p), this._nDataBytes += p.sigBytes;
|
|
415
|
+
},
|
|
416
|
+
/**
|
|
417
|
+
* Processes available data blocks.
|
|
418
|
+
*
|
|
419
|
+
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
|
|
420
|
+
*
|
|
421
|
+
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
|
|
422
|
+
*
|
|
423
|
+
* @return {WordArray} The processed data.
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
*
|
|
427
|
+
* var processedData = bufferedBlockAlgorithm._process();
|
|
428
|
+
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
|
|
429
|
+
*/
|
|
430
|
+
_process: function(p) {
|
|
431
|
+
var o, l = this._data, g = l.words, P = l.sigBytes, A = this.blockSize, F = A * 4, D = P / F;
|
|
432
|
+
p ? D = r.ceil(D) : D = r.max((D | 0) - this._minBufferSize, 0);
|
|
433
|
+
var a = D * A, u = r.min(a * 4, P);
|
|
434
|
+
if (a) {
|
|
435
|
+
for (var $ = 0; $ < a; $ += A)
|
|
436
|
+
this._doProcessBlock(g, $);
|
|
437
|
+
o = g.splice(0, a), l.sigBytes -= u;
|
|
438
|
+
}
|
|
439
|
+
return new k.init(o, u);
|
|
440
|
+
},
|
|
441
|
+
/**
|
|
442
|
+
* Creates a copy of this object.
|
|
443
|
+
*
|
|
444
|
+
* @return {Object} The clone.
|
|
445
|
+
*
|
|
446
|
+
* @example
|
|
447
|
+
*
|
|
448
|
+
* var clone = bufferedBlockAlgorithm.clone();
|
|
449
|
+
*/
|
|
450
|
+
clone: function() {
|
|
451
|
+
var p = I.clone.call(this);
|
|
452
|
+
return p._data = this._data.clone(), p;
|
|
453
|
+
},
|
|
454
|
+
_minBufferSize: 0
|
|
455
|
+
});
|
|
456
|
+
n.Hasher = E.extend({
|
|
457
|
+
/**
|
|
458
|
+
* Configuration options.
|
|
459
|
+
*/
|
|
460
|
+
cfg: I.extend(),
|
|
461
|
+
/**
|
|
462
|
+
* Initializes a newly created hasher.
|
|
463
|
+
*
|
|
464
|
+
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
|
|
465
|
+
*
|
|
466
|
+
* @example
|
|
467
|
+
*
|
|
468
|
+
* var hasher = CryptoJS.algo.SHA256.create();
|
|
469
|
+
*/
|
|
470
|
+
init: function(p) {
|
|
471
|
+
this.cfg = this.cfg.extend(p), this.reset();
|
|
472
|
+
},
|
|
473
|
+
/**
|
|
474
|
+
* Resets this hasher to its initial state.
|
|
475
|
+
*
|
|
476
|
+
* @example
|
|
477
|
+
*
|
|
478
|
+
* hasher.reset();
|
|
479
|
+
*/
|
|
480
|
+
reset: function() {
|
|
481
|
+
E.reset.call(this), this._doReset();
|
|
482
|
+
},
|
|
483
|
+
/**
|
|
484
|
+
* Updates this hasher with a message.
|
|
485
|
+
*
|
|
486
|
+
* @param {WordArray|string} messageUpdate The message to append.
|
|
487
|
+
*
|
|
488
|
+
* @return {Hasher} This hasher.
|
|
489
|
+
*
|
|
490
|
+
* @example
|
|
491
|
+
*
|
|
492
|
+
* hasher.update('message');
|
|
493
|
+
* hasher.update(wordArray);
|
|
494
|
+
*/
|
|
495
|
+
update: function(p) {
|
|
496
|
+
return this._append(p), this._process(), this;
|
|
497
|
+
},
|
|
498
|
+
/**
|
|
499
|
+
* Finalizes the hash computation.
|
|
500
|
+
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
501
|
+
*
|
|
502
|
+
* @param {WordArray|string} messageUpdate (Optional) A final message update.
|
|
503
|
+
*
|
|
504
|
+
* @return {WordArray} The hash.
|
|
505
|
+
*
|
|
506
|
+
* @example
|
|
507
|
+
*
|
|
508
|
+
* var hash = hasher.finalize();
|
|
509
|
+
* var hash = hasher.finalize('message');
|
|
510
|
+
* var hash = hasher.finalize(wordArray);
|
|
511
|
+
*/
|
|
512
|
+
finalize: function(p) {
|
|
513
|
+
p && this._append(p);
|
|
514
|
+
var o = this._doFinalize();
|
|
515
|
+
return o;
|
|
516
|
+
},
|
|
517
|
+
blockSize: 16,
|
|
518
|
+
/**
|
|
519
|
+
* Creates a shortcut function to a hasher's object interface.
|
|
520
|
+
*
|
|
521
|
+
* @param {Hasher} hasher The hasher to create a helper for.
|
|
522
|
+
*
|
|
523
|
+
* @return {Function} The shortcut function.
|
|
524
|
+
*
|
|
525
|
+
* @static
|
|
526
|
+
*
|
|
527
|
+
* @example
|
|
528
|
+
*
|
|
529
|
+
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
|
|
530
|
+
*/
|
|
531
|
+
_createHelper: function(p) {
|
|
532
|
+
return function(o, l) {
|
|
533
|
+
return new p.init(l).finalize(o);
|
|
534
|
+
};
|
|
535
|
+
},
|
|
536
|
+
/**
|
|
537
|
+
* Creates a shortcut function to the HMAC's object interface.
|
|
538
|
+
*
|
|
539
|
+
* @param {Hasher} hasher The hasher to use in this HMAC helper.
|
|
540
|
+
*
|
|
541
|
+
* @return {Function} The shortcut function.
|
|
542
|
+
*
|
|
543
|
+
* @static
|
|
544
|
+
*
|
|
545
|
+
* @example
|
|
546
|
+
*
|
|
547
|
+
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
|
548
|
+
*/
|
|
549
|
+
_createHmacHelper: function(p) {
|
|
550
|
+
return function(o, l) {
|
|
551
|
+
return new N.HMAC.init(p, l).finalize(o);
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
var N = B.algo = {};
|
|
556
|
+
return B;
|
|
557
|
+
}(Math);
|
|
558
|
+
return t;
|
|
559
|
+
});
|
|
560
|
+
}(ue)), ue.exports;
|
|
561
|
+
}
|
|
562
|
+
(function(s, e) {
|
|
563
|
+
(function(t, r) {
|
|
564
|
+
s.exports = r(Z());
|
|
565
|
+
})(z, function(t) {
|
|
566
|
+
return t.enc.Utf8;
|
|
567
|
+
});
|
|
568
|
+
})(Se);
|
|
569
|
+
var qe = Se.exports;
|
|
570
|
+
const $e = /* @__PURE__ */ le(qe);
|
|
571
|
+
var Be = { exports: {} };
|
|
572
|
+
(function(s, e) {
|
|
573
|
+
(function(t, r) {
|
|
574
|
+
s.exports = r(Z());
|
|
575
|
+
})(z, function(t) {
|
|
576
|
+
return function() {
|
|
577
|
+
var r = t, i = r.lib, c = i.WordArray, x = r.enc;
|
|
578
|
+
x.Base64 = {
|
|
579
|
+
/**
|
|
580
|
+
* Converts a word array to a Base64 string.
|
|
581
|
+
*
|
|
582
|
+
* @param {WordArray} wordArray The word array.
|
|
583
|
+
*
|
|
584
|
+
* @return {string} The Base64 string.
|
|
585
|
+
*
|
|
586
|
+
* @static
|
|
587
|
+
*
|
|
588
|
+
* @example
|
|
589
|
+
*
|
|
590
|
+
* var base64String = CryptoJS.enc.Base64.stringify(wordArray);
|
|
591
|
+
*/
|
|
592
|
+
stringify: function(B) {
|
|
593
|
+
var n = B.words, I = B.sigBytes, k = this._map;
|
|
594
|
+
B.clamp();
|
|
595
|
+
for (var d = [], b = 0; b < I; b += 3)
|
|
596
|
+
for (var S = n[b >>> 2] >>> 24 - b % 4 * 8 & 255, _ = n[b + 1 >>> 2] >>> 24 - (b + 1) % 4 * 8 & 255, E = n[b + 2 >>> 2] >>> 24 - (b + 2) % 4 * 8 & 255, N = S << 16 | _ << 8 | E, p = 0; p < 4 && b + p * 0.75 < I; p++)
|
|
597
|
+
d.push(k.charAt(N >>> 6 * (3 - p) & 63));
|
|
598
|
+
var o = k.charAt(64);
|
|
599
|
+
if (o)
|
|
600
|
+
for (; d.length % 4; )
|
|
601
|
+
d.push(o);
|
|
602
|
+
return d.join("");
|
|
603
|
+
},
|
|
604
|
+
/**
|
|
605
|
+
* Converts a Base64 string to a word array.
|
|
606
|
+
*
|
|
607
|
+
* @param {string} base64Str The Base64 string.
|
|
608
|
+
*
|
|
609
|
+
* @return {WordArray} The word array.
|
|
610
|
+
*
|
|
611
|
+
* @static
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
*
|
|
615
|
+
* var wordArray = CryptoJS.enc.Base64.parse(base64String);
|
|
616
|
+
*/
|
|
617
|
+
parse: function(B) {
|
|
618
|
+
var n = B.length, I = this._map, k = this._reverseMap;
|
|
619
|
+
if (!k) {
|
|
620
|
+
k = this._reverseMap = [];
|
|
621
|
+
for (var d = 0; d < I.length; d++)
|
|
622
|
+
k[I.charCodeAt(d)] = d;
|
|
623
|
+
}
|
|
624
|
+
var b = I.charAt(64);
|
|
625
|
+
if (b) {
|
|
626
|
+
var S = B.indexOf(b);
|
|
627
|
+
S !== -1 && (n = S);
|
|
628
|
+
}
|
|
629
|
+
return w(B, n, k);
|
|
630
|
+
},
|
|
631
|
+
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
|
|
632
|
+
};
|
|
633
|
+
function w(B, n, I) {
|
|
634
|
+
for (var k = [], d = 0, b = 0; b < n; b++)
|
|
635
|
+
if (b % 4) {
|
|
636
|
+
var S = I[B.charCodeAt(b - 1)] << b % 4 * 2, _ = I[B.charCodeAt(b)] >>> 6 - b % 4 * 2, E = S | _;
|
|
637
|
+
k[d >>> 2] |= E << 24 - d % 4 * 8, d++;
|
|
638
|
+
}
|
|
639
|
+
return c.create(k, d);
|
|
640
|
+
}
|
|
641
|
+
}(), t.enc.Base64;
|
|
642
|
+
});
|
|
643
|
+
})(Be);
|
|
644
|
+
var Ae = Be.exports;
|
|
645
|
+
const ie = /* @__PURE__ */ le(Ae);
|
|
646
|
+
class de {
|
|
647
|
+
$blank(e) {
|
|
648
|
+
return q(e);
|
|
649
|
+
}
|
|
650
|
+
$present(e) {
|
|
651
|
+
return !this.$blank(e);
|
|
652
|
+
}
|
|
653
|
+
$type(e, t) {
|
|
654
|
+
return oe(e, t);
|
|
655
|
+
}
|
|
656
|
+
$uuid() {
|
|
657
|
+
return ke();
|
|
658
|
+
}
|
|
659
|
+
$encrypt(e) {
|
|
660
|
+
return this.$type(e, "object") && (e = JSON.stringify(e)), ie.stringify($e.parse(e));
|
|
661
|
+
}
|
|
662
|
+
$decrypt(e) {
|
|
663
|
+
return $e.stringify(ie.parse(e));
|
|
664
|
+
}
|
|
665
|
+
getUserAgent() {
|
|
666
|
+
return window.navigator.userAgent;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
const se = {
|
|
670
|
+
debug: 1,
|
|
671
|
+
info: 2,
|
|
672
|
+
warning: 3,
|
|
673
|
+
error: 4
|
|
674
|
+
}, R = {
|
|
675
|
+
level: se.warning,
|
|
676
|
+
/**
|
|
677
|
+
* 로그 레벨을 설정한다
|
|
678
|
+
* Comment by John
|
|
679
|
+
* @date: 2021-02-18
|
|
680
|
+
* @param logLevel: number
|
|
681
|
+
*/
|
|
682
|
+
setLogLevel(s) {
|
|
683
|
+
this.level = s;
|
|
684
|
+
},
|
|
685
|
+
messageStringify(s, e) {
|
|
686
|
+
try {
|
|
687
|
+
return e = `${s}: ${oe(e, "object") ? JSON.stringify(e) : e}`;
|
|
688
|
+
} catch (t) {
|
|
689
|
+
console.error(`log parse error: ${t}`);
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
debug(s, e) {
|
|
693
|
+
this.level <= se.debug && console.log(this.messageStringify(s, e));
|
|
694
|
+
},
|
|
695
|
+
info(s, e) {
|
|
696
|
+
this.level <= se.info && console.info(this.messageStringify(s, e));
|
|
697
|
+
},
|
|
698
|
+
warn(s, e) {
|
|
699
|
+
this.level <= se.warning && console.warn(this.messageStringify(s, e));
|
|
700
|
+
},
|
|
701
|
+
error(s, e) {
|
|
702
|
+
this.level <= se.error && console.error(this.messageStringify(s, e));
|
|
703
|
+
}
|
|
704
|
+
};
|
|
705
|
+
class ze extends de {
|
|
706
|
+
constructor() {
|
|
707
|
+
super(), this.$storage = {};
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Local Storage 에 데이터를 가져온다
|
|
711
|
+
* Comment by Gosomi
|
|
712
|
+
* @date: 2021-02-18
|
|
713
|
+
* @param key: string
|
|
714
|
+
* @returns string
|
|
715
|
+
*/
|
|
716
|
+
get(e) {
|
|
717
|
+
let t = "";
|
|
718
|
+
try {
|
|
719
|
+
t = window.localStorage.getItem(e);
|
|
720
|
+
} catch {
|
|
721
|
+
t = this.$storage[e];
|
|
722
|
+
}
|
|
723
|
+
return this.$present(t) ? this.$decrypt(t) : void 0;
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Local Storage에 데이터를 저장
|
|
727
|
+
* Comment by Gosomi
|
|
728
|
+
* @date: 2021-02-18
|
|
729
|
+
* @param key: string
|
|
730
|
+
* @param value: any
|
|
731
|
+
* @returns any
|
|
732
|
+
*/
|
|
733
|
+
set(e, t) {
|
|
734
|
+
try {
|
|
735
|
+
window.localStorage.setItem(e, this.$encrypt(t));
|
|
736
|
+
} catch {
|
|
737
|
+
this.$storage[e] = this.$encrypt(t);
|
|
738
|
+
}
|
|
739
|
+
return t;
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* 현재 사용자의 고유 UUID를 Local Storage에서 가져온다
|
|
743
|
+
* Comment by Gosomi
|
|
744
|
+
* @date: 2021-02-18
|
|
745
|
+
* @returns string
|
|
746
|
+
*/
|
|
747
|
+
currentUserUUID() {
|
|
748
|
+
const e = H.STORAGE_PREFIX("uuid"), t = this.get(e);
|
|
749
|
+
return this.$blank(t) ? this.set(e, this.$uuid()) : t;
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* UUID를 외부 값으로 설정
|
|
753
|
+
* Comment by GOSOMI
|
|
754
|
+
* @date: 2021-12-22
|
|
755
|
+
* @param uuid: string
|
|
756
|
+
* @returns string
|
|
757
|
+
*/
|
|
758
|
+
setUUID(e) {
|
|
759
|
+
const t = H.STORAGE_PREFIX("uuid");
|
|
760
|
+
return this.set(t, e);
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Local Storage 에서 JSON -> Object 변환해서 가져온다
|
|
764
|
+
* Comment by Gosomi
|
|
765
|
+
* @date: 2021-02-18
|
|
766
|
+
* @param key: string
|
|
767
|
+
* @returns object
|
|
768
|
+
*/
|
|
769
|
+
getToJSON(e) {
|
|
770
|
+
const t = this.get(e);
|
|
771
|
+
return this.$present(t) ? this.caseMarshalToJson(t) : t;
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* Local Storage 에서 Object -> JSON으로 데이터를 변환해서 저장한다
|
|
775
|
+
* Comment by Gosomi
|
|
776
|
+
* @date: 2021-02-18
|
|
777
|
+
* @param key: string
|
|
778
|
+
* @param value: any
|
|
779
|
+
* @returns any
|
|
780
|
+
*/
|
|
781
|
+
setToJSON(e, t) {
|
|
782
|
+
return this.set(e, JSON.stringify(t)), t;
|
|
783
|
+
}
|
|
784
|
+
caseMarshalToJson(e) {
|
|
785
|
+
try {
|
|
786
|
+
return JSON.parse(e);
|
|
787
|
+
} catch {
|
|
788
|
+
return JSON.parse(e.replace(/\\\"/g, '"'));
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
class We extends ze {
|
|
793
|
+
constructor() {
|
|
794
|
+
super(), this.currentUserUUID();
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* 현재 결제의 Session key를 가져온다. 1800초 ( 30분 ) 초과되면 세션을 갱신한다
|
|
798
|
+
* Comment by Gosomi
|
|
799
|
+
* @date: 2021-02-18
|
|
800
|
+
* @returns string
|
|
801
|
+
*/
|
|
802
|
+
currentSessionKey() {
|
|
803
|
+
const e = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3), t = H.STORAGE_PREFIX("session"), r = this.getToJSON(t);
|
|
804
|
+
return this.$blank(r) || r.time + 1800 < e ? this.setToJSON(t, {
|
|
805
|
+
time: e,
|
|
806
|
+
term: this.$blank(r) ? -1 : e - r.time,
|
|
807
|
+
uuid: `${this.$uuid()}-${e}`
|
|
808
|
+
}).uuid : r.uuid;
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* 재방문 시간을 리턴한다
|
|
812
|
+
* Comment by GOSOMI
|
|
813
|
+
* @date: 2021-05-12
|
|
814
|
+
* @returns number
|
|
815
|
+
*/
|
|
816
|
+
currentTimeTerm() {
|
|
817
|
+
const e = H.STORAGE_PREFIX("session"), t = this.getToJSON(e);
|
|
818
|
+
return this.$blank(t.term) ? -1 : t.term;
|
|
819
|
+
}
|
|
820
|
+
currentTime() {
|
|
821
|
+
const e = H.STORAGE_PREFIX("session"), t = this.getToJSON(e);
|
|
822
|
+
return this.$blank(t.time) ? -1 : t.time;
|
|
823
|
+
}
|
|
824
|
+
setTime(e) {
|
|
825
|
+
const t = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3), r = H.STORAGE_PREFIX("session"), i = this.getToJSON(r), c = this.$blank(i) ? {
|
|
826
|
+
time: e > 0 ? e : t,
|
|
827
|
+
term: e > 0 ? t - e : -1,
|
|
828
|
+
uuid: `${this.$uuid()}-${t}`
|
|
829
|
+
} : i;
|
|
830
|
+
c.time = e, this.setToJSON(r, c);
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* 사용할 기본 키를 조합한다
|
|
834
|
+
* Comment by GOSOMI
|
|
835
|
+
* @date: 2021-05-20
|
|
836
|
+
*/
|
|
837
|
+
generateKey() {
|
|
838
|
+
return `${this.$uuid()}-${(/* @__PURE__ */ new Date()).getTime()}`;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* 사용자 정보를 저장
|
|
842
|
+
* Comment by GOSOMI
|
|
843
|
+
* @date: 2022-03-02 @returns
|
|
844
|
+
*/
|
|
845
|
+
setUser(e) {
|
|
846
|
+
return this.set(H.STORAGE_PREFIX("user"), e === void 0 ? void 0 : JSON.stringify(e)), e;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* 사용자 정보를 가져온다
|
|
850
|
+
* Comment by GOSOMI
|
|
851
|
+
* @date: 2022-03-02
|
|
852
|
+
*/
|
|
853
|
+
getUser() {
|
|
854
|
+
try {
|
|
855
|
+
return JSON.parse(this.get(H.STORAGE_PREFIX("user")));
|
|
856
|
+
} catch (e) {
|
|
857
|
+
R.error("User Storage", `사용자 정보를 추출하는데 실패하였습니다. [ ${e.message} ]`);
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
const ne = new We(), Ke = "@bootpay/client-js", Ve = "5.5.2", Je = "dist/index.mjs", Ye = "dist/index.d.ts", Ge = {
|
|
863
|
+
".": {
|
|
864
|
+
types: "./dist/index.d.ts",
|
|
865
|
+
import: "./dist/index.mjs"
|
|
866
|
+
},
|
|
867
|
+
"./payment": {
|
|
868
|
+
types: "./dist/payment.d.ts",
|
|
869
|
+
import: "./dist/payment.mjs"
|
|
870
|
+
}
|
|
871
|
+
}, Qe = {
|
|
872
|
+
"*": {
|
|
873
|
+
payment: [
|
|
874
|
+
"dist/payment.d.ts"
|
|
875
|
+
]
|
|
876
|
+
}
|
|
877
|
+
}, Ze = "dist/index.css", Xe = {
|
|
878
|
+
test: 'echo "Error: no test specified" && exit 1',
|
|
879
|
+
build: "rm -rf ./dist && vite build && vite build --mode umd",
|
|
880
|
+
deploy: "NODE_ENV=production ./node_modules/.bin/webpack --output-path=./dist --mode=production && gzip -kf dist/*.min.js && ./webview.sh $npm_package_version"
|
|
881
|
+
}, et = {
|
|
882
|
+
typescript: "^5.5.4"
|
|
883
|
+
}, tt = {
|
|
884
|
+
"@types/ws": "^8.5.5",
|
|
885
|
+
"@types/node": "^18.15.3",
|
|
886
|
+
"@webpack-cli/serve": "^2.0.5",
|
|
887
|
+
"webpack-dev-server": "^4.15.1",
|
|
888
|
+
webpack: "^5.87.0",
|
|
889
|
+
"webpack-cli": "^5.1.4",
|
|
890
|
+
axios: "^0.27.2",
|
|
891
|
+
"crypto-js": "^4.1.1",
|
|
892
|
+
"@types/crypto-js": "^4.1.1",
|
|
893
|
+
"@babel/core": "^7.22.5",
|
|
894
|
+
"@babel/plugin-transform-regenerator": "^7.22.5",
|
|
895
|
+
"@babel/plugin-transform-runtime": "^7.22.5",
|
|
896
|
+
"@babel/plugin-transform-object-assign": "^7.22.5",
|
|
897
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
898
|
+
"@babel/plugin-transform-destructuring": "^7.24.8",
|
|
899
|
+
"@babel/plugin-proposal-export-default-from": "^7.27.1",
|
|
900
|
+
"@babel/plugin-transform-class-properties": "^7.27.1",
|
|
901
|
+
"@babel/plugin-proposal-decorators": "^7.28.0",
|
|
902
|
+
"@babel/plugin-transform-private-methods": "^7.27.1",
|
|
903
|
+
"@babel/plugin-transform-typescript": "^7.28.0",
|
|
904
|
+
"@babel/preset-env": "^7.22.5",
|
|
905
|
+
"@babel/preset-typescript": "^7.22.5",
|
|
906
|
+
"@babel/runtime-corejs3": "^7.22.5",
|
|
907
|
+
"@babel/plugin-transform-classes": "^7.22.5",
|
|
908
|
+
"core-js": "^3.31.0",
|
|
909
|
+
"babel-loader": "^9.1.2",
|
|
910
|
+
"css-loader": "^6.8.1",
|
|
911
|
+
sass: "^1.63.4",
|
|
912
|
+
"sass-loader": "^13.3.2",
|
|
913
|
+
"style-loader": "^3.3.3",
|
|
914
|
+
vite: "^5.4.3",
|
|
915
|
+
"vite-plugin-dts": "^3.6.4",
|
|
916
|
+
"vite-plugin-tsconfig": "^1.0.4",
|
|
917
|
+
"vite-plugin-css-injected-by-js": "3.3.1"
|
|
918
|
+
}, rt = {
|
|
919
|
+
"@webpack-cli/serve": "^1.3.1"
|
|
920
|
+
}, st = [], it = "", ot = "ISC", nt = "", re = {
|
|
921
|
+
name: Ke,
|
|
922
|
+
version: Ve,
|
|
923
|
+
main: Je,
|
|
924
|
+
types: Ye,
|
|
925
|
+
exports: Ge,
|
|
926
|
+
typesVersions: Qe,
|
|
927
|
+
styles: Ze,
|
|
928
|
+
scripts: Xe,
|
|
929
|
+
dependencies: et,
|
|
930
|
+
devDependencies: tt,
|
|
931
|
+
resolutions: rt,
|
|
932
|
+
keywords: st,
|
|
933
|
+
author: it,
|
|
934
|
+
license: ot,
|
|
935
|
+
description: nt
|
|
936
|
+
}, U = {
|
|
937
|
+
mode: "production",
|
|
938
|
+
locale: "ko",
|
|
939
|
+
isSetLocale: !1,
|
|
940
|
+
packageVersion: re.version,
|
|
941
|
+
applicationId: "",
|
|
942
|
+
API_URL: {
|
|
943
|
+
development: "https://dev-api.bootpay.co.kr/v2",
|
|
944
|
+
stage: "https://stage-api.bootpay.co.kr/v2",
|
|
945
|
+
production: "https://api.bootpay.co.kr/v2"
|
|
946
|
+
},
|
|
947
|
+
ANALYTICS_URL: {
|
|
948
|
+
development: "https://dev-analytics.bootpay.co.kr",
|
|
949
|
+
stage: "https://stage-analytics.bootpay.co.kr",
|
|
950
|
+
production: "https://analytics.bootpay.co.kr"
|
|
951
|
+
},
|
|
952
|
+
DOOR_URL: {
|
|
953
|
+
development: "https://door-dev.bootpay.co.kr",
|
|
954
|
+
stage: "https://door-stage.bootpay.co.kr",
|
|
955
|
+
production: "https://door.bootpay.co.kr"
|
|
956
|
+
},
|
|
957
|
+
WIDGET_URL: {
|
|
958
|
+
development: "https://dev-widget.bootpay.co.kr",
|
|
959
|
+
stage: "https://stage-widget.bootpay.co.kr",
|
|
960
|
+
production: "https://widget.bootpay.co.kr"
|
|
961
|
+
},
|
|
962
|
+
// 리셀러 토큰 PG 신청 화면(관리자 /onboarding/s/{token}) — core ConstUrl::NEXT_ADMIN_URL 과 같은 주소 @date: 26-10-27
|
|
963
|
+
ONBOARDING_URL: {
|
|
964
|
+
development: "https://dev-admin.bootpay.co.kr",
|
|
965
|
+
stage: "https://stage-admin.bootpay.co.kr",
|
|
966
|
+
production: "https://admin.bootpay.co.kr"
|
|
967
|
+
},
|
|
968
|
+
sdkNames: {
|
|
969
|
+
android: 100,
|
|
970
|
+
android_react_native: 101,
|
|
971
|
+
android_flutter: 102,
|
|
972
|
+
android_unity: 103,
|
|
973
|
+
ios: 200,
|
|
974
|
+
ios_react_native: 201,
|
|
975
|
+
ios_flutter: 202,
|
|
976
|
+
ios_unity: 203,
|
|
977
|
+
ios_objc: 204,
|
|
978
|
+
ios_swift_ui: 205,
|
|
979
|
+
mac_swift: 206,
|
|
980
|
+
mac_flutter: 207
|
|
981
|
+
},
|
|
982
|
+
sdkVersion: "",
|
|
983
|
+
sdkName: 0,
|
|
984
|
+
set(s) {
|
|
985
|
+
this.mode = s;
|
|
986
|
+
},
|
|
987
|
+
setApplicationId(s) {
|
|
988
|
+
return this.applicationId = s, this.currentApplicationId(void 0);
|
|
989
|
+
},
|
|
990
|
+
setLocale(s) {
|
|
991
|
+
this.locale = s, this.isSetLocale = !0;
|
|
992
|
+
},
|
|
993
|
+
currentApplicationId(s = void 0) {
|
|
994
|
+
return s === void 0 ? this.applicationId : s;
|
|
995
|
+
},
|
|
996
|
+
setDevelopmentHost(s) {
|
|
997
|
+
this.API_URL.development = this.API_URL.development.replace(/dev-api.bootpay.co.kr\/v2/gi, s);
|
|
998
|
+
},
|
|
999
|
+
setVersion(s, e, t = void 0) {
|
|
1000
|
+
this.sdkName = this.sdkNames[e] === void 0 ? 0 : this.sdkNames[e], this.sdkVersion = s, this.packageVersion = t === void 0 || t === "" ? re.version : t;
|
|
1001
|
+
},
|
|
1002
|
+
toApi(s) {
|
|
1003
|
+
return [this.API_URL[this.mode], s].join("/");
|
|
1004
|
+
},
|
|
1005
|
+
toDoor(s) {
|
|
1006
|
+
return [this.DOOR_URL[this.mode], s].join("/");
|
|
1007
|
+
},
|
|
1008
|
+
toWidget(s) {
|
|
1009
|
+
return [this.WIDGET_URL[this.mode], s].join("/");
|
|
1010
|
+
},
|
|
1011
|
+
toOnboarding(s) {
|
|
1012
|
+
return [this.ONBOARDING_URL[this.mode], s].join("/");
|
|
1013
|
+
},
|
|
1014
|
+
isMobile() {
|
|
1015
|
+
if (typeof window > "u") return !1;
|
|
1016
|
+
const s = window.navigator.userAgent || window.navigator.vendor;
|
|
1017
|
+
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(s);
|
|
1018
|
+
},
|
|
1019
|
+
isMobileSafari() {
|
|
1020
|
+
if (typeof window > "u") return !1;
|
|
1021
|
+
const s = window.navigator.userAgent;
|
|
1022
|
+
return (s.match(/iPad/i) || s.match(/iPhone/i)) && !s.match(/CriOS/i);
|
|
1023
|
+
},
|
|
1024
|
+
toAnalytics(s) {
|
|
1025
|
+
return [this.ANALYTICS_URL[this.mode], s].join("/");
|
|
1026
|
+
}
|
|
1027
|
+
};
|
|
1028
|
+
class W extends Error {
|
|
1029
|
+
constructor(e) {
|
|
1030
|
+
super(), this.name = "BootpayEventError", this.eventMessage = e;
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
const X = {
|
|
1034
|
+
__BOOTPAY_NAMESPACE: {},
|
|
1035
|
+
isBind: !1,
|
|
1036
|
+
initialize() {
|
|
1037
|
+
this.isBind || (typeof window < "u" && (window.addBootpayEventListener = this.on, window.removeBootpayEventListener = this.off, window.resetBootpayEventListener = function(s, e, t) {
|
|
1038
|
+
this.removeBootpayEventListener(s).addBootpayEventListener(s, e, t);
|
|
1039
|
+
}), typeof document < "u" && (document.addBootpayEventListener = this.on, document.removeBootpayEventListener = this.off, document.resetBootpayEventListener = function(s, e, t) {
|
|
1040
|
+
this.removeBootpayEventListener(s).addBootpayEventListener(s, e, t);
|
|
1041
|
+
}), typeof Element < "u" && (Element.prototype.addBootpayEventListener = this.on, Element.prototype.removeBootpayEventListener = this.off, Element.prototype.resetBootpayEventListener = function(s, e, t) {
|
|
1042
|
+
this.removeBootpayEventListener(s).addBootpayEventListener(s, e, t);
|
|
1043
|
+
}), this.isBind = !0);
|
|
1044
|
+
},
|
|
1045
|
+
on(s, e, t = void 0) {
|
|
1046
|
+
return q(X.__BOOTPAY_NAMESPACE) && (X.__BOOTPAY_NAMESPACE = {}), this.addEventListener(s.split(".")[0], e, t || !1), X.__BOOTPAY_NAMESPACE[s] = e, this;
|
|
1047
|
+
},
|
|
1048
|
+
off(s) {
|
|
1049
|
+
return M(X.__BOOTPAY_NAMESPACE) && M(X.__BOOTPAY_NAMESPACE[s]) && this.removeEventListener(s.split(".")[0], X.__BOOTPAY_NAMESPACE[s]), this;
|
|
1050
|
+
}
|
|
1051
|
+
};
|
|
1052
|
+
class Ce extends de {
|
|
1053
|
+
constructor(e) {
|
|
1054
|
+
super(), this.$resolve = null, this.$reject = null, this.$messageEventName = (e == null ? void 0 : e.messageEventName) ?? "message.BootpayEvent", this.$eventHooks = (e == null ? void 0 : e.messageEventHooks) ?? {}, this.afterBind = e == null ? void 0 : e.afterBind, this.$childInstance = null, X.initialize();
|
|
1055
|
+
}
|
|
1056
|
+
setChildInstance(e) {
|
|
1057
|
+
this.$childInstance = e;
|
|
1058
|
+
}
|
|
1059
|
+
bind(e, t) {
|
|
1060
|
+
this.$messageEventName && window.resetBootpayEventListener(this.$messageEventName, (r) => {
|
|
1061
|
+
const i = this.parseEvent(r.data);
|
|
1062
|
+
if (R.debug("event received", JSON.stringify(i)), M(i) && M(i.event)) {
|
|
1063
|
+
const c = this.hookFunction(i.hook);
|
|
1064
|
+
if (M(c) && M(c[i.event]))
|
|
1065
|
+
return c[i.event](i.data, this);
|
|
1066
|
+
R.debug("event", `${this.$messageEventName}: ${i.event} is not defined`);
|
|
1067
|
+
}
|
|
1068
|
+
}), this.afterBind && this.afterBind(), this.setCallbackFunction(e, t);
|
|
1069
|
+
}
|
|
1070
|
+
hookFunction(e) {
|
|
1071
|
+
return this.$eventHooks[e];
|
|
1072
|
+
}
|
|
1073
|
+
reject(e) {
|
|
1074
|
+
M(this.$reject) && this.$reject(e);
|
|
1075
|
+
}
|
|
1076
|
+
resolve(e) {
|
|
1077
|
+
M(this.$resolve) && this.$resolve(e);
|
|
1078
|
+
}
|
|
1079
|
+
/**
|
|
1080
|
+
* 함수를 class instnace variables에 넣는다
|
|
1081
|
+
* Comment by GOSOMI
|
|
1082
|
+
* @date: 2021-05-11
|
|
1083
|
+
* @param resolve: Function
|
|
1084
|
+
* @param reject: Function
|
|
1085
|
+
*/
|
|
1086
|
+
setCallbackFunction(e, t) {
|
|
1087
|
+
this.$resolve = e, this.$reject = t;
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* event 데이터를 파싱한다
|
|
1091
|
+
* Comment by Gosomi
|
|
1092
|
+
* @date: 2021-02-19
|
|
1093
|
+
* @param data: string
|
|
1094
|
+
*/
|
|
1095
|
+
parseEvent(e) {
|
|
1096
|
+
let t = {};
|
|
1097
|
+
if (this.$present(e) && this.$type(e, "string")) {
|
|
1098
|
+
try {
|
|
1099
|
+
t = JSON.parse(e);
|
|
1100
|
+
} catch (r) {
|
|
1101
|
+
R.info("json parsing failed", `data: ${e}, message: ${ee(r)} JSON 파싱 형태가 아닌 이벤트 입니다.`);
|
|
1102
|
+
}
|
|
1103
|
+
return t.bootpay_event ? (delete t.bootpay_event, t) : null;
|
|
1104
|
+
} else
|
|
1105
|
+
return null;
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
const ee = (s) => typeof s == "string" ? s.toUpperCase() : s instanceof Error ? s.message : s;
|
|
1109
|
+
class be extends de {
|
|
1110
|
+
constructor(e = {}) {
|
|
1111
|
+
super();
|
|
1112
|
+
const { iframeId: t = "bootpay-iframe", template: r = this.defaultIframeHtml(), el: i = void 0 } = e;
|
|
1113
|
+
this.el = i, this.$windowId = t, this.$template = r;
|
|
1114
|
+
}
|
|
1115
|
+
defaultIframeHtml() {
|
|
1116
|
+
return `
|
|
1117
|
+
<iframe id="${this.$iFrameId}" src="" frameborder="0" allowtransparency="true" scrolling="no" style="background: transparent; width: 100%; height: 100%;"></iframe>
|
|
1118
|
+
`;
|
|
1119
|
+
}
|
|
1120
|
+
byId(e) {
|
|
1121
|
+
return document.getElementById(e);
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Template body append
|
|
1125
|
+
* Comment by GOSOMI
|
|
1126
|
+
* @date: 2022-02-16
|
|
1127
|
+
*/
|
|
1128
|
+
createTemplateHtml() {
|
|
1129
|
+
this.byId(this.$windowId) === null && document.body.insertAdjacentHTML("beforeend", this.$template);
|
|
1130
|
+
}
|
|
1131
|
+
bodyOpen(e = void 0, t = !1) {
|
|
1132
|
+
const r = document.querySelector("body");
|
|
1133
|
+
t || (this.$present(r.className) ? r.className = `${r.className} bootpay-open` : r.className = "bootpay-open"), this.$present(e) && (r.className = `${r.className} ${e}`);
|
|
1134
|
+
}
|
|
1135
|
+
bodyClose() {
|
|
1136
|
+
const e = document.querySelector("body");
|
|
1137
|
+
e.className = e.className.replace("bootpay-open", "");
|
|
1138
|
+
}
|
|
1139
|
+
templateResize(e, t) {
|
|
1140
|
+
const r = this.byId(e);
|
|
1141
|
+
r !== void 0 && this.applyStylesToElement(r, t);
|
|
1142
|
+
}
|
|
1143
|
+
/**
|
|
1144
|
+
* 엘리먼트에 스타일을 적용하는 공통 메서드
|
|
1145
|
+
* Comment by GOSOMI
|
|
1146
|
+
* @date: 2024-01-01
|
|
1147
|
+
*/
|
|
1148
|
+
applyStylesToElement(e, t) {
|
|
1149
|
+
if (t !== void 0)
|
|
1150
|
+
for (let r in Object.keys(t)) {
|
|
1151
|
+
let i = Object.keys(t)[r], c = t[i];
|
|
1152
|
+
this.$present(c) && !String(c).match(/%/) && !String(c).match(/vh/) && (i.match(/width/) || i.match(/Width/) || i.match(/height/) || i.match(/Height/)) && (c = `${String(t[i]).replace(/px/gi, "")}px`), e.style.setProperty(i, c);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
/**
|
|
1156
|
+
* render가 되었는지 체크한다
|
|
1157
|
+
* Comment by GOSOMI
|
|
1158
|
+
* @date: 2024-02-22
|
|
1159
|
+
*/
|
|
1160
|
+
isRendered() {
|
|
1161
|
+
const e = document.getElementById(this.$iFrameId);
|
|
1162
|
+
return R.debug("isRendered", `iFrameElement: ${e}`), e !== null && e.src !== null && e.src !== "";
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* child iframe에 PostMessage를 보낸다
|
|
1166
|
+
* Comment by GOSOMI
|
|
1167
|
+
* @date: 2023-06-15
|
|
1168
|
+
*/
|
|
1169
|
+
postMessage(e, t = void 0) {
|
|
1170
|
+
var i;
|
|
1171
|
+
const r = this.byId(this.$iFrameId);
|
|
1172
|
+
(i = r == null ? void 0 : r.contentWindow) == null || i.postMessage(JSON.stringify({
|
|
1173
|
+
bootpay_event: !0,
|
|
1174
|
+
event: e,
|
|
1175
|
+
data: t
|
|
1176
|
+
}), "*");
|
|
1177
|
+
}
|
|
1178
|
+
defaultRender(e) {
|
|
1179
|
+
this.el = String(this.el).replace(/#/g, "");
|
|
1180
|
+
const t = document.getElementById(this.el);
|
|
1181
|
+
if (this.$blank(this.el) || t === null)
|
|
1182
|
+
throw new Error("렌더링할 DOM Element ID를 입력해주세요.");
|
|
1183
|
+
t.style.setProperty("height", "0"), t.innerHTML = this.$template, this.byId(this.$iFrameId).setAttribute("src", e);
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
const at = "local-network-access *; local-network *; loopback-network *";
|
|
1187
|
+
class ct extends be {
|
|
1188
|
+
constructor() {
|
|
1189
|
+
super(), this.$alfredId = "bootpay-alfred-progress-id", this.$alfredTextId = "__alfred-text-message__";
|
|
1190
|
+
}
|
|
1191
|
+
/**
|
|
1192
|
+
* Template 파일
|
|
1193
|
+
* Comment by GOSOMI
|
|
1194
|
+
* @date: 2021-04-13
|
|
1195
|
+
* @param message: string
|
|
1196
|
+
* @returns void
|
|
1197
|
+
*/
|
|
1198
|
+
template(e) {
|
|
1199
|
+
return `
|
|
1200
|
+
<div class="bootpay-progress-background" id="${this.$alfredId}" style="display: none;">
|
|
1201
|
+
<div class="progress-message-window">
|
|
1202
|
+
<div class="alfred-loading">
|
|
1203
|
+
<div class="bootpay-spinner">
|
|
1204
|
+
<span class="bootpay-dot"></span>
|
|
1205
|
+
<span class="bootpay-dot"></span>
|
|
1206
|
+
<span class="bootpay-dot"></span>
|
|
1207
|
+
</div>
|
|
1208
|
+
</div>
|
|
1209
|
+
<div class="alfred-text">
|
|
1210
|
+
<span class="alfred-inner-text" id="${this.$alfredTextId}">${e}</span>
|
|
1211
|
+
</div>
|
|
1212
|
+
</div>
|
|
1213
|
+
</div>
|
|
1214
|
+
`;
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Progress 창을 보여준다
|
|
1218
|
+
* Comment by GOSOMI
|
|
1219
|
+
* @date: 2021-04-13
|
|
1220
|
+
* @param message: String
|
|
1221
|
+
* @returns void
|
|
1222
|
+
*/
|
|
1223
|
+
showProgress(e) {
|
|
1224
|
+
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", "flex");
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* Progress 창을 닫는다
|
|
1228
|
+
* Comment by GOSOMI
|
|
1229
|
+
* @date: 2021-04-13
|
|
1230
|
+
*/
|
|
1231
|
+
hideProgress() {
|
|
1232
|
+
try {
|
|
1233
|
+
this.byId(this.$alfredId).outerHTML = "";
|
|
1234
|
+
} catch {
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
const Q = new ct();
|
|
1239
|
+
var Te = { exports: {} }, Oe = { exports: {} };
|
|
1240
|
+
(function(s, e) {
|
|
1241
|
+
(function(t, r) {
|
|
1242
|
+
s.exports = r(Z());
|
|
1243
|
+
})(z, function(t) {
|
|
1244
|
+
return function(r) {
|
|
1245
|
+
var i = t, c = i.lib, x = c.WordArray, w = c.Hasher, B = i.algo, n = [];
|
|
1246
|
+
(function() {
|
|
1247
|
+
for (var _ = 0; _ < 64; _++)
|
|
1248
|
+
n[_] = r.abs(r.sin(_ + 1)) * 4294967296 | 0;
|
|
1249
|
+
})();
|
|
1250
|
+
var I = B.MD5 = w.extend({
|
|
1251
|
+
_doReset: function() {
|
|
1252
|
+
this._hash = new x.init([
|
|
1253
|
+
1732584193,
|
|
1254
|
+
4023233417,
|
|
1255
|
+
2562383102,
|
|
1256
|
+
271733878
|
|
1257
|
+
]);
|
|
1258
|
+
},
|
|
1259
|
+
_doProcessBlock: function(_, E) {
|
|
1260
|
+
for (var N = 0; N < 16; N++) {
|
|
1261
|
+
var p = E + N, o = _[p];
|
|
1262
|
+
_[p] = (o << 8 | o >>> 24) & 16711935 | (o << 24 | o >>> 8) & 4278255360;
|
|
1263
|
+
}
|
|
1264
|
+
var l = this._hash.words, g = _[E + 0], P = _[E + 1], A = _[E + 2], F = _[E + 3], D = _[E + 4], a = _[E + 5], u = _[E + 6], $ = _[E + 7], f = _[E + 8], C = _[E + 9], T = _[E + 10], L = _[E + 11], j = _[E + 12], V = _[E + 13], J = _[E + 14], Y = _[E + 15], h = l[0], y = l[1], m = l[2], v = l[3];
|
|
1265
|
+
h = k(h, y, m, v, g, 7, n[0]), v = k(v, h, y, m, P, 12, n[1]), m = k(m, v, h, y, A, 17, n[2]), y = k(y, m, v, h, F, 22, n[3]), h = k(h, y, m, v, D, 7, n[4]), v = k(v, h, y, m, a, 12, n[5]), m = k(m, v, h, y, u, 17, n[6]), y = k(y, m, v, h, $, 22, n[7]), h = k(h, y, m, v, f, 7, n[8]), v = k(v, h, y, m, C, 12, n[9]), m = k(m, v, h, y, T, 17, n[10]), y = k(y, m, v, h, L, 22, n[11]), h = k(h, y, m, v, j, 7, n[12]), v = k(v, h, y, m, V, 12, n[13]), m = k(m, v, h, y, J, 17, n[14]), y = k(y, m, v, h, Y, 22, n[15]), h = d(h, y, m, v, P, 5, n[16]), v = d(v, h, y, m, u, 9, n[17]), m = d(m, v, h, y, L, 14, n[18]), y = d(y, m, v, h, g, 20, n[19]), h = d(h, y, m, v, a, 5, n[20]), v = d(v, h, y, m, T, 9, n[21]), m = d(m, v, h, y, Y, 14, n[22]), y = d(y, m, v, h, D, 20, n[23]), h = d(h, y, m, v, C, 5, n[24]), v = d(v, h, y, m, J, 9, n[25]), m = d(m, v, h, y, F, 14, n[26]), y = d(y, m, v, h, f, 20, n[27]), h = d(h, y, m, v, V, 5, n[28]), v = d(v, h, y, m, A, 9, n[29]), m = d(m, v, h, y, $, 14, n[30]), y = d(y, m, v, h, j, 20, n[31]), h = b(h, y, m, v, a, 4, n[32]), v = b(v, h, y, m, f, 11, n[33]), m = b(m, v, h, y, L, 16, n[34]), y = b(y, m, v, h, J, 23, n[35]), h = b(h, y, m, v, P, 4, n[36]), v = b(v, h, y, m, D, 11, n[37]), m = b(m, v, h, y, $, 16, n[38]), y = b(y, m, v, h, T, 23, n[39]), h = b(h, y, m, v, V, 4, n[40]), v = b(v, h, y, m, g, 11, n[41]), m = b(m, v, h, y, F, 16, n[42]), y = b(y, m, v, h, u, 23, n[43]), h = b(h, y, m, v, C, 4, n[44]), v = b(v, h, y, m, j, 11, n[45]), m = b(m, v, h, y, Y, 16, n[46]), y = b(y, m, v, h, A, 23, n[47]), h = S(h, y, m, v, g, 6, n[48]), v = S(v, h, y, m, $, 10, n[49]), m = S(m, v, h, y, J, 15, n[50]), y = S(y, m, v, h, a, 21, n[51]), h = S(h, y, m, v, j, 6, n[52]), v = S(v, h, y, m, F, 10, n[53]), m = S(m, v, h, y, T, 15, n[54]), y = S(y, m, v, h, P, 21, n[55]), h = S(h, y, m, v, f, 6, n[56]), v = S(v, h, y, m, Y, 10, n[57]), m = S(m, v, h, y, u, 15, n[58]), y = S(y, m, v, h, V, 21, n[59]), h = S(h, y, m, v, D, 6, n[60]), v = S(v, h, y, m, L, 10, n[61]), m = S(m, v, h, y, A, 15, n[62]), y = S(y, m, v, h, C, 21, n[63]), l[0] = l[0] + h | 0, l[1] = l[1] + y | 0, l[2] = l[2] + m | 0, l[3] = l[3] + v | 0;
|
|
1266
|
+
},
|
|
1267
|
+
_doFinalize: function() {
|
|
1268
|
+
var _ = this._data, E = _.words, N = this._nDataBytes * 8, p = _.sigBytes * 8;
|
|
1269
|
+
E[p >>> 5] |= 128 << 24 - p % 32;
|
|
1270
|
+
var o = r.floor(N / 4294967296), l = N;
|
|
1271
|
+
E[(p + 64 >>> 9 << 4) + 15] = (o << 8 | o >>> 24) & 16711935 | (o << 24 | o >>> 8) & 4278255360, E[(p + 64 >>> 9 << 4) + 14] = (l << 8 | l >>> 24) & 16711935 | (l << 24 | l >>> 8) & 4278255360, _.sigBytes = (E.length + 1) * 4, this._process();
|
|
1272
|
+
for (var g = this._hash, P = g.words, A = 0; A < 4; A++) {
|
|
1273
|
+
var F = P[A];
|
|
1274
|
+
P[A] = (F << 8 | F >>> 24) & 16711935 | (F << 24 | F >>> 8) & 4278255360;
|
|
1275
|
+
}
|
|
1276
|
+
return g;
|
|
1277
|
+
},
|
|
1278
|
+
clone: function() {
|
|
1279
|
+
var _ = w.clone.call(this);
|
|
1280
|
+
return _._hash = this._hash.clone(), _;
|
|
1281
|
+
}
|
|
1282
|
+
});
|
|
1283
|
+
function k(_, E, N, p, o, l, g) {
|
|
1284
|
+
var P = _ + (E & N | ~E & p) + o + g;
|
|
1285
|
+
return (P << l | P >>> 32 - l) + E;
|
|
1286
|
+
}
|
|
1287
|
+
function d(_, E, N, p, o, l, g) {
|
|
1288
|
+
var P = _ + (E & p | N & ~p) + o + g;
|
|
1289
|
+
return (P << l | P >>> 32 - l) + E;
|
|
1290
|
+
}
|
|
1291
|
+
function b(_, E, N, p, o, l, g) {
|
|
1292
|
+
var P = _ + (E ^ N ^ p) + o + g;
|
|
1293
|
+
return (P << l | P >>> 32 - l) + E;
|
|
1294
|
+
}
|
|
1295
|
+
function S(_, E, N, p, o, l, g) {
|
|
1296
|
+
var P = _ + (N ^ (E | ~p)) + o + g;
|
|
1297
|
+
return (P << l | P >>> 32 - l) + E;
|
|
1298
|
+
}
|
|
1299
|
+
i.MD5 = w._createHelper(I), i.HmacMD5 = w._createHmacHelper(I);
|
|
1300
|
+
}(Math), t.MD5;
|
|
1301
|
+
});
|
|
1302
|
+
})(Oe);
|
|
1303
|
+
var Re = Oe.exports;
|
|
1304
|
+
const kt = /* @__PURE__ */ le(Re);
|
|
1305
|
+
var he = { exports: {} }, fe = { exports: {} }, we;
|
|
1306
|
+
function pt() {
|
|
1307
|
+
return we || (we = 1, function(s, e) {
|
|
1308
|
+
(function(t, r) {
|
|
1309
|
+
s.exports = r(Z());
|
|
1310
|
+
})(z, function(t) {
|
|
1311
|
+
return function() {
|
|
1312
|
+
var r = t, i = r.lib, c = i.WordArray, x = i.Hasher, w = r.algo, B = [], n = w.SHA1 = x.extend({
|
|
1313
|
+
_doReset: function() {
|
|
1314
|
+
this._hash = new c.init([
|
|
1315
|
+
1732584193,
|
|
1316
|
+
4023233417,
|
|
1317
|
+
2562383102,
|
|
1318
|
+
271733878,
|
|
1319
|
+
3285377520
|
|
1320
|
+
]);
|
|
1321
|
+
},
|
|
1322
|
+
_doProcessBlock: function(I, k) {
|
|
1323
|
+
for (var d = this._hash.words, b = d[0], S = d[1], _ = d[2], E = d[3], N = d[4], p = 0; p < 80; p++) {
|
|
1324
|
+
if (p < 16)
|
|
1325
|
+
B[p] = I[k + p] | 0;
|
|
1326
|
+
else {
|
|
1327
|
+
var o = B[p - 3] ^ B[p - 8] ^ B[p - 14] ^ B[p - 16];
|
|
1328
|
+
B[p] = o << 1 | o >>> 31;
|
|
1329
|
+
}
|
|
1330
|
+
var l = (b << 5 | b >>> 27) + N + B[p];
|
|
1331
|
+
p < 20 ? l += (S & _ | ~S & E) + 1518500249 : p < 40 ? l += (S ^ _ ^ E) + 1859775393 : p < 60 ? l += (S & _ | S & E | _ & E) - 1894007588 : l += (S ^ _ ^ E) - 899497514, N = E, E = _, _ = S << 30 | S >>> 2, S = b, b = l;
|
|
1332
|
+
}
|
|
1333
|
+
d[0] = d[0] + b | 0, d[1] = d[1] + S | 0, d[2] = d[2] + _ | 0, d[3] = d[3] + E | 0, d[4] = d[4] + N | 0;
|
|
1334
|
+
},
|
|
1335
|
+
_doFinalize: function() {
|
|
1336
|
+
var I = this._data, k = I.words, d = this._nDataBytes * 8, b = I.sigBytes * 8;
|
|
1337
|
+
return k[b >>> 5] |= 128 << 24 - b % 32, k[(b + 64 >>> 9 << 4) + 14] = Math.floor(d / 4294967296), k[(b + 64 >>> 9 << 4) + 15] = d, I.sigBytes = k.length * 4, this._process(), this._hash;
|
|
1338
|
+
},
|
|
1339
|
+
clone: function() {
|
|
1340
|
+
var I = x.clone.call(this);
|
|
1341
|
+
return I._hash = this._hash.clone(), I;
|
|
1342
|
+
}
|
|
1343
|
+
});
|
|
1344
|
+
r.SHA1 = x._createHelper(n), r.HmacSHA1 = x._createHmacHelper(n);
|
|
1345
|
+
}(), t.SHA1;
|
|
1346
|
+
});
|
|
1347
|
+
}(fe)), fe.exports;
|
|
1348
|
+
}
|
|
1349
|
+
var ye = { exports: {} }, Pe;
|
|
1350
|
+
function lt() {
|
|
1351
|
+
return Pe || (Pe = 1, function(s, e) {
|
|
1352
|
+
(function(t, r) {
|
|
1353
|
+
s.exports = r(Z());
|
|
1354
|
+
})(z, function(t) {
|
|
1355
|
+
(function() {
|
|
1356
|
+
var r = t, i = r.lib, c = i.Base, x = r.enc, w = x.Utf8, B = r.algo;
|
|
1357
|
+
B.HMAC = c.extend({
|
|
1358
|
+
/**
|
|
1359
|
+
* Initializes a newly created HMAC.
|
|
1360
|
+
*
|
|
1361
|
+
* @param {Hasher} hasher The hash algorithm to use.
|
|
1362
|
+
* @param {WordArray|string} key The secret key.
|
|
1363
|
+
*
|
|
1364
|
+
* @example
|
|
1365
|
+
*
|
|
1366
|
+
* var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
|
|
1367
|
+
*/
|
|
1368
|
+
init: function(n, I) {
|
|
1369
|
+
n = this._hasher = new n.init(), typeof I == "string" && (I = w.parse(I));
|
|
1370
|
+
var k = n.blockSize, d = k * 4;
|
|
1371
|
+
I.sigBytes > d && (I = n.finalize(I)), I.clamp();
|
|
1372
|
+
for (var b = this._oKey = I.clone(), S = this._iKey = I.clone(), _ = b.words, E = S.words, N = 0; N < k; N++)
|
|
1373
|
+
_[N] ^= 1549556828, E[N] ^= 909522486;
|
|
1374
|
+
b.sigBytes = S.sigBytes = d, this.reset();
|
|
1375
|
+
},
|
|
1376
|
+
/**
|
|
1377
|
+
* Resets this HMAC to its initial state.
|
|
1378
|
+
*
|
|
1379
|
+
* @example
|
|
1380
|
+
*
|
|
1381
|
+
* hmacHasher.reset();
|
|
1382
|
+
*/
|
|
1383
|
+
reset: function() {
|
|
1384
|
+
var n = this._hasher;
|
|
1385
|
+
n.reset(), n.update(this._iKey);
|
|
1386
|
+
},
|
|
1387
|
+
/**
|
|
1388
|
+
* Updates this HMAC with a message.
|
|
1389
|
+
*
|
|
1390
|
+
* @param {WordArray|string} messageUpdate The message to append.
|
|
1391
|
+
*
|
|
1392
|
+
* @return {HMAC} This HMAC instance.
|
|
1393
|
+
*
|
|
1394
|
+
* @example
|
|
1395
|
+
*
|
|
1396
|
+
* hmacHasher.update('message');
|
|
1397
|
+
* hmacHasher.update(wordArray);
|
|
1398
|
+
*/
|
|
1399
|
+
update: function(n) {
|
|
1400
|
+
return this._hasher.update(n), this;
|
|
1401
|
+
},
|
|
1402
|
+
/**
|
|
1403
|
+
* Finalizes the HMAC computation.
|
|
1404
|
+
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
1405
|
+
*
|
|
1406
|
+
* @param {WordArray|string} messageUpdate (Optional) A final message update.
|
|
1407
|
+
*
|
|
1408
|
+
* @return {WordArray} The HMAC.
|
|
1409
|
+
*
|
|
1410
|
+
* @example
|
|
1411
|
+
*
|
|
1412
|
+
* var hmac = hmacHasher.finalize();
|
|
1413
|
+
* var hmac = hmacHasher.finalize('message');
|
|
1414
|
+
* var hmac = hmacHasher.finalize(wordArray);
|
|
1415
|
+
*/
|
|
1416
|
+
finalize: function(n) {
|
|
1417
|
+
var I = this._hasher, k = I.finalize(n);
|
|
1418
|
+
I.reset();
|
|
1419
|
+
var d = I.finalize(this._oKey.clone().concat(k));
|
|
1420
|
+
return d;
|
|
1421
|
+
}
|
|
1422
|
+
});
|
|
1423
|
+
})();
|
|
1424
|
+
});
|
|
1425
|
+
}(ye)), ye.exports;
|
|
1426
|
+
}
|
|
1427
|
+
var Ee;
|
|
1428
|
+
function Ne() {
|
|
1429
|
+
return Ee || (Ee = 1, function(s, e) {
|
|
1430
|
+
(function(t, r, i) {
|
|
1431
|
+
s.exports = r(Z(), pt(), lt());
|
|
1432
|
+
})(z, function(t) {
|
|
1433
|
+
return function() {
|
|
1434
|
+
var r = t, i = r.lib, c = i.Base, x = i.WordArray, w = r.algo, B = w.MD5, n = w.EvpKDF = c.extend({
|
|
1435
|
+
/**
|
|
1436
|
+
* Configuration options.
|
|
1437
|
+
*
|
|
1438
|
+
* @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
|
|
1439
|
+
* @property {Hasher} hasher The hash algorithm to use. Default: MD5
|
|
1440
|
+
* @property {number} iterations The number of iterations to perform. Default: 1
|
|
1441
|
+
*/
|
|
1442
|
+
cfg: c.extend({
|
|
1443
|
+
keySize: 128 / 32,
|
|
1444
|
+
hasher: B,
|
|
1445
|
+
iterations: 1
|
|
1446
|
+
}),
|
|
1447
|
+
/**
|
|
1448
|
+
* Initializes a newly created key derivation function.
|
|
1449
|
+
*
|
|
1450
|
+
* @param {Object} cfg (Optional) The configuration options to use for the derivation.
|
|
1451
|
+
*
|
|
1452
|
+
* @example
|
|
1453
|
+
*
|
|
1454
|
+
* var kdf = CryptoJS.algo.EvpKDF.create();
|
|
1455
|
+
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
|
|
1456
|
+
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
|
|
1457
|
+
*/
|
|
1458
|
+
init: function(I) {
|
|
1459
|
+
this.cfg = this.cfg.extend(I);
|
|
1460
|
+
},
|
|
1461
|
+
/**
|
|
1462
|
+
* Derives a key from a password.
|
|
1463
|
+
*
|
|
1464
|
+
* @param {WordArray|string} password The password.
|
|
1465
|
+
* @param {WordArray|string} salt A salt.
|
|
1466
|
+
*
|
|
1467
|
+
* @return {WordArray} The derived key.
|
|
1468
|
+
*
|
|
1469
|
+
* @example
|
|
1470
|
+
*
|
|
1471
|
+
* var key = kdf.compute(password, salt);
|
|
1472
|
+
*/
|
|
1473
|
+
compute: function(I, k) {
|
|
1474
|
+
for (var d, b = this.cfg, S = b.hasher.create(), _ = x.create(), E = _.words, N = b.keySize, p = b.iterations; E.length < N; ) {
|
|
1475
|
+
d && S.update(d), d = S.update(I).finalize(k), S.reset();
|
|
1476
|
+
for (var o = 1; o < p; o++)
|
|
1477
|
+
d = S.finalize(d), S.reset();
|
|
1478
|
+
_.concat(d);
|
|
1479
|
+
}
|
|
1480
|
+
return _.sigBytes = N * 4, _;
|
|
1481
|
+
}
|
|
1482
|
+
});
|
|
1483
|
+
r.EvpKDF = function(I, k, d) {
|
|
1484
|
+
return n.create(d).compute(I, k);
|
|
1485
|
+
};
|
|
1486
|
+
}(), t.EvpKDF;
|
|
1487
|
+
});
|
|
1488
|
+
}(he)), he.exports;
|
|
1489
|
+
}
|
|
1490
|
+
var me = { exports: {} }, Ie;
|
|
1491
|
+
function dt() {
|
|
1492
|
+
return Ie || (Ie = 1, function(s, e) {
|
|
1493
|
+
(function(t, r, i) {
|
|
1494
|
+
s.exports = r(Z(), Ne());
|
|
1495
|
+
})(z, function(t) {
|
|
1496
|
+
t.lib.Cipher || function(r) {
|
|
1497
|
+
var i = t, c = i.lib, x = c.Base, w = c.WordArray, B = c.BufferedBlockAlgorithm, n = i.enc;
|
|
1498
|
+
n.Utf8;
|
|
1499
|
+
var I = n.Base64, k = i.algo, d = k.EvpKDF, b = c.Cipher = B.extend({
|
|
1500
|
+
/**
|
|
1501
|
+
* Configuration options.
|
|
1502
|
+
*
|
|
1503
|
+
* @property {WordArray} iv The IV to use for this operation.
|
|
1504
|
+
*/
|
|
1505
|
+
cfg: x.extend(),
|
|
1506
|
+
/**
|
|
1507
|
+
* Creates this cipher in encryption mode.
|
|
1508
|
+
*
|
|
1509
|
+
* @param {WordArray} key The key.
|
|
1510
|
+
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
1511
|
+
*
|
|
1512
|
+
* @return {Cipher} A cipher instance.
|
|
1513
|
+
*
|
|
1514
|
+
* @static
|
|
1515
|
+
*
|
|
1516
|
+
* @example
|
|
1517
|
+
*
|
|
1518
|
+
* var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
|
|
1519
|
+
*/
|
|
1520
|
+
createEncryptor: function(a, u) {
|
|
1521
|
+
return this.create(this._ENC_XFORM_MODE, a, u);
|
|
1522
|
+
},
|
|
1523
|
+
/**
|
|
1524
|
+
* Creates this cipher in decryption mode.
|
|
1525
|
+
*
|
|
1526
|
+
* @param {WordArray} key The key.
|
|
1527
|
+
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
1528
|
+
*
|
|
1529
|
+
* @return {Cipher} A cipher instance.
|
|
1530
|
+
*
|
|
1531
|
+
* @static
|
|
1532
|
+
*
|
|
1533
|
+
* @example
|
|
1534
|
+
*
|
|
1535
|
+
* var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
|
|
1536
|
+
*/
|
|
1537
|
+
createDecryptor: function(a, u) {
|
|
1538
|
+
return this.create(this._DEC_XFORM_MODE, a, u);
|
|
1539
|
+
},
|
|
1540
|
+
/**
|
|
1541
|
+
* Initializes a newly created cipher.
|
|
1542
|
+
*
|
|
1543
|
+
* @param {number} xformMode Either the encryption or decryption transormation mode constant.
|
|
1544
|
+
* @param {WordArray} key The key.
|
|
1545
|
+
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
1546
|
+
*
|
|
1547
|
+
* @example
|
|
1548
|
+
*
|
|
1549
|
+
* var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
|
|
1550
|
+
*/
|
|
1551
|
+
init: function(a, u, $) {
|
|
1552
|
+
this.cfg = this.cfg.extend($), this._xformMode = a, this._key = u, this.reset();
|
|
1553
|
+
},
|
|
1554
|
+
/**
|
|
1555
|
+
* Resets this cipher to its initial state.
|
|
1556
|
+
*
|
|
1557
|
+
* @example
|
|
1558
|
+
*
|
|
1559
|
+
* cipher.reset();
|
|
1560
|
+
*/
|
|
1561
|
+
reset: function() {
|
|
1562
|
+
B.reset.call(this), this._doReset();
|
|
1563
|
+
},
|
|
1564
|
+
/**
|
|
1565
|
+
* Adds data to be encrypted or decrypted.
|
|
1566
|
+
*
|
|
1567
|
+
* @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
|
|
1568
|
+
*
|
|
1569
|
+
* @return {WordArray} The data after processing.
|
|
1570
|
+
*
|
|
1571
|
+
* @example
|
|
1572
|
+
*
|
|
1573
|
+
* var encrypted = cipher.process('data');
|
|
1574
|
+
* var encrypted = cipher.process(wordArray);
|
|
1575
|
+
*/
|
|
1576
|
+
process: function(a) {
|
|
1577
|
+
return this._append(a), this._process();
|
|
1578
|
+
},
|
|
1579
|
+
/**
|
|
1580
|
+
* Finalizes the encryption or decryption process.
|
|
1581
|
+
* Note that the finalize operation is effectively a destructive, read-once operation.
|
|
1582
|
+
*
|
|
1583
|
+
* @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
|
|
1584
|
+
*
|
|
1585
|
+
* @return {WordArray} The data after final processing.
|
|
1586
|
+
*
|
|
1587
|
+
* @example
|
|
1588
|
+
*
|
|
1589
|
+
* var encrypted = cipher.finalize();
|
|
1590
|
+
* var encrypted = cipher.finalize('data');
|
|
1591
|
+
* var encrypted = cipher.finalize(wordArray);
|
|
1592
|
+
*/
|
|
1593
|
+
finalize: function(a) {
|
|
1594
|
+
a && this._append(a);
|
|
1595
|
+
var u = this._doFinalize();
|
|
1596
|
+
return u;
|
|
1597
|
+
},
|
|
1598
|
+
keySize: 128 / 32,
|
|
1599
|
+
ivSize: 128 / 32,
|
|
1600
|
+
_ENC_XFORM_MODE: 1,
|
|
1601
|
+
_DEC_XFORM_MODE: 2,
|
|
1602
|
+
/**
|
|
1603
|
+
* Creates shortcut functions to a cipher's object interface.
|
|
1604
|
+
*
|
|
1605
|
+
* @param {Cipher} cipher The cipher to create a helper for.
|
|
1606
|
+
*
|
|
1607
|
+
* @return {Object} An object with encrypt and decrypt shortcut functions.
|
|
1608
|
+
*
|
|
1609
|
+
* @static
|
|
1610
|
+
*
|
|
1611
|
+
* @example
|
|
1612
|
+
*
|
|
1613
|
+
* var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
|
|
1614
|
+
*/
|
|
1615
|
+
_createHelper: /* @__PURE__ */ function() {
|
|
1616
|
+
function a(u) {
|
|
1617
|
+
return typeof u == "string" ? D : P;
|
|
1618
|
+
}
|
|
1619
|
+
return function(u) {
|
|
1620
|
+
return {
|
|
1621
|
+
encrypt: function($, f, C) {
|
|
1622
|
+
return a(f).encrypt(u, $, f, C);
|
|
1623
|
+
},
|
|
1624
|
+
decrypt: function($, f, C) {
|
|
1625
|
+
return a(f).decrypt(u, $, f, C);
|
|
1626
|
+
}
|
|
1627
|
+
};
|
|
1628
|
+
};
|
|
1629
|
+
}()
|
|
1630
|
+
});
|
|
1631
|
+
c.StreamCipher = b.extend({
|
|
1632
|
+
_doFinalize: function() {
|
|
1633
|
+
var a = this._process(!0);
|
|
1634
|
+
return a;
|
|
1635
|
+
},
|
|
1636
|
+
blockSize: 1
|
|
1637
|
+
});
|
|
1638
|
+
var S = i.mode = {}, _ = c.BlockCipherMode = x.extend({
|
|
1639
|
+
/**
|
|
1640
|
+
* Creates this mode for encryption.
|
|
1641
|
+
*
|
|
1642
|
+
* @param {Cipher} cipher A block cipher instance.
|
|
1643
|
+
* @param {Array} iv The IV words.
|
|
1644
|
+
*
|
|
1645
|
+
* @static
|
|
1646
|
+
*
|
|
1647
|
+
* @example
|
|
1648
|
+
*
|
|
1649
|
+
* var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
|
|
1650
|
+
*/
|
|
1651
|
+
createEncryptor: function(a, u) {
|
|
1652
|
+
return this.Encryptor.create(a, u);
|
|
1653
|
+
},
|
|
1654
|
+
/**
|
|
1655
|
+
* Creates this mode for decryption.
|
|
1656
|
+
*
|
|
1657
|
+
* @param {Cipher} cipher A block cipher instance.
|
|
1658
|
+
* @param {Array} iv The IV words.
|
|
1659
|
+
*
|
|
1660
|
+
* @static
|
|
1661
|
+
*
|
|
1662
|
+
* @example
|
|
1663
|
+
*
|
|
1664
|
+
* var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
|
|
1665
|
+
*/
|
|
1666
|
+
createDecryptor: function(a, u) {
|
|
1667
|
+
return this.Decryptor.create(a, u);
|
|
1668
|
+
},
|
|
1669
|
+
/**
|
|
1670
|
+
* Initializes a newly created mode.
|
|
1671
|
+
*
|
|
1672
|
+
* @param {Cipher} cipher A block cipher instance.
|
|
1673
|
+
* @param {Array} iv The IV words.
|
|
1674
|
+
*
|
|
1675
|
+
* @example
|
|
1676
|
+
*
|
|
1677
|
+
* var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
|
|
1678
|
+
*/
|
|
1679
|
+
init: function(a, u) {
|
|
1680
|
+
this._cipher = a, this._iv = u;
|
|
1681
|
+
}
|
|
1682
|
+
}), E = S.CBC = function() {
|
|
1683
|
+
var a = _.extend();
|
|
1684
|
+
a.Encryptor = a.extend({
|
|
1685
|
+
/**
|
|
1686
|
+
* Processes the data block at offset.
|
|
1687
|
+
*
|
|
1688
|
+
* @param {Array} words The data words to operate on.
|
|
1689
|
+
* @param {number} offset The offset where the block starts.
|
|
1690
|
+
*
|
|
1691
|
+
* @example
|
|
1692
|
+
*
|
|
1693
|
+
* mode.processBlock(data.words, offset);
|
|
1694
|
+
*/
|
|
1695
|
+
processBlock: function($, f) {
|
|
1696
|
+
var C = this._cipher, T = C.blockSize;
|
|
1697
|
+
u.call(this, $, f, T), C.encryptBlock($, f), this._prevBlock = $.slice(f, f + T);
|
|
1698
|
+
}
|
|
1699
|
+
}), a.Decryptor = a.extend({
|
|
1700
|
+
/**
|
|
1701
|
+
* Processes the data block at offset.
|
|
1702
|
+
*
|
|
1703
|
+
* @param {Array} words The data words to operate on.
|
|
1704
|
+
* @param {number} offset The offset where the block starts.
|
|
1705
|
+
*
|
|
1706
|
+
* @example
|
|
1707
|
+
*
|
|
1708
|
+
* mode.processBlock(data.words, offset);
|
|
1709
|
+
*/
|
|
1710
|
+
processBlock: function($, f) {
|
|
1711
|
+
var C = this._cipher, T = C.blockSize, L = $.slice(f, f + T);
|
|
1712
|
+
C.decryptBlock($, f), u.call(this, $, f, T), this._prevBlock = L;
|
|
1713
|
+
}
|
|
1714
|
+
});
|
|
1715
|
+
function u($, f, C) {
|
|
1716
|
+
var T, L = this._iv;
|
|
1717
|
+
L ? (T = L, this._iv = r) : T = this._prevBlock;
|
|
1718
|
+
for (var j = 0; j < C; j++)
|
|
1719
|
+
$[f + j] ^= T[j];
|
|
1720
|
+
}
|
|
1721
|
+
return a;
|
|
1722
|
+
}(), N = i.pad = {}, p = N.Pkcs7 = {
|
|
1723
|
+
/**
|
|
1724
|
+
* Pads data using the algorithm defined in PKCS #5/7.
|
|
1725
|
+
*
|
|
1726
|
+
* @param {WordArray} data The data to pad.
|
|
1727
|
+
* @param {number} blockSize The multiple that the data should be padded to.
|
|
1728
|
+
*
|
|
1729
|
+
* @static
|
|
1730
|
+
*
|
|
1731
|
+
* @example
|
|
1732
|
+
*
|
|
1733
|
+
* CryptoJS.pad.Pkcs7.pad(wordArray, 4);
|
|
1734
|
+
*/
|
|
1735
|
+
pad: function(a, u) {
|
|
1736
|
+
for (var $ = u * 4, f = $ - a.sigBytes % $, C = f << 24 | f << 16 | f << 8 | f, T = [], L = 0; L < f; L += 4)
|
|
1737
|
+
T.push(C);
|
|
1738
|
+
var j = w.create(T, f);
|
|
1739
|
+
a.concat(j);
|
|
1740
|
+
},
|
|
1741
|
+
/**
|
|
1742
|
+
* Unpads data that had been padded using the algorithm defined in PKCS #5/7.
|
|
1743
|
+
*
|
|
1744
|
+
* @param {WordArray} data The data to unpad.
|
|
1745
|
+
*
|
|
1746
|
+
* @static
|
|
1747
|
+
*
|
|
1748
|
+
* @example
|
|
1749
|
+
*
|
|
1750
|
+
* CryptoJS.pad.Pkcs7.unpad(wordArray);
|
|
1751
|
+
*/
|
|
1752
|
+
unpad: function(a) {
|
|
1753
|
+
var u = a.words[a.sigBytes - 1 >>> 2] & 255;
|
|
1754
|
+
a.sigBytes -= u;
|
|
1755
|
+
}
|
|
1756
|
+
};
|
|
1757
|
+
c.BlockCipher = b.extend({
|
|
1758
|
+
/**
|
|
1759
|
+
* Configuration options.
|
|
1760
|
+
*
|
|
1761
|
+
* @property {Mode} mode The block mode to use. Default: CBC
|
|
1762
|
+
* @property {Padding} padding The padding strategy to use. Default: Pkcs7
|
|
1763
|
+
*/
|
|
1764
|
+
cfg: b.cfg.extend({
|
|
1765
|
+
mode: E,
|
|
1766
|
+
padding: p
|
|
1767
|
+
}),
|
|
1768
|
+
reset: function() {
|
|
1769
|
+
var a;
|
|
1770
|
+
b.reset.call(this);
|
|
1771
|
+
var u = this.cfg, $ = u.iv, f = u.mode;
|
|
1772
|
+
this._xformMode == this._ENC_XFORM_MODE ? a = f.createEncryptor : (a = f.createDecryptor, this._minBufferSize = 1), this._mode && this._mode.__creator == a ? this._mode.init(this, $ && $.words) : (this._mode = a.call(f, this, $ && $.words), this._mode.__creator = a);
|
|
1773
|
+
},
|
|
1774
|
+
_doProcessBlock: function(a, u) {
|
|
1775
|
+
this._mode.processBlock(a, u);
|
|
1776
|
+
},
|
|
1777
|
+
_doFinalize: function() {
|
|
1778
|
+
var a, u = this.cfg.padding;
|
|
1779
|
+
return this._xformMode == this._ENC_XFORM_MODE ? (u.pad(this._data, this.blockSize), a = this._process(!0)) : (a = this._process(!0), u.unpad(a)), a;
|
|
1780
|
+
},
|
|
1781
|
+
blockSize: 128 / 32
|
|
1782
|
+
});
|
|
1783
|
+
var o = c.CipherParams = x.extend({
|
|
1784
|
+
/**
|
|
1785
|
+
* Initializes a newly created cipher params object.
|
|
1786
|
+
*
|
|
1787
|
+
* @param {Object} cipherParams An object with any of the possible cipher parameters.
|
|
1788
|
+
*
|
|
1789
|
+
* @example
|
|
1790
|
+
*
|
|
1791
|
+
* var cipherParams = CryptoJS.lib.CipherParams.create({
|
|
1792
|
+
* ciphertext: ciphertextWordArray,
|
|
1793
|
+
* key: keyWordArray,
|
|
1794
|
+
* iv: ivWordArray,
|
|
1795
|
+
* salt: saltWordArray,
|
|
1796
|
+
* algorithm: CryptoJS.algo.AES,
|
|
1797
|
+
* mode: CryptoJS.mode.CBC,
|
|
1798
|
+
* padding: CryptoJS.pad.PKCS7,
|
|
1799
|
+
* blockSize: 4,
|
|
1800
|
+
* formatter: CryptoJS.format.OpenSSL
|
|
1801
|
+
* });
|
|
1802
|
+
*/
|
|
1803
|
+
init: function(a) {
|
|
1804
|
+
this.mixIn(a);
|
|
1805
|
+
},
|
|
1806
|
+
/**
|
|
1807
|
+
* Converts this cipher params object to a string.
|
|
1808
|
+
*
|
|
1809
|
+
* @param {Format} formatter (Optional) The formatting strategy to use.
|
|
1810
|
+
*
|
|
1811
|
+
* @return {string} The stringified cipher params.
|
|
1812
|
+
*
|
|
1813
|
+
* @throws Error If neither the formatter nor the default formatter is set.
|
|
1814
|
+
*
|
|
1815
|
+
* @example
|
|
1816
|
+
*
|
|
1817
|
+
* var string = cipherParams + '';
|
|
1818
|
+
* var string = cipherParams.toString();
|
|
1819
|
+
* var string = cipherParams.toString(CryptoJS.format.OpenSSL);
|
|
1820
|
+
*/
|
|
1821
|
+
toString: function(a) {
|
|
1822
|
+
return (a || this.formatter).stringify(this);
|
|
1823
|
+
}
|
|
1824
|
+
}), l = i.format = {}, g = l.OpenSSL = {
|
|
1825
|
+
/**
|
|
1826
|
+
* Converts a cipher params object to an OpenSSL-compatible string.
|
|
1827
|
+
*
|
|
1828
|
+
* @param {CipherParams} cipherParams The cipher params object.
|
|
1829
|
+
*
|
|
1830
|
+
* @return {string} The OpenSSL-compatible string.
|
|
1831
|
+
*
|
|
1832
|
+
* @static
|
|
1833
|
+
*
|
|
1834
|
+
* @example
|
|
1835
|
+
*
|
|
1836
|
+
* var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
|
|
1837
|
+
*/
|
|
1838
|
+
stringify: function(a) {
|
|
1839
|
+
var u, $ = a.ciphertext, f = a.salt;
|
|
1840
|
+
return f ? u = w.create([1398893684, 1701076831]).concat(f).concat($) : u = $, u.toString(I);
|
|
1841
|
+
},
|
|
1842
|
+
/**
|
|
1843
|
+
* Converts an OpenSSL-compatible string to a cipher params object.
|
|
1844
|
+
*
|
|
1845
|
+
* @param {string} openSSLStr The OpenSSL-compatible string.
|
|
1846
|
+
*
|
|
1847
|
+
* @return {CipherParams} The cipher params object.
|
|
1848
|
+
*
|
|
1849
|
+
* @static
|
|
1850
|
+
*
|
|
1851
|
+
* @example
|
|
1852
|
+
*
|
|
1853
|
+
* var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
|
|
1854
|
+
*/
|
|
1855
|
+
parse: function(a) {
|
|
1856
|
+
var u, $ = I.parse(a), f = $.words;
|
|
1857
|
+
return f[0] == 1398893684 && f[1] == 1701076831 && (u = w.create(f.slice(2, 4)), f.splice(0, 4), $.sigBytes -= 16), o.create({ ciphertext: $, salt: u });
|
|
1858
|
+
}
|
|
1859
|
+
}, P = c.SerializableCipher = x.extend({
|
|
1860
|
+
/**
|
|
1861
|
+
* Configuration options.
|
|
1862
|
+
*
|
|
1863
|
+
* @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
|
|
1864
|
+
*/
|
|
1865
|
+
cfg: x.extend({
|
|
1866
|
+
format: g
|
|
1867
|
+
}),
|
|
1868
|
+
/**
|
|
1869
|
+
* Encrypts a message.
|
|
1870
|
+
*
|
|
1871
|
+
* @param {Cipher} cipher The cipher algorithm to use.
|
|
1872
|
+
* @param {WordArray|string} message The message to encrypt.
|
|
1873
|
+
* @param {WordArray} key The key.
|
|
1874
|
+
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
1875
|
+
*
|
|
1876
|
+
* @return {CipherParams} A cipher params object.
|
|
1877
|
+
*
|
|
1878
|
+
* @static
|
|
1879
|
+
*
|
|
1880
|
+
* @example
|
|
1881
|
+
*
|
|
1882
|
+
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
|
|
1883
|
+
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
|
|
1884
|
+
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
|
1885
|
+
*/
|
|
1886
|
+
encrypt: function(a, u, $, f) {
|
|
1887
|
+
f = this.cfg.extend(f);
|
|
1888
|
+
var C = a.createEncryptor($, f), T = C.finalize(u), L = C.cfg;
|
|
1889
|
+
return o.create({
|
|
1890
|
+
ciphertext: T,
|
|
1891
|
+
key: $,
|
|
1892
|
+
iv: L.iv,
|
|
1893
|
+
algorithm: a,
|
|
1894
|
+
mode: L.mode,
|
|
1895
|
+
padding: L.padding,
|
|
1896
|
+
blockSize: a.blockSize,
|
|
1897
|
+
formatter: f.format
|
|
1898
|
+
});
|
|
1899
|
+
},
|
|
1900
|
+
/**
|
|
1901
|
+
* Decrypts serialized ciphertext.
|
|
1902
|
+
*
|
|
1903
|
+
* @param {Cipher} cipher The cipher algorithm to use.
|
|
1904
|
+
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
|
|
1905
|
+
* @param {WordArray} key The key.
|
|
1906
|
+
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
1907
|
+
*
|
|
1908
|
+
* @return {WordArray} The plaintext.
|
|
1909
|
+
*
|
|
1910
|
+
* @static
|
|
1911
|
+
*
|
|
1912
|
+
* @example
|
|
1913
|
+
*
|
|
1914
|
+
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
|
1915
|
+
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
|
1916
|
+
*/
|
|
1917
|
+
decrypt: function(a, u, $, f) {
|
|
1918
|
+
f = this.cfg.extend(f), u = this._parse(u, f.format);
|
|
1919
|
+
var C = a.createDecryptor($, f).finalize(u.ciphertext);
|
|
1920
|
+
return C;
|
|
1921
|
+
},
|
|
1922
|
+
/**
|
|
1923
|
+
* Converts serialized ciphertext to CipherParams,
|
|
1924
|
+
* else assumed CipherParams already and returns ciphertext unchanged.
|
|
1925
|
+
*
|
|
1926
|
+
* @param {CipherParams|string} ciphertext The ciphertext.
|
|
1927
|
+
* @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
|
|
1928
|
+
*
|
|
1929
|
+
* @return {CipherParams} The unserialized ciphertext.
|
|
1930
|
+
*
|
|
1931
|
+
* @static
|
|
1932
|
+
*
|
|
1933
|
+
* @example
|
|
1934
|
+
*
|
|
1935
|
+
* var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
|
|
1936
|
+
*/
|
|
1937
|
+
_parse: function(a, u) {
|
|
1938
|
+
return typeof a == "string" ? u.parse(a, this) : a;
|
|
1939
|
+
}
|
|
1940
|
+
}), A = i.kdf = {}, F = A.OpenSSL = {
|
|
1941
|
+
/**
|
|
1942
|
+
* Derives a key and IV from a password.
|
|
1943
|
+
*
|
|
1944
|
+
* @param {string} password The password to derive from.
|
|
1945
|
+
* @param {number} keySize The size in words of the key to generate.
|
|
1946
|
+
* @param {number} ivSize The size in words of the IV to generate.
|
|
1947
|
+
* @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
|
|
1948
|
+
*
|
|
1949
|
+
* @return {CipherParams} A cipher params object with the key, IV, and salt.
|
|
1950
|
+
*
|
|
1951
|
+
* @static
|
|
1952
|
+
*
|
|
1953
|
+
* @example
|
|
1954
|
+
*
|
|
1955
|
+
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
|
|
1956
|
+
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
|
|
1957
|
+
*/
|
|
1958
|
+
execute: function(a, u, $, f, C) {
|
|
1959
|
+
if (f || (f = w.random(64 / 8)), C)
|
|
1960
|
+
var T = d.create({ keySize: u + $, hasher: C }).compute(a, f);
|
|
1961
|
+
else
|
|
1962
|
+
var T = d.create({ keySize: u + $ }).compute(a, f);
|
|
1963
|
+
var L = w.create(T.words.slice(u), $ * 4);
|
|
1964
|
+
return T.sigBytes = u * 4, o.create({ key: T, iv: L, salt: f });
|
|
1965
|
+
}
|
|
1966
|
+
}, D = c.PasswordBasedCipher = P.extend({
|
|
1967
|
+
/**
|
|
1968
|
+
* Configuration options.
|
|
1969
|
+
*
|
|
1970
|
+
* @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
|
|
1971
|
+
*/
|
|
1972
|
+
cfg: P.cfg.extend({
|
|
1973
|
+
kdf: F
|
|
1974
|
+
}),
|
|
1975
|
+
/**
|
|
1976
|
+
* Encrypts a message using a password.
|
|
1977
|
+
*
|
|
1978
|
+
* @param {Cipher} cipher The cipher algorithm to use.
|
|
1979
|
+
* @param {WordArray|string} message The message to encrypt.
|
|
1980
|
+
* @param {string} password The password.
|
|
1981
|
+
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
1982
|
+
*
|
|
1983
|
+
* @return {CipherParams} A cipher params object.
|
|
1984
|
+
*
|
|
1985
|
+
* @static
|
|
1986
|
+
*
|
|
1987
|
+
* @example
|
|
1988
|
+
*
|
|
1989
|
+
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
|
|
1990
|
+
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
|
|
1991
|
+
*/
|
|
1992
|
+
encrypt: function(a, u, $, f) {
|
|
1993
|
+
f = this.cfg.extend(f);
|
|
1994
|
+
var C = f.kdf.execute($, a.keySize, a.ivSize, f.salt, f.hasher);
|
|
1995
|
+
f.iv = C.iv;
|
|
1996
|
+
var T = P.encrypt.call(this, a, u, C.key, f);
|
|
1997
|
+
return T.mixIn(C), T;
|
|
1998
|
+
},
|
|
1999
|
+
/**
|
|
2000
|
+
* Decrypts serialized ciphertext using a password.
|
|
2001
|
+
*
|
|
2002
|
+
* @param {Cipher} cipher The cipher algorithm to use.
|
|
2003
|
+
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
|
|
2004
|
+
* @param {string} password The password.
|
|
2005
|
+
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
|
2006
|
+
*
|
|
2007
|
+
* @return {WordArray} The plaintext.
|
|
2008
|
+
*
|
|
2009
|
+
* @static
|
|
2010
|
+
*
|
|
2011
|
+
* @example
|
|
2012
|
+
*
|
|
2013
|
+
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
|
|
2014
|
+
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
|
|
2015
|
+
*/
|
|
2016
|
+
decrypt: function(a, u, $, f) {
|
|
2017
|
+
f = this.cfg.extend(f), u = this._parse(u, f.format);
|
|
2018
|
+
var C = f.kdf.execute($, a.keySize, a.ivSize, u.salt, f.hasher);
|
|
2019
|
+
f.iv = C.iv;
|
|
2020
|
+
var T = P.decrypt.call(this, a, u, C.key, f);
|
|
2021
|
+
return T;
|
|
2022
|
+
}
|
|
2023
|
+
});
|
|
2024
|
+
}();
|
|
2025
|
+
});
|
|
2026
|
+
}(me)), me.exports;
|
|
2027
|
+
}
|
|
2028
|
+
(function(s, e) {
|
|
2029
|
+
(function(t, r, i) {
|
|
2030
|
+
s.exports = r(Z(), Ae, Re, Ne(), dt());
|
|
2031
|
+
})(z, function(t) {
|
|
2032
|
+
return function() {
|
|
2033
|
+
var r = t, i = r.lib, c = i.BlockCipher, x = r.algo, w = [], B = [], n = [], I = [], k = [], d = [], b = [], S = [], _ = [], E = [];
|
|
2034
|
+
(function() {
|
|
2035
|
+
for (var o = [], l = 0; l < 256; l++)
|
|
2036
|
+
l < 128 ? o[l] = l << 1 : o[l] = l << 1 ^ 283;
|
|
2037
|
+
for (var g = 0, P = 0, l = 0; l < 256; l++) {
|
|
2038
|
+
var A = P ^ P << 1 ^ P << 2 ^ P << 3 ^ P << 4;
|
|
2039
|
+
A = A >>> 8 ^ A & 255 ^ 99, w[g] = A, B[A] = g;
|
|
2040
|
+
var F = o[g], D = o[F], a = o[D], u = o[A] * 257 ^ A * 16843008;
|
|
2041
|
+
n[g] = u << 24 | u >>> 8, I[g] = u << 16 | u >>> 16, k[g] = u << 8 | u >>> 24, d[g] = u;
|
|
2042
|
+
var u = a * 16843009 ^ D * 65537 ^ F * 257 ^ g * 16843008;
|
|
2043
|
+
b[A] = u << 24 | u >>> 8, S[A] = u << 16 | u >>> 16, _[A] = u << 8 | u >>> 24, E[A] = u, g ? (g = F ^ o[o[o[a ^ F]]], P ^= o[o[P]]) : g = P = 1;
|
|
2044
|
+
}
|
|
2045
|
+
})();
|
|
2046
|
+
var N = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], p = x.AES = c.extend({
|
|
2047
|
+
_doReset: function() {
|
|
2048
|
+
var o;
|
|
2049
|
+
if (!(this._nRounds && this._keyPriorReset === this._key)) {
|
|
2050
|
+
for (var l = this._keyPriorReset = this._key, g = l.words, P = l.sigBytes / 4, A = this._nRounds = P + 6, F = (A + 1) * 4, D = this._keySchedule = [], a = 0; a < F; a++)
|
|
2051
|
+
a < P ? D[a] = g[a] : (o = D[a - 1], a % P ? P > 6 && a % P == 4 && (o = w[o >>> 24] << 24 | w[o >>> 16 & 255] << 16 | w[o >>> 8 & 255] << 8 | w[o & 255]) : (o = o << 8 | o >>> 24, o = w[o >>> 24] << 24 | w[o >>> 16 & 255] << 16 | w[o >>> 8 & 255] << 8 | w[o & 255], o ^= N[a / P | 0] << 24), D[a] = D[a - P] ^ o);
|
|
2052
|
+
for (var u = this._invKeySchedule = [], $ = 0; $ < F; $++) {
|
|
2053
|
+
var a = F - $;
|
|
2054
|
+
if ($ % 4)
|
|
2055
|
+
var o = D[a];
|
|
2056
|
+
else
|
|
2057
|
+
var o = D[a - 4];
|
|
2058
|
+
$ < 4 || a <= 4 ? u[$] = o : u[$] = b[w[o >>> 24]] ^ S[w[o >>> 16 & 255]] ^ _[w[o >>> 8 & 255]] ^ E[w[o & 255]];
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
},
|
|
2062
|
+
encryptBlock: function(o, l) {
|
|
2063
|
+
this._doCryptBlock(o, l, this._keySchedule, n, I, k, d, w);
|
|
2064
|
+
},
|
|
2065
|
+
decryptBlock: function(o, l) {
|
|
2066
|
+
var g = o[l + 1];
|
|
2067
|
+
o[l + 1] = o[l + 3], o[l + 3] = g, this._doCryptBlock(o, l, this._invKeySchedule, b, S, _, E, B);
|
|
2068
|
+
var g = o[l + 1];
|
|
2069
|
+
o[l + 1] = o[l + 3], o[l + 3] = g;
|
|
2070
|
+
},
|
|
2071
|
+
_doCryptBlock: function(o, l, g, P, A, F, D, a) {
|
|
2072
|
+
for (var u = this._nRounds, $ = o[l] ^ g[0], f = o[l + 1] ^ g[1], C = o[l + 2] ^ g[2], T = o[l + 3] ^ g[3], L = 4, j = 1; j < u; j++) {
|
|
2073
|
+
var V = P[$ >>> 24] ^ A[f >>> 16 & 255] ^ F[C >>> 8 & 255] ^ D[T & 255] ^ g[L++], J = P[f >>> 24] ^ A[C >>> 16 & 255] ^ F[T >>> 8 & 255] ^ D[$ & 255] ^ g[L++], Y = P[C >>> 24] ^ A[T >>> 16 & 255] ^ F[$ >>> 8 & 255] ^ D[f & 255] ^ g[L++], h = P[T >>> 24] ^ A[$ >>> 16 & 255] ^ F[f >>> 8 & 255] ^ D[C & 255] ^ g[L++];
|
|
2074
|
+
$ = V, f = J, C = Y, T = h;
|
|
2075
|
+
}
|
|
2076
|
+
var V = (a[$ >>> 24] << 24 | a[f >>> 16 & 255] << 16 | a[C >>> 8 & 255] << 8 | a[T & 255]) ^ g[L++], J = (a[f >>> 24] << 24 | a[C >>> 16 & 255] << 16 | a[T >>> 8 & 255] << 8 | a[$ & 255]) ^ g[L++], Y = (a[C >>> 24] << 24 | a[T >>> 16 & 255] << 16 | a[$ >>> 8 & 255] << 8 | a[f & 255]) ^ g[L++], h = (a[T >>> 24] << 24 | a[$ >>> 16 & 255] << 16 | a[f >>> 8 & 255] << 8 | a[C & 255]) ^ g[L++];
|
|
2077
|
+
o[l] = V, o[l + 1] = J, o[l + 2] = Y, o[l + 3] = h;
|
|
2078
|
+
},
|
|
2079
|
+
keySize: 256 / 32
|
|
2080
|
+
});
|
|
2081
|
+
r.AES = c._createHelper(p);
|
|
2082
|
+
}(), t.AES;
|
|
2083
|
+
});
|
|
2084
|
+
})(Te);
|
|
2085
|
+
var ut = Te.exports;
|
|
2086
|
+
const ht = /* @__PURE__ */ le(ut);
|
|
2087
|
+
class ce extends Error {
|
|
2088
|
+
constructor(e, t, r) {
|
|
2089
|
+
super(e), this.name = "HttpError", this.code = t, this.response = r;
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
class pe {
|
|
2093
|
+
constructor(e = 6e4) {
|
|
2094
|
+
this.timeout = e;
|
|
2095
|
+
}
|
|
2096
|
+
get(e, t = {}) {
|
|
2097
|
+
return this.request("GET", e, void 0, t);
|
|
2098
|
+
}
|
|
2099
|
+
post(e, t, r = {}) {
|
|
2100
|
+
return this.request("POST", e, t, r);
|
|
2101
|
+
}
|
|
2102
|
+
put(e, t, r = {}) {
|
|
2103
|
+
return this.request("PUT", e, t, r);
|
|
2104
|
+
}
|
|
2105
|
+
async request(e, t, r, i = {}) {
|
|
2106
|
+
const c = { Accept: "application/json" }, x = { method: e, headers: c };
|
|
2107
|
+
r !== void 0 && (c["Content-Type"] = "application/json", x.body = typeof r == "string" ? r : JSON.stringify(r));
|
|
2108
|
+
const w = typeof AbortController < "u" ? new AbortController() : void 0;
|
|
2109
|
+
w !== void 0 && (x.signal = w.signal);
|
|
2110
|
+
let B;
|
|
2111
|
+
const n = () => new ce(`timeout of ${this.timeout}ms exceeded`, "ECONNABORTED"), I = new Promise((d, b) => {
|
|
2112
|
+
B = setTimeout(() => {
|
|
2113
|
+
b(n()), w == null || w.abort();
|
|
2114
|
+
}, this.timeout);
|
|
2115
|
+
}), k = (d) => d instanceof ce ? d : (d == null ? void 0 : d.name) === "AbortError" ? n() : new ce("Network Error", "ERR_NETWORK");
|
|
2116
|
+
try {
|
|
2117
|
+
let d, b;
|
|
2118
|
+
try {
|
|
2119
|
+
d = await Promise.race([fetch(pe.buildUrl(t, i.params), x), I]), b = await Promise.race([d.text(), I]);
|
|
2120
|
+
} catch (_) {
|
|
2121
|
+
throw k(_);
|
|
2122
|
+
}
|
|
2123
|
+
const S = { data: pe.parseBody(b), status: d.status, headers: d.headers };
|
|
2124
|
+
if (d.status < 200 || d.status >= 300) {
|
|
2125
|
+
const _ = d.status >= 400 && d.status < 500 ? "ERR_BAD_REQUEST" : "ERR_BAD_RESPONSE";
|
|
2126
|
+
throw new ce(`Request failed with status code ${d.status}`, _, S);
|
|
2127
|
+
}
|
|
2128
|
+
return S;
|
|
2129
|
+
} finally {
|
|
2130
|
+
clearTimeout(B);
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
static parseBody(e) {
|
|
2134
|
+
if (e === "")
|
|
2135
|
+
return e;
|
|
2136
|
+
try {
|
|
2137
|
+
return JSON.parse(e);
|
|
2138
|
+
} catch {
|
|
2139
|
+
return e;
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
/**
|
|
2143
|
+
* query string 을 붙인다 — axios 와 같이 null · undefined 는 빼고, 배열은 key[] 로, 객체는 JSON 으로 보낸다
|
|
2144
|
+
*/
|
|
2145
|
+
static buildUrl(e, t) {
|
|
2146
|
+
if (t == null)
|
|
2147
|
+
return e;
|
|
2148
|
+
const r = (c) => encodeURIComponent(c).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"), i = [];
|
|
2149
|
+
return Object.keys(t).forEach((c) => {
|
|
2150
|
+
const x = t[c];
|
|
2151
|
+
if (x == null)
|
|
2152
|
+
return;
|
|
2153
|
+
const w = Array.isArray(x) ? x : [x], B = Array.isArray(x) ? `${c}[]` : c;
|
|
2154
|
+
w.forEach((n) => {
|
|
2155
|
+
const I = n instanceof Date ? n.toISOString() : typeof n == "object" && n !== null ? JSON.stringify(n) : String(n);
|
|
2156
|
+
i.push(`${r(B)}=${r(I)}`);
|
|
2157
|
+
});
|
|
2158
|
+
}), i.length === 0 ? e : `${e}${e.indexOf("?") === -1 ? "?" : "&"}${i.join("&")}`;
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
class ae {
|
|
2162
|
+
constructor() {
|
|
2163
|
+
this.$http = new pe(6e4);
|
|
2164
|
+
}
|
|
2165
|
+
static encryptParams(e) {
|
|
2166
|
+
oe(e, "object") && (e = JSON.stringify(e));
|
|
2167
|
+
let t = ht.encrypt(e, ke());
|
|
2168
|
+
return {
|
|
2169
|
+
payload: t.ciphertext.toString(ie),
|
|
2170
|
+
token: `${t.key.toString(ie)}##${t.iv.toString(ie)}`
|
|
2171
|
+
};
|
|
2172
|
+
}
|
|
2173
|
+
static toUnderscore(e) {
|
|
2174
|
+
return e.split(/(?=[A-Z])/).join("_").toLowerCase();
|
|
2175
|
+
}
|
|
2176
|
+
static toCamelcase(e) {
|
|
2177
|
+
return e.replace(/(\_[a-z])/g, function(t) {
|
|
2178
|
+
return t.toUpperCase().replace(/_/g, "");
|
|
2179
|
+
});
|
|
2180
|
+
}
|
|
2181
|
+
static objectKeyToUnderscore(e) {
|
|
2182
|
+
let t;
|
|
2183
|
+
return M(e) && (Array.isArray(e) ? (t = [], e.forEach((r) => {
|
|
2184
|
+
let i = {};
|
|
2185
|
+
Object.keys(r).forEach((c) => {
|
|
2186
|
+
i[this.toUnderscore(c)] = r[c];
|
|
2187
|
+
}), t.push(i);
|
|
2188
|
+
})) : (t = {}, Object.keys(e).forEach((r) => {
|
|
2189
|
+
t[this.toUnderscore(r)] = e[r];
|
|
2190
|
+
}))), t;
|
|
2191
|
+
}
|
|
2192
|
+
static objectKeyToCamel(e) {
|
|
2193
|
+
let t;
|
|
2194
|
+
return M(e) && (Array.isArray(e) ? (t = [], e.forEach((r) => {
|
|
2195
|
+
let i = {};
|
|
2196
|
+
Object.keys(r).forEach((c) => {
|
|
2197
|
+
i[this.toCamelcase(c)] = r[c];
|
|
2198
|
+
}), t.push(i);
|
|
2199
|
+
})) : (t = {}, Object.keys(e).forEach((r) => {
|
|
2200
|
+
oe(e[r], "object") && Object.keys(e[r]).length > 0 ? t[this.toCamelcase(r)] = this.objectKeyToCamel(e[r]) : t[this.toCamelcase(r)] = e[r];
|
|
2201
|
+
}))), t;
|
|
2202
|
+
}
|
|
2203
|
+
static isHttpBodyUsedMethod(e) {
|
|
2204
|
+
return ["post", "put"].indexOf(e) > -1;
|
|
2205
|
+
}
|
|
2206
|
+
}
|
|
2207
|
+
class ft extends ae {
|
|
2208
|
+
constructor() {
|
|
2209
|
+
super();
|
|
2210
|
+
}
|
|
2211
|
+
/**
|
|
2212
|
+
* 결제 상태 정보를 지속적으로 가져온다
|
|
2213
|
+
* Comment by GOSOMI
|
|
2214
|
+
* @date: 2021-12-29
|
|
2215
|
+
*/
|
|
2216
|
+
async pollingStatus(e, t, r, i) {
|
|
2217
|
+
try {
|
|
2218
|
+
const c = await this.$http.get([e, "s", t].join("/"), {
|
|
2219
|
+
params: {
|
|
2220
|
+
application_id: r,
|
|
2221
|
+
tk: i
|
|
2222
|
+
}
|
|
2223
|
+
});
|
|
2224
|
+
return Promise.resolve(c);
|
|
2225
|
+
} catch (c) {
|
|
2226
|
+
return Promise.reject(c);
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
const yt = new ft();
|
|
2231
|
+
class mt extends Ce {
|
|
2232
|
+
constructor() {
|
|
2233
|
+
super(), this.$messageEventName = "message.BootpayPaymentEvent", this.$eventPrefix = "bootpay", this.$pollingInterval = void 0, this.resetPollingData(), this.$pollingEvent = yt, this.pollingInterval = 3e3, this.isDone = !1;
|
|
2234
|
+
}
|
|
2235
|
+
/**
|
|
2236
|
+
* 결제 이벤트를 바인딩한다
|
|
2237
|
+
* Comment by GOSOMI
|
|
2238
|
+
* @date: 2021-05-11
|
|
2239
|
+
*/
|
|
2240
|
+
bind(e, t) {
|
|
2241
|
+
this.isDone = !1, this.setCallbackFunction(e, t), window.resetBootpayEventListener(this.$messageEventName, (r) => {
|
|
2242
|
+
const i = this.parseEvent(r.data);
|
|
2243
|
+
if (R.debug("event received", JSON.stringify(i)), M(i))
|
|
2244
|
+
switch (R.debug("event", i), i.event) {
|
|
2245
|
+
case "error":
|
|
2246
|
+
case "cancel":
|
|
2247
|
+
return this.handleErrorOrCancel(i);
|
|
2248
|
+
case "setConfirmParameters":
|
|
2249
|
+
const c = `${i.gateway_url}/confirm/${i.receipt_id}?application_id=${i.application_id}`;
|
|
2250
|
+
i.open_type === "redirect" ? O.setConfirmRedirect(c) : O.setConfirmFormUrl(c);
|
|
2251
|
+
break;
|
|
2252
|
+
case "confirm":
|
|
2253
|
+
return this.resolve({
|
|
2254
|
+
event: i.event,
|
|
2255
|
+
application_id: i.application_id,
|
|
2256
|
+
receipt_id: i.receipt_id,
|
|
2257
|
+
gateway_url: i.gateway_url,
|
|
2258
|
+
order_id: i.order_id
|
|
2259
|
+
});
|
|
2260
|
+
case "redirect":
|
|
2261
|
+
O.destroy(!1), location.href = i.url;
|
|
2262
|
+
return;
|
|
2263
|
+
case "moveRedirectUrl":
|
|
2264
|
+
O.closePopup(), O.hidePaymentiFrame(), O.showProgress("결제 진행 중입니다. 잠시만 기다려주세요."), location.replace(De(i.url, i.parameters)), setTimeout(() => {
|
|
2265
|
+
O.destroy(!1);
|
|
2266
|
+
}, 5e3);
|
|
2267
|
+
break;
|
|
2268
|
+
case "polling":
|
|
2269
|
+
return this.$pollingData !== void 0 && (this.$pollingData.receiptId = i.receipt_id, this.$pollingData.gatewayUrl = i.gateway_url), this.startPollingEvent();
|
|
2270
|
+
case "issued":
|
|
2271
|
+
case "done":
|
|
2272
|
+
if (!this.isDone)
|
|
2273
|
+
return this.isDone = !0, this.clearPollingEvent(), this.resolve(i);
|
|
2274
|
+
break;
|
|
2275
|
+
case "iFrameStyle":
|
|
2276
|
+
case "windowStyle":
|
|
2277
|
+
case "resize":
|
|
2278
|
+
this.handleStyleUpdate(i);
|
|
2279
|
+
break;
|
|
2280
|
+
case "hideProgress":
|
|
2281
|
+
case "showProgress":
|
|
2282
|
+
this.handleProgressUpdate(i);
|
|
2283
|
+
break;
|
|
2284
|
+
case "hidePayment":
|
|
2285
|
+
case "showPayment":
|
|
2286
|
+
this.handleVisibilityUpdate(i);
|
|
2287
|
+
break;
|
|
2288
|
+
case "popup":
|
|
2289
|
+
O.createPopupButton({
|
|
2290
|
+
gatewayUrl: i.url,
|
|
2291
|
+
receiptId: i.receipt_id,
|
|
2292
|
+
name: i.name,
|
|
2293
|
+
price: i.price
|
|
2294
|
+
});
|
|
2295
|
+
break;
|
|
2296
|
+
case "close":
|
|
2297
|
+
O.destroy();
|
|
2298
|
+
break;
|
|
2299
|
+
default:
|
|
2300
|
+
return;
|
|
2301
|
+
}
|
|
2302
|
+
});
|
|
2303
|
+
}
|
|
2304
|
+
/**
|
|
2305
|
+
* 결제 이벤트에 필요한 기본 값들을 받는다
|
|
2306
|
+
* Comment by GOSOMI
|
|
2307
|
+
* @date: 2021-12-29
|
|
2308
|
+
*/
|
|
2309
|
+
setDefaultPaymentData(e, t) {
|
|
2310
|
+
this.$pollingData !== void 0 && (this.$pollingData.applicationId = e, this.$pollingData.transactionKey = t);
|
|
2311
|
+
}
|
|
2312
|
+
/**
|
|
2313
|
+
* bootpay dom custom 이벤트 호출
|
|
2314
|
+
* Comment by GOSOMI
|
|
2315
|
+
* @date: 2021-12-24
|
|
2316
|
+
* @param eventName: string
|
|
2317
|
+
* @param data: any
|
|
2318
|
+
*/
|
|
2319
|
+
callBootpayDOMEvent(e, t = void 0) {
|
|
2320
|
+
document.dispatchEvent(
|
|
2321
|
+
new CustomEvent(
|
|
2322
|
+
[this.$eventPrefix, e].join(""),
|
|
2323
|
+
{ detail: t }
|
|
2324
|
+
)
|
|
2325
|
+
);
|
|
2326
|
+
}
|
|
2327
|
+
/**
|
|
2328
|
+
* Polling Event를 시작한다
|
|
2329
|
+
* Comment by GOSOMI
|
|
2330
|
+
* @date: 2021-12-29
|
|
2331
|
+
*/
|
|
2332
|
+
startPollingEvent() {
|
|
2333
|
+
this.$pollingInterval = setInterval(async () => {
|
|
2334
|
+
if (this.$pollingData !== void 0)
|
|
2335
|
+
try {
|
|
2336
|
+
const e = await this.$pollingEvent.pollingStatus(
|
|
2337
|
+
this.$pollingData.gatewayUrl,
|
|
2338
|
+
this.$pollingData.receiptId,
|
|
2339
|
+
this.$pollingData.applicationId,
|
|
2340
|
+
this.$pollingData.transactionKey
|
|
2341
|
+
);
|
|
2342
|
+
this.handlePollingResponse(e);
|
|
2343
|
+
} catch {
|
|
2344
|
+
return this.reject({
|
|
2345
|
+
error_code: "RC_RECEIPT_POLLING_INVALID",
|
|
2346
|
+
message: "결제 상태 체크에 실패하였습니다."
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
}, this.pollingInterval);
|
|
2350
|
+
}
|
|
2351
|
+
/**
|
|
2352
|
+
* Polling Event를 초기화한다
|
|
2353
|
+
* Comment by GOSOMI
|
|
2354
|
+
* @date: 2021-12-29
|
|
2355
|
+
*/
|
|
2356
|
+
clearPollingEvent() {
|
|
2357
|
+
this.$pollingInterval !== void 0 && clearInterval(this.$pollingInterval), this.$pollingInterval = void 0, this.resetPollingData();
|
|
2358
|
+
}
|
|
2359
|
+
/**
|
|
2360
|
+
* PostMessage bind 이벤트 모두 삭제하기
|
|
2361
|
+
* Comment by GOSOMI
|
|
2362
|
+
* @date: 2023-04-18
|
|
2363
|
+
*/
|
|
2364
|
+
allClearEvent() {
|
|
2365
|
+
this.clearPollingEvent(), window.removeBootpayEventListener(this.$messageEventName);
|
|
2366
|
+
}
|
|
2367
|
+
/**
|
|
2368
|
+
* 공통 에러/취소 처리 메서드
|
|
2369
|
+
* Comment by GOSOMI
|
|
2370
|
+
* @date: 2024-01-01
|
|
2371
|
+
*/
|
|
2372
|
+
handleErrorOrCancel(e) {
|
|
2373
|
+
return this.reject({
|
|
2374
|
+
event: e.event,
|
|
2375
|
+
pg_error_code: e.pg_error_code,
|
|
2376
|
+
error_code: e.error_code,
|
|
2377
|
+
message: e.message,
|
|
2378
|
+
payload: e.payload
|
|
2379
|
+
});
|
|
2380
|
+
}
|
|
2381
|
+
/**
|
|
2382
|
+
* 공통 진행상태 업데이트 처리 메서드
|
|
2383
|
+
* Comment by GOSOMI
|
|
2384
|
+
* @date: 2024-01-01
|
|
2385
|
+
*/
|
|
2386
|
+
handleProgressUpdate(e) {
|
|
2387
|
+
switch (e.event) {
|
|
2388
|
+
case "hideProgress":
|
|
2389
|
+
Q.hideProgress();
|
|
2390
|
+
break;
|
|
2391
|
+
case "showProgress":
|
|
2392
|
+
O.showProgress(e.message);
|
|
2393
|
+
break;
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
/**
|
|
2397
|
+
* 공통 스타일 업데이트 처리 메서드
|
|
2398
|
+
* Comment by GOSOMI
|
|
2399
|
+
* @date: 2024-01-01
|
|
2400
|
+
*/
|
|
2401
|
+
handleStyleUpdate(e) {
|
|
2402
|
+
switch (e.event) {
|
|
2403
|
+
case "iFrameStyle":
|
|
2404
|
+
O.iFrameSetStyle(e.styles);
|
|
2405
|
+
break;
|
|
2406
|
+
case "windowStyle":
|
|
2407
|
+
O.windowStyle(e.styles);
|
|
2408
|
+
break;
|
|
2409
|
+
case "resize":
|
|
2410
|
+
O.iFrameResize(e.resizeData);
|
|
2411
|
+
break;
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
/**
|
|
2415
|
+
* 공통 표시상태 처리 메서드
|
|
2416
|
+
* Comment by GOSOMI
|
|
2417
|
+
* @date: 2024-01-01
|
|
2418
|
+
*/
|
|
2419
|
+
handleVisibilityUpdate(e) {
|
|
2420
|
+
switch (e.event) {
|
|
2421
|
+
case "hidePayment":
|
|
2422
|
+
O.closePopup(), O.hidePaymentiFrame();
|
|
2423
|
+
break;
|
|
2424
|
+
case "showPayment":
|
|
2425
|
+
O.showPaymentiFrame(this.$present(e.showCloseButton) ? e.showCloseButton : !1);
|
|
2426
|
+
break;
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
* polling 응답 처리 헬퍼 메서드
|
|
2431
|
+
* Comment by GOSOMI
|
|
2432
|
+
* @date: 2024-01-01
|
|
2433
|
+
*/
|
|
2434
|
+
handlePollingResponse(e) {
|
|
2435
|
+
let t = {
|
|
2436
|
+
bootpay_event: !0,
|
|
2437
|
+
event: "",
|
|
2438
|
+
data: e.data
|
|
2439
|
+
};
|
|
2440
|
+
if (e.data !== void 0) {
|
|
2441
|
+
if (R.debug("polling event", `receive data: ${JSON.stringify(t)}`), e.data.status === 1)
|
|
2442
|
+
return t.event = "done", window.postMessage(JSON.stringify(t), "*");
|
|
2443
|
+
if (e.data.status === 5)
|
|
2444
|
+
return t.event = "issued", window.postMessage(JSON.stringify(t), "*");
|
|
2445
|
+
}
|
|
2446
|
+
}
|
|
2447
|
+
/**
|
|
2448
|
+
* polling 데이터 초기화 헬퍼 메서드
|
|
2449
|
+
* Comment by GOSOMI
|
|
2450
|
+
* @date: 2024-01-01
|
|
2451
|
+
*/
|
|
2452
|
+
resetPollingData() {
|
|
2453
|
+
this.$pollingData = {
|
|
2454
|
+
applicationId: "",
|
|
2455
|
+
gatewayUrl: "",
|
|
2456
|
+
receiptId: "",
|
|
2457
|
+
transactionKey: ""
|
|
2458
|
+
};
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
const K = new mt();
|
|
2462
|
+
class vt extends ae {
|
|
2463
|
+
constructor() {
|
|
2464
|
+
super(), this.$session = ne, this.$applicationId = void 0, this.$tk = void 0, this.$platformType = 1, this.$receiptId = void 0;
|
|
2465
|
+
}
|
|
2466
|
+
/**
|
|
2467
|
+
* Token키를 설정
|
|
2468
|
+
* Comment by GOSOMI
|
|
2469
|
+
* @date: 2021-05-20
|
|
2470
|
+
* @param tokenKey: string
|
|
2471
|
+
* @returns void
|
|
2472
|
+
*/
|
|
2473
|
+
setTokenKey(e) {
|
|
2474
|
+
this.$tk = e;
|
|
2475
|
+
}
|
|
2476
|
+
setReceiptId(e) {
|
|
2477
|
+
this.$receiptId = e;
|
|
2478
|
+
}
|
|
2479
|
+
clearInstance() {
|
|
2480
|
+
this.$applicationId = void 0, this.$receiptId = void 0;
|
|
2481
|
+
}
|
|
2482
|
+
send(e) {
|
|
2483
|
+
try {
|
|
2484
|
+
if (M(this.$applicationId))
|
|
2485
|
+
return e.application_id = this.$applicationId, e.status = M(e.status) ? e.status : 1, e.version = re.version, e.tk = this.$tk, R.debug("send event", `${JSON.stringify(e)} 전송됨`), this.$http.post(
|
|
2486
|
+
U.toAnalytics("event"),
|
|
2487
|
+
e
|
|
2488
|
+
);
|
|
2489
|
+
} catch {
|
|
2490
|
+
return;
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
sendError(e) {
|
|
2494
|
+
e.status = -1, this.send(e);
|
|
2495
|
+
}
|
|
2496
|
+
setApplicationId(e) {
|
|
2497
|
+
this.$applicationId = e;
|
|
2498
|
+
}
|
|
2499
|
+
/**
|
|
2500
|
+
* 결제창 닫기 이벤트를 전송한다
|
|
2501
|
+
* Comment by GOSOMI
|
|
2502
|
+
* @date: 2022-05-13
|
|
2503
|
+
*/
|
|
2504
|
+
sendCloseEvent() {
|
|
2505
|
+
if (M(this.$receiptId))
|
|
2506
|
+
try {
|
|
2507
|
+
return this.$http.put(U.toApi(`close/${this.$receiptId}`));
|
|
2508
|
+
} catch (e) {
|
|
2509
|
+
return Promise.reject(e);
|
|
2510
|
+
}
|
|
2511
|
+
else
|
|
2512
|
+
return R.debug("receipt_id", "undefined receipt_id"), Promise.resolve();
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
const te = new vt(), Ue = {
|
|
2516
|
+
startProgress: {
|
|
2517
|
+
PAYMENT: {
|
|
2518
|
+
ko: "결제를 시작합니다",
|
|
2519
|
+
en: "Start Payment..."
|
|
2520
|
+
},
|
|
2521
|
+
CARD_SUBSCRIPTION: {
|
|
2522
|
+
ko: "자동결제 정보를 불러오는 중입니다...",
|
|
2523
|
+
en: "Automatic payment will start..."
|
|
2524
|
+
},
|
|
2525
|
+
AUTH: {
|
|
2526
|
+
ko: "본인인증을 시작합니다",
|
|
2527
|
+
en: "Authentication will start..."
|
|
2528
|
+
}
|
|
2529
|
+
},
|
|
2530
|
+
popupLocaleMessage: {
|
|
2531
|
+
message: {
|
|
2532
|
+
ko: "구매 내역에 동의하면 결제를 진행해주세요",
|
|
2533
|
+
en: "If you agree with the purchase details, please proceed with the payment."
|
|
2534
|
+
},
|
|
2535
|
+
button: {
|
|
2536
|
+
ko: "결제계속하기",
|
|
2537
|
+
en: "Continue"
|
|
2538
|
+
}
|
|
2539
|
+
},
|
|
2540
|
+
popupMessage: {
|
|
2541
|
+
message: {
|
|
2542
|
+
PAYMENT: {
|
|
2543
|
+
ko: "구매 내역에 동의하면 결제를 진행해주세요",
|
|
2544
|
+
en: "If you agree with the purchase details, please proceed with the payment"
|
|
2545
|
+
},
|
|
2546
|
+
CARD_SUBSCRIPTION: {
|
|
2547
|
+
ko: '자동결제에 동의하면 "계속하기" 버튼을 눌러 진행해주세요',
|
|
2548
|
+
en: 'If you agree to automatic card payment, press the "Continue" button to proceed'
|
|
2549
|
+
},
|
|
2550
|
+
AUTH: {
|
|
2551
|
+
ko: '본인인증에 동의하면 "계속하기" 버튼을 눌러 진행해주세요',
|
|
2552
|
+
en: 'If you agree to authenticate yourself, press the "Continue" button to proceed'
|
|
2553
|
+
}
|
|
2554
|
+
},
|
|
2555
|
+
button: {
|
|
2556
|
+
PAYMENT: {
|
|
2557
|
+
ko: "결제계속하기",
|
|
2558
|
+
en: "Continue"
|
|
2559
|
+
},
|
|
2560
|
+
CARD_SUBSCRIPTION: {
|
|
2561
|
+
ko: "계속하기",
|
|
2562
|
+
en: "Continue"
|
|
2563
|
+
},
|
|
2564
|
+
AUTH: {
|
|
2565
|
+
ko: "계속하기",
|
|
2566
|
+
en: "Continue"
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
},
|
|
2570
|
+
// 팝업이 처음 차단됐을 때 「계속하기」 안내창에 대신 보여줄 문구
|
|
2571
|
+
popupBlocked: {
|
|
2572
|
+
PAYMENT: {
|
|
2573
|
+
ko: '팝업이 차단되었습니다. 브라우저에서 팝업을 허용한 뒤 "결제계속하기"를 다시 눌러주세요',
|
|
2574
|
+
en: 'The pop-up was blocked. Allow pop-ups in your browser, then press "Continue" again'
|
|
2575
|
+
},
|
|
2576
|
+
CARD_SUBSCRIPTION: {
|
|
2577
|
+
ko: '팝업이 차단되었습니다. 브라우저에서 팝업을 허용한 뒤 "계속하기"를 다시 눌러주세요',
|
|
2578
|
+
en: 'The pop-up was blocked. Allow pop-ups in your browser, then press "Continue" again'
|
|
2579
|
+
},
|
|
2580
|
+
AUTH: {
|
|
2581
|
+
ko: '팝업이 차단되었습니다. 브라우저에서 팝업을 허용한 뒤 "계속하기"를 다시 눌러주세요',
|
|
2582
|
+
en: 'The pop-up was blocked. Allow pop-ups in your browser, then press "Continue" again'
|
|
2583
|
+
}
|
|
2584
|
+
},
|
|
2585
|
+
// 다시 눌러도 차단돼서 RC_POPUP_BLOCKED 로 끝낼 때의 메세지
|
|
2586
|
+
popupBlockedError: {
|
|
2587
|
+
PAYMENT: {
|
|
2588
|
+
ko: "팝업이 차단되어 결제창을 열지 못했습니다",
|
|
2589
|
+
en: "The payment window could not be opened because the pop-up was blocked"
|
|
2590
|
+
},
|
|
2591
|
+
CARD_SUBSCRIPTION: {
|
|
2592
|
+
ko: "팝업이 차단되어 자동결제 창을 열지 못했습니다",
|
|
2593
|
+
en: "The automatic payment window could not be opened because the pop-up was blocked"
|
|
2594
|
+
},
|
|
2595
|
+
AUTH: {
|
|
2596
|
+
ko: "팝업이 차단되어 본인인증 창을 열지 못했습니다",
|
|
2597
|
+
en: "The authentication window could not be opened because the pop-up was blocked"
|
|
2598
|
+
}
|
|
2599
|
+
},
|
|
2600
|
+
closeMessage: {
|
|
2601
|
+
PAYMENT: {
|
|
2602
|
+
ko: "결제창을 닫았습니다",
|
|
2603
|
+
en: "Payment window is closed"
|
|
2604
|
+
},
|
|
2605
|
+
CARD_SUBSCRIPTION: {
|
|
2606
|
+
ko: "자동 결제창을 닫았습니다",
|
|
2607
|
+
en: "Automatic Payment window is closed"
|
|
2608
|
+
},
|
|
2609
|
+
AUTH: {
|
|
2610
|
+
ko: "본인인증 창을 닫았습니다",
|
|
2611
|
+
en: "Authenticate window is closed"
|
|
2612
|
+
}
|
|
2613
|
+
},
|
|
2614
|
+
confirmNotYet: {
|
|
2615
|
+
PAYMENT: {
|
|
2616
|
+
ko: "결제 승인준비가 되지 않았습니다",
|
|
2617
|
+
en: "Payment approval not ready "
|
|
2618
|
+
},
|
|
2619
|
+
CARD_SUBSCRIPTION: {
|
|
2620
|
+
ko: "자동결제 승인준비가 되지 않았습니다",
|
|
2621
|
+
en: "Automatic Payment approval not ready"
|
|
2622
|
+
},
|
|
2623
|
+
AUTH: {
|
|
2624
|
+
ko: "본인인증 승인준비가 되지 않았습니다",
|
|
2625
|
+
en: "Authenticate approval not ready"
|
|
2626
|
+
}
|
|
2627
|
+
},
|
|
2628
|
+
notSelectPayment: {
|
|
2629
|
+
ko: "어떤 방법으로 결제할지 선택해주세요",
|
|
2630
|
+
en: "Please, do select payment."
|
|
2631
|
+
},
|
|
2632
|
+
termsNotAgree: {
|
|
2633
|
+
ko: "필수 약관을 모두 동의해주세요",
|
|
2634
|
+
en: "Please agree to all required terms and conditions"
|
|
2635
|
+
},
|
|
2636
|
+
notSelectBrandpay: {
|
|
2637
|
+
ko: "간편결제로 결제하려면, 등록된 카드 혹은 계좌를 선택해주세요",
|
|
2638
|
+
en: "Please select a registered card or account to pay with Easy Payment"
|
|
2639
|
+
},
|
|
2640
|
+
widgetTypeNotPayment: {
|
|
2641
|
+
ko: "결제 위젯 요청이 아닙니다. 결제 위젯이 아닌 경우 requestSubscription 함수를 이용해주세요.",
|
|
2642
|
+
en: "This is not a payment widget. If it is not a payment widget, use the requestSubscription function."
|
|
2643
|
+
},
|
|
2644
|
+
widgetTypeNotSubscription: {
|
|
2645
|
+
ko: "정기결제 위젯 요청이 아닙니다. 정기결제 위젯이 아닌 경우 requestPayment 함수를 이용해주세요.",
|
|
2646
|
+
en: "This is not a subscription widget. If it is not a subscription widget, use the requestPayment function."
|
|
2647
|
+
},
|
|
2648
|
+
getLocaleMessage: (s, e) => {
|
|
2649
|
+
const r = s.split(".").reduce((i, c) => i[c], Ue);
|
|
2650
|
+
return M(r) && M(r[e]) ? r[e] : r.ko;
|
|
2651
|
+
}
|
|
2652
|
+
};
|
|
2653
|
+
class gt extends be {
|
|
2654
|
+
constructor() {
|
|
2655
|
+
super(), this.mode = "PAYMENT", this.modeApiUrl = {
|
|
2656
|
+
PAYMENT: "request/payment",
|
|
2657
|
+
CARD_SUBSCRIPTION: "request/subscribe",
|
|
2658
|
+
AUTH: "request/authentication"
|
|
2659
|
+
}, 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.$popupMessageId = "bootpay-popup-message-id", this.$popup = void 0, this.$popupWatcher = void 0, this.$popupBlocked = !1, this.$popupUrl = void 0, this.$env = U, this.$template = this.template();
|
|
2660
|
+
}
|
|
2661
|
+
template() {
|
|
2662
|
+
return `
|
|
2663
|
+
<div id="${this.$windowId}" class="bootpay-payment-background">
|
|
2664
|
+
<div class="bootpay-payment-window ${U.isMobile() ? "__mobile" : ""}" id="${this.$paymentWindowId}">
|
|
2665
|
+
<button class="bootpay-close-btn" id="${this.$closeButton}" style="display: none;" onclick="Bootpay.dismiss()"></button>
|
|
2666
|
+
<form id="${this.$formId}" method="POST">
|
|
2667
|
+
</form>
|
|
2668
|
+
<iframe id="${this.$iFrameId}" name="${this.$iFrameId}" allow="${at}"></iframe>
|
|
2669
|
+
<div class="bootpay-popup-window" id="${this.$popupWindow}">
|
|
2670
|
+
<div class="header">
|
|
2671
|
+
<button type="button" class="bootpay-close-btn" aria-label="close" onclick="Bootpay.dismiss(true)"></button>
|
|
2672
|
+
</div>
|
|
2673
|
+
<div class="body">
|
|
2674
|
+
<h5 id="${this.$popupItemNameId}"></h5>
|
|
2675
|
+
<p class="price" id="${this.$popupPriceId}"></p>
|
|
2676
|
+
<div class="agree-text">
|
|
2677
|
+
<svg viewBox="0 0 20 20" fill="none" aria-hidden="true"><circle cx="10" cy="10" r="8.25" stroke="currentColor" stroke-width="1.5"/><path d="M6.5 10.25l2.25 2.25 4.75-4.75" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
2678
|
+
<span id="${this.$popupMessageId}">${this.message("popupMessage.message")}</span>
|
|
2679
|
+
</div>
|
|
2680
|
+
</div>
|
|
2681
|
+
<div class="footer">
|
|
2682
|
+
<button type="button" class="bootpay-button" onclick="Bootpay.readyToPopup()">
|
|
2683
|
+
${this.message("popupMessage.button")}
|
|
2684
|
+
</button>
|
|
2685
|
+
</div>
|
|
2686
|
+
</div>
|
|
2687
|
+
</div>
|
|
2688
|
+
<div class="bootpay-confirm-form">
|
|
2689
|
+
<form id="${this.$confirmFormId}" method="POST">
|
|
2690
|
+
<input type="hidden" name="_method" value="put" />
|
|
2691
|
+
</form>
|
|
2692
|
+
<iframe id="${this.$confirmIFrame}" name="${this.$confirmIFrame}" style="height:0; width: 0; border: 0; outline: 0;" frameborder="0"></iframe>
|
|
2693
|
+
</div>
|
|
2694
|
+
</div>
|
|
2695
|
+
`;
|
|
2696
|
+
}
|
|
2697
|
+
/**
|
|
2698
|
+
* Locale을 설정
|
|
2699
|
+
* Comment by GOSOMI
|
|
2700
|
+
* @date: 2022-06-09
|
|
2701
|
+
*/
|
|
2702
|
+
templateReload() {
|
|
2703
|
+
R.debug("template reload", "template reload!"), this.$template = this.template();
|
|
2704
|
+
}
|
|
2705
|
+
/**
|
|
2706
|
+
* 결제를 시작한다
|
|
2707
|
+
* Comment by GOSOMI
|
|
2708
|
+
* @date: 2021-05-12
|
|
2709
|
+
* @param data: any
|
|
2710
|
+
* @param mode: string
|
|
2711
|
+
* @returns Promise<any>
|
|
2712
|
+
*/
|
|
2713
|
+
async start(e, t = "PAYMENT") {
|
|
2714
|
+
return new Promise((r, i) => {
|
|
2715
|
+
var w, B;
|
|
2716
|
+
this.initializePayment(t, r, i, e.application_id, e.tk), this.$themeColor = ((w = e.extra) == null ? void 0 : w.theme_color) ?? ((B = e.extra) == null ? void 0 : B.themeColor), this.createTemplateHtml(), this.bodyOpen(), this.showProgress(this.message("startProgress"));
|
|
2717
|
+
const c = ae.encryptParams(ae.objectKeyToUnderscore(e));
|
|
2718
|
+
this.setupForm(c, this.$env.toApi(this.apiUrl()));
|
|
2719
|
+
const x = this.byId(this.$formId);
|
|
2720
|
+
this.$present(e.extra) && e.extra.popup, x.target = this.$iFrameId, x.submit();
|
|
2721
|
+
});
|
|
2722
|
+
}
|
|
2723
|
+
/**
|
|
2724
|
+
* 결제 승인을 위한 form 데이터를 미리 만들어둔다
|
|
2725
|
+
* Comment by GOSOMI
|
|
2726
|
+
* @date: 2021-05-20
|
|
2727
|
+
* @param url: string
|
|
2728
|
+
* @returns void
|
|
2729
|
+
*/
|
|
2730
|
+
setConfirmFormUrl(e) {
|
|
2731
|
+
const t = this.byId(this.$confirmIFrame), r = this.byId(this.$confirmFormId);
|
|
2732
|
+
t.style.setProperty("display", "block"), r.target = this.$confirmIFrame, r.action = e;
|
|
2733
|
+
}
|
|
2734
|
+
/**
|
|
2735
|
+
* 결제 승인시 redirect 인 경우 _self target으로 설정한다
|
|
2736
|
+
* Comment by GOSOMI
|
|
2737
|
+
* @date: 2024-06-12
|
|
2738
|
+
*/
|
|
2739
|
+
setConfirmRedirect(e) {
|
|
2740
|
+
const t = this.byId(this.$confirmFormId);
|
|
2741
|
+
t.target = "_self", t.action = e;
|
|
2742
|
+
}
|
|
2743
|
+
/**
|
|
2744
|
+
* 결제 승인
|
|
2745
|
+
* Comment by GOSOMI
|
|
2746
|
+
* @date: 2021-05-20
|
|
2747
|
+
*/
|
|
2748
|
+
confirm() {
|
|
2749
|
+
return new Promise((e, t) => {
|
|
2750
|
+
K.bind(e, t);
|
|
2751
|
+
const r = this.byId(this.$confirmFormId);
|
|
2752
|
+
if (this.$blank(r.action))
|
|
2753
|
+
throw new W({
|
|
2754
|
+
event: "error",
|
|
2755
|
+
error_code: "RC_CONFIRM_READY_NOT_YET",
|
|
2756
|
+
message: this.message("confirmNotYet")
|
|
2757
|
+
});
|
|
2758
|
+
r.submit();
|
|
2759
|
+
});
|
|
2760
|
+
}
|
|
2761
|
+
/**
|
|
2762
|
+
* REST API 받은 결제 URL을 실행한다
|
|
2763
|
+
* Comment by GOSOMI
|
|
2764
|
+
* @date: 2023-04-13
|
|
2765
|
+
*/
|
|
2766
|
+
async startPaymentUrl(e, t = "PAYMENT") {
|
|
2767
|
+
return new Promise((r, i) => {
|
|
2768
|
+
this.initializePayment(t, r, i), this.$themeColor = void 0, this.showProgress(this.message("startProgress")), this.createTemplateHtml(), this.bodyOpen(), this.setupFormForUrl(e), this.byId(this.$formId).submit();
|
|
2769
|
+
});
|
|
2770
|
+
}
|
|
2771
|
+
/**
|
|
2772
|
+
* 팝업창을 띄우기 위한 준비
|
|
2773
|
+
* Comment by GOSOMI
|
|
2774
|
+
* @date: 2021-05-12
|
|
2775
|
+
* @returns void
|
|
2776
|
+
*/
|
|
2777
|
+
createPopupButton(e) {
|
|
2778
|
+
Q.hideProgress(), this.hidePaymentiFrame(), this.$popupBlocked = !1, this.showPopupMessage(e), this.$present(e.gatewayUrl) && (this.$popupUrl = `${e.gatewayUrl}?popup=1`, te.setReceiptId(e.receiptId));
|
|
2779
|
+
}
|
|
2780
|
+
/**
|
|
2781
|
+
* 팝업창을 띄운다
|
|
2782
|
+
* Comment by GOSOMI
|
|
2783
|
+
* @date: 2021-06-23
|
|
2784
|
+
*/
|
|
2785
|
+
readyToPopup(e = void 0) {
|
|
2786
|
+
this.hidePopupMessage(), this.closePopup();
|
|
2787
|
+
const t = "width=750,height=500,top=0,left=0,scrollbars=yes,directories=no, status=no, menubar=no, fullscreen=no";
|
|
2788
|
+
if (this.$popup = window.open(this.getPopupUrl(e), "BootPayPopupInstance", t), this.$popup === null || this.$popup === void 0) {
|
|
2789
|
+
this.$popup = void 0, this.handlePopupBlocked();
|
|
2790
|
+
return;
|
|
2791
|
+
}
|
|
2792
|
+
this.$popupBlocked = !1, this.$popupWatcher = setInterval(async () => {
|
|
2793
|
+
if (!this.isPopupOpened()) {
|
|
2794
|
+
try {
|
|
2795
|
+
clearInterval(this.$popupWatcher), await te.sendCloseEvent();
|
|
2796
|
+
} catch (r) {
|
|
2797
|
+
R.debug("popup", ee(r));
|
|
2798
|
+
}
|
|
2799
|
+
return this.$popupUrl = void 0, K.reject({
|
|
2800
|
+
event: "cancel",
|
|
2801
|
+
error_code: "RC_CLOSE_WINDOW",
|
|
2802
|
+
message: this.message("closeMessage")
|
|
2803
|
+
});
|
|
2804
|
+
}
|
|
2805
|
+
}, 500), this.bindParentEventOnPopup();
|
|
2806
|
+
}
|
|
2807
|
+
/**
|
|
2808
|
+
* 팝업이 차단됐을 때
|
|
2809
|
+
* 처음에는 「계속하기」 안내창을 차단 안내 문구로 다시 띄워 팝업을 허용한 뒤 다시 누를 수 있게 한다
|
|
2810
|
+
* 그래도 차단되면 RC_POPUP_BLOCKED 로 끝낸다 — 사용자가 닫은 RC_CLOSE_WINDOW 와 구분해 가맹점이 안내를 달리할 수 있게 한다
|
|
2811
|
+
* Comment by GOSOMI
|
|
2812
|
+
* @date: 2026-11-06
|
|
2813
|
+
*/
|
|
2814
|
+
handlePopupBlocked() {
|
|
2815
|
+
if (R.warn("popup", "popup blocked"), !this.$popupBlocked) {
|
|
2816
|
+
this.$popupBlocked = !0, this.showPopupBlockedMessage();
|
|
2817
|
+
return;
|
|
2818
|
+
}
|
|
2819
|
+
this.$popupBlocked = !1, this.$popupUrl = void 0, te.sendCloseEvent().catch((e) => R.debug("popup", ee(e))).then(() => K.reject({
|
|
2820
|
+
event: "error",
|
|
2821
|
+
error_code: "RC_POPUP_BLOCKED",
|
|
2822
|
+
message: this.message("popupBlockedError")
|
|
2823
|
+
}));
|
|
2824
|
+
}
|
|
2825
|
+
/**
|
|
2826
|
+
* 「계속하기」 안내창을 팝업 차단 안내 문구로 바꿔 다시 보여준다
|
|
2827
|
+
* Comment by GOSOMI
|
|
2828
|
+
* @date: 2026-11-06
|
|
2829
|
+
*/
|
|
2830
|
+
showPopupBlockedMessage() {
|
|
2831
|
+
var r, i;
|
|
2832
|
+
const e = this.byId(this.$popupWindow), t = this.byId(this.$popupMessageId);
|
|
2833
|
+
t !== null && (t.innerText = this.message("popupBlocked"), (i = (r = t.parentElement) == null ? void 0 : r.querySelector("svg")) == null || i.style.setProperty("display", "none")), e == null || e.style.setProperty("display", "block");
|
|
2834
|
+
}
|
|
2835
|
+
/**
|
|
2836
|
+
* 팝업창이 열려 있는지 — 차단되어 null 인 경우도 닫힌 것으로 본다
|
|
2837
|
+
* Comment by GOSOMI
|
|
2838
|
+
* @date: 2026-11-06
|
|
2839
|
+
*/
|
|
2840
|
+
isPopupOpened() {
|
|
2841
|
+
return this.$popup !== null && this.$popup !== void 0 && !this.$popup.closed;
|
|
2842
|
+
}
|
|
2843
|
+
/**
|
|
2844
|
+
* 팝업창을 닫는다
|
|
2845
|
+
* Comment by GOSOMI
|
|
2846
|
+
* @date: 2021-05-12
|
|
2847
|
+
* @returns void
|
|
2848
|
+
*/
|
|
2849
|
+
closePopup() {
|
|
2850
|
+
if (this.$popupWatcher !== void 0)
|
|
2851
|
+
try {
|
|
2852
|
+
clearInterval(this.$popupWatcher), R.debug("close popup", "clear popup interval");
|
|
2853
|
+
} catch (e) {
|
|
2854
|
+
R.info("clear popup watcher", ee(e));
|
|
2855
|
+
}
|
|
2856
|
+
if (this.isPopupOpened())
|
|
2857
|
+
try {
|
|
2858
|
+
this.$popup.close(), R.debug("close popup", "close popup instance");
|
|
2859
|
+
} catch (e) {
|
|
2860
|
+
R.info("popup destroy", ee(e));
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
/**
|
|
2864
|
+
* POPUP url 정보를 가져온다
|
|
2865
|
+
* Comment by GOSOMI
|
|
2866
|
+
* @date: 2021-06-23
|
|
2867
|
+
* @param url: string | undefined
|
|
2868
|
+
* @returns string
|
|
2869
|
+
*/
|
|
2870
|
+
getPopupUrl(e) {
|
|
2871
|
+
return this.$present(e) ? e : this.$present(this.$popupUrl) ? this.$popupUrl : "about:blank";
|
|
2872
|
+
}
|
|
2873
|
+
/**
|
|
2874
|
+
* Popup 이후 Parent 페이지 이동 관련 이벤트 컨트롤
|
|
2875
|
+
* Comment by GOSOMI
|
|
2876
|
+
* @date: 2021-06-23
|
|
2877
|
+
*/
|
|
2878
|
+
bindParentEventOnPopup() {
|
|
2879
|
+
let e = "beforeunload.BootpayReloadWatcher";
|
|
2880
|
+
U.isMobileSafari() && (e = "pagehide.BootpayReloadWatcher"), window.resetBootpayEventListener(e, () => {
|
|
2881
|
+
if (this.isPopupOpened())
|
|
2882
|
+
try {
|
|
2883
|
+
this.$popup.close();
|
|
2884
|
+
} catch (t) {
|
|
2885
|
+
R.info("popup destroy", ee(t));
|
|
2886
|
+
}
|
|
2887
|
+
});
|
|
2888
|
+
}
|
|
2889
|
+
/**
|
|
2890
|
+
* iFrame 결제창을 보여준다
|
|
2891
|
+
* Comment by GOSOMI
|
|
2892
|
+
* @date: 2021-05-12
|
|
2893
|
+
* @returns void
|
|
2894
|
+
*/
|
|
2895
|
+
showPaymentiFrame(e = !1) {
|
|
2896
|
+
const t = this.byId(this.$iFrameId), r = this.byId(this.$closeButton);
|
|
2897
|
+
t !== void 0 && t.style.setProperty("display", "block"), r !== void 0 && e && r.style.setProperty("display", "inline-block");
|
|
2898
|
+
}
|
|
2899
|
+
/**
|
|
2900
|
+
* 팝업 안내 메세지를 보여준다
|
|
2901
|
+
* Comment by GOSOMI
|
|
2902
|
+
* @date: 2021-06-23
|
|
2903
|
+
* @returns void
|
|
2904
|
+
*/
|
|
2905
|
+
showPopupMessage(e) {
|
|
2906
|
+
const t = this.byId(this.$popupWindow), r = this.byId(this.$popupItemNameId), i = this.byId(this.$popupPriceId);
|
|
2907
|
+
if (t !== void 0 && (this.applyPopupThemeColor(t), t.style.setProperty("display", "block")), r !== void 0 && (r.innerText = e.name), i !== void 0) {
|
|
2908
|
+
const c = String(e.price ?? ""), x = c.match(/\d[\d,]*(\.\d+)?/);
|
|
2909
|
+
if (x !== null && parseFloat(x[0].replace(/,/g, "")) > 0) {
|
|
2910
|
+
const [w, B] = x[0].replace(/,/g, "").split("."), n = w.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + (B !== void 0 ? `.${B}` : "");
|
|
2911
|
+
i.innerText = c.replace(x[0], n);
|
|
2912
|
+
} else
|
|
2913
|
+
i.remove();
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
/**
|
|
2917
|
+
* 팝업 안내 창에 결제 요청 extra.theme_color 를 적용한다
|
|
2918
|
+
* 값이 없거나 CSS 색상이 아니면 common.sass 의 기본색(--bootpay-primary)을 쓴다
|
|
2919
|
+
*/
|
|
2920
|
+
applyPopupThemeColor(e) {
|
|
2921
|
+
const t = this.resolveRgb(this.$themeColor), r = ["--bootpay-popup-accent", "--bootpay-popup-accent-hover", "--bootpay-popup-accent-soft", "--bootpay-popup-accent-text", "--bootpay-popup-on-accent"];
|
|
2922
|
+
if (t === void 0) {
|
|
2923
|
+
r.forEach((n) => e.style.removeProperty(n));
|
|
2924
|
+
return;
|
|
2925
|
+
}
|
|
2926
|
+
const [i, c, x] = t, w = this.relativeLuminance(i, c, x) > 0.4, B = (n) => `rgb(${[i, c, x].map((I) => Math.round(I * n + 26 * (1 - n))).join(", ")})`;
|
|
2927
|
+
e.style.setProperty("--bootpay-popup-accent", `rgb(${i}, ${c}, ${x})`), e.style.setProperty("--bootpay-popup-accent-hover", B(0.88)), e.style.setProperty("--bootpay-popup-accent-soft", `rgba(${i}, ${c}, ${x}, 0.1)`), e.style.setProperty("--bootpay-popup-accent-text", B(w ? 0.45 : 0.7)), e.style.setProperty("--bootpay-popup-on-accent", w ? "#1a1a1a" : "#ffffff");
|
|
2928
|
+
}
|
|
2929
|
+
/**
|
|
2930
|
+
* CSS 색상 문자열을 [r, g, b] 로 변환한다 — 브라우저가 계산한 값을 읽으므로 hex/rgb/hsl/색상명 모두 지원한다
|
|
2931
|
+
*/
|
|
2932
|
+
resolveRgb(e) {
|
|
2933
|
+
if (typeof e != "string" || !CSS.supports("color", e))
|
|
2934
|
+
return;
|
|
2935
|
+
const t = document.createElement("span");
|
|
2936
|
+
t.style.setProperty("color", e), t.style.setProperty("display", "none"), document.body.appendChild(t);
|
|
2937
|
+
const r = (getComputedStyle(t).color.match(/[\d.]+/g) ?? []).map(Number);
|
|
2938
|
+
return t.remove(), r.length >= 3 ? r.slice(0, 3) : void 0;
|
|
2939
|
+
}
|
|
2940
|
+
/**
|
|
2941
|
+
* WCAG 상대 휘도 — 버튼 글자색(흰색/검정)을 고르는 데 쓴다
|
|
2942
|
+
*/
|
|
2943
|
+
relativeLuminance(e, t, r) {
|
|
2944
|
+
const [i, c, x] = [e, t, r].map((w) => {
|
|
2945
|
+
const B = w / 255;
|
|
2946
|
+
return B <= 0.03928 ? B / 12.92 : Math.pow((B + 0.055) / 1.055, 2.4);
|
|
2947
|
+
});
|
|
2948
|
+
return 0.2126 * i + 0.7152 * c + 0.0722 * x;
|
|
2949
|
+
}
|
|
2950
|
+
/**
|
|
2951
|
+
* 팝업 버튼 창을 닫는다
|
|
2952
|
+
* Comment by GOSOMI
|
|
2953
|
+
* @date: 2021-06-23
|
|
2954
|
+
*/
|
|
2955
|
+
hidePopupMessage() {
|
|
2956
|
+
this.byId(this.$popupWindow).style.setProperty("display", "none");
|
|
2957
|
+
}
|
|
2958
|
+
/**
|
|
2959
|
+
* 결제창을 삭제한다
|
|
2960
|
+
* Comment by GOSOMI
|
|
2961
|
+
* @date: 2021-05-12
|
|
2962
|
+
* @returns void
|
|
2963
|
+
*/
|
|
2964
|
+
destroy(e = !0) {
|
|
2965
|
+
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"), Q.hideProgress(), this.closePopup(), this.$popupBlocked = !1, K.allClearEvent(), te.clearInstance(), e && setTimeout(() => K.callBootpayDOMEvent("close"), 300);
|
|
2966
|
+
}
|
|
2967
|
+
/**
|
|
2968
|
+
* IFrame 창을 컨트롤한다
|
|
2969
|
+
* Comment by GOSOMI
|
|
2970
|
+
* @date: 2021-05-18
|
|
2971
|
+
*/
|
|
2972
|
+
iFrameResize(e) {
|
|
2973
|
+
const t = this.byId(this.$iFrameId);
|
|
2974
|
+
if (t !== void 0) {
|
|
2975
|
+
for (let r in e)
|
|
2976
|
+
if (String(e[r]).match(/%/) && !this.byId(this.$paymentWindowId).className.match(/w-100/)) {
|
|
2977
|
+
this.byId(this.$paymentWindowId).className += " w-100";
|
|
2978
|
+
break;
|
|
2979
|
+
}
|
|
2980
|
+
this.applyStylesToElement(t, e);
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
/**
|
|
2984
|
+
* iFrame Custom Style 추가
|
|
2985
|
+
* Comment by GOSOMI
|
|
2986
|
+
* @date: 2022-09-30
|
|
2987
|
+
*/
|
|
2988
|
+
iFrameSetStyle(e) {
|
|
2989
|
+
R.debug("change style", e);
|
|
2990
|
+
const t = this.byId(this.$iFrameId);
|
|
2991
|
+
this.safeApplyStyles(t, e, "iframe style");
|
|
2992
|
+
}
|
|
2993
|
+
/**
|
|
2994
|
+
* Window Style 정리
|
|
2995
|
+
* Comment by GOSOMI
|
|
2996
|
+
* @date: 2023-07-17
|
|
2997
|
+
*/
|
|
2998
|
+
windowStyle(e) {
|
|
2999
|
+
R.debug("change style", e);
|
|
3000
|
+
const t = this.byId(this.$paymentWindowId);
|
|
3001
|
+
this.safeApplyStyles(t, e, "window style");
|
|
3002
|
+
}
|
|
3003
|
+
/**
|
|
3004
|
+
* 안전한 스타일 적용 메서드
|
|
3005
|
+
* Comment by GOSOMI
|
|
3006
|
+
* @date: 2024-01-01
|
|
3007
|
+
*/
|
|
3008
|
+
safeApplyStyles(e, t, r) {
|
|
3009
|
+
for (let i in t)
|
|
3010
|
+
try {
|
|
3011
|
+
R.debug(i, t[i]), e.style.setProperty(i, t[i]);
|
|
3012
|
+
} catch (c) {
|
|
3013
|
+
R.warn(r, c == null ? void 0 : c.message);
|
|
3014
|
+
}
|
|
3015
|
+
}
|
|
3016
|
+
/**
|
|
3017
|
+
* 결제 iFrame창을 감춘다
|
|
3018
|
+
* Comment by GOSOMI
|
|
3019
|
+
* @date: 2021-05-20
|
|
3020
|
+
* @returns void
|
|
3021
|
+
*/
|
|
3022
|
+
hidePaymentiFrame() {
|
|
3023
|
+
const e = this.byId(this.$iFrameId), t = this.byId(this.$closeButton);
|
|
3024
|
+
e !== void 0 && e.style.setProperty("display", "none"), t !== void 0 && t.style.setProperty("display", "none");
|
|
3025
|
+
}
|
|
3026
|
+
/**
|
|
3027
|
+
* 출력할 메세지를 선택적으로 보여준다
|
|
3028
|
+
* Comment by GOSOMI
|
|
3029
|
+
* @date: 2021-10-28
|
|
3030
|
+
* @param messageType: string
|
|
3031
|
+
* @returns string
|
|
3032
|
+
*/
|
|
3033
|
+
message(e) {
|
|
3034
|
+
return Ue.getLocaleMessage(`${e}.${this.mode}`, U.locale);
|
|
3035
|
+
}
|
|
3036
|
+
/**
|
|
3037
|
+
* Iframe창의 URL로 이동한다
|
|
3038
|
+
* Comment by GOSOMI
|
|
3039
|
+
* @date: 2022-01-12
|
|
3040
|
+
*/
|
|
3041
|
+
moveToUrl(e) {
|
|
3042
|
+
const t = this.byId(this.$iFrameId);
|
|
3043
|
+
this.hidePaymentiFrame(), t.removeAttribute("style"), this.iFrameResize({
|
|
3044
|
+
width: U.isMobile() ? "100%" : 400,
|
|
3045
|
+
height: U.isMobile() ? "100%" : 700
|
|
3046
|
+
}), t.style.setProperty("display", "block"), t.src = e;
|
|
3047
|
+
}
|
|
3048
|
+
apiUrl() {
|
|
3049
|
+
return this.modeApiUrl[this.mode];
|
|
3050
|
+
}
|
|
3051
|
+
/**
|
|
3052
|
+
* Progress 창을 보여준다 — 결제 요청 extra.theme_color 가 있으면 로딩 점 색을 그 색으로 바꾼다
|
|
3053
|
+
* 값이 없거나 CSS 색상이 아니면 alfred-progress 기본색(--bootpay-progress-accent)을 쓴다
|
|
3054
|
+
*/
|
|
3055
|
+
showProgress(e) {
|
|
3056
|
+
Q.showProgress(e);
|
|
3057
|
+
const t = this.byId(Q.$alfredId);
|
|
3058
|
+
if (!t)
|
|
3059
|
+
return;
|
|
3060
|
+
const r = this.$themeColor;
|
|
3061
|
+
if (typeof r == "string" && CSS.supports("color", r)) {
|
|
3062
|
+
const i = CSS.supports("color", "color-mix(in srgb, red 50%, transparent)");
|
|
3063
|
+
t.style.setProperty("--bootpay-progress-accent", r), t.style.setProperty("--bootpay-progress-accent-light", i ? `color-mix(in srgb, ${r} 50%, transparent)` : r), t.style.setProperty("--bootpay-progress-accent-glow", i ? `color-mix(in srgb, ${r} 80%, transparent)` : r);
|
|
3064
|
+
} else
|
|
3065
|
+
t.style.removeProperty("--bootpay-progress-accent"), t.style.removeProperty("--bootpay-progress-accent-light"), t.style.removeProperty("--bootpay-progress-accent-glow");
|
|
3066
|
+
}
|
|
3067
|
+
/**
|
|
3068
|
+
* Form 설정 공통 메서드
|
|
3069
|
+
* Comment by GOSOMI
|
|
3070
|
+
* @date: 2024-01-01
|
|
3071
|
+
*/
|
|
3072
|
+
setupForm(e, t) {
|
|
3073
|
+
const r = this.byId(this.$formId);
|
|
3074
|
+
r.innerHTML = `
|
|
3075
|
+
<input type="hidden" name="payload" value="${e.payload}" />
|
|
3076
|
+
<input type="hidden" name="token" value="${e.token}" />
|
|
3077
|
+
`, r.action = t, r.target = this.$iFrameId;
|
|
3078
|
+
}
|
|
3079
|
+
/**
|
|
3080
|
+
* URL용 Form 설정 공통 메서드
|
|
3081
|
+
* Comment by GOSOMI
|
|
3082
|
+
* @date: 2024-01-01
|
|
3083
|
+
*/
|
|
3084
|
+
setupFormForUrl(e) {
|
|
3085
|
+
const t = this.byId(this.$formId);
|
|
3086
|
+
t.method = "GET", t.action = e, t.target = this.$iFrameId;
|
|
3087
|
+
}
|
|
3088
|
+
/**
|
|
3089
|
+
* 공통 초기화 및 설정
|
|
3090
|
+
* Comment by GOSOMI
|
|
3091
|
+
* @date: 2024-01-01
|
|
3092
|
+
*/
|
|
3093
|
+
initializePayment(e, t, r, i, c) {
|
|
3094
|
+
this.mode = e, this.templateReload(), K.clearPollingEvent(), K.bind(t, r), i && c && K.setDefaultPaymentData(i, c);
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
const O = new gt(), G = class G extends de {
|
|
3098
|
+
constructor() {
|
|
3099
|
+
super(), this.$session = ne, this.$logger = R, this.$event = te, this.platformType = H.PLATFORM.JS, this.$transactionKey = "", this.extra = {}, this.browserBootpayFilter = {
|
|
3100
|
+
instagram: /Instagram/i,
|
|
3101
|
+
kakaotalk: /KAKAOTALK/i,
|
|
3102
|
+
facebook: /FBAV/i,
|
|
3103
|
+
naver: /NAVER/i,
|
|
3104
|
+
mobile_safari: /(iPhone|iPad|iPod)/,
|
|
3105
|
+
mobile_chrome: [
|
|
3106
|
+
/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/,
|
|
3107
|
+
/Chrome/
|
|
3108
|
+
]
|
|
3109
|
+
};
|
|
3110
|
+
}
|
|
3111
|
+
/**
|
|
3112
|
+
* 결제 요청 진행하기
|
|
3113
|
+
* Comment by GOSOMI
|
|
3114
|
+
* @date: 2021-05-11
|
|
3115
|
+
* @param data: RequestPaymentModel
|
|
3116
|
+
* @returns Promise<any>
|
|
3117
|
+
*/
|
|
3118
|
+
async requestPayment(e) {
|
|
3119
|
+
var t;
|
|
3120
|
+
((t = e.extra) == null ? void 0 : t.locale) !== void 0 && !U.isSetLocale && U.setLocale(e.extra.locale), this.$event.clearInstance(), this.generateTransactionKey(), e.application_id = e.client_key === void 0 ? U.currentApplicationId(e.application_id) : null, this.$event.setTokenKey(this.$transactionKey), this.$event.setApplicationId(e.application_id), this.$event.send({
|
|
3121
|
+
step: "start",
|
|
3122
|
+
msg: "결제 요청 시작",
|
|
3123
|
+
request: e
|
|
3124
|
+
}), e.sdk = !0, e.platform_type = this.platformType, e.ver = U.packageVersion, e.sdk_version = U.sdkVersion, e.sdk_type = U.sdkName, e.locale = U.locale, e.price = parseFloat(String(e.price)), e.tax_free = parseFloat(String(e.tax_free)), e.deposit_price = parseFloat(String(e.deposit_price)), G.invalidRequestParamsData(e), G.invalidClientIdOrApplicationId(e), G.invalidRequestItemsData(e.items, e.price), e.uuid = this.$session.currentUserUUID(), e.sk = this.$session.currentSessionKey(), e.ti = this.$session.currentTimeTerm(), e.tk = this.$transactionKey, e.env = this.getUserDeviceEnvironment(), e.extra = this.openTypeFilter(e.extra), this.extra = e.extra;
|
|
3125
|
+
try {
|
|
3126
|
+
const r = await O.start(e);
|
|
3127
|
+
return R.debug("confirm ready", r), O.hidePaymentiFrame(), O.closePopup(), ["done", "issued"].indexOf(r.event) === -1 && this.$event.send({
|
|
3128
|
+
step: r.event,
|
|
3129
|
+
msg: "",
|
|
3130
|
+
request: e,
|
|
3131
|
+
response: r
|
|
3132
|
+
}), O.setConfirmFormUrl(
|
|
3133
|
+
`${r.gateway_url}/confirm/${r.receipt_id}?application_id=${r.application_id}`
|
|
3134
|
+
), Promise.resolve(r);
|
|
3135
|
+
} catch (r) {
|
|
3136
|
+
return this.eventError(r), Promise.reject(r);
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
/**
|
|
3140
|
+
* 결제 승인
|
|
3141
|
+
* Comment by GOSOMI
|
|
3142
|
+
* @date: 2021-05-20
|
|
3143
|
+
*/
|
|
3144
|
+
async confirm() {
|
|
3145
|
+
try {
|
|
3146
|
+
const e = await O.confirm();
|
|
3147
|
+
return Promise.resolve(e);
|
|
3148
|
+
} catch (e) {
|
|
3149
|
+
return this.eventError(e), Promise.reject(e);
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
3152
|
+
/**
|
|
3153
|
+
* 이벤트 완료 이벤트
|
|
3154
|
+
* Comment by GOSOMI
|
|
3155
|
+
* @date: 2021-07-12
|
|
3156
|
+
*/
|
|
3157
|
+
eventDone(e, t = !0) {
|
|
3158
|
+
var r;
|
|
3159
|
+
this.$logger.debug(e.event, e), this.$event.send({
|
|
3160
|
+
step: e.event,
|
|
3161
|
+
msg: e.event === "done" ? "결제완료" : "가상계좌발급완료",
|
|
3162
|
+
request: {},
|
|
3163
|
+
response: e
|
|
3164
|
+
}), Q.hideProgress(), this.$logger.debug("show result", this.isDisplaySuccessResult()), this.isDisplaySuccessResult() && t && ((r = e.data) == null ? void 0 : r.receipt_id) !== void 0 ? this.displayResultView(e.data.receipt_id) : O.destroy();
|
|
3165
|
+
}
|
|
3166
|
+
/**
|
|
3167
|
+
* 오류를 처리한다
|
|
3168
|
+
* Comment by GOSOMI
|
|
3169
|
+
* @date: 2022-01-12
|
|
3170
|
+
*/
|
|
3171
|
+
eventError(e) {
|
|
3172
|
+
Q.hideProgress(), O.closePopup(), this.isDisplayErrorResult() && e.event === "error" ? this.displayResultErrorView(e) : O.destroy(), this.$logger.debug("done failed destroy and hide", "payment"), this.$event.sendError({
|
|
3173
|
+
step: this.$present(e.event) ? e.event : "error",
|
|
3174
|
+
msg: e.message,
|
|
3175
|
+
trace: function() {
|
|
3176
|
+
try {
|
|
3177
|
+
return e.stack;
|
|
3178
|
+
} catch {
|
|
3179
|
+
return !1;
|
|
3180
|
+
}
|
|
3181
|
+
}()
|
|
3182
|
+
});
|
|
3183
|
+
}
|
|
3184
|
+
/**
|
|
3185
|
+
* 트랜젝션 키를 만든다
|
|
3186
|
+
* Comment by GOSOMI
|
|
3187
|
+
* @date: 2021-05-12
|
|
3188
|
+
* @returns string
|
|
3189
|
+
*/
|
|
3190
|
+
generateTransactionKey() {
|
|
3191
|
+
return this.$transactionKey = `${this.$uuid()}-${(/* @__PURE__ */ new Date()).getTime() * 1e3}`, this.$transactionKey;
|
|
3192
|
+
}
|
|
3193
|
+
async requestSubscription(e) {
|
|
3194
|
+
this.$event.clearInstance(), this.generateTransactionKey(), this.$event.setTokenKey(this.$transactionKey), this.$event.setApplicationId(e.application_id), this.$event.send({
|
|
3195
|
+
step: "start",
|
|
3196
|
+
msg: "정기결제 요청 시작",
|
|
3197
|
+
request: e
|
|
3198
|
+
}), e.extra = this.openTypeFilter(e.extra);
|
|
3199
|
+
const t = {
|
|
3200
|
+
application_id: e.client_key === void 0 ? e.application_id : null,
|
|
3201
|
+
client_key: e.client_key,
|
|
3202
|
+
subscription_id: e.subscription_id,
|
|
3203
|
+
pg: e.pg,
|
|
3204
|
+
method: e.method,
|
|
3205
|
+
order_name: e.order_name,
|
|
3206
|
+
price: e.price,
|
|
3207
|
+
tax_free: e.tax_free,
|
|
3208
|
+
user_token: e.user_token,
|
|
3209
|
+
metadata: e.metadata,
|
|
3210
|
+
redirect_url: e.redirect_url,
|
|
3211
|
+
wallet_id: e.wallet_id,
|
|
3212
|
+
widget: e.widget,
|
|
3213
|
+
widget_key: e.widget_key,
|
|
3214
|
+
widget_sandbox: e.widget_sandbox,
|
|
3215
|
+
subscribe_brandpay_type: e.subscribe_brandpay_type,
|
|
3216
|
+
platform_type: this.platformType,
|
|
3217
|
+
ver: U.packageVersion,
|
|
3218
|
+
sdk_version: U.sdkVersion,
|
|
3219
|
+
sdk_type: U.sdkName,
|
|
3220
|
+
locale: U.locale,
|
|
3221
|
+
sdk: !0,
|
|
3222
|
+
uuid: this.$session.currentUserUUID(),
|
|
3223
|
+
sk: this.$session.currentSessionKey(),
|
|
3224
|
+
tk: this.$transactionKey,
|
|
3225
|
+
env: this.getUserDeviceEnvironment(),
|
|
3226
|
+
user: e.user,
|
|
3227
|
+
extra: e.extra
|
|
3228
|
+
};
|
|
3229
|
+
try {
|
|
3230
|
+
const r = await O.start(t, "CARD_SUBSCRIPTION");
|
|
3231
|
+
switch (R.debug("subscription success", r), this.$event.send({
|
|
3232
|
+
step: "confirm",
|
|
3233
|
+
msg: "결제승인전",
|
|
3234
|
+
request: {},
|
|
3235
|
+
response: r
|
|
3236
|
+
}), O.hidePaymentiFrame(), O.closePopup(), r.event) {
|
|
3237
|
+
case "done":
|
|
3238
|
+
case "issued":
|
|
3239
|
+
break;
|
|
3240
|
+
case "confirm":
|
|
3241
|
+
O.setConfirmFormUrl(
|
|
3242
|
+
`${r.gateway_url}/confirm/${r.receipt_id}?application_id=${r.application_id}`
|
|
3243
|
+
);
|
|
3244
|
+
}
|
|
3245
|
+
return Promise.resolve(r);
|
|
3246
|
+
} catch (r) {
|
|
3247
|
+
return this.eventError(r), Promise.reject(r);
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
/**
|
|
3251
|
+
* 본인인증 요청
|
|
3252
|
+
* Comment by GOSOMI
|
|
3253
|
+
* @date: 2021-12-06
|
|
3254
|
+
* @param data: RequestAuthenticationModel
|
|
3255
|
+
*/
|
|
3256
|
+
async requestAuthentication(e) {
|
|
3257
|
+
this.$event.clearInstance(), this.generateTransactionKey(), this.$event.setTokenKey(this.$transactionKey), this.$event.setApplicationId(e.application_id), this.$event.send({
|
|
3258
|
+
step: "start",
|
|
3259
|
+
msg: "본인인증 요청 시작",
|
|
3260
|
+
request: e
|
|
3261
|
+
}), e.extra = this.openTypeFilter(e.extra);
|
|
3262
|
+
const t = {
|
|
3263
|
+
application_id: e.client_key === void 0 ? e.application_id : null,
|
|
3264
|
+
client_key: e.client_key,
|
|
3265
|
+
authentication_id: e.authentication_id,
|
|
3266
|
+
pg: e.pg,
|
|
3267
|
+
method: this.$present(e.method) ? e.method : "auth",
|
|
3268
|
+
order_name: e.order_name,
|
|
3269
|
+
platform_type: this.platformType,
|
|
3270
|
+
ver: re.version,
|
|
3271
|
+
sdk_version: U.sdkVersion,
|
|
3272
|
+
sdk_type: U.sdkName,
|
|
3273
|
+
locale: U.locale,
|
|
3274
|
+
metadata: e.metadata,
|
|
3275
|
+
redirect_url: e.redirect_url,
|
|
3276
|
+
sdk: !0,
|
|
3277
|
+
uuid: this.$session.currentUserUUID(),
|
|
3278
|
+
sk: this.$session.currentSessionKey(),
|
|
3279
|
+
tk: this.$transactionKey,
|
|
3280
|
+
env: this.getUserDeviceEnvironment(),
|
|
3281
|
+
user: e.user,
|
|
3282
|
+
extra: e.extra
|
|
3283
|
+
};
|
|
3284
|
+
try {
|
|
3285
|
+
const r = await O.start(t, "AUTH");
|
|
3286
|
+
switch (R.debug("authentication success", r), this.$event.send({
|
|
3287
|
+
step: "confirm",
|
|
3288
|
+
msg: "본인인증 승인전",
|
|
3289
|
+
request: {},
|
|
3290
|
+
response: r
|
|
3291
|
+
}), O.hidePaymentiFrame(), O.closePopup(), r.event) {
|
|
3292
|
+
case "done":
|
|
3293
|
+
case "issued":
|
|
3294
|
+
break;
|
|
3295
|
+
case "confirm":
|
|
3296
|
+
O.setConfirmFormUrl(
|
|
3297
|
+
`${r.gateway_url}/confirm/${r.receipt_id}?application_id=${r.application_id}`
|
|
3298
|
+
);
|
|
3299
|
+
}
|
|
3300
|
+
return Promise.resolve(r);
|
|
3301
|
+
} catch (r) {
|
|
3302
|
+
return this.eventError(r), Promise.reject(r);
|
|
3303
|
+
}
|
|
3304
|
+
}
|
|
3305
|
+
async requestPaymentUrl(e) {
|
|
3306
|
+
try {
|
|
3307
|
+
const t = await O.startPaymentUrl(e.url);
|
|
3308
|
+
return ["done", "issued"].indexOf(t.event) === -1 && this.$event.send({
|
|
3309
|
+
step: t.event,
|
|
3310
|
+
msg: "",
|
|
3311
|
+
request: {
|
|
3312
|
+
url: e.url
|
|
3313
|
+
},
|
|
3314
|
+
response: t
|
|
3315
|
+
}), O.setConfirmFormUrl(
|
|
3316
|
+
`${t.gateway_url}/confirm/${t.receipt_id}?application_id=${t.application_id}`
|
|
3317
|
+
), Promise.resolve(t);
|
|
3318
|
+
} catch (t) {
|
|
3319
|
+
return this.eventError(t), Promise.reject(t);
|
|
3320
|
+
}
|
|
3321
|
+
}
|
|
3322
|
+
getUserDeviceEnvironment() {
|
|
3323
|
+
return {
|
|
3324
|
+
width: window.innerWidth,
|
|
3325
|
+
height: window.innerHeight
|
|
3326
|
+
};
|
|
3327
|
+
}
|
|
3328
|
+
/**
|
|
3329
|
+
* display result
|
|
3330
|
+
* Comment by GOSOMI
|
|
3331
|
+
* @date: 2022-01-12
|
|
3332
|
+
*/
|
|
3333
|
+
isDisplaySuccessResult() {
|
|
3334
|
+
return this.extra !== void 0 && this.extra.display_success_result !== void 0 && this.extra.display_success_result;
|
|
3335
|
+
}
|
|
3336
|
+
isDisplayErrorResult() {
|
|
3337
|
+
return this.extra !== void 0 && this.extra.display_error_result !== void 0 && this.extra.display_error_result;
|
|
3338
|
+
}
|
|
3339
|
+
/**
|
|
3340
|
+
* Result View를 호출한다
|
|
3341
|
+
* Comment by GOSOMI
|
|
3342
|
+
* @date: 2022-01-12
|
|
3343
|
+
*/
|
|
3344
|
+
displayResultView(e) {
|
|
3345
|
+
O.moveToUrl(U.toWidget(`payment/result/${e}`));
|
|
3346
|
+
}
|
|
3347
|
+
/**
|
|
3348
|
+
* Result Error View를 보여준다
|
|
3349
|
+
* Comment by GOSOMI
|
|
3350
|
+
* @date: 2022-01-12
|
|
3351
|
+
*/
|
|
3352
|
+
displayResultErrorView(e) {
|
|
3353
|
+
O.moveToUrl(U.toWidget(`payment/error?error_code=${e.error_code}&pg_error_code=${e.pg_error_code}&message=${e.message}`));
|
|
3354
|
+
}
|
|
3355
|
+
/**
|
|
3356
|
+
* OpenTypeUserAgent Filter
|
|
3357
|
+
* Comment by GOSOMI
|
|
3358
|
+
* @date: 2022-05-09
|
|
3359
|
+
*/
|
|
3360
|
+
openTypeFilter(e) {
|
|
3361
|
+
if (this.$present(e) && e.browser_open_type !== void 0) {
|
|
3362
|
+
const t = this.getUserAgent();
|
|
3363
|
+
for (let r in e.browser_open_type) {
|
|
3364
|
+
const i = e.browser_open_type[r], c = this.$present(this.browserBootpayFilter[i.browser]) ? this.browserBootpayFilter[i.browser] : new RegExp(`${i.browser}`);
|
|
3365
|
+
if (t.match(c)) {
|
|
3366
|
+
e.open_type = i.open_type;
|
|
3367
|
+
break;
|
|
3368
|
+
}
|
|
3369
|
+
}
|
|
3370
|
+
}
|
|
3371
|
+
return e;
|
|
3372
|
+
}
|
|
3373
|
+
/**
|
|
3374
|
+
* 요청 데이터 필수 값 체크
|
|
3375
|
+
* Comment by GOSOMI
|
|
3376
|
+
* @date: 2021-05-12
|
|
3377
|
+
* @param data: RequestPaymentModel
|
|
3378
|
+
*/
|
|
3379
|
+
static invalidRequestParamsData(e) {
|
|
3380
|
+
if (q(e))
|
|
3381
|
+
throw new W({
|
|
3382
|
+
event: "error",
|
|
3383
|
+
error_code: "NEED_MORE_PARAMS",
|
|
3384
|
+
message: "결제 요청을 위한 최소한의 결제 정보를 입력해주세요."
|
|
3385
|
+
});
|
|
3386
|
+
Object.keys(G.invalidRequestParams).forEach((t) => {
|
|
3387
|
+
const r = e[t];
|
|
3388
|
+
if (q(r))
|
|
3389
|
+
throw new W({
|
|
3390
|
+
event: "error",
|
|
3391
|
+
error_code: "INVALID_REQUEST_PARAMS",
|
|
3392
|
+
message: G.invalidRequestParams[t]
|
|
3393
|
+
});
|
|
3394
|
+
});
|
|
3395
|
+
}
|
|
3396
|
+
static invalidClientIdOrApplicationId(e) {
|
|
3397
|
+
if (e.client_key === void 0 && e.application_id === void 0)
|
|
3398
|
+
throw new W({
|
|
3399
|
+
event: "error",
|
|
3400
|
+
error_code: "NEED_CLIENT_KEY",
|
|
3401
|
+
message: "Client Key가 필요합니다"
|
|
3402
|
+
});
|
|
3403
|
+
}
|
|
3404
|
+
/**
|
|
3405
|
+
* 첨부된 item data invalidate
|
|
3406
|
+
* Comment by GOSOMI
|
|
3407
|
+
* @date: 2021-05-12
|
|
3408
|
+
* @param items: Array<ItemModel>
|
|
3409
|
+
* @param price: number
|
|
3410
|
+
*/
|
|
3411
|
+
static invalidRequestItemsData(e, t) {
|
|
3412
|
+
if (e !== void 0 && M(e)) {
|
|
3413
|
+
let r = 0;
|
|
3414
|
+
if (e.forEach((i, c) => {
|
|
3415
|
+
if (q(i.id))
|
|
3416
|
+
throw new W({
|
|
3417
|
+
event: "error",
|
|
3418
|
+
error_code: "NEED_ITEM_ID",
|
|
3419
|
+
message: `${c + 1}번째 상품 고유 ID를 입력해주세요. [ key: id ]`
|
|
3420
|
+
});
|
|
3421
|
+
if (q(i.name))
|
|
3422
|
+
throw new W({
|
|
3423
|
+
event: "error",
|
|
3424
|
+
error_code: "NEED_ITEM_NAME",
|
|
3425
|
+
message: `${c + 1}번째 상품명을 입력해주세요. [ key: name ]`
|
|
3426
|
+
});
|
|
3427
|
+
if (q(i.qty))
|
|
3428
|
+
throw new W({
|
|
3429
|
+
event: "error",
|
|
3430
|
+
error_code: "NEED_ITEM_QTY",
|
|
3431
|
+
message: `${c + 1}번째 상품수량을 입력해주세요. [ key: qty ]`
|
|
3432
|
+
});
|
|
3433
|
+
if (q(i.price))
|
|
3434
|
+
throw new W({
|
|
3435
|
+
event: "error",
|
|
3436
|
+
error_code: "NEED_ITEM_PRICE",
|
|
3437
|
+
message: `${c + 1}번째 상품금액을 입력해주세요. [ key: price ]`
|
|
3438
|
+
});
|
|
3439
|
+
e[c].price = parseFloat(String(e[c].price)), e[c].qty = parseFloat(String(e[c].qty)), r += e[c].price * e[c].qty;
|
|
3440
|
+
}), r !== t)
|
|
3441
|
+
throw new W({
|
|
3442
|
+
event: "error",
|
|
3443
|
+
error_code: "NEED_ITEM_TOTAL_PRICE_NOT_MATCH",
|
|
3444
|
+
message: `결제 금액과 상품 수량 및 상품 금액의 총합과 일치하지 않습니다. [ 요청금액: ${t} ${typeof t}, 상품 총합계 금액: ${r} ${typeof r} ]`
|
|
3445
|
+
});
|
|
3446
|
+
}
|
|
3447
|
+
}
|
|
3448
|
+
};
|
|
3449
|
+
G.invalidRequestParams = {
|
|
3450
|
+
order_name: "판매할 상품명을 입력해주세요. [ key: order_name ]",
|
|
3451
|
+
price: "판매할 상품의 금액을 입력해주세요. [ key: price ]",
|
|
3452
|
+
order_id: "가맹점에서 설정할 주문 ID를 입력해주세요. [ key: order_id ]"
|
|
3453
|
+
};
|
|
3454
|
+
let ve = G;
|
|
3455
|
+
const bt = new ve();
|
|
3456
|
+
class _t extends ae {
|
|
3457
|
+
constructor() {
|
|
3458
|
+
super(), this.$session = ne;
|
|
3459
|
+
}
|
|
3460
|
+
/**
|
|
3461
|
+
* 인앱을 위한 통계 정보 추가
|
|
3462
|
+
* Comment by GOSOMI
|
|
3463
|
+
* @date: 2022-05-09
|
|
3464
|
+
*/
|
|
3465
|
+
setAnalyticsData(e) {
|
|
3466
|
+
this.$session.setTime(e.time), this.$session.setUUID(e.uuid);
|
|
3467
|
+
}
|
|
3468
|
+
/**
|
|
3469
|
+
* 일반적인 통계 데이터를 전송
|
|
3470
|
+
* Comment by GOSOMI
|
|
3471
|
+
* @date: 2022-03-02
|
|
3472
|
+
*/
|
|
3473
|
+
async send(e) {
|
|
3474
|
+
const t = document.URL;
|
|
3475
|
+
if (t !== void 0 && t.search(/bootapi.co.kr/) === -1) {
|
|
3476
|
+
const r = this.$session.getUser();
|
|
3477
|
+
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 = document.referrer !== void 0 && M(document.referrer) && document.referrer.search(new RegExp(window.location.hostname)) == -1 ? document.referrer : "", e.user_id = r === void 0 || q(r) ? void 0 : r.id, e.items = this.generateItemKeyToVersion1(e.items);
|
|
3478
|
+
try {
|
|
3479
|
+
const i = await this.$http.post(
|
|
3480
|
+
U.toAnalytics(`call?ver=${re.version}`),
|
|
3481
|
+
e
|
|
3482
|
+
);
|
|
3483
|
+
return i.data.status === 200 ? (R.info("Analytics Common Send", "통계 데이터가 전송되었습니다."), Promise.resolve()) : (R.warn("Analytics Common Send", `통계 데이터가 전송 실패. ${JSON.stringify(i.data)}`), Promise.reject());
|
|
3484
|
+
} catch (i) {
|
|
3485
|
+
return R.error("Analytics Common Error", `데이터 전송 실패: ${i.message}`), Promise.reject();
|
|
3486
|
+
}
|
|
3487
|
+
}
|
|
3488
|
+
}
|
|
3489
|
+
/**
|
|
3490
|
+
* User Login 정보 보내기
|
|
3491
|
+
* Comment by GOSOMI
|
|
3492
|
+
* @date: 2022-03-02
|
|
3493
|
+
*/
|
|
3494
|
+
async login(e) {
|
|
3495
|
+
if (e.application_id = U.currentApplicationId(e.application_id), q(e.application_id))
|
|
3496
|
+
return R.error("Analytics Params", "application_id 값을 입력해주세요.");
|
|
3497
|
+
if (q(e.id))
|
|
3498
|
+
return R.error("Analytics Params", "id 값을 입력해주세요.");
|
|
3499
|
+
try {
|
|
3500
|
+
const t = await this.$http.post(
|
|
3501
|
+
U.toAnalytics(`login?ver=${re.version}`),
|
|
3502
|
+
e
|
|
3503
|
+
), { user_id: r } = t.data.data;
|
|
3504
|
+
return this.$session.setUser({
|
|
3505
|
+
id: r,
|
|
3506
|
+
time: (/* @__PURE__ */ new Date()).getTime()
|
|
3507
|
+
}), Promise.resolve();
|
|
3508
|
+
} catch (t) {
|
|
3509
|
+
return R.error("Analytics Login Error", `데이터 전송 실패: ${t.message}`), Promise.reject();
|
|
3510
|
+
}
|
|
3511
|
+
}
|
|
3512
|
+
/**
|
|
3513
|
+
* Logout
|
|
3514
|
+
* Comment by GOSOMI
|
|
3515
|
+
* @date: 2022-03-02
|
|
3516
|
+
*/
|
|
3517
|
+
logout() {
|
|
3518
|
+
this.$session.setUser(void 0);
|
|
3519
|
+
}
|
|
3520
|
+
/**
|
|
3521
|
+
* Analytics Key to V1 Filter
|
|
3522
|
+
* Comment by GOSOMI
|
|
3523
|
+
* @date: 2022-05-09
|
|
3524
|
+
*/
|
|
3525
|
+
generateItemKeyToVersion1(e) {
|
|
3526
|
+
if (e !== void 0)
|
|
3527
|
+
return e.map((t) => ({
|
|
3528
|
+
cat1: t.cat1,
|
|
3529
|
+
cat2: t.cat2,
|
|
3530
|
+
cat3: t.cat3,
|
|
3531
|
+
item_img: t.img,
|
|
3532
|
+
item_name: t.name,
|
|
3533
|
+
unique: t.id,
|
|
3534
|
+
price: t.price
|
|
3535
|
+
}));
|
|
3536
|
+
}
|
|
3537
|
+
}
|
|
3538
|
+
const $t = new _t();
|
|
3539
|
+
class wt extends Ce {
|
|
3540
|
+
constructor() {
|
|
3541
|
+
super(), this.$messageEventName = "message.BootpayOnboardingEvent";
|
|
3542
|
+
}
|
|
3543
|
+
bindOnboarding(e, t, r, i) {
|
|
3544
|
+
window.resetBootpayEventListener(this.$messageEventName, (c) => {
|
|
3545
|
+
if (c.origin !== e) return;
|
|
3546
|
+
const x = t();
|
|
3547
|
+
if (x !== null && c.source !== x) return;
|
|
3548
|
+
const w = this.parseEvent(c.data);
|
|
3549
|
+
if (M(w))
|
|
3550
|
+
switch (w.event) {
|
|
3551
|
+
case "done":
|
|
3552
|
+
return r({
|
|
3553
|
+
event: "done",
|
|
3554
|
+
id: w.id,
|
|
3555
|
+
kind: w.kind,
|
|
3556
|
+
pg_wait_id: w.pg_wait_id,
|
|
3557
|
+
status: w.status
|
|
3558
|
+
});
|
|
3559
|
+
case "cancel":
|
|
3560
|
+
return i();
|
|
3561
|
+
default:
|
|
3562
|
+
return;
|
|
3563
|
+
}
|
|
3564
|
+
});
|
|
3565
|
+
}
|
|
3566
|
+
unbind() {
|
|
3567
|
+
window.removeBootpayEventListener(this.$messageEventName);
|
|
3568
|
+
}
|
|
3569
|
+
}
|
|
3570
|
+
const Pt = ["popup", "iframe", "redirect"], xe = "rst_";
|
|
3571
|
+
class Et extends be {
|
|
3572
|
+
constructor() {
|
|
3573
|
+
super(), this.$popup = null, this.$popupWatcher = void 0, this.$abortPrevious = null, this.$windowId = "bootpay-onboarding-background-id", this.$onboardingWindowId = "bootpay-onboarding-window-id", this.$iFrameId = "bootpay-onboarding-iframe-id", this.$template = this.template(), this.$event = new wt();
|
|
3574
|
+
}
|
|
3575
|
+
template() {
|
|
3576
|
+
return `
|
|
3577
|
+
<div id="${this.$windowId}" class="bootpay-payment-background">
|
|
3578
|
+
<div class="bootpay-payment-window" id="${this.$onboardingWindowId}">
|
|
3579
|
+
<iframe id="${this.$iFrameId}" name="${this.$iFrameId}" title="PG 신청" frameborder="0"
|
|
3580
|
+
style="display: block; width: min(960px, calc(100vw - 32px)); height: 90vh; border: 0; background: #ffffff;"></iframe>
|
|
3581
|
+
</div>
|
|
3582
|
+
</div>
|
|
3583
|
+
`;
|
|
3584
|
+
}
|
|
3585
|
+
/**
|
|
3586
|
+
* 신청 화면 주소 — url 을 주면 부트페이 신청 화면 주소(ONBOARDING_URL)일 때만 쓴다
|
|
3587
|
+
*/
|
|
3588
|
+
onboardingUrl(e, t) {
|
|
3589
|
+
const r = String((e == null ? void 0 : e.token) ?? "").trim();
|
|
3590
|
+
if (r.indexOf(xe) !== 0 || r.length <= xe.length)
|
|
3591
|
+
throw {
|
|
3592
|
+
event: "error",
|
|
3593
|
+
error_code: "ONBOARDING_TOKEN_REQUIRED",
|
|
3594
|
+
message: "등록 폼 토큰(rst_…)을 넣어 주세요."
|
|
3595
|
+
};
|
|
3596
|
+
let i;
|
|
3597
|
+
try {
|
|
3598
|
+
i = this.$present(e.url) ? new URL(String(e.url)) : new URL(U.toOnboarding(`onboarding/s/${encodeURIComponent(r)}`));
|
|
3599
|
+
} catch {
|
|
3600
|
+
i = null;
|
|
3601
|
+
}
|
|
3602
|
+
const c = Object.keys(U.ONBOARDING_URL).map((x) => new URL(U.ONBOARDING_URL[x]).origin);
|
|
3603
|
+
if (i === null || c.indexOf(i.origin) < 0)
|
|
3604
|
+
throw {
|
|
3605
|
+
event: "error",
|
|
3606
|
+
error_code: "ONBOARDING_URL_INVALID",
|
|
3607
|
+
message: "부트페이 신청 화면 주소가 아니에요. 등록 폼 세션 발급 응답의 url 을 그대로 넣어 주세요."
|
|
3608
|
+
};
|
|
3609
|
+
return i.searchParams.set("display", t), i.searchParams.set("origin", window.location.origin), i.toString();
|
|
3610
|
+
}
|
|
3611
|
+
/**
|
|
3612
|
+
* 신청 화면을 연다. done 은 resolve, cancel 과 error 는 reject
|
|
3613
|
+
*/
|
|
3614
|
+
open(e) {
|
|
3615
|
+
return new Promise((t, r) => {
|
|
3616
|
+
const i = Pt.indexOf(e == null ? void 0 : e.display) > -1 ? e.display : "iframe";
|
|
3617
|
+
let c;
|
|
3618
|
+
try {
|
|
3619
|
+
c = this.onboardingUrl(e, i);
|
|
3620
|
+
} catch (n) {
|
|
3621
|
+
return r(n);
|
|
3622
|
+
}
|
|
3623
|
+
if (this.$abortPrevious !== null && this.$abortPrevious(), this.destroy(), i === "redirect") {
|
|
3624
|
+
window.location.href = c;
|
|
3625
|
+
return;
|
|
3626
|
+
}
|
|
3627
|
+
let x = !1;
|
|
3628
|
+
const w = (n) => {
|
|
3629
|
+
x || (x = !0, this.$abortPrevious = null, this.destroy(), n());
|
|
3630
|
+
};
|
|
3631
|
+
if (this.$abortPrevious = () => w(() => r({ event: "cancel" })), this.$event.bindOnboarding(
|
|
3632
|
+
new URL(c).origin,
|
|
3633
|
+
() => this.currentWindow(i),
|
|
3634
|
+
(n) => w(() => t(n)),
|
|
3635
|
+
() => w(() => r({ event: "cancel" }))
|
|
3636
|
+
), i === "popup") {
|
|
3637
|
+
if (this.$popup = window.open(c, "BootpayOnboarding", "width=960,height=900,scrollbars=yes,resizable=yes"), this.$popup === null || this.$popup === void 0)
|
|
3638
|
+
return x = !0, this.$abortPrevious = null, this.$popup = null, this.$event.unbind(), r({
|
|
3639
|
+
event: "error",
|
|
3640
|
+
error_code: "POPUP_BLOCKED",
|
|
3641
|
+
message: "팝업이 차단되었어요. 버튼을 누른 직후에 다시 열거나 display 를 iframe 으로 바꿔 주세요."
|
|
3642
|
+
});
|
|
3643
|
+
this.$popupWatcher = setInterval(() => {
|
|
3644
|
+
(this.$popup === null || this.$popup.closed) && w(() => r({ event: "cancel" }));
|
|
3645
|
+
}, 500);
|
|
3646
|
+
return;
|
|
3647
|
+
}
|
|
3648
|
+
this.createTemplateHtml(), this.bodyOpen(), this.byId(this.$iFrameId).setAttribute("src", c);
|
|
3649
|
+
});
|
|
3650
|
+
}
|
|
3651
|
+
currentWindow(e) {
|
|
3652
|
+
if (e === "popup") return this.$popup;
|
|
3653
|
+
const t = this.byId(this.$iFrameId);
|
|
3654
|
+
return (t == null ? void 0 : t.contentWindow) ?? null;
|
|
3655
|
+
}
|
|
3656
|
+
/**
|
|
3657
|
+
* 창 · 덮개 · 감시 · 리스너를 정리하고 본문 스크롤을 되돌린다
|
|
3658
|
+
*/
|
|
3659
|
+
destroy() {
|
|
3660
|
+
if (this.$popupWatcher !== void 0 && (clearInterval(this.$popupWatcher), this.$popupWatcher = void 0), this.$popup !== null && !this.$popup.closed)
|
|
3661
|
+
try {
|
|
3662
|
+
this.$popup.close();
|
|
3663
|
+
} catch {
|
|
3664
|
+
}
|
|
3665
|
+
this.$popup = null;
|
|
3666
|
+
const e = this.byId(this.$windowId);
|
|
3667
|
+
e !== null && (e.remove(), this.bodyClose()), this.$event.unbind();
|
|
3668
|
+
}
|
|
3669
|
+
}
|
|
3670
|
+
const It = new Et();
|
|
3671
|
+
(function() {
|
|
3672
|
+
if (typeof window > "u" || typeof window.CustomEvent == "function") return !1;
|
|
3673
|
+
function s(e, t) {
|
|
3674
|
+
t = t || { bubbles: !1, cancelable: !1, detail: void 0 };
|
|
3675
|
+
let r = document.createEvent("CustomEvent");
|
|
3676
|
+
return r.initCustomEvent(e, t.bubbles, t.cancelable, t.detail), r;
|
|
3677
|
+
}
|
|
3678
|
+
s.prototype = window.Event.prototype, window.CustomEvent = s;
|
|
3679
|
+
})();
|
|
3680
|
+
const ge = {
|
|
3681
|
+
$payment: bt,
|
|
3682
|
+
$analytics: $t,
|
|
3683
|
+
$environment: U,
|
|
3684
|
+
/**
|
|
3685
|
+
* 결제 요청
|
|
3686
|
+
* Comment by GOSOMI
|
|
3687
|
+
* @date: 2021-05-11
|
|
3688
|
+
* @param data: RequestPaymentModel
|
|
3689
|
+
* @returns Promise<any>
|
|
3690
|
+
*/
|
|
3691
|
+
async requestPayment(s) {
|
|
3692
|
+
return new Promise(async (e, t) => {
|
|
3693
|
+
try {
|
|
3694
|
+
s.extra !== void 0 && s.extra.override_global_event === !0 && (R.debug("override global event", "override global event!"), ge.overrideGlobalInstance());
|
|
3695
|
+
const r = await this.$payment.requestPayment(s);
|
|
3696
|
+
setTimeout(() => {
|
|
3697
|
+
e(r), ["done", "issued"].indexOf(r.event) > -1 && this.$payment.eventDone(r);
|
|
3698
|
+
}, 100);
|
|
3699
|
+
} catch (r) {
|
|
3700
|
+
setTimeout(() => {
|
|
3701
|
+
t(this.errorHandler(r));
|
|
3702
|
+
}, 100);
|
|
3703
|
+
}
|
|
3704
|
+
});
|
|
3705
|
+
},
|
|
3706
|
+
/**
|
|
3707
|
+
* 결제 승인 요청
|
|
3708
|
+
* Comment by GOSOMI
|
|
3709
|
+
* @date: 2021-05-20
|
|
3710
|
+
*/
|
|
3711
|
+
async confirm() {
|
|
3712
|
+
return new Promise(async (s, e) => {
|
|
3713
|
+
try {
|
|
3714
|
+
const t = await this.$payment.confirm();
|
|
3715
|
+
setTimeout(() => {
|
|
3716
|
+
s(t), this.$payment.eventDone(t);
|
|
3717
|
+
}, 100);
|
|
3718
|
+
} catch (t) {
|
|
3719
|
+
setTimeout(() => e(this.errorHandler(t)), 100);
|
|
3720
|
+
}
|
|
3721
|
+
});
|
|
3722
|
+
},
|
|
3723
|
+
/**
|
|
3724
|
+
* 정기결제창 요청
|
|
3725
|
+
* Comment by GOSOMI
|
|
3726
|
+
* @date: 2021-10-28
|
|
3727
|
+
* @param data: RequestSubscriptionModel
|
|
3728
|
+
*/
|
|
3729
|
+
async requestSubscription(s) {
|
|
3730
|
+
return new Promise(async (e, t) => {
|
|
3731
|
+
try {
|
|
3732
|
+
const r = await this.$payment.requestSubscription(s);
|
|
3733
|
+
e(r), this.$payment.eventDone(r);
|
|
3734
|
+
} catch (r) {
|
|
3735
|
+
return t(this.errorHandler(r));
|
|
3736
|
+
}
|
|
3737
|
+
});
|
|
3738
|
+
},
|
|
3739
|
+
/**
|
|
3740
|
+
* 본인인증 요청
|
|
3741
|
+
* Comment by GOSOMI
|
|
3742
|
+
* @date: 2021-12-06
|
|
3743
|
+
* @param data: RequestAuthenticationModel
|
|
3744
|
+
*/
|
|
3745
|
+
async requestAuthentication(s) {
|
|
3746
|
+
return new Promise(async (e, t) => {
|
|
3747
|
+
try {
|
|
3748
|
+
const r = await this.$payment.requestAuthentication(s);
|
|
3749
|
+
e(r), this.$payment.eventDone(r);
|
|
3750
|
+
} catch (r) {
|
|
3751
|
+
return t(this.errorHandler(r));
|
|
3752
|
+
}
|
|
3753
|
+
});
|
|
3754
|
+
},
|
|
3755
|
+
async requestPaymentUrl(s, e = !1) {
|
|
3756
|
+
return new Promise(async (t, r) => {
|
|
3757
|
+
try {
|
|
3758
|
+
const i = await this.$payment.requestPaymentUrl(s);
|
|
3759
|
+
setTimeout(() => {
|
|
3760
|
+
t(i), ["done", "issued"].indexOf(i.event) > -1 && this.$payment.eventDone(i);
|
|
3761
|
+
}, 100);
|
|
3762
|
+
} catch (i) {
|
|
3763
|
+
setTimeout(() => {
|
|
3764
|
+
r(this.errorHandler(i));
|
|
3765
|
+
}, 100);
|
|
3766
|
+
}
|
|
3767
|
+
});
|
|
3768
|
+
},
|
|
3769
|
+
/**
|
|
3770
|
+
* 리셀러 등록 폼(PG 신청 화면)을 연다 — 리셀러 서버가 발급받은 토큰(rst_…) 하나로
|
|
3771
|
+
* 접수되면 resolve { event: 'done', id, kind, pg_wait_id, status }, 창을 닫거나 [나중에 할게요] 는 reject { event: 'cancel' }
|
|
3772
|
+
* display 기본값은 iframe. popup 은 버튼 클릭 처리 안에서 바로 불러야 차단되지 않는다.
|
|
3773
|
+
* async 로 두지 않는다 — window.open 이 클릭 처리 안에서 바로 돌아야 한다
|
|
3774
|
+
* @date: 26-10-27
|
|
3775
|
+
*/
|
|
3776
|
+
requestOnboarding(s) {
|
|
3777
|
+
return new Promise((e, t) => {
|
|
3778
|
+
if (typeof window > "u")
|
|
3779
|
+
return t({ event: "error", error_code: "ONBOARDING_BROWSER_ONLY", message: "브라우저에서만 열 수 있어요." });
|
|
3780
|
+
It.open(s).then(e).catch((r) => {
|
|
3781
|
+
try {
|
|
3782
|
+
t(this.errorHandler(r));
|
|
3783
|
+
} catch (i) {
|
|
3784
|
+
t(i);
|
|
3785
|
+
}
|
|
3786
|
+
});
|
|
3787
|
+
});
|
|
3788
|
+
},
|
|
3789
|
+
/**
|
|
3790
|
+
* 환경 설정
|
|
3791
|
+
* Comment by GOSOMI
|
|
3792
|
+
* @date: 2021-05-11
|
|
3793
|
+
* @returns void
|
|
3794
|
+
*/
|
|
3795
|
+
setEnvironmentMode(s, e = void 0) {
|
|
3796
|
+
this.$environment.set(s), e !== void 0 && this.$environment.setDevelopmentHost(e);
|
|
3797
|
+
},
|
|
3798
|
+
/**
|
|
3799
|
+
* ApplicationID를 지정
|
|
3800
|
+
* Comment by GOSOMI
|
|
3801
|
+
* @date: 2022-03-02
|
|
3802
|
+
*/
|
|
3803
|
+
setApplicationId(s) {
|
|
3804
|
+
return this.$environment.setApplicationId(s);
|
|
3805
|
+
},
|
|
3806
|
+
/**
|
|
3807
|
+
* SDK 버전과 SDK 이름 기록
|
|
3808
|
+
* Comment by GOSOMI
|
|
3809
|
+
* @date: 2022-05-15
|
|
3810
|
+
*/
|
|
3811
|
+
setVersion(s, e, t) {
|
|
3812
|
+
return this.$environment.setVersion(s, e, t);
|
|
3813
|
+
},
|
|
3814
|
+
/**
|
|
3815
|
+
* DeviceType을 설정
|
|
3816
|
+
* Comment by GOSOMI
|
|
3817
|
+
* @date: 2021-12-23
|
|
3818
|
+
* @param deviceType: string
|
|
3819
|
+
* @returns number
|
|
3820
|
+
*/
|
|
3821
|
+
setDevice(s) {
|
|
3822
|
+
switch (s) {
|
|
3823
|
+
case "IOS":
|
|
3824
|
+
this.$payment.platformType = H.PLATFORM.IOS;
|
|
3825
|
+
break;
|
|
3826
|
+
case "ANDROID":
|
|
3827
|
+
this.$payment.platformType = H.PLATFORM.ANDROID;
|
|
3828
|
+
break;
|
|
3829
|
+
default:
|
|
3830
|
+
this.$payment.platformType = H.PLATFORM.JS;
|
|
3831
|
+
}
|
|
3832
|
+
return this.$payment.platformType;
|
|
3833
|
+
},
|
|
3834
|
+
/**
|
|
3835
|
+
* 이벤트 오류를 받아서 처리한다
|
|
3836
|
+
* Comment by GOSOMI
|
|
3837
|
+
* @date: 2021-05-12
|
|
3838
|
+
* @param e: any
|
|
3839
|
+
*/
|
|
3840
|
+
errorHandler(s) {
|
|
3841
|
+
let e;
|
|
3842
|
+
switch (Q.hideProgress(), s.name) {
|
|
3843
|
+
case "BootpayEventError":
|
|
3844
|
+
e = s.eventMessage;
|
|
3845
|
+
break;
|
|
3846
|
+
default:
|
|
3847
|
+
if (M(s.event))
|
|
3848
|
+
e = s;
|
|
3849
|
+
else
|
|
3850
|
+
throw s;
|
|
3851
|
+
}
|
|
3852
|
+
return e;
|
|
3853
|
+
},
|
|
3854
|
+
/**
|
|
3855
|
+
* 팝업을 준비한다
|
|
3856
|
+
* Comment by GOSOMI
|
|
3857
|
+
* @date: 2021-06-23
|
|
3858
|
+
*/
|
|
3859
|
+
readyToPopup() {
|
|
3860
|
+
O.readyToPopup();
|
|
3861
|
+
},
|
|
3862
|
+
/**
|
|
3863
|
+
* 로그 레벨을 설정한다
|
|
3864
|
+
* Comment by GOSOMI
|
|
3865
|
+
* @date: 2021-05-12
|
|
3866
|
+
* @param level: number
|
|
3867
|
+
* @returns void
|
|
3868
|
+
*/
|
|
3869
|
+
setLogLevel(s) {
|
|
3870
|
+
R.setLogLevel(s);
|
|
3871
|
+
},
|
|
3872
|
+
/**
|
|
3873
|
+
* UUID 설정
|
|
3874
|
+
* Comment by GOSOMI
|
|
3875
|
+
* @date: 2021-12-22
|
|
3876
|
+
* @param uuid: string
|
|
3877
|
+
* @returns string
|
|
3878
|
+
*/
|
|
3879
|
+
setUUID(s) {
|
|
3880
|
+
return ne.setUUID(s);
|
|
3881
|
+
},
|
|
3882
|
+
/**
|
|
3883
|
+
* 페이지 통계 데이터를 전송
|
|
3884
|
+
* Comment by GOSOMI
|
|
3885
|
+
* @date: 2022-03-02
|
|
3886
|
+
*/
|
|
3887
|
+
send(s = void 0) {
|
|
3888
|
+
return this.$analytics.send(s !== void 0 ? s : {});
|
|
3889
|
+
},
|
|
3890
|
+
login(s) {
|
|
3891
|
+
return this.$analytics.login(s);
|
|
3892
|
+
},
|
|
3893
|
+
logout() {
|
|
3894
|
+
return this.$analytics.logout();
|
|
3895
|
+
},
|
|
3896
|
+
/**
|
|
3897
|
+
* Locale 설정
|
|
3898
|
+
* Comment by GOSOMI
|
|
3899
|
+
* @date: 2022-06-09
|
|
3900
|
+
*/
|
|
3901
|
+
setLocale(s) {
|
|
3902
|
+
U.setLocale(s), O.templateReload();
|
|
3903
|
+
},
|
|
3904
|
+
/**
|
|
3905
|
+
* 결제창을 닫는다
|
|
3906
|
+
* Comment by GOSOMI
|
|
3907
|
+
* @date: 2021-12-29
|
|
3908
|
+
*/
|
|
3909
|
+
async dismiss(s = !1) {
|
|
3910
|
+
if (s)
|
|
3911
|
+
try {
|
|
3912
|
+
await te.sendCloseEvent();
|
|
3913
|
+
} catch (e) {
|
|
3914
|
+
R.debug("error", e.message);
|
|
3915
|
+
}
|
|
3916
|
+
K.reject({
|
|
3917
|
+
event: "cancel",
|
|
3918
|
+
error_code: "RC_CLOSE_WINDOW",
|
|
3919
|
+
message: "사용자가 결제창을 닫았습니다."
|
|
3920
|
+
});
|
|
3921
|
+
},
|
|
3922
|
+
getCurrentUUID() {
|
|
3923
|
+
return ne.currentUserUUID();
|
|
3924
|
+
},
|
|
3925
|
+
/**
|
|
3926
|
+
* 결제창을 닫는다
|
|
3927
|
+
* Comment by GOSOMI
|
|
3928
|
+
* @date: 2022-06-14
|
|
3929
|
+
*/
|
|
3930
|
+
destroy() {
|
|
3931
|
+
O.destroy();
|
|
3932
|
+
},
|
|
3933
|
+
overrideGlobalInstance() {
|
|
3934
|
+
window.Bootpay = ge;
|
|
3935
|
+
}
|
|
3936
|
+
};
|
|
3937
|
+
typeof window < "u" && (window.Bootpay = ge);
|
|
3938
|
+
export {
|
|
3939
|
+
ht as A,
|
|
3940
|
+
Ce as B,
|
|
3941
|
+
H as C,
|
|
3942
|
+
U as E,
|
|
3943
|
+
R as L,
|
|
3944
|
+
kt as M,
|
|
3945
|
+
at as P,
|
|
3946
|
+
ae as R,
|
|
3947
|
+
ne as S,
|
|
3948
|
+
be as T,
|
|
3949
|
+
$e as U,
|
|
3950
|
+
dt as a,
|
|
3951
|
+
q as b,
|
|
3952
|
+
z as c,
|
|
3953
|
+
ie as d,
|
|
3954
|
+
de as e,
|
|
3955
|
+
Ue as f,
|
|
3956
|
+
le as g,
|
|
3957
|
+
ge as h,
|
|
3958
|
+
M as i,
|
|
3959
|
+
W as j,
|
|
3960
|
+
re as k,
|
|
3961
|
+
ve as l,
|
|
3962
|
+
xt as m,
|
|
3963
|
+
K as n,
|
|
3964
|
+
Q as o,
|
|
3965
|
+
Z as r
|
|
3966
|
+
};
|