@copart/ops-tool-kit 1.13.0-beta.1 → 1.13.0-beta.10

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.
@@ -47,7 +47,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
47
47
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
48
48
 
49
49
  const name$1 = "@copart/ops-tool-kit";
50
- const version$3 = "1.13.0-beta.1";
50
+ const version$3 = "1.13.0-beta.10";
51
51
  const main$1 = "dist/ops-tool-kit.js";
52
52
  const style = "dist/ops-tool-kit.css";
53
53
  const files = [
@@ -2449,22 +2449,22 @@ var stringify$1 = function stringify(target) {
2449
2449
 
2450
2450
  emitStorageEvents('local');
2451
2451
  emitStorageEvents('session');
2452
- var getLocalItem = function getLocalItem(key, path) {
2452
+ var getLocalItem$1 = function getLocalItem(key, path) {
2453
2453
  var data = parse$1(localStorage[key]) || {};
2454
2454
  return path ? getValue$1(data, path) : data;
2455
2455
  };
2456
- var getSessionItem = function getSessionItem(key, path) {
2456
+ var getSessionItem$1 = function getSessionItem(key, path) {
2457
2457
  var data = parse$1(sessionStorage[key]) || {};
2458
2458
  return path ? getValue$1(data, path) : data;
2459
2459
  };
2460
- var setLocalItem = function setLocalItem(key, value, path) {
2460
+ var setLocalItem$1 = function setLocalItem(key, value, path) {
2461
2461
  if (value) {
2462
- localStorage[key] = stringify$1(path ? setValue(getLocalItem(key), path, value) : value);
2462
+ localStorage[key] = stringify$1(path ? setValue(getLocalItem$1(key), path, value) : value);
2463
2463
  }
2464
2464
  };
2465
- var setSessionItem = function setSessionItem(key, value, path) {
2465
+ var setSessionItem$1 = function setSessionItem(key, value, path) {
2466
2466
  if (value) {
2467
- sessionStorage[key] = stringify$1(path ? setValue(getSessionItem(key), path, value) : value);
2467
+ sessionStorage[key] = stringify$1(path ? setValue(getSessionItem$1(key), path, value) : value);
2468
2468
  }
2469
2469
  };
2470
2470
  var getItemFromStorage = function getItemFromStorage(storage) {
@@ -2485,7 +2485,7 @@ var resetRole = function resetRole() {
2485
2485
  var newSettings = getItemFromStorage(localStorage)('settings');
2486
2486
  localStorage.setItem('settings', newSettings);
2487
2487
  };
2488
- var clearStorage = function clearStorage() {
2488
+ var clearStorage$1 = function clearStorage() {
2489
2489
  localStorage.removeItem('login');
2490
2490
  localStorage.removeItem('twilio');
2491
2491
  //Clear app permissions
@@ -2502,7 +2502,7 @@ var clearStorage = function clearStorage() {
2502
2502
  // Clear Mihub related field. Need to revisit this
2503
2503
  sessionStorage.removeItem('globalNavResponseObj');
2504
2504
  };
2505
- var setAppContext = function setAppContext() {
2505
+ var setAppContext$1 = function setAppContext() {
2506
2506
  var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2507
2507
  try {
2508
2508
  var _window$toolkitEnv, _window$toolkitEnv2, _window$toolkitEnv3;
@@ -2511,10 +2511,10 @@ var setAppContext = function setAppContext() {
2511
2511
  }
2512
2512
  var isCoreApp = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
2513
2513
  if (isCoreApp) {
2514
- setSessionItem('opsportal-core:miHelpBotContext', context);
2514
+ setSessionItem$1('opsportal-core:miHelpBotContext', context);
2515
2515
  return;
2516
2516
  }
2517
- var appTiles = storage$1.getLocalItem('opsportal-core:config').tiles || [];
2517
+ var appTiles = storage$2.getLocalItem('opsportal-core:config').tiles || [];
2518
2518
  var appName = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
2519
2519
  var appData = appTiles.find(function (tile) {
2520
2520
  if (tile.appName) {
@@ -2525,28 +2525,28 @@ var setAppContext = function setAppContext() {
2525
2525
  });
2526
2526
  var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv3 = window.toolkitEnv) !== null && _window$toolkitEnv3 !== void 0 && _window$toolkitEnv3.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
2527
2527
  if (!appAuthName) throw new Error('appAuthName not found');
2528
- setSessionItem("".concat(appAuthName, ":miHelpBotContext"), context);
2528
+ setSessionItem$1("".concat(appAuthName, ":miHelpBotContext"), context);
2529
2529
  } catch (e) {
2530
2530
  console.log('Error while setting context ', e);
2531
2531
  }
2532
2532
  };
2533
2533
  var createOpsStorage = function createOpsStorage() {
2534
2534
  return {
2535
- getLocalItem: getLocalItem,
2536
- setLocalItem: setLocalItem,
2537
- getSessionItem: getSessionItem,
2538
- setSessionItem: setSessionItem,
2539
- setAppContext: setAppContext,
2535
+ getLocalItem: getLocalItem$1,
2536
+ setLocalItem: setLocalItem$1,
2537
+ getSessionItem: getSessionItem$1,
2538
+ setSessionItem: setSessionItem$1,
2539
+ setAppContext: setAppContext$1,
2540
2540
  setItem: function setItem(key, value) {
2541
2541
  var _window$toolkitEnv4;
2542
2542
  var APP_NAME = (_window$toolkitEnv4 = window.toolkitEnv) !== null && _window$toolkitEnv4 !== void 0 && _window$toolkitEnv4.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
2543
- setLocalItem("".concat(APP_NAME, ":").concat(key), value);
2543
+ setLocalItem$1("".concat(APP_NAME, ":").concat(key), value);
2544
2544
  return value;
2545
2545
  },
2546
2546
  getItem: function getItem(key) {
2547
2547
  var _window$toolkitEnv5;
2548
2548
  var APP_NAME = (_window$toolkitEnv5 = window.toolkitEnv) !== null && _window$toolkitEnv5 !== void 0 && _window$toolkitEnv5.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
2549
- var value = getLocalItem("".concat(APP_NAME, ":").concat(key));
2549
+ var value = getLocalItem$1("".concat(APP_NAME, ":").concat(key));
2550
2550
  return value;
2551
2551
  },
2552
2552
  get appContext() {
@@ -2554,10 +2554,10 @@ var createOpsStorage = function createOpsStorage() {
2554
2554
  var _window$toolkitEnv6;
2555
2555
  var isCoreApp = (_window$toolkitEnv6 = window.toolkitEnv) !== null && _window$toolkitEnv6 !== void 0 && _window$toolkitEnv6.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
2556
2556
  if (isCoreApp) {
2557
- return getSessionItem('opsportal-core:miHelpBotContext');
2557
+ return getSessionItem$1('opsportal-core:miHelpBotContext');
2558
2558
  } else {
2559
2559
  var _window$toolkitEnv7, _window$toolkitEnv8;
2560
- var appTiles = storage$1.getLocalItem('opsportal-core:config').tiles || [];
2560
+ var appTiles = storage$2.getLocalItem('opsportal-core:config').tiles || [];
2561
2561
  var appName = (_window$toolkitEnv7 = window.toolkitEnv) !== null && _window$toolkitEnv7 !== void 0 && _window$toolkitEnv7.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
2562
2562
  var appData = appTiles.find(function (tile) {
2563
2563
  if (tile.appName) {
@@ -2567,7 +2567,7 @@ var createOpsStorage = function createOpsStorage() {
2567
2567
  }
2568
2568
  });
2569
2569
  var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv8 = window.toolkitEnv) !== null && _window$toolkitEnv8 !== void 0 && _window$toolkitEnv8.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
2570
- return appAuthName ? getSessionItem("".concat(appAuthName, ":miHelpBotContext")) : {};
2570
+ return appAuthName ? getSessionItem$1("".concat(appAuthName, ":miHelpBotContext")) : {};
2571
2571
  }
2572
2572
  } catch (e) {
2573
2573
  console.log('App context error, ', e);
@@ -2578,20 +2578,20 @@ var createOpsStorage = function createOpsStorage() {
2578
2578
  return getItem('config');
2579
2579
  },
2580
2580
  get permissions() {
2581
- return storage$1.getLocalItem('settings', 'permissions') || [];
2581
+ return storage$2.getLocalItem('settings', 'permissions') || [];
2582
2582
  },
2583
2583
  get permissionIds() {
2584
- return storage$1.getLocalItem('settings', 'permissionIds') || [];
2584
+ return storage$2.getLocalItem('settings', 'permissionIds') || [];
2585
2585
  },
2586
2586
  get allPermissionIds() {
2587
- return storage$1.getLocalItem('settings', 'allPermissionIds') || [];
2587
+ return storage$2.getLocalItem('settings', 'allPermissionIds') || [];
2588
2588
  },
2589
2589
  get coreAppPermissions() {
2590
- return storage$1.getLocalItem('ops_portal:permissions') || [];
2590
+ return storage$2.getLocalItem('ops_portal:permissions') || [];
2591
2591
  },
2592
2592
  get currentAppPermissions() {
2593
2593
  var _window$toolkitEnv9, _window$toolkitEnv0;
2594
- var appTiles = storage$1.getLocalItem('opsportal-core:config').tiles || [];
2594
+ var appTiles = storage$2.getLocalItem('opsportal-core:config').tiles || [];
2595
2595
  var appName = (_window$toolkitEnv9 = window.toolkitEnv) !== null && _window$toolkitEnv9 !== void 0 && _window$toolkitEnv9.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
2596
2596
  var appData = appTiles.find(function (tile) {
2597
2597
  if (tile.appName) {
@@ -2601,142 +2601,142 @@ var createOpsStorage = function createOpsStorage() {
2601
2601
  }
2602
2602
  });
2603
2603
  var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv0 = window.toolkitEnv) !== null && _window$toolkitEnv0 !== void 0 && _window$toolkitEnv0.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
2604
- return appAuthName ? storage$1.getLocalItem("".concat(appAuthName, ":permissions")) : [];
2604
+ return appAuthName ? storage$2.getLocalItem("".concat(appAuthName, ":permissions")) : [];
2605
2605
  },
2606
2606
  get appScopesAndFunctions() {
2607
- return getLocalItem('appScopesAndFunctions') || [];
2607
+ return getLocalItem$1('appScopesAndFunctions') || [];
2608
2608
  },
2609
2609
  get userAppScopes() {
2610
- return getLocalItem('login', 'userAppScopes') || [];
2610
+ return getLocalItem$1('login', 'userAppScopes') || [];
2611
2611
  },
2612
2612
  get coreConfig() {
2613
- return getLocalItem('opsportal-core:config');
2613
+ return getLocalItem$1('opsportal-core:config');
2614
2614
  },
2615
2615
  get userName() {
2616
- return getLocalItem('login', 'userData.entity_name');
2616
+ return getLocalItem$1('login', 'userData.entity_name');
2617
2617
  },
2618
2618
  get userAvailability() {
2619
- return getLocalItem('dashboard', 'userAvailability');
2619
+ return getLocalItem$1('dashboard', 'userAvailability');
2620
2620
  },
2621
2621
  get userEmail() {
2622
- return getLocalItem('login', 'userData.entity_mail');
2622
+ return getLocalItem$1('login', 'userData.entity_mail');
2623
2623
  },
2624
2624
  get userCopartId() {
2625
- return getLocalItem('login', 'userData.entity_employee_copart_id');
2625
+ return getLocalItem$1('login', 'userData.entity_employee_copart_id');
2626
2626
  },
2627
2627
  get userSamAccount() {
2628
- return getLocalItem('login', 'userData.entity_sam_id');
2628
+ return getLocalItem$1('login', 'userData.entity_sam_id');
2629
2629
  },
2630
2630
  get userCountry() {
2631
- return getLocalItem('login', 'userData.entity_country');
2631
+ return getLocalItem$1('login', 'userData.entity_country');
2632
2632
  },
2633
2633
  get accessToken() {
2634
- return getLocalItem('login', 'userData.access_token');
2634
+ return getLocalItem$1('login', 'userData.access_token');
2635
2635
  },
2636
2636
  get refreshToken() {
2637
- return getLocalItem('login', 'userData.refresh_token');
2637
+ return getLocalItem$1('login', 'userData.refresh_token');
2638
2638
  },
2639
2639
  get isAuthenticated() {
2640
- return getLocalItem('login', 'isAuthenticated');
2640
+ return getLocalItem$1('login', 'isAuthenticated');
2641
2641
  },
2642
2642
  get activeCountry() {
2643
2643
  var _getSessionItem;
2644
- return (_getSessionItem = getSessionItem('dashboard')) === null || _getSessionItem === void 0 ? void 0 : _getSessionItem.selectedCountry;
2644
+ return (_getSessionItem = getSessionItem$1('dashboard')) === null || _getSessionItem === void 0 ? void 0 : _getSessionItem.selectedCountry;
2645
2645
  },
2646
2646
  get activeLanguage() {
2647
2647
  var _getSessionItem2;
2648
- return ((_getSessionItem2 = getSessionItem('dashboard')) === null || _getSessionItem2 === void 0 ? void 0 : _getSessionItem2.language) || 'en';
2648
+ return ((_getSessionItem2 = getSessionItem$1('dashboard')) === null || _getSessionItem2 === void 0 ? void 0 : _getSessionItem2.language) || 'en';
2649
2649
  },
2650
2650
  get userSecurityLevel() {
2651
- return Number(getSessionItem('securityLevel')) || 0;
2651
+ return Number(getSessionItem$1('securityLevel')) || 0;
2652
2652
  },
2653
2653
  get phoneNumber() {
2654
2654
  var _getLocalItem;
2655
- return (_getLocalItem = getLocalItem('dashboard')) === null || _getLocalItem === void 0 ? void 0 : _getLocalItem.phoneNumber;
2655
+ return (_getLocalItem = getLocalItem$1('dashboard')) === null || _getLocalItem === void 0 ? void 0 : _getLocalItem.phoneNumber;
2656
2656
  },
2657
2657
  get userRole() {
2658
2658
  var _getLocalItem2;
2659
- return ((_getLocalItem2 = getLocalItem('settings')) === null || _getLocalItem2 === void 0 ? void 0 : _getLocalItem2.selectedRole) || '';
2659
+ return ((_getLocalItem2 = getLocalItem$1('settings')) === null || _getLocalItem2 === void 0 ? void 0 : _getLocalItem2.selectedRole) || '';
2660
2660
  },
2661
2661
  get hasCasAccess() {
2662
2662
  var _getLocalItem3, _getLocalItem3$userDa;
2663
- return (_getLocalItem3 = getLocalItem('login')) === null || _getLocalItem3 === void 0 ? void 0 : (_getLocalItem3$userDa = _getLocalItem3.userData) === null || _getLocalItem3$userDa === void 0 ? void 0 : _getLocalItem3$userDa.hasCasAccess;
2663
+ return (_getLocalItem3 = getLocalItem$1('login')) === null || _getLocalItem3 === void 0 ? void 0 : (_getLocalItem3$userDa = _getLocalItem3.userData) === null || _getLocalItem3$userDa === void 0 ? void 0 : _getLocalItem3$userDa.hasCasAccess;
2664
2664
  },
2665
2665
  get activeYardNumber() {
2666
2666
  var _getSessionItem3;
2667
- return (_getSessionItem3 = getSessionItem('dashboard')) === null || _getSessionItem3 === void 0 ? void 0 : _getSessionItem3.selectedYard;
2667
+ return (_getSessionItem3 = getSessionItem$1('dashboard')) === null || _getSessionItem3 === void 0 ? void 0 : _getSessionItem3.selectedYard;
2668
2668
  },
2669
2669
  get lastSelectedYard() {
2670
- var data = getLocalItem('lastSelectedYard');
2670
+ var data = getLocalItem$1('lastSelectedYard');
2671
2671
  if (data && Object.entries(data).length) {
2672
2672
  return data;
2673
2673
  }
2674
2674
  },
2675
2675
  get homeYard() {
2676
2676
  var _getLocalItem4;
2677
- var yardList = ((_getLocalItem4 = getLocalItem('login')) === null || _getLocalItem4 === void 0 ? void 0 : _getLocalItem4.yardList) || [];
2677
+ var yardList = ((_getLocalItem4 = getLocalItem$1('login')) === null || _getLocalItem4 === void 0 ? void 0 : _getLocalItem4.yardList) || [];
2678
2678
  return yardList.find(function (yard) {
2679
2679
  return yard.isHomeYard === 'Y';
2680
2680
  });
2681
2681
  },
2682
2682
  get selectedHierarchy() {
2683
- return storage$1.getLocalItem('settings', 'selectedHierarchy') || {};
2683
+ return storage$2.getLocalItem('settings', 'selectedHierarchy') || {};
2684
2684
  },
2685
2685
  get selectedHierarchyOption() {
2686
- return storage$1.getLocalItem('settings', 'selectedHierarchyOption') || {};
2686
+ return storage$2.getLocalItem('settings', 'selectedHierarchyOption') || {};
2687
2687
  },
2688
2688
  get chromePluginData() {
2689
- return storage$1.getLocalItem('chromePluginData') || {};
2689
+ return storage$2.getLocalItem('chromePluginData') || {};
2690
2690
  },
2691
2691
  get twilioVoiceTask() {
2692
- return getLocalItem('twilio', 'voiceTask') || {};
2692
+ return getLocalItem$1('twilio', 'voiceTask') || {};
2693
2693
  },
2694
2694
  get twilioCallAnswered() {
2695
- return getLocalItem('twilio', 'callAccepted') || false;
2695
+ return getLocalItem$1('twilio', 'callAccepted') || false;
2696
2696
  },
2697
2697
  get twilioWrapup() {
2698
- return getLocalItem('twilio', 'wrapUpCall') || false;
2698
+ return getLocalItem$1('twilio', 'wrapUpCall') || false;
2699
2699
  },
2700
2700
  get twilioEnabledStatus() {
2701
- return getLocalItem('dashboard', 'twilioEnabled') || false;
2701
+ return getLocalItem$1('dashboard', 'twilioEnabled') || false;
2702
2702
  },
2703
2703
  get clickToDialEnabledStatus() {
2704
2704
  return localStorage.c2dEnabled ? JSON.parse(localStorage.c2dEnabled) : false;
2705
2705
  },
2706
2706
  get callCapsuleEnabledStatus() {
2707
- return getLocalItem('dashboard', 'isCallCapsuleEnabled') || false;
2707
+ return getLocalItem$1('dashboard', 'isCallCapsuleEnabled') || false;
2708
2708
  },
2709
2709
  get flexLoaded() {
2710
- return getLocalItem('twilio', 'flexLoaded') || false;
2710
+ return getLocalItem$1('twilio', 'flexLoaded') || false;
2711
2711
  },
2712
2712
  get workerProfileData() {
2713
- return getLocalItem('twilio', 'workerProfileData') || {};
2713
+ return getLocalItem$1('twilio', 'workerProfileData') || {};
2714
2714
  },
2715
2715
  get twilioStatus() {
2716
- return getLocalItem('twilio', 'status') || 'Offline';
2716
+ return getLocalItem$1('twilio', 'status') || 'Offline';
2717
2717
  },
2718
2718
  get twilioUserStatus() {
2719
- return getLocalItem('twilio', 'userStatus') || 'Offline';
2719
+ return getLocalItem$1('twilio', 'userStatus') || 'Offline';
2720
2720
  },
2721
2721
  get twilioCallSid() {
2722
- return getLocalItem('twilio', 'callSid') || false;
2722
+ return getLocalItem$1('twilio', 'callSid') || false;
2723
2723
  },
2724
2724
  get twilioWarning() {
2725
- return getLocalItem('twilio', 'warning') || 'false';
2725
+ return getLocalItem$1('twilio', 'warning') || 'false';
2726
2726
  },
2727
2727
  clear: function clear() {
2728
- return clearStorage();
2728
+ return clearStorage$1();
2729
2729
  },
2730
2730
  logout: function logout() {
2731
- clearStorage();
2731
+ clearStorage$1();
2732
2732
  localStorage.removeItem('c2dEnabled');
2733
2733
  localStorage.removeItem('mihelpAgentConversations');
2734
2734
  window.location.assign('/logout');
2735
2735
  }
2736
2736
  };
2737
2737
  };
2738
- var storage$1 = createOpsStorage();
2739
- global.storage = storage$1;
2738
+ var storage$2 = createOpsStorage();
2739
+ global.storage = storage$2;
2740
2740
 
2741
2741
  var DEFAULT_BREADCRUMBS_CONTEXT = {
2742
2742
  error: 'You tried to use Breadcrumbs outside of its context.'
@@ -2767,17 +2767,19 @@ var withBreadcrumbs = function withBreadcrumbs(Comp) {
2767
2767
  }(React__namespace.Component);
2768
2768
  };
2769
2769
  var Breadcrumbs = withBreadcrumbs(index$1.purist(function (props) {
2770
- var _props$appTile, _props$appTile2;
2770
+ var _props$appTile, _props$appTile3;
2771
2771
  return /*#__PURE__*/React__namespace.createElement("div", {
2772
2772
  className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Breadcrumbs"
2773
2773
  }, /*#__PURE__*/React__namespace.createElement("div", {
2774
2774
  className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--crumbs"
2775
2775
  }, props !== null && props !== void 0 && (_props$appTile = props.appTile) !== null && _props$appTile !== void 0 && _props$appTile.title ? /*#__PURE__*/React__namespace.createElement("a", {
2776
2776
  onClick: function onClick() {
2777
- return props.history.push('/');
2777
+ var _props$appTile2;
2778
+ var isEmbedded = window.location.pathname.includes('embedded');
2779
+ props.history.push(isEmbedded && (_props$appTile2 = props.appTile) !== null && _props$appTile2 !== void 0 && _props$appTile2.path ? props.appTile.path : '/');
2778
2780
  },
2779
2781
  className: "utilities_ops-app-frame_Breadcrumbs_styles_Breadcrumbs--Crumb"
2780
- }, props === null || props === void 0 ? void 0 : (_props$appTile2 = props.appTile) === null || _props$appTile2 === void 0 ? void 0 : _props$appTile2.title) : null, props.breadcrumbs.crumbs.map(function (crumb, index) {
2782
+ }, props === null || props === void 0 ? void 0 : (_props$appTile3 = props.appTile) === null || _props$appTile3 === void 0 ? void 0 : _props$appTile3.title) : null, props.breadcrumbs.crumbs.map(function (crumb, index) {
2781
2783
  return /*#__PURE__*/React__namespace.createElement("a", {
2782
2784
  onClick: function onClick() {
2783
2785
  return props.history.push(crumb.to);
@@ -2866,7 +2868,7 @@ var getCrumbProps = function getCrumbProps(props) {
2866
2868
  var crumbProps = _objectWithoutProperties(props, _excluded$4);
2867
2869
  return crumbProps;
2868
2870
  };
2869
- var Crumb = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
2871
+ var Crumb$1 = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
2870
2872
  function Crumb() {
2871
2873
  var _this;
2872
2874
  _classCallCheck$3(this, Crumb);
@@ -2913,7 +2915,7 @@ var Crumb = withBreadcrumbs(_class = /*#__PURE__*/function (_React$Component) {
2913
2915
  }
2914
2916
  }]);
2915
2917
  }(React__namespace.Component)) || _class;
2916
- Crumb.defaultProps = {
2918
+ Crumb$1.defaultProps = {
2917
2919
  breadcrumbs: {
2918
2920
  addCrumb: function addCrumb() {},
2919
2921
  removeCrumb: function removeCrumb() {},
@@ -4943,7 +4945,7 @@ factory["default"] = Wretcher.factory;
4943
4945
  var getRequestBody = function getRequestBody() {
4944
4946
  return {
4945
4947
  grant_type: 'refresh_token',
4946
- refreshToken: storage$1.getLocalItem('login', 'userData.refresh_token')
4948
+ refreshToken: storage$2.getLocalItem('login', 'userData.refresh_token')
4947
4949
  };
4948
4950
  };
4949
4951
  var getRequestOptions = function getRequestOptions() {
@@ -4966,17 +4968,17 @@ var refreshToken = /*#__PURE__*/function () {
4966
4968
  // TODO: Warn the user that they must log back in
4967
4969
  // then send user to login.
4968
4970
  devOnly.error('refreshToken - No refreshToken present.');
4969
- return _context.a(2, storage$1.logout());
4971
+ return _context.a(2, storage$2.logout());
4970
4972
  case 1:
4971
4973
  handleUnauthorized = function handleUnauthorized(error) {
4972
4974
  // TODO: Warn the user that they must log back in first.
4973
4975
  devOnly.error('refreshToken - attempt received unauthorized.');
4974
- storage$1.logout();
4976
+ storage$2.logout();
4975
4977
  };
4976
4978
  handleSuccess = function handleSuccess(data) {
4977
4979
  if (data.access_token && data.refresh_token) {
4978
- storage$1.setLocalItem('login', data.access_token, 'userData.access_token');
4979
- storage$1.setLocalItem('login', data.refresh_token, 'userData.refresh_token');
4980
+ storage$2.setLocalItem('login', data.access_token, 'userData.access_token');
4981
+ storage$2.setLocalItem('login', data.refresh_token, 'userData.refresh_token');
4980
4982
  }
4981
4983
  return data;
4982
4984
  };
@@ -4984,14 +4986,14 @@ var refreshToken = /*#__PURE__*/function () {
4984
4986
  devOnly.error('refreshToken - badRequest', {
4985
4987
  error: error
4986
4988
  });
4987
- storage$1.logout();
4989
+ storage$2.logout();
4988
4990
  };
4989
4991
  handleError = function handleError(error) {
4990
4992
  devOnly.error('refreshToken - Error refreshing config:', {
4991
4993
  error: error
4992
4994
  });
4993
4995
  devOnly.error('expiring login session:');
4994
- storage$1.logout();
4996
+ storage$2.logout();
4995
4997
  };
4996
4998
  _context.n = 2;
4997
4999
  return factory('/refreshToken').options(options).post(body).unauthorized(handleUnauthorized).error(418, handleExpired).json(handleSuccess).catch(handleError);
@@ -5005,7 +5007,7 @@ var refreshToken = /*#__PURE__*/function () {
5005
5007
  };
5006
5008
  }();
5007
5009
 
5008
- var fetcher = axios.create();
5010
+ var fetcher$1 = axios.create();
5009
5011
  var store$1 = {
5010
5012
  isRefreshing: false
5011
5013
  };
@@ -5025,25 +5027,25 @@ var handleHeaderVersion = function handleHeaderVersion(config) {
5025
5027
  };
5026
5028
  var handleRole = function handleRole(config) {
5027
5029
  var _config$headers;
5028
- (_config$headers = config.headers).AUTHORIZATIONROLE || (_config$headers.AUTHORIZATIONROLE = storage$1.userRole);
5030
+ (_config$headers = config.headers).AUTHORIZATIONROLE || (_config$headers.AUTHORIZATIONROLE = storage$2.userRole);
5029
5031
  };
5030
5032
  var handleHeaders = function handleHeaders(config) {
5031
5033
  var _window$toolkitEnv2;
5032
5034
  var stack = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.STACK ? window.toolkitEnv.STACK : process.env.STACK;
5033
5035
  var countryCode = countryCodeMapper[stack];
5034
5036
  handleHeaderVersion(config);
5035
- var countryCodeFromStorage = storage$1.activeCountry || countryCode;
5037
+ var countryCodeFromStorage = storage$2.activeCountry || countryCode;
5036
5038
  var headers = config.headers;
5037
- var accessToken = storage$1.accessToken;
5039
+ var accessToken = storage$2.accessToken;
5038
5040
  handleRole(config);
5039
5041
  if (stack === 'g') {
5040
- headers.SELECTEDYARD = storage$1.activeYardNumber;
5042
+ headers.SELECTEDYARD = storage$2.activeYardNumber;
5041
5043
  headers.site = headers.site || "CPRT".concat(countryCode);
5042
5044
  headers.CORRELATIONID = "cobalt-uuid-".concat(nonSecure());
5043
- headers.languageCode || (headers.languageCode = storage$1.activeLanguage);
5044
- headers.language || (headers.language = storage$1.activeLanguage);
5045
+ headers.languageCode || (headers.languageCode = storage$2.activeLanguage);
5046
+ headers.language || (headers.language = storage$2.activeLanguage);
5045
5047
  } else {
5046
- headers.languageCode || (headers.languageCode = storage$1.activeLanguage);
5048
+ headers.languageCode || (headers.languageCode = storage$2.activeLanguage);
5047
5049
  headers.correlationID || (headers.correlationID = "cas-uuid-".concat(nonSecure()));
5048
5050
  }
5049
5051
  if (accessToken && headers) {
@@ -5068,8 +5070,8 @@ var handleHeaders = function handleHeaders(config) {
5068
5070
  }
5069
5071
  }
5070
5072
  };
5071
- fetcher.interceptors.request.use(function (config) {
5072
- storage$1.getItem('config');
5073
+ fetcher$1.interceptors.request.use(function (config) {
5074
+ storage$2.getItem('config');
5073
5075
 
5074
5076
  // Solr additional params, pass authorization to Solr search endpoint. Ensure backwards compatibility with old solr call
5075
5077
  if (['/solr/', '/search/'].some(function (solrUrl) {
@@ -5091,7 +5093,7 @@ fetcher.interceptors.request.use(function (config) {
5091
5093
  console.error(error);
5092
5094
  return Promise.reject(error);
5093
5095
  });
5094
- fetcher.interceptors.response.use(function (response) {
5096
+ fetcher$1.interceptors.response.use(function (response) {
5095
5097
  return response;
5096
5098
  }, /*#__PURE__*/function () {
5097
5099
  var _ref = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee(error) {
@@ -5109,8 +5111,8 @@ fetcher.interceptors.response.use(function (response) {
5109
5111
  break;
5110
5112
  }
5111
5113
  // Store current URL to redirect to after login
5112
- storage$1.setSessionItem('redirectUrl', window.location.href);
5113
- return _context.a(2, storage$1.logout());
5114
+ storage$2.setSessionItem('redirectUrl', window.location.href);
5115
+ return _context.a(2, storage$2.logout());
5114
5116
  case 1:
5115
5117
  if (store$1.isRefreshing) {
5116
5118
  _context.n = 4;
@@ -5122,7 +5124,7 @@ fetcher.interceptors.response.use(function (response) {
5122
5124
  case 2:
5123
5125
  _context.v;
5124
5126
  _context.n = 3;
5125
- return fetcher.request(error.response.config);
5127
+ return fetcher$1.request(error.response.config);
5126
5128
  case 3:
5127
5129
  final = _context.v;
5128
5130
  store$1.isRefreshing = false;
@@ -5137,35 +5139,35 @@ fetcher.interceptors.response.use(function (response) {
5137
5139
  };
5138
5140
  }());
5139
5141
 
5140
- Object.defineProperty(fetcher, 'extend', {
5142
+ Object.defineProperty(fetcher$1, 'extend', {
5141
5143
  enumerable: false,
5142
5144
  value: function value(name, fn) {
5143
5145
  var INVALID_NAMES = ['defaults', 'delete', 'put', 'post', 'get', 'head', 'interceptors', 'options', 'patch', 'request'];
5144
5146
  var INVALID_NAME_WARNING = "The name of the method used (\"".concat(name, "\") to extend fetcher is invalid.");
5145
5147
  !!INVALID_NAMES.includes(name) ? process.env.NODE_ENV !== "production" ? browser$2(false, INVALID_NAME_WARNING) : browser$2(false) : void 0;
5146
- fetcher[name] = fn;
5148
+ fetcher$1[name] = fn;
5147
5149
  }
5148
5150
  });
5149
5151
 
5150
- var DEFAULT_USER_RULES = {
5152
+ var DEFAULT_USER_RULES$1 = {
5151
5153
  allow: [],
5152
5154
  deny: []
5153
5155
  };
5154
- var DEFAULT_YARD_NUMBER_RULES = {
5156
+ var DEFAULT_YARD_NUMBER_RULES$1 = {
5155
5157
  allow: [],
5156
5158
  deny: []
5157
5159
  };
5158
- var DEFAULT_SECURITY_LEVEL_RULES = {
5160
+ var DEFAULT_SECURITY_LEVEL_RULES$1 = {
5159
5161
  not: [],
5160
5162
  only: [],
5161
5163
  lessThan: 100
5162
5164
  };
5163
- var hydrateTiles = (function () {
5165
+ var hydrateTiles$1 = (function () {
5164
5166
  var tiles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
5165
5167
  var prepared = tiles.map(function (tile) {
5166
- var userRules = _objectSpread2(_objectSpread2({}, DEFAULT_USER_RULES), tile.userRules);
5167
- var yardRules = _objectSpread2(_objectSpread2({}, DEFAULT_YARD_NUMBER_RULES), tile.yardRules);
5168
- var securityLevelRules = _objectSpread2(_objectSpread2({}, DEFAULT_SECURITY_LEVEL_RULES), tile.securityLevelRules);
5168
+ var userRules = _objectSpread2(_objectSpread2({}, DEFAULT_USER_RULES$1), tile.userRules);
5169
+ var yardRules = _objectSpread2(_objectSpread2({}, DEFAULT_YARD_NUMBER_RULES$1), tile.yardRules);
5170
+ var securityLevelRules = _objectSpread2(_objectSpread2({}, DEFAULT_SECURITY_LEVEL_RULES$1), tile.securityLevelRules);
5169
5171
  return _objectSpread2(_objectSpread2({}, tile), {}, {
5170
5172
  yardRules: yardRules,
5171
5173
  userRules: userRules,
@@ -5189,12 +5191,12 @@ var getConfig = /*#__PURE__*/function () {
5189
5191
  return _context.a(2, Promise.reject(new Error('Error, Please make sure "CONFIG_URI" && "CORE_CONFIG_URI" env variables are configured')));
5190
5192
  case 1:
5191
5193
  _context.n = 2;
5192
- return fetcher.get(endpoint);
5194
+ return fetcher$1.get(endpoint);
5193
5195
  case 2:
5194
5196
  response = _context.v;
5195
5197
  config = response.data.data; // Fill in values needed for access checks.
5196
- config.tiles = hydrateTiles(config.tiles);
5197
- config.tileOverrides = hydrateTiles(config.tileOverrides);
5198
+ config.tiles = hydrateTiles$1(config.tiles);
5199
+ config.tileOverrides = hydrateTiles$1(config.tileOverrides);
5198
5200
  return _context.a(2, config);
5199
5201
  case 3:
5200
5202
  _context.p = 3;
@@ -5321,7 +5323,7 @@ var getPermissions = /*#__PURE__*/function () {
5321
5323
  case 1:
5322
5324
  endpoint = (_storage$getLocalItem = storage.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.g2AppPermissions;
5323
5325
  _context.n = 2;
5324
- return fetcher.get("".concat(endpoint).concat(appName), getHeaders$1());
5326
+ return fetcher$1.get("".concat(endpoint).concat(appName), getHeaders$1());
5325
5327
  case 2:
5326
5328
  response = _context.v;
5327
5329
  appDetails = response.data.applications.find(function (app) {
@@ -5565,10 +5567,10 @@ var getAndStoreConfig = /*#__PURE__*/function () {
5565
5567
  case 0:
5566
5568
  configUri = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.CONFIG_URI ? window.toolkitEnv.CONFIG_URI : process.env.CONFIG_URI;
5567
5569
  _context.n = 1;
5568
- return fetcher.getConfig(configUri);
5570
+ return fetcher$1.getConfig(configUri);
5569
5571
  case 1:
5570
5572
  config = _context.v;
5571
- storage$1.setItem('config', config);
5573
+ storage$2.setItem('config', config);
5572
5574
  case 2:
5573
5575
  return _context.a(2);
5574
5576
  }
@@ -5579,13 +5581,13 @@ var getAndStoreConfig = /*#__PURE__*/function () {
5579
5581
  };
5580
5582
  }();
5581
5583
  var storeTokens = function storeTokens(data) {
5582
- storage$1.setLocalItem('login', data.access_token, 'userData.access_token');
5583
- storage$1.setLocalItem('login', data.refresh_token, 'userData.refresh_token');
5584
+ storage$2.setLocalItem('login', data.access_token, 'userData.access_token');
5585
+ storage$2.setLocalItem('login', data.refresh_token, 'userData.refresh_token');
5584
5586
  };
5585
5587
  var storeLoginData = function storeLoginData(data) {
5586
5588
  var email = (data.entity_mail || '').toLowerCase();
5587
5589
  var managerEmail = (data.entity_manager_mail || '').toLowerCase();
5588
- storage$1.setLocalItem('login', {
5590
+ storage$2.setLocalItem('login', {
5589
5591
  email: email,
5590
5592
  managerEmail: managerEmail,
5591
5593
  isAuthenticated: !!data.access_token,
@@ -5646,7 +5648,7 @@ var setupLogin = /*#__PURE__*/function () {
5646
5648
  entityCasID = ''; // cas ID (only applies to cas users)
5647
5649
  _context2.p = 5;
5648
5650
  _context2.n = 6;
5649
- return fetcher.getUserDetails();
5651
+ return fetcher$1.getUserDetails();
5650
5652
  case 6:
5651
5653
  userDetails = _context2.v;
5652
5654
  entityID = userDetails.userId.trim().toUpperCase();
@@ -5679,14 +5681,14 @@ var setupLogin = /*#__PURE__*/function () {
5679
5681
  case 10:
5680
5682
  storeLoginData(loginData);
5681
5683
  _context2.p = 11;
5682
- endpoint = (_storage$getLocalItem = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.appScopesAWS;
5684
+ endpoint = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.appScopesAWS;
5683
5685
  _context2.n = 12;
5684
- return fetcher.get(endpoint).then(function (res) {
5686
+ return fetcher$1.get(endpoint).then(function (res) {
5685
5687
  return res.data;
5686
5688
  });
5687
5689
  case 12:
5688
5690
  appFunctions = _context2.v;
5689
- storage$1.setLocalItem('appScopesAndFunctions', appFunctions);
5691
+ storage$2.setLocalItem('appScopesAndFunctions', appFunctions);
5690
5692
  _context2.n = 14;
5691
5693
  break;
5692
5694
  case 13:
@@ -5897,7 +5899,7 @@ var getCompanyCode = function getCompanyCode() {
5897
5899
  var stack = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.STACK ? window.toolkitEnv.STACK : process.env.STACK;
5898
5900
  if (stack === 'c') return 'COPART';
5899
5901
  if (stack === 'uk') return 'COPARTUK';
5900
- if (stack === 'g') return storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
5902
+ if (stack === 'g') return storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
5901
5903
  };
5902
5904
  var createQuery = function createQuery(activeYardNumber) {
5903
5905
  return {
@@ -5917,13 +5919,13 @@ var getYardNumbers = /*#__PURE__*/function () {
5917
5919
  while (1) switch (_context.n) {
5918
5920
  case 0:
5919
5921
  query = querystringify_1.stringify(createQuery(activeYardNumber));
5920
- endpoint = storage$1.getLocalItem('opsportal-core:config').endpoints.yardNumbersSearch;
5922
+ endpoint = storage$2.getLocalItem('opsportal-core:config').endpoints.yardNumbersSearch;
5921
5923
  _context.n = 1;
5922
- return fetcher.get("".concat(endpoint, "?").concat(query), {
5924
+ return fetcher$1.get("".concat(endpoint, "?").concat(query), {
5923
5925
  headers: {
5924
5926
  collection: 'yards',
5925
5927
  serviceName: 'opsportal',
5926
- Authorization: "bearer ".concat(storage$1.accessToken)
5928
+ Authorization: "bearer ".concat(storage$2.accessToken)
5927
5929
  }
5928
5930
  });
5929
5931
  case 1:
@@ -5948,9 +5950,9 @@ var getUserDetails = /*#__PURE__*/function () {
5948
5950
  while (1) switch (_context.p = _context.n) {
5949
5951
  case 0:
5950
5952
  _context.p = 0;
5951
- url = storage$1.getLocalItem('opsportal-core:config').endpoints.me;
5953
+ url = storage$2.getLocalItem('opsportal-core:config').endpoints.me;
5952
5954
  _context.n = 1;
5953
- return fetcher.get(url);
5955
+ return fetcher$1.get(url);
5954
5956
  case 1:
5955
5957
  _yield$fetcher$get = _context.v;
5956
5958
  data = _yield$fetcher$get.data;
@@ -5968,7 +5970,7 @@ var getUserDetails = /*#__PURE__*/function () {
5968
5970
  _context.p = 3;
5969
5971
  _t = _context.v;
5970
5972
  response = _t.response;
5971
- storage$1.setLocalItem('login', '');
5973
+ storage$2.setLocalItem('login', '');
5972
5974
  return _context.a(2, Promise.reject(response.data));
5973
5975
  }
5974
5976
  }, _callee, null, [[0, 3]]);
@@ -5986,7 +5988,7 @@ var sendFeedback = /*#__PURE__*/function () {
5986
5988
  case 0:
5987
5989
  _context.p = 0;
5988
5990
  _context.n = 1;
5989
- return fetcher.post('/api/v0/mail/feedback', {
5991
+ return fetcher$1.post('/api/v0/mail/feedback', {
5990
5992
  data: data,
5991
5993
  feedback: true
5992
5994
  }, {
@@ -6041,7 +6043,7 @@ var getUserPreferences = /*#__PURE__*/function () {
6041
6043
  appName: appName
6042
6044
  });
6043
6045
  _context.n = 2;
6044
- return fetcher.get(url, getHeaders(countryA3code));
6046
+ return fetcher$1.get(url, getHeaders(countryA3code));
6045
6047
  case 2:
6046
6048
  response = _context.v;
6047
6049
  data = response.data;
@@ -6077,7 +6079,7 @@ var setUserPreferences = /*#__PURE__*/function () {
6077
6079
  appName: appName
6078
6080
  });
6079
6081
  _context2.n = 2;
6080
- return fetcher.put(url, data, getHeaders(countryA3code));
6082
+ return fetcher$1.put(url, data, getHeaders(countryA3code));
6081
6083
  case 2:
6082
6084
  response = _context2.v;
6083
6085
  return _context2.a(2, response.statusText);
@@ -6101,11 +6103,11 @@ var getUserRoles = /*#__PURE__*/function () {
6101
6103
  while (1) switch (_context.p = _context.n) {
6102
6104
  case 0:
6103
6105
  _context.p = 0;
6104
- url = frontEndUtils.string.substitute(storage$1.getLocalItem('opsportal-core:config').endpoints.getUserRoles, {
6105
- userId: storage$1.userEmail
6106
+ url = frontEndUtils.string.substitute(storage$2.getLocalItem('opsportal-core:config').endpoints.getUserRoles, {
6107
+ userId: storage$2.userEmail
6106
6108
  });
6107
6109
  _context.n = 1;
6108
- return fetcher.get(url);
6110
+ return fetcher$1.get(url);
6109
6111
  case 1:
6110
6112
  response = _context.v;
6111
6113
  data = response.data;
@@ -6135,10 +6137,10 @@ var getHierarchyOptions = /*#__PURE__*/function () {
6135
6137
  return _regenerator().w(function (_context) {
6136
6138
  while (1) switch (_context.n) {
6137
6139
  case 0:
6138
- url = (_storage$getLocalItem = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.hierarchyOptions;
6140
+ url = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.hierarchyOptions;
6139
6141
  _context.n = 1;
6140
- return fetcher.get(frontEndUtils.string.substitute(url, {
6141
- userId: storage$1.userEmail
6142
+ return fetcher$1.get(frontEndUtils.string.substitute(url, {
6143
+ userId: storage$2.userEmail
6142
6144
  }), {
6143
6145
  headers: {
6144
6146
  roleName: selectedRole,
@@ -7137,10 +7139,10 @@ var ascend$1 = ascend;
7137
7139
  * R.isNil(0); //=> false
7138
7140
  * R.isNil([]); //=> false
7139
7141
  */
7140
- var isNil = /*#__PURE__*/_curry1(function isNil(x) {
7142
+ var isNil$1 = /*#__PURE__*/_curry1(function isNil(x) {
7141
7143
  return x == null;
7142
7144
  });
7143
- var isNil$1 = isNil;
7145
+ var isNil$2 = isNil$1;
7144
7146
 
7145
7147
  function _isFunction(x) {
7146
7148
  return Object.prototype.toString.call(x) === '[object Function]';
@@ -8643,8 +8645,8 @@ var has$2 = has$1;
8643
8645
  * R.includes([42], [[42]]); //=> true
8644
8646
  * R.includes('ba', 'banana'); //=>true
8645
8647
  */
8646
- var includes = /*#__PURE__*/_curry2(_includes);
8647
- var includes$1 = includes;
8648
+ var includes$1 = /*#__PURE__*/_curry2(_includes);
8649
+ var includes$2 = includes$1;
8648
8650
 
8649
8651
  /**
8650
8652
  * Returns a new list containing only one copy of each element in the original
@@ -8702,10 +8704,10 @@ var uniqBy$1 = uniqBy;
8702
8704
  * R.isEmpty({}); //=> true
8703
8705
  * R.isEmpty({length: 0}); //=> false
8704
8706
  */
8705
- var isEmpty = /*#__PURE__*/_curry1(function isEmpty(x) {
8707
+ var isEmpty$1 = /*#__PURE__*/_curry1(function isEmpty(x) {
8706
8708
  return x != null && equals$1(x, empty$1(x));
8707
8709
  });
8708
- var isEmpty$1 = isEmpty;
8710
+ var isEmpty$2 = isEmpty$1;
8709
8711
 
8710
8712
  /**
8711
8713
  * If the given, non-null object has a value at the given path, returns the
@@ -9015,18 +9017,18 @@ var getPrintersForYard = /*#__PURE__*/function () {
9015
9017
  return _regenerator().w(function (_context) {
9016
9018
  while (1) switch (_context.p = _context.n) {
9017
9019
  case 0:
9018
- _storage$getLocalItem = storage$1.getLocalItem('opsportal-core:config'), endpoints = _storage$getLocalItem.endpoints;
9020
+ _storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config'), endpoints = _storage$getLocalItem.endpoints;
9019
9021
  allPrinters = {};
9020
9022
  check_printers = [];
9021
9023
  text_printers = [];
9022
9024
  barcode_label_printers = [];
9023
9025
  standard_printers = [];
9024
9026
  windshield_label_printers = [];
9025
- country = countryA3code || storage$1.getSessionItem('dashboard', 'selectedCountryA3code'); // Fetch all printers from g2print-ws endpoint
9027
+ country = countryA3code || storage$2.getSessionItem('dashboard', 'selectedCountryA3code'); // Fetch all printers from g2print-ws endpoint
9026
9028
  _context.p = 1;
9027
9029
  g2PrintersUrl = "".concat(endpoints.g2Printers, "&facility=").concat(yardNumber);
9028
9030
  _context.n = 2;
9029
- return fetcher.get(g2PrintersUrl, {
9031
+ return fetcher$1.get(g2PrintersUrl, {
9030
9032
  headers: {
9031
9033
  country: country
9032
9034
  }
@@ -9088,7 +9090,7 @@ var getInnovationHubToken = /*#__PURE__*/function () {
9088
9090
  while (1) switch (_context.n) {
9089
9091
  case 0:
9090
9092
  _context.n = 1;
9091
- return fetcher.get('/api/v0/auth/innovationHubtoken', {
9093
+ return fetcher$1.get('/api/v0/auth/innovationHubtoken', {
9092
9094
  headers: {
9093
9095
  'Content-Type': 'application/json; charset=UTF-8'
9094
9096
  },
@@ -9124,7 +9126,7 @@ var getUserScopes = /*#__PURE__*/function () {
9124
9126
  endpoint = (_storage$getLocalItem = storage.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.hierarchiesAWS;
9125
9127
  _context.p = 1;
9126
9128
  _context.n = 2;
9127
- return fetcher.get(endpoint).then(function (res) {
9129
+ return fetcher$1.get(endpoint).then(function (res) {
9128
9130
  return res.data;
9129
9131
  });
9130
9132
  case 2:
@@ -9184,18 +9186,18 @@ var getCobaltUserFacilities = /*#__PURE__*/function () {
9184
9186
  while (1) switch (_context.p = _context.n) {
9185
9187
  case 0:
9186
9188
  _context.p = 0;
9187
- url = frontEndUtils.string.substitute(storage$1.coreConfig.endpoints.allFacilitiesNew, {
9189
+ url = frontEndUtils.string.substitute(storage$2.coreConfig.endpoints.allFacilitiesNew, {
9188
9190
  country: country.toLowerCase()
9189
9191
  });
9190
9192
  headers = _objectSpread2({
9191
9193
  gStackCountry: country,
9192
9194
  AUTHORIZATIONROLE: role
9193
- }, storage$1.activeLanguage === 'fi' ? {
9195
+ }, storage$2.activeLanguage === 'fi' ? {
9194
9196
  language: 'en',
9195
9197
  LANGUAGECODE: 'en'
9196
9198
  } : {});
9197
9199
  _context.n = 1;
9198
- return fetcher.get(url, {
9200
+ return fetcher$1.get(url, {
9199
9201
  headers: headers
9200
9202
  });
9201
9203
  case 1:
@@ -9227,10 +9229,10 @@ var getCobaltUserRoles = /*#__PURE__*/function () {
9227
9229
  while (1) switch (_context.p = _context.n) {
9228
9230
  case 0:
9229
9231
  _context.p = 0;
9230
- url = storage$1.coreConfig.endpoints.getRoles;
9232
+ url = storage$2.coreConfig.endpoints.getRoles;
9231
9233
  _context.n = 1;
9232
- return fetcher.get(url, {
9233
- headers: _objectSpread2(_objectSpread2({}, fetcher.defaults.headers.common), {}, {
9234
+ return fetcher$1.get(url, {
9235
+ headers: _objectSpread2(_objectSpread2({}, fetcher$1.defaults.headers.common), {}, {
9234
9236
  gStackCountry: country
9235
9237
  })
9236
9238
  });
@@ -9250,24 +9252,24 @@ var getCobaltUserRoles = /*#__PURE__*/function () {
9250
9252
  };
9251
9253
  }();
9252
9254
 
9253
- fetcher.login = login;
9254
- fetcher.oktaLogin = oktaLogin;
9255
- fetcher.getConfig = getConfig;
9256
- fetcher.getAppTileData = getAppTileData;
9257
- fetcher.getYardNumbers = getYardNumbers;
9258
- fetcher.getUserDetails = getUserDetails;
9259
- fetcher.sendFeedback = sendFeedback;
9260
- fetcher.getUserPreferences = getUserPreferences;
9261
- fetcher.setUserPreferences = setUserPreferences;
9262
- fetcher.getUserRoles = getUserRoles;
9263
- fetcher.getHierarchyOptions = getHierarchyOptions;
9264
- fetcher.getPrintersForYard = getPrintersForYard;
9265
- fetcher.getPermissions = getPermissions;
9266
- fetcher.getCoreAppPermissions = getCoreAppPermissions;
9267
- fetcher.getInnovationHubToken = getInnovationHubToken;
9268
- fetcher.getUserScopes = getUserScopes;
9269
- fetcher.getCobaltUserFacilities = getCobaltUserFacilities;
9270
- fetcher.getCobaltUserRoles = getCobaltUserRoles;
9255
+ fetcher$1.login = login;
9256
+ fetcher$1.oktaLogin = oktaLogin;
9257
+ fetcher$1.getConfig = getConfig;
9258
+ fetcher$1.getAppTileData = getAppTileData;
9259
+ fetcher$1.getYardNumbers = getYardNumbers;
9260
+ fetcher$1.getUserDetails = getUserDetails;
9261
+ fetcher$1.sendFeedback = sendFeedback;
9262
+ fetcher$1.getUserPreferences = getUserPreferences;
9263
+ fetcher$1.setUserPreferences = setUserPreferences;
9264
+ fetcher$1.getUserRoles = getUserRoles;
9265
+ fetcher$1.getHierarchyOptions = getHierarchyOptions;
9266
+ fetcher$1.getPrintersForYard = getPrintersForYard;
9267
+ fetcher$1.getPermissions = getPermissions;
9268
+ fetcher$1.getCoreAppPermissions = getCoreAppPermissions;
9269
+ fetcher$1.getInnovationHubToken = getInnovationHubToken;
9270
+ fetcher$1.getUserScopes = getUserScopes;
9271
+ fetcher$1.getCobaltUserFacilities = getCobaltUserFacilities;
9272
+ fetcher$1.getCobaltUserRoles = getCobaltUserRoles;
9271
9273
 
9272
9274
  var getRouteName = function getRouteName() {
9273
9275
  return window.location.pathname.split('/').splice(1)[0];
@@ -9308,11 +9310,11 @@ var isUserStatusHidden = function isUserStatusHidden() {
9308
9310
  var isCoreApp = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
9309
9311
  if (isCoreApp) {
9310
9312
  var _storage$coreConfig;
9311
- return ((_storage$coreConfig = storage$1.coreConfig) === null || _storage$coreConfig === void 0 ? void 0 : _storage$coreConfig.hideUserStatus) || false;
9313
+ return ((_storage$coreConfig = storage$2.coreConfig) === null || _storage$coreConfig === void 0 ? void 0 : _storage$coreConfig.hideUserStatus) || false;
9312
9314
  }
9313
- if ((_storage$coreConfig2 = storage$1.coreConfig) !== null && _storage$coreConfig2 !== void 0 && _storage$coreConfig2.checkUserStatusByApp) {
9315
+ if ((_storage$coreConfig2 = storage$2.coreConfig) !== null && _storage$coreConfig2 !== void 0 && _storage$coreConfig2.checkUserStatusByApp) {
9314
9316
  var _window$toolkitEnv2;
9315
- var appTiles = storage$1.getLocalItem('opsportal-core:config').tiles || [];
9317
+ var appTiles = storage$2.getLocalItem('opsportal-core:config').tiles || [];
9316
9318
  var appName = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
9317
9319
  var appData = appTiles.find(function (tile) {
9318
9320
  if (tile.appName) {
@@ -9323,7 +9325,7 @@ var isUserStatusHidden = function isUserStatusHidden() {
9323
9325
  });
9324
9326
  return (appData === null || appData === void 0 ? void 0 : appData.showUserStatus) !== true;
9325
9327
  }
9326
- return ((_storage$coreConfig3 = storage$1.coreConfig) === null || _storage$coreConfig3 === void 0 ? void 0 : _storage$coreConfig3.hideUserStatus) || false;
9328
+ return ((_storage$coreConfig3 = storage$2.coreConfig) === null || _storage$coreConfig3 === void 0 ? void 0 : _storage$coreConfig3.hideUserStatus) || false;
9327
9329
  };
9328
9330
 
9329
9331
  var css_248z$q = ".utilities_ops-app-frame_ConfigFetcher_ConfigFetcher--ConfigFetcher {\r\n}\r\n\r\n.utilities_ops-app-frame_ConfigFetcher_ConfigFetcher--spinner {\r\n margin: 80px 0 40px;\r\n width: 100%;\r\n height: 100%;\r\n}\r\n\r\n.utilities_ops-app-frame_ConfigFetcher_ConfigFetcher--spinner * {\r\n width: 60px;\r\n height: 60px;\r\n}\r\n";
@@ -9349,7 +9351,7 @@ var ConfigFetcher = /*#__PURE__*/function (_React$Component) {
9349
9351
  case 0:
9350
9352
  fetchVersion = ++_this._fetchVersion;
9351
9353
  isCoreApp = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
9352
- if (!(isCoreApp && (isCoreRoute || isAuthRoute) && !storage$1.isAuthenticated)) {
9354
+ if (!(isCoreApp && (isCoreRoute || isAuthRoute) && !storage$2.isAuthenticated)) {
9353
9355
  _context.n = 1;
9354
9356
  break;
9355
9357
  }
@@ -9360,7 +9362,7 @@ var ConfigFetcher = /*#__PURE__*/function (_React$Component) {
9360
9362
  configUri = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.CONFIG_URI ? window.toolkitEnv.CONFIG_URI : process.env.CONFIG_URI;
9361
9363
  console.log('[ConfigFetcher] fetching config from:', configUri, 'APP_NAME:', (_window$toolkitEnv3 = window.toolkitEnv) === null || _window$toolkitEnv3 === void 0 ? void 0 : _window$toolkitEnv3.APP_NAME);
9362
9364
  _context.n = 2;
9363
- return fetcher.getConfig(configUri);
9365
+ return fetcher$1.getConfig(configUri);
9364
9366
  case 2:
9365
9367
  config = _context.v;
9366
9368
  if (!(_this._fetchVersion !== fetchVersion)) {
@@ -9369,7 +9371,7 @@ var ConfigFetcher = /*#__PURE__*/function (_React$Component) {
9369
9371
  }
9370
9372
  return _context.a(2);
9371
9373
  case 3:
9372
- storage$1.setItem('config', config);
9374
+ storage$2.setItem('config', config);
9373
9375
  if (config.instanaKey) {
9374
9376
  window.setUpInstana(config.instanaKey, isCoreApp);
9375
9377
  }
@@ -16204,7 +16206,7 @@ function arraysEqual(array1, array2) {
16204
16206
  * Fetches an item from session storage without throwing an exception
16205
16207
  * @param key The key of the item to fetch from session storage
16206
16208
  */
16207
- function getItem$2(key) {
16209
+ function getItem$3(key) {
16208
16210
  var result = null;
16209
16211
  try {
16210
16212
  var win = getWindow$1();
@@ -16219,7 +16221,7 @@ function getItem$2(key) {
16219
16221
  * @param key The key of the item to add to session storage
16220
16222
  * @param data The data to put into session storage
16221
16223
  */
16222
- function setItem(key, data) {
16224
+ function setItem$1(key, data) {
16223
16225
  var _a;
16224
16226
  try {
16225
16227
  (_a = getWindow$1()) === null || _a === void 0 ? void 0 : _a.sessionStorage.setItem(key, data);
@@ -16243,7 +16245,7 @@ function getRTL(theme) {
16243
16245
  }
16244
16246
  if (_isRTL === undefined) {
16245
16247
  // Fabric supports persisting the RTL setting between page refreshes via session storage
16246
- var savedRTL = getItem$2(RTL_LOCAL_STORAGE_KEY);
16248
+ var savedRTL = getItem$3(RTL_LOCAL_STORAGE_KEY);
16247
16249
  if (savedRTL !== null) {
16248
16250
  _isRTL = savedRTL === '1';
16249
16251
  setRTL(_isRTL);
@@ -16268,7 +16270,7 @@ function setRTL(isRTL, persistSetting) {
16268
16270
  doc.documentElement.setAttribute('dir', isRTL ? 'rtl' : 'ltr');
16269
16271
  }
16270
16272
  if (persistSetting) {
16271
- setItem(RTL_LOCAL_STORAGE_KEY, isRTL ? '1' : '0');
16273
+ setItem$1(RTL_LOCAL_STORAGE_KEY, isRTL ? '1' : '0');
16272
16274
  }
16273
16275
  _isRTL = isRTL;
16274
16276
  setRTL$1(_isRTL);
@@ -17191,7 +17193,7 @@ function _setComponentRef(componentRef, value) {
17191
17193
  * Fetches an item from local storage without throwing an exception
17192
17194
  * @param key The key of the item to fetch from local storage
17193
17195
  */
17194
- function getItem$1(key) {
17196
+ function getItem$2(key) {
17195
17197
  var result = null;
17196
17198
  try {
17197
17199
  var win = getWindow$1();
@@ -17216,7 +17218,7 @@ function getLanguage(persistenceType) {
17216
17218
  }
17217
17219
  if (_language === undefined) {
17218
17220
  var doc = getDocument();
17219
- var savedLanguage = persistenceType === 'localStorage' ? getItem$1(STORAGE_KEY) : persistenceType === 'sessionStorage' ? getItem$2(STORAGE_KEY) : undefined;
17221
+ var savedLanguage = persistenceType === 'localStorage' ? getItem$2(STORAGE_KEY) : persistenceType === 'sessionStorage' ? getItem$3(STORAGE_KEY) : undefined;
17220
17222
  if (savedLanguage) {
17221
17223
  _language = savedLanguage;
17222
17224
  }
@@ -21473,7 +21475,7 @@ var ProfileDetails = function ProfileDetails(_ref) {
21473
21475
  className: "utilities_ops-app-frame_AppBarComponent_Settings_ProfileDetails_ProfileDetails--profileDetails"
21474
21476
  }, /*#__PURE__*/React__default["default"].createElement("div", {
21475
21477
  className: "utilities_ops-app-frame_AppBarComponent_Settings_ProfileDetails_ProfileDetails--details"
21476
- }, /*#__PURE__*/React__default["default"].createElement("h3", null, storage$1.userName), /*#__PURE__*/React__default["default"].createElement("p", null, storage$1.userEmail), Array.isArray(enhancedStatuses) && enhancedStatuses.length > 0 && !userStatusHidden && /*#__PURE__*/React__default["default"].createElement("div", {
21478
+ }, /*#__PURE__*/React__default["default"].createElement("h3", null, storage$2.userName), /*#__PURE__*/React__default["default"].createElement("p", null, storage$2.userEmail), Array.isArray(enhancedStatuses) && enhancedStatuses.length > 0 && !userStatusHidden && /*#__PURE__*/React__default["default"].createElement("div", {
21477
21479
  className: "utilities_ops-app-frame_AppBarComponent_Settings_ProfileDetails_ProfileDetails--statusSelector"
21478
21480
  }, /*#__PURE__*/React__default["default"].createElement(coreComponents.Select, {
21479
21481
  id: "user-status-select",
@@ -21646,7 +21648,7 @@ var viewMapper = {
21646
21648
  };
21647
21649
 
21648
21650
  var getRecommendedHelpArticles = function getRecommendedHelpArticles(helpContent) {
21649
- var articles = !isNil$1(helpContent) ? _toConsumableArray(helpContent === null || helpContent === void 0 ? void 0 : helpContent.helpArticles) : [];
21651
+ var articles = !isNil$2(helpContent) ? _toConsumableArray(helpContent === null || helpContent === void 0 ? void 0 : helpContent.helpArticles) : [];
21650
21652
  // const sortedByLikes = sortedBySequence.sort((a, b) => {
21651
21653
  // return parseInt(b.likes) - parseInt(a.likes)
21652
21654
  // })
@@ -21660,7 +21662,7 @@ var getRecommendedHelpArticles = function getRecommendedHelpArticles(helpContent
21660
21662
  };
21661
21663
  var getFaqs = function getFaqs(helpContent) {
21662
21664
  var _helpContent$faqs$;
21663
- var faqData = !isNil$1(helpContent) ? (_helpContent$faqs$ = helpContent.faqs[0]) === null || _helpContent$faqs$ === void 0 ? void 0 : _helpContent$faqs$.content : '';
21665
+ var faqData = !isNil$2(helpContent) ? (_helpContent$faqs$ = helpContent.faqs[0]) === null || _helpContent$faqs$ === void 0 ? void 0 : _helpContent$faqs$.content : '';
21664
21666
  if (!faqData) return [];
21665
21667
  var faqObj = JSON.parse(faqData.slice(faqData.indexOf('wp:acf/faq')).replace('wp:acf/faq', '').replace('/-->', '').trim());
21666
21668
  var faqs = [];
@@ -21677,7 +21679,7 @@ var getFaqs = function getFaqs(helpContent) {
21677
21679
  return faqs;
21678
21680
  };
21679
21681
  var getReleaseNotes = function getReleaseNotes(helpContent, mihelpAppPath) {
21680
- var releasenotes = !isNil$1(helpContent) ? _toConsumableArray(helpContent === null || helpContent === void 0 ? void 0 : helpContent.releaseNotes) : [];
21682
+ var releasenotes = !isNil$2(helpContent) ? _toConsumableArray(helpContent === null || helpContent === void 0 ? void 0 : helpContent.releaseNotes) : [];
21681
21683
  if (!mihelpAppPath) {
21682
21684
  var releaseNotesByApp = {};
21683
21685
  releasenotes.forEach(function (note) {
@@ -21723,8 +21725,8 @@ var clearDebounceTimer = function clearDebounceTimer() {
21723
21725
  clearTimeout(timer);
21724
21726
  };
21725
21727
  var handleRedirect = function handleRedirect(type, mihelpAppPath, currentArticle) {
21726
- var country = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
21727
- var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
21728
+ var country = storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
21729
+ var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
21728
21730
  var uri;
21729
21731
  switch (type) {
21730
21732
  case redirectContants.OPEN_IN_NEW_TAB:
@@ -22603,13 +22605,13 @@ var HelpSideBar = function HelpSideBar(_ref) {
22603
22605
  case 0:
22604
22606
  _context.p = 0;
22605
22607
  setLoading(true);
22606
- country = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
22608
+ country = storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
22607
22609
  app = mihelpAppPath || 'g2-portal';
22608
- url = (_storage$getLocalItem = storage$1.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.getMihelpContent;
22610
+ url = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.getMihelpContent;
22609
22611
  _context.n = 1;
22610
- return fetcher.get("".concat(url, "?app=").concat(app, "&country=").concat(country), {
22612
+ return fetcher$1.get("".concat(url, "?app=").concat(app, "&country=").concat(country), {
22611
22613
  headers: {
22612
- Authorization: storage$1.accessToken
22614
+ Authorization: storage$2.accessToken
22613
22615
  }
22614
22616
  });
22615
22617
  case 1:
@@ -22653,14 +22655,14 @@ var HelpSideBar = function HelpSideBar(_ref) {
22653
22655
  while (1) switch (_context2.p = _context2.n) {
22654
22656
  case 0:
22655
22657
  _context2.p = 0;
22656
- country = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
22658
+ country = storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
22657
22659
  app = mihelpAppPath || 'g2-portal';
22658
- url = (_storage$getLocalItem2 = storage$1.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.mihelpSearch;
22660
+ url = (_storage$getLocalItem2 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.mihelpSearch;
22659
22661
  setLoading(true);
22660
22662
  _context2.n = 1;
22661
- return fetcher.get("".concat(url, "?s=").concat(searchText, "&country=").concat(country, "&app=").concat(app), {
22663
+ return fetcher$1.get("".concat(url, "?s=").concat(searchText, "&country=").concat(country, "&app=").concat(app), {
22662
22664
  headers: {
22663
- Authorization: storage$1.accessToken
22665
+ Authorization: storage$2.accessToken
22664
22666
  }
22665
22667
  });
22666
22668
  case 1:
@@ -22815,12 +22817,12 @@ var HelpSideBar = function HelpSideBar(_ref) {
22815
22817
  case 0:
22816
22818
  _context3.p = 0;
22817
22819
  setLoading(true);
22818
- url = (_storage$getLocalItem3 = storage$1.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.getMihelpArticle;
22820
+ url = (_storage$getLocalItem3 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.getMihelpArticle;
22819
22821
  id = view === views.FAQ && !isSearchFaq ? faqs.id : article.id || article.ID;
22820
22822
  _context3.n = 1;
22821
- return fetcher.get("".concat(url, "/").concat(id), {
22823
+ return fetcher$1.get("".concat(url, "/").concat(id), {
22822
22824
  headers: {
22823
- Authorization: storage$1.accessToken
22825
+ Authorization: storage$2.accessToken
22824
22826
  }
22825
22827
  });
22826
22828
  case 1:
@@ -22859,12 +22861,12 @@ var HelpSideBar = function HelpSideBar(_ref) {
22859
22861
  case 0:
22860
22862
  _context4.p = 0;
22861
22863
  setLoading(true);
22862
- url = (_storage$getLocalItem4 = storage$1.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem4 === void 0 ? void 0 : _storage$getLocalItem4.mihelpLike;
22864
+ url = (_storage$getLocalItem4 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem4 === void 0 ? void 0 : _storage$getLocalItem4.mihelpLike;
22863
22865
  id = article.id || article.ID;
22864
22866
  _context4.n = 1;
22865
- return fetcher.post("".concat(url, "/").concat(id), null, {
22867
+ return fetcher$1.post("".concat(url, "/").concat(id), null, {
22866
22868
  headers: {
22867
- Authorization: storage$1.accessToken
22869
+ Authorization: storage$2.accessToken
22868
22870
  }
22869
22871
  });
22870
22872
  case 1:
@@ -22909,12 +22911,12 @@ var HelpSideBar = function HelpSideBar(_ref) {
22909
22911
  case 0:
22910
22912
  _context5.p = 0;
22911
22913
  setLoading(true);
22912
- url = (_storage$getLocalItem5 = storage$1.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem5 === void 0 ? void 0 : _storage$getLocalItem5.mihelpDisLike;
22914
+ url = (_storage$getLocalItem5 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem5 === void 0 ? void 0 : _storage$getLocalItem5.mihelpDisLike;
22913
22915
  id = article.id || article.ID;
22914
22916
  _context5.n = 1;
22915
- return fetcher.post("".concat(url, "/").concat(id), null, {
22917
+ return fetcher$1.post("".concat(url, "/").concat(id), null, {
22916
22918
  headers: {
22917
- Authorization: storage$1.accessToken
22919
+ Authorization: storage$2.accessToken
22918
22920
  }
22919
22921
  });
22920
22922
  case 1:
@@ -22965,15 +22967,15 @@ var HelpSideBar = function HelpSideBar(_ref) {
22965
22967
  case 0:
22966
22968
  skipFeedback();
22967
22969
  _context6.p = 1;
22968
- url = (_storage$getLocalItem6 = storage$1.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem6 === void 0 ? void 0 : _storage$getLocalItem6.mihelpSubmitFeedback;
22970
+ url = (_storage$getLocalItem6 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem6 === void 0 ? void 0 : _storage$getLocalItem6.mihelpSubmitFeedback;
22969
22971
  _context6.n = 2;
22970
- return fetcher.post(url, {
22972
+ return fetcher$1.post(url, {
22971
22973
  message: feedback,
22972
22974
  url: window.location.href,
22973
22975
  userAgent: navigator.userAgent
22974
22976
  }, {
22975
22977
  headers: {
22976
- Authorization: storage$1.accessToken
22978
+ Authorization: storage$2.accessToken
22977
22979
  }
22978
22980
  });
22979
22981
  case 2:
@@ -22999,15 +23001,15 @@ var HelpSideBar = function HelpSideBar(_ref) {
22999
23001
  while (1) switch (_context7.p = _context7.n) {
23000
23002
  case 0:
23001
23003
  _context7.p = 0;
23002
- url = (_storage$getLocalItem7 = storage$1.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem7 === void 0 ? void 0 : _storage$getLocalItem7.mihelpSubmitQuestion;
23004
+ url = (_storage$getLocalItem7 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem7 === void 0 ? void 0 : _storage$getLocalItem7.mihelpSubmitQuestion;
23003
23005
  _context7.n = 1;
23004
- return fetcher.post(url, {
23006
+ return fetcher$1.post(url, {
23005
23007
  question: question,
23006
23008
  category: category,
23007
23009
  app: title
23008
23010
  }, {
23009
23011
  headers: {
23010
- Authorization: storage$1.accessToken
23012
+ Authorization: storage$2.accessToken
23011
23013
  }
23012
23014
  });
23013
23015
  case 1:
@@ -23534,7 +23536,7 @@ var handleUpdate = function handleUpdate(self) {
23534
23536
  return _context.a(2, self.setYardOptions(self.props.history.get(yardNumber)));
23535
23537
  case 1:
23536
23538
  _context.n = 2;
23537
- return fetcher.getYardNumbers(yardNumber);
23539
+ return fetcher$1.getYardNumbers(yardNumber);
23538
23540
  case 2:
23539
23541
  yards = _context.v;
23540
23542
  yardOptions = filterYards(yards);
@@ -23616,7 +23618,7 @@ var getRCExtensionStatus = /*#__PURE__*/function () {
23616
23618
  return _regenerator().w(function (_context) {
23617
23619
  while (1) switch (_context.p = _context.n) {
23618
23620
  case 0:
23619
- url = (_storage$getItem$endp = storage$1.getItem('config').endpoints) === null || _storage$getItem$endp === void 0 ? void 0 : _storage$getItem$endp.ringCentralEnabledStatus;
23621
+ url = (_storage$getItem$endp = storage$2.getItem('config').endpoints) === null || _storage$getItem$endp === void 0 ? void 0 : _storage$getItem$endp.ringCentralEnabledStatus;
23620
23622
  if (url) {
23621
23623
  _context.n = 1;
23622
23624
  break;
@@ -23625,7 +23627,7 @@ var getRCExtensionStatus = /*#__PURE__*/function () {
23625
23627
  case 1:
23626
23628
  _context.p = 1;
23627
23629
  _context.n = 2;
23628
- return fetcher.get(url);
23630
+ return fetcher$1.get(url);
23629
23631
  case 2:
23630
23632
  response = _context.v;
23631
23633
  return _context.a(2, response.data);
@@ -23651,7 +23653,7 @@ var resetPhoneSettingsBasedOnRCStatus = function resetPhoneSettingsBasedOnRCStat
23651
23653
  ringCentralURL = _ref2$ringcentral_lis === void 0 ? '' : _ref2$ringcentral_lis,
23652
23654
  _ref2$ringcentral_acc = _ref2.ringcentral_account_id,
23653
23655
  ringCentralAccountId = _ref2$ringcentral_acc === void 0 ? '' : _ref2$ringcentral_acc;
23654
- var dashboardObject = storage$1.getLocalItem('dashboard');
23656
+ var dashboardObject = storage$2.getLocalItem('dashboard');
23655
23657
  if (ringCentralEnabled) {
23656
23658
  dashboardObject.ringCentralEnabled = true;
23657
23659
  dashboardObject.phoneNumber = formatPhoneNumber(phoneNumber, ringCentralExtension);
@@ -23665,7 +23667,7 @@ var resetPhoneSettingsBasedOnRCStatus = function resetPhoneSettingsBasedOnRCStat
23665
23667
  delete dashboardObject.ringCentralEnabled;
23666
23668
  }
23667
23669
  }
23668
- storage$1.setLocalItem('dashboard', dashboardObject);
23670
+ storage$2.setLocalItem('dashboard', dashboardObject);
23669
23671
  var event = new Event('localStorageChanged');
23670
23672
  window.dispatchEvent(event);
23671
23673
  };
@@ -23711,10 +23713,10 @@ var pluckDefault = function pluckDefault(final, _ref3) {
23711
23713
  var sessionOrDefault = function sessionOrDefault(label) {
23712
23714
  return function () {
23713
23715
  var printer_name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
23714
- var sessionDashboard = storage$1.getSessionItem('dashboard');
23716
+ var sessionDashboard = storage$2.getSessionItem('dashboard');
23715
23717
  sessionDashboard.printers = sessionDashboard.printers || EMPTY_PRINTERS$2;
23716
23718
  var printerName = sessionDashboard.printers[label];
23717
- return !isEmpty$1(printerName) ? printerName : printer_name;
23719
+ return !isEmpty$2(printerName) ? printerName : printer_name;
23718
23720
  };
23719
23721
  };
23720
23722
  var chooseActive = function chooseActive(final, _ref5) {
@@ -23787,7 +23789,7 @@ var Container = /*#__PURE__*/function (_React$Component) {
23787
23789
  });
23788
23790
  _context.p = 1;
23789
23791
  _context.n = 2;
23790
- return fetcher.get(testCallUrl);
23792
+ return fetcher$1.get(testCallUrl);
23791
23793
  case 2:
23792
23794
  _yield$fetcher$get = _context.v;
23793
23795
  data = _yield$fetcher$get.data;
@@ -23862,8 +23864,8 @@ var generateTestCallUrl = function generateTestCallUrl(_ref2) {
23862
23864
  var _storage$getLocalItem;
23863
23865
  var yardNumber = _ref2.yardNumber,
23864
23866
  extension = _ref2.extension;
23865
- var id = (_storage$getLocalItem = storage$1.getLocalItem('login')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.userData.entity_id;
23866
- var url = storage$1.getItem('config').endpoints.testCall;
23867
+ var id = (_storage$getLocalItem = storage$2.getLocalItem('login')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.userData.entity_id;
23868
+ var url = storage$2.getItem('config').endpoints.testCall;
23867
23869
  return frontEndUtils.string.substitute(url, {
23868
23870
  yardNumber: yardNumber,
23869
23871
  extension: extension,
@@ -23891,7 +23893,7 @@ var getHierarchyLevel = function getHierarchyLevel(levelId) {
23891
23893
  return '';
23892
23894
  }
23893
23895
  };
23894
- var isInvalid = either$1(isNil$1, isEmpty$1);
23896
+ var isInvalid = either$1(isNil$2, isEmpty$2);
23895
23897
  var keysToBeDeleted = ['openEmailDialog', 'openPhoneDialog', 'searchParam', 'selectedCountry', 'selectedCountryA3code', 'selectedCurrency', 'selectedRole', 'selectedTimeZone', 'selectedYard', 'showPhoneEntryOnEnter', 'yard'];
23896
23898
 
23897
23899
  // Handles changes to all inputs.
@@ -23902,18 +23904,18 @@ var handleInputChange$2 = function handleInputChange(self) {
23902
23904
  if (name === 'selectedRole') {
23903
23905
  var selectedValue = value.selectedValue,
23904
23906
  option = value.option;
23905
- storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$1, 'printers');
23907
+ storage$2.setSessionItem('dashboard', EMPTY_PRINTERS$1, 'printers');
23906
23908
  return self.setState({
23907
23909
  selectedRoleOption: option,
23908
23910
  selectedRole: selectedValue
23909
23911
  });
23910
23912
  } else if (name === 'selectedYardNumber') {
23911
- storage$1.setSessionItem('dashboard', EMPTY_PRINTERS$1, 'printers');
23913
+ storage$2.setSessionItem('dashboard', EMPTY_PRINTERS$1, 'printers');
23912
23914
  self.updatePhoneNumber(activePhoneNumber$1());
23913
23915
 
23914
23916
  // Ensure we fetch the proper roles per the entered yard
23915
23917
  var oldSelectedYard = self.state.selectedYardNumber;
23916
- fetcher.getYardNumbers(value).then(function (yards) {
23918
+ fetcher$1.getYardNumbers(value).then(function (yards) {
23917
23919
  var currentYard = find$1(propEq$1('yard_number', parseInt(value)), yards);
23918
23920
  if (currentYard) yardCountryCode = currentYard.yard_country_code;
23919
23921
  self.fetchRoles(yardCountryCode);
@@ -23945,7 +23947,7 @@ var handleInputChange$2 = function handleInputChange(self) {
23945
23947
  }, {});
23946
23948
  };
23947
23949
  var getSelectedYard = function getSelectedYard(selectedNumber) {
23948
- return storage$1.getLocalItem('login').yardList.find(function (yard) {
23950
+ return storage$2.getLocalItem('login').yardList.find(function (yard) {
23949
23951
  return yard.number == selectedNumber;
23950
23952
  });
23951
23953
  };
@@ -23964,20 +23966,20 @@ var saveSettings$2 = function saveSettings(self) {
23964
23966
  printers = {}; // ******* Hack to be remved ******* create date July 12, 2019 *******
23965
23967
  // Just a hack to ensure yard gets changed to avoid issue caused by proquote app which is using old toolkit
23966
23968
  // remove this hack once pro quote app update its tool kit version to latest
23967
- dashboardSessionState = storage$1.getSessionItem('dashboard');
23969
+ dashboardSessionState = storage$2.getSessionItem('dashboard');
23968
23970
  oldSettings = {
23969
23971
  selectedCurrency: dashboardSessionState.selectedCurrency,
23970
23972
  selectedYard: dashboardSessionState.selectedYard,
23971
23973
  selectedCountry: dashboardSessionState.selectedCountry,
23972
23974
  language: dashboardSessionState.language,
23973
- selectedRole: storage$1.getLocalItem('settings').selectedRole,
23975
+ selectedRole: storage$2.getLocalItem('settings').selectedRole,
23974
23976
  activePrinters: self.state.oldActivePrinters
23975
23977
  };
23976
- dashboardState = storage$1.getLocalItem('dashboard');
23978
+ dashboardState = storage$2.getLocalItem('dashboard');
23977
23979
  cleanedDashboardState = pickBy$1(function (val, key) {
23978
23980
  return !keysToBeDeleted.includes(key);
23979
23981
  }, dashboardState);
23980
- storage$1.setLocalItem('dashboard', cleanedDashboardState);
23982
+ storage$2.setLocalItem('dashboard', cleanedDashboardState);
23981
23983
  toPairs$1(self.state).forEach(function (_ref4) {
23982
23984
  var _ref5 = _slicedToArray(_ref4, 2),
23983
23985
  key = _ref5[0],
@@ -23989,7 +23991,7 @@ var saveSettings$2 = function saveSettings(self) {
23989
23991
  value = JSON.stringify(value);
23990
23992
  }
23991
23993
  if (key === 'phoneNumber') {
23992
- storage$1.setLocalItem('dashboard', value, 'phoneNumber');
23994
+ storage$2.setLocalItem('dashboard', value, 'phoneNumber');
23993
23995
  }
23994
23996
  }
23995
23997
  });
@@ -24000,7 +24002,7 @@ var saveSettings$2 = function saveSettings(self) {
24000
24002
  roleName = propOr$1('', 'roleName', roleOptionFromState); // Update hierarchy on local storage when role changes
24001
24003
  if (roleOptionFromState) {
24002
24004
  _roleOptionFromState$ = roleOptionFromState.levelId, levelId = _roleOptionFromState$ === void 0 ? -1 : _roleOptionFromState$, _roleOptionFromState$2 = roleOptionFromState.hierarchyId, hierarchyId = _roleOptionFromState$2 === void 0 ? -1 : _roleOptionFromState$2;
24003
- storage$1.setLocalItem('settings', {
24005
+ storage$2.setLocalItem('settings', {
24004
24006
  level: getHierarchyLevel(levelId),
24005
24007
  id: hierarchyId
24006
24008
  }, 'selectedHierarchy');
@@ -24012,7 +24014,7 @@ var saveSettings$2 = function saveSettings(self) {
24012
24014
  return _context.a(2);
24013
24015
  case 1:
24014
24016
  yard = self.yardsHistory.get(selectedYard)[selectedYard];
24015
- storage$1.setSessionItem('dashboard', _objectSpread2(_objectSpread2({}, storage$1.getSessionItem('dashboard')), {}, {
24017
+ storage$2.setSessionItem('dashboard', _objectSpread2(_objectSpread2({}, storage$2.getSessionItem('dashboard')), {}, {
24016
24018
  selectedCurrency: selectedCurrency || yard.yard_currency,
24017
24019
  selectedCountry: (_yard$yard_country_co = yard.yard_country_code) === null || _yard$yard_country_co === void 0 ? void 0 : _yard$yard_country_co.slice(0, 2),
24018
24020
  selectedCountryA3code: yard.yard_country_code,
@@ -24023,21 +24025,21 @@ var saveSettings$2 = function saveSettings(self) {
24023
24025
  printers: printers,
24024
24026
  yard: yard
24025
24027
  }));
24026
- storage$1.setLocalItem('dashboard', printers, 'printers');
24027
- storage$1.setLocalItem('dashboard', selectedLanguage || 'en', 'language');
24028
- storage$1.setLocalItem('settings', roleName, 'selectedRole');
24029
- storage$1.setLocalItem('lastSelectedYard', yard);
24030
- storage$1.setLocalItem('dashboard', selectedCurrency || yard.yard_currency, 'selectedCurrency');
24028
+ storage$2.setLocalItem('dashboard', printers, 'printers');
24029
+ storage$2.setLocalItem('dashboard', selectedLanguage || 'en', 'language');
24030
+ storage$2.setLocalItem('settings', roleName, 'selectedRole');
24031
+ storage$2.setLocalItem('lastSelectedYard', yard);
24032
+ storage$2.setLocalItem('dashboard', selectedCurrency || yard.yard_currency, 'selectedCurrency');
24031
24033
  securityLevel = pickUserSecurityLevel(getSelectedYard(selectedYard));
24032
- storage$1.setSessionItem('securityLevel', Number(securityLevel));
24034
+ storage$2.setSessionItem('securityLevel', Number(securityLevel));
24033
24035
  _context.n = 2;
24034
- return fetcher.getUserScopes();
24036
+ return fetcher$1.getUserScopes();
24035
24037
  case 2:
24036
24038
  userScopes = _context.v;
24037
- storage$1.setLocalItem('login', userScopes, 'userAppScopes');
24039
+ storage$2.setLocalItem('login', userScopes, 'userAppScopes');
24038
24040
  // persist user preferences
24039
24041
  _context.n = 3;
24040
- return fetcher.setUserPreferences('oph', {
24042
+ return fetcher$1.setUserPreferences('oph', {
24041
24043
  selectedCurrency: selectedCurrency || yard.yard_currency,
24042
24044
  language: selectedLanguage || 'en',
24043
24045
  // TODO Remove this after remove role selection
@@ -24071,27 +24073,27 @@ var saveSettings$2 = function saveSettings(self) {
24071
24073
  };
24072
24074
  var selectedYardNumber$2 = function selectedYardNumber() {
24073
24075
  var _storage$getSessionIt;
24074
- return (_storage$getSessionIt = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
24076
+ return (_storage$getSessionIt = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
24075
24077
  };
24076
24078
  var selectedCountry$1 = function selectedCountry() {
24077
24079
  var _storage$getSessionIt2;
24078
- return ((_storage$getSessionIt2 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountry) || 'US';
24080
+ return ((_storage$getSessionIt2 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountry) || 'US';
24079
24081
  };
24080
24082
  var selectedLanguage$1 = function selectedLanguage() {
24081
24083
  var _storage$getSessionIt3;
24082
- return ((_storage$getSessionIt3 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt3 === void 0 ? void 0 : _storage$getSessionIt3.language) || 'en';
24084
+ return ((_storage$getSessionIt3 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt3 === void 0 ? void 0 : _storage$getSessionIt3.language) || 'en';
24083
24085
  };
24084
24086
  var selectedCurrency = function selectedCurrency() {
24085
24087
  var _storage$getSessionIt4;
24086
- return ((_storage$getSessionIt4 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt4 === void 0 ? void 0 : _storage$getSessionIt4.selectedCurrency) || 'USD';
24088
+ return ((_storage$getSessionIt4 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt4 === void 0 ? void 0 : _storage$getSessionIt4.selectedCurrency) || 'USD';
24087
24089
  };
24088
24090
  var selectedCountryA3code$2 = function selectedCountryA3code() {
24089
24091
  var _storage$getSessionIt5;
24090
- return ((_storage$getSessionIt5 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt5 === void 0 ? void 0 : _storage$getSessionIt5.selectedCountryA3code) || 'USA';
24092
+ return ((_storage$getSessionIt5 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt5 === void 0 ? void 0 : _storage$getSessionIt5.selectedCountryA3code) || 'USA';
24091
24093
  };
24092
24094
  var activePrinters$1 = function activePrinters() {
24093
24095
  var _storage$getLocalItem;
24094
- return ((_storage$getLocalItem = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.printers) || EMPTY_PRINTERS$1;
24096
+ return ((_storage$getLocalItem = storage$2.getLocalItem('dashboard')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.printers) || EMPTY_PRINTERS$1;
24095
24097
  };
24096
24098
  var makeKeyValue$1 = function makeKeyValue(final, target) {
24097
24099
  final[target.label] = target.printer_name;
@@ -24104,11 +24106,11 @@ var formatActivePrintersForState$1 = function formatActivePrintersForState() {
24104
24106
  };
24105
24107
  var activePhoneNumber$1 = function activePhoneNumber() {
24106
24108
  var _storage$getLocalItem2;
24107
- return ((_storage$getLocalItem2 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.phoneNumber) || '';
24109
+ return ((_storage$getLocalItem2 = storage$2.getLocalItem('dashboard')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.phoneNumber) || '';
24108
24110
  };
24109
24111
  var ringCentralEnabled$1 = function ringCentralEnabled() {
24110
24112
  var _storage$getLocalItem3;
24111
- return ((_storage$getLocalItem3 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.ringCentralEnabled) || false;
24113
+ return ((_storage$getLocalItem3 = storage$2.getLocalItem('dashboard')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.ringCentralEnabled) || false;
24112
24114
  };
24113
24115
  var filterRoles$2 = function filterRoles(roles, countryCode) {
24114
24116
  return compose(uniqBy$1(prop$1('roleName')), filter$1(propEq$1('countryCode', countryCode)))(roles);
@@ -24130,13 +24132,13 @@ var SettingsView$2 = /*#__PURE__*/function (_React$Component) {
24130
24132
  selectedLanguage: selectedLanguage$1(),
24131
24133
  selectedCurrency: selectedCurrency(),
24132
24134
  roles: [],
24133
- selectedRole: frontEndUtils.regex.beautifyRoleText(storage$1.userRole),
24135
+ selectedRole: frontEndUtils.regex.beautifyRoleText(storage$2.userRole),
24134
24136
  printersData: EMPTY_PRINTERS$1,
24135
24137
  loadingPrinters: false,
24136
24138
  oldActivePrinters: null
24137
24139
  }, EMPTY_PRINTERS$1));
24138
24140
  _defineProperty$2(_this, "fetchRoles", function (countryCode) {
24139
- fetcher.getUserRoles(countryCode).then(function (_roles) {
24141
+ fetcher$1.getUserRoles(countryCode).then(function (_roles) {
24140
24142
  var roles = filterRoles$2(_roles, countryCode);
24141
24143
  var selectedRole = _this.state.selectedRole;
24142
24144
  _this.setState({
@@ -24172,7 +24174,7 @@ var SettingsView$2 = /*#__PURE__*/function (_React$Component) {
24172
24174
  showLoading: true
24173
24175
  });
24174
24176
  _context2.n = 1;
24175
- return fetcher.getPrintersForYard(yardNumber, countryA3code);
24177
+ return fetcher$1.getPrintersForYard(yardNumber, countryA3code);
24176
24178
  case 1:
24177
24179
  printersData = _context2.v;
24178
24180
  _this.setState({
@@ -24180,7 +24182,7 @@ var SettingsView$2 = /*#__PURE__*/function (_React$Component) {
24180
24182
  loadingPrinters: false,
24181
24183
  showLoading: false
24182
24184
  });
24183
- if (firstTime && storage$1.getLocalItem('dashboard', 'printers')) {
24185
+ if (firstTime && storage$2.getLocalItem('dashboard', 'printers')) {
24184
24186
  _this.setState(_objectSpread2(_objectSpread2({}, activePrinters$1()), {}, {
24185
24187
  oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, activePrinters$1()) : _this.state.oldActivePrinters
24186
24188
  }));
@@ -24345,7 +24347,7 @@ var transformYardOptions = function transformYardOptions(option) {
24345
24347
  return {
24346
24348
  id: option.yardId,
24347
24349
  level: 'yard',
24348
- label: !isNil$1(option.yardName) ? option.yardId : 'NA',
24350
+ label: !isNil$2(option.yardName) ? option.yardId : 'NA',
24349
24351
  isSelectable: option.hasAccess
24350
24352
  };
24351
24353
  };
@@ -24353,7 +24355,7 @@ var transformRegionOptions = function transformRegionOptions(option) {
24353
24355
  return {
24354
24356
  id: option.regionId,
24355
24357
  level: 'region',
24356
- label: !isNil$1(option.regionName) ? option.regionName : 'NA',
24358
+ label: !isNil$2(option.regionName) ? option.regionName : 'NA',
24357
24359
  isSelectable: option.hasAccess,
24358
24360
  options: frontEndUtils.string.exists(option.yards) && option.yards.map(function (yard) {
24359
24361
  return transformYardOptions(yard);
@@ -24364,7 +24366,7 @@ var transformDivisionOptions = function transformDivisionOptions(option) {
24364
24366
  return {
24365
24367
  id: option.divisionId,
24366
24368
  level: 'division',
24367
- label: isNil$1(option.divisionName) ? 'NA' : option.divisionName,
24369
+ label: isNil$2(option.divisionName) ? 'NA' : option.divisionName,
24368
24370
  isSelectable: option.hasAccess,
24369
24371
  options: frontEndUtils.string.exists(option.regions) && option.regions.map(function (reg) {
24370
24372
  return transformRegionOptions(reg);
@@ -24375,7 +24377,7 @@ var transformCountriesOption = function transformCountriesOption(option) {
24375
24377
  return {
24376
24378
  id: "".concat(option.countryId, "-").concat(option.countryCode),
24377
24379
  level: 'country',
24378
- label: isNil$1(option.countryName) ? 'NA' : option.countryName,
24380
+ label: isNil$2(option.countryName) ? 'NA' : option.countryName,
24379
24381
  isSelectable: option.hasAccess,
24380
24382
  options: frontEndUtils.string.exists(option.divisions) && option.divisions.map(function (div) {
24381
24383
  return transformDivisionOptions(div);
@@ -24493,7 +24495,7 @@ var handleInputChange$1 = function handleInputChange(self) {
24493
24495
  break;
24494
24496
  }
24495
24497
  selectedValue = value.selectedValue, option = value.option;
24496
- storage$1.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
24498
+ storage$2.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
24497
24499
  roleName = option && option.roleName || ''; //pathOr('', ['selectedRoleOption', 'roleName'], nextState)
24498
24500
  isValidRole = self.state.roles.find(function (role) {
24499
24501
  return role.roleName === roleName;
@@ -24503,7 +24505,7 @@ var handleInputChange$1 = function handleInputChange(self) {
24503
24505
  break;
24504
24506
  }
24505
24507
  _context.n = 1;
24506
- return fetcher.getHierarchyOptions(roleName);
24508
+ return fetcher$1.getHierarchyOptions(roleName);
24507
24509
  case 1:
24508
24510
  hierarchies = _context.v;
24509
24511
  self.setState(_objectSpread2({
@@ -24522,7 +24524,7 @@ var handleInputChange$1 = function handleInputChange(self) {
24522
24524
  _context.n = 8;
24523
24525
  break;
24524
24526
  }
24525
- storage$1.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
24527
+ storage$2.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
24526
24528
  country = value.country, _value$yard = value.yard, yard = _value$yard === void 0 ? null : _value$yard;
24527
24529
  countryId = country && country.split('-')[0];
24528
24530
  if (!countryId) {
@@ -24543,7 +24545,7 @@ var handleInputChange$1 = function handleInputChange(self) {
24543
24545
  break;
24544
24546
  }
24545
24547
  _context.n = 5;
24546
- return fetcher.getYardNumbers(parseInt(yard));
24548
+ return fetcher$1.getYardNumbers(parseInt(yard));
24547
24549
  case 5:
24548
24550
  currentyards = _context.v;
24549
24551
  currentYard = currentyards[0];
@@ -24565,7 +24567,7 @@ var handleInputChange$1 = function handleInputChange(self) {
24565
24567
  _context.n = 11;
24566
24568
  break;
24567
24569
  }
24568
- storage$1.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
24570
+ storage$2.setSessionItem('dashboard', EMPTY_PRINTERS, 'printers');
24569
24571
  if (!(value !== self.state.selectedYardNumber && Boolean(value))) {
24570
24572
  _context.n = 10;
24571
24573
  break;
@@ -24576,7 +24578,7 @@ var handleInputChange$1 = function handleInputChange(self) {
24576
24578
  break;
24577
24579
  }
24578
24580
  _context.n = 9;
24579
- return fetcher.getYardNumbers(parseInt(value));
24581
+ return fetcher$1.getYardNumbers(parseInt(value));
24580
24582
  case 9:
24581
24583
  _currentyards = _context.v;
24582
24584
  _currentYard = _currentyards[0];
@@ -24615,8 +24617,8 @@ var saveSettings$1 = function saveSettings(self) {
24615
24617
  return _regenerator().w(function (_context2) {
24616
24618
  while (1) switch (_context2.n) {
24617
24619
  case 0:
24618
- dashboardSessionState = storage$1.getSessionItem('dashboard');
24619
- settingsLocalStorageState = storage$1.getLocalItem('settings');
24620
+ dashboardSessionState = storage$2.getSessionItem('dashboard');
24621
+ settingsLocalStorageState = storage$2.getLocalItem('settings');
24620
24622
  oldSettings = {
24621
24623
  selectedRole: settingsLocalStorageState.selectedRole,
24622
24624
  selectedHierarchyOption: settingsLocalStorageState.selectedHierarchyOption,
@@ -24639,21 +24641,21 @@ var saveSettings$1 = function saveSettings(self) {
24639
24641
  }
24640
24642
  }
24641
24643
  if (key === 'phoneNumber') {
24642
- storage$1.setLocalItem('dashboard', value, 'phoneNumber');
24644
+ storage$2.setLocalItem('dashboard', value, 'phoneNumber');
24643
24645
  }
24644
24646
  });
24645
24647
  _self$state = self.state, selectedYard = _self$state.selectedYardNumber, _self$state$selectedH = _self$state.selectedHierarchyOption, selectedHierarchyOption = _self$state$selectedH === void 0 ? {} : _self$state$selectedH, selectedRole = _self$state.selectedRole, _self$state$roles = _self$state.roles, roles = _self$state$roles === void 0 ? [] : _self$state$roles;
24646
24648
  roleOptionFromState = roles.find(function (roleOption) {
24647
24649
  return frontEndUtils.regex.beautifyRoleText(roleOption.roleName) === selectedRole;
24648
24650
  });
24649
- if (!(!roleOptionFromState || isEmpty$1(selectedHierarchyOption))) {
24651
+ if (!(!roleOptionFromState || isEmpty$2(selectedHierarchyOption))) {
24650
24652
  _context2.n = 1;
24651
24653
  break;
24652
24654
  }
24653
24655
  return _context2.a(2);
24654
24656
  case 1:
24655
24657
  _context2.n = 2;
24656
- return fetcher.getYardNumbers(selectedYard);
24658
+ return fetcher$1.getYardNumbers(selectedYard);
24657
24659
  case 2:
24658
24660
  yardNumbers = _context2.v;
24659
24661
  yard = yardNumbers[0];
@@ -24662,7 +24664,7 @@ var saveSettings$1 = function saveSettings(self) {
24662
24664
  countryId: selectedHierarchyOption.country,
24663
24665
  level: selectedHierarchyOption.yard ? 'yard' : 'country'
24664
24666
  };
24665
- storage$1.setSessionItem('dashboard', _objectSpread2(_objectSpread2({}, storage$1.getSessionItem('dashboard')), {}, {
24667
+ storage$2.setSessionItem('dashboard', _objectSpread2(_objectSpread2({}, storage$2.getSessionItem('dashboard')), {}, {
24666
24668
  selectedCurrency: yard.yard_currency,
24667
24669
  selectedCountry: (_yard$yard_country_co = yard.yard_country_code) === null || _yard$yard_country_co === void 0 ? void 0 : _yard$yard_country_co.slice(0, 2),
24668
24670
  selectedCountryA3code: yard.yard_country_code,
@@ -24672,17 +24674,17 @@ var saveSettings$1 = function saveSettings(self) {
24672
24674
  printers: printers,
24673
24675
  yard: yard
24674
24676
  }));
24675
- storage$1.setLocalItem('dashboard', printers, 'printers');
24676
- storage$1.setLocalItem('dashboard', 'en', 'language');
24677
- storage$1.setLocalItem('settings', roleOptionFromState.roleName, 'selectedRole');
24678
- storage$1.setLocalItem('settings', selectedHierarchyOption, 'selectedHierarchyOption');
24679
- storage$1.setLocalItem('settings', selectedHierarchy, 'selectedHierarchy');
24680
- storage$1.setLocalItem('lastSelectedYard', yard);
24677
+ storage$2.setLocalItem('dashboard', printers, 'printers');
24678
+ storage$2.setLocalItem('dashboard', 'en', 'language');
24679
+ storage$2.setLocalItem('settings', roleOptionFromState.roleName, 'selectedRole');
24680
+ storage$2.setLocalItem('settings', selectedHierarchyOption, 'selectedHierarchyOption');
24681
+ storage$2.setLocalItem('settings', selectedHierarchy, 'selectedHierarchy');
24682
+ storage$2.setLocalItem('lastSelectedYard', yard);
24681
24683
  _context2.n = 3;
24682
- return fetcher.getUserScopes();
24684
+ return fetcher$1.getUserScopes();
24683
24685
  case 3:
24684
24686
  userScopes = _context2.v;
24685
- storage$1.setLocalItem('login', userScopes, 'userAppScopes');
24687
+ storage$2.setLocalItem('login', userScopes, 'userAppScopes');
24686
24688
  getSelectedYard = function getSelectedYard() {
24687
24689
  var yardList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
24688
24690
  return yardList.find(function (yard) {
@@ -24692,11 +24694,11 @@ var saveSettings$1 = function saveSettings(self) {
24692
24694
  pickUserSecurityLevel = function pickUserSecurityLevel(obj) {
24693
24695
  return +propOr$1('0', 'userSecurityLevel', obj);
24694
24696
  };
24695
- securityLevel = compose(pickUserSecurityLevel, getSelectedYard)((_storage$getLocalItem = storage$1.getLocalItem('login')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.yardList);
24696
- storage$1.setSessionItem('securityLevel', securityLevel);
24697
+ securityLevel = compose(pickUserSecurityLevel, getSelectedYard)((_storage$getLocalItem = storage$2.getLocalItem('login')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.yardList);
24698
+ storage$2.setSessionItem('securityLevel', securityLevel);
24697
24699
  // persist user preferences
24698
24700
  _context2.n = 4;
24699
- return fetcher.setUserPreferences('oph', {
24701
+ return fetcher$1.setUserPreferences('oph', {
24700
24702
  selectedCurrency: yard.yard_currency,
24701
24703
  language: 'en',
24702
24704
  // TODO Remove this after remove role selection
@@ -24732,14 +24734,14 @@ var saveSettings$1 = function saveSettings(self) {
24732
24734
  }();
24733
24735
  };
24734
24736
  var selectedYardNumber$1 = function selectedYardNumber() {
24735
- return storage$1.activeYardNumber;
24737
+ return storage$2.activeYardNumber;
24736
24738
  };
24737
24739
  var selectedCountryA3code$1 = function selectedCountryA3code() {
24738
24740
  var _storage$getSessionIt2;
24739
- return ((_storage$getSessionIt2 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountryA3code) || 'GBR';
24741
+ return ((_storage$getSessionIt2 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountryA3code) || 'GBR';
24740
24742
  };
24741
24743
  var activePrinters = function activePrinters() {
24742
- return storage$1.getLocalItem('dashboard', 'printers') || EMPTY_PRINTERS;
24744
+ return storage$2.getLocalItem('dashboard', 'printers') || EMPTY_PRINTERS;
24743
24745
  };
24744
24746
  var makeKeyValue = function makeKeyValue(final, target) {
24745
24747
  final[target.label] = target.printer_name;
@@ -24752,11 +24754,11 @@ var formatActivePrintersForState = function formatActivePrintersForState() {
24752
24754
  };
24753
24755
  var activePhoneNumber = function activePhoneNumber() {
24754
24756
  var _storage$getLocalItem2;
24755
- return ((_storage$getLocalItem2 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.phoneNumber) || '';
24757
+ return ((_storage$getLocalItem2 = storage$2.getLocalItem('dashboard')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.phoneNumber) || '';
24756
24758
  };
24757
24759
  var ringCentralEnabled = function ringCentralEnabled() {
24758
24760
  var _storage$getLocalItem3;
24759
- return ((_storage$getLocalItem3 = storage$1.getLocalItem('dashboard')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.ringCentralEnabled) || false;
24761
+ return ((_storage$getLocalItem3 = storage$2.getLocalItem('dashboard')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.ringCentralEnabled) || false;
24760
24762
  };
24761
24763
  var getYardOptions = /*#__PURE__*/function () {
24762
24764
  var _ref7 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee3(countryId) {
@@ -24765,9 +24767,9 @@ var getYardOptions = /*#__PURE__*/function () {
24765
24767
  return _regenerator().w(function (_context3) {
24766
24768
  while (1) switch (_context3.n) {
24767
24769
  case 0:
24768
- url = (_storage$getLocalItem4 = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem4 === void 0 ? void 0 : (_storage$getLocalItem5 = _storage$getLocalItem4.endpoints) === null || _storage$getLocalItem5 === void 0 ? void 0 : _storage$getLocalItem5.yardsOptions;
24770
+ url = (_storage$getLocalItem4 = storage$2.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem4 === void 0 ? void 0 : (_storage$getLocalItem5 = _storage$getLocalItem4.endpoints) === null || _storage$getLocalItem5 === void 0 ? void 0 : _storage$getLocalItem5.yardsOptions;
24769
24771
  _context3.n = 1;
24770
- return fetcher.get(frontEndUtils.string.substitute(url, {
24772
+ return fetcher$1.get(frontEndUtils.string.substitute(url, {
24771
24773
  countryId: countryId
24772
24774
  }), {
24773
24775
  headers: {
@@ -24789,7 +24791,7 @@ var getYardOptions = /*#__PURE__*/function () {
24789
24791
  };
24790
24792
  }();
24791
24793
  var filterRoles = function filterRoles(roles, invalidCodes) {
24792
- return compose(uniqBy$1(prop$1('roleName')), filter$1(compose(not$1, flip$3(includes$1)(invalidCodes), prop$1('countryCode'))))(roles);
24794
+ return compose(uniqBy$1(prop$1('roleName')), filter$1(compose(not$1, flip$3(includes$2)(invalidCodes), prop$1('countryCode'))))(roles);
24793
24795
  };
24794
24796
  var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
24795
24797
  function SettingsView() {
@@ -24804,9 +24806,9 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
24804
24806
  ringCentralEnabled: ringCentralEnabled(),
24805
24807
  selectedYardNumber: selectedYardNumber$1(),
24806
24808
  selectedCountryA3code: selectedCountryA3code$1(),
24807
- selectedRole: frontEndUtils.regex.beautifyRoleText(storage$1.userRole),
24808
- selectedHierarchy: storage$1.getLocalItem('settings', 'selectedHierarchy') || null,
24809
- selectedHierarchyOption: storage$1.getLocalItem('settings', 'selectedHierarchyOption'),
24809
+ selectedRole: frontEndUtils.regex.beautifyRoleText(storage$2.userRole),
24810
+ selectedHierarchy: storage$2.getLocalItem('settings', 'selectedHierarchy') || null,
24811
+ selectedHierarchyOption: storage$2.getLocalItem('settings', 'selectedHierarchyOption'),
24810
24812
  roles: [],
24811
24813
  hierarchies: [],
24812
24814
  printersData: EMPTY_PRINTERS,
@@ -24848,14 +24850,14 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
24848
24850
  showLoading: true
24849
24851
  });
24850
24852
  _context5.n = 1;
24851
- return fetcher.getPrintersForYard(yardNumber, countryA3code);
24853
+ return fetcher$1.getPrintersForYard(yardNumber, countryA3code);
24852
24854
  case 1:
24853
24855
  printersData = _context5.v;
24854
24856
  _this.setState({
24855
24857
  printersData: printersData,
24856
24858
  showLoading: false
24857
24859
  });
24858
- if (firstTime && storage$1.getLocalItem('dashboard', 'printers')) {
24860
+ if (firstTime && storage$2.getLocalItem('dashboard', 'printers')) {
24859
24861
  _this.setState(_objectSpread2(_objectSpread2({}, activePrinters()), {}, {
24860
24862
  oldActivePrinters: !_this.state.oldActivePrinters ? _objectSpread2({}, activePrinters()) : _this.state.oldActivePrinters
24861
24863
  }));
@@ -24899,16 +24901,16 @@ var SettingsView$1 = /*#__PURE__*/function (_React$Component) {
24899
24901
  while (1) switch (_context6.n) {
24900
24902
  case 0:
24901
24903
  _context6.n = 1;
24902
- return fetcher.getUserRoles(this.state.selectedCountryA3code);
24904
+ return fetcher$1.getUserRoles(this.state.selectedCountryA3code);
24903
24905
  case 1:
24904
24906
  _roles = _context6.v;
24905
24907
  // MEA and UK are both valid in UK portal so filter out the rest
24906
24908
  roles = filterRoles(_roles, ['CAN', 'BRA', 'USA', 'IND']);
24907
24909
  _context6.n = 2;
24908
- return fetcher.getHierarchyOptions(storage$1.userRole);
24910
+ return fetcher$1.getHierarchyOptions(storage$2.userRole);
24909
24911
  case 2:
24910
24912
  hierarchies = _context6.v;
24911
- _storage$getLocalItem6 = storage$1.getLocalItem('settings', 'selectedHierarchyOption'), _storage$getLocalItem7 = _storage$getLocalItem6.country, country = _storage$getLocalItem7 === void 0 ? '' : _storage$getLocalItem7;
24913
+ _storage$getLocalItem6 = storage$2.getLocalItem('settings', 'selectedHierarchyOption'), _storage$getLocalItem7 = _storage$getLocalItem6.country, country = _storage$getLocalItem7 === void 0 ? '' : _storage$getLocalItem7;
24912
24914
  countryId = country.split('-')[0];
24913
24915
  if (!countryId) {
24914
24916
  _context6.n = 4;
@@ -25084,7 +25086,7 @@ var COUNTRIES$1 = {
25084
25086
  }
25085
25087
  };
25086
25088
  var validCountry = function validCountry(value) {
25087
- return value && includes$1(value, keys$3(COUNTRIES$1)) ? locale(COUNTRIES$1[value].name) : value || '';
25089
+ return value && includes$2(value, keys$3(COUNTRIES$1)) ? locale(COUNTRIES$1[value].name) : value || '';
25088
25090
  };
25089
25091
  var CountrySelector = function CountrySelector(_ref) {
25090
25092
  var handleChange = _ref.handleChange,
@@ -25124,7 +25126,7 @@ var getRolesMap = function getRolesMap(userRoles) {
25124
25126
  userRoles.map(function (obj) {
25125
25127
  if (has$2(obj.roleName, rolesMap)) rolesMap[obj.roleName] = [].concat(_toConsumableArray(rolesMap[obj.roleName]), [obj.hierarchyId]);else rolesMap[obj.roleName] = [obj.hierarchyId];
25126
25128
  });
25127
- storage$1.setLocalItem('settings', rolesMap, 'rolesMap');
25129
+ storage$2.setLocalItem('settings', rolesMap, 'rolesMap');
25128
25130
  return rolesMap;
25129
25131
  };
25130
25132
  var getUserRolesFromFetcher = /*#__PURE__*/function () {
@@ -25134,7 +25136,7 @@ var getUserRolesFromFetcher = /*#__PURE__*/function () {
25134
25136
  while (1) switch (_context.n) {
25135
25137
  case 0:
25136
25138
  promises = keys$3(COUNTRIES).map(function (country) {
25137
- return fetcher.getCobaltUserRoles(COUNTRIES[country].code);
25139
+ return fetcher$1.getCobaltUserRoles(COUNTRIES[country].code);
25138
25140
  });
25139
25141
  _context.n = 1;
25140
25142
  return Promise.all(promises);
@@ -25146,7 +25148,7 @@ var getUserRolesFromFetcher = /*#__PURE__*/function () {
25146
25148
  roles: userRoles[index]
25147
25149
  };
25148
25150
  }).filter(function (roleByCountry) {
25149
- return !isEmpty$1(roleByCountry.roles);
25151
+ return !isEmpty$2(roleByCountry.roles);
25150
25152
  });
25151
25153
  return _context.a(2, result);
25152
25154
  }
@@ -25157,13 +25159,13 @@ var getUserRolesFromFetcher = /*#__PURE__*/function () {
25157
25159
  };
25158
25160
  }();
25159
25161
  var getSelectedYardNumberAndName = function getSelectedYardNumberAndName() {
25160
- var _storage$getLocalItem = storage$1.getLocalItem('dashboard'),
25162
+ var _storage$getLocalItem = storage$2.getLocalItem('dashboard'),
25161
25163
  selectedYard = _storage$getLocalItem.selectedYard,
25162
25164
  yardList = _storage$getLocalItem.yardList;
25163
25165
  var selectedYardObject = head$1(filter$1(function (yard) {
25164
25166
  return yard.yard_number === selectedYard;
25165
25167
  }, yardList)) || {};
25166
- return !isEmpty$1(selectedYardObject) ? "".concat(selectedYardObject.yard_number, " - ").concat(selectedYardObject.yard_name) : null;
25168
+ return !isEmpty$2(selectedYardObject) ? "".concat(selectedYardObject.yard_number, " - ").concat(selectedYardObject.yard_name) : null;
25167
25169
  };
25168
25170
  var getAccessCountries = function getAccessCountries(userRoles) {
25169
25171
  return userRoles.map(function (rolesByCountry) {
@@ -25233,15 +25235,15 @@ var saveSettings = function saveSettings(self) {
25233
25235
  };
25234
25236
  localStorage.setItem('dashboard', JSON.stringify(dashboard));
25235
25237
  sessionStorage.setItem('dashboard', JSON.stringify(dashboard));
25236
- storage$1.setLocalItem('dashboard', {
25238
+ storage$2.setLocalItem('dashboard', {
25237
25239
  yard_number: selectedYard
25238
25240
  }, 'yard');
25239
- storage$1.setSessionItem('dashboard', {
25241
+ storage$2.setSessionItem('dashboard', {
25240
25242
  yard_number: selectedYard
25241
25243
  }, 'yard');
25242
- storage$1.setLocalItem('dashboard', yardOptions, 'yardList');
25243
- storage$1.setSessionItem('dashboard', yardOptions, 'yardList');
25244
- storage$1.setLocalItem('settings', selectedRole, 'selectedRole');
25244
+ storage$2.setLocalItem('dashboard', yardOptions, 'yardList');
25245
+ storage$2.setSessionItem('dashboard', yardOptions, 'yardList');
25246
+ storage$2.setLocalItem('settings', selectedRole, 'selectedRole');
25245
25247
  if (self.props.onSave) {
25246
25248
  self.props.onSave();
25247
25249
  }
@@ -25249,19 +25251,19 @@ var saveSettings = function saveSettings(self) {
25249
25251
  };
25250
25252
  var selectedYardNumber = function selectedYardNumber() {
25251
25253
  var _storage$getSessionIt;
25252
- return (_storage$getSessionIt = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
25254
+ return (_storage$getSessionIt = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
25253
25255
  };
25254
25256
  var selectedCountry = function selectedCountry() {
25255
25257
  var _storage$getSessionIt2;
25256
- return ((_storage$getSessionIt2 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountry) || 'US';
25258
+ return ((_storage$getSessionIt2 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountry) || 'US';
25257
25259
  };
25258
25260
  var selectedLanguage = function selectedLanguage() {
25259
25261
  var _storage$getSessionIt3;
25260
- return ((_storage$getSessionIt3 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt3 === void 0 ? void 0 : _storage$getSessionIt3.language) || 'en';
25262
+ return ((_storage$getSessionIt3 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt3 === void 0 ? void 0 : _storage$getSessionIt3.language) || 'en';
25261
25263
  };
25262
25264
  var selectedCountryA3code = function selectedCountryA3code() {
25263
25265
  var _storage$getSessionIt4;
25264
- return ((_storage$getSessionIt4 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt4 === void 0 ? void 0 : _storage$getSessionIt4.selectedCountryA3code) || 'USA';
25266
+ return ((_storage$getSessionIt4 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt4 === void 0 ? void 0 : _storage$getSessionIt4.selectedCountryA3code) || 'USA';
25265
25267
  };
25266
25268
  var SettingsView = /*#__PURE__*/function (_React$Component) {
25267
25269
  function SettingsView() {
@@ -25281,7 +25283,7 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
25281
25283
  userRoles: [],
25282
25284
  yardOptions: [],
25283
25285
  selectedYardNumberAndName: getSelectedYardNumberAndName() || null,
25284
- selectedRole: storage$1.getLocalItem('settings').selectedRole || '',
25286
+ selectedRole: storage$2.getLocalItem('settings').selectedRole || '',
25285
25287
  showLoading: false
25286
25288
  });
25287
25289
  _defineProperty$2(_this, "fetchFacilititesForRole", /*#__PURE__*/function () {
@@ -25300,7 +25302,7 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
25300
25302
  });
25301
25303
  return _context.a(2);
25302
25304
  case 1:
25303
- if (!includes$1(roleName, pluck$1('roleName', (activeCountryObj === null || activeCountryObj === void 0 ? void 0 : activeCountryObj.roles) || []))) {
25305
+ if (!includes$2(roleName, pluck$1('roleName', (activeCountryObj === null || activeCountryObj === void 0 ? void 0 : activeCountryObj.roles) || []))) {
25304
25306
  _context.n = 7;
25305
25307
  break;
25306
25308
  }
@@ -25315,18 +25317,18 @@ var SettingsView = /*#__PURE__*/function (_React$Component) {
25315
25317
  return _context.a(2);
25316
25318
  case 3:
25317
25319
  _context.n = 4;
25318
- return fetcher.getCobaltUserFacilities(COUNTRIES[_this.state.selectedCountry].code, roleName);
25320
+ return fetcher$1.getCobaltUserFacilities(COUNTRIES[_this.state.selectedCountry].code, roleName);
25319
25321
  case 4:
25320
25322
  allFacilities = _context.v;
25321
25323
  rolesMap = getRolesMap((activeCountryObj === null || activeCountryObj === void 0 ? void 0 : activeCountryObj.roles) || []);
25322
- if (!includes$1(_this.state.selectedYardNumber, rolesMap[roleName])) {
25324
+ if (!includes$2(_this.state.selectedYardNumber, rolesMap[roleName])) {
25323
25325
  _this.setState({
25324
25326
  selectedYardNumber: '',
25325
25327
  selectedYardNumberAndName: ''
25326
25328
  });
25327
25329
  }
25328
25330
  yardOptions = filter$1(function (yard) {
25329
- return includes$1(yard.yard_number, rolesMap[roleName]);
25331
+ return includes$2(yard.yard_number, rolesMap[roleName]);
25330
25332
  }, allFacilities);
25331
25333
  _this.setState({
25332
25334
  yardOptions: yardOptions
@@ -25602,7 +25604,7 @@ function filterOutExpiredNotifications(notifications) {
25602
25604
  }
25603
25605
  function filterOutNotificationForOtherApps(notifications) {
25604
25606
  var currentApp = window.location.pathname === '/' ? 'home' : window.location.pathname;
25605
- var tilesConfig = storage$1.getLocalItem('opsportal-core:config').tiles || [];
25607
+ var tilesConfig = storage$2.getLocalItem('opsportal-core:config').tiles || [];
25606
25608
  var tile = tilesConfig.find(function (item) {
25607
25609
  return item.path === currentApp || "".concat(item.path, "/") === currentApp || currentApp.startsWith(item.path);
25608
25610
  }) || {};
@@ -25617,8 +25619,8 @@ function filterOutNotificationForOtherApps(notifications) {
25617
25619
  });
25618
25620
  }
25619
25621
  function filterOutNotificationByAudience(notifications) {
25620
- var userEmail = storage$1.userEmail;
25621
- var yardNumber = storage$1.activeYardNumber;
25622
+ var userEmail = storage$2.userEmail;
25623
+ var yardNumber = storage$2.activeYardNumber;
25622
25624
  // const countryCodes = window.location.hostname.includes('.com') ? ["USA", "CAN"] : ["ARE", "OMN", "BHR", "IRL", "GBR"]
25623
25625
  return notifications.filter(function (notification) {
25624
25626
  // if (!countryCodes.includes(notification.countryCode)) return false
@@ -26115,7 +26117,7 @@ var Notifications = function Notifications(_ref) {
26115
26117
  setLast(notifications.length - 1);
26116
26118
  }, [notifications]);
26117
26119
  var notification = notifications[i];
26118
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !isNil$1(notification) && !showSideBar ? /*#__PURE__*/React__default["default"].createElement(Banner, _extends$1({
26120
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !isNil$2(notification) && !showSideBar ? /*#__PURE__*/React__default["default"].createElement(Banner, _extends$1({
26119
26121
  current: i + 1,
26120
26122
  count: notifications.length,
26121
26123
  showNavButtons: notifications.length > 1,
@@ -26317,7 +26319,7 @@ var generateAppBarElements = function generateAppBarElements(props, showCallout)
26317
26319
  var handleIconClick = props.handleIconClick,
26318
26320
  ideaNoteVisible = props.ideaNoteVisible,
26319
26321
  mobileMenuVisible = props.mobileMenuVisible;
26320
- var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
26322
+ var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
26321
26323
  var enableNewToolkitFeatures = coreAppConfig.enableNewToolkitFeatures,
26322
26324
  showSettingsMenuByTileConfig = coreAppConfig.showSettingsMenuByTileConfig,
26323
26325
  enableIdeaNote = coreAppConfig.enableIdeaNote,
@@ -26412,7 +26414,7 @@ var generateAppBarElements = function generateAppBarElements(props, showCallout)
26412
26414
  }, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
26413
26415
  name: "earth-americas",
26414
26416
  variant: "regular"
26415
- }), ' ', /*#__PURE__*/React__default["default"].createElement("span", null, getLanguage(storage$1.activeLanguage)));
26417
+ }), ' ', /*#__PURE__*/React__default["default"].createElement("span", null, getLanguage(storage$2.activeLanguage)));
26416
26418
  }
26417
26419
  }, {
26418
26420
  key: 'roleAndFlag',
@@ -26724,7 +26726,7 @@ var ICONS = {
26724
26726
  };
26725
26727
  var AppBar$1 = function AppBar(props) {
26726
26728
  var _window$toolkitEnv4;
26727
- var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
26729
+ var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
26728
26730
  var enableNewToolkitFeatures = coreAppConfig.enableNewToolkitFeatures,
26729
26731
  ideaNoteUri = coreAppConfig.ideaNoteUri;
26730
26732
  var _useState = React.useState(false),
@@ -28706,7 +28708,7 @@ var ReactModal = /*@__PURE__*/unwrapExports(lib);
28706
28708
 
28707
28709
  ReactModal.setAppElement('*');
28708
28710
 
28709
- storage$1.flexLoaded;
28711
+ storage$2.flexLoaded;
28710
28712
 
28711
28713
  function LatestReleaseDialog(_ref) {
28712
28714
  var release = _ref.release,
@@ -28971,7 +28973,7 @@ var getCurrentApp = function getCurrentApp() {
28971
28973
  if (currentApp === 'Ops Home') {
28972
28974
  app = 'Ops Home';
28973
28975
  } else {
28974
- var tilesConfig = storage$1.getLocalItem('opsportal-core:config').tiles || [];
28976
+ var tilesConfig = storage$2.getLocalItem('opsportal-core:config').tiles || [];
28975
28977
  var isPathMatch = function isPathMatch(item) {
28976
28978
  if (item.path === currentApp || "".concat(item.path, "/") === currentApp) return true;
28977
28979
  // For sub-routes, require path boundary: next char must be '/' or end of string
@@ -28991,9 +28993,26 @@ var getCurrentApp = function getCurrentApp() {
28991
28993
  return app;
28992
28994
  };
28993
28995
  var buildTargetingClause = function buildTargetingClause(yardNumber, email) {
28994
- var app = encodeURIComponent(getCurrentApp());
28995
- var clauses = ["(facilities:".concat(yardNumber, " AND -user_details:* AND -applications:* AND -group_user_details:*)"), "(-facilities:* AND user_details:\"".concat(email, "\" AND -applications:* AND -group_user_details:*)"), "(-facilities:* AND -user_details:* AND applications:\"".concat(app, "\" AND -group_user_details:*)"), "(-facilities:* AND -user_details:* AND -applications:* AND group_user_details:\"".concat(email, "\")"), "(facilities:".concat(yardNumber, " AND user_details:\"").concat(email, "\" AND -applications:* AND -group_user_details:*)"), "(facilities:".concat(yardNumber, " AND -user_details:* AND applications:\"").concat(app, "\" AND -group_user_details:*)"), "(facilities:".concat(yardNumber, " AND -user_details:* AND -applications:* AND group_user_details:\"").concat(email, "\")"), "(-facilities:* AND user_details:\"".concat(email, "\" AND applications:\"").concat(app, "\" AND -group_user_details:*)"), "(-facilities:* AND user_details:\"".concat(email, "\" AND -applications:* AND group_user_details:\"").concat(email, "\")"), "(-facilities:* AND -user_details:* AND applications:\"".concat(app, "\" AND group_user_details:\"").concat(email, "\")"), "(facilities:".concat(yardNumber, " AND user_details:\"").concat(email, "\" AND applications:\"").concat(app, "\" AND -group_user_details:*)"), "(facilities:".concat(yardNumber, " AND user_details:\"").concat(email, "\" AND -applications:* AND group_user_details:\"").concat(email, "\")"), "(facilities:".concat(yardNumber, " AND -user_details:* AND applications:\"").concat(app, "\" AND group_user_details:\"").concat(email, "\")"), "(-facilities:* AND user_details:\"".concat(email, "\" AND applications:\"").concat(app, "\" AND group_user_details:\"").concat(email, "\")"), "(facilities:".concat(yardNumber, " AND user_details:\"").concat(email, "\" AND applications:\"").concat(app, "\" AND group_user_details:\"").concat(email, "\")")];
28996
- return clauses.join(' OR ');
28996
+ encodeURIComponent(getCurrentApp());
28997
+ // const clauses = [
28998
+ // `(facilities:${yardNumber} AND -user_details:* AND -applications:* AND -group_user_details:*)`,
28999
+ // `(-facilities:* AND user_details:"${email}" AND -applications:* AND -group_user_details:*)`,
29000
+ // `(-facilities:* AND -user_details:* AND applications:"${app}" AND -group_user_details:*)`,
29001
+ // `(-facilities:* AND -user_details:* AND -applications:* AND group_user_details:"${email}")`,
29002
+ // `(facilities:${yardNumber} AND user_details:"${email}" AND -applications:* AND -group_user_details:*)`,
29003
+ // `(facilities:${yardNumber} AND -user_details:* AND applications:"${app}" AND -group_user_details:*)`,
29004
+ // `(facilities:${yardNumber} AND -user_details:* AND -applications:* AND group_user_details:"${email}")`,
29005
+ // `(-facilities:* AND user_details:"${email}" AND applications:"${app}" AND -group_user_details:*)`,
29006
+ // `(-facilities:* AND user_details:"${email}" AND -applications:* AND group_user_details:"${email}")`,
29007
+ // `(-facilities:* AND -user_details:* AND applications:"${app}" AND group_user_details:"${email}")`,
29008
+ // `(facilities:${yardNumber} AND user_details:"${email}" AND applications:"${app}" AND -group_user_details:*)`,
29009
+ // `(facilities:${yardNumber} AND user_details:"${email}" AND -applications:* AND group_user_details:"${email}")`,
29010
+ // `(facilities:${yardNumber} AND -user_details:* AND applications:"${app}" AND group_user_details:"${email}")`,
29011
+ // `(-facilities:* AND user_details:"${email}" AND applications:"${app}" AND group_user_details:"${email}")`,
29012
+ // `(facilities:${yardNumber} AND user_details:"${email}" AND applications:"${app}" AND group_user_details:"${email}")`,
29013
+ // ]
29014
+ // return clauses.join(' OR ')
29015
+ return "(facilities:".concat(yardNumber, " OR user_details:\"").concat(email, "\" OR group_user_details:\"").concat(email, "\")");
28997
29016
  };
28998
29017
  var generateQuery = function generateQuery(yardNumber, email) {
28999
29018
  var startDateTs = moment(new Date()).add(1, 'days').local().format('YYYY-MM-DDTHH:mm:ss[Z]');
@@ -29038,16 +29057,16 @@ var generateTargets = function generateTargets(notification) {
29038
29057
  };
29039
29058
  //url encode the query string
29040
29059
  function fetchG2Notifications(updateNotifications, updateAllNotificationsList) {
29041
- var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
29060
+ var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
29042
29061
  var endpoints = coreAppConfig.endpoints;
29043
- var query = generateQuery(storage$1.activeYardNumber, storage$1.userEmail);
29062
+ var query = generateQuery(storage$2.activeYardNumber, storage$2.userEmail);
29044
29063
  var headers = {
29045
29064
  collection: 'notifications',
29046
29065
  serviceName: 'notification',
29047
- Country: storage$1.getSessionItem('dashboard', 'selectedCountryA3code'),
29048
- Authorization: "bearer ".concat(storage$1.accessToken)
29066
+ Country: storage$2.getSessionItem('dashboard', 'selectedCountryA3code'),
29067
+ Authorization: "bearer ".concat(storage$2.accessToken)
29049
29068
  };
29050
- fetcher.get("".concat(endpoints.getG2NotificationsSolr, "?").concat(query), {
29069
+ fetcher$1.get("".concat(endpoints.getG2NotificationsSolr, "?").concat(query), {
29051
29070
  headers: headers
29052
29071
  }).then(function (res) {
29053
29072
  var notificationsList = pathOr$1([], ['data', 'response', 'docs'], res);
@@ -29090,14 +29109,17 @@ function fetchG2Notifications(updateNotifications, updateAllNotificationsList) {
29090
29109
  });
29091
29110
  }
29092
29111
  function startWebSocketConnection(updateNotifications, updateAllNotificationsList, reConnectSocket, updateUserStatus) {
29093
- var _storage$getSessionIt, _storage$getSessionIt2;
29112
+ var _window$location$host, _storage$getSessionIt, _storage$getSessionIt2;
29094
29113
  var callbacks = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
29114
+ if ((_window$location$host = window.location.hostname) !== null && _window$location$host !== void 0 && _window$location$host.includes('localhost')) {
29115
+ return;
29116
+ }
29095
29117
  var onOpen = callbacks.onOpen,
29096
29118
  onClose = callbacks.onClose;
29097
- var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
29098
- var webSocketURL = "".concat(coreAppConfig.webSocketURL, "/").concat((_storage$getSessionIt = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard, ",").concat(storage$1.userEmail, ",").concat(encodeURIComponent(getCurrentApp()));
29119
+ var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
29120
+ var webSocketURL = "".concat(coreAppConfig.webSocketURL, "/").concat((_storage$getSessionIt = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard, ",").concat(storage$2.userEmail, ",").concat(encodeURIComponent(getCurrentApp()));
29099
29121
  var domain = window.location.hostname.slice(window.location.hostname.indexOf('.copart'));
29100
- var selectedCountryA3code = (_storage$getSessionIt2 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountryA3code;
29122
+ var selectedCountryA3code = (_storage$getSessionIt2 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.selectedCountryA3code;
29101
29123
  var notificationCountry = selectedCountryA3code;
29102
29124
  try {
29103
29125
  if (coreAppConfig.nchanAvailableCountries) {
@@ -29113,7 +29135,7 @@ function startWebSocketConnection(updateNotifications, updateAllNotificationsLis
29113
29135
  browserCookies.set('notification_country', notificationCountry, {
29114
29136
  domain: domain
29115
29137
  });
29116
- document.cookie = 'access_token=' + storage$1.accessToken + '; path=/;domain=' + domain;
29138
+ document.cookie = 'access_token=' + storage$2.accessToken + '; path=/;domain=' + domain;
29117
29139
  var NOTIFICATION_FLUSH_MS = 150;
29118
29140
  var notificationBuffer = [];
29119
29141
  var flushTimerId = null;
@@ -29153,7 +29175,7 @@ function startWebSocketConnection(updateNotifications, updateAllNotificationsLis
29153
29175
  // Check if this is a user status update message (process immediately)
29154
29176
  if ((messageData === null || messageData === void 0 ? void 0 : messageData.type) === 'USER_STATUS_UPDATE') {
29155
29177
  var messageEmail = (messageData.userEmail || '').toLowerCase();
29156
- var currentUserEmail = (storage$1.userEmail || '').toLowerCase();
29178
+ var currentUserEmail = (storage$2.userEmail || '').toLowerCase();
29157
29179
  if (messageEmail !== currentUserEmail) {
29158
29180
  return;
29159
29181
  }
@@ -29200,15 +29222,15 @@ var fetchAvailableStatuses = /*#__PURE__*/function () {
29200
29222
  return _regenerator().w(function (_context) {
29201
29223
  while (1) switch (_context.p = _context.n) {
29202
29224
  case 0:
29203
- coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
29225
+ coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
29204
29226
  endpoints = coreAppConfig.endpoints;
29205
- email = storage$1.userEmail || '';
29227
+ email = storage$2.userEmail || '';
29206
29228
  endpoint = frontEndUtils.string.substitute(endpoints === null || endpoints === void 0 ? void 0 : endpoints.getAvailableStatusesByUser, {
29207
29229
  email: email
29208
29230
  });
29209
29231
  _context.p = 1;
29210
29232
  _context.n = 2;
29211
- return fetcher.get(endpoint);
29233
+ return fetcher$1.get(endpoint);
29212
29234
  case 2:
29213
29235
  res = _context.v;
29214
29236
  availableStatuses = pathOr$1([], ['data'], res);
@@ -29233,15 +29255,15 @@ var fetchUserStatus = /*#__PURE__*/function () {
29233
29255
  return _regenerator().w(function (_context2) {
29234
29256
  while (1) switch (_context2.p = _context2.n) {
29235
29257
  case 0:
29236
- coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
29258
+ coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
29237
29259
  endpoints = coreAppConfig.endpoints;
29238
- email = storage$1.userEmail || '';
29260
+ email = storage$2.userEmail || '';
29239
29261
  endpoint = frontEndUtils.string.substitute(endpoints === null || endpoints === void 0 ? void 0 : endpoints.getUserStatus, {
29240
29262
  email: email
29241
29263
  });
29242
29264
  _context2.p = 1;
29243
29265
  _context2.n = 2;
29244
- return fetcher.get(endpoint);
29266
+ return fetcher$1.get(endpoint);
29245
29267
  case 2:
29246
29268
  res = _context2.v;
29247
29269
  docs = pathOr$1([], ['data', 'response', 'docs'], res);
@@ -29266,17 +29288,17 @@ var updateUserStatus = /*#__PURE__*/function () {
29266
29288
  return _regenerator().w(function (_context3) {
29267
29289
  while (1) switch (_context3.p = _context3.n) {
29268
29290
  case 0:
29269
- coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
29291
+ coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
29270
29292
  endpoints = coreAppConfig.endpoints;
29271
29293
  endpoint = endpoints === null || endpoints === void 0 ? void 0 : endpoints.updateUserStatus;
29272
29294
  requestBody = {
29273
29295
  status: statusId,
29274
- email: storage$1.userEmail,
29296
+ email: storage$2.userEmail,
29275
29297
  timeStamp: moment.utc().format('YYYY-MM-DD HH:mm:ss')
29276
29298
  };
29277
29299
  _context3.p = 1;
29278
29300
  _context3.n = 2;
29279
- return fetcher.post(endpoint, requestBody);
29301
+ return fetcher$1.post(endpoint, requestBody);
29280
29302
  case 2:
29281
29303
  res = _context3.v;
29282
29304
  responseData = pathOr$1(null, ['data'], res);
@@ -29302,18 +29324,18 @@ var sendHeartBeat = /*#__PURE__*/function () {
29302
29324
  return _regenerator().w(function (_context4) {
29303
29325
  while (1) switch (_context4.p = _context4.n) {
29304
29326
  case 0:
29305
- coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
29327
+ coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
29306
29328
  endpoints = coreAppConfig.endpoints;
29307
29329
  endpoint = endpoints === null || endpoints === void 0 ? void 0 : endpoints.sendHeartBeat;
29308
29330
  requestBody = {
29309
- email: storage$1.userEmail,
29331
+ email: storage$2.userEmail,
29310
29332
  timeStamp: moment.utc().format('YYYY-MM-DD HH:mm:ss'),
29311
- copartId: storage$1.userCopartId,
29312
- samAccount: storage$1.userSamAccount
29333
+ copartId: storage$2.userCopartId,
29334
+ samAccount: storage$2.userSamAccount
29313
29335
  };
29314
29336
  _context4.p = 1;
29315
29337
  _context4.n = 2;
29316
- return fetcher.post(endpoint, requestBody);
29338
+ return fetcher$1.post(endpoint, requestBody);
29317
29339
  case 2:
29318
29340
  _context4.n = 4;
29319
29341
  break;
@@ -29343,19 +29365,19 @@ var sendUserInteractionEvent = /*#__PURE__*/function () {
29343
29365
  while (1) switch (_context5.p = _context5.n) {
29344
29366
  case 0:
29345
29367
  didInteract = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : false;
29346
- coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
29368
+ coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
29347
29369
  endpoints = coreAppConfig.endpoints;
29348
29370
  endpoint = endpoints === null || endpoints === void 0 ? void 0 : endpoints.sendUserInteractionEvent;
29349
29371
  requestBody = {
29350
- email: storage$1.userEmail,
29372
+ email: storage$2.userEmail,
29351
29373
  timeStamp: moment.utc().format('YYYY-MM-DD HH:mm:ss'),
29352
- copartId: storage$1.userCopartId,
29353
- samAccount: storage$1.userSamAccount,
29374
+ copartId: storage$2.userCopartId,
29375
+ samAccount: storage$2.userSamAccount,
29354
29376
  userConnectivity: didInteract
29355
29377
  };
29356
29378
  _context5.p = 1;
29357
29379
  _context5.n = 2;
29358
- return fetcher.post(endpoint, requestBody);
29380
+ return fetcher$1.post(endpoint, requestBody);
29359
29381
  case 2:
29360
29382
  _context5.n = 4;
29361
29383
  break;
@@ -29816,25 +29838,25 @@ var ErrorNotificationProvider = function ErrorNotificationProvider(_ref) {
29816
29838
  }));
29817
29839
  };
29818
29840
 
29819
- var allAreTruthy = all$1(equals$1(true));
29820
- var yardNumberAllowed = function yardNumberAllowed(yardNumber, tile) {
29841
+ var allAreTruthy$1 = all$1(equals$1(true));
29842
+ var yardNumberAllowed$1 = function yardNumberAllowed(yardNumber, tile) {
29821
29843
  var _tile$yardRules, _tile$yardRules$allow, _tile$yardRules2, _tile$yardRules3;
29822
29844
  // Pass if yardNumber is specifically allowed or if it is not specifically denied.
29823
- return (_tile$yardRules = tile.yardRules) !== null && _tile$yardRules !== void 0 && (_tile$yardRules$allow = _tile$yardRules.allow) !== null && _tile$yardRules$allow !== void 0 && _tile$yardRules$allow.length ? includes$1(yardNumber, (_tile$yardRules2 = tile.yardRules) === null || _tile$yardRules2 === void 0 ? void 0 : _tile$yardRules2.allow) : !includes$1(yardNumber, (_tile$yardRules3 = tile.yardRules) === null || _tile$yardRules3 === void 0 ? void 0 : _tile$yardRules3.deny);
29845
+ return (_tile$yardRules = tile.yardRules) !== null && _tile$yardRules !== void 0 && (_tile$yardRules$allow = _tile$yardRules.allow) !== null && _tile$yardRules$allow !== void 0 && _tile$yardRules$allow.length ? includes$2(yardNumber, (_tile$yardRules2 = tile.yardRules) === null || _tile$yardRules2 === void 0 ? void 0 : _tile$yardRules2.allow) : !includes$2(yardNumber, (_tile$yardRules3 = tile.yardRules) === null || _tile$yardRules3 === void 0 ? void 0 : _tile$yardRules3.deny);
29824
29846
  };
29825
- var securityLevelAllowed = function securityLevelAllowed(securityLevel, tile) {
29847
+ var securityLevelAllowed$1 = function securityLevelAllowed(securityLevel, tile) {
29826
29848
  var _tile$securityLevelRu, _tile$securityLevelRu2;
29827
29849
  // Pass if securityLevel is not in not array or if greater than the lessThan array or requireCasAccess is false.
29828
- return (tile === null || tile === void 0 ? void 0 : tile.requireCasAccess) === false || !includes$1(securityLevel, (_tile$securityLevelRu = tile.securityLevelRules) === null || _tile$securityLevelRu === void 0 ? void 0 : _tile$securityLevelRu.not) && ((_tile$securityLevelRu2 = tile.securityLevelRules) === null || _tile$securityLevelRu2 === void 0 ? void 0 : _tile$securityLevelRu2.lessThan) > Number(securityLevel);
29850
+ return (tile === null || tile === void 0 ? void 0 : tile.requireCasAccess) === false || !includes$2(securityLevel, (_tile$securityLevelRu = tile.securityLevelRules) === null || _tile$securityLevelRu === void 0 ? void 0 : _tile$securityLevelRu.not) && ((_tile$securityLevelRu2 = tile.securityLevelRules) === null || _tile$securityLevelRu2 === void 0 ? void 0 : _tile$securityLevelRu2.lessThan) > Number(securityLevel);
29829
29851
  };
29830
- var emailAddressAllowed = function emailAddressAllowed(emailAddress, tile) {
29852
+ var emailAddressAllowed$1 = function emailAddressAllowed(emailAddress, tile) {
29831
29853
  var _tile$userRules, _tile$userRules2;
29832
29854
  // Pass if no emails specified or if email is in allow array.
29833
- return isEmpty$1((_tile$userRules = tile.userRules) === null || _tile$userRules === void 0 ? void 0 : _tile$userRules.allow) || includes$1(emailAddress, (_tile$userRules2 = tile.userRules) === null || _tile$userRules2 === void 0 ? void 0 : _tile$userRules2.allow);
29855
+ return isEmpty$2((_tile$userRules = tile.userRules) === null || _tile$userRules === void 0 ? void 0 : _tile$userRules.allow) || includes$2(emailAddress, (_tile$userRules2 = tile.userRules) === null || _tile$userRules2 === void 0 ? void 0 : _tile$userRules2.allow);
29834
29856
  };
29835
29857
 
29836
29858
  // permissionIds are for selected role only
29837
- var appFunctionIdAllowed = function appFunctionIdAllowed() {
29859
+ var appFunctionIdAllowed$1 = function appFunctionIdAllowed() {
29838
29860
  var _window$toolkitEnv;
29839
29861
  var coreAppPermissions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
29840
29862
  var permissionIds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
@@ -29851,62 +29873,62 @@ var appFunctionIdAllowed = function appFunctionIdAllowed() {
29851
29873
  if (!id) {
29852
29874
  return true; // not defined in config so just allow the tile to be viewed for now
29853
29875
  } else if (stack === 'g') {
29854
- return includes$1(id, permissionIds);
29876
+ return includes$2(id, permissionIds);
29855
29877
  }
29856
29878
  // Check appfunction in opsportal-core permissions
29857
29879
  else {
29858
- return !isEmpty$1(coreAppPermissions) && !isNil$1(coreAppPermissions.find(function (permission) {
29880
+ return !isEmpty$2(coreAppPermissions) && !isNil$2(coreAppPermissions.find(function (permission) {
29859
29881
  return permission.name === id;
29860
29882
  }));
29861
29883
  }
29862
29884
  };
29863
- var stackIsAllowed = function stackIsAllowed(stack) {
29885
+ var stackIsAllowed$1 = function stackIsAllowed(stack) {
29864
29886
  return stack ? stack === global.STACK : true;
29865
29887
  };
29866
29888
 
29867
29889
  // require cas access is a configurable flag per tile
29868
29890
  // while hasAccess is defined at the user level determined by me service
29869
- var casAccessAllowed = function casAccessAllowed(hasCasAccess) {
29891
+ var casAccessAllowed$1 = function casAccessAllowed(hasCasAccess) {
29870
29892
  var requireCasAccess = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
29871
29893
  // this is just a check for usres who are currently logged in
29872
- if (isNil$1(hasCasAccess)) return true;
29894
+ if (isNil$2(hasCasAccess)) return true;
29873
29895
  return requireCasAccess === false || requireCasAccess && hasCasAccess;
29874
29896
  };
29875
- var getUserData = function getUserData() {
29897
+ var getUserData$1 = function getUserData() {
29876
29898
  return {
29877
- activeYardNumber: storage$1.activeYardNumber,
29878
- securityLevel: storage$1.userSecurityLevel,
29879
- emailAddress: storage$1.userEmail,
29880
- permissionIds: storage$1.permissionIds,
29881
- allPermissionIds: storage$1.allPermissionIds,
29882
- hasCasAccess: storage$1.hasCasAccess,
29883
- coreAppPermissions: storage$1.coreAppPermissions,
29884
- appScopes: storage$1.userAppScopes
29899
+ activeYardNumber: storage$2.activeYardNumber,
29900
+ securityLevel: storage$2.userSecurityLevel,
29901
+ emailAddress: storage$2.userEmail,
29902
+ permissionIds: storage$2.permissionIds,
29903
+ allPermissionIds: storage$2.allPermissionIds,
29904
+ hasCasAccess: storage$2.hasCasAccess,
29905
+ coreAppPermissions: storage$2.coreAppPermissions,
29906
+ appScopes: storage$2.userAppScopes
29885
29907
  };
29886
29908
  };
29887
- var userHasChatBotAccess = function userHasChatBotAccess(appFunction) {
29909
+ var userHasChatBotAccess$1 = function userHasChatBotAccess(appFunction) {
29888
29910
  if (!appFunction) return true;
29889
- var coreAppPermissions = storage$1.coreAppPermissions;
29890
- return !isEmpty$1(coreAppPermissions) && !isNil$1(coreAppPermissions.find(function (permission) {
29911
+ var coreAppPermissions = storage$2.coreAppPermissions;
29912
+ return !isEmpty$2(coreAppPermissions) && !isNil$2(coreAppPermissions.find(function (permission) {
29891
29913
  return permission.name === appFunction;
29892
29914
  }));
29893
29915
  };
29894
- var userHasAccess = function userHasAccess(tile) {
29895
- var user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getUserData();
29896
- return allAreTruthy([stackIsAllowed(tile.stack), yardNumberAllowed(user.activeYardNumber, tile), securityLevelAllowed(user.securityLevel, tile), emailAddressAllowed(user.emailAddress, tile), appFunctionIdAllowed(user.coreAppPermissions, user.allPermissionIds, user.permissionIds, user.appScopes, tile), casAccessAllowed(user.hasCasAccess, tile.requireCasAccess)]);
29916
+ var userHasAccess$1 = function userHasAccess(tile) {
29917
+ var user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getUserData$1();
29918
+ return allAreTruthy$1([stackIsAllowed$1(tile.stack), yardNumberAllowed$1(user.activeYardNumber, tile), securityLevelAllowed$1(user.securityLevel, tile), emailAddressAllowed$1(user.emailAddress, tile), appFunctionIdAllowed$1(user.coreAppPermissions, user.allPermissionIds, user.permissionIds, user.appScopes, tile), casAccessAllowed$1(user.hasCasAccess, tile.requireCasAccess)]);
29897
29919
  };
29898
29920
 
29899
- var accessHelpers = /*#__PURE__*/Object.freeze({
29921
+ var accessHelpers$1 = /*#__PURE__*/Object.freeze({
29900
29922
  __proto__: null,
29901
- yardNumberAllowed: yardNumberAllowed,
29902
- securityLevelAllowed: securityLevelAllowed,
29903
- emailAddressAllowed: emailAddressAllowed,
29904
- appFunctionIdAllowed: appFunctionIdAllowed,
29905
- stackIsAllowed: stackIsAllowed,
29906
- casAccessAllowed: casAccessAllowed,
29907
- userHasChatBotAccess: userHasChatBotAccess,
29908
- userHasAccess: userHasAccess,
29909
- 'default': userHasAccess
29923
+ yardNumberAllowed: yardNumberAllowed$1,
29924
+ securityLevelAllowed: securityLevelAllowed$1,
29925
+ emailAddressAllowed: emailAddressAllowed$1,
29926
+ appFunctionIdAllowed: appFunctionIdAllowed$1,
29927
+ stackIsAllowed: stackIsAllowed$1,
29928
+ casAccessAllowed: casAccessAllowed$1,
29929
+ userHasChatBotAccess: userHasChatBotAccess$1,
29930
+ userHasAccess: userHasAccess$1,
29931
+ 'default': userHasAccess$1
29910
29932
  });
29911
29933
 
29912
29934
  var css_248z$5 = ".utilities_ops-app-frame_AppBar_AppBar--AppBar {\r\n background: var(--primaryBlue);\r\n background: var(--primaryBlue);\r\n color: var(--white);\r\n color: var(--white);\r\n height: 64px;\r\n width: 100vw;\r\n padding: 0 20px;\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: space-between;\r\n}\r\n\r\n.__AppBar-item.__AppBar-phoneUnvailable > div, .__AppBar-item.__AppBar-phoneAvailable > div {\r\n margin-bottom: 2px;\r\n}\r\n\r\nbutton[name='Clear Cookies'] {\r\n font-size: 12px;\r\n opacity: 0.5;\r\n text-transform: uppercase;\r\n color: #f00;\r\n font-weight: 700;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBar_AppBar--left {\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.utilities_ops-app-frame_AppBar_AppBar--right {\r\n display: flex;\r\n align-items: center;\r\n}\r\n";
@@ -29918,11 +29940,11 @@ var APP_BAR_CONFIGS = {
29918
29940
  uk: ['flag', 'role', 'yard', 'phone']
29919
29941
  };
29920
29942
 
29921
- var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
29943
+ var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
29922
29944
  var notificationsSource = pathOr$1([], ['notificationsSource'])(coreAppConfig);
29923
29945
  var enableNewToolkitFeatures = coreAppConfig.enableNewToolkitFeatures;
29924
29946
  var getIdeaNoteEnabledStatus = function getIdeaNoteEnabledStatus(tileData) {
29925
- var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
29947
+ var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
29926
29948
  if (isCoreRoute || coreAppConfig.enableIdeaNoteGlobally) {
29927
29949
  return coreAppConfig.enableIdeaNote;
29928
29950
  } else {
@@ -29970,7 +29992,7 @@ var getAvailableStatusFromStatuses = function getAvailableStatusFromStatuses(sta
29970
29992
  var CountryFlag = function CountryFlag() {
29971
29993
  var _storage$activeCountr;
29972
29994
  return /*#__PURE__*/React__default["default"].createElement(Flag, {
29973
- countryCode: (_storage$activeCountr = storage$1.activeCountry) === null || _storage$activeCountr === void 0 ? void 0 : _storage$activeCountr.toLowerCase()
29995
+ countryCode: (_storage$activeCountr = storage$2.activeCountry) === null || _storage$activeCountr === void 0 ? void 0 : _storage$activeCountr.toLowerCase()
29974
29996
  });
29975
29997
  };
29976
29998
  var AppBar = function AppBar(_ref) {
@@ -29985,7 +30007,7 @@ var AppBar = function AppBar(_ref) {
29985
30007
  searchComponent = _ref.searchComponent,
29986
30008
  showNavIconInHeader = _ref.showNavIconInHeader,
29987
30009
  setIsNavBarOpen = _ref.setIsNavBarOpen;
29988
- SETTINGS_ITEMS[0].name = storage$1.userName;
30010
+ SETTINGS_ITEMS[0].name = storage$2.userName;
29989
30011
 
29990
30012
  // Escape hatch for forceUpdate function
29991
30013
  var _useReducer = React.useReducer(function (x) {
@@ -30049,11 +30071,11 @@ var AppBar = function AppBar(_ref) {
30049
30071
  while (1) switch (_context.p = _context.n) {
30050
30072
  case 0:
30051
30073
  _context.p = 0;
30052
- url = (_storage$getLocalItem = storage$1.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.getMihelpCss;
30074
+ url = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.getMihelpCss;
30053
30075
  _context.n = 1;
30054
30076
  return axios.get(url, {
30055
30077
  headers: {
30056
- Authorization: storage$1.accessToken
30078
+ Authorization: storage$2.accessToken
30057
30079
  }
30058
30080
  });
30059
30081
  case 1:
@@ -30093,13 +30115,13 @@ var AppBar = function AppBar(_ref) {
30093
30115
  while (1) switch (_context2.p = _context2.n) {
30094
30116
  case 0:
30095
30117
  _context2.p = 0;
30096
- country = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
30118
+ country = storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
30097
30119
  app = mihelpAppPath || 'g2-portal';
30098
- url = (_storage$getLocalItem2 = storage$1.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.getMihelpLatestRelease;
30120
+ url = (_storage$getLocalItem2 = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.getMihelpLatestRelease;
30099
30121
  _context2.n = 1;
30100
30122
  return axios.get("".concat(url, "?app=").concat(app, "&country=").concat(country), {
30101
30123
  headers: {
30102
- Authorization: storage$1.accessToken
30124
+ Authorization: storage$2.accessToken
30103
30125
  }
30104
30126
  });
30105
30127
  case 1:
@@ -30108,7 +30130,7 @@ var AppBar = function AppBar(_ref) {
30108
30130
  _context2.n = 6;
30109
30131
  break;
30110
30132
  }
30111
- latestReleaseFromStorage = storage$1.getLocalItem("".concat(app, ":latestRelease"));
30133
+ latestReleaseFromStorage = storage$2.getLocalItem("".concat(app, ":latestRelease"));
30112
30134
  hasLatestReleaseInStorage = Boolean(((_latestReleaseFromSto = latestReleaseFromStorage) === null || _latestReleaseFromSto === void 0 ? void 0 : (_latestReleaseFromSto2 = _latestReleaseFromSto.release) === null || _latestReleaseFromSto2 === void 0 ? void 0 : _latestReleaseFromSto2.id) && ((_latestReleaseFromSto3 = latestReleaseFromStorage) === null || _latestReleaseFromSto3 === void 0 ? void 0 : _latestReleaseFromSto3.viewedDate));
30113
30135
  if (hasLatestReleaseInStorage) {
30114
30136
  _context2.n = 5;
@@ -30116,13 +30138,13 @@ var AppBar = function AppBar(_ref) {
30116
30138
  }
30117
30139
  _context2.p = 2;
30118
30140
  _context2.n = 3;
30119
- return fetcher.getUserPreferences("".concat(app, "-latestRelease"), country);
30141
+ return fetcher$1.getUserPreferences("".concat(app, "-latestRelease"), country);
30120
30142
  case 3:
30121
30143
  latestReleaseFromPreferences = _context2.v;
30122
30144
  hasLatestReleaseInPreferences = Boolean((latestReleaseFromPreferences === null || latestReleaseFromPreferences === void 0 ? void 0 : (_latestReleaseFromPre = latestReleaseFromPreferences.release) === null || _latestReleaseFromPre === void 0 ? void 0 : _latestReleaseFromPre.id) && (latestReleaseFromPreferences === null || latestReleaseFromPreferences === void 0 ? void 0 : latestReleaseFromPreferences.viewedDate));
30123
30145
  if (hasLatestReleaseInPreferences) {
30124
30146
  latestReleaseFromStorage = latestReleaseFromPreferences;
30125
- storage$1.setLocalItem("".concat(app, ":latestRelease"), latestReleaseFromStorage);
30147
+ storage$2.setLocalItem("".concat(app, ":latestRelease"), latestReleaseFromStorage);
30126
30148
  }
30127
30149
  _context2.n = 5;
30128
30150
  break;
@@ -30169,8 +30191,8 @@ var AppBar = function AppBar(_ref) {
30169
30191
  viewedDate: new Date()
30170
30192
  };
30171
30193
  app = mihelpAppPath || 'g2-portal';
30172
- countryA3code = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
30173
- storage$1.setLocalItem("".concat(app, ":latestRelease"), releasedata);
30194
+ countryA3code = storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
30195
+ storage$2.setLocalItem("".concat(app, ":latestRelease"), releasedata);
30174
30196
  setLatestRelease(null);
30175
30197
  setShowMihelpTooltip(true);
30176
30198
  setTimeout(function () {
@@ -30178,7 +30200,7 @@ var AppBar = function AppBar(_ref) {
30178
30200
  }, 5000);
30179
30201
  _context3.p = 1;
30180
30202
  _context3.n = 2;
30181
- return fetcher.setUserPreferences("".concat(app, "-latestRelease"), releasedata, countryA3code);
30203
+ return fetcher$1.setUserPreferences("".concat(app, "-latestRelease"), releasedata, countryA3code);
30182
30204
  case 2:
30183
30205
  _context3.n = 4;
30184
30206
  break;
@@ -30223,18 +30245,18 @@ var AppBar = function AppBar(_ref) {
30223
30245
  });
30224
30246
  }
30225
30247
  });
30226
- return storage$1.logout();
30248
+ return storage$2.logout();
30227
30249
  }
30228
30250
  };
30229
30251
  var isIdeaNoteEnabled = getIdeaNoteEnabledStatus(tileData);
30230
30252
  var handleHelpClick = function handleHelpClick() {
30231
- var country = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
30253
+ var country = storage$2.getSessionItem('dashboard', 'selectedCountryA3code');
30232
30254
  var uri = mihelpAppPath ? "".concat(coreAppConfig.mihelpUri, "/applications/").concat(mihelpAppPath, "?re=").concat(country.toLowerCase()) : "".concat(coreAppConfig.mihelpUri, "?re=").concat(country.toLowerCase());
30233
30255
  window.open(uri, '_blank');
30234
30256
  };
30235
30257
  var feedbackConfig = function feedbackConfig() {
30236
30258
  var _storage$coreConfig;
30237
- return (_storage$coreConfig = storage$1.coreConfig) === null || _storage$coreConfig === void 0 ? void 0 : _storage$coreConfig.feedbackDialog;
30259
+ return (_storage$coreConfig = storage$2.coreConfig) === null || _storage$coreConfig === void 0 ? void 0 : _storage$coreConfig.feedbackDialog;
30238
30260
  };
30239
30261
  var navigateTo = function navigateTo(where) {
30240
30262
  return function () {
@@ -30384,7 +30406,7 @@ var AppBar = function AppBar(_ref) {
30384
30406
  });
30385
30407
  setListOfAllNotifications(updatedListOfAllNotifications);
30386
30408
  };
30387
- var selectedYard = (_storage$getSessionIt = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
30409
+ var selectedYard = (_storage$getSessionIt = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt === void 0 ? void 0 : _storage$getSessionIt.selectedYard;
30388
30410
  var handleUserStatusUpdate = /*#__PURE__*/function () {
30389
30411
  var _ref5 = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee4(statusValue) {
30390
30412
  var previousStatus, updatedStatus, _t5;
@@ -30393,14 +30415,14 @@ var AppBar = function AppBar(_ref) {
30393
30415
  case 0:
30394
30416
  previousStatus = currentUserStatus;
30395
30417
  setCurrentUserStatus(statusValue);
30396
- storage$1.setLocalItem('dashboard', statusValue, 'userAvailability');
30418
+ storage$2.setLocalItem('dashboard', statusValue, 'userAvailability');
30397
30419
  _context4.p = 1;
30398
30420
  _context4.n = 2;
30399
30421
  return updateUserStatus(statusValue);
30400
30422
  case 2:
30401
30423
  updatedStatus = _context4.v;
30402
30424
  setCurrentUserStatus(updatedStatus);
30403
- storage$1.setLocalItem('dashboard', updatedStatus, 'userAvailability');
30425
+ storage$2.setLocalItem('dashboard', updatedStatus, 'userAvailability');
30404
30426
  _context4.n = 4;
30405
30427
  break;
30406
30428
  case 3:
@@ -30409,7 +30431,7 @@ var AppBar = function AppBar(_ref) {
30409
30431
  console.error('Failed to update user status:', _t5);
30410
30432
  showError('Failed to update user status.');
30411
30433
  setCurrentUserStatus(previousStatus);
30412
- storage$1.setLocalItem('dashboard', previousStatus, 'userAvailability');
30434
+ storage$2.setLocalItem('dashboard', previousStatus, 'userAvailability');
30413
30435
  case 4:
30414
30436
  return _context4.a(2);
30415
30437
  }
@@ -30421,7 +30443,7 @@ var AppBar = function AppBar(_ref) {
30421
30443
  }();
30422
30444
  var updateUserStatusFromWebSocket = function updateUserStatusFromWebSocket(newStatus) {
30423
30445
  setCurrentUserStatus(newStatus);
30424
- storage$1.setLocalItem('dashboard', newStatus, 'userAvailability');
30446
+ storage$2.setLocalItem('dashboard', newStatus, 'userAvailability');
30425
30447
  };
30426
30448
  React.useEffect(function () {
30427
30449
  if (isSystemMarkedOffline(currentUserStatus) && !isUserStatusHidden()) {
@@ -30496,6 +30518,7 @@ var AppBar = function AppBar(_ref) {
30496
30518
  document.removeEventListener('visibilitychange', handleVisibilityChange);
30497
30519
  };
30498
30520
  }, [socketClient]);
30521
+ var notificationsReloadPathKey = pathname === '/embedded' || pathname && pathname.startsWith('/embedded/') ? pathname : '__non_embedded__';
30499
30522
  React.useEffect(function () {
30500
30523
  setNotifications([]);
30501
30524
  setListOfAllNotifications([]);
@@ -30522,7 +30545,7 @@ var AppBar = function AppBar(_ref) {
30522
30545
  });
30523
30546
  var tileConfigAccess = true;
30524
30547
  if (currentTile) {
30525
- tileConfigAccess = userHasAccess(currentTile);
30548
+ tileConfigAccess = userHasAccess$1(currentTile);
30526
30549
  }
30527
30550
  if (history.location.pathname !== '/logout' && history.location.pathname !== '/login' && localStorage.getItem('login') && tileConfigAccess) {
30528
30551
  if (notificationsSource.includes('Nchan')) {
@@ -30593,14 +30616,14 @@ var AppBar = function AppBar(_ref) {
30593
30616
  break;
30594
30617
  }
30595
30618
  setCurrentUserStatus(finalStatus);
30596
- storage$1.setLocalItem('dashboard', finalStatus, 'userAvailability');
30619
+ storage$2.setLocalItem('dashboard', finalStatus, 'userAvailability');
30597
30620
  _context5.p = 4;
30598
30621
  _context5.n = 5;
30599
30622
  return updateUserStatus(finalStatus);
30600
30623
  case 5:
30601
30624
  updatedStatus = _context5.v;
30602
30625
  setCurrentUserStatus(updatedStatus);
30603
- storage$1.setLocalItem('dashboard', updatedStatus, 'userAvailability');
30626
+ storage$2.setLocalItem('dashboard', updatedStatus, 'userAvailability');
30604
30627
  _context5.n = 7;
30605
30628
  break;
30606
30629
  case 6:
@@ -30613,7 +30636,7 @@ var AppBar = function AppBar(_ref) {
30613
30636
  break;
30614
30637
  case 8:
30615
30638
  setCurrentUserStatus(finalStatus);
30616
- storage$1.setLocalItem('dashboard', finalStatus, 'userAvailability');
30639
+ storage$2.setLocalItem('dashboard', finalStatus, 'userAvailability');
30617
30640
  case 9:
30618
30641
  _context5.n = 11;
30619
30642
  break;
@@ -30640,7 +30663,7 @@ var AppBar = function AppBar(_ref) {
30640
30663
  }
30641
30664
  }
30642
30665
  }
30643
- }, [selectedYard, pathname]);
30666
+ }, [selectedYard, notificationsReloadPathKey]);
30644
30667
  React.useEffect(function () {
30645
30668
  var interval = setInterval(function () {
30646
30669
  var allNotifications = listOfAllNotificationsRef.current;
@@ -30671,6 +30694,7 @@ var AppBar = function AppBar(_ref) {
30671
30694
  };
30672
30695
  }, []);
30673
30696
  React.useEffect(function () {
30697
+ if (coreAppConfig !== null && coreAppConfig !== void 0 && coreAppConfig.disableHeartbeat) return;
30674
30698
  var heartBeatEnabledStatuses = ((coreAppConfig === null || coreAppConfig === void 0 ? void 0 : coreAppConfig.heartBeatEnabledStatuses) || ['available']).map(function (s) {
30675
30699
  var _s$toLowerCase2;
30676
30700
  return (s === null || s === void 0 ? void 0 : (_s$toLowerCase2 = s.toLowerCase) === null || _s$toLowerCase2 === void 0 ? void 0 : _s$toLowerCase2.call(s)) || '';
@@ -30681,7 +30705,7 @@ var AppBar = function AppBar(_ref) {
30681
30705
  var MIN_INTERACTION_MS = 10000;
30682
30706
  var heartBeatIntervalMs = Math.max((parseInt(coreAppConfig === null || coreAppConfig === void 0 ? void 0 : coreAppConfig.heartBeatInterval, 10) || 30) * 1000, MIN_HEARTBEAT_MS);
30683
30707
  var userInteractionIntervalMs = Math.max((parseInt(coreAppConfig === null || coreAppConfig === void 0 ? void 0 : coreAppConfig.userInteractionInterval, 10) || 60) * 1000, MIN_INTERACTION_MS);
30684
- var userKey = storage$1.userEmail || '';
30708
+ var userKey = storage$2.userEmail || '';
30685
30709
  var updateLastInteractionTime = function updateLastInteractionTime() {
30686
30710
  recordUserInteraction(userKey);
30687
30711
  };
@@ -30720,8 +30744,8 @@ var AppBar = function AppBar(_ref) {
30720
30744
  var STACK = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.STACK ? window.toolkitEnv.STACK : process.env.STACK;
30721
30745
  STACK = STACK || 'c';
30722
30746
  var modifiedSettings = SETTINGS_ITEMS;
30723
- modifiedSettings[0]['name'] = storage$1.userName;
30724
- var _storage$chromePlugin = storage$1.chromePluginData.ringcentral,
30747
+ modifiedSettings[0]['name'] = storage$2.userName;
30748
+ var _storage$chromePlugin = storage$2.chromePluginData.ringcentral,
30725
30749
  ringcentral = _storage$chromePlugin === void 0 ? {
30726
30750
  phoneStatus: '',
30727
30751
  phoneStatusProcessing: false
@@ -30736,25 +30760,25 @@ var AppBar = function AppBar(_ref) {
30736
30760
  setNotificationHeightFlag: setNotificationHeightFlag
30737
30761
  }), /*#__PURE__*/React__default["default"].createElement(AppBar$1, {
30738
30762
  moduleName: "OPS PORTAL",
30739
- isLoggedOn: storage$1.isAuthenticated,
30763
+ isLoggedOn: storage$2.isAuthenticated,
30740
30764
  config: APP_BAR_CONFIGS[STACK],
30741
- role: storage$1.userRole,
30765
+ role: storage$2.userRole,
30742
30766
  navigateTo: navigateTo,
30743
- phoneNumber: storage$1.phoneNumber,
30744
- userEmail: storage$1.userEmail,
30745
- language: storage$1.activeLanguage,
30767
+ phoneNumber: storage$2.phoneNumber,
30768
+ userEmail: storage$2.userEmail,
30769
+ language: storage$2.activeLanguage,
30746
30770
  showSearchBar: false,
30747
- homeYard: (_storage$getSessionIt2 = storage$1.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.homeYard,
30771
+ homeYard: (_storage$getSessionIt2 = storage$2.getSessionItem('dashboard')) === null || _storage$getSessionIt2 === void 0 ? void 0 : _storage$getSessionIt2.homeYard,
30748
30772
  logoutItems: modifiedSettings,
30749
- countryCode: storage$1.activeCountry,
30750
- yardNumber: storage$1.activeYardNumber,
30773
+ countryCode: storage$2.activeCountry,
30774
+ yardNumber: storage$2.activeYardNumber,
30751
30775
  onRenderFlag: CountryFlag,
30752
30776
  onLogoutItemClicked: handleSettingsItemClick,
30753
30777
  handleHelpClick: handleHelpClick,
30754
30778
  isMihelpEnabled: isMihelpEnabled,
30755
30779
  isIdeaNoteEnabled: isIdeaNoteEnabled,
30756
- sendFeedback: fetcher.sendFeedback,
30757
- getInnovationHubToken: fetcher.getInnovationHubToken,
30780
+ sendFeedback: fetcher$1.sendFeedback,
30781
+ getInnovationHubToken: fetcher$1.getInnovationHubToken,
30758
30782
  feedbackConfig: feedbackConfig(),
30759
30783
  stack: STACK,
30760
30784
  phoneStatusObject: ringcentral,
@@ -30852,10 +30876,10 @@ var AuthGuard = /*#__PURE__*/function (_React$PureComponent) {
30852
30876
  case 1:
30853
30877
  // If user is NOT authenticated and route is not login/logout, always deny
30854
30878
  // and re-route to "/login".
30855
- if (!storage$1.isAuthenticated) {
30856
- if (isLogoutRoute) storage$1.clear();
30879
+ if (!storage$2.isAuthenticated) {
30880
+ if (isLogoutRoute) storage$2.clear();
30857
30881
  // Store current URL to redirect to after login
30858
- storage$1.setSessionItem('redirectUrl', window.location.href);
30882
+ storage$2.setSessionItem('redirectUrl', window.location.href);
30859
30883
  this.denyAccess(FAILED_AUTHENTICATION_CHECK_REASON);
30860
30884
  window.location.assign('/login');
30861
30885
  }
@@ -30881,7 +30905,7 @@ var AuthGuard = /*#__PURE__*/function (_React$PureComponent) {
30881
30905
  return _context.a(2, this.allowAccess(PASS_BECAUSE_RESTRICTIONS_DISABLED));
30882
30906
  case 3:
30883
30907
  _context.n = 4;
30884
- return fetcher.getAppTileData();
30908
+ return fetcher$1.getAppTileData();
30885
30909
  case 4:
30886
30910
  appTile = _context.v;
30887
30911
  if (appTile) {
@@ -30894,7 +30918,7 @@ var AuthGuard = /*#__PURE__*/function (_React$PureComponent) {
30894
30918
  break;
30895
30919
  }
30896
30920
  _context.n = 5;
30897
- return fetcher.getPermissions(appAuthName);
30921
+ return fetcher$1.getPermissions(appAuthName);
30898
30922
  case 5:
30899
30923
  return _context.a(2, this.allowAccess(PATH_NOT_FOUND));
30900
30924
  case 6:
@@ -30909,17 +30933,17 @@ var AuthGuard = /*#__PURE__*/function (_React$PureComponent) {
30909
30933
  break;
30910
30934
  }
30911
30935
  _context.n = 7;
30912
- return fetcher.getCoreAppPermissions();
30936
+ return fetcher$1.getCoreAppPermissions();
30913
30937
  case 7:
30914
30938
  if (!appTile.appAuthName) {
30915
30939
  _context.n = 8;
30916
30940
  break;
30917
30941
  }
30918
30942
  _context.n = 8;
30919
- return fetcher.getPermissions(appTile.appAuthName, appTile.useAppScopes);
30943
+ return fetcher$1.getPermissions(appTile.appAuthName, appTile.useAppScopes);
30920
30944
  case 8:
30921
30945
  // If there are rules, evaluate and act accordingly.
30922
- tileConfigAccess = userHasAccess(appTile);
30946
+ tileConfigAccess = userHasAccess$1(appTile);
30923
30947
  if (tileConfigAccess) {
30924
30948
  this.allowAccess('Tile restrictions passed.');
30925
30949
  } else {
@@ -52410,12 +52434,12 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52410
52434
  }
52411
52435
  };
52412
52436
  React.useEffect(function () {
52413
- var conversationsFromSession = storage$1.getLocalItem('mihelpAgentConversations');
52414
- var conversationsToBeSaved = !isEmpty$1(conversationsFromSession) ? conversationsFromSession : [];
52437
+ var conversationsFromSession = storage$2.getLocalItem('mihelpAgentConversations');
52438
+ var conversationsToBeSaved = !isEmpty$2(conversationsFromSession) ? conversationsFromSession : [];
52415
52439
  setConversations(conversationsToBeSaved);
52416
- var feedbacksFromSession = storage$1.getLocalItem('mihelpAgentFeedbacks');
52417
- var lastSentApp = storage$1.getLocalItem('mihelpAgentLastSentApp');
52418
- var feedbacksToBeSaved = !isEmpty$1(feedbacksFromSession) ? feedbacksFromSession : {};
52440
+ var feedbacksFromSession = storage$2.getLocalItem('mihelpAgentFeedbacks');
52441
+ var lastSentApp = storage$2.getLocalItem('mihelpAgentLastSentApp');
52442
+ var feedbacksToBeSaved = !isEmpty$2(feedbacksFromSession) ? feedbacksFromSession : {};
52419
52443
  setFeedbacks(feedbacksToBeSaved);
52420
52444
  setLastSentFromApp(lastSentApp);
52421
52445
  if (conversationsToBeSaved.length) {
@@ -52438,7 +52462,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52438
52462
  var handleStorageChange = function handleStorageChange(event) {
52439
52463
  if (event.key === 'mihelpAgentConversations') {
52440
52464
  var conversationsFromSession = JSON.parse(event.newValue);
52441
- var conversationsToBeSaved = !isEmpty$1(conversationsFromSession) ? conversationsFromSession : [];
52465
+ var conversationsToBeSaved = !isEmpty$2(conversationsFromSession) ? conversationsFromSession : [];
52442
52466
  setConversations(conversationsToBeSaved);
52443
52467
  if (conversationsToBeSaved.length) {
52444
52468
  saveCurrentContext(conversationsToBeSaved);
@@ -52448,7 +52472,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52448
52472
  }
52449
52473
  if (event.key === 'mihelpAgentFeedbacks') {
52450
52474
  var feedbacksFromSession = JSON.parse(event.newValue);
52451
- var feedbacksToBeSaved = !isEmpty$1(feedbacksFromSession) ? feedbacksFromSession : {};
52475
+ var feedbacksToBeSaved = !isEmpty$2(feedbacksFromSession) ? feedbacksFromSession : {};
52452
52476
  setFeedbacks(feedbacksToBeSaved);
52453
52477
  }
52454
52478
  if (event.key === 'mihelpAgentLastSentApp') {
@@ -52472,8 +52496,8 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52472
52496
  var getSystemPrompt = function getSystemPrompt(prompt) {
52473
52497
  var context = {};
52474
52498
  try {
52475
- if (storage$1.appContext) {
52476
- context = storage$1.appContext;
52499
+ if (storage$2.appContext) {
52500
+ context = storage$2.appContext;
52477
52501
  }
52478
52502
  } catch (e) {
52479
52503
  console.log('App context error');
@@ -52501,7 +52525,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52501
52525
  _context.p = 1;
52502
52526
  newMessages = _toConsumableArray(sanitizeMessages(messages));
52503
52527
  isCoreApp = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
52504
- appTiles = storage$1.getLocalItem('opsportal-core:config').tiles || [];
52528
+ appTiles = storage$2.getLocalItem('opsportal-core:config').tiles || [];
52505
52529
  appName = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.APP_NAME ? window.toolkitEnv.APP_NAME : process.env.APP_NAME;
52506
52530
  appData = appTiles.find(function (tile) {
52507
52531
  if (tile.appName) {
@@ -52528,11 +52552,11 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52528
52552
  content: getSystemPrompt(systemPrompt)
52529
52553
  });
52530
52554
  }
52531
- if (storage$1.appContext) {
52532
- setCurrentContext(storage$1.appContext);
52555
+ if (storage$2.appContext) {
52556
+ setCurrentContext(storage$2.appContext);
52533
52557
  }
52534
- } else if (!equals$1(currentContext, storage$1.appContext) || lastSentFromApp !== currentAppName) {
52535
- setCurrentContext(storage$1.appContext);
52558
+ } else if (!equals$1(currentContext, storage$2.appContext) || lastSentFromApp !== currentAppName) {
52559
+ setCurrentContext(storage$2.appContext);
52536
52560
  newMessages.splice(newMessages.length - 1, 0, {
52537
52561
  role: 'system',
52538
52562
  content: getSystemPrompt(systemPrompt)
@@ -52558,11 +52582,11 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52558
52582
  app_name: currentAppName,
52559
52583
  k: contextChunks,
52560
52584
  top_n: contextTopMessagesCount,
52561
- user_email: storage$1.userEmail
52585
+ user_email: storage$2.userEmail
52562
52586
  };
52563
- endpoint = (_storage$getLocalItem = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.mihelpChat;
52587
+ endpoint = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : (_storage$getLocalItem2 = _storage$getLocalItem.endpoints) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.mihelpChat;
52564
52588
  _context.n = 2;
52565
- return fetcher.post(endpoint, payload, {
52589
+ return fetcher$1.post(endpoint, payload, {
52566
52590
  headers: {
52567
52591
  'Content-Type': 'application/json'
52568
52592
  }
@@ -52578,8 +52602,8 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52578
52602
  id: nonSecure()
52579
52603
  }]);
52580
52604
  setConversations(newConversations);
52581
- storage$1.setLocalItem('mihelpAgentConversations', newConversations);
52582
- storage$1.setLocalItem('mihelpAgentLastSentApp', currentAppName);
52605
+ storage$2.setLocalItem('mihelpAgentConversations', newConversations);
52606
+ storage$2.setLocalItem('mihelpAgentLastSentApp', currentAppName);
52583
52607
  _context.n = 5;
52584
52608
  break;
52585
52609
  case 3:
@@ -52668,9 +52692,9 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52668
52692
  }, [quickReplies]);
52669
52693
  var handleNewConversation = function handleNewConversation() {
52670
52694
  setConversations([]);
52671
- storage$1.setLocalItem('mihelpAgentConversations', []);
52672
- storage$1.setLocalItem('mihelpAgentFeedbacks', {});
52673
- storage$1.setLocalItem('mihelpAgentLastSentApp', '');
52695
+ storage$2.setLocalItem('mihelpAgentConversations', []);
52696
+ storage$2.setLocalItem('mihelpAgentFeedbacks', {});
52697
+ storage$2.setLocalItem('mihelpAgentLastSentApp', '');
52674
52698
  setMessageError(false);
52675
52699
  setCurrentContext(null);
52676
52700
  };
@@ -52760,7 +52784,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52760
52784
  payload = {
52761
52785
  feedback: feedback
52762
52786
  };
52763
- feedbackEndpoint = (_storage$getLocalItem3 = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem3 === void 0 ? void 0 : (_storage$getLocalItem4 = _storage$getLocalItem3.endpoints) === null || _storage$getLocalItem4 === void 0 ? void 0 : _storage$getLocalItem4.mihelpChatFeedback;
52787
+ feedbackEndpoint = (_storage$getLocalItem3 = storage$2.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem3 === void 0 ? void 0 : (_storage$getLocalItem4 = _storage$getLocalItem3.endpoints) === null || _storage$getLocalItem4 === void 0 ? void 0 : _storage$getLocalItem4.mihelpChatFeedback;
52764
52788
  if (feedbackEndpoint) {
52765
52789
  _context3.n = 1;
52766
52790
  break;
@@ -52773,7 +52797,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52773
52797
  setIsFeedbackLoading(true);
52774
52798
  _context3.p = 2;
52775
52799
  _context3.n = 3;
52776
- return fetcher.put(endpoint, payload, {
52800
+ return fetcher$1.put(endpoint, payload, {
52777
52801
  headers: {
52778
52802
  'Content-Type': 'application/json'
52779
52803
  }
@@ -52785,7 +52809,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52785
52809
  }) : conversation;
52786
52810
  });
52787
52811
  setConversations(newConversations);
52788
- storage$1.setLocalItem('mihelpAgentConversations', newConversations);
52812
+ storage$2.setLocalItem('mihelpAgentConversations', newConversations);
52789
52813
  _context3.n = 5;
52790
52814
  break;
52791
52815
  case 4:
@@ -52844,9 +52868,9 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52844
52868
  chat_history: chatHistoryWithoutSystemPrompts,
52845
52869
  retrieved_documents: Currentconversation === null || Currentconversation === void 0 ? void 0 : Currentconversation.retrievedDocuments,
52846
52870
  timestamp: new Date().toISOString(),
52847
- user_email: storage$1.userEmail
52871
+ user_email: storage$2.userEmail
52848
52872
  };
52849
- endpoint = (_storage$getLocalItem5 = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem5 === void 0 ? void 0 : (_storage$getLocalItem6 = _storage$getLocalItem5.endpoints) === null || _storage$getLocalItem6 === void 0 ? void 0 : _storage$getLocalItem6.mihelpChatFeedback;
52873
+ endpoint = (_storage$getLocalItem5 = storage$2.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem5 === void 0 ? void 0 : (_storage$getLocalItem6 = _storage$getLocalItem5.endpoints) === null || _storage$getLocalItem6 === void 0 ? void 0 : _storage$getLocalItem6.mihelpChatFeedback;
52850
52874
  if (endpoint) {
52851
52875
  _context4.n = 3;
52852
52876
  break;
@@ -52858,7 +52882,7 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52858
52882
  setIsFeedbackLoading(true);
52859
52883
  _context4.p = 4;
52860
52884
  _context4.n = 5;
52861
- return fetcher.post(endpoint, payload, {
52885
+ return fetcher$1.post(endpoint, payload, {
52862
52886
  headers: {
52863
52887
  'Content-Type': 'application/json'
52864
52888
  }
@@ -52875,8 +52899,8 @@ var MiHelpAgent = function MiHelpAgent(_ref) {
52875
52899
  newFeedbacks = _objectSpread2(_objectSpread2({}, feedbacks), {}, _defineProperty$2({}, Currentconversation === null || Currentconversation === void 0 ? void 0 : Currentconversation.id, chatHistoryWithoutSystemPrompts));
52876
52900
  setFeedbacks(newFeedbacks);
52877
52901
  setConversations(newConversations);
52878
- storage$1.setLocalItem('mihelpAgentConversations', newConversations);
52879
- storage$1.setLocalItem('mihelpAgentFeedbacks', newFeedbacks);
52902
+ storage$2.setLocalItem('mihelpAgentConversations', newConversations);
52903
+ storage$2.setLocalItem('mihelpAgentFeedbacks', newFeedbacks);
52880
52904
  _context4.n = 7;
52881
52905
  break;
52882
52906
  case 6:
@@ -63546,7 +63570,7 @@ var velocityReact = {
63546
63570
 
63547
63571
  var unitlist = ["", "K", "M", "T"];
63548
63572
  var formatNumber = function formatNumber(number) {
63549
- if (isNil$1(number)) return '';
63573
+ if (isNil$2(number)) return '';
63550
63574
  var sign = Math.sign(number);
63551
63575
  var unit = 0;
63552
63576
  while (Math.abs(number) > 1000) {
@@ -63683,7 +63707,8 @@ var NavigationBar = function NavigationBar(_ref2) {
63683
63707
  showNavIconInHeader = _ref2.showNavIconInHeader,
63684
63708
  isNavBarOpen = _ref2.isNavBarOpen,
63685
63709
  _ref2$showLevel3Navig = _ref2.showLevel3Navigation,
63686
- showLevel3Navigation = _ref2$showLevel3Navig === void 0 ? false : _ref2$showLevel3Navig;
63710
+ showLevel3Navigation = _ref2$showLevel3Navig === void 0 ? false : _ref2$showLevel3Navig,
63711
+ basePath = _ref2.basePath;
63687
63712
  // const withCounts = getCounts && typeof getCounts === 'function'
63688
63713
  var navigateFunction = navigateTo || (history === null || history === void 0 ? void 0 : history.push) || defaultRedirect;
63689
63714
  var _useState = React.useState(null),
@@ -63765,7 +63790,8 @@ var NavigationBar = function NavigationBar(_ref2) {
63765
63790
  countsRef: countsRef,
63766
63791
  countAutoReloadDisabled: countAutoReloadDisabled,
63767
63792
  onNavSectionToggle: onNavSectionToggle,
63768
- showLevel3Navigation: showLevel3Navigation
63793
+ showLevel3Navigation: showLevel3Navigation,
63794
+ basePath: basePath
63769
63795
  }) : null, isConfigValid === false ? /*#__PURE__*/React__default["default"].createElement("div", null, "Please check your navigation config") : null);
63770
63796
  };
63771
63797
  var NavigationMenu = function NavigationMenu(_ref3) {
@@ -63786,8 +63812,10 @@ var NavigationMenu = function NavigationMenu(_ref3) {
63786
63812
  countAutoReloadDisabled = _ref3.countAutoReloadDisabled,
63787
63813
  onNavSectionToggle = _ref3.onNavSectionToggle,
63788
63814
  _ref3$showLevel3Navig = _ref3.showLevel3Navigation,
63789
- showLevel3Navigation = _ref3$showLevel3Navig === void 0 ? false : _ref3$showLevel3Navig;
63790
- var redirectUrl = window.location.pathname;
63815
+ showLevel3Navigation = _ref3$showLevel3Navig === void 0 ? false : _ref3$showLevel3Navig,
63816
+ basePath = _ref3.basePath;
63817
+ var rawUrl = window.location.pathname;
63818
+ var redirectUrl = basePath && rawUrl.startsWith(basePath) ? rawUrl.slice(basePath.length) || '/' : rawUrl;
63791
63819
  var _useState11 = React.useState(null),
63792
63820
  _useState12 = _slicedToArray(_useState11, 2),
63793
63821
  counts = _useState12[0],
@@ -63796,7 +63824,7 @@ var NavigationMenu = function NavigationMenu(_ref3) {
63796
63824
  React.useEffect(function () {
63797
63825
  if (redirectUrl != '/') {
63798
63826
  var splitUrl = redirectUrl.split('/');
63799
- if (!process.env.IS_CORE_APP) {
63827
+ if (!process.env.IS_CORE_APP && !basePath) {
63800
63828
  splitUrl.shift();
63801
63829
  }
63802
63830
  // if (splitUrl.length - 1 === configDepth) {
@@ -63832,7 +63860,7 @@ var NavigationMenu = function NavigationMenu(_ref3) {
63832
63860
  var reloadCounts = function reloadCounts(menuItemName, setCountsLoading) {
63833
63861
  getCounts(menuItemName).then(function (result) {
63834
63862
  setCounts(result);
63835
- setWithCounts(!isEmpty$1(result));
63863
+ setWithCounts(!isEmpty$2(result));
63836
63864
  if (setCountsLoading) setCountsLoading(false);
63837
63865
  }).catch(function () {
63838
63866
  if (setCountsLoading) setCountsLoading(false);
@@ -64385,7 +64413,7 @@ var NavigationMenuLevel3 = function NavigationMenuLevel3(_ref6) {
64385
64413
  className: "utilities_ops-app-frame_NavigationBar_NavigationBar--expandButton"
64386
64414
  }, /*#__PURE__*/React__default["default"].createElement(coreComponents.IconV2, {
64387
64415
  name: isMenuExpanded ? 'chevron-up' : 'chevron-down'
64388
- })), (countsLoading || !isNil$1(countText)) && /*#__PURE__*/React__default["default"].createElement("div", {
64416
+ })), (countsLoading || !isNil$2(countText)) && /*#__PURE__*/React__default["default"].createElement("div", {
64389
64417
  className: "utilities_ops-app-frame_NavigationBar_NavigationBar--NavItemCount"
64390
64418
  }, countsLoading ? /*#__PURE__*/React__default["default"].createElement(coreComponents.Spinner, {
64391
64419
  size: "xxs"
@@ -64395,9 +64423,9 @@ var NavigationMenuLevel3 = function NavigationMenuLevel3(_ref6) {
64395
64423
  var css_248z$1 = ".utilities_ops-app-frame_AppFrame_AppFrame--AppFrame {\r\n background: var(--paleGray);\r\n background: var(--paleGray);\r\n height: 100vh;\r\n max-height: 100vh;\r\n height: 100dvh;\r\n max-height: 100dvh;\r\n display: flex;\r\n flex-direction: column;\r\n flex-basis: 0;\r\n /* padding-top: env(safe-area-inset-top, 0px); */\r\n /* position: sticky;\r\n top: 0; */\r\n}\r\n\r\n.utilities_ops-app-frame_AppFrame_AppFrame--header {\r\n flex: 0 1 auto;\r\n display: flex;\r\n flex-direction: column;\r\n /* padding-top: env(safe-area-inset-top, 0px); */\r\n /* position: sticky;\r\n top: 0; */\r\n}\r\n\r\n/* Wrapper that contains the app being developed. */\r\n\r\n.utilities_ops-app-frame_AppFrame_AppFrame--AppContainer {\r\n flex: 1 1 auto;\r\n position: relative;\r\n min-height: 0;\r\n}\r\n";
64396
64424
  styleInject(css_248z$1);
64397
64425
 
64398
- if (!storage$1.activeYardNumber) {
64399
- var lastSelectedYard = storage$1.getLocalItem('lastSelectedYard');
64400
- var dashboardLocalItem = storage$1.getLocalItem('dashboard');
64426
+ if (!storage$2.activeYardNumber) {
64427
+ var lastSelectedYard = storage$2.getLocalItem('lastSelectedYard');
64428
+ var dashboardLocalItem = storage$2.getLocalItem('dashboard');
64401
64429
  var dashboardSessionItem = {};
64402
64430
  if (!equals$1(lastSelectedYard, {})) {
64403
64431
  dashboardSessionItem = {
@@ -64453,28 +64481,28 @@ var AppFrame = function AppFrame(props) {
64453
64481
  isNavBarOpen = _useState10[0],
64454
64482
  setIsNavBarOpen = _useState10[1];
64455
64483
  var setChatBotEnableStatus = function setChatBotEnableStatus() {
64456
- var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
64484
+ var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
64457
64485
  var tileData = findAppData(coreAppConfig === null || coreAppConfig === void 0 ? void 0 : coreAppConfig.tiles, coreAppConfig === null || coreAppConfig === void 0 ? void 0 : coreAppConfig.tileOverrides) || {};
64458
64486
  var _ref = coreAppConfig || {},
64459
64487
  enableChatBot = _ref.enableChatBot,
64460
64488
  chatBotAppFunctionId = _ref.chatBotAppFunctionId;
64461
64489
  var isCoreRoute = ['settings', 'home', 'webChat', 'embedded', ''].includes(getRouteName());
64462
- var hasChatBotAccess = userHasChatBotAccess(chatBotAppFunctionId);
64490
+ var hasChatBotAccess = userHasChatBotAccess$1(chatBotAppFunctionId);
64463
64491
  var chatBotEnabled = isCoreRoute && !window.location.pathname.includes('embedded') ? enableChatBot && hasChatBotAccess : (tileData === null || tileData === void 0 ? void 0 : tileData.enableChatBot) && hasChatBotAccess;
64464
64492
  setChatBotEnabled(chatBotEnabled);
64465
64493
  chatBotEnabledRef.current = chatBotEnabled;
64466
64494
  };
64467
64495
  React.useEffect(function () {
64468
64496
  // Check if config and permissions are loaded, start polling if not
64469
- var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
64470
- var coreAppPermissions = storage$1.coreAppPermissions;
64497
+ var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
64498
+ var coreAppPermissions = storage$2.coreAppPermissions;
64471
64499
  var isConfigLoaded = coreAppConfig && Object.keys(coreAppConfig).length > 0;
64472
64500
  var isPermissionsLoaded = coreAppPermissions && Array.isArray(coreAppPermissions) && coreAppPermissions.length >= 0;
64473
64501
  if (!isConfigLoaded || !isPermissionsLoaded) {
64474
64502
  // Poll for config and permissions until both are available
64475
64503
  var pollInterval = setInterval(function () {
64476
- var config = storage$1.getLocalItem('opsportal-core:config');
64477
- var permissions = storage$1.coreAppPermissions;
64504
+ var config = storage$2.getLocalItem('opsportal-core:config');
64505
+ var permissions = storage$2.coreAppPermissions;
64478
64506
  var configLoaded = config && Object.keys(config).length > 0;
64479
64507
  var permissionsLoaded = permissions && Array.isArray(permissions) && permissions.length >= 0;
64480
64508
  if (configLoaded && permissionsLoaded) {
@@ -64486,8 +64514,8 @@ var AppFrame = function AppFrame(props) {
64486
64514
  // Stop polling after 5 seconds
64487
64515
  var timeoutId = setTimeout(function () {
64488
64516
  clearInterval(pollInterval);
64489
- var finalConfig = storage$1.getLocalItem('opsportal-core:config');
64490
- var finalPermissions = storage$1.coreAppPermissions;
64517
+ var finalConfig = storage$2.getLocalItem('opsportal-core:config');
64518
+ var finalPermissions = storage$2.coreAppPermissions;
64491
64519
  var configLoaded = finalConfig && Object.keys(finalConfig).length > 0;
64492
64520
  var permissionsLoaded = finalPermissions && Array.isArray(finalPermissions) && finalPermissions.length >= 0;
64493
64521
  if (configLoaded && permissionsLoaded) {
@@ -64572,7 +64600,7 @@ var AppFrame = function AppFrame(props) {
64572
64600
  setIsNavBarOpen: setIsNavBarOpen
64573
64601
  })), /*#__PURE__*/React__default["default"].createElement("main", {
64574
64602
  className: "utilities_ops-app-frame_AppFrame_AppFrame--AppContainer"
64575
- }, props.showNavigation && storage$1.isAuthenticated ? /*#__PURE__*/React__default["default"].createElement(NavigationBar, {
64603
+ }, props.showNavigation && storage$2.isAuthenticated ? /*#__PURE__*/React__default["default"].createElement(NavigationBar, {
64576
64604
  navigateTo: props.navigateTo,
64577
64605
  history: props.history,
64578
64606
  navItems: props.navItems
@@ -64588,7 +64616,8 @@ var AppFrame = function AppFrame(props) {
64588
64616
  onNavSectionToggle: props.onNavSectionToggle,
64589
64617
  showNavIconInHeader: props === null || props === void 0 ? void 0 : props.showNavIconInHeader,
64590
64618
  isNavBarOpen: isNavBarOpen,
64591
- showLevel3Navigation: props.showLevel3Navigation
64619
+ showLevel3Navigation: props.showLevel3Navigation,
64620
+ basePath: props.navBasePath
64592
64621
  }) : null, /*#__PURE__*/React__default["default"].createElement("div", {
64593
64622
  style: {
64594
64623
  marginLeft: props.showNavigation && !(props !== null && props !== void 0 && props.showNavIconInHeader) ? navigationWidth : '0px',
@@ -64620,9 +64649,9 @@ var logOutboundCalls = /*#__PURE__*/function () {
64620
64649
  return _regenerator().w(function (_context) {
64621
64650
  while (1) switch (_context.n) {
64622
64651
  case 0:
64623
- url = (_storage$getLocalItem = storage$1.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.logOutboundCalls;
64652
+ url = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.logOutboundCalls;
64624
64653
  _context.n = 1;
64625
- return fetcher.post(url, data, {
64654
+ return fetcher$1.post(url, data, {
64626
64655
  headers: {
64627
64656
  'Content-Type': 'application/json'
64628
64657
  }
@@ -64817,11 +64846,11 @@ function Snippet(_ref) {
64817
64846
  window.open(article === null || article === void 0 ? void 0 : (_article$linkedArticl = article.linkedArticle) === null || _article$linkedArticl === void 0 ? void 0 : _article$linkedArticl.url, '_blank');
64818
64847
  };
64819
64848
  var openEditPage = function openEditPage() {
64820
- var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
64849
+ var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
64821
64850
  window.open("".concat(coreAppConfig.mihelpUri, "/wp-admin/post.php?post=").concat(article.id, "&action=edit"), '_blank');
64822
64851
  };
64823
64852
  var canEdit = function canEdit() {
64824
- return storage$1.coreAppPermissions.some(function (permission) {
64853
+ return storage$2.coreAppPermissions.some(function (permission) {
64825
64854
  return ['administer_site', 'manage_content'].includes(permission.name);
64826
64855
  });
64827
64856
  };
@@ -67980,7 +68009,7 @@ function ContextualHelp(_ref) {
67980
68009
  _useState2 = _slicedToArray(_useState, 2),
67981
68010
  article = _useState2[0],
67982
68011
  setArticle = _useState2[1];
67983
- var coreAppConfig = storage$1.getLocalItem('opsportal-core:config');
68012
+ var coreAppConfig = storage$2.getLocalItem('opsportal-core:config');
67984
68013
  var tileData = findAppData(coreAppConfig.tiles, coreAppConfig.tileOverrides) || {};
67985
68014
  var mihelpAppPath = !isCoreRoute ? tileData.mihelpAppPath : null;
67986
68015
  var isMihelpEnabled;
@@ -68021,12 +68050,12 @@ function ContextualHelp(_ref) {
68021
68050
  return _regenerator().w(function (_context) {
68022
68051
  while (1) switch (_context.p = _context.n) {
68023
68052
  case 0:
68024
- url = (_storage$getLocalItem = storage$1.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.getMihelpArticle;
68053
+ url = (_storage$getLocalItem = storage$2.getLocalItem('opsportal-core:config').endpoints) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.getMihelpArticle;
68025
68054
  _context.p = 1;
68026
68055
  _context.n = 2;
68027
- return fetcher.get("".concat(url, "/").concat(id), {
68056
+ return fetcher$1.get("".concat(url, "/").concat(id), {
68028
68057
  headers: {
68029
- Authorization: storage$1.accessToken
68058
+ Authorization: storage$2.accessToken
68030
68059
  }
68031
68060
  });
68032
68061
  case 2:
@@ -68073,6 +68102,1376 @@ function ContextualHelp(_ref) {
68073
68102
  })));
68074
68103
  }
68075
68104
 
68105
+ var pending = new Map();
68106
+ function requestId() {
68107
+ return "bridge-".concat(Date.now(), "-").concat(Math.random().toString(36).slice(2, 9));
68108
+ }
68109
+ function post(eventType, eventProps) {
68110
+ if (typeof window === 'undefined' || !window.parent) return;
68111
+ window.parent.postMessage({
68112
+ eventType: eventType,
68113
+ eventProps: eventProps || {}
68114
+ }, '*');
68115
+ }
68116
+ function handleMessage(event) {
68117
+ var data = event.data;
68118
+ if (!data || !data.eventType) return;
68119
+ var _data$eventProps = data.eventProps,
68120
+ eventProps = _data$eventProps === void 0 ? {} : _data$eventProps;
68121
+ var id = eventProps.requestId;
68122
+ if (!id || !pending.has(id)) return;
68123
+ var _pending$get = pending.get(id),
68124
+ resolve = _pending$get.resolve,
68125
+ reject = _pending$get.reject;
68126
+ pending.delete(id);
68127
+ switch (data.eventType) {
68128
+ case 'FETCH_RESPONSE':
68129
+ if ('error' in eventProps) {
68130
+ var _eventProps$error, _eventProps$error2, _eventProps$error3, _eventProps$error4, _eventProps$error5;
68131
+ var err = new Error(((_eventProps$error = eventProps.error) === null || _eventProps$error === void 0 ? void 0 : _eventProps$error.message) || 'Fetch failed');
68132
+ err.response = ((_eventProps$error2 = eventProps.error) === null || _eventProps$error2 === void 0 ? void 0 : _eventProps$error2.status) != null ? {
68133
+ data: (_eventProps$error3 = eventProps.error) === null || _eventProps$error3 === void 0 ? void 0 : _eventProps$error3.data,
68134
+ status: (_eventProps$error4 = eventProps.error) === null || _eventProps$error4 === void 0 ? void 0 : _eventProps$error4.status,
68135
+ headers: (_eventProps$error5 = eventProps.error) === null || _eventProps$error5 === void 0 ? void 0 : _eventProps$error5.headers
68136
+ } : eventProps.error;
68137
+ reject(err);
68138
+ } else {
68139
+ resolve(eventProps.result);
68140
+ }
68141
+ break;
68142
+ case 'STORAGE_RESPONSE':
68143
+ resolve(eventProps.result);
68144
+ break;
68145
+ case 'ACCESS_RESPONSE':
68146
+ resolve(eventProps.result);
68147
+ break;
68148
+ case 'INIT_DATA':
68149
+ resolve(eventProps.result);
68150
+ break;
68151
+ }
68152
+ }
68153
+ if (typeof window !== 'undefined') {
68154
+ window.addEventListener('message', handleMessage, false);
68155
+ }
68156
+ function sendFetchRequest(payload) {
68157
+ return new Promise(function (resolve, reject) {
68158
+ var id = requestId();
68159
+ pending.set(id, {
68160
+ resolve: resolve,
68161
+ reject: reject
68162
+ });
68163
+ post('FETCH_REQUEST', _objectSpread2(_objectSpread2({}, payload), {}, {
68164
+ requestId: id
68165
+ }));
68166
+ });
68167
+ }
68168
+ function sendStorageGet(payload) {
68169
+ return new Promise(function (resolve) {
68170
+ var id = requestId();
68171
+ pending.set(id, {
68172
+ resolve: resolve,
68173
+ reject: function reject() {}
68174
+ });
68175
+ post('STORAGE_GET', _objectSpread2(_objectSpread2({}, payload), {}, {
68176
+ requestId: id
68177
+ }));
68178
+ });
68179
+ }
68180
+ function sendStorageSet(payload) {
68181
+ return new Promise(function (resolve) {
68182
+ var id = requestId();
68183
+ pending.set(id, {
68184
+ resolve: resolve,
68185
+ reject: function reject() {}
68186
+ });
68187
+ post('STORAGE_SET', _objectSpread2(_objectSpread2({}, payload), {}, {
68188
+ requestId: id
68189
+ }));
68190
+ });
68191
+ }
68192
+ function getInitData() {
68193
+ return new Promise(function (_resolve) {
68194
+ var id = requestId();
68195
+ var timer = setTimeout(function () {
68196
+ if (pending.has(id)) {
68197
+ pending.delete(id);
68198
+ _resolve(null);
68199
+ }
68200
+ }, 5000);
68201
+ pending.set(id, {
68202
+ resolve: function resolve(result) {
68203
+ clearTimeout(timer);
68204
+ _resolve(result);
68205
+ },
68206
+ reject: function reject() {
68207
+ clearTimeout(timer);
68208
+ _resolve(null);
68209
+ }
68210
+ });
68211
+ post('GET_INIT_DATA', {
68212
+ requestId: id
68213
+ });
68214
+ });
68215
+ }
68216
+ function postUpdateUri(uri) {
68217
+ var isPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
68218
+ post('UPDATE_URI', {
68219
+ uri: uri,
68220
+ isPath: isPath
68221
+ });
68222
+ }
68223
+ function postUpdateCrumbs(crumbs) {
68224
+ post('UPDATE_CRUMBS', {
68225
+ crumbs: crumbs
68226
+ });
68227
+ }
68228
+ function postNavConfig(navItems) {
68229
+ post('SET_NAV_CONFIG', {
68230
+ navItems: navItems
68231
+ });
68232
+ }
68233
+ function postAppEnv(toolkitEnv, mihelpAgentProps) {
68234
+ post('SET_APP_ENV', {
68235
+ toolkitEnv: toolkitEnv,
68236
+ mihelpAgentProps: mihelpAgentProps
68237
+ });
68238
+ }
68239
+ function addMessageListener(callback) {
68240
+ var handler = function handler(event) {
68241
+ var data = event.data;
68242
+ if (data && data.eventType) callback(data);
68243
+ };
68244
+ window.addEventListener('message', handler, false);
68245
+ return function () {
68246
+ return window.removeEventListener('message', handler);
68247
+ };
68248
+ }
68249
+ function extractUriFromFullPath(fullPath) {
68250
+ try {
68251
+ var url = new URL(fullPath);
68252
+ return url.pathname || '/';
68253
+ } catch (_) {}
68254
+ return null;
68255
+ }
68256
+ function getInitialUri() {
68257
+ if (typeof window !== 'undefined' && window.__IFRAME_EARLY_LOAD_URI != null) {
68258
+ var uri = window.__IFRAME_EARLY_LOAD_URI;
68259
+ return Promise.resolve(uri === '' ? '/' : uri);
68260
+ }
68261
+ return new Promise(function (resolve) {
68262
+ function onMessage(event) {
68263
+ if (event.data && event.data.eventType === 'LOAD_URI' && event.data.eventProps) {
68264
+ window.removeEventListener('message', onMessage);
68265
+ clearTimeout(timer);
68266
+ var _uri = event.data.eventProps.uri;
68267
+ if (_uri == null && event.data.eventProps.fullPath) {
68268
+ _uri = extractUriFromFullPath(event.data.eventProps.fullPath);
68269
+ }
68270
+ resolve(_uri == null || _uri === '' ? '/' : _uri);
68271
+ }
68272
+ }
68273
+ window.addEventListener('message', onMessage, false);
68274
+ var timer = setTimeout(function () {
68275
+ window.removeEventListener('message', onMessage);
68276
+ var early = typeof window !== 'undefined' && window.__IFRAME_EARLY_LOAD_URI;
68277
+ resolve(early || '/');
68278
+ }, 3000);
68279
+ });
68280
+ }
68281
+
68282
+ var _appName = null;
68283
+ function setAppName(name) {
68284
+ _appName = name;
68285
+ }
68286
+ function getAppName() {
68287
+ var _window$toolkitEnv;
68288
+ if (_appName) return _appName;
68289
+ return (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.APP_NAME ? window.toolkitEnv.APP_NAME : typeof process !== 'undefined' && process.env && process.env.APP_NAME || 'test-app';
68290
+ }
68291
+ function getByPath(obj, path) {
68292
+ if (obj == null) return undefined;
68293
+ var parts = path.split('.');
68294
+ var value = obj;
68295
+ for (var i = 0; i < parts.length && value != null; i++) {
68296
+ value = value[parts[i]];
68297
+ }
68298
+ return value;
68299
+ }
68300
+ function setByPath(obj, path, value) {
68301
+ if (obj == null) obj = {};
68302
+ var parts = path.split('.');
68303
+ var current = obj;
68304
+ for (var i = 0; i < parts.length - 1; i++) {
68305
+ if (current[parts[i]] == null) current[parts[i]] = {};
68306
+ current = current[parts[i]];
68307
+ }
68308
+ current[parts[parts.length - 1]] = value;
68309
+ return obj;
68310
+ }
68311
+ var cache = {
68312
+ local: {},
68313
+ session: {}
68314
+ };
68315
+ function setInitCache(initData) {
68316
+ if (!initData) return;
68317
+ cache = _objectSpread2({
68318
+ local: {},
68319
+ session: {}
68320
+ }, initData);
68321
+ if (initData.login != null) cache.local.login = initData.login;
68322
+ if (initData.settings != null) cache.local.settings = initData.settings;
68323
+ if (initData.dashboard != null) cache.session.dashboard = initData.dashboard;
68324
+ // Shell sends config/coreAppPermissions under shorthand keys; map to canonical keys bridge getters expect
68325
+ if (initData.config != null && initData['opsportal-core:config'] == null) {
68326
+ cache.local['opsportal-core:config'] = initData.config;
68327
+ console.log('[iframe-bridge/storage] setInitCache mapped config -> opsportal-core:config');
68328
+ }
68329
+ if (initData.coreAppPermissions != null && initData['ops_portal:permissions'] == null) {
68330
+ cache.local['ops_portal:permissions'] = initData.coreAppPermissions;
68331
+ console.log('[iframe-bridge/storage] setInitCache mapped coreAppPermissions -> ops_portal:permissions', {
68332
+ count: Array.isArray(initData.coreAppPermissions) ? initData.coreAppPermissions.length : 'not-array'
68333
+ });
68334
+ }
68335
+ var appPermKeys = Object.keys(initData).filter(function (k) {
68336
+ return k.endsWith(':permissions') && k !== 'ops_portal:permissions';
68337
+ });
68338
+ appPermKeys.forEach(function (k) {
68339
+ cache.local[k] = initData[k];
68340
+ console.log('[iframe-bridge/storage] setInitCache mapped app permissions', {
68341
+ key: k,
68342
+ count: Array.isArray(initData[k]) ? initData[k].length : 'not-array'
68343
+ });
68344
+ });
68345
+ }
68346
+ function setExtraLocal(key, value) {
68347
+ cache.local[key] = value;
68348
+ }
68349
+ function getInitDataForBootstrap() {
68350
+ return getInitData();
68351
+ }
68352
+ function getLocalItem(key, path) {
68353
+ var value = cache.local[key] ?? cache[key];
68354
+ var out = path ? getByPath(value, path) : value;
68355
+ if (out !== undefined) return out;
68356
+ if (key === 'login') return cache.login;
68357
+ if (key === 'settings') return cache.settings;
68358
+ return undefined;
68359
+ }
68360
+ function setLocalItem(key, value, path) {
68361
+ sendStorageSet({
68362
+ op: 'setLocalItem',
68363
+ key: key,
68364
+ value: value,
68365
+ path: path
68366
+ });
68367
+ if (path) {
68368
+ var existing = cache.local[key] ?? cache[key] ?? {};
68369
+ cache.local[key] = setByPath(_objectSpread2({}, existing), path, value);
68370
+ } else {
68371
+ cache.local[key] = value;
68372
+ if (key === 'login') cache.login = value;
68373
+ if (key === 'settings') cache.settings = value;
68374
+ }
68375
+ }
68376
+ function getSessionItem(key, path) {
68377
+ var value = cache.session[key] ?? cache[key];
68378
+ var out = path ? getByPath(value, path) : value;
68379
+ if (out !== undefined) return out;
68380
+ if (key === 'dashboard') return cache.dashboard;
68381
+ return undefined;
68382
+ }
68383
+ function setSessionItem(key, value, path) {
68384
+ sendStorageSet({
68385
+ op: 'setSessionItem',
68386
+ key: key,
68387
+ value: value,
68388
+ path: path
68389
+ });
68390
+ if (path) {
68391
+ var existing = cache.session[key] ?? cache[key] ?? {};
68392
+ cache.session[key] = setByPath(_objectSpread2({}, existing), path, value);
68393
+ } else {
68394
+ cache.session[key] = value;
68395
+ if (key === 'dashboard') cache.dashboard = value;
68396
+ }
68397
+ }
68398
+ function getItem$1(key) {
68399
+ var APP_NAME = getAppName();
68400
+ var namespaced = "".concat(APP_NAME, ":").concat(key);
68401
+ return cache.local[namespaced] ?? cache[key];
68402
+ }
68403
+ function setItem(key, value) {
68404
+ var APP_NAME = getAppName();
68405
+ var namespaced = "".concat(APP_NAME, ":").concat(key);
68406
+ sendStorageSet({
68407
+ op: 'setLocalItem',
68408
+ key: namespaced,
68409
+ value: value
68410
+ });
68411
+ cache.local[namespaced] = value;
68412
+ cache[key] = value;
68413
+ return value;
68414
+ }
68415
+ function setAppContext() {
68416
+ var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
68417
+ try {
68418
+ var _window$toolkitEnv2, _storage$getLocalItem, _window$toolkitEnv3;
68419
+ if (_typeof$1(context) !== 'object' || context === null || Array.isArray(context)) {
68420
+ context = {};
68421
+ }
68422
+ var isCoreApp = (_window$toolkitEnv2 = window.toolkitEnv) !== null && _window$toolkitEnv2 !== void 0 && _window$toolkitEnv2.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
68423
+ if (isCoreApp) {
68424
+ setSessionItem('opsportal-core:miHelpBotContext', context);
68425
+ return;
68426
+ }
68427
+ var appTiles = ((_storage$getLocalItem = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem === void 0 ? void 0 : _storage$getLocalItem.tiles) || [];
68428
+ var appName = getAppName();
68429
+ var appData = appTiles.find(function (tile) {
68430
+ return tile.appName ? tile.appName === appName : tile.path === "/".concat(appName);
68431
+ });
68432
+ var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv3 = window.toolkitEnv) !== null && _window$toolkitEnv3 !== void 0 && _window$toolkitEnv3.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
68433
+ if (!appAuthName) throw new Error('appAuthName not found');
68434
+ setSessionItem("".concat(appAuthName, ":miHelpBotContext"), context);
68435
+ } catch (e) {
68436
+ console.log('Error while setting context ', e);
68437
+ }
68438
+ }
68439
+ function clearStorage() {
68440
+ sendStorageSet({
68441
+ op: 'clear'
68442
+ });
68443
+ }
68444
+ var storage$1 = {
68445
+ getLocalItem: getLocalItem,
68446
+ setLocalItem: setLocalItem,
68447
+ getSessionItem: getSessionItem,
68448
+ setSessionItem: setSessionItem,
68449
+ getItem: getItem$1,
68450
+ setItem: setItem,
68451
+ setAppContext: setAppContext,
68452
+ get appContext() {
68453
+ try {
68454
+ var _window$toolkitEnv4, _storage$getLocalItem2, _window$toolkitEnv5;
68455
+ var isCoreApp = (_window$toolkitEnv4 = window.toolkitEnv) !== null && _window$toolkitEnv4 !== void 0 && _window$toolkitEnv4.IS_CORE_APP ? window.toolkitEnv.IS_CORE_APP : process.env.IS_CORE_APP;
68456
+ if (isCoreApp) {
68457
+ return getSessionItem('opsportal-core:miHelpBotContext');
68458
+ }
68459
+ var appTiles = ((_storage$getLocalItem2 = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem2 === void 0 ? void 0 : _storage$getLocalItem2.tiles) || [];
68460
+ var appName = getAppName();
68461
+ var appData = appTiles.find(function (tile) {
68462
+ return tile.appName ? tile.appName === appName : tile.path === "/".concat(appName);
68463
+ });
68464
+ var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv5 = window.toolkitEnv) !== null && _window$toolkitEnv5 !== void 0 && _window$toolkitEnv5.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
68465
+ return appAuthName ? getSessionItem("".concat(appAuthName, ":miHelpBotContext")) : {};
68466
+ } catch (e) {
68467
+ console.log('App context error, ', e);
68468
+ return '';
68469
+ }
68470
+ },
68471
+ get config() {
68472
+ return getItem$1('config');
68473
+ },
68474
+ get coreConfig() {
68475
+ return getLocalItem('opsportal-core:config');
68476
+ },
68477
+ get permissions() {
68478
+ return getLocalItem('settings', 'permissions') || [];
68479
+ },
68480
+ get permissionIds() {
68481
+ return getLocalItem('settings', 'permissionIds') || [];
68482
+ },
68483
+ get allPermissionIds() {
68484
+ return getLocalItem('settings', 'allPermissionIds') || [];
68485
+ },
68486
+ get coreAppPermissions() {
68487
+ return getLocalItem('ops_portal:permissions') || [];
68488
+ },
68489
+ get currentAppPermissions() {
68490
+ var _storage$getLocalItem3, _window$toolkitEnv6;
68491
+ var appTiles = ((_storage$getLocalItem3 = storage$1.getLocalItem('opsportal-core:config')) === null || _storage$getLocalItem3 === void 0 ? void 0 : _storage$getLocalItem3.tiles) || [];
68492
+ var appName = getAppName();
68493
+ var appData = appTiles.find(function (tile) {
68494
+ return tile.appName ? tile.appName === appName : tile.path === "/".concat(appName);
68495
+ });
68496
+ var appAuthName = appData ? appData.appAuthName : (_window$toolkitEnv6 = window.toolkitEnv) !== null && _window$toolkitEnv6 !== void 0 && _window$toolkitEnv6.APP_AUTH_NAME ? window.toolkitEnv.APP_AUTH_NAME : process.env.APP_AUTH_NAME;
68497
+ return appAuthName ? storage$1.getLocalItem("".concat(appAuthName, ":permissions")) : [];
68498
+ },
68499
+ get appScopesAndFunctions() {
68500
+ return getLocalItem('appScopesAndFunctions') || [];
68501
+ },
68502
+ get userAppScopes() {
68503
+ return getLocalItem('login', 'userAppScopes') || [];
68504
+ },
68505
+ get userName() {
68506
+ return getLocalItem('login', 'userData.entity_name');
68507
+ },
68508
+ get userAvailability() {
68509
+ return getLocalItem('dashboard', 'userAvailability');
68510
+ },
68511
+ get userEmail() {
68512
+ return getLocalItem('login', 'userData.entity_mail');
68513
+ },
68514
+ get userCopartId() {
68515
+ return getLocalItem('login', 'userData.entity_employee_copart_id');
68516
+ },
68517
+ get userSamAccount() {
68518
+ return getLocalItem('login', 'userData.entity_sam_id');
68519
+ },
68520
+ get userCountry() {
68521
+ return getLocalItem('login', 'userData.entity_country');
68522
+ },
68523
+ get accessToken() {
68524
+ return getLocalItem('login', 'userData.access_token');
68525
+ },
68526
+ get refreshToken() {
68527
+ return getLocalItem('login', 'userData.refresh_token');
68528
+ },
68529
+ get isAuthenticated() {
68530
+ return getLocalItem('login', 'isAuthenticated');
68531
+ },
68532
+ get activeCountry() {
68533
+ var _getSessionItem;
68534
+ return (_getSessionItem = getSessionItem('dashboard')) === null || _getSessionItem === void 0 ? void 0 : _getSessionItem.selectedCountry;
68535
+ },
68536
+ get activeLanguage() {
68537
+ var _getSessionItem2;
68538
+ return ((_getSessionItem2 = getSessionItem('dashboard')) === null || _getSessionItem2 === void 0 ? void 0 : _getSessionItem2.language) || 'en';
68539
+ },
68540
+ get userSecurityLevel() {
68541
+ return Number(getSessionItem('securityLevel')) || 0;
68542
+ },
68543
+ get phoneNumber() {
68544
+ var _getLocalItem;
68545
+ return (_getLocalItem = getLocalItem('dashboard')) === null || _getLocalItem === void 0 ? void 0 : _getLocalItem.phoneNumber;
68546
+ },
68547
+ get userRole() {
68548
+ var _getLocalItem2;
68549
+ return ((_getLocalItem2 = getLocalItem('settings')) === null || _getLocalItem2 === void 0 ? void 0 : _getLocalItem2.selectedRole) || '';
68550
+ },
68551
+ get hasCasAccess() {
68552
+ var _getLocalItem3, _getLocalItem3$userDa;
68553
+ return (_getLocalItem3 = getLocalItem('login')) === null || _getLocalItem3 === void 0 ? void 0 : (_getLocalItem3$userDa = _getLocalItem3.userData) === null || _getLocalItem3$userDa === void 0 ? void 0 : _getLocalItem3$userDa.hasCasAccess;
68554
+ },
68555
+ get activeYardNumber() {
68556
+ var _getSessionItem3;
68557
+ return (_getSessionItem3 = getSessionItem('dashboard')) === null || _getSessionItem3 === void 0 ? void 0 : _getSessionItem3.selectedYard;
68558
+ },
68559
+ get lastSelectedYard() {
68560
+ var data = getLocalItem('lastSelectedYard');
68561
+ if (data && Object.entries(data).length) {
68562
+ return data;
68563
+ }
68564
+ },
68565
+ get homeYard() {
68566
+ var _getLocalItem4;
68567
+ var yardList = ((_getLocalItem4 = getLocalItem('login')) === null || _getLocalItem4 === void 0 ? void 0 : _getLocalItem4.yardList) || [];
68568
+ return yardList.find(function (yard) {
68569
+ return yard.isHomeYard === 'Y';
68570
+ });
68571
+ },
68572
+ get selectedHierarchy() {
68573
+ return storage$1.getLocalItem('settings', 'selectedHierarchy') || {};
68574
+ },
68575
+ get selectedHierarchyOption() {
68576
+ return storage$1.getLocalItem('settings', 'selectedHierarchyOption') || {};
68577
+ },
68578
+ get chromePluginData() {
68579
+ return storage$1.getLocalItem('chromePluginData') || {};
68580
+ },
68581
+ get twilioVoiceTask() {
68582
+ return getLocalItem('twilio', 'voiceTask') || {};
68583
+ },
68584
+ get twilioCallAnswered() {
68585
+ return getLocalItem('twilio', 'callAccepted') || false;
68586
+ },
68587
+ get twilioWrapup() {
68588
+ return getLocalItem('twilio', 'wrapUpCall') || false;
68589
+ },
68590
+ get twilioEnabledStatus() {
68591
+ return getLocalItem('dashboard', 'twilioEnabled') || false;
68592
+ },
68593
+ get clickToDialEnabledStatus() {
68594
+ return cache.local.c2dEnabled ? JSON.parse(cache.local.c2dEnabled) : false;
68595
+ },
68596
+ get callCapsuleEnabledStatus() {
68597
+ return getLocalItem('dashboard', 'isCallCapsuleEnabled') || false;
68598
+ },
68599
+ get flexLoaded() {
68600
+ return getLocalItem('twilio', 'flexLoaded') || false;
68601
+ },
68602
+ get workerProfileData() {
68603
+ return getLocalItem('twilio', 'workerProfileData') || {};
68604
+ },
68605
+ get twilioStatus() {
68606
+ return getLocalItem('twilio', 'status') || 'Offline';
68607
+ },
68608
+ get twilioUserStatus() {
68609
+ return getLocalItem('twilio', 'userStatus') || 'Offline';
68610
+ },
68611
+ get twilioCallSid() {
68612
+ return getLocalItem('twilio', 'callSid') || false;
68613
+ },
68614
+ get twilioWarning() {
68615
+ return getLocalItem('twilio', 'warning') || 'false';
68616
+ },
68617
+ clear: function clear() {
68618
+ return clearStorage();
68619
+ },
68620
+ logout: function logout() {
68621
+ clearStorage();
68622
+ window.location.assign('/logout');
68623
+ }
68624
+ };
68625
+
68626
+ var requestInterceptors = [];
68627
+ var responseInterceptors = [];
68628
+ function applyRequestInterceptors(config) {
68629
+ var chain = Promise.resolve(config);
68630
+ requestInterceptors.forEach(function (_ref) {
68631
+ var fulfilled = _ref.fulfilled,
68632
+ rejected = _ref.rejected;
68633
+ chain = chain.then(fulfilled, rejected);
68634
+ });
68635
+ return chain;
68636
+ }
68637
+ function applyResponseInterceptors(response) {
68638
+ var chain = Promise.resolve(response);
68639
+ responseInterceptors.forEach(function (_ref2) {
68640
+ var fulfilled = _ref2.fulfilled,
68641
+ rejected = _ref2.rejected;
68642
+ chain = chain.then(fulfilled, rejected);
68643
+ });
68644
+ return chain;
68645
+ }
68646
+ function applyResponseErrorInterceptors(error) {
68647
+ var chain = Promise.reject(error);
68648
+ responseInterceptors.forEach(function (_ref3) {
68649
+ var fulfilled = _ref3.fulfilled,
68650
+ rejected = _ref3.rejected;
68651
+ chain = chain.then(fulfilled, rejected);
68652
+ });
68653
+ return chain;
68654
+ }
68655
+ function request(config) {
68656
+ return applyRequestInterceptors(_objectSpread2({
68657
+ headers: {}
68658
+ }, config)).then(function (finalConfig) {
68659
+ var _finalConfig$method = finalConfig.method,
68660
+ method = _finalConfig$method === void 0 ? 'get' : _finalConfig$method,
68661
+ url = finalConfig.url,
68662
+ params = finalConfig.params,
68663
+ data = finalConfig.data,
68664
+ _finalConfig$headers = finalConfig.headers,
68665
+ headers = _finalConfig$headers === void 0 ? {} : _finalConfig$headers;
68666
+ return sendFetchRequest({
68667
+ method: (method || 'get').toLowerCase(),
68668
+ url: url,
68669
+ params: params,
68670
+ data: data,
68671
+ headers: headers
68672
+ });
68673
+ }).then(function (result) {
68674
+ return applyResponseInterceptors({
68675
+ data: result.data,
68676
+ status: result.status,
68677
+ headers: result.headers || {}
68678
+ });
68679
+ }, function (err) {
68680
+ return applyResponseErrorInterceptors(err);
68681
+ });
68682
+ }
68683
+ var DEFAULT_USER_RULES = {
68684
+ allow: [],
68685
+ deny: []
68686
+ };
68687
+ var DEFAULT_YARD_NUMBER_RULES = {
68688
+ allow: [],
68689
+ deny: []
68690
+ };
68691
+ var DEFAULT_SECURITY_LEVEL_RULES = {
68692
+ not: [],
68693
+ only: [],
68694
+ lessThan: 100
68695
+ };
68696
+ function hydrateTiles() {
68697
+ var tiles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
68698
+ return tiles.map(function (tile) {
68699
+ return _objectSpread2(_objectSpread2({}, tile), {}, {
68700
+ yardRules: _objectSpread2(_objectSpread2({}, DEFAULT_YARD_NUMBER_RULES), tile.yardRules),
68701
+ userRules: _objectSpread2(_objectSpread2({}, DEFAULT_USER_RULES), tile.userRules),
68702
+ securityLevelRules: _objectSpread2(_objectSpread2({}, DEFAULT_SECURITY_LEVEL_RULES), tile.securityLevelRules)
68703
+ });
68704
+ });
68705
+ }
68706
+ function fetcher(config) {
68707
+ return request(config);
68708
+ }
68709
+ fetcher.defaults = {
68710
+ headers: {
68711
+ common: {},
68712
+ get: {},
68713
+ post: {},
68714
+ put: {},
68715
+ patch: {},
68716
+ delete: {}
68717
+ },
68718
+ baseURL: '',
68719
+ timeout: 0
68720
+ };
68721
+ fetcher.create = function (instanceConfig) {
68722
+ return fetcher;
68723
+ };
68724
+ fetcher.request = request;
68725
+ fetcher.get = function (url) {
68726
+ var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
68727
+ return request(_objectSpread2(_objectSpread2({}, config), {}, {
68728
+ method: 'get',
68729
+ url: url
68730
+ }));
68731
+ };
68732
+ fetcher.post = function (url, data) {
68733
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
68734
+ return request(_objectSpread2(_objectSpread2({}, config), {}, {
68735
+ method: 'post',
68736
+ url: url,
68737
+ data: data
68738
+ }));
68739
+ };
68740
+ fetcher.put = function (url, data) {
68741
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
68742
+ return request(_objectSpread2(_objectSpread2({}, config), {}, {
68743
+ method: 'put',
68744
+ url: url,
68745
+ data: data
68746
+ }));
68747
+ };
68748
+ fetcher.delete = function (url) {
68749
+ var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
68750
+ return request(_objectSpread2(_objectSpread2({}, config), {}, {
68751
+ method: 'delete',
68752
+ url: url
68753
+ }));
68754
+ };
68755
+ fetcher.patch = function (url, data) {
68756
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
68757
+ return request(_objectSpread2(_objectSpread2({}, config), {}, {
68758
+ method: 'patch',
68759
+ url: url,
68760
+ data: data
68761
+ }));
68762
+ };
68763
+ fetcher.interceptors = {
68764
+ request: {
68765
+ use: function use(fulfilled, rejected) {
68766
+ requestInterceptors.push({
68767
+ fulfilled: fulfilled,
68768
+ rejected: rejected
68769
+ });
68770
+ }
68771
+ },
68772
+ response: {
68773
+ use: function use(fulfilled, rejected) {
68774
+ responseInterceptors.push({
68775
+ fulfilled: fulfilled,
68776
+ rejected: rejected
68777
+ });
68778
+ }
68779
+ }
68780
+ };
68781
+ Object.assign(fetcher, {
68782
+ getConfig: function () {
68783
+ var _getConfig = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee(endpoint) {
68784
+ var response, config;
68785
+ return _regenerator().w(function (_context) {
68786
+ while (1) switch (_context.n) {
68787
+ case 0:
68788
+ if (endpoint) {
68789
+ _context.n = 1;
68790
+ break;
68791
+ }
68792
+ return _context.a(2, Promise.reject(new Error('Error, Please make sure "CONFIG_URI" && "CORE_CONFIG_URI" env variables are configured')));
68793
+ case 1:
68794
+ _context.n = 2;
68795
+ return fetcher.get(endpoint);
68796
+ case 2:
68797
+ response = _context.v;
68798
+ config = response.data.data;
68799
+ config.tiles = hydrateTiles(config.tiles);
68800
+ config.tileOverrides = hydrateTiles(config.tileOverrides);
68801
+ return _context.a(2, config);
68802
+ }
68803
+ }, _callee);
68804
+ }));
68805
+ function getConfig(_x) {
68806
+ return _getConfig.apply(this, arguments);
68807
+ }
68808
+ return getConfig;
68809
+ }(),
68810
+ getAppTileData: function () {
68811
+ var _getAppTileData = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee2() {
68812
+ var _window$toolkitEnv;
68813
+ var coreConfigUri, config;
68814
+ return _regenerator().w(function (_context2) {
68815
+ while (1) switch (_context2.n) {
68816
+ case 0:
68817
+ coreConfigUri = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.CORE_CONFIG_URI ? window.toolkitEnv.CORE_CONFIG_URI : process.env.CORE_CONFIG_URI;
68818
+ _context2.n = 1;
68819
+ return fetcher.getConfig(coreConfigUri);
68820
+ case 1:
68821
+ config = _context2.v;
68822
+ return _context2.a(2, config);
68823
+ }
68824
+ }, _callee2);
68825
+ }));
68826
+ function getAppTileData() {
68827
+ return _getAppTileData.apply(this, arguments);
68828
+ }
68829
+ return getAppTileData;
68830
+ }(),
68831
+ getPermissions: function () {
68832
+ var _getPermissions = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee3(appName, useAppScopes) {
68833
+ var permissions, userAppScopes, allAppScopesAndFunctions, appEntry, _appEntry$scopes, appFunctionsMap, _config$endpoints, _response$data, _response$data$applic, config, endpoint, url, country, response, appDetails, _t;
68834
+ return _regenerator().w(function (_context3) {
68835
+ while (1) switch (_context3.p = _context3.n) {
68836
+ case 0:
68837
+ console.log('[iframe-bridge/fetcher] getPermissions called', {
68838
+ appName: appName,
68839
+ useAppScopes: useAppScopes
68840
+ });
68841
+ _context3.p = 1;
68842
+ permissions = [];
68843
+ if (!useAppScopes) {
68844
+ _context3.n = 2;
68845
+ break;
68846
+ }
68847
+ userAppScopes = Array.isArray(storage$1.userAppScopes) ? storage$1.userAppScopes : [];
68848
+ allAppScopesAndFunctions = storage$1.appScopesAndFunctions;
68849
+ appEntry = Array.isArray(allAppScopesAndFunctions) ? allAppScopesAndFunctions.find(function (s) {
68850
+ return s.appName === appName;
68851
+ }) : null;
68852
+ console.log('[iframe-bridge/fetcher] getPermissions (useAppScopes)', {
68853
+ appEntryFound: Boolean(appEntry),
68854
+ userAppScopesCount: userAppScopes.length
68855
+ });
68856
+ if (appEntry) {
68857
+ appFunctionsMap = {};
68858
+ (_appEntry$scopes = appEntry.scopes) === null || _appEntry$scopes === void 0 ? void 0 : _appEntry$scopes.forEach(function (scope) {
68859
+ var userHasScope = userAppScopes.find(function (s) {
68860
+ return s.appName === appName && s.scopeName === scope.appscope;
68861
+ });
68862
+ if (userHasScope) {
68863
+ var _scope$applicationFun;
68864
+ (_scope$applicationFun = scope.applicationFunctions) === null || _scope$applicationFun === void 0 ? void 0 : _scope$applicationFun.forEach(function (fn) {
68865
+ if (!appFunctionsMap[fn]) {
68866
+ appFunctionsMap[fn] = {
68867
+ name: fn,
68868
+ description: fn,
68869
+ hierarchyDetails: userHasScope.hierarchies
68870
+ };
68871
+ }
68872
+ });
68873
+ }
68874
+ });
68875
+ permissions = Object.values(appFunctionsMap);
68876
+ }
68877
+ _context3.n = 4;
68878
+ break;
68879
+ case 2:
68880
+ config = storage$1.getLocalItem('opsportal-core:config') || storage$1.getLocalItem('config');
68881
+ endpoint = config === null || config === void 0 ? void 0 : (_config$endpoints = config.endpoints) === null || _config$endpoints === void 0 ? void 0 : _config$endpoints.g2AppPermissions;
68882
+ url = endpoint ? "".concat(endpoint).concat(appName) : "/api/permissions/".concat(appName);
68883
+ country = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
68884
+ console.log('[iframe-bridge/fetcher] getPermissions fetching', {
68885
+ url: url,
68886
+ country: country
68887
+ });
68888
+ _context3.n = 3;
68889
+ return fetcher.get(url, {
68890
+ headers: {
68891
+ country: country,
68892
+ source: 'OPS_PORTAL'
68893
+ }
68894
+ });
68895
+ case 3:
68896
+ response = _context3.v;
68897
+ appDetails = (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$applic = _response$data.applications) === null || _response$data$applic === void 0 ? void 0 : _response$data$applic.find(function (app) {
68898
+ return app.name === appName;
68899
+ });
68900
+ if (appDetails) {
68901
+ permissions = appDetails.applicationFunctions;
68902
+ }
68903
+ case 4:
68904
+ console.log('[iframe-bridge/fetcher] getPermissions stored', {
68905
+ appName: appName,
68906
+ count: permissions.length
68907
+ });
68908
+ storage$1.setLocalItem("".concat(appName, ":permissions"), permissions);
68909
+ return _context3.a(2, permissions);
68910
+ case 5:
68911
+ _context3.p = 5;
68912
+ _t = _context3.v;
68913
+ console.warn('[iframe-bridge/fetcher] getPermissions failed', {
68914
+ appName: appName,
68915
+ error: (_t === null || _t === void 0 ? void 0 : _t.message) || _t
68916
+ });
68917
+ return _context3.a(2, []);
68918
+ }
68919
+ }, _callee3, null, [[1, 5]]);
68920
+ }));
68921
+ function getPermissions(_x2, _x3) {
68922
+ return _getPermissions.apply(this, arguments);
68923
+ }
68924
+ return getPermissions;
68925
+ }(),
68926
+ getCoreAppPermissions: function () {
68927
+ var _getCoreAppPermissions = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee4() {
68928
+ return _regenerator().w(function (_context4) {
68929
+ while (1) switch (_context4.n) {
68930
+ case 0:
68931
+ return _context4.a(2, fetcher.getPermissions('ops_portal'));
68932
+ }
68933
+ }, _callee4);
68934
+ }));
68935
+ function getCoreAppPermissions() {
68936
+ return _getCoreAppPermissions.apply(this, arguments);
68937
+ }
68938
+ return getCoreAppPermissions;
68939
+ }(),
68940
+ getUserPreferences: function () {
68941
+ var _getUserPreferences = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee5() {
68942
+ var appName,
68943
+ _config$endpoints2,
68944
+ config,
68945
+ urlTemplate,
68946
+ url,
68947
+ country,
68948
+ response,
68949
+ _args5 = arguments,
68950
+ _t2;
68951
+ return _regenerator().w(function (_context5) {
68952
+ while (1) switch (_context5.p = _context5.n) {
68953
+ case 0:
68954
+ appName = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : '';
68955
+ _context5.p = 1;
68956
+ config = storage$1.getLocalItem('opsportal-core:config');
68957
+ urlTemplate = config === null || config === void 0 ? void 0 : (_config$endpoints2 = config.endpoints) === null || _config$endpoints2 === void 0 ? void 0 : _config$endpoints2.userPreferences;
68958
+ if (urlTemplate) {
68959
+ _context5.n = 2;
68960
+ break;
68961
+ }
68962
+ return _context5.a(2, {});
68963
+ case 2:
68964
+ url = urlTemplate.replace(/\{appName\}/g, appName);
68965
+ country = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
68966
+ _context5.n = 3;
68967
+ return fetcher.get(url, {
68968
+ headers: {
68969
+ country: country,
68970
+ source: 'OPS_PORTAL'
68971
+ }
68972
+ });
68973
+ case 3:
68974
+ response = _context5.v;
68975
+ return _context5.a(2, response.data);
68976
+ case 4:
68977
+ _context5.p = 4;
68978
+ _t2 = _context5.v;
68979
+ return _context5.a(2, Promise.reject(_t2));
68980
+ }
68981
+ }, _callee5, null, [[1, 4]]);
68982
+ }));
68983
+ function getUserPreferences() {
68984
+ return _getUserPreferences.apply(this, arguments);
68985
+ }
68986
+ return getUserPreferences;
68987
+ }(),
68988
+ setUserPreferences: function () {
68989
+ var _setUserPreferences = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee6() {
68990
+ var appName,
68991
+ data,
68992
+ _config$endpoints3,
68993
+ config,
68994
+ urlTemplate,
68995
+ url,
68996
+ country,
68997
+ response,
68998
+ _args6 = arguments,
68999
+ _t3;
69000
+ return _regenerator().w(function (_context6) {
69001
+ while (1) switch (_context6.p = _context6.n) {
69002
+ case 0:
69003
+ appName = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : '';
69004
+ data = _args6.length > 1 ? _args6[1] : undefined;
69005
+ _context6.p = 1;
69006
+ config = storage$1.getLocalItem('opsportal-core:config');
69007
+ urlTemplate = config === null || config === void 0 ? void 0 : (_config$endpoints3 = config.endpoints) === null || _config$endpoints3 === void 0 ? void 0 : _config$endpoints3.userPreferences;
69008
+ if (urlTemplate) {
69009
+ _context6.n = 2;
69010
+ break;
69011
+ }
69012
+ return _context6.a(2, '');
69013
+ case 2:
69014
+ url = urlTemplate.replace(/\{appName\}/g, appName);
69015
+ country = storage$1.getSessionItem('dashboard', 'selectedCountryA3code');
69016
+ _context6.n = 3;
69017
+ return fetcher.put(url, data, {
69018
+ headers: {
69019
+ country: country,
69020
+ source: 'OPS_PORTAL'
69021
+ }
69022
+ });
69023
+ case 3:
69024
+ response = _context6.v;
69025
+ return _context6.a(2, response.statusText);
69026
+ case 4:
69027
+ _context6.p = 4;
69028
+ _t3 = _context6.v;
69029
+ return _context6.a(2, Promise.reject(_t3));
69030
+ }
69031
+ }, _callee6, null, [[1, 4]]);
69032
+ }));
69033
+ function setUserPreferences() {
69034
+ return _setUserPreferences.apply(this, arguments);
69035
+ }
69036
+ return setUserPreferences;
69037
+ }(),
69038
+ getPrintersForYard: function () {
69039
+ var _getPrintersForYard = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee7(yardNumber) {
69040
+ var _config$endpoints4, config, url, response;
69041
+ return _regenerator().w(function (_context7) {
69042
+ while (1) switch (_context7.p = _context7.n) {
69043
+ case 0:
69044
+ _context7.p = 0;
69045
+ config = storage$1.getLocalItem('opsportal-core:config');
69046
+ url = config === null || config === void 0 ? void 0 : (_config$endpoints4 = config.endpoints) === null || _config$endpoints4 === void 0 ? void 0 : _config$endpoints4.printersByYard;
69047
+ if (url) {
69048
+ _context7.n = 1;
69049
+ break;
69050
+ }
69051
+ return _context7.a(2, {});
69052
+ case 1:
69053
+ _context7.n = 2;
69054
+ return fetcher.get("".concat(url).concat(yardNumber));
69055
+ case 2:
69056
+ response = _context7.v;
69057
+ return _context7.a(2, response.data);
69058
+ case 3:
69059
+ _context7.p = 3;
69060
+ _context7.v;
69061
+ return _context7.a(2, {});
69062
+ }
69063
+ }, _callee7, null, [[0, 3]]);
69064
+ }));
69065
+ function getPrintersForYard(_x4) {
69066
+ return _getPrintersForYard.apply(this, arguments);
69067
+ }
69068
+ return getPrintersForYard;
69069
+ }(),
69070
+ login: function () {
69071
+ var _login = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee8() {
69072
+ return _regenerator().w(function (_context8) {
69073
+ while (1) switch (_context8.n) {
69074
+ case 0:
69075
+ return _context8.a(2, {});
69076
+ }
69077
+ }, _callee8);
69078
+ }));
69079
+ function login() {
69080
+ return _login.apply(this, arguments);
69081
+ }
69082
+ return login;
69083
+ }(),
69084
+ oktaLogin: function () {
69085
+ var _oktaLogin = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee9() {
69086
+ return _regenerator().w(function (_context9) {
69087
+ while (1) switch (_context9.n) {
69088
+ case 0:
69089
+ return _context9.a(2, {});
69090
+ }
69091
+ }, _callee9);
69092
+ }));
69093
+ function oktaLogin() {
69094
+ return _oktaLogin.apply(this, arguments);
69095
+ }
69096
+ return oktaLogin;
69097
+ }(),
69098
+ getYardNumbers: function () {
69099
+ var _getYardNumbers = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee0() {
69100
+ return _regenerator().w(function (_context0) {
69101
+ while (1) switch (_context0.n) {
69102
+ case 0:
69103
+ return _context0.a(2, []);
69104
+ }
69105
+ }, _callee0);
69106
+ }));
69107
+ function getYardNumbers() {
69108
+ return _getYardNumbers.apply(this, arguments);
69109
+ }
69110
+ return getYardNumbers;
69111
+ }(),
69112
+ getUserDetails: function () {
69113
+ var _getUserDetails = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee1() {
69114
+ return _regenerator().w(function (_context1) {
69115
+ while (1) switch (_context1.n) {
69116
+ case 0:
69117
+ return _context1.a(2, {});
69118
+ }
69119
+ }, _callee1);
69120
+ }));
69121
+ function getUserDetails() {
69122
+ return _getUserDetails.apply(this, arguments);
69123
+ }
69124
+ return getUserDetails;
69125
+ }(),
69126
+ sendFeedback: function () {
69127
+ var _sendFeedback = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee10() {
69128
+ return _regenerator().w(function (_context10) {
69129
+ while (1) switch (_context10.n) {
69130
+ case 0:
69131
+ return _context10.a(2, {});
69132
+ }
69133
+ }, _callee10);
69134
+ }));
69135
+ function sendFeedback() {
69136
+ return _sendFeedback.apply(this, arguments);
69137
+ }
69138
+ return sendFeedback;
69139
+ }(),
69140
+ getUserRoles: function () {
69141
+ var _getUserRoles = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee11() {
69142
+ return _regenerator().w(function (_context11) {
69143
+ while (1) switch (_context11.n) {
69144
+ case 0:
69145
+ return _context11.a(2, []);
69146
+ }
69147
+ }, _callee11);
69148
+ }));
69149
+ function getUserRoles() {
69150
+ return _getUserRoles.apply(this, arguments);
69151
+ }
69152
+ return getUserRoles;
69153
+ }(),
69154
+ getHierarchyOptions: function () {
69155
+ var _getHierarchyOptions = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee12() {
69156
+ return _regenerator().w(function (_context12) {
69157
+ while (1) switch (_context12.n) {
69158
+ case 0:
69159
+ return _context12.a(2, []);
69160
+ }
69161
+ }, _callee12);
69162
+ }));
69163
+ function getHierarchyOptions() {
69164
+ return _getHierarchyOptions.apply(this, arguments);
69165
+ }
69166
+ return getHierarchyOptions;
69167
+ }(),
69168
+ getInnovationHubToken: function () {
69169
+ var _getInnovationHubToken = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee13() {
69170
+ return _regenerator().w(function (_context13) {
69171
+ while (1) switch (_context13.n) {
69172
+ case 0:
69173
+ return _context13.a(2, {});
69174
+ }
69175
+ }, _callee13);
69176
+ }));
69177
+ function getInnovationHubToken() {
69178
+ return _getInnovationHubToken.apply(this, arguments);
69179
+ }
69180
+ return getInnovationHubToken;
69181
+ }(),
69182
+ getUserScopes: function () {
69183
+ var _getUserScopes = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee14() {
69184
+ return _regenerator().w(function (_context14) {
69185
+ while (1) switch (_context14.n) {
69186
+ case 0:
69187
+ return _context14.a(2, []);
69188
+ }
69189
+ }, _callee14);
69190
+ }));
69191
+ function getUserScopes() {
69192
+ return _getUserScopes.apply(this, arguments);
69193
+ }
69194
+ return getUserScopes;
69195
+ }(),
69196
+ getCobaltUserFacilities: function () {
69197
+ var _getCobaltUserFacilities = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee15() {
69198
+ return _regenerator().w(function (_context15) {
69199
+ while (1) switch (_context15.n) {
69200
+ case 0:
69201
+ return _context15.a(2, []);
69202
+ }
69203
+ }, _callee15);
69204
+ }));
69205
+ function getCobaltUserFacilities() {
69206
+ return _getCobaltUserFacilities.apply(this, arguments);
69207
+ }
69208
+ return getCobaltUserFacilities;
69209
+ }(),
69210
+ getCobaltUserRoles: function () {
69211
+ var _getCobaltUserRoles = _asyncToGenerator$1(/*#__PURE__*/_regenerator().m(function _callee16() {
69212
+ return _regenerator().w(function (_context16) {
69213
+ while (1) switch (_context16.n) {
69214
+ case 0:
69215
+ return _context16.a(2, []);
69216
+ }
69217
+ }, _callee16);
69218
+ }));
69219
+ function getCobaltUserRoles() {
69220
+ return _getCobaltUserRoles.apply(this, arguments);
69221
+ }
69222
+ return getCobaltUserRoles;
69223
+ }()
69224
+ });
69225
+
69226
+ var isEmpty = function isEmpty(arr) {
69227
+ return !arr || arr.length === 0;
69228
+ };
69229
+ var includes = function includes(val, arr) {
69230
+ return Array.isArray(arr) && arr.includes(val);
69231
+ };
69232
+ var isNil = function isNil(v) {
69233
+ return v == null;
69234
+ };
69235
+ var allAreTruthy = function allAreTruthy(arr) {
69236
+ return arr.every(function (v) {
69237
+ return v === true;
69238
+ });
69239
+ };
69240
+ var yardNumberAllowed = function yardNumberAllowed(yardNumber, tile) {
69241
+ var _tile$yardRules, _tile$yardRules$allow, _tile$yardRules2, _tile$yardRules3;
69242
+ return (_tile$yardRules = tile.yardRules) !== null && _tile$yardRules !== void 0 && (_tile$yardRules$allow = _tile$yardRules.allow) !== null && _tile$yardRules$allow !== void 0 && _tile$yardRules$allow.length ? includes(yardNumber, (_tile$yardRules2 = tile.yardRules) === null || _tile$yardRules2 === void 0 ? void 0 : _tile$yardRules2.allow) : !includes(yardNumber, (_tile$yardRules3 = tile.yardRules) === null || _tile$yardRules3 === void 0 ? void 0 : _tile$yardRules3.deny);
69243
+ };
69244
+ var securityLevelAllowed = function securityLevelAllowed(securityLevel, tile) {
69245
+ var _tile$securityLevelRu, _tile$securityLevelRu2;
69246
+ return (tile === null || tile === void 0 ? void 0 : tile.requireCasAccess) === false || !includes(securityLevel, (_tile$securityLevelRu = tile.securityLevelRules) === null || _tile$securityLevelRu === void 0 ? void 0 : _tile$securityLevelRu.not) && ((_tile$securityLevelRu2 = tile.securityLevelRules) === null || _tile$securityLevelRu2 === void 0 ? void 0 : _tile$securityLevelRu2.lessThan) > Number(securityLevel);
69247
+ };
69248
+ var emailAddressAllowed = function emailAddressAllowed(emailAddress, tile) {
69249
+ var _tile$userRules, _tile$userRules2;
69250
+ return isEmpty((_tile$userRules = tile.userRules) === null || _tile$userRules === void 0 ? void 0 : _tile$userRules.allow) || includes(emailAddress, (_tile$userRules2 = tile.userRules) === null || _tile$userRules2 === void 0 ? void 0 : _tile$userRules2.allow);
69251
+ };
69252
+ var appFunctionIdAllowed = function appFunctionIdAllowed() {
69253
+ var _window$toolkitEnv;
69254
+ var coreAppPermissions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
69255
+ var permissionIds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
69256
+ var appScopes = arguments.length > 3 ? arguments[3] : undefined;
69257
+ var tile = arguments.length > 4 ? arguments[4] : undefined;
69258
+ var stack = (_window$toolkitEnv = window.toolkitEnv) !== null && _window$toolkitEnv !== void 0 && _window$toolkitEnv.STACK ? window.toolkitEnv.STACK : process.env.STACK;
69259
+ if (tile.useAppScopes) {
69260
+ var userAppScopes = Array.isArray(appScopes) ? appScopes : [];
69261
+ return tile.appAuthName && userAppScopes.some(function (appScope) {
69262
+ return appScope.appName === tile.appAuthName;
69263
+ });
69264
+ }
69265
+ var id = tile.appFunctionId;
69266
+ if (!id) {
69267
+ return true;
69268
+ } else if (stack === 'g') {
69269
+ return includes(id, permissionIds);
69270
+ } else {
69271
+ return !isEmpty(coreAppPermissions) && !isNil(coreAppPermissions.find(function (permission) {
69272
+ return permission.name === id;
69273
+ }));
69274
+ }
69275
+ };
69276
+ var stackIsAllowed = function stackIsAllowed(stack) {
69277
+ return stack ? stack === global.STACK : true;
69278
+ };
69279
+ var casAccessAllowed = function casAccessAllowed(hasCasAccess) {
69280
+ var requireCasAccess = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
69281
+ if (isNil(hasCasAccess)) return true;
69282
+ return requireCasAccess === false || requireCasAccess && hasCasAccess;
69283
+ };
69284
+ var getUserData = function getUserData() {
69285
+ return {
69286
+ activeYardNumber: storage$1.activeYardNumber,
69287
+ securityLevel: storage$1.userSecurityLevel,
69288
+ emailAddress: storage$1.userEmail,
69289
+ permissionIds: storage$1.permissionIds,
69290
+ allPermissionIds: storage$1.allPermissionIds,
69291
+ hasCasAccess: storage$1.hasCasAccess,
69292
+ coreAppPermissions: storage$1.coreAppPermissions,
69293
+ appScopes: storage$1.userAppScopes
69294
+ };
69295
+ };
69296
+ var userHasChatBotAccess = function userHasChatBotAccess(appFunction) {
69297
+ if (!appFunction) return true;
69298
+ var coreAppPermissions = storage$1.coreAppPermissions;
69299
+ return !isEmpty(coreAppPermissions) && !isNil(coreAppPermissions.find(function (permission) {
69300
+ return permission.name === appFunction;
69301
+ }));
69302
+ };
69303
+ var userHasAccess = function userHasAccess(tile) {
69304
+ var user = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getUserData();
69305
+ return allAreTruthy([stackIsAllowed(tile.stack), yardNumberAllowed(user.activeYardNumber, tile), securityLevelAllowed(user.securityLevel, tile), emailAddressAllowed(user.emailAddress, tile), appFunctionIdAllowed(user.coreAppPermissions, user.allPermissionIds, user.permissionIds, user.appScopes, tile), casAccessAllowed(user.hasCasAccess, tile.requireCasAccess)]);
69306
+ };
69307
+ var accessHelpers = {
69308
+ yardNumberAllowed: yardNumberAllowed,
69309
+ securityLevelAllowed: securityLevelAllowed,
69310
+ emailAddressAllowed: emailAddressAllowed,
69311
+ appFunctionIdAllowed: appFunctionIdAllowed,
69312
+ stackIsAllowed: stackIsAllowed,
69313
+ casAccessAllowed: casAccessAllowed,
69314
+ userHasChatBotAccess: userHasChatBotAccess,
69315
+ userHasAccess: userHasAccess
69316
+ };
69317
+
69318
+ var CrumbContext = React.createContext(null);
69319
+ var crumbId = 0;
69320
+ function CrumbProvider(_ref) {
69321
+ var children = _ref.children,
69322
+ navigate = _ref.navigate;
69323
+ var _useState = React.useState([]),
69324
+ _useState2 = _slicedToArray(_useState, 2);
69325
+ _useState2[0];
69326
+ var setTrail = _useState2[1];
69327
+ var _useState3 = React.useState(function () {
69328
+ return navigate;
69329
+ }),
69330
+ _useState4 = _slicedToArray(_useState3, 2),
69331
+ navigateRef = _useState4[0],
69332
+ setNavigateRef = _useState4[1];
69333
+ React.useEffect(function () {
69334
+ setNavigateRef(function () {
69335
+ return navigate;
69336
+ });
69337
+ }, [navigate]);
69338
+ React.useEffect(function () {
69339
+ var remove = addMessageListener(function (data) {
69340
+ var _data$eventProps;
69341
+ if (data.eventType === 'CRUMB_CLICKED' && ((_data$eventProps = data.eventProps) === null || _data$eventProps === void 0 ? void 0 : _data$eventProps.path) != null && navigateRef) {
69342
+ navigateRef(data.eventProps.path);
69343
+ }
69344
+ });
69345
+ return remove;
69346
+ }, [navigateRef]);
69347
+ var register = React.useCallback(function (entry) {
69348
+ var id = ++crumbId;
69349
+ setTrail(function (prev) {
69350
+ var next = [].concat(_toConsumableArray(prev), [_objectSpread2({
69351
+ id: id
69352
+ }, entry)]);
69353
+ postUpdateCrumbs(next.map(function (_ref2) {
69354
+ var path = _ref2.path,
69355
+ name = _ref2.name;
69356
+ return {
69357
+ path: path || '',
69358
+ name: name
69359
+ };
69360
+ }));
69361
+ return next;
69362
+ });
69363
+ return id;
69364
+ }, []);
69365
+ var unregister = React.useCallback(function (id) {
69366
+ setTrail(function (prev) {
69367
+ var next = prev.filter(function (item) {
69368
+ return item.id !== id;
69369
+ });
69370
+ postUpdateCrumbs(next.map(function (_ref3) {
69371
+ var path = _ref3.path,
69372
+ name = _ref3.name;
69373
+ return {
69374
+ path: path || '',
69375
+ name: name
69376
+ };
69377
+ }));
69378
+ return next;
69379
+ });
69380
+ }, []);
69381
+ var update = React.useCallback(function (id, entry) {
69382
+ setTrail(function (prev) {
69383
+ var next = prev.map(function (item) {
69384
+ return item.id === id ? _objectSpread2(_objectSpread2({}, item), entry) : item;
69385
+ });
69386
+ postUpdateCrumbs(next.map(function (_ref4) {
69387
+ var path = _ref4.path,
69388
+ name = _ref4.name;
69389
+ return {
69390
+ path: path || '',
69391
+ name: name
69392
+ };
69393
+ }));
69394
+ return next;
69395
+ });
69396
+ }, []);
69397
+ var value = React.useMemo(function () {
69398
+ return {
69399
+ register: register,
69400
+ unregister: unregister,
69401
+ update: update
69402
+ };
69403
+ }, [register, unregister, update]);
69404
+ return /*#__PURE__*/React__default["default"].createElement(CrumbContext.Provider, {
69405
+ value: value
69406
+ }, children);
69407
+ }
69408
+ function useCrumbContext() {
69409
+ return React.useContext(CrumbContext);
69410
+ }
69411
+
69412
+ function getCrumbLabel(children) {
69413
+ var _children$props;
69414
+ if (children == null) return '';
69415
+ if (typeof children === 'string') return children;
69416
+ if (Array.isArray(children)) return children.map(getCrumbLabel).join('');
69417
+ if (React__default["default"].isValidElement(children) && ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.children) != null) return getCrumbLabel(children.props.children);
69418
+ return String(children);
69419
+ }
69420
+ function Crumb(_ref) {
69421
+ var to = _ref.to,
69422
+ children = _ref.children;
69423
+ var ctx = useCrumbContext();
69424
+ var idRef = React.useRef(null);
69425
+ var path = to != null ? to : '';
69426
+ var name = getCrumbLabel(children);
69427
+ React.useEffect(function () {
69428
+ if (!ctx) return;
69429
+ idRef.current = ctx.register({
69430
+ path: path,
69431
+ name: name
69432
+ });
69433
+ return function () {
69434
+ if (idRef.current != null) ctx.unregister(idRef.current);
69435
+ };
69436
+ }, [ctx]);
69437
+ React.useEffect(function () {
69438
+ if (ctx && idRef.current != null) {
69439
+ ctx.update(idRef.current, {
69440
+ path: path,
69441
+ name: name
69442
+ });
69443
+ }
69444
+ }, [ctx, path, name]);
69445
+ return null;
69446
+ }
69447
+
69448
+ var iframeFacade = {
69449
+ AppFrame: AppFrame,
69450
+ CallLogger: CallLogger,
69451
+ AutoRefresh: AutoRefresh,
69452
+ ContextualHelp: ContextualHelp,
69453
+ fetcher: fetcher,
69454
+ storage: storage$1,
69455
+ accessHelpers: accessHelpers,
69456
+ Crumb: Crumb,
69457
+ CrumbProvider: CrumbProvider,
69458
+ useCrumbContext: useCrumbContext,
69459
+ bridge: {
69460
+ postUpdateUri: postUpdateUri,
69461
+ postUpdateCrumbs: postUpdateCrumbs,
69462
+ postNavConfig: postNavConfig,
69463
+ postAppEnv: postAppEnv,
69464
+ addMessageListener: addMessageListener,
69465
+ getInitData: getInitData,
69466
+ getInitialUri: getInitialUri,
69467
+ setInitCache: setInitCache,
69468
+ setExtraLocal: setExtraLocal,
69469
+ setAppName: setAppName,
69470
+ getInitDataForBootstrap: getInitDataForBootstrap,
69471
+ sendStorageGet: sendStorageGet
69472
+ }
69473
+ };
69474
+
68076
69475
  setup({
68077
69476
  pkg: pkg
68078
69477
  });
@@ -79655,8 +81054,9 @@ exports.AppFrame = AppFrame;
79655
81054
  exports.AutoRefresh = AutoRefresh;
79656
81055
  exports.CallLogger = CallLogger;
79657
81056
  exports.ContextualHelp = ContextualHelp;
79658
- exports.Crumb = Crumb;
79659
- exports.accessHelpers = accessHelpers;
79660
- exports.fetcher = fetcher;
79661
- exports.storage = storage$1;
81057
+ exports.Crumb = Crumb$1;
81058
+ exports.accessHelpers = accessHelpers$1;
81059
+ exports.fetcher = fetcher$1;
81060
+ exports.iframeFacade = iframeFacade;
81061
+ exports.storage = storage$2;
79662
81062
  //# sourceMappingURL=ops-tool-kit.js.map