capacitor-kakao-plugin
Version:
capacitor kakao plugin supports Capacitor 6
537 lines (530 loc) • 113 kB
JavaScript
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var core = require('@capacitor/core');
var camelCase = require('lodash.camelcase');
var snake_case = require('lodash.snakecase');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var camelCase__default = /*#__PURE__*/_interopDefaultLegacy(camelCase);
var snake_case__default = /*#__PURE__*/_interopDefaultLegacy(snake_case);
exports.KakaoOAuthTokenStatus = void 0;
(function (KakaoOAuthTokenStatus) {
KakaoOAuthTokenStatus["LOGIN_NEEDED"] = "LOGIN_NEEDED";
KakaoOAuthTokenStatus["ERROR"] = "ERROR";
KakaoOAuthTokenStatus["SUCCEED"] = "SUCCEED";
})(exports.KakaoOAuthTokenStatus || (exports.KakaoOAuthTokenStatus = {}));
const CapacitorKakao = core.registerPlugin('CapacitorKakao', {
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.CapacitorKakaoWeb()),
});
/*!
* Kakao SDK for JavaScript - v2.7.2
*
* Copyright 2017 Kakao Corp.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
* OSS Notice | KakaoSDK-JavaScript
*
* This application is Copyright © Kakao Corp. All rights reserved.
* The following sets forth attribution notices for third party software that may be contained in this application.
* If you have any questions about these notices, please email us at opensource@kakaocorp.com
*
*
* crypto-js
*
* https://github.com/brix/crypto-js
*
* Copyright 2009-2013 Jeff Mott
* Copyright 2013-2016 Evan Vosberg
*
* MIT License
*
*
* ES6-Promise
*
* https://github.com/stefanpenner/es6-promise
*
* Copyright 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors
*
* MIT License
*
*
* Kakao Web2App Library
*
* https://github.com/kakao/web2app
*
* Copyright 2015 Kakao Corp. http://www.kakaocorp.com
*
* MIT License
*
*
* lodash
*
* https://github.com/lodash/lodash
*
* Copyright JS Foundation and other contributors
*
* MIT License
*
*
* ua_parser
*
* https://github.com/html5crew/ua_parser
*
* Copyright HTML5 Tech. Team in Daum Communications Corp.
*
* MIT License
*
*
* ``````````
* MIT License
*
* Copyright (c)
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* 'Software'), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* ``````````
*/
!function (e, t) { "object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t((e = "undefined" != typeof globalThis ? globalThis : e || self).Kakao = e.Kakao || {}); }(undefined, (function (e) {
var t = "object" == typeof global && global && global.Object === Object && global, n = "object" == typeof self && self && self.Object === Object && self, r = t || n || Function("return this")(), o = r.Symbol, i = Object.prototype, a = i.hasOwnProperty, c = i.toString, u = o ? o.toStringTag : void 0;
var s = Object.prototype.toString;
var l = "[object Null]", f = "[object Undefined]", d = o ? o.toStringTag : void 0;
function p(e) { return null == e ? void 0 === e ? f : l : d && d in Object(e) ? function (e) { var t = a.call(e, u), n = e[u]; try {
e[u] = void 0;
var r = !0;
}
catch (e) { } var o = c.call(e); return r && (t ? e[u] = n : delete e[u]), o; }(e) : function (e) { return s.call(e); }(e); }
function h(e) { return null != e && "object" == typeof e; }
var v = "[object Symbol]";
var m = Array.isArray, y = /\s/;
var g = /^\s+/;
function b(e) { return e ? e.slice(0, function (e) { for (var t = e.length; t-- && y.test(e.charAt(t));)
; return t; }(e) + 1).replace(g, "") : e; }
function _(e) { var t = typeof e; return null != e && ("object" == t || "function" == t); }
var k = NaN, w = /^[-+]0x[0-9a-f]+$/i, S = /^0b[01]+$/i, j = /^0o[0-7]+$/i, O = parseInt;
function x(e) { if ("number" == typeof e)
return e; if (function (e) { return "symbol" == typeof e || h(e) && p(e) == v; }(e))
return k; if (_(e)) {
var t = "function" == typeof e.valueOf ? e.valueOf() : e;
e = _(t) ? t + "" : t;
} if ("string" != typeof e)
return 0 === e ? e : +e; e = b(e); var n = S.test(e); return n || j.test(e) ? O(e.slice(2), n ? 2 : 8) : w.test(e) ? k : +e; }
var T = 1 / 0, A = 17976931348623157e292;
function P(e) { var t = function (e) { return e ? (e = x(e)) === T || e === -T ? (e < 0 ? -1 : 1) * A : e == e ? e : 0 : 0 === e ? e : 0; }(e), n = t % 1; return t == t ? n ? t - n : t : 0; }
function C(e) { return e; }
var I = "[object AsyncFunction]", B = "[object Function]", E = "[object GeneratorFunction]", z = "[object Proxy]";
function D(e) { if (!_(e))
return !1; var t = p(e); return t == B || t == E || t == I || t == z; }
var U, q = r["__core-js_shared__"], F = (U = /[^.]+$/.exec(q && q.keys && q.keys.IE_PROTO || "")) ? "Symbol(src)_1." + U : "";
var R = Function.prototype.toString;
var L = /^\[object .+?Constructor\]$/, M = Function.prototype, K = Object.prototype, N = M.toString, H = K.hasOwnProperty, G = RegExp("^" + N.call(H).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
function J(e) { return !(!_(e) || (t = e, F && F in t)) && (D(e) ? G : L).test(function (e) { if (null != e) {
try {
return R.call(e);
}
catch (e) { }
try {
return e + "";
}
catch (e) { }
} return ""; }(e)); var t; }
var X = Date.now;
var $, W, V, Y = function () { try {
var e = J(t = function (e, t) { return null == e ? void 0 : e[t]; }(Object, "defineProperty")) ? t : void 0;
return e({}, "", {}), e;
}
catch (e) { } var t; }(), Z = Y, Q = Z ? function (e, t) { return Z(e, "toString", { configurable: !0, enumerable: !1, value: (n = t, function () { return n; }), writable: !0 }); var n; } : C, ee = ($ = Q, W = 0, V = 0, function () { var e = X(), t = 16 - (e - V); if (V = e, t > 0) {
if (++W >= 800)
return arguments[0];
}
else
W = 0; return $.apply(void 0, arguments); }), te = ee;
function ne(e, t) { for (var n = -1, r = null == e ? 0 : e.length; ++n < r && !1 !== t(e[n], n, e);)
; return e; }
var re = 9007199254740991, oe = /^(?:0|[1-9]\d*)$/;
function ie(e, t) { var n = typeof e; return !!(t = null == t ? re : t) && ("number" == n || "symbol" != n && oe.test(e)) && e > -1 && e % 1 == 0 && e < t; }
function ae(e, t) { return e === t || e != e && t != t; }
var ce = Math.max;
var ue = 9007199254740991;
function se(e) { return "number" == typeof e && e > -1 && e % 1 == 0 && e <= ue; }
function le(e) { return null != e && se(e.length) && !D(e); }
var fe = Object.prototype;
function de(e) { var t = e && e.constructor; return e === ("function" == typeof t && t.prototype || fe); }
function pe(e) { return h(e) && "[object Arguments]" == p(e); }
var he = Object.prototype, ve = he.hasOwnProperty, me = he.propertyIsEnumerable, ye = pe(function () { return arguments; }()) ? pe : function (e) { return h(e) && ve.call(e, "callee") && !me.call(e, "callee"); }, ge = ye;
var be = "object" == typeof e && e && !e.nodeType && e, _e = be && "object" == typeof module && module && !module.nodeType && module, ke = _e && _e.exports === be ? r.Buffer : void 0, we = (ke ? ke.isBuffer : void 0) || function () { return !1; }, Se = {};
Se["[object Float32Array]"] = Se["[object Float64Array]"] = Se["[object Int8Array]"] = Se["[object Int16Array]"] = Se["[object Int32Array]"] = Se["[object Uint8Array]"] = Se["[object Uint8ClampedArray]"] = Se["[object Uint16Array]"] = Se["[object Uint32Array]"] = !0, Se["[object Arguments]"] = Se["[object Array]"] = Se["[object ArrayBuffer]"] = Se["[object Boolean]"] = Se["[object DataView]"] = Se["[object Date]"] = Se["[object Error]"] = Se["[object Function]"] = Se["[object Map]"] = Se["[object Number]"] = Se["[object Object]"] = Se["[object RegExp]"] = Se["[object Set]"] = Se["[object String]"] = Se["[object WeakMap]"] = !1;
var je = "object" == typeof e && e && !e.nodeType && e, Oe = je && "object" == typeof module && module && !module.nodeType && module, xe = Oe && Oe.exports === je && t.process, Te = function () { try {
var e = Oe && Oe.require && Oe.require("util").types;
return e || xe && xe.binding && xe.binding("util");
}
catch (e) { } }(), Ae = Te && Te.isTypedArray, Pe = Ae ? function (e) { return function (t) { return e(t); }; }(Ae) : function (e) { return h(e) && se(e.length) && !!Se[p(e)]; }, Ce = Pe, Ie = Object.prototype.hasOwnProperty;
function Be(e, t) { var n = m(e), r = !n && ge(e), o = !n && !r && we(e), i = !n && !r && !o && Ce(e), a = n || r || o || i, c = a ? function (e, t) { for (var n = -1, r = Array(e); ++n < e;)
r[n] = t(n); return r; }(e.length, String) : [], u = c.length; for (var s in e)
!t && !Ie.call(e, s) || a && ("length" == s || o && ("offset" == s || "parent" == s) || i && ("buffer" == s || "byteLength" == s || "byteOffset" == s) || ie(s, u)) || c.push(s); return c; }
function Ee(e, t) { return function (n) { return e(t(n)); }; }
var ze = Ee(Object.keys, Object), De = Object.prototype.hasOwnProperty;
function Ue(e) { return le(e) ? Be(e) : function (e) { if (!de(e))
return ze(e); var t = []; for (var n in Object(e))
De.call(e, n) && "constructor" != n && t.push(n); return t; }(e); }
var qe = Object.prototype.hasOwnProperty;
function Fe(e) { if (!_(e))
return function (e) { var t = []; if (null != e)
for (var n in Object(e))
t.push(n); return t; }(e); var t = de(e), n = []; for (var r in e)
("constructor" != r || !t && qe.call(e, r)) && n.push(r); return n; }
function Re(e) { return le(e) ? Be(e, !0) : Fe(e); }
var Le = Ee(Object.getPrototypeOf, Object), Me = "[object Object]", Ke = Function.prototype, Ne = Object.prototype, He = Ke.toString, Ge = Ne.hasOwnProperty, Je = He.call(Object);
var $e = function (e, t, n) { for (var r = -1, o = Object(e), i = n(e), a = i.length; a--;) {
var c = i[++r];
if (!1 === t(o[c], c, o))
break;
} return e; };
var We = function (e, t) { return function (n, r) { if (null == n)
return n; if (!le(n))
return e(n, r); for (var o = n.length, i = t ? o : -1, a = Object(n); (t ? i-- : ++i < o) && !1 !== r(a[i], i, a);)
; return n; }; }((function (e, t) { return e && $e(e, t, Ue); })), Ve = We, Ye = Object.prototype, Ze = Ye.hasOwnProperty, Qe = function (e, t) { return te(function (e, t, n) { return t = ce(void 0 === t ? e.length - 1 : t, 0), function () { for (var r = arguments, o = -1, i = ce(r.length - t, 0), a = Array(i); ++o < i;)
a[o] = r[t + o]; o = -1; for (var c = Array(t + 1); ++o < t;)
c[o] = r[o]; return c[t] = n(a), function (e, t, n) { switch (n.length) {
case 0: return e.call(t);
case 1: return e.call(t, n[0]);
case 2: return e.call(t, n[0], n[1]);
case 3: return e.call(t, n[0], n[1], n[2]);
} return e.apply(t, n); }(e, this, c); }; }(e, t, C), e + ""); }((function (e, t) { e = Object(e); var n = -1, r = t.length, o = r > 2 ? t[2] : void 0; for (o && function (e, t, n) { if (!_(n))
return !1; var r = typeof t; return !!("number" == r ? le(n) && ie(t, n.length) : "string" == r && t in n) && ae(n[t], e); }(t[0], t[1], o) && (r = 1); ++n < r;)
for (var i = t[n], a = Re(i), c = -1, u = a.length; ++c < u;) {
var s = a[c], l = e[s];
(void 0 === l || ae(l, Ye[s]) && !Ze.call(e, s)) && (e[s] = i[s]);
} return e; })), et = Qe;
function tt(e, t) { var n; return (m(e) ? ne : Ve)(e, "function" == typeof (n = t) ? n : C); }
var nt = "[object String]";
function rt(e) { return "string" == typeof e || !m(e) && h(e) && p(e) == nt; }
function ot(e) { return !0 === e || !1 === e || h(e) && "[object Boolean]" == p(e); }
function it(e) { return h(e) && 1 === e.nodeType && !function (e) { if (!h(e) || p(e) != Me)
return !1; var t = Le(e); if (null === t)
return !0; var n = Ge.call(t, "constructor") && t.constructor; return "function" == typeof n && n instanceof n && He.call(n) == Je; }(e); }
function at(e) { return "number" == typeof e && e == P(e); }
function ct(e) { return "number" == typeof e || h(e) && "[object Number]" == p(e); }
function ut(e) { return function (t) { return Object.prototype.toString.call(t) === "[object ".concat(e, "]"); }; }
function st(e) { return ut("Blob")(e); }
function lt(e) { return ut("File")(e); }
function ft(e) { return ut("FileList")(e); }
function dt(e, t) { return Array.prototype.slice.call(e).map(t); }
function pt(e, t) { return Array.prototype.slice.call(e).every(t); }
function ht(e, t) { return [e, t].reduce((function (e, t) { return e.filter((function (e) { return -1 === t.indexOf(e); })); })); }
function vt(e) { return Object.keys(e || {}); }
function mt() { }
function yt(e) { return it(e) ? e : rt(e) ? document.querySelector(e) : null; }
function gt(e, t, n) { e.addEventListener && e.addEventListener(t, n, !1); }
function bt(e, t, n) { e.removeEventListener && e.removeEventListener(t, n, !1); }
function _t(e) { var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1] ? encodeURIComponent : function (e) { return e; }; return dt(vt(e), (function (n) { var r = e[n]; return t(n) + "=" + t(h(r) ? JSON.stringify(r) : r); })).join("&"); }
function kt(e) { if (!m(e))
throw new Error("elements should be an Array"); return function (t) { return e.indexOf(t) > -1; }; }
function wt(e) { if (!m(e))
throw new Error("validators should be an Array"); return function (t) { return e.some((function (e) { return e(t); })); }; }
function St(e, t) { var n = Object.keys(e); if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
t && (r = r.filter((function (t) { return Object.getOwnPropertyDescriptor(e, t).enumerable; }))), n.push.apply(n, r);
} return n; }
function jt(e) { for (var t = 1; t < arguments.length; t++) {
var n = null != arguments[t] ? arguments[t] : {};
t % 2 ? St(Object(n), !0).forEach((function (t) { At(e, t, n[t]); })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : St(Object(n)).forEach((function (t) { Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t)); }));
} return e; }
function Ot(e, t) { if (!(e instanceof t))
throw new TypeError("Cannot call a class as a function"); }
function xt(e, t) { for (var n = 0; n < t.length; n++) {
var r = t[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, Rt(r.key), r);
} }
function Tt(e, t, n) { return t && xt(e.prototype, t), n && xt(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function At(e, t, n) { return (t = Rt(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e; }
function Pt(e, t) { if ("function" != typeof t && null !== t)
throw new TypeError("Super expression must either be null or a function"); e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && It(e, t); }
function Ct(e) { return Ct = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (e) { return e.__proto__ || Object.getPrototypeOf(e); }, Ct(e); }
function It(e, t) { return It = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (e, t) { return e.__proto__ = t, e; }, It(e, t); }
function Bt(e, t) { if (null == e)
return {}; var n, r, o = function (e, t) { if (null == e)
return {}; var n, r, o = {}, i = Object.keys(e); for (r = 0; r < i.length; r++)
n = i[r], t.indexOf(n) >= 0 || (o[n] = e[n]); return o; }(e, t); if (Object.getOwnPropertySymbols) {
var i = Object.getOwnPropertySymbols(e);
for (r = 0; r < i.length; r++)
n = i[r], t.indexOf(n) >= 0 || Object.prototype.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
} return o; }
function Et(e, t) { if (t && ("object" == typeof t || "function" == typeof t))
return t; if (void 0 !== t)
throw new TypeError("Derived constructors may only return object or undefined"); return function (e) { if (void 0 === e)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }(e); }
function zt(e) { var t = function () { if ("undefined" == typeof Reflect || !Reflect.construct)
return !1; if (Reflect.construct.sham)
return !1; if ("function" == typeof Proxy)
return !0; try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () { }))), !0;
}
catch (e) {
return !1;
} }(); return function () { var n, r = Ct(e); if (t) {
var o = Ct(this).constructor;
n = Reflect.construct(r, arguments, o);
}
else
n = r.apply(this, arguments); return Et(this, n); }; }
function Dt(e, t) { return function (e) { if (Array.isArray(e))
return e; }(e) || function (e, t) { var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"]; if (null != n) {
var r, o, i, a, c = [], u = !0, s = !1;
try {
if (i = (n = n.call(e)).next, 0 === t) {
if (Object(n) !== n)
return;
u = !1;
}
else
for (; !(u = (r = i.call(n)).done) && (c.push(r.value), c.length !== t); u = !0)
;
}
catch (e) {
s = !0, o = e;
}
finally {
try {
if (!u && null != n.return && (a = n.return(), Object(a) !== a))
return;
}
finally {
if (s)
throw o;
}
}
return c;
} }(e, t) || qt(e, t) || function () { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }(); }
function Ut(e) { return function (e) { if (Array.isArray(e))
return Ft(e); }(e) || function (e) { if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"])
return Array.from(e); }(e) || qt(e) || function () { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }(); }
function qt(e, t) { if (e) {
if ("string" == typeof e)
return Ft(e, t);
var n = Object.prototype.toString.call(e).slice(8, -1);
return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Ft(e, t) : void 0;
} }
function Ft(e, t) { (null == t || t > e.length) && (t = e.length); for (var n = 0, r = new Array(t); n < t; n++)
r[n] = e[n]; return r; }
function Rt(e) { var t = function (e, t) { if ("object" != typeof e || null === e)
return e; var n = e[Symbol.toPrimitive]; if (void 0 !== n) {
var r = n.call(e, t || "default");
if ("object" != typeof r)
return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
} return ("string" === t ? String : Number)(e); }(e, "string"); return "symbol" == typeof t ? t : String(t); }
var Lt = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
function Mt(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; }
var Kt = function () { function e(e) { var n = {}, r = /(dolfin)[ \/]([\w.]+)/.exec(e) || /(edge)[ \/]([\w.]+)/.exec(e) || /(chrome)[ \/]([\w.]+)/.exec(e) || /(tizen)[ \/]([\w.]+)/.exec(e) || /(opera)(?:.*version)?[ \/]([\w.]+)/.exec(e) || /(webkit)(?:.*version)?[ \/]([\w.]+)/.exec(e) || /(msie) ([\w.]+)/.exec(e) || e.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+))?/.exec(e) || ["", "unknown"]; return "webkit" === r[1] ? r = /(iphone|ipad|ipod)[\S\s]*os ([\w._\-]+) like/.exec(e) || /(android)[ \/]([\w._\-]+);/.exec(e) || [r[0], "safari", r[2]] : "mozilla" === r[1] ? /trident/.test(e) ? r[1] = "msie" : r[1] = "firefox" : /polaris|natebrowser|([010|011|016|017|018|019]{3}\d{3,4}\d{4}$)/.test(e) && (r[1] = "polaris"), n[r[1]] = !0, n.name = r[1], n.version = t(r[2]), n; } function t(e) { var t = {}, n = e ? e.split(/\.|-|_/) : ["0", "0", "0"]; return t.info = n.join("."), t.major = n[0] || "0", t.minor = n[1] || "0", t.patch = n[2] || "0", t; } function n(e) { return function (e) { if (e.match(/ipad/) || e.match(/android/) && !e.match(/mobi|mini|fennec/) || e.match(/macintosh/) && window.navigator.maxTouchPoints > 1)
return !0; return !1; }(e) ? "tablet" : function (e) { if (e.match(/linux|windows (nt|98)|macintosh|cros/) && !e.match(/android|mobile|polaris|lgtelecom|uzard|natebrowser|ktf;|skt;/))
return !0; return !1; }(e) ? "pc" : function (e) { return !!e.match(/ip(hone|od)|android.+mobile|windows (ce|phone)|blackberry|bb10|symbian|webos|firefox.+fennec|opera m(ob|in)i|tizen.+mobile|polaris|iemobile|lgtelecom|nokia|sonyericsson|dolfin|uzard|natebrowser|ktf;|skt;/); }(e) ? "mobile" : ""; } function r(e) { var n = {}, r = /(iphone|ipad|ipod)[\S\s]*os ([\w._\-]+) like/.exec(e) || !!/polaris|natebrowser|([010|011|016|017|018|019]{3}\d{3,4}\d{4}$)/.test(e) && ["", "polaris", "0.0.0"] || /(windows)(?: nt | phone(?: os){0,1} | )([\w._\-]+)/.exec(e) || /(android)[ \/]([\w._\-]+);/.exec(e) || !!/android/.test(e) && ["", "android", "0.0.0"] || !!/(windows)/.test(e) && ["", "windows", "0.0.0"] || /(mac) os x ([\w._\-]+)/.exec(e) || /(tizen)[ \/]([\w._\-]+);/.exec(e) || !!/(linux)/.test(e) && ["", "linux", "0.0.0"] || !!/webos/.test(e) && ["", "webos", "0.0.0"] || /(cros)(?:\s[\w]+\s)([\d._\-]+)/.exec(e) || /(bada)[ \/]([\w._\-]+)/.exec(e) || !!/bada/.test(e) && ["", "bada", "0.0.0"] || !!/(rim|blackberry|bb10)/.test(e) && ["", "blackberry", "0.0.0"] || ["", "unknown", "0.0.0"]; return "iphone" === r[1] || "ipad" === r[1] || "ipod" === r[1] ? r[1] = "ios" : "windows" === r[1] && "98" === r[2] && (r[2] = "0.98.0"), "mac" === r[1] && "undefined" != typeof window && window.navigator.maxTouchPoints > 1 && (r[1] = "ios"), "cros" === r[1] && (r[1] = "chrome"), n[r[1]] = !0, n.name = r[1], n.version = t(r[2]), n; } Array.isArray || (Array.isArray = function (e) { return "[object Array]" === Object.prototype.toString.call(e); }); var o = ["crios", "fxios", "daumapps"]; function i(e, n) { var r = {}, i = null, a = o; Array.isArray(n) ? a = o.concat(n) : "string" == typeof n && (a = o.concat([n])); for (var c = 0, u = a.length; c < u; c += 1) {
var s = a[c];
if (i = new RegExp("(" + s + ")[ \\/]([\\w._\\-]+)").exec(e))
break;
} return i || (i = ["", ""]), i[1] ? (r.isApp = !0, r.name = i[1], r.version = t(i[2])) : r.isApp = !1, r; } return function (t, o) { var a = function (e) { return e ? e.toLowerCase() : "undefined" != typeof window && window.navigator && "string" == typeof window.navigator.userAgent ? window.navigator.userAgent.toLowerCase() : ""; }(t); return { ua: a, browser: e(a), platform: n(a), os: r(a), app: i(a, o) }; }; }(), Nt = Mt(Kt)();
var Ht, Gt, Jt, Xt, $t = "https://kauth.kakao.com", Wt = (Ht = location, Gt = Ht.protocol, Jt = Ht.hostname, Xt = Ht.port, "".concat(Gt, "//").concat(Jt).concat(Xt ? ":" + Xt : "")), Vt = Nt, Yt = /KAKAOTALK/i.test(Vt.ua), Zt = Vt.os.ios && "tablet" === Vt.platform, Qt = "2.7.2".concat(""), en = navigator, tn = ["sdk/".concat(Qt), "os/javascript", "sdk_type/javascript", "lang/".concat(en.userLanguage || en.language), "device/".concat(en.platform.replace(/ /g, "_")), "origin/".concat(encodeURIComponent(Wt))].join(" "), nn = { apiDomain: "https://kapi.kakao.com", accountDomain: "https://accounts.kakao.com", authDomain: $t, authorize: "".concat($t, "/oauth/authorize"), redirectUri: "JS-SDK", universalKakaoLink: "".concat("https://talk-apps.kakao.com", "/scheme/"), talkInappScheme: "kakaotalk://inappbrowser", talkSyncpluginScheme: "kakaotalk://bizplugin?plugin_id=6011263b74fc2b49c73a7298", sharerDomain: "https://sharer.kakao.com", pickerDomain: "https://friend-picker.kakao.com", appsDomain: "https://apps.kakao.com", talkLinkScheme: "kakaolink://send", talkAndroidPackage: "com.kakao.talk", channel: "https://pf.kakao.com", talkChannelScheme: "kakaoplus://plusfriend", channelIcon: "".concat("https://developers.kakao.com", "/assets/img/about/logos/channel"), naviScheme: "kakaonavi-sdk://navigate", naviFallback: "https://kakaonavi.kakao.com/launch/index.do" }, rn = null;
function on() { return rn; }
function an(e) { rn = e; }
function cn(e) { Error.prototype.constructor.apply(this, arguments), this.name = "KakaoError", this.message = e; }
function un(e) { var t = e.reduce((function (e, t) { return jt(jt({}, e), t); }), {}); return jt(jt({}, t), {}, { cleanup: function () { tt(e, (function (e) { return e.cleanup && e.cleanup(); })); } }); }
function sn(e) { tt(e, (function (e) { e(); })), e.length = 0; }
function ln() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0, n = arguments.length > 2 ? arguments[2] : void 0; if (!h(e))
throw new Error("params should be an Object"); D(t.before) && t.before(e), D(t.defaults) ? et(e, t.defaults(e)) : et(e, t.defaults); var r = t.required, o = void 0 === r ? {} : r, i = t.optional, a = void 0 === i ? {} : i, c = ht(vt(o), vt(e)); if (c.length > 0)
throw new cn("Missing required keys: ".concat(c.join(","), " at ").concat(n)); var u = jt(jt({}, o), a), s = ht(vt(e), vt(u)); if (s.length > 0)
throw new cn("Invalid parameter keys: ".concat(s.join(","), " at ").concat(n)); return tt(e, (function (e, t) { !function (e, t, n) { if (!1 === t(e))
throw new cn("Illegal argument for ".concat(n)); }(e, u[t], '"'.concat(t, '" in ').concat(n)); })), D(t.after) && t.after(e), e; }
function fn(e) { var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"; return dt((window.crypto || window.msCrypto).getRandomValues(new Uint8Array(e)), (function (e) { return t[e % 66]; })).join(""); }
function dn(e, t) { if (Vt.os.android) {
var n = JSON.stringify({ appKey: rn, KA: tn });
return "market://details?id=".concat(e, "&referrer=").concat(n);
} return Vt.os.ios ? "https://itunes.apple.com/app/id".concat(t) : location.href; }
cn.prototype = new Error;
var pn = {};
function hn(e, t, n) { var r = pn[t]; return r && r.close && !r.closed && r.close(), pn[t] = window.open(e, t, n), pn[t]; }
function vn() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 480, t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 700, n = window.screenLeft ? window.screenLeft : window.screenX ? window.screenX : 0, r = window.screenTop ? window.screenTop : window.screenY ? window.screenY : 0; return ["width=".concat(e), "height=".concat(t), "left=".concat(screen.width / 2 - e / 2 + n), "top=".concat(screen.height / 2 - t / 2 + r), "scrollbars=yes", "resizable=1"].join(","); }
function mn(e, t, n) { tt(n, (function (n, r) { var o = t.getAttribute(n); null !== o && (e[r] = "true" === o || "false" === o ? "true" === o : o); })); }
function yn(e, t) { var n = document.createElement("iframe"); return n.id = n.name = e, n.src = t, n.setAttribute("style", "border:none; width:0; height:0; display:none; overflow:hidden;"), document.body.appendChild(n), n; }
function gn(e, t, n, r) { var o = Vt.browser.msie ? {} : hn(e, n, r || vn()); return o.focus && o.focus(), bn(e, t, n), o; }
function bn(e, t) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "_self", r = document.createElement("form"); r.setAttribute("accept-charset", "utf-8"), r.setAttribute("method", "post"), r.setAttribute("action", e), r.setAttribute("target", n), r.setAttribute("style", "display:none"), tt(t, (function (e, t) { var n = document.createElement("input"); n.type = "hidden", n.name = t, n.value = rt(e) ? e : JSON.stringify(e), r.appendChild(n); })), document.body.appendChild(r), r.submit(), document.body.removeChild(r); }
var _n = { exports: {} };
!function (e, t) { e.exports = function () { function e(e) { var t = typeof e; return null !== e && ("object" === t || "function" === t); } function t(e) { return "function" == typeof e; } var n = Array.isArray ? Array.isArray : function (e) { return "[object Array]" === Object.prototype.toString.call(e); }, r = 0, o = void 0, i = void 0, a = function (e, t) { b[r] = e, b[r + 1] = t, 2 === (r += 2) && (i ? i(_) : w()); }; function c(e) { i = e; } function u(e) { a = e; } var s = "undefined" != typeof window ? window : void 0, l = s || {}, f = l.MutationObserver || l.WebKitMutationObserver, d = "undefined" == typeof self && "undefined" != typeof process && "[object process]" === {}.toString.call(process), p = "undefined" != typeof Uint8ClampedArray && "undefined" != typeof importScripts && "undefined" != typeof MessageChannel; function h() { return function () { return process.nextTick(_); }; } function v() { return void 0 !== o ? function () { o(_); } : g(); } function m() { var e = 0, t = new f(_), n = document.createTextNode(""); return t.observe(n, { characterData: !0 }), function () { n.data = e = ++e % 2; }; } function y() { var e = new MessageChannel; return e.port1.onmessage = _, function () { return e.port2.postMessage(0); }; } function g() { var e = setTimeout; return function () { return e(_, 1); }; } var b = new Array(1e3); function _() { for (var e = 0; e < r; e += 2)
(0, b[e])(b[e + 1]), b[e] = void 0, b[e + 1] = void 0; r = 0; } function k() { try {
var e = Function("return this")().require("vertx");
return o = e.runOnLoop || e.runOnContext, v();
}
catch (e) {
return g();
} } var w = void 0; function S(e, t) { var n = this, r = new this.constructor(x); void 0 === r[O] && J(r); var o = n._state; if (o) {
var i = arguments[o - 1];
a((function () { return K(o, r, i, n._result); }));
}
else
L(n, r, e, t); return r; } function j(e) { var t = this; if (e && "object" == typeof e && e.constructor === t)
return e; var n = new t(x); return U(n, e), n; } w = d ? h() : f ? m() : p ? y() : void 0 === s ? k() : g(); var O = Math.random().toString(36).substring(2); function x() { } var T = void 0, A = 1, P = 2; function C() { return new TypeError("You cannot resolve a promise with itself"); } function I() { return new TypeError("A promises callback cannot return that same promise."); } function B(e, t, n, r) { try {
e.call(t, n, r);
}
catch (e) {
return e;
} } function E(e, t, n) { a((function (e) { var r = !1, o = B(n, t, (function (n) { r || (r = !0, t !== n ? U(e, n) : F(e, n)); }), (function (t) { r || (r = !0, R(e, t)); }), "Settle: " + (e._label || " unknown promise")); !r && o && (r = !0, R(e, o)); }), e); } function z(e, t) { t._state === A ? F(e, t._result) : t._state === P ? R(e, t._result) : L(t, void 0, (function (t) { return U(e, t); }), (function (t) { return R(e, t); })); } function D(e, n, r) { n.constructor === e.constructor && r === S && n.constructor.resolve === j ? z(e, n) : void 0 === r ? F(e, n) : t(r) ? E(e, n, r) : F(e, n); } function U(t, n) { if (t === n)
R(t, C());
else if (e(n)) {
var r = void 0;
try {
r = n.then;
}
catch (e) {
return void R(t, e);
}
D(t, n, r);
}
else
F(t, n); } function q(e) { e._onerror && e._onerror(e._result), M(e); } function F(e, t) { e._state === T && (e._result = t, e._state = A, 0 !== e._subscribers.length && a(M, e)); } function R(e, t) { e._state === T && (e._state = P, e._result = t, a(q, e)); } function L(e, t, n, r) { var o = e._subscribers, i = o.length; e._onerror = null, o[i] = t, o[i + A] = n, o[i + P] = r, 0 === i && e._state && a(M, e); } function M(e) { var t = e._subscribers, n = e._state; if (0 !== t.length) {
for (var r = void 0, o = void 0, i = e._result, a = 0; a < t.length; a += 3)
r = t[a], o = t[a + n], r ? K(n, r, o, i) : o(i);
e._subscribers.length = 0;
} } function K(e, n, r, o) { var i = t(r), a = void 0, c = void 0, u = !0; if (i) {
try {
a = r(o);
}
catch (e) {
u = !1, c = e;
}
if (n === a)
return void R(n, I());
}
else
a = o; n._state !== T || (i && u ? U(n, a) : !1 === u ? R(n, c) : e === A ? F(n, a) : e === P && R(n, a)); } function N(e, t) { try {
t((function (t) { U(e, t); }), (function (t) { R(e, t); }));
}
catch (t) {
R(e, t);
} } var H = 0; function G() { return H++; } function J(e) { e[O] = H++, e._state = void 0, e._result = void 0, e._subscribers = []; } function X() { return new Error("Array Methods must be provided an Array"); } var $ = function () { function e(e, t) { this._instanceConstructor = e, this.promise = new e(x), this.promise[O] || J(this.promise), n(t) ? (this.length = t.length, this._remaining = t.length, this._result = new Array(this.length), 0 === this.length ? F(this.promise, this._result) : (this.length = this.length || 0, this._enumerate(t), 0 === this._remaining && F(this.promise, this._result))) : R(this.promise, X()); } return e.prototype._enumerate = function (e) { for (var t = 0; this._state === T && t < e.length; t++)
this._eachEntry(e[t], t); }, e.prototype._eachEntry = function (e, t) { var n = this._instanceConstructor, r = n.resolve; if (r === j) {
var o = void 0, i = void 0, a = !1;
try {
o = e.then;
}
catch (e) {
a = !0, i = e;
}
if (o === S && e._state !== T)
this._settledAt(e._state, t, e._result);
else if ("function" != typeof o)
this._remaining--, this._result[t] = e;
else if (n === ee) {
var c = new n(x);
a ? R(c, i) : D(c, e, o), this._willSettleAt(c, t);
}
else
this._willSettleAt(new n((function (t) { return t(e); })), t);
}
else
this._willSettleAt(r(e), t); }, e.prototype._settledAt = function (e, t, n) { var r = this.promise; r._state === T && (this._remaining--, e === P ? R(r, n) : this._result[t] = n), 0 === this._remaining && F(r, this._result); }, e.prototype._willSettleAt = function (e, t) { var n = this; L(e, void 0, (function (e) { return n._settledAt(A, t, e); }), (function (e) { return n._settledAt(P, t, e); })); }, e; }(); function W(e) { return new $(this, e).promise; } function V(e) { var t = this; return n(e) ? new t((function (n, r) { for (var o = e.length, i = 0; i < o; i++)
t.resolve(e[i]).then(n, r); })) : new t((function (e, t) { return t(new TypeError("You must pass an array to race.")); })); } function Y(e) { var t = new this(x); return R(t, e), t; } function Z() { throw new TypeError("You must pass a resolver function as the first argument to the promise constructor"); } function Q() { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."); } var ee = function () { function e(t) { this[O] = G(), this._result = this._state = void 0, this._subscribers = [], x !== t && ("function" != typeof t && Z(), this instanceof e ? N(this, t) : Q()); } return e.prototype.catch = function (e) { return this.then(null, e); }, e.prototype.finally = function (e) { var n = this, r = n.constructor; return t(e) ? n.then((function (t) { return r.resolve(e()).then((function () { return t; })); }), (function (t) { return r.resolve(e()).then((function () { throw t; })); })) : n.then(e, e); }, e; }(); function te() { var e = void 0; if (void 0 !== Lt)
e = Lt;
else if ("undefined" != typeof self)
e = self;
else
try {
e = Function("return this")();
}
catch (e) {
throw new Error("polyfill failed because global object is unavailable in this environment");
} var t = e.Promise; if (t) {
var n = null;
try {
n = Object.prototype.toString.call(t.resolve());
}
catch (e) { }
if ("[object Promise]" === n && !t.cast)
return;
} e.Promise = ee; } return ee.prototype.then = S, ee.all = W, ee.race = V, ee.resolve = j, ee.reject = Y, ee._setScheduler = c, ee._setAsap = u, ee._asap = a, ee.polyfill = te, ee.Promise = ee, ee; }(); }(_n);
var kn = _n.exports;
function wn(e) { return new kn.Promise((function (t, n) { !function (e, t) { var n = e.url, r = e.method, o = e.headers, i = e.data, a = new XMLHttpRequest; a.open(r, n), function (e) { var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; Object.keys(t).forEach((function (n) { e.setRequestHeader(n, t[n]); })); }(a, o), a.onreadystatechange = function () { a.readyState === XMLHttpRequest.DONE && t(a); }, a.send(i); }(e, (function (e) { var r = e.status, o = function (e) { try {
return JSON.parse(e);
}
catch (t) {
return e;
} }(e.response); 200 === r ? t(o) : n(o); })); })); }
Mt(kn);
var Sn = {};
var jn = { subscribe: function (e, t) { Sn[e] = Sn[e] || [], Sn[e].push(t); }, unsubscribe: function (e, t) { for (var n = Sn[e], r = 0; r < n.length; r++)
if (n[r] === t)
return void n.splice(r, 1); }, dispatch: function (e) { tt(Sn[e], (function (e) { e(); })); } }, On = function () { function e(t, n) { Ot(this, e), this._interval = t, this._maxCount = n, this._count = 0, this._stopped = !1, this._timeout = null; } return Tt(e, [{ key: "start", value: function (e, t) { null !== this._timeout && this.stop(), this._count = 0, this._stopped = !1, this._doPolling(e, t); } }, { key: "_doPolling", value: function (e, t) { var n = this; this._stopped || (this._timeout = setTimeout((function () { ++n._count > n._maxCount ? t() : (e(), n._doPolling(e, t)); }), this._interval)); } }, { key: "stop", value: function () { this._stopped = !0, clearTimeout(this._timeout), this._timeout = null; } }]), e; }(), xn = { optional: { close: D, returnUrl: rt, forceMobileLayout: ot, enableBackButton: ot }, defaults: { close: mt, forceMobileLayout: !1, enableBackButton: !0 } }, Tn = { authorize: { optional: { redirectUri: rt, state: rt, prompt: rt, scope: rt, isPopup: ot, throughTalk: ot, throughSyncplugin: ot, serviceTerms: rt, channelPublicId: rt, deviceType: kt(["watch", "tv"]), loginHint: rt, nonce: rt, settleId: rt, kauth_tx_id: rt }, defaults: { isPopup: !1, throughTalk: !0, throughSyncplugin: !0 } }, authorizeForCert: { required: { redirectUri: rt, settleId: rt, signData: rt }, optional: { state: rt, prompt: rt, scope: rt, throughTalk: ot, throughSyncplugin: ot, serviceTerms: rt, channelPublicId: rt, deviceType: kt(["watch", "tv"]), loginHint: rt, nonce: rt, identifyItems: rt }, defaults: { throughTalk: !0, throughSyncplugin: !0 } }, selectShippingAddress: xn, createShippingAddress: xn, updateShippingAddress: jt({ required: { addressId: at } }, xn) };
function An(e) { return e.throughSyncplugin && Yt && /ch-home|PFHOME/i.test(Vt.ua); }
function Pn(e, t) { return !!(e && e.indexOf(t) > -1); }
function Cn(e) { return "".concat(nn.authorize, "?").concat(_t(e)); }
function In(e) { return jt(jt({}, function (e) { var t = { client_id: on() }; return e.scope && (t.scope = e.scope), e.prompt && (t.prompt = e.prompt), e.state && (t.state = e.state), e.nonce && (t.nonce = e.nonce), e.loginHint && (t.login_hint = e.loginHint), e.settleId && (t.settle_id = e.settleId), e.kauth_tx_id && (t.kauth_tx_id = e.kauth_tx_id), e.deviceType && (t.device_type = e.deviceType), e.channelPublicId && (t.channel_public_id = e.channelPublicId), (e.serviceTerms || "" === e.serviceTerms) && (t["extra.service_terms"] = e.serviceTerms), t; }(e)), {}, { redirect_uri: e.redirectUri || nn.redirectUri, response_type: "code", auth_tran_id: fn(60) }); }
function Bn(e, t) { return jt(jt({}, t), {}, { ka: tn, is_popup: e.isPopup }); }
var En = ["status", "error_code"], zn = ["settleId", "signData", "identifyItems"], Dn = new On(1e3, 600);
function Un(e) { if (e = ln(e, Tn.authorize, "Auth.authorize"), Pn(e.prompt, "none") && !Yt) {
var t = jt({ error: "auto_login", error_description: "NOT_SUPPORTED_BROWSER" }, e.state && { state: e.state });
return Fn(e, t), kn.Promise.reject(t);
} var n, r, o, i; if (jn.dispatch("LOGIN_START"), r = (n = e).throughSyncplugin, o = n.isPopup, i = n.prompt, !An({ throughSyncplugin: r }) || !1 !== o || Pn(i, "cert") || !window.kakaoweb || "function" != typeof window.kakaoweb.reqSignInLocation)
return qn(e); (function (e) { var t = In(e), n = Bn(e, t), r = _t(jt(jt({}, n), {}, { is_popup: !1, prompt: "none" })); return kakaoweb.reqSignInLocation(r).then((function (t) { var n = Object.fromEntries(new window.URL(t).searchParams); return "consent_required" === n.error && !Pn(e.prompt, "none") || "interaction_required" === n.error || (Fn(e, n), !1); })).catch((function (e) { return !1; })); })(e).then((function (t) { t && qn(e); })); }
function qn(e) { var t, n, r, o, i, a, c = In(e), u = Bn(e, c), s = (n = (t = e).prompt, r = t.throughTalk, o = !(!Vt.os.ios && !Vt.os.android || Yt), i = Pn(n, "login"), a = Pn(n, "none"), r && o && !(Vt.os.android && /instagram|fb_iab/g.test(Vt.ua)) && !i && !a), l = An(e), f = Cn(u), d = s ? function (e, t, n) { var r = jt(jt({}, t), {}, { is_popup: !0 }), o = function () { return ["intent:#Intent", "action=com.kakao.talk.intent.action.CAPRI_LOGGED_IN_ACTIVITY", "launchFlags=0x08880000", "S.com.kakao.sdk.talk.appKey=".concat(on()), "S.com.kakao.sdk.talk.redirectUri=".concat(r.redirect_uri), "S.com.kakao.sdk.talk.kaHeader=".concat(tn), "S.com.kakao.sdk.talk.extraparams=".concat(encodeURIComponent(JSON.stringify(r)))].concat(Ut(e.state ? ["S.com.kakao.sdk.talk.state=".concat(e.state)] : []), ["S.browser_fallback_url=".concat(encodeURIComponent(n)), "end;"]).join(";"); }, i = function () { var t = Cn(r), o = e.isPopup ? t : n, i = "".concat(t, "&ka=").concat(encodeURIComponent(tn)), a = "".concat(nn.talkInappScheme, "?url=").concat(encodeURIComponent(i)); return "".concat(nn.universalKakaoLink).concat(encodeURIComponent(a), "&web=").concat(encodeURIComponent(o)); }; return Vt.os.android ? o() : i(); }(e, c, f) : f, p = null; return l ? function (e) { var t = jt(jt({}, e), {}, { is_popup: !0, approval_window_type: "v4_bizplugin" }), n = encodeURIComponent(_t(t)); location.href = "".concat(nn.talkSyncpluginScheme, "&query=").concat(n); }(u) : e.isPopup ? p = hn(d, "_blank", vn()) : location.href = d, new kn.Promise((function (t, n) { if (s || l || e.isPopup) {
var r = (o = c.auth_tran_id, { client_id: on(), auth_tran_id: o, ka: tn });
Dn.start((function () { var o; (o = r, wn({ method: "GET", url: "".concat(nn.authDomain, "/apiweb/code.json?").concat(_t(o)) })).then((function (r) { var o = function (e) { var t = e.status, n = e.error_code, r = Bt(e, En); if ("300" === n)
return null; "error" === t && "700" === n && (location.href = "".concat(nn.authDomain, "/error/network")); return r; }(r); null !== o && (Dn.stop(), p && p.close && p.close(), "700" !== r.error_code && (o.error ? n(o) : t(o), Fn(e, o))), !s && p && p.closed && Dn.stop(); })); }), (function () { var t = jt({ error: "timeout", error_description: "LOGIN_TIMEOUT" }, e.state && { state: e.state }); n(t), Fn(e, t); }));
} var o; })); }
function Fn(e, t) { var n = e.redirectUri; if (n) {
var r = n.indexOf("?") > -1 ? "&" : "?";
location.href = n + r + _t(t);
} }
var Rn, Ln = Object.freeze({ __proto__: null, authorize: Un, authorizeForCert: function (e) { var t = e = ln(e, Tn.authorizeForCert, "Auth.authorizeForCert"), n = t.settleId, r = t.signData, o = t.identifyItems, i = Bt(t, zn); (function (e, t, n) { var r = _t(jt({ cert_type: "k2100", client_id: on(), settle_id: e, sign_data: t }, n && { sign_identify_items: n })); return wn({ method: "POST", url: "".concat(nn.authorize, "/prepare"), headers: { "Content-Type": "application/x-www-form-urlencoded" }, data: r }); })(n, r, o).then((function (e) { var t = e.kauth_tx_id, n = i.prompt ? [i.prompt] : []; Pn(i.prompt, "cert") || n.push("cert"), Un(jt(jt({}, i), {}, { kauth_tx_id: t, prompt: n.join(",") })); })).catch((function (t) { var n = t.error, r = t.error_description; Fn(e, jt({ error: n, error_description: r }, e.state && { state: e.state })); })); } }), Mn = { exports: {} }, Kn = { exports: {} };
function Nn() { return Rn || (Rn = 1, function (e, t) { var n; e.exports = (n = n || function (e, t) { var n; if ("undefined" != typeof window && window.crypto && (n = window.crypto), "undefined" != typeof self && self.crypto && (n = self.crypto), "undefined" != typeof globalThis && globalThis.crypto && (n = globalThis.crypto), !n && "undefined" != typeof window && window.msCrypto && (n = window.msCrypto), !n && void 0 !== Lt && Lt.crypto && (n = Lt.crypto), !n)
try {
n = require("crypto");
}
catch (e) { } var r = function () { if (n) {
if ("function" == typeof n.getRandomValues)
try {
return n.getRandomValues(new Uint32Array(1))[0];
}
catch (e) { }
if ("function" == typeof n.randomBytes)
try {
return n.randomBytes(4).readInt32LE();
}
catch (e) { }
} throw new Error("Native crypto module could not be used to get secure random number."); }, o = Object.create || function () { function e() { } return function (t) { var n; return e.prototype = t, n = new e, e.prototype = null, n; }; }(), i = {}, a = i.lib = {}, c = a.Base = { extend: function (e) { var t = o(this); return e && t.mixIn(e), t.hasOwnProperty("init") && this.init !== t.init || (t.init = function () { t.$super.init.apply(this, arguments); }), t.init.prototype = t, t.$super = this, t; }, create: function () { var e = this.extend(); return e.init.apply(e, arguments), e; }, init: function () { }, mixIn: function (e) { for (var t in e)
e.hasOwnProperty(t) && (this[t] = e[t]); e.hasOwnProperty("toString") && (this.toString = e.toString); }, clone: function () { return this.init.prototype.extend(this); } }, u = a.WordArray = c.extend({ init: function (e, n) { e = this.words = e || [], this.sigBytes = n != t ? n : 4 * e.length; }, toString: function (e) { return (e || l).stringify(this); }, concat: function (e) { var t = this.words, n = e.words, r = this.sigBytes, o = e.sigBytes; if (this.clamp(), r % 4)
for (var i = 0; i < o; i++) {
var a = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
t[r + i >>> 2] |= a << 24 - (r + i) % 4 * 8;
}
else
for (var c = 0; c < o; c += 4)
t[r + c >>> 2] = n[c >>> 2]; return this.sigBytes += o, this; }, clamp: function () { var t = this.words, n = this.sigBytes; t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8, t.length = e.ceil(n / 4); }, clone: function () { var e = c.clone.call(this); return e.words = this.words.slice(0), e; }, random: function (e) { for (var t = [], n = 0; n < e; n += 4)
t.push(r()); return new u.init(t, e); } }), s = i.enc = {}, l = s.Hex = { stringify: function (e) { for (var t = e.words, n = e.sigBytes, r = [], o = 0; o < n; o++) {
var i = t[o >>> 2] >>> 24 - o % 4 * 8 & 255;
r.push((i >>> 4).toString(16)), r.push((15 & i).toString(16));
} return r.join(""); }, parse: function (e) { for (var t = e.length, n = [], r = 0; r < t;