solid-ui 2.4.16-9d8eda18 → 2.4.16-d98dff7d
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 +1 -0
- package/lib/acl/add-agent-buttons.js +1 -1
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/chat/message.js +3 -3
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/thread.js +1 -1
- package/lib/chat/thread.js.map +1 -1
- package/lib/create/create.js +1 -1
- package/lib/create/create.js.map +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -8
- package/lib/index.js.map +1 -1
- package/lib/login/login.d.ts +3 -3
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +28 -25
- package/lib/login/login.js.map +1 -1
- package/lib/messageArea.js +1 -1
- package/lib/messageArea.js.map +1 -1
- package/lib/participation.d.ts.map +1 -1
- package/lib/participation.js +59 -30
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js +1 -1
- package/lib/preferences.js.map +1 -1
- package/lib/utils/label.js +1 -2
- package/lib/utils/label.js.map +1 -1
- package/lib/versionInfo.js +9 -9
- package/lib/versionInfo.js.map +1 -1
- package/lib/webpack-bundle.js +826 -628
- package/lib/webpack-bundle.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +3 -1
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +14 -7
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/package.json +12 -3
package/lib/webpack-bundle.js
CHANGED
|
@@ -2252,7 +2252,7 @@ var AddAgentButtons = /*#__PURE__*/function () {
|
|
|
2252
2252
|
switch (_context.prev = _context.next) {
|
|
2253
2253
|
case 0:
|
|
2254
2254
|
_context.next = 2;
|
|
2255
|
-
return (0, _login.
|
|
2255
|
+
return (0, _login.ensureLoadedProfile)(eventContext);
|
|
2256
2256
|
|
|
2257
2257
|
case 2:
|
|
2258
2258
|
trustedApps = this.groupList.store.each(eventContext.me, ns.acl('trustedApp')); // @@ TODO fix as
|
|
@@ -4938,6 +4938,8 @@ var _iconBase = __webpack_require__(/*! ../iconBase */ "./lib/iconBase.js");
|
|
|
4938
4938
|
|
|
4939
4939
|
var _solidLogic = __webpack_require__(/*! solid-logic */ "./node_modules/solid-logic/lib/index.js");
|
|
4940
4940
|
|
|
4941
|
+
var _login = __webpack_require__(/*! ../login/login */ "./lib/login/login.js");
|
|
4942
|
+
|
|
4941
4943
|
var _index = __webpack_require__(/*! ../media/index */ "./lib/media/index.js");
|
|
4942
4944
|
|
|
4943
4945
|
var ns = _interopRequireWildcard(__webpack_require__(/*! ../ns */ "./lib/ns.js"));
|
|
@@ -5544,15 +5546,13 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
5544
5546
|
div: middle,
|
|
5545
5547
|
dom: dom
|
|
5546
5548
|
};
|
|
5547
|
-
|
|
5548
|
-
_solidLogic.authn.logIn(context).then(function (context) {
|
|
5549
|
+
(0, _login.ensureLoggedIn)(context).then(function (context) {
|
|
5549
5550
|
// me = context.me
|
|
5550
5551
|
turnOnInput();
|
|
5551
5552
|
Object.assign(context, userContext);
|
|
5552
5553
|
(0, _bookmarks.findBookmarkDocument)(context).then(function (_context) {// console.log('Bookmark file: ' + context.bookmarkDocument)
|
|
5553
5554
|
});
|
|
5554
5555
|
});
|
|
5555
|
-
|
|
5556
5556
|
return messageEditor;
|
|
5557
5557
|
} // renderMessageEditor
|
|
5558
5558
|
//# sourceMappingURL=message.js.map
|
|
@@ -6111,7 +6111,7 @@ function newThingUI(createContext, dataBrowserContext, thePanes) {
|
|
|
6111
6111
|
var selectUI; // , selectUIParent
|
|
6112
6112
|
|
|
6113
6113
|
function callbackWS(ws, newBase) {
|
|
6114
|
-
(0, _login.
|
|
6114
|
+
(0, _login.ensureLoadedProfile)(createContext).then(function (_context) {
|
|
6115
6115
|
var newPaneOptions = Object.assign({
|
|
6116
6116
|
newBase: newBase,
|
|
6117
6117
|
folder: options.folder || undefined,
|
|
@@ -7354,7 +7354,7 @@ Object.defineProperty(exports, "messageArea", {
|
|
|
7354
7354
|
return _messageArea.messageArea;
|
|
7355
7355
|
}
|
|
7356
7356
|
});
|
|
7357
|
-
exports.style = exports.
|
|
7357
|
+
exports.style = exports.rdf = exports.preferences = exports.participation = exports.pad = exports.ns = void 0;
|
|
7358
7358
|
Object.defineProperty(exports, "table", {
|
|
7359
7359
|
enumerable: true,
|
|
7360
7360
|
get: function get() {
|
|
@@ -7444,9 +7444,7 @@ var createTypes = _interopRequireWildcard(__webpack_require__(/*! ./create/types
|
|
|
7444
7444
|
|
|
7445
7445
|
exports.createTypes = createTypes;
|
|
7446
7446
|
|
|
7447
|
-
var
|
|
7448
|
-
|
|
7449
|
-
exports.solidLogicLib = solidLogicLib;
|
|
7447
|
+
var _solidLogic = __webpack_require__(/*! solid-logic */ "./node_modules/solid-logic/lib/index.js");
|
|
7450
7448
|
|
|
7451
7449
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
7452
7450
|
|
|
@@ -7455,9 +7453,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
7455
7453
|
// pull in first avoid cross-refs
|
|
7456
7454
|
// @ts-ignore
|
|
7457
7455
|
// @ts-ignore
|
|
7458
|
-
// import * as debug from '../debug'
|
|
7459
|
-
// @ts-ignore
|
|
7460
|
-
// @ts-ignore
|
|
7461
7456
|
// @ts-ignore
|
|
7462
7457
|
// @ts-ignore
|
|
7463
7458
|
// @ts-ignore
|
|
@@ -7473,7 +7468,9 @@ exports.dom = dom;
|
|
|
7473
7468
|
if (typeof window !== 'undefined') {
|
|
7474
7469
|
;
|
|
7475
7470
|
window.UI = {
|
|
7476
|
-
|
|
7471
|
+
authn: _solidLogic.authn,
|
|
7472
|
+
store: _solidLogic.store,
|
|
7473
|
+
authSession: _solidLogic.authSession,
|
|
7477
7474
|
ns: ns,
|
|
7478
7475
|
rdf: rdf,
|
|
7479
7476
|
acl: _index.acl,
|
|
@@ -7848,12 +7845,12 @@ var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_m
|
|
|
7848
7845
|
Object.defineProperty(exports, "__esModule", {
|
|
7849
7846
|
value: true
|
|
7850
7847
|
});
|
|
7848
|
+
exports.ensureLoadedPreferences = ensureLoadedPreferences;
|
|
7849
|
+
exports.ensureLoadedProfile = ensureLoadedProfile;
|
|
7850
|
+
exports.ensureLoggedIn = ensureLoggedIn;
|
|
7851
7851
|
exports.filterAvailablePanes = filterAvailablePanes;
|
|
7852
7852
|
exports.findAppInstances = findAppInstances;
|
|
7853
7853
|
exports.getUserRoles = getUserRoles;
|
|
7854
|
-
exports.logInLoadPreferences = logInLoadPreferences;
|
|
7855
|
-
exports.logInLoadProfile = logInLoadProfile;
|
|
7856
|
-
exports.loggedInContext = loggedInContext;
|
|
7857
7854
|
exports.loginStatusBox = loginStatusBox;
|
|
7858
7855
|
exports.newAppInstance = newAppInstance;
|
|
7859
7856
|
exports.registrationControl = registrationControl;
|
|
@@ -7914,7 +7911,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
7914
7911
|
*
|
|
7915
7912
|
* @param context
|
|
7916
7913
|
*/
|
|
7917
|
-
|
|
7914
|
+
// used to be logIn
|
|
7915
|
+
function ensureLoggedIn(context) {
|
|
7918
7916
|
var me = _solidLogic.authn.currentUser();
|
|
7919
7917
|
|
|
7920
7918
|
if (me) {
|
|
@@ -7952,10 +7950,11 @@ function loggedInContext(context) {
|
|
|
7952
7950
|
*
|
|
7953
7951
|
* @param context
|
|
7954
7952
|
*/
|
|
7953
|
+
// used to be logInLoadPreferences
|
|
7955
7954
|
|
|
7956
7955
|
|
|
7957
|
-
function
|
|
7958
|
-
return
|
|
7956
|
+
function ensureLoadedPreferences(_x2) {
|
|
7957
|
+
return _ensureLoadedPreferences.apply(this, arguments);
|
|
7959
7958
|
}
|
|
7960
7959
|
/**
|
|
7961
7960
|
* Logs the user in and loads their WebID profile document into the store
|
|
@@ -7964,17 +7963,18 @@ function logInLoadPreferences(_x2) {
|
|
|
7964
7963
|
*
|
|
7965
7964
|
* @returns Resolves with the context after login / fetch
|
|
7966
7965
|
*/
|
|
7966
|
+
// used to be logInLoadProfile
|
|
7967
7967
|
|
|
7968
7968
|
|
|
7969
|
-
function
|
|
7970
|
-
|
|
7969
|
+
function _ensureLoadedPreferences() {
|
|
7970
|
+
_ensureLoadedPreferences = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(context) {
|
|
7971
7971
|
var statusArea, progressDisplay, complain, preferencesFile, m2;
|
|
7972
7972
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
7973
7973
|
while (1) {
|
|
7974
7974
|
switch (_context4.prev = _context4.next) {
|
|
7975
7975
|
case 0:
|
|
7976
7976
|
complain = function _complain(message) {
|
|
7977
|
-
message = "
|
|
7977
|
+
message = "ensureLoadedPreferences: ".concat(message);
|
|
7978
7978
|
|
|
7979
7979
|
if (statusArea) {
|
|
7980
7980
|
// statusArea.innerHTML = ''
|
|
@@ -7996,7 +7996,7 @@ function _logInLoadPreferences() {
|
|
|
7996
7996
|
statusArea = context.statusArea || context.div || null;
|
|
7997
7997
|
_context4.prev = 4;
|
|
7998
7998
|
_context4.next = 7;
|
|
7999
|
-
return
|
|
7999
|
+
return ensureLoadedProfile(context);
|
|
8000
8000
|
|
|
8001
8001
|
case 7:
|
|
8002
8002
|
context = _context4.sent;
|
|
@@ -8097,11 +8097,11 @@ function _logInLoadPreferences() {
|
|
|
8097
8097
|
}
|
|
8098
8098
|
}, _callee4, null, [[4, 15]]);
|
|
8099
8099
|
}));
|
|
8100
|
-
return
|
|
8100
|
+
return _ensureLoadedPreferences.apply(this, arguments);
|
|
8101
8101
|
}
|
|
8102
8102
|
|
|
8103
|
-
function
|
|
8104
|
-
return
|
|
8103
|
+
function ensureLoadedProfile(_x3) {
|
|
8104
|
+
return _ensureLoadedProfile.apply(this, arguments);
|
|
8105
8105
|
}
|
|
8106
8106
|
/**
|
|
8107
8107
|
* Returns promise of context with arrays of symbols
|
|
@@ -8111,8 +8111,8 @@ function logInLoadProfile(_x3) {
|
|
|
8111
8111
|
*/
|
|
8112
8112
|
|
|
8113
8113
|
|
|
8114
|
-
function
|
|
8115
|
-
|
|
8114
|
+
function _ensureLoadedProfile() {
|
|
8115
|
+
_ensureLoadedProfile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(context) {
|
|
8116
8116
|
var logInContext;
|
|
8117
8117
|
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
8118
8118
|
while (1) {
|
|
@@ -8128,7 +8128,7 @@ function _logInLoadProfile() {
|
|
|
8128
8128
|
case 2:
|
|
8129
8129
|
_context5.prev = 2;
|
|
8130
8130
|
_context5.next = 5;
|
|
8131
|
-
return
|
|
8131
|
+
return ensureLoggedIn(context);
|
|
8132
8132
|
|
|
8133
8133
|
case 5:
|
|
8134
8134
|
logInContext = _context5.sent;
|
|
@@ -8169,7 +8169,7 @@ function _logInLoadProfile() {
|
|
|
8169
8169
|
}
|
|
8170
8170
|
}, _callee5, null, [[2, 13]]);
|
|
8171
8171
|
}));
|
|
8172
|
-
return
|
|
8172
|
+
return _ensureLoadedProfile.apply(this, arguments);
|
|
8173
8173
|
}
|
|
8174
8174
|
|
|
8175
8175
|
function findAppInstances(_x4, _x5, _x6) {
|
|
@@ -8209,7 +8209,7 @@ function _findAppInstances() {
|
|
|
8209
8209
|
case 7:
|
|
8210
8210
|
_context6.prev = 7;
|
|
8211
8211
|
_context6.next = 10;
|
|
8212
|
-
return isPublic ?
|
|
8212
|
+
return isPublic ? ensureLoadedProfile(context) : ensureLoadedPreferences(context);
|
|
8213
8213
|
|
|
8214
8214
|
case 10:
|
|
8215
8215
|
_context6.next = 15;
|
|
@@ -9109,7 +9109,7 @@ function selectWorkspace(dom, appDetails, callbackWS) {
|
|
|
9109
9109
|
// console.log('kicking off async operation')
|
|
9110
9110
|
|
|
9111
9111
|
|
|
9112
|
-
|
|
9112
|
+
ensureLoadedPreferences(context) // kick off async operation
|
|
9113
9113
|
.then(displayOptions)["catch"](function (err) {
|
|
9114
9114
|
// console.log("err from async op")
|
|
9115
9115
|
box.appendChild(widgets.errorMessageBlock(context.dom, err));
|
|
@@ -9168,7 +9168,7 @@ function getUserRoles() {
|
|
|
9168
9168
|
|
|
9169
9169
|
function _getUserRoles() {
|
|
9170
9170
|
_getUserRoles = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
9171
|
-
var _yield$
|
|
9171
|
+
var _yield$ensureLoadedPr, me, preferencesFile, preferencesFileError;
|
|
9172
9172
|
|
|
9173
9173
|
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
9174
9174
|
while (1) {
|
|
@@ -9176,13 +9176,13 @@ function _getUserRoles() {
|
|
|
9176
9176
|
case 0:
|
|
9177
9177
|
_context7.prev = 0;
|
|
9178
9178
|
_context7.next = 3;
|
|
9179
|
-
return
|
|
9179
|
+
return ensureLoadedPreferences({});
|
|
9180
9180
|
|
|
9181
9181
|
case 3:
|
|
9182
|
-
_yield$
|
|
9183
|
-
me = _yield$
|
|
9184
|
-
preferencesFile = _yield$
|
|
9185
|
-
preferencesFileError = _yield$
|
|
9182
|
+
_yield$ensureLoadedPr = _context7.sent;
|
|
9183
|
+
me = _yield$ensureLoadedPr.me;
|
|
9184
|
+
preferencesFile = _yield$ensureLoadedPr.preferencesFile;
|
|
9185
|
+
preferencesFileError = _yield$ensureLoadedPr.preferencesFileError;
|
|
9186
9186
|
|
|
9187
9187
|
if (!(!preferencesFile || preferencesFileError)) {
|
|
9188
9188
|
_context7.next = 9;
|
|
@@ -10001,7 +10001,7 @@ function messageArea(dom, kb, subject, messageStore, options) {
|
|
|
10001
10001
|
div: middle,
|
|
10002
10002
|
dom: dom
|
|
10003
10003
|
};
|
|
10004
|
-
login.
|
|
10004
|
+
login.ensureLoggedIn(context).then(function (context) {
|
|
10005
10005
|
me = context.me;
|
|
10006
10006
|
turnOnInput();
|
|
10007
10007
|
});
|
|
@@ -11295,6 +11295,8 @@ var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/ru
|
|
|
11295
11295
|
|
|
11296
11296
|
var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js"));
|
|
11297
11297
|
|
|
11298
|
+
var debug = _interopRequireWildcard(__webpack_require__(/*! ./debug */ "./lib/debug.js"));
|
|
11299
|
+
|
|
11298
11300
|
var _rdflib = __webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/index.js");
|
|
11299
11301
|
|
|
11300
11302
|
var ns = _interopRequireWildcard(__webpack_require__(/*! ./ns */ "./lib/ns.js"));
|
|
@@ -11305,14 +11307,18 @@ var _utils = __webpack_require__(/*! ./utils */ "./lib/utils/index.js");
|
|
|
11305
11307
|
|
|
11306
11308
|
var _pad = __webpack_require__(/*! ./pad */ "./lib/pad.js");
|
|
11307
11309
|
|
|
11308
|
-
var _debug = __webpack_require__(/*! ./debug */ "./lib/debug.js");
|
|
11309
|
-
|
|
11310
11310
|
var _solidLogic = __webpack_require__(/*! solid-logic */ "./node_modules/solid-logic/lib/index.js");
|
|
11311
11311
|
|
|
11312
11312
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11313
11313
|
|
|
11314
11314
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11315
11315
|
|
|
11316
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
11317
|
+
|
|
11318
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11319
|
+
|
|
11320
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11321
|
+
|
|
11316
11322
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
11317
11323
|
|
|
11318
11324
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -11339,7 +11345,7 @@ var ParticipationTableElement = /*#__PURE__*/function (_HTMLTableElement) {
|
|
|
11339
11345
|
return (0, _createClass2["default"])(ParticipationTableElement);
|
|
11340
11346
|
}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLTableElement));
|
|
11341
11347
|
|
|
11342
|
-
var
|
|
11348
|
+
var store = _solidLogic.solidLogicSingleton.store;
|
|
11343
11349
|
/** Manage participation in this session
|
|
11344
11350
|
*
|
|
11345
11351
|
* @param {Document} dom - the web page loaded into the browser
|
|
@@ -11354,7 +11360,7 @@ function renderPartipants(dom, table, unused1, subject, unused2, options) {
|
|
|
11354
11360
|
table.setAttribute('style', 'margin: 0.8em;');
|
|
11355
11361
|
|
|
11356
11362
|
var newRowForParticpation = function newRowForParticpation(parp) {
|
|
11357
|
-
var person =
|
|
11363
|
+
var person = store.any(parp, ns.wf('participant'));
|
|
11358
11364
|
var tr;
|
|
11359
11365
|
|
|
11360
11366
|
if (!person) {
|
|
@@ -11364,7 +11370,7 @@ function renderPartipants(dom, table, unused1, subject, unused2, options) {
|
|
|
11364
11370
|
return tr;
|
|
11365
11371
|
}
|
|
11366
11372
|
|
|
11367
|
-
var bg =
|
|
11373
|
+
var bg = store.anyValue(parp, ns.ui('backgroundColor')) || 'white';
|
|
11368
11374
|
var block = dom.createElement('div');
|
|
11369
11375
|
block.setAttribute('style', 'height: 1.5em; width: 1.5em; margin: 0.3em; border 0.01em solid #888; background-color: ' + bg);
|
|
11370
11376
|
tr = (0, _widgets.personTR)(dom, null, person, options);
|
|
@@ -11377,9 +11383,9 @@ function renderPartipants(dom, table, unused1, subject, unused2, options) {
|
|
|
11377
11383
|
};
|
|
11378
11384
|
|
|
11379
11385
|
var syncTable = function syncTable() {
|
|
11380
|
-
var parps =
|
|
11381
|
-
(0,
|
|
11382
|
-
return [
|
|
11386
|
+
var parps = store.each(subject, ns.wf('participation')).map(function (parp) {
|
|
11387
|
+
(0, debug.log)('in participants');
|
|
11388
|
+
return [store.anyValue(parp, ns.cal('dtstart')) || '9999-12-31', parp];
|
|
11383
11389
|
});
|
|
11384
11390
|
parps.sort(); // List in order of joining
|
|
11385
11391
|
|
|
@@ -11407,36 +11413,57 @@ function renderPartipants(dom, table, unused1, subject, unused2, options) {
|
|
|
11407
11413
|
function participationObject(subject, padDoc, me) {
|
|
11408
11414
|
return new Promise(function (resolve, reject) {
|
|
11409
11415
|
if (!me) {
|
|
11410
|
-
throw new Error('
|
|
11416
|
+
throw new Error('No user id');
|
|
11411
11417
|
}
|
|
11412
11418
|
|
|
11413
|
-
var parps =
|
|
11414
|
-
return
|
|
11419
|
+
var parps = store.each(subject, ns.wf('participation')).filter(function (pn) {
|
|
11420
|
+
return store.holds(pn, ns.wf('participant'), me);
|
|
11415
11421
|
});
|
|
11416
11422
|
|
|
11417
11423
|
if (parps.length > 1) {
|
|
11418
|
-
|
|
11424
|
+
// This can happen. https://github.com/solid/chat-pane/issues/71
|
|
11425
|
+
var candidates = [];
|
|
11426
|
+
|
|
11427
|
+
var _iterator = _createForOfIteratorHelper(parps),
|
|
11428
|
+
_step;
|
|
11429
|
+
|
|
11430
|
+
try {
|
|
11431
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
11432
|
+
var participation = _step.value;
|
|
11433
|
+
var date = store.anyValue(participation, ns.cal('dtstart'));
|
|
11434
|
+
|
|
11435
|
+
if (date) {
|
|
11436
|
+
candidates.push([date, participation]);
|
|
11437
|
+
}
|
|
11438
|
+
}
|
|
11439
|
+
} catch (err) {
|
|
11440
|
+
_iterator.e(err);
|
|
11441
|
+
} finally {
|
|
11442
|
+
_iterator.f();
|
|
11443
|
+
}
|
|
11444
|
+
|
|
11445
|
+
candidates.sort(); // Pick the earliest
|
|
11446
|
+
// @@ Possibly, for extra credit, delete the others, if we have write access
|
|
11447
|
+
|
|
11448
|
+
debug.warn('Multiple particpation objects, picking earliest, in ' + padDoc);
|
|
11449
|
+
resolve(candidates[0][1]); // throw new Error('Multiple records of your participation')
|
|
11419
11450
|
}
|
|
11420
11451
|
|
|
11421
11452
|
if (parps.length) {
|
|
11422
11453
|
// If I am not already recorded
|
|
11423
11454
|
resolve(parps[0]); // returns the particpation object
|
|
11424
11455
|
} else {
|
|
11425
|
-
var
|
|
11426
|
-
var ins = [(0, _rdflib.st)(subject, ns.wf('participation'), participation, padDoc), (0, _rdflib.st)(participation, ns.wf('participant'), me, padDoc), (0, _rdflib.st)(participation, ns.cal('dtstart'), new Date(), padDoc), (0, _rdflib.st)(participation, ns.ui('backgroundColor'), (0, _pad.lightColorHash)(me), padDoc)];
|
|
11456
|
+
var _participation2 = (0, _widgets.newThing)(padDoc);
|
|
11427
11457
|
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
}
|
|
11431
|
-
|
|
11432
|
-
kb.updater.update([], ins, function (uri, ok, errorMessage) {
|
|
11458
|
+
var ins = [(0, _rdflib.st)(subject, ns.wf('participation'), _participation2, padDoc), (0, _rdflib.st)(_participation2, ns.wf('participant'), me, padDoc), (0, _rdflib.st)(_participation2, ns.cal('dtstart'), new Date(), padDoc), (0, _rdflib.st)(_participation2, ns.ui('backgroundColor'), (0, _pad.lightColorHash)(me), padDoc)];
|
|
11459
|
+
store.updater.update([], ins, function (uri, ok, errorMessage) {
|
|
11433
11460
|
if (!ok) {
|
|
11434
11461
|
reject(new Error('Error recording your partipation: ' + errorMessage));
|
|
11435
11462
|
} else {
|
|
11436
|
-
resolve(
|
|
11463
|
+
resolve(_participation2);
|
|
11437
11464
|
}
|
|
11438
11465
|
});
|
|
11439
|
-
resolve(
|
|
11466
|
+
resolve(_participation2);
|
|
11440
11467
|
}
|
|
11441
11468
|
});
|
|
11442
11469
|
}
|
|
@@ -11454,8 +11481,8 @@ function recordParticipation(subject, padDoc, refreshable) {
|
|
|
11454
11481
|
|
|
11455
11482
|
if (!me) return; // Not logged in
|
|
11456
11483
|
|
|
11457
|
-
var parps =
|
|
11458
|
-
return
|
|
11484
|
+
var parps = store.each(subject, ns.wf('participation')).filter(function (pn) {
|
|
11485
|
+
return store.holds(pn, ns.wf('participant'), me);
|
|
11459
11486
|
});
|
|
11460
11487
|
|
|
11461
11488
|
if (parps.length > 1) {
|
|
@@ -11466,14 +11493,14 @@ function recordParticipation(subject, padDoc, refreshable) {
|
|
|
11466
11493
|
// If I am not already recorded
|
|
11467
11494
|
return parps[0]; // returns the particpation object
|
|
11468
11495
|
} else {
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
|
|
11472
|
-
if (!kb.updater) {
|
|
11473
|
-
throw new Error('kb has no updater');
|
|
11496
|
+
if (!store.updater.editable(padDoc)) {
|
|
11497
|
+
debug.log('Not recording participation, as no write acesss as ' + me + ' to ' + padDoc);
|
|
11498
|
+
return null;
|
|
11474
11499
|
}
|
|
11475
11500
|
|
|
11476
|
-
|
|
11501
|
+
var participation = (0, _widgets.newThing)(padDoc);
|
|
11502
|
+
var ins = [(0, _rdflib.st)(subject, ns.wf('participation'), participation, padDoc), (0, _rdflib.st)(participation, ns.wf('participant'), me, padDoc), (0, _rdflib.st)(participation, ns.cal('dtstart'), new Date(), padDoc), (0, _rdflib.st)(participation, ns.ui('backgroundColor'), (0, _pad.lightColorHash)(me), padDoc)];
|
|
11503
|
+
store.updater.update([], ins, function (uri, ok, errorMessage) {
|
|
11477
11504
|
if (!ok) {
|
|
11478
11505
|
throw new Error('Error recording your partipation: ' + errorMessage);
|
|
11479
11506
|
}
|
|
@@ -11503,8 +11530,10 @@ function manageParticipation(dom, container, padDoc, subject, me, options) {
|
|
|
11503
11530
|
container.appendChild(table);
|
|
11504
11531
|
renderPartipants(dom, table, padDoc, subject, me, options);
|
|
11505
11532
|
|
|
11533
|
+
var _participation;
|
|
11534
|
+
|
|
11506
11535
|
try {
|
|
11507
|
-
recordParticipation(subject, padDoc, table);
|
|
11536
|
+
_participation = recordParticipation(subject, padDoc, table);
|
|
11508
11537
|
} catch (e) {
|
|
11509
11538
|
container.appendChild((0, _widgets.errorMessageBlock)(dom, 'Error recording your partipation: ' + e)); // Clean up?
|
|
11510
11539
|
}
|
|
@@ -11615,7 +11644,7 @@ function recordSharedPreferences(subject, context) {
|
|
|
11615
11644
|
|
|
11616
11645
|
function recordPersonalDefaults(theClass, context) {
|
|
11617
11646
|
return new Promise(function (resolve, reject) {
|
|
11618
|
-
(0, _login.
|
|
11647
|
+
(0, _login.ensureLoadedPreferences)(context).then(function (context) {
|
|
11619
11648
|
if (!context.preferencesFile) {
|
|
11620
11649
|
debug.log('Not doing private class preferences as no access to preferences file. ' + context.preferencesFileError);
|
|
11621
11650
|
return;
|
|
@@ -15008,8 +15037,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
15008
15037
|
var UI = {
|
|
15009
15038
|
log: log,
|
|
15010
15039
|
ns: ns,
|
|
15011
|
-
rdf: rdf
|
|
15012
|
-
store: _solidLogic.store
|
|
15040
|
+
rdf: rdf
|
|
15013
15041
|
}; // This ubiquitous function returns the best label for a thing
|
|
15014
15042
|
//
|
|
15015
15043
|
// The hacks in this code make a major difference to the usability
|
|
@@ -15127,23 +15155,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
15127
15155
|
});
|
|
15128
15156
|
exports["default"] = void 0;
|
|
15129
15157
|
var _default = {
|
|
15130
|
-
buildTime: '2022-02-
|
|
15131
|
-
commit: '
|
|
15158
|
+
buildTime: '2022-02-21T23:22:07Z',
|
|
15159
|
+
commit: 'd98dff7d7be96930fce9ca29328fd101a5ba4411',
|
|
15132
15160
|
npmInfo: {
|
|
15133
15161
|
'solid-ui': '2.4.16',
|
|
15134
|
-
npm: '6.14.
|
|
15162
|
+
npm: '6.14.16',
|
|
15135
15163
|
ares: '1.18.1',
|
|
15136
15164
|
brotli: '1.0.9',
|
|
15137
|
-
cldr: '
|
|
15138
|
-
icu: '
|
|
15165
|
+
cldr: '40.0',
|
|
15166
|
+
icu: '70.1',
|
|
15139
15167
|
llhttp: '2.1.4',
|
|
15140
15168
|
modules: '83',
|
|
15141
15169
|
napi: '8',
|
|
15142
15170
|
nghttp2: '1.42.0',
|
|
15143
|
-
node: '14.
|
|
15144
|
-
openssl: '1.1.
|
|
15145
|
-
tz: '
|
|
15146
|
-
unicode: '
|
|
15171
|
+
node: '14.19.0',
|
|
15172
|
+
openssl: '1.1.1m',
|
|
15173
|
+
tz: '2021a3',
|
|
15174
|
+
unicode: '14.0',
|
|
15147
15175
|
uv: '1.42.0',
|
|
15148
15176
|
v8: '8.4.371.23-node.85',
|
|
15149
15177
|
zlib: '1.2.11'
|
|
@@ -20225,6 +20253,8 @@ function getPreferredLanguagesFor(_x) {
|
|
|
20225
20253
|
|
|
20226
20254
|
function _getPreferredLanguagesFor() {
|
|
20227
20255
|
_getPreferredLanguagesFor = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(person) {
|
|
20256
|
+
var _store$fetcher;
|
|
20257
|
+
|
|
20228
20258
|
var doc, list, languageCodeArray;
|
|
20229
20259
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
20230
20260
|
while (1) {
|
|
@@ -20232,7 +20262,7 @@ function _getPreferredLanguagesFor() {
|
|
|
20232
20262
|
case 0:
|
|
20233
20263
|
doc = person.doc();
|
|
20234
20264
|
_context.next = 3;
|
|
20235
|
-
return _solidLogic.store.fetcher.load(doc);
|
|
20265
|
+
return (_store$fetcher = _solidLogic.store.fetcher) === null || _store$fetcher === void 0 ? void 0 : _store$fetcher.load(doc);
|
|
20236
20266
|
|
|
20237
20267
|
case 3:
|
|
20238
20268
|
list = _solidLogic.store.any(person, ns.schema('knowsLanguage'), null, doc);
|
|
@@ -20702,6 +20732,8 @@ function queryESCODataByName(_x, _x2, _x3) {
|
|
|
20702
20732
|
|
|
20703
20733
|
function _queryESCODataByName() {
|
|
20704
20734
|
_queryESCODataByName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(filter, theClass, queryTarget) {
|
|
20735
|
+
var _store$fetcher;
|
|
20736
|
+
|
|
20705
20737
|
var limit, queryURI, response, text, json;
|
|
20706
20738
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
20707
20739
|
while (1) {
|
|
@@ -20719,11 +20751,11 @@ function _queryESCODataByName() {
|
|
|
20719
20751
|
queryURI = queryTarget.searchByNameURI.replace('$(name)', filter).replace('$(limit)', '' + limit).replace('$(targetClass)', theClass.toNT());
|
|
20720
20752
|
debug.log('Querying ESCO data - uri: ' + queryURI);
|
|
20721
20753
|
_context.next = 7;
|
|
20722
|
-
return _solidLogic.store.fetcher.webOperation('GET', queryURI, fetcherOptionsJsonPublicData);
|
|
20754
|
+
return (_store$fetcher = _solidLogic.store.fetcher) === null || _store$fetcher === void 0 ? void 0 : _store$fetcher.webOperation('GET', queryURI, fetcherOptionsJsonPublicData);
|
|
20723
20755
|
|
|
20724
20756
|
case 7:
|
|
20725
20757
|
response = _context.sent;
|
|
20726
|
-
text = response.responseText || '';
|
|
20758
|
+
text = (response === null || response === void 0 ? void 0 : response.responseText) || '';
|
|
20727
20759
|
debug.log(' Query result text' + text.slice(0, 500) + '...');
|
|
20728
20760
|
|
|
20729
20761
|
if (!(text.length === 0)) {
|
|
@@ -20770,7 +20802,8 @@ function queryPublicDataByName(_x4, _x5, _x6, _x7) {
|
|
|
20770
20802
|
|
|
20771
20803
|
function _queryPublicDataByName() {
|
|
20772
20804
|
_queryPublicDataByName = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(filter, theClass, languages, queryTarget) {
|
|
20773
|
-
var substituteStrings, languagePrefs, language, sparql, queryURI, response, text, text2, json, bindings;
|
|
20805
|
+
var substituteStrings, languagePrefs, language, sparql, queryURI, response, _store$fetcher2, text, text2, json, bindings;
|
|
20806
|
+
|
|
20774
20807
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
20775
20808
|
while (1) {
|
|
20776
20809
|
switch (_context2.prev = _context2.next) {
|
|
@@ -20825,7 +20858,7 @@ function _queryPublicDataByName() {
|
|
|
20825
20858
|
queryURI = substituteStrings(queryTarget.searchByNameURI);
|
|
20826
20859
|
_context2.prev = 18;
|
|
20827
20860
|
_context2.next = 21;
|
|
20828
|
-
return _solidLogic.store.fetcher.webOperation('GET', queryURI, fetcherOptionsJsonPublicData);
|
|
20861
|
+
return (_store$fetcher2 = _solidLogic.store.fetcher) === null || _store$fetcher2 === void 0 ? void 0 : _store$fetcher2.webOperation('GET', queryURI, fetcherOptionsJsonPublicData);
|
|
20829
20862
|
|
|
20830
20863
|
case 21:
|
|
20831
20864
|
response = _context2.sent;
|
|
@@ -20902,6 +20935,8 @@ function queryPublicDataSelect(_x8, _x9) {
|
|
|
20902
20935
|
|
|
20903
20936
|
function _queryPublicDataSelect() {
|
|
20904
20937
|
_queryPublicDataSelect = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(sparql, queryTarget) {
|
|
20938
|
+
var _store$fetcher3;
|
|
20939
|
+
|
|
20905
20940
|
var myUrlWithParams, queryURI, headers, options, response, text, text2, json, bindings;
|
|
20906
20941
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
20907
20942
|
while (1) {
|
|
@@ -20927,7 +20962,7 @@ function _queryPublicDataSelect() {
|
|
|
20927
20962
|
headers: headers
|
|
20928
20963
|
};
|
|
20929
20964
|
_context3.next = 11;
|
|
20930
|
-
return _solidLogic.store.fetcher.webOperation('GET', queryURI, options);
|
|
20965
|
+
return (_store$fetcher3 = _solidLogic.store.fetcher) === null || _store$fetcher3 === void 0 ? void 0 : _store$fetcher3.webOperation('GET', queryURI, options);
|
|
20931
20966
|
|
|
20932
20967
|
case 11:
|
|
20933
20968
|
response = _context3.sent;
|
|
@@ -20963,6 +20998,8 @@ function queryPublicDataConstruct(_x10, _x11, _x12) {
|
|
|
20963
20998
|
|
|
20964
20999
|
function _queryPublicDataConstruct() {
|
|
20965
21000
|
_queryPublicDataConstruct = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(sparql, pubicId, queryTarget) {
|
|
21001
|
+
var _store$fetcher4;
|
|
21002
|
+
|
|
20966
21003
|
var myUrlWithParams, queryURI, headers, options, response, text, report;
|
|
20967
21004
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
20968
21005
|
while (1) {
|
|
@@ -20991,11 +21028,11 @@ function _queryPublicDataConstruct() {
|
|
|
20991
21028
|
|
|
20992
21029
|
};
|
|
20993
21030
|
_context4.next = 12;
|
|
20994
|
-
return _solidLogic.store.fetcher.webOperation('GET', queryURI, options);
|
|
21031
|
+
return (_store$fetcher4 = _solidLogic.store.fetcher) === null || _store$fetcher4 === void 0 ? void 0 : _store$fetcher4.webOperation('GET', queryURI, options);
|
|
20995
21032
|
|
|
20996
21033
|
case 12:
|
|
20997
21034
|
response = _context4.sent;
|
|
20998
|
-
text = response.responseText || 'No response text?';
|
|
21035
|
+
text = (response === null || response === void 0 ? void 0 : response.responseText) || 'No response text?';
|
|
20999
21036
|
report = text.length > 500 ? text.slice(0, 200) + ' ... ' + text.slice(-200) : text;
|
|
21000
21037
|
debug.log(' queryPublicDataConstruct result text:' + report);
|
|
21001
21038
|
|
|
@@ -23038,14 +23075,14 @@ function _inherits(subClass, superClass) {
|
|
|
23038
23075
|
throw new TypeError("Super expression must either be null or a function");
|
|
23039
23076
|
}
|
|
23040
23077
|
|
|
23078
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
23079
|
+
constructor: {
|
|
23080
|
+
value: subClass,
|
|
23081
|
+
writable: true,
|
|
23082
|
+
configurable: true
|
|
23083
|
+
}
|
|
23084
|
+
});
|
|
23041
23085
|
Object.defineProperty(subClass, "prototype", {
|
|
23042
|
-
value: Object.create(superClass && superClass.prototype, {
|
|
23043
|
-
constructor: {
|
|
23044
|
-
value: subClass,
|
|
23045
|
-
writable: true,
|
|
23046
|
-
configurable: true
|
|
23047
|
-
}
|
|
23048
|
-
}),
|
|
23049
23086
|
writable: false
|
|
23050
23087
|
});
|
|
23051
23088
|
if (superClass) setPrototypeOf(subClass, superClass);
|
|
@@ -23174,7 +23211,7 @@ module.exports = _nonIterableRest, module.exports.__esModule = true, module.expo
|
|
|
23174
23211
|
/*! no static exports found */
|
|
23175
23212
|
/***/ (function(module, exports, __webpack_require__) {
|
|
23176
23213
|
|
|
23177
|
-
var _typeof = __webpack_require__(/*!
|
|
23214
|
+
var _typeof = __webpack_require__(/*! ./typeof.js */ "./node_modules/@babel/runtime/helpers/typeof.js")["default"];
|
|
23178
23215
|
|
|
23179
23216
|
var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
|
|
23180
23217
|
|
|
@@ -24400,9 +24437,6 @@ const issuerConfigKeyMap = {
|
|
|
24400
24437
|
toKey: "opTosUri",
|
|
24401
24438
|
convertToUrl: true,
|
|
24402
24439
|
},
|
|
24403
|
-
solid_oidc_supported: {
|
|
24404
|
-
toKey: "solidOidcSupported",
|
|
24405
|
-
},
|
|
24406
24440
|
};
|
|
24407
24441
|
function processConfig(config) {
|
|
24408
24442
|
const parsedConfig = {};
|
|
@@ -25071,16 +25105,13 @@ exports.generateDpopKeyPair = exports.createDpopHeader = void 0;
|
|
|
25071
25105
|
const jose_1 = __webpack_require__(/*! jose */ "./node_modules/jose/dist/browser/index.js");
|
|
25072
25106
|
const uuid_1 = __webpack_require__(/*! uuid */ "./node_modules/uuid/dist/esm-browser/index.js");
|
|
25073
25107
|
const constant_1 = __webpack_require__(/*! ../constant */ "./node_modules/@inrupt/solid-client-authn-core/dist/constant.js");
|
|
25074
|
-
function
|
|
25075
|
-
const
|
|
25076
|
-
|
|
25077
|
-
cleanedAudience.username = "";
|
|
25078
|
-
cleanedAudience.password = "";
|
|
25079
|
-
return cleanedAudience.toString();
|
|
25108
|
+
function normalizeHTU(audience) {
|
|
25109
|
+
const audienceUrl = new URL(audience);
|
|
25110
|
+
return new URL(audienceUrl.pathname, audienceUrl.origin).toString();
|
|
25080
25111
|
}
|
|
25081
25112
|
async function createDpopHeader(audience, method, dpopKey) {
|
|
25082
25113
|
return new jose_1.SignJWT({
|
|
25083
|
-
htu:
|
|
25114
|
+
htu: normalizeHTU(audience),
|
|
25084
25115
|
htm: method.toUpperCase(),
|
|
25085
25116
|
jti: (0, uuid_1.v4)(),
|
|
25086
25117
|
})
|
|
@@ -25523,8 +25554,7 @@ function determineClientType(options, issuerConfig) {
|
|
|
25523
25554
|
if (options.clientId !== undefined && !isValidUrl(options.clientId)) {
|
|
25524
25555
|
return "static";
|
|
25525
25556
|
}
|
|
25526
|
-
if (issuerConfig.
|
|
25527
|
-
"https://solidproject.org/TR/solid-oidc" &&
|
|
25557
|
+
if (issuerConfig.scopesSupported.includes("webid") &&
|
|
25528
25558
|
options.clientId !== undefined &&
|
|
25529
25559
|
isValidUrl(options.clientId)) {
|
|
25530
25560
|
return "solid-oidc";
|
|
@@ -28320,7 +28350,7 @@ var tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\:
|
|
|
28320
28350
|
//S_TAG, S_ATTR, S_EQ, S_ATTR_NOQUOT_VALUE
|
|
28321
28351
|
//S_ATTR_SPACE, S_ATTR_END, S_TAG_SPACE, S_TAG_CLOSE
|
|
28322
28352
|
var S_TAG = 0;//tag name offerring
|
|
28323
|
-
var S_ATTR = 1;//attr name offerring
|
|
28353
|
+
var S_ATTR = 1;//attr name offerring
|
|
28324
28354
|
var S_ATTR_SPACE=2;//attr name end and space offer
|
|
28325
28355
|
var S_EQ = 3;//=space?
|
|
28326
28356
|
var S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)
|
|
@@ -28344,7 +28374,7 @@ ParseError.prototype = new Error();
|
|
|
28344
28374
|
ParseError.prototype.name = ParseError.name
|
|
28345
28375
|
|
|
28346
28376
|
function XMLReader(){
|
|
28347
|
-
|
|
28377
|
+
|
|
28348
28378
|
}
|
|
28349
28379
|
|
|
28350
28380
|
XMLReader.prototype = {
|
|
@@ -28373,8 +28403,8 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
|
|
|
28373
28403
|
}
|
|
28374
28404
|
function entityReplacer(a){
|
|
28375
28405
|
var k = a.slice(1,-1);
|
|
28376
|
-
if(k
|
|
28377
|
-
return entityMap[k];
|
|
28406
|
+
if (Object.hasOwnProperty.call(entityMap, k)) {
|
|
28407
|
+
return entityMap[k];
|
|
28378
28408
|
}else if(k.charAt(0) === '#'){
|
|
28379
28409
|
return fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))
|
|
28380
28410
|
}else{
|
|
@@ -28403,7 +28433,7 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
|
|
|
28403
28433
|
var lineEnd = 0;
|
|
28404
28434
|
var linePattern = /.*(?:\r\n?|\n)|.*$/g
|
|
28405
28435
|
var locator = domBuilder.locator;
|
|
28406
|
-
|
|
28436
|
+
|
|
28407
28437
|
var parseStack = [{currentNSMap:defaultNSMapCopy}]
|
|
28408
28438
|
var closeMap = {};
|
|
28409
28439
|
var start = 0;
|
|
@@ -28428,7 +28458,7 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
|
|
|
28428
28458
|
var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, '');
|
|
28429
28459
|
var config = parseStack.pop();
|
|
28430
28460
|
if(end<0){
|
|
28431
|
-
|
|
28461
|
+
|
|
28432
28462
|
tagName = source.substring(tagStart+2).replace(/[\s<].*/,'');
|
|
28433
28463
|
errorHandler.error("end tag name: "+tagName+' is not complete:'+config.tagName);
|
|
28434
28464
|
end = tagStart+1+tagName.length;
|
|
@@ -28453,7 +28483,7 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
|
|
|
28453
28483
|
}else{
|
|
28454
28484
|
parseStack.push(config)
|
|
28455
28485
|
}
|
|
28456
|
-
|
|
28486
|
+
|
|
28457
28487
|
end++;
|
|
28458
28488
|
break;
|
|
28459
28489
|
// end elment
|
|
@@ -28472,8 +28502,8 @@ function parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){
|
|
|
28472
28502
|
//elStartEnd
|
|
28473
28503
|
var end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);
|
|
28474
28504
|
var len = el.length;
|
|
28475
|
-
|
|
28476
|
-
|
|
28505
|
+
|
|
28506
|
+
|
|
28477
28507
|
if(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){
|
|
28478
28508
|
el.closed = true;
|
|
28479
28509
|
if(!entityMap.nbsp){
|
|
@@ -28743,7 +28773,7 @@ function appendElement(el,domBuilder,currentNSMap){
|
|
|
28743
28773
|
}
|
|
28744
28774
|
//can not set prefix,because prefix !== ''
|
|
28745
28775
|
a.localName = localName ;
|
|
28746
|
-
//prefix == null for no ns prefix attribute
|
|
28776
|
+
//prefix == null for no ns prefix attribute
|
|
28747
28777
|
if(nsPrefix !== false){//hack!!
|
|
28748
28778
|
if(localNSMap == null){
|
|
28749
28779
|
localNSMap = {}
|
|
@@ -28753,7 +28783,7 @@ function appendElement(el,domBuilder,currentNSMap){
|
|
|
28753
28783
|
}
|
|
28754
28784
|
currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
|
|
28755
28785
|
a.uri = NAMESPACE.XMLNS
|
|
28756
|
-
domBuilder.startPrefixMapping(nsPrefix, value)
|
|
28786
|
+
domBuilder.startPrefixMapping(nsPrefix, value)
|
|
28757
28787
|
}
|
|
28758
28788
|
}
|
|
28759
28789
|
var i = el.length;
|
|
@@ -28765,7 +28795,7 @@ function appendElement(el,domBuilder,currentNSMap){
|
|
|
28765
28795
|
a.uri = NAMESPACE.XML;
|
|
28766
28796
|
}if(prefix !== 'xmlns'){
|
|
28767
28797
|
a.uri = currentNSMap[prefix || '']
|
|
28768
|
-
|
|
28798
|
+
|
|
28769
28799
|
//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}
|
|
28770
28800
|
}
|
|
28771
28801
|
}
|
|
@@ -28787,7 +28817,7 @@ function appendElement(el,domBuilder,currentNSMap){
|
|
|
28787
28817
|
domBuilder.endElement(ns,localName,tagName);
|
|
28788
28818
|
if(localNSMap){
|
|
28789
28819
|
for(prefix in localNSMap){
|
|
28790
|
-
domBuilder.endPrefixMapping(prefix)
|
|
28820
|
+
domBuilder.endPrefixMapping(prefix)
|
|
28791
28821
|
}
|
|
28792
28822
|
}
|
|
28793
28823
|
}else{
|
|
@@ -28814,7 +28844,7 @@ function parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBui
|
|
|
28814
28844
|
domBuilder.characters(text,0,text.length);
|
|
28815
28845
|
return elEndStart;
|
|
28816
28846
|
//}
|
|
28817
|
-
|
|
28847
|
+
|
|
28818
28848
|
}
|
|
28819
28849
|
}
|
|
28820
28850
|
return elStartEnd+1;
|
|
@@ -28831,7 +28861,7 @@ function fixSelfClosed(source,elStartEnd,tagName,closeMap){
|
|
|
28831
28861
|
closeMap[tagName] =pos
|
|
28832
28862
|
}
|
|
28833
28863
|
return pos<elStartEnd;
|
|
28834
|
-
//}
|
|
28864
|
+
//}
|
|
28835
28865
|
}
|
|
28836
28866
|
function _copy(source,target){
|
|
28837
28867
|
for(var n in source){target[n] = source[n]}
|
|
@@ -28859,11 +28889,11 @@ function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
|
|
|
28859
28889
|
var end = source.indexOf(']]>',start+9);
|
|
28860
28890
|
domBuilder.startCDATA();
|
|
28861
28891
|
domBuilder.characters(source,start+9,end-start-9);
|
|
28862
|
-
domBuilder.endCDATA()
|
|
28892
|
+
domBuilder.endCDATA()
|
|
28863
28893
|
return end+3;
|
|
28864
28894
|
}
|
|
28865
28895
|
//<!DOCTYPE
|
|
28866
|
-
//startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
|
|
28896
|
+
//startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
|
|
28867
28897
|
var matchs = split(source,start);
|
|
28868
28898
|
var len = matchs.length;
|
|
28869
28899
|
if(len>1 && /!doctype/i.test(matchs[0][0])){
|
|
@@ -28881,7 +28911,7 @@ function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
|
|
|
28881
28911
|
var lastMatch = matchs[len-1]
|
|
28882
28912
|
domBuilder.startDTD(name, pubid, sysid);
|
|
28883
28913
|
domBuilder.endDTD();
|
|
28884
|
-
|
|
28914
|
+
|
|
28885
28915
|
return lastMatch.index+lastMatch[0].length
|
|
28886
28916
|
}
|
|
28887
28917
|
}
|
|
@@ -28930,7 +28960,7 @@ ElementAttributes.prototype = {
|
|
|
28930
28960
|
getValue:function(i){return this[i].value}
|
|
28931
28961
|
// ,getIndex:function(uri, localName)){
|
|
28932
28962
|
// if(localName){
|
|
28933
|
-
//
|
|
28963
|
+
//
|
|
28934
28964
|
// }else{
|
|
28935
28965
|
// var qName = uri
|
|
28936
28966
|
// }
|
|
@@ -30265,10 +30295,36 @@ var FN_ARGS = /^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/;
|
|
|
30265
30295
|
var ARROW_FN_ARGS = /^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/;
|
|
30266
30296
|
var FN_ARG_SPLIT = /,/;
|
|
30267
30297
|
var FN_ARG = /(=.+)?(\s*)$/;
|
|
30268
|
-
|
|
30298
|
+
|
|
30299
|
+
function stripComments(string) {
|
|
30300
|
+
let stripped = '';
|
|
30301
|
+
let index = 0;
|
|
30302
|
+
let endBlockComment = string.indexOf('*/');
|
|
30303
|
+
while (index < string.length) {
|
|
30304
|
+
if (string[index] === '/' && string[index+1] === '/') {
|
|
30305
|
+
// inline comment
|
|
30306
|
+
let endIndex = string.indexOf('\n', index);
|
|
30307
|
+
index = (endIndex === -1) ? string.length : endIndex;
|
|
30308
|
+
} else if ((endBlockComment !== -1) && (string[index] === '/') && (string[index+1] === '*')) {
|
|
30309
|
+
// block comment
|
|
30310
|
+
let endIndex = string.indexOf('*/', index);
|
|
30311
|
+
if (endIndex !== -1) {
|
|
30312
|
+
index = endIndex + 2;
|
|
30313
|
+
endBlockComment = string.indexOf('*/', index);
|
|
30314
|
+
} else {
|
|
30315
|
+
stripped += string[index];
|
|
30316
|
+
index++;
|
|
30317
|
+
}
|
|
30318
|
+
} else {
|
|
30319
|
+
stripped += string[index];
|
|
30320
|
+
index++;
|
|
30321
|
+
}
|
|
30322
|
+
}
|
|
30323
|
+
return stripped;
|
|
30324
|
+
}
|
|
30269
30325
|
|
|
30270
30326
|
function parseParams(func) {
|
|
30271
|
-
const src = func.toString()
|
|
30327
|
+
const src = stripComments(func.toString());
|
|
30272
30328
|
let match = src.match(FN_ARGS);
|
|
30273
30329
|
if (!match) {
|
|
30274
30330
|
match = src.match(ARROW_FN_ARGS);
|
|
@@ -31025,7 +31081,7 @@ var reduce$1 = awaitify(reduce, 4);
|
|
|
31025
31081
|
* app.get('/cats', function(request, response) {
|
|
31026
31082
|
* var User = request.models.User;
|
|
31027
31083
|
* async.seq(
|
|
31028
|
-
*
|
|
31084
|
+
* User.get.bind(User), // 'User.get' has signature (id, callback(err, data))
|
|
31029
31085
|
* function(user, fn) {
|
|
31030
31086
|
* user.getCats(fn); // 'getCats' has signature (callback(err, data))
|
|
31031
31087
|
* }
|
|
@@ -32659,6 +32715,8 @@ function memoize(fn, hasher = v => v) {
|
|
|
32659
32715
|
return memoized;
|
|
32660
32716
|
}
|
|
32661
32717
|
|
|
32718
|
+
/* istanbul ignore file */
|
|
32719
|
+
|
|
32662
32720
|
/**
|
|
32663
32721
|
* Calls `callback` on a later loop around the event loop. In Node.js this just
|
|
32664
32722
|
* calls `process.nextTick`. In the browser it will use `setImmediate` if
|
|
@@ -35175,7 +35233,7 @@ function fromByteArray (uint8) {
|
|
|
35175
35233
|
|
|
35176
35234
|
var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js")
|
|
35177
35235
|
var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js")
|
|
35178
|
-
var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
|
|
35236
|
+
var isArray = __webpack_require__(/*! isarray */ "./node_modules/buffer/node_modules/isarray/index.js")
|
|
35179
35237
|
|
|
35180
35238
|
exports.Buffer = Buffer
|
|
35181
35239
|
exports.SlowBuffer = SlowBuffer
|
|
@@ -36955,6 +37013,22 @@ function isnan (val) {
|
|
|
36955
37013
|
|
|
36956
37014
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
|
|
36957
37015
|
|
|
37016
|
+
/***/ }),
|
|
37017
|
+
|
|
37018
|
+
/***/ "./node_modules/buffer/node_modules/isarray/index.js":
|
|
37019
|
+
/*!***********************************************************!*\
|
|
37020
|
+
!*** ./node_modules/buffer/node_modules/isarray/index.js ***!
|
|
37021
|
+
\***********************************************************/
|
|
37022
|
+
/*! no static exports found */
|
|
37023
|
+
/***/ (function(module, exports) {
|
|
37024
|
+
|
|
37025
|
+
var toString = {}.toString;
|
|
37026
|
+
|
|
37027
|
+
module.exports = Array.isArray || function (arr) {
|
|
37028
|
+
return toString.call(arr) == '[object Array]';
|
|
37029
|
+
};
|
|
37030
|
+
|
|
37031
|
+
|
|
36958
37032
|
/***/ }),
|
|
36959
37033
|
|
|
36960
37034
|
/***/ "./node_modules/canonicalize/lib/canonicalize.js":
|
|
@@ -37541,7 +37615,7 @@ var irrelevant = (function (exports) {
|
|
|
37541
37615
|
|
|
37542
37616
|
return exports;
|
|
37543
37617
|
|
|
37544
|
-
}({})
|
|
37618
|
+
})({});
|
|
37545
37619
|
})(__self__);
|
|
37546
37620
|
__self__.fetch.ponyfill = true;
|
|
37547
37621
|
// Remove "polyfill" property added by whatwg-fetch
|
|
@@ -38991,29 +39065,13 @@ var isBrowser = (typeof window === "undefined" ? "undefined" : _typeof(window))
|
|
|
38991
39065
|
/* harmony default export */ __webpack_exports__["default"] = (isBrowser);
|
|
38992
39066
|
|
|
38993
39067
|
|
|
38994
|
-
/***/ }),
|
|
38995
|
-
|
|
38996
|
-
/***/ "./node_modules/isarray/index.js":
|
|
38997
|
-
/*!***************************************!*\
|
|
38998
|
-
!*** ./node_modules/isarray/index.js ***!
|
|
38999
|
-
\***************************************/
|
|
39000
|
-
/*! no static exports found */
|
|
39001
|
-
/***/ (function(module, exports) {
|
|
39002
|
-
|
|
39003
|
-
var toString = {}.toString;
|
|
39004
|
-
|
|
39005
|
-
module.exports = Array.isArray || function (arr) {
|
|
39006
|
-
return toString.call(arr) == '[object Array]';
|
|
39007
|
-
};
|
|
39008
|
-
|
|
39009
|
-
|
|
39010
39068
|
/***/ }),
|
|
39011
39069
|
|
|
39012
39070
|
/***/ "./node_modules/jose/dist/browser/index.js":
|
|
39013
39071
|
/*!*************************************************!*\
|
|
39014
39072
|
!*** ./node_modules/jose/dist/browser/index.js ***!
|
|
39015
39073
|
\*************************************************/
|
|
39016
|
-
/*! exports provided: compactDecrypt, flattenedDecrypt, generalDecrypt, GeneralEncrypt, compactVerify, flattenedVerify, generalVerify, jwtVerify, jwtDecrypt, CompactEncrypt, FlattenedEncrypt, CompactSign, FlattenedSign, GeneralSign, SignJWT, EncryptJWT, calculateJwkThumbprint, EmbeddedJWK, createRemoteJWKSet, UnsecuredJWT, exportPKCS8, exportSPKI, exportJWK, importSPKI, importPKCS8, importX509, importJWK, decodeProtectedHeader, errors, generateKeyPair, generateSecret, base64url */
|
|
39074
|
+
/*! exports provided: compactDecrypt, flattenedDecrypt, generalDecrypt, GeneralEncrypt, compactVerify, flattenedVerify, generalVerify, jwtVerify, jwtDecrypt, CompactEncrypt, FlattenedEncrypt, CompactSign, FlattenedSign, GeneralSign, SignJWT, EncryptJWT, calculateJwkThumbprint, EmbeddedJWK, createLocalJWKSet, createRemoteJWKSet, UnsecuredJWT, exportPKCS8, exportSPKI, exportJWK, importSPKI, importPKCS8, importX509, importJWK, decodeProtectedHeader, decodeJwt, errors, generateKeyPair, generateSecret, base64url */
|
|
39017
39075
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
39018
39076
|
|
|
39019
39077
|
"use strict";
|
|
@@ -39072,41 +39130,49 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
39072
39130
|
/* harmony import */ var _jwk_embedded_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./jwk/embedded.js */ "./node_modules/jose/dist/browser/jwk/embedded.js");
|
|
39073
39131
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "EmbeddedJWK", function() { return _jwk_embedded_js__WEBPACK_IMPORTED_MODULE_17__["EmbeddedJWK"]; });
|
|
39074
39132
|
|
|
39075
|
-
/* harmony import */ var
|
|
39076
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "
|
|
39133
|
+
/* harmony import */ var _jwks_local_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./jwks/local.js */ "./node_modules/jose/dist/browser/jwks/local.js");
|
|
39134
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createLocalJWKSet", function() { return _jwks_local_js__WEBPACK_IMPORTED_MODULE_18__["createLocalJWKSet"]; });
|
|
39135
|
+
|
|
39136
|
+
/* harmony import */ var _jwks_remote_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./jwks/remote.js */ "./node_modules/jose/dist/browser/jwks/remote.js");
|
|
39137
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createRemoteJWKSet", function() { return _jwks_remote_js__WEBPACK_IMPORTED_MODULE_19__["createRemoteJWKSet"]; });
|
|
39077
39138
|
|
|
39078
|
-
/* harmony import */ var
|
|
39079
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnsecuredJWT", function() { return
|
|
39139
|
+
/* harmony import */ var _jwt_unsecured_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./jwt/unsecured.js */ "./node_modules/jose/dist/browser/jwt/unsecured.js");
|
|
39140
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "UnsecuredJWT", function() { return _jwt_unsecured_js__WEBPACK_IMPORTED_MODULE_20__["UnsecuredJWT"]; });
|
|
39080
39141
|
|
|
39081
|
-
/* harmony import */ var
|
|
39082
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exportPKCS8", function() { return
|
|
39142
|
+
/* harmony import */ var _key_export_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./key/export.js */ "./node_modules/jose/dist/browser/key/export.js");
|
|
39143
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exportPKCS8", function() { return _key_export_js__WEBPACK_IMPORTED_MODULE_21__["exportPKCS8"]; });
|
|
39083
39144
|
|
|
39084
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exportSPKI", function() { return
|
|
39145
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exportSPKI", function() { return _key_export_js__WEBPACK_IMPORTED_MODULE_21__["exportSPKI"]; });
|
|
39085
39146
|
|
|
39086
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exportJWK", function() { return
|
|
39147
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "exportJWK", function() { return _key_export_js__WEBPACK_IMPORTED_MODULE_21__["exportJWK"]; });
|
|
39087
39148
|
|
|
39088
|
-
/* harmony import */ var
|
|
39089
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importSPKI", function() { return
|
|
39149
|
+
/* harmony import */ var _key_import_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./key/import.js */ "./node_modules/jose/dist/browser/key/import.js");
|
|
39150
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importSPKI", function() { return _key_import_js__WEBPACK_IMPORTED_MODULE_22__["importSPKI"]; });
|
|
39090
39151
|
|
|
39091
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importPKCS8", function() { return
|
|
39152
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importPKCS8", function() { return _key_import_js__WEBPACK_IMPORTED_MODULE_22__["importPKCS8"]; });
|
|
39092
39153
|
|
|
39093
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importX509", function() { return
|
|
39154
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importX509", function() { return _key_import_js__WEBPACK_IMPORTED_MODULE_22__["importX509"]; });
|
|
39094
39155
|
|
|
39095
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importJWK", function() { return
|
|
39156
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "importJWK", function() { return _key_import_js__WEBPACK_IMPORTED_MODULE_22__["importJWK"]; });
|
|
39096
39157
|
|
|
39097
|
-
/* harmony import */ var
|
|
39098
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "decodeProtectedHeader", function() { return
|
|
39158
|
+
/* harmony import */ var _util_decode_protected_header_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./util/decode_protected_header.js */ "./node_modules/jose/dist/browser/util/decode_protected_header.js");
|
|
39159
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "decodeProtectedHeader", function() { return _util_decode_protected_header_js__WEBPACK_IMPORTED_MODULE_23__["decodeProtectedHeader"]; });
|
|
39099
39160
|
|
|
39100
|
-
/* harmony import */ var
|
|
39101
|
-
/* harmony reexport (
|
|
39102
|
-
|
|
39103
|
-
/* harmony
|
|
39161
|
+
/* harmony import */ var _util_decode_jwt_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./util/decode_jwt.js */ "./node_modules/jose/dist/browser/util/decode_jwt.js");
|
|
39162
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "decodeJwt", function() { return _util_decode_jwt_js__WEBPACK_IMPORTED_MODULE_24__["decodeJwt"]; });
|
|
39163
|
+
|
|
39164
|
+
/* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
39165
|
+
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "errors", function() { return _util_errors_js__WEBPACK_IMPORTED_MODULE_25__; });
|
|
39166
|
+
/* harmony import */ var _key_generate_key_pair_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./key/generate_key_pair.js */ "./node_modules/jose/dist/browser/key/generate_key_pair.js");
|
|
39167
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generateKeyPair", function() { return _key_generate_key_pair_js__WEBPACK_IMPORTED_MODULE_26__["generateKeyPair"]; });
|
|
39168
|
+
|
|
39169
|
+
/* harmony import */ var _key_generate_secret_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./key/generate_secret.js */ "./node_modules/jose/dist/browser/key/generate_secret.js");
|
|
39170
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generateSecret", function() { return _key_generate_secret_js__WEBPACK_IMPORTED_MODULE_27__["generateSecret"]; });
|
|
39171
|
+
|
|
39172
|
+
/* harmony import */ var _util_base64url_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./util/base64url.js */ "./node_modules/jose/dist/browser/util/base64url.js");
|
|
39173
|
+
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "base64url", function() { return _util_base64url_js__WEBPACK_IMPORTED_MODULE_28__; });
|
|
39104
39174
|
|
|
39105
|
-
/* harmony import */ var _key_generate_secret_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./key/generate_secret.js */ "./node_modules/jose/dist/browser/key/generate_secret.js");
|
|
39106
|
-
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "generateSecret", function() { return _key_generate_secret_js__WEBPACK_IMPORTED_MODULE_25__["generateSecret"]; });
|
|
39107
39175
|
|
|
39108
|
-
/* harmony import */ var _util_base64url_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./util/base64url.js */ "./node_modules/jose/dist/browser/util/base64url.js");
|
|
39109
|
-
/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "base64url", function() { return _util_base64url_js__WEBPACK_IMPORTED_MODULE_26__; });
|
|
39110
39176
|
|
|
39111
39177
|
|
|
39112
39178
|
|
|
@@ -39921,26 +39987,26 @@ async function calculateJwkThumbprint(jwk, digestAlgorithm = 'sha256') {
|
|
|
39921
39987
|
|
|
39922
39988
|
/***/ }),
|
|
39923
39989
|
|
|
39924
|
-
/***/ "./node_modules/jose/dist/browser/jwks/
|
|
39925
|
-
|
|
39926
|
-
!*** ./node_modules/jose/dist/browser/jwks/
|
|
39927
|
-
|
|
39928
|
-
/*! exports provided:
|
|
39990
|
+
/***/ "./node_modules/jose/dist/browser/jwks/local.js":
|
|
39991
|
+
/*!******************************************************!*\
|
|
39992
|
+
!*** ./node_modules/jose/dist/browser/jwks/local.js ***!
|
|
39993
|
+
\******************************************************/
|
|
39994
|
+
/*! exports provided: isJWKSLike, LocalJWKSet, createLocalJWKSet */
|
|
39929
39995
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
39930
39996
|
|
|
39931
39997
|
"use strict";
|
|
39932
39998
|
__webpack_require__.r(__webpack_exports__);
|
|
39933
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
39934
|
-
/* harmony
|
|
39935
|
-
/* harmony
|
|
39936
|
-
/* harmony import */ var
|
|
39937
|
-
/* harmony import */ var
|
|
39938
|
-
|
|
39999
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isJWKSLike", function() { return isJWKSLike; });
|
|
40000
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LocalJWKSet", function() { return LocalJWKSet; });
|
|
40001
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLocalJWKSet", function() { return createLocalJWKSet; });
|
|
40002
|
+
/* harmony import */ var _key_import_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../key/import.js */ "./node_modules/jose/dist/browser/key/import.js");
|
|
40003
|
+
/* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
40004
|
+
/* harmony import */ var _lib_is_object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/is_object.js */ "./node_modules/jose/dist/browser/lib/is_object.js");
|
|
39939
40005
|
|
|
39940
40006
|
|
|
39941
40007
|
|
|
39942
40008
|
function getKtyFromAlg(alg) {
|
|
39943
|
-
switch (typeof alg === 'string' && alg.
|
|
40009
|
+
switch (typeof alg === 'string' && alg.slice(0, 2)) {
|
|
39944
40010
|
case 'RS':
|
|
39945
40011
|
case 'PS':
|
|
39946
40012
|
return 'RSA';
|
|
@@ -39949,46 +40015,41 @@ function getKtyFromAlg(alg) {
|
|
|
39949
40015
|
case 'Ed':
|
|
39950
40016
|
return 'OKP';
|
|
39951
40017
|
default:
|
|
39952
|
-
throw new
|
|
40018
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JOSENotSupported"]('Unsupported "alg" value for a JSON Web Key Set');
|
|
39953
40019
|
}
|
|
39954
40020
|
}
|
|
40021
|
+
function isJWKSLike(jwks) {
|
|
40022
|
+
return (jwks &&
|
|
40023
|
+
typeof jwks === 'object' &&
|
|
40024
|
+
Array.isArray(jwks.keys) &&
|
|
40025
|
+
jwks.keys.every(isJWKLike));
|
|
40026
|
+
}
|
|
39955
40027
|
function isJWKLike(key) {
|
|
39956
|
-
return Object(
|
|
40028
|
+
return Object(_lib_is_object_js__WEBPACK_IMPORTED_MODULE_2__["default"])(key);
|
|
39957
40029
|
}
|
|
39958
|
-
|
|
39959
|
-
|
|
39960
|
-
|
|
39961
|
-
if (!(url instanceof URL)) {
|
|
39962
|
-
throw new TypeError('url must be an instance of URL');
|
|
39963
|
-
}
|
|
39964
|
-
this._url = new URL(url.href);
|
|
39965
|
-
this._options = { agent: options === null || options === void 0 ? void 0 : options.agent };
|
|
39966
|
-
this._timeoutDuration =
|
|
39967
|
-
typeof (options === null || options === void 0 ? void 0 : options.timeoutDuration) === 'number' ? options === null || options === void 0 ? void 0 : options.timeoutDuration : 5000;
|
|
39968
|
-
this._cooldownDuration =
|
|
39969
|
-
typeof (options === null || options === void 0 ? void 0 : options.cooldownDuration) === 'number' ? options === null || options === void 0 ? void 0 : options.cooldownDuration : 30000;
|
|
40030
|
+
function clone(obj) {
|
|
40031
|
+
if (typeof structuredClone === 'function') {
|
|
40032
|
+
return structuredClone(obj);
|
|
39970
40033
|
}
|
|
39971
|
-
|
|
39972
|
-
|
|
39973
|
-
|
|
40034
|
+
return JSON.parse(JSON.stringify(obj));
|
|
40035
|
+
}
|
|
40036
|
+
class LocalJWKSet {
|
|
40037
|
+
constructor(jwks) {
|
|
40038
|
+
this._cached = new WeakMap();
|
|
40039
|
+
if (!isJWKSLike(jwks)) {
|
|
40040
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWKSInvalid"]('JSON Web Key Set malformed');
|
|
39974
40041
|
}
|
|
39975
|
-
|
|
40042
|
+
this._jwks = clone(jwks);
|
|
39976
40043
|
}
|
|
39977
40044
|
async getKey(protectedHeader, token) {
|
|
39978
|
-
const
|
|
39979
|
-
...protectedHeader,
|
|
39980
|
-
...token.header,
|
|
39981
|
-
};
|
|
39982
|
-
if (!this._jwks) {
|
|
39983
|
-
await this.reload();
|
|
39984
|
-
}
|
|
40045
|
+
const { alg, kid } = { ...protectedHeader, ...token.header };
|
|
39985
40046
|
const candidates = this._jwks.keys.filter((jwk) => {
|
|
39986
|
-
let candidate = jwk.kty === getKtyFromAlg(
|
|
39987
|
-
if (candidate && typeof
|
|
39988
|
-
candidate =
|
|
40047
|
+
let candidate = jwk.kty === getKtyFromAlg(alg);
|
|
40048
|
+
if (candidate && typeof kid === 'string') {
|
|
40049
|
+
candidate = kid === jwk.kid;
|
|
39989
40050
|
}
|
|
39990
40051
|
if (candidate && typeof jwk.alg === 'string') {
|
|
39991
|
-
candidate =
|
|
40052
|
+
candidate = alg === jwk.alg;
|
|
39992
40053
|
}
|
|
39993
40054
|
if (candidate && typeof jwk.use === 'string') {
|
|
39994
40055
|
candidate = jwk.use === 'sig';
|
|
@@ -39996,11 +40057,11 @@ class RemoteJWKSet {
|
|
|
39996
40057
|
if (candidate && Array.isArray(jwk.key_ops)) {
|
|
39997
40058
|
candidate = jwk.key_ops.includes('verify');
|
|
39998
40059
|
}
|
|
39999
|
-
if (candidate &&
|
|
40060
|
+
if (candidate && alg === 'EdDSA') {
|
|
40000
40061
|
candidate = jwk.crv === 'Ed25519' || jwk.crv === 'Ed448';
|
|
40001
40062
|
}
|
|
40002
40063
|
if (candidate) {
|
|
40003
|
-
switch (
|
|
40064
|
+
switch (alg) {
|
|
40004
40065
|
case 'ES256':
|
|
40005
40066
|
candidate = jwk.crv === 'P-256';
|
|
40006
40067
|
break;
|
|
@@ -40013,40 +40074,108 @@ class RemoteJWKSet {
|
|
|
40013
40074
|
case 'ES512':
|
|
40014
40075
|
candidate = jwk.crv === 'P-521';
|
|
40015
40076
|
break;
|
|
40016
|
-
default:
|
|
40017
40077
|
}
|
|
40018
40078
|
}
|
|
40019
40079
|
return candidate;
|
|
40020
40080
|
});
|
|
40021
40081
|
const { 0: jwk, length } = candidates;
|
|
40022
40082
|
if (length === 0) {
|
|
40023
|
-
|
|
40024
|
-
await this.reload();
|
|
40025
|
-
return this.getKey(protectedHeader, token);
|
|
40026
|
-
}
|
|
40027
|
-
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__["JWKSNoMatchingKey"]();
|
|
40083
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWKSNoMatchingKey"]();
|
|
40028
40084
|
}
|
|
40029
40085
|
else if (length !== 1) {
|
|
40030
|
-
throw new
|
|
40086
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWKSMultipleMatchingKeys"]();
|
|
40031
40087
|
}
|
|
40032
40088
|
const cached = this._cached.get(jwk) || this._cached.set(jwk, {}).get(jwk);
|
|
40033
|
-
if (cached[
|
|
40034
|
-
const keyObject = await Object(
|
|
40089
|
+
if (cached[alg] === undefined) {
|
|
40090
|
+
const keyObject = await Object(_key_import_js__WEBPACK_IMPORTED_MODULE_0__["importJWK"])({ ...jwk, ext: true }, alg);
|
|
40035
40091
|
if (keyObject instanceof Uint8Array || keyObject.type !== 'public') {
|
|
40036
|
-
throw new
|
|
40092
|
+
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JWKSInvalid"]('JSON Web Key Set members must be public keys');
|
|
40093
|
+
}
|
|
40094
|
+
cached[alg] = keyObject;
|
|
40095
|
+
}
|
|
40096
|
+
return cached[alg];
|
|
40097
|
+
}
|
|
40098
|
+
}
|
|
40099
|
+
function createLocalJWKSet(jwks) {
|
|
40100
|
+
return LocalJWKSet.prototype.getKey.bind(new LocalJWKSet(jwks));
|
|
40101
|
+
}
|
|
40102
|
+
|
|
40103
|
+
|
|
40104
|
+
/***/ }),
|
|
40105
|
+
|
|
40106
|
+
/***/ "./node_modules/jose/dist/browser/jwks/remote.js":
|
|
40107
|
+
/*!*******************************************************!*\
|
|
40108
|
+
!*** ./node_modules/jose/dist/browser/jwks/remote.js ***!
|
|
40109
|
+
\*******************************************************/
|
|
40110
|
+
/*! exports provided: createRemoteJWKSet */
|
|
40111
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
40112
|
+
|
|
40113
|
+
"use strict";
|
|
40114
|
+
__webpack_require__.r(__webpack_exports__);
|
|
40115
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createRemoteJWKSet", function() { return createRemoteJWKSet; });
|
|
40116
|
+
/* harmony import */ var _runtime_fetch_jwks_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../runtime/fetch_jwks.js */ "./node_modules/jose/dist/browser/runtime/fetch_jwks.js");
|
|
40117
|
+
/* harmony import */ var _runtime_env_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../runtime/env.js */ "./node_modules/jose/dist/browser/runtime/env.js");
|
|
40118
|
+
/* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
40119
|
+
/* harmony import */ var _local_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./local.js */ "./node_modules/jose/dist/browser/jwks/local.js");
|
|
40120
|
+
|
|
40121
|
+
|
|
40122
|
+
|
|
40123
|
+
|
|
40124
|
+
class RemoteJWKSet extends _local_js__WEBPACK_IMPORTED_MODULE_3__["LocalJWKSet"] {
|
|
40125
|
+
constructor(url, options) {
|
|
40126
|
+
super({ keys: [] });
|
|
40127
|
+
this._jwks = undefined;
|
|
40128
|
+
if (!(url instanceof URL)) {
|
|
40129
|
+
throw new TypeError('url must be an instance of URL');
|
|
40130
|
+
}
|
|
40131
|
+
this._url = new URL(url.href);
|
|
40132
|
+
this._options = { agent: options === null || options === void 0 ? void 0 : options.agent };
|
|
40133
|
+
this._timeoutDuration =
|
|
40134
|
+
typeof (options === null || options === void 0 ? void 0 : options.timeoutDuration) === 'number' ? options === null || options === void 0 ? void 0 : options.timeoutDuration : 5000;
|
|
40135
|
+
this._cooldownDuration =
|
|
40136
|
+
typeof (options === null || options === void 0 ? void 0 : options.cooldownDuration) === 'number' ? options === null || options === void 0 ? void 0 : options.cooldownDuration : 30000;
|
|
40137
|
+
}
|
|
40138
|
+
coolingDown() {
|
|
40139
|
+
if (!this._cooldownStarted) {
|
|
40140
|
+
return false;
|
|
40141
|
+
}
|
|
40142
|
+
return Date.now() < this._cooldownStarted + this._cooldownDuration;
|
|
40143
|
+
}
|
|
40144
|
+
async getKey(protectedHeader, token) {
|
|
40145
|
+
if (!this._jwks) {
|
|
40146
|
+
await this.reload();
|
|
40147
|
+
}
|
|
40148
|
+
try {
|
|
40149
|
+
return await super.getKey(protectedHeader, token);
|
|
40150
|
+
}
|
|
40151
|
+
catch (err) {
|
|
40152
|
+
if (err instanceof _util_errors_js__WEBPACK_IMPORTED_MODULE_2__["JWKSNoMatchingKey"]) {
|
|
40153
|
+
if (this.coolingDown() === false) {
|
|
40154
|
+
await this.reload();
|
|
40155
|
+
return super.getKey(protectedHeader, token);
|
|
40156
|
+
}
|
|
40037
40157
|
}
|
|
40038
|
-
|
|
40158
|
+
throw err;
|
|
40039
40159
|
}
|
|
40040
|
-
return cached[joseHeader.alg];
|
|
40041
40160
|
}
|
|
40042
40161
|
async reload() {
|
|
40162
|
+
if (this._pendingFetch && Object(_runtime_env_js__WEBPACK_IMPORTED_MODULE_1__["isCloudflareWorkers"])()) {
|
|
40163
|
+
return new Promise((resolve) => {
|
|
40164
|
+
const isDone = () => {
|
|
40165
|
+
if (this._pendingFetch === undefined) {
|
|
40166
|
+
resolve();
|
|
40167
|
+
}
|
|
40168
|
+
else {
|
|
40169
|
+
setTimeout(isDone, 5);
|
|
40170
|
+
}
|
|
40171
|
+
};
|
|
40172
|
+
isDone();
|
|
40173
|
+
});
|
|
40174
|
+
}
|
|
40043
40175
|
if (!this._pendingFetch) {
|
|
40044
40176
|
this._pendingFetch = Object(_runtime_fetch_jwks_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this._url, this._timeoutDuration, this._options)
|
|
40045
40177
|
.then((json) => {
|
|
40046
|
-
if (
|
|
40047
|
-
!json ||
|
|
40048
|
-
!Array.isArray(json.keys) ||
|
|
40049
|
-
!json.keys.every(isJWKLike)) {
|
|
40178
|
+
if (!Object(_local_js__WEBPACK_IMPORTED_MODULE_3__["isJWKSLike"])(json)) {
|
|
40050
40179
|
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_2__["JWKSInvalid"]('JSON Web Key Set malformed');
|
|
40051
40180
|
}
|
|
40052
40181
|
this._jwks = { keys: json.keys };
|
|
@@ -41041,13 +41170,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
41041
41170
|
|
|
41042
41171
|
|
|
41043
41172
|
async function wrap(alg, key, cek, iv) {
|
|
41044
|
-
const jweAlgorithm = alg.
|
|
41173
|
+
const jweAlgorithm = alg.slice(0, 7);
|
|
41045
41174
|
iv || (iv = Object(_iv_js__WEBPACK_IMPORTED_MODULE_2__["default"])(jweAlgorithm));
|
|
41046
41175
|
const { ciphertext: encryptedKey, tag } = await Object(_runtime_encrypt_js__WEBPACK_IMPORTED_MODULE_0__["default"])(jweAlgorithm, cek, key, iv, new Uint8Array(0));
|
|
41047
41176
|
return { encryptedKey, iv: Object(_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_3__["encode"])(iv), tag: Object(_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_3__["encode"])(tag) };
|
|
41048
41177
|
}
|
|
41049
41178
|
async function unwrap(alg, key, encryptedKey, iv, tag) {
|
|
41050
|
-
const jweAlgorithm = alg.
|
|
41179
|
+
const jweAlgorithm = alg.slice(0, 7);
|
|
41051
41180
|
return Object(_runtime_decrypt_js__WEBPACK_IMPORTED_MODULE_1__["default"])(jweAlgorithm, key, encryptedKey, iv, tag, new Uint8Array(0));
|
|
41052
41181
|
}
|
|
41053
41182
|
|
|
@@ -41291,7 +41420,7 @@ function isAlgorithm(algorithm, name) {
|
|
|
41291
41420
|
return algorithm.name === name;
|
|
41292
41421
|
}
|
|
41293
41422
|
function getHashLength(hash) {
|
|
41294
|
-
return parseInt(hash.name.
|
|
41423
|
+
return parseInt(hash.name.slice(4), 10);
|
|
41295
41424
|
}
|
|
41296
41425
|
function getNamedCurve(alg) {
|
|
41297
41426
|
switch (alg) {
|
|
@@ -41328,7 +41457,7 @@ function checkSigCryptoKey(key, alg, ...usages) {
|
|
|
41328
41457
|
case 'HS512': {
|
|
41329
41458
|
if (!isAlgorithm(key.algorithm, 'HMAC'))
|
|
41330
41459
|
throw unusable('HMAC');
|
|
41331
|
-
const expected = parseInt(alg.
|
|
41460
|
+
const expected = parseInt(alg.slice(2), 10);
|
|
41332
41461
|
const actual = getHashLength(key.algorithm.hash);
|
|
41333
41462
|
if (actual !== expected)
|
|
41334
41463
|
throw unusable(`SHA-${expected}`, 'algorithm.hash');
|
|
@@ -41339,7 +41468,7 @@ function checkSigCryptoKey(key, alg, ...usages) {
|
|
|
41339
41468
|
case 'RS512': {
|
|
41340
41469
|
if (!isAlgorithm(key.algorithm, 'RSASSA-PKCS1-v1_5'))
|
|
41341
41470
|
throw unusable('RSASSA-PKCS1-v1_5');
|
|
41342
|
-
const expected = parseInt(alg.
|
|
41471
|
+
const expected = parseInt(alg.slice(2), 10);
|
|
41343
41472
|
const actual = getHashLength(key.algorithm.hash);
|
|
41344
41473
|
if (actual !== expected)
|
|
41345
41474
|
throw unusable(`SHA-${expected}`, 'algorithm.hash');
|
|
@@ -41350,7 +41479,7 @@ function checkSigCryptoKey(key, alg, ...usages) {
|
|
|
41350
41479
|
case 'PS512': {
|
|
41351
41480
|
if (!isAlgorithm(key.algorithm, 'RSA-PSS'))
|
|
41352
41481
|
throw unusable('RSA-PSS');
|
|
41353
|
-
const expected = parseInt(alg.
|
|
41482
|
+
const expected = parseInt(alg.slice(2), 10);
|
|
41354
41483
|
const actual = getHashLength(key.algorithm.hash);
|
|
41355
41484
|
if (actual !== expected)
|
|
41356
41485
|
throw unusable(`SHA-${expected}`, 'algorithm.hash');
|
|
@@ -41389,7 +41518,7 @@ function checkEncCryptoKey(key, alg, ...usages) {
|
|
|
41389
41518
|
case 'A256GCM': {
|
|
41390
41519
|
if (!isAlgorithm(key.algorithm, 'AES-GCM'))
|
|
41391
41520
|
throw unusable('AES-GCM');
|
|
41392
|
-
const expected = parseInt(alg.
|
|
41521
|
+
const expected = parseInt(alg.slice(1, 4), 10);
|
|
41393
41522
|
const actual = key.algorithm.length;
|
|
41394
41523
|
if (actual !== expected)
|
|
41395
41524
|
throw unusable(expected, 'algorithm.length');
|
|
@@ -41400,7 +41529,7 @@ function checkEncCryptoKey(key, alg, ...usages) {
|
|
|
41400
41529
|
case 'A256KW': {
|
|
41401
41530
|
if (!isAlgorithm(key.algorithm, 'AES-KW'))
|
|
41402
41531
|
throw unusable('AES-KW');
|
|
41403
|
-
const expected = parseInt(alg.
|
|
41532
|
+
const expected = parseInt(alg.slice(1, 4), 10);
|
|
41404
41533
|
const actual = key.algorithm.length;
|
|
41405
41534
|
if (actual !== expected)
|
|
41406
41535
|
throw unusable(expected, 'algorithm.length');
|
|
@@ -41422,7 +41551,7 @@ function checkEncCryptoKey(key, alg, ...usages) {
|
|
|
41422
41551
|
case 'RSA-OAEP-512': {
|
|
41423
41552
|
if (!isAlgorithm(key.algorithm, 'RSA-OAEP'))
|
|
41424
41553
|
throw unusable('RSA-OAEP');
|
|
41425
|
-
const expected = parseInt(alg.
|
|
41554
|
+
const expected = parseInt(alg.slice(9), 10) || 1;
|
|
41426
41555
|
const actual = getHashLength(key.algorithm.hash);
|
|
41427
41556
|
if (actual !== expected)
|
|
41428
41557
|
throw unusable(`SHA-${expected}`, 'algorithm.hash');
|
|
@@ -41499,12 +41628,12 @@ async function decryptKeyManagement(alg, key, encryptedKey, joseHeader) {
|
|
|
41499
41628
|
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_5__["JWEInvalid"](`JOSE Header "apv" (Agreement PartyVInfo) invalid`);
|
|
41500
41629
|
partyVInfo = Object(_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_4__["decode"])(joseHeader.apv);
|
|
41501
41630
|
}
|
|
41502
|
-
const sharedSecret = await _runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["deriveKey"](epk, key, alg === 'ECDH-ES' ? joseHeader.enc : alg, alg === 'ECDH-ES' ? Object(_lib_cek_js__WEBPACK_IMPORTED_MODULE_6__["bitLength"])(joseHeader.enc) : parseInt(alg.
|
|
41631
|
+
const sharedSecret = await _runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["deriveKey"](epk, key, alg === 'ECDH-ES' ? joseHeader.enc : alg, alg === 'ECDH-ES' ? Object(_lib_cek_js__WEBPACK_IMPORTED_MODULE_6__["bitLength"])(joseHeader.enc) : parseInt(alg.slice(-5, -2), 10), partyUInfo, partyVInfo);
|
|
41503
41632
|
if (alg === 'ECDH-ES')
|
|
41504
41633
|
return sharedSecret;
|
|
41505
41634
|
if (encryptedKey === undefined)
|
|
41506
41635
|
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_5__["JWEInvalid"]('JWE Encrypted Key missing');
|
|
41507
|
-
return Object(_runtime_aeskw_js__WEBPACK_IMPORTED_MODULE_0__["unwrap"])(alg.
|
|
41636
|
+
return Object(_runtime_aeskw_js__WEBPACK_IMPORTED_MODULE_0__["unwrap"])(alg.slice(-6), sharedSecret, encryptedKey);
|
|
41508
41637
|
}
|
|
41509
41638
|
case 'RSA1_5':
|
|
41510
41639
|
case 'RSA-OAEP':
|
|
@@ -41604,10 +41733,12 @@ async function encryptKeyManagement(alg, enc, key, providedCek, providedParamete
|
|
|
41604
41733
|
}
|
|
41605
41734
|
const { apu, apv } = providedParameters;
|
|
41606
41735
|
let { epk: ephemeralKey } = providedParameters;
|
|
41607
|
-
ephemeralKey || (ephemeralKey = await _runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["generateEpk"](key));
|
|
41736
|
+
ephemeralKey || (ephemeralKey = (await _runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["generateEpk"](key)).privateKey);
|
|
41608
41737
|
const { x, y, crv, kty } = await Object(_key_export_js__WEBPACK_IMPORTED_MODULE_7__["exportJWK"])(ephemeralKey);
|
|
41609
|
-
const sharedSecret = await _runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["deriveKey"](key, ephemeralKey, alg === 'ECDH-ES' ? enc : alg, alg === 'ECDH-ES' ? Object(_lib_cek_js__WEBPACK_IMPORTED_MODULE_5__["bitLength"])(enc) : parseInt(alg.
|
|
41610
|
-
parameters = { epk: { x,
|
|
41738
|
+
const sharedSecret = await _runtime_ecdhes_js__WEBPACK_IMPORTED_MODULE_1__["deriveKey"](key, ephemeralKey, alg === 'ECDH-ES' ? enc : alg, alg === 'ECDH-ES' ? Object(_lib_cek_js__WEBPACK_IMPORTED_MODULE_5__["bitLength"])(enc) : parseInt(alg.slice(-5, -2), 10), apu, apv);
|
|
41739
|
+
parameters = { epk: { x, crv, kty } };
|
|
41740
|
+
if (kty === 'EC')
|
|
41741
|
+
parameters.epk.y = y;
|
|
41611
41742
|
if (apu)
|
|
41612
41743
|
parameters.apu = Object(_runtime_base64url_js__WEBPACK_IMPORTED_MODULE_4__["encode"])(apu);
|
|
41613
41744
|
if (apv)
|
|
@@ -41617,7 +41748,7 @@ async function encryptKeyManagement(alg, enc, key, providedCek, providedParamete
|
|
|
41617
41748
|
break;
|
|
41618
41749
|
}
|
|
41619
41750
|
cek = providedCek || Object(_lib_cek_js__WEBPACK_IMPORTED_MODULE_5__["default"])(enc);
|
|
41620
|
-
const kwAlg = alg.
|
|
41751
|
+
const kwAlg = alg.slice(-6);
|
|
41621
41752
|
encryptedKey = await Object(_runtime_aeskw_js__WEBPACK_IMPORTED_MODULE_0__["wrap"])(kwAlg, sharedSecret, cek);
|
|
41622
41753
|
break;
|
|
41623
41754
|
}
|
|
@@ -42099,7 +42230,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42099
42230
|
|
|
42100
42231
|
|
|
42101
42232
|
function checkKeySize(key, alg) {
|
|
42102
|
-
if (key.algorithm.length !== parseInt(alg.
|
|
42233
|
+
if (key.algorithm.length !== parseInt(alg.slice(1, 4), 10)) {
|
|
42103
42234
|
throw new TypeError(`Invalid key size for alg: ${alg}`);
|
|
42104
42235
|
}
|
|
42105
42236
|
}
|
|
@@ -42174,29 +42305,30 @@ const toSPKI = (key) => {
|
|
|
42174
42305
|
const toPKCS8 = (key) => {
|
|
42175
42306
|
return genericExport('private', 'pkcs8', key);
|
|
42176
42307
|
};
|
|
42308
|
+
const findOid = (keyData, oid, from = 0) => {
|
|
42309
|
+
if (from === 0) {
|
|
42310
|
+
oid.unshift(oid.length);
|
|
42311
|
+
oid.unshift(0x06);
|
|
42312
|
+
}
|
|
42313
|
+
let i = keyData.indexOf(oid[0], from);
|
|
42314
|
+
if (i === -1)
|
|
42315
|
+
return false;
|
|
42316
|
+
const sub = keyData.subarray(i, i + oid.length);
|
|
42317
|
+
if (sub.length !== oid.length)
|
|
42318
|
+
return false;
|
|
42319
|
+
return sub.every((value, index) => value === oid[index]) || findOid(keyData, oid, i + 1);
|
|
42320
|
+
};
|
|
42177
42321
|
const getNamedCurve = (keyData) => {
|
|
42178
|
-
const keyDataStr = keyData.toString();
|
|
42179
42322
|
switch (true) {
|
|
42180
|
-
case
|
|
42181
|
-
0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce,
|
|
42182
|
-
0x3d, 0x03, 0x01, 0x07,
|
|
42183
|
-
]).toString()):
|
|
42323
|
+
case findOid(keyData, [0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07]):
|
|
42184
42324
|
return 'P-256';
|
|
42185
|
-
case
|
|
42186
|
-
0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00,
|
|
42187
|
-
0x22,
|
|
42188
|
-
]).toString()):
|
|
42325
|
+
case findOid(keyData, [0x2b, 0x81, 0x04, 0x00, 0x22]):
|
|
42189
42326
|
return 'P-384';
|
|
42190
|
-
case
|
|
42191
|
-
0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00,
|
|
42192
|
-
0x23,
|
|
42193
|
-
]).toString()):
|
|
42327
|
+
case findOid(keyData, [0x2b, 0x81, 0x04, 0x00, 0x23]):
|
|
42194
42328
|
return 'P-521';
|
|
42195
|
-
case (Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isCloudflareWorkers"])() || Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isNodeJs"])()) &&
|
|
42196
|
-
keyDataStr.includes(new Uint8Array([0x06, 0x03, 0x2b, 0x65, 0x70]).toString()):
|
|
42329
|
+
case (Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isCloudflareWorkers"])() || Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isNodeJs"])()) && findOid(keyData, [0x2b, 0x65, 0x70]):
|
|
42197
42330
|
return 'Ed25519';
|
|
42198
|
-
case Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isNodeJs"])() &&
|
|
42199
|
-
keyDataStr.includes(new Uint8Array([0x06, 0x03, 0x2b, 0x65, 0x71]).toString()):
|
|
42331
|
+
case Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isNodeJs"])() && findOid(keyData, [0x2b, 0x65, 0x71]):
|
|
42200
42332
|
return 'Ed448';
|
|
42201
42333
|
default:
|
|
42202
42334
|
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_5__["JOSENotSupported"]('Invalid or unsupported EC Key Curve or OKP Key Sub Type');
|
|
@@ -42214,13 +42346,13 @@ const genericImport = async (replace, keyFormat, pem, alg, options) => {
|
|
|
42214
42346
|
case 'PS256':
|
|
42215
42347
|
case 'PS384':
|
|
42216
42348
|
case 'PS512':
|
|
42217
|
-
algorithm = { name: 'RSA-PSS', hash: `SHA-${alg.
|
|
42349
|
+
algorithm = { name: 'RSA-PSS', hash: `SHA-${alg.slice(-3)}` };
|
|
42218
42350
|
keyUsages = isPublic ? ['verify'] : ['sign'];
|
|
42219
42351
|
break;
|
|
42220
42352
|
case 'RS256':
|
|
42221
42353
|
case 'RS384':
|
|
42222
42354
|
case 'RS512':
|
|
42223
|
-
algorithm = { name: 'RSASSA-PKCS1-v1_5', hash: `SHA-${alg.
|
|
42355
|
+
algorithm = { name: 'RSASSA-PKCS1-v1_5', hash: `SHA-${alg.slice(-3)}` };
|
|
42224
42356
|
keyUsages = isPublic ? ['verify'] : ['sign'];
|
|
42225
42357
|
break;
|
|
42226
42358
|
case 'RSA-OAEP':
|
|
@@ -42229,7 +42361,7 @@ const genericImport = async (replace, keyFormat, pem, alg, options) => {
|
|
|
42229
42361
|
case 'RSA-OAEP-512':
|
|
42230
42362
|
algorithm = {
|
|
42231
42363
|
name: 'RSA-OAEP',
|
|
42232
|
-
hash: `SHA-${parseInt(alg.
|
|
42364
|
+
hash: `SHA-${parseInt(alg.slice(-3), 10) || 1}`,
|
|
42233
42365
|
};
|
|
42234
42366
|
keyUsages = isPublic ? ['encrypt', 'wrapKey'] : ['decrypt', 'unwrapKey'];
|
|
42235
42367
|
break;
|
|
@@ -42416,7 +42548,7 @@ async function cbcDecrypt(enc, cek, ciphertext, iv, tag, aad) {
|
|
|
42416
42548
|
if (!(cek instanceof Uint8Array)) {
|
|
42417
42549
|
throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_7__["default"])(cek, 'Uint8Array'));
|
|
42418
42550
|
}
|
|
42419
|
-
const keySize = parseInt(enc.
|
|
42551
|
+
const keySize = parseInt(enc.slice(1, 4), 10);
|
|
42420
42552
|
const encKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_5__["default"].subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, ['decrypt']);
|
|
42421
42553
|
const macKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_5__["default"].subtle.importKey('raw', cek.subarray(0, keySize >> 3), {
|
|
42422
42554
|
hash: `SHA-${keySize << 1}`,
|
|
@@ -42475,13 +42607,13 @@ const decrypt = async (enc, cek, ciphertext, iv, tag, aad) => {
|
|
|
42475
42607
|
case 'A192CBC-HS384':
|
|
42476
42608
|
case 'A256CBC-HS512':
|
|
42477
42609
|
if (cek instanceof Uint8Array)
|
|
42478
|
-
Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.
|
|
42610
|
+
Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.slice(-3), 10));
|
|
42479
42611
|
return cbcDecrypt(enc, cek, ciphertext, iv, tag, aad);
|
|
42480
42612
|
case 'A128GCM':
|
|
42481
42613
|
case 'A192GCM':
|
|
42482
42614
|
case 'A256GCM':
|
|
42483
42615
|
if (cek instanceof Uint8Array)
|
|
42484
|
-
Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.
|
|
42616
|
+
Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.slice(1, 4), 10));
|
|
42485
42617
|
return gcmDecrypt(enc, cek, ciphertext, iv, tag, aad);
|
|
42486
42618
|
default:
|
|
42487
42619
|
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_4__["JOSENotSupported"]('Unsupported JWE Content Encryption Algorithm');
|
|
@@ -42504,7 +42636,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42504
42636
|
/* harmony import */ var _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./webcrypto.js */ "./node_modules/jose/dist/browser/runtime/webcrypto.js");
|
|
42505
42637
|
|
|
42506
42638
|
const digest = async (algorithm, data) => {
|
|
42507
|
-
const subtleDigest = `SHA-${algorithm.
|
|
42639
|
+
const subtleDigest = `SHA-${algorithm.slice(-3)}`;
|
|
42508
42640
|
return new Uint8Array(await _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__["default"].subtle.digest(subtleDigest, data));
|
|
42509
42641
|
};
|
|
42510
42642
|
/* harmony default export */ __webpack_exports__["default"] = (digest);
|
|
@@ -42536,7 +42668,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42536
42668
|
|
|
42537
42669
|
|
|
42538
42670
|
|
|
42539
|
-
|
|
42671
|
+
async function deriveKey(publicKey, privateKey, algorithm, keyLength, apu = new Uint8Array(0), apv = new Uint8Array(0)) {
|
|
42540
42672
|
if (!Object(_webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["isCryptoKey"])(publicKey)) {
|
|
42541
42673
|
throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_4__["default"])(publicKey, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_5__["types"]));
|
|
42542
42674
|
}
|
|
@@ -42552,22 +42684,21 @@ const deriveKey = async (publicKey, privateKey, algorithm, keyLength, apu = new
|
|
|
42552
42684
|
const sharedSecret = new Uint8Array(await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.deriveBits({
|
|
42553
42685
|
name: 'ECDH',
|
|
42554
42686
|
public: publicKey,
|
|
42555
|
-
}, privateKey, Math.ceil(parseInt(privateKey.algorithm.namedCurve.
|
|
42556
|
-
3));
|
|
42687
|
+
}, privateKey, Math.ceil(parseInt(privateKey.algorithm.namedCurve.slice(-3), 10) / 8) << 3));
|
|
42557
42688
|
return Object(_lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_0__["concatKdf"])(_digest_js__WEBPACK_IMPORTED_MODULE_3__["default"], sharedSecret, keyLength, value);
|
|
42558
|
-
}
|
|
42559
|
-
|
|
42689
|
+
}
|
|
42690
|
+
async function generateEpk(key) {
|
|
42560
42691
|
if (!Object(_webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["isCryptoKey"])(key)) {
|
|
42561
42692
|
throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_4__["default"])(key, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_5__["types"]));
|
|
42562
42693
|
}
|
|
42563
|
-
return
|
|
42564
|
-
}
|
|
42565
|
-
|
|
42694
|
+
return _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.generateKey(key.algorithm, true, ['deriveBits']);
|
|
42695
|
+
}
|
|
42696
|
+
function ecdhAllowed(key) {
|
|
42566
42697
|
if (!Object(_webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["isCryptoKey"])(key)) {
|
|
42567
42698
|
throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_4__["default"])(key, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_5__["types"]));
|
|
42568
42699
|
}
|
|
42569
42700
|
return ['P-256', 'P-384', 'P-521'].includes(key.algorithm.namedCurve);
|
|
42570
|
-
}
|
|
42701
|
+
}
|
|
42571
42702
|
|
|
42572
42703
|
|
|
42573
42704
|
/***/ }),
|
|
@@ -42601,7 +42732,7 @@ async function cbcEncrypt(enc, plaintext, cek, iv, aad) {
|
|
|
42601
42732
|
if (!(cek instanceof Uint8Array)) {
|
|
42602
42733
|
throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_5__["default"])(cek, 'Uint8Array'));
|
|
42603
42734
|
}
|
|
42604
|
-
const keySize = parseInt(enc.
|
|
42735
|
+
const keySize = parseInt(enc.slice(1, 4), 10);
|
|
42605
42736
|
const encKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_3__["default"].subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, ['encrypt']);
|
|
42606
42737
|
const macKey = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_3__["default"].subtle.importKey('raw', cek.subarray(0, keySize >> 3), {
|
|
42607
42738
|
hash: `SHA-${keySize << 1}`,
|
|
@@ -42644,13 +42775,13 @@ const encrypt = async (enc, plaintext, cek, iv, aad) => {
|
|
|
42644
42775
|
case 'A192CBC-HS384':
|
|
42645
42776
|
case 'A256CBC-HS512':
|
|
42646
42777
|
if (cek instanceof Uint8Array)
|
|
42647
|
-
Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.
|
|
42778
|
+
Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.slice(-3), 10));
|
|
42648
42779
|
return cbcEncrypt(enc, plaintext, cek, iv, aad);
|
|
42649
42780
|
case 'A128GCM':
|
|
42650
42781
|
case 'A192GCM':
|
|
42651
42782
|
case 'A256GCM':
|
|
42652
42783
|
if (cek instanceof Uint8Array)
|
|
42653
|
-
Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.
|
|
42784
|
+
Object(_check_cek_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(cek, parseInt(enc.slice(1, 4), 10));
|
|
42654
42785
|
return gcmEncrypt(enc, plaintext, cek, iv, aad);
|
|
42655
42786
|
default:
|
|
42656
42787
|
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_6__["JOSENotSupported"]('Unsupported JWE Content Encryption Algorithm');
|
|
@@ -42773,19 +42904,19 @@ async function generateSecret(alg, options) {
|
|
|
42773
42904
|
case 'HS256':
|
|
42774
42905
|
case 'HS384':
|
|
42775
42906
|
case 'HS512':
|
|
42776
|
-
length = parseInt(alg.
|
|
42907
|
+
length = parseInt(alg.slice(-3), 10);
|
|
42777
42908
|
algorithm = { name: 'HMAC', hash: `SHA-${length}`, length };
|
|
42778
42909
|
keyUsages = ['sign', 'verify'];
|
|
42779
42910
|
break;
|
|
42780
42911
|
case 'A128CBC-HS256':
|
|
42781
42912
|
case 'A192CBC-HS384':
|
|
42782
42913
|
case 'A256CBC-HS512':
|
|
42783
|
-
length = parseInt(alg.
|
|
42914
|
+
length = parseInt(alg.slice(-3), 10);
|
|
42784
42915
|
return Object(_random_js__WEBPACK_IMPORTED_MODULE_3__["default"])(new Uint8Array(length >> 3));
|
|
42785
42916
|
case 'A128KW':
|
|
42786
42917
|
case 'A192KW':
|
|
42787
42918
|
case 'A256KW':
|
|
42788
|
-
length = parseInt(alg.
|
|
42919
|
+
length = parseInt(alg.slice(1, 4), 10);
|
|
42789
42920
|
algorithm = { name: 'AES-KW', length };
|
|
42790
42921
|
keyUsages = ['wrapKey', 'unwrapKey'];
|
|
42791
42922
|
break;
|
|
@@ -42795,7 +42926,7 @@ async function generateSecret(alg, options) {
|
|
|
42795
42926
|
case 'A128GCM':
|
|
42796
42927
|
case 'A192GCM':
|
|
42797
42928
|
case 'A256GCM':
|
|
42798
|
-
length = parseInt(alg.
|
|
42929
|
+
length = parseInt(alg.slice(1, 4), 10);
|
|
42799
42930
|
algorithm = { name: 'AES-GCM', length };
|
|
42800
42931
|
keyUsages = ['encrypt', 'decrypt'];
|
|
42801
42932
|
break;
|
|
@@ -42822,7 +42953,7 @@ async function generateKeyPair(alg, options) {
|
|
|
42822
42953
|
case 'PS512':
|
|
42823
42954
|
algorithm = {
|
|
42824
42955
|
name: 'RSA-PSS',
|
|
42825
|
-
hash: `SHA-${alg.
|
|
42956
|
+
hash: `SHA-${alg.slice(-3)}`,
|
|
42826
42957
|
publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
|
|
42827
42958
|
modulusLength: getModulusLengthOption(options),
|
|
42828
42959
|
};
|
|
@@ -42833,7 +42964,7 @@ async function generateKeyPair(alg, options) {
|
|
|
42833
42964
|
case 'RS512':
|
|
42834
42965
|
algorithm = {
|
|
42835
42966
|
name: 'RSASSA-PKCS1-v1_5',
|
|
42836
|
-
hash: `SHA-${alg.
|
|
42967
|
+
hash: `SHA-${alg.slice(-3)}`,
|
|
42837
42968
|
publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
|
|
42838
42969
|
modulusLength: getModulusLengthOption(options),
|
|
42839
42970
|
};
|
|
@@ -42845,7 +42976,7 @@ async function generateKeyPair(alg, options) {
|
|
|
42845
42976
|
case 'RSA-OAEP-512':
|
|
42846
42977
|
algorithm = {
|
|
42847
42978
|
name: 'RSA-OAEP',
|
|
42848
|
-
hash: `SHA-${parseInt(alg.
|
|
42979
|
+
hash: `SHA-${parseInt(alg.slice(-3), 10) || 1}`,
|
|
42849
42980
|
publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
|
|
42850
42981
|
modulusLength: getModulusLengthOption(options),
|
|
42851
42982
|
};
|
|
@@ -42921,7 +43052,7 @@ function getCryptoKey(alg, key, usage) {
|
|
|
42921
43052
|
if (!alg.startsWith('HS')) {
|
|
42922
43053
|
throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_2__["default"])(key, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_3__["types"]));
|
|
42923
43054
|
}
|
|
42924
|
-
return _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__["default"].subtle.importKey('raw', key, { hash: `SHA-${alg.
|
|
43055
|
+
return _webcrypto_js__WEBPACK_IMPORTED_MODULE_0__["default"].subtle.importKey('raw', key, { hash: `SHA-${alg.slice(-3)}`, name: 'HMAC' }, false, [usage]);
|
|
42925
43056
|
}
|
|
42926
43057
|
throw new TypeError(Object(_lib_invalid_key_input_js__WEBPACK_IMPORTED_MODULE_2__["default"])(key, ..._is_key_like_js__WEBPACK_IMPORTED_MODULE_3__["types"], 'Uint8Array'));
|
|
42927
43058
|
}
|
|
@@ -42975,7 +43106,7 @@ function subtleMapping(jwk) {
|
|
|
42975
43106
|
case 'HS256':
|
|
42976
43107
|
case 'HS384':
|
|
42977
43108
|
case 'HS512':
|
|
42978
|
-
algorithm = { name: 'HMAC', hash: `SHA-${jwk.alg.
|
|
43109
|
+
algorithm = { name: 'HMAC', hash: `SHA-${jwk.alg.slice(-3)}` };
|
|
42979
43110
|
keyUsages = ['sign', 'verify'];
|
|
42980
43111
|
break;
|
|
42981
43112
|
case 'A128CBC-HS256':
|
|
@@ -43013,13 +43144,13 @@ function subtleMapping(jwk) {
|
|
|
43013
43144
|
case 'PS256':
|
|
43014
43145
|
case 'PS384':
|
|
43015
43146
|
case 'PS512':
|
|
43016
|
-
algorithm = { name: 'RSA-PSS', hash: `SHA-${jwk.alg.
|
|
43147
|
+
algorithm = { name: 'RSA-PSS', hash: `SHA-${jwk.alg.slice(-3)}` };
|
|
43017
43148
|
keyUsages = jwk.d ? ['sign'] : ['verify'];
|
|
43018
43149
|
break;
|
|
43019
43150
|
case 'RS256':
|
|
43020
43151
|
case 'RS384':
|
|
43021
43152
|
case 'RS512':
|
|
43022
|
-
algorithm = { name: 'RSASSA-PKCS1-v1_5', hash: `SHA-${jwk.alg.
|
|
43153
|
+
algorithm = { name: 'RSASSA-PKCS1-v1_5', hash: `SHA-${jwk.alg.slice(-3)}` };
|
|
43023
43154
|
keyUsages = jwk.d ? ['sign'] : ['verify'];
|
|
43024
43155
|
break;
|
|
43025
43156
|
case 'RSA-OAEP':
|
|
@@ -43028,7 +43159,7 @@ function subtleMapping(jwk) {
|
|
|
43028
43159
|
case 'RSA-OAEP-512':
|
|
43029
43160
|
algorithm = {
|
|
43030
43161
|
name: 'RSA-OAEP',
|
|
43031
|
-
hash: `SHA-${parseInt(jwk.alg.
|
|
43162
|
+
hash: `SHA-${parseInt(jwk.alg.slice(-3), 10) || 1}`,
|
|
43032
43163
|
};
|
|
43033
43164
|
keyUsages = jwk.d ? ['decrypt', 'unwrapKey'] : ['encrypt', 'wrapKey'];
|
|
43034
43165
|
break;
|
|
@@ -43185,9 +43316,9 @@ function getCryptoKey(key, alg) {
|
|
|
43185
43316
|
async function deriveKey(p2s, alg, p2c, key) {
|
|
43186
43317
|
Object(_lib_check_p2s_js__WEBPACK_IMPORTED_MODULE_4__["default"])(p2s);
|
|
43187
43318
|
const salt = Object(_lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_1__["p2s"])(alg, p2s);
|
|
43188
|
-
const keylen = parseInt(alg.
|
|
43319
|
+
const keylen = parseInt(alg.slice(13, 16), 10);
|
|
43189
43320
|
const subtleAlg = {
|
|
43190
|
-
hash: `SHA-${alg.
|
|
43321
|
+
hash: `SHA-${alg.slice(8, 11)}`,
|
|
43191
43322
|
iterations: p2c,
|
|
43192
43323
|
name: 'PBKDF2',
|
|
43193
43324
|
salt,
|
|
@@ -43207,12 +43338,12 @@ async function deriveKey(p2s, alg, p2c, key) {
|
|
|
43207
43338
|
}
|
|
43208
43339
|
const encrypt = async (alg, key, cek, p2c = Math.floor(Math.random() * 2049) + 2048, p2s = Object(_random_js__WEBPACK_IMPORTED_MODULE_0__["default"])(new Uint8Array(16))) => {
|
|
43209
43340
|
const derived = await deriveKey(p2s, alg, p2c, key);
|
|
43210
|
-
const encryptedKey = await Object(_aeskw_js__WEBPACK_IMPORTED_MODULE_3__["wrap"])(alg.
|
|
43341
|
+
const encryptedKey = await Object(_aeskw_js__WEBPACK_IMPORTED_MODULE_3__["wrap"])(alg.slice(-6), derived, cek);
|
|
43211
43342
|
return { encryptedKey, p2c, p2s: Object(_base64url_js__WEBPACK_IMPORTED_MODULE_2__["encode"])(p2s) };
|
|
43212
43343
|
};
|
|
43213
43344
|
const decrypt = async (alg, key, encryptedKey, p2c, p2s) => {
|
|
43214
43345
|
const derived = await deriveKey(p2s, alg, p2c, key);
|
|
43215
|
-
return Object(_aeskw_js__WEBPACK_IMPORTED_MODULE_3__["unwrap"])(alg.
|
|
43346
|
+
return Object(_aeskw_js__WEBPACK_IMPORTED_MODULE_3__["unwrap"])(alg.slice(-6), derived, encryptedKey);
|
|
43216
43347
|
};
|
|
43217
43348
|
|
|
43218
43349
|
|
|
@@ -43313,7 +43444,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43313
43444
|
const sign = async (alg, key, data) => {
|
|
43314
43445
|
const cryptoKey = await Object(_get_sign_verify_key_js__WEBPACK_IMPORTED_MODULE_3__["default"])(alg, key, 'sign');
|
|
43315
43446
|
Object(_check_key_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(alg, cryptoKey);
|
|
43316
|
-
const signature = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.sign(Object(_subtle_dsa_js__WEBPACK_IMPORTED_MODULE_0__["default"])(alg, cryptoKey.algorithm
|
|
43447
|
+
const signature = await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.sign(Object(_subtle_dsa_js__WEBPACK_IMPORTED_MODULE_0__["default"])(alg, cryptoKey.algorithm), cryptoKey, data);
|
|
43317
43448
|
return new Uint8Array(signature);
|
|
43318
43449
|
};
|
|
43319
43450
|
/* harmony default export */ __webpack_exports__["default"] = (sign);
|
|
@@ -43335,26 +43466,27 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43335
43466
|
/* harmony import */ var _util_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
43336
43467
|
|
|
43337
43468
|
|
|
43338
|
-
function subtleDsa(alg,
|
|
43339
|
-
const
|
|
43469
|
+
function subtleDsa(alg, algorithm) {
|
|
43470
|
+
const hash = `SHA-${alg.slice(-3)}`;
|
|
43340
43471
|
switch (alg) {
|
|
43341
43472
|
case 'HS256':
|
|
43342
43473
|
case 'HS384':
|
|
43343
43474
|
case 'HS512':
|
|
43344
|
-
return { hash
|
|
43475
|
+
return { hash, name: 'HMAC' };
|
|
43345
43476
|
case 'PS256':
|
|
43346
43477
|
case 'PS384':
|
|
43347
43478
|
case 'PS512':
|
|
43348
|
-
return { hash
|
|
43479
|
+
return { hash, name: 'RSA-PSS', saltLength: alg.slice(-3) >> 3 };
|
|
43349
43480
|
case 'RS256':
|
|
43350
43481
|
case 'RS384':
|
|
43351
43482
|
case 'RS512':
|
|
43352
|
-
return { hash
|
|
43483
|
+
return { hash, name: 'RSASSA-PKCS1-v1_5' };
|
|
43353
43484
|
case 'ES256':
|
|
43354
43485
|
case 'ES384':
|
|
43355
43486
|
case 'ES512':
|
|
43356
|
-
return { hash
|
|
43487
|
+
return { hash, name: 'ECDSA', namedCurve: algorithm.namedCurve };
|
|
43357
43488
|
case (Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isCloudflareWorkers"])() || Object(_env_js__WEBPACK_IMPORTED_MODULE_0__["isNodeJs"])()) && 'EdDSA':
|
|
43489
|
+
const { namedCurve } = algorithm;
|
|
43358
43490
|
return { name: namedCurve, namedCurve };
|
|
43359
43491
|
default:
|
|
43360
43492
|
throw new _util_errors_js__WEBPACK_IMPORTED_MODULE_1__["JOSENotSupported"](`alg ${alg} is not supported either by JOSE or your javascript runtime`);
|
|
@@ -43443,7 +43575,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43443
43575
|
const verify = async (alg, key, signature, data) => {
|
|
43444
43576
|
const cryptoKey = await Object(_get_sign_verify_key_js__WEBPACK_IMPORTED_MODULE_3__["default"])(alg, key, 'verify');
|
|
43445
43577
|
Object(_check_key_length_js__WEBPACK_IMPORTED_MODULE_2__["default"])(alg, cryptoKey);
|
|
43446
|
-
const algorithm = Object(_subtle_dsa_js__WEBPACK_IMPORTED_MODULE_0__["default"])(alg, cryptoKey.algorithm
|
|
43578
|
+
const algorithm = Object(_subtle_dsa_js__WEBPACK_IMPORTED_MODULE_0__["default"])(alg, cryptoKey.algorithm);
|
|
43447
43579
|
try {
|
|
43448
43580
|
return await _webcrypto_js__WEBPACK_IMPORTED_MODULE_1__["default"].subtle.verify(algorithm, cryptoKey, signature, data);
|
|
43449
43581
|
}
|
|
@@ -43522,6 +43654,56 @@ const encode = _runtime_base64url_js__WEBPACK_IMPORTED_MODULE_0__["encode"];
|
|
|
43522
43654
|
const decode = _runtime_base64url_js__WEBPACK_IMPORTED_MODULE_0__["decode"];
|
|
43523
43655
|
|
|
43524
43656
|
|
|
43657
|
+
/***/ }),
|
|
43658
|
+
|
|
43659
|
+
/***/ "./node_modules/jose/dist/browser/util/decode_jwt.js":
|
|
43660
|
+
/*!***********************************************************!*\
|
|
43661
|
+
!*** ./node_modules/jose/dist/browser/util/decode_jwt.js ***!
|
|
43662
|
+
\***********************************************************/
|
|
43663
|
+
/*! exports provided: decodeJwt */
|
|
43664
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
43665
|
+
|
|
43666
|
+
"use strict";
|
|
43667
|
+
__webpack_require__.r(__webpack_exports__);
|
|
43668
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeJwt", function() { return decodeJwt; });
|
|
43669
|
+
/* harmony import */ var _base64url_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base64url.js */ "./node_modules/jose/dist/browser/util/base64url.js");
|
|
43670
|
+
/* harmony import */ var _lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib/buffer_utils.js */ "./node_modules/jose/dist/browser/lib/buffer_utils.js");
|
|
43671
|
+
/* harmony import */ var _lib_is_object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/is_object.js */ "./node_modules/jose/dist/browser/lib/is_object.js");
|
|
43672
|
+
/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./errors.js */ "./node_modules/jose/dist/browser/util/errors.js");
|
|
43673
|
+
|
|
43674
|
+
|
|
43675
|
+
|
|
43676
|
+
|
|
43677
|
+
function decodeJwt(jwt) {
|
|
43678
|
+
if (typeof jwt !== 'string')
|
|
43679
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('JWTs must use Compact JWS serialization, JWT must be a string');
|
|
43680
|
+
const { 1: payload, length } = jwt.split('.');
|
|
43681
|
+
if (length === 5)
|
|
43682
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('Only JWTs using Compact JWS serialization can be decoded');
|
|
43683
|
+
if (length !== 3)
|
|
43684
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('Invalid JWT');
|
|
43685
|
+
if (!payload)
|
|
43686
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('JWTs must contain a payload');
|
|
43687
|
+
let decoded;
|
|
43688
|
+
try {
|
|
43689
|
+
decoded = Object(_base64url_js__WEBPACK_IMPORTED_MODULE_0__["decode"])(payload);
|
|
43690
|
+
}
|
|
43691
|
+
catch (_a) {
|
|
43692
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('Failed to parse the base64url encoded payload');
|
|
43693
|
+
}
|
|
43694
|
+
let result;
|
|
43695
|
+
try {
|
|
43696
|
+
result = JSON.parse(_lib_buffer_utils_js__WEBPACK_IMPORTED_MODULE_1__["decoder"].decode(decoded));
|
|
43697
|
+
}
|
|
43698
|
+
catch (_b) {
|
|
43699
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('Failed to parse the decoded payload as JSON');
|
|
43700
|
+
}
|
|
43701
|
+
if (!Object(_lib_is_object_js__WEBPACK_IMPORTED_MODULE_2__["default"])(result))
|
|
43702
|
+
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__["JWTInvalid"]('Invalid JWT Claims Set');
|
|
43703
|
+
return result;
|
|
43704
|
+
}
|
|
43705
|
+
|
|
43706
|
+
|
|
43525
43707
|
/***/ }),
|
|
43526
43708
|
|
|
43527
43709
|
/***/ "./node_modules/jose/dist/browser/util/decode_protected_header.js":
|
|
@@ -60258,7 +60440,7 @@ function escapeRegex(regex) {
|
|
|
60258
60440
|
/*!**************************************!*\
|
|
60259
60441
|
!*** ./node_modules/n3/src/index.js ***!
|
|
60260
60442
|
\**************************************/
|
|
60261
|
-
/*! exports provided: Lexer, Parser, Writer, Store, StreamParser, StreamWriter, Util, DataFactory, Term, NamedNode, Literal, BlankNode, Variable, DefaultGraph, Quad, Triple, termFromId, termToId */
|
|
60443
|
+
/*! exports provided: Lexer, Parser, Writer, Store, StreamParser, StreamWriter, Util, DataFactory, Term, NamedNode, Literal, BlankNode, Variable, DefaultGraph, Quad, Triple, termFromId, termToId, default */
|
|
60262
60444
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
60263
60445
|
|
|
60264
60446
|
"use strict";
|
|
@@ -60316,8 +60498,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
60316
60498
|
|
|
60317
60499
|
|
|
60318
60500
|
|
|
60501
|
+
// Named exports
|
|
60319
60502
|
|
|
60320
60503
|
|
|
60504
|
+
// Export all named exports as a default object for backward compatibility
|
|
60505
|
+
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
60506
|
+
Lexer: _N3Lexer__WEBPACK_IMPORTED_MODULE_0__["default"],
|
|
60507
|
+
Parser: _N3Parser__WEBPACK_IMPORTED_MODULE_1__["default"],
|
|
60508
|
+
Writer: _N3Writer__WEBPACK_IMPORTED_MODULE_2__["default"],
|
|
60509
|
+
Store: _N3Store__WEBPACK_IMPORTED_MODULE_3__["default"],
|
|
60510
|
+
StreamParser: _N3StreamParser__WEBPACK_IMPORTED_MODULE_4__["default"],
|
|
60511
|
+
StreamWriter: _N3StreamWriter__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
60512
|
+
Util: _N3Util__WEBPACK_IMPORTED_MODULE_6__,
|
|
60513
|
+
|
|
60514
|
+
DataFactory: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["default"],
|
|
60515
|
+
|
|
60516
|
+
Term: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["Term"],
|
|
60517
|
+
NamedNode: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["NamedNode"],
|
|
60518
|
+
Literal: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["Literal"],
|
|
60519
|
+
BlankNode: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["BlankNode"],
|
|
60520
|
+
Variable: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["Variable"],
|
|
60521
|
+
DefaultGraph: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["DefaultGraph"],
|
|
60522
|
+
Quad: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["Quad"],
|
|
60523
|
+
Triple: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["Triple"],
|
|
60524
|
+
|
|
60525
|
+
termFromId: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["termFromId"],
|
|
60526
|
+
termToId: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["termToId"],
|
|
60527
|
+
});
|
|
60528
|
+
|
|
60321
60529
|
|
|
60322
60530
|
/***/ }),
|
|
60323
60531
|
|
|
@@ -60635,6 +60843,313 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
|
60635
60843
|
|
|
60636
60844
|
/***/ }),
|
|
60637
60845
|
|
|
60846
|
+
/***/ "./node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js":
|
|
60847
|
+
/*!******************************************************************************************!*\
|
|
60848
|
+
!*** ./node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js ***!
|
|
60849
|
+
\******************************************************************************************/
|
|
60850
|
+
/*! no static exports found */
|
|
60851
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
60852
|
+
|
|
60853
|
+
"use strict";
|
|
60854
|
+
// Copyright Joyent, Inc. and other Node contributors.
|
|
60855
|
+
//
|
|
60856
|
+
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
60857
|
+
// copy of this software and associated documentation files (the
|
|
60858
|
+
// "Software"), to deal in the Software without restriction, including
|
|
60859
|
+
// without limitation the rights to use, copy, modify, merge, publish,
|
|
60860
|
+
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
60861
|
+
// persons to whom the Software is furnished to do so, subject to the
|
|
60862
|
+
// following conditions:
|
|
60863
|
+
//
|
|
60864
|
+
// The above copyright notice and this permission notice shall be included
|
|
60865
|
+
// in all copies or substantial portions of the Software.
|
|
60866
|
+
//
|
|
60867
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
60868
|
+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
60869
|
+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
60870
|
+
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
60871
|
+
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
60872
|
+
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
60873
|
+
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
60874
|
+
|
|
60875
|
+
|
|
60876
|
+
|
|
60877
|
+
/*<replacement>*/
|
|
60878
|
+
|
|
60879
|
+
var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer;
|
|
60880
|
+
/*</replacement>*/
|
|
60881
|
+
|
|
60882
|
+
var isEncoding = Buffer.isEncoding || function (encoding) {
|
|
60883
|
+
encoding = '' + encoding;
|
|
60884
|
+
switch (encoding && encoding.toLowerCase()) {
|
|
60885
|
+
case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
|
|
60886
|
+
return true;
|
|
60887
|
+
default:
|
|
60888
|
+
return false;
|
|
60889
|
+
}
|
|
60890
|
+
};
|
|
60891
|
+
|
|
60892
|
+
function _normalizeEncoding(enc) {
|
|
60893
|
+
if (!enc) return 'utf8';
|
|
60894
|
+
var retried;
|
|
60895
|
+
while (true) {
|
|
60896
|
+
switch (enc) {
|
|
60897
|
+
case 'utf8':
|
|
60898
|
+
case 'utf-8':
|
|
60899
|
+
return 'utf8';
|
|
60900
|
+
case 'ucs2':
|
|
60901
|
+
case 'ucs-2':
|
|
60902
|
+
case 'utf16le':
|
|
60903
|
+
case 'utf-16le':
|
|
60904
|
+
return 'utf16le';
|
|
60905
|
+
case 'latin1':
|
|
60906
|
+
case 'binary':
|
|
60907
|
+
return 'latin1';
|
|
60908
|
+
case 'base64':
|
|
60909
|
+
case 'ascii':
|
|
60910
|
+
case 'hex':
|
|
60911
|
+
return enc;
|
|
60912
|
+
default:
|
|
60913
|
+
if (retried) return; // undefined
|
|
60914
|
+
enc = ('' + enc).toLowerCase();
|
|
60915
|
+
retried = true;
|
|
60916
|
+
}
|
|
60917
|
+
}
|
|
60918
|
+
};
|
|
60919
|
+
|
|
60920
|
+
// Do not cache `Buffer.isEncoding` when checking encoding names as some
|
|
60921
|
+
// modules monkey-patch it to support additional encodings
|
|
60922
|
+
function normalizeEncoding(enc) {
|
|
60923
|
+
var nenc = _normalizeEncoding(enc);
|
|
60924
|
+
if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
|
|
60925
|
+
return nenc || enc;
|
|
60926
|
+
}
|
|
60927
|
+
|
|
60928
|
+
// StringDecoder provides an interface for efficiently splitting a series of
|
|
60929
|
+
// buffers into a series of JS strings without breaking apart multi-byte
|
|
60930
|
+
// characters.
|
|
60931
|
+
exports.StringDecoder = StringDecoder;
|
|
60932
|
+
function StringDecoder(encoding) {
|
|
60933
|
+
this.encoding = normalizeEncoding(encoding);
|
|
60934
|
+
var nb;
|
|
60935
|
+
switch (this.encoding) {
|
|
60936
|
+
case 'utf16le':
|
|
60937
|
+
this.text = utf16Text;
|
|
60938
|
+
this.end = utf16End;
|
|
60939
|
+
nb = 4;
|
|
60940
|
+
break;
|
|
60941
|
+
case 'utf8':
|
|
60942
|
+
this.fillLast = utf8FillLast;
|
|
60943
|
+
nb = 4;
|
|
60944
|
+
break;
|
|
60945
|
+
case 'base64':
|
|
60946
|
+
this.text = base64Text;
|
|
60947
|
+
this.end = base64End;
|
|
60948
|
+
nb = 3;
|
|
60949
|
+
break;
|
|
60950
|
+
default:
|
|
60951
|
+
this.write = simpleWrite;
|
|
60952
|
+
this.end = simpleEnd;
|
|
60953
|
+
return;
|
|
60954
|
+
}
|
|
60955
|
+
this.lastNeed = 0;
|
|
60956
|
+
this.lastTotal = 0;
|
|
60957
|
+
this.lastChar = Buffer.allocUnsafe(nb);
|
|
60958
|
+
}
|
|
60959
|
+
|
|
60960
|
+
StringDecoder.prototype.write = function (buf) {
|
|
60961
|
+
if (buf.length === 0) return '';
|
|
60962
|
+
var r;
|
|
60963
|
+
var i;
|
|
60964
|
+
if (this.lastNeed) {
|
|
60965
|
+
r = this.fillLast(buf);
|
|
60966
|
+
if (r === undefined) return '';
|
|
60967
|
+
i = this.lastNeed;
|
|
60968
|
+
this.lastNeed = 0;
|
|
60969
|
+
} else {
|
|
60970
|
+
i = 0;
|
|
60971
|
+
}
|
|
60972
|
+
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
|
|
60973
|
+
return r || '';
|
|
60974
|
+
};
|
|
60975
|
+
|
|
60976
|
+
StringDecoder.prototype.end = utf8End;
|
|
60977
|
+
|
|
60978
|
+
// Returns only complete characters in a Buffer
|
|
60979
|
+
StringDecoder.prototype.text = utf8Text;
|
|
60980
|
+
|
|
60981
|
+
// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
|
|
60982
|
+
StringDecoder.prototype.fillLast = function (buf) {
|
|
60983
|
+
if (this.lastNeed <= buf.length) {
|
|
60984
|
+
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
|
|
60985
|
+
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
60986
|
+
}
|
|
60987
|
+
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
|
|
60988
|
+
this.lastNeed -= buf.length;
|
|
60989
|
+
};
|
|
60990
|
+
|
|
60991
|
+
// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
|
|
60992
|
+
// continuation byte. If an invalid byte is detected, -2 is returned.
|
|
60993
|
+
function utf8CheckByte(byte) {
|
|
60994
|
+
if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
|
|
60995
|
+
return byte >> 6 === 0x02 ? -1 : -2;
|
|
60996
|
+
}
|
|
60997
|
+
|
|
60998
|
+
// Checks at most 3 bytes at the end of a Buffer in order to detect an
|
|
60999
|
+
// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
|
|
61000
|
+
// needed to complete the UTF-8 character (if applicable) are returned.
|
|
61001
|
+
function utf8CheckIncomplete(self, buf, i) {
|
|
61002
|
+
var j = buf.length - 1;
|
|
61003
|
+
if (j < i) return 0;
|
|
61004
|
+
var nb = utf8CheckByte(buf[j]);
|
|
61005
|
+
if (nb >= 0) {
|
|
61006
|
+
if (nb > 0) self.lastNeed = nb - 1;
|
|
61007
|
+
return nb;
|
|
61008
|
+
}
|
|
61009
|
+
if (--j < i || nb === -2) return 0;
|
|
61010
|
+
nb = utf8CheckByte(buf[j]);
|
|
61011
|
+
if (nb >= 0) {
|
|
61012
|
+
if (nb > 0) self.lastNeed = nb - 2;
|
|
61013
|
+
return nb;
|
|
61014
|
+
}
|
|
61015
|
+
if (--j < i || nb === -2) return 0;
|
|
61016
|
+
nb = utf8CheckByte(buf[j]);
|
|
61017
|
+
if (nb >= 0) {
|
|
61018
|
+
if (nb > 0) {
|
|
61019
|
+
if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
|
|
61020
|
+
}
|
|
61021
|
+
return nb;
|
|
61022
|
+
}
|
|
61023
|
+
return 0;
|
|
61024
|
+
}
|
|
61025
|
+
|
|
61026
|
+
// Validates as many continuation bytes for a multi-byte UTF-8 character as
|
|
61027
|
+
// needed or are available. If we see a non-continuation byte where we expect
|
|
61028
|
+
// one, we "replace" the validated continuation bytes we've seen so far with
|
|
61029
|
+
// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
|
|
61030
|
+
// behavior. The continuation byte check is included three times in the case
|
|
61031
|
+
// where all of the continuation bytes for a character exist in the same buffer.
|
|
61032
|
+
// It is also done this way as a slight performance increase instead of using a
|
|
61033
|
+
// loop.
|
|
61034
|
+
function utf8CheckExtraBytes(self, buf, p) {
|
|
61035
|
+
if ((buf[0] & 0xC0) !== 0x80) {
|
|
61036
|
+
self.lastNeed = 0;
|
|
61037
|
+
return '\ufffd';
|
|
61038
|
+
}
|
|
61039
|
+
if (self.lastNeed > 1 && buf.length > 1) {
|
|
61040
|
+
if ((buf[1] & 0xC0) !== 0x80) {
|
|
61041
|
+
self.lastNeed = 1;
|
|
61042
|
+
return '\ufffd';
|
|
61043
|
+
}
|
|
61044
|
+
if (self.lastNeed > 2 && buf.length > 2) {
|
|
61045
|
+
if ((buf[2] & 0xC0) !== 0x80) {
|
|
61046
|
+
self.lastNeed = 2;
|
|
61047
|
+
return '\ufffd';
|
|
61048
|
+
}
|
|
61049
|
+
}
|
|
61050
|
+
}
|
|
61051
|
+
}
|
|
61052
|
+
|
|
61053
|
+
// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
|
|
61054
|
+
function utf8FillLast(buf) {
|
|
61055
|
+
var p = this.lastTotal - this.lastNeed;
|
|
61056
|
+
var r = utf8CheckExtraBytes(this, buf, p);
|
|
61057
|
+
if (r !== undefined) return r;
|
|
61058
|
+
if (this.lastNeed <= buf.length) {
|
|
61059
|
+
buf.copy(this.lastChar, p, 0, this.lastNeed);
|
|
61060
|
+
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
61061
|
+
}
|
|
61062
|
+
buf.copy(this.lastChar, p, 0, buf.length);
|
|
61063
|
+
this.lastNeed -= buf.length;
|
|
61064
|
+
}
|
|
61065
|
+
|
|
61066
|
+
// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
|
|
61067
|
+
// partial character, the character's bytes are buffered until the required
|
|
61068
|
+
// number of bytes are available.
|
|
61069
|
+
function utf8Text(buf, i) {
|
|
61070
|
+
var total = utf8CheckIncomplete(this, buf, i);
|
|
61071
|
+
if (!this.lastNeed) return buf.toString('utf8', i);
|
|
61072
|
+
this.lastTotal = total;
|
|
61073
|
+
var end = buf.length - (total - this.lastNeed);
|
|
61074
|
+
buf.copy(this.lastChar, 0, end);
|
|
61075
|
+
return buf.toString('utf8', i, end);
|
|
61076
|
+
}
|
|
61077
|
+
|
|
61078
|
+
// For UTF-8, a replacement character is added when ending on a partial
|
|
61079
|
+
// character.
|
|
61080
|
+
function utf8End(buf) {
|
|
61081
|
+
var r = buf && buf.length ? this.write(buf) : '';
|
|
61082
|
+
if (this.lastNeed) return r + '\ufffd';
|
|
61083
|
+
return r;
|
|
61084
|
+
}
|
|
61085
|
+
|
|
61086
|
+
// UTF-16LE typically needs two bytes per character, but even if we have an even
|
|
61087
|
+
// number of bytes available, we need to check if we end on a leading/high
|
|
61088
|
+
// surrogate. In that case, we need to wait for the next two bytes in order to
|
|
61089
|
+
// decode the last character properly.
|
|
61090
|
+
function utf16Text(buf, i) {
|
|
61091
|
+
if ((buf.length - i) % 2 === 0) {
|
|
61092
|
+
var r = buf.toString('utf16le', i);
|
|
61093
|
+
if (r) {
|
|
61094
|
+
var c = r.charCodeAt(r.length - 1);
|
|
61095
|
+
if (c >= 0xD800 && c <= 0xDBFF) {
|
|
61096
|
+
this.lastNeed = 2;
|
|
61097
|
+
this.lastTotal = 4;
|
|
61098
|
+
this.lastChar[0] = buf[buf.length - 2];
|
|
61099
|
+
this.lastChar[1] = buf[buf.length - 1];
|
|
61100
|
+
return r.slice(0, -1);
|
|
61101
|
+
}
|
|
61102
|
+
}
|
|
61103
|
+
return r;
|
|
61104
|
+
}
|
|
61105
|
+
this.lastNeed = 1;
|
|
61106
|
+
this.lastTotal = 2;
|
|
61107
|
+
this.lastChar[0] = buf[buf.length - 1];
|
|
61108
|
+
return buf.toString('utf16le', i, buf.length - 1);
|
|
61109
|
+
}
|
|
61110
|
+
|
|
61111
|
+
// For UTF-16LE we do not explicitly append special replacement characters if we
|
|
61112
|
+
// end on a partial character, we simply let v8 handle that.
|
|
61113
|
+
function utf16End(buf) {
|
|
61114
|
+
var r = buf && buf.length ? this.write(buf) : '';
|
|
61115
|
+
if (this.lastNeed) {
|
|
61116
|
+
var end = this.lastTotal - this.lastNeed;
|
|
61117
|
+
return r + this.lastChar.toString('utf16le', 0, end);
|
|
61118
|
+
}
|
|
61119
|
+
return r;
|
|
61120
|
+
}
|
|
61121
|
+
|
|
61122
|
+
function base64Text(buf, i) {
|
|
61123
|
+
var n = (buf.length - i) % 3;
|
|
61124
|
+
if (n === 0) return buf.toString('base64', i);
|
|
61125
|
+
this.lastNeed = 3 - n;
|
|
61126
|
+
this.lastTotal = 3;
|
|
61127
|
+
if (n === 1) {
|
|
61128
|
+
this.lastChar[0] = buf[buf.length - 1];
|
|
61129
|
+
} else {
|
|
61130
|
+
this.lastChar[0] = buf[buf.length - 2];
|
|
61131
|
+
this.lastChar[1] = buf[buf.length - 1];
|
|
61132
|
+
}
|
|
61133
|
+
return buf.toString('base64', i, buf.length - n);
|
|
61134
|
+
}
|
|
61135
|
+
|
|
61136
|
+
function base64End(buf) {
|
|
61137
|
+
var r = buf && buf.length ? this.write(buf) : '';
|
|
61138
|
+
if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
|
|
61139
|
+
return r;
|
|
61140
|
+
}
|
|
61141
|
+
|
|
61142
|
+
// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
|
|
61143
|
+
function simpleWrite(buf) {
|
|
61144
|
+
return buf.toString(this.encoding);
|
|
61145
|
+
}
|
|
61146
|
+
|
|
61147
|
+
function simpleEnd(buf) {
|
|
61148
|
+
return buf && buf.length ? this.write(buf) : '';
|
|
61149
|
+
}
|
|
61150
|
+
|
|
61151
|
+
/***/ }),
|
|
61152
|
+
|
|
60638
61153
|
/***/ "./node_modules/process/browser.js":
|
|
60639
61154
|
/*!*****************************************!*\
|
|
60640
61155
|
!*** ./node_modules/process/browser.js ***!
|
|
@@ -79702,7 +80217,7 @@ function ReadableState(options, stream, isDuplex) {
|
|
|
79702
80217
|
this.encoding = null;
|
|
79703
80218
|
|
|
79704
80219
|
if (options.encoding) {
|
|
79705
|
-
if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
|
|
80220
|
+
if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
|
|
79706
80221
|
this.decoder = new StringDecoder(options.encoding);
|
|
79707
80222
|
this.encoding = options.encoding;
|
|
79708
80223
|
}
|
|
@@ -79864,7 +80379,7 @@ Readable.prototype.isPaused = function () {
|
|
|
79864
80379
|
|
|
79865
80380
|
|
|
79866
80381
|
Readable.prototype.setEncoding = function (enc) {
|
|
79867
|
-
if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
|
|
80382
|
+
if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "./node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js").StringDecoder;
|
|
79868
80383
|
var decoder = new StringDecoder(enc);
|
|
79869
80384
|
this._readableState.decoder = decoder; // If setEncoding(null), decoder.encoding equals utf8
|
|
79870
80385
|
|
|
@@ -83225,7 +83740,6 @@ try {
|
|
|
83225
83740
|
/*! no static exports found */
|
|
83226
83741
|
/***/ (function(module, exports, __webpack_require__) {
|
|
83227
83742
|
|
|
83228
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
83229
83743
|
/* eslint-disable node/no-deprecated-api */
|
|
83230
83744
|
var buffer = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js")
|
|
83231
83745
|
var Buffer = buffer.Buffer
|
|
@@ -83248,8 +83762,6 @@ function SafeBuffer (arg, encodingOrOffset, length) {
|
|
|
83248
83762
|
return Buffer(arg, encodingOrOffset, length)
|
|
83249
83763
|
}
|
|
83250
83764
|
|
|
83251
|
-
SafeBuffer.prototype = Object.create(Buffer.prototype)
|
|
83252
|
-
|
|
83253
83765
|
// Copy static methods from Buffer
|
|
83254
83766
|
copyProps(Buffer, SafeBuffer)
|
|
83255
83767
|
|
|
@@ -83733,9 +84245,6 @@ exports.SolidAuthnLogic = void 0;
|
|
|
83733
84245
|
var rdflib_1 = __webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/index.js");
|
|
83734
84246
|
var authUtil_1 = __webpack_require__(/*! ./authUtil */ "./node_modules/solid-logic/lib/authn/authUtil.js");
|
|
83735
84247
|
var debug = __importStar(__webpack_require__(/*! ../util/debug */ "./node_modules/solid-logic/lib/util/debug.js"));
|
|
83736
|
-
/**
|
|
83737
|
-
* Implements AuthnLogic relying on solid-auth-client
|
|
83738
|
-
*/
|
|
83739
84248
|
var SolidAuthnLogic = /** @class */ (function () {
|
|
83740
84249
|
function SolidAuthnLogic(solidAuthSession) {
|
|
83741
84250
|
this.session = solidAuthSession;
|
|
@@ -84548,12 +85057,8 @@ var SolidLogic = /** @class */ (function () {
|
|
|
84548
85057
|
preferencesFile: {},
|
|
84549
85058
|
};
|
|
84550
85059
|
this.fetcher = fetcher;
|
|
84551
|
-
// if (authSession) {
|
|
84552
85060
|
this.authn = new SolidAuthnLogic_1.SolidAuthnLogic(session);
|
|
84553
85061
|
debug.log('SolidAuthnLogic initialized');
|
|
84554
|
-
/* } else {
|
|
84555
|
-
this.authn = new NoAuthnLogic();
|
|
84556
|
-
}*/
|
|
84557
85062
|
this.profile = new ProfileLogic_1.ProfileLogic(this.store, ns, this.authn);
|
|
84558
85063
|
this.chat = new ChatLogic_1.ChatLogic(this.store, ns, this.profile);
|
|
84559
85064
|
this.util = new UtilityLogic_1.UtilityLogic(this.store, ns, this.fetcher);
|
|
@@ -85719,313 +86224,6 @@ function vocab (rdf = { namedNode: u => u }) {
|
|
|
85719
86224
|
module.exports = vocab
|
|
85720
86225
|
|
|
85721
86226
|
|
|
85722
|
-
/***/ }),
|
|
85723
|
-
|
|
85724
|
-
/***/ "./node_modules/string_decoder/lib/string_decoder.js":
|
|
85725
|
-
/*!***********************************************************!*\
|
|
85726
|
-
!*** ./node_modules/string_decoder/lib/string_decoder.js ***!
|
|
85727
|
-
\***********************************************************/
|
|
85728
|
-
/*! no static exports found */
|
|
85729
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
85730
|
-
|
|
85731
|
-
"use strict";
|
|
85732
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
85733
|
-
//
|
|
85734
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
85735
|
-
// copy of this software and associated documentation files (the
|
|
85736
|
-
// "Software"), to deal in the Software without restriction, including
|
|
85737
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
85738
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
85739
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
85740
|
-
// following conditions:
|
|
85741
|
-
//
|
|
85742
|
-
// The above copyright notice and this permission notice shall be included
|
|
85743
|
-
// in all copies or substantial portions of the Software.
|
|
85744
|
-
//
|
|
85745
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
85746
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
85747
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
85748
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
85749
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
85750
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
85751
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
85752
|
-
|
|
85753
|
-
|
|
85754
|
-
|
|
85755
|
-
/*<replacement>*/
|
|
85756
|
-
|
|
85757
|
-
var Buffer = __webpack_require__(/*! safe-buffer */ "./node_modules/safe-buffer/index.js").Buffer;
|
|
85758
|
-
/*</replacement>*/
|
|
85759
|
-
|
|
85760
|
-
var isEncoding = Buffer.isEncoding || function (encoding) {
|
|
85761
|
-
encoding = '' + encoding;
|
|
85762
|
-
switch (encoding && encoding.toLowerCase()) {
|
|
85763
|
-
case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
|
|
85764
|
-
return true;
|
|
85765
|
-
default:
|
|
85766
|
-
return false;
|
|
85767
|
-
}
|
|
85768
|
-
};
|
|
85769
|
-
|
|
85770
|
-
function _normalizeEncoding(enc) {
|
|
85771
|
-
if (!enc) return 'utf8';
|
|
85772
|
-
var retried;
|
|
85773
|
-
while (true) {
|
|
85774
|
-
switch (enc) {
|
|
85775
|
-
case 'utf8':
|
|
85776
|
-
case 'utf-8':
|
|
85777
|
-
return 'utf8';
|
|
85778
|
-
case 'ucs2':
|
|
85779
|
-
case 'ucs-2':
|
|
85780
|
-
case 'utf16le':
|
|
85781
|
-
case 'utf-16le':
|
|
85782
|
-
return 'utf16le';
|
|
85783
|
-
case 'latin1':
|
|
85784
|
-
case 'binary':
|
|
85785
|
-
return 'latin1';
|
|
85786
|
-
case 'base64':
|
|
85787
|
-
case 'ascii':
|
|
85788
|
-
case 'hex':
|
|
85789
|
-
return enc;
|
|
85790
|
-
default:
|
|
85791
|
-
if (retried) return; // undefined
|
|
85792
|
-
enc = ('' + enc).toLowerCase();
|
|
85793
|
-
retried = true;
|
|
85794
|
-
}
|
|
85795
|
-
}
|
|
85796
|
-
};
|
|
85797
|
-
|
|
85798
|
-
// Do not cache `Buffer.isEncoding` when checking encoding names as some
|
|
85799
|
-
// modules monkey-patch it to support additional encodings
|
|
85800
|
-
function normalizeEncoding(enc) {
|
|
85801
|
-
var nenc = _normalizeEncoding(enc);
|
|
85802
|
-
if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
|
|
85803
|
-
return nenc || enc;
|
|
85804
|
-
}
|
|
85805
|
-
|
|
85806
|
-
// StringDecoder provides an interface for efficiently splitting a series of
|
|
85807
|
-
// buffers into a series of JS strings without breaking apart multi-byte
|
|
85808
|
-
// characters.
|
|
85809
|
-
exports.StringDecoder = StringDecoder;
|
|
85810
|
-
function StringDecoder(encoding) {
|
|
85811
|
-
this.encoding = normalizeEncoding(encoding);
|
|
85812
|
-
var nb;
|
|
85813
|
-
switch (this.encoding) {
|
|
85814
|
-
case 'utf16le':
|
|
85815
|
-
this.text = utf16Text;
|
|
85816
|
-
this.end = utf16End;
|
|
85817
|
-
nb = 4;
|
|
85818
|
-
break;
|
|
85819
|
-
case 'utf8':
|
|
85820
|
-
this.fillLast = utf8FillLast;
|
|
85821
|
-
nb = 4;
|
|
85822
|
-
break;
|
|
85823
|
-
case 'base64':
|
|
85824
|
-
this.text = base64Text;
|
|
85825
|
-
this.end = base64End;
|
|
85826
|
-
nb = 3;
|
|
85827
|
-
break;
|
|
85828
|
-
default:
|
|
85829
|
-
this.write = simpleWrite;
|
|
85830
|
-
this.end = simpleEnd;
|
|
85831
|
-
return;
|
|
85832
|
-
}
|
|
85833
|
-
this.lastNeed = 0;
|
|
85834
|
-
this.lastTotal = 0;
|
|
85835
|
-
this.lastChar = Buffer.allocUnsafe(nb);
|
|
85836
|
-
}
|
|
85837
|
-
|
|
85838
|
-
StringDecoder.prototype.write = function (buf) {
|
|
85839
|
-
if (buf.length === 0) return '';
|
|
85840
|
-
var r;
|
|
85841
|
-
var i;
|
|
85842
|
-
if (this.lastNeed) {
|
|
85843
|
-
r = this.fillLast(buf);
|
|
85844
|
-
if (r === undefined) return '';
|
|
85845
|
-
i = this.lastNeed;
|
|
85846
|
-
this.lastNeed = 0;
|
|
85847
|
-
} else {
|
|
85848
|
-
i = 0;
|
|
85849
|
-
}
|
|
85850
|
-
if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
|
|
85851
|
-
return r || '';
|
|
85852
|
-
};
|
|
85853
|
-
|
|
85854
|
-
StringDecoder.prototype.end = utf8End;
|
|
85855
|
-
|
|
85856
|
-
// Returns only complete characters in a Buffer
|
|
85857
|
-
StringDecoder.prototype.text = utf8Text;
|
|
85858
|
-
|
|
85859
|
-
// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
|
|
85860
|
-
StringDecoder.prototype.fillLast = function (buf) {
|
|
85861
|
-
if (this.lastNeed <= buf.length) {
|
|
85862
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
|
|
85863
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
85864
|
-
}
|
|
85865
|
-
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
|
|
85866
|
-
this.lastNeed -= buf.length;
|
|
85867
|
-
};
|
|
85868
|
-
|
|
85869
|
-
// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
|
|
85870
|
-
// continuation byte. If an invalid byte is detected, -2 is returned.
|
|
85871
|
-
function utf8CheckByte(byte) {
|
|
85872
|
-
if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
|
|
85873
|
-
return byte >> 6 === 0x02 ? -1 : -2;
|
|
85874
|
-
}
|
|
85875
|
-
|
|
85876
|
-
// Checks at most 3 bytes at the end of a Buffer in order to detect an
|
|
85877
|
-
// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
|
|
85878
|
-
// needed to complete the UTF-8 character (if applicable) are returned.
|
|
85879
|
-
function utf8CheckIncomplete(self, buf, i) {
|
|
85880
|
-
var j = buf.length - 1;
|
|
85881
|
-
if (j < i) return 0;
|
|
85882
|
-
var nb = utf8CheckByte(buf[j]);
|
|
85883
|
-
if (nb >= 0) {
|
|
85884
|
-
if (nb > 0) self.lastNeed = nb - 1;
|
|
85885
|
-
return nb;
|
|
85886
|
-
}
|
|
85887
|
-
if (--j < i || nb === -2) return 0;
|
|
85888
|
-
nb = utf8CheckByte(buf[j]);
|
|
85889
|
-
if (nb >= 0) {
|
|
85890
|
-
if (nb > 0) self.lastNeed = nb - 2;
|
|
85891
|
-
return nb;
|
|
85892
|
-
}
|
|
85893
|
-
if (--j < i || nb === -2) return 0;
|
|
85894
|
-
nb = utf8CheckByte(buf[j]);
|
|
85895
|
-
if (nb >= 0) {
|
|
85896
|
-
if (nb > 0) {
|
|
85897
|
-
if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
|
|
85898
|
-
}
|
|
85899
|
-
return nb;
|
|
85900
|
-
}
|
|
85901
|
-
return 0;
|
|
85902
|
-
}
|
|
85903
|
-
|
|
85904
|
-
// Validates as many continuation bytes for a multi-byte UTF-8 character as
|
|
85905
|
-
// needed or are available. If we see a non-continuation byte where we expect
|
|
85906
|
-
// one, we "replace" the validated continuation bytes we've seen so far with
|
|
85907
|
-
// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
|
|
85908
|
-
// behavior. The continuation byte check is included three times in the case
|
|
85909
|
-
// where all of the continuation bytes for a character exist in the same buffer.
|
|
85910
|
-
// It is also done this way as a slight performance increase instead of using a
|
|
85911
|
-
// loop.
|
|
85912
|
-
function utf8CheckExtraBytes(self, buf, p) {
|
|
85913
|
-
if ((buf[0] & 0xC0) !== 0x80) {
|
|
85914
|
-
self.lastNeed = 0;
|
|
85915
|
-
return '\ufffd';
|
|
85916
|
-
}
|
|
85917
|
-
if (self.lastNeed > 1 && buf.length > 1) {
|
|
85918
|
-
if ((buf[1] & 0xC0) !== 0x80) {
|
|
85919
|
-
self.lastNeed = 1;
|
|
85920
|
-
return '\ufffd';
|
|
85921
|
-
}
|
|
85922
|
-
if (self.lastNeed > 2 && buf.length > 2) {
|
|
85923
|
-
if ((buf[2] & 0xC0) !== 0x80) {
|
|
85924
|
-
self.lastNeed = 2;
|
|
85925
|
-
return '\ufffd';
|
|
85926
|
-
}
|
|
85927
|
-
}
|
|
85928
|
-
}
|
|
85929
|
-
}
|
|
85930
|
-
|
|
85931
|
-
// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
|
|
85932
|
-
function utf8FillLast(buf) {
|
|
85933
|
-
var p = this.lastTotal - this.lastNeed;
|
|
85934
|
-
var r = utf8CheckExtraBytes(this, buf, p);
|
|
85935
|
-
if (r !== undefined) return r;
|
|
85936
|
-
if (this.lastNeed <= buf.length) {
|
|
85937
|
-
buf.copy(this.lastChar, p, 0, this.lastNeed);
|
|
85938
|
-
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
85939
|
-
}
|
|
85940
|
-
buf.copy(this.lastChar, p, 0, buf.length);
|
|
85941
|
-
this.lastNeed -= buf.length;
|
|
85942
|
-
}
|
|
85943
|
-
|
|
85944
|
-
// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
|
|
85945
|
-
// partial character, the character's bytes are buffered until the required
|
|
85946
|
-
// number of bytes are available.
|
|
85947
|
-
function utf8Text(buf, i) {
|
|
85948
|
-
var total = utf8CheckIncomplete(this, buf, i);
|
|
85949
|
-
if (!this.lastNeed) return buf.toString('utf8', i);
|
|
85950
|
-
this.lastTotal = total;
|
|
85951
|
-
var end = buf.length - (total - this.lastNeed);
|
|
85952
|
-
buf.copy(this.lastChar, 0, end);
|
|
85953
|
-
return buf.toString('utf8', i, end);
|
|
85954
|
-
}
|
|
85955
|
-
|
|
85956
|
-
// For UTF-8, a replacement character is added when ending on a partial
|
|
85957
|
-
// character.
|
|
85958
|
-
function utf8End(buf) {
|
|
85959
|
-
var r = buf && buf.length ? this.write(buf) : '';
|
|
85960
|
-
if (this.lastNeed) return r + '\ufffd';
|
|
85961
|
-
return r;
|
|
85962
|
-
}
|
|
85963
|
-
|
|
85964
|
-
// UTF-16LE typically needs two bytes per character, but even if we have an even
|
|
85965
|
-
// number of bytes available, we need to check if we end on a leading/high
|
|
85966
|
-
// surrogate. In that case, we need to wait for the next two bytes in order to
|
|
85967
|
-
// decode the last character properly.
|
|
85968
|
-
function utf16Text(buf, i) {
|
|
85969
|
-
if ((buf.length - i) % 2 === 0) {
|
|
85970
|
-
var r = buf.toString('utf16le', i);
|
|
85971
|
-
if (r) {
|
|
85972
|
-
var c = r.charCodeAt(r.length - 1);
|
|
85973
|
-
if (c >= 0xD800 && c <= 0xDBFF) {
|
|
85974
|
-
this.lastNeed = 2;
|
|
85975
|
-
this.lastTotal = 4;
|
|
85976
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
85977
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
85978
|
-
return r.slice(0, -1);
|
|
85979
|
-
}
|
|
85980
|
-
}
|
|
85981
|
-
return r;
|
|
85982
|
-
}
|
|
85983
|
-
this.lastNeed = 1;
|
|
85984
|
-
this.lastTotal = 2;
|
|
85985
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
85986
|
-
return buf.toString('utf16le', i, buf.length - 1);
|
|
85987
|
-
}
|
|
85988
|
-
|
|
85989
|
-
// For UTF-16LE we do not explicitly append special replacement characters if we
|
|
85990
|
-
// end on a partial character, we simply let v8 handle that.
|
|
85991
|
-
function utf16End(buf) {
|
|
85992
|
-
var r = buf && buf.length ? this.write(buf) : '';
|
|
85993
|
-
if (this.lastNeed) {
|
|
85994
|
-
var end = this.lastTotal - this.lastNeed;
|
|
85995
|
-
return r + this.lastChar.toString('utf16le', 0, end);
|
|
85996
|
-
}
|
|
85997
|
-
return r;
|
|
85998
|
-
}
|
|
85999
|
-
|
|
86000
|
-
function base64Text(buf, i) {
|
|
86001
|
-
var n = (buf.length - i) % 3;
|
|
86002
|
-
if (n === 0) return buf.toString('base64', i);
|
|
86003
|
-
this.lastNeed = 3 - n;
|
|
86004
|
-
this.lastTotal = 3;
|
|
86005
|
-
if (n === 1) {
|
|
86006
|
-
this.lastChar[0] = buf[buf.length - 1];
|
|
86007
|
-
} else {
|
|
86008
|
-
this.lastChar[0] = buf[buf.length - 2];
|
|
86009
|
-
this.lastChar[1] = buf[buf.length - 1];
|
|
86010
|
-
}
|
|
86011
|
-
return buf.toString('base64', i, buf.length - n);
|
|
86012
|
-
}
|
|
86013
|
-
|
|
86014
|
-
function base64End(buf) {
|
|
86015
|
-
var r = buf && buf.length ? this.write(buf) : '';
|
|
86016
|
-
if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
|
|
86017
|
-
return r;
|
|
86018
|
-
}
|
|
86019
|
-
|
|
86020
|
-
// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
|
|
86021
|
-
function simpleWrite(buf) {
|
|
86022
|
-
return buf.toString(this.encoding);
|
|
86023
|
-
}
|
|
86024
|
-
|
|
86025
|
-
function simpleEnd(buf) {
|
|
86026
|
-
return buf && buf.length ? this.write(buf) : '';
|
|
86027
|
-
}
|
|
86028
|
-
|
|
86029
86227
|
/***/ }),
|
|
86030
86228
|
|
|
86031
86229
|
/***/ "./node_modules/symbol-observable/es/index.js":
|