@opencampus/ocid-connect-js 2.0.6 → 2.0.8

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__(35);
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,14 @@ __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 _lib_WalletServiceManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
1078
+ /* harmony import */ var _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
1079
+ /* harmony import */ var _lib_TokenManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17);
1080
+ /* harmony import */ var _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29);
1081
+ /* harmony import */ var _lib_StorageManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30);
1082
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(18);
1083
+ /* harmony import */ var _endpoints__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(33);
1084
+ /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(26);
1085
1085
  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
1086
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
1087
1087
  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 +1090,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
1090
1090
  function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
1091
1091
  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
1092
  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; }
1093
+ 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 }; })(); }
1094
+ 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
1095
  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
1096
  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
1097
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -1115,8 +1116,9 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
1115
1116
 
1116
1117
 
1117
1118
 
1119
+
1118
1120
  var OCAuthCore = /*#__PURE__*/function () {
1119
- function OCAuthCore(clientId, loginEndpoint, redirectUri, transactionManager, tokenManager, referralCode, logoutEndPoint) {
1121
+ function OCAuthCore(clientId, loginEndpoint, redirectUri, transactionManager, tokenManager, referralCode, logoutEndPoint, walletServiceManager, authInfoManager) {
1120
1122
  _classCallCheck(this, OCAuthCore);
1121
1123
  _defineProperty(this, "clientId", void 0);
1122
1124
  _defineProperty(this, "tokenManager", void 0);
@@ -1126,17 +1128,19 @@ var OCAuthCore = /*#__PURE__*/function () {
1126
1128
  _defineProperty(this, "loginEndPoint", void 0);
1127
1129
  _defineProperty(this, "logoutEndPoint", void 0);
1128
1130
  _defineProperty(this, "referralCode", void 0);
1131
+ _defineProperty(this, "walletServiceManager", void 0);
1129
1132
  if (!clientId) {
1130
- throw new _utils_errors__WEBPACK_IMPORTED_MODULE_6__["InvalidParamsError"]('clientId is not defined');
1133
+ throw new _utils_errors__WEBPACK_IMPORTED_MODULE_7__["InvalidParamsError"]('clientId is not defined');
1131
1134
  }
1132
1135
  this.transactionManager = transactionManager;
1133
1136
  this.tokenManager = tokenManager;
1134
- this.authInfoManager = new _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_0__["default"]();
1137
+ this.authInfoManager = authInfoManager;
1135
1138
  this.loginEndPoint = loginEndpoint;
1136
1139
  this.logoutEndPoint = logoutEndPoint;
1137
1140
  this.redirectUri = redirectUri;
1138
1141
  this.referralCode = referralCode;
1139
1142
  this.clientId = clientId;
1143
+ this.walletServiceManager = walletServiceManager;
1140
1144
  this.syncAuthInfo();
1141
1145
  }
1142
1146
  return _createClass(OCAuthCore, [{
@@ -1148,20 +1152,22 @@ var OCAuthCore = /*#__PURE__*/function () {
1148
1152
  }, {
1149
1153
  key: "logout",
1150
1154
  value: function () {
1151
- var _logout = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(logoutReturnTo) {
1155
+ var _logout = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(logoutReturnTo) {
1152
1156
  var url;
1153
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1154
- while (1) switch (_context.prev = _context.next) {
1157
+ return _regenerator().w(function (_context) {
1158
+ while (1) switch (_context.n) {
1155
1159
  case 0:
1156
1160
  this.clearStorage();
1161
+ _context.n = 1;
1162
+ return this.walletServiceManager.logout();
1163
+ case 1:
1157
1164
  url = new URL(this.logoutEndPoint);
1158
1165
  if (logoutReturnTo) {
1159
1166
  url.searchParams.append('returnTo', logoutReturnTo);
1160
1167
  }
1161
1168
  window.location.assign(url.toString());
1162
- case 4:
1163
- case "end":
1164
- return _context.stop();
1169
+ case 2:
1170
+ return _context.a(2);
1165
1171
  }
1166
1172
  }, _callee, this);
1167
1173
  }));
@@ -1173,29 +1179,28 @@ var OCAuthCore = /*#__PURE__*/function () {
1173
1179
  }, {
1174
1180
  key: "signInWithRedirect",
1175
1181
  value: function () {
1176
- var _signInWithRedirect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
1182
+ var _signInWithRedirect = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(params) {
1177
1183
  var paramsClone, signinParams, meta, requestUrl;
1178
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1179
- while (1) switch (_context2.prev = _context2.next) {
1184
+ return _regenerator().w(function (_context2) {
1185
+ while (1) switch (_context2.n) {
1180
1186
  case 0:
1181
1187
  // we use ONLY code flow with PKCE, so lacks a lot of options
1182
1188
  // available in other OAuth SDKs.
1183
1189
  paramsClone = Object.assign({}, params);
1184
1190
  paramsClone.redirectUri = this.redirectUri;
1185
1191
  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);
1192
+ _context2.n = 1;
1193
+ return Object(_utils__WEBPACK_IMPORTED_MODULE_5__["prepareTokenParams"])(paramsClone);
1194
+ case 1:
1195
+ signinParams = _context2.v;
1196
+ meta = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["createPkceMeta"])(signinParams);
1191
1197
  this.transactionManager.save(meta);
1192
1198
  signinParams.referralCode = this.referralCode;
1193
1199
  signinParams.emailPlaceholder = paramsClone.emailPlaceholder;
1194
- requestUrl = Object(_endpoints__WEBPACK_IMPORTED_MODULE_5__["buildAuthEndpointUrl"])(signinParams, this.loginEndPoint);
1200
+ requestUrl = Object(_endpoints__WEBPACK_IMPORTED_MODULE_6__["buildAuthEndpointUrl"])(signinParams, this.loginEndPoint);
1195
1201
  window.location.assign(requestUrl);
1196
- case 12:
1197
- case "end":
1198
- return _context2.stop();
1202
+ case 2:
1203
+ return _context2.a(2);
1199
1204
  }
1200
1205
  }, _callee2, this);
1201
1206
  }));
@@ -1207,36 +1212,35 @@ var OCAuthCore = /*#__PURE__*/function () {
1207
1212
  }, {
1208
1213
  key: "handleLoginRedirect",
1209
1214
  value: function () {
1210
- var _handleLoginRedirect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
1215
+ var _handleLoginRedirect = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
1211
1216
  var urlParams, meta, codeVerifier;
1212
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1213
- while (1) switch (_context3.prev = _context3.next) {
1217
+ return _regenerator().w(function (_context3) {
1218
+ while (1) switch (_context3.n) {
1214
1219
  case 0:
1215
- urlParams = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["parseUrl"])(); // Again we only handle PKCE code flow
1220
+ urlParams = Object(_utils__WEBPACK_IMPORTED_MODULE_5__["parseUrl"])(); // Again we only handle PKCE code flow
1216
1221
  if (!urlParams.code) {
1217
- _context3.next = 13;
1222
+ _context3.n = 4;
1218
1223
  break;
1219
1224
  }
1220
1225
  meta = this.transactionManager.getTransactionMeta();
1221
1226
  codeVerifier = meta.codeVerifier;
1222
1227
  if (!codeVerifier) {
1223
- _context3.next = 12;
1228
+ _context3.n = 3;
1224
1229
  break;
1225
1230
  }
1226
- _context3.next = 7;
1231
+ _context3.n = 1;
1227
1232
  return this.tokenManager.exchangeTokenFromCode(urlParams.code, codeVerifier, urlParams.state);
1228
- case 7:
1233
+ case 1:
1229
1234
  // clear transaction meta, coz it's completed
1230
1235
  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();
1236
+ _context3.n = 2;
1237
+ return this.syncAuthInfo();
1238
+ case 2:
1239
+ return _context3.a(2, this.getAuthState());
1240
+ case 3:
1241
+ throw new _utils_errors__WEBPACK_IMPORTED_MODULE_7__["AuthError"]('codeVerifier not found, cannot complete flow');
1242
+ case 4:
1243
+ return _context3.a(2, {});
1240
1244
  }
1241
1245
  }, _callee3, this);
1242
1246
  }));
@@ -1253,16 +1257,34 @@ var OCAuthCore = /*#__PURE__*/function () {
1253
1257
  }
1254
1258
  }, {
1255
1259
  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);
1260
+ value: function () {
1261
+ var _syncAuthInfo = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
1262
+ var _this$getParsedIdToke, edu_username, eth_address;
1263
+ return _regenerator().w(function (_context4) {
1264
+ while (1) switch (_context4.n) {
1265
+ case 0:
1266
+ if (!this.tokenManager.hasExpired()) {
1267
+ _context4.n = 1;
1268
+ break;
1269
+ }
1270
+ this.authInfoManager.clear();
1271
+ _context4.n = 2;
1272
+ break;
1273
+ case 1:
1274
+ _this$getParsedIdToke = this.getParsedIdToken(), edu_username = _this$getParsedIdToke.edu_username, eth_address = _this$getParsedIdToke.eth_address;
1275
+ this.authInfoManager.setAuthState(this.getAccessToken(), this.getIdToken(), edu_username, eth_address, true);
1276
+ _context4.n = 2;
1277
+ return this.walletServiceManager.login(this.getAccessToken());
1278
+ case 2:
1279
+ return _context4.a(2);
1280
+ }
1281
+ }, _callee4, this);
1282
+ }));
1283
+ function syncAuthInfo() {
1284
+ return _syncAuthInfo.apply(this, arguments);
1264
1285
  }
1265
- }
1286
+ return syncAuthInfo;
1287
+ }()
1266
1288
  }, {
1267
1289
  key: "getAuthState",
1268
1290
  value: function getAuthState() {
@@ -1289,7 +1311,7 @@ var OCAuthCore = /*#__PURE__*/function () {
1289
1311
  // return all info in id token
1290
1312
  var idToken = this.tokenManager.getIdToken();
1291
1313
  if (idToken) {
1292
- return Object(_utils__WEBPACK_IMPORTED_MODULE_4__["parseJwt"])(idToken);
1314
+ return Object(_utils__WEBPACK_IMPORTED_MODULE_5__["parseJwt"])(idToken);
1293
1315
  }
1294
1316
  return {};
1295
1317
  }
@@ -1299,7 +1321,7 @@ var OCAuthCore = /*#__PURE__*/function () {
1299
1321
  // return all info in access token
1300
1322
  var accessToken = this.tokenManager.getAccessToken();
1301
1323
  if (accessToken) {
1302
- return Object(_utils__WEBPACK_IMPORTED_MODULE_4__["parseJwt"])(accessToken);
1324
+ return Object(_utils__WEBPACK_IMPORTED_MODULE_5__["parseJwt"])(accessToken);
1303
1325
  }
1304
1326
  return {};
1305
1327
  }
@@ -1321,6 +1343,12 @@ var OCAuthCore = /*#__PURE__*/function () {
1321
1343
  }();
1322
1344
  var LIVE_PUBLIC_KEY = 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBIDHtLbgVM76SXZ4iuIjuO+ERQPnVpJzagOsZdYxFG3ZJmvfdpr/Z29SLUbdZWafrOlAVlKe1Ovf/tcH671tTw==';
1323
1345
  var SANDBOX_PUBLIC_KEY = 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE/EymMLXd/MVYPK5r2xXQj91ZVvX3OQ+QagvR2N6lCvRVjnzmOtPRTf+u5g1RliWnmuxbV3gTm0/0VuV/40Salg==';
1346
+ var BUILD_ENV = {
1347
+ PRODUCTION: 'production',
1348
+ SANDBOX: 'sandbox'
1349
+ };
1350
+ var LIVE_PARTNER_ID = '2debfc3c-2205-4c67-b6f2-d015b286b318';
1351
+ var SANDBOX_PARTNER_ID = '3d54efbe-2666-45b7-bdf9-e843d69fd2f8';
1324
1352
  var OCAuthLive = /*#__PURE__*/function (_OCAuthCore2) {
1325
1353
  function OCAuthLive() {
1326
1354
  var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -1329,17 +1357,32 @@ var OCAuthLive = /*#__PURE__*/function (_OCAuthCore2) {
1329
1357
  overrideLoginEndpoint = opts.loginEndPoint,
1330
1358
  overrideLogoutEndpoint = opts.logoutEndPoint,
1331
1359
  overridePublicKey = opts.publicKey,
1360
+ overrideAirKitTokenEndpoint = opts.airKitTokenEndPoint,
1361
+ overrideAirKitPartnerId = opts.airKitPartnerId,
1362
+ overrideAirKitBuildEnv = opts.airKitBuildEnv,
1332
1363
  redirectUri = opts.redirectUri,
1333
1364
  referralCode = opts.referralCode,
1334
- clientId = opts.clientId;
1365
+ clientId = opts.clientId,
1366
+ useWalletService = opts.useWalletService;
1335
1367
  var tokenEndpoint = overrideTokenEndpoint || 'https://api.login.opencampus.xyz/auth/token';
1336
1368
  var loginEndpoint = overrideLoginEndpoint || 'https://api.login.opencampus.xyz/auth/login';
1337
1369
  var logoutEndpoint = overrideLogoutEndpoint || 'https://api.login.opencampus.xyz/auth/logout';
1370
+ var airKitTokenEndpoint = overrideAirKitTokenEndpoint || 'https://api.login.opencampus.xyz/auth/airkit/token';
1338
1371
  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]);
1372
+ var airKitPartnerId = overrideAirKitPartnerId || LIVE_PARTNER_ID;
1373
+ var airKitBuildEnv = overrideAirKitBuildEnv || BUILD_ENV.PRODUCTION;
1374
+ var storageClass = Object(_lib_StorageManager__WEBPACK_IMPORTED_MODULE_4__["getStorageClass"])(opts);
1375
+ var authInfoManager = new _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_1__["default"]();
1376
+ var walletServiceManager = new _lib_WalletServiceManager__WEBPACK_IMPORTED_MODULE_0__["default"]({
1377
+ airKitPartnerId: airKitPartnerId,
1378
+ airKitEnv: airKitBuildEnv,
1379
+ airKitTokenEndpoint: airKitTokenEndpoint,
1380
+ authInfoManager: authInfoManager,
1381
+ useWalletService: useWalletService
1382
+ });
1383
+ var pkceTransactionManager = new _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_3__["default"](storageClass);
1384
+ var tokenManager = new _lib_TokenManager__WEBPACK_IMPORTED_MODULE_2__["default"](storageClass, tokenEndpoint, publicKey);
1385
+ return _callSuper(this, OCAuthLive, [clientId, loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint, walletServiceManager, authInfoManager]);
1343
1386
  }
1344
1387
  _inherits(OCAuthLive, _OCAuthCore2);
1345
1388
  return _createClass(OCAuthLive);
@@ -1352,17 +1395,32 @@ var OCAuthSandbox = /*#__PURE__*/function (_OCAuthCore3) {
1352
1395
  overrideLoginEndpoint = opts.loginEndPoint,
1353
1396
  overrideLogoutEndpoint = opts.logoutEndPoint,
1354
1397
  overridePublicKey = opts.publicKey,
1398
+ overrideAirKitTokenEndpoint = opts.airKitTokenEndPoint,
1399
+ overrideAirKitPartnerId = opts.airKitPartnerId,
1400
+ overrideAirKitBuildEnv = opts.airKitBuildEnv,
1355
1401
  redirectUri = opts.redirectUri,
1356
- referralCode = opts.referralCode;
1402
+ referralCode = opts.referralCode,
1403
+ useWalletService = opts.useWalletService;
1357
1404
  var clientId = opts.clientId || 'sandbox';
1358
1405
  var tokenEndpoint = overrideTokenEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/token';
1359
1406
  var loginEndpoint = overrideLoginEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/login';
1360
1407
  var logoutEndpoint = overrideLogoutEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/logout';
1408
+ var airKitTokenEndpoint = overrideAirKitTokenEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/airkit/token';
1361
1409
  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]);
1410
+ var airKitPartnerId = overrideAirKitPartnerId || SANDBOX_PARTNER_ID;
1411
+ var airKitBuildEnv = overrideAirKitBuildEnv || BUILD_ENV.SANDBOX;
1412
+ var authInfoManager = new _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_1__["default"]();
1413
+ var storageClass = Object(_lib_StorageManager__WEBPACK_IMPORTED_MODULE_4__["getStorageClass"])(opts);
1414
+ var walletServiceManager = new _lib_WalletServiceManager__WEBPACK_IMPORTED_MODULE_0__["default"]({
1415
+ airKitPartnerId: airKitPartnerId,
1416
+ airKitEnv: airKitBuildEnv,
1417
+ airKitTokenEndpoint: airKitTokenEndpoint,
1418
+ authInfoManager: authInfoManager,
1419
+ useWalletService: useWalletService
1420
+ });
1421
+ var pkceTransactionManager = new _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_3__["default"](storageClass);
1422
+ var tokenManager = new _lib_TokenManager__WEBPACK_IMPORTED_MODULE_2__["default"](storageClass, tokenEndpoint, publicKey);
1423
+ return _callSuper(this, OCAuthSandbox, [clientId, loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint, walletServiceManager, authInfoManager]);
1366
1424
  }
1367
1425
  _inherits(OCAuthSandbox, _OCAuthCore3);
1368
1426
  return _createClass(OCAuthSandbox);
@@ -1374,7 +1432,158 @@ var OCAuthSandbox = /*#__PURE__*/function (_OCAuthCore3) {
1374
1432
 
1375
1433
  "use strict";
1376
1434
  __webpack_require__.r(__webpack_exports__);
1377
- /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
1435
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAirServiceFactory", function() { return setAirServiceFactory; });
1436
+ 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); }
1437
+ 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 }; })(); }
1438
+ 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); }
1439
+ 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); }
1440
+ 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); }); }; }
1441
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
1442
+ 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); } }
1443
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
1444
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
1445
+ 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); }
1446
+ var _airService = null;
1447
+ var _airServiceInitialized = false;
1448
+ var _airServiceFactory = null;
1449
+ var setAirServiceFactory = function setAirServiceFactory(factory) {
1450
+ _airServiceFactory = factory;
1451
+ };
1452
+ var WalletServiceManager = /*#__PURE__*/function () {
1453
+ function WalletServiceManager(_ref) {
1454
+ var airKitPartnerId = _ref.airKitPartnerId,
1455
+ airKitEnv = _ref.airKitEnv,
1456
+ airKitTokenEndpoint = _ref.airKitTokenEndpoint,
1457
+ authInfoManager = _ref.authInfoManager,
1458
+ useWalletService = _ref.useWalletService;
1459
+ _classCallCheck(this, WalletServiceManager);
1460
+ this.airKitTokenEndpoint = airKitTokenEndpoint;
1461
+ this.airKitEnv = airKitEnv;
1462
+ this.authInfoManager = authInfoManager;
1463
+ if (useWalletService && !_airService && _airServiceFactory) {
1464
+ _airService = _airServiceFactory({
1465
+ partnerId: airKitPartnerId,
1466
+ environment: airKitEnv
1467
+ });
1468
+ }
1469
+ }
1470
+ return _createClass(WalletServiceManager, [{
1471
+ key: "init",
1472
+ value: function () {
1473
+ var _init = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
1474
+ return _regenerator().w(function (_context) {
1475
+ while (1) switch (_context.n) {
1476
+ case 0:
1477
+ if (!(_airService && !_airServiceInitialized)) {
1478
+ _context.n = 2;
1479
+ break;
1480
+ }
1481
+ _context.n = 1;
1482
+ return _airService.init({
1483
+ buildEnv: this.airKitEnv
1484
+ });
1485
+ case 1:
1486
+ _airServiceInitialized = true;
1487
+ case 2:
1488
+ return _context.a(2);
1489
+ }
1490
+ }, _callee, this);
1491
+ }));
1492
+ function init() {
1493
+ return _init.apply(this, arguments);
1494
+ }
1495
+ return init;
1496
+ }()
1497
+ }, {
1498
+ key: "login",
1499
+ value: function () {
1500
+ var _login = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(accessToken) {
1501
+ var response, tokenResponse, airKitToken;
1502
+ return _regenerator().w(function (_context2) {
1503
+ while (1) switch (_context2.n) {
1504
+ case 0:
1505
+ if (!_airService) {
1506
+ _context2.n = 5;
1507
+ break;
1508
+ }
1509
+ _context2.n = 1;
1510
+ return this.init();
1511
+ case 1:
1512
+ _context2.n = 2;
1513
+ return fetch(this.airKitTokenEndpoint, {
1514
+ method: "GET",
1515
+ headers: {
1516
+ "Content-Type": "application/json",
1517
+ Authorization: "Bearer ".concat(accessToken)
1518
+ }
1519
+ });
1520
+ case 2:
1521
+ response = _context2.v;
1522
+ _context2.n = 3;
1523
+ return response.json();
1524
+ case 3:
1525
+ tokenResponse = _context2.v;
1526
+ airKitToken = tokenResponse.airKitToken;
1527
+ if (!airKitToken) {
1528
+ _context2.n = 5;
1529
+ break;
1530
+ }
1531
+ _context2.n = 4;
1532
+ return _airService.login({
1533
+ authToken: airKitToken
1534
+ });
1535
+ case 4:
1536
+ this.authInfoManager.updateAuthState({
1537
+ walletService: _airService
1538
+ });
1539
+ case 5:
1540
+ return _context2.a(2);
1541
+ }
1542
+ }, _callee2, this);
1543
+ }));
1544
+ function login(_x) {
1545
+ return _login.apply(this, arguments);
1546
+ }
1547
+ return login;
1548
+ }()
1549
+ }, {
1550
+ key: "logout",
1551
+ value: function () {
1552
+ var _logout = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
1553
+ return _regenerator().w(function (_context3) {
1554
+ while (1) switch (_context3.n) {
1555
+ case 0:
1556
+ if (!(_airService && _airService.isLoggedIn)) {
1557
+ _context3.n = 2;
1558
+ break;
1559
+ }
1560
+ _context3.n = 1;
1561
+ return _airService.logout();
1562
+ case 1:
1563
+ this.authInfoManager.updateAuthState({
1564
+ walletService: undefined
1565
+ });
1566
+ case 2:
1567
+ return _context3.a(2);
1568
+ }
1569
+ }, _callee3, this);
1570
+ }));
1571
+ function logout() {
1572
+ return _logout.apply(this, arguments);
1573
+ }
1574
+ return logout;
1575
+ }()
1576
+ }]);
1577
+ }();
1578
+ /* harmony default export */ __webpack_exports__["default"] = (WalletServiceManager);
1579
+
1580
+ /***/ }),
1581
+ /* 15 */
1582
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
1583
+
1584
+ "use strict";
1585
+ __webpack_require__.r(__webpack_exports__);
1586
+ /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
1378
1587
  /* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tiny_emitter__WEBPACK_IMPORTED_MODULE_0__);
1379
1588
  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
1589
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -1420,6 +1629,12 @@ var AuthInfoManager = /*#__PURE__*/function () {
1420
1629
  value: function getAuthState() {
1421
1630
  return Object.assign({}, this._authState);
1422
1631
  }
1632
+ }, {
1633
+ key: "updateAuthState",
1634
+ value: function updateAuthState(partialAuthState) {
1635
+ this._authState = Object.assign({}, this._authState, partialAuthState);
1636
+ this._emitter.emit(EVENT_AUTH_STATE_CHANGE, this._authState);
1637
+ }
1423
1638
  }, {
1424
1639
  key: "clear",
1425
1640
  value: function clear() {
@@ -1443,7 +1658,7 @@ var AuthInfoManager = /*#__PURE__*/function () {
1443
1658
  /* harmony default export */ __webpack_exports__["default"] = (AuthInfoManager);
1444
1659
 
1445
1660
  /***/ }),
1446
- /* 15 */
1661
+ /* 16 */
1447
1662
  /***/ (function(module, exports) {
1448
1663
 
1449
1664
  function E () {
@@ -1516,16 +1731,17 @@ module.exports.TinyEmitter = E;
1516
1731
 
1517
1732
 
1518
1733
  /***/ }),
1519
- /* 16 */
1734
+ /* 17 */
1520
1735
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1521
1736
 
1522
1737
  "use strict";
1523
1738
  __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);
1739
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
1740
+ /* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22);
1741
+ /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26);
1527
1742
  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; }
1743
+ 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 }; })(); }
1744
+ 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
1745
  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
1746
  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
1747
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -1567,7 +1783,7 @@ var TokenManager = /*#__PURE__*/function () {
1567
1783
  }, {
1568
1784
  key: "exchangeTokenFromCode",
1569
1785
  value: function () {
1570
- var _exchangeTokenFromCode = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessCode, codeVerifier) {
1786
+ var _exchangeTokenFromCode = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(accessCode, codeVerifier) {
1571
1787
  var state,
1572
1788
  body,
1573
1789
  response,
@@ -1578,17 +1794,18 @@ var TokenManager = /*#__PURE__*/function () {
1578
1794
  tokenVerified,
1579
1795
  parsedAccessToken,
1580
1796
  storageData,
1581
- _args = arguments;
1582
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1583
- while (1) switch (_context.prev = _context.next) {
1797
+ _args = arguments,
1798
+ _t;
1799
+ return _regenerator().w(function (_context) {
1800
+ while (1) switch (_context.p = _context.n) {
1584
1801
  case 0:
1585
1802
  state = _args.length > 2 && _args[2] !== undefined ? _args[2] : null;
1586
1803
  body = {
1587
1804
  accessCode: accessCode,
1588
1805
  codeVerifier: codeVerifier
1589
1806
  };
1590
- _context.prev = 2;
1591
- _context.next = 5;
1807
+ _context.p = 1;
1808
+ _context.n = 2;
1592
1809
  return fetch(this.tokenEndPoint, {
1593
1810
  method: 'POST',
1594
1811
  headers: {
@@ -1596,34 +1813,34 @@ var TokenManager = /*#__PURE__*/function () {
1596
1813
  },
1597
1814
  body: JSON.stringify(body)
1598
1815
  });
1599
- case 5:
1600
- response = _context.sent;
1601
- _context.next = 8;
1816
+ case 2:
1817
+ response = _context.v;
1818
+ _context.n = 3;
1602
1819
  return response.json();
1603
- case 8:
1604
- _yield$response$json = _context.sent;
1820
+ case 3:
1821
+ _yield$response$json = _context.v;
1605
1822
  access_token = _yield$response$json.access_token;
1606
1823
  id_token = _yield$response$json.id_token;
1607
1824
  if (!(!access_token || !id_token)) {
1608
- _context.next = 13;
1825
+ _context.n = 4;
1609
1826
  break;
1610
1827
  }
1611
1828
  throw new _utils_errors__WEBPACK_IMPORTED_MODULE_2__["AuthError"]('Fail to exchange token');
1612
- case 13:
1613
- _context.next = 15;
1829
+ case 4:
1830
+ _context.n = 5;
1614
1831
  return this.getPublicKey();
1615
- case 15:
1616
- pubKey = _context.sent;
1617
- _context.next = 18;
1832
+ case 5:
1833
+ pubKey = _context.v;
1834
+ _context.n = 6;
1618
1835
  return Object(_crypto__WEBPACK_IMPORTED_MODULE_1__["verifyToken"])(id_token, pubKey);
1619
- case 18:
1620
- tokenVerified = _context.sent;
1836
+ case 6:
1837
+ tokenVerified = _context.v;
1621
1838
  if (tokenVerified) {
1622
- _context.next = 21;
1839
+ _context.n = 7;
1623
1840
  break;
1624
1841
  }
1625
1842
  throw new _utils_errors__WEBPACK_IMPORTED_MODULE_2__["AuthError"]('Unable to verify token');
1626
- case 21:
1843
+ case 7:
1627
1844
  parsedAccessToken = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["parseJwt"])(access_token);
1628
1845
  storageData = Object.assign({
1629
1846
  access_token: access_token,
@@ -1633,18 +1850,17 @@ var TokenManager = /*#__PURE__*/function () {
1633
1850
  state: state
1634
1851
  });
1635
1852
  this.storageManager.getStorageObject().setStorage(storageData);
1636
- _context.next = 30;
1853
+ _context.n = 9;
1637
1854
  break;
1638
- case 26:
1639
- _context.prev = 26;
1640
- _context.t0 = _context["catch"](2);
1641
- console.log(_context.t0);
1855
+ case 8:
1856
+ _context.p = 8;
1857
+ _t = _context.v;
1858
+ console.log(_t);
1642
1859
  throw new _utils_errors__WEBPACK_IMPORTED_MODULE_2__["AuthError"]('Token acquisition failed');
1643
- case 30:
1644
- case "end":
1645
- return _context.stop();
1860
+ case 9:
1861
+ return _context.a(2);
1646
1862
  }
1647
- }, _callee, this, [[2, 26]]);
1863
+ }, _callee, this, [[1, 8]]);
1648
1864
  }));
1649
1865
  function exchangeTokenFromCode(_x, _x2) {
1650
1866
  return _exchangeTokenFromCode.apply(this, arguments);
@@ -1674,14 +1890,11 @@ var TokenManager = /*#__PURE__*/function () {
1674
1890
  }, {
1675
1891
  key: "getPublicKey",
1676
1892
  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) {
1893
+ var _getPublicKey = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
1894
+ return _regenerator().w(function (_context2) {
1895
+ while (1) switch (_context2.n) {
1680
1896
  case 0:
1681
- return _context2.abrupt("return", this.publicKey);
1682
- case 1:
1683
- case "end":
1684
- return _context2.stop();
1897
+ return _context2.a(2, this.publicKey);
1685
1898
  }
1686
1899
  }, _callee2, this);
1687
1900
  }));
@@ -1705,21 +1918,21 @@ var TokenManager = /*#__PURE__*/function () {
1705
1918
  /* harmony default export */ __webpack_exports__["default"] = (TokenManager);
1706
1919
 
1707
1920
  /***/ }),
1708
- /* 17 */
1921
+ /* 18 */
1709
1922
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1710
1923
 
1711
1924
  "use strict";
1712
1925
  __webpack_require__.r(__webpack_exports__);
1713
- /* harmony import */ var _urlParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
1926
+ /* harmony import */ var _urlParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(19);
1714
1927
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseUrl", function() { return _urlParser__WEBPACK_IMPORTED_MODULE_0__["parseUrl"]; });
1715
1928
 
1716
- /* harmony import */ var _prepareTokenParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);
1929
+ /* harmony import */ var _prepareTokenParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
1717
1930
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareTokenParams", function() { return _prepareTokenParams__WEBPACK_IMPORTED_MODULE_1__["prepareTokenParams"]; });
1718
1931
 
1719
- /* harmony import */ var _createPkceMeta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26);
1932
+ /* harmony import */ var _createPkceMeta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(27);
1720
1933
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createPkceMeta", function() { return _createPkceMeta__WEBPACK_IMPORTED_MODULE_2__["createPkceMeta"]; });
1721
1934
 
1722
- /* harmony import */ var _jwtParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27);
1935
+ /* harmony import */ var _jwtParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(28);
1723
1936
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseJwt", function() { return _jwtParser__WEBPACK_IMPORTED_MODULE_3__["parseJwt"]; });
1724
1937
 
1725
1938
  /*!
@@ -1737,7 +1950,7 @@ __webpack_require__.r(__webpack_exports__);
1737
1950
 
1738
1951
 
1739
1952
  /***/ }),
1740
- /* 18 */
1953
+ /* 19 */
1741
1954
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1742
1955
 
1743
1956
  "use strict";
@@ -1763,16 +1976,16 @@ var parseUrl = function parseUrl() {
1763
1976
  };
1764
1977
 
1765
1978
  /***/ }),
1766
- /* 19 */
1979
+ /* 20 */
1767
1980
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1768
1981
 
1769
1982
  "use strict";
1770
1983
  __webpack_require__.r(__webpack_exports__);
1771
1984
  /* 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; }
1985
+ /* harmony import */ var _lib_pkce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
1986
+ /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26);
1987
+ 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 }; })(); }
1988
+ 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
1989
  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
1990
  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
1991
  /*!
@@ -1787,10 +2000,10 @@ function _asyncToGenerator(n) { return function () { var t = this, e = arguments
1787
2000
 
1788
2001
 
1789
2002
  var prepareTokenParams = /*#__PURE__*/function () {
1790
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
2003
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(params) {
1791
2004
  var clientId, redirectUri, state, codeVerifier, codeChallenge, tokenParams;
1792
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1793
- while (1) switch (_context.prev = _context.next) {
2005
+ return _regenerator().w(function (_context) {
2006
+ while (1) switch (_context.n) {
1794
2007
  case 0:
1795
2008
  // prepare all the params needed for building the signin flow
1796
2009
  // mandatory redirect_uri, for now, we only allow user to set redirect_uri and state
@@ -1798,17 +2011,17 @@ var prepareTokenParams = /*#__PURE__*/function () {
1798
2011
  // we prepare all the rest
1799
2012
  clientId = params.clientId, redirectUri = params.redirectUri, state = params.state;
1800
2013
  if (redirectUri) {
1801
- _context.next = 3;
2014
+ _context.n = 1;
1802
2015
  break;
1803
2016
  }
1804
2017
  throw new _errors__WEBPACK_IMPORTED_MODULE_1__["InvalidParamsError"](' No redirect uri params!');
1805
- case 3:
2018
+ case 1:
1806
2019
  // must be pkce
1807
2020
  codeVerifier = _lib_pkce__WEBPACK_IMPORTED_MODULE_0__["default"].generateVerifier();
1808
- _context.next = 6;
2021
+ _context.n = 2;
1809
2022
  return _lib_pkce__WEBPACK_IMPORTED_MODULE_0__["default"].computeChallenge(codeVerifier);
1810
- case 6:
1811
- codeChallenge = _context.sent;
2023
+ case 2:
2024
+ codeChallenge = _context.v;
1812
2025
  // pack up the full set of token params needed
1813
2026
  tokenParams = {
1814
2027
  clientId: clientId,
@@ -1822,10 +2035,7 @@ var prepareTokenParams = /*#__PURE__*/function () {
1822
2035
  if (state !== undefined && state !== null) {
1823
2036
  tokenParams.state = state;
1824
2037
  }
1825
- return _context.abrupt("return", tokenParams);
1826
- case 10:
1827
- case "end":
1828
- return _context.stop();
2038
+ return _context.a(2, tokenParams);
1829
2039
  }
1830
2040
  }, _callee);
1831
2041
  }));
@@ -1835,7 +2045,7 @@ var prepareTokenParams = /*#__PURE__*/function () {
1835
2045
  }();
1836
2046
 
1837
2047
  /***/ }),
1838
- /* 20 */
2048
+ /* 21 */
1839
2049
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1840
2050
 
1841
2051
  "use strict";
@@ -1843,7 +2053,7 @@ __webpack_require__.r(__webpack_exports__);
1843
2053
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MIN_VERIFIER_LENGTH", function() { return MIN_VERIFIER_LENGTH; });
1844
2054
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAX_VERIFIER_LENGTH", function() { return MAX_VERIFIER_LENGTH; });
1845
2055
  /* 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);
2056
+ /* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
1847
2057
  /*!
1848
2058
  * Copyright 2024-Present Animoca Brands Corporation Ltd.
1849
2059
  *
@@ -1891,19 +2101,19 @@ function computeChallenge(str) {
1891
2101
  });
1892
2102
 
1893
2103
  /***/ }),
1894
- /* 21 */
2104
+ /* 22 */
1895
2105
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1896
2106
 
1897
2107
  "use strict";
1898
2108
  __webpack_require__.r(__webpack_exports__);
1899
- /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
2109
+ /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);
1900
2110
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "atob", function() { return _webcrypto__WEBPACK_IMPORTED_MODULE_0__["atob"]; });
1901
2111
 
1902
2112
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "btoa", function() { return _webcrypto__WEBPACK_IMPORTED_MODULE_0__["btoa"]; });
1903
2113
 
1904
2114
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "webcrypto", function() { return _webcrypto__WEBPACK_IMPORTED_MODULE_0__["webcrypto"]; });
1905
2115
 
1906
- /* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
2116
+ /* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24);
1907
2117
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "base64ToBase64Url", function() { return _base64__WEBPACK_IMPORTED_MODULE_1__["base64ToBase64Url"]; });
1908
2118
 
1909
2119
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "base64UrlToBase64", function() { return _base64__WEBPACK_IMPORTED_MODULE_1__["base64UrlToBase64"]; });
@@ -1914,7 +2124,7 @@ __webpack_require__.r(__webpack_exports__);
1914
2124
 
1915
2125
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "base64UrlDecode", function() { return _base64__WEBPACK_IMPORTED_MODULE_1__["base64UrlDecode"]; });
1916
2126
 
1917
- /* harmony import */ var _verifyToken__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24);
2127
+ /* harmony import */ var _verifyToken__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
1918
2128
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "verifyToken", function() { return _verifyToken__WEBPACK_IMPORTED_MODULE_2__["verifyToken"]; });
1919
2129
 
1920
2130
  /*!
@@ -1931,7 +2141,7 @@ __webpack_require__.r(__webpack_exports__);
1931
2141
 
1932
2142
 
1933
2143
  /***/ }),
1934
- /* 22 */
2144
+ /* 23 */
1935
2145
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1936
2146
 
1937
2147
  "use strict";
@@ -1961,7 +2171,7 @@ var c = typeof crypto === 'undefined' ? null : crypto;
1961
2171
 
1962
2172
 
1963
2173
  /***/ }),
1964
- /* 23 */
2174
+ /* 24 */
1965
2175
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1966
2176
 
1967
2177
  "use strict";
@@ -1971,7 +2181,7 @@ __webpack_require__.r(__webpack_exports__);
1971
2181
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringToBase64Url", function() { return stringToBase64Url; });
1972
2182
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringToBuffer", function() { return stringToBuffer; });
1973
2183
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "base64UrlDecode", function() { return base64UrlDecode; });
1974
- /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
2184
+ /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);
1975
2185
  /*!
1976
2186
  * Copyright 2024-Present Animoca Brands Corporation Ltd.
1977
2187
  *
@@ -2010,16 +2220,16 @@ function base64UrlDecode(str) {
2010
2220
  }
2011
2221
 
2012
2222
  /***/ }),
2013
- /* 24 */
2223
+ /* 25 */
2014
2224
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2015
2225
 
2016
2226
  "use strict";
2017
2227
  __webpack_require__.r(__webpack_exports__);
2018
2228
  /* 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; }
2229
+ /* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24);
2230
+ /* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
2231
+ 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 }; })(); }
2232
+ 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
2233
  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
2234
  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
2235
  /*!
@@ -2039,10 +2249,10 @@ var prepareKey = function prepareKey(key) {
2039
2249
  return Object(_base64__WEBPACK_IMPORTED_MODULE_0__["stringToBuffer"])(binaryDerString);
2040
2250
  };
2041
2251
  var verifyToken = /*#__PURE__*/function () {
2042
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(idToken, key) {
2252
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(idToken, key) {
2043
2253
  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) {
2254
+ return _regenerator().w(function (_context) {
2255
+ while (1) switch (_context.n) {
2046
2256
  case 0:
2047
2257
  format = 'spki';
2048
2258
  algo = {
@@ -2055,21 +2265,18 @@ var verifyToken = /*#__PURE__*/function () {
2055
2265
  extractable = true;
2056
2266
  usages = ['verify'];
2057
2267
  preparedKey = prepareKey(key);
2058
- _context.next = 7;
2268
+ _context.n = 1;
2059
2269
  return _webcrypto__WEBPACK_IMPORTED_MODULE_1__["webcrypto"].subtle.importKey(format, preparedKey, algo, extractable, usages);
2060
- case 7:
2061
- cryptoKey = _context.sent;
2270
+ case 1:
2271
+ cryptoKey = _context.v;
2062
2272
  jwt = idToken.split('.');
2063
2273
  payload = Object(_base64__WEBPACK_IMPORTED_MODULE_0__["stringToBuffer"])(jwt[0] + '.' + jwt[1]);
2064
2274
  b64Signature = Object(_base64__WEBPACK_IMPORTED_MODULE_0__["base64UrlDecode"])(jwt[2]);
2065
2275
  signature = Object(_base64__WEBPACK_IMPORTED_MODULE_0__["stringToBuffer"])(b64Signature);
2066
- _context.next = 14;
2276
+ _context.n = 2;
2067
2277
  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();
2278
+ case 2:
2279
+ return _context.a(2, _context.v);
2073
2280
  }
2074
2281
  }, _callee);
2075
2282
  }));
@@ -2079,7 +2286,7 @@ var verifyToken = /*#__PURE__*/function () {
2079
2286
  }();
2080
2287
 
2081
2288
  /***/ }),
2082
- /* 25 */
2289
+ /* 26 */
2083
2290
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2084
2291
 
2085
2292
  "use strict";
@@ -2138,13 +2345,13 @@ var AuthError = /*#__PURE__*/function (_Error2) {
2138
2345
  }(/*#__PURE__*/_wrapNativeSuper(Error));
2139
2346
 
2140
2347
  /***/ }),
2141
- /* 26 */
2348
+ /* 27 */
2142
2349
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2143
2350
 
2144
2351
  "use strict";
2145
2352
  __webpack_require__.r(__webpack_exports__);
2146
2353
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPkceMeta", function() { return createPkceMeta; });
2147
- /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
2354
+ /* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
2148
2355
  /*!
2149
2356
  * Copyright 2024-Present Animoca Brands Corporation Ltd.
2150
2357
  *
@@ -2172,7 +2379,7 @@ var createPkceMeta = function createPkceMeta(signinParams) {
2172
2379
  };
2173
2380
 
2174
2381
  /***/ }),
2175
- /* 27 */
2382
+ /* 28 */
2176
2383
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2177
2384
 
2178
2385
  "use strict";
@@ -2198,7 +2405,7 @@ var parseJwt = function parseJwt(token) {
2198
2405
  };
2199
2406
 
2200
2407
  /***/ }),
2201
- /* 28 */
2408
+ /* 29 */
2202
2409
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2203
2410
 
2204
2411
  "use strict";
@@ -2262,7 +2469,7 @@ var TransactionManager = /*#__PURE__*/function () {
2262
2469
  /* harmony default export */ __webpack_exports__["default"] = (TransactionManager);
2263
2470
 
2264
2471
  /***/ }),
2265
- /* 29 */
2472
+ /* 30 */
2266
2473
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2267
2474
 
2268
2475
  "use strict";
@@ -2270,8 +2477,8 @@ __webpack_require__.r(__webpack_exports__);
2270
2477
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseStorageManager", function() { return BaseStorageManager; });
2271
2478
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalStorageManager", function() { return LocalStorageManager; });
2272
2479
  /* 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);
2480
+ /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
2481
+ /* harmony import */ var _CookieStorageProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31);
2275
2482
  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
2483
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
2277
2484
  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 +2610,13 @@ var getStorageClass = function getStorageClass(opts) {
2403
2610
  };
2404
2611
 
2405
2612
  /***/ }),
2406
- /* 30 */
2613
+ /* 31 */
2407
2614
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2408
2615
 
2409
2616
  "use strict";
2410
2617
  __webpack_require__.r(__webpack_exports__);
2411
2618
  /* 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);
2619
+ /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(32);
2413
2620
  /* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(js_cookie__WEBPACK_IMPORTED_MODULE_0__);
2414
2621
  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
2622
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -2479,7 +2686,7 @@ var CookieStorageProvider = /*#__PURE__*/function () {
2479
2686
  }();
2480
2687
 
2481
2688
  /***/ }),
2482
- /* 31 */
2689
+ /* 32 */
2483
2690
  /***/ (function(module, exports, __webpack_require__) {
2484
2691
 
2485
2692
  /*! js-cookie v3.0.5 | MIT */
@@ -2627,12 +2834,12 @@ var CookieStorageProvider = /*#__PURE__*/function () {
2627
2834
 
2628
2835
 
2629
2836
  /***/ }),
2630
- /* 32 */
2837
+ /* 33 */
2631
2838
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2632
2839
 
2633
2840
  "use strict";
2634
2841
  __webpack_require__.r(__webpack_exports__);
2635
- /* harmony import */ var _buildAuthEndpointUrl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33);
2842
+ /* harmony import */ var _buildAuthEndpointUrl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
2636
2843
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildAuthEndpointUrl", function() { return _buildAuthEndpointUrl__WEBPACK_IMPORTED_MODULE_0__["buildAuthEndpointUrl"]; });
2637
2844
 
2638
2845
  /*!
@@ -2647,7 +2854,7 @@ __webpack_require__.r(__webpack_exports__);
2647
2854
 
2648
2855
 
2649
2856
  /***/ }),
2650
- /* 33 */
2857
+ /* 34 */
2651
2858
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2652
2859
 
2653
2860
  "use strict";
@@ -2696,12 +2903,12 @@ var buildAuthEndpointUrl = function buildAuthEndpointUrl(signInParams, loginEndP
2696
2903
  };
2697
2904
 
2698
2905
  /***/ }),
2699
- /* 34 */
2906
+ /* 35 */
2700
2907
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2701
2908
 
2702
2909
  "use strict";
2703
2910
  __webpack_require__.r(__webpack_exports__);
2704
- /* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
2911
+ /* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(36);
2705
2912
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TokenManager", function() { return _lib__WEBPACK_IMPORTED_MODULE_0__["TokenManager"]; });
2706
2913
 
2707
2914
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransactionManager", function() { return _lib__WEBPACK_IMPORTED_MODULE_0__["TransactionManager"]; });
@@ -2723,18 +2930,18 @@ __webpack_require__.r(__webpack_exports__);
2723
2930
 
2724
2931
 
2725
2932
  /***/ }),
2726
- /* 35 */
2933
+ /* 36 */
2727
2934
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2728
2935
 
2729
2936
  "use strict";
2730
2937
  __webpack_require__.r(__webpack_exports__);
2731
- /* harmony import */ var _TokenManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
2938
+ /* harmony import */ var _TokenManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
2732
2939
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TokenManager", function() { return _TokenManager__WEBPACK_IMPORTED_MODULE_0__["default"]; });
2733
2940
 
2734
- /* harmony import */ var _TransactionManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28);
2941
+ /* harmony import */ var _TransactionManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29);
2735
2942
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransactionManager", function() { return _TransactionManager__WEBPACK_IMPORTED_MODULE_1__["default"]; });
2736
2943
 
2737
- /* harmony import */ var _StorageManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29);
2944
+ /* harmony import */ var _StorageManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30);
2738
2945
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseStorageManager", function() { return _StorageManager__WEBPACK_IMPORTED_MODULE_2__["BaseStorageManager"]; });
2739
2946
 
2740
2947
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LocalStorageManager", function() { return _StorageManager__WEBPACK_IMPORTED_MODULE_2__["LocalStorageManager"]; });