@opencampus/ocid-connect-js 1.2.5 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -3
- package/dist/ocid-connect-js.js +783 -128
- package/dist/ocid-connect-js.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/react/LoginButton.d.ts +6 -0
- package/lib/react/LoginButton.js +1 -1
- package/lib/react/LoginCallBack.d.ts +7 -0
- package/lib/react/LoginCallBack.js +22 -9
- package/lib/react/OCConnect.d.ts +7 -0
- package/lib/react/OCConnect.js +7 -7
- package/lib/react/OCContext.d.ts +3 -0
- package/lib/react/OCSpinner.css +25 -0
- package/lib/react/OCSpinner.d.ts +6 -0
- package/lib/react/OCSpinner.js +39 -0
- package/lib/react/index.d.ts +4 -0
- package/lib/sdk/auth.d.ts +32 -0
- package/lib/sdk/auth.js +26 -19
- package/lib/sdk/crypto/base64.d.ts +5 -0
- package/lib/sdk/crypto/index.d.ts +3 -0
- package/lib/sdk/crypto/verifyToken.d.ts +1 -0
- package/lib/sdk/crypto/verifyToken.js +1 -1
- package/lib/sdk/crypto/webcrypto.d.ts +13 -0
- package/lib/sdk/endpoints/buildAuthEndpointUrl.d.ts +1 -0
- package/lib/sdk/endpoints/buildAuthEndpointUrl.js +8 -7
- package/lib/sdk/endpoints/index.d.ts +1 -0
- package/lib/sdk/index.d.ts +2 -0
- package/lib/sdk/lib/AuthInfoManager.d.ts +11 -0
- package/lib/sdk/lib/CookieStorageProvider.d.ts +8 -0
- package/lib/sdk/lib/CookieStorageProvider.js +16 -5
- package/lib/sdk/lib/StorageManager.d.ts +23 -0
- package/lib/sdk/lib/StorageManager.js +1 -1
- package/lib/sdk/lib/TokenManager.d.ts +16 -0
- package/lib/sdk/lib/TokenManager.js +2 -2
- package/lib/sdk/lib/TransactionManager.d.ts +9 -0
- package/lib/sdk/lib/index.d.ts +3 -0
- package/lib/sdk/lib/pkce.d.ts +11 -0
- package/lib/sdk/utils/createPkceMeta.d.ts +5 -0
- package/lib/sdk/utils/errors.d.ts +15 -0
- package/lib/sdk/utils/errors.js +2 -2
- package/lib/sdk/utils/index.d.ts +4 -0
- package/lib/sdk/utils/jwtParser.d.ts +1 -0
- package/lib/sdk/utils/prepareTokenParams.d.ts +9 -0
- package/lib/sdk/utils/prepareTokenParams.js +11 -10
- package/lib/sdk/utils/urlParser.d.ts +5 -0
- package/package.json +6 -2
package/dist/ocid-connect-js.js
CHANGED
|
@@ -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__(
|
|
114
|
+
/* harmony import */ var _sdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34);
|
|
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"]; });
|
|
@@ -152,7 +152,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
152
152
|
/* harmony import */ var _LoginCallBack__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
|
|
153
153
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LoginCallBack", function() { return _LoginCallBack__WEBPACK_IMPORTED_MODULE_1__["default"]; });
|
|
154
154
|
|
|
155
|
-
/* harmony import */ var _OCConnect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
155
|
+
/* harmony import */ var _OCConnect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
|
|
156
156
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OCConnect", function() { return _OCConnect__WEBPACK_IMPORTED_MODULE_2__["default"]; });
|
|
157
157
|
|
|
158
158
|
/* harmony import */ var _OCContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
|
@@ -261,7 +261,7 @@ function LoginButton(_ref) {
|
|
|
261
261
|
ocAuth = _useOCAuth.ocAuth;
|
|
262
262
|
var customTheme = themes[theme] || themes['ocBlue'];
|
|
263
263
|
var loginWithRedirect = /*#__PURE__*/function () {
|
|
264
|
-
var _ref2 = _asyncToGenerator(
|
|
264
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
265
265
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
266
266
|
while (1) switch (_context.prev = _context.next) {
|
|
267
267
|
case 0:
|
|
@@ -335,36 +335,38 @@ var useOCAuth = function useOCAuth() {
|
|
|
335
335
|
__webpack_require__.r(__webpack_exports__);
|
|
336
336
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
|
337
337
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
338
|
-
/* harmony import */ var
|
|
338
|
+
/* harmony import */ var _OCSpinner__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
|
|
339
|
+
/* harmony import */ var _OCContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
|
|
339
340
|
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); }
|
|
340
341
|
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; }
|
|
341
342
|
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); }
|
|
342
343
|
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); }); }; }
|
|
343
344
|
/*!
|
|
344
|
-
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
345
|
-
*
|
|
346
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
347
|
-
*
|
|
348
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
349
|
-
*
|
|
350
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
345
|
+
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
346
|
+
*
|
|
347
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
348
|
+
*
|
|
349
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
350
|
+
*
|
|
351
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
351
352
|
*/
|
|
352
353
|
|
|
353
354
|
|
|
355
|
+
|
|
354
356
|
var handledRedirect = false;
|
|
355
357
|
var LoginCallBack = function LoginCallBack(_ref) {
|
|
356
358
|
var successCallback = _ref.successCallback,
|
|
357
359
|
errorCallback = _ref.errorCallback,
|
|
358
360
|
customErrorComponent = _ref.customErrorComponent,
|
|
359
361
|
customLoadingComponent = _ref.customLoadingComponent;
|
|
360
|
-
var _useOCAuth = Object(
|
|
362
|
+
var _useOCAuth = Object(_OCContext__WEBPACK_IMPORTED_MODULE_2__["useOCAuth"])(),
|
|
361
363
|
isInitialized = _useOCAuth.isInitialized,
|
|
362
364
|
ocAuth = _useOCAuth.ocAuth,
|
|
363
365
|
authState = _useOCAuth.authState,
|
|
364
366
|
setAuthError = _useOCAuth.setAuthError;
|
|
365
367
|
Object(react__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () {
|
|
366
368
|
var handleLogin = /*#__PURE__*/function () {
|
|
367
|
-
var _ref2 = _asyncToGenerator(
|
|
369
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
368
370
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
369
371
|
while (1) switch (_context.prev = _context.next) {
|
|
370
372
|
case 0:
|
|
@@ -403,7 +405,18 @@ var LoginCallBack = function LoginCallBack(_ref) {
|
|
|
403
405
|
if (isInitialized && authState.error !== undefined && !errorCallback) {
|
|
404
406
|
return customErrorComponent ? customErrorComponent : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, "Error Logging in: ", authState.error.message);
|
|
405
407
|
} else {
|
|
406
|
-
return customLoadingComponent ? customLoadingComponent : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div",
|
|
408
|
+
return customLoadingComponent ? customLoadingComponent : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
|
|
409
|
+
style: {
|
|
410
|
+
height: '100vh',
|
|
411
|
+
width: '100%',
|
|
412
|
+
display: 'flex',
|
|
413
|
+
justifyContent: 'center',
|
|
414
|
+
alignItems: 'center'
|
|
415
|
+
}
|
|
416
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_OCSpinner__WEBPACK_IMPORTED_MODULE_1__["default"], {
|
|
417
|
+
height: 100,
|
|
418
|
+
width: 100
|
|
419
|
+
}));
|
|
407
420
|
}
|
|
408
421
|
};
|
|
409
422
|
/* harmony default export */ __webpack_exports__["default"] = (LoginCallBack);
|
|
@@ -412,12 +425,562 @@ var LoginCallBack = function LoginCallBack(_ref) {
|
|
|
412
425
|
/* 6 */
|
|
413
426
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
414
427
|
|
|
428
|
+
"use strict";
|
|
429
|
+
__webpack_require__.r(__webpack_exports__);
|
|
430
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
|
431
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
432
|
+
/* harmony import */ var _OCSpinner_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
|
|
433
|
+
/* harmony import */ var _OCSpinner_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_OCSpinner_css__WEBPACK_IMPORTED_MODULE_1__);
|
|
434
|
+
/*!
|
|
435
|
+
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
436
|
+
*
|
|
437
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
438
|
+
*
|
|
439
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
440
|
+
*
|
|
441
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
442
|
+
*/
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
var OCSpinner = function OCSpinner(_ref) {
|
|
447
|
+
var width = _ref.width,
|
|
448
|
+
height = _ref.height;
|
|
449
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
|
|
450
|
+
className: "oc-spinner-container",
|
|
451
|
+
style: {
|
|
452
|
+
width: width || 80,
|
|
453
|
+
height: height || 80
|
|
454
|
+
}
|
|
455
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
|
|
456
|
+
className: "oc-spinner"
|
|
457
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", {
|
|
458
|
+
className: "oc-logo-img",
|
|
459
|
+
alt: "logo",
|
|
460
|
+
src: "https://static.opencampus.xyz/assets/oc_logo.svg",
|
|
461
|
+
width: "70%",
|
|
462
|
+
height: "70%"
|
|
463
|
+
}));
|
|
464
|
+
};
|
|
465
|
+
/* harmony default export */ __webpack_exports__["default"] = (OCSpinner);
|
|
466
|
+
|
|
467
|
+
/***/ }),
|
|
468
|
+
/* 7 */
|
|
469
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
470
|
+
|
|
471
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
472
|
+
|
|
473
|
+
// load the styles
|
|
474
|
+
var content = __webpack_require__(8);
|
|
475
|
+
if(typeof content === 'string') content = [[module.i, content, '']];
|
|
476
|
+
// add the styles to the DOM
|
|
477
|
+
var update = __webpack_require__(10)(content, {});
|
|
478
|
+
if(content.locals) module.exports = content.locals;
|
|
479
|
+
// Hot Module Replacement
|
|
480
|
+
if(false) {}
|
|
481
|
+
|
|
482
|
+
/***/ }),
|
|
483
|
+
/* 8 */
|
|
484
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
485
|
+
|
|
486
|
+
exports = module.exports = __webpack_require__(9)(false);
|
|
487
|
+
// Module
|
|
488
|
+
exports.push([module.i, ".oc-spinner-container {\n position: relative;\n\n .oc-logo-img {\n position: absolute;\n top: 15%;\n left: 15%;\n }\n\n .oc-spinner {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background: radial-gradient(farthest-side,#141BEB 94%,#0000) top/9px 9px no-repeat,\n conic-gradient(#00EDBE 30%,#141BEB);\n -webkit-mask: radial-gradient(farthest-side,#0000 calc(100% - 9px),#000 0);\n animation: spinner-oc-animation 1s infinite linear;\n } \n}\n \n @keyframes spinner-oc-animation {\n 100% {\n transform: rotate(1turn);\n }\n }", ""]);
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
/***/ }),
|
|
493
|
+
/* 9 */
|
|
494
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
495
|
+
|
|
496
|
+
"use strict";
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
/*
|
|
500
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
501
|
+
Author Tobias Koppers @sokra
|
|
502
|
+
*/
|
|
503
|
+
// css base code, injected by the css-loader
|
|
504
|
+
module.exports = function (useSourceMap) {
|
|
505
|
+
var list = []; // return the list of modules as css string
|
|
506
|
+
|
|
507
|
+
list.toString = function toString() {
|
|
508
|
+
return this.map(function (item) {
|
|
509
|
+
var content = cssWithMappingToString(item, useSourceMap);
|
|
510
|
+
|
|
511
|
+
if (item[2]) {
|
|
512
|
+
return '@media ' + item[2] + '{' + content + '}';
|
|
513
|
+
} else {
|
|
514
|
+
return content;
|
|
515
|
+
}
|
|
516
|
+
}).join('');
|
|
517
|
+
}; // import a list of modules into the list
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
list.i = function (modules, mediaQuery) {
|
|
521
|
+
if (typeof modules === 'string') {
|
|
522
|
+
modules = [[null, modules, '']];
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
var alreadyImportedModules = {};
|
|
526
|
+
|
|
527
|
+
for (var i = 0; i < this.length; i++) {
|
|
528
|
+
var id = this[i][0];
|
|
529
|
+
|
|
530
|
+
if (id != null) {
|
|
531
|
+
alreadyImportedModules[id] = true;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
for (i = 0; i < modules.length; i++) {
|
|
536
|
+
var item = modules[i]; // skip already imported module
|
|
537
|
+
// this implementation is not 100% perfect for weird media query combinations
|
|
538
|
+
// when a module is imported multiple times with different media queries.
|
|
539
|
+
// I hope this will never occur (Hey this way we have smaller bundles)
|
|
540
|
+
|
|
541
|
+
if (item[0] == null || !alreadyImportedModules[item[0]]) {
|
|
542
|
+
if (mediaQuery && !item[2]) {
|
|
543
|
+
item[2] = mediaQuery;
|
|
544
|
+
} else if (mediaQuery) {
|
|
545
|
+
item[2] = '(' + item[2] + ') and (' + mediaQuery + ')';
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
list.push(item);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
return list;
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
function cssWithMappingToString(item, useSourceMap) {
|
|
557
|
+
var content = item[1] || '';
|
|
558
|
+
var cssMapping = item[3];
|
|
559
|
+
|
|
560
|
+
if (!cssMapping) {
|
|
561
|
+
return content;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
if (useSourceMap && typeof btoa === 'function') {
|
|
565
|
+
var sourceMapping = toComment(cssMapping);
|
|
566
|
+
var sourceURLs = cssMapping.sources.map(function (source) {
|
|
567
|
+
return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */';
|
|
568
|
+
});
|
|
569
|
+
return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
return [content].join('\n');
|
|
573
|
+
} // Adapted from convert-source-map (MIT)
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
function toComment(sourceMap) {
|
|
577
|
+
// eslint-disable-next-line no-undef
|
|
578
|
+
var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
|
|
579
|
+
var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
|
|
580
|
+
return '/*# ' + data + ' */';
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/***/ }),
|
|
584
|
+
/* 10 */
|
|
585
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
586
|
+
|
|
587
|
+
/*
|
|
588
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
589
|
+
Author Tobias Koppers @sokra
|
|
590
|
+
*/
|
|
591
|
+
var stylesInDom = {},
|
|
592
|
+
memoize = function(fn) {
|
|
593
|
+
var memo;
|
|
594
|
+
return function () {
|
|
595
|
+
if (typeof memo === "undefined") memo = fn.apply(this, arguments);
|
|
596
|
+
return memo;
|
|
597
|
+
};
|
|
598
|
+
},
|
|
599
|
+
isOldIE = memoize(function() {
|
|
600
|
+
// Test for IE <= 9 as proposed by Browserhacks
|
|
601
|
+
// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
|
|
602
|
+
// Tests for existence of standard globals is to allow style-loader
|
|
603
|
+
// to operate correctly into non-standard environments
|
|
604
|
+
// @see https://github.com/webpack-contrib/style-loader/issues/177
|
|
605
|
+
return window && document && document.all && !window.atob;
|
|
606
|
+
}),
|
|
607
|
+
getElement = (function(fn) {
|
|
608
|
+
var memo = {};
|
|
609
|
+
return function(selector) {
|
|
610
|
+
if (typeof memo[selector] === "undefined") {
|
|
611
|
+
memo[selector] = fn.call(this, selector);
|
|
612
|
+
}
|
|
613
|
+
return memo[selector]
|
|
614
|
+
};
|
|
615
|
+
})(function (styleTarget) {
|
|
616
|
+
return document.querySelector(styleTarget)
|
|
617
|
+
}),
|
|
618
|
+
singletonElement = null,
|
|
619
|
+
singletonCounter = 0,
|
|
620
|
+
styleElementsInsertedAtTop = [],
|
|
621
|
+
fixUrls = __webpack_require__(11);
|
|
622
|
+
|
|
623
|
+
module.exports = function(list, options) {
|
|
624
|
+
if(typeof DEBUG !== "undefined" && DEBUG) {
|
|
625
|
+
if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
options = options || {};
|
|
629
|
+
options.attrs = typeof options.attrs === "object" ? options.attrs : {};
|
|
630
|
+
|
|
631
|
+
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
|
|
632
|
+
// tags it will allow on a page
|
|
633
|
+
if (typeof options.singleton === "undefined") options.singleton = isOldIE();
|
|
634
|
+
|
|
635
|
+
// By default, add <style> tags to the <head> element
|
|
636
|
+
if (typeof options.insertInto === "undefined") options.insertInto = "head";
|
|
637
|
+
|
|
638
|
+
// By default, add <style> tags to the bottom of the target
|
|
639
|
+
if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
|
|
640
|
+
|
|
641
|
+
var styles = listToStyles(list);
|
|
642
|
+
addStylesToDom(styles, options);
|
|
643
|
+
|
|
644
|
+
return function update(newList) {
|
|
645
|
+
var mayRemove = [];
|
|
646
|
+
for(var i = 0; i < styles.length; i++) {
|
|
647
|
+
var item = styles[i];
|
|
648
|
+
var domStyle = stylesInDom[item.id];
|
|
649
|
+
domStyle.refs--;
|
|
650
|
+
mayRemove.push(domStyle);
|
|
651
|
+
}
|
|
652
|
+
if(newList) {
|
|
653
|
+
var newStyles = listToStyles(newList);
|
|
654
|
+
addStylesToDom(newStyles, options);
|
|
655
|
+
}
|
|
656
|
+
for(var i = 0; i < mayRemove.length; i++) {
|
|
657
|
+
var domStyle = mayRemove[i];
|
|
658
|
+
if(domStyle.refs === 0) {
|
|
659
|
+
for(var j = 0; j < domStyle.parts.length; j++)
|
|
660
|
+
domStyle.parts[j]();
|
|
661
|
+
delete stylesInDom[domStyle.id];
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
function addStylesToDom(styles, options) {
|
|
668
|
+
for(var i = 0; i < styles.length; i++) {
|
|
669
|
+
var item = styles[i];
|
|
670
|
+
var domStyle = stylesInDom[item.id];
|
|
671
|
+
if(domStyle) {
|
|
672
|
+
domStyle.refs++;
|
|
673
|
+
for(var j = 0; j < domStyle.parts.length; j++) {
|
|
674
|
+
domStyle.parts[j](item.parts[j]);
|
|
675
|
+
}
|
|
676
|
+
for(; j < item.parts.length; j++) {
|
|
677
|
+
domStyle.parts.push(addStyle(item.parts[j], options));
|
|
678
|
+
}
|
|
679
|
+
} else {
|
|
680
|
+
var parts = [];
|
|
681
|
+
for(var j = 0; j < item.parts.length; j++) {
|
|
682
|
+
parts.push(addStyle(item.parts[j], options));
|
|
683
|
+
}
|
|
684
|
+
stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
function listToStyles(list) {
|
|
690
|
+
var styles = [];
|
|
691
|
+
var newStyles = {};
|
|
692
|
+
for(var i = 0; i < list.length; i++) {
|
|
693
|
+
var item = list[i];
|
|
694
|
+
var id = item[0];
|
|
695
|
+
var css = item[1];
|
|
696
|
+
var media = item[2];
|
|
697
|
+
var sourceMap = item[3];
|
|
698
|
+
var part = {css: css, media: media, sourceMap: sourceMap};
|
|
699
|
+
if(!newStyles[id])
|
|
700
|
+
styles.push(newStyles[id] = {id: id, parts: [part]});
|
|
701
|
+
else
|
|
702
|
+
newStyles[id].parts.push(part);
|
|
703
|
+
}
|
|
704
|
+
return styles;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
function insertStyleElement(options, styleElement) {
|
|
708
|
+
var styleTarget = getElement(options.insertInto)
|
|
709
|
+
if (!styleTarget) {
|
|
710
|
+
throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
|
|
711
|
+
}
|
|
712
|
+
var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
|
|
713
|
+
if (options.insertAt === "top") {
|
|
714
|
+
if(!lastStyleElementInsertedAtTop) {
|
|
715
|
+
styleTarget.insertBefore(styleElement, styleTarget.firstChild);
|
|
716
|
+
} else if(lastStyleElementInsertedAtTop.nextSibling) {
|
|
717
|
+
styleTarget.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
|
|
718
|
+
} else {
|
|
719
|
+
styleTarget.appendChild(styleElement);
|
|
720
|
+
}
|
|
721
|
+
styleElementsInsertedAtTop.push(styleElement);
|
|
722
|
+
} else if (options.insertAt === "bottom") {
|
|
723
|
+
styleTarget.appendChild(styleElement);
|
|
724
|
+
} else {
|
|
725
|
+
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
function removeStyleElement(styleElement) {
|
|
730
|
+
styleElement.parentNode.removeChild(styleElement);
|
|
731
|
+
var idx = styleElementsInsertedAtTop.indexOf(styleElement);
|
|
732
|
+
if(idx >= 0) {
|
|
733
|
+
styleElementsInsertedAtTop.splice(idx, 1);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
function createStyleElement(options) {
|
|
738
|
+
var styleElement = document.createElement("style");
|
|
739
|
+
options.attrs.type = "text/css";
|
|
740
|
+
|
|
741
|
+
attachTagAttrs(styleElement, options.attrs);
|
|
742
|
+
insertStyleElement(options, styleElement);
|
|
743
|
+
return styleElement;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
function createLinkElement(options) {
|
|
747
|
+
var linkElement = document.createElement("link");
|
|
748
|
+
options.attrs.type = "text/css";
|
|
749
|
+
options.attrs.rel = "stylesheet";
|
|
750
|
+
|
|
751
|
+
attachTagAttrs(linkElement, options.attrs);
|
|
752
|
+
insertStyleElement(options, linkElement);
|
|
753
|
+
return linkElement;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
function attachTagAttrs(element, attrs) {
|
|
757
|
+
Object.keys(attrs).forEach(function (key) {
|
|
758
|
+
element.setAttribute(key, attrs[key]);
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
function addStyle(obj, options) {
|
|
763
|
+
var styleElement, update, remove;
|
|
764
|
+
|
|
765
|
+
if (options.singleton) {
|
|
766
|
+
var styleIndex = singletonCounter++;
|
|
767
|
+
styleElement = singletonElement || (singletonElement = createStyleElement(options));
|
|
768
|
+
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
|
|
769
|
+
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
|
|
770
|
+
} else if(obj.sourceMap &&
|
|
771
|
+
typeof URL === "function" &&
|
|
772
|
+
typeof URL.createObjectURL === "function" &&
|
|
773
|
+
typeof URL.revokeObjectURL === "function" &&
|
|
774
|
+
typeof Blob === "function" &&
|
|
775
|
+
typeof btoa === "function") {
|
|
776
|
+
styleElement = createLinkElement(options);
|
|
777
|
+
update = updateLink.bind(null, styleElement, options);
|
|
778
|
+
remove = function() {
|
|
779
|
+
removeStyleElement(styleElement);
|
|
780
|
+
if(styleElement.href)
|
|
781
|
+
URL.revokeObjectURL(styleElement.href);
|
|
782
|
+
};
|
|
783
|
+
} else {
|
|
784
|
+
styleElement = createStyleElement(options);
|
|
785
|
+
update = applyToTag.bind(null, styleElement);
|
|
786
|
+
remove = function() {
|
|
787
|
+
removeStyleElement(styleElement);
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
update(obj);
|
|
792
|
+
|
|
793
|
+
return function updateStyle(newObj) {
|
|
794
|
+
if(newObj) {
|
|
795
|
+
if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
|
|
796
|
+
return;
|
|
797
|
+
update(obj = newObj);
|
|
798
|
+
} else {
|
|
799
|
+
remove();
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
var replaceText = (function () {
|
|
805
|
+
var textStore = [];
|
|
806
|
+
|
|
807
|
+
return function (index, replacement) {
|
|
808
|
+
textStore[index] = replacement;
|
|
809
|
+
return textStore.filter(Boolean).join('\n');
|
|
810
|
+
};
|
|
811
|
+
})();
|
|
812
|
+
|
|
813
|
+
function applyToSingletonTag(styleElement, index, remove, obj) {
|
|
814
|
+
var css = remove ? "" : obj.css;
|
|
815
|
+
|
|
816
|
+
if (styleElement.styleSheet) {
|
|
817
|
+
styleElement.styleSheet.cssText = replaceText(index, css);
|
|
818
|
+
} else {
|
|
819
|
+
var cssNode = document.createTextNode(css);
|
|
820
|
+
var childNodes = styleElement.childNodes;
|
|
821
|
+
if (childNodes[index]) styleElement.removeChild(childNodes[index]);
|
|
822
|
+
if (childNodes.length) {
|
|
823
|
+
styleElement.insertBefore(cssNode, childNodes[index]);
|
|
824
|
+
} else {
|
|
825
|
+
styleElement.appendChild(cssNode);
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
function applyToTag(styleElement, obj) {
|
|
831
|
+
var css = obj.css;
|
|
832
|
+
var media = obj.media;
|
|
833
|
+
|
|
834
|
+
if(media) {
|
|
835
|
+
styleElement.setAttribute("media", media)
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
if(styleElement.styleSheet) {
|
|
839
|
+
styleElement.styleSheet.cssText = css;
|
|
840
|
+
} else {
|
|
841
|
+
while(styleElement.firstChild) {
|
|
842
|
+
styleElement.removeChild(styleElement.firstChild);
|
|
843
|
+
}
|
|
844
|
+
styleElement.appendChild(document.createTextNode(css));
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
function updateLink(linkElement, options, obj) {
|
|
849
|
+
var css = obj.css;
|
|
850
|
+
var sourceMap = obj.sourceMap;
|
|
851
|
+
|
|
852
|
+
/* If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
|
|
853
|
+
and there is no publicPath defined then lets turn convertToAbsoluteUrls
|
|
854
|
+
on by default. Otherwise default to the convertToAbsoluteUrls option
|
|
855
|
+
directly
|
|
856
|
+
*/
|
|
857
|
+
var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
|
|
858
|
+
|
|
859
|
+
if (options.convertToAbsoluteUrls || autoFixUrls){
|
|
860
|
+
css = fixUrls(css);
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
if(sourceMap) {
|
|
864
|
+
// http://stackoverflow.com/a/26603875
|
|
865
|
+
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
var blob = new Blob([css], { type: "text/css" });
|
|
869
|
+
|
|
870
|
+
var oldSrc = linkElement.href;
|
|
871
|
+
|
|
872
|
+
linkElement.href = URL.createObjectURL(blob);
|
|
873
|
+
|
|
874
|
+
if(oldSrc)
|
|
875
|
+
URL.revokeObjectURL(oldSrc);
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
/***/ }),
|
|
880
|
+
/* 11 */
|
|
881
|
+
/***/ (function(module, exports) {
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* When source maps are enabled, `style-loader` uses a link element with a data-uri to
|
|
886
|
+
* embed the css on the page. This breaks all relative urls because now they are relative to a
|
|
887
|
+
* bundle instead of the current page.
|
|
888
|
+
*
|
|
889
|
+
* One solution is to only use full urls, but that may be impossible.
|
|
890
|
+
*
|
|
891
|
+
* Instead, this function "fixes" the relative urls to be absolute according to the current page location.
|
|
892
|
+
*
|
|
893
|
+
* A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
|
|
894
|
+
*
|
|
895
|
+
*/
|
|
896
|
+
|
|
897
|
+
module.exports = function (css) {
|
|
898
|
+
// get current location
|
|
899
|
+
var location = typeof window !== "undefined" && window.location;
|
|
900
|
+
|
|
901
|
+
if (!location) {
|
|
902
|
+
throw new Error("fixUrls requires window.location");
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
// blank or null?
|
|
906
|
+
if (!css || typeof css !== "string") {
|
|
907
|
+
return css;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
var baseUrl = location.protocol + "//" + location.host;
|
|
911
|
+
var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
|
|
912
|
+
|
|
913
|
+
// convert each url(...)
|
|
914
|
+
/*
|
|
915
|
+
This regular expression is just a way to recursively match brackets within
|
|
916
|
+
a string.
|
|
917
|
+
|
|
918
|
+
/url\s*\( = Match on the word "url" with any whitespace after it and then a parens
|
|
919
|
+
( = Start a capturing group
|
|
920
|
+
(?: = Start a non-capturing group
|
|
921
|
+
[^)(] = Match anything that isn't a parentheses
|
|
922
|
+
| = OR
|
|
923
|
+
\( = Match a start parentheses
|
|
924
|
+
(?: = Start another non-capturing groups
|
|
925
|
+
[^)(]+ = Match anything that isn't a parentheses
|
|
926
|
+
| = OR
|
|
927
|
+
\( = Match a start parentheses
|
|
928
|
+
[^)(]* = Match anything that isn't a parentheses
|
|
929
|
+
\) = Match a end parentheses
|
|
930
|
+
) = End Group
|
|
931
|
+
*\) = Match anything and then a close parens
|
|
932
|
+
) = Close non-capturing group
|
|
933
|
+
* = Match anything
|
|
934
|
+
) = Close capturing group
|
|
935
|
+
\) = Match a close parens
|
|
936
|
+
|
|
937
|
+
/gi = Get all matches, not the first. Be case insensitive.
|
|
938
|
+
*/
|
|
939
|
+
var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
|
|
940
|
+
// strip quotes (if they exist)
|
|
941
|
+
var unquotedOrigUrl = origUrl
|
|
942
|
+
.trim()
|
|
943
|
+
.replace(/^"(.*)"$/, function(o, $1){ return $1; })
|
|
944
|
+
.replace(/^'(.*)'$/, function(o, $1){ return $1; });
|
|
945
|
+
|
|
946
|
+
// already a full url? no change
|
|
947
|
+
if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) {
|
|
948
|
+
return fullMatch;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// convert the url to a full url
|
|
952
|
+
var newUrl;
|
|
953
|
+
|
|
954
|
+
if (unquotedOrigUrl.indexOf("//") === 0) {
|
|
955
|
+
//TODO: should we add protocol?
|
|
956
|
+
newUrl = unquotedOrigUrl;
|
|
957
|
+
} else if (unquotedOrigUrl.indexOf("/") === 0) {
|
|
958
|
+
// path should be relative to the base url
|
|
959
|
+
newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
|
|
960
|
+
} else {
|
|
961
|
+
// path should be relative to current directory
|
|
962
|
+
newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
// send back the fixed url(...)
|
|
966
|
+
return "url(" + JSON.stringify(newUrl) + ")";
|
|
967
|
+
});
|
|
968
|
+
|
|
969
|
+
// send back the fixed css
|
|
970
|
+
return fixedCss;
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
/***/ }),
|
|
975
|
+
/* 12 */
|
|
976
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
977
|
+
|
|
415
978
|
"use strict";
|
|
416
979
|
__webpack_require__.r(__webpack_exports__);
|
|
417
980
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
|
418
981
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
419
982
|
/* harmony import */ var _OCContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
420
|
-
/* harmony import */ var _sdk_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
983
|
+
/* harmony import */ var _sdk_auth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
|
|
421
984
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
422
985
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
423
986
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -425,13 +988,13 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
425
988
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
426
989
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
427
990
|
/*!
|
|
428
|
-
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
429
|
-
*
|
|
430
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
431
|
-
*
|
|
432
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
433
|
-
*
|
|
434
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
991
|
+
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
992
|
+
*
|
|
993
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
994
|
+
*
|
|
995
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
996
|
+
*
|
|
997
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
435
998
|
*/
|
|
436
999
|
|
|
437
1000
|
|
|
@@ -501,7 +1064,7 @@ var OCConnect = function OCConnect(_ref) {
|
|
|
501
1064
|
/* harmony default export */ __webpack_exports__["default"] = (OCConnect);
|
|
502
1065
|
|
|
503
1066
|
/***/ }),
|
|
504
|
-
/*
|
|
1067
|
+
/* 13 */
|
|
505
1068
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
506
1069
|
|
|
507
1070
|
"use strict";
|
|
@@ -509,13 +1072,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
509
1072
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OCAuthCore", function() { return OCAuthCore; });
|
|
510
1073
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OCAuthLive", function() { return OCAuthLive; });
|
|
511
1074
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OCAuthSandbox", function() { return OCAuthSandbox; });
|
|
512
|
-
/* harmony import */ var _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
513
|
-
/* harmony import */ var _lib_TokenManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
514
|
-
/* harmony import */ var _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
515
|
-
/* harmony import */ var _lib_StorageManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
516
|
-
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
517
|
-
/* harmony import */ var _endpoints__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
518
|
-
/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
1075
|
+
/* harmony import */ var _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
|
|
1076
|
+
/* harmony import */ var _lib_TokenManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16);
|
|
1077
|
+
/* harmony import */ var _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28);
|
|
1078
|
+
/* harmony import */ var _lib_StorageManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(29);
|
|
1079
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17);
|
|
1080
|
+
/* harmony import */ var _endpoints__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(32);
|
|
1081
|
+
/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(25);
|
|
519
1082
|
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); }
|
|
520
1083
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
521
1084
|
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); }
|
|
@@ -534,13 +1097,13 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
534
1097
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
535
1098
|
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); }
|
|
536
1099
|
/*!
|
|
537
|
-
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
538
|
-
*
|
|
539
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
540
|
-
*
|
|
541
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
542
|
-
*
|
|
543
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1100
|
+
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
1101
|
+
*
|
|
1102
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
1103
|
+
*
|
|
1104
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
1105
|
+
*
|
|
1106
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
544
1107
|
*/
|
|
545
1108
|
|
|
546
1109
|
|
|
@@ -550,8 +1113,9 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
550
1113
|
|
|
551
1114
|
|
|
552
1115
|
var OCAuthCore = /*#__PURE__*/function () {
|
|
553
|
-
function OCAuthCore(loginEndpoint, redirectUri, transactionManager, tokenManager, referralCode, logoutEndPoint) {
|
|
1116
|
+
function OCAuthCore(clientId, loginEndpoint, redirectUri, transactionManager, tokenManager, referralCode, logoutEndPoint) {
|
|
554
1117
|
_classCallCheck(this, OCAuthCore);
|
|
1118
|
+
_defineProperty(this, "clientId", void 0);
|
|
555
1119
|
_defineProperty(this, "tokenManager", void 0);
|
|
556
1120
|
_defineProperty(this, "authInfoManager", void 0);
|
|
557
1121
|
_defineProperty(this, "transactionManager", void 0);
|
|
@@ -559,6 +1123,9 @@ var OCAuthCore = /*#__PURE__*/function () {
|
|
|
559
1123
|
_defineProperty(this, "loginEndPoint", void 0);
|
|
560
1124
|
_defineProperty(this, "logoutEndPoint", void 0);
|
|
561
1125
|
_defineProperty(this, "referralCode", void 0);
|
|
1126
|
+
if (!clientId) {
|
|
1127
|
+
throw new _utils_errors__WEBPACK_IMPORTED_MODULE_6__["InvalidParamsError"]('clientId is not defined');
|
|
1128
|
+
}
|
|
562
1129
|
this.transactionManager = transactionManager;
|
|
563
1130
|
this.tokenManager = tokenManager;
|
|
564
1131
|
this.authInfoManager = new _lib_AuthInfoManager__WEBPACK_IMPORTED_MODULE_0__["default"]();
|
|
@@ -566,6 +1133,7 @@ var OCAuthCore = /*#__PURE__*/function () {
|
|
|
566
1133
|
this.logoutEndPoint = logoutEndPoint;
|
|
567
1134
|
this.redirectUri = redirectUri;
|
|
568
1135
|
this.referralCode = referralCode;
|
|
1136
|
+
this.clientId = clientId;
|
|
569
1137
|
this.syncAuthInfo();
|
|
570
1138
|
}
|
|
571
1139
|
return _createClass(OCAuthCore, [{
|
|
@@ -577,7 +1145,7 @@ var OCAuthCore = /*#__PURE__*/function () {
|
|
|
577
1145
|
}, {
|
|
578
1146
|
key: "logout",
|
|
579
1147
|
value: function () {
|
|
580
|
-
var _logout = _asyncToGenerator(
|
|
1148
|
+
var _logout = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(logoutReturnTo) {
|
|
581
1149
|
var url;
|
|
582
1150
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
583
1151
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -602,7 +1170,7 @@ var OCAuthCore = /*#__PURE__*/function () {
|
|
|
602
1170
|
}, {
|
|
603
1171
|
key: "signInWithRedirect",
|
|
604
1172
|
value: function () {
|
|
605
|
-
var _signInWithRedirect = _asyncToGenerator(
|
|
1173
|
+
var _signInWithRedirect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
606
1174
|
var paramsClone, signinParams, meta, requestUrl;
|
|
607
1175
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
608
1176
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -611,16 +1179,17 @@ var OCAuthCore = /*#__PURE__*/function () {
|
|
|
611
1179
|
// available in other OAuth SDKs.
|
|
612
1180
|
paramsClone = Object.assign({}, params);
|
|
613
1181
|
paramsClone.redirectUri = this.redirectUri;
|
|
614
|
-
|
|
1182
|
+
paramsClone.clientId = this.clientId;
|
|
1183
|
+
_context2.next = 5;
|
|
615
1184
|
return Object(_utils__WEBPACK_IMPORTED_MODULE_4__["prepareTokenParams"])(paramsClone);
|
|
616
|
-
case
|
|
1185
|
+
case 5:
|
|
617
1186
|
signinParams = _context2.sent;
|
|
618
1187
|
meta = Object(_utils__WEBPACK_IMPORTED_MODULE_4__["createPkceMeta"])(signinParams);
|
|
619
1188
|
this.transactionManager.save(meta);
|
|
620
1189
|
signinParams.referralCode = this.referralCode;
|
|
621
1190
|
requestUrl = Object(_endpoints__WEBPACK_IMPORTED_MODULE_5__["buildAuthEndpointUrl"])(signinParams, this.loginEndPoint);
|
|
622
1191
|
window.location.assign(requestUrl);
|
|
623
|
-
case
|
|
1192
|
+
case 11:
|
|
624
1193
|
case "end":
|
|
625
1194
|
return _context2.stop();
|
|
626
1195
|
}
|
|
@@ -634,7 +1203,7 @@ var OCAuthCore = /*#__PURE__*/function () {
|
|
|
634
1203
|
}, {
|
|
635
1204
|
key: "handleLoginRedirect",
|
|
636
1205
|
value: function () {
|
|
637
|
-
var _handleLoginRedirect = _asyncToGenerator(
|
|
1206
|
+
var _handleLoginRedirect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
638
1207
|
var urlParams, meta, codeVerifier;
|
|
639
1208
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
640
1209
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -757,7 +1326,8 @@ var OCAuthLive = /*#__PURE__*/function (_OCAuthCore2) {
|
|
|
757
1326
|
overrideLogoutEndpoint = opts.logoutEndPoint,
|
|
758
1327
|
overridePublicKey = opts.publicKey,
|
|
759
1328
|
redirectUri = opts.redirectUri,
|
|
760
|
-
referralCode = opts.referralCode
|
|
1329
|
+
referralCode = opts.referralCode,
|
|
1330
|
+
clientId = opts.clientId;
|
|
761
1331
|
var tokenEndpoint = overrideTokenEndpoint || 'https://api.login.opencampus.xyz/auth/token';
|
|
762
1332
|
var loginEndpoint = overrideLoginEndpoint || 'https://api.login.opencampus.xyz/auth/login';
|
|
763
1333
|
var logoutEndpoint = overrideLogoutEndpoint || 'https://api.login.opencampus.xyz/auth/logout';
|
|
@@ -765,7 +1335,7 @@ var OCAuthLive = /*#__PURE__*/function (_OCAuthCore2) {
|
|
|
765
1335
|
var storageClass = Object(_lib_StorageManager__WEBPACK_IMPORTED_MODULE_3__["getStorageClass"])(opts);
|
|
766
1336
|
var pkceTransactionManager = new _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_2__["default"](storageClass);
|
|
767
1337
|
var tokenManager = new _lib_TokenManager__WEBPACK_IMPORTED_MODULE_1__["default"](storageClass, tokenEndpoint, publicKey);
|
|
768
|
-
return _callSuper(this, OCAuthLive, [loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint
|
|
1338
|
+
return _callSuper(this, OCAuthLive, [clientId, loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint]);
|
|
769
1339
|
}
|
|
770
1340
|
_inherits(OCAuthLive, _OCAuthCore2);
|
|
771
1341
|
return _createClass(OCAuthLive);
|
|
@@ -779,8 +1349,8 @@ var OCAuthSandbox = /*#__PURE__*/function (_OCAuthCore3) {
|
|
|
779
1349
|
overrideLogoutEndpoint = opts.logoutEndPoint,
|
|
780
1350
|
overridePublicKey = opts.publicKey,
|
|
781
1351
|
redirectUri = opts.redirectUri,
|
|
782
|
-
referralCode = opts.referralCode
|
|
783
|
-
|
|
1352
|
+
referralCode = opts.referralCode;
|
|
1353
|
+
var clientId = opts.clientId || 'sandbox';
|
|
784
1354
|
var tokenEndpoint = overrideTokenEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/token';
|
|
785
1355
|
var loginEndpoint = overrideLoginEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/login';
|
|
786
1356
|
var logoutEndpoint = overrideLogoutEndpoint || 'https://api.login.sandbox.opencampus.xyz/auth/logout';
|
|
@@ -788,19 +1358,20 @@ var OCAuthSandbox = /*#__PURE__*/function (_OCAuthCore3) {
|
|
|
788
1358
|
var storageClass = Object(_lib_StorageManager__WEBPACK_IMPORTED_MODULE_3__["getStorageClass"])(opts);
|
|
789
1359
|
var pkceTransactionManager = new _lib_TransactionManager__WEBPACK_IMPORTED_MODULE_2__["default"](storageClass);
|
|
790
1360
|
var tokenManager = new _lib_TokenManager__WEBPACK_IMPORTED_MODULE_1__["default"](storageClass, tokenEndpoint, publicKey);
|
|
791
|
-
return _callSuper(this, OCAuthSandbox, [loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint
|
|
1361
|
+
return _callSuper(this, OCAuthSandbox, [clientId, loginEndpoint, redirectUri, pkceTransactionManager, tokenManager, referralCode, logoutEndpoint]);
|
|
792
1362
|
}
|
|
793
1363
|
_inherits(OCAuthSandbox, _OCAuthCore3);
|
|
794
1364
|
return _createClass(OCAuthSandbox);
|
|
795
1365
|
}(OCAuthCore);
|
|
796
1366
|
|
|
797
1367
|
/***/ }),
|
|
798
|
-
/*
|
|
1368
|
+
/* 14 */
|
|
799
1369
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
800
1370
|
|
|
801
1371
|
"use strict";
|
|
802
1372
|
__webpack_require__.r(__webpack_exports__);
|
|
803
|
-
|
|
1373
|
+
/* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
|
|
1374
|
+
/* harmony import */ var tiny_emitter__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tiny_emitter__WEBPACK_IMPORTED_MODULE_0__);
|
|
804
1375
|
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); }
|
|
805
1376
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
806
1377
|
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); } }
|
|
@@ -826,7 +1397,7 @@ var AuthInfoManager = /*#__PURE__*/function () {
|
|
|
826
1397
|
_defineProperty(this, "_emmitter", void 0);
|
|
827
1398
|
_defineProperty(this, "_authState", void 0);
|
|
828
1399
|
this._authState = null;
|
|
829
|
-
this._emitter = new
|
|
1400
|
+
this._emitter = new tiny_emitter__WEBPACK_IMPORTED_MODULE_0___default.a();
|
|
830
1401
|
}
|
|
831
1402
|
return _createClass(AuthInfoManager, [{
|
|
832
1403
|
key: "setAuthState",
|
|
@@ -868,14 +1439,87 @@ var AuthInfoManager = /*#__PURE__*/function () {
|
|
|
868
1439
|
/* harmony default export */ __webpack_exports__["default"] = (AuthInfoManager);
|
|
869
1440
|
|
|
870
1441
|
/***/ }),
|
|
871
|
-
/*
|
|
1442
|
+
/* 15 */
|
|
1443
|
+
/***/ (function(module, exports) {
|
|
1444
|
+
|
|
1445
|
+
function E () {
|
|
1446
|
+
// Keep this empty so it's easier to inherit from
|
|
1447
|
+
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
E.prototype = {
|
|
1451
|
+
on: function (name, callback, ctx) {
|
|
1452
|
+
var e = this.e || (this.e = {});
|
|
1453
|
+
|
|
1454
|
+
(e[name] || (e[name] = [])).push({
|
|
1455
|
+
fn: callback,
|
|
1456
|
+
ctx: ctx
|
|
1457
|
+
});
|
|
1458
|
+
|
|
1459
|
+
return this;
|
|
1460
|
+
},
|
|
1461
|
+
|
|
1462
|
+
once: function (name, callback, ctx) {
|
|
1463
|
+
var self = this;
|
|
1464
|
+
function listener () {
|
|
1465
|
+
self.off(name, listener);
|
|
1466
|
+
callback.apply(ctx, arguments);
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1469
|
+
listener._ = callback
|
|
1470
|
+
return this.on(name, listener, ctx);
|
|
1471
|
+
},
|
|
1472
|
+
|
|
1473
|
+
emit: function (name) {
|
|
1474
|
+
var data = [].slice.call(arguments, 1);
|
|
1475
|
+
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
|
|
1476
|
+
var i = 0;
|
|
1477
|
+
var len = evtArr.length;
|
|
1478
|
+
|
|
1479
|
+
for (i; i < len; i++) {
|
|
1480
|
+
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
return this;
|
|
1484
|
+
},
|
|
1485
|
+
|
|
1486
|
+
off: function (name, callback) {
|
|
1487
|
+
var e = this.e || (this.e = {});
|
|
1488
|
+
var evts = e[name];
|
|
1489
|
+
var liveEvents = [];
|
|
1490
|
+
|
|
1491
|
+
if (evts && callback) {
|
|
1492
|
+
for (var i = 0, len = evts.length; i < len; i++) {
|
|
1493
|
+
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
|
|
1494
|
+
liveEvents.push(evts[i]);
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
// Remove event from queue to prevent memory leak
|
|
1499
|
+
// Suggested by https://github.com/lazd
|
|
1500
|
+
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
|
|
1501
|
+
|
|
1502
|
+
(liveEvents.length)
|
|
1503
|
+
? e[name] = liveEvents
|
|
1504
|
+
: delete e[name];
|
|
1505
|
+
|
|
1506
|
+
return this;
|
|
1507
|
+
}
|
|
1508
|
+
};
|
|
1509
|
+
|
|
1510
|
+
module.exports = E;
|
|
1511
|
+
module.exports.TinyEmitter = E;
|
|
1512
|
+
|
|
1513
|
+
|
|
1514
|
+
/***/ }),
|
|
1515
|
+
/* 16 */
|
|
872
1516
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
873
1517
|
|
|
874
1518
|
"use strict";
|
|
875
1519
|
__webpack_require__.r(__webpack_exports__);
|
|
876
|
-
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
877
|
-
/* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
878
|
-
/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
1520
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17);
|
|
1521
|
+
/* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21);
|
|
1522
|
+
/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25);
|
|
879
1523
|
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); }
|
|
880
1524
|
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; }
|
|
881
1525
|
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); }
|
|
@@ -919,7 +1563,7 @@ var TokenManager = /*#__PURE__*/function () {
|
|
|
919
1563
|
}, {
|
|
920
1564
|
key: "exchangeTokenFromCode",
|
|
921
1565
|
value: function () {
|
|
922
|
-
var _exchangeTokenFromCode = _asyncToGenerator(
|
|
1566
|
+
var _exchangeTokenFromCode = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(accessCode, codeVerifier) {
|
|
923
1567
|
var state,
|
|
924
1568
|
body,
|
|
925
1569
|
response,
|
|
@@ -1026,7 +1670,7 @@ var TokenManager = /*#__PURE__*/function () {
|
|
|
1026
1670
|
}, {
|
|
1027
1671
|
key: "getPublicKey",
|
|
1028
1672
|
value: function () {
|
|
1029
|
-
var _getPublicKey = _asyncToGenerator(
|
|
1673
|
+
var _getPublicKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
1030
1674
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1031
1675
|
while (1) switch (_context2.prev = _context2.next) {
|
|
1032
1676
|
case 0:
|
|
@@ -1057,21 +1701,21 @@ var TokenManager = /*#__PURE__*/function () {
|
|
|
1057
1701
|
/* harmony default export */ __webpack_exports__["default"] = (TokenManager);
|
|
1058
1702
|
|
|
1059
1703
|
/***/ }),
|
|
1060
|
-
/*
|
|
1704
|
+
/* 17 */
|
|
1061
1705
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1062
1706
|
|
|
1063
1707
|
"use strict";
|
|
1064
1708
|
__webpack_require__.r(__webpack_exports__);
|
|
1065
|
-
/* harmony import */ var _urlParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
1709
|
+
/* harmony import */ var _urlParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18);
|
|
1066
1710
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseUrl", function() { return _urlParser__WEBPACK_IMPORTED_MODULE_0__["parseUrl"]; });
|
|
1067
1711
|
|
|
1068
|
-
/* harmony import */ var _prepareTokenParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
1712
|
+
/* harmony import */ var _prepareTokenParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);
|
|
1069
1713
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "prepareTokenParams", function() { return _prepareTokenParams__WEBPACK_IMPORTED_MODULE_1__["prepareTokenParams"]; });
|
|
1070
1714
|
|
|
1071
|
-
/* harmony import */ var _createPkceMeta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
1715
|
+
/* harmony import */ var _createPkceMeta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26);
|
|
1072
1716
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createPkceMeta", function() { return _createPkceMeta__WEBPACK_IMPORTED_MODULE_2__["createPkceMeta"]; });
|
|
1073
1717
|
|
|
1074
|
-
/* harmony import */ var _jwtParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
1718
|
+
/* harmony import */ var _jwtParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27);
|
|
1075
1719
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "parseJwt", function() { return _jwtParser__WEBPACK_IMPORTED_MODULE_3__["parseJwt"]; });
|
|
1076
1720
|
|
|
1077
1721
|
/*!
|
|
@@ -1089,7 +1733,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1089
1733
|
|
|
1090
1734
|
|
|
1091
1735
|
/***/ }),
|
|
1092
|
-
/*
|
|
1736
|
+
/* 18 */
|
|
1093
1737
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1094
1738
|
|
|
1095
1739
|
"use strict";
|
|
@@ -1115,32 +1759,32 @@ var parseUrl = function parseUrl() {
|
|
|
1115
1759
|
};
|
|
1116
1760
|
|
|
1117
1761
|
/***/ }),
|
|
1118
|
-
/*
|
|
1762
|
+
/* 19 */
|
|
1119
1763
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1120
1764
|
|
|
1121
1765
|
"use strict";
|
|
1122
1766
|
__webpack_require__.r(__webpack_exports__);
|
|
1123
1767
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prepareTokenParams", function() { return prepareTokenParams; });
|
|
1124
|
-
/* harmony import */ var _lib_pkce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
1125
|
-
/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
1768
|
+
/* harmony import */ var _lib_pkce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
|
|
1769
|
+
/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
|
|
1126
1770
|
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); }
|
|
1127
1771
|
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; }
|
|
1128
1772
|
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); }
|
|
1129
1773
|
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); }); }; }
|
|
1130
1774
|
/*!
|
|
1131
|
-
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
1132
|
-
*
|
|
1133
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
1134
|
-
*
|
|
1135
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
1136
|
-
*
|
|
1137
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1775
|
+
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
1776
|
+
*
|
|
1777
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
1778
|
+
*
|
|
1779
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
1780
|
+
*
|
|
1781
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1138
1782
|
*/
|
|
1139
1783
|
|
|
1140
1784
|
|
|
1141
1785
|
var prepareTokenParams = /*#__PURE__*/function () {
|
|
1142
|
-
var _ref = _asyncToGenerator(
|
|
1143
|
-
var redirectUri, state, codeVerifier, codeChallenge, tokenParams;
|
|
1786
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
1787
|
+
var clientId, redirectUri, state, codeVerifier, codeChallenge, tokenParams;
|
|
1144
1788
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1145
1789
|
while (1) switch (_context.prev = _context.next) {
|
|
1146
1790
|
case 0:
|
|
@@ -1148,7 +1792,7 @@ var prepareTokenParams = /*#__PURE__*/function () {
|
|
|
1148
1792
|
// mandatory redirect_uri, for now, we only allow user to set redirect_uri and state
|
|
1149
1793
|
// again this is not a full on OIDC/OAuth flow allowing user to set all the options
|
|
1150
1794
|
// we prepare all the rest
|
|
1151
|
-
redirectUri = params.redirectUri, state = params.state;
|
|
1795
|
+
clientId = params.clientId, redirectUri = params.redirectUri, state = params.state;
|
|
1152
1796
|
if (redirectUri) {
|
|
1153
1797
|
_context.next = 3;
|
|
1154
1798
|
break;
|
|
@@ -1163,6 +1807,7 @@ var prepareTokenParams = /*#__PURE__*/function () {
|
|
|
1163
1807
|
codeChallenge = _context.sent;
|
|
1164
1808
|
// pack up the full set of token params needed
|
|
1165
1809
|
tokenParams = {
|
|
1810
|
+
clientId: clientId,
|
|
1166
1811
|
redirectUri: redirectUri,
|
|
1167
1812
|
codeVerifier: codeVerifier,
|
|
1168
1813
|
codeChallenge: codeChallenge,
|
|
@@ -1186,7 +1831,7 @@ var prepareTokenParams = /*#__PURE__*/function () {
|
|
|
1186
1831
|
}();
|
|
1187
1832
|
|
|
1188
1833
|
/***/ }),
|
|
1189
|
-
/*
|
|
1834
|
+
/* 20 */
|
|
1190
1835
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1191
1836
|
|
|
1192
1837
|
"use strict";
|
|
@@ -1194,7 +1839,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1194
1839
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MIN_VERIFIER_LENGTH", function() { return MIN_VERIFIER_LENGTH; });
|
|
1195
1840
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAX_VERIFIER_LENGTH", function() { return MAX_VERIFIER_LENGTH; });
|
|
1196
1841
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_CODE_CHALLENGE_METHOD", function() { return DEFAULT_CODE_CHALLENGE_METHOD; });
|
|
1197
|
-
/* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
1842
|
+
/* harmony import */ var _crypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21);
|
|
1198
1843
|
/*!
|
|
1199
1844
|
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
1200
1845
|
*
|
|
@@ -1242,19 +1887,19 @@ function computeChallenge(str) {
|
|
|
1242
1887
|
});
|
|
1243
1888
|
|
|
1244
1889
|
/***/ }),
|
|
1245
|
-
/*
|
|
1890
|
+
/* 21 */
|
|
1246
1891
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1247
1892
|
|
|
1248
1893
|
"use strict";
|
|
1249
1894
|
__webpack_require__.r(__webpack_exports__);
|
|
1250
|
-
/* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
1895
|
+
/* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
|
|
1251
1896
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "atob", function() { return _webcrypto__WEBPACK_IMPORTED_MODULE_0__["atob"]; });
|
|
1252
1897
|
|
|
1253
1898
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "btoa", function() { return _webcrypto__WEBPACK_IMPORTED_MODULE_0__["btoa"]; });
|
|
1254
1899
|
|
|
1255
1900
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "webcrypto", function() { return _webcrypto__WEBPACK_IMPORTED_MODULE_0__["webcrypto"]; });
|
|
1256
1901
|
|
|
1257
|
-
/* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
1902
|
+
/* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(23);
|
|
1258
1903
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "base64ToBase64Url", function() { return _base64__WEBPACK_IMPORTED_MODULE_1__["base64ToBase64Url"]; });
|
|
1259
1904
|
|
|
1260
1905
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "base64UrlToBase64", function() { return _base64__WEBPACK_IMPORTED_MODULE_1__["base64UrlToBase64"]; });
|
|
@@ -1265,7 +1910,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1265
1910
|
|
|
1266
1911
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "base64UrlDecode", function() { return _base64__WEBPACK_IMPORTED_MODULE_1__["base64UrlDecode"]; });
|
|
1267
1912
|
|
|
1268
|
-
/* harmony import */ var _verifyToken__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
1913
|
+
/* harmony import */ var _verifyToken__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(24);
|
|
1269
1914
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "verifyToken", function() { return _verifyToken__WEBPACK_IMPORTED_MODULE_2__["verifyToken"]; });
|
|
1270
1915
|
|
|
1271
1916
|
/*!
|
|
@@ -1282,7 +1927,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1282
1927
|
|
|
1283
1928
|
|
|
1284
1929
|
/***/ }),
|
|
1285
|
-
/*
|
|
1930
|
+
/* 22 */
|
|
1286
1931
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1287
1932
|
|
|
1288
1933
|
"use strict";
|
|
@@ -1312,7 +1957,7 @@ var c = typeof crypto === 'undefined' ? null : crypto;
|
|
|
1312
1957
|
|
|
1313
1958
|
|
|
1314
1959
|
/***/ }),
|
|
1315
|
-
/*
|
|
1960
|
+
/* 23 */
|
|
1316
1961
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1317
1962
|
|
|
1318
1963
|
"use strict";
|
|
@@ -1322,7 +1967,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1322
1967
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringToBase64Url", function() { return stringToBase64Url; });
|
|
1323
1968
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stringToBuffer", function() { return stringToBuffer; });
|
|
1324
1969
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "base64UrlDecode", function() { return base64UrlDecode; });
|
|
1325
|
-
/* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
1970
|
+
/* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
|
|
1326
1971
|
/*!
|
|
1327
1972
|
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
1328
1973
|
*
|
|
@@ -1361,14 +2006,14 @@ function base64UrlDecode(str) {
|
|
|
1361
2006
|
}
|
|
1362
2007
|
|
|
1363
2008
|
/***/ }),
|
|
1364
|
-
/*
|
|
2009
|
+
/* 24 */
|
|
1365
2010
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1366
2011
|
|
|
1367
2012
|
"use strict";
|
|
1368
2013
|
__webpack_require__.r(__webpack_exports__);
|
|
1369
2014
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "verifyToken", function() { return verifyToken; });
|
|
1370
|
-
/* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
1371
|
-
/* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
2015
|
+
/* harmony import */ var _base64__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23);
|
|
2016
|
+
/* harmony import */ var _webcrypto__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22);
|
|
1372
2017
|
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); }
|
|
1373
2018
|
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; }
|
|
1374
2019
|
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); }
|
|
@@ -1390,7 +2035,7 @@ var prepareKey = function prepareKey(key) {
|
|
|
1390
2035
|
return Object(_base64__WEBPACK_IMPORTED_MODULE_0__["stringToBuffer"])(binaryDerString);
|
|
1391
2036
|
};
|
|
1392
2037
|
var verifyToken = /*#__PURE__*/function () {
|
|
1393
|
-
var _ref = _asyncToGenerator(
|
|
2038
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(idToken, key) {
|
|
1394
2039
|
var format, algo, extractable, usages, preparedKey, cryptoKey, jwt, payload, b64Signature, signature;
|
|
1395
2040
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
1396
2041
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -1430,7 +2075,7 @@ var verifyToken = /*#__PURE__*/function () {
|
|
|
1430
2075
|
}();
|
|
1431
2076
|
|
|
1432
2077
|
/***/ }),
|
|
1433
|
-
/*
|
|
2078
|
+
/* 25 */
|
|
1434
2079
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1435
2080
|
|
|
1436
2081
|
"use strict";
|
|
@@ -1470,7 +2115,7 @@ var InternalError = /*#__PURE__*/function (_Error) {
|
|
|
1470
2115
|
}
|
|
1471
2116
|
_inherits(InternalError, _Error);
|
|
1472
2117
|
return _createClass(InternalError);
|
|
1473
|
-
}(
|
|
2118
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
1474
2119
|
var InvalidParamsError = /*#__PURE__*/function (_InternalError) {
|
|
1475
2120
|
function InvalidParamsError() {
|
|
1476
2121
|
_classCallCheck(this, InvalidParamsError);
|
|
@@ -1486,16 +2131,16 @@ var AuthError = /*#__PURE__*/function (_Error2) {
|
|
|
1486
2131
|
}
|
|
1487
2132
|
_inherits(AuthError, _Error2);
|
|
1488
2133
|
return _createClass(AuthError);
|
|
1489
|
-
}(
|
|
2134
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
1490
2135
|
|
|
1491
2136
|
/***/ }),
|
|
1492
|
-
/*
|
|
2137
|
+
/* 26 */
|
|
1493
2138
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1494
2139
|
|
|
1495
2140
|
"use strict";
|
|
1496
2141
|
__webpack_require__.r(__webpack_exports__);
|
|
1497
2142
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createPkceMeta", function() { return createPkceMeta; });
|
|
1498
|
-
/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
2143
|
+
/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
|
|
1499
2144
|
/*!
|
|
1500
2145
|
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
1501
2146
|
*
|
|
@@ -1523,7 +2168,7 @@ var createPkceMeta = function createPkceMeta(signinParams) {
|
|
|
1523
2168
|
};
|
|
1524
2169
|
|
|
1525
2170
|
/***/ }),
|
|
1526
|
-
/*
|
|
2171
|
+
/* 27 */
|
|
1527
2172
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1528
2173
|
|
|
1529
2174
|
"use strict";
|
|
@@ -1549,7 +2194,7 @@ var parseJwt = function parseJwt(token) {
|
|
|
1549
2194
|
};
|
|
1550
2195
|
|
|
1551
2196
|
/***/ }),
|
|
1552
|
-
/*
|
|
2197
|
+
/* 28 */
|
|
1553
2198
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1554
2199
|
|
|
1555
2200
|
"use strict";
|
|
@@ -1613,7 +2258,7 @@ var TransactionManager = /*#__PURE__*/function () {
|
|
|
1613
2258
|
/* harmony default export */ __webpack_exports__["default"] = (TransactionManager);
|
|
1614
2259
|
|
|
1615
2260
|
/***/ }),
|
|
1616
|
-
/*
|
|
2261
|
+
/* 29 */
|
|
1617
2262
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1618
2263
|
|
|
1619
2264
|
"use strict";
|
|
@@ -1621,8 +2266,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1621
2266
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BaseStorageManager", function() { return BaseStorageManager; });
|
|
1622
2267
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalStorageManager", function() { return LocalStorageManager; });
|
|
1623
2268
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getStorageClass", function() { return getStorageClass; });
|
|
1624
|
-
/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
1625
|
-
/* harmony import */ var _CookieStorageProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
2269
|
+
/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25);
|
|
2270
|
+
/* harmony import */ var _CookieStorageProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(30);
|
|
1626
2271
|
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); }
|
|
1627
2272
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
1628
2273
|
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); }
|
|
@@ -1743,7 +2388,7 @@ var getStorageClass = function getStorageClass(opts) {
|
|
|
1743
2388
|
return /*#__PURE__*/function (_BaseStorageManager3) {
|
|
1744
2389
|
function CookieStorageManager(storageName) {
|
|
1745
2390
|
_classCallCheck(this, CookieStorageManager);
|
|
1746
|
-
return _callSuper(this, CookieStorageManager, [storageName, new _CookieStorageProvider__WEBPACK_IMPORTED_MODULE_1__["CookieStorageProvider"](opts
|
|
2391
|
+
return _callSuper(this, CookieStorageManager, [storageName, new _CookieStorageProvider__WEBPACK_IMPORTED_MODULE_1__["CookieStorageProvider"](opts)]);
|
|
1747
2392
|
}
|
|
1748
2393
|
_inherits(CookieStorageManager, _BaseStorageManager3);
|
|
1749
2394
|
return _createClass(CookieStorageManager);
|
|
@@ -1754,13 +2399,13 @@ var getStorageClass = function getStorageClass(opts) {
|
|
|
1754
2399
|
};
|
|
1755
2400
|
|
|
1756
2401
|
/***/ }),
|
|
1757
|
-
/*
|
|
2402
|
+
/* 30 */
|
|
1758
2403
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1759
2404
|
|
|
1760
2405
|
"use strict";
|
|
1761
2406
|
__webpack_require__.r(__webpack_exports__);
|
|
1762
2407
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "CookieStorageProvider", function() { return CookieStorageProvider; });
|
|
1763
|
-
/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
2408
|
+
/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31);
|
|
1764
2409
|
/* harmony import */ var js_cookie__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(js_cookie__WEBPACK_IMPORTED_MODULE_0__);
|
|
1765
2410
|
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); }
|
|
1766
2411
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
@@ -1779,14 +2424,14 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
1779
2424
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1780
2425
|
*/
|
|
1781
2426
|
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
// Wrapper to support Cookie based storage
|
|
1785
2427
|
var CookieStorageProvider = /*#__PURE__*/function () {
|
|
1786
|
-
function CookieStorageProvider(
|
|
2428
|
+
function CookieStorageProvider() {
|
|
2429
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1787
2430
|
_classCallCheck(this, CookieStorageProvider);
|
|
1788
2431
|
_defineProperty(this, "domain", void 0);
|
|
1789
|
-
this
|
|
2432
|
+
_defineProperty(this, "sameSite", void 0);
|
|
2433
|
+
this.domain = options.domain;
|
|
2434
|
+
this.sameSite = options.sameSite;
|
|
1790
2435
|
}
|
|
1791
2436
|
return _createClass(CookieStorageProvider, [{
|
|
1792
2437
|
key: "getItem",
|
|
@@ -1796,11 +2441,20 @@ var CookieStorageProvider = /*#__PURE__*/function () {
|
|
|
1796
2441
|
}, {
|
|
1797
2442
|
key: "setItem",
|
|
1798
2443
|
value: function setItem(key, value) {
|
|
1799
|
-
|
|
2444
|
+
var cookieOptions = {
|
|
1800
2445
|
expires: 365,
|
|
1801
2446
|
path: '/',
|
|
1802
2447
|
domain: this.domain
|
|
1803
|
-
}
|
|
2448
|
+
};
|
|
2449
|
+
if (this.sameSite === true) {
|
|
2450
|
+
cookieOptions.sameSite = 'Strict';
|
|
2451
|
+
} else if (this.sameSite === false) {
|
|
2452
|
+
cookieOptions.sameSite = 'None';
|
|
2453
|
+
cookieOptions.secure = true;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
// if sameSite is undefined or null, leave default browser behavior
|
|
2457
|
+
return js_cookie__WEBPACK_IMPORTED_MODULE_0___default.a.set(key, value, cookieOptions);
|
|
1804
2458
|
}
|
|
1805
2459
|
}, {
|
|
1806
2460
|
key: "removeItem",
|
|
@@ -1814,7 +2468,7 @@ var CookieStorageProvider = /*#__PURE__*/function () {
|
|
|
1814
2468
|
}();
|
|
1815
2469
|
|
|
1816
2470
|
/***/ }),
|
|
1817
|
-
/*
|
|
2471
|
+
/* 31 */
|
|
1818
2472
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1819
2473
|
|
|
1820
2474
|
/*! js-cookie v3.0.5 | MIT */
|
|
@@ -1962,12 +2616,12 @@ var CookieStorageProvider = /*#__PURE__*/function () {
|
|
|
1962
2616
|
|
|
1963
2617
|
|
|
1964
2618
|
/***/ }),
|
|
1965
|
-
/*
|
|
2619
|
+
/* 32 */
|
|
1966
2620
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1967
2621
|
|
|
1968
2622
|
"use strict";
|
|
1969
2623
|
__webpack_require__.r(__webpack_exports__);
|
|
1970
|
-
/* harmony import */ var _buildAuthEndpointUrl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
2624
|
+
/* harmony import */ var _buildAuthEndpointUrl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33);
|
|
1971
2625
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "buildAuthEndpointUrl", function() { return _buildAuthEndpointUrl__WEBPACK_IMPORTED_MODULE_0__["buildAuthEndpointUrl"]; });
|
|
1972
2626
|
|
|
1973
2627
|
/*!
|
|
@@ -1982,23 +2636,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1982
2636
|
|
|
1983
2637
|
|
|
1984
2638
|
/***/ }),
|
|
1985
|
-
/*
|
|
2639
|
+
/* 33 */
|
|
1986
2640
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
1987
2641
|
|
|
1988
2642
|
"use strict";
|
|
1989
2643
|
__webpack_require__.r(__webpack_exports__);
|
|
1990
2644
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buildAuthEndpointUrl", function() { return buildAuthEndpointUrl; });
|
|
1991
2645
|
/*!
|
|
1992
|
-
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
1993
|
-
*
|
|
1994
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
1995
|
-
*
|
|
1996
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
1997
|
-
*
|
|
1998
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
2646
|
+
* Copyright 2024-Present Animoca Brands Corporation Ltd.
|
|
2647
|
+
*
|
|
2648
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
2649
|
+
*
|
|
2650
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
2651
|
+
*
|
|
2652
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1999
2653
|
*/
|
|
2000
2654
|
var buildAuthEndpointUrl = function buildAuthEndpointUrl(signInParams, loginEndPoint) {
|
|
2001
2655
|
var loginUrl = new URL(loginEndPoint);
|
|
2656
|
+
loginUrl.searchParams.append('client_id', signInParams.clientId);
|
|
2002
2657
|
loginUrl.searchParams.append('origin_url', window.location.href);
|
|
2003
2658
|
loginUrl.searchParams.append('redirect_uri', signInParams.redirectUri);
|
|
2004
2659
|
loginUrl.searchParams.append('response_type', signInParams.responseType);
|
|
@@ -2021,12 +2676,12 @@ var buildAuthEndpointUrl = function buildAuthEndpointUrl(signInParams, loginEndP
|
|
|
2021
2676
|
};
|
|
2022
2677
|
|
|
2023
2678
|
/***/ }),
|
|
2024
|
-
/*
|
|
2679
|
+
/* 34 */
|
|
2025
2680
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2026
2681
|
|
|
2027
2682
|
"use strict";
|
|
2028
2683
|
__webpack_require__.r(__webpack_exports__);
|
|
2029
|
-
/* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
2684
|
+
/* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(35);
|
|
2030
2685
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TokenManager", function() { return _lib__WEBPACK_IMPORTED_MODULE_0__["TokenManager"]; });
|
|
2031
2686
|
|
|
2032
2687
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransactionManager", function() { return _lib__WEBPACK_IMPORTED_MODULE_0__["TransactionManager"]; });
|
|
@@ -2037,7 +2692,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2037
2692
|
|
|
2038
2693
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "getStorageClass", function() { return _lib__WEBPACK_IMPORTED_MODULE_0__["getStorageClass"]; });
|
|
2039
2694
|
|
|
2040
|
-
/* harmony import */ var _auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
2695
|
+
/* harmony import */ var _auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13);
|
|
2041
2696
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OCAuthCore", function() { return _auth__WEBPACK_IMPORTED_MODULE_1__["OCAuthCore"]; });
|
|
2042
2697
|
|
|
2043
2698
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "OCAuthLive", function() { return _auth__WEBPACK_IMPORTED_MODULE_1__["OCAuthLive"]; });
|
|
@@ -2048,18 +2703,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2048
2703
|
|
|
2049
2704
|
|
|
2050
2705
|
/***/ }),
|
|
2051
|
-
/*
|
|
2706
|
+
/* 35 */
|
|
2052
2707
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2053
2708
|
|
|
2054
2709
|
"use strict";
|
|
2055
2710
|
__webpack_require__.r(__webpack_exports__);
|
|
2056
|
-
/* harmony import */ var _TokenManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
2711
|
+
/* harmony import */ var _TokenManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(16);
|
|
2057
2712
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TokenManager", function() { return _TokenManager__WEBPACK_IMPORTED_MODULE_0__["default"]; });
|
|
2058
2713
|
|
|
2059
|
-
/* harmony import */ var _TransactionManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
|
|
2714
|
+
/* harmony import */ var _TransactionManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28);
|
|
2060
2715
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransactionManager", function() { return _TransactionManager__WEBPACK_IMPORTED_MODULE_1__["default"]; });
|
|
2061
2716
|
|
|
2062
|
-
/* harmony import */ var _StorageManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
2717
|
+
/* harmony import */ var _StorageManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(29);
|
|
2063
2718
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "BaseStorageManager", function() { return _StorageManager__WEBPACK_IMPORTED_MODULE_2__["BaseStorageManager"]; });
|
|
2064
2719
|
|
|
2065
2720
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LocalStorageManager", function() { return _StorageManager__WEBPACK_IMPORTED_MODULE_2__["LocalStorageManager"]; });
|