@frontegg/js 6.84.0 → 6.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -407,7 +407,7 @@ var FronteggApp = /*#__PURE__*/function () {
407
407
  break;
408
408
  }
409
409
  _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.FeatureFlags.set(_utils_mockFlagsList__WEBPACK_IMPORTED_MODULE_8__.mockFlagsList, _this.name);
410
- _context3.next = 14;
410
+ _context3.next = 15;
411
411
  break;
412
412
  case 4:
413
413
  _context3.prev = 4;
@@ -415,18 +415,21 @@ var FronteggApp = /*#__PURE__*/function () {
415
415
  return _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.loadFeatureFlags();
416
416
  case 7:
417
417
  flags = _context3.sent;
418
+ if (_this.options.overrideFeatureFlags) {
419
+ Object.assign(flags, _this.options.overrideFeatureFlags);
420
+ }
418
421
  _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.FeatureFlags.set(flags, _this.name);
419
- _context3.next = 14;
422
+ _context3.next = 15;
420
423
  break;
421
- case 11:
422
- _context3.prev = 11;
424
+ case 12:
425
+ _context3.prev = 12;
423
426
  _context3.t0 = _context3["catch"](4);
424
427
  console.error('failed to get admin portal feature flags', _context3.t0);
425
- case 14:
428
+ case 15:
426
429
  case "end":
427
430
  return _context3.stop();
428
431
  }
429
- }, _callee3, null, [[4, 11]]);
432
+ }, _callee3, null, [[4, 12]]);
430
433
  }));
431
434
  this.updateLocalizationsSetter = function (localizationUpdateFn) {
432
435
  _this.updateLocalizations = localizationUpdateFn;
@@ -1183,7 +1186,8 @@ var mockFlagsList = {
1183
1186
  admin_portal_domain_restrictions: 'on',
1184
1187
  'new-mfa-pages': 'on',
1185
1188
  'show-passkeys-new': 'on',
1186
- 'groups-admin-box-new': 'on'
1189
+ 'groups-admin-box-new': 'on',
1190
+ 'msp-all-accounts': 'on'
1187
1191
  };
1188
1192
 
1189
1193
  /***/ }),
@@ -1200,7 +1204,7 @@ __webpack_require__.r(__webpack_exports__);
1200
1204
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1201
1205
  /* harmony export */ });
1202
1206
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1203
- cdnVersion: '6.84.0'
1207
+ cdnVersion: '6.86.0'
1204
1208
  });
1205
1209
 
1206
1210
  /***/ }),
@@ -9672,6 +9676,12 @@ const actions = {
9672
9676
  saveSSOConfigurationsFile: (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__.createAction)(`${_constants__WEBPACK_IMPORTED_MODULE_2__.authStoreName}/saveSSOConfigurationsFile`, payload => ({
9673
9677
  payload
9674
9678
  })),
9679
+ saveSSOConfigurationByData: (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__.createAction)(`${_constants__WEBPACK_IMPORTED_MODULE_2__.authStoreName}/saveSSOConfigurationByData`, payload => ({
9680
+ payload
9681
+ })),
9682
+ saveSSOConfigurationByUrl: (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__.createAction)(`${_constants__WEBPACK_IMPORTED_MODULE_2__.authStoreName}/saveSSOConfigurationByUrl`, payload => ({
9683
+ payload
9684
+ })),
9675
9685
  saveSSOConfigurationsFileWithCallback: (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_1__.createAction)(`${_constants__WEBPACK_IMPORTED_MODULE_2__.authStoreName}/saveSSOConfigurationsFileWithCallback`, payload => ({
9676
9686
  payload
9677
9687
  })),
@@ -9700,7 +9710,7 @@ const actions = {
9700
9710
  // noinspection JSUnusedLocalSymbols
9701
9711
  /**
9702
9712
  * if you see error in matcher that's mean the DispatchAction does not
9703
- * contains the same functions in reducers and actions
9713
+ * contain the same functions in reducers and actions
9704
9714
  */
9705
9715
  const Matcher = {};
9706
9716
 
@@ -10264,6 +10274,7 @@ __webpack_require__.r(__webpack_exports__);
10264
10274
  /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");
10265
10275
  /* harmony import */ var redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! redux-saga/effects */ "../../node_modules/redux-saga/dist/redux-saga-effects-npm-proxy.esm.js");
10266
10276
  /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/index.js");
10277
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/fetch.js");
10267
10278
  /* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../reducer */ "../../dist/@frontegg/redux-store/auth/reducer.js");
10268
10279
  /* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./interfaces */ "../../dist/@frontegg/redux-store/auth/SSOState/interfaces.js");
10269
10280
  /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers.js");
@@ -10271,7 +10282,8 @@ __webpack_require__.r(__webpack_exports__);
10271
10282
 
10272
10283
  const _excluded = ["callback"],
10273
10284
  _excluded2 = ["callback", "ssoConfigId"],
10274
- _excluded3 = ["callback", "ssoConfigId"];
10285
+ _excluded3 = ["callback", "ssoConfigId"],
10286
+ _excluded4 = ["callback", "ssoConfigId"];
10275
10287
 
10276
10288
 
10277
10289
 
@@ -10718,6 +10730,88 @@ function* updateSSOGroups({
10718
10730
  }));
10719
10731
  }
10720
10732
  }
10733
+ function* saveSSOConfigurationByUrl({
10734
+ payload
10735
+ }) {
10736
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.put)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.setSSOLoader({
10737
+ key: _interfaces__WEBPACK_IMPORTED_MODULE_5__.SSOStateKeys.SAVE_SSO_CONFIGURATION_BY_METADATA,
10738
+ value: true
10739
+ }));
10740
+ const {
10741
+ metadataUrl,
10742
+ configMetadata,
10743
+ ssoConfigId,
10744
+ callback
10745
+ } = payload;
10746
+ const ssoConfigurations = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.select)(state => state.auth.ssoState.ssoConfigurations);
10747
+ try {
10748
+ const metadata = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_7__.Get, metadataUrl, undefined, {
10749
+ responseType: 'plain'
10750
+ });
10751
+
10752
+ // TODO: remove any after adding configMetadata for @frontegg/rest-api
10753
+ const body = {
10754
+ metadata,
10755
+ configMetadata
10756
+ };
10757
+ let newSsoConfiguration;
10758
+ let newSsoConfigurations;
10759
+ if (ssoConfigId) {
10760
+ newSsoConfiguration = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.api.auth.updateSSOConfigurationByMetadata, ssoConfigId, body);
10761
+ newSsoConfigurations = ssoConfigurations.map(ssoConfig => ssoConfig.id === ssoConfigId ? newSsoConfiguration : ssoConfig);
10762
+ } else {
10763
+ newSsoConfiguration = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.api.auth.createSSOConfigurationByMetadata, body);
10764
+ newSsoConfigurations = [newSsoConfiguration, ...ssoConfigurations];
10765
+ }
10766
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.put)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.setSSOState({
10767
+ ssoConfigurations: newSsoConfigurations
10768
+ }));
10769
+ callback == null ? void 0 : callback(newSsoConfiguration);
10770
+ } catch (error) {
10771
+ callback == null ? void 0 : callback(null, error);
10772
+ } finally {
10773
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.put)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.setSSOLoader({
10774
+ key: _interfaces__WEBPACK_IMPORTED_MODULE_5__.SSOStateKeys.SAVE_SSO_CONFIGURATION_BY_METADATA,
10775
+ value: false
10776
+ }));
10777
+ }
10778
+ }
10779
+ function* saveSSOConfigurationByData({
10780
+ payload
10781
+ }) {
10782
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.put)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.setSSOLoader({
10783
+ key: _interfaces__WEBPACK_IMPORTED_MODULE_5__.SSOStateKeys.SAVE_SSO_CONFIGURATION,
10784
+ value: true
10785
+ }));
10786
+ const {
10787
+ callback,
10788
+ ssoConfigId
10789
+ } = payload,
10790
+ body = (0,_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_1__["default"])(payload, _excluded4);
10791
+ const ssoConfigurations = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.select)(state => state.auth.ssoState.ssoConfigurations);
10792
+ try {
10793
+ let newSsoConfiguration;
10794
+ let newSsoConfigurations;
10795
+ if (ssoConfigId) {
10796
+ newSsoConfiguration = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.api.auth.updateSSOConfiguration, ssoConfigId, body);
10797
+ newSsoConfigurations = ssoConfigurations.map(ssoConfig => ssoConfig.id === ssoConfigId ? newSsoConfiguration : ssoConfig);
10798
+ } else {
10799
+ newSsoConfiguration = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.call)(_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.api.auth.createSSOConfiguration, body);
10800
+ newSsoConfigurations = [newSsoConfiguration, ...ssoConfigurations];
10801
+ }
10802
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.put)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.setSSOState({
10803
+ ssoConfigurations: newSsoConfigurations
10804
+ }));
10805
+ callback == null ? void 0 : callback(newSsoConfiguration);
10806
+ } catch (error) {
10807
+ callback == null ? void 0 : callback(null, error);
10808
+ } finally {
10809
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.put)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.setSSOLoader({
10810
+ key: _interfaces__WEBPACK_IMPORTED_MODULE_5__.SSOStateKeys.SAVE_SSO_CONFIGURATION_BY_METADATA,
10811
+ value: false
10812
+ }));
10813
+ }
10814
+ }
10721
10815
  function* ssoSagas() {
10722
10816
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.takeEvery)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.loadSSOConfigurationsV2, loadSSOConfigurationsV2);
10723
10817
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.takeEvery)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.saveSSOConfigurationV2, saveSSOConfigurationV2);
@@ -10731,6 +10825,8 @@ function* ssoSagas() {
10731
10825
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.takeEvery)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.setSSODefaultRoles, setSSODefaultRoles);
10732
10826
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.takeEvery)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.saveSSOConfigurationByMetadata, saveSSOConfigurationByMetadata);
10733
10827
  yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.takeEvery)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.updateSSOConfigurationByMetadata, updateSSOConfigurationByMetadata);
10828
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.takeEvery)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.saveSSOConfigurationByUrl, saveSSOConfigurationByUrl);
10829
+ yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_2__.takeEvery)(_reducer__WEBPACK_IMPORTED_MODULE_4__.actions.saveSSOConfigurationByData, saveSSOConfigurationByData);
10734
10830
  }
10735
10831
 
10736
10832
  /***/ }),
@@ -16006,14 +16102,19 @@ __webpack_require__.r(__webpack_exports__);
16006
16102
  /* harmony export */ "createRandomString": () => (/* binding */ createRandomString),
16007
16103
  /* harmony export */ "generateActionCreator": () => (/* binding */ generateActionCreator),
16008
16104
  /* harmony export */ "generateCodeChallenge": () => (/* binding */ generateCodeChallenge),
16105
+ /* harmony export */ "generateCodeChallengeNative": () => (/* binding */ generateCodeChallengeNative),
16106
+ /* harmony export */ "generateCodeChallengePureJs": () => (/* binding */ generateCodeChallengePureJs),
16009
16107
  /* harmony export */ "getFeatureFlags": () => (/* binding */ getFeatureFlags),
16010
16108
  /* harmony export */ "omitProps": () => (/* binding */ omitProps),
16011
16109
  /* harmony export */ "readFileAsText": () => (/* binding */ readFileAsText)
16012
16110
  /* harmony export */ });
16013
16111
  /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "../../node_modules/@babel/runtime/helpers/esm/extends.js");
16014
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/feature-flags/index.js");
16015
- /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @reduxjs/toolkit */ "../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
16112
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/feature-flags/index.js");
16113
+ /* harmony import */ var _reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @reduxjs/toolkit */ "../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
16016
16114
  /* harmony import */ var redux_saga_effects__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! redux-saga/effects */ "../../node_modules/redux-saga/dist/redux-saga-effects-npm-proxy.esm.js");
16115
+ /* harmony import */ var js_sha256__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! js-sha256 */ "../../node_modules/js-sha256/src/sha256.js");
16116
+ /* harmony import */ var js_sha256__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(js_sha256__WEBPACK_IMPORTED_MODULE_2__);
16117
+
16017
16118
 
16018
16119
 
16019
16120
 
@@ -16027,16 +16128,29 @@ function omitProps(props, keys) {
16027
16128
  return newProps;
16028
16129
  }
16029
16130
  function generateActionCreator(storeName) {
16030
- return (key, withPayload) => withPayload ? (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_2__.createAction)(`${storeName}/${key}`, payload => ({
16131
+ return (key, withPayload) => withPayload ? (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__.createAction)(`${storeName}/${key}`, payload => ({
16031
16132
  payload
16032
- })) : (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_2__.createAction)(`${storeName}/${key}`);
16133
+ })) : (0,_reduxjs_toolkit__WEBPACK_IMPORTED_MODULE_3__.createAction)(`${storeName}/${key}`);
16033
16134
  }
16034
- async function generateCodeChallenge(codeVerifier) {
16135
+ async function generateCodeChallengePureJs(codeVerifier) {
16136
+ // noinspection TypeScriptValidateJSTypes pure sha256 recevie single params alg name
16137
+ const digest = js_sha256__WEBPACK_IMPORTED_MODULE_2__.sha256.digest(new TextEncoder().encode(codeVerifier));
16138
+ return btoa(String.fromCharCode(...new Uint8Array(digest))).replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
16139
+ }
16140
+ async function generateCodeChallengeNative(codeVerifier) {
16035
16141
  const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(codeVerifier));
16036
-
16037
- // @ts-ignore
16038
16142
  return btoa(String.fromCharCode(...new Uint8Array(digest))).replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
16039
16143
  }
16144
+ async function generateCodeChallenge(codeVerifier) {
16145
+ var _window$crypto, _window$crypto$subtle;
16146
+ // @ts-expect-error Crypto.subtle not available in non-secure domains
16147
+ if ((_window$crypto = window.crypto) != null && (_window$crypto$subtle = _window$crypto.subtle) != null && _window$crypto$subtle.digest) {
16148
+ return generateCodeChallengeNative(codeVerifier);
16149
+ } else {
16150
+ console.warn('Generating CodeChallenge in non-secure domain:', window.location.origin);
16151
+ return generateCodeChallengePureJs(codeVerifier);
16152
+ }
16153
+ }
16040
16154
  function createRandomString(length = 16) {
16041
16155
  let text = '';
16042
16156
  const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
@@ -16053,7 +16167,7 @@ const readFileAsText = file => new Promise((resolve, reject) => {
16053
16167
  });
16054
16168
  function* getFeatureFlags(flags) {
16055
16169
  const appName = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_1__.select)(state => state.root.appName);
16056
- return _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.FeatureFlags.getFeatureFlags(flags, appName);
16170
+ return _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_4__.FeatureFlags.getFeatureFlags(flags, appName);
16057
16171
  }
16058
16172
 
16059
16173
  /***/ }),
@@ -18912,7 +19026,7 @@ __webpack_require__.r(__webpack_exports__);
18912
19026
  /* harmony export */ });
18913
19027
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
18914
19028
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
18915
- /** @license Frontegg v6.84.0
19029
+ /** @license Frontegg v6.86.0
18916
19030
  *
18917
19031
  * This source code is licensed under the MIT license found in the
18918
19032
  * LICENSE file in the root directory of this source tree.
@@ -27149,6 +27263,535 @@ var deepmerge_1 = deepmerge;
27149
27263
  module.exports = deepmerge_1;
27150
27264
 
27151
27265
 
27266
+ /***/ }),
27267
+
27268
+ /***/ "../../node_modules/js-sha256/src/sha256.js":
27269
+ /*!**************************************************!*\
27270
+ !*** ../../node_modules/js-sha256/src/sha256.js ***!
27271
+ \**************************************************/
27272
+ /***/ ((module, exports, __webpack_require__) => {
27273
+
27274
+ var __WEBPACK_AMD_DEFINE_RESULT__;/**
27275
+ * [js-sha256]{@link https://github.com/emn178/js-sha256}
27276
+ *
27277
+ * @version 0.9.0
27278
+ * @author Chen, Yi-Cyuan [emn178@gmail.com]
27279
+ * @copyright Chen, Yi-Cyuan 2014-2017
27280
+ * @license MIT
27281
+ */
27282
+ /*jslint bitwise: true */
27283
+ (function () {
27284
+ 'use strict';
27285
+
27286
+ var ERROR = 'input is invalid type';
27287
+ var WINDOW = typeof window === 'object';
27288
+ var root = WINDOW ? window : {};
27289
+ if (root.JS_SHA256_NO_WINDOW) {
27290
+ WINDOW = false;
27291
+ }
27292
+ var WEB_WORKER = !WINDOW && typeof self === 'object';
27293
+ var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;
27294
+ if (NODE_JS) {
27295
+ root = __webpack_require__.g;
27296
+ } else if (WEB_WORKER) {
27297
+ root = self;
27298
+ }
27299
+ var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && "object" === 'object' && module.exports;
27300
+ var AMD = true && __webpack_require__.amdO;
27301
+ var ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';
27302
+ var HEX_CHARS = '0123456789abcdef'.split('');
27303
+ var EXTRA = [-2147483648, 8388608, 32768, 128];
27304
+ var SHIFT = [24, 16, 8, 0];
27305
+ var K = [
27306
+ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
27307
+ 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
27308
+ 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
27309
+ 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
27310
+ 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
27311
+ 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
27312
+ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
27313
+ 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
27314
+ ];
27315
+ var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer'];
27316
+
27317
+ var blocks = [];
27318
+
27319
+ if (root.JS_SHA256_NO_NODE_JS || !Array.isArray) {
27320
+ Array.isArray = function (obj) {
27321
+ return Object.prototype.toString.call(obj) === '[object Array]';
27322
+ };
27323
+ }
27324
+
27325
+ if (ARRAY_BUFFER && (root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
27326
+ ArrayBuffer.isView = function (obj) {
27327
+ return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;
27328
+ };
27329
+ }
27330
+
27331
+ var createOutputMethod = function (outputType, is224) {
27332
+ return function (message) {
27333
+ return new Sha256(is224, true).update(message)[outputType]();
27334
+ };
27335
+ };
27336
+
27337
+ var createMethod = function (is224) {
27338
+ var method = createOutputMethod('hex', is224);
27339
+ if (NODE_JS) {
27340
+ method = nodeWrap(method, is224);
27341
+ }
27342
+ method.create = function () {
27343
+ return new Sha256(is224);
27344
+ };
27345
+ method.update = function (message) {
27346
+ return method.create().update(message);
27347
+ };
27348
+ for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
27349
+ var type = OUTPUT_TYPES[i];
27350
+ method[type] = createOutputMethod(type, is224);
27351
+ }
27352
+ return method;
27353
+ };
27354
+
27355
+ var nodeWrap = function (method, is224) {
27356
+ var crypto = eval("require('crypto')");
27357
+ var Buffer = eval("require('buffer').Buffer");
27358
+ var algorithm = is224 ? 'sha224' : 'sha256';
27359
+ var nodeMethod = function (message) {
27360
+ if (typeof message === 'string') {
27361
+ return crypto.createHash(algorithm).update(message, 'utf8').digest('hex');
27362
+ } else {
27363
+ if (message === null || message === undefined) {
27364
+ throw new Error(ERROR);
27365
+ } else if (message.constructor === ArrayBuffer) {
27366
+ message = new Uint8Array(message);
27367
+ }
27368
+ }
27369
+ if (Array.isArray(message) || ArrayBuffer.isView(message) ||
27370
+ message.constructor === Buffer) {
27371
+ return crypto.createHash(algorithm).update(new Buffer(message)).digest('hex');
27372
+ } else {
27373
+ return method(message);
27374
+ }
27375
+ };
27376
+ return nodeMethod;
27377
+ };
27378
+
27379
+ var createHmacOutputMethod = function (outputType, is224) {
27380
+ return function (key, message) {
27381
+ return new HmacSha256(key, is224, true).update(message)[outputType]();
27382
+ };
27383
+ };
27384
+
27385
+ var createHmacMethod = function (is224) {
27386
+ var method = createHmacOutputMethod('hex', is224);
27387
+ method.create = function (key) {
27388
+ return new HmacSha256(key, is224);
27389
+ };
27390
+ method.update = function (key, message) {
27391
+ return method.create(key).update(message);
27392
+ };
27393
+ for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
27394
+ var type = OUTPUT_TYPES[i];
27395
+ method[type] = createHmacOutputMethod(type, is224);
27396
+ }
27397
+ return method;
27398
+ };
27399
+
27400
+ function Sha256(is224, sharedMemory) {
27401
+ if (sharedMemory) {
27402
+ blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =
27403
+ blocks[4] = blocks[5] = blocks[6] = blocks[7] =
27404
+ blocks[8] = blocks[9] = blocks[10] = blocks[11] =
27405
+ blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
27406
+ this.blocks = blocks;
27407
+ } else {
27408
+ this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
27409
+ }
27410
+
27411
+ if (is224) {
27412
+ this.h0 = 0xc1059ed8;
27413
+ this.h1 = 0x367cd507;
27414
+ this.h2 = 0x3070dd17;
27415
+ this.h3 = 0xf70e5939;
27416
+ this.h4 = 0xffc00b31;
27417
+ this.h5 = 0x68581511;
27418
+ this.h6 = 0x64f98fa7;
27419
+ this.h7 = 0xbefa4fa4;
27420
+ } else { // 256
27421
+ this.h0 = 0x6a09e667;
27422
+ this.h1 = 0xbb67ae85;
27423
+ this.h2 = 0x3c6ef372;
27424
+ this.h3 = 0xa54ff53a;
27425
+ this.h4 = 0x510e527f;
27426
+ this.h5 = 0x9b05688c;
27427
+ this.h6 = 0x1f83d9ab;
27428
+ this.h7 = 0x5be0cd19;
27429
+ }
27430
+
27431
+ this.block = this.start = this.bytes = this.hBytes = 0;
27432
+ this.finalized = this.hashed = false;
27433
+ this.first = true;
27434
+ this.is224 = is224;
27435
+ }
27436
+
27437
+ Sha256.prototype.update = function (message) {
27438
+ if (this.finalized) {
27439
+ return;
27440
+ }
27441
+ var notString, type = typeof message;
27442
+ if (type !== 'string') {
27443
+ if (type === 'object') {
27444
+ if (message === null) {
27445
+ throw new Error(ERROR);
27446
+ } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
27447
+ message = new Uint8Array(message);
27448
+ } else if (!Array.isArray(message)) {
27449
+ if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
27450
+ throw new Error(ERROR);
27451
+ }
27452
+ }
27453
+ } else {
27454
+ throw new Error(ERROR);
27455
+ }
27456
+ notString = true;
27457
+ }
27458
+ var code, index = 0, i, length = message.length, blocks = this.blocks;
27459
+
27460
+ while (index < length) {
27461
+ if (this.hashed) {
27462
+ this.hashed = false;
27463
+ blocks[0] = this.block;
27464
+ blocks[16] = blocks[1] = blocks[2] = blocks[3] =
27465
+ blocks[4] = blocks[5] = blocks[6] = blocks[7] =
27466
+ blocks[8] = blocks[9] = blocks[10] = blocks[11] =
27467
+ blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
27468
+ }
27469
+
27470
+ if (notString) {
27471
+ for (i = this.start; index < length && i < 64; ++index) {
27472
+ blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
27473
+ }
27474
+ } else {
27475
+ for (i = this.start; index < length && i < 64; ++index) {
27476
+ code = message.charCodeAt(index);
27477
+ if (code < 0x80) {
27478
+ blocks[i >> 2] |= code << SHIFT[i++ & 3];
27479
+ } else if (code < 0x800) {
27480
+ blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];
27481
+ blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
27482
+ } else if (code < 0xd800 || code >= 0xe000) {
27483
+ blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];
27484
+ blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
27485
+ blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
27486
+ } else {
27487
+ code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));
27488
+ blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];
27489
+ blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];
27490
+ blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];
27491
+ blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];
27492
+ }
27493
+ }
27494
+ }
27495
+
27496
+ this.lastByteIndex = i;
27497
+ this.bytes += i - this.start;
27498
+ if (i >= 64) {
27499
+ this.block = blocks[16];
27500
+ this.start = i - 64;
27501
+ this.hash();
27502
+ this.hashed = true;
27503
+ } else {
27504
+ this.start = i;
27505
+ }
27506
+ }
27507
+ if (this.bytes > 4294967295) {
27508
+ this.hBytes += this.bytes / 4294967296 << 0;
27509
+ this.bytes = this.bytes % 4294967296;
27510
+ }
27511
+ return this;
27512
+ };
27513
+
27514
+ Sha256.prototype.finalize = function () {
27515
+ if (this.finalized) {
27516
+ return;
27517
+ }
27518
+ this.finalized = true;
27519
+ var blocks = this.blocks, i = this.lastByteIndex;
27520
+ blocks[16] = this.block;
27521
+ blocks[i >> 2] |= EXTRA[i & 3];
27522
+ this.block = blocks[16];
27523
+ if (i >= 56) {
27524
+ if (!this.hashed) {
27525
+ this.hash();
27526
+ }
27527
+ blocks[0] = this.block;
27528
+ blocks[16] = blocks[1] = blocks[2] = blocks[3] =
27529
+ blocks[4] = blocks[5] = blocks[6] = blocks[7] =
27530
+ blocks[8] = blocks[9] = blocks[10] = blocks[11] =
27531
+ blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
27532
+ }
27533
+ blocks[14] = this.hBytes << 3 | this.bytes >>> 29;
27534
+ blocks[15] = this.bytes << 3;
27535
+ this.hash();
27536
+ };
27537
+
27538
+ Sha256.prototype.hash = function () {
27539
+ var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4, f = this.h5, g = this.h6,
27540
+ h = this.h7, blocks = this.blocks, j, s0, s1, maj, t1, t2, ch, ab, da, cd, bc;
27541
+
27542
+ for (j = 16; j < 64; ++j) {
27543
+ // rightrotate
27544
+ t1 = blocks[j - 15];
27545
+ s0 = ((t1 >>> 7) | (t1 << 25)) ^ ((t1 >>> 18) | (t1 << 14)) ^ (t1 >>> 3);
27546
+ t1 = blocks[j - 2];
27547
+ s1 = ((t1 >>> 17) | (t1 << 15)) ^ ((t1 >>> 19) | (t1 << 13)) ^ (t1 >>> 10);
27548
+ blocks[j] = blocks[j - 16] + s0 + blocks[j - 7] + s1 << 0;
27549
+ }
27550
+
27551
+ bc = b & c;
27552
+ for (j = 0; j < 64; j += 4) {
27553
+ if (this.first) {
27554
+ if (this.is224) {
27555
+ ab = 300032;
27556
+ t1 = blocks[0] - 1413257819;
27557
+ h = t1 - 150054599 << 0;
27558
+ d = t1 + 24177077 << 0;
27559
+ } else {
27560
+ ab = 704751109;
27561
+ t1 = blocks[0] - 210244248;
27562
+ h = t1 - 1521486534 << 0;
27563
+ d = t1 + 143694565 << 0;
27564
+ }
27565
+ this.first = false;
27566
+ } else {
27567
+ s0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));
27568
+ s1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));
27569
+ ab = a & b;
27570
+ maj = ab ^ (a & c) ^ bc;
27571
+ ch = (e & f) ^ (~e & g);
27572
+ t1 = h + s1 + ch + K[j] + blocks[j];
27573
+ t2 = s0 + maj;
27574
+ h = d + t1 << 0;
27575
+ d = t1 + t2 << 0;
27576
+ }
27577
+ s0 = ((d >>> 2) | (d << 30)) ^ ((d >>> 13) | (d << 19)) ^ ((d >>> 22) | (d << 10));
27578
+ s1 = ((h >>> 6) | (h << 26)) ^ ((h >>> 11) | (h << 21)) ^ ((h >>> 25) | (h << 7));
27579
+ da = d & a;
27580
+ maj = da ^ (d & b) ^ ab;
27581
+ ch = (h & e) ^ (~h & f);
27582
+ t1 = g + s1 + ch + K[j + 1] + blocks[j + 1];
27583
+ t2 = s0 + maj;
27584
+ g = c + t1 << 0;
27585
+ c = t1 + t2 << 0;
27586
+ s0 = ((c >>> 2) | (c << 30)) ^ ((c >>> 13) | (c << 19)) ^ ((c >>> 22) | (c << 10));
27587
+ s1 = ((g >>> 6) | (g << 26)) ^ ((g >>> 11) | (g << 21)) ^ ((g >>> 25) | (g << 7));
27588
+ cd = c & d;
27589
+ maj = cd ^ (c & a) ^ da;
27590
+ ch = (g & h) ^ (~g & e);
27591
+ t1 = f + s1 + ch + K[j + 2] + blocks[j + 2];
27592
+ t2 = s0 + maj;
27593
+ f = b + t1 << 0;
27594
+ b = t1 + t2 << 0;
27595
+ s0 = ((b >>> 2) | (b << 30)) ^ ((b >>> 13) | (b << 19)) ^ ((b >>> 22) | (b << 10));
27596
+ s1 = ((f >>> 6) | (f << 26)) ^ ((f >>> 11) | (f << 21)) ^ ((f >>> 25) | (f << 7));
27597
+ bc = b & c;
27598
+ maj = bc ^ (b & d) ^ cd;
27599
+ ch = (f & g) ^ (~f & h);
27600
+ t1 = e + s1 + ch + K[j + 3] + blocks[j + 3];
27601
+ t2 = s0 + maj;
27602
+ e = a + t1 << 0;
27603
+ a = t1 + t2 << 0;
27604
+ }
27605
+
27606
+ this.h0 = this.h0 + a << 0;
27607
+ this.h1 = this.h1 + b << 0;
27608
+ this.h2 = this.h2 + c << 0;
27609
+ this.h3 = this.h3 + d << 0;
27610
+ this.h4 = this.h4 + e << 0;
27611
+ this.h5 = this.h5 + f << 0;
27612
+ this.h6 = this.h6 + g << 0;
27613
+ this.h7 = this.h7 + h << 0;
27614
+ };
27615
+
27616
+ Sha256.prototype.hex = function () {
27617
+ this.finalize();
27618
+
27619
+ var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5,
27620
+ h6 = this.h6, h7 = this.h7;
27621
+
27622
+ var hex = HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +
27623
+ HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +
27624
+ HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +
27625
+ HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +
27626
+ HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +
27627
+ HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +
27628
+ HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +
27629
+ HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +
27630
+ HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +
27631
+ HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +
27632
+ HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +
27633
+ HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +
27634
+ HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F] +
27635
+ HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +
27636
+ HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +
27637
+ HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +
27638
+ HEX_CHARS[(h4 >> 28) & 0x0F] + HEX_CHARS[(h4 >> 24) & 0x0F] +
27639
+ HEX_CHARS[(h4 >> 20) & 0x0F] + HEX_CHARS[(h4 >> 16) & 0x0F] +
27640
+ HEX_CHARS[(h4 >> 12) & 0x0F] + HEX_CHARS[(h4 >> 8) & 0x0F] +
27641
+ HEX_CHARS[(h4 >> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F] +
27642
+ HEX_CHARS[(h5 >> 28) & 0x0F] + HEX_CHARS[(h5 >> 24) & 0x0F] +
27643
+ HEX_CHARS[(h5 >> 20) & 0x0F] + HEX_CHARS[(h5 >> 16) & 0x0F] +
27644
+ HEX_CHARS[(h5 >> 12) & 0x0F] + HEX_CHARS[(h5 >> 8) & 0x0F] +
27645
+ HEX_CHARS[(h5 >> 4) & 0x0F] + HEX_CHARS[h5 & 0x0F] +
27646
+ HEX_CHARS[(h6 >> 28) & 0x0F] + HEX_CHARS[(h6 >> 24) & 0x0F] +
27647
+ HEX_CHARS[(h6 >> 20) & 0x0F] + HEX_CHARS[(h6 >> 16) & 0x0F] +
27648
+ HEX_CHARS[(h6 >> 12) & 0x0F] + HEX_CHARS[(h6 >> 8) & 0x0F] +
27649
+ HEX_CHARS[(h6 >> 4) & 0x0F] + HEX_CHARS[h6 & 0x0F];
27650
+ if (!this.is224) {
27651
+ hex += HEX_CHARS[(h7 >> 28) & 0x0F] + HEX_CHARS[(h7 >> 24) & 0x0F] +
27652
+ HEX_CHARS[(h7 >> 20) & 0x0F] + HEX_CHARS[(h7 >> 16) & 0x0F] +
27653
+ HEX_CHARS[(h7 >> 12) & 0x0F] + HEX_CHARS[(h7 >> 8) & 0x0F] +
27654
+ HEX_CHARS[(h7 >> 4) & 0x0F] + HEX_CHARS[h7 & 0x0F];
27655
+ }
27656
+ return hex;
27657
+ };
27658
+
27659
+ Sha256.prototype.toString = Sha256.prototype.hex;
27660
+
27661
+ Sha256.prototype.digest = function () {
27662
+ this.finalize();
27663
+
27664
+ var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5,
27665
+ h6 = this.h6, h7 = this.h7;
27666
+
27667
+ var arr = [
27668
+ (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, h0 & 0xFF,
27669
+ (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, h1 & 0xFF,
27670
+ (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, h2 & 0xFF,
27671
+ (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, h3 & 0xFF,
27672
+ (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, h4 & 0xFF,
27673
+ (h5 >> 24) & 0xFF, (h5 >> 16) & 0xFF, (h5 >> 8) & 0xFF, h5 & 0xFF,
27674
+ (h6 >> 24) & 0xFF, (h6 >> 16) & 0xFF, (h6 >> 8) & 0xFF, h6 & 0xFF
27675
+ ];
27676
+ if (!this.is224) {
27677
+ arr.push((h7 >> 24) & 0xFF, (h7 >> 16) & 0xFF, (h7 >> 8) & 0xFF, h7 & 0xFF);
27678
+ }
27679
+ return arr;
27680
+ };
27681
+
27682
+ Sha256.prototype.array = Sha256.prototype.digest;
27683
+
27684
+ Sha256.prototype.arrayBuffer = function () {
27685
+ this.finalize();
27686
+
27687
+ var buffer = new ArrayBuffer(this.is224 ? 28 : 32);
27688
+ var dataView = new DataView(buffer);
27689
+ dataView.setUint32(0, this.h0);
27690
+ dataView.setUint32(4, this.h1);
27691
+ dataView.setUint32(8, this.h2);
27692
+ dataView.setUint32(12, this.h3);
27693
+ dataView.setUint32(16, this.h4);
27694
+ dataView.setUint32(20, this.h5);
27695
+ dataView.setUint32(24, this.h6);
27696
+ if (!this.is224) {
27697
+ dataView.setUint32(28, this.h7);
27698
+ }
27699
+ return buffer;
27700
+ };
27701
+
27702
+ function HmacSha256(key, is224, sharedMemory) {
27703
+ var i, type = typeof key;
27704
+ if (type === 'string') {
27705
+ var bytes = [], length = key.length, index = 0, code;
27706
+ for (i = 0; i < length; ++i) {
27707
+ code = key.charCodeAt(i);
27708
+ if (code < 0x80) {
27709
+ bytes[index++] = code;
27710
+ } else if (code < 0x800) {
27711
+ bytes[index++] = (0xc0 | (code >> 6));
27712
+ bytes[index++] = (0x80 | (code & 0x3f));
27713
+ } else if (code < 0xd800 || code >= 0xe000) {
27714
+ bytes[index++] = (0xe0 | (code >> 12));
27715
+ bytes[index++] = (0x80 | ((code >> 6) & 0x3f));
27716
+ bytes[index++] = (0x80 | (code & 0x3f));
27717
+ } else {
27718
+ code = 0x10000 + (((code & 0x3ff) << 10) | (key.charCodeAt(++i) & 0x3ff));
27719
+ bytes[index++] = (0xf0 | (code >> 18));
27720
+ bytes[index++] = (0x80 | ((code >> 12) & 0x3f));
27721
+ bytes[index++] = (0x80 | ((code >> 6) & 0x3f));
27722
+ bytes[index++] = (0x80 | (code & 0x3f));
27723
+ }
27724
+ }
27725
+ key = bytes;
27726
+ } else {
27727
+ if (type === 'object') {
27728
+ if (key === null) {
27729
+ throw new Error(ERROR);
27730
+ } else if (ARRAY_BUFFER && key.constructor === ArrayBuffer) {
27731
+ key = new Uint8Array(key);
27732
+ } else if (!Array.isArray(key)) {
27733
+ if (!ARRAY_BUFFER || !ArrayBuffer.isView(key)) {
27734
+ throw new Error(ERROR);
27735
+ }
27736
+ }
27737
+ } else {
27738
+ throw new Error(ERROR);
27739
+ }
27740
+ }
27741
+
27742
+ if (key.length > 64) {
27743
+ key = (new Sha256(is224, true)).update(key).array();
27744
+ }
27745
+
27746
+ var oKeyPad = [], iKeyPad = [];
27747
+ for (i = 0; i < 64; ++i) {
27748
+ var b = key[i] || 0;
27749
+ oKeyPad[i] = 0x5c ^ b;
27750
+ iKeyPad[i] = 0x36 ^ b;
27751
+ }
27752
+
27753
+ Sha256.call(this, is224, sharedMemory);
27754
+
27755
+ this.update(iKeyPad);
27756
+ this.oKeyPad = oKeyPad;
27757
+ this.inner = true;
27758
+ this.sharedMemory = sharedMemory;
27759
+ }
27760
+ HmacSha256.prototype = new Sha256();
27761
+
27762
+ HmacSha256.prototype.finalize = function () {
27763
+ Sha256.prototype.finalize.call(this);
27764
+ if (this.inner) {
27765
+ this.inner = false;
27766
+ var innerHash = this.array();
27767
+ Sha256.call(this, this.is224, this.sharedMemory);
27768
+ this.update(this.oKeyPad);
27769
+ this.update(innerHash);
27770
+ Sha256.prototype.finalize.call(this);
27771
+ }
27772
+ };
27773
+
27774
+ var exports = createMethod();
27775
+ exports.sha256 = exports;
27776
+ exports.sha224 = createMethod(true);
27777
+ exports.sha256.hmac = createHmacMethod();
27778
+ exports.sha224.hmac = createHmacMethod(true);
27779
+
27780
+ if (COMMON_JS) {
27781
+ module.exports = exports;
27782
+ } else {
27783
+ root.sha256 = exports.sha256;
27784
+ root.sha224 = exports.sha224;
27785
+ if (AMD) {
27786
+ !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
27787
+ return exports;
27788
+ }).call(exports, __webpack_require__, exports, module),
27789
+ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
27790
+ }
27791
+ }
27792
+ })();
27793
+
27794
+
27152
27795
  /***/ }),
27153
27796
 
27154
27797
  /***/ "../../node_modules/redux-saga/dist/redux-saga-core-npm-proxy.esm.js":
@@ -29430,6 +30073,11 @@ function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=a
29430
30073
  /******/ }
29431
30074
  /******/
29432
30075
  /************************************************************************/
30076
+ /******/ /* webpack/runtime/amd options */
30077
+ /******/ (() => {
30078
+ /******/ __webpack_require__.amdO = {};
30079
+ /******/ })();
30080
+ /******/
29433
30081
  /******/ /* webpack/runtime/compat get default export */
29434
30082
  /******/ (() => {
29435
30083
  /******/ // getDefaultExport function for compatibility with non-harmony modules
@@ -29454,6 +30102,18 @@ function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=a
29454
30102
  /******/ };
29455
30103
  /******/ })();
29456
30104
  /******/
30105
+ /******/ /* webpack/runtime/global */
30106
+ /******/ (() => {
30107
+ /******/ __webpack_require__.g = (function() {
30108
+ /******/ if (typeof globalThis === 'object') return globalThis;
30109
+ /******/ try {
30110
+ /******/ return this || new Function('return this')();
30111
+ /******/ } catch (e) {
30112
+ /******/ if (typeof window === 'object') return window;
30113
+ /******/ }
30114
+ /******/ })();
30115
+ /******/ })();
30116
+ /******/
29457
30117
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
29458
30118
  /******/ (() => {
29459
30119
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))