@opencampus/ocid-connect-js 2.0.6 → 2.0.7

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.
@@ -111,7 +111,7 @@ __webpack_require__.r(__webpack_exports__);
111
111
 
112
112
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "useOCAuth", function() { return _react__WEBPACK_IMPORTED_MODULE_0__["useOCAuth"]; });
113
113
 
114
- /* harmony import */ var _sdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34);
114
+ /* harmony import */ var _sdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36);
115
115
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TokenManager", function() { return _sdk__WEBPACK_IMPORTED_MODULE_1__["TokenManager"]; });
116
116
 
117
117
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransactionManager", function() { return _sdk__WEBPACK_IMPORTED_MODULE_1__["TransactionManager"]; });
@@ -175,8 +175,8 @@ __webpack_require__.r(__webpack_exports__);
175
175
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
176
176
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
177
177
  /* harmony import */ var _OCContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
178
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
179
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
178
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
179
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
180
180
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
181
181
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
182
182
  /*!
@@ -263,18 +263,17 @@ function LoginButton(_ref) {
263
263
  ocAuth = _useOCAuth.ocAuth;
264
264
  var customTheme = themes[theme] || themes['ocBlue'];
265
265
  var loginWithRedirect = /*#__PURE__*/function () {
266
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
267
- return _regeneratorRuntime().wrap(function _callee$(_context) {
268
- while (1) switch (_context.prev = _context.next) {
266
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
267
+ return _regenerator().w(function (_context) {
268
+ while (1) switch (_context.n) {
269
269
  case 0:
270
- _context.next = 2;
270
+ _context.n = 1;
271
271
  return ocAuth.signInWithRedirect({
272
272
  state: state,
273
273
  emailPlaceholder: emailPlaceholder
274
274
  });
275
- case 2:
276
- case "end":
277
- return _context.stop();
275
+ case 1:
276
+ return _context.a(2);
278
277
  }
279
278
  }, _callee);
280
279
  }));
@@ -340,8 +339,8 @@ __webpack_require__.r(__webpack_exports__);
340
339
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
341
340
  /* harmony import */ var _OCSpinner__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
342
341
  /* harmony import */ var _OCContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
343
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
344
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
342
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
343
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
345
344
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
346
345
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
347
346
  /*!
@@ -369,33 +368,33 @@ var LoginCallBack = function LoginCallBack(_ref) {
369
368
  setAuthError = _useOCAuth.setAuthError;
370
369
  Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
371
370
  var handleLogin = /*#__PURE__*/function () {
372
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
373
- return _regeneratorRuntime().wrap(function _callee$(_context) {
374
- while (1) switch (_context.prev = _context.next) {
371
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
372
+ var _t;
373
+ return _regenerator().w(function (_context) {
374
+ while (1) switch (_context.p = _context.n) {
375
375
  case 0:
376
376
  if (!ocAuth) {
377
- _context.next = 11;
377
+ _context.n = 4;
378
378
  break;
379
379
  }
380
- _context.prev = 1;
381
- _context.next = 4;
380
+ _context.p = 1;
381
+ _context.n = 2;
382
382
  return ocAuth.handleLoginRedirect();
383
- case 4:
383
+ case 2:
384
384
  successCallback();
385
- _context.next = 11;
385
+ _context.n = 4;
386
386
  break;
387
- case 7:
388
- _context.prev = 7;
389
- _context.t0 = _context["catch"](1);
390
- setAuthError(_context.t0);
387
+ case 3:
388
+ _context.p = 3;
389
+ _t = _context.v;
390
+ setAuthError(_t);
391
391
  if (errorCallback) {
392
392
  errorCallback();
393
393
  }
394
- case 11:
395
- case "end":
396
- return _context.stop();
394
+ case 4:
395
+ return _context.a(2);
397
396
  }
398
- }, _callee, null, [[1, 7]]);
397
+ }, _callee, null, [[1, 3]]);
399
398
  }));
400
399
  return function handleLogin() {
401
400
  return _ref2.apply(this, arguments);
@@ -1023,13 +1022,13 @@ var OCConnect = function OCConnect(_ref) {
1023
1022
  authState = _useState8[0],
1024
1023
  setAuthState = _useState8[1];
1025
1024
  var _useState9 = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(false),
1026
- _useState10 = _slicedToArray(_useState9, 2),
1027
- isInitialized = _useState10[0],
1028
- setIsInitialized = _useState10[1];
1029
- var _useState11 = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(null),
1030
- _useState12 = _slicedToArray(_useState11, 2),
1031
- authError = _useState12[0],
1032
- setAuthError = _useState12[1];
1025
+ _useState0 = _slicedToArray(_useState9, 2),
1026
+ isInitialized = _useState0[0],
1027
+ setIsInitialized = _useState0[1];
1028
+ var _useState1 = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(null),
1029
+ _useState10 = _slicedToArray(_useState1, 2),
1030
+ authError = _useState10[0],
1031
+ setAuthError = _useState10[1];
1033
1032
  var updateAuthState = function updateAuthState(authState) {
1034
1033
  setAuthState(authState);
1035
1034
  setOCId(authState.OCId);
@@ -1075,13 +1074,16 @@ __webpack_require__.r(__webpack_exports__);
1075
1074
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OCAuthCore", function() { return OCAuthCore; });
1076
1075
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OCAuthLive", function() { return OCAuthLive; });
1077
1076
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OCAuthSandbox", function() { return OCAuthSandbox; });
1078
- /* harmony import */ var _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
1079
- /* harmony import */ var _lib_TokenManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
1080
- /* harmony import */ var _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28);
1081
- /* harmony import */ var _lib_StorageManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29);
1082
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17);
1083
- /* harmony import */ var _endpoints__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32);
1084
- /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(25);
1077
+ /* harmony import */ var _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
1078
+ /* harmony import */ var _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__);
1079
+ /* harmony import */ var _lib_WalletServiceManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
1080
+ /* harmony import */ var _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
1081
+ /* harmony import */ var _lib_TokenManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18);
1082
+ /* harmony import */ var _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30);
1083
+ /* harmony import */ var _lib_StorageManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(31);
1084
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(19);
1085
+ /* harmony import */ var _endpoints__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(34);
1086
+ /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(27);
1085
1087
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1086
1088
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
1087
1089
  function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
@@ -1090,7 +1092,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
1090
1092
  function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
1091
1093
  function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
1092
1094
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
1093
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
1095
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
1096
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
1094
1097
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
1095
1098
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
1096
1099
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -1115,8 +1118,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
1115
1118
 
1116
1119
 
1117
1120
 
1121
+
1122
+
1118
1123
  var OCAuthCore = /*#__PURE__*/function () {
1119
- function OCAuthCore(clientId, loginEndpoint, redirectUri, transactionManager, tokenManager, referralCode, logoutEndPoint) {
1124
+ function OCAuthCore(clientId, loginEndpoint, redirectUri, transactionManager, tokenManager, referralCode, logoutEndPoint, walletServiceManager, authInfoManager) {
1120
1125
  _classCallCheck(this, OCAuthCore);
1121
1126
  _defineProperty(this, "clientId", void 0);
1122
1127
  _defineProperty(this, "tokenManager", void 0);
@@ -1126,17 +1131,19 @@ var OCAuthCore = /*#__PURE__*/function () {
1126
1131
  _defineProperty(this, "loginEndPoint", void 0);
1127
1132
  _defineProperty(this, "logoutEndPoint", void 0);
1128
1133
  _defineProperty(this, "referralCode", void 0);
1134
+ _defineProperty(this, "walletServiceManager", void 0);
1129
1135
  if (!clientId) {
1130
- throw new _utils_errors__WEBPACK_IMPORTED_MODULE_6__["InvalidParamsError"]('clientId is not defined');
1136
+ throw new _utils_errors__WEBPACK_IMPORTED_MODULE_8__["InvalidParamsError"]('clientId is not defined');
1131
1137
  }
1132
1138
  this.transactionManager = transactionManager;
1133
1139
  this.tokenManager = tokenManager;
1134
- this.authInfoManager = new _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_0__["default"]();
1140
+ this.authInfoManager = authInfoManager;
1135
1141
  this.loginEndPoint = loginEndpoint;
1136
1142
  this.logoutEndPoint = logoutEndPoint;
1137
1143
  this.redirectUri = redirectUri;
1138
1144
  this.referralCode = referralCode;
1139
1145
  this.clientId = clientId;
1146
+ this.walletServiceManager = walletServiceManager;
1140
1147
  this.syncAuthInfo();
1141
1148
  }
1142
1149
  return _createClass(OCAuthCore, [{
@@ -1148,20 +1155,22 @@ var OCAuthCore = /*#__PURE__*/function () {
1148
1155
  }, {
1149
1156
  key: "logout",
1150
1157
  value: function () {
1151
- var _logout = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(logoutReturnTo) {
1158
+ var _logout = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(logoutReturnTo) {
1152
1159
  var url;
1153
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1154
- while (1) switch (_context.prev = _context.next) {
1160
+ return _regenerator().w(function (_context) {
1161
+ while (1) switch (_context.n) {
1155
1162
  case 0:
1156
1163
  this.clearStorage();
1164
+ _context.n = 1;
1165
+ return this.walletServiceManager.logout();
1166
+ case 1:
1157
1167
  url = new URL(this.logoutEndPoint);
1158
1168
  if (logoutReturnTo) {
1159
1169
  url.searchParams.append('returnTo', logoutReturnTo);
1160
1170
  }
1161
1171
  window.location.assign(url.toString());
1162
- case 4:
1163
- case "end":
1164
- return _context.stop();
1172
+ case 2:
1173
+ return _context.a(2);
1165
1174
  }
1166
1175
  }, _callee, this);
1167
1176
  }));
@@ -1173,29 +1182,28 @@ var OCAuthCore = /*#__PURE__*/function () {
1173
1182
  }, {
1174
1183
  key: "signInWithRedirect",
1175
1184
  value: function () {
1176
- var _signInWithRedirect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
1185
+ var _signInWithRedirect = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(params) {
1177
1186
  var paramsClone, signinParams, meta, requestUrl;
1178
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1179
- while (1) switch (_context2.prev = _context2.next) {
1187
+ return _regenerator().w(function (_context2) {
1188
+ while (1) switch (_context2.n) {
1180
1189
  case 0:
1181
1190
  // we use ONLY code flow with PKCE, so lacks a lot of options
1182
1191
  // available in other OAuth SDKs.
1183
1192
  paramsClone = Object.assign({}, params);
1184
1193
  paramsClone.redirectUri = this.redirectUri;
1185
1194
  paramsClone.clientId = this.clientId;
1186
- _context2.next = 5;
1187
- return Object(_utils__WEBPACK_IMPORTED_MODULE_4__["prepareTokenParams"])(paramsClone);
1188
- case 5:
1189
- signinParams = _context2.sent;
1190
- meta = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["createPkceMeta"])(signinParams);
1195
+ _context2.n = 1;
1196
+ return Object(_utils__WEBPACK_IMPORTED_MODULE_6__["prepareTokenParams"])(paramsClone);
1197
+ case 1:
1198
+ signinParams = _context2.v;
1199
+ meta = Object(_utils__WEBPACK_IMPORTED_MODULE_6__["createPkceMeta"])(signinParams);
1191
1200
  this.transactionManager.save(meta);
1192
1201
  signinParams.referralCode = this.referralCode;
1193
1202
  signinParams.emailPlaceholder = paramsClone.emailPlaceholder;
1194
- requestUrl = Object(_endpoints__WEBPACK_IMPORTED_MODULE_5__["buildAuthEndpointUrl"])(signinParams, this.loginEndPoint);
1203
+ requestUrl = Object(_endpoints__WEBPACK_IMPORTED_MODULE_7__["buildAuthEndpointUrl"])(signinParams, this.loginEndPoint);
1195
1204
  window.location.assign(requestUrl);
1196
- case 12:
1197
- case "end":
1198
- return _context2.stop();
1205
+ case 2:
1206
+ return _context2.a(2);
1199
1207
  }
1200
1208
  }, _callee2, this);
1201
1209
  }));
@@ -1207,36 +1215,35 @@ var OCAuthCore = /*#__PURE__*/function () {
1207
1215
  }, {
1208
1216
  key: "handleLoginRedirect",
1209
1217
  value: function () {
1210
- var _handleLoginRedirect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
1218
+ var _handleLoginRedirect = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
1211
1219
  var urlParams, meta, codeVerifier;
1212
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1213
- while (1) switch (_context3.prev = _context3.next) {
1220
+ return _regenerator().w(function (_context3) {
1221
+ while (1) switch (_context3.n) {
1214
1222
  case 0:
1215
- urlParams = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["parseUrl"])(); // Again we only handle PKCE code flow
1223
+ urlParams = Object(_utils__WEBPACK_IMPORTED_MODULE_6__["parseUrl"])(); // Again we only handle PKCE code flow
1216
1224
  if (!urlParams.code) {
1217
- _context3.next = 13;
1225
+ _context3.n = 4;
1218
1226
  break;
1219
1227
  }
1220
1228
  meta = this.transactionManager.getTransactionMeta();
1221
1229
  codeVerifier = meta.codeVerifier;
1222
1230
  if (!codeVerifier) {
1223
- _context3.next = 12;
1231
+ _context3.n = 3;
1224
1232
  break;
1225
1233
  }
1226
- _context3.next = 7;
1234
+ _context3.n = 1;
1227
1235
  return this.tokenManager.exchangeTokenFromCode(urlParams.code, codeVerifier, urlParams.state);
1228
- case 7:
1236
+ case 1:
1229
1237
  // clear transaction meta, coz it's completed
1230
1238
  this.transactionManager.clear();
1231
- this.syncAuthInfo();
1232
- return _context3.abrupt("return", this.getAuthState());
1233
- case 12:
1234
- throw new _utils_errors__WEBPACK_IMPORTED_MODULE_6__["AuthError"]('codeVerifier not found, cannot complete flow');
1235
- case 13:
1236
- return _context3.abrupt("return", {});
1237
- case 14:
1238
- case "end":
1239
- return _context3.stop();
1239
+ _context3.n = 2;
1240
+ return this.syncAuthInfo();
1241
+ case 2:
1242
+ return _context3.a(2, this.getAuthState());
1243
+ case 3:
1244
+ throw new _utils_errors__WEBPACK_IMPORTED_MODULE_8__["AuthError"]('codeVerifier not found, cannot complete flow');
1245
+ case 4:
1246
+ return _context3.a(2, {});
1240
1247
  }
1241
1248
  }, _callee3, this);
1242
1249
  }));
@@ -1253,16 +1260,34 @@ var OCAuthCore = /*#__PURE__*/function () {
1253
1260
  }
1254
1261
  }, {
1255
1262
  key: "syncAuthInfo",
1256
- value: function syncAuthInfo() {
1257
- if (this.tokenManager.hasExpired()) {
1258
- this.authInfoManager.clear();
1259
- } else {
1260
- var _this$getParsedIdToke = this.getParsedIdToken(),
1261
- edu_username = _this$getParsedIdToke.edu_username,
1262
- eth_address = _this$getParsedIdToke.eth_address;
1263
- this.authInfoManager.setAuthState(this.getAccessToken(), this.getIdToken(), edu_username, eth_address, true);
1263
+ value: function () {
1264
+ var _syncAuthInfo = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
1265
+ var _this$getParsedIdToke, edu_username, eth_address;
1266
+ return _regenerator().w(function (_context4) {
1267
+ while (1) switch (_context4.n) {
1268
+ case 0:
1269
+ if (!this.tokenManager.hasExpired()) {
1270
+ _context4.n = 1;
1271
+ break;
1272
+ }
1273
+ this.authInfoManager.clear();
1274
+ _context4.n = 2;
1275
+ break;
1276
+ case 1:
1277
+ _this$getParsedIdToke = this.getParsedIdToken(), edu_username = _this$getParsedIdToke.edu_username, eth_address = _this$getParsedIdToke.eth_address;
1278
+ this.authInfoManager.setAuthState(this.getAccessToken(), this.getIdToken(), edu_username, eth_address, true);
1279
+ _context4.n = 2;
1280
+ return this.walletServiceManager.login(this.getAccessToken());
1281
+ case 2:
1282
+ return _context4.a(2);
1283
+ }
1284
+ }, _callee4, this);
1285
+ }));
1286
+ function syncAuthInfo() {
1287
+ return _syncAuthInfo.apply(this, arguments);
1264
1288
  }
1265
- }
1289
+ return syncAuthInfo;
1290
+ }()
1266
1291
  }, {
1267
1292
  key: "getAuthState",
1268
1293
  value: function getAuthState() {
@@ -1289,7 +1314,7 @@ var OCAuthCore = /*#__PURE__*/function () {
1289
1314
  // return all info in id token
1290
1315
  var idToken = this.tokenManager.getIdToken();
1291
1316
  if (idToken) {
1292
- return Object(_utils__WEBPACK_IMPORTED_MODULE_4__["parseJwt"])(idToken);
1317
+ return Object(_utils__WEBPACK_IMPORTED_MODULE_6__["parseJwt"])(idToken);
1293
1318
  }
1294
1319
  return {};
1295
1320
  }
@@ -1299,7 +1324,7 @@ var OCAuthCore = /*#__PURE__*/function () {
1299
1324
  // return all info in access token
1300
1325
  var accessToken = this.tokenManager.getAccessToken();
1301
1326
  if (accessToken) {
1302
- return Object(_utils__WEBPACK_IMPORTED_MODULE_4__["parseJwt"])(accessToken);
1327
+ return Object(_utils__WEBPACK_IMPORTED_MODULE_6__["parseJwt"])(accessToken);
1303
1328
  }
1304
1329
  return {};
1305
1330
  }
@@ -1321,6 +1346,8 @@ var OCAuthCore = /*#__PURE__*/function () {
1321
1346
  }();
1322
1347
  var LIVE_PUBLIC_KEY = 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBIDHtLbgVM76SXZ4iuIjuO+ERQPnVpJzagOsZdYxFG3ZJmvfdpr/Z29SLUbdZWafrOlAVlKe1Ovf/tcH671tTw==';
1323
1348
  var SANDBOX_PUBLIC_KEY = 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/EymMLXd/MVYPK5r2xXQj91ZVvX3OQ+QagvR2N6lCvRVjnzmOtPRTf+u5g1RliWnmuxbV3gTm0/0VuV/40Salg==';
1349
+ var LIVE_PARTNER_ID = '2debfc3c-2205-4c67-b6f2-d015b286b318';
1350
+ var SANDBOX_PARTNER_ID = '3d54efbe-2666-45b7-bdf9-e843d69fd2f8';
1324
1351
  var OCAuthLive = /*#__PURE__*/function (_OCAuthCore2) {
1325
1352
  function OCAuthLive() {
1326
1353
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -1329,17 +1356,32 @@ var OCAuthLive = /*#__PURE__*/function (_OCAuthCore2) {
1329
1356
  overrideLoginEndpoint = opts.loginEndPoint,
1330
1357
  overrideLogoutEndpoint = opts.logoutEndPoint,
1331
1358
  overridePublicKey = opts.publicKey,
1359
+ overrideAirKitTokenEndpoint = opts.airKitTokenEndPoint,
1360
+ overrideAirKitPartnerId = opts.airKitPartnerId,
1361
+ overrideAirKitBuildEnv = opts.airKitBuildEnv,
1332
1362
  redirectUri = opts.redirectUri,
1333
1363
  referralCode = opts.referralCode,
1334
- clientId = opts.clientId;
1364
+ clientId = opts.clientId,
1365
+ useWalletService = opts.useWalletService;
1335
1366
  var tokenEndpoint = overrideTokenEndpoint || 'https://api.login.opencampus.xyz/auth/token';
1336
1367
  var loginEndpoint = overrideLoginEndpoint || 'https://api.login.opencampus.xyz/auth/login';
1337
1368
  var logoutEndpoint = overrideLogoutEndpoint || 'https://api.login.opencampus.xyz/auth/logout';
1369
+ var airKitTokenEndpoint = overrideAirKitTokenEndpoint || 'https://api.login.opencampus.xyz/auth/airkit/token';
1338
1370
  var publicKey = overridePublicKey || LIVE_PUBLIC_KEY;
1339
- var storageClass = Object(_lib_StorageManager__WEBPACK_IMPORTED_MODULE_3__["getStorageClass"])(opts);
1340
- var pkceTransactionManager = new _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_2__["default"](storageClass);
1341
- var tokenManager = new _lib_TokenManager__WEBPACK_IMPORTED_MODULE_1__["default"](storageClass, tokenEndpoint, publicKey);
1342
- return _callSuper(this, OCAuthLive, [clientId, loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint]);
1371
+ var airKitPartnerId = overrideAirKitPartnerId || LIVE_PARTNER_ID;
1372
+ var airKitBuildEnv = overrideAirKitBuildEnv || _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__["BUILD_ENV"].PRODUCTION;
1373
+ var storageClass = Object(_lib_StorageManager__WEBPACK_IMPORTED_MODULE_5__["getStorageClass"])(opts);
1374
+ var authInfoManager = new _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_2__["default"]();
1375
+ var walletServiceManager = new _lib_WalletServiceManager__WEBPACK_IMPORTED_MODULE_1__["default"]({
1376
+ airKitPartnerId: airKitPartnerId,
1377
+ airKitEnv: airKitBuildEnv,
1378
+ airKitTokenEndpoint: airKitTokenEndpoint,
1379
+ authInfoManager: authInfoManager,
1380
+ useWalletService: useWalletService
1381
+ });
1382
+ var pkceTransactionManager = new _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_4__["default"](storageClass);
1383
+ var tokenManager = new _lib_TokenManager__WEBPACK_IMPORTED_MODULE_3__["default"](storageClass, tokenEndpoint, publicKey);
1384
+ return _callSuper(this, OCAuthLive, [clientId, loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint, walletServiceManager, authInfoManager]);
1343
1385
  }
1344
1386
  _inherits(OCAuthLive, _OCAuthCore2);
1345
1387
  return _createClass(OCAuthLive);
@@ -1352,17 +1394,32 @@ var OCAuthSandbox = /*#__PURE__*/function (_OCAuthCore3) {
1352
1394
  overrideLoginEndpoint = opts.loginEndPoint,
1353
1395
  overrideLogoutEndpoint = opts.logoutEndPoint,
1354
1396
  overridePublicKey = opts.publicKey,
1397
+ overrideAirKitTokenEndpoint = opts.airKitTokenEndPoint,
1398
+ overrideAirKitPartnerId = opts.airKitPartnerId,
1399
+ overrideAirKitBuildEnv = opts.airKitBuildEnv,
1355
1400
  redirectUri = opts.redirectUri,
1356
- referralCode = opts.referralCode;
1401
+ referralCode = opts.referralCode,
1402
+ useWalletService = opts.useWalletService;
1357
1403
  var clientId = opts.clientId || 'sandbox';
1358
1404
  var tokenEndpoint = overrideTokenEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/token';
1359
1405
  var loginEndpoint = overrideLoginEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/login';
1360
1406
  var logoutEndpoint = overrideLogoutEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/logout';
1407
+ var airKitTokenEndpoint = overrideAirKitTokenEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/airkit/token';
1361
1408
  var publicKey = overridePublicKey || SANDBOX_PUBLIC_KEY;
1362
- var storageClass = Object(_lib_StorageManager__WEBPACK_IMPORTED_MODULE_3__["getStorageClass"])(opts);
1363
- var pkceTransactionManager = new _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_2__["default"](storageClass);
1364
- var tokenManager = new _lib_TokenManager__WEBPACK_IMPORTED_MODULE_1__["default"](storageClass, tokenEndpoint, publicKey);
1365
- return _callSuper(this, OCAuthSandbox, [clientId, loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint]);
1409
+ var airKitPartnerId = overrideAirKitPartnerId || SANDBOX_PARTNER_ID;
1410
+ var airKitBuildEnv = overrideAirKitBuildEnv || _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__["BUILD_ENV"].SANDBOX;
1411
+ var authInfoManager = new _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_2__["default"]();
1412
+ var storageClass = Object(_lib_StorageManager__WEBPACK_IMPORTED_MODULE_5__["getStorageClass"])(opts);
1413
+ var walletServiceManager = new _lib_WalletServiceManager__WEBPACK_IMPORTED_MODULE_1__["default"]({
1414
+ airKitPartnerId: airKitPartnerId,
1415
+ airKitEnv: airKitBuildEnv,
1416
+ airKitTokenEndpoint: airKitTokenEndpoint,
1417
+ authInfoManager: authInfoManager,
1418
+ useWalletService: useWalletService
1419
+ });
1420
+ var pkceTransactionManager = new _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_4__["default"](storageClass);
1421
+ var tokenManager = new _lib_TokenManager__WEBPACK_IMPORTED_MODULE_3__["default"](storageClass, tokenEndpoint, publicKey);
1422
+ return _callSuper(this, OCAuthSandbox, [clientId, loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint, walletServiceManager, authInfoManager]);
1366
1423
  }
1367
1424
  _inherits(OCAuthSandbox, _OCAuthCore3);
1368
1425
  return _createClass(OCAuthSandbox);
@@ -1370,11 +1427,166 @@ var OCAuthSandbox = /*#__PURE__*/function (_OCAuthCore3) {
1370
1427
 
1371
1428
  /***/ }),
1372
1429
  /* 14 */
1430
+ /***/ (function(module, exports) {
1431
+
1432
+ throw new Error("Module parse failed: Unexpected token (545:23)\nYou may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders\n| super(message || name);\n| this.name = name;\n> this.stack = cause?.stack;\n| this.cause = cause;\n| this.context = context;");
1433
+
1434
+ /***/ }),
1435
+ /* 15 */
1436
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1437
+
1438
+ "use strict";
1439
+ __webpack_require__.r(__webpack_exports__);
1440
+ /* harmony import */ var _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
1441
+ /* harmony import */ var _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__);
1442
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1443
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
1444
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
1445
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
1446
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
1447
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
1448
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
1449
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
1450
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1451
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1452
+
1453
+ var _airService = null;
1454
+ var _airServiceInitialized = false;
1455
+ var WalletServiceManager = /*#__PURE__*/function () {
1456
+ function WalletServiceManager(_ref) {
1457
+ var airKitPartnerId = _ref.airKitPartnerId,
1458
+ airKitEnv = _ref.airKitEnv,
1459
+ airKitTokenEndpoint = _ref.airKitTokenEndpoint,
1460
+ authInfoManager = _ref.authInfoManager,
1461
+ useWalletService = _ref.useWalletService;
1462
+ _classCallCheck(this, WalletServiceManager);
1463
+ this.airKitTokenEndpoint = airKitTokenEndpoint;
1464
+ this.airKitEnv = airKitEnv;
1465
+ this.authInfoManager = authInfoManager;
1466
+ if (useWalletService && !_airService) {
1467
+ _airService = new _mocanetwork_airkit__WEBPACK_IMPORTED_MODULE_0__["AirService"]({
1468
+ partnerId: airKitPartnerId,
1469
+ environment: airKitEnv
1470
+ });
1471
+ }
1472
+ }
1473
+ return _createClass(WalletServiceManager, [{
1474
+ key: "init",
1475
+ value: function () {
1476
+ var _init = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
1477
+ return _regenerator().w(function (_context) {
1478
+ while (1) switch (_context.n) {
1479
+ case 0:
1480
+ if (!(_airService && !_airServiceInitialized)) {
1481
+ _context.n = 2;
1482
+ break;
1483
+ }
1484
+ _context.n = 1;
1485
+ return _airService.init({
1486
+ buildEnv: this.airKitEnv
1487
+ });
1488
+ case 1:
1489
+ _airServiceInitialized = true;
1490
+ case 2:
1491
+ return _context.a(2);
1492
+ }
1493
+ }, _callee, this);
1494
+ }));
1495
+ function init() {
1496
+ return _init.apply(this, arguments);
1497
+ }
1498
+ return init;
1499
+ }()
1500
+ }, {
1501
+ key: "login",
1502
+ value: function () {
1503
+ var _login = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(accessToken) {
1504
+ var response, tokenResponse, airKitToken;
1505
+ return _regenerator().w(function (_context2) {
1506
+ while (1) switch (_context2.n) {
1507
+ case 0:
1508
+ if (!_airService) {
1509
+ _context2.n = 5;
1510
+ break;
1511
+ }
1512
+ _context2.n = 1;
1513
+ return this.init();
1514
+ case 1:
1515
+ _context2.n = 2;
1516
+ return fetch(this.airKitTokenEndpoint, {
1517
+ method: "GET",
1518
+ headers: {
1519
+ "Content-Type": "application/json",
1520
+ Authorization: "Bearer ".concat(accessToken)
1521
+ }
1522
+ });
1523
+ case 2:
1524
+ response = _context2.v;
1525
+ _context2.n = 3;
1526
+ return response.json();
1527
+ case 3:
1528
+ tokenResponse = _context2.v;
1529
+ airKitToken = tokenResponse.airKitToken;
1530
+ if (!airKitToken) {
1531
+ _context2.n = 5;
1532
+ break;
1533
+ }
1534
+ _context2.n = 4;
1535
+ return _airService.login({
1536
+ authToken: airKitToken
1537
+ });
1538
+ case 4:
1539
+ this.authInfoManager.updateAuthState({
1540
+ walletService: _airService
1541
+ });
1542
+ case 5:
1543
+ return _context2.a(2);
1544
+ }
1545
+ }, _callee2, this);
1546
+ }));
1547
+ function login(_x) {
1548
+ return _login.apply(this, arguments);
1549
+ }
1550
+ return login;
1551
+ }()
1552
+ }, {
1553
+ key: "logout",
1554
+ value: function () {
1555
+ var _logout = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
1556
+ return _regenerator().w(function (_context3) {
1557
+ while (1) switch (_context3.n) {
1558
+ case 0:
1559
+ if (!(_airService && _airService.isLoggedIn)) {
1560
+ _context3.n = 2;
1561
+ break;
1562
+ }
1563
+ _context3.n = 1;
1564
+ return _airService.logout();
1565
+ case 1:
1566
+ this.authInfoManager.updateAuthState({
1567
+ walletService: undefined
1568
+ });
1569
+ case 2:
1570
+ return _context3.a(2);
1571
+ }
1572
+ }, _callee3, this);
1573
+ }));
1574
+ function logout() {
1575
+ return _logout.apply(this, arguments);
1576
+ }
1577
+ return logout;
1578
+ }()
1579
+ }]);
1580
+ }();
1581
+ /* harmony default export */ __webpack_exports__["default"] = (WalletServiceManager);
1582
+
1583
+ /***/ }),
1584
+ /* 16 */
1373
1585
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1374
1586
 
1375
1587
  "use strict";
1376
1588
  __webpack_require__.r(__webpack_exports__);
1377
- /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
1589
+ /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
1378
1590
  /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tiny_emitter__WEBPACK_IMPORTED_MODULE_0__);
1379
1591
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1380
1592
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -1420,6 +1632,12 @@ var AuthInfoManager = /*#__PURE__*/function () {
1420
1632
  value: function getAuthState() {
1421
1633
  return Object.assign({}, this._authState);
1422
1634
  }
1635
+ }, {
1636
+ key: "updateAuthState",
1637
+ value: function updateAuthState(partialAuthState) {
1638
+ this._authState = Object.assign({}, this._authState, partialAuthState);
1639
+ this._emitter.emit(EVENT_AUTH_STATE_CHANGE, this._authState);
1640
+ }
1423
1641
  }, {
1424
1642
  key: "clear",
1425
1643
  value: function clear() {
@@ -1443,7 +1661,7 @@ var AuthInfoManager = /*#__PURE__*/function () {
1443
1661
  /* harmony default export */ __webpack_exports__["default"] = (AuthInfoManager);
1444
1662
 
1445
1663
  /***/ }),
1446
- /* 15 */
1664
+ /* 17 */
1447
1665
  /***/ (function(module, exports) {
1448
1666
 
1449
1667
  function E () {
@@ -1516,16 +1734,17 @@ module.exports.TinyEmitter = E;
1516
1734
 
1517
1735
 
1518
1736
  /***/ }),
1519
- /* 16 */
1737
+ /* 18 */
1520
1738
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1521
1739
 
1522
1740
  "use strict";
1523
1741
  __webpack_require__.r(__webpack_exports__);
1524
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
1525
- /* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
1526
- /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
1742
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19);
1743
+ /* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
1744
+ /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27);
1527
1745
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1528
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
1746
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
1747
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
1529
1748
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
1530
1749
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
1531
1750
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -1567,7 +1786,7 @@ var TokenManager = /*#__PURE__*/function () {
1567
1786
  }, {
1568
1787
  key: "exchangeTokenFromCode",
1569
1788
  value: function () {
1570
- var _exchangeTokenFromCode = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessCode, codeVerifier) {
1789
+ var _exchangeTokenFromCode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(accessCode, codeVerifier) {
1571
1790
  var state,
1572
1791
  body,
1573
1792
  response,
@@ -1578,17 +1797,18 @@ var TokenManager = /*#__PURE__*/function () {
1578
1797
  tokenVerified,
1579
1798
  parsedAccessToken,
1580
1799
  storageData,
1581
- _args = arguments;
1582
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1583
- while (1) switch (_context.prev = _context.next) {
1800
+ _args = arguments,
1801
+ _t;
1802
+ return _regenerator().w(function (_context) {
1803
+ while (1) switch (_context.p = _context.n) {
1584
1804
  case 0:
1585
1805
  state = _args.length > 2 && _args[2] !== undefined ? _args[2] : null;
1586
1806
  body = {
1587
1807
  accessCode: accessCode,
1588
1808
  codeVerifier: codeVerifier
1589
1809
  };
1590
- _context.prev = 2;
1591
- _context.next = 5;
1810
+ _context.p = 1;
1811
+ _context.n = 2;
1592
1812
  return fetch(this.tokenEndPoint, {
1593
1813
  method: 'POST',
1594
1814
  headers: {
@@ -1596,34 +1816,34 @@ var TokenManager = /*#__PURE__*/function () {
1596
1816
  },
1597
1817
  body: JSON.stringify(body)
1598
1818
  });
1599
- case 5:
1600
- response = _context.sent;
1601
- _context.next = 8;
1819
+ case 2:
1820
+ response = _context.v;
1821
+ _context.n = 3;
1602
1822
  return response.json();
1603
- case 8:
1604
- _yield$response$json = _context.sent;
1823
+ case 3:
1824
+ _yield$response$json = _context.v;
1605
1825
  access_token = _yield$response$json.access_token;
1606
1826
  id_token = _yield$response$json.id_token;
1607
1827
  if (!(!access_token || !id_token)) {
1608
- _context.next = 13;
1828
+ _context.n = 4;
1609
1829
  break;
1610
1830
  }
1611
1831
  throw new _utils_errors__WEBPACK_IMPORTED_MODULE_2__["AuthError"]('Fail to exchange token');
1612
- case 13:
1613
- _context.next = 15;
1832
+ case 4:
1833
+ _context.n = 5;
1614
1834
  return this.getPublicKey();
1615
- case 15:
1616
- pubKey = _context.sent;
1617
- _context.next = 18;
1835
+ case 5:
1836
+ pubKey = _context.v;
1837
+ _context.n = 6;
1618
1838
  return Object(_crypto__WEBPACK_IMPORTED_MODULE_1__["verifyToken"])(id_token, pubKey);
1619
- case 18:
1620
- tokenVerified = _context.sent;
1839
+ case 6:
1840
+ tokenVerified = _context.v;
1621
1841
  if (tokenVerified) {
1622
- _context.next = 21;
1842
+ _context.n = 7;
1623
1843
  break;
1624
1844
  }
1625
1845
  throw new _utils_errors__WEBPACK_IMPORTED_MODULE_2__["AuthError"]('Unable to verify token');
1626
- case 21:
1846
+ case 7:
1627
1847
  parsedAccessToken = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["parseJwt"])(access_token);
1628
1848
  storageData = Object.assign({
1629
1849
  access_token: access_token,
@@ -1633,18 +1853,17 @@ var TokenManager = /*#__PURE__*/function () {
1633
1853
  state: state
1634
1854
  });
1635
1855
  this.storageManager.getStorageObject().setStorage(storageData);
1636
- _context.next = 30;
1856
+ _context.n = 9;
1637
1857
  break;
1638
- case 26:
1639
- _context.prev = 26;
1640
- _context.t0 = _context["catch"](2);
1641
- console.log(_context.t0);
1858
+ case 8:
1859
+ _context.p = 8;
1860
+ _t = _context.v;
1861
+ console.log(_t);
1642
1862
  throw new _utils_errors__WEBPACK_IMPORTED_MODULE_2__["AuthError"]('Token acquisition failed');
1643
- case 30:
1644
- case "end":
1645
- return _context.stop();
1863
+ case 9:
1864
+ return _context.a(2);
1646
1865
  }
1647
- }, _callee, this, [[2, 26]]);
1866
+ }, _callee, this, [[1, 8]]);
1648
1867
  }));
1649
1868
  function exchangeTokenFromCode(_x, _x2) {
1650
1869
  return _exchangeTokenFromCode.apply(this, arguments);
@@ -1674,14 +1893,11 @@ var TokenManager = /*#__PURE__*/function () {
1674
1893
  }, {
1675
1894
  key: "getPublicKey",
1676
1895
  value: function () {
1677
- var _getPublicKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1678
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1679
- while (1) switch (_context2.prev = _context2.next) {
1896
+ var _getPublicKey = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
1897
+ return _regenerator().w(function (_context2) {
1898
+ while (1) switch (_context2.n) {
1680
1899
  case 0:
1681
- return _context2.abrupt("return", this.publicKey);
1682
- case 1:
1683
- case "end":
1684
- return _context2.stop();
1900
+ return _context2.a(2, this.publicKey);
1685
1901
  }
1686
1902
  }, _callee2, this);
1687
1903
  }));
@@ -1705,21 +1921,21 @@ var TokenManager = /*#__PURE__*/function () {
1705
1921
  /* harmony default export */ __webpack_exports__["default"] = (TokenManager);
1706
1922
 
1707
1923
  /***/ }),
1708
- /* 17 */
1924
+ /* 19 */
1709
1925
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1710
1926
 
1711
1927
  "use strict";
1712
1928
  __webpack_require__.r(__webpack_exports__);
1713
- /* harmony import */ var _urlParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
1929
+ /* harmony import */ var _urlParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
1714
1930
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseUrl", function() { return _urlParser__WEBPACK_IMPORTED_MODULE_0__["parseUrl"]; });
1715
1931
 
1716
- /* harmony import */ var _prepareTokenParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);
1932
+ /* harmony import */ var _prepareTokenParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
1717
1933
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareTokenParams", function() { return _prepareTokenParams__WEBPACK_IMPORTED_MODULE_1__["prepareTokenParams"]; });
1718
1934
 
1719
- /* harmony import */ var _createPkceMeta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26);
1935
+ /* harmony import */ var _createPkceMeta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28);
1720
1936
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createPkceMeta", function() { return _createPkceMeta__WEBPACK_IMPORTED_MODULE_2__["createPkceMeta"]; });
1721
1937
 
1722
- /* harmony import */ var _jwtParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27);
1938
+ /* harmony import */ var _jwtParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29);
1723
1939
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseJwt", function() { return _jwtParser__WEBPACK_IMPORTED_MODULE_3__["parseJwt"]; });
1724
1940
 
1725
1941
  /*!
@@ -1737,7 +1953,7 @@ __webpack_require__.r(__webpack_exports__);
1737
1953
 
1738
1954
 
1739
1955
  /***/ }),
1740
- /* 18 */
1956
+ /* 20 */
1741
1957
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1742
1958
 
1743
1959
  "use strict";
@@ -1763,16 +1979,16 @@ var parseUrl = function parseUrl() {
1763
1979
  };
1764
1980
 
1765
1981
  /***/ }),
1766
- /* 19 */
1982
+ /* 21 */
1767
1983
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1768
1984
 
1769
1985
  "use strict";
1770
1986
  __webpack_require__.r(__webpack_exports__);
1771
1987
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareTokenParams", function() { return prepareTokenParams; });
1772
- /* harmony import */ var _lib_pkce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
1773
- /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
1774
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1775
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
1988
+ /* harmony import */ var _lib_pkce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
1989
+ /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(27);
1990
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
1991
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
1776
1992
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
1777
1993
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
1778
1994
  /*!
@@ -1787,10 +2003,10 @@ function _asyncToGenerator(n) { return function () { var t = this, e = arguments
1787
2003
 
1788
2004
 
1789
2005
  var prepareTokenParams = /*#__PURE__*/function () {
1790
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
2006
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(params) {
1791
2007
  var clientId, redirectUri, state, codeVerifier, codeChallenge, tokenParams;
1792
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1793
- while (1) switch (_context.prev = _context.next) {
2008
+ return _regenerator().w(function (_context) {
2009
+ while (1) switch (_context.n) {
1794
2010
  case 0:
1795
2011
  // prepare all the params needed for building the signin flow
1796
2012
  // mandatory redirect_uri, for now, we only allow user to set redirect_uri and state
@@ -1798,17 +2014,17 @@ var prepareTokenParams = /*#__PURE__*/function () {
1798
2014
  // we prepare all the rest
1799
2015
  clientId = params.clientId, redirectUri = params.redirectUri, state = params.state;
1800
2016
  if (redirectUri) {
1801
- _context.next = 3;
2017
+ _context.n = 1;
1802
2018
  break;
1803
2019
  }
1804
2020
  throw new _errors__WEBPACK_IMPORTED_MODULE_1__["InvalidParamsError"](' No redirect uri params!');
1805
- case 3:
2021
+ case 1:
1806
2022
  // must be pkce
1807
2023
  codeVerifier = _lib_pkce__WEBPACK_IMPORTED_MODULE_0__["default"].generateVerifier();
1808
- _context.next = 6;
2024
+ _context.n = 2;
1809
2025
  return _lib_pkce__WEBPACK_IMPORTED_MODULE_0__["default"].computeChallenge(codeVerifier);
1810
- case 6:
1811
- codeChallenge = _context.sent;
2026
+ case 2:
2027
+ codeChallenge = _context.v;
1812
2028
  // pack up the full set of token params needed
1813
2029
  tokenParams = {
1814
2030
  clientId: clientId,
@@ -1822,10 +2038,7 @@ var prepareTokenParams = /*#__PURE__*/function () {
1822
2038
  if (state !== undefined && state !== null) {
1823
2039
  tokenParams.state = state;
1824
2040
  }
1825
- return _context.abrupt("return", tokenParams);
1826
- case 10:
1827
- case "end":
1828
- return _context.stop();
2041
+ return _context.a(2, tokenParams);
1829
2042
  }
1830
2043
  }, _callee);
1831
2044
  }));
@@ -1835,7 +2048,7 @@ var prepareTokenParams = /*#__PURE__*/function () {
1835
2048
  }();
1836
2049
 
1837
2050
  /***/ }),
1838
- /* 20 */
2051
+ /* 22 */
1839
2052
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1840
2053
 
1841
2054
  "use strict";
@@ -1843,7 +2056,7 @@ __webpack_require__.r(__webpack_exports__);
1843
2056
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MIN_VERIFIER_LENGTH", function() { return MIN_VERIFIER_LENGTH; });
1844
2057
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAX_VERIFIER_LENGTH", function() { return MAX_VERIFIER_LENGTH; });
1845
2058
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_CODE_CHALLENGE_METHOD", function() { return DEFAULT_CODE_CHALLENGE_METHOD; });
1846
- /* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
2059
+ /* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);
1847
2060
  /*!
1848
2061
  * Copyright 2024-Present Animoca Brands Corporation Ltd.
1849
2062
  *
@@ -1891,19 +2104,19 @@ function computeChallenge(str) {
1891
2104
  });
1892
2105
 
1893
2106
  /***/ }),
1894
- /* 21 */
2107
+ /* 23 */
1895
2108
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1896
2109
 
1897
2110
  "use strict";
1898
2111
  __webpack_require__.r(__webpack_exports__);
1899
- /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
2112
+ /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
1900
2113
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "atob", function() { return _webcrypto__WEBPACK_IMPORTED_MODULE_0__["atob"]; });
1901
2114
 
1902
2115
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "btoa", function() { return _webcrypto__WEBPACK_IMPORTED_MODULE_0__["btoa"]; });
1903
2116
 
1904
2117
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "webcrypto", function() { return _webcrypto__WEBPACK_IMPORTED_MODULE_0__["webcrypto"]; });
1905
2118
 
1906
- /* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
2119
+ /* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
1907
2120
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "base64ToBase64Url", function() { return _base64__WEBPACK_IMPORTED_MODULE_1__["base64ToBase64Url"]; });
1908
2121
 
1909
2122
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "base64UrlToBase64", function() { return _base64__WEBPACK_IMPORTED_MODULE_1__["base64UrlToBase64"]; });
@@ -1914,7 +2127,7 @@ __webpack_require__.r(__webpack_exports__);
1914
2127
 
1915
2128
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "base64UrlDecode", function() { return _base64__WEBPACK_IMPORTED_MODULE_1__["base64UrlDecode"]; });
1916
2129
 
1917
- /* harmony import */ var _verifyToken__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24);
2130
+ /* harmony import */ var _verifyToken__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26);
1918
2131
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "verifyToken", function() { return _verifyToken__WEBPACK_IMPORTED_MODULE_2__["verifyToken"]; });
1919
2132
 
1920
2133
  /*!
@@ -1931,7 +2144,7 @@ __webpack_require__.r(__webpack_exports__);
1931
2144
 
1932
2145
 
1933
2146
  /***/ }),
1934
- /* 22 */
2147
+ /* 24 */
1935
2148
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1936
2149
 
1937
2150
  "use strict";
@@ -1961,7 +2174,7 @@ var c = typeof crypto === 'undefined' ? null : crypto;
1961
2174
 
1962
2175
 
1963
2176
  /***/ }),
1964
- /* 23 */
2177
+ /* 25 */
1965
2178
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1966
2179
 
1967
2180
  "use strict";
@@ -1971,7 +2184,7 @@ __webpack_require__.r(__webpack_exports__);
1971
2184
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringToBase64Url", function() { return stringToBase64Url; });
1972
2185
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringToBuffer", function() { return stringToBuffer; });
1973
2186
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "base64UrlDecode", function() { return base64UrlDecode; });
1974
- /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
2187
+ /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
1975
2188
  /*!
1976
2189
  * Copyright 2024-Present Animoca Brands Corporation Ltd.
1977
2190
  *
@@ -2010,16 +2223,16 @@ function base64UrlDecode(str) {
2010
2223
  }
2011
2224
 
2012
2225
  /***/ }),
2013
- /* 24 */
2226
+ /* 26 */
2014
2227
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2015
2228
 
2016
2229
  "use strict";
2017
2230
  __webpack_require__.r(__webpack_exports__);
2018
2231
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "verifyToken", function() { return verifyToken; });
2019
- /* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);
2020
- /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22);
2021
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2022
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
2232
+ /* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
2233
+ /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24);
2234
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
2235
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
2023
2236
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
2024
2237
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
2025
2238
  /*!
@@ -2039,10 +2252,10 @@ var prepareKey = function prepareKey(key) {
2039
2252
  return Object(_base64__WEBPACK_IMPORTED_MODULE_0__["stringToBuffer"])(binaryDerString);
2040
2253
  };
2041
2254
  var verifyToken = /*#__PURE__*/function () {
2042
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(idToken, key) {
2255
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(idToken, key) {
2043
2256
  var format, algo, extractable, usages, preparedKey, cryptoKey, jwt, payload, b64Signature, signature;
2044
- return _regeneratorRuntime().wrap(function _callee$(_context) {
2045
- while (1) switch (_context.prev = _context.next) {
2257
+ return _regenerator().w(function (_context) {
2258
+ while (1) switch (_context.n) {
2046
2259
  case 0:
2047
2260
  format = 'spki';
2048
2261
  algo = {
@@ -2055,21 +2268,18 @@ var verifyToken = /*#__PURE__*/function () {
2055
2268
  extractable = true;
2056
2269
  usages = ['verify'];
2057
2270
  preparedKey = prepareKey(key);
2058
- _context.next = 7;
2271
+ _context.n = 1;
2059
2272
  return _webcrypto__WEBPACK_IMPORTED_MODULE_1__["webcrypto"].subtle.importKey(format, preparedKey, algo, extractable, usages);
2060
- case 7:
2061
- cryptoKey = _context.sent;
2273
+ case 1:
2274
+ cryptoKey = _context.v;
2062
2275
  jwt = idToken.split('.');
2063
2276
  payload = Object(_base64__WEBPACK_IMPORTED_MODULE_0__["stringToBuffer"])(jwt[0] + '.' + jwt[1]);
2064
2277
  b64Signature = Object(_base64__WEBPACK_IMPORTED_MODULE_0__["base64UrlDecode"])(jwt[2]);
2065
2278
  signature = Object(_base64__WEBPACK_IMPORTED_MODULE_0__["stringToBuffer"])(b64Signature);
2066
- _context.next = 14;
2279
+ _context.n = 2;
2067
2280
  return _webcrypto__WEBPACK_IMPORTED_MODULE_1__["webcrypto"].subtle.verify(algo, cryptoKey, signature, payload);
2068
- case 14:
2069
- return _context.abrupt("return", _context.sent);
2070
- case 15:
2071
- case "end":
2072
- return _context.stop();
2281
+ case 2:
2282
+ return _context.a(2, _context.v);
2073
2283
  }
2074
2284
  }, _callee);
2075
2285
  }));
@@ -2079,7 +2289,7 @@ var verifyToken = /*#__PURE__*/function () {
2079
2289
  }();
2080
2290
 
2081
2291
  /***/ }),
2082
- /* 25 */
2292
+ /* 27 */
2083
2293
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2084
2294
 
2085
2295
  "use strict";
@@ -2138,13 +2348,13 @@ var AuthError = /*#__PURE__*/function (_Error2) {
2138
2348
  }(/*#__PURE__*/_wrapNativeSuper(Error));
2139
2349
 
2140
2350
  /***/ }),
2141
- /* 26 */
2351
+ /* 28 */
2142
2352
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2143
2353
 
2144
2354
  "use strict";
2145
2355
  __webpack_require__.r(__webpack_exports__);
2146
2356
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPkceMeta", function() { return createPkceMeta; });
2147
- /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
2357
+ /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27);
2148
2358
  /*!
2149
2359
  * Copyright 2024-Present Animoca Brands Corporation Ltd.
2150
2360
  *
@@ -2172,7 +2382,7 @@ var createPkceMeta = function createPkceMeta(signinParams) {
2172
2382
  };
2173
2383
 
2174
2384
  /***/ }),
2175
- /* 27 */
2385
+ /* 29 */
2176
2386
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2177
2387
 
2178
2388
  "use strict";
@@ -2198,7 +2408,7 @@ var parseJwt = function parseJwt(token) {
2198
2408
  };
2199
2409
 
2200
2410
  /***/ }),
2201
- /* 28 */
2411
+ /* 30 */
2202
2412
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2203
2413
 
2204
2414
  "use strict";
@@ -2262,7 +2472,7 @@ var TransactionManager = /*#__PURE__*/function () {
2262
2472
  /* harmony default export */ __webpack_exports__["default"] = (TransactionManager);
2263
2473
 
2264
2474
  /***/ }),
2265
- /* 29 */
2475
+ /* 31 */
2266
2476
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2267
2477
 
2268
2478
  "use strict";
@@ -2270,8 +2480,8 @@ __webpack_require__.r(__webpack_exports__);
2270
2480
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseStorageManager", function() { return BaseStorageManager; });
2271
2481
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalStorageManager", function() { return LocalStorageManager; });
2272
2482
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStorageClass", function() { return getStorageClass; });
2273
- /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
2274
- /* harmony import */ var _CookieStorageProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30);
2483
+ /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27);
2484
+ /* harmony import */ var _CookieStorageProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(32);
2275
2485
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2276
2486
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
2277
2487
  function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
@@ -2403,13 +2613,13 @@ var getStorageClass = function getStorageClass(opts) {
2403
2613
  };
2404
2614
 
2405
2615
  /***/ }),
2406
- /* 30 */
2616
+ /* 32 */
2407
2617
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2408
2618
 
2409
2619
  "use strict";
2410
2620
  __webpack_require__.r(__webpack_exports__);
2411
2621
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CookieStorageProvider", function() { return CookieStorageProvider; });
2412
- /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
2622
+ /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33);
2413
2623
  /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(js_cookie__WEBPACK_IMPORTED_MODULE_0__);
2414
2624
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2415
2625
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -2479,7 +2689,7 @@ var CookieStorageProvider = /*#__PURE__*/function () {
2479
2689
  }();
2480
2690
 
2481
2691
  /***/ }),
2482
- /* 31 */
2692
+ /* 33 */
2483
2693
  /***/ (function(module, exports, __webpack_require__) {
2484
2694
 
2485
2695
  /*! js-cookie v3.0.5 | MIT */
@@ -2627,12 +2837,12 @@ var CookieStorageProvider = /*#__PURE__*/function () {
2627
2837
 
2628
2838
 
2629
2839
  /***/ }),
2630
- /* 32 */
2840
+ /* 34 */
2631
2841
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2632
2842
 
2633
2843
  "use strict";
2634
2844
  __webpack_require__.r(__webpack_exports__);
2635
- /* harmony import */ var _buildAuthEndpointUrl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33);
2845
+ /* harmony import */ var _buildAuthEndpointUrl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
2636
2846
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildAuthEndpointUrl", function() { return _buildAuthEndpointUrl__WEBPACK_IMPORTED_MODULE_0__["buildAuthEndpointUrl"]; });
2637
2847
 
2638
2848
  /*!
@@ -2647,7 +2857,7 @@ __webpack_require__.r(__webpack_exports__);
2647
2857
 
2648
2858
 
2649
2859
  /***/ }),
2650
- /* 33 */
2860
+ /* 35 */
2651
2861
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2652
2862
 
2653
2863
  "use strict";
@@ -2696,12 +2906,12 @@ var buildAuthEndpointUrl = function buildAuthEndpointUrl(signInParams, loginEndP
2696
2906
  };
2697
2907
 
2698
2908
  /***/ }),
2699
- /* 34 */
2909
+ /* 36 */
2700
2910
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2701
2911
 
2702
2912
  "use strict";
2703
2913
  __webpack_require__.r(__webpack_exports__);
2704
- /* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
2914
+ /* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(37);
2705
2915
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TokenManager", function() { return _lib__WEBPACK_IMPORTED_MODULE_0__["TokenManager"]; });
2706
2916
 
2707
2917
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransactionManager", function() { return _lib__WEBPACK_IMPORTED_MODULE_0__["TransactionManager"]; });
@@ -2723,18 +2933,18 @@ __webpack_require__.r(__webpack_exports__);
2723
2933
 
2724
2934
 
2725
2935
  /***/ }),
2726
- /* 35 */
2936
+ /* 37 */
2727
2937
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2728
2938
 
2729
2939
  "use strict";
2730
2940
  __webpack_require__.r(__webpack_exports__);
2731
- /* harmony import */ var _TokenManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
2941
+ /* harmony import */ var _TokenManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
2732
2942
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TokenManager", function() { return _TokenManager__WEBPACK_IMPORTED_MODULE_0__["default"]; });
2733
2943
 
2734
- /* harmony import */ var _TransactionManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28);
2944
+ /* harmony import */ var _TransactionManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30);
2735
2945
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransactionManager", function() { return _TransactionManager__WEBPACK_IMPORTED_MODULE_1__["default"]; });
2736
2946
 
2737
- /* harmony import */ var _StorageManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29);
2947
+ /* harmony import */ var _StorageManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31);
2738
2948
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseStorageManager", function() { return _StorageManager__WEBPACK_IMPORTED_MODULE_2__["BaseStorageManager"]; });
2739
2949
 
2740
2950
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LocalStorageManager", function() { return _StorageManager__WEBPACK_IMPORTED_MODULE_2__["LocalStorageManager"]; });