@frontegg/js 6.147.0-alpha.4 → 6.147.0-alpha.6

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.
@@ -294,26 +294,29 @@ __webpack_require__.r(__webpack_exports__);
294
294
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
295
295
  /* harmony export */ "FronteggApp": () => (/* binding */ FronteggApp)
296
296
  /* harmony export */ });
297
- /* 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");
298
- /* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
299
- /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
300
- /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
301
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../node_modules/@babel/runtime/regenerator/index.js");
302
- /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4__);
303
- /* harmony import */ var _frontegg_redux_store__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @frontegg/redux-store */ "../../dist/@frontegg/redux-store/toolkit/index.js");
304
- /* harmony import */ var _frontegg_redux_store__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @frontegg/redux-store */ "../../dist/@frontegg/redux-store/auth/Entitlements/utils.js");
305
- /* harmony import */ var _frontegg_types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @frontegg/types */ "../../dist/@frontegg/types/Metadata/index.js");
306
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils */ "../../dist/@frontegg/js/utils/index.js");
307
- /* harmony import */ var _AppHolder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../AppHolder */ "../../dist/@frontegg/js/AppHolder/index.js");
308
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/fetch.js");
309
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/ContextHolder/index.js");
310
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/interfaces.js");
311
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/feature-flags/index.js");
312
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/index.js");
313
- /* harmony import */ var _frontegg_types__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @frontegg/types */ "../../dist/@frontegg/types/index.js");
314
- /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../version */ "../../dist/@frontegg/js/version.js");
315
- /* harmony import */ var _utils_mockFlagsList__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/mockFlagsList */ "../../dist/@frontegg/js/utils/mockFlagsList.js");
316
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils */ "../../dist/@frontegg/js/FronteggApp/utils.js");
297
+ /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ "../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js");
298
+ /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "../../node_modules/@babel/runtime/helpers/esm/extends.js");
299
+ /* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/asyncToGenerator */ "../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js");
300
+ /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
301
+ /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../node_modules/@babel/runtime/helpers/esm/createClass.js");
302
+ /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/regenerator */ "../../node_modules/@babel/runtime/regenerator/index.js");
303
+ /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5__);
304
+ /* harmony import */ var _frontegg_redux_store__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @frontegg/redux-store */ "../../dist/@frontegg/redux-store/toolkit/index.js");
305
+ /* harmony import */ var _frontegg_redux_store__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @frontegg/redux-store */ "../../dist/@frontegg/redux-store/auth/Entitlements/utils.js");
306
+ /* harmony import */ var _frontegg_types__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @frontegg/types */ "../../dist/@frontegg/types/Metadata/index.js");
307
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils */ "../../dist/@frontegg/js/utils/index.js");
308
+ /* harmony import */ var _AppHolder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../AppHolder */ "../../dist/@frontegg/js/AppHolder/index.js");
309
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/fetch.js");
310
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/auth/constants.js");
311
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/ContextHolder/index.js");
312
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/interfaces.js");
313
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/feature-flags/index.js");
314
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/index.js");
315
+ /* harmony import */ var _frontegg_types__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @frontegg/types */ "../../dist/@frontegg/types/index.js");
316
+ /* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../version */ "../../dist/@frontegg/js/version.js");
317
+ /* harmony import */ var _utils_mockFlagsList__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/mockFlagsList */ "../../dist/@frontegg/js/utils/mockFlagsList.js");
318
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils */ "../../dist/@frontegg/js/FronteggApp/utils.js");
319
+
317
320
 
318
321
 
319
322
 
@@ -337,12 +340,12 @@ var FronteggApp = /*#__PURE__*/function () {
337
340
  _options$authOptions;
338
341
  var iframeRendering = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
339
342
  var allowMultipleRenderers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
340
- (0,_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_2__["default"])(this, FronteggApp);
343
+ (0,_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_3__["default"])(this, FronteggApp);
341
344
  this.name = void 0;
342
345
  this.iframeRendering = void 0;
343
346
  this.options = void 0;
344
347
  this.loading = true;
345
- this.cdnUrl = "https://assets.frontegg.com/admin-box/".concat(_version__WEBPACK_IMPORTED_MODULE_7__["default"].cdnVersion);
348
+ this.cdnUrl = "https://assets.frontegg.com/admin-box/".concat(_version__WEBPACK_IMPORTED_MODULE_8__["default"].cdnVersion);
346
349
  this.customElementName = '';
347
350
  this.adminPortalEl = void 0;
348
351
  this.adminPortalRenderer = void 0;
@@ -356,12 +359,12 @@ var FronteggApp = /*#__PURE__*/function () {
356
359
  this.store = void 0;
357
360
  this.loadingListeners = [];
358
361
  this.updateLocalizations = void 0;
359
- this.loadAdminBoxMetadata = /*#__PURE__*/(0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee() {
362
+ this.loadAdminBoxMetadata = /*#__PURE__*/(0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().mark(function _callee() {
360
363
  var Get, _data$rows$0$configur, _data$rows, _data$rows$, data;
361
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee$(_context) {
364
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee$(_context) {
362
365
  while (1) switch (_context.prev = _context.next) {
363
366
  case 0:
364
- Get = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_10__.Get;
367
+ Get = _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_11__.Get;
365
368
  if (_this.options.metadata) {
366
369
  _context.next = 12;
367
370
  break;
@@ -381,17 +384,17 @@ var FronteggApp = /*#__PURE__*/function () {
381
384
  _context.t0 = _context["catch"](2);
382
385
  console.error('failed to get admin portal metadata', _context.t0);
383
386
  case 12:
384
- _frontegg_types__WEBPACK_IMPORTED_MODULE_11__.Metadata.set(_this.options.metadata, _this.name);
387
+ _frontegg_types__WEBPACK_IMPORTED_MODULE_12__.Metadata.set(_this.options.metadata, _this.name);
385
388
  case 13:
386
389
  case "end":
387
390
  return _context.stop();
388
391
  }
389
392
  }, _callee, null, [[2, 9]]);
390
393
  }));
391
- this.requestAuthorize = /*#__PURE__*/(0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee2() {
394
+ this.requestAuthorize = /*#__PURE__*/(0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().mark(function _callee2() {
392
395
  var _this$options$authOpt, _this$options$authOpt2;
393
396
  var shouldRequestHostedLoginAuthorize;
394
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee2$(_context2) {
397
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee2$(_context2) {
395
398
  while (1) switch (_context2.prev = _context2.next) {
396
399
  case 0:
397
400
  shouldRequestHostedLoginAuthorize = (_this$options$authOpt = _this.options.authOptions) == null ? void 0 : (_this$options$authOpt2 = _this$options$authOpt.hostedLoginOptions) == null ? void 0 : _this$options$authOpt2.loadUserOnFirstLoad;
@@ -417,28 +420,28 @@ var FronteggApp = /*#__PURE__*/function () {
417
420
  }
418
421
  }, _callee2);
419
422
  }));
420
- this.loadFeatureFlags = /*#__PURE__*/(0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee3() {
423
+ this.loadFeatureFlags = /*#__PURE__*/(0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().mark(function _callee3() {
421
424
  var flags;
422
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee3$(_context3) {
425
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee3$(_context3) {
423
426
  while (1) switch (_context3.prev = _context3.next) {
424
427
  case 0:
425
428
  if (!(_this.options.previewMode || _this.options.builderMode)) {
426
429
  _context3.next = 4;
427
430
  break;
428
431
  }
429
- _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.FeatureFlags.set(_utils_mockFlagsList__WEBPACK_IMPORTED_MODULE_8__.mockFlagsList, _this.name);
432
+ _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_13__.FeatureFlags.set(_utils_mockFlagsList__WEBPACK_IMPORTED_MODULE_9__.mockFlagsList, _this.name);
430
433
  _context3.next = 15;
431
434
  break;
432
435
  case 4:
433
436
  _context3.prev = 4;
434
437
  _context3.next = 7;
435
- return _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.loadFeatureFlags();
438
+ return _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_13__.loadFeatureFlags();
436
439
  case 7:
437
440
  flags = _context3.sent;
438
441
  if (_this.options.overrideFeatureFlags) {
439
442
  Object.assign(flags, _this.options.overrideFeatureFlags);
440
443
  }
441
- _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.FeatureFlags.set(flags, _this.name);
444
+ _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_13__.FeatureFlags.set(flags, _this.name);
442
445
  _context3.next = 15;
443
446
  break;
444
447
  case 12:
@@ -452,7 +455,10 @@ var FronteggApp = /*#__PURE__*/function () {
452
455
  }, _callee3, null, [[4, 12]]);
453
456
  }));
454
457
  this.setFeatureFlagsForPreview = function (previewFeatureFlags) {
455
- _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_12__.FeatureFlags.set((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, _utils_mockFlagsList__WEBPACK_IMPORTED_MODULE_8__.mockFlagsList, previewFeatureFlags), _this.name);
458
+ _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_13__.FeatureFlags.set((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, _utils_mockFlagsList__WEBPACK_IMPORTED_MODULE_9__.mockFlagsList, previewFeatureFlags), _this.name);
459
+ };
460
+ this.queryFeatureFlags = function (flags) {
461
+ return _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_13__.FeatureFlags.getFeatureFlags(flags, _this.name);
456
462
  };
457
463
  this.updateLocalizationsSetter = function (localizationUpdateFn) {
458
464
  _this.updateLocalizations = localizationUpdateFn;
@@ -461,12 +467,31 @@ var FronteggApp = /*#__PURE__*/function () {
461
467
  var _this$store$getState$;
462
468
  return (_this$store$getState$ = _this.store.getState().auth.user) == null ? void 0 : _this$store$getState$.entitlements;
463
469
  };
464
- var appName = (0,_utils__WEBPACK_IMPORTED_MODULE_5__.formatName)(name);
470
+ this.getUserFromStore = function () {
471
+ return _this.store.getState().auth.user;
472
+ };
473
+ this.getEntitlementsQueryData = function (customAttributes) {
474
+ var user = _this.getUserFromStore();
475
+ var entitlements = _this.getEntitlementsFromStore();
476
+ var attributes = {
477
+ custom: customAttributes,
478
+ frontegg: user
479
+ };
480
+ var _this$queryFeatureFla = _this.queryFeatureFlags([_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__.USE_ENTITLEMENTS_V2_ENDPOINT_FF]),
481
+ _this$queryFeatureFla2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_0__["default"])(_this$queryFeatureFla, 1),
482
+ useEntitlementsV2 = _this$queryFeatureFla2[0];
483
+ return {
484
+ entitlements: entitlements,
485
+ attributes: attributes,
486
+ isV2: useEntitlementsV2
487
+ };
488
+ };
489
+ var appName = (0,_utils__WEBPACK_IMPORTED_MODULE_6__.formatName)(name);
465
490
  var customElementName = "frontegg-app-".concat(appName);
466
491
  this.iframeRendering = iframeRendering;
467
492
  this.name = appName;
468
- this.options = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, _options, {
469
- contextOptions: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
493
+ this.options = (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, _options, {
494
+ contextOptions: (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({
470
495
  requestCredentials: 'include'
471
496
  }, _options.contextOptions)
472
497
  });
@@ -474,7 +499,7 @@ var FronteggApp = /*#__PURE__*/function () {
474
499
  this.cdnUrl = this.options.cdnUrl;
475
500
  }
476
501
  this.customElementName = customElementName;
477
- var authOptions = this.options.authOptions ? (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this.options.authOptions, {
502
+ var authOptions = this.options.authOptions ? (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, this.options.authOptions, {
478
503
  hostedLoginBox: this.options.hostedLoginBox
479
504
  }) : {
480
505
  hostedLoginBox: this.options.hostedLoginBox
@@ -487,7 +512,7 @@ var FronteggApp = /*#__PURE__*/function () {
487
512
  }
488
513
  } else {
489
514
  var _this$options$authOpt4, _this$options$auditsO;
490
- this.store = (0,_frontegg_redux_store__WEBPACK_IMPORTED_MODULE_13__.createFronteggStore)({
515
+ this.store = (0,_frontegg_redux_store__WEBPACK_IMPORTED_MODULE_15__.createFronteggStore)({
491
516
  context: this.options.contextOptions,
492
517
  appName: this.name
493
518
  }, this, this.options.previewMode, authOptions, {
@@ -495,35 +520,35 @@ var FronteggApp = /*#__PURE__*/function () {
495
520
  audits: (_this$options$auditsO = this.options.auditsOptions) != null ? _this$options$auditsO : {}
496
521
  }, false, this.options.urlStrategy);
497
522
  }
498
- _AppHolder__WEBPACK_IMPORTED_MODULE_6__.AppHolder.setInstance(appName, this);
523
+ _AppHolder__WEBPACK_IMPORTED_MODULE_7__.AppHolder.setInstance(appName, this);
499
524
  this.setEntitlementsOptions(_options.entitlementsOptions);
500
525
  this.setSessionContext({
501
526
  enableSessionPerTenant: (_options$authOptions = _options.authOptions) == null ? void 0 : _options$authOptions.enableSessionPerTenant
502
527
  });
503
528
 
504
529
  // for feature flags (for entitlements)
505
- _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__.ContextHolder.setAppName(appName);
530
+ _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_16__.ContextHolder.setAppName(appName);
506
531
  }
507
532
 
508
533
  /**
509
534
  * Set entitlements related options in context holder according to frontegg options
510
535
  * @param entitlementsOptions - entitlements options from frontegg options
511
536
  */
512
- (0,_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_3__["default"])(FronteggApp, [{
537
+ (0,_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_4__["default"])(FronteggApp, [{
513
538
  key: "setEntitlementsOptions",
514
539
  value: function setEntitlementsOptions(entitlementsOptions) {
515
- _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__.ContextHolder.setEntitlementsOptions((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, entitlementsOptions));
540
+ _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_16__.ContextHolder.setEntitlementsOptions((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, entitlementsOptions));
516
541
  }
517
542
  }, {
518
543
  key: "setSessionContext",
519
544
  value: function setSessionContext(sessionContext) {
520
- _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__.ContextHolder.setSessionContext((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, sessionContext));
545
+ _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_16__.ContextHolder.setSessionContext((0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({}, sessionContext));
521
546
  }
522
547
  }, {
523
548
  key: "initContainers",
524
549
  value: function () {
525
- var _initContainers = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee4(elements) {
526
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee4$(_context4) {
550
+ var _initContainers = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().mark(function _callee4(elements) {
551
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee4$(_context4) {
527
552
  while (1) switch (_context4.prev = _context4.next) {
528
553
  case 0:
529
554
  this.adminPortalEl = elements.adminPortalEl;
@@ -549,7 +574,7 @@ var FronteggApp = /*#__PURE__*/function () {
549
574
  case 11:
550
575
  if (!this.options.previewMode && !this.options.customLoginBox) {
551
576
  this.loadLoginBox();
552
- (0,_utils__WEBPACK_IMPORTED_MODULE_9__.loadGTM)(this.name);
577
+ (0,_utils__WEBPACK_IMPORTED_MODULE_10__.loadGTM)(this.name);
553
578
  }
554
579
  if (!this.options.lazyLoadAdminPortal) {
555
580
  this.loadScript('FronteggAdminPortal');
@@ -568,7 +593,7 @@ var FronteggApp = /*#__PURE__*/function () {
568
593
  }, {
569
594
  key: "updateMetadata",
570
595
  value: function updateMetadata(metadata) {
571
- _frontegg_types__WEBPACK_IMPORTED_MODULE_11__.Metadata.set(metadata, this.name);
596
+ _frontegg_types__WEBPACK_IMPORTED_MODULE_12__.Metadata.set(metadata, this.name);
572
597
  if (metadata != null && metadata.localizations) {
573
598
  var _this$updateLocalizat;
574
599
  (_this$updateLocalizat = this.updateLocalizations) == null ? void 0 : _this$updateLocalizat.call(this, metadata.localizations);
@@ -644,8 +669,8 @@ var FronteggApp = /*#__PURE__*/function () {
644
669
  script.onload = function () {
645
670
  if (window["".concat(component, "Init")]) {
646
671
  resolve(window["".concat(component, "Init")]({
647
- FronteggRestApi: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_15__,
648
- FronteggTypes: _frontegg_types__WEBPACK_IMPORTED_MODULE_16__
672
+ FronteggRestApi: _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__,
673
+ FronteggTypes: _frontegg_types__WEBPACK_IMPORTED_MODULE_18__
649
674
  }));
650
675
  } else {
651
676
  resolve(window[component]);
@@ -662,9 +687,9 @@ var FronteggApp = /*#__PURE__*/function () {
662
687
  }, {
663
688
  key: "loadLoginBox",
664
689
  value: function () {
665
- var _loadLoginBox = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee5() {
690
+ var _loadLoginBox = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().mark(function _callee5() {
666
691
  var FronteggLoginBox;
667
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee5$(_context5) {
692
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee5$(_context5) {
668
693
  while (1) switch (_context5.prev = _context5.next) {
669
694
  case 0:
670
695
  _context5.next = 2;
@@ -698,12 +723,12 @@ var FronteggApp = /*#__PURE__*/function () {
698
723
  }, {
699
724
  key: "showAdminPortal",
700
725
  value: function () {
701
- var _showAdminPortal = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee6() {
726
+ var _showAdminPortal = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().mark(function _callee6() {
702
727
  var FronteggAdminPortal;
703
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee6$(_context6) {
728
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee6$(_context6) {
704
729
  while (1) switch (_context6.prev = _context6.next) {
705
730
  case 0:
706
- _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__.ContextHolder.setRequestSource(_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_17__.RequestSource.AdminPortal);
731
+ _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_16__.ContextHolder.setRequestSource(_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_19__.RequestSource.AdminPortal);
707
732
  _context6.next = 3;
708
733
  return this.loadScript('FronteggAdminPortal');
709
734
  case 3:
@@ -731,8 +756,8 @@ var FronteggApp = /*#__PURE__*/function () {
731
756
  var searchParams = new URLSearchParams(window.location.search);
732
757
  (_this$adminPortalRend = this.adminPortalRenderer) == null ? void 0 : _this$adminPortalRend.unmount();
733
758
  // unmount is removing url search params, therefore we need to restore them after unmount
734
- (0,_utils__WEBPACK_IMPORTED_MODULE_5__.restoreSearchParams)(searchParams);
735
- _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_14__.ContextHolder.setRequestSource(null);
759
+ (0,_utils__WEBPACK_IMPORTED_MODULE_6__.restoreSearchParams)(searchParams);
760
+ _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_16__.ContextHolder.setRequestSource(null);
736
761
  } catch (e) {
737
762
  console.error('Failed to unmount admin portal', e);
738
763
  }
@@ -740,16 +765,16 @@ var FronteggApp = /*#__PURE__*/function () {
740
765
  }, {
741
766
  key: "showCheckoutDialog",
742
767
  value: function () {
743
- var _showCheckoutDialog = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee7(opts) {
768
+ var _showCheckoutDialog = (0,_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__["default"])( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().mark(function _callee7(opts) {
744
769
  var FronteggAdminPortal;
745
- return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function _callee7$(_context7) {
770
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_5___default().wrap(function _callee7$(_context7) {
746
771
  while (1) switch (_context7.prev = _context7.next) {
747
772
  case 0:
748
773
  _context7.next = 2;
749
774
  return this.loadScript('FronteggAdminPortal');
750
775
  case 2:
751
776
  FronteggAdminPortal = _context7.sent;
752
- this.checkoutDialogRenderer = FronteggAdminPortal.renderCheckoutDialog(this.checkoutDialogEl, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
777
+ this.checkoutDialogRenderer = FronteggAdminPortal.renderCheckoutDialog(this.checkoutDialogEl, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__["default"])({
753
778
  injector: this
754
779
  }, opts, {
755
780
  options: this.options
@@ -783,40 +808,49 @@ var FronteggApp = /*#__PURE__*/function () {
783
808
  key: "getFeatureEntitlements",
784
809
  value:
785
810
  /**
786
- @param key
811
+ @param key feature key
812
+ @param customAttributes user attributes
787
813
  @returns if the user is entitled to the given feature. Attaching the justification if not
788
814
  @throws when entitlement is not enabled via frontegg options
789
815
  */
790
- function getFeatureEntitlements(key) {
791
- var entitlements = this.getEntitlementsFromStore();
792
- return (0,_frontegg_redux_store__WEBPACK_IMPORTED_MODULE_18__.getFeatureEntitlements)(entitlements, key);
816
+ function getFeatureEntitlements(key, customAttributes) {
817
+ var _this$getEntitlements = this.getEntitlementsQueryData(customAttributes),
818
+ entitlements = _this$getEntitlements.entitlements,
819
+ attributes = _this$getEntitlements.attributes,
820
+ isV2 = _this$getEntitlements.isV2;
821
+ return (0,_frontegg_redux_store__WEBPACK_IMPORTED_MODULE_20__.getFeatureEntitlements)(entitlements, key, attributes, isV2);
793
822
  }
794
823
 
795
824
  /**
796
- @param key
825
+ @param key permission key
826
+ @param customAttributes user attributes
797
827
  @returns if the user is entitled to the given permission. Attaching the justification if not
798
828
  @throws when entitlement is not enabled via frontegg options
799
829
  */
800
830
  }, {
801
831
  key: "getPermissionEntitlements",
802
- value: function getPermissionEntitlements(key) {
803
- var entitlements = this.getEntitlementsFromStore();
804
- return (0,_frontegg_redux_store__WEBPACK_IMPORTED_MODULE_18__.getPermissionEntitlements)(entitlements, key);
832
+ value: function getPermissionEntitlements(key, customAttributes) {
833
+ var _this$getEntitlements2 = this.getEntitlementsQueryData(customAttributes),
834
+ entitlements = _this$getEntitlements2.entitlements,
835
+ attributes = _this$getEntitlements2.attributes,
836
+ isV2 = _this$getEntitlements2.isV2;
837
+ return (0,_frontegg_redux_store__WEBPACK_IMPORTED_MODULE_20__.getPermissionEntitlements)(entitlements, key, attributes, isV2);
805
838
  }
806
839
 
807
840
  /**
808
841
  @param options - including permission or feature key
842
+ @param customAttributes user attributes
809
843
  @returns if the user is entitled to the given permission or feature. Attaching the justification if not
810
844
  @throws when entitlement is not enabled via frontegg options
811
845
  */
812
846
  }, {
813
847
  key: "getEntitlements",
814
- value: function getEntitlements(options) {
848
+ value: function getEntitlements(options, customAttributes) {
815
849
  // we use permissionKey (options key) to decide if the user is using permission key or feature key
816
850
  if ('permissionKey' in options) {
817
- return this.getPermissionEntitlements(options.permissionKey);
851
+ return this.getPermissionEntitlements(options.permissionKey, customAttributes);
818
852
  }
819
- return this.getFeatureEntitlements(options.featureKey);
853
+ return this.getFeatureEntitlements(options.featureKey, customAttributes);
820
854
  }
821
855
 
822
856
  /**
@@ -1380,7 +1414,7 @@ __webpack_require__.r(__webpack_exports__);
1380
1414
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1381
1415
  /* harmony export */ });
1382
1416
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
1383
- cdnVersion: '6.147.0-alpha.4'
1417
+ cdnVersion: '6.147.0-alpha.6'
1384
1418
  });
1385
1419
 
1386
1420
  /***/ }),
@@ -4040,8 +4074,12 @@ __webpack_require__.r(__webpack_exports__);
4040
4074
  /* harmony import */ var fast_deep_equal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-deep-equal */ "../../node_modules/fast-deep-equal/index.js");
4041
4075
  /* harmony import */ var fast_deep_equal__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal__WEBPACK_IMPORTED_MODULE_0__);
4042
4076
  /* 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");
4043
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/index.js");
4077
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/auth/constants.js");
4078
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/index.js");
4044
4079
  /* harmony import */ var _reducer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../reducer */ "../../dist/@frontegg/redux-store/auth/reducer.js");
4080
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../helpers */ "../../dist/@frontegg/redux-store/helpers.js");
4081
+
4082
+
4045
4083
 
4046
4084
 
4047
4085
 
@@ -4082,8 +4120,9 @@ function* loadEntitlements({
4082
4120
  payload
4083
4121
  }) {
4084
4122
  const callback = payload == null ? void 0 : payload.callback;
4123
+ const [useEntitlementsV2] = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_1__.call)(_helpers__WEBPACK_IMPORTED_MODULE_3__.getFeatureFlags, [_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_4__.USE_ENTITLEMENTS_V2_ENDPOINT_FF]);
4085
4124
  try {
4086
- const entitlements = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_1__.call)(_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_3__.api.entitlements.loadEntitlements);
4125
+ const entitlements = yield (0,redux_saga_effects__WEBPACK_IMPORTED_MODULE_1__.call)(useEntitlementsV2 ? _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_5__.api.entitlements.loadEntitlementsV2 : _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_5__.api.entitlements.loadEntitlements);
4087
4126
  yield handleFetchedEntitlements(entitlements);
4088
4127
  callback == null ? void 0 : callback(true);
4089
4128
  } catch (e) {
@@ -4109,8 +4148,21 @@ __webpack_require__.r(__webpack_exports__);
4109
4148
  /* harmony export */ "getFeatureEntitlements": () => (/* binding */ getFeatureEntitlements),
4110
4149
  /* harmony export */ "getPermissionEntitlements": () => (/* binding */ getPermissionEntitlements)
4111
4150
  /* harmony export */ });
4112
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/ContextHolder/index.js");
4113
- /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/entitlements/interfaces.js");
4151
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/ContextHolder/index.js");
4152
+ /* harmony import */ var _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @frontegg/rest-api */ "../../node_modules/@frontegg/rest-api/entitlements/interfaces.js");
4153
+ /* harmony import */ var _frontegg_entitlements_javascript_commons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @frontegg/entitlements-javascript-commons */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/index.js");
4154
+
4155
+
4156
+ /**
4157
+ * NOTE: This file including the usage of user entitlements API V1 and V2. The BE API response is diffrent.
4158
+ * V1 is the initial implementation.
4159
+ * V2 is using the entitlenents package for Rule Based entitlements.
4160
+ *
4161
+ * V1 is still supported with feature flag but it's depracated.
4162
+ *
4163
+ * The entitlements query functions supports both APIs by an optional argument of [isV2] to decide what version to choose.
4164
+ * The function returns the same type.
4165
+ */
4114
4166
 
4115
4167
  const ENTITLEMENTS_NOT_ENABLED_EXCEPTION_TEXT = 'You must first enable entitlements via Frontegg options to use this function';
4116
4168
 
@@ -4119,18 +4171,19 @@ const ENTITLEMENTS_NOT_ENABLED_EXCEPTION_TEXT = 'You must first enable entitleme
4119
4171
  * @throws when entitlement is not enabled via frontegg options
4120
4172
  */
4121
4173
  const guardEntitlementsUsage = () => {
4122
- if (_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_0__.ContextHolder.shouldLoadEntitlements()) return;
4174
+ if (_frontegg_rest_api__WEBPACK_IMPORTED_MODULE_1__.ContextHolder.shouldLoadEntitlements()) return;
4123
4175
  throw new Error(ENTITLEMENTS_NOT_ENABLED_EXCEPTION_TEXT);
4124
4176
  };
4125
4177
 
4126
4178
  /**
4179
+ For user entitlements API V1
4180
+
4127
4181
  @param keyEntitlements permission or feature data object
4128
4182
  @param missingKeyEnum missing key for scenario that the key does not exist in entitlementsValuePerKeys
4129
4183
  @returns if the user is entitled to the given key. Attaching the justification if not
4130
4184
  @throws when entitlement is not enabled via frontegg options
4131
4185
  */
4132
- const getEntitlementsHelper = (keyEntitlements, missingKeyEnum) => {
4133
- guardEntitlementsUsage();
4186
+ const getEntitlementsHelperV1 = (keyEntitlements, missingKeyEnum) => {
4134
4187
  if (!keyEntitlements) {
4135
4188
  return {
4136
4189
  isEntitled: false,
@@ -4150,37 +4203,51 @@ const getEntitlementsHelper = (keyEntitlements, missingKeyEnum) => {
4150
4203
 
4151
4204
  /**
4152
4205
  @param entitlements
4153
- @param key
4206
+ @param key permission key
4207
+ @param attributes entitlements query attributes including comnsumer and frontegg attributes
4208
+ @param isV2 true when need to use entitlements API V2
4154
4209
  @returns if the user is entitled to the given permission. Attaching the justification if not
4155
4210
  @throws when entitlement is not enabled via frontegg options
4156
4211
  */
4157
- const getPermissionEntitlements = (entitlements, key) => {
4158
- var _entitlements$permiss;
4159
- return getEntitlementsHelper(entitlements == null ? void 0 : (_entitlements$permiss = entitlements.permissions) == null ? void 0 : _entitlements$permiss[key], _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_1__.NotEntitledJustification.MISSING_PERMISSION);
4212
+ const getPermissionEntitlements = (entitlements, key, attributes, isV2) => {
4213
+ var _permissions;
4214
+ guardEntitlementsUsage();
4215
+ if (isV2) {
4216
+ return (0,_frontegg_entitlements_javascript_commons__WEBPACK_IMPORTED_MODULE_0__.evaluateIsEntitledToPermissions)(key, entitlements, attributes);
4217
+ }
4218
+ return getEntitlementsHelperV1(entitlements == null ? void 0 : (_permissions = entitlements.permissions) == null ? void 0 : _permissions[key], _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_2__.NotEntitledJustification.MISSING_PERMISSION);
4160
4219
  };
4161
4220
 
4162
4221
  /**
4163
4222
  @param entitlements
4164
- @param key
4223
+ @param key feature key
4224
+ @param attributes entitlements query attributes including comnsumer and frontegg attributes
4225
+ @param isV2 true when need to use entitlements API V2
4165
4226
  @returns if the user is entitled to the given feature. Attaching the justification if not
4166
4227
  @throws when entitlement is not enabled via frontegg options
4167
4228
  */
4168
- const getFeatureEntitlements = (entitlements, key) => {
4169
- var _entitlements$feature;
4170
- return getEntitlementsHelper(entitlements == null ? void 0 : (_entitlements$feature = entitlements.features) == null ? void 0 : _entitlements$feature[key], _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_1__.NotEntitledJustification.MISSING_FEATURE);
4229
+ const getFeatureEntitlements = (entitlements, key, attributes, isV2) => {
4230
+ var _features;
4231
+ guardEntitlementsUsage();
4232
+ if (isV2) {
4233
+ return (0,_frontegg_entitlements_javascript_commons__WEBPACK_IMPORTED_MODULE_0__.evaluateIsEntitledToFeature)(key, entitlements, attributes);
4234
+ }
4235
+ return getEntitlementsHelperV1(entitlements == null ? void 0 : (_features = entitlements.features) == null ? void 0 : _features[key], _frontegg_rest_api__WEBPACK_IMPORTED_MODULE_2__.NotEntitledJustification.MISSING_FEATURE);
4171
4236
  };
4172
4237
 
4173
4238
  /**
4174
4239
  @param entitlements
4175
4240
  @param options including permission or feature
4241
+ @param attributes entitlements query attributes including comnsumer and frontegg attributes
4242
+ @param isV2 true when need to use entitlements API V2
4176
4243
  @returns if the user is entitled to the given feature or permission (check only one). Attaching the justification if not
4177
4244
  @throws when entitlement is not enabled via frontegg options
4178
4245
  */
4179
- const getEntitlements = (entitlements, options) => {
4246
+ const getEntitlements = (entitlements, options, attributes, isV2) => {
4180
4247
  if ('permissionKey' in options) {
4181
- return getPermissionEntitlements(entitlements, options.permissionKey);
4248
+ return getPermissionEntitlements(entitlements, options.permissionKey, attributes, isV2);
4182
4249
  }
4183
- return getFeatureEntitlements(entitlements, options.featureKey);
4250
+ return getFeatureEntitlements(entitlements, options.featureKey, attributes, isV2);
4184
4251
  };
4185
4252
 
4186
4253
  /***/ }),
@@ -23178,7 +23245,7 @@ __webpack_require__.r(__webpack_exports__);
23178
23245
  /* harmony export */ });
23179
23246
  /* harmony import */ var _ThemeOptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ThemeOptions */ "../../dist/@frontegg/types/ThemeOptions/index.js");
23180
23247
  /* harmony import */ var _Metadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Metadata */ "../../dist/@frontegg/types/Metadata/index.js");
23181
- /** @license Frontegg v6.147.0-alpha.4
23248
+ /** @license Frontegg v6.147.0-alpha.6
23182
23249
  *
23183
23250
  * This source code is licensed under the MIT license found in the
23184
23251
  * LICENSE file in the root directory of this source tree.
@@ -23193,6 +23260,1068 @@ __webpack_require__.r(__webpack_exports__);
23193
23260
 
23194
23261
 
23195
23262
 
23263
+ /***/ }),
23264
+
23265
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/conditions/condition.evaluator.js":
23266
+ /*!***********************************************************************************************************!*\
23267
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/conditions/condition.evaluator.js ***!
23268
+ \***********************************************************************************************************/
23269
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
23270
+
23271
+ "use strict";
23272
+
23273
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23274
+ exports.createConditionEvaluator = void 0;
23275
+ const operation_resolver_1 = __webpack_require__(/*! ../operations/components/operation.resolver */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/components/operation.resolver.js");
23276
+ const sanitizers_resolver_1 = __webpack_require__(/*! ../operations/components/sanitizers.resolver */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/components/sanitizers.resolver.js");
23277
+ function failingConditionEvaluator() {
23278
+ return () => false;
23279
+ }
23280
+ function createConditionEvaluator(payload) {
23281
+ const sanitizer = (0, sanitizers_resolver_1.useSanitizer)(payload.condition.op);
23282
+ if (!sanitizer) {
23283
+ return failingConditionEvaluator();
23284
+ }
23285
+ const { isSanitized, sanitizedValue } = sanitizer(payload.condition.value);
23286
+ if (!isSanitized || sanitizedValue === undefined) {
23287
+ return failingConditionEvaluator();
23288
+ }
23289
+ const operation = (0, operation_resolver_1.useOperation)(payload.condition.op, sanitizedValue);
23290
+ return (attributes) => {
23291
+ const attributeKey = payload.condition.attribute;
23292
+ const value = attributes[attributeKey];
23293
+ const { isValid: result } = value !== undefined && operation ? operation(value) : { isValid: false };
23294
+ return payload.condition.negate ? !result : result;
23295
+ };
23296
+ }
23297
+ exports.createConditionEvaluator = createConditionEvaluator;
23298
+ //# sourceMappingURL=condition.evaluator.js.map
23299
+
23300
+ /***/ }),
23301
+
23302
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/conditions/index.js":
23303
+ /*!*********************************************************************************************!*\
23304
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/conditions/index.js ***!
23305
+ \*********************************************************************************************/
23306
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
23307
+
23308
+ "use strict";
23309
+
23310
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23311
+ if (k2 === undefined) k2 = k;
23312
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23313
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
23314
+ desc = { enumerable: true, get: function() { return m[k]; } };
23315
+ }
23316
+ Object.defineProperty(o, k2, desc);
23317
+ }) : (function(o, m, k, k2) {
23318
+ if (k2 === undefined) k2 = k;
23319
+ o[k2] = m[k];
23320
+ }));
23321
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
23322
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23323
+ };
23324
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23325
+ __exportStar(__webpack_require__(/*! ./condition.evaluator */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/conditions/condition.evaluator.js"), exports);
23326
+ __exportStar(__webpack_require__(/*! ./types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/conditions/types.js"), exports);
23327
+ //# sourceMappingURL=index.js.map
23328
+
23329
+ /***/ }),
23330
+
23331
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/conditions/types.js":
23332
+ /*!*********************************************************************************************!*\
23333
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/conditions/types.js ***!
23334
+ \*********************************************************************************************/
23335
+ /***/ ((__unused_webpack_module, exports) => {
23336
+
23337
+ "use strict";
23338
+
23339
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23340
+ //# sourceMappingURL=types.js.map
23341
+
23342
+ /***/ }),
23343
+
23344
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/feature-flags/feature-flag.evaluator.js":
23345
+ /*!*****************************************************************************************************************!*\
23346
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/feature-flags/feature-flag.evaluator.js ***!
23347
+ \*****************************************************************************************************************/
23348
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
23349
+
23350
+ "use strict";
23351
+
23352
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23353
+ exports.evaluateFeatureFlag = void 0;
23354
+ const rules_1 = __webpack_require__(/*! ../rules */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/rules/index.js");
23355
+ function evaluateFeatureFlag(featureFlag, attributes) {
23356
+ if (!featureFlag.on) {
23357
+ return { treatment: featureFlag.offTreatment };
23358
+ }
23359
+ const treatableRule = findTreatableRule(featureFlag, attributes);
23360
+ if (treatableRule) {
23361
+ return { treatment: treatableRule.treatment };
23362
+ }
23363
+ return { treatment: featureFlag.defaultTreatment };
23364
+ }
23365
+ exports.evaluateFeatureFlag = evaluateFeatureFlag;
23366
+ function findTreatableRule(featureFlag, attributes) {
23367
+ var _a;
23368
+ return (_a = featureFlag.rules) === null || _a === void 0 ? void 0 : _a.find((rule) => {
23369
+ const evaluator = (0, rules_1.createRuleEvaluator)({ rule });
23370
+ const result = evaluator(attributes);
23371
+ return result === rules_1.RuleEvaluationResultEnum.Treatable;
23372
+ });
23373
+ }
23374
+ //# sourceMappingURL=feature-flag.evaluator.js.map
23375
+
23376
+ /***/ }),
23377
+
23378
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/feature-flags/index.js":
23379
+ /*!************************************************************************************************!*\
23380
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/feature-flags/index.js ***!
23381
+ \************************************************************************************************/
23382
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
23383
+
23384
+ "use strict";
23385
+
23386
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23387
+ if (k2 === undefined) k2 = k;
23388
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23389
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
23390
+ desc = { enumerable: true, get: function() { return m[k]; } };
23391
+ }
23392
+ Object.defineProperty(o, k2, desc);
23393
+ }) : (function(o, m, k, k2) {
23394
+ if (k2 === undefined) k2 = k;
23395
+ o[k2] = m[k];
23396
+ }));
23397
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
23398
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23399
+ };
23400
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23401
+ __exportStar(__webpack_require__(/*! ./feature-flag.evaluator */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/feature-flags/feature-flag.evaluator.js"), exports);
23402
+ //# sourceMappingURL=index.js.map
23403
+
23404
+ /***/ }),
23405
+
23406
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/index.js":
23407
+ /*!**********************************************************************************!*\
23408
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/index.js ***!
23409
+ \**********************************************************************************/
23410
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
23411
+
23412
+ "use strict";
23413
+
23414
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23415
+ exports.NotEntitledJustification = exports.prepareAttributes = exports.evaluateIsEntitledToPermissions = exports.evaluateIsEntitledToFeature = exports.OperationEnum = exports.TreatmentEnum = exports.evaluateFeatureFlag = void 0;
23416
+ var feature_flags_1 = __webpack_require__(/*! ./feature-flags */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/feature-flags/index.js");
23417
+ Object.defineProperty(exports, "evaluateFeatureFlag", ({ enumerable: true, get: function () { return feature_flags_1.evaluateFeatureFlag; } }));
23418
+ var rules_1 = __webpack_require__(/*! ./rules */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/rules/index.js");
23419
+ Object.defineProperty(exports, "TreatmentEnum", ({ enumerable: true, get: function () { return rules_1.TreatmentEnum; } }));
23420
+ var types_1 = __webpack_require__(/*! ./operations/types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/index.js");
23421
+ Object.defineProperty(exports, "OperationEnum", ({ enumerable: true, get: function () { return types_1.OperationEnum; } }));
23422
+ var user_entitlements_1 = __webpack_require__(/*! ./user-entitlements */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/index.js");
23423
+ Object.defineProperty(exports, "evaluateIsEntitledToFeature", ({ enumerable: true, get: function () { return user_entitlements_1.evaluateIsEntitledToFeature; } }));
23424
+ Object.defineProperty(exports, "evaluateIsEntitledToPermissions", ({ enumerable: true, get: function () { return user_entitlements_1.evaluateIsEntitledToPermissions; } }));
23425
+ Object.defineProperty(exports, "prepareAttributes", ({ enumerable: true, get: function () { return user_entitlements_1.prepareAttributes; } }));
23426
+ Object.defineProperty(exports, "NotEntitledJustification", ({ enumerable: true, get: function () { return user_entitlements_1.NotEntitledJustification; } }));
23427
+ //# sourceMappingURL=index.js.map
23428
+
23429
+ /***/ }),
23430
+
23431
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/boolean/index.js":
23432
+ /*!*****************************************************************************************************!*\
23433
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/boolean/index.js ***!
23434
+ \*****************************************************************************************************/
23435
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
23436
+
23437
+ "use strict";
23438
+
23439
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23440
+ if (k2 === undefined) k2 = k;
23441
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23442
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
23443
+ desc = { enumerable: true, get: function() { return m[k]; } };
23444
+ }
23445
+ Object.defineProperty(o, k2, desc);
23446
+ }) : (function(o, m, k, k2) {
23447
+ if (k2 === undefined) k2 = k;
23448
+ o[k2] = m[k];
23449
+ }));
23450
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
23451
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23452
+ };
23453
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23454
+ exports.BooleanOperationsMapper = void 0;
23455
+ const types_1 = __webpack_require__(/*! ../types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/index.js");
23456
+ const operations_1 = __webpack_require__(/*! ./operations */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/boolean/operations.js");
23457
+ __exportStar(__webpack_require__(/*! ./operations */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/boolean/operations.js"), exports);
23458
+ __exportStar(__webpack_require__(/*! ./sanitizers */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/boolean/sanitizers.js"), exports);
23459
+ exports.BooleanOperationsMapper = {
23460
+ [types_1.OperationEnum.Is]: (value) => (0, operations_1.useIsOperation)(value),
23461
+ };
23462
+ //# sourceMappingURL=index.js.map
23463
+
23464
+ /***/ }),
23465
+
23466
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/boolean/operations.js":
23467
+ /*!**********************************************************************************************************!*\
23468
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/boolean/operations.js ***!
23469
+ \**********************************************************************************************************/
23470
+ /***/ ((__unused_webpack_module, exports) => {
23471
+
23472
+ "use strict";
23473
+
23474
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23475
+ exports.useIsOperation = void 0;
23476
+ function useIsOperation(payload) {
23477
+ return (attribute) => ({ isValid: attribute === payload.boolean });
23478
+ }
23479
+ exports.useIsOperation = useIsOperation;
23480
+ //# sourceMappingURL=operations.js.map
23481
+
23482
+ /***/ }),
23483
+
23484
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/boolean/sanitizers.js":
23485
+ /*!**********************************************************************************************************!*\
23486
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/boolean/sanitizers.js ***!
23487
+ \**********************************************************************************************************/
23488
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
23489
+
23490
+ "use strict";
23491
+
23492
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23493
+ exports.BooleanSanitizersMapper = exports.singleBooleanSanitizer = void 0;
23494
+ const types_1 = __webpack_require__(/*! ../types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/index.js");
23495
+ const isBoolean = (value) => typeof value === 'boolean';
23496
+ const singleBooleanSanitizer = (value) => {
23497
+ const sanitizedValue = value.boolean !== undefined && isBoolean(value.boolean) ? { boolean: value.boolean } : undefined;
23498
+ return {
23499
+ isSanitized: !!sanitizedValue,
23500
+ sanitizedValue,
23501
+ };
23502
+ };
23503
+ exports.singleBooleanSanitizer = singleBooleanSanitizer;
23504
+ exports.BooleanSanitizersMapper = {
23505
+ [types_1.OperationEnum.Is]: exports.singleBooleanSanitizer,
23506
+ };
23507
+ //# sourceMappingURL=sanitizers.js.map
23508
+
23509
+ /***/ }),
23510
+
23511
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/components/operation.resolver.js":
23512
+ /*!*********************************************************************************************************************!*\
23513
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/components/operation.resolver.js ***!
23514
+ \*********************************************************************************************************************/
23515
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
23516
+
23517
+ "use strict";
23518
+
23519
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23520
+ exports.useOperation = void 0;
23521
+ const string_1 = __webpack_require__(/*! ../string */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/index.js");
23522
+ const numeric_1 = __webpack_require__(/*! ../numeric */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/index.js");
23523
+ const date_1 = __webpack_require__(/*! ../date */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/index.js");
23524
+ const boolean_1 = __webpack_require__(/*! ../boolean */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/boolean/index.js");
23525
+ const operationEnrichersMapper = {
23526
+ ...string_1.StringOperationsMapper,
23527
+ ...numeric_1.NumericOperationsMapper,
23528
+ ...date_1.DateOperationsMapper,
23529
+ ...boolean_1.BooleanOperationsMapper,
23530
+ };
23531
+ function useOperation(operation, value) {
23532
+ const operationContextEnricher = operationEnrichersMapper[operation];
23533
+ return operationContextEnricher ? operationContextEnricher(value) : undefined;
23534
+ }
23535
+ exports.useOperation = useOperation;
23536
+ //# sourceMappingURL=operation.resolver.js.map
23537
+
23538
+ /***/ }),
23539
+
23540
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/components/sanitizers.resolver.js":
23541
+ /*!**********************************************************************************************************************!*\
23542
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/components/sanitizers.resolver.js ***!
23543
+ \**********************************************************************************************************************/
23544
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
23545
+
23546
+ "use strict";
23547
+
23548
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23549
+ exports.useSanitizer = void 0;
23550
+ const boolean_1 = __webpack_require__(/*! ../boolean */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/boolean/index.js");
23551
+ const sanitizers_1 = __webpack_require__(/*! ../string/sanitizers */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/sanitizers.js");
23552
+ const sanitizers_2 = __webpack_require__(/*! ../date/sanitizers */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/sanitizers.js");
23553
+ const numeric_1 = __webpack_require__(/*! ../numeric */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/index.js");
23554
+ const SanitizersMapper = {
23555
+ ...sanitizers_1.StringSanitizersMapper,
23556
+ ...numeric_1.NumericSanitizersMapper,
23557
+ ...sanitizers_2.DateSanitizersMapper,
23558
+ ...boolean_1.BooleanSanitizersMapper,
23559
+ };
23560
+ function useSanitizer(operation) {
23561
+ return SanitizersMapper[operation];
23562
+ }
23563
+ exports.useSanitizer = useSanitizer;
23564
+ //# sourceMappingURL=sanitizers.resolver.js.map
23565
+
23566
+ /***/ }),
23567
+
23568
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/index.js":
23569
+ /*!**************************************************************************************************!*\
23570
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/index.js ***!
23571
+ \**************************************************************************************************/
23572
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
23573
+
23574
+ "use strict";
23575
+
23576
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23577
+ if (k2 === undefined) k2 = k;
23578
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23579
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
23580
+ desc = { enumerable: true, get: function() { return m[k]; } };
23581
+ }
23582
+ Object.defineProperty(o, k2, desc);
23583
+ }) : (function(o, m, k, k2) {
23584
+ if (k2 === undefined) k2 = k;
23585
+ o[k2] = m[k];
23586
+ }));
23587
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
23588
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23589
+ };
23590
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23591
+ exports.DateOperationsMapper = void 0;
23592
+ const types_1 = __webpack_require__(/*! ../types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/index.js");
23593
+ const operations_1 = __webpack_require__(/*! ./operations */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/operations.js");
23594
+ __exportStar(__webpack_require__(/*! ./operations */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/operations.js"), exports);
23595
+ __exportStar(__webpack_require__(/*! ./types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/types.js"), exports);
23596
+ exports.DateOperationsMapper = {
23597
+ [types_1.OperationEnum.On]: (value) => (0, operations_1.useDateOnOperation)(value),
23598
+ [types_1.OperationEnum.OnOrAfter]: (value) => (0, operations_1.useDateOnOrAfterOperation)(value),
23599
+ [types_1.OperationEnum.OnOrBefore]: (value) => (0, operations_1.useDateOnOrBeforeOperation)(value),
23600
+ [types_1.OperationEnum.BetweenDate]: (value) => (0, operations_1.useDateBetweenOperation)(value),
23601
+ };
23602
+ //# sourceMappingURL=index.js.map
23603
+
23604
+ /***/ }),
23605
+
23606
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/operations.js":
23607
+ /*!*******************************************************************************************************!*\
23608
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/operations.js ***!
23609
+ \*******************************************************************************************************/
23610
+ /***/ ((__unused_webpack_module, exports) => {
23611
+
23612
+ "use strict";
23613
+
23614
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23615
+ exports.useDateBetweenOperation = exports.useDateOnOrBeforeOperation = exports.useDateOnOrAfterOperation = exports.useDateOnOperation = void 0;
23616
+ function useDateOnOperation(payload) {
23617
+ return (attribute) => ({ isValid: attribute.getTime() === payload.date.getTime() });
23618
+ }
23619
+ exports.useDateOnOperation = useDateOnOperation;
23620
+ function useDateOnOrAfterOperation(payload) {
23621
+ return (attribute) => ({ isValid: attribute.getTime() >= payload.date.getTime() });
23622
+ }
23623
+ exports.useDateOnOrAfterOperation = useDateOnOrAfterOperation;
23624
+ function useDateOnOrBeforeOperation(payload) {
23625
+ return (attribute) => ({ isValid: attribute.getTime() <= payload.date.getTime() });
23626
+ }
23627
+ exports.useDateOnOrBeforeOperation = useDateOnOrBeforeOperation;
23628
+ function useDateBetweenOperation(payload) {
23629
+ return (attribute) => ({
23630
+ isValid: attribute.getTime() >= payload.start.getTime() && attribute.getTime() <= payload.end.getTime(),
23631
+ });
23632
+ }
23633
+ exports.useDateBetweenOperation = useDateBetweenOperation;
23634
+ //# sourceMappingURL=operations.js.map
23635
+
23636
+ /***/ }),
23637
+
23638
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/sanitizers.js":
23639
+ /*!*******************************************************************************************************!*\
23640
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/sanitizers.js ***!
23641
+ \*******************************************************************************************************/
23642
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
23643
+
23644
+ "use strict";
23645
+
23646
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23647
+ exports.DateSanitizersMapper = exports.sanitizeDateRange = exports.sanitizeSingleDate = void 0;
23648
+ const types_1 = __webpack_require__(/*! ../types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/index.js");
23649
+ const sanitizeSingleDate = (value) => {
23650
+ const sanitizedValue = value.date ? { date: value.date } : undefined;
23651
+ return {
23652
+ isSanitized: !!sanitizedValue,
23653
+ sanitizedValue,
23654
+ };
23655
+ };
23656
+ exports.sanitizeSingleDate = sanitizeSingleDate;
23657
+ const sanitizeDateRange = (value) => {
23658
+ const sanitizedValue = value.start && value.end ? { start: value.start, end: value.end } : undefined;
23659
+ return {
23660
+ isSanitized: !!sanitizedValue,
23661
+ sanitizedValue,
23662
+ };
23663
+ };
23664
+ exports.sanitizeDateRange = sanitizeDateRange;
23665
+ exports.DateSanitizersMapper = {
23666
+ [types_1.OperationEnum.On]: exports.sanitizeSingleDate,
23667
+ [types_1.OperationEnum.OnOrAfter]: exports.sanitizeDateRange,
23668
+ [types_1.OperationEnum.OnOrBefore]: exports.sanitizeSingleDate,
23669
+ [types_1.OperationEnum.BetweenDate]: exports.sanitizeSingleDate,
23670
+ };
23671
+ //# sourceMappingURL=sanitizers.js.map
23672
+
23673
+ /***/ }),
23674
+
23675
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/types.js":
23676
+ /*!**************************************************************************************************!*\
23677
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/date/types.js ***!
23678
+ \**************************************************************************************************/
23679
+ /***/ ((__unused_webpack_module, exports) => {
23680
+
23681
+ "use strict";
23682
+
23683
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23684
+ //# sourceMappingURL=types.js.map
23685
+
23686
+ /***/ }),
23687
+
23688
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/index.js":
23689
+ /*!*****************************************************************************************************!*\
23690
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/index.js ***!
23691
+ \*****************************************************************************************************/
23692
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
23693
+
23694
+ "use strict";
23695
+
23696
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23697
+ if (k2 === undefined) k2 = k;
23698
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23699
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
23700
+ desc = { enumerable: true, get: function() { return m[k]; } };
23701
+ }
23702
+ Object.defineProperty(o, k2, desc);
23703
+ }) : (function(o, m, k, k2) {
23704
+ if (k2 === undefined) k2 = k;
23705
+ o[k2] = m[k];
23706
+ }));
23707
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
23708
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23709
+ };
23710
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23711
+ exports.NumericOperationsMapper = void 0;
23712
+ const types_1 = __webpack_require__(/*! ../types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/index.js");
23713
+ const operations_1 = __webpack_require__(/*! ./operations */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/operations.js");
23714
+ exports.NumericOperationsMapper = {
23715
+ [types_1.OperationEnum.Equal]: (value) => (0, operations_1.useEqualsOperation)(value),
23716
+ [types_1.OperationEnum.GreaterThan]: (value) => (0, operations_1.useGreaterThanOperation)(value),
23717
+ [types_1.OperationEnum.GreaterThanEqual]: (value) => (0, operations_1.useGreaterThanEqualOperation)(value),
23718
+ [types_1.OperationEnum.LesserThan]: (value) => (0, operations_1.useLesserThanOperation)(value),
23719
+ [types_1.OperationEnum.LesserThanEqual]: (value) => (0, operations_1.useLesserThanEqualOperation)(value),
23720
+ [types_1.OperationEnum.BetweenNumeric]: (value) => (0, operations_1.useBetweenNumericOperation)(value),
23721
+ };
23722
+ __exportStar(__webpack_require__(/*! ./operations */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/operations.js"), exports);
23723
+ __exportStar(__webpack_require__(/*! ./sanitizers */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/sanitizers.js"), exports);
23724
+ __exportStar(__webpack_require__(/*! ./types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/types.js"), exports);
23725
+ //# sourceMappingURL=index.js.map
23726
+
23727
+ /***/ }),
23728
+
23729
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/operations.js":
23730
+ /*!**********************************************************************************************************!*\
23731
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/operations.js ***!
23732
+ \**********************************************************************************************************/
23733
+ /***/ ((__unused_webpack_module, exports) => {
23734
+
23735
+ "use strict";
23736
+
23737
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23738
+ exports.useBetweenNumericOperation = exports.useLesserThanEqualOperation = exports.useLesserThanOperation = exports.useGreaterThanEqualOperation = exports.useGreaterThanOperation = exports.useEqualsOperation = void 0;
23739
+ function useEqualsOperation(payload) {
23740
+ return (attribute) => ({ isValid: attribute === payload.number });
23741
+ }
23742
+ exports.useEqualsOperation = useEqualsOperation;
23743
+ function useGreaterThanOperation(payload) {
23744
+ return (attribute) => ({ isValid: attribute > payload.number });
23745
+ }
23746
+ exports.useGreaterThanOperation = useGreaterThanOperation;
23747
+ function useGreaterThanEqualOperation(payload) {
23748
+ return (attribute) => ({ isValid: attribute >= payload.number });
23749
+ }
23750
+ exports.useGreaterThanEqualOperation = useGreaterThanEqualOperation;
23751
+ function useLesserThanOperation(payload) {
23752
+ return (attribute) => ({ isValid: attribute < payload.number });
23753
+ }
23754
+ exports.useLesserThanOperation = useLesserThanOperation;
23755
+ function useLesserThanEqualOperation(payload) {
23756
+ return (attribute) => ({ isValid: attribute <= payload.number });
23757
+ }
23758
+ exports.useLesserThanEqualOperation = useLesserThanEqualOperation;
23759
+ function useBetweenNumericOperation(payload) {
23760
+ return (attribute) => ({ isValid: attribute >= payload.start && attribute <= payload.end });
23761
+ }
23762
+ exports.useBetweenNumericOperation = useBetweenNumericOperation;
23763
+ //# sourceMappingURL=operations.js.map
23764
+
23765
+ /***/ }),
23766
+
23767
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/sanitizers.js":
23768
+ /*!**********************************************************************************************************!*\
23769
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/sanitizers.js ***!
23770
+ \**********************************************************************************************************/
23771
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
23772
+
23773
+ "use strict";
23774
+
23775
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23776
+ exports.NumericSanitizersMapper = exports.sanitizeNumericRange = exports.sanitizeSingleNumber = void 0;
23777
+ const types_1 = __webpack_require__(/*! ../types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/index.js");
23778
+ const isNumber = (value) => typeof value === 'number';
23779
+ const sanitizeSingleNumber = (value) => {
23780
+ const sanitizedValue = value.number !== undefined && isNumber(value.number) ? { number: value.number } : undefined;
23781
+ return {
23782
+ isSanitized: !!sanitizedValue,
23783
+ sanitizedValue,
23784
+ };
23785
+ };
23786
+ exports.sanitizeSingleNumber = sanitizeSingleNumber;
23787
+ const sanitizeNumericRange = (value) => {
23788
+ const sanitizedValue = value.start !== undefined && value.end !== undefined && isNumber(value.start) && isNumber(value.end)
23789
+ ? { start: value.start, end: value.end }
23790
+ : undefined;
23791
+ return {
23792
+ isSanitized: !!sanitizedValue,
23793
+ sanitizedValue,
23794
+ };
23795
+ };
23796
+ exports.sanitizeNumericRange = sanitizeNumericRange;
23797
+ exports.NumericSanitizersMapper = {
23798
+ [types_1.OperationEnum.Equal]: exports.sanitizeSingleNumber,
23799
+ [types_1.OperationEnum.GreaterThan]: exports.sanitizeNumericRange,
23800
+ [types_1.OperationEnum.GreaterThanEqual]: exports.sanitizeSingleNumber,
23801
+ [types_1.OperationEnum.LesserThan]: exports.sanitizeSingleNumber,
23802
+ [types_1.OperationEnum.LesserThanEqual]: exports.sanitizeNumericRange,
23803
+ [types_1.OperationEnum.BetweenNumeric]: exports.sanitizeNumericRange,
23804
+ };
23805
+ //# sourceMappingURL=sanitizers.js.map
23806
+
23807
+ /***/ }),
23808
+
23809
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/types.js":
23810
+ /*!*****************************************************************************************************!*\
23811
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/numeric/types.js ***!
23812
+ \*****************************************************************************************************/
23813
+ /***/ ((__unused_webpack_module, exports) => {
23814
+
23815
+ "use strict";
23816
+
23817
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23818
+ //# sourceMappingURL=types.js.map
23819
+
23820
+ /***/ }),
23821
+
23822
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/index.js":
23823
+ /*!****************************************************************************************************!*\
23824
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/index.js ***!
23825
+ \****************************************************************************************************/
23826
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
23827
+
23828
+ "use strict";
23829
+
23830
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23831
+ if (k2 === undefined) k2 = k;
23832
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23833
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
23834
+ desc = { enumerable: true, get: function() { return m[k]; } };
23835
+ }
23836
+ Object.defineProperty(o, k2, desc);
23837
+ }) : (function(o, m, k, k2) {
23838
+ if (k2 === undefined) k2 = k;
23839
+ o[k2] = m[k];
23840
+ }));
23841
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
23842
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23843
+ };
23844
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23845
+ exports.StringOperationsMapper = void 0;
23846
+ const types_1 = __webpack_require__(/*! ../types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/index.js");
23847
+ const operations_1 = __webpack_require__(/*! ./operations */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/operations.js");
23848
+ __exportStar(__webpack_require__(/*! ./operations */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/operations.js"), exports);
23849
+ __exportStar(__webpack_require__(/*! ./types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/types.js"), exports);
23850
+ exports.StringOperationsMapper = {
23851
+ [types_1.OperationEnum.StartsWith]: (value) => (0, operations_1.useStartsWithOperation)(value),
23852
+ [types_1.OperationEnum.EndsWith]: (value) => (0, operations_1.useEndsWithOperation)(value),
23853
+ [types_1.OperationEnum.Contains]: (value) => (0, operations_1.useContainsOperation)(value),
23854
+ [types_1.OperationEnum.InList]: (value) => (0, operations_1.useInListOperation)(value),
23855
+ [types_1.OperationEnum.Matches]: (value) => (0, operations_1.useMatchesOperation)(value),
23856
+ };
23857
+ //# sourceMappingURL=index.js.map
23858
+
23859
+ /***/ }),
23860
+
23861
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/operations.js":
23862
+ /*!*********************************************************************************************************!*\
23863
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/operations.js ***!
23864
+ \*********************************************************************************************************/
23865
+ /***/ ((__unused_webpack_module, exports) => {
23866
+
23867
+ "use strict";
23868
+
23869
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23870
+ exports.useMatchesOperation = exports.useInListOperation = exports.useContainsOperation = exports.useEndsWithOperation = exports.useStartsWithOperation = void 0;
23871
+ function useStartsWithOperation(payload) {
23872
+ return (attribute) => ({ isValid: payload.list.some((value) => attribute.startsWith(value)) });
23873
+ }
23874
+ exports.useStartsWithOperation = useStartsWithOperation;
23875
+ function useEndsWithOperation(payload) {
23876
+ return (attribute) => ({ isValid: payload.list.some((value) => attribute.endsWith(value)) });
23877
+ }
23878
+ exports.useEndsWithOperation = useEndsWithOperation;
23879
+ function useContainsOperation(payload) {
23880
+ return (attribute) => ({ isValid: payload.list.some((value) => attribute.includes(value)) });
23881
+ }
23882
+ exports.useContainsOperation = useContainsOperation;
23883
+ function useInListOperation(payload) {
23884
+ return (attribute) => ({ isValid: payload.list.includes(attribute) });
23885
+ }
23886
+ exports.useInListOperation = useInListOperation;
23887
+ function useMatchesOperation(payload) {
23888
+ return (attribute) => {
23889
+ let expression;
23890
+ try {
23891
+ expression = new RegExp(payload.string);
23892
+ }
23893
+ catch (e) {
23894
+ return { isValid: false };
23895
+ }
23896
+ return { isValid: expression.test(attribute) };
23897
+ };
23898
+ }
23899
+ exports.useMatchesOperation = useMatchesOperation;
23900
+ //# sourceMappingURL=operations.js.map
23901
+
23902
+ /***/ }),
23903
+
23904
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/sanitizers.js":
23905
+ /*!*********************************************************************************************************!*\
23906
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/sanitizers.js ***!
23907
+ \*********************************************************************************************************/
23908
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
23909
+
23910
+ "use strict";
23911
+
23912
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23913
+ exports.StringSanitizersMapper = exports.sanitizeListString = exports.sanitizeSingleString = void 0;
23914
+ const types_1 = __webpack_require__(/*! ../types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/index.js");
23915
+ const isString = (value) => typeof value === 'string';
23916
+ const sanitizeSingleString = (value) => {
23917
+ const sanitizedValue = value.string !== undefined && isString(value.string) ? { string: value.string } : undefined;
23918
+ return {
23919
+ isSanitized: !!sanitizedValue,
23920
+ sanitizedValue,
23921
+ };
23922
+ };
23923
+ exports.sanitizeSingleString = sanitizeSingleString;
23924
+ const sanitizeListString = (value) => {
23925
+ const sanitizedValue = value.list !== undefined && value.list.every((str) => isString(str))
23926
+ ? { list: value.list }
23927
+ : undefined;
23928
+ return {
23929
+ isSanitized: !!sanitizedValue,
23930
+ sanitizedValue,
23931
+ };
23932
+ };
23933
+ exports.sanitizeListString = sanitizeListString;
23934
+ exports.StringSanitizersMapper = {
23935
+ [types_1.OperationEnum.Matches]: exports.sanitizeSingleString,
23936
+ [types_1.OperationEnum.Contains]: exports.sanitizeListString,
23937
+ [types_1.OperationEnum.StartsWith]: exports.sanitizeListString,
23938
+ [types_1.OperationEnum.EndsWith]: exports.sanitizeListString,
23939
+ [types_1.OperationEnum.InList]: exports.sanitizeListString,
23940
+ };
23941
+ //# sourceMappingURL=sanitizers.js.map
23942
+
23943
+ /***/ }),
23944
+
23945
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/types.js":
23946
+ /*!****************************************************************************************************!*\
23947
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/string/types.js ***!
23948
+ \****************************************************************************************************/
23949
+ /***/ ((__unused_webpack_module, exports) => {
23950
+
23951
+ "use strict";
23952
+
23953
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23954
+ //# sourceMappingURL=types.js.map
23955
+
23956
+ /***/ }),
23957
+
23958
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/index.js":
23959
+ /*!***************************************************************************************************!*\
23960
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/index.js ***!
23961
+ \***************************************************************************************************/
23962
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
23963
+
23964
+ "use strict";
23965
+
23966
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
23967
+ if (k2 === undefined) k2 = k;
23968
+ var desc = Object.getOwnPropertyDescriptor(m, k);
23969
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
23970
+ desc = { enumerable: true, get: function() { return m[k]; } };
23971
+ }
23972
+ Object.defineProperty(o, k2, desc);
23973
+ }) : (function(o, m, k, k2) {
23974
+ if (k2 === undefined) k2 = k;
23975
+ o[k2] = m[k];
23976
+ }));
23977
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
23978
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
23979
+ };
23980
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23981
+ __exportStar(__webpack_require__(/*! ./operation.enum */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/operation.enum.js"), exports);
23982
+ //# sourceMappingURL=index.js.map
23983
+
23984
+ /***/ }),
23985
+
23986
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/operation.enum.js":
23987
+ /*!************************************************************************************************************!*\
23988
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/operations/types/operation.enum.js ***!
23989
+ \************************************************************************************************************/
23990
+ /***/ ((__unused_webpack_module, exports) => {
23991
+
23992
+ "use strict";
23993
+
23994
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
23995
+ exports.OperationEnum = void 0;
23996
+ var OperationEnum;
23997
+ (function (OperationEnum) {
23998
+ // String Operations
23999
+ OperationEnum["InList"] = "in_list";
24000
+ OperationEnum["StartsWith"] = "starts_with";
24001
+ OperationEnum["EndsWith"] = "ends_with";
24002
+ OperationEnum["Contains"] = "contains";
24003
+ OperationEnum["Matches"] = "matches";
24004
+ // Numeric Operations
24005
+ OperationEnum["Equal"] = "equal";
24006
+ OperationEnum["GreaterThan"] = "greater_than";
24007
+ OperationEnum["GreaterThanEqual"] = "greater_than_equal";
24008
+ OperationEnum["LesserThan"] = "lower_than";
24009
+ OperationEnum["LesserThanEqual"] = "lower_than_equal";
24010
+ OperationEnum["BetweenNumeric"] = "between_numeric";
24011
+ // Boolean Operations
24012
+ OperationEnum["Is"] = "is";
24013
+ // Date Operations
24014
+ OperationEnum["On"] = "on";
24015
+ OperationEnum["BetweenDate"] = "between_date";
24016
+ OperationEnum["OnOrAfter"] = "on_or_after";
24017
+ OperationEnum["OnOrBefore"] = "on_or_before";
24018
+ })(OperationEnum = exports.OperationEnum || (exports.OperationEnum = {}));
24019
+ //# sourceMappingURL=operation.enum.js.map
24020
+
24021
+ /***/ }),
24022
+
24023
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/rules/index.js":
24024
+ /*!****************************************************************************************!*\
24025
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/rules/index.js ***!
24026
+ \****************************************************************************************/
24027
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
24028
+
24029
+ "use strict";
24030
+
24031
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
24032
+ if (k2 === undefined) k2 = k;
24033
+ var desc = Object.getOwnPropertyDescriptor(m, k);
24034
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24035
+ desc = { enumerable: true, get: function() { return m[k]; } };
24036
+ }
24037
+ Object.defineProperty(o, k2, desc);
24038
+ }) : (function(o, m, k, k2) {
24039
+ if (k2 === undefined) k2 = k;
24040
+ o[k2] = m[k];
24041
+ }));
24042
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
24043
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
24044
+ };
24045
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
24046
+ __exportStar(__webpack_require__(/*! ./types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/rules/types.js"), exports);
24047
+ __exportStar(__webpack_require__(/*! ./rule.evaluator */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/rules/rule.evaluator.js"), exports);
24048
+ //# sourceMappingURL=index.js.map
24049
+
24050
+ /***/ }),
24051
+
24052
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/rules/rule.evaluator.js":
24053
+ /*!*************************************************************************************************!*\
24054
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/rules/rule.evaluator.js ***!
24055
+ \*************************************************************************************************/
24056
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24057
+
24058
+ "use strict";
24059
+
24060
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
24061
+ exports.createRuleEvaluator = void 0;
24062
+ const types_1 = __webpack_require__(/*! ./types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/rules/types.js");
24063
+ const conditions_1 = __webpack_require__(/*! ../conditions */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/conditions/index.js");
24064
+ function createRuleEvaluator(payload) {
24065
+ return (attributes) => {
24066
+ const isRuleTreatable = payload.rule.conditions.every((condition) => {
24067
+ const evaluator = (0, conditions_1.createConditionEvaluator)({ condition });
24068
+ return evaluator(attributes);
24069
+ });
24070
+ return isRuleTreatable ? types_1.RuleEvaluationResultEnum.Treatable : types_1.RuleEvaluationResultEnum.Insufficient;
24071
+ };
24072
+ }
24073
+ exports.createRuleEvaluator = createRuleEvaluator;
24074
+ //# sourceMappingURL=rule.evaluator.js.map
24075
+
24076
+ /***/ }),
24077
+
24078
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/rules/types.js":
24079
+ /*!****************************************************************************************!*\
24080
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/rules/types.js ***!
24081
+ \****************************************************************************************/
24082
+ /***/ ((__unused_webpack_module, exports) => {
24083
+
24084
+ "use strict";
24085
+
24086
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
24087
+ exports.RuleEvaluationResultEnum = exports.TreatmentEnum = exports.ConditionLogicEnum = void 0;
24088
+ var ConditionLogicEnum;
24089
+ (function (ConditionLogicEnum) {
24090
+ ConditionLogicEnum["And"] = "and";
24091
+ })(ConditionLogicEnum = exports.ConditionLogicEnum || (exports.ConditionLogicEnum = {}));
24092
+ var TreatmentEnum;
24093
+ (function (TreatmentEnum) {
24094
+ TreatmentEnum["True"] = "true";
24095
+ TreatmentEnum["False"] = "false";
24096
+ })(TreatmentEnum = exports.TreatmentEnum || (exports.TreatmentEnum = {}));
24097
+ var RuleEvaluationResultEnum;
24098
+ (function (RuleEvaluationResultEnum) {
24099
+ RuleEvaluationResultEnum["Treatable"] = "treatable";
24100
+ RuleEvaluationResultEnum["Insufficient"] = "insufficient";
24101
+ })(RuleEvaluationResultEnum = exports.RuleEvaluationResultEnum || (exports.RuleEvaluationResultEnum = {}));
24102
+ //# sourceMappingURL=types.js.map
24103
+
24104
+ /***/ }),
24105
+
24106
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/attributes.utils.js":
24107
+ /*!***************************************************************************************************************!*\
24108
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/attributes.utils.js ***!
24109
+ \***************************************************************************************************************/
24110
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24111
+
24112
+ "use strict";
24113
+
24114
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
24115
+ exports.modifyObjectKeysWithPrefix = exports.defaultFronteggAttributesMapper = exports.prepareAttributes = void 0;
24116
+ const flatten_utils_1 = __webpack_require__(/*! ./flatten.utils */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/flatten.utils.js");
24117
+ /**
24118
+ * Merges both `custom` and `jwt` records, map Frontegg attributes and modifies record keys with corrisponding prefixes
24119
+ *
24120
+ * Example:
24121
+ * Input: { 'custom': { 'customAttribute': 'someValue' }, 'jwt': { 'email': 'user@email.com', other: 'some-vaule' } }
24122
+ * Output: { 'customAttribute': 'someValue', 'frontegg.email': 'user@email.com', 'jwt.email': 'user@email.com', 'jwt.other': 'some-vaule' }
24123
+ */
24124
+ function prepareAttributes(attributes = {}, customFronteggAttributesMapper) {
24125
+ const { custom = {}, jwt = {} } = attributes;
24126
+ const flatJwtAttributes = (0, flatten_utils_1.flatten)(jwt);
24127
+ const fronteggAttributes = customFronteggAttributesMapper
24128
+ ? customFronteggAttributesMapper(jwt)
24129
+ : defaultFronteggAttributesMapper(jwt);
24130
+ const fronteggAttributesPrefix = 'frontegg.';
24131
+ const jwtAttributesPrefix = 'jwt.';
24132
+ return {
24133
+ ...custom,
24134
+ ...modifyObjectKeysWithPrefix(fronteggAttributes, fronteggAttributesPrefix),
24135
+ ...modifyObjectKeysWithPrefix(flatJwtAttributes, jwtAttributesPrefix),
24136
+ };
24137
+ }
24138
+ exports.prepareAttributes = prepareAttributes;
24139
+ function defaultFronteggAttributesMapper(jwt) {
24140
+ return {
24141
+ email: jwt.email,
24142
+ emailVerified: jwt.email_verified,
24143
+ tenantId: jwt.tenantId,
24144
+ userId: jwt.userId,
24145
+ };
24146
+ }
24147
+ exports.defaultFronteggAttributesMapper = defaultFronteggAttributesMapper;
24148
+ function modifyObjectKeysWithPrefix(object, prefix) {
24149
+ return Object.keys(object).reduce((modifiedObject, currentKey) => {
24150
+ modifiedObject[`${prefix}${currentKey}`] = object[currentKey];
24151
+ return modifiedObject;
24152
+ }, {});
24153
+ }
24154
+ exports.modifyObjectKeysWithPrefix = modifyObjectKeysWithPrefix;
24155
+ //# sourceMappingURL=attributes.utils.js.map
24156
+
24157
+ /***/ }),
24158
+
24159
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/flatten.utils.js":
24160
+ /*!************************************************************************************************************!*\
24161
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/flatten.utils.js ***!
24162
+ \************************************************************************************************************/
24163
+ /***/ ((__unused_webpack_module, exports) => {
24164
+
24165
+ "use strict";
24166
+
24167
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
24168
+ exports.flatten = void 0;
24169
+ function flatten(target, opts) {
24170
+ opts = opts || {};
24171
+ const delimiter = (opts === null || opts === void 0 ? void 0 : opts.delimiter) || '.';
24172
+ const maxDepth = opts === null || opts === void 0 ? void 0 : opts.maxDepth;
24173
+ const transformKey = (opts === null || opts === void 0 ? void 0 : opts.transformKey) || keyIdentity;
24174
+ const output = {};
24175
+ function step(object, prev, currentDepth) {
24176
+ currentDepth = currentDepth || 1;
24177
+ Object.keys(object).forEach(function (key) {
24178
+ const value = object[key];
24179
+ const isarray = (opts === null || opts === void 0 ? void 0 : opts.safe) && Array.isArray(value);
24180
+ const type = Object.prototype.toString.call(value);
24181
+ const isbuffer = isBuffer(value);
24182
+ const isobject = type === '[object Object]' || type === '[object Array]';
24183
+ const newKey = prev ? prev + delimiter + transformKey(key) : transformKey(key);
24184
+ if (!isarray &&
24185
+ !isbuffer &&
24186
+ isobject &&
24187
+ Object.keys(value).length &&
24188
+ (!(opts === null || opts === void 0 ? void 0 : opts.maxDepth) || (maxDepth && currentDepth < maxDepth))) {
24189
+ return step(value, newKey, currentDepth + 1);
24190
+ }
24191
+ output[newKey] = value;
24192
+ });
24193
+ }
24194
+ step(target);
24195
+ return output;
24196
+ }
24197
+ exports.flatten = flatten;
24198
+ function isBuffer(obj) {
24199
+ return obj && obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj);
24200
+ }
24201
+ function keyIdentity(key) {
24202
+ return key;
24203
+ }
24204
+ //# sourceMappingURL=flatten.utils.js.map
24205
+
24206
+ /***/ }),
24207
+
24208
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/index.js":
24209
+ /*!****************************************************************************************************!*\
24210
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/index.js ***!
24211
+ \****************************************************************************************************/
24212
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
24213
+
24214
+ "use strict";
24215
+
24216
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
24217
+ if (k2 === undefined) k2 = k;
24218
+ var desc = Object.getOwnPropertyDescriptor(m, k);
24219
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
24220
+ desc = { enumerable: true, get: function() { return m[k]; } };
24221
+ }
24222
+ Object.defineProperty(o, k2, desc);
24223
+ }) : (function(o, m, k, k2) {
24224
+ if (k2 === undefined) k2 = k;
24225
+ o[k2] = m[k];
24226
+ }));
24227
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
24228
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
24229
+ };
24230
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
24231
+ __exportStar(__webpack_require__(/*! ./is-entitled.evaluator */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/is-entitled.evaluator.js"), exports);
24232
+ __exportStar(__webpack_require__(/*! ./types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/types.js"), exports);
24233
+ __exportStar(__webpack_require__(/*! ./attributes.utils */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/attributes.utils.js"), exports);
24234
+ //# sourceMappingURL=index.js.map
24235
+
24236
+ /***/ }),
24237
+
24238
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/is-entitled.evaluator.js":
24239
+ /*!********************************************************************************************************************!*\
24240
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/is-entitled.evaluator.js ***!
24241
+ \********************************************************************************************************************/
24242
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24243
+
24244
+ "use strict";
24245
+
24246
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
24247
+ exports.evaluateIsEntitledToPermissions = exports.evaluateIsEntitledToFeature = void 0;
24248
+ const types_1 = __webpack_require__(/*! ./types */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/types.js");
24249
+ const feature_flags_1 = __webpack_require__(/*! ../feature-flags */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/feature-flags/index.js");
24250
+ const attributes_utils_1 = __webpack_require__(/*! ./attributes.utils */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/attributes.utils.js");
24251
+ const rules_1 = __webpack_require__(/*! ../rules */ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/rules/index.js");
24252
+ function evaluateIsEntitledToFeature(featureKey, userEntitlementsContext, attributes = {}) {
24253
+ const feature = userEntitlementsContext.features[featureKey];
24254
+ let hasExpired = false;
24255
+ if (feature && feature.expireTime !== null) {
24256
+ hasExpired = feature.expireTime !== types_1.NO_EXPIRATION_TIME && feature.expireTime < Date.now();
24257
+ if (!hasExpired) {
24258
+ return { isEntitled: true };
24259
+ }
24260
+ }
24261
+ if (feature && feature.featureFlag) {
24262
+ const preparedAttributes = (0, attributes_utils_1.prepareAttributes)(attributes);
24263
+ const { treatment } = (0, feature_flags_1.evaluateFeatureFlag)(feature.featureFlag, preparedAttributes);
24264
+ if (treatment === rules_1.TreatmentEnum.True) {
24265
+ return { isEntitled: true };
24266
+ }
24267
+ }
24268
+ return {
24269
+ isEntitled: false,
24270
+ justification: hasExpired ? types_1.NotEntitledJustification.BUNDLE_EXPIRED : types_1.NotEntitledJustification.MISSING_FEATURE,
24271
+ };
24272
+ }
24273
+ exports.evaluateIsEntitledToFeature = evaluateIsEntitledToFeature;
24274
+ function evaluateIsEntitledToPermissions(permissionKey, userEntitlementsContext, attributes) {
24275
+ const permission = userEntitlementsContext.permissions[permissionKey];
24276
+ if (!permission) {
24277
+ return { isEntitled: false, justification: types_1.NotEntitledJustification.MISSING_PERMISSION };
24278
+ }
24279
+ const linkedFeatures = getLinkedFeatures(permissionKey, userEntitlementsContext);
24280
+ if (!linkedFeatures.length) {
24281
+ return { isEntitled: true };
24282
+ }
24283
+ let hasExpired = false;
24284
+ for (const featureKey of linkedFeatures) {
24285
+ const { isEntitled, justification } = evaluateIsEntitledToFeature(featureKey, userEntitlementsContext, attributes);
24286
+ if (isEntitled) {
24287
+ return { isEntitled: true };
24288
+ }
24289
+ if (justification === types_1.NotEntitledJustification.BUNDLE_EXPIRED) {
24290
+ hasExpired = true;
24291
+ }
24292
+ }
24293
+ return {
24294
+ isEntitled: false,
24295
+ justification: hasExpired ? types_1.NotEntitledJustification.BUNDLE_EXPIRED : types_1.NotEntitledJustification.MISSING_FEATURE,
24296
+ };
24297
+ }
24298
+ exports.evaluateIsEntitledToPermissions = evaluateIsEntitledToPermissions;
24299
+ function getLinkedFeatures(permissionKey, userEntitlementsContext) {
24300
+ return Object.keys(userEntitlementsContext.features).filter((featureKey) => userEntitlementsContext.features[featureKey].linkedPermissions.includes(permissionKey));
24301
+ }
24302
+ //# sourceMappingURL=is-entitled.evaluator.js.map
24303
+
24304
+ /***/ }),
24305
+
24306
+ /***/ "../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/types.js":
24307
+ /*!****************************************************************************************************!*\
24308
+ !*** ../../node_modules/@frontegg/entitlements-javascript-commons/dist/user-entitlements/types.js ***!
24309
+ \****************************************************************************************************/
24310
+ /***/ ((__unused_webpack_module, exports) => {
24311
+
24312
+ "use strict";
24313
+
24314
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
24315
+ exports.NO_EXPIRATION_TIME = exports.NotEntitledJustification = void 0;
24316
+ var NotEntitledJustification;
24317
+ (function (NotEntitledJustification) {
24318
+ NotEntitledJustification["MISSING_FEATURE"] = "MISSING_FEATURE";
24319
+ NotEntitledJustification["MISSING_PERMISSION"] = "MISSING_PERMISSION";
24320
+ NotEntitledJustification["BUNDLE_EXPIRED"] = "BUNDLE_EXPIRED";
24321
+ })(NotEntitledJustification = exports.NotEntitledJustification || (exports.NotEntitledJustification = {}));
24322
+ exports.NO_EXPIRATION_TIME = -1;
24323
+ //# sourceMappingURL=types.js.map
24324
+
23196
24325
  /***/ }),
23197
24326
 
23198
24327
  /***/ "../../node_modules/@frontegg/rest-api/ContextHolder/index.js":
@@ -24438,9 +25567,12 @@ __webpack_require__.r(__webpack_exports__);
24438
25567
  /* harmony export */ "MFAStrategyEnum": () => (/* binding */ MFAStrategyEnum),
24439
25568
  /* harmony export */ "RestrictionType": () => (/* reexport safe */ _secutiry_poilicy_interfaces__WEBPACK_IMPORTED_MODULE_0__.RestrictionType),
24440
25569
  /* harmony export */ "SecondaryAuthStrategy": () => (/* binding */ SecondaryAuthStrategy),
25570
+ /* harmony export */ "USE_ENTITLEMENTS_V2_ENDPOINT_FF": () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_1__.USE_ENTITLEMENTS_V2_ENDPOINT_FF),
24441
25571
  /* harmony export */ "WebAuthnDeviceType": () => (/* binding */ WebAuthnDeviceType)
24442
25572
  /* harmony export */ });
24443
25573
  /* harmony import */ var _secutiry_poilicy_interfaces__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./secutiry-poilicy/interfaces */ "../../node_modules/@frontegg/rest-api/auth/secutiry-poilicy/interfaces.js");
25574
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "../../node_modules/@frontegg/rest-api/auth/constants.js");
25575
+
24444
25576
 
24445
25577
  let SecondaryAuthStrategy;
24446
25578
 
@@ -25762,6 +26894,7 @@ __webpack_require__.r(__webpack_exports__);
25762
26894
  /* harmony export */ "SortByEnum": () => (/* reexport safe */ _users_interfaces__WEBPACK_IMPORTED_MODULE_10__.SortByEnum),
25763
26895
  /* harmony export */ "TenantSortByEnum": () => (/* reexport safe */ _tenants_interfaces__WEBPACK_IMPORTED_MODULE_4__.TenantSortByEnum),
25764
26896
  /* harmony export */ "TenantType": () => (/* reexport safe */ _tenants_interfaces__WEBPACK_IMPORTED_MODULE_4__.TenantType),
26897
+ /* harmony export */ "USE_ENTITLEMENTS_V2_ENDPOINT_FF": () => (/* reexport safe */ _auth_interfaces__WEBPACK_IMPORTED_MODULE_1__.USE_ENTITLEMENTS_V2_ENDPOINT_FF),
25765
26898
  /* harmony export */ "UserManagedByEnum": () => (/* reexport safe */ _teams_interfaces__WEBPACK_IMPORTED_MODULE_3__.UserManagedByEnum),
25766
26899
  /* harmony export */ "WebAuthnDeviceType": () => (/* reexport safe */ _auth_interfaces__WEBPACK_IMPORTED_MODULE_1__.WebAuthnDeviceType),
25767
26900
  /* harmony export */ "api": () => (/* binding */ api),
@@ -25822,7 +26955,7 @@ __webpack_require__.r(__webpack_exports__);
25822
26955
  /* harmony import */ var _users_interfaces__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./users/interfaces */ "../../node_modules/@frontegg/rest-api/users/interfaces.js");
25823
26956
  /* harmony import */ var _entitlements_interfaces__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./entitlements/interfaces */ "../../node_modules/@frontegg/rest-api/entitlements/interfaces.js");
25824
26957
  /* harmony import */ var _security_center_interfaces__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./security-center/interfaces */ "../../node_modules/@frontegg/rest-api/security-center/interfaces.js");
25825
- /** @license Frontegg v3.1.34
26958
+ /** @license Frontegg v3.1.38
25826
26959
  *
25827
26960
  * This source code is licensed under the MIT license found in the
25828
26961
  * LICENSE file in the root directory of this source tree.
@@ -34130,6 +35263,42 @@ try {
34130
35263
  }
34131
35264
 
34132
35265
 
35266
+ /***/ }),
35267
+
35268
+ /***/ "../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":
35269
+ /*!*************************************************************************!*\
35270
+ !*** ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js ***!
35271
+ \*************************************************************************/
35272
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35273
+
35274
+ "use strict";
35275
+ __webpack_require__.r(__webpack_exports__);
35276
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35277
+ /* harmony export */ "default": () => (/* binding */ _arrayLikeToArray)
35278
+ /* harmony export */ });
35279
+ function _arrayLikeToArray(arr, len) {
35280
+ if (len == null || len > arr.length) len = arr.length;
35281
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
35282
+ return arr2;
35283
+ }
35284
+
35285
+ /***/ }),
35286
+
35287
+ /***/ "../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":
35288
+ /*!***********************************************************************!*\
35289
+ !*** ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***!
35290
+ \***********************************************************************/
35291
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35292
+
35293
+ "use strict";
35294
+ __webpack_require__.r(__webpack_exports__);
35295
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35296
+ /* harmony export */ "default": () => (/* binding */ _arrayWithHoles)
35297
+ /* harmony export */ });
35298
+ function _arrayWithHoles(arr) {
35299
+ if (Array.isArray(arr)) return arr;
35300
+ }
35301
+
34133
35302
  /***/ }),
34134
35303
 
34135
35304
  /***/ "../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":
@@ -34433,6 +35602,64 @@ function _isNativeReflectConstruct() {
34433
35602
 
34434
35603
  /***/ }),
34435
35604
 
35605
+ /***/ "../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js":
35606
+ /*!*****************************************************************************!*\
35607
+ !*** ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js ***!
35608
+ \*****************************************************************************/
35609
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35610
+
35611
+ "use strict";
35612
+ __webpack_require__.r(__webpack_exports__);
35613
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35614
+ /* harmony export */ "default": () => (/* binding */ _iterableToArrayLimit)
35615
+ /* harmony export */ });
35616
+ function _iterableToArrayLimit(arr, i) {
35617
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
35618
+ if (null != _i) {
35619
+ var _s,
35620
+ _e,
35621
+ _x,
35622
+ _r,
35623
+ _arr = [],
35624
+ _n = !0,
35625
+ _d = !1;
35626
+ try {
35627
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
35628
+ if (Object(_i) !== _i) return;
35629
+ _n = !1;
35630
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
35631
+ } catch (err) {
35632
+ _d = !0, _e = err;
35633
+ } finally {
35634
+ try {
35635
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
35636
+ } finally {
35637
+ if (_d) throw _e;
35638
+ }
35639
+ }
35640
+ return _arr;
35641
+ }
35642
+ }
35643
+
35644
+ /***/ }),
35645
+
35646
+ /***/ "../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":
35647
+ /*!************************************************************************!*\
35648
+ !*** ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***!
35649
+ \************************************************************************/
35650
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35651
+
35652
+ "use strict";
35653
+ __webpack_require__.r(__webpack_exports__);
35654
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35655
+ /* harmony export */ "default": () => (/* binding */ _nonIterableRest)
35656
+ /* harmony export */ });
35657
+ function _nonIterableRest() {
35658
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
35659
+ }
35660
+
35661
+ /***/ }),
35662
+
34436
35663
  /***/ "../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js":
34437
35664
  /*!**********************************************************************!*\
34438
35665
  !*** ../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***!
@@ -34543,6 +35770,31 @@ function _setPrototypeOf(o, p) {
34543
35770
 
34544
35771
  /***/ }),
34545
35772
 
35773
+ /***/ "../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js":
35774
+ /*!**********************************************************************!*\
35775
+ !*** ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js ***!
35776
+ \**********************************************************************/
35777
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35778
+
35779
+ "use strict";
35780
+ __webpack_require__.r(__webpack_exports__);
35781
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35782
+ /* harmony export */ "default": () => (/* binding */ _slicedToArray)
35783
+ /* harmony export */ });
35784
+ /* harmony import */ var _arrayWithHoles_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles.js */ "../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");
35785
+ /* harmony import */ var _iterableToArrayLimit_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js");
35786
+ /* harmony import */ var _unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");
35787
+ /* harmony import */ var _nonIterableRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./nonIterableRest.js */ "../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");
35788
+
35789
+
35790
+
35791
+
35792
+ function _slicedToArray(arr, i) {
35793
+ return (0,_arrayWithHoles_js__WEBPACK_IMPORTED_MODULE_0__["default"])(arr) || (0,_iterableToArrayLimit_js__WEBPACK_IMPORTED_MODULE_1__["default"])(arr, i) || (0,_unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__["default"])(arr, i) || (0,_nonIterableRest_js__WEBPACK_IMPORTED_MODULE_3__["default"])();
35794
+ }
35795
+
35796
+ /***/ }),
35797
+
34546
35798
  /***/ "../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js":
34547
35799
  /*!********************************************************************!*\
34548
35800
  !*** ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
@@ -34614,6 +35866,30 @@ function _typeof(obj) {
34614
35866
 
34615
35867
  /***/ }),
34616
35868
 
35869
+ /***/ "../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":
35870
+ /*!***********************************************************************************!*\
35871
+ !*** ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js ***!
35872
+ \***********************************************************************************/
35873
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
35874
+
35875
+ "use strict";
35876
+ __webpack_require__.r(__webpack_exports__);
35877
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35878
+ /* harmony export */ "default": () => (/* binding */ _unsupportedIterableToArray)
35879
+ /* harmony export */ });
35880
+ /* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayLikeToArray.js */ "../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");
35881
+
35882
+ function _unsupportedIterableToArray(o, minLen) {
35883
+ if (!o) return;
35884
+ if (typeof o === "string") return (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(o, minLen);
35885
+ var n = Object.prototype.toString.call(o).slice(8, -1);
35886
+ if (n === "Object" && o.constructor) n = o.constructor.name;
35887
+ if (n === "Map" || n === "Set") return Array.from(o);
35888
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return (0,_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__["default"])(o, minLen);
35889
+ }
35890
+
35891
+ /***/ }),
35892
+
34617
35893
  /***/ "../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js":
34618
35894
  /*!************************************************************************!*\
34619
35895
  !*** ../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js ***!
@@ -34720,7 +35996,7 @@ function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=a
34720
35996
  /******/ };
34721
35997
  /******/
34722
35998
  /******/ // Execute the module function
34723
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
35999
+ /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
34724
36000
  /******/
34725
36001
  /******/ // Return the exports of the module
34726
36002
  /******/ return module.exports;