From e99c9cc40a8df16d0fc3539111b304697104ad62 Mon Sep 17 00:00:00 2001 From: Jeremy Sampson Date: Tue, 2 Jan 2024 15:51:08 -0700 Subject: [PATCH] v2.7.0 (#71) * update deps, tsv srf, user agent * update sync-assets script * downgrade typescript-eslint packages * prepare v2.7.0 --- .env.development | 1 + .env.production | 1 + lib/components/AopDataViewer/AopDataViewer.js | 601 +- lib/components/AopDataViewer/index.js | 2 +- .../Bundles/BundleContentBuilder.js | 56 +- lib/components/Bundles/BundleListItemIcon.js | 25 +- .../Bundles/DataProductBundleCard.js | 67 +- lib/components/Bundles/index.js | 2 +- lib/components/Button/SplitButton.js | 94 +- lib/components/Button/index.js | 2 +- lib/components/Card/BaseCard.js | 73 +- lib/components/Card/BaseMessageCard.js | 89 +- lib/components/Card/ErrorCard.js | 49 +- lib/components/Card/InfoCard.js | 49 +- lib/components/Card/InfoMessageCard.js | 62 +- lib/components/Card/ReleaseMessageCard.js | 30 +- lib/components/Card/ReleaseNoticeCard.js | 36 +- lib/components/Card/WarningCard.js | 49 +- lib/components/Card/index.js | 2 +- lib/components/Chip/ReleaseChip.js | 58 +- lib/components/Chip/index.js | 2 +- .../Citation/DataProductCitation.js | 25 +- .../Citation/DataProductCitation/Actions.js | 286 +- .../Citation/DataProductCitation/Context.js | 161 +- .../Citation/DataProductCitation/ItemView.js | 220 +- .../Citation/DataProductCitation/Reducer.js | 96 +- .../Citation/DataProductCitation/Service.js | 367 +- .../Citation/DataProductCitation/State.js | 12 +- .../Citation/DataProductCitation/View.js | 155 +- .../Citation/DataProductCitation/ViewState.js | 5 +- lib/components/Citation/index.js | 2 +- .../AvailabilityContext.js | 213 +- .../AvailabilityPending.js | 21 +- .../AvailabilitySvgComponents.js | 219 +- .../AvailabilityUtils.js | 74 +- .../BasicAvailabilityGrid.js | 550 +- .../BasicAvailabilityInterface.js | 690 +- .../BasicAvailabilityKey.js | 235 +- .../DataProductAvailability.js | 18 +- .../EnhancedAvailabilityGrid.js | 494 +- .../EnhancedAvailabilityInterface.js | 300 +- .../EnhancedAvailabilityKey.js | 147 +- .../DataProductAvailability/SvgPatterns.js | 22 +- .../DataProductAvailability/index.js | 2 +- lib/components/DataThemeIcon/DataThemeIcon.js | 42 +- lib/components/DataThemeIcon/index.js | 2 +- lib/components/DialogBase/DialogBase.js | 90 +- lib/components/DialogBase/index.js | 2 +- lib/components/Documents/DocumentList.js | 60 +- lib/components/Documents/DocumentListItem.js | 417 +- lib/components/Documents/DocumentSelect.js | 98 +- lib/components/Documents/DocumentTabs.js | 234 +- lib/components/Documents/DocumentViewer.js | 106 +- lib/components/Documents/PdfDocumentViewer.js | 165 +- lib/components/Documents/index.js | 2 +- .../DownloadDataButton/DownloadDataButton.js | 61 +- lib/components/DownloadDataButton/index.js | 2 +- .../DownloadDataContext.js | 740 +- .../StateStorageConverter.js | 12 +- lib/components/DownloadDataContext/index.js | 2 +- .../DownloadDataDialog/DownloadDataDialog.js | 594 +- lib/components/DownloadDataDialog/index.js | 2 +- .../DownloadStepForm/DownloadStepForm.js | 832 +- lib/components/DownloadStepForm/index.js | 2 +- .../Error/ComponentErrorBoundary.js | 19 +- lib/components/Error/ComponentFallback.js | 11 +- .../Error/CustomComponentFallback.js | 9 +- lib/components/Error/index.js | 2 +- lib/components/ExternalHost/ExternalHost.js | 118 +- lib/components/ExternalHost/index.js | 2 +- .../ExternalHostInfo/ExternalHostInfo.js | 88 +- lib/components/ExternalHostInfo/index.js | 2 +- .../ExternalHostProductSpecificLinks.js | 135 +- .../ExternalHostProductSpecificLinks/index.js | 2 +- .../FullWidthVisualization.js | 79 +- .../FullWidthVisualization/index.js | 2 +- .../MapSelectionButton/MapSelectionButton.js | 181 +- .../MaterialTableIcons/MaterialTableIcons.js | 146 +- lib/components/NeonApi/NeonApi.js | 248 +- lib/components/NeonApi/index.js | 2 +- lib/components/NeonAuth/AuthService.js | 227 +- lib/components/NeonAuth/NeonAuth.js | 134 +- lib/components/NeonAuth/UserCard.js | 196 +- lib/components/NeonAuth/index.js | 2 +- lib/components/NeonContext/NeonContext.js | 266 +- .../NeonEnvironment/NeonEnvironment.d.ts | 2 + .../NeonEnvironment/NeonEnvironment.js | 364 +- lib/components/NeonEnvironment/index.js | 2 +- lib/components/NeonFooter/NeonFooter.js | 67 +- lib/components/NeonFooter/index.js | 2 +- lib/components/NeonGraphQL/NeonGraphQL.js | 130 +- lib/components/NeonGraphQL/index.js | 2 +- lib/components/NeonHeader/ApplicationMenu.js | 241 +- lib/components/NeonHeader/NeonHeader.js | 384 +- lib/components/NeonHeader/index.js | 2 +- lib/components/NeonJsonLd/NeonJsonLd.js | 106 +- lib/components/NeonJsonLd/index.js | 2 +- lib/components/NeonPage/BrowserWarning.js | 67 +- .../NeonPage/LiferayNotifications.js | 79 +- lib/components/NeonPage/NeonPage.js | 831 +- lib/components/NeonPage/index.js | 2 +- lib/components/NeonRouter/NeonRouter.js | 15 +- lib/components/NeonRouter/index.js | 2 +- .../NeonSignInButton/NeonSignInButton.js | 16 +- .../NeonSignInButton/NeonSignInButtonState.js | 21 +- lib/components/ReleaseFilter/ReleaseFilter.js | 304 +- lib/components/SidebarFilter/SidebarFilter.js | 189 +- lib/components/SidebarFilter/index.js | 2 +- lib/components/SiteChip/SiteChip.js | 66 +- lib/components/SiteChip/index.js | 2 +- lib/components/SiteMap/FetchLocationUtils.js | 56 +- lib/components/SiteMap/SiteMap.js | 15 +- lib/components/SiteMap/SiteMapContainer.js | 1047 ++- lib/components/SiteMap/SiteMapContext.js | 827 +- lib/components/SiteMap/SiteMapFeature.js | 970 ++- lib/components/SiteMap/SiteMapLeaflet.js | 727 +- lib/components/SiteMap/SiteMapTable.js | 910 +-- lib/components/SiteMap/SiteMapUtils.js | 761 +- .../SiteMap/StateStorageConverter.js | 32 +- lib/components/SiteMap/index.js | 2 +- lib/components/StoryMap/StoryMap.js | 52 +- lib/components/StoryMap/index.js | 2 +- .../SyntaxHighlight/SyntaxHighlight.js | 49 +- lib/components/SyntaxHighlight/index.js | 2 +- lib/components/Theme/Theme.js | 34 +- lib/components/Theme/index.js | 2 +- .../TimeSeriesViewer/StateStorageConverter.js | 78 +- .../TimeSeriesViewer/TimeSeriesViewer.js | 9 +- .../TimeSeriesViewer/TimeSeriesViewerAxes.js | 518 +- .../TimeSeriesViewerContainer.js | 599 +- .../TimeSeriesViewerContext.js | 908 +-- .../TimeSeriesViewerDateRange.js | 237 +- .../TimeSeriesViewer/TimeSeriesViewerGraph.js | 611 +- .../TimeSeriesViewer/TimeSeriesViewerSites.js | 896 +- .../TimeSeriesViewerVariables.js | 490 +- lib/components/TimeSeriesViewer/constants.js | 10 +- lib/flow/AsyncFlow.js | 302 +- lib/flow/EpicService.js | 119 +- lib/index.js | 46 +- lib/parser/BundleParser.js | 53 +- lib/parser/DataPackageParser.js | 21 +- lib/parser/DocumentParser.js | 35 +- lib/remoteAssets/drupal-footer.html.d.ts | 2 +- lib/remoteAssets/drupal-footer.html.js | 5 +- lib/remoteAssets/drupal-header.html.d.ts | 2 +- lib/remoteAssets/drupal-header.html.js | 5 +- lib/remoteAssets/drupal-header.js | 277 +- lib/remoteAssetsMap/remoteAssets.js | 8 +- lib/remoteAssetsMap/remoteAssetsMap.js | 7 +- lib/service/AnalyticsService.js | 21 +- lib/service/BundleService.js | 104 +- lib/service/CitationService.js | 53 +- lib/service/DataCiteService.js | 140 +- lib/service/DocumentService.js | 349 +- lib/service/DrupalAssetService.js | 42 +- lib/service/NeonContextService.js | 11 +- lib/service/ReleaseService.js | 93 +- lib/service/RouteService.js | 146 +- lib/service/StateStorageService.js | 21 +- lib/service/StorageService.js | 35 +- lib/sharedState/SharedState.js | 30 +- lib/types/asyncFlow.js | 5 +- lib/types/core.js | 5 +- lib/types/internal.js | 5 +- lib/types/manifest.js | 5 +- lib/types/neonApi.js | 5 +- lib/types/neonDataPackage.js | 10 +- lib/util/browserUtil.js | 11 +- lib/util/historyUtil.js | 15 +- lib/util/index.js | 8 +- lib/util/liferayNotificationsUtil.js | 16 +- lib/util/manifestUtil.js | 149 +- lib/util/polyfillUtil.js | 8 +- lib/util/requestUtil.d.ts | 5 + lib/util/requestUtil.js | 22 + lib/util/rxUtil.js | 63 +- lib/util/typeUtil.js | 30 +- lib/vendor/paralleljs/lib/parallel.js | 94 +- lib/workers/generateTimeSeriesGraphData.js | 333 +- lib/workers/parseDomainHierarchy.js | 28 +- lib/workers/parseLocationsArray.js | 137 +- lib/workers/parseTimeSeriesData.js | 98 +- package-lock.json | 7213 ++++++++++------- package.json | 131 +- ...e.98af391f0797dc8df157fb52a8a37b1d.min.css | 2 +- public/index.html | 2 +- scripts/lib/lib-cache-remote-assets.js | 8 +- scripts/sync-assets.js | 11 +- src/App.jsx | 7 +- .../NeonEnvironment/NeonEnvironment.ts | 6 + .../TimeSeriesViewerContext.jsx | 6 +- .../remoteAssets/drupal-footer.html.js | 18 +- .../remoteAssets/drupal-header.html.js | 344 +- src/lib_components/service/DocumentService.ts | 6 +- src/lib_components/util/requestUtil.ts | 17 + 195 files changed, 16725 insertions(+), 17769 deletions(-) create mode 100644 lib/util/requestUtil.d.ts create mode 100644 lib/util/requestUtil.js create mode 100644 src/lib_components/util/requestUtil.ts diff --git a/.env.development b/.env.development index f54d0d9b..5e98458b 100644 --- a/.env.development +++ b/.env.development @@ -1,4 +1,5 @@ PORT=3010 +REACT_APP_NAME=$npm_package_name REACT_APP_VERSION=$npm_package_version #------------------------------------------------------------------------------- diff --git a/.env.production b/.env.production index 4d7ab7ec..e355d5a6 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,4 @@ +REACT_APP_NAME=$npm_package_name REACT_APP_VERSION=$npm_package_version #------------------------------------------------------------------------------- diff --git a/lib/components/AopDataViewer/AopDataViewer.js b/lib/components/AopDataViewer/AopDataViewer.js index d220171f..533c4748 100644 --- a/lib/components/AopDataViewer/AopDataViewer.js +++ b/lib/components/AopDataViewer/AopDataViewer.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -34,63 +33,51 @@ var _NeonEnvironment = _interopRequireDefault(require("../NeonEnvironment/NeonEn var _FullWidthVisualization = _interopRequireDefault(require("../FullWidthVisualization/FullWidthVisualization")); var _MapSelectionButton = _interopRequireDefault(require("../MapSelectionButton/MapSelectionButton")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -var MIN_IFRAME_WIDTH = 240; +const MIN_IFRAME_WIDTH = 240; /** Setup: CSS classes */ -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - selectionForm: { - width: '100%', - marginBottom: theme.spacing(2) - }, - iframe: { - minWidth: "".concat(MIN_IFRAME_WIDTH, "px"), - minHeight: "".concat(MIN_IFRAME_WIDTH, "px"), - border: "1px solid ".concat(theme.palette.grey[700]) - }, - divider: { - margin: theme.spacing(2, 0) - }, - label: { - color: theme.palette.grey[500], - fontSize: '0.9rem', - marginBottom: theme.spacing(0.5) - }, - optgroup: { - fontWeight: _Theme.default.typography.fontWeightMedium - }, - tooltipIconButton: { - marginTop: theme.spacing(-0.5), - marginLeft: theme.spacing(0.5) - }, - openInNewLink: { - display: 'block', - width: '100%', - textAlign: 'right', - marginTop: theme.spacing(0.5), - fontSize: '0.8rem' - }, - openInNewIcon: { - fontSize: '0.95rem', - margin: theme.spacing(0, 0.5, -0.25, 0) - } - }; -}); +const useStyles = (0, _styles.makeStyles)(theme => ({ + selectionForm: { + width: '100%', + marginBottom: theme.spacing(2) + }, + iframe: { + minWidth: "".concat(MIN_IFRAME_WIDTH, "px"), + minHeight: "".concat(MIN_IFRAME_WIDTH, "px"), + border: "1px solid ".concat(theme.palette.grey[700]) + }, + divider: { + margin: theme.spacing(2, 0) + }, + label: { + color: theme.palette.grey[500], + fontSize: '0.9rem', + marginBottom: theme.spacing(0.5) + }, + optgroup: { + fontWeight: _Theme.default.typography.fontWeightMedium + }, + tooltipIconButton: { + marginTop: theme.spacing(-0.5), + marginLeft: theme.spacing(0.5) + }, + openInNewLink: { + display: 'block', + width: '100%', + textAlign: 'right', + marginTop: theme.spacing(0.5), + fontSize: '0.8rem' + }, + openInNewIcon: { + fontSize: '0.95rem', + margin: theme.spacing(0, 0.5, -0.25, 0) + } +})); /** Function: Parse the response from the Visus API from its original shape @@ -98,39 +85,33 @@ var useStyles = (0, _styles.makeStyles)(function (theme) { each containing an array of flights. Each flight contains the month and URL. */ /* eslint-disable no-param-reassign, function-paren-newline */ -var parseFetchResponse = function parseFetchResponse(response) { - return response.data.siteCodes.reduce(function (obj, site) { - obj[site.siteCode] = site.availableMonths.reduce(function (siteObj, yearMonth, idx) { - var year = parseInt(yearMonth.substr(0, 4), 10); - var month = yearMonth.substr(5, 2); - if (!siteObj[year]) { - siteObj[year] = []; - } - siteObj[year].push({ - month: month, - url: site.availableDataUrls[idx] - }); - return siteObj; - }, {}); - return obj; +const parseFetchResponse = response => response.data.siteCodes.reduce((obj, site) => { + obj[site.siteCode] = site.availableMonths.reduce((siteObj, yearMonth, idx) => { + const year = parseInt(yearMonth.substr(0, 4), 10); + const month = yearMonth.substr(5, 2); + if (!siteObj[year]) { + siteObj[year] = []; + } + siteObj[year].push({ + month, + url: site.availableDataUrls[idx] + }); + return siteObj; }, {}); -}; + return obj; +}, {}); /* eslint-enable no-param-reassign, function-paren-newline */ /** Functions to get slider marks and bounds Limit slider marks to one per year where the year is the slider value */ -var getCurrentSliderMarks = function getCurrentSliderMarks(currentYears) { - return Array.from(new Set(Object.keys(currentYears || {}).sort().map(function (year) { - return { - label: year, - value: year - }; - }))); -}; -var getCurrentSliderBounds = function getCurrentSliderBounds(currentYears) { - var years = Object.keys(currentYears).sort(); +const getCurrentSliderMarks = currentYears => Array.from(new Set(Object.keys(currentYears || {}).sort().map(year => ({ + label: year, + value: year +})))); +const getCurrentSliderBounds = currentYears => { + const years = Object.keys(currentYears).sort(); if (years < 2) { return null; } @@ -143,46 +124,52 @@ var getCurrentSliderBounds = function getCurrentSliderBounds(currentYears) { /** Main Function */ -var AopDataViewer = function AopDataViewer(props) { - var classes = useStyles(_Theme.default); - var productCode = props.productCode, - showTitle = props.showTitle, - fillContainer = props.fillContainer, - showOpenInNewWindow = props.showOpenInNewWindow; - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - neonContextData = _NeonContext$useNeonC2[0].data; - var sites = neonContextData.sites, - states = neonContextData.states; - var belowSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('xs')); - var atSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('sm')); +const AopDataViewer = props => { + const classes = useStyles(_Theme.default); + const { + productCode, + showTitle, + fillContainer, + showOpenInNewWindow + } = props; + const [{ + data: neonContextData + }] = _NeonContext.default.useNeonContextState(); + const { + sites, + states + } = neonContextData; + const belowSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('xs')); + const atSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('sm')); /** Getters for site description and data set title */ - var getSiteDescription = function getSiteDescription(site) { - var includeState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + const getSiteDescription = function (site) { + let includeState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; if (sites[site]) { - var state = includeState ? ", ".concat(sites[site].stateCode) : ''; + const state = includeState ? ", ".concat(sites[site].stateCode) : ''; return "".concat(sites[site].description).concat(state); } return null; }; - var getDataSetTitle = function getDataSetTitle(selection, data) { + const getDataSetTitle = (selection, data) => { if (!selection || !data) { return ''; } - var site = selection.site, - year = selection.year, - flight = selection.flight; + const { + site, + year, + flight + } = selection; if (!site || !year || !flight) { return ''; } - var flightIdx = flight - 1; + const flightIdx = flight - 1; if (!data[site] || !data[site][year] || !data[site][year][flightIdx]) { return ''; } - var parts = { + const parts = { site: getSiteDescription(site), date: (0, _dateformat.default)(new Date("".concat(year, "-").concat(data[site][year][flightIdx].month, "-02")), 'mmmm yyyy'), flight: "Flight ".concat(flight, "/").concat(data[site][year].length) @@ -194,10 +181,7 @@ var AopDataViewer = function AopDataViewer(props) { State: data Object, keyed by site code and then year, with each year containing an array of flight objects. */ - var _useState = (0, _react.useState)({}), - _useState2 = _slicedToArray(_useState, 2), - data = _useState2[0], - setData = _useState2[1]; + const [data, setData] = (0, _react.useState)({}); /** State: iFrame Width @@ -205,16 +189,18 @@ var AopDataViewer = function AopDataViewer(props) { keeping the component at its maximum width at all times and with an appropriate aspect ratio given the width. */ - var iframeRef = (0, _react.useRef)(null); + const iframeRef = (0, _react.useRef)(null); /** State: currentSelection Object containing current site, year, and flight to show in the iframe */ - var initialSite = props.initialSite, - initialYear = props.initialYear, - initialFlight = props.initialFlight; - var initialCurrentSelection = { + const { + initialSite, + initialYear, + initialFlight + } = props; + const initialCurrentSelection = { site: initialSite || null, year: initialYear || null, flight: initialFlight || null, @@ -224,30 +210,27 @@ var AopDataViewer = function AopDataViewer(props) { max: 2050 } }; - var _useState3 = (0, _react.useState)(initialCurrentSelection), - _useState4 = _slicedToArray(_useState3, 2), - currentSelection = _useState4[0], - setCurrentSelection = _useState4[1]; - var handleSiteChange = (0, _react.useCallback)(function () { - var site = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + const [currentSelection, setCurrentSelection] = (0, _react.useState)(initialCurrentSelection); + const handleSiteChange = (0, _react.useCallback)(function () { + let site = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; if (!data || !Object.keys(data).length) { return; } - var newSite = site; + let newSite = site; if (site === null) { newSite = initialSite || Object.keys(data)[0]; } if (!data[newSite] || !Object.keys(data[newSite]).length) { return; } - var newYear = parseInt(Object.keys(data[newSite]).sort().reverse()[0], 10); + let newYear = parseInt(Object.keys(data[newSite]).sort().reverse()[0], 10); if (site === null && initialYear && data[newSite][initialYear]) { newYear = initialYear; } if (!data[newSite][newYear].length) { return; } - var newFlight = data[newSite][newYear].length; + let newFlight = data[newSite][newYear].length; if (site === null && initialFlight && data[newSite][newYear][initialFlight - 1]) { newFlight = initialFlight; } @@ -259,66 +242,60 @@ var AopDataViewer = function AopDataViewer(props) { sliderBounds: getCurrentSliderBounds(data[newSite]) }); }, [initialSite, initialYear, initialFlight, data]); - var handleSliderChange = function handleSliderChange(year) { - var validYears = Object.keys(data[currentSelection.site]).map(function (y) { - return parseInt(y, 10); - }); + const handleSliderChange = year => { + const validYears = Object.keys(data[currentSelection.site]).map(y => parseInt(y, 10)); if (!year || !validYears.includes(year) || year === currentSelection.year) { return; } - var flight = data[currentSelection.site][year].length; - setCurrentSelection(function (previousCurrentSelection) { - return _extends({}, previousCurrentSelection, { - year: year, - flight: flight - }); - }); + const flight = data[currentSelection.site][year].length; + setCurrentSelection(previousCurrentSelection => _extends({}, previousCurrentSelection, { + year, + flight + })); }; - var handleSliderButtonClick = function handleSliderButtonClick(direction) { + const handleSliderButtonClick = direction => { if (!['next', 'previous'].includes(direction)) { return; } - var validYears = Object.keys(data[currentSelection.site]).map(function (y) { - return parseInt(y, 10); - }); - var currentYearIdx = validYears.indexOf(currentSelection.year); - var nudge = direction === 'next' ? 1 : -1; - var newYear = validYears[currentYearIdx + nudge]; + const validYears = Object.keys(data[currentSelection.site]).map(y => parseInt(y, 10)); + const currentYearIdx = validYears.indexOf(currentSelection.year); + const nudge = direction === 'next' ? 1 : -1; + const newYear = validYears[currentYearIdx + nudge]; if (!newYear) { return; } handleSliderChange(newYear); }; - var handleFlightChange = function handleFlightChange(flight) { + const handleFlightChange = flight => { if (Number.isNaN(flight) || !data[currentSelection.site][currentSelection.year][flight - 1]) { return; } - setCurrentSelection(function (previousCurrentSelection) { - return _extends({}, previousCurrentSelection, { - flight: flight - }); - }); + setCurrentSelection(previousCurrentSelection => _extends({}, previousCurrentSelection, { + flight + })); }; - var getCurrentIframeSrc = function getCurrentIframeSrc() { - var site = currentSelection.site, - year = currentSelection.year, - flight = currentSelection.flight; + const getCurrentIframeSrc = () => { + const { + site, + year, + flight + } = currentSelection; if (!site || !year || !flight) { return ''; } - var flightIdx = flight - 1; + const flightIdx = flight - 1; if (!data[site] || !data[site][year] || !data[site][year][flightIdx]) { return ''; } - var yearData = data[site][year]; + const yearData = data[site][year]; if (!yearData[flightIdx].month) { return ''; } - var yearFlightMonth = yearData[flightIdx].month; - var currentDataUrl = data[site][year][flightIdx].url; - var queryParams = "&dataproduct=".concat(productCode, "&site=").concat(site, "&month=").concat(year, "-").concat(yearFlightMonth); - var appliedDataUrl = "".concat(currentDataUrl).concat(queryParams); - var title = encodeURIComponent(getDataSetTitle(currentSelection, data)); + const yearFlightMonth = yearData[flightIdx].month; + const currentDataUrl = data[site][year][flightIdx].url; + const queryParams = "&dataproduct=".concat(productCode, "&site=").concat(site, "&month=").concat(year, "-").concat(yearFlightMonth); + const appliedDataUrl = "".concat(currentDataUrl).concat(queryParams); + const title = encodeURIComponent(getDataSetTitle(currentSelection, data)); return "".concat(_NeonEnvironment.default.getVisusIframeBaseUrl(), "?").concat(appliedDataUrl, "&title=").concat(title); }; @@ -327,39 +304,28 @@ var AopDataViewer = function AopDataViewer(props) { Booleans for whether the initial data availability fetch has been called, whether it has completed (resolved OK or with an error), and whether it failed. */ - var _useState5 = (0, _react.useState)(false), - _useState6 = _slicedToArray(_useState5, 2), - fetchCalled = _useState6[0], - setFetchCalled = _useState6[1]; - var _useState7 = (0, _react.useState)(false), - _useState8 = _slicedToArray(_useState7, 2), - fetchSucceeded = _useState8[0], - setFetchSucceeded = _useState8[1]; - var _useState9 = (0, _react.useState)(false), - _useState10 = _slicedToArray(_useState9, 2), - fetchFailed = _useState10[0], - setFetchFailed = _useState10[1]; + const [fetchCalled, setFetchCalled] = (0, _react.useState)(false); + const [fetchSucceeded, setFetchSucceeded] = (0, _react.useState)(false); + const [fetchFailed, setFetchFailed] = (0, _react.useState)(false); /** Effect: fetch and parse available data */ - var handleFetchProductByCode = (0, _react.useCallback)(function () { - return (0, _ajax.ajax)({ - method: 'GET', - url: "".concat(_NeonEnvironment.default.getVisusProductsBaseUrl(), "/").concat(productCode), - crossDomain: true - }).pipe((0, _rxjs.map)(function (response) { - if (!response || !response.response || !response.response.data || !response.response.data.siteCodes || response.response.data.siteCodes.length <= 0) { - throw Error('Product response contained no data'); - } - setData(parseFetchResponse(response.response)); - setFetchSucceeded(true); - }), (0, _rxjs.catchError)(function () { - setFetchFailed(true); - return (0, _rxjs.of)('Product not found'); - })).subscribe(); - }, [productCode]); - (0, _react.useEffect)(function () { + const handleFetchProductByCode = (0, _react.useCallback)(() => (0, _ajax.ajax)({ + method: 'GET', + url: "".concat(_NeonEnvironment.default.getVisusProductsBaseUrl(), "/").concat(productCode), + crossDomain: true + }).pipe((0, _rxjs.map)(response => { + if (!response || !response.response || !response.response.data || !response.response.data.siteCodes || response.response.data.siteCodes.length <= 0) { + throw Error('Product response contained no data'); + } + setData(parseFetchResponse(response.response)); + setFetchSucceeded(true); + }), (0, _rxjs.catchError)(() => { + setFetchFailed(true); + return (0, _rxjs.of)('Product not found'); + })).subscribe(), [productCode]); + (0, _react.useEffect)(() => { if (!fetchCalled) { handleFetchProductByCode(); setFetchCalled(true); @@ -368,39 +334,35 @@ var AopDataViewer = function AopDataViewer(props) { handleSiteChange(); } }, [fetchCalled, fetchSucceeded, currentSelection, handleFetchProductByCode, handleSiteChange]); - var renderSiteSelect = function renderSiteSelect() { - var sitesByStateName = {}; - Object.keys(data).forEach(function (site) { + const renderSiteSelect = () => { + const sitesByStateName = {}; + Object.keys(data).forEach(site => { if (!sites[site]) { return; } - var stateName = states[sites[site].stateCode].name; + const stateName = states[sites[site].stateCode].name; if (!sitesByStateName[stateName]) { sitesByStateName[stateName] = []; } sitesByStateName[stateName].push(site); }); - var menuItems = Object.keys(sitesByStateName).sort().flatMap(function (stateName) { - return [/*#__PURE__*/_react.default.createElement(_MenuItem.default, { - key: stateName, - value: stateName, - className: classes.optgroup, - style: { - opacity: 1 - }, - disabled: true - }, stateName)].concat(sitesByStateName[stateName].map(function (site) { - return /*#__PURE__*/_react.default.createElement(_MenuItem.default, { - key: site, - value: site - }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, { - display: "block" - }, site), /*#__PURE__*/_react.default.createElement(_Typography.default, { - display: "block", - variant: "caption" - }, getSiteDescription(site, false)))); - })); - }); + const menuItems = Object.keys(sitesByStateName).sort().flatMap(stateName => [/*#__PURE__*/_react.default.createElement(_MenuItem.default, { + key: stateName, + value: stateName, + className: classes.optgroup, + style: { + opacity: 1 + }, + disabled: true + }, stateName)].concat(sitesByStateName[stateName].map(site => /*#__PURE__*/_react.default.createElement(_MenuItem.default, { + key: site, + value: site + }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, { + display: "block" + }, site), /*#__PURE__*/_react.default.createElement(_Typography.default, { + display: "block", + variant: "caption" + }, getSiteDescription(site, false))))))); return /*#__PURE__*/_react.default.createElement("div", { style: { display: 'flex', @@ -416,28 +378,24 @@ var AopDataViewer = function AopDataViewer(props) { marginRight: _Theme.default.spacing(1) } }, - onSave: function onSave(newSites) { - handleSiteChange(_toConsumableArray(newSites)[0]); + onSave: newSites => { + handleSiteChange([...newSites][0]); }, icon: !atSm }), /*#__PURE__*/_react.default.createElement(_Select.default, { "data-selenium": "aop-data-viewer.site-select", value: currentSelection.site || '', - onChange: function onChange(event) { - return handleSiteChange(event.target.value); - }, + onChange: event => handleSiteChange(event.target.value), input: /*#__PURE__*/_react.default.createElement(_OutlinedInput.default, { name: "site", id: "site", margin: "dense" }), "aria-labelledby": "site-label", - renderValue: function renderValue(value) { - return value; - } + renderValue: value => value }, menuItems)); }; - var renderYearSlider = function renderYearSlider() { + const renderYearSlider = () => { if (!currentSelection.year) { return null; } @@ -458,9 +416,7 @@ var AopDataViewer = function AopDataViewer(props) { style: { marginRight: _Theme.default.spacing(0.5) }, - onClick: function onClick() { - return handleSliderButtonClick('previous'); - }, + onClick: () => handleSliderButtonClick('previous'), disabled: currentSelection.year === currentSelection.sliderBounds.min + 1 }, /*#__PURE__*/_react.default.createElement(_KeyboardArrowLeft.default, null))), /*#__PURE__*/_react.default.createElement("div", { style: { @@ -475,12 +431,8 @@ var AopDataViewer = function AopDataViewer(props) { max: currentSelection.sliderBounds.max, "aria-labelledby": "year-label", valueLabelDisplay: "auto", - valueLabelFormat: function valueLabelFormat(value) { - return value; - }, - onChange: function onChange(event, newYear) { - return handleSliderChange(parseInt(newYear, 10)); - } + valueLabelFormat: value => value, + onChange: (event, newYear) => handleSliderChange(parseInt(newYear, 10)) })), /*#__PURE__*/_react.default.createElement("div", { style: { flexGrow: 0 @@ -493,48 +445,40 @@ var AopDataViewer = function AopDataViewer(props) { style: { marginLeft: _Theme.default.spacing(0.5) }, - onClick: function onClick() { - return handleSliderButtonClick('next'); - }, + onClick: () => handleSliderButtonClick('next'), disabled: currentSelection.year === currentSelection.sliderBounds.max - 1 }, /*#__PURE__*/_react.default.createElement(_KeyboardArrowRight.default, null)))); }; - var renderFlightSelect = function renderFlightSelect() { - var site = currentSelection.site, - year = currentSelection.year, - flight = currentSelection.flight; + const renderFlightSelect = () => { + const { + site, + year, + flight + } = currentSelection; if (!flight || !data[site] || !data[site][year] || !data[site][year].length) { return null; } - var total = data[site][year].length; - var getFlightLabel = function getFlightLabel(flightNumber, month) { - return "".concat(flightNumber, "/").concat(total, " (").concat((0, _dateformat.default)(new Date("2000-".concat(month, "-02")), 'mmmm'), ")"); - }; + const total = data[site][year].length; + const getFlightLabel = (flightNumber, month) => "".concat(flightNumber, "/").concat(total, " (").concat((0, _dateformat.default)(new Date("2000-".concat(month, "-02")), 'mmmm'), ")"); return /*#__PURE__*/_react.default.createElement(_Select.default, { "data-selenium": "aop-data-viewer.flight-select", value: flight, - onChange: function onChange(event) { - return handleFlightChange(parseInt(event.target.value, 10)); - }, + onChange: event => handleFlightChange(parseInt(event.target.value, 10)), input: /*#__PURE__*/_react.default.createElement(_OutlinedInput.default, { name: "flight", id: "flight", margin: "dense" }), "aria-labelledby": "flight-label", - renderValue: function renderValue(value) { - return getFlightLabel(value, data[site][year][value - 1].month); - }, + renderValue: value => getFlightLabel(value, data[site][year][value - 1].month), disabled: total === 1 - }, data[site][year].map(function (f, idx) { - return /*#__PURE__*/_react.default.createElement(_MenuItem.default, { - key: "".concat(f.url), - value: idx + 1 - }, getFlightLabel(idx + 1, f.month)); - })); + }, data[site][year].map((f, idx) => /*#__PURE__*/_react.default.createElement(_MenuItem.default, { + key: "".concat(f.url), + value: idx + 1 + }, getFlightLabel(idx + 1, f.month)))); }; - var renderInputLabel = function renderInputLabel(input) { - var tooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + const renderInputLabel = function (input) { + let tooltip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; return /*#__PURE__*/_react.default.createElement(_Typography.default, { className: classes.label, id: "".concat(input, "-label") @@ -550,88 +494,86 @@ var AopDataViewer = function AopDataViewer(props) { fontSize: "inherit" }))) : null); }; - var tooltips = { + const tooltips = { site: 'Use the map or the menu below to select a site to display. Only one site can be viewed at a time.', year: 'This slider can be used to move back and forth through time for a given site.', flight: 'Most sites are visited once per year, but sometimes subsequent flights are necessary to get complete data for that year. If more than one flight is available for a given site/year then this field can be used to select particular flights of interest.' }; - var visusLink = /*#__PURE__*/_react.default.createElement(_Link.default, { + const visusLink = /*#__PURE__*/_react.default.createElement(_Link.default, { href: "https://visus.org/", target: "_blank", "data-external": "VISUS", rel: "noopener noreferrer" }, "Visus Project at the Univeristy of Utah"); - var renderSelectionForm = function renderSelectionForm() { - return /*#__PURE__*/_react.default.createElement("form", { - className: classes.selectionForm, - autoComplete: "off" - }, showTitle ? /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "h5", - gutterBottom: true - }, "AOP Data Viewer") : null, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "caption", - gutterBottom: true - }, "This viewer allows for interactive exploration of remotely sensed data from the Airborne Observation Platform (AOP). Change the field site and flight for this data product using the tools below to stream different data into view. Pan and zoom in the view to stream higher resolution imagery. This pilot data viewer is provided through a collaboration with the ", visusLink, " and more updates are planned for the future."), /*#__PURE__*/_react.default.createElement(_Divider.default, { - className: classes.divider - }), belowSm ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Grid.default, { - container: true, - spacing: 2, - justifyContent: "center", - style: { - marginBottom: _Theme.default.spacing(1) - } - }, /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 2 - }, renderInputLabel('site', tooltips.site)), /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 10 - }, renderSiteSelect())), /*#__PURE__*/_react.default.createElement(_Grid.default, { - container: true, - spacing: 2, - justifyContent: "center", - style: { - marginBottom: _Theme.default.spacing(1) - } - }, /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 2 - }, renderInputLabel('year', tooltips.year)), /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 10 - }, renderYearSlider())), /*#__PURE__*/_react.default.createElement(_Grid.default, { - container: true, - spacing: 2, - justifyContent: "center", - style: { - marginBottom: _Theme.default.spacing(1) - } - }, /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 2 - }, renderInputLabel('flight', tooltips.flight)), /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 10 - }, renderFlightSelect()))) : /*#__PURE__*/_react.default.createElement("div", { - style: { - width: '100%', - display: 'flex' - } - }, /*#__PURE__*/_react.default.createElement("div", { - style: { - flexGrow: 0 - } - }, renderInputLabel('site', tooltips.site), renderSiteSelect()), /*#__PURE__*/_react.default.createElement("div", { - style: { - flexGrow: 1, - margin: _Theme.default.spacing(0, 2) - } - }, renderInputLabel('year', tooltips.year), renderYearSlider()), /*#__PURE__*/_react.default.createElement("div", { - style: { - flexGrow: 0 - } - }, renderInputLabel('flight', tooltips.flight), renderFlightSelect()))); - }; + const renderSelectionForm = () => /*#__PURE__*/_react.default.createElement("form", { + className: classes.selectionForm, + autoComplete: "off" + }, showTitle ? /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "h5", + gutterBottom: true + }, "AOP Data Viewer") : null, /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "caption", + gutterBottom: true + }, "This viewer allows for interactive exploration of remotely sensed data from the Airborne Observation Platform (AOP). Change the field site and flight for this data product using the tools below to stream different data into view. Pan and zoom in the view to stream higher resolution imagery. This pilot data viewer is provided through a collaboration with the ", visusLink, " and more updates are planned for the future."), /*#__PURE__*/_react.default.createElement(_Divider.default, { + className: classes.divider + }), belowSm ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Grid.default, { + container: true, + spacing: 2, + justifyContent: "center", + style: { + marginBottom: _Theme.default.spacing(1) + } + }, /*#__PURE__*/_react.default.createElement(_Grid.default, { + item: true, + xs: 2 + }, renderInputLabel('site', tooltips.site)), /*#__PURE__*/_react.default.createElement(_Grid.default, { + item: true, + xs: 10 + }, renderSiteSelect())), /*#__PURE__*/_react.default.createElement(_Grid.default, { + container: true, + spacing: 2, + justifyContent: "center", + style: { + marginBottom: _Theme.default.spacing(1) + } + }, /*#__PURE__*/_react.default.createElement(_Grid.default, { + item: true, + xs: 2 + }, renderInputLabel('year', tooltips.year)), /*#__PURE__*/_react.default.createElement(_Grid.default, { + item: true, + xs: 10 + }, renderYearSlider())), /*#__PURE__*/_react.default.createElement(_Grid.default, { + container: true, + spacing: 2, + justifyContent: "center", + style: { + marginBottom: _Theme.default.spacing(1) + } + }, /*#__PURE__*/_react.default.createElement(_Grid.default, { + item: true, + xs: 2 + }, renderInputLabel('flight', tooltips.flight)), /*#__PURE__*/_react.default.createElement(_Grid.default, { + item: true, + xs: 10 + }, renderFlightSelect()))) : /*#__PURE__*/_react.default.createElement("div", { + style: { + width: '100%', + display: 'flex' + } + }, /*#__PURE__*/_react.default.createElement("div", { + style: { + flexGrow: 0 + } + }, renderInputLabel('site', tooltips.site), renderSiteSelect()), /*#__PURE__*/_react.default.createElement("div", { + style: { + flexGrow: 1, + margin: _Theme.default.spacing(0, 2) + } + }, renderInputLabel('year', tooltips.year), renderYearSlider()), /*#__PURE__*/_react.default.createElement("div", { + style: { + flexGrow: 0 + } + }, renderInputLabel('flight', tooltips.flight), renderFlightSelect()))); if (fetchFailed) { return /*#__PURE__*/_react.default.createElement("div", { className: classes.iframeContainer @@ -651,14 +593,12 @@ var AopDataViewer = function AopDataViewer(props) { }), "AOP Data Viewer is not available for this data product.") })); } - var srcUrl = getCurrentIframeSrc(); + const srcUrl = getCurrentIframeSrc(); return /*#__PURE__*/_react.default.createElement(_FullWidthVisualization.default, { vizRef: iframeRef, minWidth: MIN_IFRAME_WIDTH, allowHeightResize: fillContainer, - deriveHeightFromWidth: !fillContainer ? 'auto' : function (width, container, viz) { - return container.clientHeight - viz.offsetTop - 10; - }, + deriveHeightFromWidth: !fillContainer ? 'auto' : (width, container, viz) => container.clientHeight - viz.offsetTop - 10, containerStyle: !fillContainer ? null : { minWidth: "".concat(MIN_IFRAME_WIDTH, "px"), position: 'absolute', @@ -702,6 +642,5 @@ AopDataViewer.defaultProps = { fillContainer: false, showOpenInNewWindow: false }; -var WrappedAopDataViewer = _Theme.default.getWrappedComponent(_NeonContext.default.getWrappedComponent(AopDataViewer)); -var _default = WrappedAopDataViewer; -exports.default = _default; \ No newline at end of file +const WrappedAopDataViewer = _Theme.default.getWrappedComponent(_NeonContext.default.getWrappedComponent(AopDataViewer)); +var _default = exports.default = WrappedAopDataViewer; \ No newline at end of file diff --git a/lib/components/AopDataViewer/index.js b/lib/components/AopDataViewer/index.js index 51c80ba0..b95ae432 100644 --- a/lib/components/AopDataViewer/index.js +++ b/lib/components/AopDataViewer/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _AopDataViewer.default; } }); diff --git a/lib/components/Bundles/BundleContentBuilder.js b/lib/components/Bundles/BundleContentBuilder.js index 95d983ac..c9c75ff2 100644 --- a/lib/components/Bundles/BundleContentBuilder.js +++ b/lib/components/Bundles/BundleContentBuilder.js @@ -11,51 +11,43 @@ var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _typeUtil = require("../../util/typeUtil"); var _ReleaseService = require("../../service/ReleaseService"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var BundleContentBuilder = { - getParentProductLink: function getParentProductLink(dataProduct, release) { - var isRelease = (0, _typeUtil.isStringNonEmpty)(release) && release !== _ReleaseService.LATEST_AND_PROVISIONAL; - var href = _RouteService.default.getProductDetailPath(dataProduct.productCode, isRelease ? release : undefined); +const BundleContentBuilder = { + getParentProductLink: (dataProduct, release) => { + const isRelease = (0, _typeUtil.isStringNonEmpty)(release) && release !== _ReleaseService.LATEST_AND_PROVISIONAL; + const href = _RouteService.default.getProductDetailPath(dataProduct.productCode, isRelease ? release : undefined); return /*#__PURE__*/_react.default.createElement(_Link.default, { href: href, target: "_blank" }, "".concat(dataProduct.productName, " (").concat(dataProduct.productCode, ")")); }, - getBundledLink: function getBundledLink() { - var href = _RouteService.default.getDataProductBundlesPath(); + getBundledLink: () => { + const href = _RouteService.default.getDataProductBundlesPath(); return /*#__PURE__*/_react.default.createElement(_Link.default, { href: href, target: "_blank" }, "bundled"); }, - buildManyParentsMainContent: function buildManyParentsMainContent(dataProducts, release) { - return /*#__PURE__*/_react.default.createElement("ul", { - style: { - margin: _Theme.default.spacing(1, 0) - } - }, dataProducts.map(function (dataProduct) { - return /*#__PURE__*/_react.default.createElement("li", { - key: dataProduct.productCode - }, BundleContentBuilder.getParentProductLink(dataProduct, release)); - })); - }, - buildDefaultTitleContent: function buildDefaultTitleContent(dataProduct, release) { - var isRelease = (0, _typeUtil.isStringNonEmpty)(release) && release !== _ReleaseService.LATEST_AND_PROVISIONAL; - var bundleParentLink = BundleContentBuilder.getParentProductLink(dataProduct, isRelease ? release : undefined); - var bundledLink = BundleContentBuilder.getBundledLink(); + buildManyParentsMainContent: (dataProducts, release) => /*#__PURE__*/_react.default.createElement("ul", { + style: { + margin: _Theme.default.spacing(1, 0) + } + }, dataProducts.map(dataProduct => /*#__PURE__*/_react.default.createElement("li", { + key: dataProduct.productCode + }, BundleContentBuilder.getParentProductLink(dataProduct, release)))), + buildDefaultTitleContent: (dataProduct, release) => { + const isRelease = (0, _typeUtil.isStringNonEmpty)(release) && release !== _ReleaseService.LATEST_AND_PROVISIONAL; + const bundleParentLink = BundleContentBuilder.getParentProductLink(dataProduct, isRelease ? release : undefined); + const bundledLink = BundleContentBuilder.getBundledLink(); return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "This data product ", isRelease ? 'release ' : '', "is ", bundledLink, " into ", bundleParentLink); }, - buildDefaultSplitTitleContent: function buildDefaultSplitTitleContent(isRelease, terminalChar) { - var bundledLink = BundleContentBuilder.getBundledLink(); + buildDefaultSplitTitleContent: (isRelease, terminalChar) => { + const bundledLink = BundleContentBuilder.getBundledLink(); return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "This data product ", isRelease ? 'release ' : '', "is ", bundledLink, " into the following data product", isRelease ? ' releases' : 's', "".concat(terminalChar)); }, - buildDefaultSubTitleContent: function buildDefaultSubTitleContent(forwardAvailability, hasManyParents) { - return ( - /*#__PURE__*/ - // eslint-disable-next-line react/jsx-no-useless-fragment - _react.default.createElement(_react.default.Fragment, null, forwardAvailability ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "It is not available as a standalone download. Data availability shown below reflects availability of the entire bundle.") : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "It is not available as a standalone download. Data availability information and data product download is only available through the bundle data ", hasManyParents ? 'products' : 'product', ".")) - ); - } + buildDefaultSubTitleContent: (forwardAvailability, hasManyParents) => + /*#__PURE__*/ + // eslint-disable-next-line react/jsx-no-useless-fragment + _react.default.createElement(_react.default.Fragment, null, forwardAvailability ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "It is not available as a standalone download. Data availability shown below reflects availability of the entire bundle.") : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "It is not available as a standalone download. Data availability information and data product download is only available through the bundle data ", hasManyParents ? 'products' : 'product', ".")) }; Object.freeze(BundleContentBuilder); -var _default = BundleContentBuilder; -exports.default = _default; \ No newline at end of file +var _default = exports.default = BundleContentBuilder; \ No newline at end of file diff --git a/lib/components/Bundles/BundleListItemIcon.js b/lib/components/Bundles/BundleListItemIcon.js index b831e2df..98bcfbad 100644 --- a/lib/components/Bundles/BundleListItemIcon.js +++ b/lib/components/Bundles/BundleListItemIcon.js @@ -11,17 +11,17 @@ var _reactFontawesome = require("@fortawesome/react-fontawesome"); var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons"); var _Theme = _interopRequireDefault(require("../Theme/Theme")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - bundleIcon: { - padding: '5px', - marginRight: theme.spacing(2) - } - }; -}); -var BundleListItemIcon = function BundleListItemIcon(props) { - var classes = useStyles(_Theme.default); - var isSplit = props.isSplit; +const useStyles = (0, _styles.makeStyles)(theme => ({ + bundleIcon: { + padding: '5px', + marginRight: theme.spacing(2) + } +})); +const BundleListItemIcon = props => { + const classes = useStyles(_Theme.default); + const { + isSplit + } = props; return /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, { icon: isSplit ? _freeSolidSvgIcons.faBoxesStacked : _freeSolidSvgIcons.faBox, size: "2x", @@ -31,5 +31,4 @@ var BundleListItemIcon = function BundleListItemIcon(props) { BundleListItemIcon.defaultProps = { isSplit: false }; -var _default = BundleListItemIcon; -exports.default = _default; \ No newline at end of file +var _default = exports.default = BundleListItemIcon; \ No newline at end of file diff --git a/lib/components/Bundles/DataProductBundleCard.js b/lib/components/Bundles/DataProductBundleCard.js index 6b3f525f..f4bf131d 100644 --- a/lib/components/Bundles/DataProductBundleCard.js +++ b/lib/components/Bundles/DataProductBundleCard.js @@ -13,38 +13,38 @@ var _InfoMessageCard = _interopRequireDefault(require("../Card/InfoMessageCard") var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - cardIcon: { - color: 'rgba(0, 0, 0, 0.9)', - padding: '5px 0px', - fontSize: '1.5em', - marginRight: theme.spacing(2) - }, - cardSecondaryIcon: { - color: 'rgba(138, 191, 236, 0.9)', - // theme.colors.LIGHT_BLUE[200] with 'a' value applied - marginLeft: theme.spacing(2), - fontSize: '1.5rem' - }, - cardTitleContentContainer: { - padding: theme.spacing(2, 2.5, 0.5, 2.5) - }, - cardMessageContentContainer: { - padding: theme.spacing(0.25, 2.5, 2, 2.5) - } - }; -}); -var DataProductBundleCard = function DataProductBundleCard(props) { - var classes = useStyles(_Theme.default); - var titleContent = props.titleContent, - subTitleContent = props.subTitleContent, - detailContent = props.detailContent, - customContent = props.customContent, - isSplit = props.isSplit, - customClasses = props.classes; - var customIconClass = customClasses ? customClasses.cardIcon : undefined; - var renderContent = function renderContent() { +const useStyles = (0, _styles.makeStyles)(theme => ({ + cardIcon: { + color: 'rgba(0, 0, 0, 0.9)', + padding: '5px 0px', + fontSize: '1.5em', + marginRight: theme.spacing(2) + }, + cardSecondaryIcon: { + color: 'rgba(138, 191, 236, 0.9)', + // theme.colors.LIGHT_BLUE[200] with 'a' value applied + marginLeft: theme.spacing(2), + fontSize: '1.5rem' + }, + cardTitleContentContainer: { + padding: theme.spacing(2, 2.5, 0.5, 2.5) + }, + cardMessageContentContainer: { + padding: theme.spacing(0.25, 2.5, 2, 2.5) + } +})); +const DataProductBundleCard = props => { + const classes = useStyles(_Theme.default); + const { + titleContent, + subTitleContent, + detailContent, + customContent, + isSplit, + classes: customClasses + } = props; + const customIconClass = customClasses ? customClasses.cardIcon : undefined; + const renderContent = () => { if ((0, _typeUtil.exists)(customContent)) { // eslint-disable-next-line react/jsx-no-useless-fragment return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, customContent); @@ -81,5 +81,4 @@ DataProductBundleCard.defaultProps = { isSplit: false, classes: undefined }; -var _default = DataProductBundleCard; -exports.default = _default; \ No newline at end of file +var _default = exports.default = DataProductBundleCard; \ No newline at end of file diff --git a/lib/components/Bundles/index.js b/lib/components/Bundles/index.js index 3e67f491..357b8968 100644 --- a/lib/components/Bundles/index.js +++ b/lib/components/Bundles/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _DataProductBundleCard.default; } }); diff --git a/lib/components/Button/SplitButton.js b/lib/components/Button/SplitButton.js index c020a141..234f50b3 100644 --- a/lib/components/Button/SplitButton.js +++ b/lib/components/Button/SplitButton.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -19,79 +18,67 @@ var _ArrowDropDown = _interopRequireDefault(require("@material-ui/icons/ArrowDro var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -var SplitButton = function SplitButton(props) { - var name = props.name, - options = props.options, - selectedOption = props.selectedOption, - selectedOptionDisplayCallback = props.selectedOptionDisplayCallback, - onClick = props.onClick, - onChange = props.onChange, - buttonGroupProps = props.buttonGroupProps, - buttonMenuProps = props.buttonMenuProps, - buttonProps = props.buttonProps; - var _useState = (0, _react.useState)(false), - _useState2 = _slicedToArray(_useState, 2), - open = _useState2[0], - setOpen = _useState2[1]; - var _useState3 = (0, _react.useState)(selectedOption), - _useState4 = _slicedToArray(_useState3, 2), - stateSelectedOption = _useState4[0], - setStateSelectedOption = _useState4[1]; - var anchorRef = (0, _react.useRef)(null); - var appliedButtonGroupProps = { +const SplitButton = props => { + const { + name, + options, + selectedOption, + selectedOptionDisplayCallback, + onClick, + onChange, + buttonGroupProps, + buttonMenuProps, + buttonProps + } = props; + const [open, setOpen] = (0, _react.useState)(false); + const [stateSelectedOption, setStateSelectedOption] = (0, _react.useState)(selectedOption); + const anchorRef = (0, _react.useRef)(null); + let appliedButtonGroupProps = { variant: 'outlined', color: 'primary' }; if ((0, _typeUtil.exists)(buttonGroupProps)) { appliedButtonGroupProps = buttonGroupProps; } - var appliedButtonProps = { + let appliedButtonProps = { color: 'primary', size: 'small' }; if ((0, _typeUtil.exists)(buttonProps)) { appliedButtonProps = buttonProps; } - var appliedButtonMenuProps = { + let appliedButtonMenuProps = { color: 'primary', size: 'small' }; if ((0, _typeUtil.exists)(buttonMenuProps)) { appliedButtonMenuProps = buttonMenuProps; } - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (selectedOption === stateSelectedOption) return; setStateSelectedOption(selectedOption); }, [selectedOption, stateSelectedOption]); - var handleClick = function handleClick() { + const handleClick = () => { onClick(stateSelectedOption); }; - var handleMenuItemClick = function handleMenuItemClick(event, index) { + const handleMenuItemClick = (event, index) => { setStateSelectedOption(options[index]); onChange(options[index]); setOpen(false); }; - var handleToggle = function handleToggle() { - setOpen(function (prevOpen) { - return !prevOpen; - }); + const handleToggle = () => { + setOpen(prevOpen => !prevOpen); }; - var handleClose = function handleClose(event) { + const handleClose = event => { if (anchorRef.current && anchorRef.current.contains(event.target)) { return; } setOpen(false); }; - var renderSelectedOption = function renderSelectedOption() { + const renderSelectedOption = () => { if ((0, _typeUtil.exists)(selectedOptionDisplayCallback)) { // eslint-disable-next-line max-len return selectedOptionDisplayCallback(stateSelectedOption); @@ -123,9 +110,11 @@ var SplitButton = function SplitButton(props) { anchorEl: anchorRef.current, open: open, role: undefined - }, function (_ref) { - var TransitionProps = _ref.TransitionProps, - placement = _ref.placement; + }, _ref => { + let { + TransitionProps, + placement + } = _ref; return /*#__PURE__*/_react.default.createElement(_Grow.default, _extends({}, TransitionProps, { style: { transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom' @@ -134,17 +123,12 @@ var SplitButton = function SplitButton(props) { onClickAway: handleClose }, /*#__PURE__*/_react.default.createElement(_MenuList.default, { id: "".concat(name, "-split-button-menu") - }, options.map(function (option, index) { - return /*#__PURE__*/_react.default.createElement(_MenuItem.default, { - key: option, - selected: option === stateSelectedOption, - onClick: function onClick(event) { - return handleMenuItemClick(event, index); - } - }, option); - }))))); + }, options.map((option, index) => /*#__PURE__*/_react.default.createElement(_MenuItem.default, { + key: option, + selected: option === stateSelectedOption, + onClick: event => handleMenuItemClick(event, index) + }, option)))))); }))); }; -var WrappedSplitButton = _Theme.default.getWrappedComponent(SplitButton); -var _default = WrappedSplitButton; -exports.default = _default; \ No newline at end of file +const WrappedSplitButton = _Theme.default.getWrappedComponent(SplitButton); +var _default = exports.default = WrappedSplitButton; \ No newline at end of file diff --git a/lib/components/Button/index.js b/lib/components/Button/index.js index 86feeb45..dc38aebd 100644 --- a/lib/components/Button/index.js +++ b/lib/components/Button/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _SplitButton.default; } }); diff --git a/lib/components/Card/BaseCard.js b/lib/components/Card/BaseCard.js index c99754c2..a2b5475e 100644 --- a/lib/components/Card/BaseCard.js +++ b/lib/components/Card/BaseCard.js @@ -20,41 +20,39 @@ var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint-disable react/require-default-props */ -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - startFlex: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center' - }, - divider: { - margin: muiTheme.spacing(0, 3, 0, 3) - }, - messageContainer: { - padding: muiTheme.spacing(3, 3, 3, 3) - } - }) - ); -}); -var CardType = /*#__PURE__*/function (CardType) { +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + startFlex: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center' + }, + divider: { + margin: muiTheme.spacing(0, 3, 0, 3) + }, + messageContainer: { + padding: muiTheme.spacing(3, 3, 3, 3) + } +})); +let CardType = exports.CardType = /*#__PURE__*/function (CardType) { CardType["INFO"] = "INFO"; CardType["WARN"] = "WARN"; CardType["ERROR"] = "ERROR"; return CardType; }({}); -exports.CardType = CardType; -var BaseCard = function BaseCard(props) { - var classes = useStyles(_Theme.default); - var type = props.type, - title = props.title, - calloutClasses = props.calloutClasses, - message = props.message, - titleContent = props.titleContent, - actionLabel = props.actionLabel, - onActionClick = props.onActionClick; - var iconContent = /*#__PURE__*/_react.default.createElement(_Info.default, { +const BaseCard = props => { + const classes = useStyles(_Theme.default); + const { + type, + title, + calloutClasses, + message, + titleContent, + actionLabel, + onActionClick + } = props; + let iconContent = /*#__PURE__*/_react.default.createElement(_Info.default, { fontSize: "large", className: calloutClasses.calloutIcon }); @@ -75,8 +73,8 @@ var BaseCard = function BaseCard(props) { default: break; } - var renderTitle = function renderTitle() { - var titleTextContent = null; + const renderTitle = () => { + let titleTextContent = null; if ((0, _typeUtil.isStringNonEmpty)(title)) { titleTextContent = /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "subtitle2", @@ -85,7 +83,7 @@ var BaseCard = function BaseCard(props) { } }, title); } - var appliedTitleContent = null; + let appliedTitleContent = null; if ((0, _typeUtil.exists)(titleContent)) { appliedTitleContent = /*#__PURE__*/_react.default.createElement("div", { style: { @@ -93,8 +91,8 @@ var BaseCard = function BaseCard(props) { } }, titleContent); } - var action; - var appliedLabel = (0, _typeUtil.isStringNonEmpty)(actionLabel) ? actionLabel : 'Reset'; + let action; + const appliedLabel = (0, _typeUtil.isStringNonEmpty)(actionLabel) ? actionLabel : 'Reset'; if ((0, _typeUtil.exists)(onActionClick)) { action = /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.default, { variant: "outlined", @@ -104,7 +102,7 @@ var BaseCard = function BaseCard(props) { } return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconContent, titleTextContent, appliedTitleContent, action); }; - var content = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CardContent.default, { + const content = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CardContent.default, { className: classes.startFlex }, renderTitle()), (0, _typeUtil.isStringNonEmpty)(message) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Divider.default, { className: classes.divider @@ -117,5 +115,4 @@ var BaseCard = function BaseCard(props) { className: calloutClasses.callout }, content)); }; -var _default = BaseCard; -exports.default = _default; \ No newline at end of file +var _default = exports.default = BaseCard; \ No newline at end of file diff --git a/lib/components/Card/BaseMessageCard.js b/lib/components/Card/BaseMessageCard.js index c71ef5ce..60340b3e 100644 --- a/lib/components/Card/BaseMessageCard.js +++ b/lib/components/Card/BaseMessageCard.js @@ -15,52 +15,50 @@ var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint-disable react/require-default-props */ -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - startFlex: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center' - }, - titleContentContainer: { - padding: muiTheme.spacing(2, 2.5, 1.5, 2.5) - }, - textTitleContent: { - flexGrow: 1, - textTransform: 'uppercase', - fontSize: '0.775rem' - }, - messageContainer: { - padding: muiTheme.spacing(0, 3, 3, 3) - } - }) - ); -}); -var MessageCardType = /*#__PURE__*/function (MessageCardType) { +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + startFlex: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center' + }, + titleContentContainer: { + padding: muiTheme.spacing(2, 2.5, 1.5, 2.5) + }, + textTitleContent: { + flexGrow: 1, + textTransform: 'uppercase', + fontSize: '0.775rem' + }, + messageContainer: { + padding: muiTheme.spacing(0, 3, 3, 3) + } +})); +let MessageCardType = exports.MessageCardType = /*#__PURE__*/function (MessageCardType) { MessageCardType["INFO"] = "INFO"; return MessageCardType; }({}); -exports.MessageCardType = MessageCardType; -var BaseMessageCard = function BaseMessageCard(props) { - var classes = useStyles(_Theme.default); - var type = props.type, - messageCardClasses = props.messageCardClasses, - icon = props.icon, - title = props.title, - titleContent = props.titleContent, - message = props.message, - messageContent = props.messageContent; - var appliedTitleContentContainer = classes.titleContentContainer; +const BaseMessageCard = props => { + const classes = useStyles(_Theme.default); + const { + type, + messageCardClasses, + icon, + title, + titleContent, + message, + messageContent + } = props; + let appliedTitleContentContainer = classes.titleContentContainer; if (messageCardClasses && messageCardClasses.cardTitleContentContainer) { appliedTitleContentContainer = messageCardClasses.cardTitleContentContainer; } - var iconContent = /*#__PURE__*/_react.default.createElement(_InfoOutlined.default, { + let iconContent = /*#__PURE__*/_react.default.createElement(_InfoOutlined.default, { fontSize: "small", className: messageCardClasses.primaryIcon }); - var secondaryIconContent = null; + let secondaryIconContent = null; switch (type) { case MessageCardType.INFO: if ((0, _typeUtil.exists)(icon)) { @@ -75,15 +73,15 @@ var BaseMessageCard = function BaseMessageCard(props) { default: break; } - var renderTitle = function renderTitle() { - var titleTextContent = null; + const renderTitle = () => { + let titleTextContent = null; if ((0, _typeUtil.isStringNonEmpty)(title)) { titleTextContent = /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "subtitle2", className: classes.textTitleContent }, title); } - var appliedTitleContent = null; + let appliedTitleContent = null; if ((0, _typeUtil.exists)(titleContent)) { appliedTitleContent = /*#__PURE__*/_react.default.createElement("div", { style: { @@ -93,9 +91,9 @@ var BaseMessageCard = function BaseMessageCard(props) { } return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, iconContent, titleTextContent, appliedTitleContent, secondaryIconContent); }; - var renderMessage = function renderMessage() { - var hasCustomClass = messageCardClasses && messageCardClasses.messageContentContainer; - var injectedMessageContainerClass = hasCustomClass ? messageCardClasses.messageContentContainer : classes.messageContainer; + const renderMessage = () => { + const hasCustomClass = messageCardClasses && messageCardClasses.messageContentContainer; + const injectedMessageContainerClass = hasCustomClass ? messageCardClasses.messageContentContainer : classes.messageContainer; if ((0, _typeUtil.exists)(messageContent)) { return /*#__PURE__*/_react.default.createElement("div", { className: injectedMessageContainerClass @@ -110,12 +108,11 @@ var BaseMessageCard = function BaseMessageCard(props) { } return null; }; - var content = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CardContent.default, { + const content = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CardContent.default, { className: "".concat(classes.startFlex, " ").concat(appliedTitleContentContainer) }, renderTitle()), renderMessage()); return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Card.default, { className: messageCardClasses.card }, content)); }; -var _default = BaseMessageCard; -exports.default = _default; \ No newline at end of file +var _default = exports.default = BaseMessageCard; \ No newline at end of file diff --git a/lib/components/Card/ErrorCard.js b/lib/components/Card/ErrorCard.js index 882322ce..aeeb62c3 100644 --- a/lib/components/Card/ErrorCard.js +++ b/lib/components/Card/ErrorCard.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -9,31 +8,30 @@ var _react = _interopRequireDefault(require("react")); var _styles = require("@material-ui/core/styles"); var _BaseCard = _interopRequireWildcard(require("./BaseCard")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/require-default-props */ -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - callout: { - margin: muiTheme.spacing(0.5, 0, 3, 0), - backgroundColor: _Theme.default.colors.RED[50], - borderColor: _Theme.default.colors.RED[300] - }, - calloutIcon: { - color: _Theme.default.colors.RED[300], - marginRight: muiTheme.spacing(2) - } - }) - ); -}); -var ErrorCard = function ErrorCard(props) { - var classes = useStyles(_Theme.default); - var calloutClasses = props.classes; - var injectedCallout = calloutClasses ? calloutClasses.callout : undefined; - var injectedCalloutIcon = calloutClasses ? calloutClasses.calloutIcon : undefined; +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + callout: { + margin: muiTheme.spacing(0.5, 0, 3, 0), + backgroundColor: _Theme.default.colors.RED[50], + borderColor: _Theme.default.colors.RED[300] + }, + calloutIcon: { + color: _Theme.default.colors.RED[300], + marginRight: muiTheme.spacing(2) + } +})); +const ErrorCard = props => { + const classes = useStyles(_Theme.default); + const { + classes: calloutClasses + } = props; + const injectedCallout = calloutClasses ? calloutClasses.callout : undefined; + const injectedCalloutIcon = calloutClasses ? calloutClasses.calloutIcon : undefined; return /*#__PURE__*/_react.default.createElement(_BaseCard.default, _extends({}, props, { type: _BaseCard.CardType.ERROR, calloutClasses: { @@ -42,5 +40,4 @@ var ErrorCard = function ErrorCard(props) { } })); }; -var _default = ErrorCard; -exports.default = _default; \ No newline at end of file +var _default = exports.default = ErrorCard; \ No newline at end of file diff --git a/lib/components/Card/InfoCard.js b/lib/components/Card/InfoCard.js index 277b9403..6ed993ed 100644 --- a/lib/components/Card/InfoCard.js +++ b/lib/components/Card/InfoCard.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -9,31 +8,30 @@ var _react = _interopRequireDefault(require("react")); var _styles = require("@material-ui/core/styles"); var _BaseCard = _interopRequireWildcard(require("./BaseCard")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/require-default-props */ -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - callout: { - margin: muiTheme.spacing(0.5, 0, 3, 0), - backgroundColor: _Theme.default.colors.LIGHT_BLUE[50], - borderColor: _Theme.default.colors.LIGHT_BLUE[300] - }, - calloutIcon: { - color: _Theme.default.colors.LIGHT_BLUE[300], - marginRight: muiTheme.spacing(2) - } - }) - ); -}); -var InfoCard = function InfoCard(props) { - var classes = useStyles(_Theme.default); - var calloutClasses = props.classes; - var injectedCallout = calloutClasses ? calloutClasses.callout : undefined; - var injectedCalloutIcon = calloutClasses ? calloutClasses.calloutIcon : undefined; +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + callout: { + margin: muiTheme.spacing(0.5, 0, 3, 0), + backgroundColor: _Theme.default.colors.LIGHT_BLUE[50], + borderColor: _Theme.default.colors.LIGHT_BLUE[300] + }, + calloutIcon: { + color: _Theme.default.colors.LIGHT_BLUE[300], + marginRight: muiTheme.spacing(2) + } +})); +const InfoCard = props => { + const classes = useStyles(_Theme.default); + const { + classes: calloutClasses + } = props; + const injectedCallout = calloutClasses ? calloutClasses.callout : undefined; + const injectedCalloutIcon = calloutClasses ? calloutClasses.calloutIcon : undefined; return /*#__PURE__*/_react.default.createElement(_BaseCard.default, _extends({}, props, { type: _BaseCard.CardType.INFO, calloutClasses: { @@ -42,5 +40,4 @@ var InfoCard = function InfoCard(props) { } })); }; -var _default = InfoCard; -exports.default = _default; \ No newline at end of file +var _default = exports.default = InfoCard; \ No newline at end of file diff --git a/lib/components/Card/InfoMessageCard.js b/lib/components/Card/InfoMessageCard.js index 16650d3b..b667e406 100644 --- a/lib/components/Card/InfoMessageCard.js +++ b/lib/components/Card/InfoMessageCard.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -9,38 +8,36 @@ var _react = _interopRequireDefault(require("react")); var _styles = require("@material-ui/core/styles"); var _BaseMessageCard = _interopRequireWildcard(require("./BaseMessageCard")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/require-default-props */ -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - card: { - margin: muiTheme.spacing(0.5, 0, 3, 0), - backgroundColor: 'rgba(230, 241, 251, 0.5)', - // theme.colors.LIGHT_BLUE[50] with 'a' value applied - borderColor: 'rgba(138, 191, 236, 0.5)' // theme.colors.LIGHT_BLUE[200] with 'a' value applied - }, - - primaryIcon: { - marginRight: muiTheme.spacing(2) - }, - secondaryIcon: { - color: 'rgba(138, 191, 236, 0.9)', - // theme.colors.LIGHT_BLUE[200] with 'a' value applied - marginLeft: muiTheme.spacing(2) - } - }) - ); -}); -var InfoCard = function InfoCard(props) { - var classes = useStyles(_Theme.default); - var messageCardClasses = props.classes; - var injectedCard = messageCardClasses ? messageCardClasses.card : undefined; - var injectedPrimaryIcon = messageCardClasses ? messageCardClasses.primaryIcon : undefined; - var injectedSecondaryIcon = messageCardClasses ? messageCardClasses.secondaryIcon : undefined; +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + card: { + margin: muiTheme.spacing(0.5, 0, 3, 0), + backgroundColor: 'rgba(230, 241, 251, 0.5)', + // theme.colors.LIGHT_BLUE[50] with 'a' value applied + borderColor: 'rgba(138, 191, 236, 0.5)' // theme.colors.LIGHT_BLUE[200] with 'a' value applied + }, + primaryIcon: { + marginRight: muiTheme.spacing(2) + }, + secondaryIcon: { + color: 'rgba(138, 191, 236, 0.9)', + // theme.colors.LIGHT_BLUE[200] with 'a' value applied + marginLeft: muiTheme.spacing(2) + } +})); +const InfoCard = props => { + const classes = useStyles(_Theme.default); + const { + classes: messageCardClasses + } = props; + const injectedCard = messageCardClasses ? messageCardClasses.card : undefined; + const injectedPrimaryIcon = messageCardClasses ? messageCardClasses.primaryIcon : undefined; + const injectedSecondaryIcon = messageCardClasses ? messageCardClasses.secondaryIcon : undefined; return /*#__PURE__*/_react.default.createElement(_BaseMessageCard.default, _extends({}, props, { type: _BaseMessageCard.MessageCardType.INFO, messageCardClasses: { @@ -52,5 +49,4 @@ var InfoCard = function InfoCard(props) { } })); }; -var _default = InfoCard; -exports.default = _default; \ No newline at end of file +var _default = exports.default = InfoCard; \ No newline at end of file diff --git a/lib/components/Card/ReleaseMessageCard.js b/lib/components/Card/ReleaseMessageCard.js index 40ffa2d7..2d213406 100644 --- a/lib/components/Card/ReleaseMessageCard.js +++ b/lib/components/Card/ReleaseMessageCard.js @@ -12,21 +12,18 @@ var _InfoMessageCard = _interopRequireDefault(require("./InfoMessageCard")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/require-default-props */ -var useStyles = (0, _styles.makeStyles)(function (theme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - customIcon: { - color: 'rgba(0, 0, 0, 0.9)', - padding: '5px', - fontSize: '1.5em', - marginRight: theme.spacing(2) - } - }) - ); -}); -var ReleaseMessageCard = function ReleaseMessageCard(props) { - var classes = useStyles(_Theme.default); +const useStyles = (0, _styles.makeStyles)(theme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + customIcon: { + color: 'rgba(0, 0, 0, 0.9)', + padding: '5px', + fontSize: '1.5em', + marginRight: theme.spacing(2) + } +})); +const ReleaseMessageCard = props => { + const classes = useStyles(_Theme.default); return /*#__PURE__*/_react.default.createElement(_InfoMessageCard.default, _extends({}, props, { title: "Data Product Release", icon: /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, { @@ -36,5 +33,4 @@ var ReleaseMessageCard = function ReleaseMessageCard(props) { }) })); }; -var _default = ReleaseMessageCard; -exports.default = _default; \ No newline at end of file +var _default = exports.default = ReleaseMessageCard; \ No newline at end of file diff --git a/lib/components/Card/ReleaseNoticeCard.js b/lib/components/Card/ReleaseNoticeCard.js index 34c5700d..edeba657 100644 --- a/lib/components/Card/ReleaseNoticeCard.js +++ b/lib/components/Card/ReleaseNoticeCard.js @@ -10,24 +10,21 @@ var _InfoMessageCard = _interopRequireDefault(require("./InfoMessageCard")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/require-default-props */ -var useStyles = (0, _styles.makeStyles)(function (theme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - card: { - margin: theme.spacing(0.5, 0, 3, 0), - backgroundColor: theme.colors.GOLD[50], - borderColor: theme.colors.GOLD[300] - }, - cardSecondaryIcon: { - color: theme.colors.GOLD[300], - marginLeft: theme.spacing(2) - } - }) - ); -}); -var ReleaseNoticeCard = function ReleaseNoticeCard(props) { - var classes = useStyles(_Theme.default); +const useStyles = (0, _styles.makeStyles)(theme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + card: { + margin: theme.spacing(0.5, 0, 3, 0), + backgroundColor: theme.colors.GOLD[50], + borderColor: theme.colors.GOLD[300] + }, + cardSecondaryIcon: { + color: theme.colors.GOLD[300], + marginLeft: theme.spacing(2) + } +})); +const ReleaseNoticeCard = props => { + const classes = useStyles(_Theme.default); return /*#__PURE__*/_react.default.createElement(_InfoMessageCard.default, _extends({}, props, { title: "Release Notice", classes: { @@ -36,5 +33,4 @@ var ReleaseNoticeCard = function ReleaseNoticeCard(props) { } })); }; -var _default = ReleaseNoticeCard; -exports.default = _default; \ No newline at end of file +var _default = exports.default = ReleaseNoticeCard; \ No newline at end of file diff --git a/lib/components/Card/WarningCard.js b/lib/components/Card/WarningCard.js index a7a9c0a3..c9193e8e 100644 --- a/lib/components/Card/WarningCard.js +++ b/lib/components/Card/WarningCard.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -9,31 +8,30 @@ var _react = _interopRequireDefault(require("react")); var _styles = require("@material-ui/core/styles"); var _BaseCard = _interopRequireWildcard(require("./BaseCard")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/require-default-props */ -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - callout: { - margin: muiTheme.spacing(0.5, 0, 3, 0), - backgroundColor: _Theme.default.colors.BROWN[50], - borderColor: _Theme.default.colors.BROWN[300] - }, - calloutIcon: { - color: _Theme.default.colors.BROWN[300], - marginRight: muiTheme.spacing(2) - } - }) - ); -}); -var WarningCard = function WarningCard(props) { - var classes = useStyles(_Theme.default); - var calloutClasses = props.classes; - var injectedCallout = calloutClasses ? calloutClasses.callout : undefined; - var injectedCalloutIcon = calloutClasses ? calloutClasses.calloutIcon : undefined; +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + callout: { + margin: muiTheme.spacing(0.5, 0, 3, 0), + backgroundColor: _Theme.default.colors.BROWN[50], + borderColor: _Theme.default.colors.BROWN[300] + }, + calloutIcon: { + color: _Theme.default.colors.BROWN[300], + marginRight: muiTheme.spacing(2) + } +})); +const WarningCard = props => { + const classes = useStyles(_Theme.default); + const { + classes: calloutClasses + } = props; + const injectedCallout = calloutClasses ? calloutClasses.callout : undefined; + const injectedCalloutIcon = calloutClasses ? calloutClasses.calloutIcon : undefined; return /*#__PURE__*/_react.default.createElement(_BaseCard.default, _extends({}, props, { type: _BaseCard.CardType.WARN, calloutClasses: { @@ -42,5 +40,4 @@ var WarningCard = function WarningCard(props) { } })); }; -var _default = WarningCard; -exports.default = _default; \ No newline at end of file +var _default = exports.default = WarningCard; \ No newline at end of file diff --git a/lib/components/Card/index.js b/lib/components/Card/index.js index 9342ecf5..ac6e656c 100644 --- a/lib/components/Card/index.js +++ b/lib/components/Card/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _BaseCard.default; } }); diff --git a/lib/components/Chip/ReleaseChip.js b/lib/components/Chip/ReleaseChip.js index 241a675f..416f5333 100644 --- a/lib/components/Chip/ReleaseChip.js +++ b/lib/components/Chip/ReleaseChip.js @@ -13,34 +13,33 @@ var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons"); var _Theme = _interopRequireDefault(require("../Theme/Theme")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/require-default-props */ -var useStyles = (0, _styles.makeStyles)(function (theme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - releaseIcon: { - color: theme.colors.LIGHT_BLUE[600], - fontSize: '1em', - marginRight: theme.spacing(0.75) - }, - releaseChip: { - color: theme.colors.LIGHT_BLUE[600], - border: "1px solid ".concat(theme.colors.LIGHT_BLUE[600]), - backgroundColor: theme.colors.LIGHT_BLUE[50], - fontWeight: 600, - cursor: 'help' - } - }) - ); -}); -var ReleaseChip = function ReleaseChip(props) { - var classes = useStyles(_Theme.default); - var tooltipTitle = props.tooltipTitle, - chipLabel = props.chipLabel, - customClasses = props.classes, - chipStyle = props.chipStyle, - tooltipProps = props.tooltipProps; - var injectedChipClass = customClasses ? customClasses.chip : undefined; - var injectedChipIconClass = customClasses ? customClasses.icon : undefined; +const useStyles = (0, _styles.makeStyles)(theme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + releaseIcon: { + color: theme.colors.LIGHT_BLUE[600], + fontSize: '1em', + marginRight: theme.spacing(0.75) + }, + releaseChip: { + color: theme.colors.LIGHT_BLUE[600], + border: "1px solid ".concat(theme.colors.LIGHT_BLUE[600]), + backgroundColor: theme.colors.LIGHT_BLUE[50], + fontWeight: 600, + cursor: 'help' + } +})); +const ReleaseChip = props => { + const classes = useStyles(_Theme.default); + const { + tooltipTitle, + chipLabel, + classes: customClasses, + chipStyle, + tooltipProps + } = props; + const injectedChipClass = customClasses ? customClasses.chip : undefined; + const injectedChipIconClass = customClasses ? customClasses.icon : undefined; return /*#__PURE__*/_react.default.createElement(_Tooltip.default, _extends({}, tooltipProps, { // eslint-disable-next-line react/jsx-no-useless-fragment title: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, tooltipTitle) @@ -55,5 +54,4 @@ var ReleaseChip = function ReleaseChip(props) { }), chipLabel) })); }; -var _default = ReleaseChip; -exports.default = _default; \ No newline at end of file +var _default = exports.default = ReleaseChip; \ No newline at end of file diff --git a/lib/components/Chip/index.js b/lib/components/Chip/index.js index e5c31412..76dba2be 100644 --- a/lib/components/Chip/index.js +++ b/lib/components/Chip/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _ReleaseChip.default; } }); diff --git a/lib/components/Citation/DataProductCitation.js b/lib/components/Citation/DataProductCitation.js index d08198c9..c29b883a 100644 --- a/lib/components/Citation/DataProductCitation.js +++ b/lib/components/Citation/DataProductCitation.js @@ -11,16 +11,18 @@ var _View = _interopRequireDefault(require("./DataProductCitation/View")); var _NeonContext = _interopRequireDefault(require("../NeonContext/NeonContext")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var DataProductCitation = function DataProductCitation(props) { - var productCode = props.productCode, - release = props.release, - showQuoteIcon = props.showQuoteIcon, - disableConditional = props.disableConditional, - disableSkeleton = props.disableSkeleton, - showTextOnly = props.showTextOnly, - textOnlyProps = props.textOnlyProps; +const DataProductCitation = props => { + const { + productCode, + release, + showQuoteIcon, + disableConditional, + disableSkeleton, + showTextOnly, + textOnlyProps + } = props; return /*#__PURE__*/_react.default.createElement(_ComponentErrorBoundary.default, { - onReset: function onReset() {/* noop for boundary reset */} + onReset: () => {/* noop for boundary reset */} }, /*#__PURE__*/_react.default.createElement(_Context.default.Provider, { productCode: productCode, release: release @@ -40,6 +42,5 @@ DataProductCitation.defaultProps = { showTextOnly: false, textOnlyProps: undefined }; -var WrappedDataProductCitation = _Theme.default.getWrappedComponent(_NeonContext.default.getWrappedComponent(DataProductCitation)); -var _default = WrappedDataProductCitation; -exports.default = _default; \ No newline at end of file +const WrappedDataProductCitation = _Theme.default.getWrappedComponent(_NeonContext.default.getWrappedComponent(DataProductCitation)); +var _default = exports.default = WrappedDataProductCitation; \ No newline at end of file diff --git a/lib/components/Citation/DataProductCitation/Actions.js b/lib/components/Citation/DataProductCitation/Actions.js index ab2c9c73..ccaaebb5 100644 --- a/lib/components/Citation/DataProductCitation/Actions.js +++ b/lib/components/Citation/DataProductCitation/Actions.js @@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.ActionTypes = void 0; -var ActionTypes = /*#__PURE__*/function (ActionTypes) { +let ActionTypes = exports.ActionTypes = /*#__PURE__*/function (ActionTypes) { ActionTypes["REINITIALIZE"] = "REINITIALIZE"; ActionTypes["ERROR"] = "ERROR"; ActionTypes["SET_PRODUCT_CODE"] = "SET_PRODUCT_CODE"; @@ -32,172 +32,120 @@ var ActionTypes = /*#__PURE__*/function (ActionTypes) { ActionTypes["FETCH_CITATION_DOWNLOAD_RESET"] = "FETCH_CITATION_DOWNLOAD_RESET"; return ActionTypes; }({}); -exports.ActionTypes = ActionTypes; -var ActionCreator = { - reinitialize: function reinitialize(productCode, release) { - return { - type: ActionTypes.REINITIALIZE, - productCode: productCode, - release: release - }; - }, - error: function error(_error) { - return { - type: ActionTypes.ERROR, - error: _error - }; - }, - setProductCode: function setProductCode(productCode) { - return { - type: ActionTypes.SET_PRODUCT_CODE, - productCode: productCode - }; - }, - setRelease: function setRelease(release) { - return { - type: ActionTypes.SET_RELEASE, - release: release - }; - }, - setParams: function setParams(productCode, release) { - return { - type: ActionTypes.SET_PARAMS, - productCode: productCode, - release: release - }; - }, - storeFinalizedNeonContextState: function storeFinalizedNeonContextState(neonContextState) { - return { - type: ActionTypes.STORE_FINALIZED_NEON_CONTEXT_STATE, - neonContextState: neonContextState - }; - }, - fetchProductStarted: function fetchProductStarted() { - return { - type: ActionTypes.FETCH_PRODUCT_STARTED - }; - }, - fetchProductFailed: function fetchProductFailed(error) { - return { - type: ActionTypes.FETCH_PRODUCT_FAILED, - error: error - }; - }, - fetchProductSucceeded: function fetchProductSucceeded(data) { - return { - type: ActionTypes.FETCH_PRODUCT_SUCCEEDED, - data: data - }; - }, - fetchProductReleaseStarted: function fetchProductReleaseStarted(release) { - return { - type: ActionTypes.FETCH_PRODUCT_RELEASE_STARTED, - release: release - }; - }, - fetchProductReleaseFailed: function fetchProductReleaseFailed(release, error) { - return { - type: ActionTypes.FETCH_PRODUCT_RELEASE_FAILED, - release: release, - error: error - }; - }, - fetchProductReleaseSucceeded: function fetchProductReleaseSucceeded(release, data) { - return { - type: ActionTypes.FETCH_PRODUCT_RELEASE_SUCCEEDED, - release: release, - data: data - }; - }, - fetchProductReleaseDoiStarted: function fetchProductReleaseDoiStarted(release) { - return { - type: ActionTypes.FETCH_PRODUCT_RELEASE_DOI_STARTED, - release: release - }; - }, - fetchProductReleaseDoiFailed: function fetchProductReleaseDoiFailed(release, error) { - return { - type: ActionTypes.FETCH_PRODUCT_RELEASE_DOI_FAILED, - release: release, - error: error - }; - }, - fetchProductReleaseDoiSucceeded: function fetchProductReleaseDoiSucceeded(productCode, release, data) { - return { - type: ActionTypes.FETCH_PRODUCT_RELEASE_DOI_SUCCEEDED, - productCode: productCode, - release: release, - data: data - }; - }, - fetchBundleParentStarted: function fetchBundleParentStarted(bundleParent) { - return { - type: ActionTypes.FETCH_BUNDLE_PARENT_STARTED, - bundleParent: bundleParent - }; - }, - fetchBundleParentFailed: function fetchBundleParentFailed(bundleParent, error) { - return { - type: ActionTypes.FETCH_BUNDLE_PARENT_FAILED, - bundleParent: bundleParent, - error: error - }; - }, - fetchBundleParentSucceeded: function fetchBundleParentSucceeded(bundleParent, data) { - return { - type: ActionTypes.FETCH_BUNDLE_PARENT_SUCCEEDED, - bundleParent: bundleParent, - data: data - }; - }, - fetchBundleParentReleaseStarted: function fetchBundleParentReleaseStarted(bundleParent, release) { - return { - type: ActionTypes.FETCH_BUNDLE_PARENT_RELEASE_STARTED, - bundleParent: bundleParent, - release: release - }; - }, - fetchBundleParentReleaseFailed: function fetchBundleParentReleaseFailed(bundleParent, release, error) { - return { - type: ActionTypes.FETCH_BUNDLE_PARENT_RELEASE_FAILED, - bundleParent: bundleParent, - release: release, - error: error - }; - }, - fetchBundleParentReleaseSucceeded: function fetchBundleParentReleaseSucceeded(bundleParent, release, data) { - return { - type: ActionTypes.FETCH_BUNDLE_PARENT_RELEASE_SUCCEEDED, - bundleParent: bundleParent, - release: release, - data: data - }; - }, - fetchCitationDownloadStarted: function fetchCitationDownloadStarted(key) { - return { - type: ActionTypes.FETCH_CITATION_DOWNLOAD_STARTED, - key: key - }; - }, - fetchCitationDownloadFailed: function fetchCitationDownloadFailed(key, error) { - return { - type: ActionTypes.FETCH_CITATION_DOWNLOAD_FAILED, - key: key, - error: error - }; - }, - fetchCitationDownloadSucceeded: function fetchCitationDownloadSucceeded(key) { - return { - type: ActionTypes.FETCH_CITATION_DOWNLOAD_SUCCEEDED, - key: key - }; - }, - fetchCitationDownloadReset: function fetchCitationDownloadReset(key) { - return { - type: ActionTypes.FETCH_CITATION_DOWNLOAD_RESET, - key: key - }; - } +const ActionCreator = { + reinitialize: (productCode, release) => ({ + type: ActionTypes.REINITIALIZE, + productCode, + release + }), + error: error => ({ + type: ActionTypes.ERROR, + error + }), + setProductCode: productCode => ({ + type: ActionTypes.SET_PRODUCT_CODE, + productCode + }), + setRelease: release => ({ + type: ActionTypes.SET_RELEASE, + release + }), + setParams: (productCode, release) => ({ + type: ActionTypes.SET_PARAMS, + productCode, + release + }), + storeFinalizedNeonContextState: neonContextState => ({ + type: ActionTypes.STORE_FINALIZED_NEON_CONTEXT_STATE, + neonContextState + }), + fetchProductStarted: () => ({ + type: ActionTypes.FETCH_PRODUCT_STARTED + }), + fetchProductFailed: error => ({ + type: ActionTypes.FETCH_PRODUCT_FAILED, + error + }), + fetchProductSucceeded: data => ({ + type: ActionTypes.FETCH_PRODUCT_SUCCEEDED, + data + }), + fetchProductReleaseStarted: release => ({ + type: ActionTypes.FETCH_PRODUCT_RELEASE_STARTED, + release + }), + fetchProductReleaseFailed: (release, error) => ({ + type: ActionTypes.FETCH_PRODUCT_RELEASE_FAILED, + release, + error + }), + fetchProductReleaseSucceeded: (release, data) => ({ + type: ActionTypes.FETCH_PRODUCT_RELEASE_SUCCEEDED, + release, + data + }), + fetchProductReleaseDoiStarted: release => ({ + type: ActionTypes.FETCH_PRODUCT_RELEASE_DOI_STARTED, + release + }), + fetchProductReleaseDoiFailed: (release, error) => ({ + type: ActionTypes.FETCH_PRODUCT_RELEASE_DOI_FAILED, + release, + error + }), + fetchProductReleaseDoiSucceeded: (productCode, release, data) => ({ + type: ActionTypes.FETCH_PRODUCT_RELEASE_DOI_SUCCEEDED, + productCode, + release, + data + }), + fetchBundleParentStarted: bundleParent => ({ + type: ActionTypes.FETCH_BUNDLE_PARENT_STARTED, + bundleParent + }), + fetchBundleParentFailed: (bundleParent, error) => ({ + type: ActionTypes.FETCH_BUNDLE_PARENT_FAILED, + bundleParent, + error + }), + fetchBundleParentSucceeded: (bundleParent, data) => ({ + type: ActionTypes.FETCH_BUNDLE_PARENT_SUCCEEDED, + bundleParent, + data + }), + fetchBundleParentReleaseStarted: (bundleParent, release) => ({ + type: ActionTypes.FETCH_BUNDLE_PARENT_RELEASE_STARTED, + bundleParent, + release + }), + fetchBundleParentReleaseFailed: (bundleParent, release, error) => ({ + type: ActionTypes.FETCH_BUNDLE_PARENT_RELEASE_FAILED, + bundleParent, + release, + error + }), + fetchBundleParentReleaseSucceeded: (bundleParent, release, data) => ({ + type: ActionTypes.FETCH_BUNDLE_PARENT_RELEASE_SUCCEEDED, + bundleParent, + release, + data + }), + fetchCitationDownloadStarted: key => ({ + type: ActionTypes.FETCH_CITATION_DOWNLOAD_STARTED, + key + }), + fetchCitationDownloadFailed: (key, error) => ({ + type: ActionTypes.FETCH_CITATION_DOWNLOAD_FAILED, + key, + error + }), + fetchCitationDownloadSucceeded: key => ({ + type: ActionTypes.FETCH_CITATION_DOWNLOAD_SUCCEEDED, + key + }), + fetchCitationDownloadReset: key => ({ + type: ActionTypes.FETCH_CITATION_DOWNLOAD_RESET, + key + }) }; -var _default = ActionCreator; -exports.default = _default; \ No newline at end of file +var _default = exports.default = ActionCreator; \ No newline at end of file diff --git a/lib/components/Citation/DataProductCitation/Context.js b/lib/components/Citation/DataProductCitation/Context.js index 2c54de86..cd1a6a82 100644 --- a/lib/components/Citation/DataProductCitation/Context.js +++ b/lib/components/Citation/DataProductCitation/Context.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -15,68 +14,61 @@ var _Reducer = _interopRequireDefault(require("./Reducer")); var _Service = _interopRequireDefault(require("./Service")); var _State = require("./State"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* eslint-disable react/require-default-props */ -var StateContext = /*#__PURE__*/(0, _react.createContext)((0, _State.getDefaultState)()); -var DispatchContext = /*#__PURE__*/(0, _react.createContext)(undefined); -var useDataProductCitationContextState = function useDataProductCitationContextState() { - var state = (0, _react.useContext)(StateContext); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/require-default-props */ +const StateContext = /*#__PURE__*/(0, _react.createContext)((0, _State.getDefaultState)()); +const DispatchContext = /*#__PURE__*/(0, _react.createContext)(undefined); +const useDataProductCitationContextState = () => { + let state = (0, _react.useContext)(StateContext); if (!(0, _typeUtil.exists)(state)) { state = (0, _State.getDefaultState)(); } return state; }; -var useDataProductCitationContextDispatch = function useDataProductCitationContextDispatch() { - var dispatchContext = (0, _react.useContext)(DispatchContext); +const useDataProductCitationContextDispatch = () => { + const dispatchContext = (0, _react.useContext)(DispatchContext); if (!(0, _typeUtil.exists)(dispatchContext)) { throw new Error('Failed to initialize dispatch context'); } return dispatchContext; }; -var buildProductQuery = function buildProductQuery(productCode, release) { - var hasRelease = (0, _typeUtil.isStringNonEmpty)(release); - var releaseArgument = !hasRelease ? '' : ", release: \"".concat(release, "\""); +const buildProductQuery = (productCode, release) => { + const hasRelease = (0, _typeUtil.isStringNonEmpty)(release); + const releaseArgument = !hasRelease ? '' : ", release: \"".concat(release, "\""); return "query Product {\n product(productCode: \"".concat(productCode, "\"").concat(releaseArgument, ") {\n productCode\n productName\n productDescription\n releases {\n release\n generationDate\n url\n productDoi {\n url\n generationDate\n }\n }\n }\n }"); }; -var verifyProductResponse = function verifyProductResponse(response) { - return (0, _typeUtil.exists)(response) && (0, _typeUtil.exists)(response.response) && (0, _typeUtil.exists)(response.response.data) && (0, _typeUtil.exists)(response.response.data.product); -}; -var verifyProductReleaseDoiResponse = function verifyProductReleaseDoiResponse(response) { - return (0, _typeUtil.exists)(response); -}; -var Provider = function Provider(props) { - var propsProductCode = props.productCode, - propsRelease = props.release, - contextControlled = props.contextControlled, - children = props.children; - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - neonContextState = _NeonContext$useNeonC2[0]; - var neonContextIsFinal = neonContextState.isFinal, - neonContextHasError = neonContextState.hasError; - var initialState = _extends({}, (0, _State.getDefaultState)(), { +const verifyProductResponse = response => (0, _typeUtil.exists)(response) && (0, _typeUtil.exists)(response.response) && (0, _typeUtil.exists)(response.response.data) && (0, _typeUtil.exists)(response.response.data.product); +const verifyProductReleaseDoiResponse = response => (0, _typeUtil.exists)(response); +const Provider = props => { + const { + productCode: propsProductCode, + release: propsRelease, + contextControlled, + children + } = props; + const [neonContextState] = _NeonContext.default.useNeonContextState(); + const { + isFinal: neonContextIsFinal, + hasError: neonContextHasError + } = neonContextState; + const initialState = _extends({}, (0, _State.getDefaultState)(), { productCode: propsProductCode, release: propsRelease }); if (neonContextIsFinal || neonContextHasError) { initialState.neonContextState = _extends({}, neonContextState); } - var _useReducer = (0, _react.useReducer)(_Reducer.default, initialState), - _useReducer2 = _slicedToArray(_useReducer, 2), - state = _useReducer2[0], - dispatch = _useReducer2[1]; - var status = state.component.status, - productCode = state.productCode, - release = state.release, - fetches = state.fetches; - (0, _react.useEffect)(function () { + const [state, dispatch] = (0, _react.useReducer)(_Reducer.default, initialState); + const { + component: { + status + }, + productCode, + release, + fetches + } = state; + (0, _react.useEffect)(() => { if (status !== _State.ContextStatus.INITIALIZING) { return; } @@ -86,7 +78,7 @@ var Provider = function Provider(props) { }, [status, productCode]); // Respond to prop changes when not context controlled - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (contextControlled) { return; } @@ -94,20 +86,20 @@ var Provider = function Provider(props) { return; } if (productCode !== propsProductCode || release !== propsRelease) { - var initProductCode = (0, _typeUtil.isStringNonEmpty)(propsProductCode) ? propsProductCode : ''; + const initProductCode = (0, _typeUtil.isStringNonEmpty)(propsProductCode) ? propsProductCode : ''; dispatch(_Actions.default.reinitialize(initProductCode, propsRelease)); } }, [contextControlled, status, productCode, propsProductCode, release, propsRelease]); - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (neonContextIsFinal || neonContextHasError) { dispatch(_Actions.default.storeFinalizedNeonContextState(neonContextState)); } }, [neonContextState, neonContextIsFinal, neonContextHasError]); // Transform the object to a string to ensure the effect // fires anytime the object changes for ensure it always resolves fetches. - var fetchesStringified = JSON.stringify(fetches); + const fetchesStringified = JSON.stringify(fetches); // Trigger any fetches that are awaiting call - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { // NeonContext is required to fetch data for the app due to bundles. if (!neonContextIsFinal) { return; @@ -118,100 +110,92 @@ var Provider = function Provider(props) { // Base product fetch if (_Service.default.fetchIsAwaitingCall(fetches.product)) { dispatch(_Actions.default.fetchProductStarted()); - var queryProductCode = productCode; + const queryProductCode = productCode; // eslint-disable-next-line max-len _NeonGraphQL.default.getGraphqlQuery(buildProductQuery(queryProductCode)).subscribe({ - next: function next(response) { + next: response => { if (!verifyProductResponse(response)) { dispatch(_Actions.default.fetchProductFailed('Failed to fetch product')); return; } dispatch(_Actions.default.fetchProductSucceeded(response.response.data.product)); }, - error: function error(_error) { - dispatch(_Actions.default.fetchProductFailed(_error)); + error: error => { + dispatch(_Actions.default.fetchProductFailed(error)); } }); } // Product release fetches - Object.keys(fetches.productReleases).filter(function (fetchRelease) { - return _Service.default.fetchIsAwaitingCall(fetches.productReleases[fetchRelease]); - }).forEach(function (fetchRelease) { + Object.keys(fetches.productReleases).filter(fetchRelease => _Service.default.fetchIsAwaitingCall(fetches.productReleases[fetchRelease])).forEach(fetchRelease => { dispatch(_Actions.default.fetchProductReleaseStarted(fetchRelease)); - var queryProductCode = productCode; - var query = buildProductQuery(queryProductCode, fetchRelease); + const queryProductCode = productCode; + const query = buildProductQuery(queryProductCode, fetchRelease); // eslint-disable-next-line max-len _NeonGraphQL.default.getGraphqlQuery(query).subscribe({ - next: function next(response) { + next: response => { if (!verifyProductResponse(response)) { dispatch(_Actions.default.fetchProductReleaseFailed(fetchRelease, 'Failed to fetch product')); return; } dispatch(_Actions.default.fetchProductReleaseSucceeded(fetchRelease, response.response.data.product)); }, - error: function error(_error2) { - dispatch(_Actions.default.fetchProductReleaseFailed(fetchRelease, _error2)); + error: error => { + dispatch(_Actions.default.fetchProductReleaseFailed(fetchRelease, error)); } }); }); // Product release doi fetches - Object.keys(fetches.productReleaseDois).filter(function (fetchRelease) { - return _Service.default.fetchIsAwaitingCall(fetches.productReleaseDois[fetchRelease]); - }).forEach(function (fetchRelease) { + Object.keys(fetches.productReleaseDois).filter(fetchRelease => _Service.default.fetchIsAwaitingCall(fetches.productReleaseDois[fetchRelease])).forEach(fetchRelease => { dispatch(_Actions.default.fetchProductReleaseDoiStarted(fetchRelease)); - var queryProductCode = productCode; + const queryProductCode = productCode; // eslint-disable-next-line max-len _NeonApi.default.getProductDoisObservable(queryProductCode, fetchRelease).subscribe({ - next: function next(response) { + next: response => { if (!verifyProductReleaseDoiResponse(response)) { dispatch(_Actions.default.fetchProductReleaseDoiFailed(fetchRelease, 'Failed to fetch product release doi status')); return; } dispatch(_Actions.default.fetchProductReleaseDoiSucceeded(queryProductCode, fetchRelease, response.data)); }, - error: function error(_error3) { - dispatch(_Actions.default.fetchProductReleaseDoiFailed(fetchRelease, _error3)); + error: error => { + dispatch(_Actions.default.fetchProductReleaseDoiFailed(fetchRelease, error)); } }); }); // Bundle parent fetches - Object.keys(fetches.bundleParents).filter(function (bundleParent) { - return _Service.default.fetchIsAwaitingCall(fetches.bundleParents[bundleParent]); - }).forEach(function (bundleParent) { + Object.keys(fetches.bundleParents).filter(bundleParent => _Service.default.fetchIsAwaitingCall(fetches.bundleParents[bundleParent])).forEach(bundleParent => { dispatch(_Actions.default.fetchBundleParentStarted(bundleParent)); // eslint-disable-next-line max-len _NeonGraphQL.default.getGraphqlQuery(buildProductQuery(bundleParent)).subscribe({ - next: function next(response) { + next: response => { if (!verifyProductResponse(response)) { dispatch(_Actions.default.fetchBundleParentFailed(bundleParent, 'Failed to fetch product')); return; } dispatch(_Actions.default.fetchBundleParentSucceeded(bundleParent, response.response.data.product)); }, - error: function error(_error4) { - dispatch(_Actions.default.fetchBundleParentFailed(bundleParent, _error4)); + error: error => { + dispatch(_Actions.default.fetchBundleParentFailed(bundleParent, error)); } }); }); // Bundle parent release fetches - Object.keys(fetches.bundleParentReleases).forEach(function (bundleParent) { - Object.keys(fetches.bundleParentReleases[bundleParent]).filter(function (fetchRelease) { - return _Service.default.fetchIsAwaitingCall(fetches.bundleParentReleases[bundleParent][fetchRelease]); - }).forEach(function (fetchRelease) { + Object.keys(fetches.bundleParentReleases).forEach(bundleParent => { + Object.keys(fetches.bundleParentReleases[bundleParent]).filter(fetchRelease => _Service.default.fetchIsAwaitingCall(fetches.bundleParentReleases[bundleParent][fetchRelease])).forEach(fetchRelease => { dispatch(_Actions.default.fetchBundleParentReleaseStarted(bundleParent, fetchRelease)); - var query = buildProductQuery(bundleParent, fetchRelease); + const query = buildProductQuery(bundleParent, fetchRelease); // eslint-disable-next-line max-len _NeonGraphQL.default.getGraphqlQuery(query).subscribe({ // eslint-disable-next-line max-len - next: function next(response) { + next: response => { if (!verifyProductResponse(response)) { dispatch(_Actions.default.fetchBundleParentReleaseFailed(bundleParent, fetchRelease, 'Failed to fetch product')); return; } dispatch(_Actions.default.fetchBundleParentReleaseSucceeded(bundleParent, fetchRelease, response.response.data.product)); }, - error: function error(_error5) { - dispatch(_Actions.default.fetchBundleParentReleaseFailed(bundleParent, fetchRelease, _error5)); + error: error => { + dispatch(_Actions.default.fetchBundleParentReleaseFailed(bundleParent, fetchRelease, error)); } }); }); @@ -226,10 +210,9 @@ var Provider = function Provider(props) { Provider.defaultProps = { contextControlled: false }; -var DataProductCitationContext = { - Provider: Provider, - useDataProductCitationContextState: useDataProductCitationContextState, - useDataProductCitationContextDispatch: useDataProductCitationContextDispatch +const DataProductCitationContext = { + Provider, + useDataProductCitationContextState, + useDataProductCitationContextDispatch }; -var _default = DataProductCitationContext; -exports.default = _default; \ No newline at end of file +var _default = exports.default = DataProductCitationContext; \ No newline at end of file diff --git a/lib/components/Citation/DataProductCitation/ItemView.js b/lib/components/Citation/DataProductCitation/ItemView.js index 9b08a23b..5f69a0cd 100644 --- a/lib/components/Citation/DataProductCitation/ItemView.js +++ b/lib/components/Citation/DataProductCitation/ItemView.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -35,86 +34,90 @@ var _Service = _interopRequireDefault(require("./Service")); var _State = require("./State"); var _ViewState = require("./ViewState"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/jsx-fragments */ -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - cardActions: { - flexWrap: 'wrap', - marginTop: theme.spacing(-1), - '&> *': { - marginLeft: '0px !important', - marginTop: theme.spacing(1) - }, - '&> :not(:last-child)': { - marginRight: theme.spacing(1) - } - }, - cardButton: { - padding: '5px 10px', - backgroundColor: '#fff', - whiteSpace: 'nowrap' +const useStyles = (0, _styles.makeStyles)(theme => ({ + cardActions: { + flexWrap: 'wrap', + marginTop: theme.spacing(-1), + '&> *': { + marginLeft: '0px !important', + marginTop: theme.spacing(1) }, - cardButtonIcon: { + '&> :not(:last-child)': { marginRight: theme.spacing(1) - }, - citationCard: { - marginTop: theme.spacing(2) - }, - citationText: { - fontFamily: 'monospace' - }, - citationTextOnly: { - color: theme.palette.grey[400] - }, - citationTextWithQualifier: { - marginTop: theme.spacing(1.5), - fontFamily: 'monospace' - }, - bundleTextOnlySpacer: { - marginBottom: theme.spacing(2) - }, - tombstoneBlurb: { - fontSize: '0.8rem' - }, - noticeCardDivider: { - margin: theme.spacing(0, 0, 2, 0) } - }; -}); -var DataProductCitationItemView = function DataProductCitationItemView(props) { - var showTextOnly = props.showTextOnly, - textOnlyProps = props.textOnlyProps, - citationItem = props.citationItem, - viewState = props.viewState, - hasManyParents = props.hasManyParents; - var classes = useStyles(_Theme.default); - var dispatch = _Context.default.useDataProductCitationContextDispatch(); - var appliedTextOnly = { + }, + cardButton: { + padding: '5px 10px', + backgroundColor: '#fff', + whiteSpace: 'nowrap' + }, + cardButtonIcon: { + marginRight: theme.spacing(1) + }, + citationCard: { + marginTop: theme.spacing(2) + }, + citationText: { + fontFamily: 'monospace' + }, + citationTextOnly: { + color: theme.palette.grey[400] + }, + citationTextWithQualifier: { + marginTop: theme.spacing(1.5), + fontFamily: 'monospace' + }, + bundleTextOnlySpacer: { + marginBottom: theme.spacing(2) + }, + tombstoneBlurb: { + fontSize: '0.8rem' + }, + noticeCardDivider: { + margin: theme.spacing(0, 0, 2, 0) + } +})); +const DataProductCitationItemView = props => { + const { + showTextOnly, + textOnlyProps, + citationItem, + viewState, + hasManyParents + } = props; + const classes = useStyles(_Theme.default); + const dispatch = _Context.default.useDataProductCitationContextDispatch(); + let appliedTextOnly = { variant: 'caption', cssClass: classes.citationTextOnly }; if ((0, _typeUtil.exists)(textOnlyProps)) { appliedTextOnly = textOnlyProps; } - var displayType = viewState.displayType, - isTombstoned = viewState.isTombstoned, - releases = viewState.releases, - citationDownloadsFetchStatus = viewState.citationDownloadsFetchStatus; - var releaseObject = citationItem.releaseObject, - doiUrl = citationItem.doiUrl, - citableBaseProduct = citationItem.citableBaseProduct, - citableReleaseProduct = citationItem.citableReleaseProduct, - bundleParentCode = citationItem.bundleParentCode; - var handleResetCitationDownloadsCb = (0, _react.useCallback)(function (provisionalCb, productCode) { + const { + displayType, + isTombstoned, + releases, + citationDownloadsFetchStatus + } = viewState; + const { + releaseObject, + doiUrl, + citableBaseProduct, + citableReleaseProduct, + bundleParentCode + } = citationItem; + const handleResetCitationDownloadsCb = (0, _react.useCallback)((provisionalCb, productCode) => { _Service.default.handleResetCitationDownloads(citationDownloadsFetchStatus, provisionalCb, productCode, dispatch); }, [dispatch, citationDownloadsFetchStatus]); - var handleCitationDownloadCb = (0, _react.useCallback)(function (citationProduct, releaseCb, formatCb) { - var provisionalCb = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; - var coercedTarget = _extends({}, citationProduct); - var key = _Service.default.buildCitationDownloadKey(citationProduct, releaseCb, formatCb, provisionalCb); - var fullDoi = _Service.default.getReleaseDoi(releases, releaseCb); + const handleCitationDownloadCb = (0, _react.useCallback)(function (citationProduct, releaseCb, formatCb) { + let provisionalCb = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; + const coercedTarget = _extends({}, citationProduct); + const key = _Service.default.buildCitationDownloadKey(citationProduct, releaseCb, formatCb, provisionalCb); + let fullDoi = _Service.default.getReleaseDoi(releases, releaseCb); if ((0, _typeUtil.isStringNonEmpty)(fullDoi) && (0, _typeUtil.isStringNonEmpty)(doiUrl) && fullDoi !== doiUrl) { // In the case of multiple citations for a single product, we want to resolve // to the specified DOI URL for this citation, but adhere to pulling @@ -126,40 +129,40 @@ var DataProductCitationItemView = function DataProductCitationItemView(props) { if (dispatch) { dispatch(_Actions.default.fetchCitationDownloadStarted(key)); } - _DataCiteService.default.downloadCitation(formatCb, _DataCiteService.CitationDownloadType.DATA_PRODUCT, coercedTarget, fullDoi, releaseCb, function (data) { + _DataCiteService.default.downloadCitation(formatCb, _DataCiteService.CitationDownloadType.DATA_PRODUCT, coercedTarget, fullDoi, releaseCb, data => { if (dispatch) { dispatch(_Actions.default.fetchCitationDownloadSucceeded(key)); } - }, function (error) { + }, error => { if (dispatch) { dispatch(_Actions.default.fetchCitationDownloadFailed(key, 'Citation download failed')); } }); }, [dispatch, releases, doiUrl, handleResetCitationDownloadsCb]); - var renderTombstoneNotice = function renderTombstoneNotice() { + const renderTombstoneNotice = () => { if (!isTombstoned) { return null; } - var citationRelease = releaseObject; - var doiDisplay = ' '; + const citationRelease = releaseObject; + let doiDisplay = ' '; if (citationRelease.productDoi.url) { - var doiId = citationRelease.productDoi.url.split('/').slice(-2).join('/'); + const doiId = citationRelease.productDoi.url.split('/').slice(-2).join('/'); doiDisplay = " (DOI:".concat(doiId, ") "); } - var latestAvailableReleaseBlurb = null; + let latestAvailableReleaseBlurb = null; if (citableBaseProduct !== null && citableBaseProduct !== void 0 && citableBaseProduct.releases && (citableBaseProduct === null || citableBaseProduct === void 0 ? void 0 : citableBaseProduct.releases.length) > 0) { - var latestAvailableProductRelease = citableBaseProduct === null || citableBaseProduct === void 0 ? void 0 : citableBaseProduct.releases[0]; + const latestAvailableProductRelease = citableBaseProduct === null || citableBaseProduct === void 0 ? void 0 : citableBaseProduct.releases[0]; if (latestAvailableProductRelease.release.localeCompare(citationRelease.release) !== 0) { - var dataProductDetailLink = /*#__PURE__*/_react.default.createElement(_Link.default, { + const dataProductDetailLink = /*#__PURE__*/_react.default.createElement(_Link.default, { href: _RouteService.default.getProductDetailPath(citableBaseProduct.productCode) }, "newer release"); latestAvailableReleaseBlurb = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "has been replaced by a ", dataProductDetailLink, " and\xA0"); } } - var contactUsLink = /*#__PURE__*/_react.default.createElement(_Link.default, { + const contactUsLink = /*#__PURE__*/_react.default.createElement(_Link.default, { href: _RouteService.default.getContactUsPath() }, "Contact Us"); - var tombstoneNote = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("b", null, citationRelease.release), " of this data product", doiDisplay, " ", latestAvailableReleaseBlurb, "is no longer available for download. If this specific release is needed for research purposes, please fill out the ", contactUsLink, " form."); + const tombstoneNote = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("b", null, citationRelease.release), " of this data product", doiDisplay, " ", latestAvailableReleaseBlurb, "is no longer available for download. If this specific release is needed for research purposes, please fill out the ", contactUsLink, " form."); return /*#__PURE__*/_react.default.createElement(_ReleaseNoticeCard.default, { messageContent: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Divider.default, { className: classes.noticeCardDivider @@ -170,24 +173,24 @@ var DataProductCitationItemView = function DataProductCitationItemView(props) { }, tombstoneNote)) }); }; - var renderBundleParentLink = function renderBundleParentLink() { + const renderBundleParentLink = () => { if (!(0, _typeUtil.isStringNonEmpty)(bundleParentCode) || hasManyParents) { return null; } - var isReleaseDisplay = displayType === _ViewState.DisplayType.RELEASE; - var bundleParentName = isReleaseDisplay ? citableReleaseProduct.productName : citableBaseProduct.productName; - var titleContent; - var dataProductLike = { + const isReleaseDisplay = displayType === _ViewState.DisplayType.RELEASE; + const bundleParentName = isReleaseDisplay ? citableReleaseProduct.productName : citableBaseProduct.productName; + let titleContent; + const dataProductLike = { productCode: bundleParentCode, productName: bundleParentName }; - var appliedRelease = isReleaseDisplay ? releaseObject.release : undefined; + const appliedRelease = isReleaseDisplay ? releaseObject.release : undefined; if (isReleaseDisplay) { titleContent = _BundleContentBuilder.default.buildDefaultTitleContent(dataProductLike, appliedRelease); } else { titleContent = _BundleContentBuilder.default.buildDefaultTitleContent(dataProductLike); } - var subTitleContent = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "The ", isReleaseDisplay ? 'citation below refers' : 'citations below refer', " to that data product as this data product is not directly citable."); + const subTitleContent = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "The ", isReleaseDisplay ? 'citation below refers' : 'citations below refer', " to that data product as this data product is not directly citable."); return /*#__PURE__*/_react.default.createElement("div", { className: showTextOnly ? classes.bundleTextOnlySpacer : undefined }, /*#__PURE__*/_react.default.createElement(_DataProductBundleCard.default, { @@ -196,14 +199,14 @@ var DataProductCitationItemView = function DataProductCitationItemView(props) { subTitleContent: subTitleContent })); }; - var renderCitationCard = function renderCitationCard(release) { - var conditional = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var provisional = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var citationProduct = provisional ? citableBaseProduct : citableReleaseProduct; - var conditionalText = null; - var citationClassName = classes.citationText; + const renderCitationCard = function (release) { + let conditional = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + let provisional = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + const citationProduct = provisional ? citableBaseProduct : citableReleaseProduct; + let conditionalText = null; + let citationClassName = classes.citationText; if (conditional) { - var provReleaseText = provisional ? 'If Provisional data are used, include:' : 'If Released data are used, include:'; + const provReleaseText = provisional ? 'If Provisional data are used, include:' : 'If Released data are used, include:'; if (showTextOnly) { conditionalText = /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: appliedTextOnly.variant, @@ -218,11 +221,11 @@ var DataProductCitationItemView = function DataProductCitationItemView(props) { } citationClassName = classes.citationTextWithQualifier; } - var citationReleaseObject = null; + let citationReleaseObject = null; if (!provisional) { citationReleaseObject = releaseObject; } - var citationText = _CitationService.default.buildDataProductCitationText(citationProduct, citationReleaseObject); + const citationText = _CitationService.default.buildDataProductCitationText(citationProduct, citationReleaseObject); if (showTextOnly) { return /*#__PURE__*/_react.default.createElement("div", null, conditionalText, /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: appliedTextOnly.variant, @@ -230,21 +233,17 @@ var DataProductCitationItemView = function DataProductCitationItemView(props) { className: appliedTextOnly.cssClass }, citationText)); } - var isSectionDownloading = _Service.default.hasCitationDownloadStatus(citationDownloadsFetchStatus, provisional, citationProduct.productCode, _State.FetchStatus.FETCHING); - var downloadStatus; + const isSectionDownloading = _Service.default.hasCitationDownloadStatus(citationDownloadsFetchStatus, provisional, citationProduct.productCode, _State.FetchStatus.FETCHING); + let downloadStatus; if (_Service.default.hasCitationDownloadStatus(citationDownloadsFetchStatus, provisional, citationProduct.productCode, _State.FetchStatus.ERROR)) { downloadStatus = /*#__PURE__*/_react.default.createElement(_Alert.default, { severity: "error", - onClose: function onClose() { - return handleResetCitationDownloadsCb(provisional, citationProduct.productCode); - } + onClose: () => handleResetCitationDownloadsCb(provisional, citationProduct.productCode) }, "Citation download encountered a problem"); } else if (_Service.default.hasCitationDownloadStatus(citationDownloadsFetchStatus, provisional, citationProduct.productCode, _State.FetchStatus.SUCCESS)) { downloadStatus = /*#__PURE__*/_react.default.createElement(_Alert.default, { severity: "success", - onClose: function onClose() { - return handleResetCitationDownloadsCb(provisional, citationProduct.productCode); - } + onClose: () => handleResetCitationDownloadsCb(provisional, citationProduct.productCode) }, "Citation downloaded"); } return /*#__PURE__*/_react.default.createElement(_Card.default, { @@ -268,9 +267,9 @@ var DataProductCitationItemView = function DataProductCitationItemView(props) { className: classes.cardButtonIcon }), className: classes.cardButton - }, "Copy"))), _DataCiteService.default.getDataProductFormats().map(function (format) { - var key = _Service.default.buildCitationDownloadKey(citationProduct, release, format.shortName, provisional); - var isDownloading = !(0, _typeUtil.exists)(citationDownloadsFetchStatus[key]) ? false : citationDownloadsFetchStatus[key].status === _State.FetchStatus.FETCHING; + }, "Copy"))), _DataCiteService.default.getDataProductFormats().map(format => { + const key = _Service.default.buildCitationDownloadKey(citationProduct, release, format.shortName, provisional); + const isDownloading = !(0, _typeUtil.exists)(citationDownloadsFetchStatus[key]) ? false : citationDownloadsFetchStatus[key].status === _State.FetchStatus.FETCHING; return /*#__PURE__*/_react.default.createElement(_Tooltip.default, { key: format.shortName, placement: "bottom-start", @@ -288,13 +287,13 @@ var DataProductCitationItemView = function DataProductCitationItemView(props) { fontSize: "small", className: classes.cardButtonIcon }), - onClick: function onClick() { + onClick: () => { handleCitationDownloadCb(citationProduct, release, format.shortName, provisional); } }, "Download (".concat(format.shortName, ")")))); })), downloadStatus); }; - var citationCard; + let citationCard; switch (displayType) { case _ViewState.DisplayType.CONDITIONAL: citationCard = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderCitationCard(_ReleaseService.PROVISIONAL_RELEASE, true, true), renderCitationCard(releaseObject.release, true, false)); @@ -319,5 +318,4 @@ DataProductCitationItemView.defaultProps = { showTextOnly: false, textOnlyProps: undefined }; -var _default = DataProductCitationItemView; -exports.default = _default; \ No newline at end of file +var _default = exports.default = DataProductCitationItemView; \ No newline at end of file diff --git a/lib/components/Citation/DataProductCitation/Reducer.js b/lib/components/Citation/DataProductCitation/Reducer.js index b4db536f..d87743cb 100644 --- a/lib/components/Citation/DataProductCitation/Reducer.js +++ b/lib/components/Citation/DataProductCitation/Reducer.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -10,12 +9,12 @@ var _typeUtil = require("../../../util/typeUtil"); var _Service = _interopRequireDefault(require("./Service")); var _Actions = _interopRequireWildcard(require("./Actions")); var _State = require("./State"); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -var reinitialize = function reinitialize(state, action) { - var defaultState = (0, _State.getDefaultState)(); +const reinitialize = (state, action) => { + const defaultState = (0, _State.getDefaultState)(); // Calculate new initialized state, keep relevant // computed values from context. return _Service.default.calculateContextState(_extends({}, defaultState, { @@ -27,23 +26,21 @@ var reinitialize = function reinitialize(state, action) { }) }), state.neonContextState, action.release, action.productCode); }; -var isErrorTypeAction = function isErrorTypeAction(action) { - return 'type' in action && 'error' in action; -}; -var resolveError = function resolveError(action, state) { +const isErrorTypeAction = action => 'type' in action && 'error' in action; +const resolveError = (action, state) => { if (!isErrorTypeAction(action)) { return null; } - var result = null; + let result = null; if ((0, _typeUtil.exists)(action.error)) { if ((0, _typeUtil.isStringNonEmpty)(action.error)) { result = action.error; } else { - var resolved = action.error; + const resolved = action.error; if ((0, _typeUtil.exists)(resolved.response)) { - var resolvedResponse = resolved.response; + const resolvedResponse = resolved.response; if ((0, _typeUtil.exists)(resolvedResponse.error)) { - var resolvedErrorResponse = resolvedResponse.error; + const resolvedErrorResponse = resolvedResponse.error; if ((0, _typeUtil.exists)(resolvedErrorResponse.detail)) { result = resolvedErrorResponse.detail; } @@ -55,12 +52,12 @@ var resolveError = function resolveError(action, state) { } } } - var fetchProductFailedAction; - var fetchProductReleaseFailedAction; - var fetchProductReleaseDoiFailedAction; - var fetchBundleParentFailedAction; - var fetchBundleParentReleaseFailedAction; - var fetchCitationDownloadFailedAction; + let fetchProductFailedAction; + let fetchProductReleaseFailedAction; + let fetchProductReleaseDoiFailedAction; + let fetchBundleParentFailedAction; + let fetchBundleParentReleaseFailedAction; + let fetchCitationDownloadFailedAction; switch (action.type) { case _Actions.ActionTypes.FETCH_PRODUCT_FAILED: fetchProductFailedAction = action; @@ -92,36 +89,36 @@ var resolveError = function resolveError(action, state) { } return result; }; -var Reducer = function Reducer(state, action) { - var newState = _extends({}, state); - var errorResult = null; +const Reducer = (state, action) => { + const newState = _extends({}, state); + let errorResult = null; if (isErrorTypeAction(action)) { errorResult = resolveError(action, newState); } - var product; - var productReleaseDoiStatus; - var release; - var bundleParent; - var fetchStatusState; - var setProductCodeAction; - var setReleaseAction; - var fpSucceededAction; - var fprStartedAction; - var fprFailedAction; - var fprSucceededAction; - var fprdStartedAction; - var fprdFailedAction; - var fprdSucceededAction; - var fbpStartedAction; - var fbpFailedAction; - var fbpSucceededAction; - var fbprStartedAction; - var fbprFailedAction; - var fbprSucceededAction; - var fcdStartedAction; - var fcdFailedAction; - var fcdSucceededAction; - var fcdResetAction; + let product; + let productReleaseDoiStatus; + let release; + let bundleParent; + let fetchStatusState; + let setProductCodeAction; + let setReleaseAction; + let fpSucceededAction; + let fprStartedAction; + let fprFailedAction; + let fprSucceededAction; + let fprdStartedAction; + let fprdFailedAction; + let fprdSucceededAction; + let fbpStartedAction; + let fbpFailedAction; + let fbpSucceededAction; + let fbprStartedAction; + let fbprFailedAction; + let fbprSucceededAction; + let fcdStartedAction; + let fcdFailedAction; + let fcdSucceededAction; + let fcdResetAction; switch (action.type) { case _Actions.ActionTypes.REINITIALIZE: // Reset the context state to default state, but keep the @@ -211,9 +208,7 @@ var Reducer = function Reducer(state, action) { } else if (Array.isArray(productReleaseDoiStatus)) { if ((0, _typeUtil.existsNonEmpty)(productReleaseDoiStatus)) { // eslint-disable-next-line max-len - newState.data.productReleaseDois[release] = productReleaseDoiStatus.filter(function (dpds) { - return (0, _typeUtil.exists)(dpds) && (0, _typeUtil.exists)(dpds.status); - }); + newState.data.productReleaseDois[release] = productReleaseDoiStatus.filter(dpds => (0, _typeUtil.exists)(dpds) && (0, _typeUtil.exists)(dpds.status)); } else { newState.data.productReleaseDois[release] = null; } @@ -297,5 +292,4 @@ var Reducer = function Reducer(state, action) { return state; } }; -var _default = Reducer; -exports.default = _default; \ No newline at end of file +var _default = exports.default = Reducer; \ No newline at end of file diff --git a/lib/components/Citation/DataProductCitation/Service.js b/lib/components/Citation/DataProductCitation/Service.js index 7be630fe..594b20d1 100644 --- a/lib/components/Citation/DataProductCitation/Service.js +++ b/lib/components/Citation/DataProductCitation/Service.js @@ -11,44 +11,31 @@ var _typeUtil = require("../../../util/typeUtil"); var _Actions = _interopRequireDefault(require("./Actions")); var _State = require("./State"); var _ViewState = require("./ViewState"); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -var fetchIsInStatus = function fetchIsInStatus(fetchObject, status) { - return _typeof(fetchObject) === 'object' && fetchObject !== null && fetchObject.status === status; -}; -var fetchIsAwaitingCall = function fetchIsAwaitingCall(fetchObject) { - return fetchIsInStatus(fetchObject, _State.FetchStatus.AWAITING_CALL); -}; -var stateHasFetchesInStatus = function stateHasFetchesInStatus(state, status) { - return fetchIsInStatus(state.fetches.product, status) || Object.keys(state.fetches.productReleases).some(function (f) { - return fetchIsInStatus(state.fetches.productReleases[f], status); - }) || Object.keys(state.fetches.productReleaseDois).some(function (f) { - return fetchIsInStatus(state.fetches.productReleaseDois[f], status); - }) || Object.keys(state.fetches.bundleParents).some(function (f) { - return fetchIsInStatus(state.fetches.bundleParents[f], status); - }) || Object.keys(state.fetches.bundleParentReleases).some(function (bundleParent) { - return Object.keys(state.fetches.bundleParentReleases[bundleParent]).some(function (f) { - return fetchIsInStatus(state.fetches.bundleParentReleases[bundleParent][f], status); - }); - }); -}; -var calculateFetches = function calculateFetches(state) { - var newState = _extends({}, state); - var productCode = state.productCode, - release = state.release, - parentCodes = state.bundle.parentCodes; - var releases = state.data.releases; +const fetchIsInStatus = (fetchObject, status) => typeof fetchObject === 'object' && fetchObject !== null && fetchObject.status === status; +const fetchIsAwaitingCall = fetchObject => fetchIsInStatus(fetchObject, _State.FetchStatus.AWAITING_CALL); +const stateHasFetchesInStatus = (state, status) => fetchIsInStatus(state.fetches.product, status) || Object.keys(state.fetches.productReleases).some(f => fetchIsInStatus(state.fetches.productReleases[f], status)) || Object.keys(state.fetches.productReleaseDois).some(f => fetchIsInStatus(state.fetches.productReleaseDois[f], status)) || Object.keys(state.fetches.bundleParents).some(f => fetchIsInStatus(state.fetches.bundleParents[f], status)) || Object.keys(state.fetches.bundleParentReleases).some(bundleParent => Object.keys(state.fetches.bundleParentReleases[bundleParent]).some(f => fetchIsInStatus(state.fetches.bundleParentReleases[bundleParent][f], status))); +const calculateFetches = state => { + const newState = _extends({}, state); + const { + productCode, + release, + bundle: { + parentCodes + } + } = state; + const { + releases + } = state.data; if (!productCode) { return state; } // Find the latest non-prov release definition - var latestRelease = (0, _typeUtil.existsNonEmpty)(releases) ? releases.find(function (r) { - return !_ReleaseService.default.isLatestNonProv(r.release); - }) : null; - var fetchRelease = release || (latestRelease || {}).release; + const latestRelease = (0, _typeUtil.existsNonEmpty)(releases) ? releases.find(r => !_ReleaseService.default.isLatestNonProv(r.release)) : null; + const fetchRelease = release || (latestRelease || {}).release; // Fetch the base product if (!state.fetches.product) { newState.fetches.product = { @@ -68,7 +55,7 @@ var calculateFetches = function calculateFetches(state) { }; } // Fetch all base bundle parent products - (parentCodes || []).forEach(function (bundleParentCode) { + (parentCodes || []).forEach(bundleParentCode => { if (!newState.fetches.bundleParents[bundleParentCode]) { newState.fetches.bundleParents[bundleParentCode] = { status: _State.FetchStatus.AWAITING_CALL @@ -77,7 +64,7 @@ var calculateFetches = function calculateFetches(state) { }); // Fetch all release-specific bundle parent products if (fetchRelease) { - (parentCodes || []).forEach(function (parentCode) { + (parentCodes || []).forEach(parentCode => { if (!newState.fetches.bundleParentReleases[parentCode]) { newState.fetches.bundleParentReleases[parentCode] = {}; } @@ -90,8 +77,8 @@ var calculateFetches = function calculateFetches(state) { } return newState; }; -var calculateAppStatus = function calculateAppStatus(state) { - var updatedState = _extends({}, state); +const calculateAppStatus = state => { + const updatedState = _extends({}, state); if (stateHasFetchesInStatus(state, _State.FetchStatus.ERROR) || state.neonContextState.hasError) { updatedState.component.status = _State.ContextStatus.ERROR; return updatedState; @@ -114,18 +101,12 @@ var calculateAppStatus = function calculateAppStatus(state) { // child may not show as being in any release though the parent is (if the bundle is one that // forwards availability). In such a case this will be called when the bundle parent is fetched // and will thus populate the global releases object (and so the ReleaseFilter). -var applyReleasesGlobally = function applyReleasesGlobally(state, releases) { - var updatedState = _extends({}, state); - releases.filter(function (r) { - return !Object.prototype.hasOwnProperty.call(updatedState.data.productReleases, r.release); - }).forEach(function (r) { +const applyReleasesGlobally = (state, releases) => { + const updatedState = _extends({}, state); + releases.filter(r => !Object.prototype.hasOwnProperty.call(updatedState.data.productReleases, r.release)).forEach(r => { updatedState.data.productReleases[r.release] = null; }); - releases.filter(function (r) { - return updatedState.data.releases.every(function (existingR) { - return r.release !== existingR.release; - }); - }).forEach(function (r) { + releases.filter(r => updatedState.data.releases.every(existingR => r.release !== existingR.release)).forEach(r => { updatedState.data.releases.push(_extends({}, r, { description: r.release, showCitation: true, @@ -136,22 +117,20 @@ var applyReleasesGlobally = function applyReleasesGlobally(state, releases) { updatedState.data.releases = _ReleaseService.default.sortReleases(updatedState.data.releases); return updatedState; }; -var applyDoiStatusReleaseGlobally = function applyDoiStatusReleaseGlobally(state, productCode, release, doiStatus) { +const applyDoiStatusReleaseGlobally = (state, productCode, release, doiStatus) => { var _updatedState$neonCon; if (!(0, _typeUtil.exists)(doiStatus)) { return state; } - var updatedState = _extends({}, state); + const updatedState = _extends({}, state); // eslint-disable-next-line max-len - var appliedDoiStatus = _BundleService.default.determineAppliedBundleRelease((((_updatedState$neonCon = updatedState.neonContextState) === null || _updatedState$neonCon === void 0 ? void 0 : _updatedState$neonCon.data) || {}).bundles, release, productCode, doiStatus); - var transformedRelease = _ReleaseService.default.transformDoiStatusRelease(appliedDoiStatus); + const appliedDoiStatus = _BundleService.default.determineAppliedBundleRelease((((_updatedState$neonCon = updatedState.neonContextState) === null || _updatedState$neonCon === void 0 ? void 0 : _updatedState$neonCon.data) || {}).bundles, release, productCode, doiStatus); + const transformedRelease = _ReleaseService.default.transformDoiStatusRelease(appliedDoiStatus); if (!(0, _typeUtil.exists)(transformedRelease)) { return updatedState; } - var citationRelease = transformedRelease; - var hasRelease = updatedState.data.releases.some(function (value) { - return (0, _typeUtil.exists)(value) && (0, _typeUtil.isStringNonEmpty)(value.release) && (0, _typeUtil.isStringNonEmpty)(citationRelease.release) && value.release.localeCompare(citationRelease.release) === 0; - }); + const citationRelease = transformedRelease; + const hasRelease = updatedState.data.releases.some(value => (0, _typeUtil.exists)(value) && (0, _typeUtil.isStringNonEmpty)(value.release) && (0, _typeUtil.isStringNonEmpty)(citationRelease.release) && value.release.localeCompare(citationRelease.release) === 0); if (!hasRelease) { updatedState.data.releases.push(citationRelease); } @@ -168,20 +147,20 @@ var applyDoiStatusReleaseGlobally = function applyDoiStatusReleaseGlobally(state * @param productCode The product code to work from. * @return The next DataProductCitationState state. */ -var calculateContextState = function calculateContextState(newState, neonContextState, release, productCode) { - var isErrorState = newState.component.status === _State.ContextStatus.ERROR; - var bundles = { +const calculateContextState = (newState, neonContextState, release, productCode) => { + const isErrorState = newState.component.status === _State.ContextStatus.ERROR; + let bundles = { parentCodes: [], doiProductCode: null }; if ((0, _typeUtil.isStringNonEmpty)(productCode)) { bundles = _BundleService.default.determineCitationBundle(neonContextState.data.bundles, release, productCode); } - var newFetchState = calculateFetches(_extends({}, newState, { + const newFetchState = calculateFetches(_extends({}, newState, { bundle: bundles })); - var newAppStatusState = calculateAppStatus(_extends({}, newFetchState, { - neonContextState: neonContextState + const newAppStatusState = calculateAppStatus(_extends({}, newFetchState, { + neonContextState })); // If the existing app state was errored due to initialization, // keep the current error state. @@ -190,21 +169,17 @@ var calculateContextState = function calculateContextState(newState, neonContext } return newAppStatusState; }; -var getReleaseObject = function getReleaseObject(releases, release) { - return !(0, _typeUtil.isStringNonEmpty)(release) || release === _ReleaseService.PROVISIONAL_RELEASE ? null : releases.find(function (r) { - return r.release === release; - }); -}; -var getReleaseDoi = function getReleaseDoi(releases, release) { - var releaseObject = getReleaseObject(releases, release); +const getReleaseObject = (releases, release) => !(0, _typeUtil.isStringNonEmpty)(release) || release === _ReleaseService.PROVISIONAL_RELEASE ? null : releases.find(r => r.release === release); +const getReleaseDoi = (releases, release) => { + const releaseObject = getReleaseObject(releases, release); if (!(0, _typeUtil.exists)(releaseObject) || !(0, _typeUtil.exists)(releaseObject.productDoi) || !(0, _typeUtil.isStringNonEmpty)(releaseObject.productDoi.url)) { return null; } return releaseObject.productDoi.url; }; -var buildCitationDownloadKey = function buildCitationDownloadKey(citationProduct, releaseCb, formatCb) { - var provisionalCb = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; - var key = "citation-download-".concat(citationProduct.productCode); +const buildCitationDownloadKey = function (citationProduct, releaseCb, formatCb) { + let provisionalCb = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; + let key = "citation-download-".concat(citationProduct.productCode); if ((0, _typeUtil.isStringNonEmpty)(releaseCb)) { key = "".concat(key, "-").concat(releaseCb); } else if (provisionalCb) { @@ -219,24 +194,22 @@ var buildCitationDownloadKey = function buildCitationDownloadKey(citationProduct } return key; }; -var hasCitationDownloadStatus = function hasCitationDownloadStatus(citationDownloadsFetchStatus, provisionalCb, productCode, statusCb) { - return Object.keys(citationDownloadsFetchStatus).some(function (k) { - if (citationDownloadsFetchStatus[k]) { - var shouldConsider = true; - if (!k.includes(productCode) || !provisionalCb && k.includes(_ReleaseService.PROVISIONAL_RELEASE) || provisionalCb && !k.includes(_ReleaseService.PROVISIONAL_RELEASE)) { - shouldConsider = false; - } - if (shouldConsider && citationDownloadsFetchStatus[k].status === statusCb) { - return true; - } +const hasCitationDownloadStatus = (citationDownloadsFetchStatus, provisionalCb, productCode, statusCb) => Object.keys(citationDownloadsFetchStatus).some(k => { + if (citationDownloadsFetchStatus[k]) { + let shouldConsider = true; + if (!k.includes(productCode) || !provisionalCb && k.includes(_ReleaseService.PROVISIONAL_RELEASE) || provisionalCb && !k.includes(_ReleaseService.PROVISIONAL_RELEASE)) { + shouldConsider = false; } - return false; - }); -}; -var handleResetCitationDownloads = function handleResetCitationDownloads(citationDownloadsFetchStatus, provisionalCb, productCode, dispatch) { - Object.keys(citationDownloadsFetchStatus).forEach(function (k) { + if (shouldConsider && citationDownloadsFetchStatus[k].status === statusCb) { + return true; + } + } + return false; +}); +const handleResetCitationDownloads = (citationDownloadsFetchStatus, provisionalCb, productCode, dispatch) => { + Object.keys(citationDownloadsFetchStatus).forEach(k => { if (citationDownloadsFetchStatus[k]) { - var shouldReset = true; + let shouldReset = true; if (!k.includes(productCode) || !provisionalCb && k.includes(_ReleaseService.PROVISIONAL_RELEASE) || provisionalCb && !k.includes(_ReleaseService.PROVISIONAL_RELEASE)) { shouldReset = false; } @@ -250,37 +223,46 @@ var handleResetCitationDownloads = function handleResetCitationDownloads(citatio } }); }; -var useViewState = function useViewState(state, props) { - var specifiedReleaseTag = state.release, - bundle = state.bundle, - status = state.component.status, - citationDownloadsFetchStatus = state.fetches.citationDownloads, - _state$data = state.data, - baseProduct = _state$data.product, - productReleases = _state$data.productReleases, - productReleaseDois = _state$data.productReleaseDois, - bundleParents = _state$data.bundleParents, - bundleParentReleases = _state$data.bundleParentReleases, - releases = _state$data.releases, - neonContextStateData = state.neonContextState.data; - var bundlesContext = neonContextStateData.bundles; - var disableConditional = props.disableConditional; - var hasReleases = (0, _typeUtil.existsNonEmpty)(releases); +const useViewState = (state, props) => { + const { + release: specifiedReleaseTag, + bundle, + component: { + status + }, + fetches: { + citationDownloads: citationDownloadsFetchStatus + }, + data: { + product: baseProduct, + productReleases, + productReleaseDois, + bundleParents, + bundleParentReleases, + releases + }, + neonContextState: { + data: neonContextStateData + } + } = state; + const bundlesContext = neonContextStateData.bundles; + const { + disableConditional + } = props; + const hasReleases = (0, _typeUtil.existsNonEmpty)(releases); // Identify the latest release state. - var latestReleaseObject = hasReleases ? releases.find(function (r) { - return r.showCitation === true; - }) : null; - var hasLatestRelease = (0, _typeUtil.exists)(latestReleaseObject) && (0, _typeUtil.isStringNonEmpty)(latestReleaseObject.release); - var hideLatestReleaseCitation = hasLatestRelease ? latestReleaseObject.showCitation === false : false; + const latestReleaseObject = hasReleases ? releases.find(r => r.showCitation === true) : null; + const hasLatestRelease = (0, _typeUtil.exists)(latestReleaseObject) && (0, _typeUtil.isStringNonEmpty)(latestReleaseObject.release); + const hideLatestReleaseCitation = hasLatestRelease ? latestReleaseObject.showCitation === false : false; // Identify state of specified release. - var hasSpecifiedRelease = (0, _typeUtil.isStringNonEmpty)(specifiedReleaseTag); - var specifiedReleaseObject = hasSpecifiedRelease && hasReleases ? getReleaseObject(releases, specifiedReleaseTag) : null; - var isSpecifiedReleaseValid = (0, _typeUtil.exists)(specifiedReleaseObject) && (0, _typeUtil.isStringNonEmpty)(specifiedReleaseObject.release); - var isSpecifiedReleaseLatestNonProv = hasSpecifiedRelease ? _ReleaseService.default.isLatestNonProv(specifiedReleaseTag) : false; + const hasSpecifiedRelease = (0, _typeUtil.isStringNonEmpty)(specifiedReleaseTag); + const specifiedReleaseObject = hasSpecifiedRelease && hasReleases ? getReleaseObject(releases, specifiedReleaseTag) : null; + const isSpecifiedReleaseValid = (0, _typeUtil.exists)(specifiedReleaseObject) && (0, _typeUtil.isStringNonEmpty)(specifiedReleaseObject.release); + const isSpecifiedReleaseLatestNonProv = hasSpecifiedRelease ? _ReleaseService.default.isLatestNonProv(specifiedReleaseTag) : false; // Determine the release tag to render for the citation, either for the // currently specified release or the latest release. - var appliedReleaseObject = null; - var appliedRenderedReleaseTag = null; + let appliedReleaseObject = null; + let appliedRenderedReleaseTag = null; if (hasSpecifiedRelease) { if (isSpecifiedReleaseValid) { appliedReleaseObject = specifiedReleaseObject; @@ -290,29 +272,29 @@ var useViewState = function useViewState(state, props) { appliedReleaseObject = latestReleaseObject; appliedRenderedReleaseTag = latestReleaseObject.release; } - var hasAppliedRelease = (0, _typeUtil.exists)(appliedReleaseObject); - var isAppliedReleaseLatestNonProv = (0, _typeUtil.isStringNonEmpty)(appliedRenderedReleaseTag) ? _ReleaseService.default.isLatestNonProv(appliedRenderedReleaseTag) : false; - var appliedReleaseDoi = null; + const hasAppliedRelease = (0, _typeUtil.exists)(appliedReleaseObject); + const isAppliedReleaseLatestNonProv = (0, _typeUtil.isStringNonEmpty)(appliedRenderedReleaseTag) ? _ReleaseService.default.isLatestNonProv(appliedRenderedReleaseTag) : false; + let appliedReleaseDoi = null; if (hasAppliedRelease && !isAppliedReleaseLatestNonProv) { - var aro = appliedReleaseObject; + const aro = appliedReleaseObject; if ((0, _typeUtil.exists)(aro.productDoi) && (0, _typeUtil.isStringNonEmpty)(aro.productDoi.url)) { appliedReleaseDoi = aro.productDoi.url; } } - var hasAppliedReleaseDoi = (0, _typeUtil.isStringNonEmpty)(appliedReleaseDoi); - var hideAppliedReleaseCitation = (0, _typeUtil.exists)(appliedReleaseObject) && appliedReleaseObject.showCitation === false; + const hasAppliedReleaseDoi = (0, _typeUtil.isStringNonEmpty)(appliedReleaseDoi); + const hideAppliedReleaseCitation = (0, _typeUtil.exists)(appliedReleaseObject) && appliedReleaseObject.showCitation === false; // Determine tombstoned state for entire citation - var hasProductReleaseDois = (0, _typeUtil.exists)(productReleaseDois) && (0, _typeUtil.isStringNonEmpty)(appliedRenderedReleaseTag) && (0, _typeUtil.exists)(productReleaseDois[appliedRenderedReleaseTag]); - var dataProductDoiStatus = null; - var isTombstoned = false; - var determineDoiStatusTombstone = function determineDoiStatusTombstone(dpds) { - var tsResult = false; + const hasProductReleaseDois = (0, _typeUtil.exists)(productReleaseDois) && (0, _typeUtil.isStringNonEmpty)(appliedRenderedReleaseTag) && (0, _typeUtil.exists)(productReleaseDois[appliedRenderedReleaseTag]); + let dataProductDoiStatus = null; + let isTombstoned = false; + const determineDoiStatusTombstone = dpds => { + let tsResult = false; if (!Array.isArray(dpds)) { // eslint-disable-next-line max-len - var doiStatusType = dpds === null || dpds === void 0 ? void 0 : dpds.status; + const doiStatusType = dpds === null || dpds === void 0 ? void 0 : dpds.status; tsResult = (0, _typeUtil.exists)(doiStatusType) && doiStatusType === _neonApi.DoiStatusType.TOMBSTONED; } else { - tsResult = dpds.every(function (ds) { + tsResult = dpds.every(ds => { if (!(0, _typeUtil.exists)(ds)) return false; return ds.status === _neonApi.DoiStatusType.TOMBSTONED; }); @@ -324,11 +306,11 @@ var useViewState = function useViewState(state, props) { isTombstoned = determineDoiStatusTombstone(dataProductDoiStatus); } // Identify whether or not viewing a bundled product with applicable DOI. - var hasBundleCode = (0, _typeUtil.existsNonEmpty)(bundle.parentCodes) && ((0, _typeUtil.isStringNonEmpty)(bundle.doiProductCode) || Array.isArray(bundle.doiProductCode) && (0, _typeUtil.existsNonEmpty)(bundle.doiProductCode)); + const hasBundleCode = (0, _typeUtil.existsNonEmpty)(bundle.parentCodes) && ((0, _typeUtil.isStringNonEmpty)(bundle.doiProductCode) || Array.isArray(bundle.doiProductCode) && (0, _typeUtil.existsNonEmpty)(bundle.doiProductCode)); // Builds a citation item based on current state // of release, specified bundle code when applicable. - var buildCitationItem = function buildCitationItem(bundleParentCode, bundleDpds) { - var item = { + const buildCitationItem = (bundleParentCode, bundleDpds) => { + const item = { releaseObject: null, doiUrl: null, citableBaseProduct: null, @@ -336,35 +318,33 @@ var useViewState = function useViewState(state, props) { bundleParentCode: null, isTombstoned: false }; - var bundleProduct = null; + let bundleProduct = null; if (hasBundleCode && (0, _typeUtil.isStringNonEmpty)(bundleParentCode) && (0, _typeUtil.exists)(bundleParents[bundleParentCode])) { bundleProduct = bundleParents[bundleParentCode]; } - var hasBundleProduct = (0, _typeUtil.exists)(bundleProduct); + const hasBundleProduct = (0, _typeUtil.exists)(bundleProduct); // Determines if the latest release has a bundle defined for this product. - var hasLatestReleaseBundle = false; + let hasLatestReleaseBundle = false; if (hasLatestRelease && (0, _typeUtil.exists)(baseProduct)) { hasLatestReleaseBundle = _BundleService.default.isProductInBundle(bundlesContext, latestReleaseObject.release, baseProduct.productCode); } // Determine if the bundle product has data for the specified release. - var isBundleProductInRelease = true; + let isBundleProductInRelease = true; if (hasBundleProduct && hasSpecifiedRelease && !isAppliedReleaseLatestNonProv) { var _bundleProduct; - var bundleHasRelease = (_bundleProduct = bundleProduct) === null || _bundleProduct === void 0 ? void 0 : _bundleProduct.releases.find(function (r) { - return r.release === appliedRenderedReleaseTag; - }); + const bundleHasRelease = (_bundleProduct = bundleProduct) === null || _bundleProduct === void 0 ? void 0 : _bundleProduct.releases.find(r => r.release === appliedRenderedReleaseTag); isBundleProductInRelease = (0, _typeUtil.exists)(bundleHasRelease); } - var itemReleaseObject = appliedReleaseObject; - var itemDoiUrl = appliedReleaseDoi; - var itemIsTombstoned = false; + let itemReleaseObject = appliedReleaseObject; + let itemDoiUrl = appliedReleaseDoi; + let itemIsTombstoned = false; // Determine if the citable product should be the bundle container product // or the currently specified product. // eslint-disable-next-line max-len - var citableBaseProduct = hasBundleProduct && isBundleProductInRelease ? bundleProduct : baseProduct; + const citableBaseProduct = hasBundleProduct && isBundleProductInRelease ? bundleProduct : baseProduct; // Determine the product to use for citing within the applicable release // and within the context of bundles. - var citableReleaseProduct = null; + let citableReleaseProduct = null; if (hasAppliedReleaseDoi && !hideAppliedReleaseCitation) { // If we're referencing latest release and provisional, and there isn't a bundle // defined for the latest release, use base product for release citation. @@ -378,24 +358,24 @@ var useViewState = function useViewState(state, props) { // release when available. // eslint-disable-next-line no-lonely-if if (hasBundleCode) { - var bpr = bundleParentReleases[bundleParentCode]; + const bpr = bundleParentReleases[bundleParentCode]; if ((0, _typeUtil.exists)(bpr)) { - var product = bpr[appliedRenderedReleaseTag]; + const product = bpr[appliedRenderedReleaseTag]; if ((0, _typeUtil.exists)(product)) { citableReleaseProduct = product; } } } else { - var _product = productReleases[appliedRenderedReleaseTag]; - if ((0, _typeUtil.exists)(_product)) { - citableReleaseProduct = _product; + const product = productReleases[appliedRenderedReleaseTag]; + if ((0, _typeUtil.exists)(product)) { + citableReleaseProduct = product; } } } } // Determine release property states from current bundle. if (hasBundleCode && (0, _typeUtil.isStringNonEmpty)(bundleParentCode) && (0, _typeUtil.exists)(bundleDpds)) { - var bundleCitationRelease = _ReleaseService.default.transformDoiStatusRelease(bundleDpds); + const bundleCitationRelease = _ReleaseService.default.transformDoiStatusRelease(bundleDpds); itemReleaseObject = bundleCitationRelease; itemDoiUrl = bundleCitationRelease.productDoi.url; itemIsTombstoned = determineDoiStatusTombstone(bundleDpds); @@ -409,25 +389,25 @@ var useViewState = function useViewState(state, props) { return item; }; // Build set of applicable citation items for product, bundle - var items = []; + const items = []; if (!hasBundleCode) { - var nonBundleItem = buildCitationItem(); + const nonBundleItem = buildCitationItem(); items.push(nonBundleItem); } else if ((0, _typeUtil.isStringNonEmpty)(bundle.doiProductCode)) { - var bundleParentCode = bundle.doiProductCode; - var singleBundleItem = buildCitationItem(bundleParentCode); + const bundleParentCode = bundle.doiProductCode; + const singleBundleItem = buildCitationItem(bundleParentCode); items.push(singleBundleItem); } else if (Array.isArray(bundle.doiProductCode) && (0, _typeUtil.existsNonEmpty)(bundle.doiProductCode)) { - var bundleParentCodes = bundle.doiProductCode; + const bundleParentCodes = bundle.doiProductCode; if (hasProductReleaseDois && !Array.isArray(dataProductDoiStatus)) { - var _bundleParentCode = bundle.doiProductCode[0]; - var _singleBundleItem = buildCitationItem(_bundleParentCode); - items.push(_singleBundleItem); + const bundleParentCode = bundle.doiProductCode[0]; + const singleBundleItem = buildCitationItem(bundleParentCode); + items.push(singleBundleItem); } else { - bundleParentCodes.forEach(function (bundleParentCode) { - var bundleDpds; + bundleParentCodes.forEach(bundleParentCode => { + let bundleDpds; if (hasProductReleaseDois && Array.isArray(dataProductDoiStatus)) { - bundleDpds = dataProductDoiStatus.find(function (ds) { + bundleDpds = dataProductDoiStatus.find(ds => { if (!(0, _typeUtil.exists)(ds)) return false; return ds.productCode.localeCompare(bundleParentCode) === 0; }); @@ -437,43 +417,37 @@ var useViewState = function useViewState(state, props) { // This should not occur if bundles and DOIs are properly // configured and data come across properly in API calls. if ((0, _typeUtil.exists)(bundleDpds)) { - var bundleItem = buildCitationItem(bundleParentCode, bundleDpds); + const bundleItem = buildCitationItem(bundleParentCode, bundleDpds); items.push(bundleItem); } else if (hasSpecifiedRelease && isAppliedReleaseLatestNonProv) { - var _bundleItem = buildCitationItem(bundleParentCode); - items.push(_bundleItem); + const bundleItem = buildCitationItem(bundleParentCode); + items.push(bundleItem); } }); } } // Determine if there's a valid product to generate the citation with. - var hasValidProduct = items.some(function (item) { - return (0, _typeUtil.exists)(item.citableBaseProduct); - }); - var hasValidReleaseProduct = items.some(function (item) { - return (0, _typeUtil.exists)(item.citableReleaseProduct); - }); + const hasValidProduct = items.some(item => (0, _typeUtil.exists)(item.citableBaseProduct)); + const hasValidReleaseProduct = items.some(item => (0, _typeUtil.exists)(item.citableReleaseProduct)); // Verify identified release product is in the applied release. - var isCitableReleaseProductInRelease = false; + let isCitableReleaseProductInRelease = false; // If looking at latest release non provisional, consider in release. if (isAppliedReleaseLatestNonProv) { isCitableReleaseProductInRelease = true; } else if (hasValidReleaseProduct) { - var productHasRelease = items.some(function (item) { + const productHasRelease = items.some(item => { var _item$citableReleaseP; - var dpr = (_item$citableReleaseP = item.citableReleaseProduct) === null || _item$citableReleaseP === void 0 ? void 0 : _item$citableReleaseP.releases.find(function (r) { - return r.release === appliedRenderedReleaseTag; - }); + const dpr = (_item$citableReleaseP = item.citableReleaseProduct) === null || _item$citableReleaseP === void 0 ? void 0 : _item$citableReleaseP.releases.find(r => r.release === appliedRenderedReleaseTag); return (0, _typeUtil.exists)(dpr) || item.isTombstoned; }); isCitableReleaseProductInRelease = productHasRelease || isTombstoned; } // Determine the overall citation display status. - var appliedStatus = status; - var displayType = _ViewState.DisplayType.CONDITIONAL; - var isReady = status === _State.ContextStatus.READY; - var isError = status === _State.ContextStatus.ERROR; - var setErrorNotAvailable = function setErrorNotAvailable() { + let appliedStatus = status; + let displayType = _ViewState.DisplayType.CONDITIONAL; + const isReady = status === _State.ContextStatus.READY; + const isError = status === _State.ContextStatus.ERROR; + const setErrorNotAvailable = () => { appliedStatus = _State.ContextStatus.ERROR; displayType = _ViewState.DisplayType.NOT_AVAILABLE; }; @@ -537,26 +511,25 @@ var useViewState = function useViewState(state, props) { return { status: appliedStatus, citationItems: items, - releases: releases, - displayType: displayType, - isTombstoned: isTombstoned, - citationDownloadsFetchStatus: citationDownloadsFetchStatus + releases, + displayType, + isTombstoned, + citationDownloadsFetchStatus }; }; -var Service = { - fetchIsAwaitingCall: fetchIsAwaitingCall, - stateHasFetchesInStatus: stateHasFetchesInStatus, - calculateFetches: calculateFetches, - calculateAppStatus: calculateAppStatus, - applyReleasesGlobally: applyReleasesGlobally, - applyDoiStatusReleaseGlobally: applyDoiStatusReleaseGlobally, - calculateContextState: calculateContextState, - useViewState: useViewState, - getReleaseObject: getReleaseObject, - getReleaseDoi: getReleaseDoi, - buildCitationDownloadKey: buildCitationDownloadKey, - hasCitationDownloadStatus: hasCitationDownloadStatus, - handleResetCitationDownloads: handleResetCitationDownloads +const Service = { + fetchIsAwaitingCall, + stateHasFetchesInStatus, + calculateFetches, + calculateAppStatus, + applyReleasesGlobally, + applyDoiStatusReleaseGlobally, + calculateContextState, + useViewState, + getReleaseObject, + getReleaseDoi, + buildCitationDownloadKey, + hasCitationDownloadStatus, + handleResetCitationDownloads }; -var _default = Service; -exports.default = _default; \ No newline at end of file +var _default = exports.default = Service; \ No newline at end of file diff --git a/lib/components/Citation/DataProductCitation/State.js b/lib/components/Citation/DataProductCitation/State.js index e6d63c60..4652ac83 100644 --- a/lib/components/Citation/DataProductCitation/State.js +++ b/lib/components/Citation/DataProductCitation/State.js @@ -7,7 +7,7 @@ exports.getDefaultState = exports.FetchStatus = exports.ContextStatus = void 0; var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep")); var _NeonContext = _interopRequireDefault(require("../../NeonContext/NeonContext")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var FetchStatus = /*#__PURE__*/function (FetchStatus) { +let FetchStatus = exports.FetchStatus = /*#__PURE__*/function (FetchStatus) { FetchStatus["AWAITING_CALL"] = "AWAITING_CALL"; FetchStatus["FETCHING"] = "FETCHING"; FetchStatus["ERROR"] = "ERROR"; @@ -15,8 +15,7 @@ var FetchStatus = /*#__PURE__*/function (FetchStatus) { FetchStatus["IDLE"] = "IDLE"; return FetchStatus; }({}); -exports.FetchStatus = FetchStatus; -var ContextStatus = /*#__PURE__*/function (ContextStatus) { +let ContextStatus = exports.ContextStatus = /*#__PURE__*/function (ContextStatus) { ContextStatus["INITIALIZING"] = "INITIALIZING"; ContextStatus["HAS_FETCHES_TO_TRIGGER"] = "HAS_FETCHES_TO_TRIGGER"; ContextStatus["FETCHING"] = "FETCHING"; @@ -25,8 +24,7 @@ var ContextStatus = /*#__PURE__*/function (ContextStatus) { return ContextStatus; }({}); // TODO: once product is moved to a proper interface, // make this a "Pick" of that type. -exports.ContextStatus = ContextStatus; -var DEFAULT_STATE = { +const DEFAULT_STATE = { productCode: null, release: null, component: { @@ -61,7 +59,5 @@ var DEFAULT_STATE = { }, neonContextState: (0, _cloneDeep.default)(_NeonContext.default.DEFAULT_STATE) }; -var getDefaultState = function getDefaultState() { - return (0, _cloneDeep.default)(DEFAULT_STATE); -}; +const getDefaultState = () => (0, _cloneDeep.default)(DEFAULT_STATE); exports.getDefaultState = getDefaultState; \ No newline at end of file diff --git a/lib/components/Citation/DataProductCitation/View.js b/lib/components/Citation/DataProductCitation/View.js index e4c341b9..e28abf74 100644 --- a/lib/components/Citation/DataProductCitation/View.js +++ b/lib/components/Citation/DataProductCitation/View.js @@ -25,56 +25,58 @@ var _State = require("./State"); var _ViewState = require("./ViewState"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - citationTextOnly: { - color: theme.palette.grey[400] - }, - calloutIcon: { - color: theme.palette.grey[300], - marginRight: theme.spacing(2) - }, - citationUseFlexContainer: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center', - marginBottom: theme.spacing(3) - }, - citationUseText: { - flexGrow: 1 - }, - itemContainer: { - marginBottom: theme.spacing(2) - } - }; -}); -var DataProductCitationView = function DataProductCitationView(props) { - var showQuoteIcon = props.showQuoteIcon, - disableSkeleton = props.disableSkeleton, - showTextOnly = props.showTextOnly, - textOnlyProps = props.textOnlyProps, - showManyParents = props.showManyParents; - var classes = useStyles(_Theme.default); - var state = _Context.default.useDataProductCitationContextState(); - var appliedTextOnly = { +const useStyles = (0, _styles.makeStyles)(theme => ({ + citationTextOnly: { + color: theme.palette.grey[400] + }, + calloutIcon: { + color: theme.palette.grey[300], + marginRight: theme.spacing(2) + }, + citationUseFlexContainer: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center', + marginBottom: theme.spacing(3) + }, + citationUseText: { + flexGrow: 1 + }, + itemContainer: { + marginBottom: theme.spacing(2) + } +})); +const DataProductCitationView = props => { + const { + showQuoteIcon, + disableSkeleton, + showTextOnly, + textOnlyProps, + showManyParents + } = props; + const classes = useStyles(_Theme.default); + const state = _Context.default.useDataProductCitationContextState(); + let appliedTextOnly = { variant: 'caption', cssClass: classes.citationTextOnly }; if ((0, _typeUtil.exists)(textOnlyProps)) { appliedTextOnly = textOnlyProps; } - var viewState = _Service.default.useViewState(state, props); - var status = viewState.status, - displayType = viewState.displayType, - citationItems = viewState.citationItems; - var bundleParentCodes = {}; - var hasManyParents = citationItems.length > 1; - citationItems.forEach(function (item) { + const viewState = _Service.default.useViewState(state, props); + const { + status, + displayType, + citationItems + } = viewState; + const bundleParentCodes = {}; + const hasManyParents = citationItems.length > 1; + citationItems.forEach(item => { var _item$releaseObject; if (!(0, _typeUtil.exists)(item) || !(0, _typeUtil.isStringNonEmpty)(item.bundleParentCode)) { return; } - var key = "".concat(item.bundleParentCode, ":").concat((_item$releaseObject = item.releaseObject) === null || _item$releaseObject === void 0 ? void 0 : _item$releaseObject.release); + const key = "".concat(item.bundleParentCode, ":").concat((_item$releaseObject = item.releaseObject) === null || _item$releaseObject === void 0 ? void 0 : _item$releaseObject.release); if (!(0, _typeUtil.exists)(bundleParentCodes[key])) { var _item$releaseObject2; bundleParentCodes[key] = { @@ -83,7 +85,7 @@ var DataProductCitationView = function DataProductCitationView(props) { }; } }); - var renderSkeleton = function renderSkeleton() { + const renderSkeleton = () => { if (disableSkeleton) { // eslint-disable-next-line react/jsx-no-useless-fragment return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null); @@ -107,8 +109,8 @@ var DataProductCitationView = function DataProductCitationView(props) { height: 180 })) : null); }; - var renderError = function renderError() { - var errorTitle = 'Data Product Citation Generation Error'; + const renderError = () => { + const errorTitle = 'Data Product Citation Generation Error'; if (showTextOnly) { return /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: appliedTextOnly.variant, @@ -126,9 +128,9 @@ var DataProductCitationView = function DataProductCitationView(props) { title: errorTitle }))); }; - var renderNotAvailable = function renderNotAvailable() { - var errorTitle = 'Data Product Citation Not Available'; - var errorMessage = 'A citation is not available for the specified data product and release.'; + const renderNotAvailable = () => { + const errorTitle = 'Data Product Citation Not Available'; + const errorMessage = 'A citation is not available for the specified data product and release.'; if (showTextOnly) { return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: appliedTextOnly.variant, @@ -147,20 +149,20 @@ var DataProductCitationView = function DataProductCitationView(props) { message: errorMessage }))); }; - var renderCitationBlurb = function renderCitationBlurb() { + const renderCitationBlurb = () => { if (showTextOnly) { return null; } - var showNonConditionalBlurb = [_ViewState.DisplayType.RELEASE, _ViewState.DisplayType.PROVISIONAL].includes(displayType); - var quoteIcon = showQuoteIcon ? /*#__PURE__*/_react.default.createElement(_FormatQuote.default, { + const showNonConditionalBlurb = [_ViewState.DisplayType.RELEASE, _ViewState.DisplayType.PROVISIONAL].includes(displayType); + const quoteIcon = showQuoteIcon ? /*#__PURE__*/_react.default.createElement(_FormatQuote.default, { fontSize: "large", className: classes.calloutIcon }) : null; - var blurb = 'Please use the appropriate citation(s) from below in your publications. ' + 'If using both provisional and release data please include both citations. '; + let blurb = 'Please use the appropriate citation(s) from below in your publications. ' + 'If using both provisional and release data please include both citations. '; if (showNonConditionalBlurb) { blurb = 'Please use this citation in your publications. '; } - var dataPolicyLink = /*#__PURE__*/_react.default.createElement(_Link.default, { + const dataPolicyLink = /*#__PURE__*/_react.default.createElement(_Link.default, { href: _RouteService.default.getDataPoliciesCitationPath() }, "Data Policies & Citation Guidelines"); return /*#__PURE__*/_react.default.createElement("div", { @@ -170,23 +172,21 @@ var DataProductCitationView = function DataProductCitationView(props) { className: classes.citationUseText }, blurb, "See ", dataPolicyLink, " for more info.")); }; - var renderBundleParentsCard = function renderBundleParentsCard() { - var filteredCitationItems = citationItems.filter(function (item) { - return (0, _typeUtil.exists)(item) && (0, _typeUtil.exists)(item.citableBaseProduct) && (0, _typeUtil.exists)(item.citableReleaseProduct) && (0, _typeUtil.isStringNonEmpty)(item.bundleParentCode) && (0, _typeUtil.exists)(item.releaseObject); - }); + const renderBundleParentsCard = () => { + const filteredCitationItems = citationItems.filter(item => (0, _typeUtil.exists)(item) && (0, _typeUtil.exists)(item.citableBaseProduct) && (0, _typeUtil.exists)(item.citableReleaseProduct) && (0, _typeUtil.isStringNonEmpty)(item.bundleParentCode) && (0, _typeUtil.exists)(item.releaseObject)); if (!(0, _typeUtil.existsNonEmpty)(filteredCitationItems) || filteredCitationItems.length <= 1) { return null; } - var isReleaseDisplay = displayType === _ViewState.DisplayType.RELEASE; - var bundleNoteTerminalChar = !showManyParents ? '.' : ':'; - var titleContent = _BundleContentBuilder.default.buildDefaultSplitTitleContent(isReleaseDisplay, bundleNoteTerminalChar); - var detailContent = !showManyParents ? undefined : /*#__PURE__*/_react.default.createElement("ul", { + const isReleaseDisplay = displayType === _ViewState.DisplayType.RELEASE; + const bundleNoteTerminalChar = !showManyParents ? '.' : ':'; + const titleContent = _BundleContentBuilder.default.buildDefaultSplitTitleContent(isReleaseDisplay, bundleNoteTerminalChar); + const detailContent = !showManyParents ? undefined : /*#__PURE__*/_react.default.createElement("ul", { style: { margin: _Theme.default.spacing(1, 0) } - }, filteredCitationItems.map(function (item) { - var bundleParentName = isReleaseDisplay ? item.citableReleaseProduct.productName : item.citableBaseProduct.productName; - var bundleParentHref = _RouteService.default.getProductDetailPath(item.bundleParentCode); + }, filteredCitationItems.map(item => { + const bundleParentName = isReleaseDisplay ? item.citableReleaseProduct.productName : item.citableBaseProduct.productName; + let bundleParentHref = _RouteService.default.getProductDetailPath(item.bundleParentCode); if (isReleaseDisplay) { bundleParentHref = _RouteService.default.getProductDetailPath(item.bundleParentCode, item.releaseObject.release); } @@ -197,7 +197,7 @@ var DataProductCitationView = function DataProductCitationView(props) { target: "_blank" }, "".concat(bundleParentName, " (").concat(item.bundleParentCode, ")"))); })); - var subTitleContent = !showManyParents ? undefined : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Use either or both citations as appropriate."); + let subTitleContent = !showManyParents ? undefined : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Use either or both citations as appropriate."); if (showManyParents && filteredCitationItems.length > 2) { subTitleContent = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Use citations as appropriate."); } @@ -210,21 +210,17 @@ var DataProductCitationView = function DataProductCitationView(props) { subTitleContent: subTitleContent })); }; - var renderItems = function renderItems() { - return citationItems.map(function (item, index) { - return /*#__PURE__*/_react.default.createElement("div", { - className: classes.itemContainer - // eslint-disable-next-line react/no-array-index-key - , - key: "DataProductCitationItemKey-".concat(item.doiUrl || index) - }, /*#__PURE__*/_react.default.createElement(_ItemView.default, _extends({}, props, { - citationItem: item, - viewState: viewState, - hasManyParents: hasManyParents - }))); - }); - }; - var renderCitationDisplay = function renderCitationDisplay() { + const renderItems = () => citationItems.map((item, index) => /*#__PURE__*/_react.default.createElement("div", { + className: classes.itemContainer + // eslint-disable-next-line react/no-array-index-key + , + key: "DataProductCitationItemKey-".concat(item.doiUrl || index) + }, /*#__PURE__*/_react.default.createElement(_ItemView.default, _extends({}, props, { + citationItem: item, + viewState: viewState, + hasManyParents: hasManyParents + })))); + const renderCitationDisplay = () => { switch (displayType) { case _ViewState.DisplayType.CONDITIONAL: case _ViewState.DisplayType.PROVISIONAL: @@ -259,5 +255,4 @@ DataProductCitationView.defaultProps = { textOnlyProps: undefined, showManyParents: true }; -var _default = DataProductCitationView; -exports.default = _default; \ No newline at end of file +var _default = exports.default = DataProductCitationView; \ No newline at end of file diff --git a/lib/components/Citation/DataProductCitation/ViewState.js b/lib/components/Citation/DataProductCitation/ViewState.js index 6e0328b7..59aefeb0 100644 --- a/lib/components/Citation/DataProductCitation/ViewState.js +++ b/lib/components/Citation/DataProductCitation/ViewState.js @@ -4,11 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.DisplayType = void 0; -var DisplayType = /*#__PURE__*/function (DisplayType) { +let DisplayType = exports.DisplayType = /*#__PURE__*/function (DisplayType) { DisplayType["PROVISIONAL"] = "PROVISIONAL"; DisplayType["RELEASE"] = "RELEASE"; DisplayType["CONDITIONAL"] = "CONDITIONAL"; DisplayType["NOT_AVAILABLE"] = "NOT_AVAILABLE"; return DisplayType; -}({}); -exports.DisplayType = DisplayType; \ No newline at end of file +}({}); \ No newline at end of file diff --git a/lib/components/Citation/index.js b/lib/components/Citation/index.js index fcd26272..31d00e9e 100644 --- a/lib/components/Citation/index.js +++ b/lib/components/Citation/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _DataProductCitation.default; } }); diff --git a/lib/components/DataProductAvailability/AvailabilityContext.js b/lib/components/DataProductAvailability/AvailabilityContext.js index e3885eea..768f20d8 100644 --- a/lib/components/DataProductAvailability/AvailabilityContext.js +++ b/lib/components/DataProductAvailability/AvailabilityContext.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -14,24 +13,14 @@ var _AvailabilityUtils = require("./AvailabilityUtils"); var _NeonSignInButtonState = _interopRequireDefault(require("../NeonSignInButton/NeonSignInButtonState")); var _StateStorageService = _interopRequireDefault(require("../../service/StateStorageService")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -var SORT_DIRECTIONS = { +const SORT_DIRECTIONS = { ASC: 'ASC', DESC: 'DESC' }; -var DEFAULT_STATE = { +const DEFAULT_STATE = { sites: [], tables: {}, rows: {}, @@ -52,8 +41,8 @@ var DEFAULT_STATE = { /** Function to copy necessary NeonContext data into local state when ready */ -var hydrateNeonContextData = function hydrateNeonContextData(state, neonContextData) { - var newState = _extends({}, state, { +const hydrateNeonContextData = (state, neonContextData) => { + const newState = _extends({}, state, { neonContextHydrated: true }); newState.reference.sites = neonContextData.sites || {}; @@ -66,19 +55,23 @@ var hydrateNeonContextData = function hydrateNeonContextData(state, neonContextD /** Extract Tables */ -var extractTables = function extractTables(state) { - var tables = {}; - state.sites.forEach(function (site) { - var siteCode = site.siteCode; - site.tables.forEach(function (table) { - var name = table.name, - description = table.description, - waitInterval = table.waitInterval; +const extractTables = state => { + const tables = {}; + state.sites.forEach(site => { + const { + siteCode + } = site; + site.tables.forEach(table => { + const { + name, + description, + waitInterval + } = table; if (!tables[name]) { tables[name] = { - name: name, - description: description, - waitInterval: waitInterval, + name, + description, + waitInterval, sites: [siteCode] }; } else if (!tables[name].sites.includes(siteCode)) { @@ -86,8 +79,8 @@ var extractTables = function extractTables(state) { } }); }); - var digits = Math.floor(Math.log10(Object.keys(tables).length) + 1); - Object.keys(tables).forEach(function (table, idx) { + const digits = Math.floor(Math.log10(Object.keys(tables).length) + 1); + Object.keys(tables).forEach((table, idx) => { tables[table].tableCode = "T".concat((idx + 1).toString().padStart(digits, '0')); }); return tables; @@ -97,45 +90,54 @@ var extractTables = function extractTables(state) { Calculate Rows Take a state object and spit out a new state containing rows for use in the SVG grid */ -var calculateRows = function calculateRows(state) { +const calculateRows = state => { if (!state.neonContextHydrated) { return state; } - var newState = _extends({}, state, { + const newState = _extends({}, state, { rows: {}, rowLabels: [], rowTitles: {} }); - var sites = state.sites, - breakouts = state.breakouts, - reference = state.reference, - sortDirection = state.sortDirection, - knownTables = state.tables; + const { + sites, + breakouts, + reference, + sortDirection, + tables: knownTables + } = state; if (!breakouts.length) { newState.rowLabels = ['ALL']; newState.rows.ALL = {}; } // Generate unsorted row labels and row data respecting breakouts - sites.forEach(function (site) { - var siteCode = site.siteCode, - tables = site.tables; + sites.forEach(site => { + const { + siteCode, + tables + } = site; if (!reference.sites[siteCode]) { return; } - var _reference$sites$site = reference.sites[siteCode], - stateCode = _reference$sites$site.stateCode, - domainCode = _reference$sites$site.domainCode; - tables.forEach(function (table) { - var tableName = table.name, - months = table.months; + const { + stateCode, + domainCode + } = reference.sites[siteCode]; + tables.forEach(table => { + const { + name: tableName, + months + } = table; if (!knownTables[tableName]) { return; } - var tableCode = knownTables[tableName].tableCode; + const { + tableCode + } = knownTables[tableName]; // turn siteCode / stateCode / domainCode / tableCode into a label // then populate that label's row - var title = !breakouts.length ? 'Summary of all sites and tables' : ''; - var label = !breakouts.length ? 'ALL' : breakouts.reduce(function (acc, cur) { + let title = !breakouts.length ? 'Summary of all sites and tables' : ''; + const label = !breakouts.length ? 'ALL' : breakouts.reduce((acc, cur) => { switch (cur) { case 'states': title = "".concat(title).concat(title.length ? ' - ' : '').concat(reference.states[stateCode].name); @@ -158,15 +160,13 @@ var calculateRows = function calculateRows(state) { newState.rows[label] = {}; } newState.rowTitles[label] = title; - Object.keys(months).forEach(function (month) { - newState.rows[label][month] = [].concat(_toConsumableArray(newState.rows[label][month] || []), [months[month]]); + Object.keys(months).forEach(month => { + newState.rows[label][month] = [...(newState.rows[label][month] || []), months[month]]; }); }); // Sort row labels - var sortReturns = [sortDirection === SORT_DIRECTIONS.ASC ? 1 : -1, sortDirection === SORT_DIRECTIONS.ASC ? -1 : 1]; - newState.rowLabels.sort(function (a, b) { - return a < b ? sortReturns[0] : sortReturns[1]; - }); + const sortReturns = [sortDirection === SORT_DIRECTIONS.ASC ? 1 : -1, sortDirection === SORT_DIRECTIONS.ASC ? -1 : 1]; + newState.rowLabels.sort((a, b) => a < b ? sortReturns[0] : sortReturns[1]); }); return newState; }; @@ -174,8 +174,8 @@ var calculateRows = function calculateRows(state) { /** Reducer */ -var reducer = function reducer(state, action) { - var newState = _extends({}, state); +const reducer = (state, action) => { + const newState = _extends({}, state); switch (action.type) { case 'hydrateNeonContextData': if (!action.neonContextData) { @@ -186,17 +186,13 @@ var reducer = function reducer(state, action) { if (!action.breakouts) { return state; } - if (!action.breakouts.every(function (b) { - return state.validBreakouts.includes(b); - })) { + if (!action.breakouts.every(b => state.validBreakouts.includes(b))) { return state; } - newState.breakouts = _toConsumableArray(action.breakouts); + newState.breakouts = [...action.breakouts]; // If new breakouts contains the old leading breakout (the sort method) then keep it in front if (state.breakouts.length && newState.breakouts.includes(state.breakouts[0])) { - newState.breakouts = newState.breakouts.filter(function (b) { - return b !== state.breakouts[0]; - }); + newState.breakouts = newState.breakouts.filter(b => b !== state.breakouts[0]); newState.breakouts.unshift(state.breakouts[0]); } return calculateRows(newState); @@ -205,9 +201,7 @@ var reducer = function reducer(state, action) { if (!state.validBreakouts.includes(action.method)) { return state; } - newState.breakouts = state.breakouts.filter(function (b) { - return b !== action.method; - }); + newState.breakouts = state.breakouts.filter(b => b !== action.method); newState.breakouts.unshift(action.method); return calculateRows(newState); case 'setSortDirection': @@ -226,11 +220,11 @@ var reducer = function reducer(state, action) { /** Context and Hook */ -var Context = /*#__PURE__*/(0, _react.createContext)(DEFAULT_STATE); -var useAvailabilityState = function useAvailabilityState() { - var hookResponse = (0, _react.useContext)(Context); +const Context = /*#__PURE__*/(0, _react.createContext)(DEFAULT_STATE); +const useAvailabilityState = () => { + const hookResponse = (0, _react.useContext)(Context); if (hookResponse.length !== 2) { - return [(0, _cloneDeep.default)(DEFAULT_STATE), function () {}]; + return [(0, _cloneDeep.default)(DEFAULT_STATE), () => {}]; } return hookResponse; }; @@ -242,34 +236,35 @@ var useAvailabilityState = function useAvailabilityState() { * Keeping this lookup outside of the context provider function * as to not incur lifecycle interference by storing with useState. */ -var restoreStateLookup = {}; +const restoreStateLookup = {}; /** Context Provider */ -var Provider = function Provider(props) { - var sites = props.sites, - dataAvailabilityUniqueId = props.dataAvailabilityUniqueId, - children = props.children; - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - _NeonContext$useNeonC3 = _NeonContext$useNeonC2[0], - neonContextData = _NeonContext$useNeonC3.data, - neonContextIsFinal = _NeonContext$useNeonC3.isFinal, - neonContextHasError = _NeonContext$useNeonC3.hasError; - var key = "availabilityContextState-".concat(dataAvailabilityUniqueId); +const Provider = props => { + const { + sites, + dataAvailabilityUniqueId, + children + } = props; + const [{ + data: neonContextData, + isFinal: neonContextIsFinal, + hasError: neonContextHasError + }] = _NeonContext.default.useNeonContextState(); + const key = "availabilityContextState-".concat(dataAvailabilityUniqueId); if (typeof restoreStateLookup[key] === 'undefined') { restoreStateLookup[key] = true; } - var shouldRestoreState = restoreStateLookup[key]; - var stateStorage = (0, _StateStorageService.default)(key); - var savedState = stateStorage.readState(); + const shouldRestoreState = restoreStateLookup[key]; + const stateStorage = (0, _StateStorageService.default)(key); + const savedState = stateStorage.readState(); /** Initial State and Reducer Setup */ - var initialState = _extends({}, (0, _cloneDeep.default)(DEFAULT_STATE), { - sites: sites + let initialState = _extends({}, (0, _cloneDeep.default)(DEFAULT_STATE), { + sites }); initialState.tables = extractTables(initialState); if (neonContextIsFinal && !neonContextHasError && !savedState) { @@ -280,24 +275,21 @@ var Provider = function Provider(props) { stateStorage.removeState(); initialState = savedState; } - var _useReducer = (0, _react.useReducer)(reducer, calculateRows(initialState)), - _useReducer2 = _slicedToArray(_useReducer, 2), - state = _useReducer2[0], - dispatch = _useReducer2[1]; + const [state, dispatch] = (0, _react.useReducer)(reducer, calculateRows(initialState)); // The current sign in process uses a separate domain. This function // persists the current state in storage when the button is clicked // so the state may be reloaded when the page is reloaded after sign // in. - (0, _react.useEffect)(function () { - var subscription = _NeonSignInButtonState.default.getObservable().subscribe({ - next: function next() { + (0, _react.useEffect)(() => { + const subscription = _NeonSignInButtonState.default.getObservable().subscribe({ + next: () => { if (!_NeonEnvironment.default.enableGlobalSignInState) return; restoreStateLookup[key] = false; stateStorage.saveState(state); } }); - return function () { + return () => { subscription.unsubscribe(); }; }, [state, stateStorage, key]); @@ -305,11 +297,11 @@ var Provider = function Provider(props) { /** Effect - Watch for changes to NeonContext data and push into local state */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (!state.neonContextHydrated && neonContextIsFinal && !neonContextHasError) { dispatch({ type: 'hydrateNeonContextData', - neonContextData: neonContextData + neonContextData }); } }, [neonContextData, neonContextIsFinal, neonContextHasError, state.neonContextHydrated, dispatch]); @@ -338,20 +330,17 @@ Provider.defaultProps = { /** Export */ -var AvailabilityContext = { - Provider: Provider, - useAvailabilityState: useAvailabilityState, - SORT_DIRECTIONS: SORT_DIRECTIONS +const AvailabilityContext = { + Provider, + useAvailabilityState, + SORT_DIRECTIONS }; -var _default = AvailabilityContext; // Additional items exported for unit testing -exports.default = _default; -var getTestableItems = function getTestableItems() { - return process.env.NODE_ENV !== 'test' ? {} : { - DEFAULT_STATE: DEFAULT_STATE, - calculateRows: calculateRows, - extractTables: extractTables, - hydrateNeonContextData: hydrateNeonContextData, - reducer: reducer - }; +var _default = exports.default = AvailabilityContext; // Additional items exported for unit testing +const getTestableItems = () => process.env.NODE_ENV !== 'test' ? {} : { + DEFAULT_STATE, + calculateRows, + extractTables, + hydrateNeonContextData, + reducer }; exports.getTestableItems = getTestableItems; \ No newline at end of file diff --git a/lib/components/DataProductAvailability/AvailabilityPending.js b/lib/components/DataProductAvailability/AvailabilityPending.js index f0dffdd7..1a5af3f6 100644 --- a/lib/components/DataProductAvailability/AvailabilityPending.js +++ b/lib/components/DataProductAvailability/AvailabilityPending.js @@ -13,23 +13,18 @@ var _Typography = _interopRequireDefault(require("@material-ui/core/Typography") var _Warning = _interopRequireDefault(require("@material-ui/icons/Warning")); var _NeonContext = _interopRequireDefault(require("../NeonContext/NeonContext")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function AvailabilityPending(props) { - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - _NeonContext$useNeonC3 = _NeonContext$useNeonC2[0], - neonContextIsFinal = _NeonContext$useNeonC3.isFinal, - neonContextHasError = _NeonContext$useNeonC3.hasError; - var message = props.message; + const [{ + isFinal: neonContextIsFinal, + hasError: neonContextHasError + }] = _NeonContext.default.useNeonContextState(); + const { + message + } = props; if (neonContextIsFinal && !neonContextHasError) { return null; } - var status = neonContextIsFinal && neonContextHasError ? 'error' : 'loading'; + const status = neonContextIsFinal && neonContextHasError ? 'error' : 'loading'; return /*#__PURE__*/_react.default.createElement(_Card.default, { style: { width: '100%' diff --git a/lib/components/DataProductAvailability/AvailabilitySvgComponents.js b/lib/components/DataProductAvailability/AvailabilitySvgComponents.js index 07194938..dd4c3387 100644 --- a/lib/components/DataProductAvailability/AvailabilitySvgComponents.js +++ b/lib/components/DataProductAvailability/AvailabilitySvgComponents.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -9,22 +8,23 @@ var _react = _interopRequireDefault(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); var _AvailabilityUtils = require("./AvailabilityUtils"); var _Theme = _interopRequireWildcard(require("../Theme/Theme")); -var _excluded = ["nudge"]; -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +const _excluded = ["nudge"]; +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable import/prefer-default-export, max-len */ /** SVG_DEFS */ -var DiagLinesPattern = function DiagLinesPattern(props) { - var id = props.id, - color = props.color, - secondaryColor = props.secondaryColor; - var width = _AvailabilityUtils.SVG.CELL_WIDTH; - var height = _AvailabilityUtils.SVG.CELL_HEIGHT / 4; +const DiagLinesPattern = props => { + const { + id, + color, + secondaryColor + } = props; + const width = _AvailabilityUtils.SVG.CELL_WIDTH; + const height = _AvailabilityUtils.SVG.CELL_HEIGHT / 4; return /*#__PURE__*/_react.default.createElement("pattern", { id: id, width: width, @@ -53,10 +53,12 @@ DiagLinesPattern.propTypes = { DiagLinesPattern.defaultProps = { secondaryColor: '#ffffff' }; -var HalfAndHalfPattern = function HalfAndHalfPattern(props) { - var id = props.id, - color = props.color, - secondaryColor = props.secondaryColor; +const HalfAndHalfPattern = props => { + const { + id, + color, + secondaryColor + } = props; return /*#__PURE__*/_react.default.createElement("pattern", { id: id, width: 1, @@ -78,14 +80,16 @@ HalfAndHalfPattern.propTypes = { HalfAndHalfPattern.defaultProps = { secondaryColor: '#ffffff' }; -var DiagHalfAndHalfPattern = function DiagHalfAndHalfPattern(props) { - var id = props.id, - color = props.color, - diagColor = props.diagColor, - diagColorFillOpacity = props.diagColorFillOpacity, - secondaryDiagColor = props.secondaryDiagColor; - var cellW = _AvailabilityUtils.SVG.CELL_WIDTH; - var cellH = _AvailabilityUtils.SVG.CELL_HEIGHT; +const DiagHalfAndHalfPattern = props => { + const { + id, + color, + diagColor, + diagColorFillOpacity, + secondaryDiagColor + } = props; + const cellW = _AvailabilityUtils.SVG.CELL_WIDTH; + const cellH = _AvailabilityUtils.SVG.CELL_HEIGHT; // Extends the bounds of the applied rectangle dimensions // when computing coordinates. This will overlay the // computed coordinate such that they extend beyond the actual bounds @@ -94,54 +98,50 @@ var DiagHalfAndHalfPattern = function DiagHalfAndHalfPattern(props) { // Setting this to 0 will disable to the extension and map directly // onto the bounding box of the rectangle. // When divided by 2, should result in a rational number. - var extendBoundsPadding = 0; - var w = _AvailabilityUtils.SVG.CELL_WIDTH + extendBoundsPadding; - var h = _AvailabilityUtils.SVG.CELL_HEIGHT + extendBoundsPadding; + const extendBoundsPadding = 0; + const w = _AvailabilityUtils.SVG.CELL_WIDTH + extendBoundsPadding; + const h = _AvailabilityUtils.SVG.CELL_HEIGHT + extendBoundsPadding; // Nudge the half fill color to prevent background from initial // line from top right corner consuming the color at normal // viewing levels. Ensures it looks visually appropriate for half color // fill and half diag line pattern. // Will be based on initDist - var nudgeDiagFill = 1; - var numLines = 4; + const nudgeDiagFill = 1; + const numLines = 4; // Distance of the diagonal of the rectangle - var diagLengthRaw = Math.sqrt(Math.pow(cellW, 2) + Math.pow(cellH, 2)); + const diagLengthRaw = Math.sqrt(cellW ** 2 + cellH ** 2); // Distance of initial line to top right corner, as opposed to starting // at point (0, w) - var initDist = diagLengthRaw * 0.18; + const initDist = diagLengthRaw * 0.18; // Distance of furthest potential end line to bottom left corner - var trailingDist = diagLengthRaw * 0.1; + const trailingDist = diagLengthRaw * 0.1; // Distance of the diagonal of the rectangle - var diagLength = diagLengthRaw - (initDist + trailingDist); + const diagLength = diagLengthRaw - (initDist + trailingDist); // Distance between parallel lines - var diagLineGap = diagLength / numLines; - var diagLineStrokeWidth = (diagLength * 0.1).toFixed(2); + const diagLineGap = diagLength / numLines; + const diagLineStrokeWidth = (diagLength * 0.1).toFixed(2); // Compute the initial x coordinate of the first line based on specified // initial distance from top right corner // 45 degree lines means perpendicular line to top right corner // c^2 = a^2 + b^2 where a == b // Find the initial x coordinate (y == 0) to derive linear function from - var initXCoordDist = w - Math.sqrt(2 * Math.pow(initDist, 2)); - var coords = []; + const initXCoordDist = w - Math.sqrt(2 * initDist ** 2); + const coords = []; // eslint-disable-next-line no-plusplus - var _loop = function _loop() { + for (let i = 0; i < numLines; i++) { // Vertical transformation of linear function scalar value // As m == 1, use distance between parallel lines to compute hypotenuse // of equilateral triangle which will be the vertical transformation scalar // to apply to the linear function // Then scale by line index for each line - var v = Math.sqrt(2 * Math.pow(diagLineGap, 2)) * i; + const v = Math.sqrt(2 * diagLineGap ** 2) * i; // Linear functions derived from initial X coordinate, known slope - var findY = function findY(x) { - return x - initXCoordDist + v; - }; - var findX = function findX(y) { - return y + initXCoordDist - v; - }; - var x1 = 0; - var y1 = findY(x1); - var x2 = w; - var y2 = findY(x2); + const findY = x => x - initXCoordDist + v; + const findX = y => y + initXCoordDist - v; + let x1 = 0; + let y1 = findY(x1); + let x2 = w; + let y2 = findY(x2); // Snap coordinates to bounding box if (y1 < 0) { x1 = findX(0); @@ -157,9 +157,6 @@ var DiagHalfAndHalfPattern = function DiagHalfAndHalfPattern(props) { x2: (x2 - extendBoundsPadding / 2).toFixed(2), y2: (y2 - extendBoundsPadding / 2).toFixed(2) }); - }; - for (var i = 0; i < numLines; i++) { - _loop(); } return /*#__PURE__*/_react.default.createElement("pattern", { id: id, @@ -173,19 +170,17 @@ var DiagHalfAndHalfPattern = function DiagHalfAndHalfPattern(props) { points: "0,0 0,1 1,1 1,0", fill: secondaryDiagColor, fillOpacity: diagColorFillOpacity - }), coords.map(function (coord, idx) { - return /*#__PURE__*/_react.default.createElement("line", { - // eslint-disable-next-line react/no-array-index-key - key: "DiagHalfAndHalfPatternKey-".concat(coord.x1, "-").concat(coord.y1, "-").concat(coord.x2, "-").concat(coord.y2, "-").concat(idx), - x1: coord.x1, - y1: coord.y1, - x2: coord.x2, - y2: coord.y2, - stroke: diagColor, - strokeWidth: diagLineStrokeWidth, - strokeLinecap: "square" - }); - }), /*#__PURE__*/_react.default.createElement("polygon", { + }), coords.map((coord, idx) => /*#__PURE__*/_react.default.createElement("line", { + // eslint-disable-next-line react/no-array-index-key + key: "DiagHalfAndHalfPatternKey-".concat(coord.x1, "-").concat(coord.y1, "-").concat(coord.x2, "-").concat(coord.y2, "-").concat(idx), + x1: coord.x1, + y1: coord.y1, + x2: coord.x2, + y2: coord.y2, + stroke: diagColor, + strokeWidth: diagLineStrokeWidth, + strokeLinecap: "square" + })), /*#__PURE__*/_react.default.createElement("polygon", { points: "0,0 ".concat(cellW - nudgeDiagFill, ",0 ", 0, ",").concat(cellH), fill: color })); @@ -200,67 +195,65 @@ DiagHalfAndHalfPattern.propTypes = { DiagHalfAndHalfPattern.defaultProps = { secondaryDiagColor: '#ffffff' }; -var SvgDefs = function SvgDefs() { - return /*#__PURE__*/_react.default.createElement("svg", { - width: "0px", - height: "0px" - }, /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement(DiagLinesPattern, { - id: "availableProvisionalPattern", - color: _Theme.COLORS.NEON_BLUE[700], - secondaryColor: _Theme.COLORS.NEON_BLUE[50] - }), /*#__PURE__*/_react.default.createElement(DiagHalfAndHalfPattern, { - id: "mixedAvailableProvisionalPattern", - color: _Theme.COLORS.NEON_BLUE[700], - diagColor: _Theme.COLORS.NEON_BLUE[700], - diagColorFillOpacity: 0.25, - secondaryDiagColor: _Theme.COLORS.NEON_BLUE[50] - }), /*#__PURE__*/_react.default.createElement(DiagLinesPattern, { - id: "beingProcessedPattern", - color: _Theme.COLORS.NEON_BLUE[700] - }), /*#__PURE__*/_react.default.createElement(DiagLinesPattern, { - id: "delayedPattern", - color: _Theme.COLORS.GOLD[400] - }), /*#__PURE__*/_react.default.createElement(DiagLinesPattern, { - id: "partialSelectionPattern", - color: _Theme.COLORS.LIGHT_BLUE[300], - secondaryColor: _Theme.COLORS.LIGHT_BLUE[100] - }), /*#__PURE__*/_react.default.createElement(HalfAndHalfPattern, { - id: "mixedSomeAvailabilityPattern", - color: _Theme.COLORS.NEON_BLUE[700], - secondaryColor: _Theme.COLORS.GOLD[400] - }), /*#__PURE__*/_react.default.createElement(HalfAndHalfPattern, { - id: "mixedNoAvailabilityPattern", - color: _Theme.default.palette.grey[200], - secondaryColor: _Theme.COLORS.GOLD[400] - }))); -}; +const SvgDefs = () => /*#__PURE__*/_react.default.createElement("svg", { + width: "0px", + height: "0px" +}, /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement(DiagLinesPattern, { + id: "availableProvisionalPattern", + color: _Theme.COLORS.NEON_BLUE[700], + secondaryColor: _Theme.COLORS.NEON_BLUE[50] +}), /*#__PURE__*/_react.default.createElement(DiagHalfAndHalfPattern, { + id: "mixedAvailableProvisionalPattern", + color: _Theme.COLORS.NEON_BLUE[700], + diagColor: _Theme.COLORS.NEON_BLUE[700], + diagColorFillOpacity: 0.25, + secondaryDiagColor: _Theme.COLORS.NEON_BLUE[50] +}), /*#__PURE__*/_react.default.createElement(DiagLinesPattern, { + id: "beingProcessedPattern", + color: _Theme.COLORS.NEON_BLUE[700] +}), /*#__PURE__*/_react.default.createElement(DiagLinesPattern, { + id: "delayedPattern", + color: _Theme.COLORS.GOLD[400] +}), /*#__PURE__*/_react.default.createElement(DiagLinesPattern, { + id: "partialSelectionPattern", + color: _Theme.COLORS.LIGHT_BLUE[300], + secondaryColor: _Theme.COLORS.LIGHT_BLUE[100] +}), /*#__PURE__*/_react.default.createElement(HalfAndHalfPattern, { + id: "mixedSomeAvailabilityPattern", + color: _Theme.COLORS.NEON_BLUE[700], + secondaryColor: _Theme.COLORS.GOLD[400] +}), /*#__PURE__*/_react.default.createElement(HalfAndHalfPattern, { + id: "mixedNoAvailabilityPattern", + color: _Theme.default.palette.grey[200], + secondaryColor: _Theme.COLORS.GOLD[400] +}))); /** CELLS */ exports.SvgDefs = SvgDefs; -var thinStrokeAttrs = { +const thinStrokeAttrs = { strokeWidth: '0.8px', width: "".concat(_AvailabilityUtils.SVG.CELL_WIDTH - 0.8, "px"), height: "".concat(_AvailabilityUtils.SVG.CELL_HEIGHT - 0.8, "px"), rx: "".concat(_AvailabilityUtils.SVG.CELL_RX * 1.5, "px"), nudge: 0.4 }; -var midStrokeAttrs = { +const midStrokeAttrs = { strokeWidth: '1.15px', width: "".concat(_AvailabilityUtils.SVG.CELL_WIDTH - 1.15, "px"), height: "".concat(_AvailabilityUtils.SVG.CELL_HEIGHT - 1.15, "px"), rx: "".concat(_AvailabilityUtils.SVG.CELL_RX * 1.25, "px"), nudge: 0.60 }; -var fatStrokeAttrs = { +const fatStrokeAttrs = { strokeWidth: '1.5px', width: "".concat(_AvailabilityUtils.SVG.CELL_WIDTH - 1.5, "px"), height: "".concat(_AvailabilityUtils.SVG.CELL_HEIGHT - 1.5, "px"), rx: "".concat(_AvailabilityUtils.SVG.CELL_RX, "px"), nudge: 0.75 }; -var noStrokeAttrs = { +const noStrokeAttrs = { stroke: null, strokeWidth: null, width: "".concat(_AvailabilityUtils.SVG.CELL_WIDTH, "px"), @@ -268,7 +261,7 @@ var noStrokeAttrs = { rx: "".concat(_AvailabilityUtils.SVG.CELL_RX * 2, "px"), nudge: 0 }; -var CELL_ATTRS = { +const CELL_ATTRS = exports.CELL_ATTRS = { available: _extends({ fill: _Theme.COLORS.NEON_BLUE[700] }, noStrokeAttrs), @@ -323,15 +316,17 @@ var CELL_ATTRS = { stroke: _Theme.COLORS.GOLD[400] }, thinStrokeAttrs) }; -exports.CELL_ATTRS = CELL_ATTRS; -var JsxCell = function JsxCell(props) { - var status = props.status, - x = props.x, - y = props.y; - var _CELL_ATTRS$status = CELL_ATTRS[status], - _CELL_ATTRS$status$nu = _CELL_ATTRS$status.nudge, - nudge = _CELL_ATTRS$status$nu === void 0 ? 0 : _CELL_ATTRS$status$nu, - attrs = _objectWithoutProperties(_CELL_ATTRS$status, _excluded); +const JsxCell = props => { + const { + status, + x, + y + } = props; + const _CELL_ATTRS$status = CELL_ATTRS[status], + { + nudge = 0 + } = _CELL_ATTRS$status, + attrs = _objectWithoutPropertiesLoose(_CELL_ATTRS$status, _excluded); return /*#__PURE__*/_react.default.createElement("rect", _extends({ x: x + nudge, y: y + nudge, diff --git a/lib/components/DataProductAvailability/AvailabilityUtils.js b/lib/components/DataProductAvailability/AvailabilityUtils.js index 74433521..c501ff22 100644 --- a/lib/components/DataProductAvailability/AvailabilityUtils.js +++ b/lib/components/DataProductAvailability/AvailabilityUtils.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -9,13 +8,13 @@ var _propTypes = _interopRequireDefault(require("prop-types")); var _moment = _interopRequireDefault(require("moment")); var _d3Transition = require("d3-transition"); var _Theme = _interopRequireWildcard(require("../Theme/Theme")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** All possible valid statuses (enhanced availability only) */ -var VALID_ENHANCED_STATUSES = { +const VALID_ENHANCED_STATUSES = exports.VALID_ENHANCED_STATUSES = { expected: { title: 'Expected', description: 'Data collection is scheduled to happen' @@ -69,14 +68,11 @@ var VALID_ENHANCED_STATUSES = { description: 'More than one status with none "Available" across sites / tables in the rollup (e.g. viewing states, all tables, etc.)' } }; -exports.VALID_ENHANCED_STATUSES = VALID_ENHANCED_STATUSES; -var calcBasicRollupStatus = function calcBasicRollupStatus(statuses) { +const calcBasicRollupStatus = statuses => { if (!statuses) { return null; } - if (Array.from(statuses).some(function (s) { - return !Object.keys(VALID_ENHANCED_STATUSES).includes(s); - })) { + if (Array.from(statuses).some(s => !Object.keys(VALID_ENHANCED_STATUSES).includes(s))) { return null; } if (statuses.size === 0) { @@ -85,24 +81,22 @@ var calcBasicRollupStatus = function calcBasicRollupStatus(statuses) { if (statuses.size === 1) { return Array.from(statuses)[0]; } - var hasTomb = statuses.has('tombstoned'); + const hasTomb = statuses.has('tombstoned'); if (hasTomb) { return 'tombstoned'; } return statuses.has('available-provisional') ? 'mixed-available-provisional' : 'available'; }; exports.calcBasicRollupStatus = calcBasicRollupStatus; -var calcRollupStatus = function calcRollupStatus() { - var statuses = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; +const calcRollupStatus = function () { + let statuses = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; if (!Array.isArray(statuses)) { return Object.keys(VALID_ENHANCED_STATUSES).includes(statuses) ? statuses : null; } - if (statuses.some(function (status) { - return !Object.keys(VALID_ENHANCED_STATUSES).includes(status); - })) { + if (statuses.some(status => !Object.keys(VALID_ENHANCED_STATUSES).includes(status))) { return null; } - var set = new Set(statuses); + const set = new Set(statuses); if (set.size === 0) { return null; } @@ -116,7 +110,7 @@ var calcRollupStatus = function calcRollupStatus() { PropTypes for different major modes */ exports.calcRollupStatus = calcRollupStatus; -var AvailabilityPropTypes = { +const AvailabilityPropTypes = exports.AvailabilityPropTypes = { basicSiteCodes: _propTypes.default.arrayOf(_propTypes.default.shape({ siteCode: _propTypes.default.string.isRequired, availableMonths: _propTypes.default.arrayOf(_propTypes.default.string).isRequired, @@ -148,8 +142,7 @@ var AvailabilityPropTypes = { /** SVG display constants */ -exports.AvailabilityPropTypes = AvailabilityPropTypes; -var SVG = { +const SVG = exports.SVG = { MIN_ROWS: 1, MIN_CELLS: 12, CELL_WIDTH: 7, @@ -167,7 +160,6 @@ var SVG = { DATE_RANGE_HANDLE_WIDTH: 4, DATE_RANGE_MASK_WIDTH: 24 }; -exports.SVG = SVG; SVG.MIN_WIDTH = (SVG.CELL_WIDTH + SVG.CELL_PADDING) * SVG.MIN_CELLS + Math.floor(SVG.MIN_CELLS / 12) * SVG.YEAR_PADDING; SVG.MIN_HEIGHT = (SVG.CELL_HEIGHT + SVG.CELL_PADDING) * (SVG.MIN_ROWS + 1); SVG.YEAR_MONTH_WIDTH = SVG.CELL_WIDTH + SVG.CELL_PADDING; @@ -178,34 +170,19 @@ SVG.YEAR_WIDTH = SVG.YEAR_MONTH_WIDTH * 12 - SVG.CELL_PADDING; Includes all possible year-months ("YYYY-MM" strings) from a fixed start year to a fixed margin into the future from right now to serve as an x-axis data set */ -var TIME = { - getYearMonthMoment: function getYearMonthMoment(yearMonth) { - return (0, _moment.default)("".concat(yearMonth, "-01")); - }, - getNextMonth: function getNextMonth(month) { - return _moment.default.utc("".concat(month, "-15T00:00:00Z")).add(1, 'month').format('YYYY-MM'); - }, - getPreviousMonth: function getPreviousMonth(month) { - return _moment.default.utc("".concat(month, "-15T00:00:00Z")).subtract(1, 'month').format('YYYY-MM'); - }, +const TIME = exports.TIME = { + getYearMonthMoment: yearMonth => (0, _moment.default)("".concat(yearMonth, "-01")), + getNextMonth: month => _moment.default.utc("".concat(month, "-15T00:00:00Z")).add(1, 'month').format('YYYY-MM'), + getPreviousMonth: month => _moment.default.utc("".concat(month, "-15T00:00:00Z")).subtract(1, 'month').format('YYYY-MM'), CURRENT_MONTH: (0, _moment.default)().format('YYYY-MM'), START_YEAR: 2010, END_YEAR: new Date().getFullYear() + 1 }; -exports.TIME = TIME; TIME.MIN_YEAR_MONTH = "".concat(TIME.START_YEAR, "-01"); TIME.MAX_YEAR_MONTH = "".concat(TIME.END_YEAR, "-12"); -TIME.YEARS = Array(TIME.END_YEAR - TIME.START_YEAR + 1).fill(0).map(function (val, idx) { - return TIME.START_YEAR + idx; -}); -TIME.MONTHS = Array(12).fill(0).map(function (val, idx) { - return (idx + 1).toString().padStart(2, '0'); -}); -TIME.YEAR_MONTHS = TIME.YEARS.flatMap(function (year) { - return TIME.MONTHS.map(function (month) { - return "".concat(year, "-").concat(month); - }); -}); +TIME.YEARS = Array(TIME.END_YEAR - TIME.START_YEAR + 1).fill(0).map((val, idx) => TIME.START_YEAR + idx); +TIME.MONTHS = Array(12).fill(0).map((val, idx) => (idx + 1).toString().padStart(2, '0')); +TIME.YEAR_MONTHS = TIME.YEARS.flatMap(year => TIME.MONTHS.map(month => "".concat(year, "-").concat(month))); // Derive an SVG constant from TIME SVG.ABS_MAX_DATA_WIDTH = 2 * SVG.END_PADDING + TIME.YEARS.length * SVG.YEAR_WIDTH + (TIME.YEARS.length - 1) * SVG.YEAR_PADDING; @@ -219,7 +196,7 @@ SVG.ABS_MAX_DATA_WIDTH = 2 * SVG.END_PADDING + TIME.YEARS.length * SVG.YEAR_WIDT makeStyles but instead apply them using a custom function to add them in-line to the style attribute for a given DOM element. */ -var SVG_STYLES = { +const SVG_STYLES = exports.SVG_STYLES = { styles: { rowLabel: { textAnchor: 'end', @@ -274,15 +251,12 @@ var SVG_STYLES = { Parse an object literal style definition into d3 selection.style() calls to apply styles defined in the styles object literal to a node */ -exports.SVG_STYLES = SVG_STYLES; -SVG_STYLES.apply = function (node, styleName) { +SVG_STYLES.apply = (node, styleName) => { if (!SVG_STYLES.styles[styleName]) { return; } - Object.keys(SVG_STYLES.styles[styleName]).forEach(function (key) { - var style = key.replace(/([A-Z]){1}/g, function (v) { - return "-".concat(v.toLowerCase()); - }); + Object.keys(SVG_STYLES.styles[styleName]).forEach(key => { + const style = key.replace(/([A-Z]){1}/g, v => "-".concat(v.toLowerCase())); node.style(style, SVG_STYLES.styles[styleName][key]); }); }; @@ -295,6 +269,6 @@ SVG_STYLES.apply = function (node, styleName) { that will trigger a rerender and thus a full style reset. */ SVG_STYLES.touchRipple = function (selection) { - var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 15; + let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 15; selection.style('fill', 'rgba(199, 110, 0, 0.75)').transition((0, _d3Transition.transition)().duration(duration)).style('fill', 'rgba(199, 110, 0, 0.25)'); }; \ No newline at end of file diff --git a/lib/components/DataProductAvailability/BasicAvailabilityGrid.js b/lib/components/DataProductAvailability/BasicAvailabilityGrid.js index d1c1ab03..f4b7a55f 100644 --- a/lib/components/DataProductAvailability/BasicAvailabilityGrid.js +++ b/lib/components/DataProductAvailability/BasicAvailabilityGrid.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -12,15 +11,9 @@ var _uniqueId = _interopRequireDefault(require("lodash/uniqueId")); var _Theme = _interopRequireWildcard(require("../Theme/Theme")); var _AvailabilitySvgComponents = require("./AvailabilitySvgComponents"); var _AvailabilityUtils = require("./AvailabilityUtils"); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /** * BasicAvailabilityGrid generator function * @param {object} config - all arguments, see below: @@ -47,28 +40,23 @@ function BasicAvailabilityGrid(config) { /** Extract Config */ - var svgRef = config.svgRef, - data = config.data, - _config$sites = config.sites, - sites = _config$sites === void 0 ? { + const { + svgRef, + data, + sites = { value: [], validValues: [] - } : _config$sites, - _config$allSites = config.allSites, - allSites = _config$allSites === void 0 ? {} : _config$allSites, - _config$sortedSites = config.sortedSites, - sortedSites = _config$sortedSites === void 0 ? [] : _config$sortedSites, - _config$setSitesValue = config.setSitesValue, - setSitesValue = _config$setSitesValue === void 0 ? null : _config$setSitesValue, - _config$dateRange = config.dateRange, - dateRange = _config$dateRange === void 0 ? { + }, + allSites = {}, + sortedSites = [], + setSitesValue = null, + dateRange = { value: [], validValues: [_AvailabilityUtils.TIME.MIN_YEAR_MONTH, _AvailabilityUtils.TIME.MAX_YEAR_MONTH] - } : _config$dateRange, - _config$setDateRangeV = config.setDateRangeValue, - setDateRangeValue = _config$setDateRangeV === void 0 ? function () {} : _config$setDateRangeV, - _config$selectionEnab = config.selectionEnabled, - selectionEnabled = _config$selectionEnab === void 0 ? true : _config$selectionEnab; + }, + setDateRangeValue = () => {}, + selectionEnabled = true + } = config; /** Sanity Check: svgRef must be a valid ref @@ -87,15 +75,15 @@ function BasicAvailabilityGrid(config) { /** Setup: Inputs and Base Values */ - var svg = (0, _d3Selection.select)(svgRef.current); + const svg = (0, _d3Selection.select)(svgRef.current); if (svg.attr('id') === null) { svg.attr('id', "availability-".concat((0, _uniqueId.default)())); } - var svgId = svg.attr('id'); - var svgWidth = parseFloat(svg.attr('width')); - var svgHeight = parseFloat(svg.attr('height')); - var rowKeys = sortedSites.length ? sortedSites : Object.keys(data.rows).sort().reverse(); - var rowCount = rowKeys.length; + const svgId = svg.attr('id'); + const svgWidth = parseFloat(svg.attr('width')); + const svgHeight = parseFloat(svg.attr('height')); + const rowKeys = sortedSites.length ? sortedSites : Object.keys(data.rows).sort().reverse(); + const rowCount = rowKeys.length; /** Sanity Check: svg must have discrete numeric dimensions @@ -109,17 +97,17 @@ function BasicAvailabilityGrid(config) { Create mappings of all sites for given state or domain to aid in showing partial vs. full selections */ - var siteViewMaps = { + const siteViewMaps = { domains: {}, states: {} }; - Object.keys(allSites).forEach(function (site) { - var domain = allSites[site].domainCode; + Object.keys(allSites).forEach(site => { + const domain = allSites[site].domainCode; if (!siteViewMaps.domains[domain]) { siteViewMaps.domains[domain] = []; } siteViewMaps.domains[domain].push(site); - var state = allSites[site].stateCode; + const state = allSites[site].stateCode; if (!siteViewMaps.states[state]) { siteViewMaps.states[state] = []; } @@ -129,12 +117,12 @@ function BasicAvailabilityGrid(config) { /** Setup: Interaction state vars (local vars is all we need here) */ - var rowHoverKey = null; - var draggingCells = false; + let rowHoverKey = null; + let draggingCells = false; /* eslint-disable no-unused-vars */ - var dateRangeHoverKey = null; - var draggingDateRange = [{ + let dateRangeHoverKey = null; + const draggingDateRange = [{ dragging: false, centerDragX: 0 }, { @@ -149,46 +137,38 @@ function BasicAvailabilityGrid(config) { feed data to d3 selections in order to only draw what will actually be visible. */ - var getLabelWidth = function getLabelWidth() { + const getLabelWidth = () => { if (data.view === 'products') return _AvailabilityUtils.SVG.PRODUCT_LABEL_WIDTH; return data.view === 'ungrouped' ? _AvailabilityUtils.SVG.UNGROUPED_LABEL_WIDTH : _AvailabilityUtils.SVG.GROUPED_LABEL_WIDTH; }; - var getMinTimeOffset = function getMinTimeOffset() { - return 0 - (_AvailabilityUtils.SVG.ABS_MAX_DATA_WIDTH - (svgWidth - getLabelWidth())); - }; - var getYearStartX = function getYearStartX(year) { - var intYear = parseInt(year, 10); + const getMinTimeOffset = () => 0 - (_AvailabilityUtils.SVG.ABS_MAX_DATA_WIDTH - (svgWidth - getLabelWidth())); + const getYearStartX = year => { + const intYear = parseInt(year, 10); return getLabelWidth() + _AvailabilityUtils.SVG.END_PADDING + _AvailabilityUtils.TIME.YEARS.indexOf(intYear) * (_AvailabilityUtils.SVG.YEAR_WIDTH + _AvailabilityUtils.SVG.YEAR_PADDING); }; - var getYearCenterX = function getYearCenterX(year) { - return getYearStartX(year) + _AvailabilityUtils.SVG.YEAR_WIDTH / 2; - }; - var getYearMonthStartX = function getYearMonthStartX(yearMonth) { - var year = parseInt(yearMonth.substr(0, 4), 10); - var month = parseInt(yearMonth.substr(5, 2), 10); - var yearIdx = _AvailabilityUtils.TIME.YEARS.indexOf(year); + const getYearCenterX = year => getYearStartX(year) + _AvailabilityUtils.SVG.YEAR_WIDTH / 2; + const getYearMonthStartX = yearMonth => { + const year = parseInt(yearMonth.substr(0, 4), 10); + const month = parseInt(yearMonth.substr(5, 2), 10); + const yearIdx = _AvailabilityUtils.TIME.YEARS.indexOf(year); if (yearIdx === -1 || month < 1 || month > 12) { return 0; } return getYearStartX(year) + (month - 1) * _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH; }; - var getYearMonthsInView = function getYearMonthsInView(totalSvgWidth, dragOffset) { - return _AvailabilityUtils.TIME.YEAR_MONTHS.filter(function (yearMonth) { - var tX = getYearMonthStartX(yearMonth) + dragOffset; - var margin = _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH * 4; - var lower = Math.max(0, getLabelWidth() - margin); - var upper = totalSvgWidth + margin; - return tX > lower && tX + _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH < upper; - }); - }; - var getYearsInView = function getYearsInView(totalSvgWidth, dragOffset) { - return _AvailabilityUtils.TIME.YEARS.filter(function (year) { - var tX = getYearStartX(year) + dragOffset; - var lower = -2 * _AvailabilityUtils.SVG.YEAR_WIDTH; - var upper = totalSvgWidth - getLabelWidth() + 2 * _AvailabilityUtils.SVG.YEAR_WIDTH; - return tX > lower && tX + _AvailabilityUtils.SVG.YEAR_WIDTH < upper; - }); - }; + const getYearMonthsInView = (totalSvgWidth, dragOffset) => _AvailabilityUtils.TIME.YEAR_MONTHS.filter(yearMonth => { + const tX = getYearMonthStartX(yearMonth) + dragOffset; + const margin = _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH * 4; + const lower = Math.max(0, getLabelWidth() - margin); + const upper = totalSvgWidth + margin; + return tX > lower && tX + _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH < upper; + }); + const getYearsInView = (totalSvgWidth, dragOffset) => _AvailabilityUtils.TIME.YEARS.filter(year => { + const tX = getYearStartX(year) + dragOffset; + const lower = -2 * _AvailabilityUtils.SVG.YEAR_WIDTH; + const upper = totalSvgWidth - getLabelWidth() + 2 * _AvailabilityUtils.SVG.YEAR_WIDTH; + return tX > lower && tX + _AvailabilityUtils.SVG.YEAR_WIDTH < upper; + }); /** Function to generate the "initial" time offset for first load. By default we may extend the @@ -198,17 +178,17 @@ function BasicAvailabilityGrid(config) { right edge, but also keeping full year labels in view (why we target 8 months of the latest year... the right number of months so the year label is not cut off even if the year is empty) */ - var getInitialTimeOffset = function getInitialTimeOffset() { - var minTimeOffset = getMinTimeOffset(); + const getInitialTimeOffset = () => { + const minTimeOffset = getMinTimeOffset(); if (!data || !data.rows) { return minTimeOffset; } - var availableMonths = []; + let availableMonths = []; if (data.rows.summary) { availableMonths = Object.keys(data.rows.summary); } else { - var availableMonthsSet = new Set(); - Object.keys(data.rows).forEach(function (rowKey) { + const availableMonthsSet = new Set(); + Object.keys(data.rows).forEach(rowKey => { Object.keys(data.rows[rowKey]).forEach(availableMonthsSet.add, availableMonthsSet); }); availableMonths = Array.from(availableMonthsSet.values()); @@ -217,10 +197,10 @@ function BasicAvailabilityGrid(config) { return minTimeOffset; } availableMonths.sort(); - var latestAvailableYearMonth = availableMonths[availableMonths.length - 1]; - var latestAvailableYearInt = parseInt(latestAvailableYearMonth.substr(0, 4), 10); - var latestAvailableMonthInt = parseInt(latestAvailableYearMonth.substr(5, 2), 10); - var finalMonth = latestAvailableMonthInt <= 6 ? "".concat(latestAvailableYearInt, "-08") : "".concat(latestAvailableYearInt + 1, "-08"); + const latestAvailableYearMonth = availableMonths[availableMonths.length - 1]; + const latestAvailableYearInt = parseInt(latestAvailableYearMonth.substr(0, 4), 10); + const latestAvailableMonthInt = parseInt(latestAvailableYearMonth.substr(5, 2), 10); + const finalMonth = latestAvailableMonthInt <= 6 ? "".concat(latestAvailableYearInt, "-08") : "".concat(latestAvailableYearInt + 1, "-08"); return Math.max(0 - getYearMonthStartX(finalMonth) - _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH + svgWidth, minTimeOffset); }; @@ -228,27 +208,23 @@ function BasicAvailabilityGrid(config) { Functions to get a translate() string for a data row by index in the sorted rowKeys array */ - var getRowY = function getRowY(idx) { - return _AvailabilityUtils.SVG.CELL_PADDING + (rowCount - idx) * (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING); - }; - var getRowTranslation = function getRowTranslation(d, idx) { - return "translate(0,".concat(getRowY(idx), ")"); - }; + const getRowY = idx => _AvailabilityUtils.SVG.CELL_PADDING + (rowCount - idx) * (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING); + const getRowTranslation = (d, idx) => "translate(0,".concat(getRowY(idx), ")"); /** Main SVG Structure (Layered groups, clip definition, etc.) */ svg.selectAll('*').remove(); - var clipWidth = svgWidth - getLabelWidth(); - var defs = svg.append('defs'); - var labelSelectionsG = svg.append('g').attr('class', 'labelSelectionsG'); - var clipPath = defs.append('clipPath').attr('id', "".concat(svgId, "-clip")); + const clipWidth = svgWidth - getLabelWidth(); + const defs = svg.append('defs'); + const labelSelectionsG = svg.append('g').attr('class', 'labelSelectionsG'); + const clipPath = defs.append('clipPath').attr('id', "".concat(svgId, "-clip")); clipPath.append('rect').attr('x', getLabelWidth()).attr('y', 0).attr('width', clipWidth).attr('height', svgHeight); - var clipG = svg.append('g').attr('class', 'clipG').attr('clip-path', "url(#".concat(svgId, "-clip)")); - var dragG = clipG.append('g').attr('class', 'dragG'); - var rowSelectionsG = dragG.append('g').attr('class', 'rowSelectionsG'); - var dragContentG = dragG.append('g').attr('class', 'dragContentG'); + const clipG = svg.append('g').attr('class', 'clipG').attr('clip-path', "url(#".concat(svgId, "-clip)")); + const dragG = clipG.append('g').attr('class', 'dragG'); + const rowSelectionsG = dragG.append('g').attr('class', 'rowSelectionsG'); + const dragContentG = dragG.append('g').attr('class', 'dragContentG'); /** Time offset values and functions @@ -258,15 +234,15 @@ function BasicAvailabilityGrid(config) { has changed, prefer it stays at the minimum). Also keep the offset bounded within where there's actually data to show. */ - var prevMinTimeOffset = getMinTimeOffset(); + let prevMinTimeOffset = getMinTimeOffset(); if (svg.attr('data-prevMinTimeOffset') === null) { svg.attr('data-prevMinTimeOffset', getMinTimeOffset()); } else { prevMinTimeOffset = parseFloat(svg.attr('data-prevMinTimeOffset')); } - var getTimeOffset = function getTimeOffset() { - var minTimeOffset = getMinTimeOffset(); - var currentTimeOffset = parseFloat(svg.attr('data-timeOffset')) || 0; + const getTimeOffset = () => { + const minTimeOffset = getMinTimeOffset(); + let currentTimeOffset = parseFloat(svg.attr('data-timeOffset')) || 0; if (currentTimeOffset === prevMinTimeOffset && prevMinTimeOffset !== minTimeOffset) { currentTimeOffset = minTimeOffset; prevMinTimeOffset = minTimeOffset; @@ -274,12 +250,12 @@ function BasicAvailabilityGrid(config) { } return currentTimeOffset; }; - var setTimeOffset = function setTimeOffset(timeOffset) { + const setTimeOffset = timeOffset => { // Only set the timeOffset is sites are loaded if (!Object.keys(allSites).length) { return; } - var boundedTimeOffset = Math.min(Math.max(getMinTimeOffset(), timeOffset), 0); + const boundedTimeOffset = Math.min(Math.max(getMinTimeOffset(), timeOffset), 0); dragG.attr('transform', "translate(".concat(boundedTimeOffset, ",0)")); svg.attr('data-timeOffset', boundedTimeOffset); }; @@ -298,8 +274,8 @@ function BasicAvailabilityGrid(config) { // Get the center of the gutter on either side of a given yearMonth INSIDE the clip. // To translate the value to pixels OUTSIDE the clip add the time offset, e.g.: // getYearMonthGutterX('YYYY-MM') + getTimeOffset(); - var getYearMonthGutterX = function getYearMonthGutterX(yearMonth) { - var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'left'; + const getYearMonthGutterX = function (yearMonth) { + let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'left'; switch (side) { case 'left': if (yearMonth === _AvailabilityUtils.TIME.MIN_YEAR_MONTH) { @@ -353,15 +329,15 @@ function BasicAvailabilityGrid(config) { // Get the string for the yearmonth closest to a given pixel x-offset on either side. // Stays within the selectable range unless selectable is false, in which case // it stays within the chart's global min and max. - var getXOffsetYearMonth = function getXOffsetYearMonth(xOffset, dragOffset) { - var side = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'left'; - var selectable = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; + const getXOffsetYearMonth = function (xOffset, dragOffset) { + let side = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'left'; + let selectable = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; /***/ - var basis = Math.min(Math.max(xOffset, getLabelWidth()), svgWidth) - dragOffset; - var yearIdx = Math.floor((basis - getLabelWidth()) / (_AvailabilityUtils.SVG.YEAR_WIDTH + _AvailabilityUtils.SVG.YEAR_PADDING)); - var boundedYearIdx = Math.max(Math.min(yearIdx, _AvailabilityUtils.TIME.YEARS.length - 1), 0); - var year = _AvailabilityUtils.TIME.YEARS[boundedYearIdx]; - var yearStartX = getYearStartX(year); + const basis = Math.min(Math.max(xOffset, getLabelWidth()), svgWidth) - dragOffset; + const yearIdx = Math.floor((basis - getLabelWidth()) / (_AvailabilityUtils.SVG.YEAR_WIDTH + _AvailabilityUtils.SVG.YEAR_PADDING)); + const boundedYearIdx = Math.max(Math.min(yearIdx, _AvailabilityUtils.TIME.YEARS.length - 1), 0); + let year = _AvailabilityUtils.TIME.YEARS[boundedYearIdx]; + let yearStartX = getYearStartX(year); if (basis < yearStartX && side === 'left' && boundedYearIdx !== 0) { year = parseInt(year, 10) - 1; yearStartX = getYearStartX(year); @@ -369,11 +345,11 @@ function BasicAvailabilityGrid(config) { year = parseInt(year, 10) + 1; yearStartX = getYearStartX(year); } - var roundFunc = side === 'left' ? 'floor' : 'ceil'; - var month = Math[roundFunc]((basis - yearStartX) / _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH) + 1; - var boundedMonth = Math.max(Math.min(month, 12), 1); - var yearMonth = "".concat(year, "-").concat(boundedMonth.toString().padStart(2, '0')); - var bounds = selectable ? dateRange.validValues : [_AvailabilityUtils.TIME.MIN_YEAR_MONTH, _AvailabilityUtils.TIME.MAX_YEAR_MONTH]; + const roundFunc = side === 'left' ? 'floor' : 'ceil'; + const month = Math[roundFunc]((basis - yearStartX) / _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH) + 1; + const boundedMonth = Math.max(Math.min(month, 12), 1); + const yearMonth = "".concat(year, "-").concat(boundedMonth.toString().padStart(2, '0')); + const bounds = selectable ? dateRange.validValues : [_AvailabilityUtils.TIME.MIN_YEAR_MONTH, _AvailabilityUtils.TIME.MAX_YEAR_MONTH]; if (yearMonth < bounds[0]) { return bounds[0]; } @@ -386,18 +362,18 @@ function BasicAvailabilityGrid(config) { /** SVG: Row Hover */ - var rowHover = svg.append('rect').attr('class', 'rowHover'); + const rowHover = svg.append('rect').attr('class', 'rowHover'); rowHover.attr('x', 1).attr('y', -2 * _AvailabilityUtils.SVG.CELL_HEIGHT).attr('width', svgWidth - 1).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING).attr('fill', 'none').attr('stroke', _Theme.COLORS.LIGHT_BLUE[700]).attr('stroke-width', '1.5px').style('opacity', 0); /** SVG: Left and Right bounds */ - var lboundOffset = getLabelWidth() + _AvailabilityUtils.SVG.CELL_PADDING / 2 - 1; - var lbound = svg.append('line'); + const lboundOffset = getLabelWidth() + _AvailabilityUtils.SVG.CELL_PADDING / 2 - 1; + const lbound = svg.append('line'); lbound.attr('x1', lboundOffset).attr('y1', 0).attr('x2', lboundOffset).attr('y2', svgHeight); _AvailabilityUtils.SVG_STYLES.apply(lbound, 'timeBound'); - var rboundOffset = svgWidth - 1; - var rbound = svg.append('line'); + const rboundOffset = svgWidth - 1; + const rbound = svg.append('line'); rbound.attr('x1', rboundOffset).attr('y1', 0).attr('x2', rboundOffset).attr('y2', svgHeight); _AvailabilityUtils.SVG_STYLES.apply(rbound, 'timeBound'); @@ -406,9 +382,9 @@ function BasicAvailabilityGrid(config) { Create a mapping of current view keys (sites, domains, states, etc.) to selected status (i.e. 'full' or 'partial') */ - var viewSelections = {}; - var sitesSet = new Set(sites.value); - var validSitesSet = new Set(sites.validValues); + const viewSelections = {}; + const sitesSet = new Set(sites.value); + const validSitesSet = new Set(sites.validValues); if (sites.value.length) { switch (data.view) { case 'summary': @@ -416,19 +392,15 @@ function BasicAvailabilityGrid(config) { break; case 'sites': case 'ungrouped': - sites.value.forEach(function (site) { + sites.value.forEach(site => { viewSelections[site] = 'full'; }); break; default: // domains, states - Object.keys(siteViewMaps[data.view]).forEach(function (entry) { - var viewSites = new Set(siteViewMaps[data.view][entry].filter(function (s) { - return validSitesSet.has(s); - })); - var intersection = new Set(_toConsumableArray(viewSites).filter(function (s) { - return sitesSet.has(s); - })); + Object.keys(siteViewMaps[data.view]).forEach(entry => { + const viewSites = new Set(siteViewMaps[data.view][entry].filter(s => validSitesSet.has(s))); + const intersection = new Set([...viewSites].filter(s => sitesSet.has(s))); if (!intersection.size) { return; } @@ -437,11 +409,11 @@ function BasicAvailabilityGrid(config) { break; } } - var toggleSelection = function toggleSelection(key) { + const toggleSelection = key => { if (!setSitesValue) { return; } - var allSitesForKey = new Set(); + let allSitesForKey = new Set(); switch (data.view) { case 'summary': allSitesForKey = new Set(sites.validValues); @@ -452,37 +424,33 @@ function BasicAvailabilityGrid(config) { break; default: // domains, states - allSitesForKey = new Set(siteViewMaps[data.view][key].filter(function (s) { - return validSitesSet.has(s); - })); + allSitesForKey = new Set(siteViewMaps[data.view][key].filter(s => validSitesSet.has(s))); break; } - var newSelectedSitesSet; + let newSelectedSitesSet; if (!viewSelections[key] || viewSelections[key] === 'partial') { // select all sites for this key - newSelectedSitesSet = new Set([].concat(_toConsumableArray(sitesSet), _toConsumableArray(allSitesForKey))); + newSelectedSitesSet = new Set([...sitesSet, ...allSitesForKey]); } else { // deselect all sites for this key - newSelectedSitesSet = new Set(_toConsumableArray(sitesSet).filter(function (s) { - return !allSitesForKey.has(s); - })); + newSelectedSitesSet = new Set([...sitesSet].filter(s => !allSitesForKey.has(s))); } - setSitesValue(_toConsumableArray(newSelectedSitesSet)); + setSitesValue([...newSelectedSitesSet]); }; - var rowHighlightReset = (0, _lodash.debounce)(function () { - var clearRowHoverKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + const rowHighlightReset = (0, _lodash.debounce)(function () { + let clearRowHoverKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; if (clearRowHoverKey) { rowHoverKey = null; } rowHover.style('opacity', 0); rowHover.attr('y', -2 * _AvailabilityUtils.SVG.CELL_HEIGHT); }, 100); - var rowHighlightHover = function rowHighlightHover(key) { + const rowHighlightHover = key => { rowHoverKey = key; - var offset = rowKeys.indexOf(key); + const offset = rowKeys.indexOf(key); if (offset !== -1 && !draggingCells) { rowHighlightReset.cancel(); - var y = _AvailabilityUtils.SVG.CELL_PADDING / 2 + (rowCount - offset) * (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING); + const y = _AvailabilityUtils.SVG.CELL_PADDING / 2 + (rowCount - offset) * (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING); rowHover.style('opacity', 1); rowHover.attr('y', y); } @@ -491,32 +459,22 @@ function BasicAvailabilityGrid(config) { /** SVG: Row Labels */ - var rowLabelsG = svg.append('g').attr('class', 'rowLabelsG'); - rowKeys.forEach(function (rowKey, rowIdx) { - var transform = getRowTranslation(rowKey, rowIdx); - var labelX = getLabelWidth() - _AvailabilityUtils.SVG.CELL_PADDING; - var rowLabelG = rowLabelsG.append('g').attr('transform', transform); - var fill = selectionEnabled && setSitesValue && viewSelections[rowKey] ? _Theme.default.palette.primary.contrastText : _Theme.default.palette.grey[700]; - var text = rowLabelG.append('text').attr('x', labelX).attr('y', _AvailabilityUtils.SVG.LABEL_FONT_SIZE - _AvailabilityUtils.SVG.CELL_PADDING / 2).attr('fill', fill).text(data.getLabel.text(rowKey)); + const rowLabelsG = svg.append('g').attr('class', 'rowLabelsG'); + rowKeys.forEach((rowKey, rowIdx) => { + const transform = getRowTranslation(rowKey, rowIdx); + const labelX = getLabelWidth() - _AvailabilityUtils.SVG.CELL_PADDING; + const rowLabelG = rowLabelsG.append('g').attr('transform', transform); + const fill = selectionEnabled && setSitesValue && viewSelections[rowKey] ? _Theme.default.palette.primary.contrastText : _Theme.default.palette.grey[700]; + const text = rowLabelG.append('text').attr('x', labelX).attr('y', _AvailabilityUtils.SVG.LABEL_FONT_SIZE - _AvailabilityUtils.SVG.CELL_PADDING / 2).attr('fill', fill).text(data.getLabel.text(rowKey)); _AvailabilityUtils.SVG_STYLES.apply(text, 'rowLabel'); - var mask = rowLabelG.append('rect').attr('x', 0).attr('y', -1 * (_AvailabilityUtils.SVG.CELL_PADDING / 2)).attr('width', getLabelWidth()).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING).on('mouseover', function (event, d) { - return rowHighlightHover(rowKey); - }).on('focus', function (event, d) { - return rowHighlightHover(rowKey); - }).on('mouseout', function (event, d) { - return rowHighlightReset(true); - }).on('blur', function (event, d) { - return rowHighlightReset(true); - }); + const mask = rowLabelG.append('rect').attr('x', 0).attr('y', -1 * (_AvailabilityUtils.SVG.CELL_PADDING / 2)).attr('width', getLabelWidth()).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING).on('mouseover', (event, d) => rowHighlightHover(rowKey)).on('focus', (event, d) => rowHighlightHover(rowKey)).on('mouseout', (event, d) => rowHighlightReset(true)).on('blur', (event, d) => rowHighlightReset(true)); _AvailabilityUtils.SVG_STYLES.apply(mask, 'rowLabelMask'); // Fill the mask and delay the selection to emulate a touch ripple. // Re-render to show the selection will reset the style. - var maskClick = selectionEnabled && setSitesValue ? function (event, d) { + const maskClick = selectionEnabled && setSitesValue ? (event, d) => { _AvailabilityUtils.SVG_STYLES.touchRipple(mask, 15); - setTimeout(function () { - return toggleSelection(rowKey); - }, 15); - } : function (event, d) {}; + setTimeout(() => toggleSelection(rowKey), 15); + } : (event, d) => {}; mask.on('click', maskClick); mask.append('svg:title').text(data.getLabel.title(rowKey)); }); @@ -524,35 +482,25 @@ function BasicAvailabilityGrid(config) { /** SVG: Time Axis */ - var timeAxis = {}; + const timeAxis = {}; timeAxis.g = dragContentG.append('g').attr('class', 'timeAxisG'); timeAxis.highlight = timeAxis.g.append('rect').attr('class', 'timeAxisHighlight'); timeAxis.innerG = timeAxis.g.append('g').attr('class', 'timeAxisInnerG'); timeAxis.mask = clipG.append('rect').attr('class', 'timeAxisMask'); - var redrawTimeAxis = function redrawTimeAxis() { + const redrawTimeAxis = () => { if (timeAxis.innerG.selectAll('*').empty()) { timeAxis.highlight.attr('x', getLabelWidth()).attr('y', 0).attr('width', _AvailabilityUtils.SVG.ABS_MAX_DATA_WIDTH).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + 1.5 * _AvailabilityUtils.SVG.CELL_PADDING); _AvailabilityUtils.SVG_STYLES.apply(timeAxis.highlight, 'timeHighlight'); timeAxis.mask.attr('x', getLabelWidth()).attr('y', 0).attr('width', _AvailabilityUtils.SVG.ABS_MAX_DATA_WIDTH).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING); _AvailabilityUtils.SVG_STYLES.apply(timeAxis.mask, 'timeHighlightMask'); } - timeAxis.innerG.selectAll('text').data(function () { - return getYearsInView(svgWidth, getTimeOffset()); - }).join('text').attr('x', function (year) { - return getYearCenterX(year); - }).attr('y', _AvailabilityUtils.SVG.LABEL_FONT_SIZE + 1).text(function (year) { - return year; - }).each(function (year, idx, labelNodes) { + timeAxis.innerG.selectAll('text').data(() => getYearsInView(svgWidth, getTimeOffset())).join('text').attr('x', year => getYearCenterX(year)).attr('y', _AvailabilityUtils.SVG.LABEL_FONT_SIZE + 1).text(year => year).each((year, idx, labelNodes) => { _AvailabilityUtils.SVG_STYLES.apply((0, _d3Selection.select)(labelNodes[idx]), 'timeLabel'); }); - timeAxis.innerG.selectAll('line').data(function () { - var lineYears = getYearsInView(svgWidth, getTimeOffset()); + timeAxis.innerG.selectAll('line').data(() => { + const lineYears = getYearsInView(svgWidth, getTimeOffset()); return lineYears[0] === _AvailabilityUtils.TIME.START_YEAR ? lineYears.slice(1) : lineYears; - }).join('line').attr('x1', function (year) { - return getYearStartX(year) - _AvailabilityUtils.SVG.YEAR_PADDING / 2; - }).attr('y1', 0).attr('x2', function (year) { - return getYearStartX(year) - _AvailabilityUtils.SVG.YEAR_PADDING / 2; - }).attr('y2', svgHeight).each(function (year, idx, lineNodes) { + }).join('line').attr('x1', year => getYearStartX(year) - _AvailabilityUtils.SVG.YEAR_PADDING / 2).attr('y1', 0).attr('x2', year => getYearStartX(year) - _AvailabilityUtils.SVG.YEAR_PADDING / 2).attr('y2', svgHeight).each((year, idx, lineNodes) => { _AvailabilityUtils.SVG_STYLES.apply((0, _d3Selection.select)(lineNodes[idx]), 'timeDivider'); }); }; @@ -560,75 +508,43 @@ function BasicAvailabilityGrid(config) { /** SVG: Row Data */ - var dataG = dragContentG.append('g').attr('class', 'dataG'); - var dataMasksG = svg.append('g').attr('class', 'dataMasksG'); - var redrawData = function redrawData() { + const dataG = dragContentG.append('g').attr('class', 'dataG'); + const dataMasksG = svg.append('g').attr('class', 'dataMasksG'); + const redrawData = () => { // Click/drag masks - dataMasksG.selectAll('rect').data(rowKeys).join('rect').attr('x', getLabelWidth()).attr('y', function (d, idx) { - return _AvailabilityUtils.SVG.CELL_PADDING / 2 + (rowCount - idx) * (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING); - }).attr('width', svgWidth - getLabelWidth()).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING).attr('fill', 'transparent').style('cursor', selectionEnabled && setSitesValue ? 'pointer' : 'grab').style('outline', 'none').on('mouseover', function (event, d) { - return rowHighlightHover(d); - }).on('focus', function (event, d) { - return rowHighlightHover(d); - }).on('mouseout', function (event, d) { - return rowHighlightReset(true); - }).on('blur', function (event, d) { - return rowHighlightReset(true); - }).on('click', selectionEnabled && setSitesValue ? function (event, d) { + dataMasksG.selectAll('rect').data(rowKeys).join('rect').attr('x', getLabelWidth()).attr('y', (d, idx) => _AvailabilityUtils.SVG.CELL_PADDING / 2 + (rowCount - idx) * (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING)).attr('width', svgWidth - getLabelWidth()).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING).attr('fill', 'transparent').style('cursor', selectionEnabled && setSitesValue ? 'pointer' : 'grab').style('outline', 'none').on('mouseover', (event, d) => rowHighlightHover(d)).on('focus', (event, d) => rowHighlightHover(d)).on('mouseout', (event, d) => rowHighlightReset(true)).on('blur', (event, d) => rowHighlightReset(true)).on('click', selectionEnabled && setSitesValue ? (event, d) => { _AvailabilityUtils.SVG_STYLES.touchRipple((0, _d3Selection.select)(event.currentTarget), 15); - setTimeout(function () { - return toggleSelection(d); - }, 15); - } : function (event, d) {}); + setTimeout(() => toggleSelection(d), 15); + } : (event, d) => {}); // Cells - dataG.selectAll('g').data(rowKeys).join('g').attr('transform', getRowTranslation).each(function (rowKey, rowIdx, gNodes) { - var rowData = data.rows[rowKey]; - var getCellAttr = function getCellAttr(month, attr) { - var status = (0, _AvailabilityUtils.calcBasicRollupStatus)(rowData[month]); + dataG.selectAll('g').data(rowKeys).join('g').attr('transform', getRowTranslation).each((rowKey, rowIdx, gNodes) => { + const rowData = data.rows[rowKey]; + const getCellAttr = (month, attr) => { + const status = (0, _AvailabilityUtils.calcBasicRollupStatus)(rowData[month]); return !_AvailabilitySvgComponents.CELL_ATTRS[status] ? _AvailabilitySvgComponents.CELL_ATTRS['not available'][attr] || null : _AvailabilitySvgComponents.CELL_ATTRS[status][attr] || null; }; - (0, _d3Selection.select)(gNodes[rowIdx]).selectAll('rect').data(function () { - return getYearMonthsInView(svgWidth, getTimeOffset()); - }).join('rect').attr('cursor', 'pointer').attr('x', function (month) { - return getYearMonthStartX(month) + (getCellAttr(month, 'nudge') || 0); - }).attr('y', function (month) { - return getCellAttr(month, 'nudge') || 0; - }).attr('rx', "".concat(_AvailabilityUtils.SVG.CELL_RX, "px")).attr('width', function (month) { - return getCellAttr(month, 'width'); - }).attr('height', function (month) { - return getCellAttr(month, 'height'); - }).attr('fill', function (month) { - return getCellAttr(month, 'fill'); - }).attr('stroke', function (month) { - return getCellAttr(month, 'stroke'); - }).attr('stroke-width', function (month) { - return getCellAttr(month, 'strokeWidth'); - }); + (0, _d3Selection.select)(gNodes[rowIdx]).selectAll('rect').data(() => getYearMonthsInView(svgWidth, getTimeOffset())).join('rect').attr('cursor', 'pointer').attr('x', month => getYearMonthStartX(month) + (getCellAttr(month, 'nudge') || 0)).attr('y', month => getCellAttr(month, 'nudge') || 0).attr('rx', "".concat(_AvailabilityUtils.SVG.CELL_RX, "px")).attr('width', month => getCellAttr(month, 'width')).attr('height', month => getCellAttr(month, 'height')).attr('fill', month => getCellAttr(month, 'fill')).attr('stroke', month => getCellAttr(month, 'stroke')).attr('stroke-width', month => getCellAttr(month, 'strokeWidth')); }); }; /** SVG: Date Range Handles */ - var dateRangeHandlesG = selectionEnabled ? dragG.append('g').attr('class', 'dateRangeHandlesG') : null; - var redrawDateRangeHandles = function redrawDateRangeHandles() { + const dateRangeHandlesG = selectionEnabled ? dragG.append('g').attr('class', 'dateRangeHandlesG') : null; + const redrawDateRangeHandles = () => { if (!selectionEnabled) { return; } - var isHighlighted = function isHighlighted(d) { - return dateRangeHoverKey === d || draggingDateRange[d].dragging; - }; - var yBounds = Object.keys(viewSelections).reduce(function (acc, key) { - var y = getRowY(rowKeys.indexOf(key)); - var low = y - _AvailabilityUtils.SVG.CELL_PADDING / 2; - var high = y + _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING / 2; + const isHighlighted = d => dateRangeHoverKey === d || draggingDateRange[d].dragging; + const yBounds = Object.keys(viewSelections).reduce((acc, key) => { + const y = getRowY(rowKeys.indexOf(key)); + const low = y - _AvailabilityUtils.SVG.CELL_PADDING / 2; + const high = y + _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING / 2; return [acc[0] === null || acc[0] > low ? low : acc[0], acc[1] === null || acc[1] < high ? high : acc[1]]; }, [null, null]); - dateRangeHandlesG.selectAll('rect').data([0, 1]).join('rect').attr('class', function (d) { - return "dateRange".concat(d === 0 ? 'Start' : 'End', "HandleRect"); - }).attr('x', function (d) { - var useWidth = isHighlighted(d) ? _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH + 2 : _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH; - var gutterX = getYearMonthGutterX(dateRange.value[d], d === 0 ? 'left' : 'right'); + dateRangeHandlesG.selectAll('rect').data([0, 1]).join('rect').attr('class', d => "dateRange".concat(d === 0 ? 'Start' : 'End', "HandleRect")).attr('x', d => { + const useWidth = isHighlighted(d) ? _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH + 2 : _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH; + const gutterX = getYearMonthGutterX(dateRange.value[d], d === 0 ? 'left' : 'right'); if (d === 0 && dateRange.value[d] === _AvailabilityUtils.TIME.MIN_YEAR_MONTH) { return gutterX; } @@ -636,60 +552,48 @@ function BasicAvailabilityGrid(config) { return gutterX - useWidth; } return gutterX - useWidth / 2; - }).attr('width', function (d) { - return isHighlighted(d) ? _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH + 2 : _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH; - }).attr('y', function (d) { + }).attr('width', d => isHighlighted(d) ? _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH + 2 : _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH).attr('y', d => { if (isHighlighted(d)) { return getRowY(rowKeys.length - 1) - _AvailabilityUtils.SVG.CELL_PADDING / 2; } return yBounds[0]; - }).attr('height', function (d) { + }).attr('height', d => { if (isHighlighted(d)) { return svgHeight - getRowY(rowKeys.length - 1) + _AvailabilityUtils.SVG.CELL_PADDING / 2 - 0.5; } return yBounds[1] - yBounds[0]; - }).attr('fill', function (d) { - return isHighlighted(d) ? _Theme.COLORS.LIGHT_BLUE[100] : _Theme.COLORS.LIGHT_BLUE[300]; - }).attr('stroke', _Theme.default.palette.primary.main).style('stroke-width', '1.5px').style('display', sites.value.length ? null : 'none'); + }).attr('fill', d => isHighlighted(d) ? _Theme.COLORS.LIGHT_BLUE[100] : _Theme.COLORS.LIGHT_BLUE[300]).attr('stroke', _Theme.default.palette.primary.main).style('stroke-width', '1.5px').style('display', sites.value.length ? null : 'none'); }; /** SVG: Date Range Masks */ - var dateRangeMasksG = selectionEnabled ? svg.append('g').attr('class', 'dateRangeMasksG') : null; - var redrawDateRangeHandleMasks = function redrawDateRangeHandleMasks() { + const dateRangeMasksG = selectionEnabled ? svg.append('g').attr('class', 'dateRangeMasksG') : null; + const redrawDateRangeHandleMasks = () => { if (!selectionEnabled) { return; } - dateRangeMasksG.selectAll('rect').data([0, 1]).join('rect').attr('class', function (d) { - return "dateRange".concat(d === 0 ? 'Start' : 'End', "MaskRect"); - }).attr('x', function (d) { - return getYearMonthGutterX(dateRange.value[d] || _AvailabilityUtils.TIME.MIN_YEAR_MONTH, d === 0 ? 'left' : 'right') - _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2 + getTimeOffset(); - }).attr('y', 0).attr('width', _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH).attr('height', svgHeight).style('cursor', 'crosshair') // 'ew-resize' + dateRangeMasksG.selectAll('rect').data([0, 1]).join('rect').attr('class', d => "dateRange".concat(d === 0 ? 'Start' : 'End', "MaskRect")).attr('x', d => getYearMonthGutterX(dateRange.value[d] || _AvailabilityUtils.TIME.MIN_YEAR_MONTH, d === 0 ? 'left' : 'right') - _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2 + getTimeOffset()).attr('y', 0).attr('width', _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH).attr('height', svgHeight).style('cursor', 'crosshair') // 'ew-resize' .style('outline', 'none').attr('fill', 'red').style('opacity', 0).style('display', sites.value.length ? null : 'none'); }; /** SVG: Selections */ - var redrawSelections = function redrawSelections() { + const redrawSelections = () => { if (!selectionEnabled) { return; } // Row and label backgrounds - var yOffset = _AvailabilityUtils.SVG.CELL_PADDING / 2; - var yMultiplier = _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING; - var y = function y(d) { - return yOffset + (rowCount - rowKeys.indexOf(d)) * yMultiplier; - }; - var fill = function fill(d) { - return viewSelections[d] === 'full' ? _Theme.default.palette.primary.main : _Theme.COLORS.LIGHT_BLUE[200]; - }; - var startX = getYearMonthGutterX(dateRange.value[0], 'left'); - var endX = getYearMonthGutterX(dateRange.value[1], 'right'); + const yOffset = _AvailabilityUtils.SVG.CELL_PADDING / 2; + const yMultiplier = _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING; + const y = d => yOffset + (rowCount - rowKeys.indexOf(d)) * yMultiplier; + const fill = d => viewSelections[d] === 'full' ? _Theme.default.palette.primary.main : _Theme.COLORS.LIGHT_BLUE[200]; + let startX = getYearMonthGutterX(dateRange.value[0], 'left'); + let endX = getYearMonthGutterX(dateRange.value[1], 'right'); if (startX > endX) { - var swapX = startX; + const swapX = startX; startX = endX; endX = swapX; } @@ -705,7 +609,7 @@ function BasicAvailabilityGrid(config) { /** Redraw functions */ - var redraw = function redraw() { + const redraw = () => { redrawTimeAxis(); redrawData(); if (selectionEnabled) { @@ -723,7 +627,7 @@ function BasicAvailabilityGrid(config) { /** Setup Interactions */ - var timeHighlightReset = (0, _lodash.debounce)(function () { + const timeHighlightReset = (0, _lodash.debounce)(() => { if (draggingCells) { return; } @@ -731,26 +635,26 @@ function BasicAvailabilityGrid(config) { timeAxis.mask.style('cursor', 'grab'); _AvailabilityUtils.SVG_STYLES.apply(timeAxis.highlight, 'timeHighlight'); }, 100); - var timeHighlightHover = function timeHighlightHover() { + const timeHighlightHover = () => { if (draggingCells) { return; } timeHighlightReset.cancel(); _AvailabilityUtils.SVG_STYLES.apply(timeAxis.highlight, 'timeHighlightHover'); }; - var cellDragTime = null; - var dragCells = (0, _d3Drag.drag)().on('start', function (event, d) { + let cellDragTime = null; + const dragCells = (0, _d3Drag.drag)().on('start', (event, d) => { draggingCells = true; rowHighlightReset(false); dataMasksG.selectAll('rect').style('cursor', 'grabbing'); timeAxis.mask.style('cursor', 'grabbing'); _AvailabilityUtils.SVG_STYLES.apply(timeAxis.highlight, 'timeHighlightDrag'); cellDragTime = new Date().getTime(); - }).on('drag', function (event, d) { + }).on('drag', (event, d) => { setTimeOffset(getTimeOffset() + event.dx); redrawData(); redrawDateRangeHandleMasks(); - }).on('end', function (event, d) { + }).on('end', (event, d) => { draggingCells = false; rowHighlightHover(rowHoverKey); timeHighlightReset(); @@ -760,45 +664,33 @@ function BasicAvailabilityGrid(config) { // Perform a select action if selection is enabled to keep the end user happy. =) cellDragTime = new Date().getTime() - cellDragTime; if (selectionEnabled && setSitesValue && cellDragTime < 100) { - _AvailabilityUtils.SVG_STYLES.touchRipple(dataMasksG.selectAll('rect').filter(function (filterD) { - return filterD === rowHoverKey; - }), 15); - setTimeout(function () { - return toggleSelection(rowHoverKey); - }, 15); + _AvailabilityUtils.SVG_STYLES.touchRipple(dataMasksG.selectAll('rect').filter(filterD => filterD === rowHoverKey), 15); + setTimeout(() => toggleSelection(rowHoverKey), 15); } }); dragCells(timeAxis.mask); dragCells(dataMasksG.selectAll('rect')); - timeAxis.mask.on('wheel', function (event, d) { + timeAxis.mask.on('wheel', (event, d) => { event.preventDefault(); - var step = (_AvailabilityUtils.SVG.CELL_WIDTH + _AvailabilityUtils.SVG.CELL_PADDING) * 3; - var delta = (event.wheelDelta > 0 ? -1 : 1) * step; + const step = (_AvailabilityUtils.SVG.CELL_WIDTH + _AvailabilityUtils.SVG.CELL_PADDING) * 3; + const delta = (event.wheelDelta > 0 ? -1 : 1) * step; setTimeOffset(getTimeOffset() + delta); redraw(); redrawDateRangeHandleMasks(); - }).on('mouseover', function (event, d) { - return timeHighlightHover(); - }).on('focus', function (event, d) { - return timeHighlightHover(); - }).on('mouseout', function (event, d) { - return timeHighlightReset(); - }).on('blur', function (event, d) { - return timeHighlightReset(); - }); + }).on('mouseover', (event, d) => timeHighlightHover()).on('focus', (event, d) => timeHighlightHover()).on('mouseout', (event, d) => timeHighlightReset()).on('blur', (event, d) => timeHighlightReset()); if (selectionEnabled) { - var dateRangeHandleReset = (0, _lodash.debounce)(function () { + const dateRangeHandleReset = (0, _lodash.debounce)(() => { dateRangeHoverKey = null; redrawDateRangeHandles(); }, 100); - var dateRangeHandleHover = function dateRangeHandleHover(key) { + const dateRangeHandleHover = key => { dateRangeHoverKey = key; redrawDateRangeHandles(); }; // Function to flip date range handles, masks, and values if a drag event puts start after end // Shift values by one month on each side if flipping as start looks ahead and end looks back - var flipDateRangeSelectionIfNeeded = function flipDateRangeSelectionIfNeeded() { + const flipDateRangeSelectionIfNeeded = () => { if (dateRange.value[1] < dateRange.value[0]) { dateRange.value = [_AvailabilityUtils.TIME.getNextMonth(dateRange.value[1]), _AvailabilityUtils.TIME.getPreviousMonth(dateRange.value[0])]; // Only if the handles are atop each other will this still be true after the last flip. @@ -810,81 +702,69 @@ function BasicAvailabilityGrid(config) { }; // Interactions for Date Range START Handle - var dragDateRangeStartMask = dateRangeMasksG.select('.dateRangeStartMaskRect'); - dragDateRangeStartMask.on('mouseover', function (event, d) { - return dateRangeHandleHover(0); - }).on('focus', function (event, d) { - return dateRangeHandleHover(0); - }).on('mouseout', function (event, d) { - return dateRangeHandleReset(); - }).on('blur', function (event, d) { - return dateRangeHandleReset(); - }); - var dragDateRangeStart = (0, _d3Drag.drag)().on('start', function (event, d) { + const dragDateRangeStartMask = dateRangeMasksG.select('.dateRangeStartMaskRect'); + dragDateRangeStartMask.on('mouseover', (event, d) => dateRangeHandleHover(0)).on('focus', (event, d) => dateRangeHandleHover(0)).on('mouseout', (event, d) => dateRangeHandleReset()).on('blur', (event, d) => dateRangeHandleReset()); + const dragDateRangeStart = (0, _d3Drag.drag)().on('start', (event, d) => { draggingDateRange[0].dragging = true; draggingDateRange[0].centerDragX = parseFloat(dragDateRangeStartMask.attr('x'), 10) + _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2; - }).on('drag', function (event, d) { + }).on('drag', (event, d) => { draggingDateRange[0].centerDragX += event.dx; - var centerDragX = draggingDateRange[0].centerDragX; + const { + centerDragX + } = draggingDateRange[0]; dragDateRangeStartMask.attr('x', centerDragX - _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2); - var nextYearMonth = getXOffsetYearMonth(centerDragX, getTimeOffset(), 'right'); - var nextYearMonthStartX = getYearMonthGutterX(nextYearMonth, 'left'); - var currentYearMonthStartX = getYearMonthGutterX(dateRange.value[0], 'left'); - var insideClipCenterDragX = draggingDateRange[0].centerDragX - getTimeOffset(); - var distanceToNext = Math.abs(insideClipCenterDragX - nextYearMonthStartX); - var distanceToCurrent = Math.abs(insideClipCenterDragX - currentYearMonthStartX); + const nextYearMonth = getXOffsetYearMonth(centerDragX, getTimeOffset(), 'right'); + const nextYearMonthStartX = getYearMonthGutterX(nextYearMonth, 'left'); + const currentYearMonthStartX = getYearMonthGutterX(dateRange.value[0], 'left'); + const insideClipCenterDragX = draggingDateRange[0].centerDragX - getTimeOffset(); + const distanceToNext = Math.abs(insideClipCenterDragX - nextYearMonthStartX); + const distanceToCurrent = Math.abs(insideClipCenterDragX - currentYearMonthStartX); if (nextYearMonth !== dateRange.value[0] && distanceToNext < distanceToCurrent) { dateRange.value[0] = nextYearMonth; redrawSelections(); } - }).on('end', function (event, d) { + }).on('end', (event, d) => { draggingDateRange[0].dragging = false; draggingDateRange[0].centerDragX = 0; // Recenter mask as it is likely off a few pixels due to snap-to-gutter behavior - var maskX = getYearMonthGutterX(dateRange.value[0], 'left') + _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2 + getTimeOffset(); + const maskX = getYearMonthGutterX(dateRange.value[0], 'left') + _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2 + getTimeOffset(); dateRangeMasksG.select('.dateRangeStartMaskRect').attr('x', maskX); flipDateRangeSelectionIfNeeded(); - setDateRangeValue(_toConsumableArray(dateRange.value)); + setDateRangeValue([...dateRange.value]); redrawSelections(); }); dragDateRangeStart(dateRangeMasksG.select('.dateRangeStartMaskRect')); // Interactions for Date Range END Handle - var dragDateRangeEndMask = dateRangeMasksG.select('.dateRangeEndMaskRect'); - dragDateRangeEndMask.on('mouseover', function (event, d) { - return dateRangeHandleHover(1); - }).on('focus', function (event, d) { - return dateRangeHandleHover(1); - }).on('mouseout', function (event, d) { - return dateRangeHandleReset(); - }).on('blur', function (event, d) { - return dateRangeHandleReset(); - }); - var dragDateRangeEnd = (0, _d3Drag.drag)().on('start', function (event, d) { + const dragDateRangeEndMask = dateRangeMasksG.select('.dateRangeEndMaskRect'); + dragDateRangeEndMask.on('mouseover', (event, d) => dateRangeHandleHover(1)).on('focus', (event, d) => dateRangeHandleHover(1)).on('mouseout', (event, d) => dateRangeHandleReset()).on('blur', (event, d) => dateRangeHandleReset()); + const dragDateRangeEnd = (0, _d3Drag.drag)().on('start', (event, d) => { draggingDateRange[1].dragging = true; draggingDateRange[1].centerDragX = parseFloat(dragDateRangeEndMask.attr('x'), 10) + _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2; - }).on('drag', function (event, d) { + }).on('drag', (event, d) => { draggingDateRange[1].centerDragX += event.dx; - var centerDragX = draggingDateRange[1].centerDragX; + const { + centerDragX + } = draggingDateRange[1]; dragDateRangeEndMask.attr('x', centerDragX - _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2); - var nextYearMonth = getXOffsetYearMonth(centerDragX, getTimeOffset(), 'left'); - var nextYearMonthEndX = getYearMonthGutterX(nextYearMonth, 'right'); - var currentYearMonthEndX = getYearMonthGutterX(dateRange.value[1], 'right'); - var insideClipCenterDragX = draggingDateRange[1].centerDragX - getTimeOffset(); - var distanceToNext = Math.abs(insideClipCenterDragX - nextYearMonthEndX); - var distanceToCurrent = Math.abs(insideClipCenterDragX - currentYearMonthEndX); + const nextYearMonth = getXOffsetYearMonth(centerDragX, getTimeOffset(), 'left'); + const nextYearMonthEndX = getYearMonthGutterX(nextYearMonth, 'right'); + const currentYearMonthEndX = getYearMonthGutterX(dateRange.value[1], 'right'); + const insideClipCenterDragX = draggingDateRange[1].centerDragX - getTimeOffset(); + const distanceToNext = Math.abs(insideClipCenterDragX - nextYearMonthEndX); + const distanceToCurrent = Math.abs(insideClipCenterDragX - currentYearMonthEndX); if (nextYearMonth !== dateRange.value[1] && distanceToNext < distanceToCurrent) { dateRange.value[1] = nextYearMonth; redrawSelections(); } - }).on('end', function (event, d) { + }).on('end', (event, d) => { draggingDateRange[1].dragging = false; draggingDateRange[1].centerDragX = 0; // Recenter mask as it is likely off a few pixels due to snap-to-gutter behavior - var maskX = getYearMonthGutterX(dateRange.value[1], 'right') - _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2 + getTimeOffset(); + const maskX = getYearMonthGutterX(dateRange.value[1], 'right') - _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2 + getTimeOffset(); dateRangeMasksG.select('.dateRangeEndMaskRect').attr('x', maskX); flipDateRangeSelectionIfNeeded(); - setDateRangeValue(_toConsumableArray(dateRange.value)); + setDateRangeValue([...dateRange.value]); redrawSelections(); }); dragDateRangeEnd(dateRangeMasksG.select('.dateRangeEndMaskRect')); diff --git a/lib/components/DataProductAvailability/BasicAvailabilityInterface.js b/lib/components/DataProductAvailability/BasicAvailabilityInterface.js index aa4614c7..4a2181a8 100644 --- a/lib/components/DataProductAvailability/BasicAvailabilityInterface.js +++ b/lib/components/DataProductAvailability/BasicAvailabilityInterface.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -40,141 +39,125 @@ var _BasicAvailabilityGrid = _interopRequireDefault(require("./BasicAvailability var _BasicAvailabilityKey = _interopRequireDefault(require("./BasicAvailabilityKey")); var _AvailabilityUtils = require("./AvailabilityUtils"); var _AvailabilitySvgComponents = require("./AvailabilitySvgComponents"); -var _excluded = ["dataProducts"]; +const _excluded = ["dataProducts"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** Setup: CSS classes */ -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - svg: { - minWidth: "".concat(_AvailabilityUtils.SVG.MIN_WIDTH, "px"), - minHeight: "".concat(_AvailabilityUtils.SVG.MIN_HEIGHT, "px") - }, - topFormHeader: { - display: 'flex', - alignItems: 'center' - }, - h5Small: { - fontSize: '1.075rem' - }, - h6Small: { - fontSize: '0.95rem' - }, - xsSelect: { - height: theme.spacing(4), - '& div': { - padding: _Theme.default.spacing(1, 3, 1, 1.5) - } - }, - sortSelect: { - height: theme.spacing(4), - '& div': { - paddingRight: _Theme.default.spacing(4.5) - }, - marginRight: theme.spacing(2) - }, - helpIcon: { - color: theme.palette.grey[300], - marginRight: theme.spacing(1) - }, - helpGridContainer: { - display: 'flex', - alignItems: 'flex-start', - justifyContent: 'space-around', - flexWrap: 'wrap', - padding: '16px 16px 8px 16px !important' - }, - helpGrid: { - display: 'flex', - alignItems: 'center', - justifyContent: 'flex-start', - marginBottom: theme.spacing(1), - marginRight: theme.spacing(1) - } - }; -}); -var useSiteChipStyles = (0, _styles.makeStyles)(function (theme) { - return { - deleteIcon: { - marginLeft: theme.spacing(-0.25) +const useStyles = (0, _styles.makeStyles)(theme => ({ + svg: { + minWidth: "".concat(_AvailabilityUtils.SVG.MIN_WIDTH, "px"), + minHeight: "".concat(_AvailabilityUtils.SVG.MIN_HEIGHT, "px") + }, + topFormHeader: { + display: 'flex', + alignItems: 'center' + }, + h5Small: { + fontSize: '1.075rem' + }, + h6Small: { + fontSize: '0.95rem' + }, + xsSelect: { + height: theme.spacing(4), + '& div': { + padding: _Theme.default.spacing(1, 3, 1, 1.5) } - }; -}); + }, + sortSelect: { + height: theme.spacing(4), + '& div': { + paddingRight: _Theme.default.spacing(4.5) + }, + marginRight: theme.spacing(2) + }, + helpIcon: { + color: theme.palette.grey[300], + marginRight: theme.spacing(1) + }, + helpGridContainer: { + display: 'flex', + alignItems: 'flex-start', + justifyContent: 'space-around', + flexWrap: 'wrap', + padding: '16px 16px 8px 16px !important' + }, + helpGrid: { + display: 'flex', + alignItems: 'center', + justifyContent: 'flex-start', + marginBottom: theme.spacing(1), + marginRight: theme.spacing(1) + } +})); +const useSiteChipStyles = (0, _styles.makeStyles)(theme => ({ + deleteIcon: { + marginLeft: theme.spacing(-0.25) + } +})); /** Main Function */ -var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { - var classes = useStyles(_Theme.default); - var atXs = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('xs')); - var atSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('sm')); - var siteChipClasses = useSiteChipStyles(_Theme.default); - var dataProducts = props.dataProducts, - other = _objectWithoutProperties(props, _excluded); - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - _NeonContext$useNeonC3 = _NeonContext$useNeonC2[0], - neonContextData = _NeonContext$useNeonC3.data, - neonContextIsFinal = _NeonContext$useNeonC3.isFinal, - neonContextHasError = _NeonContext$useNeonC3.hasError; - var allSites = neonContextData.sites, - allStates = neonContextData.states, - allDomains = neonContextData.domains; +const BasicAvailabilityInterface = props => { + const classes = useStyles(_Theme.default); + const atXs = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('xs')); + const atSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('sm')); + const siteChipClasses = useSiteChipStyles(_Theme.default); + const { + dataProducts + } = props, + other = _objectWithoutPropertiesLoose(props, _excluded); + const [{ + data: neonContextData, + isFinal: neonContextIsFinal, + hasError: neonContextHasError + }] = _NeonContext.default.useNeonContextState(); + const { + sites: allSites, + states: allStates, + domains: allDomains + } = neonContextData; /** Sort methods and directions */ - var SORT_METHODS = { + const SORT_METHODS = { states: { label: 'by State', - getSortFunction: function getSortFunction(ret) { - return function (a, b) { - var aState = allStates[allSites[a].stateCode].name; - var bState = allStates[allSites[b].stateCode].name; - if (aState === bState) { - return a < b ? ret[0] : ret[1]; - } - return aState < bState ? ret[0] : ret[1]; - }; + getSortFunction: ret => (a, b) => { + const aState = allStates[allSites[a].stateCode].name; + const bState = allStates[allSites[b].stateCode].name; + if (aState === bState) { + return a < b ? ret[0] : ret[1]; + } + return aState < bState ? ret[0] : ret[1]; } }, domains: { label: 'by Domain', - getSortFunction: function getSortFunction(ret) { - return function (a, b) { - var aDomain = allSites[a].domainCode; - var bDomain = allSites[b].domainCode; - if (aDomain === bDomain) { - return a < b ? ret[0] : ret[1]; - } - return aDomain < bDomain ? ret[0] : ret[1]; - }; + getSortFunction: ret => (a, b) => { + const aDomain = allSites[a].domainCode; + const bDomain = allSites[b].domainCode; + if (aDomain === bDomain) { + return a < b ? ret[0] : ret[1]; + } + return aDomain < bDomain ? ret[0] : ret[1]; } }, sites: { label: 'by Site', - getSortFunction: function getSortFunction(ret) { - return function (a, b) { - return a < b ? ret[0] : ret[1]; - }; - } + getSortFunction: ret => (a, b) => a < b ? ret[0] : ret[1] } }; - var SORT_DIRECTIONS = ['ASC', 'DESC']; - var PRODUCT_LOOKUP = {}; - dataProducts.forEach(function (product) { + const SORT_DIRECTIONS = ['ASC', 'DESC']; + const PRODUCT_LOOKUP = {}; + dataProducts.forEach(product => { PRODUCT_LOOKUP[product.dataProductCode] = product.dataProductTitle; }); @@ -184,7 +167,7 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { Afford different methods for presenting/grouping data along the y-axis (geospatial) */ // eslint-disable-next-line react-hooks/exhaustive-deps - var views = { + const views = { summary: { view: 'summary', name: 'Summary', @@ -193,12 +176,8 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { summary: {} }, getLabel: { - text: function text() { - return 'ALL '; - }, - title: function title() { - return 'All Sites'; - } + text: () => 'ALL ', + title: () => 'All Sites' } }, sites: { @@ -207,12 +186,8 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { selectable: true, rows: {}, getLabel: { - text: function text(key) { - return key; - }, - title: function title(key) { - return allSites[key].description; - } + text: key => key, + title: key => allSites[key].description } }, states: { @@ -221,12 +196,8 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { selectable: true, rows: {}, getLabel: { - text: function text(key) { - return " ".concat(key, " "); - }, - title: function title(key) { - return allStates[key].name; - } + text: key => " ".concat(key, " "), + title: key => allStates[key].name } }, domains: { @@ -235,12 +206,8 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { selectable: true, rows: {}, getLabel: { - text: function text(key) { - return "".concat(key, " "); - }, - title: function title(key) { - return allDomains[key].name; - } + text: key => "".concat(key, " "), + title: key => allDomains[key].name } }, ungrouped: { @@ -248,13 +215,11 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { name: 'Ungrouped', selectable: false, getLabel: { - text: function text(key) { - return "".concat(allSites[key].stateCode, "-").concat(allSites[key].domainCode, "-").concat(key); - }, - title: function title(key) { - var siteTitle = allSites[key].description; - var domainTitle = allDomains[allSites[key].domainCode].name; - var stateTitle = allStates[allSites[key].stateCode].name; + text: key => "".concat(allSites[key].stateCode, "-").concat(allSites[key].domainCode, "-").concat(key), + title: key => { + const siteTitle = allSites[key].description; + const domainTitle = allDomains[allSites[key].domainCode].name; + const stateTitle = allStates[allSites[key].stateCode].name; return "".concat(stateTitle, " - ").concat(domainTitle, " - ").concat(siteTitle); } } @@ -265,41 +230,33 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { selectable: false, rows: {}, getLabel: { - text: function text(key) { - return key; - }, - title: function title(key) { - return PRODUCT_LOOKUP[key]; - } + text: key => key, + title: key => PRODUCT_LOOKUP[key] } } }; views.ungrouped.rows = views.sites.rows; - var selectableViewKeys = Object.keys(views).filter(function (key) { - return views[key].selectable; - }); + const selectableViewKeys = Object.keys(views).filter(key => views[key].selectable); /** State: Context-Derived Stuff */ - var _DownloadDataContext$ = _DownloadDataContext.default.useDownloadDataState(), - _DownloadDataContext$2 = _slicedToArray(_DownloadDataContext$, 2), - _DownloadDataContext$3 = _DownloadDataContext$2[0], - downloadContextIsActive = _DownloadDataContext$3.downloadContextIsActive, - requiredSteps = _DownloadDataContext$3.requiredSteps, - productData = _DownloadDataContext$3.productData, - sites = _DownloadDataContext$3.sites, - dateRange = _DownloadDataContext$3.dateRange, - contextView = _DownloadDataContext$3.availabilityView, - contextSortMethod = _DownloadDataContext$3.availabilitySortMethod, - contextSortDirection = _DownloadDataContext$3.availabilitySortDirection, - dispatchSelection = _DownloadDataContext$2[1]; - var disableSelection = props.disableSelection, - delineateRelease = props.delineateRelease, - availabilityStatusType = props.availabilityStatusType; - var selectionEnabled = !disableSelection && requiredSteps.some(function (step) { - return step.key === 'sitesAndDateRange'; - }); + const [{ + downloadContextIsActive, + requiredSteps, + productData, + sites, + dateRange, + availabilityView: contextView, + availabilitySortMethod: contextSortMethod, + availabilitySortDirection: contextSortDirection + }, dispatchSelection] = _DownloadDataContext.default.useDownloadDataState(); + const { + disableSelection, + delineateRelease, + availabilityStatusType + } = props; + const selectionEnabled = !disableSelection && requiredSteps.some(step => step.key === 'sitesAndDateRange'); /** State: Current View @@ -307,85 +264,76 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { Prop overrides context. If neither are set then default to 'sites' if selection is currently enabled and 'summary' if not. */ - var propsView = props.view; - var initialView = propsView; + const { + view: propsView + } = props; + let initialView = propsView; if (!initialView) { initialView = contextView; } if (!initialView) { initialView = selectionEnabled ? 'sites' : 'summary'; } - var _useState = (0, _react.useState)(initialView), - _useState2 = _slicedToArray(_useState, 2), - currentView = _useState2[0], - setCurrentView = _useState2[1]; + const [currentView, setCurrentView] = (0, _react.useState)(initialView); /** State: Current Sort Method and Sort Direction Only applies for "ungrouped" view mode. */ - var propsSortMethod = props.sortMethod, - propsSortDirection = props.sortDirection; - var initialSortMethod = propsSortMethod; + const { + sortMethod: propsSortMethod, + sortDirection: propsSortDirection + } = props; + let initialSortMethod = propsSortMethod; if (!initialSortMethod) { initialSortMethod = contextSortMethod; } if (!initialSortMethod) { initialSortMethod = 'states'; } - var initialSortDirection = propsSortDirection; + let initialSortDirection = propsSortDirection; if (!initialSortDirection) { initialSortDirection = contextSortDirection; } if (!initialSortDirection) { initialSortDirection = 'ASC'; } - var _useState3 = (0, _react.useState)(initialSortMethod), - _useState4 = _slicedToArray(_useState3, 2), - currentSortMethod = _useState4[0], - setCurrentSortMethod = _useState4[1]; - var _useState5 = (0, _react.useState)(initialSortDirection), - _useState6 = _slicedToArray(_useState5, 2), - currentSortDirection = _useState6[0], - setCurrentSortDirection = _useState6[1]; - var setSitesValue = (0, _react.useCallback)(function (sitesValue) { - return dispatchSelection({ - type: 'setValidatableValue', - key: 'sites', - value: sitesValue - }); - }, [dispatchSelection]); - var setDateRangeValue = (0, _react.useCallback)(function (dateRangeValue) { - return dispatchSelection({ - type: 'setValidatableValue', - key: 'dateRange', - value: dateRangeValue - }); - }, [dispatchSelection]); + const [currentSortMethod, setCurrentSortMethod] = (0, _react.useState)(initialSortMethod); + const [currentSortDirection, setCurrentSortDirection] = (0, _react.useState)(initialSortDirection); + const setSitesValue = (0, _react.useCallback)(sitesValue => dispatchSelection({ + type: 'setValidatableValue', + key: 'sites', + value: sitesValue + }), [dispatchSelection]); + const setDateRangeValue = (0, _react.useCallback)(dateRangeValue => dispatchSelection({ + type: 'setValidatableValue', + key: 'dateRange', + value: dateRangeValue + }), [dispatchSelection]); /** Handlers */ - var handleSelectAllSites = function handleSelectAllSites() { + const handleSelectAllSites = () => { setSitesValue(sites.validValues); }; - var handleSelectNoneSites = function handleSelectNoneSites() { + const handleSelectNoneSites = () => { setSitesValue([]); }; - var handleSelectAllDateRange = function handleSelectAllDateRange() { + const handleSelectAllDateRange = () => { setDateRangeValue(dateRange.validValues); }; - var handleSelectLatestYearDateRange = function handleSelectLatestYearDateRange() { - var start = _AvailabilityUtils.TIME.getYearMonthMoment(dateRange.validValues[1]).subtract(11, 'months').format('YYYY-MM'); + const handleSelectLatestYearDateRange = () => { + const start = _AvailabilityUtils.TIME.getYearMonthMoment(dateRange.validValues[1]).subtract(11, 'months').format('YYYY-MM'); setDateRangeValue([start < dateRange.validValues[0] ? dateRange.validValues[0] : start, dateRange.validValues[1]]); }; - var handleChangeStartDate = function handleChangeStartDate(newStartDate) { + const handleChangeStartDate = newStartDate => { setDateRangeValue([newStartDate.format('YYYY-MM'), dateRange.value[1]]); }; - var handleChangeEndDate = function handleChangeEndDate(newEndDate) { + const handleChangeEndDate = newEndDate => { setDateRangeValue([dateRange.value[0], newEndDate.format('YYYY-MM')]); }; - var handleChangeView = function handleChangeView(event, newView) { + const handleChangeView = (event, newView) => { if (!selectableViewKeys.includes(newView) || currentView === newView) { return; } @@ -399,19 +347,19 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { }; // eslint-disable-next-line react-hooks/exhaustive-deps - var sortedSites = []; - var applySort = function applySort() { + let sortedSites = []; + const applySort = () => { if (currentView !== 'ungrouped') { return; } // NOTE - these returns are backwards because the rendering in the chart is bottom-up // (though of course a user will read it top-down). - var sortReturns = [currentSortDirection === 'ASC' ? 1 : -1, currentSortDirection === 'ASC' ? -1 : 1]; + const sortReturns = [currentSortDirection === 'ASC' ? 1 : -1, currentSortDirection === 'ASC' ? -1 : 1]; sortedSites = Object.keys(views.ungrouped.rows); sortedSites.sort(SORT_METHODS[currentSortMethod].getSortFunction(sortReturns)); }; - var handleChangeSortMethod = function handleChangeSortMethod(event) { - var newSortMethod = event.target.value; + const handleChangeSortMethod = event => { + const newSortMethod = event.target.value; if (!Object.keys(SORT_METHODS).includes(newSortMethod) || currentSortMethod === newSortMethod) { return; } @@ -424,7 +372,7 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { setCurrentSortMethod(newSortMethod); applySort(); }; - var handleChangeSortDirection = function handleChangeSortDirection(event, newSortDirection) { + const handleChangeSortDirection = (event, newSortDirection) => { if (!SORT_DIRECTIONS.includes(newSortDirection) || currentSortDirection === newSortDirection) { return; } @@ -446,32 +394,37 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { all aggregation views. TODO: Add other statuses. Currently the only status is "available". */ - var siteCodes = []; - var propsSiteCodes = props.siteCodes; - var contextSiteCodes = productData.siteCodes; + let siteCodes = []; + const { + siteCodes: propsSiteCodes + } = props; + const { + siteCodes: contextSiteCodes + } = productData; if (propsSiteCodes && propsSiteCodes.length) { siteCodes = propsSiteCodes; } else if (contextSiteCodes && contextSiteCodes.length) { siteCodes = contextSiteCodes; } - siteCodes.forEach(function (site) { - var siteCode = site.siteCode, - availableMonths = site.availableMonths, - availableReleases = site.availableReleases; + siteCodes.forEach(site => { + const { + siteCode, + availableMonths, + availableReleases + } = site; if (!allSites[siteCode]) { return; } - var _allSites$siteCode = allSites[siteCode], - stateCode = _allSites$siteCode.stateCode, - domainCode = _allSites$siteCode.domainCode; + const { + stateCode, + domainCode + } = allSites[siteCode]; if (!downloadContextIsActive) { sites.validValues.push(siteCode); } - var provAvailableMonths = []; + let provAvailableMonths = []; if (delineateRelease && Array.isArray(availableReleases)) { - var provRelease = availableReleases.find(function (value) { - return value.release === 'PROVISIONAL'; - }); + const provRelease = availableReleases.find(value => value.release === 'PROVISIONAL'); if (provRelease) { provAvailableMonths = provRelease.availableMonths; } @@ -479,8 +432,8 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { views.sites.rows[siteCode] = {}; views.states.rows[stateCode] = views.states.rows[stateCode] || {}; views.domains.rows[domainCode] = views.domains.rows[domainCode] || {}; - availableMonths.forEach(function (month) { - var status = availabilityStatusType || 'available'; + availableMonths.forEach(month => { + let status = availabilityStatusType || 'available'; if (delineateRelease && provAvailableMonths && provAvailableMonths.length > 0) { if (provAvailableMonths.includes(month)) { status = 'available-provisional'; @@ -504,22 +457,22 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { views.domains.rows[domainCode][month].add(status); }); }); - dataProducts.forEach(function (product) { - var dataProductCode = product.dataProductCode, - availableMonths = product.availableMonths, - availableReleases = product.availableReleases; - var provAvailableMonths = []; + dataProducts.forEach(product => { + const { + dataProductCode, + availableMonths, + availableReleases + } = product; + let provAvailableMonths = []; if (delineateRelease && Array.isArray(availableReleases)) { - var provRelease = availableReleases.find(function (value) { - return value.release === 'PROVISIONAL'; - }); + const provRelease = availableReleases.find(value => value.release === 'PROVISIONAL'); if (provRelease) { provAvailableMonths = provRelease.availableMonths; } } views.products.rows[dataProductCode] = {}; - availableMonths.forEach(function (month) { - var status = availabilityStatusType || 'available'; + availableMonths.forEach(month => { + let status = availabilityStatusType || 'available'; if (delineateRelease && provAvailableMonths && provAvailableMonths.length > 0) { if (provAvailableMonths.includes(month)) { status = 'available-provisional'; @@ -532,7 +485,7 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { }); }); if (!downloadContextIsActive) { - var summaryMonths = Object.keys(views.summary.rows.summary).sort(); + const summaryMonths = Object.keys(views.summary.rows.summary).sort(); dateRange.validValues[0] = summaryMonths[0]; // eslint-disable-line prefer-destructuring dateRange.validValues[1] = summaryMonths.pop(); } @@ -540,31 +493,31 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { /** Redraw setup */ - var svgRef = (0, _react.useRef)(null); - var handleSvgRedraw = (0, _react.useCallback)(function () { + const svgRef = (0, _react.useRef)(null); + const handleSvgRedraw = (0, _react.useCallback)(() => { (0, _BasicAvailabilityGrid.default)({ data: views[currentView], - svgRef: svgRef, - allSites: allSites, - sites: sites, - sortedSites: sortedSites, - setSitesValue: setSitesValue, - dateRange: dateRange, - setDateRangeValue: setDateRangeValue, - selectionEnabled: selectionEnabled + svgRef, + allSites, + sites, + sortedSites, + setSitesValue, + dateRange, + setDateRangeValue, + selectionEnabled }); }, [svgRef, views, currentView, allSites, sites, sortedSites, setSitesValue, dateRange, setDateRangeValue, selectionEnabled]); - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { applySort(); handleSvgRedraw(); }); - var justify = 'end'; + let justify = 'end'; if (currentView === 'ungrouped') { justify = atXs || atSm ? 'start' : 'end'; } else { justify = atXs ? 'start' : 'end'; } - var optionDivStyle = { + const optionDivStyle = { display: 'flex', alignItems: 'center', justifyContent: "flex-".concat(justify) @@ -574,7 +527,7 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { Render: NeonContext-related Loading and Error States */ if (!neonContextIsFinal || neonContextHasError) { - var message = currentView === 'products' ? 'Loading Products...' : 'Loading Sites...'; + const message = currentView === 'products' ? 'Loading Products...' : 'Loading Sites...'; return /*#__PURE__*/_react.default.createElement(_AvailabilityPending.default, { message: message }); @@ -583,115 +536,103 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { /** Render: View Options */ - var renderViewOptions = function renderViewOptions() { - return /*#__PURE__*/_react.default.createElement("div", { - style: optionDivStyle, - "data-selenium": "data-product-availability.view-options" - }, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "h6", - className: classes.h6Small, - style: { - marginRight: _Theme.default.spacing(1.5), - whiteSpace: 'nowrap' - } - }, "View By:"), /*#__PURE__*/_react.default.createElement(_Hidden.default, { - smDown: true, - key: "viewMdUp" - }, /*#__PURE__*/_react.default.createElement(_ToggleButtonGroup.default, { - exclusive: true, - color: "primary", - variant: "outlined", - size: "small", - value: currentView, - onChange: handleChangeView - }, selectableViewKeys.map(function (key) { - return /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - key: key, - value: key, - size: "small" - }, views[key].name); - }))), /*#__PURE__*/_react.default.createElement(_Hidden.default, { - mdUp: true, - key: "viewSmDown" - }, /*#__PURE__*/_react.default.createElement(_FormControl.default, { - variant: "filled" - }, /*#__PURE__*/_react.default.createElement(_Select.default, { - value: currentView, - onChange: function onChange(event) { - return handleChangeView(event, event.target.value); - }, - input: /*#__PURE__*/_react.default.createElement(_OutlinedInput.default, { - margin: "dense", - className: selectionEnabled ? null : classes.xsSelect - }), - variant: "filled" - }, selectableViewKeys.map(function (key) { - return /*#__PURE__*/_react.default.createElement(_MenuItem.default, { - key: key, - value: key - }, views[key].name); - }))))); - }; + const renderViewOptions = () => /*#__PURE__*/_react.default.createElement("div", { + style: optionDivStyle, + "data-selenium": "data-product-availability.view-options" + }, /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "h6", + className: classes.h6Small, + style: { + marginRight: _Theme.default.spacing(1.5), + whiteSpace: 'nowrap' + } + }, "View By:"), /*#__PURE__*/_react.default.createElement(_Hidden.default, { + smDown: true, + key: "viewMdUp" + }, /*#__PURE__*/_react.default.createElement(_ToggleButtonGroup.default, { + exclusive: true, + color: "primary", + variant: "outlined", + size: "small", + value: currentView, + onChange: handleChangeView + }, selectableViewKeys.map(key => /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + key: key, + value: key, + size: "small" + }, views[key].name)))), /*#__PURE__*/_react.default.createElement(_Hidden.default, { + mdUp: true, + key: "viewSmDown" + }, /*#__PURE__*/_react.default.createElement(_FormControl.default, { + variant: "filled" + }, /*#__PURE__*/_react.default.createElement(_Select.default, { + value: currentView, + onChange: event => handleChangeView(event, event.target.value), + input: /*#__PURE__*/_react.default.createElement(_OutlinedInput.default, { + margin: "dense", + className: selectionEnabled ? null : classes.xsSelect + }), + variant: "filled" + }, selectableViewKeys.map(key => /*#__PURE__*/_react.default.createElement(_MenuItem.default, { + key: key, + value: key + }, views[key].name)))))); /** Render: Sort Options */ - var renderSortOptions = function renderSortOptions() { - return /*#__PURE__*/_react.default.createElement("div", { - style: optionDivStyle, - "data-selenium": "data-product-availability.sort-options" - }, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "h6", - className: classes.h6Small, - style: { - marginRight: _Theme.default.spacing(1.5), - whiteSpace: 'nowrap' - } - }, "Sort By:"), /*#__PURE__*/_react.default.createElement("div", { - style: { - display: 'flex', - justifyContent: 'flex-end' - } - }, /*#__PURE__*/_react.default.createElement(_FormControl.default, { - variant: "outlined" - }, /*#__PURE__*/_react.default.createElement(_Select.default, { - value: currentSortMethod, - "aria-label": "Sort Method", - className: classes.sortSelect, - onChange: handleChangeSortMethod, - "data-selenium": "data-product-availability.sort-options.method" - }, Object.keys(SORT_METHODS).map(function (method) { - return /*#__PURE__*/_react.default.createElement(_MenuItem.default, { - key: method, - value: method - }, SORT_METHODS[method].label); - }))), /*#__PURE__*/_react.default.createElement(_ToggleButtonGroup.default, { - exclusive: true, - size: "small", - value: currentSortDirection, - onChange: handleChangeSortDirection, - "data-selenium": "data-product-availability.sort-options.direction" - }, /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - key: SORT_DIRECTIONS[0], - value: SORT_DIRECTIONS[0], - title: "Sort Ascending (A-Z)", - "aria-label": "Sort Ascending (A-Z)" - }, /*#__PURE__*/_react.default.createElement(_KeyboardArrowDown.default, { - fontSize: "small" - })), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - key: SORT_DIRECTIONS[1], - value: SORT_DIRECTIONS[1], - title: "Sort Descending (Z-A)", - "aria-label": "Sort Descending (Z-A)" - }, /*#__PURE__*/_react.default.createElement(_KeyboardArrowUp.default, { - fontSize: "small" - }))))); - }; + const renderSortOptions = () => /*#__PURE__*/_react.default.createElement("div", { + style: optionDivStyle, + "data-selenium": "data-product-availability.sort-options" + }, /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "h6", + className: classes.h6Small, + style: { + marginRight: _Theme.default.spacing(1.5), + whiteSpace: 'nowrap' + } + }, "Sort By:"), /*#__PURE__*/_react.default.createElement("div", { + style: { + display: 'flex', + justifyContent: 'flex-end' + } + }, /*#__PURE__*/_react.default.createElement(_FormControl.default, { + variant: "outlined" + }, /*#__PURE__*/_react.default.createElement(_Select.default, { + value: currentSortMethod, + "aria-label": "Sort Method", + className: classes.sortSelect, + onChange: handleChangeSortMethod, + "data-selenium": "data-product-availability.sort-options.method" + }, Object.keys(SORT_METHODS).map(method => /*#__PURE__*/_react.default.createElement(_MenuItem.default, { + key: method, + value: method + }, SORT_METHODS[method].label)))), /*#__PURE__*/_react.default.createElement(_ToggleButtonGroup.default, { + exclusive: true, + size: "small", + value: currentSortDirection, + onChange: handleChangeSortDirection, + "data-selenium": "data-product-availability.sort-options.direction" + }, /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + key: SORT_DIRECTIONS[0], + value: SORT_DIRECTIONS[0], + title: "Sort Ascending (A-Z)", + "aria-label": "Sort Ascending (A-Z)" + }, /*#__PURE__*/_react.default.createElement(_KeyboardArrowDown.default, { + fontSize: "small" + })), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + key: SORT_DIRECTIONS[1], + value: SORT_DIRECTIONS[1], + title: "Sort Descending (Z-A)", + "aria-label": "Sort Descending (Z-A)" + }, /*#__PURE__*/_react.default.createElement(_KeyboardArrowUp.default, { + fontSize: "small" + }))))); /** Render: View Controls */ - var renderViewControls = function renderViewControls() { + const renderViewControls = () => { if (currentView === 'products') { return /*#__PURE__*/_react.default.createElement(_Grid.default, { item: true, @@ -709,9 +650,9 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { /** Render: Key */ - var renderKey = function renderKey() { - var smWidth = currentView === 'ungrouped' ? 12 : 7; - var mdWidth = 6; + const renderKey = () => { + let smWidth = currentView === 'ungrouped' ? 12 : 7; + let mdWidth = 6; if (currentView === 'products') { smWidth = 12; mdWidth = 12; @@ -739,10 +680,10 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { /** Render: Selection */ - var renderSelection = function renderSelection() { - var sitesPlural = sites.value.length > 1 ? 's' : ''; - var siteChipLabel = "".concat(sites.value.length, " site").concat(sitesPlural); - var siteChipProps = { + const renderSelection = () => { + const sitesPlural = sites.value.length > 1 ? 's' : ''; + const siteChipLabel = "".concat(sites.value.length, " site").concat(sitesPlural); + const siteChipProps = { size: 'large', color: 'primary', classes: siteChipClasses, @@ -750,12 +691,12 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { variant: sites.value.length ? 'default' : 'outlined', onDelete: sites.value.length ? handleSelectNoneSites : null }; - var selectionButtonProps = { + const selectionButtonProps = { size: 'small', color: 'primary', variant: 'outlined' }; - var datePickerProps = { + const datePickerProps = { inputVariant: 'outlined', margin: 'dense', views: ['month', 'year'], @@ -796,7 +737,7 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { } }), "data-selenium": "data-product-availability.map-button", - onSave: function onSave(newSites) { + onSave: newSites => { setSitesValue(Array.from(newSites)); } }))), /*#__PURE__*/_react.default.createElement(_Grid.default, { @@ -819,9 +760,7 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { "data-selenium": "data-product-availability.date-range-start", orientation: "portrait", value: _AvailabilityUtils.TIME.getYearMonthMoment(dateRange.value[0]), - onChange: function onChange(newDate) { - return handleChangeStartDate(newDate); - }, + onChange: newDate => handleChangeStartDate(newDate), minDate: _AvailabilityUtils.TIME.getYearMonthMoment(dateRange.validValues[0]), maxDate: _AvailabilityUtils.TIME.getYearMonthMoment(dateRange.value[1]), style: { @@ -832,9 +771,7 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { "data-selenium": "data-product-availability.date-range-end", orientation: "portrait", value: _AvailabilityUtils.TIME.getYearMonthMoment(dateRange.value[1]), - onChange: function onChange(newDate) { - return handleChangeEndDate(newDate); - }, + onChange: newDate => handleChangeEndDate(newDate), minDate: _AvailabilityUtils.TIME.getYearMonthMoment(dateRange.value[0]), maxDate: _AvailabilityUtils.TIME.getYearMonthMoment(dateRange.validValues[1]) })))), /*#__PURE__*/_react.default.createElement("div", { @@ -898,9 +835,9 @@ var BasicAvailabilityInterface = function BasicAvailabilityInterface(props) { /** Render: Final Component */ - var currentRows = views[currentView].rows; - var currentRowCount = Object.keys(currentRows).length; - var svgHeight = _AvailabilityUtils.SVG.CELL_PADDING + (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING) * (currentRowCount + 1); + const currentRows = views[currentView].rows; + const currentRowCount = Object.keys(currentRows).length; + const svgHeight = _AvailabilityUtils.SVG.CELL_PADDING + (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING) * (currentRowCount + 1); return /*#__PURE__*/_react.default.createElement(_FullWidthVisualization.default, _extends({ vizRef: svgRef, minWidth: _AvailabilityUtils.SVG.MIN_WIDTH, @@ -945,5 +882,4 @@ BasicAvailabilityInterface.defaultProps = { delineateRelease: false, availabilityStatusType: null }; -var _default = BasicAvailabilityInterface; -exports.default = _default; \ No newline at end of file +var _default = exports.default = BasicAvailabilityInterface; \ No newline at end of file diff --git a/lib/components/DataProductAvailability/BasicAvailabilityKey.js b/lib/components/DataProductAvailability/BasicAvailabilityKey.js index d6946bf4..be520fc0 100644 --- a/lib/components/DataProductAvailability/BasicAvailabilityKey.js +++ b/lib/components/DataProductAvailability/BasicAvailabilityKey.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -21,69 +20,64 @@ var _AvailabilitySvgComponents = require("./AvailabilitySvgComponents"); var _Theme = _interopRequireWildcard(require("../Theme/Theme")); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - legendContainer: { - display: 'flex', - alignItems: 'flex-start', - justifyContent: 'flex-start', - flexWrap: 'wrap', - marginTop: theme.spacing(1), - width: '100%' - }, - legendTitle: { - fontSize: '0.95rem', - display: 'inline-flex' - }, - legendTitleIcon: { - marginTop: theme.spacing(-0.25) - }, - legendTitleContainer: { - margin: theme.spacing(-1, 1, 0.5, 0) - }, - legendElement: { - margin: theme.spacing(0, 0, 0, 0) - }, - legendElementText: { - textAnchor: 'start', - whiteSpace: 'pre', - fontFamily: '"Cutive Mono","Lucida Console",Monaco,monospace', - fontWeight: 400, - fontSize: "".concat(_AvailabilityUtils.SVG.LABEL_FONT_SIZE, "px"), - fill: _Theme.default.palette.grey[700] - } - }; -}); -var CONTAINER_WIDTH_BREAKPOINT_XS_FLEX_COL = 250; -var CONTAINER_WIDTH_BREAKPOINT_XS = 360; -var CONTAINER_WIDTH_BREAKPOINT_XS_SELECTION = 200; -var CONTAINER_WIDTH_BREAKPOINT_SM_SELECTION = 425; -var ALL_SELECTED_TITLE = 'If the chart is presenting a roll-up (e.g. view by state) then all sites rolled into a given row are selected'; -var SOME_SELECTED_TITLE = 'If the chart is presenting a roll-up (e.g. view by state) then one or more but not all of the sites rolled into a given row are selected'; -var StatusLegendElement = function StatusLegendElement(props) { - var classes = useStyles(_Theme.default); - var status = props.status, - dialog = props.dialog; +const useStyles = (0, _styles.makeStyles)(theme => ({ + legendContainer: { + display: 'flex', + alignItems: 'flex-start', + justifyContent: 'flex-start', + flexWrap: 'wrap', + marginTop: theme.spacing(1), + width: '100%' + }, + legendTitle: { + fontSize: '0.95rem', + display: 'inline-flex' + }, + legendTitleIcon: { + marginTop: theme.spacing(-0.25) + }, + legendTitleContainer: { + margin: theme.spacing(-1, 1, 0.5, 0) + }, + legendElement: { + margin: theme.spacing(0, 0, 0, 0) + }, + legendElementText: { + textAnchor: 'start', + whiteSpace: 'pre', + fontFamily: '"Cutive Mono","Lucida Console",Monaco,monospace', + fontWeight: 400, + fontSize: "".concat(_AvailabilityUtils.SVG.LABEL_FONT_SIZE, "px"), + fill: _Theme.default.palette.grey[700] + } +})); +const CONTAINER_WIDTH_BREAKPOINT_XS_FLEX_COL = 250; +const CONTAINER_WIDTH_BREAKPOINT_XS = 360; +const CONTAINER_WIDTH_BREAKPOINT_XS_SELECTION = 200; +const CONTAINER_WIDTH_BREAKPOINT_SM_SELECTION = 425; +const ALL_SELECTED_TITLE = 'If the chart is presenting a roll-up (e.g. view by state) then all sites rolled into a given row are selected'; +const SOME_SELECTED_TITLE = 'If the chart is presenting a roll-up (e.g. view by state) then one or more but not all of the sites rolled into a given row are selected'; +const StatusLegendElement = props => { + const classes = useStyles(_Theme.default); + const { + status, + dialog + } = props; if (!(0, _typeUtil.exists)(status) || !_AvailabilityUtils.VALID_ENHANCED_STATUSES[status]) { return null; } - var statusSvgHeight = _AvailabilityUtils.SVG.CELL_HEIGHT + 2; - var labelLetterWidth = 8; - var labelY = _AvailabilityUtils.SVG.LABEL_FONT_SIZE - _AvailabilityUtils.SVG.CELL_PADDING + 2; - var statusLabelX = _AvailabilityUtils.SVG.CELL_WIDTH + 2 * _AvailabilityUtils.SVG.CELL_PADDING; - var _VALID_ENHANCED_STATU = _AvailabilityUtils.VALID_ENHANCED_STATUSES[status], - title = _VALID_ENHANCED_STATU.title, - description = _VALID_ENHANCED_STATU.description; - var statusSvgWidth = title.length * labelLetterWidth + statusLabelX; + const statusSvgHeight = _AvailabilityUtils.SVG.CELL_HEIGHT + 2; + const labelLetterWidth = 8; + const labelY = _AvailabilityUtils.SVG.LABEL_FONT_SIZE - _AvailabilityUtils.SVG.CELL_PADDING + 2; + const statusLabelX = _AvailabilityUtils.SVG.CELL_WIDTH + 2 * _AvailabilityUtils.SVG.CELL_PADDING; + const { + title, + description + } = _AvailabilityUtils.VALID_ENHANCED_STATUSES[status]; + const statusSvgWidth = title.length * labelLetterWidth + statusLabelX; return dialog ? /*#__PURE__*/_react.default.createElement("div", { style: { marginBottom: _Theme.default.spacing(2.5) @@ -132,31 +126,33 @@ StatusLegendElement.defaultProps = { status: null, dialog: false }; -var SelectionLegendElement = function SelectionLegendElement(props) { - var classes = useStyles(_Theme.default); - var variant = props.variant, - dialog = props.dialog; +const SelectionLegendElement = props => { + const classes = useStyles(_Theme.default); + const { + variant, + dialog + } = props; if (!['all', 'some'].includes(variant)) { return null; } - var statusSvgHeight = _AvailabilityUtils.SVG.CELL_HEIGHT + 2; - var labelLetterWidth = 8; - var labelY = _AvailabilityUtils.SVG.LABEL_FONT_SIZE - _AvailabilityUtils.SVG.CELL_PADDING + 2; - var selectionSvgHeight = _AvailabilityUtils.SVG.CELL_HEIGHT + 2; - var label = variant === 'all' ? 'All sites selected' : 'Some sites selected'; - var fill = variant === 'all' ? _Theme.default.palette.primary.main : _Theme.COLORS.LIGHT_BLUE[200]; - var description = variant === 'all' ? ALL_SELECTED_TITLE : SOME_SELECTED_TITLE; - var selectionWidth = 30; - var selectionLabelX = selectionWidth + 3 * _AvailabilityUtils.SVG.CELL_PADDING; - var selectionSvgWidth = label.length * labelLetterWidth + selectionLabelX; - var handleAttribs = { + const statusSvgHeight = _AvailabilityUtils.SVG.CELL_HEIGHT + 2; + const labelLetterWidth = 8; + const labelY = _AvailabilityUtils.SVG.LABEL_FONT_SIZE - _AvailabilityUtils.SVG.CELL_PADDING + 2; + const selectionSvgHeight = _AvailabilityUtils.SVG.CELL_HEIGHT + 2; + const label = variant === 'all' ? 'All sites selected' : 'Some sites selected'; + const fill = variant === 'all' ? _Theme.default.palette.primary.main : _Theme.COLORS.LIGHT_BLUE[200]; + const description = variant === 'all' ? ALL_SELECTED_TITLE : SOME_SELECTED_TITLE; + const selectionWidth = 30; + const selectionLabelX = selectionWidth + 3 * _AvailabilityUtils.SVG.CELL_PADDING; + const selectionSvgWidth = label.length * labelLetterWidth + selectionLabelX; + const handleAttribs = { width: _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH, height: _AvailabilityUtils.SVG.CELL_HEIGHT, fill: _Theme.COLORS.LIGHT_BLUE[300], stroke: _Theme.default.palette.primary.main, strokeWidth: 1.5 }; - var graphic = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("rect", { + const graphic = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("rect", { x: 0.5, y: 1.5, width: selectionWidth, @@ -211,18 +207,18 @@ SelectionLegendElement.propTypes = { SelectionLegendElement.defaultProps = { dialog: false }; -var LegendDialog = function LegendDialog(props) { - var dialogOpen = props.dialogOpen, - setDialogOpen = props.setDialogOpen, - selectionEnabled = props.selectionEnabled, - delineateRelease = props.delineateRelease, - availabilityStatusType = props.availabilityStatusType; +const LegendDialog = props => { + const { + dialogOpen, + setDialogOpen, + selectionEnabled, + delineateRelease, + availabilityStatusType + } = props; return /*#__PURE__*/_react.default.createElement(_Dialog.default, { open: dialogOpen, maxWidth: "md", - onClose: function onClose() { - return setDialogOpen(false); - }, + onClose: () => setDialogOpen(false), "aria-labelledby": "availability-key-dialog-title" }, /*#__PURE__*/_react.default.createElement("div", { style: { @@ -240,9 +236,7 @@ var LegendDialog = function LegendDialog(props) { }, "Data Availability Chart Key")), /*#__PURE__*/_react.default.createElement(_IconButton.default, { title: "Close", "aria-label": "Close", - onClick: function onClick() { - return setDialogOpen(false); - }, + onClick: () => setDialogOpen(false), style: { marginRight: _Theme.default.spacing(1) } @@ -309,37 +303,33 @@ LegendDialog.defaultProps = { delineateRelease: false, availabilityStatusType: 'available' }; -var BasicAvailabilityKey = function BasicAvailabilityKey(props) { - var classes = useStyles(_Theme.default); - var selectionEnabled = props.selectionEnabled, - delineateRelease = props.delineateRelease, - availabilityStatusType = props.availabilityStatusType, - dialogOnly = props.dialogOnly; - var appliedAvaStatusType = !(0, _typeUtil.exists)(availabilityStatusType) ? 'available' : availabilityStatusType; - var containerRef = (0, _react.useRef)(); - var _useState = (0, _react.useState)(false), - _useState2 = _slicedToArray(_useState, 2), - dialogOpen = _useState2[0], - setDialogOpen = _useState2[1]; - var _useState3 = (0, _react.useState)(0), - _useState4 = _slicedToArray(_useState3, 2), - componentWidth = _useState4[0], - setComponentWidth = _useState4[1]; - var atContainerWidthXsFlexCol = false; - var atContainerWidthXs = false; - var atContainerWidthSelectionXs = false; - var atContainerWidthSelectionSm = false; +const BasicAvailabilityKey = props => { + const classes = useStyles(_Theme.default); + const { + selectionEnabled, + delineateRelease, + availabilityStatusType, + dialogOnly + } = props; + const appliedAvaStatusType = !(0, _typeUtil.exists)(availabilityStatusType) ? 'available' : availabilityStatusType; + const containerRef = (0, _react.useRef)(); + const [dialogOpen, setDialogOpen] = (0, _react.useState)(false); + const [componentWidth, setComponentWidth] = (0, _react.useState)(0); + let atContainerWidthXsFlexCol = false; + let atContainerWidthXs = false; + let atContainerWidthSelectionXs = false; + let atContainerWidthSelectionSm = false; if (componentWidth > 0) { atContainerWidthXsFlexCol = componentWidth <= CONTAINER_WIDTH_BREAKPOINT_XS_FLEX_COL; atContainerWidthXs = componentWidth <= CONTAINER_WIDTH_BREAKPOINT_XS; atContainerWidthSelectionXs = componentWidth <= CONTAINER_WIDTH_BREAKPOINT_XS_SELECTION; atContainerWidthSelectionSm = componentWidth <= CONTAINER_WIDTH_BREAKPOINT_SM_SELECTION; } - var containerStyleProps = atContainerWidthXsFlexCol ? { + const containerStyleProps = atContainerWidthXsFlexCol ? { flexDirection: 'column' } : {}; - var handleResizeCb = (0, _react.useCallback)(function () { - var container = containerRef.current; + const handleResizeCb = (0, _react.useCallback)(() => { + const container = containerRef.current; if (!container) { return; } @@ -348,21 +338,21 @@ var BasicAvailabilityKey = function BasicAvailabilityKey(props) { } setComponentWidth(container.clientWidth); }, [containerRef, componentWidth, setComponentWidth]); - (0, _react.useLayoutEffect)(function () { - var element = containerRef.current; + (0, _react.useLayoutEffect)(() => { + const element = containerRef.current; if (!element) { - return function () {}; + return () => {}; } handleResizeCb(); if (typeof ResizeObserver !== 'function') { window.addEventListener('resize', handleResizeCb); - return function () { + return () => { window.removeEventListener('resize', handleResizeCb); }; } - var resizeObserver = new ResizeObserver(handleResizeCb); + let resizeObserver = new ResizeObserver(handleResizeCb); resizeObserver.observe(element); - return function () { + return () => { if (!resizeObserver) { return; } @@ -370,7 +360,7 @@ var BasicAvailabilityKey = function BasicAvailabilityKey(props) { resizeObserver = null; }; }, [containerRef, handleResizeCb]); - var renderLegendItems = function renderLegendItems() { + const renderLegendItems = () => { if (dialogOnly) return null; if (selectionEnabled) { return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(StatusLegendElement, { @@ -407,7 +397,7 @@ var BasicAvailabilityKey = function BasicAvailabilityKey(props) { dialog: false }))); }; - var renderLegendItemsContainer = function renderLegendItemsContainer() { + const renderLegendItemsContainer = () => { if (dialogOnly || atContainerWidthSelectionXs) return null; if (selectionEnabled) { if (atContainerWidthSelectionSm) { @@ -438,9 +428,7 @@ var BasicAvailabilityKey = function BasicAvailabilityKey(props) { color: "primary", title: "Help - Data Availability Chart Key", "aria-label": "Help - Data Availability Chart Key", - onClick: function onClick() { - return setDialogOpen(true); - }, + onClick: () => setDialogOpen(true), className: classes.legendTitleIcon }, /*#__PURE__*/_react.default.createElement(_HelpOutline.default, { fontSize: "small" @@ -464,5 +452,4 @@ BasicAvailabilityKey.defaultProps = { availabilityStatusType: 'available', dialogOnly: false }; -var _default = BasicAvailabilityKey; -exports.default = _default; \ No newline at end of file +var _default = exports.default = BasicAvailabilityKey; \ No newline at end of file diff --git a/lib/components/DataProductAvailability/DataProductAvailability.js b/lib/components/DataProductAvailability/DataProductAvailability.js index c253223f..8e65fe9f 100644 --- a/lib/components/DataProductAvailability/DataProductAvailability.js +++ b/lib/components/DataProductAvailability/DataProductAvailability.js @@ -12,15 +12,16 @@ var _AvailabilityContext = _interopRequireDefault(require("./AvailabilityContext var _BasicAvailabilityInterface = _interopRequireDefault(require("./BasicAvailabilityInterface")); var _EnhancedAvailabilityInterface = _interopRequireDefault(require("./EnhancedAvailabilityInterface")); var _AvailabilityUtils = require("./AvailabilityUtils"); -var _excluded = ["sites", "siteCodes"]; +const _excluded = ["sites", "siteCodes"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } -var DataProductAvailability = function DataProductAvailability(props) { - var enhancedSites = props.sites, - basicSiteCodes = props.siteCodes, - other = _objectWithoutProperties(props, _excluded); +const DataProductAvailability = props => { + const { + sites: enhancedSites, + siteCodes: basicSiteCodes + } = props, + other = _objectWithoutPropertiesLoose(props, _excluded); // Favor enhanced view if we have the enhanced prop return enhancedSites.length ? /*#__PURE__*/_react.default.createElement(_AvailabilityContext.default.Provider, props, /*#__PURE__*/_react.default.createElement(_EnhancedAvailabilityInterface.default, _extends({ @@ -53,6 +54,5 @@ DataProductAvailability.defaultProps = { delineateRelease: false, availabilityStatusType: null }; -var WrappedDataProductAvailability = _Theme.default.getWrappedComponent(_NeonContext.default.getWrappedComponent(DataProductAvailability)); -var _default = WrappedDataProductAvailability; -exports.default = _default; \ No newline at end of file +const WrappedDataProductAvailability = _Theme.default.getWrappedComponent(_NeonContext.default.getWrappedComponent(DataProductAvailability)); +var _default = exports.default = WrappedDataProductAvailability; \ No newline at end of file diff --git a/lib/components/DataProductAvailability/EnhancedAvailabilityGrid.js b/lib/components/DataProductAvailability/EnhancedAvailabilityGrid.js index 36009b07..3bd43dcb 100644 --- a/lib/components/DataProductAvailability/EnhancedAvailabilityGrid.js +++ b/lib/components/DataProductAvailability/EnhancedAvailabilityGrid.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -12,15 +11,9 @@ var _uniqueId = _interopRequireDefault(require("lodash/uniqueId")); var _Theme = _interopRequireWildcard(require("../Theme/Theme")); var _AvailabilityUtils = require("./AvailabilityUtils"); var _AvailabilitySvgComponents = require("./AvailabilitySvgComponents"); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /** * EnhancedAvailabilityGrid generator function * @param {object} config - all arguments, see below: @@ -47,29 +40,24 @@ function EnhancedAvailabilityGrid(config) { /** Extract Config */ - var svgRef = config.svgRef, - _config$rows = config.rows, - rows = _config$rows === void 0 ? {} : _config$rows, - _config$rowLabels = config.rowLabels, - rowLabels = _config$rowLabels === void 0 ? [] : _config$rowLabels, - _config$rowTitles = config.rowTitles, - rowTitles = _config$rowTitles === void 0 ? {} : _config$rowTitles, - _config$sites = config.sites, - sites = _config$sites === void 0 ? { + const { + svgRef, + rows = {}, + rowLabels = [], + rowTitles = {}, + sites = { value: [], validValues: [] - } : _config$sites, - _config$setSitesValue = config.setSitesValue, - setSitesValue = _config$setSitesValue === void 0 ? null : _config$setSitesValue, - _config$dateRange = config.dateRange, - dateRange = _config$dateRange === void 0 ? { + }, + // allSites = {}, + setSitesValue = null, + dateRange = { value: [], validValues: [_AvailabilityUtils.TIME.MIN_YEAR_MONTH, _AvailabilityUtils.TIME.MAX_YEAR_MONTH] - } : _config$dateRange, - _config$setDateRangeV = config.setDateRangeValue, - setDateRangeValue = _config$setDateRangeV === void 0 ? function () {} : _config$setDateRangeV, - _config$selectionEnab = config.selectionEnabled, - selectionEnabled = _config$selectionEnab === void 0 ? true : _config$selectionEnab; + }, + setDateRangeValue = () => {}, + selectionEnabled = true + } = config; /** Sanity Check: svgRef must be a valid ref @@ -88,14 +76,14 @@ function EnhancedAvailabilityGrid(config) { /** Setup: Inputs and Base Values */ - var svg = (0, _d3Selection.select)(svgRef.current); + const svg = (0, _d3Selection.select)(svgRef.current); if (svg.attr('id') === null) { svg.attr('id', "availability-".concat((0, _uniqueId.default)())); } - var svgId = svg.attr('id'); - var svgWidth = parseFloat(svg.attr('width')); - var svgHeight = parseFloat(svg.attr('height')); - var labelWidth = rowLabels[0].length * _AvailabilityUtils.SVG.LABEL_WIDTH_MULTIPLIER + _AvailabilityUtils.SVG.LABEL_WIDTH_RIGHT_BUFFER; + const svgId = svg.attr('id'); + const svgWidth = parseFloat(svg.attr('width')); + const svgHeight = parseFloat(svg.attr('height')); + const labelWidth = rowLabels[0].length * _AvailabilityUtils.SVG.LABEL_WIDTH_MULTIPLIER + _AvailabilityUtils.SVG.LABEL_WIDTH_RIGHT_BUFFER; /** Sanity Check: svg must have discrete numeric dimensions @@ -127,12 +115,12 @@ function EnhancedAvailabilityGrid(config) { /** Setup: Interaction state vars (local vars is all we need here) */ - var rowHoverKey = null; - var draggingCells = false; + let rowHoverKey = null; + let draggingCells = false; /* eslint-disable no-unused-vars */ - var dateRangeHoverKey = null; - var draggingDateRange = [{ + let dateRangeHoverKey = null; + const draggingDateRange = [{ dragging: false, centerDragX: 0 }, { @@ -147,42 +135,34 @@ function EnhancedAvailabilityGrid(config) { feed data to d3 selections in order to only draw what will actually be visible. */ - var getMinTimeOffset = function getMinTimeOffset() { - return 0 - (_AvailabilityUtils.SVG.ABS_MAX_DATA_WIDTH - (svgWidth - labelWidth)); - }; - var getYearStartX = function getYearStartX(year) { - var intYear = parseInt(year, 10); + const getMinTimeOffset = () => 0 - (_AvailabilityUtils.SVG.ABS_MAX_DATA_WIDTH - (svgWidth - labelWidth)); + const getYearStartX = year => { + const intYear = parseInt(year, 10); return labelWidth + _AvailabilityUtils.SVG.END_PADDING + _AvailabilityUtils.TIME.YEARS.indexOf(intYear) * _AvailabilityUtils.SVG.YEAR_WIDTH + _AvailabilityUtils.TIME.YEARS.indexOf(intYear) * _AvailabilityUtils.SVG.YEAR_PADDING; }; - var getYearCenterX = function getYearCenterX(year) { - return getYearStartX(year) + _AvailabilityUtils.SVG.YEAR_WIDTH / 2; - }; - var getYearMonthStartX = function getYearMonthStartX(yearMonth) { - var year = parseInt(yearMonth.substr(0, 4), 10); - var month = parseInt(yearMonth.substr(5, 2), 10); - var yearIdx = _AvailabilityUtils.TIME.YEARS.indexOf(year); + const getYearCenterX = year => getYearStartX(year) + _AvailabilityUtils.SVG.YEAR_WIDTH / 2; + const getYearMonthStartX = yearMonth => { + const year = parseInt(yearMonth.substr(0, 4), 10); + const month = parseInt(yearMonth.substr(5, 2), 10); + const yearIdx = _AvailabilityUtils.TIME.YEARS.indexOf(year); if (yearIdx === -1 || month < 1 || month > 12) { return 0; } return getYearStartX(year) + (month - 1) * _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH; }; - var getYearMonthsInView = function getYearMonthsInView(totalSvgWidth, dragOffset) { - return _AvailabilityUtils.TIME.YEAR_MONTHS.filter(function (yearMonth) { - var tX = getYearMonthStartX(yearMonth) + dragOffset; - var margin = _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH * 4; - var lower = Math.max(0, labelWidth - margin); - var upper = totalSvgWidth + margin; - return tX > lower && tX + _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH < upper; - }); - }; - var getYearsInView = function getYearsInView(totalSvgWidth, dragOffset) { - return _AvailabilityUtils.TIME.YEARS.filter(function (year) { - var tX = getYearStartX(year) + dragOffset; - var lower = -2 * _AvailabilityUtils.SVG.YEAR_WIDTH; - var upper = totalSvgWidth - labelWidth + 2 * _AvailabilityUtils.SVG.YEAR_WIDTH; - return tX > lower && tX + _AvailabilityUtils.SVG.YEAR_WIDTH < upper; - }); - }; + const getYearMonthsInView = (totalSvgWidth, dragOffset) => _AvailabilityUtils.TIME.YEAR_MONTHS.filter(yearMonth => { + const tX = getYearMonthStartX(yearMonth) + dragOffset; + const margin = _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH * 4; + const lower = Math.max(0, labelWidth - margin); + const upper = totalSvgWidth + margin; + return tX > lower && tX + _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH < upper; + }); + const getYearsInView = (totalSvgWidth, dragOffset) => _AvailabilityUtils.TIME.YEARS.filter(year => { + const tX = getYearStartX(year) + dragOffset; + const lower = -2 * _AvailabilityUtils.SVG.YEAR_WIDTH; + const upper = totalSvgWidth - labelWidth + 2 * _AvailabilityUtils.SVG.YEAR_WIDTH; + return tX > lower && tX + _AvailabilityUtils.SVG.YEAR_WIDTH < upper; + }); /** Function to generate the "initial" time offset for first load. By default we may extend the @@ -192,14 +172,14 @@ function EnhancedAvailabilityGrid(config) { right edge, but also keeping full year labels in view (why we target 8 months of the latest year... the right number of months so the year label is not cut off even if the year is empty) */ - var getInitialTimeOffset = function getInitialTimeOffset() { - var minTimeOffset = getMinTimeOffset(); + const getInitialTimeOffset = () => { + const minTimeOffset = getMinTimeOffset(); if (!rows) { return minTimeOffset; } - var availableMonths = []; - var availableMonthsSet = new Set(); - rowLabels.forEach(function (label) { + let availableMonths = []; + const availableMonthsSet = new Set(); + rowLabels.forEach(label => { Object.keys(rows[label]).forEach(availableMonthsSet.add, availableMonthsSet); }); availableMonths = Array.from(availableMonthsSet.values()); @@ -207,11 +187,11 @@ function EnhancedAvailabilityGrid(config) { return minTimeOffset; } availableMonths.sort(); - var latestAvailableYearMonth = availableMonths[availableMonths.length - 1]; - var latestAvailableYearInt = parseInt(latestAvailableYearMonth.substr(0, 4), 10); - var latestAvailableMonthInt = parseInt(latestAvailableYearMonth.substr(5, 2), 10); - var finalMonth = latestAvailableMonthInt <= 6 ? "".concat(latestAvailableYearInt, "-08") : "".concat(latestAvailableYearInt + 1, "-08"); - var ret = Math.max(0 - getYearMonthStartX(finalMonth) - _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH + svgWidth, minTimeOffset); + const latestAvailableYearMonth = availableMonths[availableMonths.length - 1]; + const latestAvailableYearInt = parseInt(latestAvailableYearMonth.substr(0, 4), 10); + const latestAvailableMonthInt = parseInt(latestAvailableYearMonth.substr(5, 2), 10); + const finalMonth = latestAvailableMonthInt <= 6 ? "".concat(latestAvailableYearInt, "-08") : "".concat(latestAvailableYearInt + 1, "-08"); + const ret = Math.max(0 - getYearMonthStartX(finalMonth) - _AvailabilityUtils.SVG.YEAR_MONTH_WIDTH + svgWidth, minTimeOffset); return ret; }; @@ -219,27 +199,23 @@ function EnhancedAvailabilityGrid(config) { Functions to get a translate() string for a data row by index in the sorted rowLabels array */ - var getRowY = function getRowY(idx) { - return _AvailabilityUtils.SVG.CELL_PADDING + (rowLabels.length - idx) * (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING); - }; - var getRowTranslation = function getRowTranslation(d, idx) { - return "translate(0,".concat(getRowY(idx), ")"); - }; + const getRowY = idx => _AvailabilityUtils.SVG.CELL_PADDING + (rowLabels.length - idx) * (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING); + const getRowTranslation = (d, idx) => "translate(0,".concat(getRowY(idx), ")"); /** Main SVG Structure (Layered groups, clip definition, etc.) */ svg.selectAll('*').remove(); - var clipWidth = svgWidth - labelWidth; - var defs = svg.append('defs'); - var labelSelectionsG = svg.append('g').attr('class', 'labelSelectionsG'); - var clipPath = defs.append('clipPath').attr('id', "".concat(svgId, "-clip")); + const clipWidth = svgWidth - labelWidth; + const defs = svg.append('defs'); + const labelSelectionsG = svg.append('g').attr('class', 'labelSelectionsG'); + const clipPath = defs.append('clipPath').attr('id', "".concat(svgId, "-clip")); clipPath.append('rect').attr('x', labelWidth).attr('y', 0).attr('width', clipWidth).attr('height', svgHeight); - var clipG = svg.append('g').attr('class', 'clipG').attr('clip-path', "url(#".concat(svgId, "-clip)")); - var dragG = clipG.append('g').attr('class', 'dragG'); - var rowSelectionsG = dragG.append('g').attr('class', 'rowSelectionsG'); - var dragContentG = dragG.append('g').attr('class', 'dragContentG'); + const clipG = svg.append('g').attr('class', 'clipG').attr('clip-path', "url(#".concat(svgId, "-clip)")); + const dragG = clipG.append('g').attr('class', 'dragG'); + const rowSelectionsG = dragG.append('g').attr('class', 'rowSelectionsG'); + const dragContentG = dragG.append('g').attr('class', 'dragContentG'); /** Time offset values and functions @@ -249,15 +225,15 @@ function EnhancedAvailabilityGrid(config) { has changed, prefer it stays at the minimum). Also keep the offset bounded within where there's actually data to show. */ - var prevMinTimeOffset = getMinTimeOffset(); + let prevMinTimeOffset = getMinTimeOffset(); if (svg.attr('data-prevMinTimeOffset') === null) { svg.attr('data-prevMinTimeOffset', getMinTimeOffset()); } else { prevMinTimeOffset = parseFloat(svg.attr('data-prevMinTimeOffset')); } - var getTimeOffset = function getTimeOffset() { - var minTimeOffset = getMinTimeOffset(); - var currentTimeOffset = parseFloat(svg.attr('data-timeOffset')) || 0; + const getTimeOffset = () => { + const minTimeOffset = getMinTimeOffset(); + let currentTimeOffset = parseFloat(svg.attr('data-timeOffset')) || 0; if (currentTimeOffset === prevMinTimeOffset && prevMinTimeOffset !== minTimeOffset) { currentTimeOffset = minTimeOffset; prevMinTimeOffset = minTimeOffset; @@ -265,8 +241,8 @@ function EnhancedAvailabilityGrid(config) { } return currentTimeOffset; }; - var setTimeOffset = function setTimeOffset(timeOffset) { - var boundedTimeOffset = Math.min(Math.max(getMinTimeOffset(), timeOffset), 0); + const setTimeOffset = timeOffset => { + const boundedTimeOffset = Math.min(Math.max(getMinTimeOffset(), timeOffset), 0); dragG.attr('transform', "translate(".concat(boundedTimeOffset, ",0)")); svg.attr('data-timeOffset', boundedTimeOffset); }; @@ -285,8 +261,8 @@ function EnhancedAvailabilityGrid(config) { // Get the center of the gutter on either side of a given yearMonth INSIDE the clip. // To translate the value to pixels OUTSIDE the clip add the time offset, e.g.: // getYearMonthGutterX('YYYY-MM') + getTimeOffset(); - var getYearMonthGutterX = function getYearMonthGutterX(yearMonth) { - var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'left'; + const getYearMonthGutterX = function (yearMonth) { + let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'left'; switch (side) { case 'left': if (yearMonth === _AvailabilityUtils.TIME.MIN_YEAR_MONTH) { @@ -311,13 +287,13 @@ function EnhancedAvailabilityGrid(config) { // Get the yearMonth string that's next to a given yearMonth on either side. // Stays within the selectable range unless selectable is false, in which case // is stays within the chart's global min and max. - var getAdjacentYearMonth = function getAdjacentYearMonth(yearMonth) { - var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'left'; - var selectable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - var year = parseInt(yearMonth.substr(0, 4), 10); - var month = parseInt(yearMonth.substr(5, 2), 10); - var bounds = selectable ? dateRange.validValues : [_AvailabilityUtils.TIME.MIN_YEAR_MONTH, _AvailabilityUtils.TIME.MAX_YEAR_MONTH]; - var adjacent = yearMonth; + const getAdjacentYearMonth = function (yearMonth) { + let side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'left'; + let selectable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + const year = parseInt(yearMonth.substr(0, 4), 10); + const month = parseInt(yearMonth.substr(5, 2), 10); + const bounds = selectable ? dateRange.validValues : [_AvailabilityUtils.TIME.MIN_YEAR_MONTH, _AvailabilityUtils.TIME.MAX_YEAR_MONTH]; + let adjacent = yearMonth; switch (side) { case 'left': if (month === 1) { @@ -341,18 +317,18 @@ function EnhancedAvailabilityGrid(config) { /** SVG: Row Hover */ - var rowHover = svg.append('rect').attr('class', 'rowHover'); + const rowHover = svg.append('rect').attr('class', 'rowHover'); rowHover.attr('x', 1).attr('y', -2 * _AvailabilityUtils.SVG.CELL_HEIGHT).attr('width', svgWidth - 1).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING).attr('fill', 'none').attr('stroke', _Theme.COLORS.LIGHT_BLUE[700]).attr('stroke-width', '1.5px').style('opacity', 0); /** SVG: Left and Right bounds */ - var lboundOffset = labelWidth + _AvailabilityUtils.SVG.CELL_PADDING / 2 - 1; - var lbound = svg.append('line'); + const lboundOffset = labelWidth + _AvailabilityUtils.SVG.CELL_PADDING / 2 - 1; + const lbound = svg.append('line'); lbound.attr('x1', lboundOffset).attr('y1', 0).attr('x2', lboundOffset).attr('y2', svgHeight); _AvailabilityUtils.SVG_STYLES.apply(lbound, 'timeBound'); - var rboundOffset = svgWidth - 1; - var rbound = svg.append('line'); + const rboundOffset = svgWidth - 1; + const rbound = svg.append('line'); rbound.attr('x1', rboundOffset).attr('y1', 0).attr('x2', rboundOffset).attr('y2', svgHeight); _AvailabilityUtils.SVG_STYLES.apply(rbound, 'timeBound'); @@ -361,7 +337,7 @@ function EnhancedAvailabilityGrid(config) { Create a mapping of current view keys (sites, domains, states, etc.) to selected status (i.e. 'full' or 'partial') */ - var viewSelections = {}; + const viewSelections = {}; // const sitesSet = new Set(sites.value); // const validSitesSet = new Set(sites.validValues); /* @@ -392,7 +368,7 @@ function EnhancedAvailabilityGrid(config) { } */ - var toggleSelection = function toggleSelection() { + const toggleSelection = () => { // console.log(key); /* if (!setSitesValue) { return; } @@ -420,20 +396,20 @@ function EnhancedAvailabilityGrid(config) { setSitesValue([...newSelectedSitesSet]); */ }; - var rowHighlightReset = (0, _lodash.debounce)(function () { - var clearRowHoverKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + const rowHighlightReset = (0, _lodash.debounce)(function () { + let clearRowHoverKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; if (clearRowHoverKey) { rowHoverKey = null; } rowHover.style('opacity', 0); rowHover.attr('y', -2 * _AvailabilityUtils.SVG.CELL_HEIGHT); }, 100); - var rowHighlightHover = function rowHighlightHover(key) { + const rowHighlightHover = key => { rowHoverKey = key; - var offset = rowLabels.indexOf(key); + const offset = rowLabels.indexOf(key); if (offset !== -1 && !draggingCells) { rowHighlightReset.cancel(); - var y = _AvailabilityUtils.SVG.CELL_PADDING / 2 + (rowLabels.length - offset) * (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING); + const y = _AvailabilityUtils.SVG.CELL_PADDING / 2 + (rowLabels.length - offset) * (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING); rowHover.style('opacity', 1); rowHover.attr('y', y); } @@ -442,32 +418,22 @@ function EnhancedAvailabilityGrid(config) { /** SVG: Row Labels */ - var rowLabelsG = svg.append('g').attr('class', 'rowLabelsG'); - rowLabels.forEach(function (label, rowIdx) { - var transform = getRowTranslation(label, rowIdx); - var labelX = labelWidth - _AvailabilityUtils.SVG.CELL_PADDING; - var rowLabelG = rowLabelsG.append('g').attr('transform', transform); - var fill = selectionEnabled && setSitesValue && viewSelections[label] ? _Theme.default.palette.primary.contrastText : _Theme.default.palette.grey[700]; - var text = rowLabelG.append('text').attr('x', labelX).attr('y', _AvailabilityUtils.SVG.LABEL_FONT_SIZE - _AvailabilityUtils.SVG.CELL_PADDING / 2).attr('fill', fill).text(label); + const rowLabelsG = svg.append('g').attr('class', 'rowLabelsG'); + rowLabels.forEach((label, rowIdx) => { + const transform = getRowTranslation(label, rowIdx); + const labelX = labelWidth - _AvailabilityUtils.SVG.CELL_PADDING; + const rowLabelG = rowLabelsG.append('g').attr('transform', transform); + const fill = selectionEnabled && setSitesValue && viewSelections[label] ? _Theme.default.palette.primary.contrastText : _Theme.default.palette.grey[700]; + const text = rowLabelG.append('text').attr('x', labelX).attr('y', _AvailabilityUtils.SVG.LABEL_FONT_SIZE - _AvailabilityUtils.SVG.CELL_PADDING / 2).attr('fill', fill).text(label); _AvailabilityUtils.SVG_STYLES.apply(text, 'rowLabel'); - var mask = rowLabelG.append('rect').attr('x', 0).attr('y', -1 * (_AvailabilityUtils.SVG.CELL_PADDING / 2)).attr('width', labelWidth).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING).on('mouseover', function (event, d) { - return rowHighlightHover(label); - }).on('focus', function (event, d) { - return rowHighlightHover(label); - }).on('mouseout', function (event, d) { - return rowHighlightReset(true); - }).on('blur', function (event, d) { - return rowHighlightReset(true); - }); + const mask = rowLabelG.append('rect').attr('x', 0).attr('y', -1 * (_AvailabilityUtils.SVG.CELL_PADDING / 2)).attr('width', labelWidth).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING).on('mouseover', (event, d) => rowHighlightHover(label)).on('focus', (event, d) => rowHighlightHover(label)).on('mouseout', (event, d) => rowHighlightReset(true)).on('blur', (event, d) => rowHighlightReset(true)); _AvailabilityUtils.SVG_STYLES.apply(mask, 'rowLabelMask'); // Fill the mask and delay the selection to emulate a touch ripple. // Re-render to show the selection will reset the style. - var maskClick = selectionEnabled && setSitesValue ? function (event, d) { + const maskClick = selectionEnabled && setSitesValue ? (event, d) => { _AvailabilityUtils.SVG_STYLES.touchRipple(mask, 15); - setTimeout(function () { - return toggleSelection(label); - }, 15); - } : function (event, d) {}; + setTimeout(() => toggleSelection(label), 15); + } : (event, d) => {}; mask.on('click', maskClick); mask.append('svg:title').text(rowTitles[label]); }); @@ -475,35 +441,25 @@ function EnhancedAvailabilityGrid(config) { /** SVG: Time Axis */ - var timeAxis = {}; + const timeAxis = {}; timeAxis.g = dragContentG.append('g').attr('class', 'timeAxisG'); timeAxis.highlight = timeAxis.g.append('rect').attr('class', 'timeAxisHighlight'); timeAxis.innerG = timeAxis.g.append('g').attr('class', 'timeAxisInnerG'); timeAxis.mask = clipG.append('rect').attr('class', 'timeAxisMask'); - var redrawTimeAxis = function redrawTimeAxis() { + const redrawTimeAxis = () => { if (timeAxis.innerG.selectAll('*').empty()) { timeAxis.highlight.attr('x', labelWidth).attr('y', 0).attr('width', _AvailabilityUtils.SVG.ABS_MAX_DATA_WIDTH).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + 1.5 * _AvailabilityUtils.SVG.CELL_PADDING); _AvailabilityUtils.SVG_STYLES.apply(timeAxis.highlight, 'timeHighlight'); timeAxis.mask.attr('x', labelWidth).attr('y', 0).attr('width', _AvailabilityUtils.SVG.ABS_MAX_DATA_WIDTH).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING); _AvailabilityUtils.SVG_STYLES.apply(timeAxis.mask, 'timeHighlightMask'); } - timeAxis.innerG.selectAll('text').data(function () { - return getYearsInView(svgWidth, getTimeOffset()); - }).join('text').attr('x', function (year) { - return getYearCenterX(year); - }).attr('y', _AvailabilityUtils.SVG.LABEL_FONT_SIZE + 1).text(function (year) { - return year; - }).each(function (year, idx, labelNodes) { + timeAxis.innerG.selectAll('text').data(() => getYearsInView(svgWidth, getTimeOffset())).join('text').attr('x', year => getYearCenterX(year)).attr('y', _AvailabilityUtils.SVG.LABEL_FONT_SIZE + 1).text(year => year).each((year, idx, labelNodes) => { _AvailabilityUtils.SVG_STYLES.apply((0, _d3Selection.select)(labelNodes[idx]), 'timeLabel'); }); - timeAxis.innerG.selectAll('line').data(function () { - var lineYears = getYearsInView(svgWidth, getTimeOffset()); + timeAxis.innerG.selectAll('line').data(() => { + const lineYears = getYearsInView(svgWidth, getTimeOffset()); return lineYears[0] === _AvailabilityUtils.TIME.START_YEAR ? lineYears.slice(1) : lineYears; - }).join('line').attr('x1', function (year) { - return getYearStartX(year) - _AvailabilityUtils.SVG.YEAR_PADDING / 2; - }).attr('y1', 0).attr('x2', function (year) { - return getYearStartX(year) - _AvailabilityUtils.SVG.YEAR_PADDING / 2; - }).attr('y2', svgHeight).each(function (year, idx, lineNodes) { + }).join('line').attr('x1', year => getYearStartX(year) - _AvailabilityUtils.SVG.YEAR_PADDING / 2).attr('y1', 0).attr('x2', year => getYearStartX(year) - _AvailabilityUtils.SVG.YEAR_PADDING / 2).attr('y2', svgHeight).each((year, idx, lineNodes) => { _AvailabilityUtils.SVG_STYLES.apply((0, _d3Selection.select)(lineNodes[idx]), 'timeDivider'); }); }; @@ -511,78 +467,44 @@ function EnhancedAvailabilityGrid(config) { /** SVG: Row Data */ - var dataG = dragContentG.append('g').attr('class', 'dataG'); - var dataMasksG = svg.append('g').attr('class', 'dataMasksG'); - var redrawData = function redrawData() { + const dataG = dragContentG.append('g').attr('class', 'dataG'); + const dataMasksG = svg.append('g').attr('class', 'dataMasksG'); + const redrawData = () => { // Click/drag masks - dataMasksG.selectAll('rect').data(rowLabels).join('rect').attr('x', labelWidth).attr('y', function (d, idx) { - return _AvailabilityUtils.SVG.CELL_PADDING / 2 + (rowLabels.length - idx) * (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING); - }).attr('width', svgWidth - labelWidth).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING).attr('fill', 'transparent').style('cursor', selectionEnabled && setSitesValue ? 'pointer' : 'grab').style('outline', 'none').on('mouseover', function (event, d) { - return rowHighlightHover(d); - }).on('focus', function (event, d) { - return rowHighlightHover(d); - }).on('mouseout', function (event, d) { - return rowHighlightReset(true); - }).on('blur', function (event, d) { - return rowHighlightReset(true); - }).on('click', selectionEnabled && setSitesValue ? function (event, d) { + dataMasksG.selectAll('rect').data(rowLabels).join('rect').attr('x', labelWidth).attr('y', (d, idx) => _AvailabilityUtils.SVG.CELL_PADDING / 2 + (rowLabels.length - idx) * (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING)).attr('width', svgWidth - labelWidth).attr('height', _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING).attr('fill', 'transparent').style('cursor', selectionEnabled && setSitesValue ? 'pointer' : 'grab').style('outline', 'none').on('mouseover', (event, d) => rowHighlightHover(d)).on('focus', (event, d) => rowHighlightHover(d)).on('mouseout', (event, d) => rowHighlightReset(true)).on('blur', (event, d) => rowHighlightReset(true)).on('click', selectionEnabled && setSitesValue ? (event, d) => { _AvailabilityUtils.SVG_STYLES.touchRipple((0, _d3Selection.select)(event.currentTarget), 15); - setTimeout(function () { - return toggleSelection(d); - }, 15); - } : function (event, d) {}); + setTimeout(() => toggleSelection(d), 15); + } : (event, d) => {}); // Cells - dataG.selectAll('g').data(rowLabels).join('g').attr('transform', getRowTranslation).each(function (label, idx, gNodes) { - var rowData = rows[label]; - var getDefaultStatus = function getDefaultStatus(month) { - return month >= _AvailabilityUtils.TIME.CURRENT_MONTH ? 'not expected' : 'not available'; - }; - var getCellAttr = function getCellAttr(month, attr) { - var status = (0, _AvailabilityUtils.calcRollupStatus)(rowData[month]); + dataG.selectAll('g').data(rowLabels).join('g').attr('transform', getRowTranslation).each((label, idx, gNodes) => { + const rowData = rows[label]; + const getDefaultStatus = month => month >= _AvailabilityUtils.TIME.CURRENT_MONTH ? 'not expected' : 'not available'; + const getCellAttr = (month, attr) => { + const status = (0, _AvailabilityUtils.calcRollupStatus)(rowData[month]); return !_AvailabilitySvgComponents.CELL_ATTRS[status] ? _AvailabilitySvgComponents.CELL_ATTRS[getDefaultStatus(month)][attr] || null : _AvailabilitySvgComponents.CELL_ATTRS[status][attr] || null; }; - (0, _d3Selection.select)(gNodes[idx]).selectAll('rect').data(function () { - return getYearMonthsInView(svgWidth, getTimeOffset()); - }).join('rect').attr('x', function (month) { - return getYearMonthStartX(month) + (getCellAttr(month, 'nudge') || 0); - }).attr('y', function (month) { - return getCellAttr(month, 'nudge') || 0; - }).attr('rx', "".concat(_AvailabilityUtils.SVG.CELL_RX, "px")).attr('width', function (month) { - return getCellAttr(month, 'width'); - }).attr('height', function (month) { - return getCellAttr(month, 'height'); - }).attr('fill', function (month) { - return getCellAttr(month, 'fill'); - }).attr('stroke', function (month) { - return getCellAttr(month, 'stroke'); - }).attr('stroke-width', function (month) { - return getCellAttr(month, 'strokeWidth'); - }); + (0, _d3Selection.select)(gNodes[idx]).selectAll('rect').data(() => getYearMonthsInView(svgWidth, getTimeOffset())).join('rect').attr('x', month => getYearMonthStartX(month) + (getCellAttr(month, 'nudge') || 0)).attr('y', month => getCellAttr(month, 'nudge') || 0).attr('rx', "".concat(_AvailabilityUtils.SVG.CELL_RX, "px")).attr('width', month => getCellAttr(month, 'width')).attr('height', month => getCellAttr(month, 'height')).attr('fill', month => getCellAttr(month, 'fill')).attr('stroke', month => getCellAttr(month, 'stroke')).attr('stroke-width', month => getCellAttr(month, 'strokeWidth')); }); }; /** SVG: Date Range Handles */ - var dateRangeHandlesG = selectionEnabled ? dragG.append('g').attr('class', 'dateRangeHandlesG') : null; - var redrawDateRangeHandles = function redrawDateRangeHandles() { + const dateRangeHandlesG = selectionEnabled ? dragG.append('g').attr('class', 'dateRangeHandlesG') : null; + const redrawDateRangeHandles = () => { if (!selectionEnabled) { return; } - var isHighlighted = function isHighlighted(d) { - return dateRangeHoverKey === d || draggingDateRange[d].dragging; - }; - var yBounds = Object.keys(viewSelections).reduce(function (acc, key) { - var y = getRowY(rowLabels.indexOf(key)); - var low = y - _AvailabilityUtils.SVG.CELL_PADDING / 2; - var high = y + _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING / 2; + const isHighlighted = d => dateRangeHoverKey === d || draggingDateRange[d].dragging; + const yBounds = Object.keys(viewSelections).reduce((acc, key) => { + const y = getRowY(rowLabels.indexOf(key)); + const low = y - _AvailabilityUtils.SVG.CELL_PADDING / 2; + const high = y + _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING / 2; return [acc[0] === null || acc[0] > low ? low : acc[0], acc[1] === null || acc[1] < high ? high : acc[1]]; }, [null, null]); - dateRangeHandlesG.selectAll('rect').data([0, 1]).join('rect').attr('class', function (d) { - return "dateRange".concat(d === 0 ? 'Start' : 'End', "HandleRect"); - }).attr('x', function (d) { - var useWidth = isHighlighted(d) ? _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH + 2 : _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH; - var gutterX = getYearMonthGutterX(dateRange.value[d], d === 0 ? 'left' : 'right'); + dateRangeHandlesG.selectAll('rect').data([0, 1]).join('rect').attr('class', d => "dateRange".concat(d === 0 ? 'Start' : 'End', "HandleRect")).attr('x', d => { + const useWidth = isHighlighted(d) ? _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH + 2 : _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH; + const gutterX = getYearMonthGutterX(dateRange.value[d], d === 0 ? 'left' : 'right'); if (d === 0 && dateRange.value[d] === _AvailabilityUtils.TIME.MIN_YEAR_MONTH) { return gutterX; } @@ -590,59 +512,47 @@ function EnhancedAvailabilityGrid(config) { return gutterX - useWidth; } return gutterX - useWidth / 2; - }).attr('width', function (d) { - return isHighlighted(d) ? _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH + 2 : _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH; - }).attr('y', function (d) { + }).attr('width', d => isHighlighted(d) ? _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH + 2 : _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH).attr('y', d => { if (isHighlighted(d)) { return getRowY(rowLabels.length - 1) - _AvailabilityUtils.SVG.CELL_PADDING / 2; } return yBounds[0]; - }).attr('height', function (d) { + }).attr('height', d => { if (isHighlighted(d)) { return svgHeight - getRowY(rowLabels.length - 1) + _AvailabilityUtils.SVG.CELL_PADDING / 2 - 0.5; } return yBounds[1] - yBounds[0]; - }).attr('fill', function (d) { - return isHighlighted(d) ? _Theme.COLORS.LIGHT_BLUE[100] : _Theme.COLORS.LIGHT_BLUE[300]; - }).attr('stroke', _Theme.default.palette.primary.main).style('stroke-width', '1.5px').style('display', sites.value.length ? null : 'none'); + }).attr('fill', d => isHighlighted(d) ? _Theme.COLORS.LIGHT_BLUE[100] : _Theme.COLORS.LIGHT_BLUE[300]).attr('stroke', _Theme.default.palette.primary.main).style('stroke-width', '1.5px').style('display', sites.value.length ? null : 'none'); }; /** SVG: Date Range Masks */ - var dateRangeMasksG = selectionEnabled ? svg.append('g').attr('class', 'dateRangeMasksG') : null; - var redrawDateRangeHandleMasks = function redrawDateRangeHandleMasks() { + const dateRangeMasksG = selectionEnabled ? svg.append('g').attr('class', 'dateRangeMasksG') : null; + const redrawDateRangeHandleMasks = () => { if (!selectionEnabled) { return; } - dateRangeMasksG.selectAll('rect').data([0, 1]).join('rect').attr('class', function (d) { - return "dateRange".concat(d === 0 ? 'Start' : 'End', "MaskRect"); - }).attr('x', function (d) { - return getYearMonthGutterX(dateRange.value[d] || _AvailabilityUtils.TIME.MIN_YEAR_MONTH, d === 0 ? 'left' : 'right') - _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2 + getTimeOffset(); - }).attr('y', 0).attr('width', _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH).attr('height', svgHeight).style('cursor', 'ew-resize').style('outline', 'none').attr('fill', 'red').style('opacity', 0).style('display', sites.value.length ? null : 'none'); + dateRangeMasksG.selectAll('rect').data([0, 1]).join('rect').attr('class', d => "dateRange".concat(d === 0 ? 'Start' : 'End', "MaskRect")).attr('x', d => getYearMonthGutterX(dateRange.value[d] || _AvailabilityUtils.TIME.MIN_YEAR_MONTH, d === 0 ? 'left' : 'right') - _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2 + getTimeOffset()).attr('y', 0).attr('width', _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH).attr('height', svgHeight).style('cursor', 'ew-resize').style('outline', 'none').attr('fill', 'red').style('opacity', 0).style('display', sites.value.length ? null : 'none'); }; /** SVG: Selections */ - var redrawSelections = function redrawSelections() { + const redrawSelections = () => { if (!selectionEnabled) { return; } // Row and label backgrounds - var yOffset = _AvailabilityUtils.SVG.CELL_PADDING / 2; - var yMultiplier = _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING; - var y = function y(d) { - return yOffset + (rowLabels.length - rowLabels.indexOf(d)) * yMultiplier; - }; - var fill = function fill(d) { - return viewSelections[d] === 'full' ? _Theme.default.palette.primary.main : _Theme.COLORS.LIGHT_BLUE[200]; - }; - var startX = getYearMonthGutterX(dateRange.value[0], 'left'); - var endX = getYearMonthGutterX(dateRange.value[1], 'right'); + const yOffset = _AvailabilityUtils.SVG.CELL_PADDING / 2; + const yMultiplier = _AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING; + const y = d => yOffset + (rowLabels.length - rowLabels.indexOf(d)) * yMultiplier; + const fill = d => viewSelections[d] === 'full' ? _Theme.default.palette.primary.main : _Theme.COLORS.LIGHT_BLUE[200]; + let startX = getYearMonthGutterX(dateRange.value[0], 'left'); + let endX = getYearMonthGutterX(dateRange.value[1], 'right'); if (startX > endX) { - var swapX = startX; + const swapX = startX; startX = endX; endX = swapX; } @@ -658,7 +568,7 @@ function EnhancedAvailabilityGrid(config) { /** Redraw functions */ - var redraw = function redraw() { + const redraw = () => { redrawTimeAxis(); redrawData(); if (selectionEnabled) { @@ -676,7 +586,7 @@ function EnhancedAvailabilityGrid(config) { /** Setup Interactions */ - var timeHighlightReset = (0, _lodash.debounce)(function () { + const timeHighlightReset = (0, _lodash.debounce)(() => { if (draggingCells) { return; } @@ -684,26 +594,26 @@ function EnhancedAvailabilityGrid(config) { timeAxis.mask.style('cursor', 'grab'); _AvailabilityUtils.SVG_STYLES.apply(timeAxis.highlight, 'timeHighlight'); }, 100); - var timeHighlightHover = function timeHighlightHover() { + const timeHighlightHover = () => { if (draggingCells) { return; } timeHighlightReset.cancel(); _AvailabilityUtils.SVG_STYLES.apply(timeAxis.highlight, 'timeHighlightHover'); }; - var cellDragTime = null; - var dragCells = (0, _d3Drag.drag)().on('start', function (event, d) { + let cellDragTime = null; + const dragCells = (0, _d3Drag.drag)().on('start', (event, d) => { draggingCells = true; rowHighlightReset(false); dataMasksG.selectAll('rect').style('cursor', 'grabbing'); timeAxis.mask.style('cursor', 'grabbing'); _AvailabilityUtils.SVG_STYLES.apply(timeAxis.highlight, 'timeHighlightDrag'); cellDragTime = new Date().getTime(); - }).on('drag', function (event, d) { + }).on('drag', (event, d) => { setTimeOffset(getTimeOffset() + event.dx); redrawData(); redrawDateRangeHandleMasks(); - }).on('end', function (event, d) { + }).on('end', (event, d) => { draggingCells = false; rowHighlightHover(rowHoverKey); timeHighlightReset(); @@ -713,45 +623,33 @@ function EnhancedAvailabilityGrid(config) { // Perform a select action if selection is enabled to keep the end user happy. =) cellDragTime = new Date().getTime() - cellDragTime; if (selectionEnabled && setSitesValue && cellDragTime < 100) { - _AvailabilityUtils.SVG_STYLES.touchRipple(dataMasksG.selectAll('rect').filter(function (filterD) { - return filterD === rowHoverKey; - }), 15); - setTimeout(function () { - return toggleSelection(rowHoverKey); - }, 15); + _AvailabilityUtils.SVG_STYLES.touchRipple(dataMasksG.selectAll('rect').filter(filterD => filterD === rowHoverKey), 15); + setTimeout(() => toggleSelection(rowHoverKey), 15); } }); dragCells(timeAxis.mask); dragCells(dataMasksG.selectAll('rect')); - timeAxis.mask.on('wheel', function (event, d) { + timeAxis.mask.on('wheel', (event, d) => { event.preventDefault(); - var step = (_AvailabilityUtils.SVG.CELL_WIDTH + _AvailabilityUtils.SVG.CELL_PADDING) * 3; - var delta = (event.wheelDelta > 0 ? -1 : 1) * step; + const step = (_AvailabilityUtils.SVG.CELL_WIDTH + _AvailabilityUtils.SVG.CELL_PADDING) * 3; + const delta = (event.wheelDelta > 0 ? -1 : 1) * step; setTimeOffset(getTimeOffset() + delta); redraw(); redrawDateRangeHandleMasks(); - }).on('mouseover', function (event, d) { - return timeHighlightHover(); - }).on('focus', function (event, d) { - return timeHighlightHover(); - }).on('mouseout', function (event, d) { - return timeHighlightReset(); - }).on('blur', function (event, d) { - return timeHighlightReset(); - }); + }).on('mouseover', (event, d) => timeHighlightHover()).on('focus', (event, d) => timeHighlightHover()).on('mouseout', (event, d) => timeHighlightReset()).on('blur', (event, d) => timeHighlightReset()); if (selectionEnabled) { - var dateRangeHandleReset = (0, _lodash.debounce)(function () { + const dateRangeHandleReset = (0, _lodash.debounce)(() => { dateRangeHoverKey = null; redrawDateRangeHandles(); }, 100); - var dateRangeHandleHover = function dateRangeHandleHover(key) { + const dateRangeHandleHover = key => { dateRangeHoverKey = key; redrawDateRangeHandles(); }; // Function to flip date range handles, masks, and values if a drag event puts start after end // Shift values by one month on each side if flipping as start looks ahead and end looks back - var flipDateRangeSelectionIfNeeded = function flipDateRangeSelectionIfNeeded() { + const flipDateRangeSelectionIfNeeded = () => { if (dateRange.value[1] < dateRange.value[0]) { dateRange.value = [_AvailabilityUtils.TIME.getNextMonth(dateRange.value[1]), _AvailabilityUtils.TIME.getPreviousMonth(dateRange.value[0])]; // Only if the handles are atop each other will this still be true after the last flip. @@ -763,79 +661,63 @@ function EnhancedAvailabilityGrid(config) { }; // Interactions for Date Range START Handle - var dragDateRangeStartMask = dateRangeMasksG.select('.dateRangeStartMaskRect'); - dragDateRangeStartMask.on('mouseover', function (event, d) { - return dateRangeHandleHover(0); - }).on('focus', function (event, d) { - return dateRangeHandleHover(0); - }).on('mouseout', function (event, d) { - return dateRangeHandleReset(); - }).on('blur', function (event, d) { - return dateRangeHandleReset(); - }); - var dragDateRangeStart = (0, _d3Drag.drag)().on('start', function (event, d) { + const dragDateRangeStartMask = dateRangeMasksG.select('.dateRangeStartMaskRect'); + dragDateRangeStartMask.on('mouseover', (event, d) => dateRangeHandleHover(0)).on('focus', (event, d) => dateRangeHandleHover(0)).on('mouseout', (event, d) => dateRangeHandleReset()).on('blur', (event, d) => dateRangeHandleReset()); + const dragDateRangeStart = (0, _d3Drag.drag)().on('start', (event, d) => { draggingDateRange[0].dragging = true; draggingDateRange[0].centerDragX = parseFloat(dragDateRangeStartMask.attr('x'), 10) + _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2; - }).on('drag', function (event, d) { + }).on('drag', (event, d) => { draggingDateRange[0].centerDragX += event.dx; dragDateRangeStartMask.attr('x', draggingDateRange[0].centerDragX - _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2); - var adjacentYearMonth = getAdjacentYearMonth(dateRange.value[0], event.dx > 0 ? 'right' : 'left'); - var adjacentYearMonthStartX = getYearMonthGutterX(adjacentYearMonth, 'left'); - var currentYearMonthStartX = getYearMonthGutterX(dateRange.value[0], 'left'); - var insideClipCenterDragX = draggingDateRange[0].centerDragX - getTimeOffset(); - var distanceToAdjacent = Math.abs(insideClipCenterDragX - adjacentYearMonthStartX); - var distanceToCurrent = Math.abs(insideClipCenterDragX - currentYearMonthStartX); + const adjacentYearMonth = getAdjacentYearMonth(dateRange.value[0], event.dx > 0 ? 'right' : 'left'); + const adjacentYearMonthStartX = getYearMonthGutterX(adjacentYearMonth, 'left'); + const currentYearMonthStartX = getYearMonthGutterX(dateRange.value[0], 'left'); + const insideClipCenterDragX = draggingDateRange[0].centerDragX - getTimeOffset(); + const distanceToAdjacent = Math.abs(insideClipCenterDragX - adjacentYearMonthStartX); + const distanceToCurrent = Math.abs(insideClipCenterDragX - currentYearMonthStartX); if (adjacentYearMonth !== dateRange.value[0] && distanceToAdjacent < distanceToCurrent) { dateRange.value[0] = adjacentYearMonth; redrawSelections(); } - }).on('end', function (event, d) { + }).on('end', (event, d) => { draggingDateRange[0].dragging = false; draggingDateRange[0].centerDragX = 0; // Recenter mask as it is likely off a few pixels due to snap-to-gutter behavior - var maskX = getYearMonthGutterX(dateRange.value[0], 'left') + _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2 + getTimeOffset(); + const maskX = getYearMonthGutterX(dateRange.value[0], 'left') + _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2 + getTimeOffset(); dateRangeMasksG.select('.dateRangeStartMaskRect').attr('x', maskX); flipDateRangeSelectionIfNeeded(); - setDateRangeValue(_toConsumableArray(dateRange.value)); + setDateRangeValue([...dateRange.value]); redrawSelections(); }); dragDateRangeStart(dateRangeMasksG.select('.dateRangeStartMaskRect')); // Interactions for Date Range END Handle - var dragDateRangeEndMask = dateRangeMasksG.select('.dateRangeEndMaskRect'); - dragDateRangeEndMask.on('mouseover', function (event, d) { - return dateRangeHandleHover(1); - }).on('focus', function (event, d) { - return dateRangeHandleHover(1); - }).on('mouseout', function (event, d) { - return dateRangeHandleReset(); - }).on('blur', function (event, d) { - return dateRangeHandleReset(); - }); - var dragDateRangeEnd = (0, _d3Drag.drag)().on('start', function (event, d) { + const dragDateRangeEndMask = dateRangeMasksG.select('.dateRangeEndMaskRect'); + dragDateRangeEndMask.on('mouseover', (event, d) => dateRangeHandleHover(1)).on('focus', (event, d) => dateRangeHandleHover(1)).on('mouseout', (event, d) => dateRangeHandleReset()).on('blur', (event, d) => dateRangeHandleReset()); + const dragDateRangeEnd = (0, _d3Drag.drag)().on('start', (event, d) => { draggingDateRange[1].dragging = true; draggingDateRange[1].centerDragX = parseFloat(dragDateRangeEndMask.attr('x'), 10) + _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2; - }).on('drag', function (event, d) { + }).on('drag', (event, d) => { draggingDateRange[1].centerDragX += event.dx; dragDateRangeEndMask.attr('x', draggingDateRange[1].centerDragX - _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2); - var adjacentYearMonth = getAdjacentYearMonth(dateRange.value[1], event.dx > 0 ? 'right' : 'left'); - var adjacentYearMonthEndX = getYearMonthGutterX(adjacentYearMonth, 'right'); - var currentYearMonthEndX = getYearMonthGutterX(dateRange.value[1], 'right'); - var insideClipCenterDragX = draggingDateRange[1].centerDragX - getTimeOffset(); - var distanceToAdjacent = Math.abs(insideClipCenterDragX - adjacentYearMonthEndX); - var distanceToCurrent = Math.abs(insideClipCenterDragX - currentYearMonthEndX); + const adjacentYearMonth = getAdjacentYearMonth(dateRange.value[1], event.dx > 0 ? 'right' : 'left'); + const adjacentYearMonthEndX = getYearMonthGutterX(adjacentYearMonth, 'right'); + const currentYearMonthEndX = getYearMonthGutterX(dateRange.value[1], 'right'); + const insideClipCenterDragX = draggingDateRange[1].centerDragX - getTimeOffset(); + const distanceToAdjacent = Math.abs(insideClipCenterDragX - adjacentYearMonthEndX); + const distanceToCurrent = Math.abs(insideClipCenterDragX - currentYearMonthEndX); if (adjacentYearMonth !== dateRange.value[1] && distanceToAdjacent < distanceToCurrent) { dateRange.value[1] = adjacentYearMonth; redrawSelections(); } - }).on('end', function (event, d) { + }).on('end', (event, d) => { draggingDateRange[1].dragging = false; draggingDateRange[1].centerDragX = 0; // Recenter mask as it is likely off a few pixels due to snap-to-gutter behavior - var maskX = getYearMonthGutterX(dateRange.value[1], 'right') - _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2 + getTimeOffset(); + const maskX = getYearMonthGutterX(dateRange.value[1], 'right') - _AvailabilityUtils.SVG.DATE_RANGE_MASK_WIDTH / 2 + getTimeOffset(); dateRangeMasksG.select('.dateRangeEndMaskRect').attr('x', maskX); flipDateRangeSelectionIfNeeded(); - setDateRangeValue(_toConsumableArray(dateRange.value)); + setDateRangeValue([...dateRange.value]); redrawSelections(); }); dragDateRangeEnd(dateRangeMasksG.select('.dateRangeEndMaskRect')); diff --git a/lib/components/DataProductAvailability/EnhancedAvailabilityInterface.js b/lib/components/DataProductAvailability/EnhancedAvailabilityInterface.js index 95ba6838..566bd1bb 100644 --- a/lib/components/DataProductAvailability/EnhancedAvailabilityInterface.js +++ b/lib/components/DataProductAvailability/EnhancedAvailabilityInterface.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -27,21 +26,14 @@ var _EnhancedAvailabilityKey = _interopRequireDefault(require("./EnhancedAvailab var _EnhancedAvailabilityGrid = _interopRequireDefault(require("./EnhancedAvailabilityGrid")); var _AvailabilityUtils = require("./AvailabilityUtils"); var _AvailabilitySvgComponents = require("./AvailabilitySvgComponents"); -var _excluded = ["sites"]; +const _excluded = ["sites"]; /* eslint-disable no-unused-vars */ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } -var preStyle = { +const preStyle = { width: '100%', height: '50vh', overflowY: 'scroll', @@ -52,81 +44,78 @@ var preStyle = { /** Setup: CSS classes */ -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - svg: { - minWidth: "".concat(_AvailabilityUtils.SVG.MIN_WIDTH, "px"), - minHeight: "".concat(_AvailabilityUtils.SVG.MIN_HEIGHT, "px") - }, - h6Small: { - fontSize: '0.95rem' - }, - xsSelect: { - height: theme.spacing(4), - '& div': { - padding: _Theme.default.spacing(1, 3, 1, 1.5) - } - }, - sortSelect: { - height: theme.spacing(4), - '& div': { - paddingRight: _Theme.default.spacing(4.5) - }, - marginRight: theme.spacing(2) - }, - viewAndSortOptionsContainer: { - display: 'flex', - alignItems: 'flex-start', - flexWrap: 'wrap', - marginBottom: theme.spacing(3) +const useStyles = (0, _styles.makeStyles)(theme => ({ + svg: { + minWidth: "".concat(_AvailabilityUtils.SVG.MIN_WIDTH, "px"), + minHeight: "".concat(_AvailabilityUtils.SVG.MIN_HEIGHT, "px") + }, + h6Small: { + fontSize: '0.95rem' + }, + xsSelect: { + height: theme.spacing(4), + '& div': { + padding: _Theme.default.spacing(1, 3, 1, 1.5) } - }; -}); -var EnhancedAvailabilityInterface = function EnhancedAvailabilityInterface(props) { - var availabilitySites = props.sites, - other = _objectWithoutProperties(props, _excluded); - var classes = useStyles(_Theme.default); - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - _NeonContext$useNeonC3 = _NeonContext$useNeonC2[0], - neonContextIsFinal = _NeonContext$useNeonC3.isFinal, - neonContextHasError = _NeonContext$useNeonC3.hasError; - var SORT_DIRECTIONS = _AvailabilityContext.default.SORT_DIRECTIONS, - useAvailabilityState = _AvailabilityContext.default.useAvailabilityState; - var _useAvailabilityState = useAvailabilityState(), - _useAvailabilityState2 = _slicedToArray(_useAvailabilityState, 2), - availabilityState = _useAvailabilityState2[0], - availabilityDispatch = _useAvailabilityState2[1]; - var rows = availabilityState.rows, - rowLabels = availabilityState.rowLabels, - rowTitles = availabilityState.rowTitles, - tables = availabilityState.tables, - breakouts = availabilityState.breakouts, - validBreakouts = availabilityState.validBreakouts, - sortDirection = availabilityState.sortDirection; + }, + sortSelect: { + height: theme.spacing(4), + '& div': { + paddingRight: _Theme.default.spacing(4.5) + }, + marginRight: theme.spacing(2) + }, + viewAndSortOptionsContainer: { + display: 'flex', + alignItems: 'flex-start', + flexWrap: 'wrap', + marginBottom: theme.spacing(3) + } +})); +const EnhancedAvailabilityInterface = props => { + const other = _objectWithoutPropertiesLoose(props, _excluded); + const classes = useStyles(_Theme.default); + const [{ + isFinal: neonContextIsFinal, + hasError: neonContextHasError + }] = _NeonContext.default.useNeonContextState(); + const { + SORT_DIRECTIONS, + useAvailabilityState + } = _AvailabilityContext.default; + const [availabilityState, availabilityDispatch] = useAvailabilityState(); + const { + rows, + rowLabels, + rowTitles, + tables, + breakouts, + validBreakouts, + sortDirection + } = availabilityState; /** Context-Derived Stuff */ - var selectionEnabled = false; + const selectionEnabled = false; /** Redraw setup */ - var svgRef = (0, _react.useRef)(null); - var handleSvgRedraw = (0, _react.useCallback)(function () { + const svgRef = (0, _react.useRef)(null); + const handleSvgRedraw = (0, _react.useCallback)(() => { if (!rowLabels.length) { return; } (0, _EnhancedAvailabilityGrid.default)({ - rows: rows, - rowLabels: rowLabels, - rowTitles: rowTitles, - svgRef: svgRef, - selectionEnabled: selectionEnabled + rows, + rowLabels, + rowTitles, + svgRef, + selectionEnabled }); }, [svgRef, rows, rowLabels, rowTitles, selectionEnabled]); - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { handleSvgRedraw(); }); @@ -138,7 +127,7 @@ var EnhancedAvailabilityInterface = function EnhancedAvailabilityInterface(props justify = atXs ? 'start' : 'end'; } */ - var optionDivStyle = { + const optionDivStyle = { display: 'flex', alignItems: 'center', justifyContent: 'flex-start' @@ -154,8 +143,8 @@ var EnhancedAvailabilityInterface = function EnhancedAvailabilityInterface(props /** Render: Breakout Options */ - var renderBreakoutOptions = function renderBreakoutOptions() { - var handleChangeBreakouts = function handleChangeBreakouts(event, newBreakouts) { + const renderBreakoutOptions = () => { + const handleChangeBreakouts = (event, newBreakouts) => { availabilityDispatch({ type: 'setBreakouts', breakouts: newBreakouts @@ -179,97 +168,91 @@ var EnhancedAvailabilityInterface = function EnhancedAvailabilityInterface(props size: "small", value: breakouts, onChange: handleChangeBreakouts - }, validBreakouts.map(function (key) { - return /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - key: key, - value: key, - size: "small" - }, key); - }))); + }, validBreakouts.map(key => /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + key: key, + value: key, + size: "small" + }, key)))); }; /** Render: Sort Options */ - var renderSortOptions = function renderSortOptions() { - return /*#__PURE__*/_react.default.createElement("div", { - style: optionDivStyle, - "data-selenium": "data-product-availability.sort-options" - }, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "h6", - className: classes.h6Small, - style: { - marginRight: _Theme.default.spacing(1.5), - whiteSpace: 'nowrap' - } - }, "Sort By:"), /*#__PURE__*/_react.default.createElement("div", { - style: { - display: 'flex', - justifyContent: 'flex-end' - } - }, /*#__PURE__*/_react.default.createElement(_FormControl.default, { - variant: "outlined" - }, /*#__PURE__*/_react.default.createElement(_Select.default, { - value: breakouts.length ? breakouts[0] : 'n/a', - "aria-label": "Sort By", - className: classes.sortSelect, - onChange: function onChange(event) { - availabilityDispatch({ - type: 'setSortMethod', - method: event.target.value - }); - }, - "data-selenium": "data-product-availability.sort-options.method" - }, /*#__PURE__*/_react.default.createElement(_MenuItem.default, { - key: "--", - value: "n/a", - disabled: true - }, "--"), validBreakouts.map(function (method) { - return /*#__PURE__*/_react.default.createElement(_MenuItem.default, { - key: method, - value: method - }, "".concat(method.substr(0, 1).toUpperCase()).concat(method.substr(1))); - }))), /*#__PURE__*/_react.default.createElement(_ToggleButtonGroup.default, { - exclusive: true, - size: "small", - value: breakouts.length ? sortDirection : null, - onChange: function onChange(event, newSortDirection) { - availabilityDispatch({ - type: 'setSortDirection', - direction: newSortDirection - }); - }, - "data-selenium": "data-product-availability.sort-options.direction" - }, /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - key: SORT_DIRECTIONS.ASC, - value: SORT_DIRECTIONS.ASC, - style: breakouts.length ? null : { - borderColor: 'unset' - }, - disabled: !breakouts.length, - title: "Sort Ascending (A-Z)", - "aria-label": "Sort Ascending (A-Z)" - }, /*#__PURE__*/_react.default.createElement(_KeyboardArrowDown.default, { - fontSize: "small" - })), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - key: SORT_DIRECTIONS.DESC, - value: SORT_DIRECTIONS.DESC, - style: breakouts.length ? null : { - borderColor: 'unset' - }, - disabled: !breakouts.length, - title: "Sort Descending (Z-A)", - "aria-label": "Sort Descending (Z-A)" - }, /*#__PURE__*/_react.default.createElement(_KeyboardArrowUp.default, { - fontSize: "small" - }))))); - }; + const renderSortOptions = () => /*#__PURE__*/_react.default.createElement("div", { + style: optionDivStyle, + "data-selenium": "data-product-availability.sort-options" + }, /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "h6", + className: classes.h6Small, + style: { + marginRight: _Theme.default.spacing(1.5), + whiteSpace: 'nowrap' + } + }, "Sort By:"), /*#__PURE__*/_react.default.createElement("div", { + style: { + display: 'flex', + justifyContent: 'flex-end' + } + }, /*#__PURE__*/_react.default.createElement(_FormControl.default, { + variant: "outlined" + }, /*#__PURE__*/_react.default.createElement(_Select.default, { + value: breakouts.length ? breakouts[0] : 'n/a', + "aria-label": "Sort By", + className: classes.sortSelect, + onChange: event => { + availabilityDispatch({ + type: 'setSortMethod', + method: event.target.value + }); + }, + "data-selenium": "data-product-availability.sort-options.method" + }, /*#__PURE__*/_react.default.createElement(_MenuItem.default, { + key: "--", + value: "n/a", + disabled: true + }, "--"), validBreakouts.map(method => /*#__PURE__*/_react.default.createElement(_MenuItem.default, { + key: method, + value: method + }, "".concat(method.substr(0, 1).toUpperCase()).concat(method.substr(1)))))), /*#__PURE__*/_react.default.createElement(_ToggleButtonGroup.default, { + exclusive: true, + size: "small", + value: breakouts.length ? sortDirection : null, + onChange: (event, newSortDirection) => { + availabilityDispatch({ + type: 'setSortDirection', + direction: newSortDirection + }); + }, + "data-selenium": "data-product-availability.sort-options.direction" + }, /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + key: SORT_DIRECTIONS.ASC, + value: SORT_DIRECTIONS.ASC, + style: breakouts.length ? null : { + borderColor: 'unset' + }, + disabled: !breakouts.length, + title: "Sort Ascending (A-Z)", + "aria-label": "Sort Ascending (A-Z)" + }, /*#__PURE__*/_react.default.createElement(_KeyboardArrowDown.default, { + fontSize: "small" + })), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + key: SORT_DIRECTIONS.DESC, + value: SORT_DIRECTIONS.DESC, + style: breakouts.length ? null : { + borderColor: 'unset' + }, + disabled: !breakouts.length, + title: "Sort Descending (Z-A)", + "aria-label": "Sort Descending (Z-A)" + }, /*#__PURE__*/_react.default.createElement(_KeyboardArrowUp.default, { + fontSize: "small" + }))))); /** Main Render */ - var svgHeight = _AvailabilityUtils.SVG.CELL_PADDING + (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING) * (rowLabels.length + 1); - var rollUpPresent = !(breakouts.includes('sites') && breakouts.includes('tables')); + const svgHeight = _AvailabilityUtils.SVG.CELL_PADDING + (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING) * (rowLabels.length + 1); + const rollUpPresent = !(breakouts.includes('sites') && breakouts.includes('tables')); return /*#__PURE__*/_react.default.createElement(_FullWidthVisualization.default, _extends({ vizRef: svgRef, minWidth: _AvailabilityUtils.SVG.MIN_WIDTH, @@ -305,5 +288,4 @@ EnhancedAvailabilityInterface.defaultProps = { sortDirection: 'ASC', disableSelection: false }; -var _default = EnhancedAvailabilityInterface; -exports.default = _default; \ No newline at end of file +var _default = exports.default = EnhancedAvailabilityInterface; \ No newline at end of file diff --git a/lib/components/DataProductAvailability/EnhancedAvailabilityKey.js b/lib/components/DataProductAvailability/EnhancedAvailabilityKey.js index b5164e18..b0795442 100644 --- a/lib/components/DataProductAvailability/EnhancedAvailabilityKey.js +++ b/lib/components/DataProductAvailability/EnhancedAvailabilityKey.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -19,75 +18,64 @@ var _AvailabilityUtils = require("./AvailabilityUtils"); var _AvailabilitySvgComponents = require("./AvailabilitySvgComponents"); var _Theme = _interopRequireWildcard(require("../Theme/Theme")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* eslint-disable max-len, no-unused-vars, prefer-destructuring */ +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable max-len, no-unused-vars, prefer-destructuring */ /** Setup: CSS classes */ -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - keyContainer: { - display: 'flex', - alignItems: 'flex-start', - justifyContent: 'flex-start', - flexWrap: 'wrap' - }, - keyElement: { - cursor: 'help', - margin: theme.spacing(0, 3, 0.25, 0) - }, - keyElementText: { - textAnchor: 'start', - whiteSpace: 'pre', - fontFamily: '"Cutive Mono","Lucida Console",Monaco,monospace', - fontWeight: 400, - fontSize: "".concat(_AvailabilityUtils.SVG.LABEL_FONT_SIZE, "px"), - fill: _Theme.default.palette.grey[700] - }, - h6Small: { - fontSize: '0.95rem' - } - }; -}); -var ALL_SELECTED_TITLE = 'If the chart is presenting a roll-up (e.g. view by state) then all sites rolled into a given row are selected'; -var SOME_SELECTED_TITLE = 'If the chart is presenting a roll-up (e.g. view by state) then one or more but not all of the sites rolled into a given row are selected'; +const useStyles = (0, _styles.makeStyles)(theme => ({ + keyContainer: { + display: 'flex', + alignItems: 'flex-start', + justifyContent: 'flex-start', + flexWrap: 'wrap' + }, + keyElement: { + cursor: 'help', + margin: theme.spacing(0, 3, 0.25, 0) + }, + keyElementText: { + textAnchor: 'start', + whiteSpace: 'pre', + fontFamily: '"Cutive Mono","Lucida Console",Monaco,monospace', + fontWeight: 400, + fontSize: "".concat(_AvailabilityUtils.SVG.LABEL_FONT_SIZE, "px"), + fill: _Theme.default.palette.grey[700] + }, + h6Small: { + fontSize: '0.95rem' + } +})); +const ALL_SELECTED_TITLE = 'If the chart is presenting a roll-up (e.g. view by state) then all sites rolled into a given row are selected'; +const SOME_SELECTED_TITLE = 'If the chart is presenting a roll-up (e.g. view by state) then one or more but not all of the sites rolled into a given row are selected'; /** Main Function */ function EnhancedAvailabilityKey(props) { - var classes = useStyles(_Theme.default); - var _useState = (0, _react.useState)(false), - _useState2 = _slicedToArray(_useState, 2), - dialogOpen = _useState2[0], - setDialogOpen = _useState2[1]; - var selectionEnabled = props.selectionEnabled, - rollUpPresent = props.rollUpPresent; - var statusSvgHeight = _AvailabilityUtils.SVG.CELL_HEIGHT + 2; - var labelLetterWidth = 8; - var labelY = _AvailabilityUtils.SVG.LABEL_FONT_SIZE - _AvailabilityUtils.SVG.CELL_PADDING + 1; - var statusLabelX = _AvailabilityUtils.SVG.CELL_WIDTH + 2 * _AvailabilityUtils.SVG.CELL_PADDING; + const classes = useStyles(_Theme.default); + const [dialogOpen, setDialogOpen] = (0, _react.useState)(false); + const { + selectionEnabled, + rollUpPresent + } = props; + const statusSvgHeight = _AvailabilityUtils.SVG.CELL_HEIGHT + 2; + const labelLetterWidth = 8; + const labelY = _AvailabilityUtils.SVG.LABEL_FONT_SIZE - _AvailabilityUtils.SVG.CELL_PADDING + 1; + const statusLabelX = _AvailabilityUtils.SVG.CELL_WIDTH + 2 * _AvailabilityUtils.SVG.CELL_PADDING; // Let each element in the key be clickable to open the help dialog. // This is in addition to the help button, but we should still provide aria attributes. - var dialogOpenerProps = { + const dialogOpenerProps = { role: 'button', - onClick: function onClick() { - return setDialogOpen(true); - } + onClick: () => setDialogOpen(true) }; - var statusSvgs = {}; - Object.keys(_AvailabilityUtils.VALID_ENHANCED_STATUSES).forEach(function (status) { - var label = _AvailabilityUtils.VALID_ENHANCED_STATUSES[status].title; - var description = _AvailabilityUtils.VALID_ENHANCED_STATUSES[status].description; - var statusSvgWidth = label.length * labelLetterWidth + statusLabelX; + const statusSvgs = {}; + Object.keys(_AvailabilityUtils.VALID_ENHANCED_STATUSES).forEach(status => { + const label = _AvailabilityUtils.VALID_ENHANCED_STATUSES[status].title; + const description = _AvailabilityUtils.VALID_ENHANCED_STATUSES[status].description; + const statusSvgWidth = label.length * labelLetterWidth + statusLabelX; statusSvgs[status] = /*#__PURE__*/_react.default.createElement("div", _extends({ className: classes.keyElement, title: description @@ -102,26 +90,26 @@ function EnhancedAvailabilityKey(props) { y: labelY }, label))); }); - var renderSelectionElement = function renderSelectionElement(variant) { - var inDialog = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const renderSelectionElement = function (variant) { + let inDialog = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!['all', 'some'].includes(variant)) { return null; } - var selectionSvgHeight = _AvailabilityUtils.SVG.CELL_HEIGHT + 2; - var label = variant === 'all' ? 'All sites selected' : 'Some sites selected'; - var fill = variant === 'all' ? _Theme.default.palette.primary.main : 'url(#partialSelectionPattern)'; - var description = variant === 'all' ? ALL_SELECTED_TITLE : SOME_SELECTED_TITLE; - var selectionWidth = 45; - var selectionLabelX = selectionWidth + 3 * _AvailabilityUtils.SVG.CELL_PADDING; - var selectionSvgWidth = label.length * labelLetterWidth + selectionLabelX; - var handleAttribs = { + const selectionSvgHeight = _AvailabilityUtils.SVG.CELL_HEIGHT + 2; + const label = variant === 'all' ? 'All sites selected' : 'Some sites selected'; + const fill = variant === 'all' ? _Theme.default.palette.primary.main : 'url(#partialSelectionPattern)'; + const description = variant === 'all' ? ALL_SELECTED_TITLE : SOME_SELECTED_TITLE; + const selectionWidth = 45; + const selectionLabelX = selectionWidth + 3 * _AvailabilityUtils.SVG.CELL_PADDING; + const selectionSvgWidth = label.length * labelLetterWidth + selectionLabelX; + const handleAttribs = { width: _AvailabilityUtils.SVG.DATE_RANGE_HANDLE_WIDTH, height: _AvailabilityUtils.SVG.CELL_HEIGHT, fill: _Theme.COLORS.LIGHT_BLUE[300], stroke: _Theme.default.palette.primary.main, strokeWidth: 1.5 }; - var graphic = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("rect", { + const graphic = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("rect", { x: 0.5, y: 1.5, width: selectionWidth, @@ -169,11 +157,12 @@ function EnhancedAvailabilityKey(props) { y: labelY }, label))); }; - var renderDialog = function renderDialog() { - var renderStatus = function renderStatus(status) { - var _VALID_ENHANCED_STATU = _AvailabilityUtils.VALID_ENHANCED_STATUSES[status], - title = _VALID_ENHANCED_STATU.title, - description = _VALID_ENHANCED_STATU.description; + const renderDialog = () => { + const renderStatus = status => { + const { + title, + description + } = _AvailabilityUtils.VALID_ENHANCED_STATUSES[status]; return /*#__PURE__*/_react.default.createElement("div", { style: { marginBottom: _Theme.default.spacing(2.5) @@ -205,9 +194,7 @@ function EnhancedAvailabilityKey(props) { return /*#__PURE__*/_react.default.createElement(_Dialog.default, { open: dialogOpen, maxWidth: "md", - onClose: function onClose() { - return setDialogOpen(false); - }, + onClose: () => setDialogOpen(false), "aria-labelledby": "availability-key-dialog-title" }, /*#__PURE__*/_react.default.createElement("div", { style: { @@ -225,9 +212,7 @@ function EnhancedAvailabilityKey(props) { }, "Data Availability Chart Key")), /*#__PURE__*/_react.default.createElement(_IconButton.default, { title: "Close", "aria-label": "Close", - onClick: function onClick() { - return setDialogOpen(false); - }, + onClick: () => setDialogOpen(false), style: { marginRight: _Theme.default.spacing(1) } @@ -294,9 +279,7 @@ function EnhancedAvailabilityKey(props) { color: "primary", title: "Help - Data Availability Chart Key", "aria-label": "Help - Data Availability Chart Key", - onClick: function onClick() { - return setDialogOpen(true); - }, + onClick: () => setDialogOpen(true), style: { marginLeft: '-3px' } diff --git a/lib/components/DataProductAvailability/SvgPatterns.js b/lib/components/DataProductAvailability/SvgPatterns.js index 1a62d26b..d21420cd 100644 --- a/lib/components/DataProductAvailability/SvgPatterns.js +++ b/lib/components/DataProductAvailability/SvgPatterns.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -9,8 +8,8 @@ exports.default = SvgPatterns; var _react = _interopRequireDefault(require("react")); var _server = _interopRequireDefault(require("react-dom/server")); var _Theme = _interopRequireWildcard(require("../Theme/Theme")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** SVG Patterns @@ -18,7 +17,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de And edited here to be theme-colored. */ -var svgPatternsSrc = { +const svgPatternsSrc = { horizontalStripeSecondaryBlue2: { dim: 8, node: /*#__PURE__*/_react.default.createElement("svg", { @@ -65,11 +64,12 @@ var svgPatternsSrc = { } }; function SvgPatterns() { - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, Object.keys(svgPatternsSrc).map(function (pattern) { - var _svgPatternsSrc$patte = svgPatternsSrc[pattern], - dim = _svgPatternsSrc$patte.dim, - node = _svgPatternsSrc$patte.node; - var base64 = btoa(_server.default.renderToStaticMarkup(node)); + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, Object.keys(svgPatternsSrc).map(pattern => { + const { + dim, + node + } = svgPatternsSrc[pattern]; + const base64 = btoa(_server.default.renderToStaticMarkup(node)); return /*#__PURE__*/_react.default.createElement("pattern", { id: pattern, key: pattern, @@ -85,7 +85,5 @@ function SvgPatterns() { })); })); } -var SvgPatternsString = function SvgPatternsString() { - return _server.default.renderToStaticMarkup(SvgPatterns()); -}; +const SvgPatternsString = () => _server.default.renderToStaticMarkup(SvgPatterns()); exports.SvgPatternsString = SvgPatternsString; \ No newline at end of file diff --git a/lib/components/DataProductAvailability/index.js b/lib/components/DataProductAvailability/index.js index 6c60268c..f7f98f90 100644 --- a/lib/components/DataProductAvailability/index.js +++ b/lib/components/DataProductAvailability/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _DataProductAvailability.default; } }); diff --git a/lib/components/DataThemeIcon/DataThemeIcon.js b/lib/components/DataThemeIcon/DataThemeIcon.js index aa37d0cd..ef55efb6 100644 --- a/lib/components/DataThemeIcon/DataThemeIcon.js +++ b/lib/components/DataThemeIcon/DataThemeIcon.js @@ -13,18 +13,11 @@ var _biogeochemistry = _interopRequireDefault(require("./svg_optimized/biogeoche var _ecohydrology = _interopRequireDefault(require("./svg_optimized/ecohydrology.svg")); var _landcover = _interopRequireDefault(require("./svg_optimized/landcover.svg")); var _organisms = _interopRequireDefault(require("./svg_optimized/organisms.svg")); -var _excluded = ["theme", "size", "avatar", "className"]; +const _excluded = ["theme", "size", "avatar", "className"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } -var dataThemes = { +const dataThemes = { atmosphere: { title: 'Atmosphere', aliases: ['atmos'], @@ -51,23 +44,23 @@ var dataThemes = { src: _organisms.default } }; -var DataThemeIcon = function DataThemeIcon(props) { - var theme = props.theme, - size = props.size, - avatar = props.avatar, - className = props.className, - other = _objectWithoutProperties(props, _excluded); - var dataTheme = dataThemes[theme] || Object.values(dataThemes).find(function (entry) { - return theme === entry.title || entry.aliases.includes(theme); - }); +const DataThemeIcon = props => { + const { + theme, + size, + avatar, + className + } = props, + other = _objectWithoutPropertiesLoose(props, _excluded); + const dataTheme = dataThemes[theme] || Object.values(dataThemes).find(entry => theme === entry.title || entry.aliases.includes(theme)); if (!dataTheme) { return null; } - var elementProps = { + const elementProps = { src: dataTheme.src, alt: dataTheme.title, title: dataTheme.title, - className: className, + className, 'data-selenium': "data-theme-icon.".concat(theme) }; if (avatar) { @@ -88,9 +81,7 @@ var DataThemeIcon = function DataThemeIcon(props) { // Data Themes do not have IDs. In order to support identifying a theme // by its full title, abbreviated name, or other known aliases we build // a full list of all supported aliases here to feed PropTypes. -var dataThemeAliases = [].concat(_toConsumableArray(Object.keys(dataThemes)), _toConsumableArray(Object.values(dataThemes).map(function (theme) { - return theme.aliases.concat(theme.title); -}).flat())); +const dataThemeAliases = [...Object.keys(dataThemes), ...Object.values(dataThemes).map(theme => theme.aliases.concat(theme.title)).flat()]; DataThemeIcon.propTypes = { theme: _propTypes.default.oneOf(dataThemeAliases).isRequired, size: _propTypes.default.number, @@ -102,6 +93,5 @@ DataThemeIcon.defaultProps = { avatar: false, className: null }; -var WrappedDataThemeIcon = _Theme.default.getWrappedComponent(DataThemeIcon); -var _default = WrappedDataThemeIcon; -exports.default = _default; \ No newline at end of file +const WrappedDataThemeIcon = _Theme.default.getWrappedComponent(DataThemeIcon); +var _default = exports.default = WrappedDataThemeIcon; \ No newline at end of file diff --git a/lib/components/DataThemeIcon/index.js b/lib/components/DataThemeIcon/index.js index 566243b1..82595551 100644 --- a/lib/components/DataThemeIcon/index.js +++ b/lib/components/DataThemeIcon/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _DataThemeIcon.default; } }); diff --git a/lib/components/DialogBase/DialogBase.js b/lib/components/DialogBase/DialogBase.js index bd9913ad..7c5c6bac 100644 --- a/lib/components/DialogBase/DialogBase.js +++ b/lib/components/DialogBase/DialogBase.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -18,54 +17,49 @@ var _Toolbar = _interopRequireDefault(require("@material-ui/core/Toolbar")); var _Typography = _interopRequireDefault(require("@material-ui/core/Typography")); var _Close = _interopRequireDefault(require("@material-ui/icons/Close")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); -var _excluded = ["open", "onClose", "title", "toolbarChildren", "children", "closeButtonProps", "customClasses", "nopaper", "style"]; +const _excluded = ["open", "onClose", "title", "toolbarChildren", "children", "closeButtonProps", "customClasses", "nopaper", "style"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -var Transition = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_Slide.default, _extends({ - direction: "up", - ref: ref - }, props)); -}); -var useStyles = function useStyles(belowSm) { - return (0, _styles.makeStyles)(function (theme) { - return { - dialogTitle: { - marginLeft: theme.spacing(2), - flex: 1 - }, - dialogPaper: { - backgroundColor: theme.palette.grey[200], - position: 'relative' - }, - noPaper: { - margin: theme.spacing(10, 2, belowSm ? 9 : 2, 2) - }, - contentPaper: { - margin: theme.spacing(10, 2, belowSm ? 9 : 2, 2), - padding: theme.spacing(3) - } - }; - }); -}; -var DialogBase = function DialogBase(props) { - var belowSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('xs')); - var classes = useStyles(belowSm)(_Theme.default); - var open = props.open, - onClose = props.onClose, - title = props.title, - toolbarChildren = props.toolbarChildren, - children = props.children, - closeButtonProps = props.closeButtonProps, - customClasses = props.customClasses, - nopaper = props.nopaper, - style = props.style, - other = _objectWithoutProperties(props, _excluded); - var appliedPaperClass = customClasses && customClasses.contentPaper ? customClasses.contentPaper : classes.contentPaper; +const Transition = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_Slide.default, _extends({ + direction: "up", + ref: ref +}, props))); +const useStyles = belowSm => (0, _styles.makeStyles)(theme => ({ + dialogTitle: { + marginLeft: theme.spacing(2), + flex: 1 + }, + dialogPaper: { + backgroundColor: theme.palette.grey[200], + position: 'relative' + }, + noPaper: { + margin: theme.spacing(10, 2, belowSm ? 9 : 2, 2) + }, + contentPaper: { + margin: theme.spacing(10, 2, belowSm ? 9 : 2, 2), + padding: theme.spacing(3) + } +})); +const DialogBase = props => { + const belowSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('xs')); + const classes = useStyles(belowSm)(_Theme.default); + const { + open, + onClose, + title, + toolbarChildren, + children, + closeButtonProps, + customClasses, + nopaper, + style + } = props, + other = _objectWithoutPropertiesLoose(props, _excluded); + const appliedPaperClass = customClasses && customClasses.contentPaper ? customClasses.contentPaper : classes.contentPaper; return /*#__PURE__*/_react.default.createElement(_Dialog.default, _extends({ open: open, onClose: onClose, @@ -106,7 +100,6 @@ DialogBase.propTypes = { nopaper: _propTypes.default.bool, style: _propTypes.default.object // eslint-disable-line react/forbid-prop-types }; - DialogBase.defaultProps = { open: true, toolbarChildren: null, @@ -115,5 +108,4 @@ DialogBase.defaultProps = { nopaper: false, style: {} }; -var _default = DialogBase; -exports.default = _default; \ No newline at end of file +var _default = exports.default = DialogBase; \ No newline at end of file diff --git a/lib/components/DialogBase/index.js b/lib/components/DialogBase/index.js index 82402596..75031681 100644 --- a/lib/components/DialogBase/index.js +++ b/lib/components/DialogBase/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _DialogBase.default; } }); diff --git a/lib/components/Documents/DocumentList.js b/lib/components/Documents/DocumentList.js index e9c847b8..2cbb5867 100644 --- a/lib/components/Documents/DocumentList.js +++ b/lib/components/Documents/DocumentList.js @@ -12,23 +12,22 @@ var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _WarningCard = _interopRequireDefault(require("../Card/WarningCard")); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - list: { - paddingTop: muiTheme.spacing(0) - } - }) - ); -}); -var DocumentList = function DocumentList(props) { - var classes = useStyles(_Theme.default); - var documents = props.documents, - makeDownloadableLink = props.makeDownloadableLink, - enableDownloadButton = props.enableDownloadButton, - fetchVariants = props.fetchVariants, - enableVariantChips = props.enableVariantChips; +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + list: { + paddingTop: muiTheme.spacing(0) + } +})); +const DocumentList = props => { + const classes = useStyles(_Theme.default); + const { + documents, + makeDownloadableLink, + enableDownloadButton, + fetchVariants, + enableVariantChips + } = props; if (!(0, _typeUtil.existsNonEmpty)(documents)) { return /*#__PURE__*/_react.default.createElement("div", { className: classes.container @@ -37,24 +36,19 @@ var DocumentList = function DocumentList(props) { message: "No documents available to display" })); } - var renderDocuments = function renderDocuments() { - return documents.map(function (document, index) { - return /*#__PURE__*/_react.default.createElement(_DocumentListItem.default, { - key: document.name, - id: index, - document: document, - makeDownloadableLink: makeDownloadableLink === true, - enableDownloadButton: enableDownloadButton, - fetchVariants: fetchVariants, - enableVariantChips: enableVariantChips - }); - }); - }; + const renderDocuments = () => documents.map((document, index) => /*#__PURE__*/_react.default.createElement(_DocumentListItem.default, { + key: document.name, + id: index, + document: document, + makeDownloadableLink: makeDownloadableLink === true, + enableDownloadButton: enableDownloadButton, + fetchVariants: fetchVariants, + enableVariantChips: enableVariantChips + })); return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_List.default, { dense: true, className: classes.list }, renderDocuments())); }; -var WrappedDocumentList = _Theme.default.getWrappedComponent(DocumentList); -var _default = WrappedDocumentList; -exports.default = _default; \ No newline at end of file +const WrappedDocumentList = _Theme.default.getWrappedComponent(DocumentList); +var _default = exports.default = WrappedDocumentList; \ No newline at end of file diff --git a/lib/components/Documents/DocumentListItem.js b/lib/components/Documents/DocumentListItem.js index be5b7136..66b03d4d 100644 --- a/lib/components/Documents/DocumentListItem.js +++ b/lib/components/Documents/DocumentListItem.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -28,80 +27,69 @@ var _DocumentParser = _interopRequireDefault(require("../../parser/DocumentParse var _DocumentService = _interopRequireDefault(require("../../service/DocumentService")); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -var COMPONENT_XS_UPPER = 480; -var COMPONENT_SM_UPPER = 805; -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return (0, _styles.createStyles)({ - listItemContainer: { - display: 'flex', - overflow: 'auto' - }, - listItem: { - display: 'flex', - wordBreak: 'break-word', - paddingLeft: muiTheme.spacing(1), - '& p': { - marginTop: muiTheme.spacing(0.5), - '& > span > span': { - whiteSpace: 'nowrap' - } - } - }, - listItemSecondarySpacer: { - margin: muiTheme.spacing(0, 2), - color: muiTheme.palette.grey[200] - }, - listItemIcon: { - minWidth: muiTheme.spacing(4), - marginRight: muiTheme.spacing(1) - }, - fileTypeChip: { - marginRight: '5px', - '&:last-child': { - marginRight: '0px' - } - }, - fileTypeChipSelected: { - marginRight: '5px', - fontWeight: 500 - }, - variantFetchingLabel: { - lineHeight: '24px' - }, - variantFetchingProgress: { - marginRight: '36px', - marginLeft: '36px' - }, - downloadErrorContainer: { - marginTop: muiTheme.spacing(2) - } - }); -}); -var useListItemSecondaryActionStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - root: { - display: 'flex', - alignItems: 'center', - position: 'unset', - transform: 'unset', - top: 'unset', - right: 'unset', +const COMPONENT_XS_UPPER = 480; +const COMPONENT_SM_UPPER = 805; +const useStyles = (0, _styles.makeStyles)(muiTheme => (0, _styles.createStyles)({ + listItemContainer: { + display: 'flex', + overflow: 'auto' + }, + listItem: { + display: 'flex', + wordBreak: 'break-word', + paddingLeft: muiTheme.spacing(1), + '& p': { + marginTop: muiTheme.spacing(0.5), + '& > span > span': { whiteSpace: 'nowrap' } - }) - ); -}); + } + }, + listItemSecondarySpacer: { + margin: muiTheme.spacing(0, 2), + color: muiTheme.palette.grey[200] + }, + listItemIcon: { + minWidth: muiTheme.spacing(4), + marginRight: muiTheme.spacing(1) + }, + fileTypeChip: { + marginRight: '5px', + '&:last-child': { + marginRight: '0px' + } + }, + fileTypeChipSelected: { + marginRight: '5px', + fontWeight: 500 + }, + variantFetchingLabel: { + lineHeight: '24px' + }, + variantFetchingProgress: { + marginRight: '36px', + marginLeft: '36px' + }, + downloadErrorContainer: { + marginTop: muiTheme.spacing(2) + } +})); +const useListItemSecondaryActionStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + root: { + display: 'flex', + alignItems: 'center', + position: 'unset', + transform: 'unset', + top: 'unset', + right: 'unset', + whiteSpace: 'nowrap' + } +})); var ActionTypes = /*#__PURE__*/function (ActionTypes) { ActionTypes["FETCH_VARIANTS_STARTED"] = "FETCH_VARIANTS_STARTED"; ActionTypes["FETCH_VARIANTS_FAILED"] = "FETCH_VARIANTS_FAILED"; @@ -112,45 +100,31 @@ var ActionTypes = /*#__PURE__*/function (ActionTypes) { ActionTypes["DOWNLOAD_FAILED"] = "DOWNLOAD_FAILED"; return ActionTypes; }(ActionTypes || {}); -var ActionCreator = { - fetchVariantsStarted: function fetchVariantsStarted() { - return { - type: ActionTypes.FETCH_VARIANTS_STARTED - }; - }, - fetchVariantsFailed: function fetchVariantsFailed(error) { - return { - type: ActionTypes.FETCH_VARIANTS_FAILED, - error: error - }; - }, - fetchVariantsSucceeded: function fetchVariantsSucceeded(variants) { - return { - type: ActionTypes.FETCH_VARIANTS_SUCCEEDED, - variants: variants - }; - }, - setSelectedVariant: function setSelectedVariant(variant) { - return { - type: ActionTypes.SET_SELECTED_VARIANT, - variant: variant - }; - }, - downloadIdle: function downloadIdle() { - return { - type: ActionTypes.DOWNLOAD_IDLE - }; - }, - downloadStarted: function downloadStarted() { - return { - type: ActionTypes.DOWNLOAD_STARTED - }; - }, - downloadFailed: function downloadFailed() { - return { - type: ActionTypes.DOWNLOAD_FAILED - }; - } +const ActionCreator = { + fetchVariantsStarted: () => ({ + type: ActionTypes.FETCH_VARIANTS_STARTED + }), + fetchVariantsFailed: error => ({ + type: ActionTypes.FETCH_VARIANTS_FAILED, + error + }), + fetchVariantsSucceeded: variants => ({ + type: ActionTypes.FETCH_VARIANTS_SUCCEEDED, + variants + }), + setSelectedVariant: variant => ({ + type: ActionTypes.SET_SELECTED_VARIANT, + variant + }), + downloadIdle: () => ({ + type: ActionTypes.DOWNLOAD_IDLE + }), + downloadStarted: () => ({ + type: ActionTypes.DOWNLOAD_STARTED + }), + downloadFailed: () => ({ + type: ActionTypes.DOWNLOAD_FAILED + }) }; var FetchStatus = /*#__PURE__*/function (FetchStatus) { FetchStatus["AWAITING_CALL"] = "AWAITING_CALL"; @@ -160,7 +134,7 @@ var FetchStatus = /*#__PURE__*/function (FetchStatus) { FetchStatus["IDLE"] = "IDLE"; return FetchStatus; }(FetchStatus || {}); -var DEFAULT_STATE = { +const DEFAULT_STATE = { fetchVariants: { status: FetchStatus.IDLE, error: null @@ -169,11 +143,11 @@ var DEFAULT_STATE = { selectedVariant: null, downloadStatus: FetchStatus.IDLE }; -var documentListItemReducer = function documentListItemReducer(state, action) { - var newState = _extends({}, state); - var fetchVariantFailedAction; - var fetchVariantSucceededAction; - var setSelectedVariantAction; +const documentListItemReducer = (state, action) => { + const newState = _extends({}, state); + let fetchVariantFailedAction; + let fetchVariantSucceededAction; + let setSelectedVariantAction; switch (action.type) { case ActionTypes.FETCH_VARIANTS_STARTED: newState.fetchVariants.status = FetchStatus.FETCHING; @@ -209,89 +183,89 @@ var documentListItemReducer = function documentListItemReducer(state, action) { return newState; } }; -var DocumentListItem = function DocumentListItem(props) { - var id = props.id, - document = props.document, - makeDownloadableLink = props.makeDownloadableLink, - enableDownloadButton = props.enableDownloadButton, - fetchVariants = props.fetchVariants, - enableVariantChips = props.enableVariantChips, - containerComponent = props.containerComponent; - var classes = useStyles(_Theme.default); - var listItemSecondaryActionClasses = useListItemSecondaryActionStyles(_Theme.default); - var containerRef = (0, _react.useRef)(); - var _useState = (0, _react.useState)(0), - _useState2 = _slicedToArray(_useState, 2), - componentWidth = _useState2[0], - setComponentWidth = _useState2[1]; - var atComponentXs = false; - var atComponentSm = false; +const DocumentListItem = props => { + const { + id, + document, + makeDownloadableLink, + enableDownloadButton, + fetchVariants, + enableVariantChips, + containerComponent + } = props; + const classes = useStyles(_Theme.default); + const listItemSecondaryActionClasses = useListItemSecondaryActionStyles(_Theme.default); + const containerRef = (0, _react.useRef)(); + const [componentWidth, setComponentWidth] = (0, _react.useState)(0); + let atComponentXs = false; + let atComponentSm = false; if (componentWidth > 0) { atComponentXs = componentWidth <= COMPONENT_XS_UPPER; atComponentSm = componentWidth >= COMPONENT_XS_UPPER && componentWidth < COMPONENT_SM_UPPER; } - var _useReducer = (0, _react.useReducer)(documentListItemReducer, (0, _cloneDeep.default)(DEFAULT_STATE)), - _useReducer2 = _slicedToArray(_useReducer, 2), - state = _useReducer2[0], - dispatch = _useReducer2[1]; - var fetchVariantStatus = state.fetchVariants.status, - stateVariants = state.variants, - stateSelectedVariant = state.selectedVariant, - downloadStatus = state.downloadStatus; - var hasDocument = (0, _typeUtil.exists)(document); - var hasProvidedVariants = hasDocument && (0, _typeUtil.existsNonEmpty)(document.variants); - var isQsg = _DocumentService.default.isQuickStartGuide(document); - var appliedFetchVariants = !hasProvidedVariants && fetchVariants === true; - var requireVariantFetch = isQsg && appliedFetchVariants && fetchVariantStatus === FetchStatus.IDLE; - (0, _react.useEffect)(function () { + const [state, dispatch] = (0, _react.useReducer)(documentListItemReducer, (0, _cloneDeep.default)(DEFAULT_STATE)); + const { + fetchVariants: { + status: fetchVariantStatus + }, + variants: stateVariants, + selectedVariant: stateSelectedVariant, + downloadStatus + } = state; + const hasDocument = (0, _typeUtil.exists)(document); + const hasProvidedVariants = hasDocument && (0, _typeUtil.existsNonEmpty)(document.variants); + const isQsg = _DocumentService.default.isQuickStartGuide(document); + const appliedFetchVariants = !hasProvidedVariants && fetchVariants === true; + const requireVariantFetch = isQsg && appliedFetchVariants && fetchVariantStatus === FetchStatus.IDLE; + (0, _react.useEffect)(() => { if (!hasDocument || !requireVariantFetch) { return; } - var qsgParsedName = _DocumentService.default.parseQuickStartGuideName(document.name); + const qsgParsedName = _DocumentService.default.parseQuickStartGuideName(document.name); if (!(0, _typeUtil.exists)(qsgParsedName)) { return; } - var coercedParsedName = qsgParsedName; - var variantObs = _NeonApi.default.getQuickStartGuideDetailObservable(coercedParsedName.matchedName, coercedParsedName.matchedVersion).pipe((0, _rxjs.map)(function (response) { + const coercedParsedName = qsgParsedName; + const variantObs = _NeonApi.default.getQuickStartGuideDetailObservable(coercedParsedName.matchedName, coercedParsedName.matchedVersion).pipe((0, _rxjs.map)(response => { if (!(0, _typeUtil.exists)(response) || !(0, _typeUtil.exists)(response.data)) { dispatch(ActionCreator.fetchVariantsFailed('Failed to fetch variants')); return (0, _rxjs.of)(false); } - var qsgResponse = _DocumentParser.default.parseQuickStartGuideVersionResponse(response); + const qsgResponse = _DocumentParser.default.parseQuickStartGuideVersionResponse(response); if (!(0, _typeUtil.exists)(qsgResponse)) { dispatch(ActionCreator.fetchVariantsFailed('Failed to fetch variants')); return (0, _rxjs.of)(false); } - var coercedQsgDocumentResponse = qsgResponse; - var qsgDocuments = coercedQsgDocumentResponse.documents; - var variantDocuments = _DocumentService.default.transformQuickStartGuideDocuments(qsgDocuments); + const coercedQsgDocumentResponse = qsgResponse; + const qsgDocuments = coercedQsgDocumentResponse.documents; + const variantDocuments = _DocumentService.default.transformQuickStartGuideDocuments(qsgDocuments); if (!(0, _typeUtil.existsNonEmpty)(variantDocuments)) { dispatch(ActionCreator.fetchVariantsFailed('Failed to fetch variants')); return (0, _rxjs.of)(false); } dispatch(ActionCreator.fetchVariantsSucceeded(variantDocuments)); return (0, _rxjs.of)(true); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { dispatch(ActionCreator.fetchVariantsFailed(error)); return (0, _rxjs.of)(false); })); dispatch(ActionCreator.fetchVariantsStarted()); variantObs.subscribe(); }, [hasDocument, requireVariantFetch, document]); - var handleSelectedVariantChanged = (0, _react.useCallback)(function (selectedVariantCb) { + const handleSelectedVariantChanged = (0, _react.useCallback)(selectedVariantCb => { dispatch(ActionCreator.setSelectedVariant(selectedVariantCb)); }, [dispatch]); - var handleDownloadIdle = (0, _react.useCallback)(function () { + const handleDownloadIdle = (0, _react.useCallback)(() => { dispatch(ActionCreator.downloadIdle()); }, [dispatch]); - var handleDownloadStarted = (0, _react.useCallback)(function () { + const handleDownloadStarted = (0, _react.useCallback)(() => { dispatch(ActionCreator.downloadStarted()); }, [dispatch]); - var handleDownloadFailed = (0, _react.useCallback)(function () { + const handleDownloadFailed = (0, _react.useCallback)(() => { dispatch(ActionCreator.downloadFailed()); }, [dispatch]); - var handleResizeCb = (0, _react.useCallback)(function () { - var container = containerRef.current; + const handleResizeCb = (0, _react.useCallback)(() => { + const container = containerRef.current; if (!container) { return; } @@ -300,21 +274,21 @@ var DocumentListItem = function DocumentListItem(props) { } setComponentWidth(container.clientWidth); }, [containerRef, componentWidth, setComponentWidth]); - (0, _react.useLayoutEffect)(function () { - var element = containerRef.current; + (0, _react.useLayoutEffect)(() => { + const element = containerRef.current; if (!element) { - return function () {}; + return () => {}; } handleResizeCb(); if (typeof ResizeObserver !== 'function') { window.addEventListener('resize', handleResizeCb); - return function () { + return () => { window.removeEventListener('resize', handleResizeCb); }; } - var resizeObserver = new ResizeObserver(handleResizeCb); + let resizeObserver = new ResizeObserver(handleResizeCb); resizeObserver.observe(element); - return function () { + return () => { if (!resizeObserver) { return; } @@ -325,21 +299,23 @@ var DocumentListItem = function DocumentListItem(props) { if (!hasDocument) { return null; } - var isFetchingVariants = fetchVariantStatus === FetchStatus.FETCHING; - var appliedDocument = (0, _typeUtil.exists)(stateSelectedVariant) ? stateSelectedVariant : document; - var appliedVariants = appliedFetchVariants ? stateVariants : document.variants; - var hasAppliedVariants = (0, _typeUtil.existsNonEmpty)(appliedVariants); - var isDownloading = downloadStatus === FetchStatus.FETCHING; - var isDownloadError = downloadStatus === FetchStatus.ERROR; - var documentType = _DocumentService.default.resolveDocumentType(appliedDocument); - var typeTitle = documentType.title, - TypeIcon = documentType.Icon; - var typeTitleString = typeTitle(appliedDocument.type); - var primary = (0, _typeUtil.isStringNonEmpty)(appliedDocument.description) ? appliedDocument.description : /*#__PURE__*/_react.default.createElement("i", null, "No description"); - var spacer = /*#__PURE__*/_react.default.createElement("span", { + const isFetchingVariants = fetchVariantStatus === FetchStatus.FETCHING; + const appliedDocument = (0, _typeUtil.exists)(stateSelectedVariant) ? stateSelectedVariant : document; + const appliedVariants = appliedFetchVariants ? stateVariants : document.variants; + const hasAppliedVariants = (0, _typeUtil.existsNonEmpty)(appliedVariants); + const isDownloading = downloadStatus === FetchStatus.FETCHING; + const isDownloadError = downloadStatus === FetchStatus.ERROR; + const documentType = _DocumentService.default.resolveDocumentType(appliedDocument); + const { + title: typeTitle, + Icon: TypeIcon + } = documentType; + const typeTitleString = typeTitle(appliedDocument.type); + const primary = (0, _typeUtil.isStringNonEmpty)(appliedDocument.description) ? appliedDocument.description : /*#__PURE__*/_react.default.createElement("i", null, "No description"); + const spacer = /*#__PURE__*/_react.default.createElement("span", { className: classes.listItemSecondarySpacer }, "|"); - var renderTypes = function renderTypes() { + const renderTypes = () => { if (!(enableVariantChips === true)) { return /*#__PURE__*/_react.default.createElement("span", { title: "file type: ".concat(typeTitleString) @@ -364,10 +340,10 @@ var DocumentListItem = function DocumentListItem(props) { label: typeTitleString }); } - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, appliedVariants.map(function (variant, index) { - var variantTypeTitleString = _DocumentService.default.getDocumentTypeTitle(variant); - var isSelected = appliedDocument.name === variant.name; - var isLast = index === appliedVariants.length - 1; + return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, appliedVariants.map((variant, index) => { + const variantTypeTitleString = _DocumentService.default.getDocumentTypeTitle(variant); + const isSelected = appliedDocument.name === variant.name; + const isLast = index === appliedVariants.length - 1; return /*#__PURE__*/_react.default.createElement(_Chip.default, { key: variant.name, variant: isSelected ? undefined : 'outlined', @@ -379,20 +355,20 @@ var DocumentListItem = function DocumentListItem(props) { size: "small", label: variantTypeTitleString, disabled: isDownloading || isDownloadError, - onClick: function onClick(event) { + onClick: event => { handleSelectedVariantChanged(variant); } }); })); }; - var renderSecondaryItem = function renderSecondaryItem() { - var sizeDisplay = /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("i", null, "n/a")); + const renderSecondaryItem = () => { + let sizeDisplay = /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("i", null, "n/a")); if (appliedDocument.size) { sizeDisplay = /*#__PURE__*/_react.default.createElement("span", { title: "file size: ".concat(_DocumentService.default.formatBytes(appliedDocument.size)) }, _DocumentService.default.formatBytes(appliedDocument.size)); } - var fileNumber = /*#__PURE__*/_react.default.createElement("span", { + const fileNumber = /*#__PURE__*/_react.default.createElement("span", { style: { whiteSpace: 'break-spaces' }, @@ -421,7 +397,7 @@ var DocumentListItem = function DocumentListItem(props) { } return /*#__PURE__*/_react.default.createElement("span", null, renderTypes(), spacer, sizeDisplay, spacer, fileNumber); }; - var renderAction = function renderAction() { + const renderAction = () => { if (!(enableDownloadButton === true)) return null; if (isFetchingVariants) { return /*#__PURE__*/_react.default.createElement(_ListItemSecondaryAction.default, { @@ -440,13 +416,9 @@ var DocumentListItem = function DocumentListItem(props) { }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_IconButton.default, { color: "primary", disabled: isDownloading || isDownloadError, - onClick: function onClick() { + onClick: () => { handleDownloadStarted(); - _DocumentService.default.downloadDocument(appliedDocument, function (downloadDoc) { - return handleDownloadIdle(); - }, function (downloadDoc) { - return handleDownloadFailed(); - }); + _DocumentService.default.downloadDocument(appliedDocument, downloadDoc => handleDownloadIdle(), downloadDoc => handleDownloadFailed()); } }, isDownloading ? /*#__PURE__*/_react.default.createElement(_CircularProgress.default, { size: 18 @@ -454,7 +426,7 @@ var DocumentListItem = function DocumentListItem(props) { fontSize: "small" }))))); } - var button = !hasAppliedVariants ? /*#__PURE__*/_react.default.createElement(_Button.default, { + const button = !hasAppliedVariants ? /*#__PURE__*/_react.default.createElement(_Button.default, { variant: "outlined", disabled: isDownloading || isDownloadError, startIcon: isDownloading ? /*#__PURE__*/_react.default.createElement(_CircularProgress.default, { @@ -462,37 +434,25 @@ var DocumentListItem = function DocumentListItem(props) { }) : /*#__PURE__*/_react.default.createElement(_SaveAlt.default, { fontSize: "small" }), - onClick: function onClick() { + onClick: () => { handleDownloadStarted(); - _DocumentService.default.downloadDocument(appliedDocument, function (downloadDoc) { - return handleDownloadIdle(); - }, function (downloadDoc) { - return handleDownloadFailed(); - }); + _DocumentService.default.downloadDocument(appliedDocument, downloadDoc => handleDownloadIdle(), downloadDoc => handleDownloadFailed()); } }, "Download") : /*#__PURE__*/_react.default.createElement(_SplitButton.default, { name: "".concat(appliedDocument.name, "-document-list-item-download-split-button"), selectedOption: "".concat(typeTitleString), - selectedOptionDisplayCallback: function selectedOptionDisplayCallback(selectedOption) { - return "Download ".concat(selectedOption); - }, - options: appliedVariants.map(function (variant) { - return _DocumentService.default.getDocumentTypeTitle(variant); - }), - onClick: function onClick(option) { - var nextSelectedVariant = _DocumentService.default.findFirstByDocumentTypeTitle(appliedVariants, option); + selectedOptionDisplayCallback: selectedOption => "Download ".concat(selectedOption), + options: appliedVariants.map(variant => _DocumentService.default.getDocumentTypeTitle(variant)), + onClick: option => { + const nextSelectedVariant = _DocumentService.default.findFirstByDocumentTypeTitle(appliedVariants, option); if ((0, _typeUtil.exists)(nextSelectedVariant)) { - var coercedDownloadVariant = nextSelectedVariant; + const coercedDownloadVariant = nextSelectedVariant; handleDownloadStarted(); - _DocumentService.default.downloadDocument(coercedDownloadVariant, function (downloadDoc) { - return handleDownloadIdle(); - }, function (downloadDoc) { - return handleDownloadFailed(); - }); + _DocumentService.default.downloadDocument(coercedDownloadVariant, downloadDoc => handleDownloadIdle(), downloadDoc => handleDownloadFailed()); } }, - onChange: function onChange(option) { - var nextSelectedVariant = _DocumentService.default.findFirstByDocumentTypeTitle(appliedVariants, option); + onChange: option => { + const nextSelectedVariant = _DocumentService.default.findFirstByDocumentTypeTitle(appliedVariants, option); if ((0, _typeUtil.exists)(nextSelectedVariant)) { handleSelectedVariantChanged(nextSelectedVariant); } @@ -522,15 +482,13 @@ var DocumentListItem = function DocumentListItem(props) { classes: listItemSecondaryActionClasses }, button); }; - var renderDownloadError = function renderDownloadError() { + const renderDownloadError = () => { if (!isDownloadError) return null; return /*#__PURE__*/_react.default.createElement("div", { className: classes.downloadErrorContainer }, /*#__PURE__*/_react.default.createElement(_WarningCard.default, { title: "Document download is currently unavailable for \"".concat(appliedDocument.name, ".\""), - onActionClick: function onActionClick() { - return handleDownloadIdle(); - } + onActionClick: () => handleDownloadIdle() })); }; return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ListItem.default, { @@ -546,13 +504,9 @@ var DocumentListItem = function DocumentListItem(props) { // @ts-ignore , button: makeDownloadableLink, - onClick: !makeDownloadableLink ? undefined : function () { + onClick: !makeDownloadableLink ? undefined : () => { handleDownloadStarted(); - _DocumentService.default.downloadDocument(appliedDocument, function (downloadDoc) { - return handleDownloadIdle(); - }, function (downloadDoc) { - return handleDownloadFailed(); - }); + _DocumentService.default.downloadDocument(appliedDocument, downloadDoc => handleDownloadIdle(), downloadDoc => handleDownloadFailed()); } }, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, { className: classes.listItemIcon @@ -561,6 +515,5 @@ var DocumentListItem = function DocumentListItem(props) { secondary: renderSecondaryItem() }), renderAction()), renderDownloadError()); }; -var WrappedDocumentListItem = _Theme.default.getWrappedComponent(DocumentListItem); -var _default = WrappedDocumentListItem; -exports.default = _default; \ No newline at end of file +const WrappedDocumentListItem = _Theme.default.getWrappedComponent(DocumentListItem); +var _default = exports.default = WrappedDocumentListItem; \ No newline at end of file diff --git a/lib/components/Documents/DocumentSelect.js b/lib/components/Documents/DocumentSelect.js index d6cdb091..9b09e241 100644 --- a/lib/components/Documents/DocumentSelect.js +++ b/lib/components/Documents/DocumentSelect.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -20,43 +19,33 @@ var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _WarningCard = _interopRequireDefault(require("../Card/WarningCard")); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - container: { - width: '100%' - }, - selectContainer: { - width: '100%', - padding: muiTheme.spacing(3, 0) - }, - selectFormControl: { - width: '100%' - } - }) - ); -}); -var DocumentSelect = function DocumentSelect(props) { - var classes = useStyles(_Theme.default); - var documents = props.documents; - var hasDocuments = (0, _typeUtil.existsNonEmpty)(documents); - var initialValue = ''; +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + container: { + width: '100%' + }, + selectContainer: { + width: '100%', + padding: muiTheme.spacing(3, 0) + }, + selectFormControl: { + width: '100%' + } +})); +const DocumentSelect = props => { + const classes = useStyles(_Theme.default); + const { + documents + } = props; + const hasDocuments = (0, _typeUtil.existsNonEmpty)(documents); + let initialValue = ''; if (hasDocuments) { initialValue = documents[0].name; } - var _useState = (0, _react.useState)(initialValue), - _useState2 = _slicedToArray(_useState, 2), - selectedDoc = _useState2[0], - setSelectedDoc = _useState2[1]; + const [selectedDoc, setSelectedDoc] = (0, _react.useState)(initialValue); if (!hasDocuments) { return /*#__PURE__*/_react.default.createElement("div", { className: classes.container @@ -65,18 +54,16 @@ var DocumentSelect = function DocumentSelect(props) { message: "No documents available to display" })); } - var renderSelectedDocument = function renderSelectedDocument() { - var matchedDoc = documents.find(function (doc) { - return (0, _typeUtil.exists)(doc) && (0, _typeUtil.isStringNonEmpty)(doc.name) && doc.name.localeCompare(selectedDoc) === 0; - }); + const renderSelectedDocument = () => { + const matchedDoc = documents.find(doc => (0, _typeUtil.exists)(doc) && (0, _typeUtil.isStringNonEmpty)(doc.name) && doc.name.localeCompare(selectedDoc) === 0); if (!(0, _typeUtil.exists)(matchedDoc)) { return /*#__PURE__*/_react.default.createElement(_WarningCard.default, { title: "Document Not Found", message: "Document could not be found" }); } - var coercedMatchedDoc = matchedDoc; - var fullUrlPath = _DocumentService.default.isQuickStartGuide(coercedMatchedDoc) ? "".concat(_NeonEnvironment.default.getFullApiPath('quickStartGuides')) : "".concat(_NeonEnvironment.default.getFullApiPath('documents')); + const coercedMatchedDoc = matchedDoc; + const fullUrlPath = _DocumentService.default.isQuickStartGuide(coercedMatchedDoc) ? "".concat(_NeonEnvironment.default.getFullApiPath('quickStartGuides')) : "".concat(_NeonEnvironment.default.getFullApiPath('documents')); return /*#__PURE__*/_react.default.createElement(_DocumentViewer.default, { document: coercedMatchedDoc, width: 600, @@ -106,28 +93,23 @@ var DocumentSelect = function DocumentSelect(props) { label: "Select Document to View", "aria-labelledby": "document-select-label", value: selectedDoc, - onChange: function onChange(event) { - var nextDoc = documents.find(function (doc) { - return doc.name.localeCompare(event.target.value) === 0; - }); + onChange: event => { + const nextDoc = documents.find(doc => doc.name.localeCompare(event.target.value) === 0); if ((0, _typeUtil.exists)(nextDoc)) { setSelectedDoc(nextDoc.name); } } - }, documents.map(function (doc, index) { - return /*#__PURE__*/_react.default.createElement(_MenuItem.default, { - key: doc.name, - value: doc.name - }, /*#__PURE__*/_react.default.createElement(_DocumentListItem.default, { - id: index, - document: doc, - makeDownloadableLink: false - })); - })))), /*#__PURE__*/_react.default.createElement(_Grid.default, { + }, documents.map((doc, index) => /*#__PURE__*/_react.default.createElement(_MenuItem.default, { + key: doc.name, + value: doc.name + }, /*#__PURE__*/_react.default.createElement(_DocumentListItem.default, { + id: index, + document: doc, + makeDownloadableLink: false + })))))), /*#__PURE__*/_react.default.createElement(_Grid.default, { item: true, xs: 12 }, renderSelectedDocument()))); }; -var WrappedDocumentSelect = _Theme.default.getWrappedComponent(DocumentSelect); -var _default = WrappedDocumentSelect; -exports.default = _default; \ No newline at end of file +const WrappedDocumentSelect = _Theme.default.getWrappedComponent(DocumentSelect); +var _default = exports.default = WrappedDocumentSelect; \ No newline at end of file diff --git a/lib/components/Documents/DocumentTabs.js b/lib/components/Documents/DocumentTabs.js index 7b31d892..f85a63b2 100644 --- a/lib/components/Documents/DocumentTabs.js +++ b/lib/components/Documents/DocumentTabs.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -17,84 +16,68 @@ var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _WarningCard = _interopRequireDefault(require("../Card/WarningCard")); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - container: { - width: '100%', - display: 'flex', - margin: muiTheme.spacing(0, -0.5, -0.5, -0.5), - flexDirection: 'column' - }, - tabPanels: { - width: '100%', - backgroundColor: '#fff' - }, - tabContentContainer: { - width: '100%', - padding: muiTheme.spacing(3, 3, 3, 3) - } - }) - ); -}); -var useTabsStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - scroller: { - backgroundColor: muiTheme.palette.grey[200] - }, - scrollButtons: { - '&.Mui-disabled': { - opacity: 0.6 - } - } - }) - ); -}); -var useTabStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - root: { - textTransform: 'none', - opacity: 1, - maxWidth: 464 - }, - wrapper: { - display: 'flex', - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'center', - '& svg': { - margin: "".concat(muiTheme.spacing(0, 1, 0, 0), " !important") - } - }, - selected: { - borderBottom: 'none' - } - }) - ); -}); -var DocumentTabs = function DocumentTabs(props) { - var classes = useStyles(_Theme.default); - var tabClasses = useTabStyles(_Theme.default); - var tabsClasses = useTabsStyles(_Theme.default); - var documents = props.documents; - var initialTabIdx = 0; - var _useState = (0, _react.useState)(initialTabIdx), - _useState2 = _slicedToArray(_useState, 2), - selectedTab = _useState2[0], - setSelectedTab = _useState2[1]; +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + container: { + width: '100%', + display: 'flex', + margin: muiTheme.spacing(0, -0.5, -0.5, -0.5), + flexDirection: 'column' + }, + tabPanels: { + width: '100%', + backgroundColor: '#fff' + }, + tabContentContainer: { + width: '100%', + padding: muiTheme.spacing(3, 3, 3, 3) + } +})); +const useTabsStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + scroller: { + backgroundColor: muiTheme.palette.grey[200] + }, + scrollButtons: { + '&.Mui-disabled': { + opacity: 0.6 + } + } +})); +const useTabStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + root: { + textTransform: 'none', + opacity: 1, + maxWidth: 464 + }, + wrapper: { + display: 'flex', + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + '& svg': { + margin: "".concat(muiTheme.spacing(0, 1, 0, 0), " !important") + } + }, + selected: { + borderBottom: 'none' + } +})); +const DocumentTabs = props => { + const classes = useStyles(_Theme.default); + const tabClasses = useTabStyles(_Theme.default); + const tabsClasses = useTabsStyles(_Theme.default); + const { + documents + } = props; + const initialTabIdx = 0; + const [selectedTab, setSelectedTab] = (0, _react.useState)(initialTabIdx); if (!(0, _typeUtil.existsNonEmpty)(documents)) { return /*#__PURE__*/_react.default.createElement("div", { className: classes.container @@ -103,48 +86,44 @@ var DocumentTabs = function DocumentTabs(props) { message: "No documents available to display" })); } - var docTabs = documents.map(function (doc, index) { - return { - document: doc, - index: index - }; - }); - var renderTabs = function renderTabs() { - return /*#__PURE__*/_react.default.createElement(_Tabs.default, { - orientation: "horizontal", - scrollButtons: "on", - variant: "scrollable", - value: selectedTab, - "aria-label": "Document Tabs", - classes: tabsClasses, - onChange: function onChange(event, newTab) { - setSelectedTab(newTab); - }, - TabIndicatorProps: { - style: { - display: 'none' - } + const docTabs = documents.map((doc, index) => ({ + document: doc, + index + })); + const renderTabs = () => /*#__PURE__*/_react.default.createElement(_Tabs.default, { + orientation: "horizontal", + scrollButtons: "on", + variant: "scrollable", + value: selectedTab, + "aria-label": "Document Tabs", + classes: tabsClasses, + onChange: (event, newTab) => { + setSelectedTab(newTab); + }, + TabIndicatorProps: { + style: { + display: 'none' } - }, docTabs.map(function (docTab) { - return /*#__PURE__*/_react.default.createElement(_Tab.default, { - key: docTab.index, - value: docTab.index, - label: /*#__PURE__*/_react.default.createElement(_DocumentListItem.default, { - id: docTab.index, - document: docTab.document, - makeDownloadableLink: false - }), - "aria-label": docTab.document.name, - classes: tabClasses, - id: "document-tabs-tab-".concat(docTab.index), - "aria-controls": "document-tabs-tabpanel-".concat(docTab.index) - }); - })); - }; - var renderTabContent = function renderTabContent(documentTab) { - var document = documentTab.document, - index = documentTab.index; - var fullUrlPath = _DocumentService.default.isQuickStartGuide(document) ? "".concat(_NeonEnvironment.default.getFullApiPath('quickStartGuides')) : "".concat(_NeonEnvironment.default.getFullApiPath('documents')); + } + }, docTabs.map(docTab => /*#__PURE__*/_react.default.createElement(_Tab.default, { + key: docTab.index, + value: docTab.index, + label: /*#__PURE__*/_react.default.createElement(_DocumentListItem.default, { + id: docTab.index, + document: docTab.document, + makeDownloadableLink: false + }), + "aria-label": docTab.document.name, + classes: tabClasses, + id: "document-tabs-tab-".concat(docTab.index), + "aria-controls": "document-tabs-tabpanel-".concat(docTab.index) + }))); + const renderTabContent = documentTab => { + const { + document, + index + } = documentTab; + const fullUrlPath = _DocumentService.default.isQuickStartGuide(document) ? "".concat(_NeonEnvironment.default.getFullApiPath('quickStartGuides')) : "".concat(_NeonEnvironment.default.getFullApiPath('documents')); return /*#__PURE__*/_react.default.createElement("div", { key: index, role: "tabpanel", @@ -160,17 +139,12 @@ var DocumentTabs = function DocumentTabs(props) { fullUrlPath: fullUrlPath })); }; - var renderTabPanels = function renderTabPanels() { - return /*#__PURE__*/_react.default.createElement("div", { - className: classes.tabPanels - }, docTabs.map(function (docTab) { - return renderTabContent(docTab); - })); - }; + const renderTabPanels = () => /*#__PURE__*/_react.default.createElement("div", { + className: classes.tabPanels + }, docTabs.map(docTab => renderTabContent(docTab))); return /*#__PURE__*/_react.default.createElement("div", { className: classes.container }, renderTabs(), renderTabPanels()); }; -var WrappedDocumentTabs = _Theme.default.getWrappedComponent(DocumentTabs); -var _default = WrappedDocumentTabs; -exports.default = _default; \ No newline at end of file +const WrappedDocumentTabs = _Theme.default.getWrappedComponent(DocumentTabs); +var _default = exports.default = WrappedDocumentTabs; \ No newline at end of file diff --git a/lib/components/Documents/DocumentViewer.js b/lib/components/Documents/DocumentViewer.js index e13a1869..3301c28a 100644 --- a/lib/components/Documents/DocumentViewer.js +++ b/lib/components/Documents/DocumentViewer.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -15,60 +14,48 @@ var _WarningCard = _interopRequireDefault(require("../Card/WarningCard")); var _typeUtil = require("../../util/typeUtil"); var _PdfDocumentViewer = _interopRequireDefault(require("./PdfDocumentViewer")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - container: { - width: '100%' - }, - iframe: { - border: 'none' - } - }) - ); -}); -var noop = function noop() {/* NOOP */}; -var breakpoints = [0, 675, 900, 1200]; -var ratios = ['8:11', '3:4', '4:4', '4:3']; -var calcAutoHeight = function calcAutoHeight(width) { - var breakIdx = breakpoints.reduce(function (acc, breakpoint, idx) { - return width >= breakpoint ? idx : acc; - }, 0); - var ratio = /^([\d.]+):([\d.]+)$/.exec(ratios[breakIdx]); - var mult = 4 / 3; +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + container: { + width: '100%' + }, + iframe: { + border: 'none' + } +})); +const noop = () => {/* NOOP */}; +const breakpoints = [0, 675, 900, 1200]; +const ratios = ['8:11', '3:4', '4:4', '4:3']; +const calcAutoHeight = width => { + const breakIdx = breakpoints.reduce((acc, breakpoint, idx) => width >= breakpoint ? idx : acc, 0); + const ratio = /^([\d.]+):([\d.]+)$/.exec(ratios[breakIdx]); + let mult = 4 / 3; if (ratio) { mult = (parseFloat(ratio[2]) || 1) / (parseFloat(ratio[1]) || 1); } return Math.floor(width * mult); }; -var DocumentViewer = function DocumentViewer(props) { - var classes = useStyles(_Theme.default); - var document = props.document, - width = props.width, - fullUrlPath = props.fullUrlPath; - var appliedUrlPath = (0, _typeUtil.isStringNonEmpty)(fullUrlPath) ? fullUrlPath : _NeonEnvironment.default.getFullApiPath('documents'); - var dataUrl = "".concat(appliedUrlPath, "/").concat(document.name, "?inline=true&fallback=html"); - var isViewerDeviceSupported = _DocumentService.default.isViewerDeviceSupported(); - var isPdfViewerSupported = _DocumentService.default.isPdfViewerSupported(document); - var isDocSupported = isViewerDeviceSupported || isPdfViewerSupported; - var containerRef = (0, _react.useRef)(); - var iframeRef = (0, _react.useRef)(); - var _useState = (0, _react.useState)(width), - _useState2 = _slicedToArray(_useState, 2), - viewerWidth = _useState2[0], - setViewerWidth = _useState2[1]; - var handleResizeCb = (0, _react.useCallback)(function () { - var container = containerRef.current; - var iframeElement = iframeRef.current; +const DocumentViewer = props => { + const classes = useStyles(_Theme.default); + const { + document, + width, + fullUrlPath + } = props; + const appliedUrlPath = (0, _typeUtil.isStringNonEmpty)(fullUrlPath) ? fullUrlPath : _NeonEnvironment.default.getFullApiPath('documents'); + const dataUrl = "".concat(appliedUrlPath, "/").concat(document.name, "?inline=true&fallback=html"); + const isViewerDeviceSupported = _DocumentService.default.isViewerDeviceSupported(); + const isPdfViewerSupported = _DocumentService.default.isPdfViewerSupported(document); + const isDocSupported = isViewerDeviceSupported || isPdfViewerSupported; + const containerRef = (0, _react.useRef)(); + const iframeRef = (0, _react.useRef)(); + const [viewerWidth, setViewerWidth] = (0, _react.useState)(width); + const handleResizeCb = (0, _react.useCallback)(() => { + const container = containerRef.current; + const iframeElement = iframeRef.current; if (!container || !iframeElement) { return; } @@ -78,30 +65,30 @@ var DocumentViewer = function DocumentViewer(props) { if (container.clientWidth === viewerWidth) { return; } - var newWidth = container.clientWidth; + const newWidth = container.clientWidth; setViewerWidth(newWidth); iframeElement.setAttribute('width', "".concat(newWidth)); iframeElement.setAttribute('height', "".concat(calcAutoHeight(newWidth))); }, [containerRef, iframeRef, viewerWidth, setViewerWidth]); - (0, _react.useLayoutEffect)(function () { - var element = iframeRef.current; + (0, _react.useLayoutEffect)(() => { + const element = iframeRef.current; if (!element) { return noop; } - var parent = element.parentElement; + const parent = element.parentElement; if (!parent) { return noop; } handleResizeCb(); if (typeof ResizeObserver !== 'function') { window.addEventListener('resize', handleResizeCb); - return function () { + return () => { window.removeEventListener('resize', handleResizeCb); }; } - var resizeObserver = new ResizeObserver(handleResizeCb); + let resizeObserver = new ResizeObserver(handleResizeCb); resizeObserver.observe(parent); - return function () { + return () => { if (!resizeObserver) { return; } @@ -119,7 +106,7 @@ var DocumentViewer = function DocumentViewer(props) { if (!isViewerDeviceSupported && isPdfViewerSupported) { return /*#__PURE__*/_react.default.createElement(_PdfDocumentViewer.default, props); } - var renderObject = function renderObject() { + const renderObject = () => { if (!_DocumentService.default.isViewerSupported(document)) { return /*#__PURE__*/_react.default.createElement(_ErrorCard.default, { title: "Document Error", @@ -144,5 +131,4 @@ var DocumentViewer = function DocumentViewer(props) { DocumentViewer.defaultProps = { fullUrlPath: undefined }; -var _default = DocumentViewer; -exports.default = _default; \ No newline at end of file +var _default = exports.default = DocumentViewer; \ No newline at end of file diff --git a/lib/components/Documents/PdfDocumentViewer.js b/lib/components/Documents/PdfDocumentViewer.js index 40576afb..8bbc2dea 100644 --- a/lib/components/Documents/PdfDocumentViewer.js +++ b/lib/components/Documents/PdfDocumentViewer.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -15,91 +14,76 @@ var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _WarningCard = _interopRequireDefault(require("../Card/WarningCard")); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } // Pull in PDF JS and set up a reference to the worker source -var pdfjs = require('pdfjs-dist/legacy/build/pdf'); +const pdfjs = require('pdfjs-dist/legacy/build/pdf'); // eslint-disable-next-line import/no-webpack-loader-syntax, import/no-unresolved -var PdfjsWorker = require('worker-loader?esModule=false&filename=static/js/workers/[name].[contenthash].js!pdfjs-dist/legacy/build/pdf.worker'); +const PdfjsWorker = require('worker-loader?esModule=false&filename=static/js/workers/[name].[contenthash].js!pdfjs-dist/legacy/build/pdf.worker'); pdfjs.GlobalWorkerOptions.workerPort = new PdfjsWorker(); -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - parentContainer: { - width: '100%' - }, - container: { - width: '100%', - position: 'relative' - }, - pdfViewerContainer: { - position: 'absolute', - top: 0, - left: 0, - overflow: 'auto', - backgroundColor: 'rgb(82, 86, 89, 0.9)', - '& .pdfViewer > .page': { - margin: '20px', - boxShadow: "0px 2px 1px -1px rgb(0 0 0 / 20%),\n 0px 1px 1px 0px rgb(0 0 0 / 14%),\n 0px 1px 3px 0px rgb(0 0 0 / 12%)" - } - } - }) - ); -}); -var noop = function noop() {/* NOOP */}; -var MIN_PDF_VIEWER_WIDTH = 800; -var breakpoints = [0, 675, 900, 1200]; -var ratios = ['8:11', '3:4', '4:4', '4:3']; -var calcAutoHeight = function calcAutoHeight(width) { - var breakIdx = breakpoints.reduce(function (acc, breakpoint, idx) { - return width >= breakpoint ? idx : acc; - }, 0); - var ratio = /^([\d.]+):([\d.]+)$/.exec(ratios[breakIdx]); - var mult = 4 / 3; +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + parentContainer: { + width: '100%' + }, + container: { + width: '100%', + position: 'relative' + }, + pdfViewerContainer: { + position: 'absolute', + top: 0, + left: 0, + overflow: 'auto', + backgroundColor: 'rgb(82, 86, 89, 0.9)', + '& .pdfViewer > .page': { + margin: '20px', + boxShadow: "0px 2px 1px -1px rgb(0 0 0 / 20%),\n 0px 1px 1px 0px rgb(0 0 0 / 14%),\n 0px 1px 3px 0px rgb(0 0 0 / 12%)" + } + } +})); +const noop = () => {/* NOOP */}; +const MIN_PDF_VIEWER_WIDTH = 800; +const breakpoints = [0, 675, 900, 1200]; +const ratios = ['8:11', '3:4', '4:4', '4:3']; +const calcAutoHeight = width => { + const breakIdx = breakpoints.reduce((acc, breakpoint, idx) => width >= breakpoint ? idx : acc, 0); + const ratio = /^([\d.]+):([\d.]+)$/.exec(ratios[breakIdx]); + let mult = 4 / 3; if (ratio) { mult = (parseFloat(ratio[2]) || 1) / (parseFloat(ratio[1]) || 1); } return Math.floor(width * mult); }; -var PdfDocumentViewer = function PdfDocumentViewer(props) { - var classes = useStyles(_Theme.default); - var document = props.document, - width = props.width, - fullUrlPath = props.fullUrlPath; - var appliedUrlPath = (0, _typeUtil.isStringNonEmpty)(fullUrlPath) ? fullUrlPath : _NeonEnvironment.default.getFullApiPath('documents'); - var dataUrl = "".concat(appliedUrlPath, "/").concat(document.name, "?inline=true&fallback=html"); - var containerRef = (0, _react.useRef)(); - var pdfContainerRef = (0, _react.useRef)(); - var pdfViewerRef = (0, _react.useRef)(); - var _useState = (0, _react.useState)(width), - _useState2 = _slicedToArray(_useState, 2), - viewerWidth = _useState2[0], - setViewerWidth = _useState2[1]; - var _useState3 = (0, _react.useState)(false), - _useState4 = _slicedToArray(_useState3, 2), - isErrorState = _useState4[0], - setIsErrorState = _useState4[1]; - var handleResizeCb = (0, _react.useCallback)(function () { - var container = containerRef.current; - var pdfContainerElement = pdfContainerRef.current; +const PdfDocumentViewer = props => { + const classes = useStyles(_Theme.default); + const { + document, + width, + fullUrlPath + } = props; + const appliedUrlPath = (0, _typeUtil.isStringNonEmpty)(fullUrlPath) ? fullUrlPath : _NeonEnvironment.default.getFullApiPath('documents'); + const dataUrl = "".concat(appliedUrlPath, "/").concat(document.name, "?inline=true&fallback=html"); + const containerRef = (0, _react.useRef)(); + const pdfContainerRef = (0, _react.useRef)(); + const pdfViewerRef = (0, _react.useRef)(); + const [viewerWidth, setViewerWidth] = (0, _react.useState)(width); + const [isErrorState, setIsErrorState] = (0, _react.useState)(false); + const handleResizeCb = (0, _react.useCallback)(() => { + const container = containerRef.current; + const pdfContainerElement = pdfContainerRef.current; if (!container || !pdfContainerElement) { return; } - var parent = container.parentElement; + const parent = container.parentElement; if (!parent) { return; } if (parent.clientWidth === viewerWidth) { return; } - var newWidth = parent.clientWidth; + const newWidth = parent.clientWidth; setViewerWidth(newWidth); container.style.width = "".concat(newWidth, "px"); container.style.height = "".concat(calcAutoHeight(newWidth), "px"); @@ -109,28 +93,28 @@ var PdfDocumentViewer = function PdfDocumentViewer(props) { pdfViewerRef.current.currentScaleValue = 'page-width'; } }, [containerRef, pdfContainerRef, viewerWidth, setViewerWidth]); - var handleSetErrorStateCb = (0, _react.useCallback)(function (isErrorStateCb) { + const handleSetErrorStateCb = (0, _react.useCallback)(isErrorStateCb => { setIsErrorState(isErrorStateCb); }, [setIsErrorState]); - (0, _react.useLayoutEffect)(function () { - var element = containerRef.current; + (0, _react.useLayoutEffect)(() => { + const element = containerRef.current; if (!element) { return noop; } - var parent = element.parentElement; + const parent = element.parentElement; if (!parent) { return noop; } handleResizeCb(); if (typeof ResizeObserver !== 'function') { window.addEventListener('resize', handleResizeCb); - return function () { + return () => { window.removeEventListener('resize', handleResizeCb); }; } - var resizeObserver = new ResizeObserver(handleResizeCb); + let resizeObserver = new ResizeObserver(handleResizeCb); resizeObserver.observe(parent); - return function () { + return () => { if (!resizeObserver) { return; } @@ -138,44 +122,44 @@ var PdfDocumentViewer = function PdfDocumentViewer(props) { resizeObserver = null; }; }, [containerRef, handleResizeCb]); - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (isErrorState) { return; } - var pdfContainerElement = pdfContainerRef.current; + const pdfContainerElement = pdfContainerRef.current; if (!pdfContainerElement) { return; } - var config = { + const config = { url: dataUrl }; - var eventBus = new PDFJSViewer.EventBus(); - var pdfLinkServiceOptions = { - eventBus: eventBus + const eventBus = new PDFJSViewer.EventBus(); + const pdfLinkServiceOptions = { + eventBus }; - var pdfLinkService = new PDFJSViewer.PDFLinkService(pdfLinkServiceOptions); - var pdfViewerOptions = { + const pdfLinkService = new PDFJSViewer.PDFLinkService(pdfLinkServiceOptions); + const pdfViewerOptions = { container: pdfContainerElement, linkService: pdfLinkService, l10n: PDFJSViewer.NullL10n, textLayerMode: 0, - eventBus: eventBus + eventBus }; pdfViewerRef.current = new PDFJSViewer.PDFViewer(pdfViewerOptions); pdfLinkService.setViewer(pdfViewerRef.current); - eventBus.on('pagesinit', function () { + eventBus.on('pagesinit', () => { if (pdfViewerRef.current) { pdfViewerRef.current.currentScaleValue = 'page-width'; } }); - var loadingTask = pdfjs.getDocument(config); - loadingTask.promise.then(function (doc) { + const loadingTask = pdfjs.getDocument(config); + loadingTask.promise.then(doc => { if (pdfViewerRef.current) { pdfViewerRef.current.setDocument(doc); } pdfLinkService.setDocument(doc, null); handleSetErrorStateCb(false); - }, function (reason) { + }, reason => { // eslint-disable-next-line no-console console.error("Error during ".concat(dataUrl, " loading: ").concat(reason)); handleSetErrorStateCb(true); @@ -211,5 +195,4 @@ var PdfDocumentViewer = function PdfDocumentViewer(props) { PdfDocumentViewer.defaultProps = { fullUrlPath: undefined }; -var _default = PdfDocumentViewer; -exports.default = _default; \ No newline at end of file +var _default = exports.default = PdfDocumentViewer; \ No newline at end of file diff --git a/lib/components/Documents/index.js b/lib/components/Documents/index.js index 766966d6..3d641ab7 100644 --- a/lib/components/Documents/index.js +++ b/lib/components/Documents/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _DocumentViewer.default; } }); diff --git a/lib/components/DownloadDataButton/DownloadDataButton.js b/lib/components/DownloadDataButton/DownloadDataButton.js index 48b695ae..08a77296 100644 --- a/lib/components/DownloadDataButton/DownloadDataButton.js +++ b/lib/components/DownloadDataButton/DownloadDataButton.js @@ -11,51 +11,37 @@ var _Button = _interopRequireDefault(require("@material-ui/core/Button")); var _SaveAlt = _interopRequireDefault(require("@material-ui/icons/SaveAlt")); var _DownloadDataContext = _interopRequireDefault(require("../DownloadDataContext/DownloadDataContext")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); -var _excluded = ["label"]; +const _excluded = ["label"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -var DownloadDataDialog = /*#__PURE__*/_react.default.lazy(function () { - return Promise.resolve().then(function () { - return _interopRequireWildcard(require('../DownloadDataDialog/DownloadDataDialog')); - }); -}); -var useStyles = (0, _styles.makeStyles)(function () { - return { - gtmCaptureButton: { - '& span': { - pointerEvents: 'none' - } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const DownloadDataDialog = /*#__PURE__*/_react.default.lazy(() => Promise.resolve().then(() => _interopRequireWildcard(require('../DownloadDataDialog/DownloadDataDialog')))); +const useStyles = (0, _styles.makeStyles)(() => ({ + gtmCaptureButton: { + '& span': { + pointerEvents: 'none' } - }; -}); -var DownloadDataButton = function DownloadDataButton(props) { - var label = props.label, - other = _objectWithoutProperties(props, _excluded); - var classes = useStyles(); - var _DownloadDataContext$ = _DownloadDataContext.default.useDownloadDataState(), - _DownloadDataContext$2 = _slicedToArray(_DownloadDataContext$, 2), - _DownloadDataContext$3 = _DownloadDataContext$2[0], - dialogOpen = _DownloadDataContext$3.dialogOpen, - productData = _DownloadDataContext$3.productData, - dispatch = _DownloadDataContext$2[1]; + } +})); +const DownloadDataButton = props => { + const { + label + } = props, + other = _objectWithoutPropertiesLoose(props, _excluded); + const classes = useStyles(); + const [{ + dialogOpen, + productData + }, dispatch] = _DownloadDataContext.default.useDownloadDataState(); function handleOpenDialog() { dispatch({ type: 'setDialogOpen', open: true }); } - var gtmProps = {}; + const gtmProps = {}; if ((productData || {}).productCode) { gtmProps.className = classes.gtmCaptureButton; gtmProps['data-gtm-product-code'] = productData.productCode; @@ -78,6 +64,5 @@ DownloadDataButton.propTypes = { DownloadDataButton.defaultProps = { label: 'Download Data' }; -var WrappedDownloadDataButton = _Theme.default.getWrappedComponent(DownloadDataButton); -var _default = WrappedDownloadDataButton; -exports.default = _default; \ No newline at end of file +const WrappedDownloadDataButton = _Theme.default.getWrappedComponent(DownloadDataButton); +var _default = exports.default = WrappedDownloadDataButton; \ No newline at end of file diff --git a/lib/components/DownloadDataButton/index.js b/lib/components/DownloadDataButton/index.js index ac212342..905a587d 100644 --- a/lib/components/DownloadDataButton/index.js +++ b/lib/components/DownloadDataButton/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _DownloadDataButton.default; } }); diff --git a/lib/components/DownloadDataContext/DownloadDataContext.js b/lib/components/DownloadDataContext/DownloadDataContext.js index 9be02c9c..b827346f 100644 --- a/lib/components/DownloadDataContext/DownloadDataContext.js +++ b/lib/components/DownloadDataContext/DownloadDataContext.js @@ -18,26 +18,15 @@ var _ReleaseService = _interopRequireDefault(require("../../service/ReleaseServi var _StateStorageConverter = require("./StateStorageConverter"); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } /* eslint-disable max-len, no-unused-vars */ // eslint-disable-next-line import/no-cycle -var ALL_POSSIBLE_VALID_DATE_RANGE = ['2010-01', (0, _moment.default)().format('YYYY-MM')]; -var ALL_POSSIBLE_VALID_DOCUMENTATION = ['include', 'exclude']; -var ALL_POSSIBLE_VALID_PACKAGE_TYPE = ['basic', 'expanded']; -var ALL_POSSIBLE_VALID_PROVISIONAL_DATA = ['include', 'exclude']; -var AVAILABILITY_VIEW_MODES = ['summary', 'sites', 'states', 'domains']; -var ALL_STEPS = { +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable max-len, no-unused-vars */ // eslint-disable-next-line import/no-cycle +const ALL_POSSIBLE_VALID_DATE_RANGE = ['2010-01', (0, _moment.default)().format('YYYY-MM')]; +const ALL_POSSIBLE_VALID_DOCUMENTATION = ['include', 'exclude']; +const ALL_POSSIBLE_VALID_PACKAGE_TYPE = ['basic', 'expanded']; +const ALL_POSSIBLE_VALID_PROVISIONAL_DATA = ['include', 'exclude']; +const AVAILABILITY_VIEW_MODES = ['summary', 'sites', 'states', 'domains']; +const ALL_STEPS = { documentation: { requiredStateKeys: ['documentation'], label: 'Documentation', @@ -82,7 +71,7 @@ var ALL_STEPS = { // For required steps isComplete can be a boolean or null. // If boolean will be interpreted as requiring validated user interaction. // If null will be interpreted as purely informational and completion does not apply. -var DEFAULT_REQUIRED_STEPS = [{ +const DEFAULT_REQUIRED_STEPS = [{ key: 'sitesAndDateRange', isComplete: false }, { @@ -101,7 +90,7 @@ var DEFAULT_REQUIRED_STEPS = [{ key: 'summary', isComplete: null }]; -var DEFAULT_STATE = { +const DEFAULT_STATE = { downloadContextIsActive: true, broadcast: false, dialogOpen: false, @@ -169,23 +158,23 @@ var DEFAULT_STATE = { isValid: false }, dateRange: { - value: [].concat(ALL_POSSIBLE_VALID_DATE_RANGE), - validValues: [].concat(ALL_POSSIBLE_VALID_DATE_RANGE), + value: [...ALL_POSSIBLE_VALID_DATE_RANGE], + validValues: [...ALL_POSSIBLE_VALID_DATE_RANGE], isValid: false }, documentation: { value: 'include', - validValues: [].concat(ALL_POSSIBLE_VALID_DOCUMENTATION), + validValues: [...ALL_POSSIBLE_VALID_DOCUMENTATION], isValid: true }, packageType: { value: null, - validValues: [].concat(ALL_POSSIBLE_VALID_PACKAGE_TYPE), + validValues: [...ALL_POSSIBLE_VALID_PACKAGE_TYPE], isValid: false }, provisionalData: { value: 'exclude', - validValues: [].concat(ALL_POSSIBLE_VALID_PROVISIONAL_DATA), + validValues: [...ALL_POSSIBLE_VALID_PROVISIONAL_DATA], isValid: true }, policies: { @@ -196,18 +185,18 @@ var DEFAULT_STATE = { }; // State keys that have a common { value, validValues, isValid } shape and can be validated -var VALIDATABLE_STATE_KEYS = ['release', 'sites', 'dateRange', 'documentation', 'packageType', 'provisionalData', 's3Files', 'policies']; +const VALIDATABLE_STATE_KEYS = ['release', 'sites', 'dateRange', 'documentation', 'packageType', 'provisionalData', 's3Files', 'policies']; // State keys that can be transfered between contexts through higher order state // (must be a subset of VALIDATABLE_STATE_KEYS) -var HIGHER_ORDER_TRANSFERABLE_STATE_KEYS = ['release', 'sites', 'dateRange']; +const HIGHER_ORDER_TRANSFERABLE_STATE_KEYS = ['release', 'sites', 'dateRange']; // State keys that should trigger a new manifest (file size estimate) request when updated // (must be a subset of VALIDATABLE_STATE_KEYS) -var MANIFEST_TRIGGERING_STATE_KEYS = ['release', 'sites', 'dateRange', 'documentation', 'packageType', 'provisionalData']; +const MANIFEST_TRIGGERING_STATE_KEYS = ['release', 'sites', 'dateRange', 'documentation', 'packageType', 'provisionalData']; // Regexes and associated capture group names for parse s3 file names and URLs -var S3_PATTERN = { +const S3_PATTERN = { name: { regex: /^([\w\\(\\)._-]+)\.(\w+)$/, groups: ['name', 'type'] @@ -220,46 +209,44 @@ var S3_PATTERN = { // VALIDATOR FUNCTIONS // Naive check, replace with a more robust JSON schema check -var productDataIsValid = function productDataIsValid(productData) { - if (_typeof(productData) !== 'object' || productData === null || typeof productData.productName !== 'string') { +const productDataIsValid = productData => { + if (typeof productData !== 'object' || productData === null || typeof productData.productName !== 'string') { return false; } - var hasSiteCodes = Array.isArray(productData.siteCodes); + const hasSiteCodes = Array.isArray(productData.siteCodes); if (!hasSiteCodes) { - var externalHost = _ExternalHost.default.getByProductCode(productData.productCode); + const externalHost = _ExternalHost.default.getByProductCode(productData.productCode); if ((0, _typeUtil.exists)(externalHost)) { - var externalHostProduct = _ExternalHost.default.getProductSpecificInfo(productData.productCode); + const externalHostProduct = _ExternalHost.default.getProductSpecificInfo(productData.productCode); return (0, _typeUtil.exists)(externalHostProduct) && externalHostProduct.allowNoAvailability === true; } } return hasSiteCodes; }; -var yearMonthIsValid = function yearMonthIsValid() { - var yearMonth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; +const yearMonthIsValid = function () { + let yearMonth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; if (typeof yearMonth !== 'string') { return false; } - var match = yearMonth.match(/^([\d]{4})-([\d]{2})$/); + const match = yearMonth.match(/^([\d]{4})-([\d]{2})$/); if (!match) { return false; } - var year = parseInt(match[1], 10); - var month = parseInt(match[2], 10); - var maxYear = new Date().getFullYear() + 1; + const year = parseInt(match[1], 10); + const month = parseInt(match[2], 10); + const maxYear = new Date().getFullYear() + 1; return year >= 2010 && year <= maxYear && month >= 1 && month <= 12; }; // Check whether a new state value is "allowable" - as in it may not be *valid* // to build a manifest, but it can be applied to state as components that use // this state to render a form will render it correctly. -var newStateIsAllowable = function newStateIsAllowable(key, value) { +const newStateIsAllowable = (key, value) => { switch (key) { case 'release': return value === null || typeof value === 'string' && value.length > 0; case 'sites': - return Array.isArray(value) && value.every(function (site) { - return typeof site === 'string' && /^[A-Z]{4}$/.test(site); - }); + return Array.isArray(value) && value.every(site => typeof site === 'string' && /^[A-Z]{4}$/.test(site)); case 'dateRange': return Array.isArray(value) && value.length === 2 && yearMonthIsValid(value[0]) && yearMonthIsValid(value[1]) && value[0] >= ALL_POSSIBLE_VALID_DATE_RANGE[0] && value[1] <= ALL_POSSIBLE_VALID_DATE_RANGE[1] && value[0] <= value[1]; case 'documentation': @@ -269,9 +256,7 @@ var newStateIsAllowable = function newStateIsAllowable(key, value) { case 'provisionalData': return ALL_POSSIBLE_VALID_PROVISIONAL_DATA.includes(value) || value === null; case 's3Files': - return Array.isArray(value) && value.every(function (id) { - return typeof id === 'string'; - }); + return Array.isArray(value) && value.every(id => typeof id === 'string'); case 'policies': return value === true; default: @@ -281,47 +266,39 @@ var newStateIsAllowable = function newStateIsAllowable(key, value) { // Check whether a new state value is "valid" - as in it is within the requirements // to be used in building a download manifest. -var newStateIsValid = function newStateIsValid(key, value) { - var validValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; +const newStateIsValid = function (key, value) { + let validValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; if (!VALIDATABLE_STATE_KEYS.includes(key)) { return false; } - var idList = {}; + const idList = {}; switch (key) { case 'sites': - return newStateIsAllowable(key, value) && Array.isArray(validValues) && value.length > 0 && value.every(function (site) { - return validValues.includes(site); - }); + return newStateIsAllowable(key, value) && Array.isArray(validValues) && value.length > 0 && value.every(site => validValues.includes(site)); case 'dateRange': return newStateIsAllowable(key, value) && newStateIsAllowable(key, validValues) && value[0] >= validValues[0] && value[1] <= validValues[1]; case 's3Files': - if (!Array.isArray(validValues) || !validValues.length || !validValues.every(function (f) { - return _typeof(f) === 'object' && f !== null && typeof f.url === 'string' && f.url.length; - })) { + if (!Array.isArray(validValues) || !validValues.length || !validValues.every(f => typeof f === 'object' && f !== null && typeof f.url === 'string' && f.url.length)) { return false; } - validValues.forEach(function (fileObj) { + validValues.forEach(fileObj => { idList[fileObj.url] = true; }); - return newStateIsAllowable(key, value) && value.length > 0 && value.every(function (id) { - return idList[id] || false; - }); + return newStateIsAllowable(key, value) && value.length > 0 && value.every(id => idList[id] || false); default: return newStateIsAllowable(key, value) && (!Array.isArray(validValues) || validValues.includes(value)); } }; -var mutateNewStateIntoRange = function mutateNewStateIntoRange(key, value) { - var validValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; +const mutateNewStateIntoRange = function (key, value) { + let validValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; if (newStateIsValid(key, value, validValues)) { return value; } - var valueIsAllowable = newStateIsAllowable(key, value); - var valueIsDefault = false; + const valueIsAllowable = newStateIsAllowable(key, value); + let valueIsDefault = false; switch (key) { case 'sites': - return valueIsAllowable ? value.filter(function (site) { - return validValues.includes(site); - }) : []; + return valueIsAllowable ? value.filter(site => validValues.includes(site)) : []; case 'dateRange': valueIsDefault = valueIsAllowable && value[0] === ALL_POSSIBLE_VALID_DATE_RANGE[0] && value[1] === ALL_POSSIBLE_VALID_DATE_RANGE[1]; return valueIsAllowable || valueIsDefault ? [value[0] < validValues[0] ? validValues[0] : value[0], value[1] > validValues[1] ? validValues[1] : value[1]] : validValues; @@ -333,41 +310,35 @@ var mutateNewStateIntoRange = function mutateNewStateIntoRange(key, value) { // Estimate a POST body size from a sile list and sites list for s3Files-based // downloads. Numbers here are based on the current POST API and what it requires // for form data keys, which is excessively verbose. -var estimatePostSize = function estimatePostSize(s3FilesState, sitesState) { - var baseLength = 300; - var sitesLength = sitesState.value.length * 62; - var filesLength = s3FilesState.value.reduce(function (a, b) { - return a + encodeURIComponent(b).length + 58; - }, 0); +const estimatePostSize = (s3FilesState, sitesState) => { + const baseLength = 300; + const sitesLength = sitesState.value.length * 62; + const filesLength = s3FilesState.value.reduce((a, b) => a + encodeURIComponent(b).length + 58, 0); return baseLength + sitesLength + filesLength; }; // GETTER FUNCTIONS -var getValidValuesFromProductData = function getValidValuesFromProductData(productData, key) { +const getValidValuesFromProductData = (productData, key) => { switch (key) { case 'release': - return (productData.releases || []).map(function (r) { - return r.release; - }) || []; + return (productData.releases || []).map(r => r.release) || []; case 'sites': - return (productData.siteCodes || []).map(function (s) { - return s.siteCode; - }) || []; + return (productData.siteCodes || []).map(s => s.siteCode) || []; case 'dateRange': - return (productData.siteCodes || []).reduce(function (acc, site) { + return (productData.siteCodes || []).reduce((acc, site) => { if (!Array.isArray(site.availableMonths) || !site.availableMonths.length) { return acc; } - var start = site.availableMonths[0]; - var end = site.availableMonths[site.availableMonths.length - 1]; + const start = site.availableMonths[0]; + const end = site.availableMonths[site.availableMonths.length - 1]; return [acc[0] === null || acc[0] > start ? start : acc[0], acc[1] === null || acc[1] < end ? end : acc[1]]; }, [null, null]); case 'documentation': - return [].concat(ALL_POSSIBLE_VALID_DOCUMENTATION); + return [...ALL_POSSIBLE_VALID_DOCUMENTATION]; case 'packageType': - return [].concat(ALL_POSSIBLE_VALID_PACKAGE_TYPE); + return [...ALL_POSSIBLE_VALID_PACKAGE_TYPE]; case 'provisionalData': - return [].concat(ALL_POSSIBLE_VALID_PROVISIONAL_DATA); + return [...ALL_POSSIBLE_VALID_PROVISIONAL_DATA]; case 'policies': return null; default: @@ -378,45 +349,43 @@ var getValidValuesFromProductData = function getValidValuesFromProductData(produ // Build initial state from props by first deriving valid values from // product data (where appropriate) and then mutating prop values into // range of valid values where appropriate. -var getInitialStateFromProps = function getInitialStateFromProps(props) { +const getInitialStateFromProps = props => { // Handle base product data - var productData = props.productData, - availabilityView = props.availabilityView, - release = props.release; + const { + productData, + availabilityView, + release + } = props; if (!productDataIsValid(productData)) { return _extends({}, DEFAULT_STATE, { - availabilityView: availabilityView, + availabilityView, requiredSteps: [] }); } - var initialState = _extends({}, DEFAULT_STATE, { - availabilityView: availabilityView, - productData: productData + const initialState = _extends({}, DEFAULT_STATE, { + availabilityView, + productData }); - var isAOPPipeline = ['productScienceTeam', 'productScienceTeamAbbr'].some(function (key) { - return typeof productData[key] === 'string' && productData[key].includes('AOP'); - }) && (productData.productPublicationFormatType || '').includes('AOP'); + const isAOPPipeline = ['productScienceTeam', 'productScienceTeamAbbr'].some(key => typeof productData[key] === 'string' && productData[key].includes('AOP')) && (productData.productPublicationFormatType || '').includes('AOP'); // Pull the latest release from productData if (productData.releases && productData.releases.length) { - var sortedReleases = _toConsumableArray(productData.releases).sort(function (a, b) { - return a.generationDate > b.generationDate ? -1 : 1; - }); + const sortedReleases = [...productData.releases].sort((a, b) => a.generationDate > b.generationDate ? -1 : 1); initialState.latestRelease = sortedReleases[0].release; } // Set required steps and data download origin booleans // Note that a data product can come from the NEON manifest AND an external host - var requiredSteps = [].concat(DEFAULT_REQUIRED_STEPS); - var fromManifest = true; - var fromAOPManifest = false; - var fromExternalHost = false; - var externalHost = _ExternalHost.default.getByProductCode(productData.productCode); - var externalHostProduct = _ExternalHost.default.getProductSpecificInfo(productData.productCode); + let requiredSteps = [...DEFAULT_REQUIRED_STEPS]; + let fromManifest = true; + let fromAOPManifest = false; + let fromExternalHost = false; + const externalHost = _ExternalHost.default.getByProductCode(productData.productCode); + const externalHostProduct = _ExternalHost.default.getProductSpecificInfo(productData.productCode); if (externalHost) { fromExternalHost = true; - var allowNoAvailability = externalHostProduct.allowNoAvailability === true; - var useExternalExclusiveData = externalHost.hostType === _ExternalHost.default.HOST_TYPES.EXCLUSIVE_DATA || allowNoAvailability && !(0, _typeUtil.existsNonEmpty)(productData.siteCodes); + const allowNoAvailability = externalHostProduct.allowNoAvailability === true; + const useExternalExclusiveData = externalHost.hostType === _ExternalHost.default.HOST_TYPES.EXCLUSIVE_DATA || allowNoAvailability && !(0, _typeUtil.existsNonEmpty)(productData.siteCodes); if (useExternalExclusiveData) { fromManifest = false; requiredSteps = [{ @@ -448,34 +417,24 @@ var getInitialStateFromProps = function getInitialStateFromProps(props) { }]; } // Remove package type step if product does not offer expanded data - if (productData.productHasExpanded === false && requiredSteps.some(function (step) { - return step.key === 'packageType'; - })) { - requiredSteps.splice(requiredSteps.findIndex(function (step) { - return step.key === 'packageType'; - }), 1); + if (productData.productHasExpanded === false && requiredSteps.some(step => step.key === 'packageType')) { + requiredSteps.splice(requiredSteps.findIndex(step => step.key === 'packageType'), 1); } // Remove provisional data step if release specified and is not a non-release - var hasRelease = (0, _typeUtil.isStringNonEmpty)(release); - var excludeProvisionalStep = hasRelease && !_ReleaseService.default.isNonRelease(release); - var hasProvisionalDataStep = requiredSteps.some(function (step) { - return step.key === 'provisionalData'; - }); - var hasProvisionalData = false; + const hasRelease = (0, _typeUtil.isStringNonEmpty)(release); + const excludeProvisionalStep = hasRelease && !_ReleaseService.default.isNonRelease(release); + const hasProvisionalDataStep = requiredSteps.some(step => step.key === 'provisionalData'); + let hasProvisionalData = false; if ((0, _typeUtil.exists)(productData) && (0, _typeUtil.existsNonEmpty)(productData.siteCodes)) { - hasProvisionalData = productData.siteCodes.some(function (siteCode) { + hasProvisionalData = productData.siteCodes.some(siteCode => { if (!(0, _typeUtil.existsNonEmpty)(siteCode.availableReleases)) { return false; } - return siteCode.availableReleases.some(function (availableRelease) { - return _ReleaseService.default.isProv(availableRelease.release) && (0, _typeUtil.existsNonEmpty)(availableRelease.availableMonths); - }); + return siteCode.availableReleases.some(availableRelease => _ReleaseService.default.isProv(availableRelease.release) && (0, _typeUtil.existsNonEmpty)(availableRelease.availableMonths)); }); } if (hasProvisionalDataStep && excludeProvisionalStep || hasProvisionalDataStep && !hasProvisionalData) { - requiredSteps.splice(requiredSteps.findIndex(function (step) { - return step.key === 'provisionalData'; - }), 1); + requiredSteps.splice(requiredSteps.findIndex(step => step.key === 'provisionalData'), 1); } initialState.requiredSteps = requiredSteps; initialState.fromManifest = fromManifest; @@ -483,23 +442,23 @@ var getInitialStateFromProps = function getInitialStateFromProps(props) { initialState.fromExternalHost = fromExternalHost; // Set all validatable state keys - VALIDATABLE_STATE_KEYS.forEach(function (key) { - var validValues = getValidValuesFromProductData(productData, key); - var unmutatedValue = props[key] || DEFAULT_STATE[key].value; - var value = mutateNewStateIntoRange(key, unmutatedValue, validValues); - var isValid = newStateIsValid(key, value, validValues); + VALIDATABLE_STATE_KEYS.forEach(key => { + const validValues = getValidValuesFromProductData(productData, key); + const unmutatedValue = props[key] || DEFAULT_STATE[key].value; + const value = mutateNewStateIntoRange(key, unmutatedValue, validValues); + const isValid = newStateIsValid(key, value, validValues); initialState[key] = _extends({}, DEFAULT_STATE[key], { - value: value, - validValues: validValues, - isValid: isValid + value, + validValues, + isValid }); }); // If AOP then initialize all s3FileFetches from props // ('notRequested' by default, 'awaitingFetchCall' if site + date is already in selection) if (isAOPPipeline) { - initialState.s3FileFetches = productData.siteCodes.reduce(function (acc, site) { - site.availableMonths.forEach(function (month) { + initialState.s3FileFetches = productData.siteCodes.reduce((acc, site) => { + site.availableMonths.forEach(month => { acc["".concat(site.siteCode, ".").concat(month)] = initialState.sites.value.includes(site.siteCode) && initialState.dateRange.value[0] <= month && initialState.dateRange.value[1] >= month ? 'awaitingFetchCall' : 'notRequested'; }); return acc; @@ -507,67 +466,51 @@ var getInitialStateFromProps = function getInitialStateFromProps(props) { } // Mark completed steps from initial values - initialState.requiredSteps.forEach(function (step, idx) { + initialState.requiredSteps.forEach((step, idx) => { if (initialState.requiredSteps[idx].isComplete === null) { return; } - initialState.requiredSteps[idx].isComplete = ALL_STEPS[step.key] && ALL_STEPS[step.key].requiredStateKeys.every(function (key) { - return initialState[key].isValid; - }); + initialState.requiredSteps[idx].isComplete = ALL_STEPS[step.key] && ALL_STEPS[step.key].requiredStateKeys.every(key => initialState[key].isValid); }); // Set allStepsComplete boolean. Ignore steps where isComplete is null // as that signifies "n/a" (the step is informational, completion doesn't apply). - initialState.allStepsComplete = initialState.requiredSteps.every(function (step) { - return step.isComplete || step.isComplete === null; - }); + initialState.allStepsComplete = initialState.requiredSteps.every(step => step.isComplete || step.isComplete === null); // Done! return initialState; }; -var getS3FilesFilterFunction = function getS3FilesFilterFunction(state) { - return function (row) { - var allowValue = true; - var hasProvisionalDataStep = state.requiredSteps.some(function (step) { - return step.key === 'provisionalData'; - }); - var excludeProvisionalData = hasProvisionalDataStep && state.provisionalData.value === 'exclude'; - if (excludeProvisionalData) { - allowValue = (0, _typeUtil.isStringNonEmpty)(row.release) && !_ReleaseService.default.isNonRelease(row.release); +const getS3FilesFilterFunction = state => row => { + let allowValue = true; + const hasProvisionalDataStep = state.requiredSteps.some(step => step.key === 'provisionalData'); + const excludeProvisionalData = hasProvisionalDataStep && state.provisionalData.value === 'exclude'; + if (excludeProvisionalData) { + allowValue = (0, _typeUtil.isStringNonEmpty)(row.release) && !_ReleaseService.default.isNonRelease(row.release); + } + const matchesFilters = Object.keys(state.s3Files.filters).every(col => { + if (col === 'name') { + return !state.s3Files.filters.name.length || row.name.includes(state.s3Files.filters.name); } - var matchesFilters = Object.keys(state.s3Files.filters).every(function (col) { - if (col === 'name') { - return !state.s3Files.filters.name.length || row.name.includes(state.s3Files.filters.name); - } - return !state.s3Files.filters[col].length || state.s3Files.filters[col].includes(row[col]); - }); - return matchesFilters && allowValue; - }; + return !state.s3Files.filters[col].length || state.s3Files.filters[col].includes(row[col]); + }); + return matchesFilters && allowValue; }; -var getS3FilesFilteredFileCount = function getS3FilesFilteredFileCount(state) { - var filtered = state.s3Files.validValues.filter(getS3FilesFilterFunction(state)); +const getS3FilesFilteredFileCount = state => { + const filtered = state.s3Files.validValues.filter(getS3FilesFilterFunction(state)); return filtered.length; }; -var calcS3FilesSummaryState = function calcS3FilesSummaryState(previousState, action) { - var newState = _extends({}, previousState); - var s3FilesIdx = newState.requiredSteps.findIndex(function (step) { - return step.key === 's3Files'; - }); +const calcS3FilesSummaryState = (previousState, action) => { + const newState = _extends({}, previousState); + const s3FilesIdx = newState.requiredSteps.findIndex(step => step.key === 's3Files'); // If we didn't already update the total size then recalculate it if (action.type !== 'setIndividualS3FileSelected') { - newState.s3Files.totalSize = newState.s3Files.value.map(function (id) { - return newState.s3Files.bytesByUrl[id]; - }).reduce(function (a, b) { - return a + b; - }, 0); + newState.s3Files.totalSize = newState.s3Files.value.map(id => newState.s3Files.bytesByUrl[id]).reduce((a, b) => a + b, 0); } // Step is only complete when there's a selection that's not too big newState.s3Files.estimatedPostSize = estimatePostSize(newState.s3Files, newState.sites); newState.s3Files.isValid = newState.s3Files.value.length > 0 && newState.s3Files.estimatedPostSize < _manifestUtil.MAX_POST_BODY_SIZE; newState.requiredSteps[s3FilesIdx].isComplete = newState.s3Files.isValid; - newState.allStepsComplete = newState.requiredSteps.every(function (step) { - return step.isComplete || step.isComplete === null; - }); + newState.allStepsComplete = newState.requiredSteps.every(step => step.isComplete || step.isComplete === null); return newState; }; @@ -575,18 +518,16 @@ var calcS3FilesSummaryState = function calcS3FilesSummaryState(previousState, ac // s3Files key. This is separate from other keys supported by getAndValidateNewState // because of the few discrete ways to update s3Files state and the common side // effects / validation all of those ways require. -var getAndValidateNewS3FilesState = function getAndValidateNewS3FilesState(previousState, action) { - var broadcast = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var s3FilesIdx = previousState.requiredSteps.findIndex(function (step) { - return step.key === 's3Files'; - }); +const getAndValidateNewS3FilesState = function (previousState, action) { + let broadcast = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + const s3FilesIdx = previousState.requiredSteps.findIndex(step => step.key === 's3Files'); if (s3FilesIdx === -1) { return previousState; } - var newState = _extends({}, previousState, { - broadcast: broadcast + const newState = _extends({}, previousState, { + broadcast }); - var fileIdx = 0; + let fileIdx = 0; // Set value and reflect back onto validValues as "checked" for material table if necessary. switch (action.type) { @@ -597,7 +538,7 @@ var getAndValidateNewS3FilesState = function getAndValidateNewS3FilesState(previ newState.s3Files.value = action.value; newState.s3Files.valueMap = {}; if ((0, _typeUtil.existsNonEmpty)(newState.s3Files.value)) { - newState.s3Files.value.forEach(function (value) { + newState.s3Files.value.forEach(value => { newState.s3Files.valueMap[value] = true; }); } @@ -609,54 +550,47 @@ var getAndValidateNewS3FilesState = function getAndValidateNewS3FilesState(previ newState.s3Files.value = action.value; newState.s3Files.valueMap = {}; if ((0, _typeUtil.existsNonEmpty)(newState.s3Files.value)) { - newState.s3Files.value.forEach(function (value) { + newState.s3Files.value.forEach(value => { newState.s3Files.valueMap[value] = true; }); } - newState.s3Files.validValues.forEach(function (file, idx) { + newState.s3Files.validValues.forEach((file, idx) => { newState.s3Files.validValues[idx].tableData.checked = newState.s3Files.valueMap[file.url] || false; }); break; case 'setS3FilesValueSelectAll': - newState.s3Files.value = newState.s3Files.validValues.map(function (file) { - return file.url; - }); + newState.s3Files.value = newState.s3Files.validValues.map(file => file.url); newState.s3Files.valueMap = {}; if ((0, _typeUtil.existsNonEmpty)(newState.s3Files.value)) { - newState.s3Files.value.forEach(function (value) { + newState.s3Files.value.forEach(value => { newState.s3Files.valueMap[value] = true; }); } - newState.s3Files.validValues.forEach(function (file, idx) { + newState.s3Files.validValues.forEach((file, idx) => { newState.s3Files.validValues[idx].tableData.checked = true; }); break; case 'setS3FilesValueSelectNone': newState.s3Files.value = []; newState.s3Files.valueMap = {}; - newState.s3Files.validValues.forEach(function (file, idx) { + newState.s3Files.validValues.forEach((file, idx) => { newState.s3Files.validValues[idx].tableData.checked = false; }); break; case 'setS3FilesValueSelectFiltered': - newState.s3Files.value = newState.s3Files.validValues.filter(getS3FilesFilterFunction(newState)).map(function (file) { - return file.url; - }); + newState.s3Files.value = newState.s3Files.validValues.filter(getS3FilesFilterFunction(newState)).map(file => file.url); newState.s3Files.valueMap = {}; if ((0, _typeUtil.existsNonEmpty)(newState.s3Files.value)) { - newState.s3Files.value.forEach(function (value) { + newState.s3Files.value.forEach(value => { newState.s3Files.valueMap[value] = true; }); } - newState.s3Files.validValues.forEach(function (file, idx) { + newState.s3Files.validValues.forEach((file, idx) => { newState.s3Files.validValues[idx].tableData.checked = newState.s3Files.valueMap[file.url] || false; // eslint-disable-line max-len }); - break; case 'setIndividualS3FileSelected': - fileIdx = newState.s3Files.validValues.findIndex(function (file) { - return file.url === action.url; - }); + fileIdx = newState.s3Files.validValues.findIndex(file => file.url === action.url); if (fileIdx === -1) { return newState; } @@ -697,68 +631,54 @@ var getAndValidateNewS3FilesState = function getAndValidateNewS3FilesState(previ // // This function may also cascade into adjusting s3Files.value by removing files no longer in // scope, but does that through getAndValidateNewS3FilesState(). -var regenerateS3FilesFiltersAndValidValues = function regenerateS3FilesFiltersAndValidValues(state) { - if (!state.requiredSteps.some(function (step) { - return step.key === 's3Files'; - })) { +const regenerateS3FilesFiltersAndValidValues = state => { + if (!state.requiredSteps.some(step => step.key === 's3Files')) { return state; } - var updated = _extends({}, state); + const updated = _extends({}, state); updated.s3Files.validValues = []; if (!updated.sites.isValid || !updated.dateRange.isValid) { - var _action = { + const action = { key: 's3Files', type: 'setValueFromUpdatedValidValues', value: [] }; - return getAndValidateNewS3FilesState(updated, _action, updated.broadcast); + return getAndValidateNewS3FilesState(updated, action, updated.broadcast); } // Generate new validValues as a subset of cachedValues in scope of sites and dateRange. // Use the current selections in s3Files.value to add tableData to each validValue record. // This is what Material Table looks for to render a checked box for the row. - updated.s3Files.cachedValues = updated.s3Files.cachedValues.map(function (file) { - return _extends({}, file, { - tableData: { - checked: false - } - }); - }); - updated.s3Files.validValues = updated.s3Files.cachedValues.filter(function (file) { - return updated.sites.value.includes(file.site) && updated.dateRange.value[0] <= file.yearMonth && file.yearMonth <= updated.dateRange.value[1]; - }).map(function (file) { - return _extends({}, file, { - tableData: { - checked: updated.s3Files.valueMap[file.url] || false - } - }); - }); - var filterKeys = Object.keys(updated.s3Files.valueLookups || {}); - filterKeys.forEach(function (key) { + updated.s3Files.cachedValues = updated.s3Files.cachedValues.map(file => _extends({}, file, { + tableData: { + checked: false + } + })); + updated.s3Files.validValues = updated.s3Files.cachedValues.filter(file => updated.sites.value.includes(file.site) && updated.dateRange.value[0] <= file.yearMonth && file.yearMonth <= updated.dateRange.value[1]).map(file => _extends({}, file, { + tableData: { + checked: updated.s3Files.valueMap[file.url] || false + } + })); + const filterKeys = Object.keys(updated.s3Files.valueLookups || {}); + filterKeys.forEach(key => { updated.s3Files.valueLookups[key] = {}; }); - updated.s3Files.validValues.forEach(function (file) { - filterKeys.forEach(function (lookup) { + updated.s3Files.validValues.forEach(file => { + filterKeys.forEach(lookup => { if (typeof file[lookup] === 'undefined') { return; } updated.s3Files.valueLookups[lookup][file[lookup]] = file[lookup] || '(none)'; }); }); - filterKeys.forEach(function (key) { - updated.s3Files.filters[key] = updated.s3Files.filters[key].filter(function (filterVal) { - return Object.keys(updated.s3Files.valueLookups[key]).includes(filterVal); - }); + filterKeys.forEach(key => { + updated.s3Files.filters[key] = updated.s3Files.filters[key].filter(filterVal => Object.keys(updated.s3Files.valueLookups[key]).includes(filterVal)); }); updated.s3Files.filteredFileCount = getS3FilesFilteredFileCount(updated); // Create an action to send to the reducer helper to set an updated value and revalidate. - var action = { + const action = { key: 's3Files', type: 'setValueFromUpdatedValidValues', - value: updated.s3Files.validValues.filter(function (file) { - return file.tableData.checked; - }).map(function (file) { - return file.url; - }) + value: updated.s3Files.validValues.filter(file => file.tableData.checked).map(file => file.url) }; return getAndValidateNewS3FilesState(updated, action, updated.broadcast); }; @@ -768,8 +688,8 @@ var regenerateS3FilesFiltersAndValidValues = function regenerateS3FilesFiltersAn // a common { value, validValues, isValid } structure. If new value is not // "allowable" (see newStateIsAllowable and newStateIsValid definitions) then // no action is taken. -var getAndValidateNewState = function getAndValidateNewState(previousState, action) { - var broadcast = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; +const getAndValidateNewState = function (previousState, action) { + let broadcast = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; if (!VALIDATABLE_STATE_KEYS.includes(action.key)) { return previousState; } @@ -780,28 +700,24 @@ var getAndValidateNewState = function getAndValidateNewState(previousState, acti if (action.key === 's3Files') { return getAndValidateNewS3FilesState(previousState, action, broadcast); } - var newState = _extends({}, previousState, { - broadcast: broadcast + let newState = _extends({}, previousState, { + broadcast }); - var valueIsValid = newStateIsValid(action.key, action.value, previousState[action.key].validValues); + const valueIsValid = newStateIsValid(action.key, action.value, previousState[action.key].validValues); newState[action.key] = _extends({}, previousState[action.key], { value: action.value, isValid: valueIsValid }); - var hasProvDataStep = newState.requiredSteps.some(function (step) { - return step.key === 'provisionalData'; - }); - var hasS3FilesStep = newState.requiredSteps.some(function (step) { - return step.key === 's3Files'; - }); + const hasProvDataStep = newState.requiredSteps.some(step => step.key === 'provisionalData'); + const hasS3FilesStep = newState.requiredSteps.some(step => step.key === 's3Files'); if (hasProvDataStep && hasS3FilesStep && action.key === 'provisionalData') { if (action.value === 'exclude') { // Go through validValues, uncheck any provisional when set to exclude if ((0, _typeUtil.existsNonEmpty)(newState.s3Files.validValues)) { newState.s3Files.value = []; newState.s3Files.valueMap = {}; - newState.s3Files.validValues = newState.s3Files.validValues.map(function (value) { - var isProv = _ReleaseService.default.isProv(value.release); + newState.s3Files.validValues = newState.s3Files.validValues.map(value => { + const isProv = _ReleaseService.default.isProv(value.release); if (isProv) { return _extends({}, value, { tableData: _extends({}, value.tableData, { @@ -820,17 +736,13 @@ var getAndValidateNewState = function getAndValidateNewState(previousState, acti } newState.s3Files.filteredFileCount = getS3FilesFilteredFileCount(newState); } - newState.requiredSteps = previousState.requiredSteps.map(function (step) { - var requiredStateKeys = ALL_STEPS[step.key] ? ALL_STEPS[step.key].requiredStateKeys : []; + newState.requiredSteps = previousState.requiredSteps.map(step => { + const requiredStateKeys = ALL_STEPS[step.key] ? ALL_STEPS[step.key].requiredStateKeys : []; return step.isComplete === null ? _extends({}, step) : _extends({}, step, { - isComplete: requiredStateKeys.every(function (key) { - return newState[key].isValid; - }) + isComplete: requiredStateKeys.every(key => newState[key].isValid) }); }); - newState.allStepsComplete = newState.requiredSteps.every(function (step) { - return step.isComplete || step.isComplete === null; - }); + newState.allStepsComplete = newState.requiredSteps.every(step => step.isComplete || step.isComplete === null); // Trigger a new manifest request for file size estimate if this update warrants it if (previousState.fromManifest && MANIFEST_TRIGGERING_STATE_KEYS.includes(action.key) && broadcast) { newState.manifest.status = 'awaitingFetchCall'; @@ -840,13 +752,11 @@ var getAndValidateNewState = function getAndValidateNewState(previousState, acti // 1. Trigger new s3 file fetches as needed // 2. Regenerate s3Files.validValues if (['sites', 'dateRange'].includes(action.key) && previousState.fromAOPManifest) { - Object.keys(previousState.s3FileFetches).filter(function (key) { - return ['notRequested', 'error'].includes(previousState.s3FileFetches[key]); - }).filter(function (key) { - var site = key.substr(0, 4); - var yearMonth = key.substr(5, 7); + Object.keys(previousState.s3FileFetches).filter(key => ['notRequested', 'error'].includes(previousState.s3FileFetches[key])).filter(key => { + const site = key.substr(0, 4); + const yearMonth = key.substr(5, 7); return newState.sites.value.includes(site) && newState.dateRange.value[0] <= yearMonth && yearMonth <= newState.dateRange.value[1]; - }).forEach(function (key) { + }).forEach(key => { newState.s3FileFetches[key] = 'awaitingFetchCall'; }); return regenerateS3FilesFiltersAndValidValues(newState); @@ -855,18 +765,16 @@ var getAndValidateNewState = function getAndValidateNewState(previousState, acti }; // REDUCER -var reducer = function reducer(state, action) { - var newState = {}; - var getStateFromHigherOrderState = function getStateFromHigherOrderState(newHigherOrderState) { - return HIGHER_ORDER_TRANSFERABLE_STATE_KEYS.reduce(function (higherOrderState, stateKey) { - var newValue = mutateNewStateIntoRange(stateKey, newHigherOrderState[stateKey].value, state[stateKey].validValues); - var newAction = { - key: stateKey, - value: newValue - }; - return getAndValidateNewState(higherOrderState, newAction); - }, state); - }; +const reducer = (state, action) => { + let newState = {}; + const getStateFromHigherOrderState = newHigherOrderState => HIGHER_ORDER_TRANSFERABLE_STATE_KEYS.reduce((higherOrderState, stateKey) => { + const newValue = mutateNewStateIntoRange(stateKey, newHigherOrderState[stateKey].value, state[stateKey].validValues); + const newAction = { + key: stateKey, + value: newValue + }; + return getAndValidateNewState(higherOrderState, newAction); + }, state); switch (action.type) { // Action for setting state from higher order state case 'setFromHigherOrderState': @@ -968,7 +876,7 @@ var reducer = function reducer(state, action) { // Action for clearing all filter values for the presentation of s3 files case 'clearS3FilesFilterValues': newState = _extends({}, state); - Object.keys(newState.s3Files.filters).forEach(function (filter) { + Object.keys(newState.s3Files.filters).forEach(filter => { newState.s3Files.filters[filter] = filter === 'name' ? '' : []; }); newState.s3Files.filteredFileCount = 0; @@ -993,10 +901,10 @@ var reducer = function reducer(state, action) { newState = _extends({}, state, { s3FileFetchProgress: 0 }); - action.value.forEach(function (response) { + action.value.forEach(response => { newState.s3FileFetches["".concat(response.site, ".").concat(response.yearMonth)] = 'fetched'; - var files = response.files.map(function (fileObj) { - var file = { + const files = response.files.map(fileObj => { + const file = { release: response.release || '', productCode: response.productCode, name: fileObj.name, @@ -1011,10 +919,10 @@ var reducer = function reducer(state, action) { } }; // Set additional file attributes from S3 regex capture groups - Object.keys(S3_PATTERN).forEach(function (key) { - var capture = fileObj[key].match(S3_PATTERN[key].regex); + Object.keys(S3_PATTERN).forEach(key => { + const capture = fileObj[key].match(S3_PATTERN[key].regex); if (capture) { - S3_PATTERN[key].groups.forEach(function (group, groupIdx) { + S3_PATTERN[key].groups.forEach((group, groupIdx) => { file[group] = capture[groupIdx + 1] || null; }); } @@ -1023,7 +931,7 @@ var reducer = function reducer(state, action) { // file size fast summing, url for building final download request newState.s3Files.bytesByUrl[file.url] = file.size; // If new unique values are present add them to the s3File value lookups - Object.keys(newState.s3Files.valueLookups).forEach(function (lookup) { + Object.keys(newState.s3Files.valueLookups).forEach(lookup => { if (typeof file[lookup] === 'undefined') { return; } @@ -1040,7 +948,7 @@ var reducer = function reducer(state, action) { newState = _extends({}, state, { s3FileFetchProgress: 0 }); - action.keys.forEach(function (key) { + action.keys.forEach(key => { newState.s3FileFetches[key] = 'fetching'; }); return newState; @@ -1073,36 +981,30 @@ var reducer = function reducer(state, action) { * @param {*} action An action. * @returns the new state. */ -var wrappedReducer = function wrappedReducer(state, action) { - return reducer(state, action); -}; +const wrappedReducer = (state, action) => reducer(state, action); // CONTEXT -var Context = /*#__PURE__*/(0, _react.createContext)(DEFAULT_STATE); +const Context = /*#__PURE__*/(0, _react.createContext)(DEFAULT_STATE); // HOOK -var useDownloadDataState = function useDownloadDataState() { - var hookResponse = (0, _react.useContext)(Context); +const useDownloadDataState = () => { + const hookResponse = (0, _react.useContext)(Context); if (hookResponse.length !== 2) { return [_extends({}, DEFAULT_STATE, { requiredSteps: [], downloadContextIsActive: false - }), function () {}]; + }), () => {}]; } return hookResponse; }; // OBSERVABLES // Observable and getter for sharing whole state through a higher order component -var stateSubject$ = new _rxjs.Subject(); -var getStateObservable = function getStateObservable() { - return stateSubject$.asObservable(); -}; +const stateSubject$ = new _rxjs.Subject(); +const getStateObservable = () => stateSubject$.asObservable(); // Observables and getters for making and canceling manifest requests -var manifestCancelation$ = new _rxjs.Subject(); -var getManifestAjaxObservable = function getManifestAjaxObservable(request) { - return _NeonApi.default.postJsonObservable(request.url, request.body, null, false); -}; +const manifestCancelation$ = new _rxjs.Subject(); +const getManifestAjaxObservable = request => _NeonApi.default.postJsonObservable(request.url, request.body, null, false); /** * Defines a lookup of state key to a boolean @@ -1111,49 +1013,52 @@ var getManifestAjaxObservable = function getManifestAjaxObservable(request) { * Keeping this lookup outside of the context provider function * as to not incur lifecycle interference by storing with useState. */ -var restoreStateLookup = {}; +const restoreStateLookup = {}; // Provider -var Provider = function Provider(props) { - var downloadDataContextUniqueId = props.downloadDataContextUniqueId, - stateObservable = props.stateObservable, - children = props.children; +const Provider = props => { + const { + downloadDataContextUniqueId, + stateObservable, + children + } = props; // get the initial state from storage if present, else get from props. - var initialState = getInitialStateFromProps(props); - var product = initialState.productData.productCode; - var stateKey = "downloadDataContextState-".concat(product, "-").concat(downloadDataContextUniqueId); + let initialState = getInitialStateFromProps(props); + const { + productCode: product + } = initialState.productData; + const stateKey = "downloadDataContextState-".concat(product, "-").concat(downloadDataContextUniqueId); if (typeof restoreStateLookup[stateKey] === 'undefined') { restoreStateLookup[stateKey] = true; } - var shouldRestoreState = restoreStateLookup[stateKey]; - var stateStorage = (0, _StateStorageService.default)(stateKey); - var savedState = stateStorage.readState(); + const shouldRestoreState = restoreStateLookup[stateKey]; + const stateStorage = (0, _StateStorageService.default)(stateKey); + const savedState = stateStorage.readState(); if (savedState && shouldRestoreState) { restoreStateLookup[stateKey] = false; stateStorage.removeState(); initialState = (0, _StateStorageConverter.convertAOPInitialState)(savedState, initialState); } - var _useReducer = (0, _react.useReducer)(wrappedReducer, initialState), - _useReducer2 = _slicedToArray(_useReducer, 2), - state = _useReducer2[0], - dispatch = _useReducer2[1]; - var downloadContextIsActive = state.downloadContextIsActive, - dialogOpen = state.dialogOpen; + const [state, dispatch] = (0, _react.useReducer)(wrappedReducer, initialState); + const { + downloadContextIsActive, + dialogOpen + } = state; // The current sign in process uses a separate domain. This function // persists the current state in storage when the button is clicked // so the state may be reloaded when the page is reloaded after sign // in. - (0, _react.useEffect)(function () { - var subscription = _NeonSignInButtonState.default.getObservable().subscribe({ - next: function next() { + (0, _react.useEffect)(() => { + const subscription = _NeonSignInButtonState.default.getObservable().subscribe({ + next: () => { if (!downloadContextIsActive || !dialogOpen) return; restoreStateLookup[stateKey] = false; stateStorage.saveState((0, _StateStorageConverter.convertStateForStorage)(state)); } }); - return function () { + return () => { subscription.unsubscribe(); }; }, [downloadContextIsActive, dialogOpen, state, stateKey, stateStorage]); @@ -1161,96 +1066,78 @@ var Provider = function Provider(props) { // Create an observable for manifests requests and subscribe to it to execute // the manifest fetch and dispatch results when updated. // eslint-disable-next-line react-hooks/exhaustive-deps - var manifestRequest$ = new _rxjs.Subject(); - manifestRequest$.subscribe(function (request) { - return getManifestAjaxObservable(request).pipe((0, _rxjs.switchMap)(function (resp) { - return (0, _rxjs.of)(request.body ? resp.response : resp); - }), (0, _rxjs.takeUntil)(manifestCancelation$)).subscribe({ - next: function next(resp) { - return dispatch({ - type: 'setFetchManifestSucceeded', - body: resp, - sizeEstimate: (0, _manifestUtil.getSizeEstimateFromManifestRollupResponse)(resp) - }); - }, - error: function error(err) { - return dispatch({ - type: 'setFetchManifestFailed', - error: err - }); - } - }); - }); - var handleFetchS3Files = function handleFetchS3Files(currentState) { - var productCode = currentState.productData.productCode; - var keys = Object.keys(currentState.s3FileFetches).filter(function (key) { - return currentState.s3FileFetches[key] === 'awaitingFetchCall'; - }); + const manifestRequest$ = new _rxjs.Subject(); + manifestRequest$.subscribe(request => getManifestAjaxObservable(request).pipe((0, _rxjs.switchMap)(resp => (0, _rxjs.of)(request.body ? resp.response : resp)), (0, _rxjs.takeUntil)(manifestCancelation$)).subscribe({ + next: resp => dispatch({ + type: 'setFetchManifestSucceeded', + body: resp, + sizeEstimate: (0, _manifestUtil.getSizeEstimateFromManifestRollupResponse)(resp) + }), + error: err => dispatch({ + type: 'setFetchManifestFailed', + error: err + }) + })); + const handleFetchS3Files = currentState => { + const { + productCode + } = currentState.productData; + const keys = Object.keys(currentState.s3FileFetches).filter(key => currentState.s3FileFetches[key] === 'awaitingFetchCall'); if (!keys.length) { return; } dispatch({ type: 'setS3FileFetchesCalled', - keys: keys + keys }); - var observable = (0, _rxUtil.forkJoinWithProgress)(keys.map(function (key) { - var site = key.substr(0, 4); - var yearMonth = key.substr(5, 7); - var release = currentState.release && currentState.release.value ? currentState.release.value : null; - return _NeonApi.default.getJsonObservable((0, _manifestUtil.buildS3FilesRequestUrl)(productCode, site, yearMonth, release)).pipe((0, _rxjs.map)(function (response) { - return { - status: 'fetched', - files: response.data.files, - release: response.data.release, - site: site, - yearMonth: yearMonth, - productCode: productCode - }; - }), (0, _rxjs.catchError)(function () { - return { - status: 'error', - files: [], - site: site, - yearMonth: yearMonth, - productCode: productCode - }; - })); + const observable = (0, _rxUtil.forkJoinWithProgress)(keys.map(key => { + const site = key.substr(0, 4); + const yearMonth = key.substr(5, 7); + const release = currentState.release && currentState.release.value ? currentState.release.value : null; + return _NeonApi.default.getJsonObservable((0, _manifestUtil.buildS3FilesRequestUrl)(productCode, site, yearMonth, release)).pipe((0, _rxjs.map)(response => ({ + status: 'fetched', + files: response.data.files, + release: response.data.release, + site, + yearMonth, + productCode + })), (0, _rxjs.catchError)(() => ({ + status: 'error', + files: [], + site, + yearMonth, + productCode + }))); + })); + observable.pipe((0, _rxjs.mergeMap)(_ref => { + let [finalResult, progress] = _ref; + return (0, _rxjs.merge)(progress.pipe((0, _rxjs.tap)(value => dispatch({ + type: 'setS3FileFetchesProgress', + value + })), (0, _rxjs.ignoreElements)()), finalResult); + })).subscribe(value => dispatch({ + type: 'setS3FileFetchesCompleted', + value })); - observable.pipe((0, _rxjs.mergeMap)(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - finalResult = _ref2[0], - progress = _ref2[1]; - return (0, _rxjs.merge)(progress.pipe((0, _rxjs.tap)(function (value) { - return dispatch({ - type: 'setS3FileFetchesProgress', - value: value - }); - }), (0, _rxjs.ignoreElements)()), finalResult); - })).subscribe(function (value) { - return dispatch({ - type: 'setS3FileFetchesCompleted', - value: value - }); - }); }; // If the state was instantiated with a higher-order context observable passed // in through props: subscribe to that observable ONLY ONE TIME. - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (typeof stateObservable !== 'function') { return; } - stateObservable().subscribe(function (newHigherOrderState) { + stateObservable().subscribe(newHigherOrderState => { dispatch({ type: 'setFromHigherOrderState', - newHigherOrderState: newHigherOrderState + newHigherOrderState }); }); }, [stateObservable]); // When the state has changed such that it needs to broadcast itself to anything // listening: do the broadcast. - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (state.broadcast) { stateSubject$.next(state); dispatch({ @@ -1262,13 +1149,13 @@ var Provider = function Provider(props) { // When state has changed such that a new manifest should be fetched: // Process state into a new manifest request and fetch it, canceling any other // fetches that may be in progress for this context. - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (!state.fromManifest || state.manifest.status !== 'awaitingFetchCall') { return; } // Cancel any in-progress manifest fetch manifestCancelation$.next(true); - var config = (0, _manifestUtil.buildManifestConfig)(state, ALL_POSSIBLE_VALID_PACKAGE_TYPE[0]); + const config = (0, _manifestUtil.buildManifestConfig)(state, ALL_POSSIBLE_VALID_PACKAGE_TYPE[0]); if (config.isError && config.errorMessage) { dispatch({ type: 'setManifestStatus', @@ -1279,8 +1166,8 @@ var Provider = function Provider(props) { dispatch({ type: 'setFetchManifestCalled' }); - var manifestURL = (0, _manifestUtil.buildManifestRequestUrl)(config, true); - var manifestBody = (0, _manifestUtil.buildManifestRequestBody)(config); + const manifestURL = (0, _manifestUtil.buildManifestRequestUrl)(config, true); + const manifestBody = (0, _manifestUtil.buildManifestRequestBody)(config); manifestRequest$.next({ url: manifestURL, body: manifestBody @@ -1290,10 +1177,8 @@ var Provider = function Provider(props) { // If the state has changed such that new fetches for s3 files are expected: // generate those fetches. - (0, _react.useEffect)(function () { - if (Object.values(state.s3FileFetches).some(function (status) { - return status === 'awaitingFetchCall'; - })) { + (0, _react.useEffect)(() => { + if (Object.values(state.s3FileFetches).some(status => status === 'awaitingFetchCall')) { handleFetchS3Files(state); } }, [state]); @@ -1343,34 +1228,31 @@ Provider.defaultProps = { packageType: DEFAULT_STATE.packageType.value, provisionalData: DEFAULT_STATE.provisionalData.value }; -var DownloadDataContext = { - Provider: Provider, - useDownloadDataState: useDownloadDataState, - reducer: reducer, - DEFAULT_STATE: DEFAULT_STATE, - ALL_STEPS: ALL_STEPS, - getStateObservable: getStateObservable +const DownloadDataContext = { + Provider, + useDownloadDataState, + reducer, + DEFAULT_STATE, + ALL_STEPS, + getStateObservable }; -var _default = DownloadDataContext; // Additional items exported for unit testing -exports.default = _default; -var getTestableItems = function getTestableItems() { - return process.env.NODE_ENV !== 'test' ? {} : { - productDataIsValid: productDataIsValid, - yearMonthIsValid: yearMonthIsValid, - newStateIsAllowable: newStateIsAllowable, - newStateIsValid: newStateIsValid, - mutateNewStateIntoRange: mutateNewStateIntoRange, - estimatePostSize: estimatePostSize, - getValidValuesFromProductData: getValidValuesFromProductData, - getInitialStateFromProps: getInitialStateFromProps, - getS3FilesFilteredFileCount: getS3FilesFilteredFileCount, - getAndValidateNewS3FilesState: getAndValidateNewS3FilesState, - regenerateS3FilesFiltersAndValidValues: regenerateS3FilesFiltersAndValidValues, - getAndValidateNewState: getAndValidateNewState, - ALL_POSSIBLE_VALID_DATE_RANGE: ALL_POSSIBLE_VALID_DATE_RANGE, - ALL_POSSIBLE_VALID_DOCUMENTATION: ALL_POSSIBLE_VALID_DOCUMENTATION, - ALL_POSSIBLE_VALID_PACKAGE_TYPE: ALL_POSSIBLE_VALID_PACKAGE_TYPE, - ALL_POSSIBLE_VALID_PROVISIONAL_DATA: ALL_POSSIBLE_VALID_PROVISIONAL_DATA - }; +var _default = exports.default = DownloadDataContext; // Additional items exported for unit testing +const getTestableItems = () => process.env.NODE_ENV !== 'test' ? {} : { + productDataIsValid, + yearMonthIsValid, + newStateIsAllowable, + newStateIsValid, + mutateNewStateIntoRange, + estimatePostSize, + getValidValuesFromProductData, + getInitialStateFromProps, + getS3FilesFilteredFileCount, + getAndValidateNewS3FilesState, + regenerateS3FilesFiltersAndValidValues, + getAndValidateNewState, + ALL_POSSIBLE_VALID_DATE_RANGE, + ALL_POSSIBLE_VALID_DOCUMENTATION, + ALL_POSSIBLE_VALID_PACKAGE_TYPE, + ALL_POSSIBLE_VALID_PROVISIONAL_DATA }; exports.getTestableItems = getTestableItems; \ No newline at end of file diff --git a/lib/components/DownloadDataContext/StateStorageConverter.js b/lib/components/DownloadDataContext/StateStorageConverter.js index 18cf5c3c..fe437813 100644 --- a/lib/components/DownloadDataContext/StateStorageConverter.js +++ b/lib/components/DownloadDataContext/StateStorageConverter.js @@ -6,19 +6,13 @@ Object.defineProperty(exports, "__esModule", { exports.convertStateForStorage = exports.convertAOPInitialState = void 0; var _DownloadDataContext = _interopRequireDefault(require("./DownloadDataContext")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } // eslint-disable-next-line import/no-cycle /** * Alter the current state for valid JSON serialization. Set objects * must be converted to Array objects for serialization. * @param currentState The current state */ -var convertStateForStorage = function convertStateForStorage(state) { +const convertStateForStorage = state => { if (state.fromAOPManifest) { // AOP S3 Files will incur too much data to be saved in session state // Restore to default state in terms of s3Files and selection state. @@ -29,14 +23,14 @@ var convertStateForStorage = function convertStateForStorage(state) { manifest: _extends({}, _DownloadDataContext.default.DEFAULT_STATE.manifest), allStepsComplete: _DownloadDataContext.default.DEFAULT_STATE.allStepsComplete, sites: _extends({}, state.sites, { - value: _toConsumableArray(_DownloadDataContext.default.DEFAULT_STATE.sites.value) + value: [..._DownloadDataContext.default.DEFAULT_STATE.sites.value] }) }); } return state; }; exports.convertStateForStorage = convertStateForStorage; -var convertAOPInitialState = function convertAOPInitialState(state, propsState) { +const convertAOPInitialState = (state, propsState) => { if (!state.fromAOPManifest) return state; return _extends({}, state, { s3FileFetches: _extends({}, propsState.s3FileFetches), diff --git a/lib/components/DownloadDataContext/index.js b/lib/components/DownloadDataContext/index.js index e22ee08b..b98ffcb0 100644 --- a/lib/components/DownloadDataContext/index.js +++ b/lib/components/DownloadDataContext/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _DownloadDataContext.default; } }); diff --git a/lib/components/DownloadDataDialog/DownloadDataDialog.js b/lib/components/DownloadDataDialog/DownloadDataDialog.js index 97e1d5ca..5180095f 100644 --- a/lib/components/DownloadDataDialog/DownloadDataDialog.js +++ b/lib/components/DownloadDataDialog/DownloadDataDialog.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -44,161 +43,137 @@ var _NeonSignInButton = _interopRequireDefault(require("../NeonSignInButton/Neon var _RouteService = _interopRequireDefault(require("../../service/RouteService")); var _manifestUtil = require("../../util/manifestUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -var useStyles = function useStyles(belowSm, belowSmMd) { - return (0, _styles.makeStyles)(function (theme) { - return { - stepChip: { - marginRight: theme.spacing(1), - fontSize: '1rem', - fontWeight: 600 - }, - productCodeChip: { - color: theme.palette.grey[400], - border: "1px solid ".concat(theme.palette.grey[400]), - backgroundColor: theme.palette.grey[100], - fontWeight: 600, - cursor: 'help', - height: '26px', - margin: theme.spacing(-0.5, 1.5, 0, 0) - }, - releaseChip: { - color: _Theme.default.colors.LIGHT_BLUE[600], - border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[600]), - backgroundColor: _Theme.default.colors.LIGHT_BLUE[50], - fontWeight: 600, - fontSize: '0.9rem', - cursor: 'help', - height: belowSmMd && !belowSm ? 'auto' : undefined, - padding: theme.spacing(2, 1, 2, 1) - }, - startFlex: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center' - }, - endFlex: { - display: 'flex', - justifyContent: 'flex-end', - alignItems: 'center' - }, - completedInactive: { - '& svg': { - opacity: 0.5 - } - }, - summaryIcon: { - fontSize: '30px', - color: theme.palette.primary.main - }, - summaryIconTitleMarker: { - fontSize: '38px', - color: theme.palette.primary.main, - margin: '-2px 6px -2px -4px' - }, - callout: { - backgroundColor: _Theme.COLORS.GOLD[300], - margin: _Theme.default.spacing(0.5, 0, 2, 0) - }, - calloutIcon: { - color: _Theme.COLORS.GOLD[800], - marginRight: theme.spacing(2) - }, - gtmCaptureButton: { - '& span': { - pointerEvents: 'none' - } - } - }; - }); -}; -var useDialogBaseStyles = function useDialogBaseStyles(belowSm) { - return (0, _styles.makeStyles)(function (theme) { - return { - contentPaper: { - margin: theme.spacing(10, 2, belowSm ? 9 : 2, 2), - padding: theme.spacing(3), - minWidth: '340px' - } - }; - }); -}; +const useStyles = (belowSm, belowSmMd) => (0, _styles.makeStyles)(theme => ({ + stepChip: { + marginRight: theme.spacing(1), + fontSize: '1rem', + fontWeight: 600 + }, + productCodeChip: { + color: theme.palette.grey[400], + border: "1px solid ".concat(theme.palette.grey[400]), + backgroundColor: theme.palette.grey[100], + fontWeight: 600, + cursor: 'help', + height: '26px', + margin: theme.spacing(-0.5, 1.5, 0, 0) + }, + releaseChip: { + color: _Theme.default.colors.LIGHT_BLUE[600], + border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[600]), + backgroundColor: _Theme.default.colors.LIGHT_BLUE[50], + fontWeight: 600, + fontSize: '0.9rem', + cursor: 'help', + height: belowSmMd && !belowSm ? 'auto' : undefined, + padding: theme.spacing(2, 1, 2, 1) + }, + startFlex: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center' + }, + endFlex: { + display: 'flex', + justifyContent: 'flex-end', + alignItems: 'center' + }, + completedInactive: { + '& svg': { + opacity: 0.5 + } + }, + summaryIcon: { + fontSize: '30px', + color: theme.palette.primary.main + }, + summaryIconTitleMarker: { + fontSize: '38px', + color: theme.palette.primary.main, + margin: '-2px 6px -2px -4px' + }, + callout: { + backgroundColor: _Theme.COLORS.GOLD[300], + margin: _Theme.default.spacing(0.5, 0, 2, 0) + }, + calloutIcon: { + color: _Theme.COLORS.GOLD[800], + marginRight: theme.spacing(2) + }, + gtmCaptureButton: { + '& span': { + pointerEvents: 'none' + } + } +})); +const useDialogBaseStyles = belowSm => (0, _styles.makeStyles)(theme => ({ + contentPaper: { + margin: theme.spacing(10, 2, belowSm ? 9 : 2, 2), + padding: theme.spacing(3), + minWidth: '340px' + } +})); function DownloadDataDialog() { - var belowSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('xs')); - var belowSmMd = (0, _useMediaQuery.default)('(max-width: 750px)'); - var belowSmMdStepper = (0, _useMediaQuery.default)('(max-width: 700px)'); - var belowMdStepper = (0, _useMediaQuery.default)('(max-width: 800px)'); - var classes = useStyles(belowSm, belowSmMd)(_Theme.default); - var dialogBaseClasses = useDialogBaseStyles(belowSm)(_Theme.default); + const belowSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('xs')); + const belowSmMd = (0, _useMediaQuery.default)('(max-width: 750px)'); + const belowSmMdStepper = (0, _useMediaQuery.default)('(max-width: 700px)'); + const belowMdStepper = (0, _useMediaQuery.default)('(max-width: 800px)'); + const classes = useStyles(belowSm, belowSmMd)(_Theme.default); + const dialogBaseClasses = useDialogBaseStyles(belowSm)(_Theme.default); /** State (from DownloadDataContext) */ - var _DownloadDataContext$ = _DownloadDataContext.default.useDownloadDataState(), - _DownloadDataContext$2 = _slicedToArray(_DownloadDataContext$, 2), - _DownloadDataContext$3 = _DownloadDataContext$2[0], - dialogOpen = _DownloadDataContext$3.dialogOpen, - productData = _DownloadDataContext$3.productData, - manifest = _DownloadDataContext$3.manifest, - requiredSteps = _DownloadDataContext$3.requiredSteps, - allStepsComplete = _DownloadDataContext$3.allStepsComplete, - fromManifest = _DownloadDataContext$3.fromManifest, - fromAOPManifest = _DownloadDataContext$3.fromAOPManifest, - documentation = _DownloadDataContext$3.documentation, - s3Files = _DownloadDataContext$3.s3Files, - release = _DownloadDataContext$3.release, - latestRelease = _DownloadDataContext$3.latestRelease, - sites = _DownloadDataContext$3.sites, - dateRange = _DownloadDataContext$3.dateRange, - packageType = _DownloadDataContext$3.packageType, - provisionalData = _DownloadDataContext$3.provisionalData, - dispatch = _DownloadDataContext$2[1]; + const [{ + dialogOpen, + productData, + manifest, + requiredSteps, + allStepsComplete, + fromManifest, + fromAOPManifest, + documentation, + s3Files, + release, + latestRelease, + sites, + dateRange, + packageType, + provisionalData + }, dispatch] = _DownloadDataContext.default.useDownloadDataState(); /** State (from NeonContext) */ - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - isAuthenticated = _NeonContext$useNeonC2[0].auth.isAuthenticated; + const [{ + auth: { + isAuthenticated + } + }] = _NeonContext.default.useNeonContextState(); /** State (local) */ - var _useState = (0, _react.useState)(0), - _useState2 = _slicedToArray(_useState, 2), - activeStepIndex = _useState2[0], - setActiveStepIndex = _useState2[1]; - var _useState3 = (0, _react.useState)(false), - _useState4 = _slicedToArray(_useState3, 2), - downloadExecuted = _useState4[0], - setDownloadExecuted = _useState4[1]; + const [activeStepIndex, setActiveStepIndex] = (0, _react.useState)(0); + const [downloadExecuted, setDownloadExecuted] = (0, _react.useState)(false); /** Size estimate getter (in bytes) */ - var getSizeEstimateBytes = function getSizeEstimateBytes() { - return (fromAOPManifest ? s3Files.totalSize : manifest.sizeEstimate) || 0; - }; + const getSizeEstimateBytes = () => (fromAOPManifest ? s3Files.totalSize : manifest.sizeEstimate) || 0; /** External Host */ - var externalHost = _ExternalHost.default.getByProductCode(productData.productCode); - var renderExternalHostInfo = function renderExternalHostInfo() { + const externalHost = _ExternalHost.default.getByProductCode(productData.productCode); + const renderExternalHostInfo = () => { if (!externalHost || externalHost.hostType === _ExternalHost.default.HOST_TYPES.EXCLUSIVE_DATA) { return null; } - var availableSiteCodes = (productData.siteCodes || []).map(function (site) { - return site.siteCode; - }); + const availableSiteCodes = (productData.siteCodes || []).map(site => site.siteCode); return /*#__PURE__*/_react.default.createElement(_ExternalHostInfo.default, { "data-selenium": "download-data-dialog.external-host-info", productCode: productData.productCode, @@ -210,9 +185,11 @@ function DownloadDataDialog() { /** Step content */ - var ALL_STEPS = _DownloadDataContext.default.ALL_STEPS; - var getStep = function getStep() { - var idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + const { + ALL_STEPS + } = _DownloadDataContext.default; + const getStep = function () { + let idx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; if (!requiredSteps[idx]) { return {}; } @@ -222,17 +199,13 @@ function DownloadDataDialog() { /** Handlers */ - var changeToStep = function changeToStep(stepIdx) { + const changeToStep = stepIdx => { setActiveStepIndex(stepIdx); }; - var changeToNextUncompletedStep = function changeToNextUncompletedStep() { - var lastStepIndex = requiredSteps.length - 1; - var summaryIndex = requiredSteps[lastStepIndex].key === 'summary' ? lastStepIndex : null; - var allIncompleteSteps = Object.keys(requiredSteps).map(function (idx) { - return parseInt(idx, 10); - }).filter(function (idx) { - return idx !== activeStepIndex && idx !== summaryIndex && !requiredSteps[idx].isComplete; - }); + const changeToNextUncompletedStep = () => { + const lastStepIndex = requiredSteps.length - 1; + const summaryIndex = requiredSteps[lastStepIndex].key === 'summary' ? lastStepIndex : null; + const allIncompleteSteps = Object.keys(requiredSteps).map(idx => parseInt(idx, 10)).filter(idx => idx !== activeStepIndex && idx !== summaryIndex && !requiredSteps[idx].isComplete); if (activeStepIndex === lastStepIndex) { return null; } @@ -242,50 +215,48 @@ function DownloadDataDialog() { // There is at least one incomplete step. // If any steps are after the current active step (OTHER than summary), go there first. // If not then take the first incomplete step in the list. - var laterIncompleteSteps = allIncompleteSteps.filter(function (idx) { - return idx !== summaryIndex && idx > activeStepIndex; - }); + const laterIncompleteSteps = allIncompleteSteps.filter(idx => idx !== summaryIndex && idx > activeStepIndex); return changeToStep(laterIncompleteSteps.length ? laterIncompleteSteps[0] : allIncompleteSteps[0]); }; - var handleCancel = function handleCancel() { + const handleCancel = () => { dispatch({ type: 'setDialogOpen', open: false }); }; - var handleDownload = function handleDownload() { + const handleDownload = () => { setDownloadExecuted(true); - var manifestSelection = { - productData: productData, - release: release, - sites: sites, - dateRange: dateRange, - documentation: documentation, - packageType: packageType, - provisionalData: provisionalData + const manifestSelection = { + productData, + release, + sites, + dateRange, + documentation, + packageType, + provisionalData }; if (fromAOPManifest) { - var _config = (0, _manifestUtil.buildManifestConfig)(manifestSelection, null, true); - return (0, _manifestUtil.downloadAopManifest)(_config, s3Files, documentation.value); + const config = (0, _manifestUtil.buildManifestConfig)(manifestSelection, null, true); + return (0, _manifestUtil.downloadAopManifest)(config, s3Files, documentation.value); } if (manifest.status !== 'fetched' || !manifest.body || !manifest.body.data) { return null; } - var config = (0, _manifestUtil.buildManifestConfig)(manifestSelection); - var manifestBody = (0, _manifestUtil.buildManifestRequestBody)(config); + const config = (0, _manifestUtil.buildManifestConfig)(manifestSelection); + const manifestBody = (0, _manifestUtil.buildManifestRequestBody)(config); return (0, _manifestUtil.downloadManifest)(manifestBody); }; /** Render functions */ - var renderSizeEstimate = function renderSizeEstimate() { - var alignRight = { + const renderSizeEstimate = () => { + const alignRight = { style: { textAlign: 'right' } }; - var subtitleStyle = { + const subtitleStyle = { style: { lineHeight: '1rem', fontSize: '0.9rem', @@ -314,10 +285,10 @@ function DownloadDataDialog() { })); } if (fromManifest && manifest.status === 'fetched' && manifest.sizeEstimate > 0 || fromAOPManifest && s3Files.isValid) { - var bytes = getSizeEstimateBytes(); - var uncompressed = fromAOPManifest ? ' (uncompressed)' : ''; - var estimateColor = bytes > _manifestUtil.DOWNLOAD_SIZE_WARN ? _Theme.COLORS.GOLD[300] : 'inherit'; - var estimateIcon = bytes > _manifestUtil.DOWNLOAD_SIZE_WARN ? /*#__PURE__*/_react.default.createElement(_Warning.default, { + const bytes = getSizeEstimateBytes(); + const uncompressed = fromAOPManifest ? ' (uncompressed)' : ''; + let estimateColor = bytes > _manifestUtil.DOWNLOAD_SIZE_WARN ? _Theme.COLORS.GOLD[300] : 'inherit'; + const estimateIcon = bytes > _manifestUtil.DOWNLOAD_SIZE_WARN ? /*#__PURE__*/_react.default.createElement(_Warning.default, { style: { marginRight: '8px', marginBottom: '-5px' @@ -345,13 +316,10 @@ function DownloadDataDialog() { }, estimateIcon, (0, _manifestUtil.formatBytes)(bytes))); /* eslint-enable react/jsx-one-expression-per-line */ } - if (fromManifest && (manifest.status === 'fetched' || manifest.status === 'no-data') && !(manifest.sizeEstimate > 0) || fromAOPManifest && !(s3Files.totalSize > 0)) { - var hasProvisionalDataStep = requiredSteps.some(function (step) { - return step.key === 'provisionalData'; - }); - var excludeProvisionalData = hasProvisionalDataStep && provisionalData.value === 'exclude'; - var showNoReleaseData = hasProvisionalDataStep && excludeProvisionalData; + const hasProvisionalDataStep = requiredSteps.some(step => step.key === 'provisionalData'); + const excludeProvisionalData = hasProvisionalDataStep && provisionalData.value === 'exclude'; + const showNoReleaseData = hasProvisionalDataStep && excludeProvisionalData; return /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body2", color: "error" @@ -365,12 +333,12 @@ function DownloadDataDialog() { } return null; }; - var renderDownloadSizeWarning = function renderDownloadSizeWarning() { - var bytes = getSizeEstimateBytes(); + const renderDownloadSizeWarning = () => { + const bytes = getSizeEstimateBytes(); if (bytes < _manifestUtil.DOWNLOAD_SIZE_WARN) { return null; } - var formattedBytes = (0, _manifestUtil.formatBytes)(bytes); + const formattedBytes = (0, _manifestUtil.formatBytes)(bytes); return /*#__PURE__*/_react.default.createElement(_Card.default, { className: classes.callout }, /*#__PURE__*/_react.default.createElement(_CardContent.default, { @@ -387,7 +355,7 @@ function DownloadDataDialog() { variant: "body1" }, "If needed, you can reduce the download size by selecting fewer sites or a more restrictive date range.")))); }; - var renderFileType = function renderFileType() { + const renderFileType = () => { if (!fromManifest) { return null; } @@ -398,11 +366,11 @@ function DownloadDataDialog() { }, "File Type:\xA0", /*#__PURE__*/_react.default.createElement("b", null, "Not available")); } // TODO: Do other file types ever come back in the manifest response? - var fileTypes = { + const fileTypes = { 'application/zip': 'ZIP (Compressed Text)' }; - var mimeType = manifest.body && manifest.body.data && manifest.body.data.mimeType ? manifest.body.data.mimeType : null; - var fileTypeText = Object.keys(fileTypes).includes(mimeType) ? fileTypes[mimeType] : 'Unknown'; + const mimeType = manifest.body && manifest.body.data && manifest.body.data.mimeType ? manifest.body.data.mimeType : null; + const fileTypeText = Object.keys(fileTypes).includes(mimeType) ? fileTypes[mimeType] : 'Unknown'; return /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body2", "data-selenium": "download-data-dialog.file-type" @@ -413,15 +381,15 @@ function DownloadDataDialog() { // This entire dialog component is launched by the Download Data Button component. // The button rendered here looks the same but only appears inside the dialog, // and actually executes the download (provided the context is in a complete state). - var renderDownloadButton = function renderDownloadButton() { - var disabled = true; - var buttonText = 'Download Data'; - var iconProps = { + const renderDownloadButton = () => { + let disabled = true; + let buttonText = 'Download Data'; + const iconProps = { style: { marginLeft: _Theme.default.spacing(1) } }; - var icon = /*#__PURE__*/_react.default.createElement(_SaveAlt.default, iconProps); + let icon = /*#__PURE__*/_react.default.createElement(_SaveAlt.default, iconProps); if (allStepsComplete) { if (fromAOPManifest) { disabled = false; @@ -452,7 +420,7 @@ function DownloadDataDialog() { } } } - var appliedDownloadButtonStyle = { + let appliedDownloadButtonStyle = { whiteSpace: 'nowrap' }; if (belowSmMd) { @@ -473,12 +441,12 @@ function DownloadDataDialog() { className: classes.gtmCaptureButton }, buttonText, icon); }; - var renderAuthSuggestion = function renderAuthSuggestion() { + const renderAuthSuggestion = () => { if (isAuthenticated) { return null; } /* eslint-disable react/jsx-one-expression-per-line */ - var authStyles = { + const authStyles = { color: _Theme.COLORS.GOLD[800], textAlign: 'right' }; @@ -504,19 +472,14 @@ function DownloadDataDialog() { }, "Learn"), " the benefits of having an account."), /*#__PURE__*/_react.default.createElement(_NeonSignInButton.default, null)); /* eslint-enable react/jsx-one-expression-per-line */ }; - - var renderDownloadButtonStepNote = function renderDownloadButtonStepNote() { - var showDownloadButton = fromManifest || fromAOPManifest; + const renderDownloadButtonStepNote = () => { + const showDownloadButton = fromManifest || fromAOPManifest; if (!showDownloadButton) { return null; } - var completableSteps = requiredSteps.filter(function (step) { - return step.key !== 'summary'; - }); - var completedSteps = requiredSteps.filter(function (step) { - return step.key !== 'summary' && step.isComplete; - }); - var noDataAvailable = fromManifest && (manifest.status === 'fetched' || manifest.status === 'no-data') && !(manifest.sizeEstimate > 0) || fromAOPManifest && !(s3Files.totalSize > 0); + const completableSteps = requiredSteps.filter(step => step.key !== 'summary'); + const completedSteps = requiredSteps.filter(step => step.key !== 'summary' && step.isComplete); + const noDataAvailable = fromManifest && (manifest.status === 'fetched' || manifest.status === 'no-data') && !(manifest.sizeEstimate > 0) || fromAOPManifest && !(s3Files.totalSize > 0); if (!allStepsComplete) { return /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body2", @@ -534,9 +497,9 @@ function DownloadDataDialog() { } }, noDataAvailable ? 'No data selected.' : 'All steps completed.'); }; - var renderActions = function renderActions() { - var divClass = belowSm ? classes.startFlex : classes.endFlex; - var showDownloadButton = fromManifest || fromAOPManifest; + const renderActions = () => { + const divClass = belowSm ? classes.startFlex : classes.endFlex; + const showDownloadButton = fromManifest || fromAOPManifest; if (belowSm) { return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Grid.default, { container: true, @@ -571,8 +534,8 @@ function DownloadDataDialog() { } }, renderDownloadButtonStepNote(), renderAuthSuggestion())); } - var appliedActionsContainerStyles = {}; - var appliedDismissActionStyle = { + let appliedActionsContainerStyles = {}; + let appliedDismissActionStyle = { marginRight: _Theme.default.spacing(showDownloadButton ? 1 : 0) }; if (showDownloadButton && belowSmMd) { @@ -606,52 +569,42 @@ function DownloadDataDialog() { className: classes.gtmCaptureButton }, showDownloadButton ? 'Cancel' : 'Done'), showDownloadButton ? renderDownloadButton() : null), renderDownloadButtonStepNote(), renderAuthSuggestion()); }; - var renderStepNavButtons = function renderStepNavButtons() { - return /*#__PURE__*/_react.default.createElement("div", { - style: { - whiteSpace: 'nowrap' - } - }, /*#__PURE__*/_react.default.createElement(_Button.default, { - "data-selenium": "download-data-dialog.step-nav-button.previous", - variant: "outlined", - "aria-label": "Previous", - disabled: activeStepIndex === 0, - onClick: function onClick() { - return changeToStep(activeStepIndex - 1); - }, - startIcon: /*#__PURE__*/_react.default.createElement(_ChevronLeft.default, null) - }, belowSm ? null : 'Back'), /*#__PURE__*/_react.default.createElement(_Button.default, { - "data-selenium": "download-data-dialog.step-nav-button.next", - variant: "outlined", - "aria-label": "Next", - disabled: activeStepIndex === requiredSteps.length - 1, - style: { - marginLeft: _Theme.default.spacing(1) - }, - onClick: function onClick() { - return changeToStep(activeStepIndex + 1); - }, - endIcon: /*#__PURE__*/_react.default.createElement(_ChevronRight.default, null) - }, belowSm ? null : 'Next')); - }; - var renderStepper = function renderStepper() { + const renderStepNavButtons = () => /*#__PURE__*/_react.default.createElement("div", { + style: { + whiteSpace: 'nowrap' + } + }, /*#__PURE__*/_react.default.createElement(_Button.default, { + "data-selenium": "download-data-dialog.step-nav-button.previous", + variant: "outlined", + "aria-label": "Previous", + disabled: activeStepIndex === 0, + onClick: () => changeToStep(activeStepIndex - 1), + startIcon: /*#__PURE__*/_react.default.createElement(_ChevronLeft.default, null) + }, belowSm ? null : 'Back'), /*#__PURE__*/_react.default.createElement(_Button.default, { + "data-selenium": "download-data-dialog.step-nav-button.next", + variant: "outlined", + "aria-label": "Next", + disabled: activeStepIndex === requiredSteps.length - 1, + style: { + marginLeft: _Theme.default.spacing(1) + }, + onClick: () => changeToStep(activeStepIndex + 1), + endIcon: /*#__PURE__*/_react.default.createElement(_ChevronRight.default, null) + }, belowSm ? null : 'Next')); + const renderStepper = () => { if (requiredSteps.length < 2) { return null; } - var hideLabel = requiredSteps.length > 5 && belowMdStepper || requiredSteps.length <= 5 && belowSmMdStepper; + const hideLabel = requiredSteps.length > 5 && belowMdStepper || requiredSteps.length <= 5 && belowSmMdStepper; if (belowSm) { - var maxSteps = requiredSteps.length; - var buttonProps = { + const maxSteps = requiredSteps.length; + const buttonProps = { size: 'small', color: 'primary', variant: 'contained' }; - var handleBack = function handleBack() { - return changeToStep(activeStepIndex - 1); - }; - var handleNext = function handleNext() { - return changeToStep(activeStepIndex + 1); - }; + const handleBack = () => changeToStep(activeStepIndex - 1); + const handleNext = () => changeToStep(activeStepIndex + 1); return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_MobileStepper.default, { steps: maxSteps, variant: "dots", @@ -669,13 +622,12 @@ function DownloadDataDialog() { return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Stepper.default, { nonLinear: true, "data-selenium": "download-data-dialog.stepper" - }, requiredSteps.map(function (step, index) { - var _getStep = getStep(index), - label = _getStep.label; - var buttonProps = { - onClick: function onClick() { - return changeToStep(index); - } + }, requiredSteps.map((step, index) => { + const { + label + } = getStep(index); + const buttonProps = { + onClick: () => changeToStep(index) }; if (step.isComplete === true && activeStepIndex !== index) { buttonProps.className = classes.completedInactive; @@ -699,7 +651,7 @@ function DownloadDataDialog() { }, /*#__PURE__*/_react.default.createElement(_StepButton.default, buttonProps, hideLabel ? null : label))); })), /*#__PURE__*/_react.default.createElement(_Divider.default, null)); }; - var renderActiveStep = function renderActiveStep() { + const renderActiveStep = () => { if (!requiredSteps.length) { return null; } @@ -721,7 +673,7 @@ function DownloadDataDialog() { stepKey: requiredSteps[activeStepIndex].key }))); } - var titleMarker = requiredSteps[activeStepIndex].key === 'summary' ? /*#__PURE__*/_react.default.createElement(_Stars.default, { + const titleMarker = requiredSteps[activeStepIndex].key === 'summary' ? /*#__PURE__*/_react.default.createElement(_Stars.default, { className: classes.summaryIconTitleMarker }) : /*#__PURE__*/_react.default.createElement(_Chip.default, { color: "primary", @@ -751,98 +703,78 @@ function DownloadDataDialog() { }; // Google Tag Manager variables - var getStepsCompleted = function getStepsCompleted() { - return requiredSteps.filter(function (step) { - return step.isComplete === true; - }).map(function (step) { - return step.key; - }); - }; - var getStepsNotCompleted = function getStepsNotCompleted() { - return requiredSteps.filter(function (step) { - return step.isComplete === false; - }).map(function (step) { - return step.key; - }); - }; - var getStepCompletionPercentage = function getStepCompletionPercentage() { - var completed = getStepsCompleted(); - var notCompleted = getStepsNotCompleted(); - var total = completed.length + notCompleted.length; + const getStepsCompleted = () => requiredSteps.filter(step => step.isComplete === true).map(step => step.key); + const getStepsNotCompleted = () => requiredSteps.filter(step => step.isComplete === false).map(step => step.key); + const getStepCompletionPercentage = () => { + const completed = getStepsCompleted(); + const notCompleted = getStepsNotCompleted(); + const total = completed.length + notCompleted.length; return total ? completed.length / total * 100 : 0; }; - var getLZWCompressedConfig = function getLZWCompressedConfig() { + const getLZWCompressedConfig = () => { if (!allStepsComplete) { return ''; } // The subset of possible steps we actually want to persist in the GA event - var eventSteps = ['sites', 'dateRange']; - if (requiredSteps.some(function (step) { - return step.key === 'documentation'; - })) { + const eventSteps = ['sites', 'dateRange']; + if (requiredSteps.some(step => step.key === 'documentation')) { eventSteps.push('documentation'); } - if (requiredSteps.some(function (step) { - return step.key === 'packageType'; - })) { + if (requiredSteps.some(step => step.key === 'packageType')) { eventSteps.push('packageType'); } - if (requiredSteps.some(function (step) { - return step.key === 'provisionalData'; - })) { + if (requiredSteps.some(step => step.key === 'provisionalData')) { eventSteps.push('provisionalData'); } // Build the config for reporting - var eventValues = { - sites: sites, - dateRange: dateRange, - documentation: documentation, - packageType: packageType, - provisionalData: provisionalData + const eventValues = { + sites, + dateRange, + documentation, + packageType, + provisionalData }; - var eventConfig = { + const eventConfig = { productCode: productData.productCode }; - eventSteps.forEach(function (step) { + eventSteps.forEach(step => { eventConfig[step] = eventValues[step].value; }); // Stringify, compress, and return return _nodeLzw.default.encode(JSON.stringify(eventConfig)); }; - var renderGtmTags = function renderGtmTags() { - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("input", { - type: "hidden", - "data-gtm": "download-data-dialog.product-code", - value: productData.productCode - }), /*#__PURE__*/_react.default.createElement("input", { - type: "hidden", - "data-gtm": "download-data-dialog.size-estimate-bytes", - value: getSizeEstimateBytes() - }), /*#__PURE__*/_react.default.createElement("input", { - type: "hidden", - "data-gtm": "download-data-dialog.steps-completed", - value: getStepsCompleted().join(', ') - }), /*#__PURE__*/_react.default.createElement("input", { - type: "hidden", - "data-gtm": "download-data-dialog.steps-not-completed", - value: getStepsNotCompleted().join(', ') - }), /*#__PURE__*/_react.default.createElement("input", { - type: "hidden", - "data-gtm": "download-data-dialog.step-completion-percentage", - value: getStepCompletionPercentage() - }), /*#__PURE__*/_react.default.createElement("input", { - type: "hidden", - "data-gtm": "download-data-dialog.download-executed", - value: downloadExecuted ? 1 : 0 - }), /*#__PURE__*/_react.default.createElement("input", { - type: "hidden", - "data-gtm": "download-data-dialog.lzw-compressed-config", - value: getLZWCompressedConfig() - })); - }; - var releaseTooltip = release.value === null ? "You are downloading only the latest released and provisional data (release: ".concat(latestRelease || 'unknown', ").") : "You are downloading product data only from the ".concat(release.value, " release (no provisional data will be included)."); - var releaseChipLabel = release.value === null ? 'Latest released and provisional data' : "Release: ".concat(release.value); - var releaseChipLabelStyle = belowSmMd && !belowSm ? { + const renderGtmTags = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("input", { + type: "hidden", + "data-gtm": "download-data-dialog.product-code", + value: productData.productCode + }), /*#__PURE__*/_react.default.createElement("input", { + type: "hidden", + "data-gtm": "download-data-dialog.size-estimate-bytes", + value: getSizeEstimateBytes() + }), /*#__PURE__*/_react.default.createElement("input", { + type: "hidden", + "data-gtm": "download-data-dialog.steps-completed", + value: getStepsCompleted().join(', ') + }), /*#__PURE__*/_react.default.createElement("input", { + type: "hidden", + "data-gtm": "download-data-dialog.steps-not-completed", + value: getStepsNotCompleted().join(', ') + }), /*#__PURE__*/_react.default.createElement("input", { + type: "hidden", + "data-gtm": "download-data-dialog.step-completion-percentage", + value: getStepCompletionPercentage() + }), /*#__PURE__*/_react.default.createElement("input", { + type: "hidden", + "data-gtm": "download-data-dialog.download-executed", + value: downloadExecuted ? 1 : 0 + }), /*#__PURE__*/_react.default.createElement("input", { + type: "hidden", + "data-gtm": "download-data-dialog.lzw-compressed-config", + value: getLZWCompressedConfig() + })); + const releaseTooltip = release.value === null ? "You are downloading only the latest released and provisional data (release: ".concat(latestRelease || 'unknown', ").") : "You are downloading product data only from the ".concat(release.value, " release (no provisional data will be included)."); + const releaseChipLabel = release.value === null ? 'Latest released and provisional data' : "Release: ".concat(release.value); + const releaseChipLabelStyle = belowSmMd && !belowSm ? { whiteSpace: 'break-spaces' } : {}; return /*#__PURE__*/_react.default.createElement(_DialogBase.default, { @@ -890,17 +822,15 @@ function DownloadDataDialog() { }, /*#__PURE__*/_react.default.createElement(_Chip.default, { label: productData.productCode, className: classes.productCodeChip - })), (productData.themes || []).map(function (dataTheme) { - return /*#__PURE__*/_react.default.createElement("div", { - key: dataTheme, - style: { - marginLeft: _Theme.default.spacing(1.5) - } - }, /*#__PURE__*/_react.default.createElement(_DataThemeIcon.default, { - size: 3, - theme: dataTheme - })); - })), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_ReleaseChip.default, { + })), (productData.themes || []).map(dataTheme => /*#__PURE__*/_react.default.createElement("div", { + key: dataTheme, + style: { + marginLeft: _Theme.default.spacing(1.5) + } + }, /*#__PURE__*/_react.default.createElement(_DataThemeIcon.default, { + size: 3, + theme: dataTheme + })))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_ReleaseChip.default, { chipLabel: /*#__PURE__*/_react.default.createElement("span", { style: releaseChipLabelStyle }, releaseChipLabel), diff --git a/lib/components/DownloadDataDialog/index.js b/lib/components/DownloadDataDialog/index.js index 092ae1a6..041baa1c 100644 --- a/lib/components/DownloadDataDialog/index.js +++ b/lib/components/DownloadDataDialog/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _DownloadDataDialog.default; } }); diff --git a/lib/components/DownloadStepForm/DownloadStepForm.js b/lib/components/DownloadStepForm/DownloadStepForm.js index 79317655..6661fa9b 100644 --- a/lib/components/DownloadStepForm/DownloadStepForm.js +++ b/lib/components/DownloadStepForm/DownloadStepForm.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -49,197 +48,197 @@ var _RouteService = _interopRequireDefault(require("../../service/RouteService") var _manifestUtil = require("../../util/manifestUtil"); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* eslint-disable react/no-unstable-nested-components */ -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - copyButton: { - marginLeft: theme.spacing(2) - }, - fileTable: { - position: 'relative', - '& td': { - whiteSpace: 'nowrap' - }, - '& label + .MuiInput-formControl': { - marginTop: '0px' - } - }, - formControlBold: { - '& span': { - fontWeight: 600 - } - }, - loadingOverlay: { - position: 'absolute', - width: '100%', - height: '100%', - textAlign: 'center', - top: 0, - left: 0, - zIndex: 10, - paddingTop: theme.spacing(14), - backgroundColor: 'rgba(255, 255, 255, 0.75)' - }, - calloutIcon: { - color: theme.palette.grey[300], - marginRight: theme.spacing(2) - }, - radio: { - marginBottom: theme.spacing(1) - }, - radioLabel: { - marginTop: theme.spacing(1.5) - }, - showColumnsLabel: { - backgroundColor: theme.palette.grey[50], - '& span': { - color: '#000' - } - }, - startFlex: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center' - }, - stepSummary: { - marginBottom: theme.spacing(3) - }, - stepSummaryHeader: { - userSelect: 'none', - cursor: 'pointer', - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center', - marginBottom: theme.spacing(1) - }, - stepSummaryContent: { - marginLeft: theme.spacing(4.25) - }, - summaryChip: { - cursor: 'pointer', - marginTop: theme.spacing(0.25), - marginRight: theme.spacing(1), - fontSize: '1rem', - fontWeight: 600, - height: theme.spacing(3), - '& span': { - padding: theme.spacing(0, 1) - } - }, - summaryText: { - fontSize: '1.2rem' +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/no-unstable-nested-components */ +const useStyles = (0, _styles.makeStyles)(theme => ({ + copyButton: { + marginLeft: theme.spacing(2) + }, + fileTable: { + position: 'relative', + '& td': { + whiteSpace: 'nowrap' }, - summaryTextIncomplete: { - fontSize: '1.2rem', - fontStyle: 'italic', - color: theme.palette.error.main + '& label + .MuiInput-formControl': { + marginTop: '0px' } - }; -}); -var dataUsageAndCitationPoliciesLink = /*#__PURE__*/_react.default.createElement(_Link.default, { + }, + formControlBold: { + '& span': { + fontWeight: 600 + } + }, + loadingOverlay: { + position: 'absolute', + width: '100%', + height: '100%', + textAlign: 'center', + top: 0, + left: 0, + zIndex: 10, + paddingTop: theme.spacing(14), + backgroundColor: 'rgba(255, 255, 255, 0.75)' + }, + calloutIcon: { + color: theme.palette.grey[300], + marginRight: theme.spacing(2) + }, + radio: { + marginBottom: theme.spacing(1) + }, + radioLabel: { + marginTop: theme.spacing(1.5) + }, + showColumnsLabel: { + backgroundColor: theme.palette.grey[50], + '& span': { + color: '#000' + } + }, + startFlex: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center' + }, + stepSummary: { + marginBottom: theme.spacing(3) + }, + stepSummaryHeader: { + userSelect: 'none', + cursor: 'pointer', + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center', + marginBottom: theme.spacing(1) + }, + stepSummaryContent: { + marginLeft: theme.spacing(4.25) + }, + summaryChip: { + cursor: 'pointer', + marginTop: theme.spacing(0.25), + marginRight: theme.spacing(1), + fontSize: '1rem', + fontWeight: 600, + height: theme.spacing(3), + '& span': { + padding: theme.spacing(0, 1) + } + }, + summaryText: { + fontSize: '1.2rem' + }, + summaryTextIncomplete: { + fontSize: '1.2rem', + fontStyle: 'italic', + color: theme.palette.error.main + } +})); +const dataUsageAndCitationPoliciesLink = /*#__PURE__*/_react.default.createElement(_Link.default, { target: "_blank", href: _RouteService.default.getDataPoliciesPath(), "data-gtm": "download-data-dialog.policies-link" }, "Data Usage and Citation Policies"); -var renderStepSummary = { - sitesAndDateRange: function sitesAndDateRange(classes, state) { - var sites = state.sites.value; - var dateRange = state.dateRange.value; - var sitesPlural = sites.length > 1 ? 's' : ''; - var getYearMonthMoment = function getYearMonthMoment(yearMonth) { - return (0, _moment.default)("".concat(yearMonth, "-01")); - }; - var startDateRange = "".concat(getYearMonthMoment(dateRange[0]).format('MMM YYYY')); - var endDateRange = "".concat(getYearMonthMoment(dateRange[1]).format('MMM YYYY')); - var humanDateRange = "".concat(startDateRange, " - ").concat(endDateRange); - var siteChipLabel = "".concat(sites.length, " site").concat(sitesPlural, " \u2014 ").concat(humanDateRange); +const renderStepSummary = { + sitesAndDateRange: (classes, state) => { + const { + value: sites + } = state.sites; + const { + value: dateRange + } = state.dateRange; + const sitesPlural = sites.length > 1 ? 's' : ''; + const getYearMonthMoment = yearMonth => (0, _moment.default)("".concat(yearMonth, "-01")); + const startDateRange = "".concat(getYearMonthMoment(dateRange[0]).format('MMM YYYY')); + const endDateRange = "".concat(getYearMonthMoment(dateRange[1]).format('MMM YYYY')); + const humanDateRange = "".concat(startDateRange, " - ").concat(endDateRange); + const siteChipLabel = "".concat(sites.length, " site").concat(sitesPlural, " \u2014 ").concat(humanDateRange); return /*#__PURE__*/_react.default.createElement(_SiteChip.default, { size: "large", variant: "default", label: siteChipLabel }); }, - documentation: function documentation(classes, state) { - var documentation = state.documentation.value; + documentation: (classes, state) => { + const { + value: documentation + } = state.documentation; return /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body2", className: classes.summaryText }, "".concat(documentation.charAt(0).toUpperCase()).concat(documentation.substring(1))); }, - packageType: function packageType(classes, state) { - var packageType = state.packageType.value; + packageType: (classes, state) => { + const { + value: packageType + } = state.packageType; return /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body2", className: classes.summaryText }, "".concat(packageType.charAt(0).toUpperCase()).concat(packageType.substring(1))); }, - provisionalData: function provisionalData(classes, state) { - var provisionalData = state.provisionalData.value; + provisionalData: (classes, state) => { + const { + value: provisionalData + } = state.provisionalData; return /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body2", className: classes.summaryText }, "".concat(provisionalData.charAt(0).toUpperCase()).concat(provisionalData.substring(1))); }, - s3Files: function s3Files(classes, state) { - var _state$s3Files = state.s3Files, - files = _state$s3Files.value, - totalSize = _state$s3Files.totalSize; + s3Files: (classes, state) => { + const { + value: files, + totalSize + } = state.s3Files; return /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body2", className: classes.summaryText }, "".concat(files.length, " file").concat(files.length === 1 ? '' : 's', " (").concat((0, _manifestUtil.formatBytes)(totalSize), " uncompressed)")); } }; -var DownloadStepForm = function DownloadStepForm(props) { - var classes = useStyles(_Theme.default); - var stepKey = props.stepKey, - changeToStep = props.changeToStep, - changeToNextUncompletedStep = props.changeToNextUncompletedStep, - renderDownloadButton = props.renderDownloadButton; - var _DownloadDataContext$ = _DownloadDataContext.default.useDownloadDataState(), - _DownloadDataContext$2 = _slicedToArray(_DownloadDataContext$, 2), - state = _DownloadDataContext$2[0], - dispatch = _DownloadDataContext$2[1]; - var release = state.release; - var delineateAvaRelease = _ReleaseService.default.determineDelineateAvaRelease(release.value); +const DownloadStepForm = props => { + const classes = useStyles(_Theme.default); + const { + stepKey, + changeToStep, + changeToNextUncompletedStep, + renderDownloadButton + } = props; + const [state, dispatch] = _DownloadDataContext.default.useDownloadDataState(); + const { + release + } = state; + const delineateAvaRelease = _ReleaseService.default.determineDelineateAvaRelease(release.value); // Effect to keep focus on the file name search field if it was the last filter updated - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (state.s3Files.lastFilterChanged !== 'name') { return; } - var mTable = document.querySelector('#s3Files-selection-table-container'); + const mTable = document.querySelector('#s3Files-selection-table-container'); if (!mTable) { return; } - var nameSearch = mTable.querySelector('input[type="search"]'); + const nameSearch = mTable.querySelector('input[type="search"]'); if (!nameSearch) { return; } nameSearch.focus(); }); - var setState = function setState(stateKey, newValue) { - return dispatch({ - type: 'setValidatableValue', - key: stateKey, - value: newValue - }); - }; - var renderSitesAndDateRangeStep = function renderSitesAndDateRangeStep() { - var requiredSteps = state.requiredSteps, - provisionalData = state.provisionalData; - var hasProvisionalDataStep = requiredSteps.some(function (step) { - return step.key === 'provisionalData'; - }); - var excludeProvisionalData = hasProvisionalDataStep && provisionalData.value === 'exclude'; + const setState = (stateKey, newValue) => dispatch({ + type: 'setValidatableValue', + key: stateKey, + value: newValue + }); + const renderSitesAndDateRangeStep = () => { + const { + requiredSteps, + provisionalData + } = state; + const hasProvisionalDataStep = requiredSteps.some(step => step.key === 'provisionalData'); + const excludeProvisionalData = hasProvisionalDataStep && provisionalData.value === 'exclude'; return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !excludeProvisionalData ? null : /*#__PURE__*/_react.default.createElement(_InfoMessageCard.default, { title: "Provisional Data", messageContent: /*#__PURE__*/_react.default.createElement(_Typography.default, { @@ -250,16 +249,17 @@ var DownloadStepForm = function DownloadStepForm(props) { delineateRelease: delineateAvaRelease })); }; - var renderDocumentationStep = function renderDocumentationStep() { - var neonFaqLink = /*#__PURE__*/_react.default.createElement(_Link.default, { + const renderDocumentationStep = () => { + const neonFaqLink = /*#__PURE__*/_react.default.createElement(_Link.default, { target: "_blank", href: _RouteService.default.getFaqPath(), "data-gtm": "download-data-dialog.neon-faq-link" }, "NEON FAQ"); - var knbLink = _ExternalHost.default.renderExternalHostLink('https://eml.ecoinformatics.org', 'KNB', 'KNB', state.productData.productCode); - var _state$documentation = state.documentation, - value = _state$documentation.value, - validValues = _state$documentation.validValues; + const knbLink = _ExternalHost.default.renderExternalHostLink('https://eml.ecoinformatics.org', 'KNB', 'KNB', state.productData.productCode); + const { + value, + validValues + } = state.documentation; return /*#__PURE__*/_react.default.createElement(_Grid.default, { container: true, spacing: 2, @@ -275,7 +275,7 @@ var DownloadStepForm = function DownloadStepForm(props) { "aria-label": "Documentation", name: "documentation", value: value || '', - onChange: function onChange(e) { + onChange: e => { setState('documentation', e.target.value); changeToNextUncompletedStep(); } @@ -318,15 +318,16 @@ var DownloadStepForm = function DownloadStepForm(props) { variant: "body1" }, "EML files for this Data Product are included in all downloads. Learn more about EML files in the ", neonFaqLink, " and at ", knbLink, "."))))); }; - var renderProvisionalDataStep = function renderProvisionalDataStep() { - var neonDataRevisionReleaseLink = /*#__PURE__*/_react.default.createElement(_Link.default, { + const renderProvisionalDataStep = () => { + const neonDataRevisionReleaseLink = /*#__PURE__*/_react.default.createElement(_Link.default, { target: "_blank", href: _RouteService.default.getDataRevisionsReleasePath(), "data-gtm": "download-data-dialog.neon-data-revisions-releases-link" }, "NEON Data Revisions and Releases"); - var _state$provisionalDat = state.provisionalData, - value = _state$provisionalDat.value, - validValues = _state$provisionalDat.validValues; + const { + value, + validValues + } = state.provisionalData; return /*#__PURE__*/_react.default.createElement(_Grid.default, { container: true, spacing: 2, @@ -342,7 +343,7 @@ var DownloadStepForm = function DownloadStepForm(props) { "aria-label": "Provisional Data", name: "provisional-data", value: value || '', - onChange: function onChange(e) { + onChange: e => { setState('provisionalData', e.target.value); changeToNextUncompletedStep(); } @@ -385,106 +386,91 @@ var DownloadStepForm = function DownloadStepForm(props) { variant: "body1" }, "Learn more about data product revisions, releases and provisional data at ", neonDataRevisionReleaseLink, "."))))); }; - var renderS3FilesStep = function renderS3FilesStep() { - var s3FileFetches = state.s3FileFetches, - s3FileFetchProgress = state.s3FileFetchProgress, - requiredSteps = state.requiredSteps, - provisionalData = state.provisionalData; - var _state$s3Files2 = state.s3Files, - selection = _state$s3Files2.value, - validValues = _state$s3Files2.validValues, - valueLookups = _state$s3Files2.valueLookups, - totalSize = _state$s3Files2.totalSize, - estimatedPostSize = _state$s3Files2.estimatedPostSize, - filters = _state$s3Files2.filters, - filteredFileCount = _state$s3Files2.filteredFileCount, - visibleColumns = _state$s3Files2.visibleColumns, - maxNumFilesSelected = _state$s3Files2.maxNumFilesSelected; - var isLoading = Object.keys(s3FileFetches).some(function (key) { - return ['awaitingFetchCall', 'fetching'].includes(s3FileFetches[key]); - }); - var hasProvisionalDataStep = requiredSteps.some(function (step) { - return step.key === 'provisionalData'; - }); - var excludeProvisionalData = hasProvisionalDataStep && provisionalData.value === 'exclude'; - var appliedValidValues = validValues; - var areProvDataExcluded = false; + const renderS3FilesStep = () => { + const { + s3FileFetches, + s3FileFetchProgress, + requiredSteps, + provisionalData + } = state; + const { + value: selection, + validValues, + valueLookups, + totalSize, + estimatedPostSize, + filters, + filteredFileCount, + visibleColumns, + maxNumFilesSelected + } = state.s3Files; + const isLoading = Object.keys(s3FileFetches).some(key => ['awaitingFetchCall', 'fetching'].includes(s3FileFetches[key])); + const hasProvisionalDataStep = requiredSteps.some(step => step.key === 'provisionalData'); + const excludeProvisionalData = hasProvisionalDataStep && provisionalData.value === 'exclude'; + let appliedValidValues = validValues; + let areProvDataExcluded = false; if (excludeProvisionalData) { - appliedValidValues = appliedValidValues.filter(function (value) { - var includeValue = (0, _typeUtil.isStringNonEmpty)(value.release) && !_ReleaseService.default.isNonRelease(value.release); + appliedValidValues = appliedValidValues.filter(value => { + const includeValue = (0, _typeUtil.isStringNonEmpty)(value.release) && !_ReleaseService.default.isNonRelease(value.release); if (!includeValue) { areProvDataExcluded = true; } return includeValue; }); } - var allowSelectAll = appliedValidValues.length <= maxNumFilesSelected; - var allowSelectFiltered = filteredFileCount <= maxNumFilesSelected; - var columns = [{ + const allowSelectAll = appliedValidValues.length <= maxNumFilesSelected; + const allowSelectFiltered = filteredFileCount <= maxNumFilesSelected; + const columns = [{ title: 'Site', field: 'site', lookup: valueLookups.site, defaultFilter: filters.site || [], hidden: !visibleColumns.includes('site'), - render: function render(row) { - return row.site; - } + render: row => row.site }, { title: 'Date', field: 'yearMonth', lookup: valueLookups.yearMonth, defaultFilter: filters.yearMonth || [], hidden: !visibleColumns.includes('date'), - render: function render(row) { - return row.yearMonth; - } + render: row => row.yearMonth }, { title: 'Visit', field: 'visit', lookup: valueLookups.visit, defaultFilter: filters.visit || [], hidden: !visibleColumns.includes('visit'), - render: function render(row) { - return row.visit; - } + render: row => row.visit }, { title: 'Name', field: 'name', defaultFilter: filters.name || '', hidden: !visibleColumns.includes('name'), - render: function render(row) { - return row.name; - } + render: row => row.name }, { title: 'Type', field: 'type', lookup: valueLookups.type, defaultFilter: filters.type || [], hidden: !visibleColumns.includes('type'), - render: function render(row) { - return row.type; - } + render: row => row.type }, { title: 'Size', field: 'size', filtering: false, removable: false, - render: function render(row) { - return (0, _manifestUtil.formatBytes)(row.size); - } + render: row => (0, _manifestUtil.formatBytes)(row.size) }]; - var debouncedFilterDispatch = (0, _lodash.debounce)(function (filter, value) { + const debouncedFilterDispatch = (0, _lodash.debounce)((filter, value) => { dispatch({ type: 'setS3FilesFilterValue', - filter: filter, - value: value + filter, + value }); }, 200); - var noFiltersApplied = Object.keys(filters).every(function (col) { - return !filters[col].length; - }); + const noFiltersApplied = Object.keys(filters).every(col => !filters[col].length); /* eslint-disable react/jsx-one-expression-per-line */ - var postSizeError = estimatedPostSize >= _manifestUtil.MAX_POST_BODY_SIZE ? /*#__PURE__*/_react.default.createElement(_Grid.default, { + const postSizeError = estimatedPostSize >= _manifestUtil.MAX_POST_BODY_SIZE ? /*#__PURE__*/_react.default.createElement(_Grid.default, { item: true, xs: 12 }, /*#__PURE__*/_react.default.createElement(_Card.default, { @@ -507,7 +493,7 @@ var DownloadStepForm = function DownloadStepForm(props) { variant: "body1" }, "Too many files requested! Current selection will make an estimated ", /*#__PURE__*/_react.default.createElement("b", null, (0, _manifestUtil.formatBytes)(estimatedPostSize)), " request; max size is ", /*#__PURE__*/_react.default.createElement("b", null, (0, _manifestUtil.formatBytes)(_manifestUtil.MAX_POST_BODY_SIZE)), ". Please select fewer files in order to proceed.")))) : null; /* eslint-disable react/jsx-one-expression-per-line */ - var tooManyFilesWarning = !allowSelectAll && !allowSelectFiltered ? /*#__PURE__*/_react.default.createElement(_Grid.default, { + const tooManyFilesWarning = !allowSelectAll && !allowSelectFiltered ? /*#__PURE__*/_react.default.createElement(_Grid.default, { item: true, xs: 12 }, /*#__PURE__*/_react.default.createElement(_Card.default, { @@ -529,176 +515,170 @@ var DownloadStepForm = function DownloadStepForm(props) { }), /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body1" }, "Too many files available for bulk selection. Please narrow your selection by selecting fewer sites, a more restrictive date range, or a more restrictive set of filters.")))) : null; - var filterButtonLoadingLabel = " (".concat(isLoading ? '…' : filteredFileCount, ")"); - var filterButtonLabel = noFiltersApplied ? '' : filterButtonLoadingLabel; - var components = { + const filterButtonLoadingLabel = " (".concat(isLoading ? '…' : filteredFileCount, ")"); + const filterButtonLabel = noFiltersApplied ? '' : filterButtonLoadingLabel; + const components = { Container: _Box.default, - Toolbar: function Toolbar(toolbarProps) { - return /*#__PURE__*/_react.default.createElement(_Grid.default, { - container: true, - spacing: 2, - alignItems: "flex-start", - style: { - marginBottom: '24px' - } - }, /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 12, - md: 6 - }, /*#__PURE__*/_react.default.createElement("div", { - style: { - marginBottom: _Theme.default.spacing(1) - } - }, /*#__PURE__*/_react.default.createElement(_ToggleButtonGroup.default, { - size: "small", - value: visibleColumns, - onChange: function onChange(event, newVisibleColumns) { - return dispatch({ - type: 'setS3FilesVisibleColumns', - visibleColumns: newVisibleColumns - }); - }, - "aria-label": "show and hide columns", - "data-selenium": "download-data-dialog.s3-files.show-hide-columns-button-group" - }, /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - value: "label", - className: classes.showColumnsLabel, - disabled: true - }, "Show Columns:"), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - value: "site" - }, "Site"), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - value: "visit" - }, "Visit"), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - value: "date" - }, "Date"), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - value: "name" - }, "Name"), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - value: "type" - }, "Type"))), /*#__PURE__*/_react.default.createElement("div", { - style: { - marginBottom: _Theme.default.spacing(1) - } - }, /*#__PURE__*/_react.default.createElement(_Button.default, { - "data-selenium": "download-data-dialog.s3-files.select-all-button", - size: "small", - color: "primary", - variant: "outlined", - onClick: function onClick() { - dispatch({ - type: 'setS3FilesValueSelectAll' - }); - }, - disabled: isLoading || !appliedValidValues.length || !allowSelectAll, - style: { - whiteSpace: 'nowrap' - } - }, /*#__PURE__*/_react.default.createElement(_DoneAll.default, { - fontSize: "small", - style: { - marginRight: _Theme.default.spacing(1) - } - }), "Select All (", isLoading ? '…' : appliedValidValues.length, ")"), /*#__PURE__*/_react.default.createElement(_Button.default, { - "data-selenium": "download-data-dialog.s3-files.select-none-button", - size: "small", - color: "primary", - variant: "outlined", - onClick: function onClick() { - dispatch({ - type: 'setS3FilesValueSelectNone' - }); - }, - disabled: isLoading || !appliedValidValues.length, - style: { - marginLeft: _Theme.default.spacing(1), - whiteSpace: 'nowrap' - } - }, /*#__PURE__*/_react.default.createElement(_Clear.default, { - fontSize: "small", - style: { - marginRight: _Theme.default.spacing(1) - } - }), "Select None")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.default, { - "data-selenium": "download-data-dialog.s3-files.select-filtered-button", - size: "small", - color: "primary", - variant: "outlined", - onClick: function onClick() { - dispatch({ - type: 'setS3FilesValueSelectFiltered' - }); - }, - disabled: noFiltersApplied || isLoading || !allowSelectFiltered, - style: { - whiteSpace: 'nowrap' - } - }, /*#__PURE__*/_react.default.createElement(_FilterList.default, { - fontSize: "small", - style: { - marginRight: _Theme.default.spacing(1) + Toolbar: toolbarProps => /*#__PURE__*/_react.default.createElement(_Grid.default, { + container: true, + spacing: 2, + alignItems: "flex-start", + style: { + marginBottom: '24px' + } + }, /*#__PURE__*/_react.default.createElement(_Grid.default, { + item: true, + xs: 12, + md: 6 + }, /*#__PURE__*/_react.default.createElement("div", { + style: { + marginBottom: _Theme.default.spacing(1) + } + }, /*#__PURE__*/_react.default.createElement(_ToggleButtonGroup.default, { + size: "small", + value: visibleColumns, + onChange: (event, newVisibleColumns) => dispatch({ + type: 'setS3FilesVisibleColumns', + visibleColumns: newVisibleColumns + }), + "aria-label": "show and hide columns", + "data-selenium": "download-data-dialog.s3-files.show-hide-columns-button-group" + }, /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + value: "label", + className: classes.showColumnsLabel, + disabled: true + }, "Show Columns:"), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + value: "site" + }, "Site"), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + value: "visit" + }, "Visit"), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + value: "date" + }, "Date"), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + value: "name" + }, "Name"), /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + value: "type" + }, "Type"))), /*#__PURE__*/_react.default.createElement("div", { + style: { + marginBottom: _Theme.default.spacing(1) + } + }, /*#__PURE__*/_react.default.createElement(_Button.default, { + "data-selenium": "download-data-dialog.s3-files.select-all-button", + size: "small", + color: "primary", + variant: "outlined", + onClick: () => { + dispatch({ + type: 'setS3FilesValueSelectAll' + }); + }, + disabled: isLoading || !appliedValidValues.length || !allowSelectAll, + style: { + whiteSpace: 'nowrap' + } + }, /*#__PURE__*/_react.default.createElement(_DoneAll.default, { + fontSize: "small", + style: { + marginRight: _Theme.default.spacing(1) + } + }), "Select All (", isLoading ? '…' : appliedValidValues.length, ")"), /*#__PURE__*/_react.default.createElement(_Button.default, { + "data-selenium": "download-data-dialog.s3-files.select-none-button", + size: "small", + color: "primary", + variant: "outlined", + onClick: () => { + dispatch({ + type: 'setS3FilesValueSelectNone' + }); + }, + disabled: isLoading || !appliedValidValues.length, + style: { + marginLeft: _Theme.default.spacing(1), + whiteSpace: 'nowrap' + } + }, /*#__PURE__*/_react.default.createElement(_Clear.default, { + fontSize: "small", + style: { + marginRight: _Theme.default.spacing(1) + } + }), "Select None")), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.default, { + "data-selenium": "download-data-dialog.s3-files.select-filtered-button", + size: "small", + color: "primary", + variant: "outlined", + onClick: () => { + dispatch({ + type: 'setS3FilesValueSelectFiltered' + }); + }, + disabled: noFiltersApplied || isLoading || !allowSelectFiltered, + style: { + whiteSpace: 'nowrap' + } + }, /*#__PURE__*/_react.default.createElement(_FilterList.default, { + fontSize: "small", + style: { + marginRight: _Theme.default.spacing(1) + } + }), "Select Filtered", filterButtonLabel), /*#__PURE__*/_react.default.createElement(_Button.default, { + "data-selenium": "download-data-dialog.s3-files.clear-filters-button", + size: "small", + color: "primary", + variant: "outlined", + disabled: noFiltersApplied || isLoading, + onClick: () => { + dispatch({ + type: 'clearS3FilesFilterValues' + }); + }, + style: { + marginLeft: _Theme.default.spacing(1), + whiteSpace: 'nowrap' + } + }, /*#__PURE__*/_react.default.createElement(_DeleteSweep.default, { + fontSize: "small", + style: { + marginRight: _Theme.default.spacing(1) + } + }), "Clear Filters"))), /*#__PURE__*/_react.default.createElement(_Grid.default, { + item: true, + xs: 12, + md: 6 + }, /*#__PURE__*/_react.default.createElement(_materialTable.MTableToolbar, toolbarProps)), postSizeError, tooManyFilesWarning, !excludeProvisionalData || !areProvDataExcluded ? null : /*#__PURE__*/_react.default.createElement("div", { + style: { + marginLeft: '8px', + marginRight: '8px', + width: '100%' + } + }, /*#__PURE__*/_react.default.createElement(_InfoMessageCard.default, { + title: "Provisional Data", + messageContent: /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "body1" + }, "Provisional data are currently being excluded from selection. To make those data available for selection, include those data from within the Provisional Data step.") + }))), + FilterRow: filterRowProps => /*#__PURE__*/_react.default.createElement(_materialTable.MTableFilterRow, _extends({}, filterRowProps, { + onFilterChanged: (columnId, value) => { + const { + onFilterChanged + } = filterRowProps; + onFilterChanged(columnId, value); + const filter = columns[columnId].field; + const current = filters[filter]; + if (filter === 'name' && value !== current) { + debouncedFilterDispatch(filter, value); + return; } - }), "Select Filtered", filterButtonLabel), /*#__PURE__*/_react.default.createElement(_Button.default, { - "data-selenium": "download-data-dialog.s3-files.clear-filters-button", - size: "small", - color: "primary", - variant: "outlined", - disabled: noFiltersApplied || isLoading, - onClick: function onClick() { + if (current && (value.length !== current.length || value.some(v => !current.includes(v)))) { dispatch({ - type: 'clearS3FilesFilterValues' + type: 'setS3FilesFilterValue', + filter, + value }); - }, - style: { - marginLeft: _Theme.default.spacing(1), - whiteSpace: 'nowrap' - } - }, /*#__PURE__*/_react.default.createElement(_DeleteSweep.default, { - fontSize: "small", - style: { - marginRight: _Theme.default.spacing(1) - } - }), "Clear Filters"))), /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 12, - md: 6 - }, /*#__PURE__*/_react.default.createElement(_materialTable.MTableToolbar, toolbarProps)), postSizeError, tooManyFilesWarning, !excludeProvisionalData || !areProvDataExcluded ? null : /*#__PURE__*/_react.default.createElement("div", { - style: { - marginLeft: '8px', - marginRight: '8px', - width: '100%' } - }, /*#__PURE__*/_react.default.createElement(_InfoMessageCard.default, { - title: "Provisional Data", - messageContent: /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "body1" - }, "Provisional data are currently being excluded from selection. To make those data available for selection, include those data from within the Provisional Data step.") - }))); - }, - FilterRow: function FilterRow(filterRowProps) { - return /*#__PURE__*/_react.default.createElement(_materialTable.MTableFilterRow, _extends({}, filterRowProps, { - onFilterChanged: function onFilterChanged(columnId, value) { - var onFilterChanged = filterRowProps.onFilterChanged; - onFilterChanged(columnId, value); - var filter = columns[columnId].field; - var current = filters[filter]; - if (filter === 'name' && value !== current) { - debouncedFilterDispatch(filter, value); - return; - } - if (current && (value.length !== current.length || value.some(function (v) { - return !current.includes(v); - }))) { - dispatch({ - type: 'setS3FilesFilterValue', - filter: filter, - value: value - }); - } - } - })); - } + } + })) }; /* eslint-enable react/jsx-one-expression-per-line */ - var localization = { + const localization = { pagination: { labelRowsSelect: 'files' }, @@ -728,9 +708,9 @@ var DownloadStepForm = function DownloadStepForm(props) { pageSizeOptions: [5, 10, 50, 100], showTitle: false, search: false, - isLoading: isLoading + isLoading }, - onSelectionChange: function onSelectionChange(rows, file) { + onSelectionChange: (rows, file) => { dispatch({ type: 'setIndividualS3FileSelected', url: file.url, @@ -757,13 +737,15 @@ var DownloadStepForm = function DownloadStepForm(props) { } }, "Select sites and date range in order to generate a list of files to choose from."); }; - var renderPackageTypeStep = function renderPackageTypeStep() { - var _state$packageType = state.packageType, - value = _state$packageType.value, - validValues = _state$packageType.validValues; - var _state$productData = state.productData, - productBasicDescription = _state$productData.productBasicDescription, - productExpandedDescription = _state$productData.productExpandedDescription; + const renderPackageTypeStep = () => { + const { + value, + validValues + } = state.packageType; + let { + productBasicDescription, + productExpandedDescription + } = state.productData; if (!productBasicDescription) { productBasicDescription = 'Includes the data product, summary statistics, expanded uncertainty, and final quality flag'; } @@ -777,7 +759,7 @@ var DownloadStepForm = function DownloadStepForm(props) { "aria-label": "Package Type", name: "package-type", value: value || '', - onChange: function onChange(e) { + onChange: e => { setState('packageType', e.target.value); changeToNextUncompletedStep(); } @@ -805,20 +787,18 @@ var DownloadStepForm = function DownloadStepForm(props) { }, productExpandedDescription)) }))); }; - var renderExternalExclusiveStep = function renderExternalExclusiveStep() { - var externalHost = _ExternalHost.default.getByProductCode(state.productData.productCode); + const renderExternalExclusiveStep = () => { + const externalHost = _ExternalHost.default.getByProductCode(state.productData.productCode); if (!externalHost) { return null; } - var hostLink = externalHost.renderLink(state.productData.productCode); - var availableSiteCodes = (state.productData.siteCodes || []).map(function (site) { - return site.siteCode; - }); - var externalHostProduct = _ExternalHost.default.getProductSpecificInfo(state.productData.productCode); - var allowNoAvailability = (0, _typeUtil.exists)(externalHostProduct) && externalHostProduct.allowNoAvailability === true; - var noData = !(0, _typeUtil.existsNonEmpty)(availableSiteCodes); - var noLinks = allowNoAvailability && noData; - var blurb; + const hostLink = externalHost.renderLink(state.productData.productCode); + const availableSiteCodes = (state.productData.siteCodes || []).map(site => site.siteCode); + const externalHostProduct = _ExternalHost.default.getProductSpecificInfo(state.productData.productCode); + const allowNoAvailability = (0, _typeUtil.exists)(externalHostProduct) && externalHostProduct.allowNoAvailability === true; + const noData = !(0, _typeUtil.existsNonEmpty)(availableSiteCodes); + const noLinks = allowNoAvailability && noData; + let blurb; if (noLinks) { blurb = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Data for this product is not currently available for download through the NEON Data Portal. Please use this link to access data for this product for a particular site from ", hostLink, "."); } else { @@ -836,14 +816,16 @@ var DownloadStepForm = function DownloadStepForm(props) { siteCodes: availableSiteCodes })); }; - var renderPoliciesStep = function renderPoliciesStep() { - var agreed = state.policies.value; - var checkbox = /*#__PURE__*/_react.default.createElement(_Checkbox.default, { + const renderPoliciesStep = () => { + const { + value: agreed + } = state.policies; + const checkbox = /*#__PURE__*/_react.default.createElement(_Checkbox.default, { color: "primary", value: "policies", checked: agreed, disabled: agreed, - onChange: function onChange() { + onChange: () => { setState('policies', true); changeToNextUncompletedStep(); } @@ -861,15 +843,16 @@ var DownloadStepForm = function DownloadStepForm(props) { })); /* eslint-enable react/jsx-one-expression-per-line */ }; - - var renderSummaryStep = function renderSummaryStep() { - var stepSummary = /*#__PURE__*/_react.default.createElement("div", { + const renderSummaryStep = () => { + const stepSummary = /*#__PURE__*/_react.default.createElement("div", { "data-selenium": "download-data-dialog.step-form.summary" - }, state.requiredSteps.map(function (step, index) { + }, state.requiredSteps.map((step, index) => { if (['summary', 'policies'].includes(step.key)) { return null; } - var isComplete = state.requiredSteps[index].isComplete; + const { + isComplete + } = state.requiredSteps[index]; return /*#__PURE__*/_react.default.createElement("div", { key: step.key, className: classes.stepSummary @@ -877,12 +860,8 @@ var DownloadStepForm = function DownloadStepForm(props) { role: "button", tabIndex: 0, className: classes.stepSummaryHeader, - onClick: function onClick() { - return changeToStep(index); - }, - onKeyPress: function onKeyPress() { - return changeToStep(index); - } + onClick: () => changeToStep(index), + onKeyPress: () => changeToStep(index) }, /*#__PURE__*/_react.default.createElement(_Chip.default, { color: isComplete ? 'primary' : 'default', label: index + 1, @@ -902,12 +881,12 @@ var DownloadStepForm = function DownloadStepForm(props) { key: "download", className: classes.stepSummary }, renderDownloadButton())); - var downloadAndExploreLink = /*#__PURE__*/_react.default.createElement(_Link.default, { + const downloadAndExploreLink = /*#__PURE__*/_react.default.createElement(_Link.default, { target: "_blank", href: _RouteService.default.getDownloadExplorePath(), "data-gtm": "download-data-dialog.download-and-explore-link" }, "Download and Explore NEON Data"); - var downloadAndExploreCallout = /*#__PURE__*/_react.default.createElement(_Card.default, { + const downloadAndExploreCallout = /*#__PURE__*/_react.default.createElement(_Card.default, { style: { margin: _Theme.default.spacing(0.5, 0, 3, 0) }, @@ -920,12 +899,12 @@ var DownloadStepForm = function DownloadStepForm(props) { }), /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "subtitle2" }, "Tip: Check out our ", downloadAndExploreLink, " tutorial. This tutorial will explain how our neonUtilities package can be used to unzip and join data tables with just a few lines of code."))); - var fileNamingConventionsLink = /*#__PURE__*/_react.default.createElement(_Link.default, { + const fileNamingConventionsLink = /*#__PURE__*/_react.default.createElement(_Link.default, { target: "_blank", href: _RouteService.default.getFileNamingConventionsPath(), "data-gtm": "download-data-dialog.file-naming-conventions-link" }, "NEON File Naming Conventions"); - var fileNamingCallout = /*#__PURE__*/_react.default.createElement(_Card.default, { + const fileNamingCallout = /*#__PURE__*/_react.default.createElement(_Card.default, { style: { margin: _Theme.default.spacing(0.5, 0, 3, 0) }, @@ -938,15 +917,15 @@ var DownloadStepForm = function DownloadStepForm(props) { }), /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "subtitle2" }, "Files in this download will follow ", fileNamingConventionsLink, "."))); - var citationProductCode = ''; - var citationRelease; + let citationProductCode = ''; + let citationRelease; if ((0, _typeUtil.exists)(state.productData) && (0, _typeUtil.isStringNonEmpty)(state.productData.productCode)) { citationProductCode = state.productData.productCode; } if ((0, _typeUtil.exists)(state.release) && (0, _typeUtil.isStringNonEmpty)(state.release.value)) { citationRelease = state.release.value; } - var citationCallout = /*#__PURE__*/_react.default.createElement(_Card.default, { + const citationCallout = /*#__PURE__*/_react.default.createElement(_Card.default, { style: { margin: _Theme.default.spacing(0.5, 0, 3, 0) }, @@ -970,7 +949,7 @@ var DownloadStepForm = function DownloadStepForm(props) { md: 6 }, downloadAndExploreCallout, fileNamingCallout, citationCallout)); }; - var renderStepForm = function renderStepForm() { + const renderStepForm = () => { switch (stepKey) { case 'sitesAndDateRange': return renderSitesAndDateRangeStep(); @@ -1001,11 +980,8 @@ DownloadStepForm.propTypes = { renderDownloadButton: _propTypes.default.func }; DownloadStepForm.defaultProps = { - changeToStep: function changeToStep() {}, - changeToNextUncompletedStep: function changeToNextUncompletedStep() {}, - renderDownloadButton: function renderDownloadButton() { - return null; - } + changeToStep: () => {}, + changeToNextUncompletedStep: () => {}, + renderDownloadButton: () => null }; -var _default = DownloadStepForm; -exports.default = _default; \ No newline at end of file +var _default = exports.default = DownloadStepForm; \ No newline at end of file diff --git a/lib/components/DownloadStepForm/index.js b/lib/components/DownloadStepForm/index.js index 17742f50..8e3dfd3c 100644 --- a/lib/components/DownloadStepForm/index.js +++ b/lib/components/DownloadStepForm/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _DownloadStepForm.default; } }); diff --git a/lib/components/Error/ComponentErrorBoundary.js b/lib/components/Error/ComponentErrorBoundary.js index b82e4245..9a829a78 100644 --- a/lib/components/Error/ComponentErrorBoundary.js +++ b/lib/components/Error/ComponentErrorBoundary.js @@ -8,11 +8,13 @@ var _react = _interopRequireDefault(require("react")); var _reactErrorBoundary = require("react-error-boundary"); var _ComponentFallback = _interopRequireDefault(require("./ComponentFallback")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var ComponentErrorBoundary = function ComponentErrorBoundary(props) { - var children = props.children, - onReset = props.onReset, - onError = props.onError, - fallbackComponent = props.fallbackComponent; +const ComponentErrorBoundary = props => { + const { + children, + onReset, + onError, + fallbackComponent + } = props; return /*#__PURE__*/_react.default.createElement(_reactErrorBoundary.ErrorBoundary, { FallbackComponent: fallbackComponent || _ComponentFallback.default, onReset: onReset, @@ -20,9 +22,8 @@ var ComponentErrorBoundary = function ComponentErrorBoundary(props) { }, children); }; ComponentErrorBoundary.defaultProps = { - onReset: function onReset() {}, - onError: function onError(error, info) {}, + onReset: function () {}, + onError: (error, info) => {}, fallbackComponent: undefined }; -var _default = ComponentErrorBoundary; -exports.default = _default; \ No newline at end of file +var _default = exports.default = ComponentErrorBoundary; \ No newline at end of file diff --git a/lib/components/Error/ComponentFallback.js b/lib/components/Error/ComponentFallback.js index 06a1df71..d7c66691 100644 --- a/lib/components/Error/ComponentFallback.js +++ b/lib/components/Error/ComponentFallback.js @@ -8,9 +8,11 @@ var _react = _interopRequireDefault(require("react")); var _Grid = _interopRequireDefault(require("@material-ui/core/Grid")); var _ErrorCard = _interopRequireDefault(require("../Card/ErrorCard")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var ComponentFallback = function ComponentFallback(props) { - var error = props.error, - resetErrorBoundary = props.resetErrorBoundary; +const ComponentFallback = props => { + const { + error, + resetErrorBoundary + } = props; // eslint-disable-next-line no-console console.error(error); return /*#__PURE__*/_react.default.createElement(_Grid.default, { @@ -26,5 +28,4 @@ var ComponentFallback = function ComponentFallback(props) { onActionClick: resetErrorBoundary }))); }; -var _default = ComponentFallback; -exports.default = _default; \ No newline at end of file +var _default = exports.default = ComponentFallback; \ No newline at end of file diff --git a/lib/components/Error/CustomComponentFallback.js b/lib/components/Error/CustomComponentFallback.js index d3d10a4f..31de5f27 100644 --- a/lib/components/Error/CustomComponentFallback.js +++ b/lib/components/Error/CustomComponentFallback.js @@ -6,9 +6,10 @@ Object.defineProperty(exports, "__esModule", { exports.default = void 0; var _react = _interopRequireDefault(require("react")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var CustomComponentFallback = function CustomComponentFallback(props) { - var FallbackComponent = props.FallbackComponent; +const CustomComponentFallback = props => { + const { + FallbackComponent + } = props; return /*#__PURE__*/_react.default.createElement(FallbackComponent, props); }; -var _default = CustomComponentFallback; -exports.default = _default; \ No newline at end of file +var _default = exports.default = CustomComponentFallback; \ No newline at end of file diff --git a/lib/components/Error/index.js b/lib/components/Error/index.js index 54569791..ff70fabb 100644 --- a/lib/components/Error/index.js +++ b/lib/components/Error/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _ComponentErrorBoundary.default; } }); diff --git a/lib/components/ExternalHost/ExternalHost.js b/lib/components/ExternalHost/ExternalHost.js index 13261a81..407642c3 100644 --- a/lib/components/ExternalHost/ExternalHost.js +++ b/lib/components/ExternalHost/ExternalHost.js @@ -7,15 +7,14 @@ exports.default = void 0; var _react = _interopRequireDefault(require("react")); var _Link = _interopRequireDefault(require("@material-ui/core/Link")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var HOST_TYPES = { +const HOST_TYPES = { ADDITIONAL_DATA: 'ADDITIONAL_DATA', // NEON and host offer different / complementary data REFORMATTED_DATA: 'REFORMATTED_DATA', // NEON and host offer same data in different formats EXCLUSIVE_DATA: 'EXCLUSIVE_DATA' // NEON does not offer any data, only host has it accessible }; - -var LINK_TYPES = { +const LINK_TYPES = { BY_SITE: 'BY_SITE', // Show links to external host site page(s) BY_PRODUCT: 'BY_PRODUCT' // Show links to external host product page(s) @@ -25,7 +24,7 @@ var LINK_TYPES = { // CPC: Since pulling this over from browse-refactor I've expanded it to // model additional info on _how_ some extrnal products link out. // API updates ideally should model all pertinent information. -var externalProducts = { +const externalProducts = { 'DP1.00001.001': { host: 'AMERIFLUX' }, @@ -169,11 +168,11 @@ var externalProducts = { host: 'AMERIFLUX' } }; -var renderExternalHostLink = function renderExternalHostLink() { - var href = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - var host = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; - var productCode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'n/a'; +const renderExternalHostLink = function () { + let href = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + let text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + let host = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + let productCode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'n/a'; return /*#__PURE__*/_react.default.createElement(_Link.default, { href: href, target: "_blank", @@ -182,7 +181,7 @@ var renderExternalHostLink = function renderExternalHostLink() { rel: "noopener noreferrer" }, text); }; -var externalHosts = { +const externalHosts = { AERONET: { id: 'AERONET', name: 'AERONET', @@ -190,12 +189,12 @@ var externalHosts = { url: 'https://aeronet.gsfc.nasa.gov', hostType: HOST_TYPES.EXCLUSIVE_DATA, linkType: LINK_TYPES.BY_SITE, - getSiteLink: function getSiteLink() { - var allSites = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var siteCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - var productCode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'n/a'; - var hrefBase = 'https://aeronet.gsfc.nasa.gov/cgi-bin/data_display_aod_v3?site='; - var nonStandardSites = { + getSiteLink: function () { + let allSites = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let siteCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + let productCode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'n/a'; + const hrefBase = 'https://aeronet.gsfc.nasa.gov/cgi-bin/data_display_aod_v3?site='; + const nonStandardSites = { BART: 'NEON_Bartlett', CPER: 'NEON-CPER', DSNY: 'NEON-Disney', @@ -203,9 +202,9 @@ var externalHosts = { SOAP: 'NEON-SoaprootSaddle', STER: 'NEON_Sterling' }; - var hrefSite = Object.keys(nonStandardSites).includes(siteCode) ? nonStandardSites[siteCode] : "NEON_".concat(siteCode); - var description = Object.keys(allSites).length ? " - ".concat(allSites[siteCode].description) : ''; - var text = "".concat(siteCode).concat(description); + const hrefSite = Object.keys(nonStandardSites).includes(siteCode) ? nonStandardSites[siteCode] : "NEON_".concat(siteCode); + const description = Object.keys(allSites).length ? " - ".concat(allSites[siteCode].description) : ''; + const text = "".concat(siteCode).concat(description); return renderExternalHostLink("".concat(hrefBase).concat(hrefSite), text, 'AERONET', productCode); } }, @@ -216,11 +215,11 @@ var externalHosts = { url: 'https://ameriflux.lbl.gov', hostType: HOST_TYPES.REFORMATTED_DATA, linkType: LINK_TYPES.BY_SITE, - getSiteLink: function getSiteLink() { - var allSites = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var siteCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - var productCode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'n/a'; - var siteCodeMapping = { + getSiteLink: function () { + let allSites = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let siteCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + let productCode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'n/a'; + const siteCodeMapping = { GUAN: 'PR-xGU', LAJA: 'PR-xLA', ABBY: 'US-xAB', @@ -271,10 +270,10 @@ var externalHosts = { if (!siteCodeMapping[siteCode]) { return null; } - var hrefBase = 'https://ameriflux.lbl.gov/sites/siteinfo'; - var hrefSite = siteCodeMapping[siteCode]; - var description = Object.keys(allSites).length ? " - ".concat(allSites[siteCode].description) : ''; - var text = "".concat(siteCode, " - ").concat(description); + const hrefBase = 'https://ameriflux.lbl.gov/sites/siteinfo'; + const hrefSite = siteCodeMapping[siteCode]; + const description = Object.keys(allSites).length ? " - ".concat(allSites[siteCode].description) : ''; + const text = "".concat(siteCode, " - ").concat(description); return renderExternalHostLink("".concat(hrefBase, "/").concat(hrefSite, "/"), text, 'AMERIFLUX', productCode); } }, @@ -286,17 +285,15 @@ var externalHosts = { hostType: HOST_TYPES.ADDITIONAL_DATA, linkType: LINK_TYPES.BY_PRODUCT, hostDataVariety: 'Raw sequence data', - getProductLinks: function getProductLinks() { - var productCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + getProductLinks: function () { + let productCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; if (!externalProducts[productCode]) { return []; } - return externalProducts[productCode].searches.map(function (search) { - return { - key: search.query, - node: renderExternalHostLink("http://www.boldsystems.org/index.php/Public_SearchTerms?query=".concat(search.query), search.title, 'BOLD', productCode) - }; - }); + return externalProducts[productCode].searches.map(search => ({ + key: search.query, + node: renderExternalHostLink("http://www.boldsystems.org/index.php/Public_SearchTerms?query=".concat(search.query), search.title, 'BOLD', productCode) + })); } }, NPN: { @@ -314,49 +311,48 @@ var externalHosts = { url: 'https://phenocam.nau.edu/webcam/about/', hostType: HOST_TYPES.EXCLUSIVE_DATA, linkType: LINK_TYPES.BY_SITE, - getSiteLink: function getSiteLink() { - var allSites = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var siteCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - var productCode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + getSiteLink: function () { + let allSites = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let siteCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + let productCode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; if (!allSites[siteCode]) { return null; } - var hrefBase = 'https://phenocam.nau.edu/webcam/sites'; - var hrefSite = "".concat(allSites[siteCode].domainCode, ".").concat(siteCode, ".").concat(productCode.split('.').slice(0, 2).join('.')); - var text = "".concat(siteCode, " - ").concat(allSites[siteCode].description); + const hrefBase = 'https://phenocam.nau.edu/webcam/sites'; + const hrefSite = "".concat(allSites[siteCode].domainCode, ".").concat(siteCode, ".").concat(productCode.split('.').slice(0, 2).join('.')); + const text = "".concat(siteCode, " - ").concat(allSites[siteCode].description); return renderExternalHostLink("".concat(hrefBase, "/NEON.").concat(hrefSite, "/"), text, 'PHENOCAM', productCode); } } }; -Object.keys(externalHosts).forEach(function (hostId) { +Object.keys(externalHosts).forEach(hostId => { externalHosts[hostId].renderLink = function () { - var productCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'n/a'; + let productCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'n/a'; return renderExternalHostLink(externalHosts[hostId].url, externalHosts[hostId].projectTitle, hostId, productCode); }; externalHosts[hostId].renderShortLink = function () { - var productCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'n/a'; + let productCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'n/a'; return renderExternalHostLink(externalHosts[hostId].url, externalHosts[hostId].name, hostId, productCode); }; }); -var getByHostId = function getByHostId() { - var hostId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; +const getByHostId = function () { + let hostId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; return externalHosts[hostId] || null; }; -var getByProductCode = function getByProductCode() { - var productCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; +const getByProductCode = function () { + let productCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; return externalProducts[productCode] ? externalHosts[externalProducts[productCode].host] : null; }; -var getProductSpecificInfo = function getProductSpecificInfo() { - var productCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; +const getProductSpecificInfo = function () { + let productCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; return externalProducts[productCode] ? externalProducts[productCode] : null; }; -var ExternalHost = { - HOST_TYPES: HOST_TYPES, - LINK_TYPES: LINK_TYPES, - getByHostId: getByHostId, - getByProductCode: getByProductCode, - getProductSpecificInfo: getProductSpecificInfo, - renderExternalHostLink: renderExternalHostLink +const ExternalHost = { + HOST_TYPES, + LINK_TYPES, + getByHostId, + getByProductCode, + getProductSpecificInfo, + renderExternalHostLink }; -var _default = ExternalHost; -exports.default = _default; \ No newline at end of file +var _default = exports.default = ExternalHost; \ No newline at end of file diff --git a/lib/components/ExternalHost/index.js b/lib/components/ExternalHost/index.js index 7618613f..c67a634c 100644 --- a/lib/components/ExternalHost/index.js +++ b/lib/components/ExternalHost/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _ExternalHost.default; } }); diff --git a/lib/components/ExternalHostInfo/ExternalHostInfo.js b/lib/components/ExternalHostInfo/ExternalHostInfo.js index 5e8d561f..d148ceee 100644 --- a/lib/components/ExternalHostInfo/ExternalHostInfo.js +++ b/lib/components/ExternalHostInfo/ExternalHostInfo.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -19,62 +18,50 @@ var _ExternalHost = _interopRequireDefault(require("../ExternalHost/ExternalHost var _ExternalHostProductSpecificLinks = _interopRequireDefault(require("../ExternalHostProductSpecificLinks/ExternalHostProductSpecificLinks")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _typeUtil = require("../../util/typeUtil"); -var _excluded = ["productCode", "expandable", "siteCodes"]; +const _excluded = ["productCode", "expandable", "siteCodes"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - startFlex: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center' - }, - cardDivider: { - margin: theme.spacing(0, 0, 2, 0) - } - }; -}); -var ExternalHostInfo = function ExternalHostInfo(props) { - var classes = useStyles(_Theme.default); - var productCode = props.productCode, - expandable = props.expandable, - siteCodes = props.siteCodes, - otherProps = _objectWithoutProperties(props, _excluded); - var _useState = (0, _react.useState)(!expandable), - _useState2 = _slicedToArray(_useState, 2), - expanded = _useState2[0], - setExpanded = _useState2[1]; - var externalHost = _ExternalHost.default.getByProductCode(productCode); - var externalHostProduct = _ExternalHost.default.getProductSpecificInfo(productCode); +const useStyles = (0, _styles.makeStyles)(theme => ({ + startFlex: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center' + }, + cardDivider: { + margin: theme.spacing(0, 0, 2, 0) + } +})); +const ExternalHostInfo = props => { + const classes = useStyles(_Theme.default); + const { + productCode, + expandable, + siteCodes + } = props, + otherProps = _objectWithoutPropertiesLoose(props, _excluded); + const [expanded, setExpanded] = (0, _react.useState)(!expandable); + const externalHost = _ExternalHost.default.getByProductCode(productCode); + const externalHostProduct = _ExternalHost.default.getProductSpecificInfo(productCode); if (!externalHost) { return null; } // Not only _should_ the info have specific links (links in addition to the top-level // one for the host), but _does_ it? - var hasSpecificLinks = externalHost.linkType === _ExternalHost.default.LINK_TYPES.BY_PRODUCT && externalHost.getProductLinks(productCode).length || externalHost.linkType === _ExternalHost.default.LINK_TYPES.BY_SITE; - var allowNoLinks = hasSpecificLinks && externalHostProduct.allowNoAvailability === true && !(0, _typeUtil.existsNonEmpty)(siteCodes); + const hasSpecificLinks = externalHost.linkType === _ExternalHost.default.LINK_TYPES.BY_PRODUCT && externalHost.getProductLinks(productCode).length || externalHost.linkType === _ExternalHost.default.LINK_TYPES.BY_SITE; + const allowNoLinks = hasSpecificLinks && externalHostProduct.allowNoAvailability === true && !(0, _typeUtil.existsNonEmpty)(siteCodes); // Remaining setup - var externalGeneralLink = externalHost.renderLink(productCode); - var expandTitle = "".concat(expanded ? 'Hide' : 'Show', " links to externally hosted data"); - var rootProps = {}; - Object.keys(otherProps).filter(function (key) { - return ['data-selenium', 'style', 'className'].includes(key); - }).forEach(function (key) { + const externalGeneralLink = externalHost.renderLink(productCode); + const expandTitle = "".concat(expanded ? 'Hide' : 'Show', " links to externally hosted data"); + const rootProps = {}; + Object.keys(otherProps).filter(key => ['data-selenium', 'style', 'className'].includes(key)).forEach(key => { rootProps[key] = otherProps[key]; }); - var blurb = null; - var dataVariety = externalHost.hostDataVariety || 'Data'; + let blurb = null; + let dataVariety = externalHost.hostDataVariety || 'Data'; if (externalHost.hostType === _ExternalHost.default.HOST_TYPES.REFORMATTED_DATA) { blurb = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "".concat(dataVariety, " for this product are available in other formats from"), "\xA0", externalGeneralLink); } @@ -84,7 +71,7 @@ var ExternalHostInfo = function ExternalHostInfo(props) { // Default: ExternalHost.HOST_TYPES.ADDITIONAL_DATA: if (!blurb) { dataVariety = externalHost.hostDataVariety || 'Additional data'; - var are = hasSpecificLinks ? 'are' : 'may be'; + const are = hasSpecificLinks ? 'are' : 'may be'; blurb = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "".concat(dataVariety, " associated with this product ").concat(are, " available from"), "\xA0", externalGeneralLink); } return /*#__PURE__*/_react.default.createElement("div", rootProps, /*#__PURE__*/_react.default.createElement(_InfoMessageCard.default, { @@ -102,9 +89,7 @@ var ExternalHostInfo = function ExternalHostInfo(props) { title: expandTitle }, /*#__PURE__*/_react.default.createElement(_IconButton.default, { "aria-label": expandTitle, - onClick: function onClick() { - return setExpanded(!expanded); - }, + onClick: () => setExpanded(!expanded), style: { marginLeft: _Theme.default.spacing(2) } @@ -127,6 +112,5 @@ ExternalHostInfo.defaultProps = { expandable: false, siteCodes: null }; -var WrappedExternalHostInfo = _Theme.default.getWrappedComponent(ExternalHostInfo); -var _default = WrappedExternalHostInfo; -exports.default = _default; \ No newline at end of file +const WrappedExternalHostInfo = _Theme.default.getWrappedComponent(ExternalHostInfo); +var _default = exports.default = WrappedExternalHostInfo; \ No newline at end of file diff --git a/lib/components/ExternalHostInfo/index.js b/lib/components/ExternalHostInfo/index.js index c83d51a2..18b54e5f 100644 --- a/lib/components/ExternalHostInfo/index.js +++ b/lib/components/ExternalHostInfo/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _ExternalHostInfo.default; } }); diff --git a/lib/components/ExternalHostProductSpecificLinks/ExternalHostProductSpecificLinks.js b/lib/components/ExternalHostProductSpecificLinks/ExternalHostProductSpecificLinks.js index 43094cf3..807c9379 100644 --- a/lib/components/ExternalHostProductSpecificLinks/ExternalHostProductSpecificLinks.js +++ b/lib/components/ExternalHostProductSpecificLinks/ExternalHostProductSpecificLinks.js @@ -15,54 +15,49 @@ var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _NeonContext = _interopRequireDefault(require("../NeonContext/NeonContext")); var _ExternalHost = _interopRequireDefault(require("../ExternalHost/ExternalHost")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - siteLinksContainer: { - display: 'flex', - flexWrap: 'wrap', - marginTop: theme.spacing(3) - }, - siteLinksLoadingContainer: { - marginTop: theme.spacing(3), - display: 'flex', - flexDirection: 'column', - alignItems: 'center' - }, - ulLinkList: { - paddingLeft: theme.spacing(2), - margin: theme.spacing(0.5, 0), - fontSize: '0.85rem', - '& > li': { - marginBottom: theme.spacing(0.5) - } +const useStyles = (0, _styles.makeStyles)(theme => ({ + siteLinksContainer: { + display: 'flex', + flexWrap: 'wrap', + marginTop: theme.spacing(3) + }, + siteLinksLoadingContainer: { + marginTop: theme.spacing(3), + display: 'flex', + flexDirection: 'column', + alignItems: 'center' + }, + ulLinkList: { + paddingLeft: theme.spacing(2), + margin: theme.spacing(0.5, 0), + fontSize: '0.85rem', + '& > li': { + marginBottom: theme.spacing(0.5) } - }; -}); + } +})); function ExternalHostProductSpecificLinks(props) { - var classes = useStyles(_Theme.default); - var productCode = props.productCode, - siteCodes = props.siteCodes; - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - _NeonContext$useNeonC3 = _NeonContext$useNeonC2[0], - neonContextData = _NeonContext$useNeonC3.data, - neonContextIsFinal = _NeonContext$useNeonC3.isFinal; - var allSites = neonContextData.sites, - allStates = neonContextData.states; - var belowSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('xs')); - var belowMd = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('sm')); - var belowLg = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('md')); - var externalHost = _ExternalHost.default.getByProductCode(productCode); + const classes = useStyles(_Theme.default); + const { + productCode, + siteCodes + } = props; + const [{ + data: neonContextData, + isFinal: neonContextIsFinal + }] = _NeonContext.default.useNeonContextState(); + const { + sites: allSites, + states: allStates + } = neonContextData; + const belowSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.only('xs')); + const belowMd = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('sm')); + const belowLg = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('md')); + const externalHost = _ExternalHost.default.getByProductCode(productCode); if (!externalHost || !Object.keys(_ExternalHost.default.LINK_TYPES).includes(externalHost.linkType)) { return null; } - var columnBasis = '25%'; + let columnBasis = '25%'; if (belowLg) { columnBasis = '33.33%'; } @@ -72,11 +67,11 @@ function ExternalHostProductSpecificLinks(props) { if (belowSm) { columnBasis = '100%'; } - var listDivStyle = { + const listDivStyle = { flex: "1 0 ".concat(columnBasis), padding: _Theme.default.spacing(0, 2, 2, 0) }; - var renderLinksByProduct = function renderLinksByProduct() { + const renderLinksByProduct = () => { if (typeof externalHost.getProductLinks !== 'function') { return null; } @@ -85,26 +80,22 @@ function ExternalHostProductSpecificLinks(props) { marginTop: _Theme.default.spacing(3), marginBottom: _Theme.default.spacing(0.75) } - }, (externalHost.getProductLinks(productCode) || []).map(function (link) { - return /*#__PURE__*/_react.default.createElement("li", { - key: link.key - }, link.node); - })); + }, (externalHost.getProductLinks(productCode) || []).map(link => /*#__PURE__*/_react.default.createElement("li", { + key: link.key + }, link.node))); }; - var renderLinksBySite = function renderLinksBySite() { + const renderLinksBySite = () => { if (typeof externalHost.getSiteLink !== 'function') { return null; } // What sites are available? If a list was not provided then show them all. // eslint-disable-next-line react/prop-types - var filterByAvailability = Array.isArray(siteCodes) && siteCodes.length; - var availableSites = allSites; + const filterByAvailability = Array.isArray(siteCodes) && siteCodes.length; + let availableSites = allSites; if (filterByAvailability) { availableSites = Object.fromEntries( // eslint-disable-next-line react/prop-types - siteCodes.map(function (siteCode) { - return [siteCode, allSites[siteCode]]; - })); + siteCodes.map(siteCode => [siteCode, allSites[siteCode]])); } // Sites still loading; render loading message if (!neonContextIsFinal) { @@ -140,9 +131,9 @@ function ExternalHostProductSpecificLinks(props) { }, "Sites failed to load.")); } // Sites loaded; build a structure of available sites grouped by state and render links as such - var sitesByStateName = {}; - Object.keys(availableSites).sort().forEach(function (siteCode) { - var stateName = allStates[allSites[siteCode].stateCode].name; + const sitesByStateName = {}; + Object.keys(availableSites).sort().forEach(siteCode => { + const stateName = allStates[allSites[siteCode].stateCode].name; if (!sitesByStateName[stateName]) { sitesByStateName[stateName] = []; } @@ -150,19 +141,13 @@ function ExternalHostProductSpecificLinks(props) { }); return /*#__PURE__*/_react.default.createElement("div", { className: classes.siteLinksContainer - }, Object.keys(sitesByStateName).sort().map(function (stateName) { - var links = sitesByStateName[stateName] + }, Object.keys(sitesByStateName).sort().map(stateName => { + const links = sitesByStateName[stateName] // eslint-disable-next-line react/prop-types - .filter(function (siteCode) { - return !filterByAvailability || siteCodes.includes(siteCode); - }).map(function (siteCode) { - return { - siteCode: siteCode, - link: externalHost.getSiteLink(allSites, siteCode, productCode) - }; - }).filter(function (entry) { - return entry.link !== null; - }); + .filter(siteCode => !filterByAvailability || siteCodes.includes(siteCode)).map(siteCode => ({ + siteCode, + link: externalHost.getSiteLink(allSites, siteCode, productCode) + })).filter(entry => entry.link !== null); if (!links.length) { return null; } @@ -174,11 +159,9 @@ function ExternalHostProductSpecificLinks(props) { key: stateName }, stateName), /*#__PURE__*/_react.default.createElement("ul", { className: classes.ulLinkList - }, links.map(function (entry) { - return /*#__PURE__*/_react.default.createElement("li", { - key: entry.siteCode - }, entry.link); - }))); + }, links.map(entry => /*#__PURE__*/_react.default.createElement("li", { + key: entry.siteCode + }, entry.link)))); })); }; switch (externalHost.linkType) { diff --git a/lib/components/ExternalHostProductSpecificLinks/index.js b/lib/components/ExternalHostProductSpecificLinks/index.js index ee7e535d..67dd14ca 100644 --- a/lib/components/ExternalHostProductSpecificLinks/index.js +++ b/lib/components/ExternalHostProductSpecificLinks/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _ExternalHostProductSpecificLinks.default; } }); diff --git a/lib/components/FullWidthVisualization/FullWidthVisualization.js b/lib/components/FullWidthVisualization/FullWidthVisualization.js index 8bdced1b..da10f581 100644 --- a/lib/components/FullWidthVisualization/FullWidthVisualization.js +++ b/lib/components/FullWidthVisualization/FullWidthVisualization.js @@ -1,56 +1,45 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); exports.default = FullWidthVisualization; var _react = _interopRequireWildcard(require("react")); var _propTypes = _interopRequireDefault(require("prop-types")); -var _excluded = ["vizRef", "minWidth", "handleRedraw", "allowHeightResize", "deriveHeightFromWidth", "containerStyle", "children"]; +const _excluded = ["vizRef", "minWidth", "handleRedraw", "allowHeightResize", "deriveHeightFromWidth", "containerStyle", "children"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /** Function: Generate an appropriate height for the visualization given its width. Maintain a more square aspect ratio for smaller widths and prefer a 16:9 ratio for larger widths. */ -var autoVizHeight = function autoVizHeight(width) { - var breakpoints = [0, 675, 900, 1200]; - var ratios = ['3:2', '16:9', '2:1', '2.5:1']; - var breakIdx = breakpoints.reduce(function (acc, breakpoint, idx) { - return width >= breakpoint ? idx : acc; - }, 0); - var ratio = /^([\d.]+):([\d.]+)$/.exec(ratios[breakIdx]); - var mult = (parseFloat(ratio[2], 10) || 1) / (parseFloat(ratio[1], 10) || 1); +const autoVizHeight = width => { + const breakpoints = [0, 675, 900, 1200]; + const ratios = ['3:2', '16:9', '2:1', '2.5:1']; + const breakIdx = breakpoints.reduce((acc, breakpoint, idx) => width >= breakpoint ? idx : acc, 0); + const ratio = /^([\d.]+):([\d.]+)$/.exec(ratios[breakIdx]); + const mult = (parseFloat(ratio[2], 10) || 1) / (parseFloat(ratio[1], 10) || 1); return Math.floor(width * mult); }; function FullWidthVisualization(props) { - var vizRef = props.vizRef, - minWidth = props.minWidth, - handleRedraw = props.handleRedraw, - allowHeightResize = props.allowHeightResize, - deriveHeightFromWidth = props.deriveHeightFromWidth, - containerStyle = props.containerStyle, - children = props.children, - other = _objectWithoutProperties(props, _excluded); - var containerRef = (0, _react.useRef)(null); - var _useState = (0, _react.useState)(minWidth), - _useState2 = _slicedToArray(_useState, 2), - vizWidth = _useState2[0], - setVizWidth = _useState2[1]; - var handleResize = (0, _react.useCallback)(function () { - var container = containerRef.current; - var viz = vizRef.current; + const { + vizRef, + minWidth, + handleRedraw, + allowHeightResize, + deriveHeightFromWidth, + containerStyle, + children + } = props, + other = _objectWithoutPropertiesLoose(props, _excluded); + const containerRef = (0, _react.useRef)(null); + const [vizWidth, setVizWidth] = (0, _react.useState)(minWidth); + const handleResize = (0, _react.useCallback)(() => { + const container = containerRef.current; + const viz = vizRef.current; // Do nothing if either container or viz references fail ot point to a DOM node if (!container || !viz) { return; @@ -65,11 +54,11 @@ function FullWidthVisualization(props) { if (container.clientWidth === vizWidth && !allowHeightResize) { return; } - var newWidth = container.clientWidth; + const newWidth = container.clientWidth; setVizWidth(newWidth); viz.setAttribute('width', "".concat(newWidth, "px")); if (deriveHeightFromWidth !== null) { - var newHeight = deriveHeightFromWidth === 'auto' ? autoVizHeight(newWidth) : deriveHeightFromWidth(newWidth, container, viz); + const newHeight = deriveHeightFromWidth === 'auto' ? autoVizHeight(newWidth) : deriveHeightFromWidth(newWidth, container, viz); viz.setAttribute('height', "".concat(newHeight, "px")); viz.style.height = "".concat(newHeight, "px"); } @@ -77,23 +66,23 @@ function FullWidthVisualization(props) { handleRedraw(); } }, [vizRef, containerRef, vizWidth, setVizWidth, allowHeightResize, handleRedraw, deriveHeightFromWidth]); - (0, _react.useLayoutEffect)(function () { - var element = vizRef.current; + (0, _react.useLayoutEffect)(() => { + const element = vizRef.current; if (!element) { - return function () {}; + return () => {}; } - var parent = element.parentElement; + const parent = element.parentElement; handleResize(); // Ensure resize observer is in place if (typeof ResizeObserver !== 'function') { window.addEventListener('resize', handleResize); - return function () { + return () => { window.removeEventListener('resize', handleResize); }; } - var resizeObserver = new ResizeObserver(handleResize); + let resizeObserver = new ResizeObserver(handleResize); resizeObserver.observe(parent); - return function () { + return () => { if (!resizeObserver) { return; } @@ -101,7 +90,7 @@ function FullWidthVisualization(props) { resizeObserver = null; }; }, [vizRef, handleResize]); - var divProps = { + const divProps = { ref: containerRef, style: { width: '100%', diff --git a/lib/components/FullWidthVisualization/index.js b/lib/components/FullWidthVisualization/index.js index 833fccdf..7661af72 100644 --- a/lib/components/FullWidthVisualization/index.js +++ b/lib/components/FullWidthVisualization/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _FullWidthVisualization.default; } }); diff --git a/lib/components/MapSelectionButton/MapSelectionButton.js b/lib/components/MapSelectionButton/MapSelectionButton.js index 289a78fa..efe3caf0 100644 --- a/lib/components/MapSelectionButton/MapSelectionButton.js +++ b/lib/components/MapSelectionButton/MapSelectionButton.js @@ -20,114 +20,96 @@ var _Language = _interopRequireDefault(require("@material-ui/icons/Language")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _SiteMapUtils = require("../SiteMap/SiteMapUtils"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -var SiteMap = /*#__PURE__*/_react.default.lazy(function () { - return Promise.resolve().then(function () { - return _interopRequireWildcard(require('../SiteMap/SiteMap')); - }); -}); -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - appBar: { - position: 'relative', - paddingRight: '0px !important' - }, - appBarTitle: { - marginLeft: theme.spacing(2), - flex: 1 - }, - toolbar: { - padding: '0px 10px 0px 14px' +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const SiteMap = /*#__PURE__*/_react.default.lazy(() => Promise.resolve().then(() => _interopRequireWildcard(require('../SiteMap/SiteMap')))); +const useStyles = (0, _styles.makeStyles)(theme => ({ + appBar: { + position: 'relative', + paddingRight: '0px !important' + }, + appBarTitle: { + marginLeft: theme.spacing(2), + flex: 1 + }, + toolbar: { + padding: '0px 10px 0px 14px' + }, + toolbarClose: { + '&:hover': { + backgroundColor: '#ffffff33' }, - toolbarClose: { - '&:hover': { - backgroundColor: '#ffffff33' - }, - '&:not(:hover):not(:focus)': { - backgroundColor: '#ffffff11', - border: "1px solid ".concat(theme.palette.primary.main, "11") - } - }, - buttonIcon: { - marginLeft: theme.spacing(1) - }, - suspenseFallback: { - width: '100%', - height: '100%', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', - backgroundColor: theme.palette.grey[200], - fontSize: '1.5em' + '&:not(:hover):not(:focus)': { + backgroundColor: '#ffffff11', + border: "1px solid ".concat(theme.palette.primary.main, "11") } - }; -}); -var MapSelectionButton = function MapSelectionButton(props) { - var label = props.label, - icon = props.icon, - dialogTitleProp = props.dialogTitle, - buttonProps = props.buttonProps, - siteMapProps = props.siteMapProps, - tooltipProps = props.tooltipProps, - selectionProp = props.selection, - validItems = props.validItems, - selectedItems = props.selectedItems, - selectionLimit = props.selectionLimit, - onSave = props.onSave; - var classes = useStyles(_Theme.default); - var _useState = (0, _react.useState)(false), - _useState2 = _slicedToArray(_useState, 2), - dialogOpen = _useState2[0], - setDialogOpen = _useState2[1]; - var _useState3 = (0, _react.useState)(false), - _useState4 = _slicedToArray(_useState3, 2), - dialogEntered = _useState4[0], - setDialogEntered = _useState4[1]; - var _useState5 = (0, _react.useState)(_SiteMapUtils.DEFAULT_STATE.selection), - _useState6 = _slicedToArray(_useState5, 2), - selection = _useState6[0], - setSelection = _useState6[1]; - var unit = ''; - var units = ''; + }, + buttonIcon: { + marginLeft: theme.spacing(1) + }, + suspenseFallback: { + width: '100%', + height: '100%', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + backgroundColor: theme.palette.grey[200], + fontSize: '1.5em' + } +})); +const MapSelectionButton = props => { + const { + label, + icon, + dialogTitle: dialogTitleProp, + buttonProps, + siteMapProps, + tooltipProps, + selection: selectionProp, + validItems, + selectedItems, + selectionLimit, + onSave + } = props; + const classes = useStyles(_Theme.default); + const [dialogOpen, setDialogOpen] = (0, _react.useState)(false); + const [dialogEntered, setDialogEntered] = (0, _react.useState)(false); + const [selection, setSelection] = (0, _react.useState)(_SiteMapUtils.DEFAULT_STATE.selection); + let unit = ''; + let units = ''; if (selectionProp) { unit = _SiteMapUtils.FEATURE_TYPES[selectionProp].unit || ''; units = _SiteMapUtils.FEATURE_TYPES[selectionProp].units || ''; } - var dialogTitle = "Select ".concat(units); + let dialogTitle = "Select ".concat(units); if (typeof selectionLimit === 'number') { dialogTitle = selectionLimit === 1 ? "Select a ".concat(unit) : "Select ".concat(selectionLimit.toString(), " ").concat(units); } if (Array.isArray(selectionLimit)) { - var min = selectionLimit[0], - max = selectionLimit[1]; + const { + 0: min, + 1: max + } = selectionLimit; dialogTitle = min === 1 ? "Select up to ".concat(max.toString(), " ").concat(units) : "Select ".concat(min.toString(), "-").concat(max.toString(), " ").concat(units); } - var saveTooltipProps = selection.valid ? {} : { + const saveTooltipProps = selection.valid ? {} : { disableFocusListener: true, disableHoverListener: true, disableTouchListener: true }; - var aspectRatio = (window.innerHeight - 64) / window.innerWidth; - var embedProps = { + const aspectRatio = (window.innerHeight - 64) / window.innerWidth; + const embedProps = { fullscreen: true, selection: selectionProp, - aspectRatio: aspectRatio, - validItems: validItems, - selectedItems: selectedItems, - selectionLimit: selectionLimit, + aspectRatio, + validItems, + selectedItems, + selectionLimit, onSelectionChange: setSelection }; - var finalEmbedProps = siteMapProps ? _extends({}, siteMapProps, embedProps) : embedProps; - var suspenseFallback = /*#__PURE__*/_react.default.createElement("div", { + const finalEmbedProps = siteMapProps ? _extends({}, siteMapProps, embedProps) : embedProps; + const suspenseFallback = /*#__PURE__*/_react.default.createElement("div", { className: classes.suspenseFallback }, "Loading Map..."); return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Tooltip.default, _extends({ @@ -139,19 +121,13 @@ var MapSelectionButton = function MapSelectionButton(props) { "data-selenium": "map-selection-button", startIcon: icon ? /*#__PURE__*/_react.default.createElement(_Language.default, null) : null }, buttonProps, { - onClick: function onClick() { - return setDialogOpen(true); - } + onClick: () => setDialogOpen(true) }), label)), /*#__PURE__*/_react.default.createElement(_Dialog.default, { fullScreen: true, open: dialogOpen, - onClose: function onClose() { - return setDialogOpen(false); - }, + onClose: () => setDialogOpen(false), TransitionProps: { - onEntered: function onEntered() { - return setDialogEntered(true); - } + onEntered: () => setDialogEntered(true) } }, /*#__PURE__*/_react.default.createElement(_AppBar.default, { color: "secondary", @@ -168,9 +144,7 @@ var MapSelectionButton = function MapSelectionButton(props) { "aria-label": "close", size: "small", className: classes.toolbarClose, - onClick: function onClick() { - return setDialogOpen(false); - } + onClick: () => setDialogOpen(false) }, /*#__PURE__*/_react.default.createElement(_Close.default, null))), /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "h5", className: classes.appBarTitle @@ -180,7 +154,7 @@ var MapSelectionButton = function MapSelectionButton(props) { }, saveTooltipProps), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.default, { color: "primary", variant: "contained", - onClick: function onClick() { + onClick: () => { onSave(selection.set); setDialogOpen(false); }, @@ -214,8 +188,7 @@ MapSelectionButton.defaultProps = { validItems: null, selectedItems: [], selectionLimit: null, - onSave: function onSave() {} + onSave: () => {} }; -var WrappedMapSelectionButton = _Theme.default.getWrappedComponent(MapSelectionButton); -var _default = WrappedMapSelectionButton; -exports.default = _default; \ No newline at end of file +const WrappedMapSelectionButton = _Theme.default.getWrappedComponent(MapSelectionButton); +var _default = exports.default = WrappedMapSelectionButton; \ No newline at end of file diff --git a/lib/components/MaterialTableIcons/MaterialTableIcons.js b/lib/components/MaterialTableIcons/MaterialTableIcons.js index fbd04530..20eb8250 100644 --- a/lib/components/MaterialTableIcons/MaterialTableIcons.js +++ b/lib/components/MaterialTableIcons/MaterialTableIcons.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -22,96 +21,61 @@ var _SaveAlt = _interopRequireDefault(require("@material-ui/icons/SaveAlt")); var _Search = _interopRequireDefault(require("@material-ui/icons/Search")); var _TableChart = _interopRequireDefault(require("@material-ui/icons/TableChart")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } // This exists so that Material Table doesn't have to rely on loading the Material Icon font in // the HTML . See https://github.com/mbrn/material-table/issues/51#issuecomment-508384214 -var MaterialTableIcons = { - Add: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_AddBox.default, _extends({}, props, { - ref: ref - })); - }), - Check: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_Check.default, _extends({}, props, { - ref: ref - })); - }), - Clear: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_Clear.default, _extends({}, props, { - ref: ref - })); - }), - Delete: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_DeleteOutline.default, _extends({}, props, { - ref: ref - })); - }), - DetailPanel: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_ChevronRight.default, _extends({}, props, { - ref: ref - })); - }), - Edit: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_Edit.default, _extends({}, props, { - ref: ref - })); - }), - Export: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_SaveAlt.default, _extends({}, props, { - ref: ref - })); - }), - Filter: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_FilterList.default, _extends({}, props, { - ref: ref - })); - }), - FirstPage: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_FirstPage.default, _extends({}, props, { - ref: ref - })); - }), - LastPage: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_LastPage.default, _extends({}, props, { - ref: ref - })); - }), - NextPage: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_ChevronRight.default, _extends({}, props, { - ref: ref - })); - }), - PreviousPage: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_ChevronLeft.default, _extends({}, props, { - ref: ref - })); - }), - ResetSearch: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_Clear.default, _extends({}, props, { - ref: ref - })); - }), - Search: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_Search.default, _extends({}, props, { - ref: ref - })); - }), - SortArrow: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_ArrowUpward.default, _extends({}, props, { - ref: ref - })); - }), - ThirdStateCheck: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_Remove.default, _extends({}, props, { - ref: ref - })); - }), - ViewColumn: /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) { - return /*#__PURE__*/_react.default.createElement(_TableChart.default, _extends({}, props, { - ref: ref - })); - }) +const MaterialTableIcons = { + Add: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_AddBox.default, _extends({}, props, { + ref: ref + }))), + Check: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_Check.default, _extends({}, props, { + ref: ref + }))), + Clear: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_Clear.default, _extends({}, props, { + ref: ref + }))), + Delete: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_DeleteOutline.default, _extends({}, props, { + ref: ref + }))), + DetailPanel: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_ChevronRight.default, _extends({}, props, { + ref: ref + }))), + Edit: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_Edit.default, _extends({}, props, { + ref: ref + }))), + Export: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_SaveAlt.default, _extends({}, props, { + ref: ref + }))), + Filter: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_FilterList.default, _extends({}, props, { + ref: ref + }))), + FirstPage: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_FirstPage.default, _extends({}, props, { + ref: ref + }))), + LastPage: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_LastPage.default, _extends({}, props, { + ref: ref + }))), + NextPage: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_ChevronRight.default, _extends({}, props, { + ref: ref + }))), + PreviousPage: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_ChevronLeft.default, _extends({}, props, { + ref: ref + }))), + ResetSearch: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_Clear.default, _extends({}, props, { + ref: ref + }))), + Search: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_Search.default, _extends({}, props, { + ref: ref + }))), + SortArrow: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_ArrowUpward.default, _extends({}, props, { + ref: ref + }))), + ThirdStateCheck: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_Remove.default, _extends({}, props, { + ref: ref + }))), + ViewColumn: /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_TableChart.default, _extends({}, props, { + ref: ref + }))) }; -var _default = MaterialTableIcons; -exports.default = _default; \ No newline at end of file +var _default = exports.default = MaterialTableIcons; \ No newline at end of file diff --git a/lib/components/NeonApi/NeonApi.js b/lib/components/NeonApi/NeonApi.js index baf57bd7..09f081f5 100644 --- a/lib/components/NeonApi/NeonApi.js +++ b/lib/components/NeonApi/NeonApi.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -11,24 +10,23 @@ var _NeonEnvironment = _interopRequireDefault(require("../NeonEnvironment/NeonEn var _rxUtil = require("../../util/rxUtil"); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /** * Gets the API Token header from the environment. * @param {Object|undefined} headers Optional headers to build upon. * @return {Object} The resulting header object with API token set. */ -var _getApiTokenHeader = function getApiTokenHeader() { - var headers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; - var appliedHeaders = headers || {}; - var apiTokenHeader = _NeonEnvironment.default.getApiTokenHeader(); - var apiToken = _NeonEnvironment.default.getApiToken(); +const getApiTokenHeader = function () { + let headers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; + let appliedHeaders = headers || {}; + const apiTokenHeader = _NeonEnvironment.default.getApiTokenHeader(); + const apiToken = _NeonEnvironment.default.getApiToken(); if (apiTokenHeader && apiTokenHeader.length > 0 && apiToken && apiToken.length > 0) { // Only add the header when it doesn't already exist. if (typeof appliedHeaders[apiTokenHeader] !== 'string') { - appliedHeaders = _extends({}, appliedHeaders, _defineProperty({}, apiTokenHeader, apiToken)); + appliedHeaders = _extends({}, appliedHeaders, { + [apiTokenHeader]: apiToken + }); } } return appliedHeaders; @@ -38,12 +36,10 @@ var _getApiTokenHeader = function getApiTokenHeader() { * Convenience function to map an ajax request to response * to match the return signature of ajax.getJSON */ -var mapResponse = (0, _rxjs.map)(function (x) { - return x.response; -}); -var getAppliedWithCredentials = function getAppliedWithCredentials() { - var withCredentials = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; - var appliedWithCredentials = false; +const mapResponse = (0, _rxjs.map)(x => x.response); +const getAppliedWithCredentials = function () { + let withCredentials = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; + let appliedWithCredentials = false; if (!(0, _typeUtil.exists)(withCredentials) || typeof withCredentials !== 'boolean') { appliedWithCredentials = _NeonEnvironment.default.requireCors(); } else { @@ -60,17 +56,17 @@ var getAppliedWithCredentials = function getAppliedWithCredentials() { * @param {boolean} withCredentials Option to include credentials with a CORS request * @return The RxJS GET AjaxRequest */ -var getJsonAjaxRequest = function getJsonAjaxRequest(url) { - var headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - var includeToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - var withCredentials = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; - var appliedHeaders = headers || {}; +const getJsonAjaxRequest = function (url) { + let headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + let includeToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + let withCredentials = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; + let appliedHeaders = headers || {}; if (includeToken) { - appliedHeaders = _getApiTokenHeader(appliedHeaders); + appliedHeaders = getApiTokenHeader(appliedHeaders); } - var appliedWithCredentials = getAppliedWithCredentials(withCredentials); + const appliedWithCredentials = getAppliedWithCredentials(withCredentials); return { - url: url, + url, method: 'GET', responseType: 'json', crossDomain: true, @@ -88,14 +84,14 @@ var getJsonAjaxRequest = function getJsonAjaxRequest(url) { * @param {boolean} withCredentials Option to include credentials with a CORS request * @return The RxJS Ajax Observable */ -var _getJsonObservable = function getJsonObservable(url) { - var headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - var includeToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - var withCredentials = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; +const getJsonObservable = function (url) { + let headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + let includeToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + let withCredentials = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; if (typeof url !== 'string' || !url.length) { return (0, _rxjs.of)(null); } - var request = getJsonAjaxRequest(url, headers, includeToken, withCredentials); + const request = getJsonAjaxRequest(url, headers, includeToken, withCredentials); return mapResponse((0, _ajax.ajax)(request)); }; @@ -107,17 +103,17 @@ var _getJsonObservable = function getJsonObservable(url) { * @param {boolean} withCredentials Option to include credentials with a CORS request * @return The RxJS HEAD AjaxRequest */ -var headJsonAjaxRequest = function headJsonAjaxRequest(url) { - var headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - var includeToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - var withCredentials = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; - var appliedHeaders = headers || {}; +const headJsonAjaxRequest = function (url) { + let headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + let includeToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + let withCredentials = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; + let appliedHeaders = headers || {}; if (includeToken) { - appliedHeaders = _getApiTokenHeader(appliedHeaders); + appliedHeaders = getApiTokenHeader(appliedHeaders); } - var appliedWithCredentials = getAppliedWithCredentials(withCredentials); + const appliedWithCredentials = getAppliedWithCredentials(withCredentials); return { - url: url, + url, method: 'HEAD', responseType: 'json', crossDomain: true, @@ -135,14 +131,14 @@ var headJsonAjaxRequest = function headJsonAjaxRequest(url) { * @param {boolean} withCredentials Option to include credentials with a CORS request * @return The RxJS Ajax Observable */ -var _headJsonObservable = function headJsonObservable(url) { - var headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - var includeToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - var withCredentials = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; +const headJsonObservable = function (url) { + let headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + let includeToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + let withCredentials = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; if (typeof url !== 'string' || !url.length) { return (0, _rxjs.of)(null); } - var request = headJsonAjaxRequest(url, headers, includeToken, withCredentials); + const request = headJsonAjaxRequest(url, headers, includeToken, withCredentials); return (0, _ajax.ajax)(request); }; @@ -156,20 +152,20 @@ var _headJsonObservable = function headJsonObservable(url) { * @param {boolean} withCredentials Option to include credentials with a CORS request * @return The RxJS Ajax Observable */ -var _postJsonObservable = function postJsonObservable(url, body) { - var headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; - var includeToken = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; - var withCredentials = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined; +const postJsonObservable = function (url, body) { + let headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + let includeToken = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; + let withCredentials = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined; if (typeof url !== 'string' || !url.length) { return (0, _rxjs.of)(null); } - var appliedHeaders = headers || {}; + let appliedHeaders = headers || {}; if (includeToken) { - appliedHeaders = _getApiTokenHeader(appliedHeaders); + appliedHeaders = getApiTokenHeader(appliedHeaders); } - var appliedWithCredentials = getAppliedWithCredentials(withCredentials); + const appliedWithCredentials = getAppliedWithCredentials(withCredentials); return (0, _ajax.ajax)({ - url: url, + url, method: 'POST', responseType: 'json', crossDomain: true, @@ -184,15 +180,15 @@ var _postJsonObservable = function postJsonObservable(url, body) { /** * Container for supplying common NEON API request handlers. */ -var NeonApi = { +const NeonApi = { /** * Gets the API Token header from the environment. * @param {Object|undefined} headers Optional headers to build upon. * @return {Object} The resulting header object with API token set. */ - getApiTokenHeader: function getApiTokenHeader() { - var headers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; - return _getApiTokenHeader(headers); + getApiTokenHeader: function () { + let headers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; + return getApiTokenHeader(headers); }, /** * Gets the RxJS observable for making an API request to the specified URL @@ -202,10 +198,10 @@ var NeonApi = { * @param {boolean} includeToken Option to include the API token in the request * @return The RxJS Ajax Observable */ - getJsonObservable: function getJsonObservable(url) { - var headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - var includeToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - return _getJsonObservable(url, headers, includeToken); + getJsonObservable: function (url) { + let headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + let includeToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + return getJsonObservable(url, headers, includeToken); }, /** * Gets the RxJS observable for making a POST API request to the specified URL @@ -216,10 +212,10 @@ var NeonApi = { * @param {boolean} includeToken Option to include the API token in the request * @return The RxJS Ajax Observable */ - postJsonObservable: function postJsonObservable(url, body) { - var headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; - var includeToken = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; - return _postJsonObservable(url, body, headers, includeToken); + postJsonObservable: function (url, body) { + let headers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + let includeToken = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; + return postJsonObservable(url, body, headers, includeToken); }, /** * Gets the RxJS observable for making a HEAD API request to the specified URL @@ -229,10 +225,10 @@ var NeonApi = { * @param {boolean} includeToken Option to include the API token in the request * @return The RxJS Ajax Observable */ - headJsonObservable: function headJsonObservable(url) { - var headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - var includeToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; - return _headJsonObservable(url, headers, includeToken); + headJsonObservable: function (url) { + let headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + let includeToken = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + return headJsonObservable(url, headers, includeToken); }, /** * Convenience method for utiliizing the rxUtil => getJson function. @@ -244,28 +240,26 @@ var NeonApi = { * @param {Object|undefined} headers * @return RxJS subscription */ - getJson: function getJson(url, callback, errorCallback, cancellationSubject$) { - var headers = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined; - return (0, _rxUtil.getJson)(url, callback, errorCallback, cancellationSubject$, _getApiTokenHeader(headers)); + getJson: function (url, callback, errorCallback, cancellationSubject$) { + let headers = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined; + return (0, _rxUtil.getJson)(url, callback, errorCallback, cancellationSubject$, getApiTokenHeader(headers)); }, /** * Gets the products endpoint RxJS Observable. * @return The RxJS Ajax Observable */ - getProductsObservable: function getProductsObservable() { - return _getJsonObservable(_NeonEnvironment.default.getFullApiPath('products')); - }, + getProductsObservable: () => getJsonObservable(_NeonEnvironment.default.getFullApiPath('products')), /** * Gets the product endpoint RxJS Observable for the specified product code. * @param {string} productCode The product code to get for. * @param {string} release An optional release to scope the product. * @return The RxJS Ajax Observable */ - getProductObservable: function getProductObservable(productCode) { - var release = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var root = _NeonEnvironment.default.getFullApiPath('products'); - var path = release ? "".concat(root, "/").concat(productCode, "/").concat(release) : "".concat(root, "/").concat(productCode); - return _getJsonObservable(path); + getProductObservable: function (productCode) { + let release = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + const root = _NeonEnvironment.default.getFullApiPath('products'); + const path = release ? "".concat(root, "/").concat(productCode, "/").concat(release) : "".concat(root, "/").concat(productCode); + return getJsonObservable(path); }, /** * Gets the product tombstone availability endpoint @@ -274,10 +268,10 @@ var NeonApi = { * @param {string} release A release to scope the product. * @return The RxJS Ajax Observable */ - getProductTombstoneAvailabilityObservable: function getProductTombstoneAvailabilityObservable(productCode, release) { - var root = _NeonEnvironment.default.getFullApiPath('products'); - var path = "".concat(root, "/").concat(productCode, "/").concat(release, "/tombstone-data-availability"); - return _getJsonObservable(path); + getProductTombstoneAvailabilityObservable: (productCode, release) => { + const root = _NeonEnvironment.default.getFullApiPath('products'); + const path = "".concat(root, "/").concat(productCode, "/").concat(release, "/tombstone-data-availability"); + return getJsonObservable(path); }, /** * Gets the product DOI endpoint RxJS Observable for the specified product code and release. @@ -285,130 +279,98 @@ var NeonApi = { * @param {string} release An optional release to scope the product DOI. * @return The RxJS Ajax Observable */ - getProductDoisObservable: function getProductDoisObservable(productCode, release) { - var root = _NeonEnvironment.default.getFullApiPath('products'); - var path = "".concat(root, "/").concat(productCode, "/dois/").concat(release); - return _getJsonObservable(path); + getProductDoisObservable: (productCode, release) => { + const root = _NeonEnvironment.default.getFullApiPath('products'); + const path = "".concat(root, "/").concat(productCode, "/dois/").concat(release); + return getJsonObservable(path); }, /** * Gets the product bundles endpoint RxJS Observable. * @param {string} release An optional release to scope the bundles. * @return The RxJS Ajax Observable */ - getProductBundlesObservable: function getProductBundlesObservable() { - var release = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var root = _NeonEnvironment.default.getFullApiPath('productBundles'); - var path = (0, _typeUtil.isStringNonEmpty)(release) ? "".concat(root, "?release=").concat(release) : "".concat(root); - return _getJsonObservable(path); + getProductBundlesObservable: function () { + let release = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + const root = _NeonEnvironment.default.getFullApiPath('productBundles'); + const path = (0, _typeUtil.isStringNonEmpty)(release) ? "".concat(root, "?release=").concat(release) : "".concat(root); + return getJsonObservable(path); }, /** * Gets the prototype data endpoint RxJS Observable. * @return The RxJS Ajax Observable */ - getPrototypeDatasetsObservable: function getPrototypeDatasetsObservable() { - return _getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('prototype'), "/datasets")); - }, - getPrototypeDatasetObservable: function getPrototypeDatasetObservable(uuid) { - return _getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('prototype'), "/datasets/").concat(uuid)); - }, - getPrototypeManifestRollupObservable: function getPrototypeManifestRollupObservable(uuid) { - return ( - // eslint-disable-next-line max-len - _getJsonObservable("".concat(_NeonEnvironment.default.getFullDownloadApiPath('prototypeManifestRollup'), "?uuid=").concat(uuid)) - ); - }, - getPrototypeDataFileObservable: function getPrototypeDataFileObservable(uuid, fileName) { - return _getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('prototype'), "/data/").concat(uuid, "/").concat(fileName)); - }, + getPrototypeDatasetsObservable: () => getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('prototype'), "/datasets")), + getPrototypeDatasetObservable: uuid => getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('prototype'), "/datasets/").concat(uuid)), + getPrototypeManifestRollupObservable: uuid => + // eslint-disable-next-line max-len + getJsonObservable("".concat(_NeonEnvironment.default.getFullDownloadApiPath('prototypeManifestRollup'), "?uuid=").concat(uuid)), + getPrototypeDataFileObservable: (uuid, fileName) => getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('prototype'), "/data/").concat(uuid, "/").concat(fileName)), /** * Gets the release endpoint RxJS Observable. * @return The RxJS Ajax Observable */ - getReleasesObservable: function getReleasesObservable() { - return _getJsonObservable(_NeonEnvironment.default.getFullApiPath('releases')); - }, + getReleasesObservable: () => getJsonObservable(_NeonEnvironment.default.getFullApiPath('releases')), /** * Gets the release endpoint RxJS Observable for the specified release. * @param {string} release The release tag to get * @return The RxJS Ajax Observable */ - getReleaseObservable: function getReleaseObservable(release) { - return _getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('releases'), "/").concat(release)); - }, + getReleaseObservable: release => getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('releases'), "/").concat(release)), /** * Gets the sites endpoint RxJS Observable. * @return The RxJS Ajax Observable */ - getSitesJsonObservable: function getSitesJsonObservable() { - return _getJsonObservable(_NeonEnvironment.default.getFullApiPath('sites')); - }, + getSitesJsonObservable: () => getJsonObservable(_NeonEnvironment.default.getFullApiPath('sites')), /** * Gets the sites endpoint RxJS Observable for the specified site code. * @param {string} siteCode The site code to get for. * @return The RxJS Ajax Observable */ - getSiteJsonObservable: function getSiteJsonObservable(siteCode) { - return _getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('sites'), "/").concat(siteCode)); - }, + getSiteJsonObservable: siteCode => getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('sites'), "/").concat(siteCode)), /** * Gets the RxJS Observable for the locations endpoint for a given site hierarchy * @param {string} siteCode The site code to get complete hierarchy for. * @return The RxJS Ajax Observable */ - getSiteLocationHierarchyObservable: function getSiteLocationHierarchyObservable(siteCode) { - return _getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('locations'), "/").concat(siteCode, "?hierarchy=true")); - }, + getSiteLocationHierarchyObservable: siteCode => getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('locations'), "/").concat(siteCode, "?hierarchy=true")), /** * Gets the RxJS Observable for the locations endpoint for a given named location * @param {string} location The named location to fetch. * @return The RxJS Ajax Observable */ - getLocationObservable: function getLocationObservable(location) { - return _getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('locations'), "/").concat(location)); - }, + getLocationObservable: location => getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('locations'), "/").concat(location)), /** * Gets the RxJS Observable for the ArcGIS asset endpoint for a given feature / site code combo * @param {string} feature * @param {string} siteCode * @return The RxJS Ajax Observable */ - getArcgisAssetObservable: function getArcgisAssetObservable(feature, siteCode) { - return _getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('arcgisAssets'), "/").concat(feature, "/").concat(siteCode), undefined, true, false); - }, + getArcgisAssetObservable: (feature, siteCode) => getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('arcgisAssets'), "/").concat(feature, "/").concat(siteCode), undefined, true, false), /** * Gets the RxJS Observable for the document HEAD endpoint for a given name * @param {string} name The document name * @return The RxJS Ajax Observable */ - headDocumentObservable: function headDocumentObservable(name) { - return _headJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('documents'), "/").concat(name)); - }, + headDocumentObservable: name => headJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('documents'), "/").concat(name)), /** * Gets the RxJS Observable for the quick start guides endpoint for a given name * @param {string} name The quick start guide name * @param {string} version The quick start guide version * @return The RxJS Ajax Observable */ - getQuickStartGuideDetailObservable: function getQuickStartGuideDetailObservable(name, version) { - return _getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('quickStartGuides'), "/details/").concat(name, "/").concat(version)); - }, + getQuickStartGuideDetailObservable: (name, version) => getJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('quickStartGuides'), "/details/").concat(name, "/").concat(version)), /** * Gets the RxJS Observable for the quick start guides HEAD endpoint for a given name * @param {string} name The document name * @return The RxJS Ajax Observable */ - headQuickStartGuideObservable: function headQuickStartGuideObservable(name) { - return _headJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('quickStartGuides'), "/").concat(name)); - } + headQuickStartGuideObservable: name => headJsonObservable("".concat(_NeonEnvironment.default.getFullApiPath('quickStartGuides'), "/").concat(name)) }; Object.freeze(NeonApi); -var _default = NeonApi; // Additional items exported for unit testing -exports.default = _default; -var getTestableItems = function getTestableItems() { - return process.env.NODE_ENV !== 'test' ? {} : { - getApiTokenHeader: _getApiTokenHeader, - getJsonObservable: _getJsonObservable, - postJsonObservable: _postJsonObservable - }; +var _default = exports.default = NeonApi; // Additional items exported for unit testing +const getTestableItems = () => process.env.NODE_ENV !== 'test' ? {} : { + getApiTokenHeader, + getJsonObservable, + postJsonObservable }; exports.getTestableItems = getTestableItems; \ No newline at end of file diff --git a/lib/components/NeonApi/index.js b/lib/components/NeonApi/index.js index dffe7ed4..aee433fa 100644 --- a/lib/components/NeonApi/index.js +++ b/lib/components/NeonApi/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _NeonApi.default; } }); diff --git a/lib/components/NeonAuth/AuthService.js b/lib/components/NeonAuth/AuthService.js index 9f4dec01..c917edf0 100644 --- a/lib/components/NeonAuth/AuthService.js +++ b/lib/components/NeonAuth/AuthService.js @@ -14,50 +14,45 @@ var _rxUtil = require("../../util/rxUtil"); var _typeUtil = require("../../util/typeUtil"); var _core = require("../../types/core"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var REDIRECT_URI = 'redirectUri'; +const REDIRECT_URI = 'redirectUri'; /** * Set of white listed paths that should redirect upon logout */ -var LOGOUT_REDIRECT_PATHS = [_NeonEnvironment.default.route.account()]; -exports.LOGOUT_REDIRECT_PATHS = LOGOUT_REDIRECT_PATHS; +const LOGOUT_REDIRECT_PATHS = exports.LOGOUT_REDIRECT_PATHS = [_NeonEnvironment.default.route.account()]; var AuthActionType = /*#__PURE__*/function (AuthActionType) { AuthActionType["LOGIN"] = "LOGIN"; AuthActionType["LOGOUT"] = "LOGOUT"; return AuthActionType; }(AuthActionType || {}); -var factory = { - createSilentIFrame: function createSilentIFrame() { - var silentIFrame = document.createElement('iframe'); +const factory = { + createSilentIFrame: () => { + const silentIFrame = document.createElement('iframe'); silentIFrame.style.display = 'none'; return silentIFrame; }, - createRxStompConfig: function createRxStompConfig() { - return { - webSocketFactory: function webSocketFactory() { - return new _sockjsClient.default(_NeonEnvironment.default.getFullAuthApiPath('ws', false)); - }, - reconnectDelay: 1000, - connectHeaders: _NeonApi.default.getApiTokenHeader(), - disconnectHeaders: _NeonApi.default.getApiTokenHeader() - }; - }, - createRxStompClient: function createRxStompClient(config, dispatch, onConnectCbs) { - var client = new _rxStomp.RxStomp(); + createRxStompConfig: () => ({ + webSocketFactory: () => new _sockjsClient.default(_NeonEnvironment.default.getFullAuthApiPath('ws', false)), + reconnectDelay: 1000, + connectHeaders: _NeonApi.default.getApiTokenHeader(), + disconnectHeaders: _NeonApi.default.getApiTokenHeader() + }), + createRxStompClient: (config, dispatch, onConnectCbs) => { + const client = new _rxStomp.RxStomp(); client.configure(config); // eslint-disable-next-line no-unused-vars - client.connected$.subscribe(function (state) { + client.connected$.subscribe(state => { dispatch({ type: 'setAuthWsConnected', isAuthWsConnected: true }); if (onConnectCbs) { - onConnectCbs.forEach(function (cb) { + onConnectCbs.forEach(cb => { if (typeof cb === 'function') cb(); }); } }); - client.stompClient.onDisconnect = function () { + client.stompClient.onDisconnect = () => { dispatch({ type: 'setAuthWsConnected', isAuthWsConnected: false @@ -77,40 +72,37 @@ var factory = { * @param {boolean} shouldRedirect - Option to redirect when resolving * @return The RxJS Subscription */ - createWorkingResolverSubscription: function createWorkingResolverSubscription(service, state, dispatch, actionType, shouldRedirect) { - return (0, _rxjs.of)(true).pipe((0, _rxjs.delay)(15000), (0, _rxjs.tap)(function () { - if (shouldRedirect) { - switch (actionType) { - case AuthActionType.LOGIN: - service.login(); - break; - case AuthActionType.LOGOUT: - service.logout(); - break; - default: - break; - } - return; + createWorkingResolverSubscription: (service, state, dispatch, actionType, shouldRedirect) => (0, _rxjs.of)(true).pipe((0, _rxjs.delay)(15000), (0, _rxjs.tap)(() => { + if (shouldRedirect) { + switch (actionType) { + case AuthActionType.LOGIN: + service.login(); + break; + case AuthActionType.LOGOUT: + service.logout(); + break; + default: + break; } - dispatch({ - type: 'setAuthWorking', - isAuthWorking: false - }); - // Clean up iframe - try { - if ((0, _typeUtil.exists)(state.silentIFrame)) { - document.body.removeChild(state.silentIFrame); - state.silentIFrame = undefined; // eslint-disable-line no-param-reassign - } - } catch (e) { - console.error(e); // eslint-disable-line no-console + return; + } + dispatch({ + type: 'setAuthWorking', + isAuthWorking: false + }); + // Clean up iframe + try { + if ((0, _typeUtil.exists)(state.silentIFrame)) { + document.body.removeChild(state.silentIFrame); + state.silentIFrame = undefined; // eslint-disable-line no-param-reassign } - - service.fetchUserInfoWithDispatch(dispatch, true); - })).subscribe(); - } + } catch (e) { + console.error(e); // eslint-disable-line no-console + } + service.fetchUserInfoWithDispatch(dispatch, true); + })).subscribe() }; -var state = { +const state = { silentIFrame: undefined, rxStompClient: undefined, watchSubscription$: undefined, @@ -119,11 +111,9 @@ var state = { logoutCancellationSubject$: new _rxjs.Subject(), workingResolverSubscription$: undefined }; -var AuthService = { - getState: function getState() { - return state; - }, - allowSilentAuth: function allowSilentAuth() { +const AuthService = { + getState: () => state, + allowSilentAuth: () => { if (_NeonEnvironment.default.authDisableWs) { return false; } @@ -138,27 +128,25 @@ var AuthService = { return false; } }, - isAuthOnlyApp: function isAuthOnlyApp() { - return [_NeonEnvironment.default.route.account()].indexOf(_NeonEnvironment.default.getRouterBaseHomePath() || '') >= 0; - }, - getLoginRedirectUri: function getLoginRedirectUri() { - var appHomePath = _NeonEnvironment.default.getRouterBaseHomePath(); - var currentPath = window.location.pathname; - var hasPath = (0, _typeUtil.isStringNonEmpty)(currentPath) && currentPath.includes(appHomePath); + isAuthOnlyApp: () => [_NeonEnvironment.default.route.account()].indexOf(_NeonEnvironment.default.getRouterBaseHomePath() || '') >= 0, + getLoginRedirectUri: () => { + const appHomePath = _NeonEnvironment.default.getRouterBaseHomePath(); + const currentPath = window.location.pathname; + const hasPath = (0, _typeUtil.isStringNonEmpty)(currentPath) && currentPath.includes(appHomePath); return hasPath ? currentPath : undefined; }, - login: function login(path, redirectUriPath) { - var env = _NeonEnvironment.default; - var rootPath = (0, _typeUtil.exists)(path) ? path : env.getFullAuthPath('login'); - var appliedRedirectUri = (0, _typeUtil.exists)(redirectUriPath) ? redirectUriPath : env.route.getFullRoute(env.getRouterBaseHomePath()); - var redirectUrl = "".concat(window.location.protocol, "//").concat(window.location.host).concat(appliedRedirectUri); - var href = "".concat(rootPath, "?").concat(REDIRECT_URI, "=").concat(encodeURIComponent(redirectUrl)); + login: (path, redirectUriPath) => { + const env = _NeonEnvironment.default; + const rootPath = (0, _typeUtil.exists)(path) ? path : env.getFullAuthPath('login'); + const appliedRedirectUri = (0, _typeUtil.exists)(redirectUriPath) ? redirectUriPath : env.route.getFullRoute(env.getRouterBaseHomePath()); + const redirectUrl = "".concat(window.location.protocol, "//").concat(window.location.host).concat(appliedRedirectUri); + const href = "".concat(rootPath, "?").concat(REDIRECT_URI, "=").concat(encodeURIComponent(redirectUrl)); window.location.href = href; }, - loginSilently: function loginSilently(dispatch, isSsoCheck, path, redirectUriPath) { + loginSilently: (dispatch, isSsoCheck, path, redirectUriPath) => { // Until custom domains are implemented, // Safari does not support silent auth flow - var allowSilent = AuthService.allowSilentAuth(); + const allowSilent = AuthService.allowSilentAuth(); if (isSsoCheck && !allowSilent) { return; } @@ -171,7 +159,7 @@ var AuthService = { isAuthWorking: true }); state.workingResolverSubscription$ = factory.createWorkingResolverSubscription(AuthService, state, dispatch, AuthActionType.LOGIN, !isSsoCheck); - (0, _rxUtil.getJson)(_NeonEnvironment.default.getFullAuthPath('silentLogin'), function (response) { + (0, _rxUtil.getJson)(_NeonEnvironment.default.getFullAuthPath('silentLogin'), response => { if (response && response.url) { state.silentIFrame = factory.createSilentIFrame(); state.silentIFrame.src = response.url; @@ -183,7 +171,7 @@ var AuthService = { }); AuthService.cancelWorkingResolver(); } - }, function (error) { + }, error => { console.error(error); // eslint-disable-line no-console dispatch({ type: 'setAuthWorking', @@ -192,18 +180,18 @@ var AuthService = { AuthService.cancelWorkingResolver(); }, state.loginCancellationSubject$, undefined, true); }, - logout: function logout(path, redirectUriPath) { - var env = _NeonEnvironment.default; - var rootPath = (0, _typeUtil.exists)(path) ? path : env.getFullAuthPath('logout'); - var appliedRedirectUri = (0, _typeUtil.exists)(redirectUriPath) ? redirectUriPath : env.route.getFullRoute(env.getRouterBaseHomePath()); - var redirectUrl = "".concat(window.location.protocol, "//").concat(window.location.host).concat(appliedRedirectUri); - var href = "".concat(rootPath, "?").concat(REDIRECT_URI, "=").concat(encodeURIComponent(redirectUrl)); + logout: (path, redirectUriPath) => { + const env = _NeonEnvironment.default; + const rootPath = (0, _typeUtil.exists)(path) ? path : env.getFullAuthPath('logout'); + const appliedRedirectUri = (0, _typeUtil.exists)(redirectUriPath) ? redirectUriPath : env.route.getFullRoute(env.getRouterBaseHomePath()); + const redirectUrl = "".concat(window.location.protocol, "//").concat(window.location.host).concat(appliedRedirectUri); + const href = "".concat(rootPath, "?").concat(REDIRECT_URI, "=").concat(encodeURIComponent(redirectUrl)); window.location.href = href; }, - logoutSilently: function logoutSilently(dispatch, path, redirectUriPath) { + logoutSilently: (dispatch, path, redirectUriPath) => { // Until custom domains are implemented, // Safari does not support silent auth flow - var allowSilent = AuthService.allowSilentAuth(); + const allowSilent = AuthService.allowSilentAuth(); if (!allowSilent) { AuthService.logout(path, redirectUriPath); return; @@ -213,7 +201,7 @@ var AuthService = { isAuthWorking: true }); state.workingResolverSubscription$ = factory.createWorkingResolverSubscription(AuthService, state, dispatch, AuthActionType.LOGOUT, true); - (0, _rxUtil.getJson)(_NeonEnvironment.default.getFullAuthPath('silentLogout'), function (response) { + (0, _rxUtil.getJson)(_NeonEnvironment.default.getFullAuthPath('silentLogout'), response => { if (response && response.url) { state.silentIFrame = factory.createSilentIFrame(); state.silentIFrame.src = response.url; @@ -225,7 +213,7 @@ var AuthService = { }); AuthService.cancelWorkingResolver(); } - }, function (error) { + }, error => { console.error(error); // eslint-disable-line no-console dispatch({ type: 'setAuthWorking', @@ -234,44 +222,36 @@ var AuthService = { AuthService.cancelWorkingResolver(); }, state.logoutCancellationSubject$, undefined, true); }, - cancellationEmitter: function cancellationEmitter() { + cancellationEmitter: () => { state.cancellationSubject$.next(true); state.cancellationSubject$.unsubscribe(); }, - fetchUserInfo: function fetchUserInfo(cb, errorCb) { - return (0, _rxUtil.getJson)(_NeonEnvironment.default.getFullAuthPath('userInfo'), cb, errorCb, state.cancellationSubject$, undefined, true); - }, - fetchUserInfoWithDispatch: function fetchUserInfoWithDispatch(dispatch, refreshSubscription) { - return AuthService.fetchUserInfo(function (response) { - dispatch({ - type: 'fetchAuthSucceeded', - isAuthenticated: AuthService.isAuthenticated(response), - response: response - }); - if (refreshSubscription) { - AuthService.refreshWatchAuth0Subscription(dispatch, true); - } - }, function (error) { - console.error(error); // eslint-disable-line no-console - dispatch({ - type: 'fetchAuthFailed', - error: error - }); + fetchUserInfo: (cb, errorCb) => (0, _rxUtil.getJson)(_NeonEnvironment.default.getFullAuthPath('userInfo'), cb, errorCb, state.cancellationSubject$, undefined, true), + fetchUserInfoWithDispatch: (dispatch, refreshSubscription) => AuthService.fetchUserInfo(response => { + dispatch({ + type: 'fetchAuthSucceeded', + isAuthenticated: AuthService.isAuthenticated(response), + response }); - }, - isAuthenticated: function isAuthenticated(response) { - return (0, _typeUtil.exists)(response) && (0, _typeUtil.exists)(response.data) && (0, _typeUtil.exists)(response.data.user) && typeof response.data.user.user_id === 'string' && response.data.user.user_id.length > 0 && typeof response.data.user.email === 'string' && response.data.user.email.length > 0; - }, - isSsoLogin: function isSsoLogin(response) { - return (0, _typeUtil.exists)(response) && (0, _typeUtil.exists)(response.data) && response.data.ssoLogin === true; - }, - parseUserData: function parseUserData(response) { + if (refreshSubscription) { + AuthService.refreshWatchAuth0Subscription(dispatch, true); + } + }, error => { + console.error(error); // eslint-disable-line no-console + dispatch({ + type: 'fetchAuthFailed', + error + }); + }), + isAuthenticated: response => (0, _typeUtil.exists)(response) && (0, _typeUtil.exists)(response.data) && (0, _typeUtil.exists)(response.data.user) && typeof response.data.user.user_id === 'string' && response.data.user.user_id.length > 0 && typeof response.data.user.email === 'string' && response.data.user.email.length > 0, + isSsoLogin: response => (0, _typeUtil.exists)(response) && (0, _typeUtil.exists)(response.data) && response.data.ssoLogin === true, + parseUserData: response => { if (!(0, _typeUtil.exists)(response)) { return null; } return response; }, - watchAuth0: function watchAuth0(dispatch, onConnectCbs) { + watchAuth0: (dispatch, onConnectCbs) => { // If the WS subscription is disabled, do not attempt to connect if (_NeonEnvironment.default.authDisableWs || _NeonEnvironment.default.getAuthSilentType() === _core.AuthSilentType.DISABLED) { return state.watchSubscription$; @@ -283,10 +263,10 @@ var AuthService = { if (state.rxStompClient) { AuthService.teardown(); } - var client = factory.createRxStompClient(factory.createRxStompConfig(), dispatch, onConnectCbs); - var watchSubscription$ = client.watch(_NeonEnvironment.default.authTopics.getAuth0()).pipe((0, _rxjs.map)(function (message) { + const client = factory.createRxStompClient(factory.createRxStompConfig(), dispatch, onConnectCbs); + const watchSubscription$ = client.watch(_NeonEnvironment.default.authTopics.getAuth0()).pipe((0, _rxjs.map)(message => { try { - var authMessage = JSON.parse(message.body); + const authMessage = JSON.parse(message.body); if (authMessage && authMessage.success) { if (authMessage.logout) { // If successful logout and auth only app, redirect @@ -321,7 +301,7 @@ var AuthService = { } }), // @ts-ignore - (0, _rxjs.catchError)(function (error) { + (0, _rxjs.catchError)(error => { console.error(error); // eslint-disable-line no-console try { // Clean up iframe @@ -344,7 +324,7 @@ var AuthService = { state.watchSubscription$ = watchSubscription$; return state.watchSubscription$; }, - teardown: function teardown() { + teardown: () => { if (state.watchSubscription$) { state.watchSubscription$.unsubscribe(); state.watchSubscription$ = undefined; @@ -354,14 +334,14 @@ var AuthService = { state.rxStompClient = undefined; } }, - refreshWatchAuth0Subscription: function refreshWatchAuth0Subscription(dispatch, delayed) { - var delayMs = delayed === true ? 300 : 0; - (0, _rxjs.of)(true).pipe((0, _rxjs.delay)(delayMs), (0, _rxjs.tap)(function () { + refreshWatchAuth0Subscription: (dispatch, delayed) => { + const delayMs = delayed === true ? 300 : 0; + (0, _rxjs.of)(true).pipe((0, _rxjs.delay)(delayMs), (0, _rxjs.tap)(() => { AuthService.teardown(); AuthService.watchAuth0(dispatch); })).subscribe(); }, - cancelWorkingResolver: function cancelWorkingResolver() { + cancelWorkingResolver: () => { // If we've resolved the working state, cancel resolver if (typeof state.workingResolverSubscription$ !== 'undefined') { state.workingResolverSubscription$.unsubscribe(); @@ -370,5 +350,4 @@ var AuthService = { } }; Object.freeze(AuthService); -var _default = AuthService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = AuthService; \ No newline at end of file diff --git a/lib/components/NeonAuth/NeonAuth.js b/lib/components/NeonAuth/NeonAuth.js index 9062812b..e5ca90ae 100644 --- a/lib/components/NeonAuth/NeonAuth.js +++ b/lib/components/NeonAuth/NeonAuth.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -17,42 +16,33 @@ var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _NeonSignInButtonState = _interopRequireDefault(require("../NeonSignInButton/NeonSignInButtonState")); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* eslint-disable react/no-unused-prop-types */ -var NeonAuthType = /*#__PURE__*/function (NeonAuthType) { +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +/* eslint-disable react/no-unused-prop-types */ +let NeonAuthType = exports.NeonAuthType = /*#__PURE__*/function (NeonAuthType) { NeonAuthType["REDIRECT"] = "REDIRECT"; NeonAuthType["SILENT"] = "SILENT"; return NeonAuthType; }({}); -exports.NeonAuthType = NeonAuthType; -var NeonAuthDisplayType = /*#__PURE__*/function (NeonAuthDisplayType) { +let NeonAuthDisplayType = exports.NeonAuthDisplayType = /*#__PURE__*/function (NeonAuthDisplayType) { NeonAuthDisplayType["MENU"] = "MENU"; return NeonAuthDisplayType; }({}); -exports.NeonAuthDisplayType = NeonAuthDisplayType; -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - button: { - whiteSpace: 'nowrap', - // The following styles are !important overrides to styles applied by the drupal header.css - // when NeonAuth is injected into the drupal header. - color: "".concat(theme.palette.primary.main, " !important"), - textTransform: 'uppercase !important', - fontSize: '0.55rem !important', - fontWeight: '600 !important', - fontFamily: '"Inter",Helvetica,Arial,sans-serif !important', - lineHeight: '1.75 !important' - } - }; -}); -var UX_TIMEOUT_MS = 300; -var triggerAuth = function triggerAuth(path, login, dispatch, redirectUriPath) { +const useStyles = (0, _styles.makeStyles)(theme => ({ + button: { + whiteSpace: 'nowrap', + // The following styles are !important overrides to styles applied by the drupal header.css + // when NeonAuth is injected into the drupal header. + color: "".concat(theme.palette.primary.main, " !important"), + textTransform: 'uppercase !important', + fontSize: '0.55rem !important', + fontWeight: '600 !important', + fontFamily: '"Inter",Helvetica,Arial,sans-serif !important', + lineHeight: '1.75 !important' + } +})); +const UX_TIMEOUT_MS = 300; +const triggerAuth = (path, login, dispatch, redirectUriPath) => { if (!path) return; // Give the browser time to render to allow for immediate feedback // by way of a spinner. @@ -60,7 +50,7 @@ var triggerAuth = function triggerAuth(path, login, dispatch, redirectUriPath) { type: 'setAuthWorking', isAuthWorking: true }); - setTimeout(function () { + setTimeout(() => { if (login) { _AuthService.default.login(path, redirectUriPath); } else { @@ -68,24 +58,26 @@ var triggerAuth = function triggerAuth(path, login, dispatch, redirectUriPath) { } }, UX_TIMEOUT_MS); }; -var renderAuth = function renderAuth(props, classes, isAuthenticated, showAuthWorking, isAuthWsConnected, dispatch) { - var loginType = props.loginType, - logoutType = props.logoutType, - displayType = props.displayType, - loginPath = props.loginPath, - logoutPath = props.logoutPath, - accountPath = props.accountPath; - var handleLogin = function handleLogin() { +const renderAuth = (props, classes, isAuthenticated, showAuthWorking, isAuthWsConnected, dispatch) => { + const { + loginType, + logoutType, + displayType, + loginPath, + logoutPath, + accountPath + } = props; + const handleLogin = () => { if (_NeonEnvironment.default.enableGlobalSignInState) { // Notify observers the sign in button has been clicked. _NeonSignInButtonState.default.sendNotification(); } - var appliedLoginType = loginType; + let appliedLoginType = loginType; // Default to redirect if WS isn't connected if (!isAuthWsConnected) { appliedLoginType = NeonAuthType.REDIRECT; } - var redirectUriPath = _AuthService.default.getLoginRedirectUri(); + const redirectUriPath = _AuthService.default.getLoginRedirectUri(); switch (appliedLoginType) { case NeonAuthType.SILENT: _AuthService.default.loginSilently(dispatch, false, loginPath, redirectUriPath); @@ -96,21 +88,21 @@ var renderAuth = function renderAuth(props, classes, isAuthenticated, showAuthWo break; } }; - var handleLogout = function handleLogout() { - var appliedLogoutType = logoutType; - var redirectUriPath; + const handleLogout = () => { + let appliedLogoutType = logoutType; + let redirectUriPath; // Default to redirect if WS isn't connected if (!isAuthWsConnected) { appliedLogoutType = NeonAuthType.REDIRECT; } - var appHomePath = _NeonEnvironment.default.getRouterBaseHomePath(); + const appHomePath = _NeonEnvironment.default.getRouterBaseHomePath(); if (_AuthService.LOGOUT_REDIRECT_PATHS.indexOf(appHomePath) >= 0) { appliedLogoutType = NeonAuthType.REDIRECT; redirectUriPath = _NeonEnvironment.default.route.home(); } else { // If not a auto redirect path, redirect back to the current path - var currentPath = window.location.pathname; - var hasPath = (0, _typeUtil.isStringNonEmpty)(currentPath) && currentPath.includes(appHomePath); + const currentPath = window.location.pathname; + const hasPath = (0, _typeUtil.isStringNonEmpty)(currentPath) && currentPath.includes(appHomePath); redirectUriPath = hasPath ? currentPath : appHomePath; } switch (appliedLogoutType) { @@ -124,7 +116,7 @@ var renderAuth = function renderAuth(props, classes, isAuthenticated, showAuthWo } }; // eslint-disable-next-line react/jsx-no-useless-fragment - var authContent = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null); + let authContent = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null); switch (displayType) { case NeonAuthDisplayType.MENU: default: @@ -133,9 +125,7 @@ var renderAuth = function renderAuth(props, classes, isAuthenticated, showAuthWo variant: "outlined", className: classes.button, "data-selenium": "neon-menu.sign-in-button", - onClick: function onClick() { - return handleLogin(); - } + onClick: () => handleLogin() }, "Sign In"); if (showAuthWorking) { authContent = /*#__PURE__*/_react.default.createElement("div", { @@ -160,9 +150,7 @@ var renderAuth = function renderAuth(props, classes, isAuthenticated, showAuthWo }, /*#__PURE__*/_react.default.createElement(_Button.default, { className: classes.button, "data-selenium": "neon-menu.sign-out-button", - onClick: function onClick() { - return handleLogout(); - } + onClick: () => handleLogout() }, "Sign Out"), /*#__PURE__*/_react.default.createElement(_Button.default, { href: accountPath, className: classes.button, @@ -173,21 +161,24 @@ var renderAuth = function renderAuth(props, classes, isAuthenticated, showAuthWo } return authContent; }; -var NeonAuth = function NeonAuth(props) { - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 2), - _NeonContext$useNeonC3 = _NeonContext$useNeonC2[0], - _NeonContext$useNeonC4 = _NeonContext$useNeonC3.auth, - isAuthenticated = _NeonContext$useNeonC4.isAuthenticated, - isAuthWorking = _NeonContext$useNeonC4.isAuthWorking, - isAuthWsConnected = _NeonContext$useNeonC4.isAuthWsConnected, - status = _NeonContext$useNeonC3.fetches.auth.status, - dispatch = _NeonContext$useNeonC2[1]; - var classes = useStyles(_Theme.default); - var isFetchingAuthentication = status === _NeonContext.FETCH_STATUS.FETCHING; - var isAuthFetched = [_NeonContext.FETCH_STATUS.SUCCESS, _NeonContext.FETCH_STATUS.ERROR].indexOf(status) >= 0; - var showAuthWorking = isAuthWorking || isFetchingAuthentication; - var authFetchCb = (0, _react.useCallback)(function () { +const NeonAuth = props => { + const [{ + auth: { + isAuthenticated, + isAuthWorking, + isAuthWsConnected + }, + fetches: { + auth: { + status + } + } + }, dispatch] = _NeonContext.default.useNeonContextState(); + const classes = useStyles(_Theme.default); + const isFetchingAuthentication = status === _NeonContext.FETCH_STATUS.FETCHING; + const isAuthFetched = [_NeonContext.FETCH_STATUS.SUCCESS, _NeonContext.FETCH_STATUS.ERROR].indexOf(status) >= 0; + const showAuthWorking = isAuthWorking || isFetchingAuthentication; + const authFetchCb = (0, _react.useCallback)(() => { _AuthService.default.fetchUserInfoWithDispatch(dispatch); }, [dispatch]); if (!isFetchingAuthentication && !isAuthFetched) { @@ -195,6 +186,5 @@ var NeonAuth = function NeonAuth(props) { } return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderAuth(props, classes, isAuthenticated, showAuthWorking, isAuthWsConnected, dispatch)); }; -var WrappedNeonAuth = _Theme.default.getWrappedComponent(_NeonContext.default.getWrappedComponent(NeonAuth)); -var _default = WrappedNeonAuth; -exports.default = _default; \ No newline at end of file +const WrappedNeonAuth = _Theme.default.getWrappedComponent(_NeonContext.default.getWrappedComponent(NeonAuth)); +var _default = exports.default = WrappedNeonAuth; \ No newline at end of file diff --git a/lib/components/NeonAuth/UserCard.js b/lib/components/NeonAuth/UserCard.js index 5d7baa8c..94954906 100644 --- a/lib/components/NeonAuth/UserCard.js +++ b/lib/components/NeonAuth/UserCard.js @@ -18,104 +18,103 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /* eslint-disable jsx-a11y/label-has-associated-control */ // eslint-disable-next-line no-unused-vars -var useStyles = (0, _styles.makeStyles)(function (theme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - cardHeaderContainer: { - padding: '10px', - '& label.account-title': { - marginLeft: '20px', - height: '68px', - marginTop: '25px', - fontWeight: 600, - fontSize: '20px' - }, - '& img.profile-image': { - width: '120px' - } - }, - card: { - margin: 'auto', - textAlign: 'center' - }, - profileArea: { - '& img': { - marginBottom: '15px', - borderRadius: '50%', - marginLeft: '10px', - marginRight: '10px' - } - }, - profileInfoArea: { - width: '100%', - textAlign: 'left', - display: 'inline-block', - marginTop: '20px', - '& i.fa': { - marginRight: '10px' - }, - '& i.fa-user': { - verticalAlign: 'middle' - }, - '& label': { - fontSize: '16px', - fontWeight: 600 - }, - '& label.label-block': { - display: 'block', - paddingBottom: '5px' - }, - '& div.label-info-container': { - padding: '10px', - paddingTop: '20px', - paddingLeft: '20px', - paddingRight: '20px' - }, - '& div.label-name-container': { - padding: '10px' - }, - '& label.username-label': { - verticalAlign: 'middle' - }, - '& label.label-normal': { - fontSize: '14px', - fontWeight: 'normal', - wordBreak: 'break-all' - } - }, - emailChipContainer: { - '& .MuiChip-root': { - height: '100% !important' - }, - '& .MuiChip-label': { - width: '100% !important', - wordBreak: 'break-all !important', - whiteSpace: 'normal !important', - padding: '6px' - }, - '& .chip-email.MuiChip-root': { - fontSize: '.90em !important' - }, - '& .chip-email .MuiAvatar-root.MuiChip-avatar.MuiChip-avatarColorPrimary': { - width: '32px !important', - height: '32px !important' - } - } - }) - ); -}); -var UserCard = function UserCard(props) { - var pictureUrl = props.pictureUrl, - email = props.email, - fullName = props.fullName, - providers = props.providers, - lastLogin = props.lastLogin; - var classes = useStyles(_Theme.default); - var lastLoginDisplay = null; +const useStyles = (0, _styles.makeStyles)(theme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + cardHeaderContainer: { + padding: '10px', + '& label.account-title': { + marginLeft: '20px', + height: '68px', + marginTop: '25px', + fontWeight: 600, + fontSize: '20px' + }, + '& img.profile-image': { + width: '120px' + } + }, + card: { + margin: 'auto', + textAlign: 'center' + }, + profileArea: { + '& img': { + marginBottom: '15px', + borderRadius: '50%', + marginLeft: '10px', + marginRight: '10px' + } + }, + profileInfoArea: { + width: '100%', + textAlign: 'left', + display: 'inline-block', + marginTop: '20px', + '& i.fa': { + marginRight: '10px' + }, + '& i.fa-user': { + verticalAlign: 'middle' + }, + '& label': { + fontSize: '16px', + fontWeight: 600 + }, + '& label.label-block': { + display: 'block', + paddingBottom: '5px' + }, + '& div.label-info-container': { + padding: '10px', + paddingTop: '20px', + paddingLeft: '20px', + paddingRight: '20px' + }, + '& div.label-name-container': { + padding: '10px' + }, + '& label.username-label': { + verticalAlign: 'middle' + }, + '& label.label-normal': { + fontSize: '14px', + fontWeight: 'normal', + wordBreak: 'break-all' + } + }, + emailChipContainer: { + '& .MuiChip-root': { + height: '100% !important' + }, + '& .MuiChip-label': { + width: '100% !important', + wordBreak: 'break-all !important', + whiteSpace: 'normal !important', + padding: '6px' + }, + '& .chip-email.MuiChip-root': { + fontSize: '.90em !important' + }, + '& .chip-email .MuiAvatar-root.MuiChip-avatar.MuiChip-avatarColorPrimary': { + width: '32px !important', + height: '32px !important' + } + } +})); +const UserCard = props => { + const { + pictureUrl, + email, + fullName, + providers, + lastLogin + } = props; + const classes = useStyles(_Theme.default); + let lastLoginDisplay = null; if ((0, _typeUtil.exists)(lastLogin)) { - var dateFmt = 'MMMM Do, YYYY h:mm:ss a'; - var lastLoginDate = (0, _moment.default)(new Date(lastLogin)); + const dateFmt = 'MMMM Do, YYYY h:mm:ss a'; + const lastLoginDate = (0, _moment.default)(new Date(lastLogin)); lastLoginDisplay = lastLoginDate.format(dateFmt); } return /*#__PURE__*/_react.default.createElement("div", { @@ -160,5 +159,4 @@ var UserCard = function UserCard(props) { className: "label-normal" }, lastLoginDisplay))))); }; -var _default = UserCard; -exports.default = _default; \ No newline at end of file +var _default = exports.default = UserCard; \ No newline at end of file diff --git a/lib/components/NeonAuth/index.js b/lib/components/NeonAuth/index.js index 9b814391..3075990e 100644 --- a/lib/components/NeonAuth/index.js +++ b/lib/components/NeonAuth/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _NeonAuth.default; } }); diff --git a/lib/components/NeonContext/NeonContext.js b/lib/components/NeonContext/NeonContext.js index e2a1836b..ce51657d 100644 --- a/lib/components/NeonContext/NeonContext.js +++ b/lib/components/NeonContext/NeonContext.js @@ -19,31 +19,19 @@ var _domains = _interopRequireDefault(require("../../staticJSON/domains.json")); var _timeSeriesDataProducts = _interopRequireDefault(require("../../staticJSON/timeSeriesDataProducts.json")); var _BundleParser = _interopRequireDefault(require("../../parser/BundleParser")); var _typeUtil = require("../../util/typeUtil"); -var _html, _fetches; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var DRUPAL_HEADER_HTML = _remoteAssetsMap.default.DRUPAL_HEADER_HTML.KEY; -var DRUPAL_FOOTER_HTML = _remoteAssetsMap.default.DRUPAL_FOOTER_HTML.KEY; -var FETCH_STATUS = { +const DRUPAL_HEADER_HTML = _remoteAssetsMap.default.DRUPAL_HEADER_HTML.KEY; +const DRUPAL_FOOTER_HTML = _remoteAssetsMap.default.DRUPAL_FOOTER_HTML.KEY; +const FETCH_STATUS = exports.FETCH_STATUS = { AWAITING_CALL: 'AWAITING_CALL', FETCHING: 'FETCHING', ERROR: 'ERROR', SUCCESS: 'SUCCESS' }; -exports.FETCH_STATUS = FETCH_STATUS; -var DEFAULT_STATE = { +const DEFAULT_STATE = { data: { sites: {}, // See for details: interface BundleContext @@ -62,9 +50,11 @@ var DEFAULT_STATE = { // derived when sites is fetched domainSites: {} // derived when sites is fetched }, - - html: (_html = {}, _defineProperty(_html, DRUPAL_HEADER_HTML, null), _defineProperty(_html, DRUPAL_FOOTER_HTML, null), _html), - fetches: (_fetches = { + html: { + [DRUPAL_HEADER_HTML]: null, + [DRUPAL_FOOTER_HTML]: null + }, + fetches: { sites: { status: FETCH_STATUS.AWAITING_CALL, error: null @@ -76,14 +66,16 @@ var DEFAULT_STATE = { auth: { status: null, error: null + }, + [DRUPAL_HEADER_HTML]: { + status: null, + error: null + }, + [DRUPAL_FOOTER_HTML]: { + status: null, + error: null } - }, _defineProperty(_fetches, DRUPAL_HEADER_HTML, { - status: null, - error: null - }), _defineProperty(_fetches, DRUPAL_FOOTER_HTML, { - status: null, - error: null - }), _fetches), + }, auth: { useCore: false, isAuthenticated: false, @@ -100,13 +92,14 @@ var DEFAULT_STATE = { // Derive values for stateSites and domainSites in state. This is a one-time mapping we // generate when sites are loaded into state containing lists of site codes for each // state code / domain code. -var deriveRegionSites = function deriveRegionSites(state) { - var stateSites = {}; - var domainSites = {}; - Object.keys(state.data.sites).forEach(function (siteCode) { - var _state$data$sites$sit = state.data.sites[siteCode], - stateCode = _state$data$sites$sit.stateCode, - domainCode = _state$data$sites$sit.domainCode; +const deriveRegionSites = state => { + const stateSites = {}; + const domainSites = {}; + Object.keys(state.data.sites).forEach(siteCode => { + const { + stateCode, + domainCode + } = state.data.sites[siteCode]; if (!stateSites[stateCode]) { stateSites[stateCode] = new Set(); } @@ -117,15 +110,13 @@ var deriveRegionSites = function deriveRegionSites(state) { domainSites[domainCode].add(siteCode); }); // Fill in empty sets for any states that had no NEON sites - Object.keys(state.data.states).filter(function (stateCode) { - return !stateSites[stateCode]; - }).forEach(function (stateCode) { + Object.keys(state.data.states).filter(stateCode => !stateSites[stateCode]).forEach(stateCode => { stateSites[stateCode] = new Set(); }); return _extends({}, state, { data: _extends({}, state.data, { - stateSites: stateSites, - domainSites: domainSites + stateSites, + domainSites }) }); }; @@ -133,38 +124,38 @@ var deriveRegionSites = function deriveRegionSites(state) { /** CONTEXT */ -var Context = /*#__PURE__*/(0, _react.createContext)(DEFAULT_STATE); +const Context = /*#__PURE__*/(0, _react.createContext)(DEFAULT_STATE); /** HOOK */ -var useNeonContextState = function useNeonContextState() { - var hookResponse = (0, _react.useContext)(Context); +const useNeonContextState = () => { + const hookResponse = (0, _react.useContext)(Context); // If called by a component that's not inside a NeonContext the hookResponse will be // DEFAULT_STATE. Otherwise it will return an array of length one containing the current state. // Thus we double-check here that we got an active state before returning it. if (!Array.isArray(hookResponse) || !hookResponse[0].isActive) { - return [_extends({}, DEFAULT_STATE), function () {}]; + return [_extends({}, DEFAULT_STATE), () => {}]; } return hookResponse; }; -var determineContextFetchFinal = function determineContextFetchFinal(state) { - var authFinal = !state.auth.useCore || state.fetches.auth.status === FETCH_STATUS.SUCCESS || state.fetches.auth.status === FETCH_STATUS.ERROR; - var sitesFinal = state.fetches.sites.status === FETCH_STATUS.SUCCESS || state.fetches.sites.status === FETCH_STATUS.ERROR; - var bundlesFinal = state.fetches.bundles.status === FETCH_STATUS.SUCCESS || state.fetches.bundles.status === FETCH_STATUS.ERROR; +const determineContextFetchFinal = state => { + const authFinal = !state.auth.useCore || state.fetches.auth.status === FETCH_STATUS.SUCCESS || state.fetches.auth.status === FETCH_STATUS.ERROR; + const sitesFinal = state.fetches.sites.status === FETCH_STATUS.SUCCESS || state.fetches.sites.status === FETCH_STATUS.ERROR; + const bundlesFinal = state.fetches.bundles.status === FETCH_STATUS.SUCCESS || state.fetches.bundles.status === FETCH_STATUS.ERROR; return authFinal && sitesFinal && bundlesFinal; }; /** Reducer */ -var reducer = function reducer(state, action) { +const reducer = (state, action) => { // Always deep clone fetches as that's the main thing we care about // changing to trigger re-renders in the consumer. - var newState = _extends({}, state, { + const newState = _extends({}, state, { fetches: (0, _cloneDeep.default)(state.fetches) }); - var hasValidRemoteAsset = action.asset && Object.keys(_remoteAssetsMap.default).includes(action.asset); + const hasValidRemoteAsset = action.asset && Object.keys(_remoteAssetsMap.default).includes(action.asset); switch (action.type) { case 'fetchCalled': if (!action.key || !state.fetches[action.key]) { @@ -250,20 +241,20 @@ var reducer = function reducer(state, action) { /** Function to convert sites fetch response to the shape we expect */ -var parseSitesFetchResponse = function parseSitesFetchResponse() { - var sitesArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; +const parseSitesFetchResponse = function () { + let sitesArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; if (!Array.isArray(sitesArray)) { return {}; } - var sitesObj = {}; - sitesArray.forEach(function (site) { - var siteCode = site.siteCode || site.code || null; + const sitesObj = {}; + sitesArray.forEach(site => { + const siteCode = site.siteCode || site.code || null; if (!siteCode) { return; } - var localReference = _sites.default[siteCode] || {}; + const localReference = _sites.default[siteCode] || {}; sitesObj[site.siteCode] = { - siteCode: siteCode, + siteCode, description: site.siteDescription || site.description || null, type: site.siteType || site.type || null, stateCode: site.stateCode || null, @@ -280,13 +271,14 @@ var parseSitesFetchResponse = function parseSitesFetchResponse() { /** Context Provider */ -var Provider = function Provider(props) { - var _fetchMethods; - var children = props.children, - fetchPartials = props.fetchPartials, - useCoreAuth = props.useCoreAuth, - whenFinal = props.whenFinal; - var initialState = (0, _cloneDeep.default)(DEFAULT_STATE); +const Provider = props => { + const { + children, + fetchPartials, + useCoreAuth, + whenFinal + } = props; + const initialState = (0, _cloneDeep.default)(DEFAULT_STATE); initialState.isActive = true; if (useCoreAuth) { initialState.auth.useCore = true; @@ -296,41 +288,40 @@ var Provider = function Provider(props) { initialState.fetches[DRUPAL_HEADER_HTML].status = FETCH_STATUS.AWAITING_CALL; initialState.fetches[DRUPAL_FOOTER_HTML].status = FETCH_STATUS.AWAITING_CALL; } - var _useReducer = (0, _react.useReducer)(reducer, initialState), - _useReducer2 = _slicedToArray(_useReducer, 2), - state = _useReducer2[0], - dispatch = _useReducer2[1]; - var isFinal = state.isFinal, - whenFinalCalled = state.whenFinalCalled; + const [state, dispatch] = (0, _react.useReducer)(reducer, initialState); + const { + isFinal, + whenFinalCalled + } = state; // Method to sanitize partial HTML. As delivered presently there are some markup issues that // throw warnings when parsed with HTMLReactParser. - var sanitizePartialHTML = function sanitizePartialHTML(html) { - return html.replace(/ value=""/g, ' initialValue=""'); - }; + const sanitizePartialHTML = html => html.replace(/ value=""/g, ' initialValue=""'); // Method to fetch header and/or footer partials - var fetchPartialHTML = function fetchPartialHTML(key) { + const fetchPartialHTML = key => { if (!Object.keys(_remoteAssetsMap.default).includes(key)) { return; } - var url = _remoteAssetsMap.default[key].url; + const { + url + } = _remoteAssetsMap.default[key]; (0, _ajax.ajax)({ - url: url, + url, method: 'GET', responseType: 'text' - }).pipe((0, _rxjs.map)(function (response) { + }).pipe((0, _rxjs.map)(response => { dispatch({ type: 'fetchHtmlSucceeded', asset: key, html: sanitizePartialHTML(response.response) }); return (0, _rxjs.of)(true); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { dispatch({ type: 'fetchHtmlFailed', asset: key, - error: error + error }); return (0, _rxjs.of)(false); })).subscribe(); @@ -338,17 +329,17 @@ var Provider = function Provider(props) { // Identify any cascading authentication fetches that require // the WS to be connected to initiate. - var cascadeAuthFetches = []; + const cascadeAuthFetches = []; // Subject and effect to perform and manage the sites GraphQL fetch - var fetchMethods = (_fetchMethods = { - sites: function sites() { - _NeonGraphQL.default.getAllSites().pipe((0, _rxjs.map)(function (response) { + const fetchMethods = { + sites: () => { + _NeonGraphQL.default.getAllSites().pipe((0, _rxjs.map)(response => { if (response.response && response.response.data && response.response.data.sites) { - var sites = parseSitesFetchResponse(response.response.data.sites); + const sites = parseSitesFetchResponse(response.response.data.sites); dispatch({ type: 'fetchSitesSucceeded', - sites: sites + sites }); return (0, _rxjs.of)(true); } @@ -357,7 +348,7 @@ var Provider = function Provider(props) { error: 'malformed response' }); return (0, _rxjs.of)(false); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { dispatch({ type: 'fetchSitesFailed', error: error.message @@ -365,9 +356,9 @@ var Provider = function Provider(props) { return (0, _rxjs.of)(false); })).subscribe(); }, - bundles: function bundles() { - _NeonApi.default.getProductBundlesObservable().pipe((0, _rxjs.map)(function (response) { - var bundles = _BundleParser.default.parseBundlesResponse(response); + bundles: () => { + _NeonApi.default.getProductBundlesObservable().pipe((0, _rxjs.map)(response => { + const bundles = _BundleParser.default.parseBundlesResponse(response); if (!(0, _typeUtil.existsNonEmpty)(bundles)) { dispatch({ type: 'fetchBundlesFailed', @@ -375,13 +366,13 @@ var Provider = function Provider(props) { }); return (0, _rxjs.of)(false); } - var context = _BundleParser.default.parseContext(bundles); + const context = _BundleParser.default.parseContext(bundles); dispatch({ type: 'fetchBundlesSucceeded', bundles: context }); return (0, _rxjs.of)(true); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { dispatch({ type: 'fetchBundlesFailed', error: error.message @@ -389,68 +380,64 @@ var Provider = function Provider(props) { return (0, _rxjs.of)(false); })).subscribe(); }, - auth: function auth() { - _AuthService.default.fetchUserInfo(function (response) { - var isAuthenticated = _AuthService.default.isAuthenticated(response); + auth: () => { + _AuthService.default.fetchUserInfo(response => { + const isAuthenticated = _AuthService.default.isAuthenticated(response); if (!isAuthenticated && _AuthService.default.isSsoLogin(response)) { // If we're not authenticated and have identified another SSO // application that's authenticated, trigger a silent authentication // check flow. if (_AuthService.default.allowSilentAuth()) { if (!state.auth.isAuthWsConnected) { - cascadeAuthFetches.push(function () { - return _AuthService.default.loginSilently(dispatch, true); - }); + cascadeAuthFetches.push(() => _AuthService.default.loginSilently(dispatch, true)); } else { _AuthService.default.loginSilently(dispatch, true); } } else { dispatch({ type: 'fetchAuthSucceeded', - isAuthenticated: isAuthenticated, - response: response + isAuthenticated, + response }); } } else { dispatch({ type: 'fetchAuthSucceeded', - isAuthenticated: isAuthenticated, - response: response + isAuthenticated, + response }); } // Initialize a subscription to the auth WS _AuthService.default.watchAuth0(dispatch, cascadeAuthFetches); - }, function (error) { + }, error => { dispatch({ type: 'fetchAuthFailed', - error: error + error }); // Initialize a subscription to the auth WS _AuthService.default.watchAuth0(dispatch, cascadeAuthFetches); }); - } - }, _defineProperty(_fetchMethods, DRUPAL_HEADER_HTML, function () { - return fetchPartialHTML(DRUPAL_HEADER_HTML); - }), _defineProperty(_fetchMethods, DRUPAL_FOOTER_HTML, function () { - return fetchPartialHTML(DRUPAL_FOOTER_HTML); - }), _fetchMethods); + }, + [DRUPAL_HEADER_HTML]: () => fetchPartialHTML(DRUPAL_HEADER_HTML), + [DRUPAL_FOOTER_HTML]: () => fetchPartialHTML(DRUPAL_FOOTER_HTML) + }; // Effect: Trigger all fetches that are awaiting call - (0, _react.useEffect)(function () { - Object.keys(state.fetches).forEach(function (key) { + (0, _react.useEffect)(() => { + Object.keys(state.fetches).forEach(key => { if (state.fetches[key].status !== FETCH_STATUS.AWAITING_CALL || typeof fetchMethods[key] !== 'function') { return; } dispatch({ type: 'fetchCalled', - key: key + key }); fetchMethods[key](); }); }); // Effect: call the whenFinal function prop exactly once when first finalized - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (!isFinal || whenFinalCalled) { return; } @@ -473,7 +460,7 @@ var Provider = function Provider(props) { }, children) ); }; -var ProviderPropTypes = { +const ProviderPropTypes = { children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string])), _propTypes.default.node, _propTypes.default.string]), fetchPartials: _propTypes.default.bool, useCoreAuth: _propTypes.default.bool, @@ -484,43 +471,38 @@ Provider.defaultProps = { children: null, fetchPartials: false, useCoreAuth: false, - whenFinal: function whenFinal() {} + whenFinal: () => {} }; /** getWrappedComponent */ -var getWrappedComponent = function getWrappedComponent(Component) { - return function (props) { - var _useNeonContextState = useNeonContextState(), - _useNeonContextState2 = _slicedToArray(_useNeonContextState, 1), - isActive = _useNeonContextState2[0].isActive; - if (!isActive) { - return /*#__PURE__*/_react.default.createElement(Provider, null, /*#__PURE__*/_react.default.createElement(Component, props)); - } - return /*#__PURE__*/_react.default.createElement(Component, props); - }; +const getWrappedComponent = Component => props => { + const [{ + isActive + }] = useNeonContextState(); + if (!isActive) { + return /*#__PURE__*/_react.default.createElement(Provider, null, /*#__PURE__*/_react.default.createElement(Component, props)); + } + return /*#__PURE__*/_react.default.createElement(Component, props); }; /** Export */ -var NeonContext = { - Provider: Provider, - useNeonContextState: useNeonContextState, - DEFAULT_STATE: DEFAULT_STATE, - getWrappedComponent: getWrappedComponent, - ProviderPropTypes: ProviderPropTypes +const NeonContext = { + Provider, + useNeonContextState, + DEFAULT_STATE, + getWrappedComponent, + ProviderPropTypes }; -var _default = NeonContext; // Additional items exported for unit testing -exports.default = _default; -var getTestableItems = function getTestableItems() { - return process.env.NODE_ENV !== 'test' ? {} : { - deriveRegionSites: deriveRegionSites, - parseSitesFetchResponse: parseSitesFetchResponse, - reducer: reducer, - DRUPAL_HEADER_HTML: DRUPAL_HEADER_HTML, - DRUPAL_FOOTER_HTML: DRUPAL_FOOTER_HTML - }; +var _default = exports.default = NeonContext; // Additional items exported for unit testing +const getTestableItems = () => process.env.NODE_ENV !== 'test' ? {} : { + deriveRegionSites, + parseSitesFetchResponse, + reducer, + DRUPAL_HEADER_HTML, + DRUPAL_FOOTER_HTML }; exports.getTestableItems = getTestableItems; \ No newline at end of file diff --git a/lib/components/NeonEnvironment/NeonEnvironment.d.ts b/lib/components/NeonEnvironment/NeonEnvironment.d.ts index 68d7df9e..4d5b1aa3 100644 --- a/lib/components/NeonEnvironment/NeonEnvironment.d.ts +++ b/lib/components/NeonEnvironment/NeonEnvironment.d.ts @@ -24,6 +24,8 @@ export interface INeonEnvironment { authDisableWs: boolean; enableGlobalSignInState: boolean; fetchDrupalAssets: boolean; + getReactAppName: () => string; + getReactAppVersion: () => string; getRootApiPath: () => string; getRootGraphqlPath: () => string; getRootJsonLdPath: () => string; diff --git a/lib/components/NeonEnvironment/NeonEnvironment.js b/lib/components/NeonEnvironment/NeonEnvironment.js index d76cff51..4e82d616 100644 --- a/lib/components/NeonEnvironment/NeonEnvironment.js +++ b/lib/components/NeonEnvironment/NeonEnvironment.js @@ -5,43 +5,33 @@ Object.defineProperty(exports, "__esModule", { }); exports.requiredEnvironmentVars = exports.optionalEnvironmentVars = exports.default = exports.HostRegexService = exports.DEFAULT_WEB_HOST = exports.DEFAULT_API_HOST = void 0; var _core = require("../../types/core"); -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } /* eslint-disable prefer-regex-literals */ +/* eslint-disable prefer-regex-literals */ + // Default hosts -var DEFAULT_API_HOST = 'https://data.neonscience.org'; -exports.DEFAULT_API_HOST = DEFAULT_API_HOST; -var DEFAULT_WEB_HOST = 'https://www.neonscience.org'; -exports.DEFAULT_WEB_HOST = DEFAULT_WEB_HOST; -var HostRegexService = { - getApiHostRegex: function getApiHostRegex() { - return new RegExp(/^(data|cert-data|int-data|local-data)[.]neonscience[.]org$/); - }, - getWebHostRegex: function getWebHostRegex() { - return new RegExp(/^(www|cert-www|int-www|local-www)[.](neonscience[.]org|.+[.]us-[0-9]{1}[.]platformsh[.]site)$/); - } +const DEFAULT_API_HOST = exports.DEFAULT_API_HOST = 'https://data.neonscience.org'; +const DEFAULT_WEB_HOST = exports.DEFAULT_WEB_HOST = 'https://www.neonscience.org'; +const HostRegexService = exports.HostRegexService = { + getApiHostRegex: () => new RegExp(/^(data|cert-data|int-data|local-data)[.]neonscience[.]org$/), + getWebHostRegex: () => new RegExp(/^(www|cert-www|int-www|local-www)[.](neonscience[.]org|.+[.]us-[0-9]{1}[.]platformsh[.]site)$/) }; // Names of all environment variables that MUST be explicitly defined for the // environment to be reported as "valid". These are evnironment variables // that are expected to be referenced by all apps. Standard vars present in all // node environments (e.g. PORT, NODE_ENV, etc.) are not listed here. -exports.HostRegexService = HostRegexService; -var requiredEnvironmentVars = ['REACT_APP_NEON_PATH_API', 'REACT_APP_NEON_PATH_PUBLIC_GRAPHQL', 'REACT_APP_NEON_PATH_AUTH_API', 'REACT_APP_NEON_PATH_AUTH0_API', 'REACT_APP_NEON_ROUTER_BASE', 'REACT_APP_NEON_ROUTER_BASE_HOME']; +const requiredEnvironmentVars = exports.requiredEnvironmentVars = ['REACT_APP_NEON_PATH_API', 'REACT_APP_NEON_PATH_PUBLIC_GRAPHQL', 'REACT_APP_NEON_PATH_AUTH_API', 'REACT_APP_NEON_PATH_AUTH0_API', 'REACT_APP_NEON_ROUTER_BASE', 'REACT_APP_NEON_ROUTER_BASE_HOME']; // Names of additional environment variables that may be referenced by // this module depending on a given app's use case. Along with the above // required list this makes a complete set of all environment variables // this module will ever reference. -exports.requiredEnvironmentVars = requiredEnvironmentVars; -var optionalEnvironmentVars = ['REACT_APP_NEON_PATH_LD_API', 'REACT_APP_NEON_PATH_DOWNLOAD_API', 'REACT_APP_NEON_AUTH_DISABLE_WS', 'REACT_APP_NEON_USE_GRAPHQL', 'REACT_APP_NEON_SHOW_AOP_VIEWER', 'REACT_APP_NEON_VISUS_PRODUCTS_BASE_URL', 'REACT_APP_NEON_VISUS_IFRAME_BASE_URL', 'REACT_APP_NEON_API_HOST_OVERRIDE', 'REACT_APP_NEON_WEB_HOST_OVERRIDE', 'REACT_APP_NEON_WS_HOST_OVERRIDE', 'REACT_APP_NEON_FETCH_DRUPAL_ASSETS']; -exports.optionalEnvironmentVars = optionalEnvironmentVars; -var EnvType = { +const optionalEnvironmentVars = exports.optionalEnvironmentVars = ['REACT_APP_NEON_PATH_LD_API', 'REACT_APP_NEON_PATH_DOWNLOAD_API', 'REACT_APP_NEON_AUTH_DISABLE_WS', 'REACT_APP_NEON_USE_GRAPHQL', 'REACT_APP_NEON_SHOW_AOP_VIEWER', 'REACT_APP_NEON_VISUS_PRODUCTS_BASE_URL', 'REACT_APP_NEON_VISUS_IFRAME_BASE_URL', 'REACT_APP_NEON_API_HOST_OVERRIDE', 'REACT_APP_NEON_WEB_HOST_OVERRIDE', 'REACT_APP_NEON_WS_HOST_OVERRIDE', 'REACT_APP_NEON_FETCH_DRUPAL_ASSETS']; +const EnvType = { DEV: 'development', PROD: 'production' }; -var NeonEnvironment = { - isValid: requiredEnvironmentVars.every(function (envVar) { - return typeof process.env[envVar] !== 'undefined'; - }), +const NeonEnvironment = { + isValid: requiredEnvironmentVars.every(envVar => typeof process.env[envVar] !== 'undefined'), isDevEnv: process.env.NODE_ENV === EnvType.DEV, isProdEnv: process.env.NODE_ENV === EnvType.PROD, useGraphql: process.env.REACT_APP_NEON_USE_GRAPHQL === 'true', @@ -49,176 +39,83 @@ var NeonEnvironment = { authDisableWs: process.env.REACT_APP_NEON_AUTH_DISABLE_WS === 'true', enableGlobalSignInState: process.env.REACT_APP_NEON_ENABLE_GLOBAL_SIGNIN_STATE === 'true', fetchDrupalAssets: process.env.REACT_APP_NEON_FETCH_DRUPAL_ASSETS !== 'false', - getRootApiPath: function getRootApiPath() { - return process.env.REACT_APP_NEON_PATH_API || '/api/v0'; - }, - getRootGraphqlPath: function getRootGraphqlPath() { - return process.env.REACT_APP_NEON_PATH_PUBLIC_GRAPHQL || '/graphql'; - }, - getRootJsonLdPath: function getRootJsonLdPath() { - return "".concat(NeonEnvironment.getRootApiPath()).concat(process.env.REACT_APP_NEON_PATH_LD_API); - }, - getRootAuthApiPath: function getRootAuthApiPath() { - return process.env.REACT_APP_NEON_PATH_AUTH_API || '/api/auth/v0'; - }, - getRootAuth0ApiPath: function getRootAuth0ApiPath() { - return process.env.REACT_APP_NEON_PATH_AUTH0_API || '/auth0'; - }, - getRootDownloadApiPath: function getRootDownloadApiPath() { - return process.env.REACT_APP_NEON_PATH_DOWNLOAD_API || '/api/download/v0'; - }, + getReactAppName: () => process.env.REACT_APP_NAME || '', + getReactAppVersion: () => process.env.REACT_APP_VERSION || '', + getRootApiPath: () => process.env.REACT_APP_NEON_PATH_API || '/api/v0', + getRootGraphqlPath: () => process.env.REACT_APP_NEON_PATH_PUBLIC_GRAPHQL || '/graphql', + getRootJsonLdPath: () => "".concat(NeonEnvironment.getRootApiPath()).concat(process.env.REACT_APP_NEON_PATH_LD_API), + getRootAuthApiPath: () => process.env.REACT_APP_NEON_PATH_AUTH_API || '/api/auth/v0', + getRootAuth0ApiPath: () => process.env.REACT_APP_NEON_PATH_AUTH0_API || '/auth0', + getRootDownloadApiPath: () => process.env.REACT_APP_NEON_PATH_DOWNLOAD_API || '/api/download/v0', getApiPath: { - data: function data() { - return '/data'; - }, - prototype: function prototype() { - return '/prototype'; - }, - documents: function documents() { - return '/documents'; - }, - quickStartGuides: function quickStartGuides() { - return '/documents/quick-start-guides'; - }, - products: function products() { - return '/products'; - }, - productBundles: function productBundles() { - return '/products/bundles'; - }, - releases: function releases() { - return '/releases'; - }, - sites: function sites() { - return '/sites'; - }, - locations: function locations() { - return '/locations'; - }, - samples: function samples() { - return '/samples'; - }, - taxonomy: function taxonomy() { - return '/taxonomy'; - }, - taxonomyDownload: function taxonomyDownload() { - return '/taxonomy/download'; - }, - arcgisAssets: function arcgisAssets() { - return '/arcgis-assets'; - }, - doiCitations: function doiCitations() { - return '/dois/citations'; - } + data: () => '/data', + prototype: () => '/prototype', + documents: () => '/documents', + quickStartGuides: () => '/documents/quick-start-guides', + products: () => '/products', + productBundles: () => '/products/bundles', + releases: () => '/releases', + sites: () => '/sites', + locations: () => '/locations', + samples: () => '/samples', + taxonomy: () => '/taxonomy', + taxonomyDownload: () => '/taxonomy/download', + arcgisAssets: () => '/arcgis-assets', + doiCitations: () => '/dois/citations' }, getDownloadApiPath: { - downloadStream: function downloadStream() { - return '/stream'; - }, - manifestRollup: function manifestRollup() { - return '/manifest/rollup'; - }, - prototypeDownloadStream: function prototypeDownloadStream() { - return '/prototype/stream'; - }, - prototypeManifestRollup: function prototypeManifestRollup() { - return '/prototype/manifest/rollup'; - } + downloadStream: () => '/stream', + manifestRollup: () => '/manifest/rollup', + prototypeDownloadStream: () => '/prototype/stream', + prototypeManifestRollup: () => '/prototype/manifest/rollup' }, getApiLdPath: { - repo: function repo() { - return '/repository'; - } + repo: () => '/repository' }, getAuthPath: { - login: function login() { - return "".concat(NeonEnvironment.getRootAuth0ApiPath(), "/login"); - }, - logout: function logout() { - return "".concat(NeonEnvironment.getRootAuth0ApiPath(), "/logout"); - }, - userInfo: function userInfo() { - return "".concat(NeonEnvironment.getRootAuth0ApiPath(), "/userinfo"); - }, - seamlessLogin: function seamlessLogin() { - return "".concat(NeonEnvironment.getAuthPath.login(), "?seamless=true"); - }, - silentLogin: function silentLogin() { - return "".concat(NeonEnvironment.getAuthPath.login(), "?silent=true"); - }, - silentLogout: function silentLogout() { - return "".concat(NeonEnvironment.getAuthPath.logout(), "?silent=true"); - }, - notifications: function notifications() { - return "".concat(NeonEnvironment.getRootAuth0ApiPath(), "/liferaynotifications"); - } + login: () => "".concat(NeonEnvironment.getRootAuth0ApiPath(), "/login"), + logout: () => "".concat(NeonEnvironment.getRootAuth0ApiPath(), "/logout"), + userInfo: () => "".concat(NeonEnvironment.getRootAuth0ApiPath(), "/userinfo"), + seamlessLogin: () => "".concat(NeonEnvironment.getAuthPath.login(), "?seamless=true"), + silentLogin: () => "".concat(NeonEnvironment.getAuthPath.login(), "?silent=true"), + silentLogout: () => "".concat(NeonEnvironment.getAuthPath.logout(), "?silent=true"), + notifications: () => "".concat(NeonEnvironment.getRootAuth0ApiPath(), "/liferaynotifications") }, getAuthApiPath: { - ws: function ws() { - return '/ws'; - } + ws: () => '/ws' }, authTopics: { - getAuth0: function getAuth0() { - return '/consumer/topic/auth0'; - } - }, - getDataProductTaxonTypesPath: function getDataProductTaxonTypesPath() { - return "".concat(NeonEnvironment.getFullApiPath('taxonomy'), "/types"); - }, - getTaxonTypeDataProductsPath: function getTaxonTypeDataProductsPath() { - return "".concat(NeonEnvironment.getFullApiPath('taxonomy'), "/products"); - }, - getVisusProductsBaseUrl: function getVisusProductsBaseUrl() { - return process.env.REACT_APP_NEON_VISUS_PRODUCTS_BASE_URL; - }, - getVisusIframeBaseUrl: function getVisusIframeBaseUrl() { - return process.env.REACT_APP_NEON_VISUS_IFRAME_BASE_URL; - }, - getRouterBasePath: function getRouterBasePath() { - return process.env.REACT_APP_NEON_ROUTER_BASE || ''; - }, - getRouterBaseHomePath: function getRouterBaseHomePath() { - return process.env.REACT_APP_NEON_ROUTER_BASE_HOME || ''; - }, - getApiHostOverride: function getApiHostOverride() { - return process.env.REACT_APP_NEON_API_HOST_OVERRIDE || DEFAULT_API_HOST; - }, - getWebHostOverride: function getWebHostOverride() { - return process.env.REACT_APP_NEON_WEB_HOST_OVERRIDE || DEFAULT_WEB_HOST; - }, - getWsHostOverride: function getWsHostOverride() { - return process.env.REACT_APP_NEON_WS_HOST_OVERRIDE || DEFAULT_API_HOST; - }, + getAuth0: () => '/consumer/topic/auth0' + }, + getDataProductTaxonTypesPath: () => "".concat(NeonEnvironment.getFullApiPath('taxonomy'), "/types"), + getTaxonTypeDataProductsPath: () => "".concat(NeonEnvironment.getFullApiPath('taxonomy'), "/products"), + getVisusProductsBaseUrl: () => process.env.REACT_APP_NEON_VISUS_PRODUCTS_BASE_URL, + getVisusIframeBaseUrl: () => process.env.REACT_APP_NEON_VISUS_IFRAME_BASE_URL, + getRouterBasePath: () => process.env.REACT_APP_NEON_ROUTER_BASE || '', + getRouterBaseHomePath: () => process.env.REACT_APP_NEON_ROUTER_BASE_HOME || '', + getApiHostOverride: () => process.env.REACT_APP_NEON_API_HOST_OVERRIDE || DEFAULT_API_HOST, + getWebHostOverride: () => process.env.REACT_APP_NEON_WEB_HOST_OVERRIDE || DEFAULT_WEB_HOST, + getWsHostOverride: () => process.env.REACT_APP_NEON_WS_HOST_OVERRIDE || DEFAULT_API_HOST, route: { - home: function home() { - return '/home'; - }, - account: function account() { - return '/myaccount'; - }, - getFullRoute: function getFullRoute() { - var route = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + home: () => '/home', + account: () => '/myaccount', + getFullRoute: function () { + let route = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; return "".concat(NeonEnvironment.getRouterBasePath()).concat(route); }, - buildRouteFromHost: function buildRouteFromHost() { - var route = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + buildRouteFromHost: function () { + let route = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; return "".concat(NeonEnvironment.getApiHost()).concat(NeonEnvironment.route.getFullRoute(route)); }, - buildHomeRoute: function buildHomeRoute() { - return "".concat(NeonEnvironment.getWebHost()).concat(NeonEnvironment.route.home()); - }, - buildAccountRoute: function buildAccountRoute() { - return (// TODO: replace with web host once switch over happens - "".concat(NeonEnvironment.getApiHost()).concat(NeonEnvironment.route.account()) - ); - } + buildHomeRoute: () => "".concat(NeonEnvironment.getWebHost()).concat(NeonEnvironment.route.home()), + buildAccountRoute: () => // TODO: replace with web host once switch over happens + "".concat(NeonEnvironment.getApiHost()).concat(NeonEnvironment.route.account()) }, /** * Gets the window.NEON_SERVER_DATA injected from the server environment. * @return {Object} The structured server data object */ - getNeonServerData: function getNeonServerData() { + getNeonServerData: () => { /* eslint-disable */ // @ts-ignore if (typeof WorkerGlobalScope === 'function') { @@ -226,19 +123,20 @@ var NeonEnvironment = { return self.NEON_SERVER_DATA ? self.NEON_SERVER_DATA : null; } /* eslint-enable */ - if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object') { + if (typeof window === 'object') { // @ts-ignore return window.NEON_SERVER_DATA ? window.NEON_SERVER_DATA : null; } return null; }, - getNeonServerDataWebHost: function getNeonServerDataWebHost() { - var serverData = NeonEnvironment.getNeonServerData(); + getNeonServerDataWebHost: () => { + const serverData = NeonEnvironment.getNeonServerData(); if (serverData && typeof serverData.NeonWebHost === 'string') { - var apiHost = serverData.NeonWebHost; + const apiHost = serverData.NeonWebHost; try { - var _URL = new URL(apiHost), - apiHostname = _URL.hostname; + const { + hostname: apiHostname + } = new URL(apiHost); if (NeonEnvironment.isWebHostValid(apiHostname)) { return apiHost; } @@ -249,13 +147,14 @@ var NeonEnvironment = { } return null; }, - getNeonServerDataApiHost: function getNeonServerDataApiHost() { - var serverData = NeonEnvironment.getNeonServerData(); + getNeonServerDataApiHost: () => { + const serverData = NeonEnvironment.getNeonServerData(); if (serverData && typeof serverData.NeonPublicAPIHost === 'string') { - var apiHost = serverData.NeonPublicAPIHost; + const apiHost = serverData.NeonPublicAPIHost; try { - var _URL2 = new URL(apiHost), - apiHostname = _URL2.hostname; + const { + hostname: apiHostname + } = new URL(apiHost); if (NeonEnvironment.isApiHostValid(apiHostname)) { return apiHost; } @@ -266,19 +165,19 @@ var NeonEnvironment = { } return null; }, - getWebHost: function getWebHost() { + getWebHost: () => { // Check for local override if (NeonEnvironment.isDevEnv && NeonEnvironment.getWebHostOverride()) { return NeonEnvironment.getWebHostOverride(); } // Check for server data env var - var webHost = NeonEnvironment.getNeonServerDataWebHost(); + const webHost = NeonEnvironment.getNeonServerDataWebHost(); if (webHost !== null) { return webHost; } /* eslint-disable */ // @ts-ignore - if (typeof WorkerGlobalScope === 'function' && _typeof(self.location) === 'object') { + if (typeof WorkerGlobalScope === 'function' && typeof self.location === 'object') { if (NeonEnvironment.isWebHostValid(self.location.host)) { return "".concat(self.location.protocol, "//").concat(self.location.host); } @@ -290,19 +189,19 @@ var NeonEnvironment = { } return DEFAULT_WEB_HOST; }, - getApiHost: function getApiHost() { + getApiHost: () => { // Check for local override if (NeonEnvironment.isDevEnv && NeonEnvironment.getApiHostOverride()) { return NeonEnvironment.getApiHostOverride(); } // Check for server data env var - var apiHost = NeonEnvironment.getNeonServerDataApiHost(); + const apiHost = NeonEnvironment.getNeonServerDataApiHost(); if (apiHost !== null) { return apiHost; } /* eslint-disable */ // @ts-ignore - if (typeof WorkerGlobalScope === 'function' && _typeof(self.location) === 'object') { + if (typeof WorkerGlobalScope === 'function' && typeof self.location === 'object') { if (NeonEnvironment.isApiHostValid(self.location.host)) { return "".concat(self.location.protocol, "//").concat(self.location.host); } @@ -314,14 +213,16 @@ var NeonEnvironment = { } return DEFAULT_API_HOST; }, - getWebSocketHost: function getWebSocketHost() { + getWebSocketHost: () => { if (NeonEnvironment.isDevEnv && NeonEnvironment.getWsHostOverride()) { return NeonEnvironment.getWsHostOverride(); } - var apiHost = NeonEnvironment.getApiHost(); - var hostUrl = new URL(apiHost); - var apiProtocol = hostUrl.protocol, - apiHostname = hostUrl.hostname; + const apiHost = NeonEnvironment.getApiHost(); + const hostUrl = new URL(apiHost); + const { + protocol: apiProtocol, + hostname: apiHostname + } = hostUrl; return apiProtocol.startsWith('https') ? "wss://".concat(apiHostname) : "ws://".concat(apiHostname); }, /** @@ -329,13 +230,13 @@ var NeonEnvironment = { * @param host * @returns */ - isApiHostValid: function isApiHostValid(host) { + isApiHostValid: host => { if (typeof host !== 'string' || host.length <= 0) { return false; } - var regex = HostRegexService.getApiHostRegex(); + const regex = HostRegexService.getApiHostRegex(); if (!regex) return false; - var matches = regex.exec(host); + const matches = regex.exec(host); if (!matches) return false; return matches.length > 0; }, @@ -344,13 +245,13 @@ var NeonEnvironment = { * @param host * @returns */ - isWebHostValid: function isWebHostValid(host) { + isWebHostValid: host => { if (typeof host !== 'string' || host.length <= 0) { return false; } - var regex = HostRegexService.getWebHostRegex(); + const regex = HostRegexService.getWebHostRegex(); if (!regex) return false; - var matches = regex.exec(host); + const matches = regex.exec(host); if (!matches) return false; return matches.length > 0; }, @@ -358,8 +259,8 @@ var NeonEnvironment = { * Gets the API token header name * @return {string} The API token header name */ - getApiTokenHeader: function getApiTokenHeader() { - var serverData = NeonEnvironment.getNeonServerData(); + getApiTokenHeader: () => { + const serverData = NeonEnvironment.getNeonServerData(); if (serverData && typeof serverData.NeonPublicAPITokenHeader === 'string') { return serverData.NeonPublicAPITokenHeader; } @@ -369,8 +270,8 @@ var NeonEnvironment = { * Gets the API token value * @return {string} The API token value */ - getApiToken: function getApiToken() { - var serverData = NeonEnvironment.getNeonServerData(); + getApiToken: () => { + const serverData = NeonEnvironment.getNeonServerData(); if (serverData && typeof serverData.NeonPublicAPIToken === 'string') { return serverData.NeonPublicAPIToken; } @@ -381,30 +282,30 @@ var NeonEnvironment = { * based on environment or browser as external dependencies are required. * @return {AuthSilentType} */ - getAuthSilentType: function getAuthSilentType() { - var serverData = NeonEnvironment.getNeonServerData(); + getAuthSilentType: () => { + const serverData = NeonEnvironment.getNeonServerData(); if (serverData && typeof serverData.NeonAuthSilentType === 'string' && serverData.NeonAuthSilentType.length > 0) { return serverData.NeonAuthSilentType; } return _core.AuthSilentType.DISABLED; }, - getFullApiPath: function getFullApiPath() { - var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var host = NeonEnvironment.getApiHost(); - var root = ['download', 'manifest'].includes(path) ? '' : NeonEnvironment.getRootApiPath(); + getFullApiPath: function () { + let path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + const host = NeonEnvironment.getApiHost(); + const root = ['download', 'manifest'].includes(path) ? '' : NeonEnvironment.getRootApiPath(); return NeonEnvironment.getApiPath[path] ? "".concat(host).concat(root).concat(NeonEnvironment.getApiPath[path]()) : "".concat(host).concat(root); }, - getFullDownloadApiPath: function getFullDownloadApiPath() { - var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var host = NeonEnvironment.getApiHost(); - var root = NeonEnvironment.getRootDownloadApiPath(); + getFullDownloadApiPath: function () { + let path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + const host = NeonEnvironment.getApiHost(); + const root = NeonEnvironment.getRootDownloadApiPath(); return NeonEnvironment.getDownloadApiPath[path] ? "".concat(host).concat(root).concat(NeonEnvironment.getDownloadApiPath[path]()) : "".concat(host).concat(root); }, - getFullJsonLdApiPath: function getFullJsonLdApiPath() { - var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var host = NeonEnvironment.getApiHost(); - var root = NeonEnvironment.getRootJsonLdPath(); - var appliedPath = ''; + getFullJsonLdApiPath: function () { + let path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + const host = NeonEnvironment.getApiHost(); + const root = NeonEnvironment.getRootJsonLdPath(); + let appliedPath = ''; if (['products', 'prototype'].includes(path)) { appliedPath = NeonEnvironment.getApiPath[path](); } else if (typeof NeonEnvironment.getApiLdPath[path] === 'function') { @@ -417,9 +318,9 @@ var NeonEnvironment = { * Auth path refers to /auth0. * @param {string} path - The path to build from */ - getFullAuthPath: function getFullAuthPath() { - var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var host = NeonEnvironment.getApiHost(); + getFullAuthPath: function () { + let path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + const host = NeonEnvironment.getApiHost(); return NeonEnvironment.getAuthPath[path] ? "".concat(host).concat(NeonEnvironment.getAuthPath[path]()) : "".concat(host); }, /** @@ -428,23 +329,23 @@ var NeonEnvironment = { * @param {string} path - The path to build from * @param {boolean} useWs - Option to build a websocket path */ - getFullAuthApiPath: function getFullAuthApiPath() { - var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var useWs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var host = useWs ? NeonEnvironment.getWebSocketHost() : NeonEnvironment.getApiHost(); - var root = NeonEnvironment.getRootAuthApiPath(); - var appliedPath = Object.keys(NeonEnvironment.getAuthApiPath).includes(path) ? NeonEnvironment.getAuthApiPath[path]() : ''; + getFullAuthApiPath: function () { + let path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + let useWs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const host = useWs ? NeonEnvironment.getWebSocketHost() : NeonEnvironment.getApiHost(); + const root = NeonEnvironment.getRootAuthApiPath(); + const appliedPath = Object.keys(NeonEnvironment.getAuthApiPath).includes(path) ? NeonEnvironment.getAuthApiPath[path]() : ''; return appliedPath ? "".concat(host).concat(root).concat(appliedPath) : "".concat(host).concat(root); }, - getFullGraphqlPath: function getFullGraphqlPath() { - var host = NeonEnvironment.getApiHost(); + getFullGraphqlPath: () => { + const host = NeonEnvironment.getApiHost(); return "".concat(host).concat(NeonEnvironment.getRootGraphqlPath()); }, /** * Indicates when a CORS request is required * @returns */ - requireCors: function requireCors() { + requireCors: () => { if (window.location.host.includes('localhost')) { return false; } @@ -452,5 +353,4 @@ var NeonEnvironment = { } }; Object.freeze(NeonEnvironment); -var _default = NeonEnvironment; -exports.default = _default; \ No newline at end of file +var _default = exports.default = NeonEnvironment; \ No newline at end of file diff --git a/lib/components/NeonEnvironment/index.js b/lib/components/NeonEnvironment/index.js index 56f8e64b..cc58dd68 100644 --- a/lib/components/NeonEnvironment/index.js +++ b/lib/components/NeonEnvironment/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _NeonEnvironment.default; } }); diff --git a/lib/components/NeonFooter/NeonFooter.js b/lib/components/NeonFooter/NeonFooter.js index d1a98f51..4494b65d 100644 --- a/lib/components/NeonFooter/NeonFooter.js +++ b/lib/components/NeonFooter/NeonFooter.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -15,36 +14,33 @@ var _drupalFooter = _interopRequireDefault(require("../../remoteAssets/drupal-fo var _NeonContext = _interopRequireWildcard(require("../NeonContext/NeonContext")); var _NeonEnvironment = _interopRequireDefault(require("../NeonEnvironment/NeonEnvironment")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -var DRUPAL_FOOTER_HTML = _remoteAssetsMap.default.DRUPAL_FOOTER_HTML.KEY; -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - footerContainer: { - '& .footer-bottom__wrapper': { - background: '#4B372E' - } +const DRUPAL_FOOTER_HTML = _remoteAssetsMap.default.DRUPAL_FOOTER_HTML.KEY; +const useStyles = (0, _styles.makeStyles)(theme => ({ + footerContainer: { + '& .footer-bottom__wrapper': { + background: '#4B372E' } - }; -}); -var NeonFooter = function NeonFooter(props) { - var drupalCssLoaded = props.drupalCssLoaded, - showSkeleton = props.showSkeleton; - var classes = useStyles(_Theme.default); - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - _NeonContext$useNeonC3 = _NeonContext$useNeonC2[0], - neonContextIsActive = _NeonContext$useNeonC3.isActive, - footerFetch = _NeonContext$useNeonC3.fetches[DRUPAL_FOOTER_HTML], - footerHTML = _NeonContext$useNeonC3.html[DRUPAL_FOOTER_HTML]; - var renderMode = 'legacy'; + } +})); +const NeonFooter = props => { + const { + drupalCssLoaded, + showSkeleton + } = props; + const classes = useStyles(_Theme.default); + const [{ + isActive: neonContextIsActive, + fetches: { + [DRUPAL_FOOTER_HTML]: footerFetch + }, + html: { + [DRUPAL_FOOTER_HTML]: footerHTML + } + }] = _NeonContext.default.useNeonContextState(); + let renderMode = 'legacy'; if (neonContextIsActive) { switch (footerFetch.status) { case _NeonContext.FETCH_STATUS.SUCCESS: @@ -62,12 +58,10 @@ var NeonFooter = function NeonFooter(props) { break; } } - var renderFallback = function renderFallback() { - return /*#__PURE__*/_react.default.createElement("footer", { - id: "footer", - className: classes.footerContainer - }, (0, _htmlReactParser.default)(_drupalFooter.default)); - }; + const renderFallback = () => /*#__PURE__*/_react.default.createElement("footer", { + id: "footer", + className: classes.footerContainer + }, (0, _htmlReactParser.default)(_drupalFooter.default)); switch (renderMode) { case 'loading': if (!showSkeleton) { @@ -97,5 +91,4 @@ NeonFooter.defaultProps = { drupalCssLoaded: false, showSkeleton: false }; -var _default = NeonFooter; -exports.default = _default; \ No newline at end of file +var _default = exports.default = NeonFooter; \ No newline at end of file diff --git a/lib/components/NeonFooter/index.js b/lib/components/NeonFooter/index.js index a1e07715..91864bda 100644 --- a/lib/components/NeonFooter/index.js +++ b/lib/components/NeonFooter/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _NeonFooter.default; } }); diff --git a/lib/components/NeonGraphQL/NeonGraphQL.js b/lib/components/NeonGraphQL/NeonGraphQL.js index 042237d9..dce512f1 100644 --- a/lib/components/NeonGraphQL/NeonGraphQL.js +++ b/lib/components/NeonGraphQL/NeonGraphQL.js @@ -10,49 +10,44 @@ var _NeonEnvironment = _interopRequireDefault(require("../NeonEnvironment/NeonEn var _NeonApi = _interopRequireDefault(require("../NeonApi/NeonApi")); var _typeUtil = require("../../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -var TYPES = { +const TYPES = exports.TYPES = { DATA_PRODUCTS: 'DATA_PRODUCTS', SITES: 'SITES', LOCATIONS: 'LOCATIONS' }; -exports.TYPES = TYPES; -var DIMENSIONALITIES = { +const DIMENSIONALITIES = exports.DIMENSIONALITIES = { ONE: 'ONE', MANY: 'MANY' }; -exports.DIMENSIONALITIES = DIMENSIONALITIES; -var transformQuery = function transformQuery(query) { - return JSON.stringify({ - query: query - }); -}; -var getAvailableReleaseClause = function getAvailableReleaseClause(args) { +const transformQuery = query => JSON.stringify({ + query +}); +const getAvailableReleaseClause = args => { if (!args) return ''; - var hasRelease = (0, _typeUtil.isStringNonEmpty)(args.release); - var availableReleases = ''; + const hasRelease = (0, _typeUtil.isStringNonEmpty)(args.release); + let availableReleases = ''; if (args.includeAvailableReleases === true && !hasRelease) { availableReleases = "availableReleases {\n release\n availableMonths\n }"; } return availableReleases; }; -var getQueryBody = function getQueryBody() { - var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var dimensionality = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - var query = ''; +const getQueryBody = function () { + let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + let dimensionality = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + let query = ''; switch (type) { case TYPES.DATA_PRODUCTS: if (dimensionality === DIMENSIONALITIES.ONE) { // TODO: Add support for deeper product data when querying for one - var releaseArgument = !args.release ? '' : ", release: \"".concat(args.release, "\""); - var availableReleases = getAvailableReleaseClause(args); + const releaseArgument = !args.release ? '' : ", release: \"".concat(args.release, "\""); + const availableReleases = getAvailableReleaseClause(args); query = "query Products {\n product (productCode: \"".concat(args.productCode, "\"").concat(releaseArgument, ") {\n productCode\n productName\n productDescription\n productScienceTeam\n productHasExpanded\n productBasicDescription\n productExpandedDescription\n productPublicationFormatType\n keywords\n themes\n siteCodes {\n siteCode\n availableMonths\n ").concat(availableReleases, "\n }\n releases {\n release\n generationDate\n url\n }\n }\n }"); } else { - var _releaseArgument = !args.release ? '' : "(release: \"".concat(args.release, "\")"); - var _availableReleases = getAvailableReleaseClause(args); - query = "query Products {\n products ".concat(_releaseArgument, "{\n productCode\n productName\n productDescription\n productScienceTeam\n productHasExpanded\n productBasicDescription\n productExpandedDescription\n productPublicationFormatType\n keywords\n themes\n siteCodes {\n siteCode\n availableMonths\n ").concat(_availableReleases, "\n }\n releases {\n release\n generationDate\n url\n }\n }\n }"); + const releaseArgument = !args.release ? '' : "(release: \"".concat(args.release, "\")"); + const availableReleases = getAvailableReleaseClause(args); + query = "query Products {\n products ".concat(releaseArgument, "{\n productCode\n productName\n productDescription\n productScienceTeam\n productHasExpanded\n productBasicDescription\n productExpandedDescription\n productPublicationFormatType\n keywords\n themes\n siteCodes {\n siteCode\n availableMonths\n ").concat(availableReleases, "\n }\n releases {\n release\n generationDate\n url\n }\n }\n }"); } break; case TYPES.SITES: @@ -75,16 +70,16 @@ var getQueryBody = function getQueryBody() { } return transformQuery(query); }; -var getAjaxRequest = function getAjaxRequest(body) { - var includeToken = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - var withCredentials = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; - var appliedWithCredentials = false; +const getAjaxRequest = function (body) { + let includeToken = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + let withCredentials = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + let appliedWithCredentials = false; if (!(0, _typeUtil.exists)(withCredentials) || typeof withCredentials !== 'boolean') { appliedWithCredentials = _NeonEnvironment.default.requireCors(); } else { appliedWithCredentials = withCredentials; } - var request = { + const request = { method: 'POST', crossDomain: true, withCredentials: appliedWithCredentials, @@ -93,26 +88,24 @@ var getAjaxRequest = function getAjaxRequest(body) { 'Content-Type': 'application/json' }, responseType: 'json', - body: body + body }; if (includeToken) { request.headers = _extends({}, request.headers, _NeonApi.default.getApiTokenHeader(request.headers)); } return request; }; -var getObservable = function getObservable(query) { +const getObservable = query => { if (!query.length) { return (0, _rxjs.of)(null); } return (0, _ajax.ajax)(getAjaxRequest(query)); }; -var getObservableWith = function getObservableWith() { - var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var dimensionality = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - var argsHaveAtLeastOneDefinedKey = args !== null && _typeof(args) === 'object' && Object.keys(args).length > 0 && Object.keys(args).some(function (key) { - return typeof args[key] !== 'undefined'; - }); +const getObservableWith = function () { + let type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let dimensionality = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + const argsHaveAtLeastOneDefinedKey = args !== null && typeof args === 'object' && Object.keys(args).length > 0 && Object.keys(args).some(key => typeof args[key] !== 'undefined'); // Type and Dimensionality must exist if (!TYPES[type] || !DIMENSIONALITIES[dimensionality]) { return (0, _rxjs.of)(null); @@ -121,47 +114,39 @@ var getObservableWith = function getObservableWith() { if (dimensionality === DIMENSIONALITIES.ONE && !argsHaveAtLeastOneDefinedKey) { return (0, _rxjs.of)(null); } - var query = getQueryBody(type, dimensionality, args); + const query = getQueryBody(type, dimensionality, args); return getObservable(query); }; -var NeonGraphQL = { - getDataProductByCode: function getDataProductByCode(productCode, release) { - var includeAvailableReleases = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; +const NeonGraphQL = { + getDataProductByCode: function (productCode, release) { + let includeAvailableReleases = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; return getObservableWith(TYPES.DATA_PRODUCTS, DIMENSIONALITIES.ONE, { - productCode: productCode, - release: release, - includeAvailableReleases: includeAvailableReleases + productCode, + release, + includeAvailableReleases }); }, - getAllDataProducts: function getAllDataProducts(release) { - var includeAvailableReleases = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + getAllDataProducts: function (release) { + let includeAvailableReleases = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; return getObservableWith(TYPES.DATA_PRODUCTS, DIMENSIONALITIES.MANY, { - release: release, - includeAvailableReleases: includeAvailableReleases + release, + includeAvailableReleases }); }, - getSiteByCode: function getSiteByCode(siteCode) { - return getObservableWith(TYPES.SITES, DIMENSIONALITIES.ONE, { - siteCode: siteCode - }); - }, - getAllSites: function getAllSites() { - return getObservableWith(TYPES.SITES, DIMENSIONALITIES.MANY); - }, - getLocationByName: function getLocationByName(locationName) { - return getObservableWith(TYPES.LOCATIONS, DIMENSIONALITIES.ONE, { - locationName: locationName - }); - }, - getManyLocationsByName: function getManyLocationsByName() { - var locationNames = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - if (!Array.isArray(locationNames) || !locationNames.length || !locationNames.every(function (name) { - return typeof name === 'string'; - })) { + getSiteByCode: siteCode => getObservableWith(TYPES.SITES, DIMENSIONALITIES.ONE, { + siteCode + }), + getAllSites: () => getObservableWith(TYPES.SITES, DIMENSIONALITIES.MANY), + getLocationByName: locationName => getObservableWith(TYPES.LOCATIONS, DIMENSIONALITIES.ONE, { + locationName + }), + getManyLocationsByName: function () { + let locationNames = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + if (!Array.isArray(locationNames) || !locationNames.length || !locationNames.every(name => typeof name === 'string')) { return (0, _rxjs.of)(null); } return getObservableWith(TYPES.LOCATIONS, DIMENSIONALITIES.MANY, { - locationNames: locationNames + locationNames }); }, /** @@ -169,18 +154,13 @@ var NeonGraphQL = { * @param {string} query - The raw GraphQL query * @return The resulting RxJS Observable from the specified query */ - getGraphqlQuery: function getGraphqlQuery(query) { - return getObservable(transformQuery(query)); - }, + getGraphqlQuery: query => getObservable(transformQuery(query)), /** * Builds a custom GraphQL AjaxRequest * @param {string} query - The raw GraphQL query * @return The resulting RxJS AjaxRequest */ - getGraphqlAjaxRequest: function getGraphqlAjaxRequest(query) { - return getAjaxRequest(transformQuery(query)); - } + getGraphqlAjaxRequest: query => getAjaxRequest(transformQuery(query)) }; Object.freeze(NeonGraphQL); -var _default = NeonGraphQL; -exports.default = _default; \ No newline at end of file +var _default = exports.default = NeonGraphQL; \ No newline at end of file diff --git a/lib/components/NeonGraphQL/index.js b/lib/components/NeonGraphQL/index.js index 7843b22d..95b2f1e4 100644 --- a/lib/components/NeonGraphQL/index.js +++ b/lib/components/NeonGraphQL/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _NeonGraphQL.default; } }); diff --git a/lib/components/NeonHeader/ApplicationMenu.js b/lib/components/NeonHeader/ApplicationMenu.js index b281877a..9dd00778 100644 --- a/lib/components/NeonHeader/ApplicationMenu.js +++ b/lib/components/NeonHeader/ApplicationMenu.js @@ -21,111 +21,97 @@ var _Grid = _interopRequireDefault(require("@material-ui/core/Grid")); var _NeonContext = _interopRequireDefault(require("../NeonContext/NeonContext")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } // interface for user application data // interface for the menu component props // declare styles -var useStyles = (0, _styles.makeStyles)(function (theme) { - return (0, _styles.createStyles)({ - menuContainer: { - zIndex: 1000 // be sure to display the menu over other elements - }, - - toolbarContainer: { - display: 'flex', - justifyContent: 'space-between', - boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.45)', - // match shadow of site header - position: 'relative' - }, - toolbarButtons: { - display: 'flex', - marginLeft: 'auto', - // align content right - marginRight: theme.spacing(2.5), - marginTop: theme.spacing(0.5), - marginBottom: theme.spacing(0.5) - }, - paper: { - padding: theme.spacing(4), - maxWidth: '500px', - // limit width of menu - marginTop: theme.spacing(1), - // line top of menu up with divider - overflowX: 'unset', - overflowY: 'unset', - '&::before': { - // add tooltip like arrow to top of menu - content: '""', - position: 'absolute', - marginRight: theme.spacing(4), - // center arrow point beneath menu button - top: 0, - right: 0, - width: theme.spacing(2), - // width of arrow - height: theme.spacing(2), - // height of arrow - backgroundColor: theme.palette.background.paper, - // match paper background - boxShadow: theme.shadows[2], - // add arrow shadow - transform: 'rotate(315deg)', - // point arrow up toward menu button - clipPath: 'polygon(-5px -5px, calc(100% + 5px) -5px, calc(100% + 5px) calc(100% + 5px))' - } - }, - card: { - transition: '0.4s', - '&:hover': { - // raised hover effect for Cards - transform: 'translateY(-2px)', - // raise Card - boxShadow: theme.shadows[2] // add shadow - }, - - cursor: 'pointer', - // visually indicate Cards are links - width: '100%', - // ensure Cards are equal width - border: 0 // remove default Card border - }, - - cardContent: { - textAlign: 'center' - }, - gridItem: { - display: 'flex' // so grid items stretch to equal height +const useStyles = (0, _styles.makeStyles)(theme => (0, _styles.createStyles)({ + menuContainer: { + zIndex: 1000 // be sure to display the menu over other elements + }, + toolbarContainer: { + display: 'flex', + justifyContent: 'space-between', + boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.45)', + // match shadow of site header + position: 'relative' + }, + toolbarButtons: { + display: 'flex', + marginLeft: 'auto', + // align content right + marginRight: theme.spacing(2.5), + marginTop: theme.spacing(0.5), + marginBottom: theme.spacing(0.5) + }, + paper: { + padding: theme.spacing(4), + maxWidth: '500px', + // limit width of menu + marginTop: theme.spacing(1), + // line top of menu up with divider + overflowX: 'unset', + overflowY: 'unset', + '&::before': { + // add tooltip like arrow to top of menu + content: '""', + position: 'absolute', + marginRight: theme.spacing(4), + // center arrow point beneath menu button + top: 0, + right: 0, + width: theme.spacing(2), + // width of arrow + height: theme.spacing(2), + // height of arrow + backgroundColor: theme.palette.background.paper, + // match paper background + boxShadow: theme.shadows[2], + // add arrow shadow + transform: 'rotate(315deg)', + // point arrow up toward menu button + clipPath: 'polygon(-5px -5px, calc(100% + 5px) -5px, calc(100% + 5px) calc(100% + 5px))' } - }); -}); + }, + card: { + transition: '0.4s', + '&:hover': { + // raised hover effect for Cards + transform: 'translateY(-2px)', + // raise Card + boxShadow: theme.shadows[2] // add shadow + }, + cursor: 'pointer', + // visually indicate Cards are links + width: '100%', + // ensure Cards are equal width + border: 0 // remove default Card border + }, + cardContent: { + textAlign: 'center' + }, + gridItem: { + display: 'flex' // so grid items stretch to equal height + } +})); // define the menu component -var Menu = function Menu(props) { - var apps = props.apps; - var classes = useStyles(); - var _React$useState = _react.default.useState(false), - _React$useState2 = _slicedToArray(_React$useState, 2), - open = _React$useState2[0], - setOpen = _React$useState2[1]; - var anchorRef = _react.default.useRef(null); +const Menu = props => { + const { + apps + } = props; + const classes = useStyles(); + const [open, setOpen] = _react.default.useState(false); + const anchorRef = _react.default.useRef(null); // handle menu toggle - var handleToggle = function handleToggle() { - setOpen(function (prevOpen) { - return !prevOpen; - }); + const handleToggle = () => { + setOpen(prevOpen => !prevOpen); }; // close the menu - var handleClose = function handleClose(event) { + const handleClose = event => { if (anchorRef.current && anchorRef.current.contains(event.target)) { return; } @@ -133,7 +119,7 @@ var Menu = function Menu(props) { }; // open menu by tab key - var handleMenuKeyDown = function handleMenuKeyDown(event) { + const handleMenuKeyDown = event => { if (event.key === 'Tab') { event.preventDefault(); setOpen(false); @@ -141,7 +127,7 @@ var Menu = function Menu(props) { }; // handle a menu selection - var handleMenuItemClick = function handleMenuItemClick(event, url) { + const handleMenuItemClick = (event, url) => { window.location.href = url; }; return /*#__PURE__*/_react.default.createElement("div", { @@ -173,9 +159,11 @@ var Menu = function Menu(props) { anchorEl: anchorRef.current, role: "presentation", transition: true - }, function (_ref) { - var TransitionProps = _ref.TransitionProps, - placement = _ref.placement; + }, _ref => { + let { + TransitionProps, + placement + } = _ref; return /*#__PURE__*/_react.default.createElement(_Fade.default, _extends({}, TransitionProps, { style: { transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom' @@ -190,30 +178,26 @@ var Menu = function Menu(props) { container: true, spacing: 4, alignItems: "stretch" - }, apps.map(function (app) { - return /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: apps.length === 1 ? 12 : 6, - className: classes.gridItem, - key: app.name - }, /*#__PURE__*/_react.default.createElement(_Card.default, { - onClick: function onClick(event) { - return handleMenuItemClick(event, app.url); - }, - key: app.url, - className: classes.card - }, /*#__PURE__*/_react.default.createElement(_CardContent.default, { - className: classes.cardContent - }, /*#__PURE__*/_react.default.createElement(_Launch.default, { - fontSize: "large" - }), /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "subtitle1", - gutterBottom: true, - style: { - lineHeight: 1 - } - }, app.name), app.description))); - }))))); + }, apps.map(app => /*#__PURE__*/_react.default.createElement(_Grid.default, { + item: true, + xs: apps.length === 1 ? 12 : 6, + className: classes.gridItem, + key: app.name + }, /*#__PURE__*/_react.default.createElement(_Card.default, { + onClick: event => handleMenuItemClick(event, app.url), + key: app.url, + className: classes.card + }, /*#__PURE__*/_react.default.createElement(_CardContent.default, { + className: classes.cardContent + }, /*#__PURE__*/_react.default.createElement(_Launch.default, { + fontSize: "large" + }), /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "subtitle1", + gutterBottom: true, + style: { + lineHeight: 1 + } + }, app.name), app.description)))))))); }))); }; @@ -221,12 +205,12 @@ var Menu = function Menu(props) { * Return the application menu * @returns The menu or null if the user has no applications to display. */ -var ApplicationMenu = function ApplicationMenu() { - var _authData$userData, _authData$userData$da; - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - authData = _NeonContext$useNeonC2[0].auth; - var apps = authData === null || authData === void 0 ? void 0 : (_authData$userData = authData.userData) === null || _authData$userData === void 0 ? void 0 : (_authData$userData$da = _authData$userData.data) === null || _authData$userData$da === void 0 ? void 0 : _authData$userData$da.apps; +const ApplicationMenu = () => { + var _authData$userData; + const [{ + auth: authData + }] = _NeonContext.default.useNeonContextState(); + const apps = authData === null || authData === void 0 || (_authData$userData = authData.userData) === null || _authData$userData === void 0 || (_authData$userData = _authData$userData.data) === null || _authData$userData === void 0 ? void 0 : _authData$userData.apps; if ((apps === null || apps === void 0 ? void 0 : apps.length) > 0) { return /*#__PURE__*/_react.default.createElement(Menu, { apps: apps @@ -234,5 +218,4 @@ var ApplicationMenu = function ApplicationMenu() { } return null; }; -var _default = ApplicationMenu; -exports.default = _default; \ No newline at end of file +var _default = exports.default = ApplicationMenu; \ No newline at end of file diff --git a/lib/components/NeonHeader/NeonHeader.js b/lib/components/NeonHeader/NeonHeader.js index 759b7266..f58758c7 100644 --- a/lib/components/NeonHeader/NeonHeader.js +++ b/lib/components/NeonHeader/NeonHeader.js @@ -21,37 +21,23 @@ var _ApplicationMenu = _interopRequireDefault(require("./ApplicationMenu")); var _headerSearch = _interopRequireDefault(require("../../images/svg/header-search.svg")); var _headerSearchHover = _interopRequireDefault(require("../../images/svg/header-search-hover.svg")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var DRUPAL_HEADER_HTML = _remoteAssetsMap.default.DRUPAL_HEADER_HTML.KEY; -var AUTH_ELEMENT_ID = 'header__authentication-ui'; -var useStyles = (0, _styles.makeStyles)(function (theme) { - var _coreAuthContainer, _headerContainer; - return { - skeletonHeader: { - boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.25), 0px 1px 1px rgba(0, 0, 0, 0.25)' - }, - // positioning of sign-in and sign-out buttons - coreAuthContainer: (_coreAuthContainer = { - // common styles - textAlign: 'right', - position: 'absolute', - zIndex: 15 - }, _defineProperty(_coreAuthContainer, theme.breakpoints.up('lg'), { +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const DRUPAL_HEADER_HTML = _remoteAssetsMap.default.DRUPAL_HEADER_HTML.KEY; +const AUTH_ELEMENT_ID = 'header__authentication-ui'; +const useStyles = (0, _styles.makeStyles)(theme => ({ + skeletonHeader: { + boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.25), 0px 1px 1px rgba(0, 0, 0, 0.25)' + }, + // positioning of sign-in and sign-out buttons + coreAuthContainer: { + // common styles + textAlign: 'right', + position: 'absolute', + zIndex: 15, + // viewport-specific styles + [theme.breakpoints.up('lg')]: { padding: '0px', top: '-1px', right: '0px', @@ -64,102 +50,106 @@ var useStyles = (0, _styles.makeStyles)(function (theme) { borderRight: 'none', borderTopLeftRadius: '0px' } - }), _defineProperty(_coreAuthContainer, theme.breakpoints.down('md'), { + }, + [theme.breakpoints.down('md')]: { padding: theme.spacing(1, 2), top: theme.spacing(1), right: theme.spacing(9) - }), _coreAuthContainer), - // These styles are gross. We need to rework the header coming from the Drupal site to make this - // less necessary. - unstickyHeader: { - paddingTop: 'unset !important', - '& > header': _defineProperty({ - position: 'unset !important', - '& label[for="nav-trigger"]': { - zIndex: '9 !important' - }, - '& div.header__site-navigation': { - zIndex: '8 !important' - } - }, theme.breakpoints.down('sm'), { + } + }, + // These styles are gross. We need to rework the header coming from the Drupal site to make this + // less necessary. + unstickyHeader: { + paddingTop: 'unset !important', + '& > header': { + position: 'unset !important', + '& label[for="nav-trigger"]': { + zIndex: '9 !important' + }, + '& div.header__site-navigation': { + zIndex: '8 !important' + }, + [theme.breakpoints.down('sm')]: { '& .header__site-navigation': { display: 'none' }, '& .nav-trigger:checked ~ .header__site-navigation': { display: 'block' } - }) - }, - headerContainerFallback: { - '& li.siteSearch > a': { - background: "url('".concat(_headerSearch.default, "') center center no-repeat !important") - }, - '& li.siteSearch > a:hover': { - background: "url('".concat(_headerSearchHover.default, "') center center no-repeat !important") } + } + }, + headerContainerFallback: { + '& li.siteSearch > a': { + background: "url('".concat(_headerSearch.default, "') center center no-repeat !important") }, - // Injecting these styles as a means of fixing up the search display - // Ideally, this CSS comes from Drupal and is removed from here... - headerContainer: (_headerContainer = { - // // Added menu__link to more closely mimic Drupal site links. - // '& .menu__link': { - // fontSize: '1.1rem !important', - // fontWeight: '700 !important', - // }, - '& .header__search': { - background: '#f5f6f7', - position: 'relative', - zIndex: 1, - transition: 'all 0.2s ease-in-out', - opacity: 1, - visibility: 'visible', - fontSize: '1.1rem' // Added, font sizes look bigger on Drupal site. - }, - - '& .header__search.visually-hidden': { - visibility: 'hidden', - opacity: 0, - transition: 'all 0.2s ease-in-out' - }, - '& .header__search > .header__search--inner': { - display: 'flex', - maxWidth: '1620px', - margin: '0 auto' - }, - '& .header__inner.l--offset-wide': { - paddingLeft: 'calc(2/27*100%)', - paddingRight: 'calc(2/27*100%)' - }, - // Purely a quick-fix workaround for Drupal header auth container... - '& .header__inner.l--offset-wide > .authContainer': { - display: 'none !important' - }, - '& .header__search--inner': { - display: 'flex', - '-ms-flex-pack': 'start', - justifyContent: 'flex-start', - '-ms-flex-align': 'center', - alignItems: 'center' - }, - '& .header__search--inner > .header__search--title': { - fontWeight: '600 !important', - // Changed from 600 to match Drupal site. - fontSize: '0.9rem !important', - // Changed from 0.9 to match Drupal site. - margin: '0 2.6rem 0 0 !important' - } - }, _defineProperty(_headerContainer, theme.breakpoints.up('lg'), { + '& li.siteSearch > a:hover': { + background: "url('".concat(_headerSearchHover.default, "') center center no-repeat !important") + } + }, + // Injecting these styles as a means of fixing up the search display + // Ideally, this CSS comes from Drupal and is removed from here... + headerContainer: { + // // Added menu__link to more closely mimic Drupal site links. + // '& .menu__link': { + // fontSize: '1.1rem !important', + // fontWeight: '700 !important', + // }, + '& .header__search': { + background: '#f5f6f7', + position: 'relative', + zIndex: 1, + transition: 'all 0.2s ease-in-out', + opacity: 1, + visibility: 'visible', + fontSize: '1.1rem' // Added, font sizes look bigger on Drupal site. + }, + '& .header__search.visually-hidden': { + visibility: 'hidden', + opacity: 0, + transition: 'all 0.2s ease-in-out' + }, + '& .header__search > .header__search--inner': { + display: 'flex', + maxWidth: '1620px', + margin: '0 auto' + }, + '& .header__inner.l--offset-wide': { + paddingLeft: 'calc(2/27*100%)', + paddingRight: 'calc(2/27*100%)' + }, + // Purely a quick-fix workaround for Drupal header auth container... + '& .header__inner.l--offset-wide > .authContainer': { + display: 'none !important' + }, + '& .header__search--inner': { + display: 'flex', + '-ms-flex-pack': 'start', + justifyContent: 'flex-start', + '-ms-flex-align': 'center', + alignItems: 'center' + }, + '& .header__search--inner > .header__search--title': { + fontWeight: '600 !important', + // Changed from 600 to match Drupal site. + fontSize: '0.9rem !important', + // Changed from 0.9 to match Drupal site. + margin: '0 2.6rem 0 0 !important' + }, + [theme.breakpoints.up('lg')]: { '& .header__search--inner > .header__search--title': { fontSize: '1.25rem !important' // Changed from 1.0 to match Drupal site. } - }), _defineProperty(_headerContainer, '& .header__search--inner > div.search-api-form > form#search-api-form', { + }, + '& .header__search--inner > div.search-api-form > form#search-api-form': { display: 'flex', '-ms-flex-pack': 'start', justifyContent: 'flex-start', '-ms-flex-align': 'center', alignItems: 'center', width: '100%' - }), _defineProperty(_headerContainer, '& .header__search--inner > div.search-api-form > form#search-api-form > .form-item', { + }, + '& .header__search--inner > div.search-api-form > form#search-api-form > .form-item': { width: '100%', display: 'flex', '-ms-flex-pack': 'start', @@ -167,11 +157,14 @@ var useStyles = (0, _styles.makeStyles)(function (theme) { '-ms-flex-align': 'center', alignItems: 'center', margin: '20px 0' - }), _defineProperty(_headerContainer, '& .header__search--inner > div.search-api-form', { + }, + '& .header__search--inner > div.search-api-form': { width: '100%' - }), _defineProperty(_headerContainer, '& .header__search--inner > div.search-api-form > form#search-api-form > .form-actions.form-wrapper', { + }, + '& .header__search--inner > div.search-api-form > form#search-api-form > .form-actions.form-wrapper': { display: 'flex' - }), _defineProperty(_headerContainer, '& .header__search--inner > div.search-api-form > form#search-api-form > .form-item > .form-search', { + }, + '& .header__search--inner > div.search-api-form > form#search-api-form > .form-item > .form-search': { width: '100%', height: '48px', background: '#fff', @@ -179,7 +172,8 @@ var useStyles = (0, _styles.makeStyles)(function (theme) { boxSizing: 'border-box', borderRadius: '3px 0 0 3px', padding: '12px 18px' - }), _defineProperty(_headerContainer, '& .header__search--inner > div.search-api-form > form#search-api-form > .form-actions > .form-submit.button--search', { + }, + '& .header__search--inner > div.search-api-form > form#search-api-form > .form-actions > .form-submit.button--search': { borderRadius: '0px 3px 3px 0px', width: '48px', height: '48px', @@ -191,28 +185,36 @@ var useStyles = (0, _styles.makeStyles)(function (theme) { backgroundRepeat: 'no-repeat', padding: '0.86rem 0', transition: 'all 0.2s ease-in-out' - }), _defineProperty(_headerContainer, '& .header__search--inner > div.search-api-form > form#search-api-form > .form-actions > .form-submit.button--search:hover', { + }, + '& .header__search--inner > div.search-api-form > form#search-api-form > .form-actions > .form-submit.button--search:hover': { transition: 'all 0.2s ease-in-out', backgroundColor: '#002c77', border: '#002c77 1px solid' - }), _defineProperty(_headerContainer, '& .header__search--inner > div.search-api-form > form#search-api-form > .form-item > label', { + }, + '& .header__search--inner > div.search-api-form > form#search-api-form > .form-item > label': { fontWeight: 600, fontSize: '20px', margin: 'auto 2.6rem' - }), _defineProperty(_headerContainer, '& .header__search--inner > .header__search-close', { + }, + '& .header__search--inner > .header__search-close': { margin: 'auto 2.5rem' - }), _defineProperty(_headerContainer, '& .header__search--inner > .header__search-close > button', { + }, + '& .header__search--inner > .header__search-close > button': { background: 'none', border: 'none', width: '50px' - }), _defineProperty(_headerContainer, '& .header__search--inner > .header__search-close > button > svg', { + }, + '& .header__search--inner > .header__search-close > button > svg': { verticalAlign: 'middle' - }), _defineProperty(_headerContainer, '& .header__search--inner > .header__search-close > button > svg > path', { + }, + '& .header__search--inner > .header__search-close > button > svg > path': { transition: 'all 0.2s ease-in-out' - }), _defineProperty(_headerContainer, '& .header__search--inner > .header__search-close > button:hover > svg > path', { + }, + '& .header__search--inner > .header__search-close > button:hover > svg > path': { fill: '#002c77', transition: 'all 0.2s ease-in-out' - }), _defineProperty(_headerContainer, theme.breakpoints.down('md'), { + }, + [theme.breakpoints.down('md')]: { '& nav#block-neon-main-menu > ul.menu.menu--main > li.siteSearch': { padding: '0 1.875rem 0.625rem 1.875rem !important' }, @@ -274,18 +276,18 @@ var useStyles = (0, _styles.makeStyles)(function (theme) { '& .search-form-mobile > div.search-api-form > form#search-api-form > .form-item > label': { display: 'none !important' } - }), _headerContainer) - }; -}); -var buildSearchAction = function buildSearchAction(action) { - var root = _NeonEnvironment.default.getWebHost(); + } + } +})); +const buildSearchAction = action => { + const root = _NeonEnvironment.default.getWebHost(); if (!action) return "".concat(root, "/search/site"); if (action.startsWith('/')) { return "".concat(root).concat(action); } return "".concat(root, "/").concat(action); }; -var applyAttribute = function applyAttribute(nextAttribs, attribs, attr) { +const applyAttribute = (nextAttribs, attribs, attr) => { switch (attr) { case 'class': // eslint-disable-next-line no-param-reassign @@ -302,31 +304,30 @@ var applyAttribute = function applyAttribute(nextAttribs, attribs, attr) { break; } }; -var NeonHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, headerRef) { - var drupalCssLoaded = props.drupalCssLoaded, - unstickyDrupalHeader = props.unstickyDrupalHeader, - showSkeleton = props.showSkeleton; - var classes = useStyles(_Theme.default); - var belowLg = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('md')); - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - _NeonContext$useNeonC3 = _NeonContext$useNeonC2[0], - neonContextIsActive = _NeonContext$useNeonC3.isActive, - headerFetch = _NeonContext$useNeonC3.fetches[DRUPAL_HEADER_HTML], - headerHTML = _NeonContext$useNeonC3.html[DRUPAL_HEADER_HTML], - auth = _NeonContext$useNeonC3.auth; +const NeonHeader = /*#__PURE__*/(0, _react.forwardRef)((props, headerRef) => { + const { + drupalCssLoaded, + unstickyDrupalHeader, + showSkeleton + } = props; + const classes = useStyles(_Theme.default); + const belowLg = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('md')); + const [{ + isActive: neonContextIsActive, + fetches: { + [DRUPAL_HEADER_HTML]: headerFetch + }, + html: { + [DRUPAL_HEADER_HTML]: headerHTML + }, + auth + }] = _NeonContext.default.useNeonContextState(); // Only do the delay effect if not in test - var initialRenderDelay = process.env.NODE_ENV === 'test'; - var _useState = (0, _react.useState)(_NeonContext.FETCH_STATUS.AWAITING_CALL), - _useState2 = _slicedToArray(_useState, 2), - headerJsStatus = _useState2[0], - setHeaderJsStatus = _useState2[1]; - var _useState3 = (0, _react.useState)(initialRenderDelay), - _useState4 = _slicedToArray(_useState3, 2), - headerRenderDelayed = _useState4[0], - setHeaderRenderDelayed = _useState4[1]; - var renderMode = 'loading'; + const initialRenderDelay = process.env.NODE_ENV === 'test'; + const [headerJsStatus, setHeaderJsStatus] = (0, _react.useState)(_NeonContext.FETCH_STATUS.AWAITING_CALL); + const [headerRenderDelayed, setHeaderRenderDelayed] = (0, _react.useState)(initialRenderDelay); + let renderMode = 'loading'; if (neonContextIsActive) { switch (headerFetch.status) { case _NeonContext.FETCH_STATUS.SUCCESS: @@ -346,61 +347,38 @@ var NeonHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, headerRef) } // Load header.js only after initial delayed render of the drupal header is complete - (0, _react.useLayoutEffect)(function () { + (0, _react.useLayoutEffect)(() => { if (!_NeonEnvironment.default.fetchDrupalAssets) { - _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { - return _regeneratorRuntime().wrap(function _callee$(_context) { - while (1) switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return Promise.resolve().then(function () { - return _interopRequireWildcard(require('../../remoteAssets/drupal-header.js')); - }); - case 2: - setHeaderJsStatus(_NeonContext.FETCH_STATUS.SUCCESS); - case 3: - case "end": - return _context.stop(); - } - }, _callee); - }))(); + (async () => { + // eslint-disable-next-line no-unused-expressions, import/extensions + await Promise.resolve().then(() => _interopRequireWildcard(require('../../remoteAssets/drupal-header.js'))); + setHeaderJsStatus(_NeonContext.FETCH_STATUS.SUCCESS); + })(); return; } if (!renderMode.includes('drupal') || headerJsStatus !== _NeonContext.FETCH_STATUS.AWAITING_CALL || !headerRenderDelayed || !drupalCssLoaded) { return; } setHeaderJsStatus(_NeonContext.FETCH_STATUS.FETCHING); - var script = document.createElement('script'); + const script = document.createElement('script'); script.src = _remoteAssetsMap.default.DRUPAL_HEADER_JS.url; - script.onload = function () { + script.onload = () => { setHeaderJsStatus(_NeonContext.FETCH_STATUS.SUCCESS); }; - script.onerror = function () { - _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { - return _regeneratorRuntime().wrap(function _callee2$(_context2) { - while (1) switch (_context2.prev = _context2.next) { - case 0: - script.remove(); - // eslint-disable-next-line no-unused-expressions, import/extensions - _context2.next = 3; - return Promise.resolve().then(function () { - return _interopRequireWildcard(require('../../remoteAssets/drupal-header.js')); - }); - case 3: - setHeaderJsStatus(_NeonContext.FETCH_STATUS.SUCCESS); - case 4: - case "end": - return _context2.stop(); - } - }, _callee2); - }))(); + script.onerror = () => { + (async () => { + script.remove(); + // eslint-disable-next-line no-unused-expressions, import/extensions + await Promise.resolve().then(() => _interopRequireWildcard(require('../../remoteAssets/drupal-header.js'))); + setHeaderJsStatus(_NeonContext.FETCH_STATUS.SUCCESS); + })(); }; document.body.appendChild(script); }, [headerJsStatus, drupalCssLoaded, headerRenderDelayed, setHeaderJsStatus, renderMode]); // Delay the rendering of the drupal header one render cycle to allow the CSS to propogate into // the environment. This prevents a "flash" of the unstyled menu in the drupal header on page load - var appliedHtmlCheck = headerHTML; + let appliedHtmlCheck = headerHTML; switch (renderMode) { case 'drupal': appliedHtmlCheck = headerHTML; @@ -412,16 +390,12 @@ var NeonHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, headerRef) default: break; } - (0, _react.useLayoutEffect)(function () { + (0, _react.useLayoutEffect)(() => { if (neonContextIsActive && appliedHtmlCheck && drupalCssLoaded && !headerRenderDelayed) { - var timeout = window.setTimeout(function () { - return setHeaderRenderDelayed(true); - }, 0); - return function () { - return window.clearTimeout(timeout); - }; + const timeout = window.setTimeout(() => setHeaderRenderDelayed(true), 0); + return () => window.clearTimeout(timeout); } - return function () {}; + return () => {}; }, [neonContextIsActive, appliedHtmlCheck, drupalCssLoaded, headerRenderDelayed]); // Render Loading @@ -438,15 +412,16 @@ var NeonHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, headerRef) } // Render Drupal header - var injectAuth = !auth.useCore ? null : { + const injectAuth = !auth.useCore ? null : { // eslint-disable-next-line react/no-unstable-nested-components - replace: function replace(domNode) { - var _domNode$attribs = domNode.attribs, - attribs = _domNode$attribs === void 0 ? {} : _domNode$attribs, - name = domNode.name; + replace: domNode => { + const { + attribs = {}, + name + } = domNode; if (name === 'form' && attribs.id === 'search-api-form') { - var nextAttribs = {}; - Object.keys(attribs).forEach(function (attr) { + const nextAttribs = {}; + Object.keys(attribs).forEach(attr => { applyAttribute(nextAttribs, attribs, attr); }); return /*#__PURE__*/_react.default.createElement("form", _extends({}, nextAttribs, { @@ -469,14 +444,14 @@ var NeonHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, headerRef) })); } }; - var appliedClassName = classes.headerContainer; + let appliedClassName = classes.headerContainer; if (unstickyDrupalHeader) { appliedClassName = "".concat(classes.unstickyHeader, " ").concat(classes.headerContainer); } if (renderMode === 'drupal-fallback' || renderMode === 'loading' && !showSkeleton) { appliedClassName = "".concat(appliedClassName, " ").concat(classes.headerContainerFallback); } - var html = renderMode === 'drupal' ? headerHTML : _drupalHeader.default; + const html = renderMode === 'drupal' ? headerHTML : _drupalHeader.default; return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("header", { ref: headerRef, id: "header", @@ -493,5 +468,4 @@ NeonHeader.defaultProps = { unstickyDrupalHeader: true, showSkeleton: false }; -var _default = NeonHeader; -exports.default = _default; \ No newline at end of file +var _default = exports.default = NeonHeader; \ No newline at end of file diff --git a/lib/components/NeonHeader/index.js b/lib/components/NeonHeader/index.js index 12da630d..fdc70889 100644 --- a/lib/components/NeonHeader/index.js +++ b/lib/components/NeonHeader/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _NeonHeader.default; } }); diff --git a/lib/components/NeonJsonLd/NeonJsonLd.js b/lib/components/NeonJsonLd/NeonJsonLd.js index fcee9ce1..01e2f999 100644 --- a/lib/components/NeonJsonLd/NeonJsonLd.js +++ b/lib/components/NeonJsonLd/NeonJsonLd.js @@ -11,31 +11,27 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /** * Container for supplying common NEON API JSON-LD request handlers. */ -var NeonJsonLd = { +const NeonJsonLd = { CITATION_AUTHOR: 'NEON (National Ecological Observatory Network)', /** * Convenience wrapper for obtaining an AJAX Observable from NeonApi. * @param {string} url The URL to build from. * @return The RxJS AJAX Observable. */ - getJsonLdObservable: function getJsonLdObservable(url) { - return _NeonApi.default.getJsonObservable(url); - }, + getJsonLdObservable: url => _NeonApi.default.getJsonObservable(url), /** * Gets the repository JSON-LD endpoint observable. * @return The RxJS AJAX Observable. */ - getRepoJsonLdObservable: function getRepoJsonLdObservable() { - return NeonJsonLd.getJsonLdObservable(_NeonEnvironment.default.getFullJsonLdApiPath('repo')); - }, + getRepoJsonLdObservable: () => NeonJsonLd.getJsonLdObservable(_NeonEnvironment.default.getFullJsonLdApiPath('repo')), /** * Gets the product JSON-LD endpoint observable. * @param {string} productCode The product code to build the URL from. * @param {string} release The release to build the URL from. * @return The RxJS AJAX Observable. */ - getProductJsonLdObservable: function getProductJsonLdObservable(productCode, release) { - var hasRelease = typeof release !== 'undefined' && release !== null && typeof release === 'string' && release.length > 0; + getProductJsonLdObservable: (productCode, release) => { + const hasRelease = typeof release !== 'undefined' && release !== null && typeof release === 'string' && release.length > 0; if (hasRelease) { return NeonJsonLd.getJsonLdObservable("".concat(_NeonEnvironment.default.getFullJsonLdApiPath('products'), "/").concat(productCode, "?release=").concat(release)); } @@ -48,14 +44,14 @@ var NeonJsonLd = { * @param {Object|null|undefined} data The JSON-LD object to inject. * @param {boolean} injectReleaseMeta Optionally inject release meta tags */ - inject: function inject(data) { - var injectReleaseMeta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + inject: function (data) { + let injectReleaseMeta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!data) return; NeonJsonLd.removeJsonLdScript(); if (injectReleaseMeta) { NeonJsonLd.injectReleaseMeta(data); } - var block = document.createElement('script'); + const block = document.createElement('script'); block.setAttribute('type', 'application/ld+json'); block.innerText = JSON.stringify(data); document.head.appendChild(block); @@ -68,11 +64,11 @@ var NeonJsonLd = { * @param {boolean|undefined} metadataUseMultiParent Optionally inject multi * parent DOIs. */ - injectReleaseMeta: function injectReleaseMeta(data) { - var metadataUseMultiParent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + injectReleaseMeta: function (data) { + let metadataUseMultiParent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!data) return; try { - var metadataObjects = []; + let metadataObjects = []; if (Array.isArray(data)) { if (!metadataUseMultiParent && data.length >= 1) { metadataObjects = [data[0]]; @@ -83,24 +79,24 @@ var NeonJsonLd = { metadataObjects = [data]; } NeonJsonLd.removeReleaseMeta(); - metadataObjects.forEach(function (metadataObject) { - var doiUrl = new URL(metadataObject.identifier); - var doiBlock = document.createElement('meta'); + metadataObjects.forEach(metadataObject => { + const doiUrl = new URL(metadataObject.identifier); + const doiBlock = document.createElement('meta'); doiBlock.setAttribute('name', 'citation_doi'); doiBlock.setAttribute('content', doiUrl.pathname.slice(1, doiUrl.pathname.length)); - var titleBlock = document.createElement('meta'); + const titleBlock = document.createElement('meta'); titleBlock.setAttribute('name', 'citation_title'); - var addTitle = false; + let addTitle = false; if (typeof metadataObject.name === 'string' && metadataObject.name.length > 0) { if (metadataObject.name.indexOf(NeonJsonLd.CITATION_AUTHOR) >= 0) { - var titleContent = metadataObject.name.replace(NeonJsonLd.CITATION_AUTHOR, '').trim(); + const titleContent = metadataObject.name.replace(NeonJsonLd.CITATION_AUTHOR, '').trim(); titleBlock.setAttribute('content', titleContent); } else { titleBlock.setAttribute('content', metadataObject.name); } addTitle = true; } - var authorBlock = document.createElement('meta'); + const authorBlock = document.createElement('meta'); authorBlock.setAttribute('name', 'citation_author'); authorBlock.setAttribute('content', NeonJsonLd.CITATION_AUTHOR); document.head.appendChild(doiBlock); @@ -113,20 +109,19 @@ var NeonJsonLd = { console.error(e); // eslint-disable-line no-console } }, - /** * Removes all JSON-LD based metadata */ - removeAllMetadata: function removeAllMetadata() { + removeAllMetadata: () => { NeonJsonLd.removeJsonLdScript(); NeonJsonLd.removeReleaseMeta(); }, /** * Removes the JDON-LD script block when present */ - removeJsonLdScript: function removeJsonLdScript() { + removeJsonLdScript: () => { try { - var existingBlock = document.head.querySelector('script[type="application/ld+json"]'); + const existingBlock = document.head.querySelector('script[type="application/ld+json"]'); if (typeof existingBlock !== 'undefined' && existingBlock !== null) { existingBlock.remove(); } @@ -134,45 +129,35 @@ var NeonJsonLd = { console.error(e); // eslint-disable-line no-console } }, - /** * Removes the release meta tags from the DOM head element when exists. */ - removeReleaseMeta: function removeReleaseMeta() { + removeReleaseMeta: () => { try { - var currentDoiBlocks = document.head.querySelectorAll('meta[name="citation_doi"]'); + const currentDoiBlocks = document.head.querySelectorAll('meta[name="citation_doi"]'); if (typeof currentDoiBlocks !== 'undefined' && currentDoiBlocks !== null) { - currentDoiBlocks.forEach(function (currentDoiBlock) { - return currentDoiBlock === null || currentDoiBlock === void 0 ? void 0 : currentDoiBlock.remove(); - }); + currentDoiBlocks.forEach(currentDoiBlock => currentDoiBlock === null || currentDoiBlock === void 0 ? void 0 : currentDoiBlock.remove()); } - var currentTitleBlocks = document.head.querySelectorAll('meta[name="citation_title"]'); + const currentTitleBlocks = document.head.querySelectorAll('meta[name="citation_title"]'); if (typeof currentTitleBlocks !== 'undefined' && currentTitleBlocks !== null) { - currentTitleBlocks.forEach(function (currentTitleBlock) { - return currentTitleBlock === null || currentTitleBlock === void 0 ? void 0 : currentTitleBlock.remove(); - }); + currentTitleBlocks.forEach(currentTitleBlock => currentTitleBlock === null || currentTitleBlock === void 0 ? void 0 : currentTitleBlock.remove()); } - var currentAuthorBlocks = document.head.querySelectorAll('meta[name="citation_author"]'); + const currentAuthorBlocks = document.head.querySelectorAll('meta[name="citation_author"]'); if (typeof currentAuthorBlocks !== 'undefined' && currentAuthorBlocks !== null) { - currentAuthorBlocks.forEach(function (currentAuthorBlock) { - return currentAuthorBlock === null || currentAuthorBlock === void 0 ? void 0 : currentAuthorBlock.remove(); - }); + currentAuthorBlocks.forEach(currentAuthorBlock => currentAuthorBlock === null || currentAuthorBlock === void 0 ? void 0 : currentAuthorBlock.remove()); } } catch (e) { console.error(e); // eslint-disable-line no-console } }, - /** * Retrieves and injects the JDON-LD data from the specified URL. * @param {string} url The URL to query. * @param {boolean} injectReleaseMeta Optionally inject release meta tags */ - getJsonLdWithInjection: function getJsonLdWithInjection(url) { - var injectReleaseMeta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var observable = _NeonApi.default.getJsonObservable(url).pipe((0, _rxjs.map)(function (response) { - return NeonJsonLd.inject(response, injectReleaseMeta); - }), (0, _rxjs.catchError)(function (err) { + getJsonLdWithInjection: function (url) { + let injectReleaseMeta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const observable = _NeonApi.default.getJsonObservable(url).pipe((0, _rxjs.map)(response => NeonJsonLd.inject(response, injectReleaseMeta)), (0, _rxjs.catchError)(err => { console.error(err); // eslint-disable-line no-console return (0, _rxjs.of)('JSON-LD not found'); })); @@ -181,9 +166,7 @@ var NeonJsonLd = { /** * Fetches and injects the repository JSON-LD. */ - injectRepo: function injectRepo() { - return NeonJsonLd.getJsonLdWithInjection(_NeonEnvironment.default.getFullJsonLdApiPath('repo')); - }, + injectRepo: () => NeonJsonLd.getJsonLdWithInjection(_NeonEnvironment.default.getFullJsonLdApiPath('repo')), /** * Fetches and injects the product JSON-LD based on the specified product code. * @param {string} productCode The product code to query with. @@ -191,13 +174,13 @@ var NeonJsonLd = { * @param {boolean} injectReleaseMeta Optionally inject release meta tags * @param {boolean} onNotExistsOnly Inject only if JSON-LD is not already injected */ - injectProduct: function injectProduct(productCode, release) { - var injectReleaseMeta = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var onNotExistsOnly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - var shouldFetch = true; + injectProduct: function (productCode, release) { + let injectReleaseMeta = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + let onNotExistsOnly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + let shouldFetch = true; if (onNotExistsOnly) { try { - var existingBlock = document.head.querySelector('script[type="application/ld+json"]'); + const existingBlock = document.head.querySelector('script[type="application/ld+json"]'); if (typeof existingBlock !== 'undefined' && existingBlock !== null) { shouldFetch = false; } @@ -205,11 +188,10 @@ var NeonJsonLd = { console.error(e); // eslint-disable-line no-console } } - if (!shouldFetch) { return null; } - var hasRelease = typeof release !== 'undefined' && release !== null && typeof release === 'string' && release.length > 0; + const hasRelease = typeof release !== 'undefined' && release !== null && typeof release === 'string' && release.length > 0; if (hasRelease) { return NeonJsonLd.getJsonLdWithInjection("".concat(_NeonEnvironment.default.getFullJsonLdApiPath('products'), "/").concat(productCode, "?release=").concat(release), injectReleaseMeta); } @@ -221,12 +203,12 @@ var NeonJsonLd = { * @param {string} uuid The dataset UUID to query with. * @param {boolean} onNotExistsOnly Inject only if JSON-LD is not already injected */ - injectPrototypeDataset: function injectPrototypeDataset(uuid) { - var onNotExistsOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var shouldFetch = true; + injectPrototypeDataset: function (uuid) { + let onNotExistsOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + let shouldFetch = true; if (onNotExistsOnly) { try { - var existingBlock = document.head.querySelector('script[type="application/ld+json"]'); + const existingBlock = document.head.querySelector('script[type="application/ld+json"]'); if (typeof existingBlock !== 'undefined' && existingBlock !== null) { shouldFetch = false; } @@ -234,7 +216,6 @@ var NeonJsonLd = { console.error(e); // eslint-disable-line no-console } } - if (!shouldFetch) { return null; } @@ -242,5 +223,4 @@ var NeonJsonLd = { } }; Object.freeze(NeonJsonLd); -var _default = NeonJsonLd; -exports.default = _default; \ No newline at end of file +var _default = exports.default = NeonJsonLd; \ No newline at end of file diff --git a/lib/components/NeonJsonLd/index.js b/lib/components/NeonJsonLd/index.js index dfea6428..eb0b15d1 100644 --- a/lib/components/NeonJsonLd/index.js +++ b/lib/components/NeonJsonLd/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _NeonJsonLd.default; } }); diff --git a/lib/components/NeonPage/BrowserWarning.js b/lib/components/NeonPage/BrowserWarning.js index 075c74d9..71085317 100644 --- a/lib/components/NeonPage/BrowserWarning.js +++ b/lib/components/NeonPage/BrowserWarning.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -15,15 +14,9 @@ var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton") var _Close = _interopRequireDefault(require("@material-ui/icons/Close")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* Browser duck typing and warning We know detecting browser on user agent strings for feature gating is bad practice. @@ -31,51 +24,44 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } Nothing else is or should be predicated on the value detected here. Don't make this any more complicated! */ -var isBrowserIE = function isBrowserIE() { - return navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > -1; -}; -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - browserWarning: { - backgroundColor: theme.palette.error.main - }, - browserWarningMessage: { - display: 'flex', - alignItems: 'center' - }, - buttonRow: { - marginTop: theme.spacing(1), - display: 'flex', - justifyContent: 'space-around' - } - }; -}); -var cookies = new _universalCookie.default(); -var BrowserWarning = function BrowserWarning() { - var classes = useStyles(_Theme.default); - var browserIsIE = isBrowserIE(); - var _useState = (0, _react.useState)(browserIsIE), - _useState2 = _slicedToArray(_useState, 2), - browserWarningOpen = _useState2[0], - setBrowserWarningOpen = _useState2[1]; +const isBrowserIE = () => navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > -1; +const useStyles = (0, _styles.makeStyles)(theme => ({ + browserWarning: { + backgroundColor: theme.palette.error.main + }, + browserWarningMessage: { + display: 'flex', + alignItems: 'center' + }, + buttonRow: { + marginTop: theme.spacing(1), + display: 'flex', + justifyContent: 'space-around' + } +})); +const cookies = new _universalCookie.default(); +const BrowserWarning = () => { + const classes = useStyles(_Theme.default); + const browserIsIE = isBrowserIE(); + const [browserWarningOpen, setBrowserWarningOpen] = (0, _react.useState)(browserIsIE); if (!browserIsIE) { return null; } if (cookies.get('ignoreIE11Warning')) { return null; } - var handleBrowserWarningClose = function handleBrowserWarningClose() { + const handleBrowserWarningClose = () => { cookies.set('ignoreIE11Warning', true, { path: '/', maxAge: 86400 }); setBrowserWarningOpen(false); }; - var buttonProps = { + const buttonProps = { color: 'inherit', target: '_blank' }; - var message = /*#__PURE__*/_react.default.createElement("span", { + const message = /*#__PURE__*/_react.default.createElement("span", { id: "browser-warning", className: classes.browserWarningMessage, "data-selenium": "neon-page.browser-warning" @@ -110,5 +96,4 @@ var BrowserWarning = function BrowserWarning() { }, /*#__PURE__*/_react.default.createElement(_Close.default, null)) })); }; -var _default = BrowserWarning; -exports.default = _default; \ No newline at end of file +var _default = exports.default = BrowserWarning; \ No newline at end of file diff --git a/lib/components/NeonPage/LiferayNotifications.js b/lib/components/NeonPage/LiferayNotifications.js index 30b14cac..3b4faa2a 100644 --- a/lib/components/NeonPage/LiferayNotifications.js +++ b/lib/components/NeonPage/LiferayNotifications.js @@ -12,54 +12,46 @@ var _SnackbarContent = _interopRequireDefault(require("@material-ui/core/Snackba var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton")); var _Close = _interopRequireDefault(require("@material-ui/icons/Close")); var _Theme = _interopRequireWildcard(require("../Theme/Theme")); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var useStyles = (0, _styles.makeStyles)(function (theme) { - var _notification; - return { - notification: (_notification = { - color: theme.palette.text.primary, - backgroundColor: _Theme.COLORS.GOLD[50], - border: "1px solid ".concat(_Theme.COLORS.GOLD[300]), - borderRadius: '4px', - marginLeft: theme.spacing(3) - }, _defineProperty(_notification, theme.breakpoints.up('sm'), { +const useStyles = (0, _styles.makeStyles)(theme => ({ + notification: { + color: theme.palette.text.primary, + backgroundColor: _Theme.COLORS.GOLD[50], + border: "1px solid ".concat(_Theme.COLORS.GOLD[300]), + borderRadius: '4px', + marginLeft: theme.spacing(3), + [theme.breakpoints.up('sm')]: { maxWidth: '75%' - }), _defineProperty(_notification, theme.breakpoints.up('md'), { + }, + [theme.breakpoints.up('md')]: { maxWidth: '50%' - }), _defineProperty(_notification, theme.breakpoints.up('lg'), { + }, + [theme.breakpoints.up('lg')]: { maxWidth: '33%' - }), _notification) - }; -}); -var LiferayNotifications = function LiferayNotifications(props) { - var classes = useStyles(_Theme.default); - var notifications = props.notifications, - onHideNotifications = props.onHideNotifications; - if (!notifications.length || notifications.every(function (n) { - return n.dismissed; - })) { + } + } +})); +const LiferayNotifications = props => { + const classes = useStyles(_Theme.default); + const { + notifications, + onHideNotifications + } = props; + if (!notifications.length || notifications.every(n => n.dismissed)) { return null; } - var renderNotificationContent = function renderNotificationContent() { - return /*#__PURE__*/_react.default.createElement("div", { - id: "neon-data-portal-notifications" - }, notifications.map(function (notification) { - return /*#__PURE__*/_react.default.createElement("div", { - key: notification.id - // eslint-disable-next-line react/no-danger - , - dangerouslySetInnerHTML: { - __html: notification.message - } - }); - })); - }; + const renderNotificationContent = () => /*#__PURE__*/_react.default.createElement("div", { + id: "neon-data-portal-notifications" + }, notifications.map(notification => /*#__PURE__*/_react.default.createElement("div", { + key: notification.id + // eslint-disable-next-line react/no-danger + , + dangerouslySetInnerHTML: { + __html: notification.message + } + }))); return /*#__PURE__*/_react.default.createElement(_Snackbar.default, { open: true, anchorOrigin: { @@ -93,5 +85,4 @@ LiferayNotifications.defaultProps = { notifications: [], onHideNotifications: null }; -var _default = LiferayNotifications; -exports.default = _default; \ No newline at end of file +var _default = exports.default = LiferayNotifications; \ No newline at end of file diff --git a/lib/components/NeonPage/NeonPage.js b/lib/components/NeonPage/NeonPage.js index 799afed8..3c3124cf 100644 --- a/lib/components/NeonPage/NeonPage.js +++ b/lib/components/NeonPage/NeonPage.js @@ -45,24 +45,14 @@ var _liferayNotificationsUtil = require("../../util/liferayNotificationsUtil"); var _NSFNEONLogo = _interopRequireDefault(require("../../images/NSF-NEON-logo.png")); require("./styles.css"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var DRUPAL_THEME_CSS = _remoteAssetsMap.default.DRUPAL_THEME_CSS.KEY; -var cookies = new _universalCookie.default(); +const DRUPAL_THEME_CSS = _remoteAssetsMap.default.DRUPAL_THEME_CSS.KEY; +const cookies = new _universalCookie.default(); // Global CSS -var GlobalCss = (0, _styles.withStyles)({ +const GlobalCss = (0, _styles.withStyles)({ '@global': { code: { fontSize: '115%', @@ -70,18 +60,16 @@ var GlobalCss = (0, _styles.withStyles)({ backgroundColor: 'rgba(0, 0, 0, 0.11)' } } -})(function () { - return null; -}); +})(() => null); // Function to determine if we're effectively scrolled to the bottom of the page. Used to set // current sidebar link to the last one automatically when the associated content for the last link // can't be scrolled past (i.e. is not taller than the page height less the footer height) -var isAtMaxScroll = function isAtMaxScroll() { - var windowHeight = window.innerHeight || (document.documentElement || document.body).clientHeight; - var documentHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight); - var scrollTop = window.pageYOffset || (document.documentElement || document.body.parentNode || document.body).scrollTop; - var trackLength = documentHeight - windowHeight; +const isAtMaxScroll = () => { + const windowHeight = window.innerHeight || (document.documentElement || document.body).clientHeight; + const documentHeight = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight); + const scrollTop = window.pageYOffset || (document.documentElement || document.body.parentNode || document.body).scrollTop; + const trackLength = documentHeight - windowHeight; return scrollTop / trackLength >= 0.99; }; @@ -95,194 +83,211 @@ if (!window.gtmDataLayer) { // NOTE: because these are defined outside the ThemeProvider any theme vars must come directly from // the Theme import, unlike most other useStyles() instances where the Theme import is passed to the // hook as an argument. -var useStyles = function useStyles(sidebarWidth) { - return (0, _styles.makeStyles)(function () { - var _pageContent, _sidebarContainer, _sidebarTitle, _sidebarSubtitle, _sidebarDivider; - return { - outerPageContainer: _defineProperty({ - display: 'flex', - position: 'relative', - minHeight: _Theme.default.spacing(30), - borderTop: '2px solid transparent', - paddingLeft: '0px', - paddingRight: '0px' - }, _Theme.default.breakpoints.down('sm'), { - paddingBottom: _Theme.default.spacing(2.5), - flexDirection: 'column' - }), - pageContent: (_pageContent = { - display: 'block', - verticalAlign: 'top', - position: 'relative', - padding: _Theme.default.spacing(4, 8, 12, 8), - width: "calc(100% - ".concat(sidebarWidth, "px)") - }, _defineProperty(_pageContent, _Theme.default.breakpoints.down('sm'), { - width: '100%', - display: 'block', - padding: _Theme.default.spacing(3, 5, 8, 5) - }), _defineProperty(_pageContent, '& a:not([class]), a[class=""]', { - color: _Theme.COLORS.LIGHT_BLUE[500], - textDecoration: 'none' - }), _defineProperty(_pageContent, '& a:hover:not([class]), a:hover[class=""]', { - textDecoration: 'underline' - }), _pageContent), - breadcrumbs: _defineProperty({ - margin: _Theme.default.spacing(2, 0, 4, 0) - }, _Theme.default.breakpoints.down('sm'), { - margin: _Theme.default.spacing(1, 0, 2, 0) - }), - sidebarContainer: (_sidebarContainer = { - display: 'block', - verticalAlign: 'top', - backgroundColor: _Theme.COLORS.GREY[50], - padding: _Theme.default.spacing(5, 4) - }, _defineProperty(_sidebarContainer, _Theme.default.breakpoints.down('sm'), { - display: 'inline-block', - width: '100%', - maxHeight: 'calc(100vh - 84px)', - padding: _Theme.default.spacing(2.5, 2), - position: 'sticky', - top: '-2px', - boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.25), 0px 1px 1px rgba(0, 0, 0, 0.25)', - zIndex: 2 - }), _defineProperty(_sidebarContainer, _Theme.default.breakpoints.down('xs'), { - padding: _Theme.default.spacing(1.5) - }), _sidebarContainer), - sidebarInnerStickyContainer: { - // Sticky properties injected via CSS to handle webkit position prop - top: '40px' - }, - sidebarTitleContainer: { - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between' - }, - sidebarTitle: (_sidebarTitle = { - fontWeight: 700 - }, _defineProperty(_sidebarTitle, _Theme.default.breakpoints.down('sm'), { - overflow: 'hidden', - whiteSpace: 'nowrap', - textOverflow: 'ellipsis' - }), _defineProperty(_sidebarTitle, _Theme.default.breakpoints.only('sm'), { - marginRight: _Theme.default.spacing(1.5) - }), _sidebarTitle), - sidebarSubtitle: (_sidebarSubtitle = { - color: _Theme.COLORS.GREY[300], - marginTop: _Theme.default.spacing(1) - }, _defineProperty(_sidebarSubtitle, _Theme.default.breakpoints.down('sm'), { - overflow: 'hidden', - whiteSpace: 'nowrap', - textOverflow: 'ellipsis', - marginTop: '0px' - }), _defineProperty(_sidebarSubtitle, _Theme.default.breakpoints.down('xs'), { - display: 'none' - }), _sidebarSubtitle), - sidebarTitlesContainer: _defineProperty({ - minWidth: '0px', - paddingRight: _Theme.default.spacing(1) - }, _Theme.default.breakpoints.only('sm'), { - display: 'flex', - alignItems: 'baseline' - }), - sidebarLink: { - cursor: 'pointer', - display: 'block', - fontSize: '0.9rem', - marginBottom: '12px' - }, - sidebarLinkCurrent: { - fontWeight: 700, - color: _Theme.COLORS.GREY[500], - textDecoration: 'none', - '&:hover': { - transition: 'all 0.45s', - color: _Theme.COLORS.GREY[900] - } - }, - sidebarLinkIcon: { - marginBottom: '-5px', - marginRight: '5px', - fontSize: '1.3rem' - }, - sidebarLinksContainer: { - flex: '1 1 auto', - overflowY: 'auto', - minHeight: '0px' - }, - sidebarDivider: (_sidebarDivider = { - margin: '24px 0px' - }, _defineProperty(_sidebarDivider, _Theme.default.breakpoints.down('sm'), { - margin: '16px 0px' - }), _defineProperty(_sidebarDivider, _Theme.default.breakpoints.down('xs'), { - margin: '8px 0px 12px 0px' - }), _sidebarDivider), - backdropPaper: _defineProperty({ - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - justifyContent: 'center', - textAlign: 'center', - borderRadius: '4px', - padding: _Theme.default.spacing(3), - position: 'sticky', - top: _Theme.default.spacing(12), - left: 0, - right: 0, - marginLeft: 'auto', - marginRight: 'auto', - width: '70%' - }, _Theme.default.breakpoints.up('lg'), { - width: '50%' - }), - pageTitle: _defineProperty({ - margin: _Theme.default.spacing(3, 0, 4, 0) - }, _Theme.default.breakpoints.up('sm'), { - margin: _Theme.default.spacing(3, 0, 4, 0) - }), - pageSubtitle: { - maxWidth: '660px', - color: _Theme.COLORS.GREY[500], - lineHeight: '1.5', - fontSize: '1.1rem', - marginTop: _Theme.default.spacing(-1), - marginBottom: _Theme.default.spacing(4) - }, - errorPageTitleIcon: { - marginRight: _Theme.default.spacing(1.5), - color: _Theme.default.palette.error.dark, - fontSize: '2.3rem', - marginBottom: '-3px' - }, - errorPageCaption: { - display: 'block', - fontSize: '1rem', - fontFamily: 'monospace, monospace', - marginBottom: _Theme.default.spacing(4) - }, - errorPageLogo: { - height: '6em', - marginTop: _Theme.default.spacing(3), - marginBottom: _Theme.default.spacing(4) - }, - dismissOverlay: { - width: '100%', - textAlign: 'right', - marginTop: _Theme.default.spacing(2) - } - }; - }); -}; +const useStyles = sidebarWidth => (0, _styles.makeStyles)(() => ({ + outerPageContainer: { + display: 'flex', + position: 'relative', + minHeight: _Theme.default.spacing(30), + borderTop: '2px solid transparent', + paddingLeft: '0px', + paddingRight: '0px', + [_Theme.default.breakpoints.down('sm')]: { + paddingBottom: _Theme.default.spacing(2.5), + flexDirection: 'column' + } + }, + pageContent: { + display: 'block', + verticalAlign: 'top', + position: 'relative', + padding: _Theme.default.spacing(4, 8, 12, 8), + width: "calc(100% - ".concat(sidebarWidth, "px)"), + [_Theme.default.breakpoints.down('sm')]: { + width: '100%', + display: 'block', + padding: _Theme.default.spacing(3, 5, 8, 5) + }, + // These override links created with a naked tag, as opposed to a + // component, to appear the same as the component. This is especially + // useful for rendered markdown where injecting Mui Links isn't possible. + '& a:not([class]), a[class=""]': { + color: _Theme.COLORS.LIGHT_BLUE[500], + textDecoration: 'none' + }, + '& a:hover:not([class]), a:hover[class=""]': { + textDecoration: 'underline' + } + }, + breadcrumbs: { + margin: _Theme.default.spacing(2, 0, 4, 0), + [_Theme.default.breakpoints.down('sm')]: { + margin: _Theme.default.spacing(1, 0, 2, 0) + } + }, + sidebarContainer: { + display: 'block', + verticalAlign: 'top', + backgroundColor: _Theme.COLORS.GREY[50], + padding: _Theme.default.spacing(5, 4), + [_Theme.default.breakpoints.down('sm')]: { + display: 'inline-block', + width: '100%', + maxHeight: 'calc(100vh - 84px)', + padding: _Theme.default.spacing(2.5, 2), + position: 'sticky', + top: '-2px', + boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.25), 0px 1px 1px rgba(0, 0, 0, 0.25)', + zIndex: 2 + }, + [_Theme.default.breakpoints.down('xs')]: { + padding: _Theme.default.spacing(1.5) + } + }, + sidebarInnerStickyContainer: { + // Sticky properties injected via CSS to handle webkit position prop + top: '40px' + }, + sidebarTitleContainer: { + display: 'flex', + alignItems: 'center', + justifyContent: 'space-between' + }, + sidebarTitle: { + fontWeight: 700, + [_Theme.default.breakpoints.down('sm')]: { + overflow: 'hidden', + whiteSpace: 'nowrap', + textOverflow: 'ellipsis' + }, + [_Theme.default.breakpoints.only('sm')]: { + marginRight: _Theme.default.spacing(1.5) + } + }, + sidebarSubtitle: { + color: _Theme.COLORS.GREY[300], + marginTop: _Theme.default.spacing(1), + [_Theme.default.breakpoints.down('sm')]: { + overflow: 'hidden', + whiteSpace: 'nowrap', + textOverflow: 'ellipsis', + marginTop: '0px' + }, + [_Theme.default.breakpoints.down('xs')]: { + display: 'none' + } + }, + sidebarTitlesContainer: { + minWidth: '0px', + paddingRight: _Theme.default.spacing(1), + [_Theme.default.breakpoints.only('sm')]: { + display: 'flex', + alignItems: 'baseline' + } + }, + sidebarLink: { + cursor: 'pointer', + display: 'block', + fontSize: '0.9rem', + marginBottom: '12px' + }, + sidebarLinkCurrent: { + fontWeight: 700, + color: _Theme.COLORS.GREY[500], + textDecoration: 'none', + '&:hover': { + transition: 'all 0.45s', + color: _Theme.COLORS.GREY[900] + } + }, + sidebarLinkIcon: { + marginBottom: '-5px', + marginRight: '5px', + fontSize: '1.3rem' + }, + sidebarLinksContainer: { + flex: '1 1 auto', + overflowY: 'auto', + minHeight: '0px' + }, + sidebarDivider: { + margin: '24px 0px', + [_Theme.default.breakpoints.down('sm')]: { + margin: '16px 0px' + }, + [_Theme.default.breakpoints.down('xs')]: { + margin: '8px 0px 12px 0px' + } + }, + backdropPaper: { + display: 'flex', + flexDirection: 'column', + alignItems: 'center', + justifyContent: 'center', + textAlign: 'center', + borderRadius: '4px', + padding: _Theme.default.spacing(3), + position: 'sticky', + top: _Theme.default.spacing(12), + left: 0, + right: 0, + marginLeft: 'auto', + marginRight: 'auto', + width: '70%', + [_Theme.default.breakpoints.up('lg')]: { + width: '50%' + } + }, + pageTitle: { + margin: _Theme.default.spacing(3, 0, 4, 0), + [_Theme.default.breakpoints.up('sm')]: { + margin: _Theme.default.spacing(3, 0, 4, 0) + } + }, + pageSubtitle: { + maxWidth: '660px', + color: _Theme.COLORS.GREY[500], + lineHeight: '1.5', + fontSize: '1.1rem', + marginTop: _Theme.default.spacing(-1), + marginBottom: _Theme.default.spacing(4) + }, + errorPageTitleIcon: { + marginRight: _Theme.default.spacing(1.5), + color: _Theme.default.palette.error.dark, + fontSize: '2.3rem', + marginBottom: '-3px' + }, + errorPageCaption: { + display: 'block', + fontSize: '1rem', + fontFamily: 'monospace, monospace', + marginBottom: _Theme.default.spacing(4) + }, + errorPageLogo: { + height: '6em', + marginTop: _Theme.default.spacing(3), + marginBottom: _Theme.default.spacing(4) + }, + dismissOverlay: { + width: '100%', + textAlign: 'right', + marginTop: _Theme.default.spacing(2) + } +})); /** NEON Error Page Shown as the fallback for a general error boundary around all NEON page instances */ -var NeonErrorPage = function NeonErrorPage(props) { - var _props$error = props.error, - message = _props$error.message, - stack = _props$error.stack, - resetErrorBoundary = props.resetErrorBoundary; - var classes = useStyles(0)(); +const NeonErrorPage = props => { + const { + error: { + message, + stack + }, + resetErrorBoundary + } = props; + const classes = useStyles(0)(); // eslint-disable-next-line no-console console.error(stack); return /*#__PURE__*/_react.default.createElement(_styles2.ThemeProvider, { @@ -334,113 +339,101 @@ NeonErrorPage.propTypes = { }).isRequired, resetErrorBoundary: _propTypes.default.func.isRequired }; -var NeonPage = function NeonPage(props) { - var breadcrumbHomeHref = props.breadcrumbHomeHref, - breadcrumbs = props.breadcrumbs, - customHeader = props.customHeader, - customFooter = props.customFooter, - showHeaderSkeleton = props.showHeaderSkeleton, - showFooterSkeleton = props.showFooterSkeleton, - error = props.error, - loading = props.loading, - notification = props.notification, - outerPageContainerMaxWidth = props.outerPageContainerMaxWidth, - progress = props.progress, - resetStateAfterRuntimeError = props.resetStateAfterRuntimeError, - sidebarContent = props.sidebarContent, - sidebarContainerClassNameProp = props.sidebarContainerClassName, - sidebarLinks = props.sidebarLinks, - sidebarLinksAdditionalContent = props.sidebarLinksAdditionalContent, - sidebarLinksAsStandaloneChildrenProp = props.sidebarLinksAsStandaloneChildren, - sidebarSubtitle = props.sidebarSubtitle, - sidebarTitle = props.sidebarTitle, - sidebarWidth = props.sidebarWidth, - sidebarUnsticky = props.sidebarUnsticky, - subtitle = props.subtitle, - title = props.title, - unstickyDrupalHeader = props.unstickyDrupalHeader, - NeonContextProviderProps = props.NeonContextProviderProps, - children = props.children; +const NeonPage = props => { + const { + breadcrumbHomeHref, + breadcrumbs, + customHeader, + customFooter, + showHeaderSkeleton, + showFooterSkeleton, + error, + loading, + notification, + outerPageContainerMaxWidth, + progress, + resetStateAfterRuntimeError, + sidebarContent, + sidebarContainerClassName: sidebarContainerClassNameProp, + sidebarLinks, + sidebarLinksAdditionalContent, + sidebarLinksAsStandaloneChildren: sidebarLinksAsStandaloneChildrenProp, + sidebarSubtitle, + sidebarTitle, + sidebarWidth, + sidebarUnsticky, + subtitle, + title, + unstickyDrupalHeader, + NeonContextProviderProps, + children + } = props; /** Sidebar Setup */ // Sidebar can have content OR links, not both. If both are set then content wins. - var hasSidebarContent = sidebarContent !== null; - var hasSidebarLinks = !sidebarContent && Array.isArray(sidebarLinks) && sidebarLinks.length > 0; - var hasSidebar = hasSidebarContent || hasSidebarLinks; - var classes = useStyles(hasSidebar ? sidebarWidth : 0)(); - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - neonContextIsActive = _NeonContext$useNeonC2[0].isActive; - var headerRef = (0, _react.useRef)(null); - var contentRef = (0, _react.useRef)(null); - var sidebarRef = (0, _react.useRef)(null); - var sidebarLinksContainerRef = (0, _react.useRef)(null); - var belowMd = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('sm')); - var _useState = (0, _react.useState)(false), - _useState2 = _slicedToArray(_useState, 2), - overlayDismissed = _useState2[0], - setOverlayDismissed = _useState2[1]; + const hasSidebarContent = sidebarContent !== null; + const hasSidebarLinks = !sidebarContent && Array.isArray(sidebarLinks) && sidebarLinks.length > 0; + const hasSidebar = hasSidebarContent || hasSidebarLinks; + const classes = useStyles(hasSidebar ? sidebarWidth : 0)(); + const [{ + isActive: neonContextIsActive + }] = _NeonContext.default.useNeonContextState(); + const headerRef = (0, _react.useRef)(null); + const contentRef = (0, _react.useRef)(null); + const sidebarRef = (0, _react.useRef)(null); + const sidebarLinksContainerRef = (0, _react.useRef)(null); + const belowMd = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('sm')); + const [overlayDismissed, setOverlayDismissed] = (0, _react.useState)(false); // Boolean - whether any Drupal assets are used; only false if both header and footer are custom - var useSomeDrupalAssets = _NeonEnvironment.default.fetchDrupalAssets && !(customHeader && customFooter); + const useSomeDrupalAssets = _NeonEnvironment.default.fetchDrupalAssets && !(customHeader && customFooter); /** Continue Sidebar Setup */ // sidebarLinksAsStandaloneChildren can only be true if all sidebar links have a defined component - var sidebarLinksAsStandaloneChildren = hasSidebarLinks && sidebarLinksAsStandaloneChildrenProp ? sidebarLinks.every(function (link) { - return link.component; - }) : false; + const sidebarLinksAsStandaloneChildren = hasSidebarLinks && sidebarLinksAsStandaloneChildrenProp ? sidebarLinks.every(link => link.component) : false; // eslint-disable-next-line react-hooks/exhaustive-deps - var sidebarHashMap = !hasSidebarLinks ? {} : Object.fromEntries(sidebarLinks.map(function (link, idx) { - return [link.hash || '#', idx]; - })); - var initialCurrentSidebarHash = hasSidebarLinks ? sidebarLinks[0].hash || '#' : '#'; - var _useState3 = (0, _react.useState)(initialCurrentSidebarHash), - _useState4 = _slicedToArray(_useState3, 2), - currentSidebarHash = _useState4[0], - setCurrentSidebarHash = _useState4[1]; - var _useState5 = (0, _react.useState)(false), - _useState6 = _slicedToArray(_useState5, 2), - hashInitialized = _useState6[0], - setHashInitialized = _useState6[1]; - var _useState7 = (0, _react.useState)(false), - _useState8 = _slicedToArray(_useState7, 2), - sidebarExpanded = _useState8[0], - setSidebarExpanded = _useState8[1]; // for small viewports only + const sidebarHashMap = !hasSidebarLinks ? {} : Object.fromEntries(sidebarLinks.map((link, idx) => [link.hash || '#', idx])); + const initialCurrentSidebarHash = hasSidebarLinks ? sidebarLinks[0].hash || '#' : '#'; + const [currentSidebarHash, setCurrentSidebarHash] = (0, _react.useState)(initialCurrentSidebarHash); + const [hashInitialized, setHashInitialized] = (0, _react.useState)(false); + const [sidebarExpanded, setSidebarExpanded] = (0, _react.useState)(false); // for small viewports only // Get the vertical pixel offset for the content associated to any sidebar link by hash - var getSidebarLinkScrollPosition = (0, _react.useCallback)(function (hash) { + const getSidebarLinkScrollPosition = (0, _react.useCallback)(hash => { if (!hasSidebarLinks || sidebarLinksAsStandaloneChildren || !contentRef.current) { return -1; } - var headerOffset = (headerRef.current || {}).offsetHeight || 0; - var stickyOffset = belowMd ? (sidebarRef.current || {}).offsetHeight || 0 : 0; + const headerOffset = (headerRef.current || {}).offsetHeight || 0; + const stickyOffset = belowMd ? (sidebarRef.current || {}).offsetHeight || 0 : 0; if (hash === '#') { return 0; } - var anchor = contentRef.current.querySelector(hash); + const anchor = contentRef.current.querySelector(hash); return !anchor ? -1 : anchor.offsetTop + headerOffset - stickyOffset - _Theme.default.spacing(5); }, [hasSidebarLinks, sidebarLinksAsStandaloneChildren, belowMd]); /** Effect - For sidebarLinks pages, on successful load, if hash is present then update the current */ - (0, _react.useLayoutEffect)(function () { + (0, _react.useLayoutEffect)(() => { if (error || loading || !hasSidebarLinks) { - return function () {}; + return () => {}; } - var handleHashChange = function handleHashChange() { - var hash = document.location.hash; + const handleHashChange = () => { + const { + hash + } = document.location; if (currentSidebarHash === hash) { return; } setCurrentSidebarHash(hash); // If standard sidebar mode (scroll to content) also perform the scroll offset here if (!sidebarLinksAsStandaloneChildren) { - window.setTimeout(function () { + window.setTimeout(() => { window.scrollTo(0, getSidebarLinkScrollPosition(hash)); }, 0); } @@ -457,36 +450,32 @@ var NeonPage = function NeonPage(props) { // Set max-height on sidebar links container when the sidebar is sticky so the links get // a dedicated scrollbar instead of clipping if (!sidebarUnsticky && hasSidebarLinks && sidebarLinksContainerRef.current) { - var maxHeight = window.innerHeight - sidebarLinksContainerRef.current.offsetTop - 104; + const maxHeight = window.innerHeight - sidebarLinksContainerRef.current.offsetTop - 104; sidebarLinksContainerRef.current.style.maxHeight = "".concat(maxHeight, "px"); } // For sidebarLinksAsStandaloneChildren listen for hash changes to trigger a "redirect". if (sidebarLinksAsStandaloneChildren) { window.addEventListener('hashchange', handleHashChange); - return function () { + return () => { window.removeEventListener('hashchange', handleHashChange); }; } // Set up event listener / handler for user-input scroll events for standard scrolling pages - var handleScroll = function handleScroll() { - var scrollBreaks = sidebarLinks.map(function (link) { - return { - y: getSidebarLinkScrollPosition(link.hash || '#'), - hash: link.hash || '#' - }; - }); + const handleScroll = () => { + const scrollBreaks = sidebarLinks.map(link => ({ + y: getSidebarLinkScrollPosition(link.hash || '#'), + hash: link.hash || '#' + })); // Determine the current scrolled-to hash. If at the max scroll always go to the last hash. // Otherwise choose from scroll position relative to scroll breakpoints. - var detectionBuffer = 80; // Extra pixels to highlight the next link when we're close enough - var currentScrolledHash = isAtMaxScroll() ? scrollBreaks[scrollBreaks.length - 1].hash : scrollBreaks.reduce(function (acc, curr) { - return curr.y !== -1 && window.scrollY >= curr.y - detectionBuffer ? curr.hash : acc; - }, sidebarLinks[0].hash || '#'); + const detectionBuffer = 80; // Extra pixels to highlight the next link when we're close enough + const currentScrolledHash = isAtMaxScroll() ? scrollBreaks[scrollBreaks.length - 1].hash : scrollBreaks.reduce((acc, curr) => curr.y !== -1 && window.scrollY >= curr.y - detectionBuffer ? curr.hash : acc, sidebarLinks[0].hash || '#'); if (currentScrolledHash !== currentSidebarHash) { setCurrentSidebarHash(currentScrolledHash); } }; window.addEventListener('scroll', handleScroll); - return function () { + return () => { window.removeEventListener('scroll', handleScroll); }; }, [error, loading, sidebarLinks, sidebarHashMap, sidebarUnsticky, hasSidebarLinks, hashInitialized, setHashInitialized, currentSidebarHash, setCurrentSidebarHash, sidebarLinksContainerRef, getSidebarLinkScrollPosition, sidebarLinksAsStandaloneChildren]); @@ -494,11 +483,8 @@ var NeonPage = function NeonPage(props) { /** Effect - Load Drupal CSS */ - var _useState9 = (0, _react.useState)(_NeonContext.FETCH_STATUS.AWAITING_CALL), - _useState10 = _slicedToArray(_useState9, 2), - drupalCssStatus = _useState10[0], - setDrupalCssStatus = _useState10[1]; - (0, _react.useEffect)(function () { + const [drupalCssStatus, setDrupalCssStatus] = (0, _react.useState)(_NeonContext.FETCH_STATUS.AWAITING_CALL); + (0, _react.useEffect)(() => { if (!useSomeDrupalAssets) { setDrupalCssStatus(_NeonContext.FETCH_STATUS.SUCCESS); return; @@ -507,27 +493,26 @@ var NeonPage = function NeonPage(props) { return; } setDrupalCssStatus(_NeonContext.FETCH_STATUS.FETCHING); - fetch(_remoteAssetsMap.default[DRUPAL_THEME_CSS].url).then(function (response) { + fetch(_remoteAssetsMap.default[DRUPAL_THEME_CSS].url).then(response => { if (!response.ok) { throw new Error('Failed to fetch Drupal theme CSS'); } return response.text(); - }).then(function (data) { - var drupalStyle = document.createElement('style'); - var appliedData = _DrupalAssetService.default.cleanCss(data, true); + }).then(data => { + const drupalStyle = document.createElement('style'); + const appliedData = _DrupalAssetService.default.cleanCss(data, true); drupalStyle.textContent = appliedData; document.head.appendChild(drupalStyle); try { - var existingBlock = document.head.querySelector('link[data-meta="drupal-theme"]'); + const existingBlock = document.head.querySelector('link[data-meta="drupal-theme"]'); if (typeof existingBlock !== 'undefined' && existingBlock !== null) { existingBlock.remove(); } } catch (e) { console.error(e); // eslint-disable-line no-console } - setDrupalCssStatus(_NeonContext.FETCH_STATUS.SUCCESS); - }).catch(function (err) { + }).catch(err => { // eslint-disable-next-line no-console console.error(err); setDrupalCssStatus(_NeonContext.FETCH_STATUS.SUCCESS); @@ -537,12 +522,12 @@ var NeonPage = function NeonPage(props) { /** Liferay Notifications */ - var cancellationSubject$ = new _rxjs.Subject(); - var notificationDismissals = cookies.get('dismissed-notifications') || []; - var initialFetchStatus = null; - var initialNotifications = []; + const cancellationSubject$ = new _rxjs.Subject(); + const notificationDismissals = cookies.get('dismissed-notifications') || []; + let initialFetchStatus = null; + let initialNotifications = []; if (notification !== null && notification.length) { - var notificationPropId = (0, _liferayNotificationsUtil.generateNotificationId)(notification); + const notificationPropId = (0, _liferayNotificationsUtil.generateNotificationId)(notification); initialFetchStatus = 'success'; initialNotifications = [{ id: notificationPropId, @@ -550,64 +535,52 @@ var NeonPage = function NeonPage(props) { dismissed: notificationDismissals.includes(notificationPropId) }]; } - var _useState11 = (0, _react.useState)(initialFetchStatus), - _useState12 = _slicedToArray(_useState11, 2), - fetchNotificationsStatus = _useState12[0], - setFetchNotificationsStatus = _useState12[1]; - var _useState13 = (0, _react.useState)(initialNotifications), - _useState14 = _slicedToArray(_useState13, 2), - notifications = _useState14[0], - setNotifications = _useState14[1]; + const [fetchNotificationsStatus, setFetchNotificationsStatus] = (0, _react.useState)(initialFetchStatus); + const [notifications, setNotifications] = (0, _react.useState)(initialNotifications); // Handle a successful response from the notifications endpoint - var handleFetchNotificationsSuccess = function handleFetchNotificationsSuccess(response) { + const handleFetchNotificationsSuccess = response => { setFetchNotificationsStatus('success'); if (!Array.isArray(response.notifications)) { return; } - setNotifications(response.notifications.map(function (message) { - var id = (0, _liferayNotificationsUtil.generateNotificationId)(message); - var dismissed = notificationDismissals.includes(id); + setNotifications(response.notifications.map(message => { + const id = (0, _liferayNotificationsUtil.generateNotificationId)(message); + const dismissed = notificationDismissals.includes(id); return { - id: id, - message: message, - dismissed: dismissed + id, + message, + dismissed }; })); }; // If the endpoint fails don't bother with any visible error. Just let it go. - var handleFetchNotificationsError = function handleFetchNotificationsError() { + const handleFetchNotificationsError = () => { setFetchNotificationsStatus('error'); setNotifications([]); }; - var handleHideNotifications = function handleHideNotifications() { - var updatedDismissals = notifications.map(function (n) { - return n.id; - }); + const handleHideNotifications = () => { + const updatedDismissals = notifications.map(n => n.id); cookies.set('dismissed-notifications', updatedDismissals, { path: '/', maxAge: 86400 }); - setNotifications(notifications.map(function (n) { - return _extends({}, n, { - dismissed: true - }); - })); + setNotifications(notifications.map(n => _extends({}, n, { + dismissed: true + }))); }; - var handleShowNotifications = function handleShowNotifications() { + const handleShowNotifications = () => { cookies.remove('dismissed-notifications'); - setNotifications(notifications.map(function (n) { - return _extends({}, n, { - dismissed: false - }); - })); + setNotifications(notifications.map(n => _extends({}, n, { + dismissed: false + }))); }; /** Effect - Fetch notifications */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (fetchNotificationsStatus !== null) { return; } @@ -618,7 +591,7 @@ var NeonPage = function NeonPage(props) { /** Render functions */ - var renderTitle = function renderTitle() { + const renderTitle = () => { if ((loading || error) && !title) { return /*#__PURE__*/_react.default.createElement(_Skeleton.default, { width: "45%", @@ -631,9 +604,9 @@ var NeonPage = function NeonPage(props) { if ((!title || !title.length) && !sidebarLinksAsStandaloneChildren) { return null; } - var titleString = title || ''; + let titleString = title || ''; if (sidebarLinksAsStandaloneChildren) { - var sidebarLink = sidebarLinks[sidebarHashMap[currentSidebarHash] || 0]; + const sidebarLink = sidebarLinks[sidebarHashMap[currentSidebarHash] || 0]; titleString = sidebarLink.pageTitle || sidebarLink.name; } return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, { @@ -648,79 +621,69 @@ var NeonPage = function NeonPage(props) { className: classes.pageSubtitle }, subtitle) : null); }; - var renderBreadcrumbs = function renderBreadcrumbs() { - return !breadcrumbs.length ? null : /*#__PURE__*/_react.default.createElement(_Breadcrumbs.default, { - "aria-label": "Breadcrumbs", - "data-selenium": "neon-page.breadcrumbs", - className: classes.breadcrumbs - }, /*#__PURE__*/_react.default.createElement(_Link.default, { - key: (0, _uniqueId.default)(), - href: breadcrumbHomeHref - }, /*#__PURE__*/_react.default.createElement(_Home.default, { - title: "Home", - fontSize: "small", - style: { - marginBottom: '-4px' - } - })), breadcrumbs.map(function (breadcrumb, idx) { - return idx !== breadcrumbs.length - 1 ? /*#__PURE__*/_react.default.createElement(_Link.default, { - key: (0, _uniqueId.default)(), - href: breadcrumb.href - }, breadcrumb.name) : /*#__PURE__*/_react.default.createElement(_Typography.default, { - key: "{idx}", - color: "textPrimary" - }, breadcrumb.name); - })); - }; - var renderOverlay = function renderOverlay(overlayChildren) { - return /*#__PURE__*/_react.default.createElement(_Backdrop.default, { - open: !overlayDismissed - }, /*#__PURE__*/_react.default.createElement(_Paper.default, { - className: classes.backdropPaper - }, overlayChildren, /*#__PURE__*/_react.default.createElement("div", { - className: classes.dismissOverlay - }, /*#__PURE__*/_react.default.createElement(_Button.default, { - size: "small", - startIcon: /*#__PURE__*/_react.default.createElement(_Clear.default, null), - variant: "outlined", - onClick: function onClick() { - setOverlayDismissed(true); - } - }, "Dismiss")))); - }; - var renderLoading = function renderLoading() { - return !loading || error ? null : renderOverlay( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "h5", - component: "h3", - gutterBottom: true - }, loading), progress === null ? /*#__PURE__*/_react.default.createElement(_CircularProgress.default, null) : /*#__PURE__*/_react.default.createElement(_CircularProgress.default, { - variant: "determinate", - value: progress - }))); - }; - var renderError = function renderError() { - return !error ? null : renderOverlay( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Warning.default, { - fontSize: "large", - color: "error" - }), /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "h5", - component: "h3", - style: { - marginTop: _Theme.default.spacing(1) - } - }, error))); - }; - var renderSidebar = function renderSidebar() { + const renderBreadcrumbs = () => !breadcrumbs.length ? null : /*#__PURE__*/_react.default.createElement(_Breadcrumbs.default, { + "aria-label": "Breadcrumbs", + "data-selenium": "neon-page.breadcrumbs", + className: classes.breadcrumbs + }, /*#__PURE__*/_react.default.createElement(_Link.default, { + key: (0, _uniqueId.default)(), + href: breadcrumbHomeHref + }, /*#__PURE__*/_react.default.createElement(_Home.default, { + title: "Home", + fontSize: "small", + style: { + marginBottom: '-4px' + } + })), breadcrumbs.map((breadcrumb, idx) => idx !== breadcrumbs.length - 1 ? /*#__PURE__*/_react.default.createElement(_Link.default, { + key: (0, _uniqueId.default)(), + href: breadcrumb.href + }, breadcrumb.name) : /*#__PURE__*/_react.default.createElement(_Typography.default, { + key: "{idx}", + color: "textPrimary" + }, breadcrumb.name))); + const renderOverlay = overlayChildren => /*#__PURE__*/_react.default.createElement(_Backdrop.default, { + open: !overlayDismissed + }, /*#__PURE__*/_react.default.createElement(_Paper.default, { + className: classes.backdropPaper + }, overlayChildren, /*#__PURE__*/_react.default.createElement("div", { + className: classes.dismissOverlay + }, /*#__PURE__*/_react.default.createElement(_Button.default, { + size: "small", + startIcon: /*#__PURE__*/_react.default.createElement(_Clear.default, null), + variant: "outlined", + onClick: () => { + setOverlayDismissed(true); + } + }, "Dismiss")))); + const renderLoading = () => !loading || error ? null : renderOverlay( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "h5", + component: "h3", + gutterBottom: true + }, loading), progress === null ? /*#__PURE__*/_react.default.createElement(_CircularProgress.default, null) : /*#__PURE__*/_react.default.createElement(_CircularProgress.default, { + variant: "determinate", + value: progress + }))); + const renderError = () => !error ? null : renderOverlay( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Warning.default, { + fontSize: "large", + color: "error" + }), /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "h5", + component: "h3", + style: { + marginTop: _Theme.default.spacing(1) + } + }, error))); + const renderSidebar = () => { if (!hasSidebar) { return null; } - var sidebarContainerStyle = belowMd ? {} : { + const sidebarContainerStyle = belowMd ? {} : { width: "".concat(sidebarWidth, "px") }; - var dividerStyle = !belowMd ? { + const dividerStyle = !belowMd ? { width: "".concat(sidebarWidth - _Theme.default.spacing(8), "px") } : {}; - var sidebarClassName = sidebarContainerClassNameProp ? "".concat(classes.sidebarContainer, " ").concat(sidebarContainerClassNameProp) : classes.sidebarContainer; + const sidebarClassName = sidebarContainerClassNameProp ? "".concat(classes.sidebarContainer, " ").concat(sidebarContainerClassNameProp) : classes.sidebarContainer; // Arbitrary Content Sidebar (no automatic skeleton) if (hasSidebarContent) { return /*#__PURE__*/_react.default.createElement("div", { @@ -730,7 +693,7 @@ var NeonPage = function NeonPage(props) { }, sidebarContent); } // Render Sidebar Title - var renderSidebarTitle = function renderSidebarTitle() { + const renderSidebarTitle = () => { if (!sidebarTitle && !title) { return null; } @@ -759,15 +722,16 @@ var NeonPage = function NeonPage(props) { }, sidebarSubtitle))); }; // Render Single Sidebar Link - var renderLink = function renderLink(link) { - var standalone = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const renderLink = function (link) { + let standalone = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!link) { return null; } - var name = link.name, - _link$hash = link.hash, - hash = _link$hash === void 0 ? '#' : _link$hash, - IconComponent = link.icon; + const { + name, + hash = '#', + icon: IconComponent + } = link; if (loading || error) { return /*#__PURE__*/_react.default.createElement(_Skeleton.default, { key: name, @@ -778,13 +742,13 @@ var NeonPage = function NeonPage(props) { } }); } - var icon = IconComponent ? /*#__PURE__*/_react.default.createElement(IconComponent, { + const icon = IconComponent ? /*#__PURE__*/_react.default.createElement(IconComponent, { className: classes.sidebarLinkIcon }) : null; return /*#__PURE__*/_react.default.createElement(_Link.default, { key: name, href: hash, - onClick: sidebarLinksAsStandaloneChildren ? function () { + onClick: sidebarLinksAsStandaloneChildren ? () => { setCurrentSidebarHash(hash); if (sidebarExpanded) { setSidebarExpanded(false); @@ -796,18 +760,16 @@ var NeonPage = function NeonPage(props) { } : {} }, icon, name); }; - var fullLinks = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", { + const fullLinks = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", { ref: sidebarLinksContainerRef, className: classes.sidebarLinksContainer - }, sidebarLinks.map(function (link) { - return renderLink(link); - })), belowMd ? null : /*#__PURE__*/_react.default.createElement(_Divider.default, { + }, sidebarLinks.map(link => renderLink(link))), belowMd ? null : /*#__PURE__*/_react.default.createElement(_Divider.default, { className: classes.sidebarDivider, style: _extends({ marginBottom: '0px' }, dividerStyle) })); - var currentLinkOnly = /*#__PURE__*/_react.default.createElement("div", { + const currentLinkOnly = /*#__PURE__*/_react.default.createElement("div", { className: classes.sidebarLinksContainer }, renderLink(sidebarLinks[sidebarHashMap[currentSidebarHash]], true)); return /*#__PURE__*/_react.default.createElement("div", { @@ -820,9 +782,7 @@ var NeonPage = function NeonPage(props) { className: classes.sidebarTitleContainer }, renderSidebarTitle(), !belowMd ? null : /*#__PURE__*/_react.default.createElement(_IconButton.default, { size: "small", - onClick: function onClick() { - return setSidebarExpanded(!sidebarExpanded); - } + onClick: () => setSidebarExpanded(!sidebarExpanded) }, sidebarExpanded ? /*#__PURE__*/_react.default.createElement(_ExpandLess.default, { fontSize: "large" }) : /*#__PURE__*/_react.default.createElement(_ExpandMore.default, { @@ -835,14 +795,14 @@ var NeonPage = function NeonPage(props) { style: _extends({}, dividerStyle) })) : null, belowMd && !sidebarExpanded ? currentLinkOnly : fullLinks)); }; - var renderNeonPage = function renderNeonPage() { - var outerPageContainerStyles = {}; + const renderNeonPage = () => { + const outerPageContainerStyles = {}; if (outerPageContainerMaxWidth) { outerPageContainerStyles.maxWidth = !hasSidebar || belowMd ? outerPageContainerMaxWidth : "calc(".concat(outerPageContainerMaxWidth, " - ").concat(sidebarWidth + 48, "px)"); } - var content = children; + let content = children; if (hasSidebarLinks && sidebarLinksAsStandaloneChildren) { - var CurrentComponent = sidebarLinks[sidebarHashMap[currentSidebarHash] || 0].component; + const CurrentComponent = sidebarLinks[sidebarHashMap[currentSidebarHash] || 0].component; content = /*#__PURE__*/_react.default.createElement(CurrentComponent, null); } return /*#__PURE__*/_react.default.createElement(_styles2.ThemeProvider, { @@ -874,7 +834,7 @@ var NeonPage = function NeonPage(props) { showSkeleton: showFooterSkeleton }), renderLoading(), renderError()); }; - var renderedPage = neonContextIsActive ? renderNeonPage() : /*#__PURE__*/_react.default.createElement(_NeonContext.default.Provider, _extends({ + const renderedPage = neonContextIsActive ? renderNeonPage() : /*#__PURE__*/_react.default.createElement(_NeonContext.default.Provider, _extends({ useCoreAuth: true, fetchPartials: useSomeDrupalAssets }, NeonContextProviderProps), renderNeonPage()); @@ -883,7 +843,7 @@ var NeonPage = function NeonPage(props) { onReset: resetStateAfterRuntimeError }, renderedPage); }; -var children = _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string])), _propTypes.default.node, _propTypes.default.string]); +const children = _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string])), _propTypes.default.node, _propTypes.default.string]); NeonPage.propTypes = { breadcrumbHomeHref: _propTypes.default.string, breadcrumbs: _propTypes.default.arrayOf(_propTypes.default.shape({ @@ -933,7 +893,7 @@ NeonPage.defaultProps = { notification: null, outerPageContainerMaxWidth: '2000px', progress: null, - resetStateAfterRuntimeError: function resetStateAfterRuntimeError() {}, + resetStateAfterRuntimeError: () => {}, sidebarContent: null, sidebarContainerClassName: null, sidebarLinks: null, @@ -948,5 +908,4 @@ NeonPage.defaultProps = { unstickyDrupalHeader: true, NeonContextProviderProps: {} }; -var _default = NeonPage; -exports.default = _default; \ No newline at end of file +var _default = exports.default = NeonPage; \ No newline at end of file diff --git a/lib/components/NeonPage/index.js b/lib/components/NeonPage/index.js index 2111ee7e..008c82e8 100644 --- a/lib/components/NeonPage/index.js +++ b/lib/components/NeonPage/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _NeonPage.default; } }); diff --git a/lib/components/NeonRouter/NeonRouter.js b/lib/components/NeonRouter/NeonRouter.js index c25cd86f..fa647542 100644 --- a/lib/components/NeonRouter/NeonRouter.js +++ b/lib/components/NeonRouter/NeonRouter.js @@ -11,14 +11,16 @@ var _historyUtil = _interopRequireDefault(require("../../util/historyUtil")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /* eslint-disable react/require-default-props */ -var NeonRouter = function NeonRouter(props) { - var cleanPath = props.cleanPath, - disableRedirect = props.disableRedirect, - children = props.children; +const NeonRouter = props => { + const { + cleanPath, + disableRedirect, + children + } = props; if (cleanPath !== false) { _historyUtil.default.cleanPath(); } - var renderFallthrough = function renderFallthrough() { + const renderFallthrough = () => { if (disableRedirect === true) { return children; } @@ -34,5 +36,4 @@ var NeonRouter = function NeonRouter(props) { element: renderFallthrough() }))); }; -var _default = NeonRouter; -exports.default = _default; \ No newline at end of file +var _default = exports.default = NeonRouter; \ No newline at end of file diff --git a/lib/components/NeonRouter/index.js b/lib/components/NeonRouter/index.js index b24f0ae1..b3ca7097 100644 --- a/lib/components/NeonRouter/index.js +++ b/lib/components/NeonRouter/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _NeonRouter.default; } }); diff --git a/lib/components/NeonSignInButton/NeonSignInButton.js b/lib/components/NeonSignInButton/NeonSignInButton.js index 410f336b..6aacae3e 100644 --- a/lib/components/NeonSignInButton/NeonSignInButton.js +++ b/lib/components/NeonSignInButton/NeonSignInButton.js @@ -11,20 +11,18 @@ var _AuthService = _interopRequireDefault(require("../NeonAuth/AuthService")); var _NeonEnvironment = _interopRequireDefault(require("../NeonEnvironment/NeonEnvironment")); var _NeonSignInButtonState = _interopRequireDefault(require("./NeonSignInButtonState")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - signInButton: { - margin: theme.spacing(2) - } - }; -}); -var handleButtonClick = function handleButtonClick() { +const useStyles = (0, _styles.makeStyles)(theme => ({ + signInButton: { + margin: theme.spacing(2) + } +})); +const handleButtonClick = () => { // Notify observers the sign in button has been clicked. _NeonSignInButtonState.default.sendNotification(); _AuthService.default.login(_NeonEnvironment.default.getFullAuthPath('login'), _AuthService.default.getLoginRedirectUri()); }; function NeonSignInButton() { - var classes = useStyles(); + const classes = useStyles(); return /*#__PURE__*/_react.default.createElement(_Button.default, { variant: "contained", className: classes.signInButton, diff --git a/lib/components/NeonSignInButton/NeonSignInButtonState.js b/lib/components/NeonSignInButton/NeonSignInButtonState.js index 8a3714ae..353bfa67 100644 --- a/lib/components/NeonSignInButton/NeonSignInButtonState.js +++ b/lib/components/NeonSignInButton/NeonSignInButtonState.js @@ -6,24 +6,17 @@ Object.defineProperty(exports, "__esModule", { exports.default = void 0; var _rxjs = require("rxjs"); // Instantiate the subject and observable. -var subject = new _rxjs.Subject(); -var observable = subject.asObservable(); +const subject = new _rxjs.Subject(); +const observable = subject.asObservable(); /** * Interface for sharing sign in button state. */ -var NeonSignInButtonState = { - getSubject: function getSubject() { - return subject; - }, - sendNotification: function sendNotification() { - return subject.next(); - }, - getObservable: function getObservable() { - return observable; - } +const NeonSignInButtonState = { + getSubject: () => subject, + sendNotification: () => subject.next(), + getObservable: () => observable }; Object.freeze(NeonSignInButtonState); -var _default = NeonSignInButtonState; -exports.default = _default; \ No newline at end of file +var _default = exports.default = NeonSignInButtonState; \ No newline at end of file diff --git a/lib/components/ReleaseFilter/ReleaseFilter.js b/lib/components/ReleaseFilter/ReleaseFilter.js index ec32f3d4..54e86e09 100644 --- a/lib/components/ReleaseFilter/ReleaseFilter.js +++ b/lib/components/ReleaseFilter/ReleaseFilter.js @@ -24,144 +24,123 @@ var _InfoOutlined = _interopRequireDefault(require("@material-ui/icons/InfoOutli var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _RouteService = _interopRequireDefault(require("../../service/RouteService")); var _ReleaseService = _interopRequireDefault(require("../../service/ReleaseService")); -var _excluded = ["excludeNullRelease", "horizontal", "maxWidth", "nullReleaseProductCount", "onChange", "releases", "selected", "showDoi", "showGenerationDate", "showProductCount", "showReleaseLink", "releaseLinkDisplayType", "skeleton", "title"]; +const _excluded = ["excludeNullRelease", "horizontal", "maxWidth", "nullReleaseProductCount", "onChange", "releases", "selected", "showDoi", "showGenerationDate", "showProductCount", "showReleaseLink", "releaseLinkDisplayType", "skeleton", "title"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - title: { - fontWeight: 500 - }, - titleContainer: { - display: 'flex', - alignItems: 'center', - justifyContent: 'flex-start', - marginBottom: theme.spacing(1) - }, - selectInput: { - width: '100%', - marginBottom: theme.spacing(0.5), - backgroundColor: '#fff' - }, - descriptionContainer: { - marginTop: theme.spacing(0.5) - }, - releaseLinkDescriptionContainer: { - marginTop: theme.spacing(0.7) - }, - releaseLinkAltDescriptionContainer: { - marginTop: theme.spacing(1.2) - }, - descriptionFlexInnerContainer: { - display: 'flex', - alignItems: 'flex-start', - justifyContent: 'flex-start' - }, - description: { - display: 'block', - color: theme.palette.grey[400], - overflowWrap: 'break-word' - }, - descriptionLabel: { - fontWeight: 700, - color: theme.palette.grey[400], - marginRight: theme.spacing(1) - }, - copyButton: { - marginTop: theme.spacing(1), - backgroundColor: '#fff', - '& svg': { - width: '0.9rem', - height: '0.9rem' - } - }, - copyButtonAdornment: { - padding: _Theme.default.spacing(1.25, 1), - backgroundColor: '#fff', - marginRight: _Theme.default.spacing(-1.75), - '& svg': { - width: '0.9rem', - height: '0.9rem' - } - }, - menuItemSubtitle: { - color: theme.palette.grey[400] - }, - horizontalFlex: { - display: 'flex', - alignItems: 'flex-start', - justifyContent: 'flex-start' - }, - horizontalDescriptions: { - marginLeft: _Theme.default.spacing(3), - '& > div:first-child': { - marginTop: '-2px !important' - } - }, - releaseLinkButton: { - width: '100%' +const useStyles = (0, _styles.makeStyles)(theme => ({ + title: { + fontWeight: 500 + }, + titleContainer: { + display: 'flex', + alignItems: 'center', + justifyContent: 'flex-start', + marginBottom: theme.spacing(1) + }, + selectInput: { + width: '100%', + marginBottom: theme.spacing(0.5), + backgroundColor: '#fff' + }, + descriptionContainer: { + marginTop: theme.spacing(0.5) + }, + releaseLinkDescriptionContainer: { + marginTop: theme.spacing(0.7) + }, + releaseLinkAltDescriptionContainer: { + marginTop: theme.spacing(1.2) + }, + descriptionFlexInnerContainer: { + display: 'flex', + alignItems: 'flex-start', + justifyContent: 'flex-start' + }, + description: { + display: 'block', + color: theme.palette.grey[400], + overflowWrap: 'break-word' + }, + descriptionLabel: { + fontWeight: 700, + color: theme.palette.grey[400], + marginRight: theme.spacing(1) + }, + copyButton: { + marginTop: theme.spacing(1), + backgroundColor: '#fff', + '& svg': { + width: '0.9rem', + height: '0.9rem' } - }; -}); -var UNSPECIFIED_NAME = 'Latest and Provisional'; -var UNSPECIFIED_DESCRIPTION = 'Data in the latest release in addition to provisional data (not yet in any release)'; -var DOI_TITLE = 'Digital Object Identifier (DOI) - A citable permanent link to this this data product release'; -var formatGenerationDate = function formatGenerationDate(generationDate) { - var generationMoment = _moment.default.utc(generationDate); + }, + copyButtonAdornment: { + padding: _Theme.default.spacing(1.25, 1), + backgroundColor: '#fff', + marginRight: _Theme.default.spacing(-1.75), + '& svg': { + width: '0.9rem', + height: '0.9rem' + } + }, + menuItemSubtitle: { + color: theme.palette.grey[400] + }, + horizontalFlex: { + display: 'flex', + alignItems: 'flex-start', + justifyContent: 'flex-start' + }, + horizontalDescriptions: { + marginLeft: _Theme.default.spacing(3), + '& > div:first-child': { + marginTop: '-2px !important' + } + }, + releaseLinkButton: { + width: '100%' + } +})); +const UNSPECIFIED_NAME = 'Latest and Provisional'; +const UNSPECIFIED_DESCRIPTION = 'Data in the latest release in addition to provisional data (not yet in any release)'; +const DOI_TITLE = 'Digital Object Identifier (DOI) - A citable permanent link to this this data product release'; +const formatGenerationDate = generationDate => { + const generationMoment = _moment.default.utc(generationDate); return generationMoment.isValid() ? generationMoment.format('MMMM D, YYYY') : null; }; -var ReleaseFilter = function ReleaseFilter(props) { - var classes = useStyles(_Theme.default); - var excludeNullRelease = props.excludeNullRelease, - horizontal = props.horizontal, - maxWidth = props.maxWidth, - nullReleaseProductCount = props.nullReleaseProductCount, - onChange = props.onChange, - releasesProp = props.releases, - selected = props.selected, - showDoi = props.showDoi, - showGenerationDate = props.showGenerationDate, - showProductCount = props.showProductCount, - showReleaseLink = props.showReleaseLink, - releaseLinkDisplayType = props.releaseLinkDisplayType, - skeleton = props.skeleton, - title = props.title, - otherProps = _objectWithoutProperties(props, _excluded); - var _useId = (0, _reactIdGenerator.useId)(), - _useId2 = _slicedToArray(_useId, 1), - instanceId = _useId2[0]; - var inputId = "release-filter-input-".concat(instanceId); - var labelId = "release-filter-label-".concat(instanceId); - var releases = _toConsumableArray(releasesProp).sort(function (a, b) { - return a.generationDate > b.generationDate ? -1 : 1; - }); +const ReleaseFilter = props => { + const classes = useStyles(_Theme.default); + const { + excludeNullRelease, + horizontal, + maxWidth, + nullReleaseProductCount, + onChange, + releases: releasesProp, + selected, + showDoi, + showGenerationDate, + showProductCount, + showReleaseLink, + releaseLinkDisplayType, + skeleton, + title + } = props, + otherProps = _objectWithoutPropertiesLoose(props, _excluded); + const [instanceId] = (0, _reactIdGenerator.useId)(); + const inputId = "release-filter-input-".concat(instanceId); + const labelId = "release-filter-label-".concat(instanceId); + const releases = [...releasesProp].sort((a, b) => a.generationDate > b.generationDate ? -1 : 1); // SANITY CHECK: Render nothing if there are no releases and null release is excluded - var optionCount = releases.length + (excludeNullRelease ? 0 : 1); + const optionCount = releases.length + (excludeNullRelease ? 0 : 1); if (!optionCount) { return null; } - var findReleaseObject = function findReleaseObject(release) { - return releases.find(function (r) { - return r.release === release; - }) || null; - }; - var findRelease = function findRelease(release) { - return (findReleaseObject(release) || {}).release || null; - }; - var getProductCount = function getProductCount(release) { + const findReleaseObject = release => releases.find(r => r.release === release) || null; + const findRelease = release => (findReleaseObject(release) || {}).release || null; + const getProductCount = release => { if (Array.isArray(release.dataProducts)) { return release.dataProducts.length; } @@ -170,38 +149,38 @@ var ReleaseFilter = function ReleaseFilter(props) { } return null; }; - var selectedRelease = findRelease(selected); + let selectedRelease = findRelease(selected); if (!selectedRelease && excludeNullRelease) { selectedRelease = releases[0].release; } - var selectedReleaseObject = findReleaseObject(selectedRelease); - var handleChange = function handleChange(newRelease) { - var validatedNewRelease = newRelease === UNSPECIFIED_NAME ? null : findRelease(newRelease); + const selectedReleaseObject = findReleaseObject(selectedRelease); + const handleChange = newRelease => { + const validatedNewRelease = newRelease === UNSPECIFIED_NAME ? null : findRelease(newRelease); if (validatedNewRelease === selectedRelease) { return; } onChange(validatedNewRelease); }; - var maxWidthStyle = maxWidth ? { + const maxWidthStyle = maxWidth ? { maxWidth: "".concat(maxWidth, "px") } : { width: '100%' }; - var input = /*#__PURE__*/_react.default.createElement(_OutlinedInput.default, { + const input = /*#__PURE__*/_react.default.createElement(_OutlinedInput.default, { id: inputId, name: inputId, margin: "dense", className: classes.selectInput, style: maxWidthStyle }); - var releasesLink = /*#__PURE__*/_react.default.createElement(_Link.default, { + const releasesLink = /*#__PURE__*/_react.default.createElement(_Link.default, { href: _RouteService.default.getDataRevisionsReleasePath(), target: "_blank" }, "Data Product Revisions and Releases"); /* eslint-disable react/jsx-one-expression-per-line */ - var tooltip = /*#__PURE__*/_react.default.createElement("div", null, "A data release is a set of data files that is static (unchanging), always available to end users, and citable. See ", releasesLink, " for more details."); + const tooltip = /*#__PURE__*/_react.default.createElement("div", null, "A data release is a set of data files that is static (unchanging), always available to end users, and citable. See ", releasesLink, " for more details."); /* eslint-enable react/jsx-one-expression-per-line */ - var titleNode = !title ? null : /*#__PURE__*/_react.default.createElement("div", { + const titleNode = !title ? null : /*#__PURE__*/_react.default.createElement("div", { className: classes.titleContainer }, /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "h5", @@ -224,7 +203,7 @@ var ReleaseFilter = function ReleaseFilter(props) { // Render skeleton if (skeleton) { - var skeletonStyle = { + const skeletonStyle = { marginBottom: _Theme.default.spacing(1) }; return /*#__PURE__*/_react.default.createElement("div", _extends({}, otherProps, { @@ -244,7 +223,7 @@ var ReleaseFilter = function ReleaseFilter(props) { } // Unspecified Node - var unspecifiedNode = selectedRelease !== null ? null : /*#__PURE__*/_react.default.createElement("div", { + const unspecifiedNode = selectedRelease !== null ? null : /*#__PURE__*/_react.default.createElement("div", { className: classes.descriptionContainer }, /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "caption", @@ -252,7 +231,7 @@ var ReleaseFilter = function ReleaseFilter(props) { }, UNSPECIFIED_DESCRIPTION)); // Generation Date Node - var generationDateNode = null; + let generationDateNode = null; if (showGenerationDate && selectedRelease !== null) { generationDateNode = /*#__PURE__*/_react.default.createElement("div", { className: classes.descriptionContainer @@ -263,7 +242,7 @@ var ReleaseFilter = function ReleaseFilter(props) { } // Product Count Node - var productCountNode = null; + let productCountNode = null; if (showProductCount) { if (selectedRelease === null) { productCountNode = nullReleaseProductCount === null ? null : /*#__PURE__*/_react.default.createElement("div", { @@ -273,7 +252,7 @@ var ReleaseFilter = function ReleaseFilter(props) { className: classes.description }, "".concat(nullReleaseProductCount, " data products"))); } else { - var productCount = getProductCount(selectedReleaseObject); + const productCount = getProductCount(selectedReleaseObject); productCountNode = /*#__PURE__*/_react.default.createElement("div", { className: classes.descriptionContainer }, /*#__PURE__*/_react.default.createElement(_Typography.default, { @@ -282,17 +261,17 @@ var ReleaseFilter = function ReleaseFilter(props) { }, productCount !== null ? "".concat(productCount, " data products") : 'Unknown data product count')); } } - var releaseLinkNode = null; + let releaseLinkNode = null; if (showReleaseLink && !_ReleaseService.default.isLatestNonProv(selectedRelease)) { - var appliedRelease = null; - var hasSelectedRelease = selectedRelease !== null; + let appliedRelease = null; + const hasSelectedRelease = selectedRelease !== null; if (!hasSelectedRelease) { appliedRelease = _ReleaseService.default.getMostRecentReleaseTag(releases); } else { appliedRelease = selectedRelease; } if (appliedRelease !== null) { - var releaseLinkTooltip = 'Click to view general information about all data products in the ' + "".concat(appliedRelease, " release"); + const releaseLinkTooltip = 'Click to view general information about all data products in the ' + "".concat(appliedRelease, " release"); switch (releaseLinkDisplayType) { case 'Link': releaseLinkNode = /*#__PURE__*/_react.default.createElement("div", { @@ -324,9 +303,9 @@ var ReleaseFilter = function ReleaseFilter(props) { } // DOI Node - var doiNode = null; + let doiNode = null; if (showDoi && selectedRelease !== null) { - var doiUrl = (selectedReleaseObject.productDoi || {}).url || null; + const doiUrl = (selectedReleaseObject.productDoi || {}).url || null; doiNode = /*#__PURE__*/_react.default.createElement("div", { className: classes.descriptionContainer }, /*#__PURE__*/_react.default.createElement("div", { @@ -362,32 +341,30 @@ var ReleaseFilter = function ReleaseFilter(props) { } // Select Node - var menuItemSubtitleProps = { + const menuItemSubtitleProps = { display: 'block', variant: 'caption', className: classes.menuItemSubtitle }; - var selectNode = /*#__PURE__*/_react.default.createElement(_Select.default, { + const selectNode = /*#__PURE__*/_react.default.createElement(_Select.default, { "data-selenium": "release-filter", value: selectedRelease || UNSPECIFIED_NAME, - onChange: function onChange(event) { - return handleChange(event.target.value); - }, + onChange: event => handleChange(event.target.value), input: input, "aria-labelledby": labelId, - renderValue: function renderValue(value) { - return value; - }, + renderValue: value => value, disabled: optionCount < 2 }, excludeNullRelease ? null : /*#__PURE__*/_react.default.createElement(_MenuItem.default, { value: UNSPECIFIED_NAME }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, { display: "block" - }, UNSPECIFIED_NAME), /*#__PURE__*/_react.default.createElement(_Typography.default, menuItemSubtitleProps, UNSPECIFIED_DESCRIPTION), !showProductCount || nullReleaseProductCount === null ? null : /*#__PURE__*/_react.default.createElement(_Typography.default, menuItemSubtitleProps, "".concat(nullReleaseProductCount, " data products")))), releases.map(function (entry) { - var release = entry.release, - generationDate = entry.generationDate; - var productCount = getProductCount(entry); - var productCountSubtitle = productCount !== null ? "".concat(productCount, " data products") : 'Unknown data product count'; + }, UNSPECIFIED_NAME), /*#__PURE__*/_react.default.createElement(_Typography.default, menuItemSubtitleProps, UNSPECIFIED_DESCRIPTION), !showProductCount || nullReleaseProductCount === null ? null : /*#__PURE__*/_react.default.createElement(_Typography.default, menuItemSubtitleProps, "".concat(nullReleaseProductCount, " data products")))), releases.map(entry => { + const { + release, + generationDate + } = entry; + const productCount = getProductCount(entry); + const productCountSubtitle = productCount !== null ? "".concat(productCount, " data products") : 'Unknown data product count'; return /*#__PURE__*/_react.default.createElement(_MenuItem.default, { key: release, value: release @@ -440,7 +417,7 @@ ReleaseFilter.defaultProps = { horizontal: false, maxWidth: null, nullReleaseProductCount: null, - onChange: function onChange() {}, + onChange: () => {}, releases: [], selected: null, showDoi: false, @@ -451,6 +428,5 @@ ReleaseFilter.defaultProps = { skeleton: false, title: 'Release' }; -var WrappedReleaseFilter = _Theme.default.getWrappedComponent(ReleaseFilter); -var _default = WrappedReleaseFilter; -exports.default = _default; \ No newline at end of file +const WrappedReleaseFilter = _Theme.default.getWrappedComponent(ReleaseFilter); +var _default = exports.default = WrappedReleaseFilter; \ No newline at end of file diff --git a/lib/components/SidebarFilter/SidebarFilter.js b/lib/components/SidebarFilter/SidebarFilter.js index 958cfb6c..2ba39a5c 100644 --- a/lib/components/SidebarFilter/SidebarFilter.js +++ b/lib/components/SidebarFilter/SidebarFilter.js @@ -17,103 +17,91 @@ var _Skeleton = _interopRequireDefault(require("@material-ui/lab/Skeleton")); var _InfoOutlined = _interopRequireDefault(require("@material-ui/icons/InfoOutlined")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _typeUtil = require("../../util/typeUtil"); -var _excluded = ["title", "skeleton", "selected", "values", "maxWidth", "horizontal", "onChange", "tooltipText", "helperText"]; +const _excluded = ["title", "skeleton", "selected", "values", "maxWidth", "horizontal", "onChange", "tooltipText", "helperText"]; /* eslint-disable react/jsx-no-useless-fragment */ /* eslint-disable react/require-default-props */ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - title: { - fontWeight: 500 - }, - titleContainer: { - display: 'flex', - alignItems: 'center', - justifyContent: 'flex-start', - marginBottom: muiTheme.spacing(1) - }, - selectInput: { - width: '100%', - marginBottom: muiTheme.spacing(0.5), - backgroundColor: '#fff' - }, - descriptionContainer: { - marginTop: muiTheme.spacing(0.5) - }, - descriptionFlexInnerContainer: { - display: 'flex', - alignItems: 'flex-start', - justifyContent: 'flex-start' - }, - description: { - display: 'block', - color: muiTheme.palette.grey[400], - overflowWrap: 'break-word' - }, - descriptionLabel: { - fontWeight: 700, - color: muiTheme.palette.grey[400], - marginRight: muiTheme.spacing(1) - }, - menuItemSubtitle: { - color: muiTheme.palette.grey[400] - }, - horizontalFlex: { - display: 'flex', - alignItems: 'flex-start', - justifyContent: 'flex-start' - }, - horizontalDescriptions: { - marginLeft: _Theme.default.spacing(3), - '& > div:first-child': { - marginTop: '-2px !important' - } - } - }) - ); -}); -var SidebarFilter = function SidebarFilter(props) { - var classes = useStyles(_Theme.default); - var title = props.title, - skeleton = props.skeleton, - selected = props.selected, - values = props.values, - maxWidth = props.maxWidth, - horizontal = props.horizontal, - onChange = props.onChange, - tooltipText = props.tooltipText, - helperText = props.helperText, - otherProps = _objectWithoutProperties(props, _excluded); - var _useId = (0, _reactIdGenerator.useId)(), - _useId2 = _slicedToArray(_useId, 1), - instanceId = _useId2[0]; - var selectSeleniumId = "sidebar-filter-select-selenium-".concat(instanceId); - var inputId = "sidebar-filter-input-".concat(instanceId); - var labelId = "sidebar-filter-label-".concat(instanceId); +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + title: { + fontWeight: 500 + }, + titleContainer: { + display: 'flex', + alignItems: 'center', + justifyContent: 'flex-start', + marginBottom: muiTheme.spacing(1) + }, + selectInput: { + width: '100%', + marginBottom: muiTheme.spacing(0.5), + backgroundColor: '#fff' + }, + descriptionContainer: { + marginTop: muiTheme.spacing(0.5) + }, + descriptionFlexInnerContainer: { + display: 'flex', + alignItems: 'flex-start', + justifyContent: 'flex-start' + }, + description: { + display: 'block', + color: muiTheme.palette.grey[400], + overflowWrap: 'break-word' + }, + descriptionLabel: { + fontWeight: 700, + color: muiTheme.palette.grey[400], + marginRight: muiTheme.spacing(1) + }, + menuItemSubtitle: { + color: muiTheme.palette.grey[400] + }, + horizontalFlex: { + display: 'flex', + alignItems: 'flex-start', + justifyContent: 'flex-start' + }, + horizontalDescriptions: { + marginLeft: _Theme.default.spacing(3), + '& > div:first-child': { + marginTop: '-2px !important' + } + } +})); +const SidebarFilter = props => { + const classes = useStyles(_Theme.default); + const { + title, + skeleton, + selected, + values, + maxWidth, + horizontal, + onChange, + tooltipText, + helperText + } = props, + otherProps = _objectWithoutPropertiesLoose(props, _excluded); + const [instanceId] = (0, _reactIdGenerator.useId)(); + const selectSeleniumId = "sidebar-filter-select-selenium-".concat(instanceId); + const inputId = "sidebar-filter-input-".concat(instanceId); + const labelId = "sidebar-filter-label-".concat(instanceId); // SANITY CHECK: Render nothing if there are no releases and null release is excluded - var optionCount = values.length + (values ? 0 : 1); + const optionCount = values.length + (values ? 0 : 1); if (!optionCount) { return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null); } - var handleChange = function handleChange(nextValue) { - return onChange(nextValue); - }; - var maxWidthStyle = maxWidth ? { + const handleChange = nextValue => onChange(nextValue); + const maxWidthStyle = maxWidth ? { maxWidth: "".concat(maxWidth, "px") } : {}; - var input = /*#__PURE__*/_react.default.createElement(_OutlinedInput.default, { + const input = /*#__PURE__*/_react.default.createElement(_OutlinedInput.default, { id: inputId, name: inputId, margin: "dense", @@ -122,9 +110,9 @@ var SidebarFilter = function SidebarFilter(props) { }); /* eslint-disable react/jsx-one-expression-per-line */ - var tooltip = !(0, _typeUtil.isStringNonEmpty)(tooltipText) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null) : /*#__PURE__*/_react.default.createElement("div", null, tooltipText); + const tooltip = !(0, _typeUtil.isStringNonEmpty)(tooltipText) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null) : /*#__PURE__*/_react.default.createElement("div", null, tooltipText); /* eslint-enable react/jsx-one-expression-per-line */ - var titleNode = !title ? null : /*#__PURE__*/_react.default.createElement("div", { + const titleNode = !title ? null : /*#__PURE__*/_react.default.createElement("div", { className: classes.titleContainer }, /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "h5", @@ -146,7 +134,7 @@ var SidebarFilter = function SidebarFilter(props) { // Render skeleton if (skeleton) { - var skeletonStyle = { + const skeletonStyle = { marginBottom: _Theme.default.spacing(1) }; return /*#__PURE__*/_react.default.createElement("div", _extends({}, otherProps, { @@ -165,24 +153,20 @@ var SidebarFilter = function SidebarFilter(props) { style: skeletonStyle })); } - var selectNode = /*#__PURE__*/_react.default.createElement(_Select.default, { + const selectNode = /*#__PURE__*/_react.default.createElement(_Select.default, { "data-selenium": selectSeleniumId, value: selected, - onChange: function onChange(event) { - return handleChange(event.target.value); - }, + onChange: event => handleChange(event.target.value), input: input, "aria-labelledby": labelId, disabled: optionCount < 2 - }, values.map(function (option) { - return /*#__PURE__*/_react.default.createElement(_MenuItem.default, { - key: option.value, - value: option.value - }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, { - display: "block" - }, option.title))); - })); - var renderHelperText = function renderHelperText() { + }, values.map(option => /*#__PURE__*/_react.default.createElement(_MenuItem.default, { + key: option.value, + value: option.value + }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, { + display: "block" + }, option.title))))); + const renderHelperText = () => { if (!(0, _typeUtil.isStringNonEmpty)(helperText)) { return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null); } @@ -209,5 +193,4 @@ var SidebarFilter = function SidebarFilter(props) { }, maxWidthStyle) }), titleNode, selectNode, renderHelperText()); }; -var _default = SidebarFilter; -exports.default = _default; \ No newline at end of file +var _default = exports.default = SidebarFilter; \ No newline at end of file diff --git a/lib/components/SidebarFilter/index.js b/lib/components/SidebarFilter/index.js index 3edee10e..563fd3c9 100644 --- a/lib/components/SidebarFilter/index.js +++ b/lib/components/SidebarFilter/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _SidebarFilter.default; } }); diff --git a/lib/components/SiteChip/SiteChip.js b/lib/components/SiteChip/SiteChip.js index 7c118f47..0939f16d 100644 --- a/lib/components/SiteChip/SiteChip.js +++ b/lib/components/SiteChip/SiteChip.js @@ -12,38 +12,35 @@ var _Avatar = _interopRequireDefault(require("@material-ui/core/Avatar")); var _Place = _interopRequireDefault(require("@material-ui/icons/Place")); var _Cancel = _interopRequireDefault(require("@material-ui/icons/Cancel")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); -var _excluded = ["label"]; +const _excluded = ["label"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - avatarLarge: { - '& svg': { - height: theme.spacing(3) - } +const useStyles = (0, _styles.makeStyles)(theme => ({ + avatarLarge: { + '& svg': { + height: theme.spacing(3) } - }; -}); -var useChipStyles = (0, _styles.makeStyles)(function (theme) { - return { - outlined: { - color: theme.palette.grey.A200 - }, - outlinedPrimary: { - color: theme.palette.primary.main - }, - outlinedSecondary: { - color: theme.palette.secondary.main - } - }; -}); -var SiteChip = function SiteChip(props) { - var classes = useStyles(_Theme.default); - var chipClasses = useChipStyles(_Theme.default); - var label = props.label, - otherProps = _objectWithoutProperties(props, _excluded); + } +})); +const useChipStyles = (0, _styles.makeStyles)(theme => ({ + outlined: { + color: theme.palette.grey.A200 + }, + outlinedPrimary: { + color: theme.palette.primary.main + }, + outlinedSecondary: { + color: theme.palette.secondary.main + } +})); +const SiteChip = props => { + const classes = useStyles(_Theme.default); + const chipClasses = useChipStyles(_Theme.default); + const { + label + } = props, + otherProps = _objectWithoutPropertiesLoose(props, _excluded); // Default optional props if (!otherProps.color) { @@ -68,7 +65,7 @@ var SiteChip = function SiteChip(props) { There is also no 'large' size despite having a small and medium, and we have use cases for large (see DataProductAvailability). */ - var avatarStyle = { + const avatarStyle = { width: '32px', height: '32px', marginLeft: '0px' @@ -86,9 +83,9 @@ var SiteChip = function SiteChip(props) { There is also 'large' size despite having a small and medium, and we have use cases for large (see DataProductAvailability). */ - var chipStyle = {}; - var deleteIconStyle = {}; - var avatarClass = null; + const chipStyle = {}; + const deleteIconStyle = {}; + let avatarClass = null; if (otherProps.size === 'large') { otherProps.size = null; // to prevent a PropTypes error in Mui/Chip avatarClass = classes.avatarLarge; @@ -117,6 +114,5 @@ var SiteChip = function SiteChip(props) { SiteChip.propTypes = { label: _propTypes.default.string.isRequired }; -var WrappedSiteChip = _Theme.default.getWrappedComponent(SiteChip); -var _default = WrappedSiteChip; -exports.default = _default; \ No newline at end of file +const WrappedSiteChip = _Theme.default.getWrappedComponent(SiteChip); +var _default = exports.default = WrappedSiteChip; \ No newline at end of file diff --git a/lib/components/SiteChip/index.js b/lib/components/SiteChip/index.js index 6cebd49e..9db490c1 100644 --- a/lib/components/SiteChip/index.js +++ b/lib/components/SiteChip/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _SiteChip.default; } }); diff --git a/lib/components/SiteMap/FetchLocationUtils.js b/lib/components/SiteMap/FetchLocationUtils.js index 904f91a3..b7a76927 100644 --- a/lib/components/SiteMap/FetchLocationUtils.js +++ b/lib/components/SiteMap/FetchLocationUtils.js @@ -10,79 +10,71 @@ var _NeonGraphQL = _interopRequireDefault(require("../NeonGraphQL/NeonGraphQL")) var _parseDomainHierarchy = _interopRequireDefault(require("../../workers/parseDomainHierarchy")); var _parseLocationsArray = _interopRequireDefault(require("../../workers/parseLocationsArray")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var domainIsValid = function domainIsValid(domainString) { +const domainIsValid = domainString => { if (typeof domainString !== 'string') { return false; } - var domainTest = /^D([0-9]{2})$/.exec(domainString); + const domainTest = /^D([0-9]{2})$/.exec(domainString); if (!domainTest) { return false; } - var domainNumber = Number.parseInt(domainTest[1], 10); + const domainNumber = Number.parseInt(domainTest[1], 10); if (Number.isNaN(domainNumber) || domainNumber < 1 || domainNumber > 20) { return false; } return true; }; -var fetchDomainHierarchy = function fetchDomainHierarchy() { - var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; +const fetchDomainHierarchy = function () { + let domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; if (!domainIsValid(domain)) { return Promise.reject(new Error('Domain is not valid')); } // Execute Locations REST API hierarchy fetch - return new Promise(function (resolve, reject) { - _NeonApi.default.getSiteLocationHierarchyObservable(domain).pipe((0, _rxjs.map)(function (response) { + return new Promise((resolve, reject) => { + _NeonApi.default.getSiteLocationHierarchyObservable(domain).pipe((0, _rxjs.map)(response => { if (response && response.data) { resolve(response.data); return (0, _rxjs.of)(true); } reject(new Error('Malformed response')); return (0, _rxjs.of)(false); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { reject(new Error(error.message)); return (0, _rxjs.of)(false); })).subscribe(); - }).then(function (data) { - return (0, _parseDomainHierarchy.default)(data); - }); + }).then(data => (0, _parseDomainHierarchy.default)(data)); }; exports.fetchDomainHierarchy = fetchDomainHierarchy; -var fetchSingleLocationREST = function fetchSingleLocationREST(location) { +const fetchSingleLocationREST = location => { if (typeof location !== 'string' || !location.length) { return Promise.reject(new Error('Location is not valid; must be non-empty string')); } // Execute REST query and pipe results to processing function - return new Promise(function (resolve, reject) { - _NeonApi.default.getLocationObservable(location).pipe((0, _rxjs.map)(function (response) { + return new Promise((resolve, reject) => { + _NeonApi.default.getLocationObservable(location).pipe((0, _rxjs.map)(response => { if (response && response.data) { resolve([response.data]); return (0, _rxjs.of)(true); } reject(new Error('Malformed response')); return (0, _rxjs.of)(false); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { reject(new Error(error.message)); return (0, _rxjs.of)(false); })).subscribe(); - }).then(function (data) { - return (0, _parseLocationsArray.default)(data); - }).then(function (locationMap) { - return (locationMap || {})[location]; - }); + }).then(data => (0, _parseLocationsArray.default)(data)).then(locationMap => (locationMap || {})[location]); }; exports.fetchSingleLocationREST = fetchSingleLocationREST; -var fetchManyLocationsGraphQL = function fetchManyLocationsGraphQL(locations) { +const fetchManyLocationsGraphQL = locations => { // Extract locations list and validate - if (!Array.isArray(locations) || !locations.length || !locations.every(function (loc) { - return typeof loc === 'string'; - })) { + if (!Array.isArray(locations) || !locations.length || !locations.every(loc => typeof loc === 'string')) { return Promise.reject(new Error('Locations list is not valid; must be non-empty array of only strings')); } // Execute GraphQL query and pipe results to processing function - return new Promise(function (resolve, reject) { + return new Promise((resolve, reject) => { _NeonGraphQL.default.getManyLocationsByName(locations).pipe( // Success - (0, _rxjs.map)(function (result) { + (0, _rxjs.map)(result => { if (!result.response || !result.response.data || !Array.isArray(result.response.data.locations)) { reject(new Error('Malformed response')); return (0, _rxjs.of)(false); @@ -91,20 +83,16 @@ var fetchManyLocationsGraphQL = function fetchManyLocationsGraphQL(locations) { return (0, _rxjs.of)(true); }), // Error - (0, _rxjs.catchError)(function (error) { + (0, _rxjs.catchError)(error => { reject(new Error(error.message)); return (0, _rxjs.of)(false); })).subscribe(); - }).then(function (data) { - return (0, _parseLocationsArray.default)(data); - }); + }).then(data => (0, _parseLocationsArray.default)(data)); }; // Additional items exported for unit testing exports.fetchManyLocationsGraphQL = fetchManyLocationsGraphQL; -var getTestableItems = function getTestableItems() { - return process.env.NODE_ENV !== 'test' ? {} : { - domainIsValid: domainIsValid - }; +const getTestableItems = () => process.env.NODE_ENV !== 'test' ? {} : { + domainIsValid }; exports.getTestableItems = getTestableItems; \ No newline at end of file diff --git a/lib/components/SiteMap/SiteMap.js b/lib/components/SiteMap/SiteMap.js index 79170ad1..c25380d4 100644 --- a/lib/components/SiteMap/SiteMap.js +++ b/lib/components/SiteMap/SiteMap.js @@ -11,12 +11,12 @@ var _SiteMapContext = _interopRequireDefault(require("./SiteMapContext")); var _SiteMapContainer = _interopRequireDefault(require("./SiteMapContainer")); var _SiteMapUtils = require("./SiteMapUtils"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var SiteMap = function SiteMap(props) { +const SiteMap = props => { // no need to store this in state, just pass it thru - var _props$unusableVertic = props.unusableVerticalSpace, - unusableVerticalSpace = _props$unusableVertic === void 0 ? 0 : _props$unusableVertic, - _props$mapUniqueId = props.mapUniqueId, - mapUniqueId = _props$mapUniqueId === void 0 ? 0 : _props$mapUniqueId; + const { + unusableVerticalSpace = 0, + mapUniqueId = 0 + } = props; return /*#__PURE__*/_react.default.createElement(_SiteMapContext.default.Provider, props, /*#__PURE__*/_react.default.createElement(_SiteMapContainer.default, { unusableVerticalSpace: unusableVerticalSpace, mapUniqueId: mapUniqueId @@ -24,6 +24,5 @@ var SiteMap = function SiteMap(props) { }; SiteMap.propTypes = _SiteMapUtils.SITE_MAP_PROP_TYPES; SiteMap.defaultProps = _SiteMapUtils.SITE_MAP_DEFAULT_PROPS; -var WrappedSiteMap = _Theme.default.getWrappedComponent(_NeonContext.default.getWrappedComponent(SiteMap)); -var _default = WrappedSiteMap; -exports.default = _default; \ No newline at end of file +const WrappedSiteMap = _Theme.default.getWrappedComponent(_NeonContext.default.getWrappedComponent(SiteMap)); +var _default = exports.default = WrappedSiteMap; \ No newline at end of file diff --git a/lib/components/SiteMap/SiteMapContainer.js b/lib/components/SiteMap/SiteMapContainer.js index 5f49b9ca..30999909 100644 --- a/lib/components/SiteMap/SiteMapContainer.js +++ b/lib/components/SiteMap/SiteMapContainer.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -51,303 +50,291 @@ var _SiteMapLeaflet = _interopRequireDefault(require("./SiteMapLeaflet")); var _SiteMapTable = _interopRequireDefault(require("./SiteMapTable")); var _SiteMapUtils = require("./SiteMapUtils"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -var boxShadow = '0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)'; -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - ':root': { - fontSize: '24px' - }, - outerContainer: { - zIndex: 0, - width: '100%', - position: 'relative' - }, - contentContainer: { - width: '100%', - height: '0px', - // Necessary to set a fixed aspect ratio from props (using paddingBottom) - position: 'relative', - backgroundColor: _Theme.default.colors.NEON_BLUE[200], - overflow: 'hidden', - display: 'flex', - justifyContent: 'center', - boxShadow: boxShadow - }, - contentPaper: { - position: 'absolute', - width: '70%', - top: '50%', - transform: 'translate(0%, -50%)', - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - padding: theme.spacing(3), - borderRadius: '2px' - }, - legendContainer: { - backgroundColor: theme.palette.grey[100], - height: 'calc(100% - 84px)', - borderBottomLeftRadius: '4px', - borderTopLeftRadius: '4px', - position: 'absolute', - zIndex: 1000, - top: '48px', - right: '0px', - boxShadow: '-3px 0 5px 0px rgba(0,0,0,0.5)', - padding: theme.spacing(2), - display: 'flex', - flexDirection: 'column', - alignItems: 'flex-start', - overflowY: 'auto', - '& span.MuiCheckbox-root': { - marginLeft: '-9px' - } - }, - legendContainerFullscreen: { - top: '56px', - height: 'calc(100% - 92px)' - }, - legendDivider: { - width: '100%', - borderBottomColor: theme.palette.grey[300], - borderWidth: '0px 0px 1px 0px', - margin: theme.spacing(2.5, 0) - }, - legendSection: { +const boxShadow = '0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)'; +const useStyles = (0, _styles.makeStyles)(theme => ({ + ':root': { + fontSize: '24px' + }, + outerContainer: { + zIndex: 0, + width: '100%', + position: 'relative' + }, + contentContainer: { + width: '100%', + height: '0px', + // Necessary to set a fixed aspect ratio from props (using paddingBottom) + position: 'relative', + backgroundColor: _Theme.default.colors.NEON_BLUE[200], + overflow: 'hidden', + display: 'flex', + justifyContent: 'center', + boxShadow + }, + contentPaper: { + position: 'absolute', + width: '70%', + top: '50%', + transform: 'translate(0%, -50%)', + display: 'flex', + flexDirection: 'column', + alignItems: 'center', + padding: theme.spacing(3), + borderRadius: '2px' + }, + legendContainer: { + backgroundColor: theme.palette.grey[100], + height: 'calc(100% - 84px)', + borderBottomLeftRadius: '4px', + borderTopLeftRadius: '4px', + position: 'absolute', + zIndex: 1000, + top: '48px', + right: '0px', + boxShadow: '-3px 0 5px 0px rgba(0,0,0,0.5)', + padding: theme.spacing(2), + display: 'flex', + flexDirection: 'column', + alignItems: 'flex-start', + overflowY: 'auto', + '& span.MuiCheckbox-root': { + marginLeft: '-9px' + } + }, + legendContainerFullscreen: { + top: '56px', + height: 'calc(100% - 92px)' + }, + legendDivider: { + width: '100%', + borderBottomColor: theme.palette.grey[300], + borderWidth: '0px 0px 1px 0px', + margin: theme.spacing(2.5, 0) + }, + legendSection: { + width: '100%' + }, + legendSectionTitleContainer: { + display: 'flex', + alignItems: 'center', + justifyContent: 'space-between', + marginBottom: '8px' + }, + legendSectionTitle: { + fontWeight: 600 + }, + featureIcon: { + width: '28px', + height: '28px', + marginRight: theme.spacing(1) + }, + legendOptionFormControlLabel: { + width: '100%', + paddingRight: theme.spacing(1), + margin: 0, + '& > span:nth-child(2)': { width: '100%' }, - legendSectionTitleContainer: { - display: 'flex', - alignItems: 'center', - justifyContent: 'space-between', - marginBottom: '8px' - }, - legendSectionTitle: { - fontWeight: 600 - }, - featureIcon: { - width: '28px', - height: '28px', - marginRight: theme.spacing(1) - }, - legendOptionFormControlLabel: { - width: '100%', - paddingRight: theme.spacing(1), - margin: 0, - '& > span:nth-child(2)': { - width: '100%' - }, - '&:hover, &:focus': { - backgroundColor: theme.palette.grey[100] - } - }, - legendOptionLabel: { - display: 'flex', - alignItems: 'center' - }, - resizeButton: { - backgroundColor: '#fff', - position: 'absolute', - zIndex: 999, - bottom: '0px', - right: '0px', - width: '26px', - height: '26px', - padding: 'unset', - borderRadius: '2px 0px 2px 0px', - border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[500]), - cursor: 'grab', - '&:hover, &:active': { - color: _Theme.default.colors.LIGHT_BLUE[400], - borderColor: _Theme.default.colors.LIGHT_BLUE[400], - backgroundColor: theme.palette.grey[50] - }, - '&:active': { - cursor: 'row-resize !important' - }, - '& svg': { - fontSize: '17px !important' - } - }, - resizeBorder: { - position: 'absolute', - border: "3px solid ".concat(_Theme.default.colors.LIGHT_BLUE[500]), - top: '0px', - left: '0px', - width: '100%', - zIndex: 998, - display: 'none' - }, - viewLegendButtonsContainer: { - display: 'flex', - position: 'absolute', - zIndex: 401, - top: '0px', - right: '0px' - }, - viewLegendButtonsContainerFullscreen: { - top: '8px', - right: '8px' - }, - mapTableToggleButtonGroup: { - borderRadius: '0px 0px 2px 2px', - backgroundColor: 'white', - '& button': { - borderTopLeftRadius: '0px !important', - borderTopRightRadius: '0px !important' - } - }, - mapTableToggleButtonGroupFullscreen: { - borderRadius: '2px', - backgroundColor: 'white' - }, - legendButton: { - border: "1px solid ".concat(_Theme.default.palette.primary.main), - borderRadius: '0px 0px 0px 2px' - }, - legendButtonFullscreen: { - border: "1px solid ".concat(_Theme.default.palette.primary.main) - }, - unselectablesButton: { - border: "1px solid ".concat(_Theme.default.palette.primary.main), - borderRadius: '0px 0px 2px 2px' - }, - unselectablesButtonFullscreen: { - border: "1px solid ".concat(_Theme.default.palette.primary.main) - }, - selectionSummaryContainer: { - position: 'absolute', - left: '8px', - bottom: '8px', - zIndex: 400 - }, - selectionSummary: { - position: 'absolute', - bottom: theme.spacing(6), - overflowY: 'auto', - borderRadius: theme.spacing(2.5), - '& .MuiListItemText-primary': { - fontWeight: 600 - }, - '& .MuiListItem-secondaryAction': { - paddingRight: theme.spacing(9) - }, - '& .MuiListItemIcon-root': { - minWidth: 'unset' - }, - '& .MuiListItemSecondaryAction-root': { - right: theme.spacing(3) - } - }, - selectionSummaryValid: { - border: "1px solid ".concat(theme.palette.secondary.main), + '&:hover, &:focus': { + backgroundColor: theme.palette.grey[100] + } + }, + legendOptionLabel: { + display: 'flex', + alignItems: 'center' + }, + resizeButton: { + backgroundColor: '#fff', + position: 'absolute', + zIndex: 999, + bottom: '0px', + right: '0px', + width: '26px', + height: '26px', + padding: 'unset', + borderRadius: '2px 0px 2px 0px', + border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[500]), + cursor: 'grab', + '&:hover, &:active': { + color: _Theme.default.colors.LIGHT_BLUE[400], + borderColor: _Theme.default.colors.LIGHT_BLUE[400], backgroundColor: theme.palette.grey[50] }, - selectionSummaryInvalid: { - border: "1px solid ".concat(theme.palette.error.light), - backgroundColor: theme.palette.error.light - }, - summaryFeatureIcon: { - width: theme.spacing(3), - height: theme.spacing(3), - marginRight: theme.spacing(1.5), - filter: 'drop-shadow(0px 0px 1.5px #000000bb)' + '&:active': { + cursor: 'row-resize !important' }, - selectionChip: { - opacity: 1, - fontSize: theme.spacing(2), - height: theme.spacing(5), - borderRadius: theme.spacing(2.5), - padding: theme.spacing(0, 1), - '& .MuiChip-label': { - padding: theme.spacing(0, 2) - } - }, - selectionChipError: { - backgroundColor: theme.palette.error.light, - fontWeight: 600, - '& .MuiChip-icon': { - color: theme.palette.error.dark - } - }, - overlayLegendContainer: { - margin: theme.spacing(0.5, 0, 2, 3.5) - }, - overlayLegendItem: { - display: 'flex', - alignItems: 'center', - marginBottom: '6px', - cursor: 'help' + '& svg': { + fontSize: '17px !important' + } + }, + resizeBorder: { + position: 'absolute', + border: "3px solid ".concat(_Theme.default.colors.LIGHT_BLUE[500]), + top: '0px', + left: '0px', + width: '100%', + zIndex: 998, + display: 'none' + }, + viewLegendButtonsContainer: { + display: 'flex', + position: 'absolute', + zIndex: 401, + top: '0px', + right: '0px' + }, + viewLegendButtonsContainerFullscreen: { + top: '8px', + right: '8px' + }, + mapTableToggleButtonGroup: { + borderRadius: '0px 0px 2px 2px', + backgroundColor: 'white', + '& button': { + borderTopLeftRadius: '0px !important', + borderTopRightRadius: '0px !important' + } + }, + mapTableToggleButtonGroupFullscreen: { + borderRadius: '2px', + backgroundColor: 'white' + }, + legendButton: { + border: "1px solid ".concat(_Theme.default.palette.primary.main), + borderRadius: '0px 0px 0px 2px' + }, + legendButtonFullscreen: { + border: "1px solid ".concat(_Theme.default.palette.primary.main) + }, + unselectablesButton: { + border: "1px solid ".concat(_Theme.default.palette.primary.main), + borderRadius: '0px 0px 2px 2px' + }, + unselectablesButtonFullscreen: { + border: "1px solid ".concat(_Theme.default.palette.primary.main) + }, + selectionSummaryContainer: { + position: 'absolute', + left: '8px', + bottom: '8px', + zIndex: 400 + }, + selectionSummary: { + position: 'absolute', + bottom: theme.spacing(6), + overflowY: 'auto', + borderRadius: theme.spacing(2.5), + '& .MuiListItemText-primary': { + fontWeight: 600 }, - overlayLegendSwatch: { - width: '36px', - height: '12px', - border: '1px solid black', - marginRight: theme.spacing(1.5), - marginBottom: '-1px', - display: 'inline-block' + '& .MuiListItem-secondaryAction': { + paddingRight: theme.spacing(9) }, - overlayLegendItemTooltipTitle: { - display: 'flex', - alignItems: 'center', - marginBottom: '8px' + '& .MuiListItemIcon-root': { + minWidth: 'unset' }, - overlayLegendCategory: { - marginBottom: '6px', - '& span.MuiTypography-caption': { - fontWeight: 600 - } + '& .MuiListItemSecondaryAction-root': { + right: theme.spacing(3) } - }; -}); -var SiteMapContainer = function SiteMapContainer(props) { - var classes = useStyles(_Theme.default); - var _props$unusableVertic = props.unusableVerticalSpace, - unusableVerticalSpace = _props$unusableVertic === void 0 ? 0 : _props$unusableVertic, - mapUniqueId = props.mapUniqueId; - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - neonContextState = _NeonContext$useNeonC2[0]; - var _SiteMapContext$useSi = _SiteMapContext.default.useSiteMapContext(), - _SiteMapContext$useSi2 = _slicedToArray(_SiteMapContext$useSi, 2), - state = _SiteMapContext$useSi2[0], - dispatch = _SiteMapContext$useSi2[1]; + }, + selectionSummaryValid: { + border: "1px solid ".concat(theme.palette.secondary.main), + backgroundColor: theme.palette.grey[50] + }, + selectionSummaryInvalid: { + border: "1px solid ".concat(theme.palette.error.light), + backgroundColor: theme.palette.error.light + }, + summaryFeatureIcon: { + width: theme.spacing(3), + height: theme.spacing(3), + marginRight: theme.spacing(1.5), + filter: 'drop-shadow(0px 0px 1.5px #000000bb)' + }, + selectionChip: { + opacity: 1, + fontSize: theme.spacing(2), + height: theme.spacing(5), + borderRadius: theme.spacing(2.5), + padding: theme.spacing(0, 1), + '& .MuiChip-label': { + padding: theme.spacing(0, 2) + } + }, + selectionChipError: { + backgroundColor: theme.palette.error.light, + fontWeight: 600, + '& .MuiChip-icon': { + color: theme.palette.error.dark + } + }, + overlayLegendContainer: { + margin: theme.spacing(0.5, 0, 2, 3.5) + }, + overlayLegendItem: { + display: 'flex', + alignItems: 'center', + marginBottom: '6px', + cursor: 'help' + }, + overlayLegendSwatch: { + width: '36px', + height: '12px', + border: '1px solid black', + marginRight: theme.spacing(1.5), + marginBottom: '-1px', + display: 'inline-block' + }, + overlayLegendItemTooltipTitle: { + display: 'flex', + alignItems: 'center', + marginBottom: '8px' + }, + overlayLegendCategory: { + marginBottom: '6px', + '& span.MuiTypography-caption': { + fontWeight: 600 + } + } +})); +const SiteMapContainer = props => { + const classes = useStyles(_Theme.default); + const { + unusableVerticalSpace = 0, + mapUniqueId + } = props; + const [neonContextState] = _NeonContext.default.useNeonContextState(); + const [state, dispatch] = _SiteMapContext.default.useSiteMapContext(); // console.log('SITEMAP STATE:', state); - var isLoading = state.overallFetch.expected !== state.overallFetch.completed; - var progressId = "sitemap-progress-".concat((0, _uniqueId.default)()); - var filters = state.filters, - fullscreen = state.fullscreen, - aspectRatio = state.aspectRatio, - featureData = state.featureData, - view = state.view.current, - tableFullHeight = state.table.fullHeight, - _state$selection = state.selection, - selection = _state$selection.set, - selectionActive = _state$selection.active, - selectableItems = _state$selection.validSet, - selectionValid = _state$selection.valid, - selectionLimit = _state$selection.limit, - hideUnselectable = _state$selection.hideUnselectable, - showSummary = _state$selection.showSummary, - manualLocationData = state.manualLocationData; - var contentDivProps = { + const isLoading = state.overallFetch.expected !== state.overallFetch.completed; + const progressId = "sitemap-progress-".concat((0, _uniqueId.default)()); + const { + filters, + fullscreen, + aspectRatio, + featureData, + view: { + current: view + }, + table: { + fullHeight: tableFullHeight + }, + selection: { + set: selection, + active: selectionActive, + validSet: selectableItems, + valid: selectionValid, + limit: selectionLimit, + hideUnselectable, + showSummary + }, + manualLocationData + } = state; + const contentDivProps = { className: classes.contentContainer, style: tableFullHeight ? { height: 'auto', @@ -356,26 +343,20 @@ var SiteMapContainer = function SiteMapContainer(props) { paddingBottom: "".concat((aspectRatio.currentValue || 0.75) * 100, "%") } }; - var legendRef = (0, _react.useRef)(null); - var containerDivRef = (0, _react.useRef)(null); - var contentDivRef = (0, _react.useRef)(null); - var resizeBorderRef = (0, _react.useRef)(null); - var resizeButtonRef = (0, _react.useRef)(null); - var belowMd = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('sm')); + const legendRef = (0, _react.useRef)(null); + const containerDivRef = (0, _react.useRef)(null); + const contentDivRef = (0, _react.useRef)(null); + const resizeBorderRef = (0, _react.useRef)(null); + const resizeButtonRef = (0, _react.useRef)(null); + const belowMd = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('sm')); /** Vertical Resize Hooks */ - var _useState = (0, _react.useState)(false), - _useState2 = _slicedToArray(_useState, 2), - resizeDragging = _useState2[0], - setResizeDragging = _useState2[1]; - var _useState3 = (0, _react.useState)(null), - _useState4 = _slicedToArray(_useState3, 2), - dragStartY = _useState4[0], - setDragStartY = _useState4[1]; - var dragDeltaY = (0, _react.useRef)(null); - var resizeVerticallyDragStart = (0, _react.useCallback)(function (event) { + const [resizeDragging, setResizeDragging] = (0, _react.useState)(false); + const [dragStartY, setDragStartY] = (0, _react.useState)(null); + const dragDeltaY = (0, _react.useRef)(null); + const resizeVerticallyDragStart = (0, _react.useCallback)(event => { if (!resizeBorderRef.current || !contentDivRef.current) { return; } @@ -385,22 +366,22 @@ var SiteMapContainer = function SiteMapContainer(props) { resizeBorderRef.current.style.display = 'block'; resizeBorderRef.current.style.height = "".concat(contentDivRef.current.clientHeight, "px"); }, [setDragStartY, setResizeDragging, dragDeltaY]); - var resizeVerticallyDrag = (0, _react.useCallback)(function (event) { + const resizeVerticallyDrag = (0, _react.useCallback)(event => { if (!resizeDragging || !resizeBorderRef.current || dragStartY === null || event.clientY === 0) { return; } dragDeltaY.current = event.clientY - dragStartY; - var newHeight = Math.max(contentDivRef.current.clientHeight + dragDeltaY.current, _SiteMapUtils.MIN_CONTAINER_HEIGHT); + const newHeight = Math.max(contentDivRef.current.clientHeight + dragDeltaY.current, _SiteMapUtils.MIN_CONTAINER_HEIGHT); resizeBorderRef.current.style.height = "".concat(newHeight, "px"); }, [resizeDragging, dragStartY, dragDeltaY]); - var resizeVerticallyDragEnd = (0, _react.useCallback)(function () { - var finalHeight = Math.max(contentDivRef.current.clientHeight + dragDeltaY.current, _SiteMapUtils.MIN_CONTAINER_HEIGHT); + const resizeVerticallyDragEnd = (0, _react.useCallback)(() => { + const finalHeight = Math.max(contentDivRef.current.clientHeight + dragDeltaY.current, _SiteMapUtils.MIN_CONTAINER_HEIGHT); setDragStartY(null); setResizeDragging(false); dragDeltaY.current = null; resizeBorderRef.current.style.display = 'none'; resizeButtonRef.current.blur(); - var newAspectRatio = finalHeight / aspectRatio.widthReference; + const newAspectRatio = finalHeight / aspectRatio.widthReference; dispatch({ type: 'setAspectRatio', aspectRatio: newAspectRatio, @@ -411,13 +392,13 @@ var SiteMapContainer = function SiteMapContainer(props) { /** Effect - Register event listener to dynamically adjust aspect ratio from viewport dimensions */ - (0, _react.useLayoutEffect)(function () { - var handleResize = (0, _debounce.default)(function () { - var newAspectRatio = aspectRatio.isDynamic ? (0, _SiteMapUtils.getDynamicAspectRatio)(unusableVerticalSpace) : aspectRatio.currentValue; + (0, _react.useLayoutEffect)(() => { + const handleResize = (0, _debounce.default)(() => { + let newAspectRatio = aspectRatio.isDynamic ? (0, _SiteMapUtils.getDynamicAspectRatio)(unusableVerticalSpace) : aspectRatio.currentValue; if (fullscreen && containerDivRef.current && contentDivRef.current) { - var boundingClientRect = contentDivRef.current.getBoundingClientRect(); - var targetHeight = Math.max(window.innerHeight - boundingClientRect.y - 1, 0); - var targetWidth = boundingClientRect.height + boundingClientRect.y > window.innerHeight ? window.innerWidth : contentDivRef.current.clientWidth; + const boundingClientRect = contentDivRef.current.getBoundingClientRect(); + const targetHeight = Math.max(window.innerHeight - boundingClientRect.y - 1, 0); + const targetWidth = boundingClientRect.height + boundingClientRect.y > window.innerHeight ? window.innerWidth : contentDivRef.current.clientWidth; newAspectRatio = targetHeight / targetWidth; containerDivRef.current.style.height = "calc(100vh - ".concat(boundingClientRect.y, "px)"); containerDivRef.current.style.overflowY = 'hidden'; @@ -429,17 +410,17 @@ var SiteMapContainer = function SiteMapContainer(props) { }); }, 10); if ((!aspectRatio.isDynamic || aspectRatio.currentValue !== null) && !fullscreen) { - return function () {}; + return () => {}; } handleResize(); if ((!aspectRatio.isDynamic || aspectRatio.resizeEventListenerInitialized) && !fullscreen) { - return function () {}; + return () => {}; } window.addEventListener('resize', handleResize); dispatch({ type: 'setAspectRatioResizeEventListenerInitialized' }); - return function () { + return () => { window.removeEventListener('resize', handleResize); }; }, [unusableVerticalSpace, aspectRatio, fullscreen, dispatch]); @@ -448,11 +429,11 @@ var SiteMapContainer = function SiteMapContainer(props) { Effect - Monitor all click events and close the legend pane if open and clicked outside and not in the content area (map or table) */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (!state.filters.legendOpen || !legendRef.current) { - return function () {}; + return () => {}; } - var handleClick = function handleClick(event) { + const handleClick = event => { if (legendRef.current && !legendRef.current.contains(event.target) && contentDivRef.current && !contentDivRef.current.contains(event.target)) { dispatch({ type: 'setLegendOpen', @@ -461,7 +442,7 @@ var SiteMapContainer = function SiteMapContainer(props) { } }; document.addEventListener('click', handleClick); - return function () { + return () => { document.removeEventListener('click', handleClick); }; }, [state.filters.legendOpen, legendRef, contentDivRef, dispatch]); @@ -469,7 +450,7 @@ var SiteMapContainer = function SiteMapContainer(props) { /** Effect - If NeonContext Data is now available and has not been hydrated into state then do so. */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (state.neonContextHydrated || !(neonContextState.isFinal && !neonContextState.hasError)) { return; } @@ -478,7 +459,7 @@ var SiteMapContainer = function SiteMapContainer(props) { neonContextData: neonContextState.data }); }, [state.neonContextHydrated, neonContextState.isFinal, neonContextState.hasError, neonContextState.data, dispatch]); - var containerProps = { + const containerProps = { ref: containerDivRef, className: classes.outerContainer, 'aria-busy': isLoading ? 'true' : 'false', @@ -524,46 +505,42 @@ var SiteMapContainer = function SiteMapContainer(props) { /** Render - Map/Table Toggle Button Group */ - var renderMapTableToggleButtonGroup = function renderMapTableToggleButtonGroup() { - var _viewTooltips; + const renderMapTableToggleButtonGroup = () => { if (state.view.current === _SiteMapUtils.VIEWS.SPLIT) { return null; } - var viewTooltips = (_viewTooltips = {}, _defineProperty(_viewTooltips, _SiteMapUtils.VIEWS.MAP, 'Show the observatory map'), _defineProperty(_viewTooltips, _SiteMapUtils.VIEWS.TABLE, 'Show a table of all locations currently visible in the map'), _viewTooltips); + const viewTooltips = { + [_SiteMapUtils.VIEWS.MAP]: 'Show the observatory map', + [_SiteMapUtils.VIEWS.TABLE]: 'Show a table of all locations currently visible in the map' + }; return /*#__PURE__*/_react.default.createElement(_ToggleButtonGroup.default, { exclusive: true, color: "primary", variant: "outlined", value: view, - onChange: function onChange(event, newView) { - return dispatch({ - type: 'setView', - view: newView - }); - }, + onChange: (event, newView) => dispatch({ + type: 'setView', + view: newView + }), className: fullscreen ? classes.mapTableToggleButtonGroupFullscreen : classes.mapTableToggleButtonGroup - }, Object.keys(_SiteMapUtils.VIEWS).filter(function (key) { - return key !== _SiteMapUtils.VIEWS.SPLIT; - }).map(function (key) { - return /*#__PURE__*/_react.default.createElement(_Tooltip.default, { - key: key, - title: viewTooltips[key], - enterDelay: 500, - enterNextDelay: 200, - placement: fullscreen ? 'bottom-end' : 'top-end' - }, /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - value: key, - selected: state.view.current === key, - "data-selenium": "sitemap-viewButton-".concat(key) - }, key)); - })); + }, Object.keys(_SiteMapUtils.VIEWS).filter(key => key !== _SiteMapUtils.VIEWS.SPLIT).map(key => /*#__PURE__*/_react.default.createElement(_Tooltip.default, { + key: key, + title: viewTooltips[key], + enterDelay: 500, + enterNextDelay: 200, + placement: fullscreen ? 'bottom-end' : 'top-end' + }, /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + value: key, + selected: state.view.current === key, + "data-selenium": "sitemap-viewButton-".concat(key) + }, key)))); }; /** Render - Legend Button */ - var renderLegendButton = function renderLegendButton() { - var buttonStyle = filters.legendOpen ? {} : { + const renderLegendButton = () => { + const buttonStyle = filters.legendOpen ? {} : { backgroundColor: 'white' }; return /*#__PURE__*/_react.default.createElement("div", { @@ -583,7 +560,7 @@ var SiteMapContainer = function SiteMapContainer(props) { endIcon: filters.legendOpen ? /*#__PURE__*/_react.default.createElement(_ExpandLess.default, null) : /*#__PURE__*/_react.default.createElement(_ExpandMore.default, null), "data-selenium": "sitemap-legendButton", className: fullscreen ? classes.legendButtonFullscreen : classes.legendButton, - onClick: function onClick() { + onClick: () => { dispatch({ type: 'setLegendOpen', open: !filters.legendOpen @@ -599,15 +576,15 @@ var SiteMapContainer = function SiteMapContainer(props) { /** Render - Unselectables Button */ - var renderUnselectablesButton = function renderUnselectablesButton() { + const renderUnselectablesButton = () => { if (!selectionActive || !selectableItems) { return null; } - var buttonStyle = hideUnselectable ? { + const buttonStyle = hideUnselectable ? { backgroundColor: 'white' } : {}; - var items = selectionActive.toLowerCase().replace('_', ''); - var title = "Click to ".concat(hideUnselectable ? 'show' : 'hide', " ").concat(items, " that are not selectable"); + const items = selectionActive.toLowerCase().replace('_', ''); + const title = "Click to ".concat(hideUnselectable ? 'show' : 'hide', " ").concat(items, " that are not selectable"); return /*#__PURE__*/_react.default.createElement("div", { style: { borderRadius: '2px', @@ -626,7 +603,7 @@ var SiteMapContainer = function SiteMapContainer(props) { "data-selenium": "sitemap-unselectablesButton", "aria-label": title, className: fullscreen ? classes.unselectablesButtonFullscreen : classes.unselectablesButton, - onClick: function onClick() { + onClick: () => { dispatch({ type: 'setHideUnselectable', hideUnselectable: !hideUnselectable @@ -642,29 +619,27 @@ var SiteMapContainer = function SiteMapContainer(props) { /** Helper Functions - Selection Summary */ - var getSelectedItemFeatureKey = function getSelectedItemFeatureKey(item) { + const getSelectedItemFeatureKey = item => { if (!selectionActive) { return null; } - return Object.keys(featureData[selectionActive]).find(function (key) { - return Object.keys(featureData[selectionActive][key]).includes(item); - }) || null; + return Object.keys(featureData[selectionActive]).find(key => Object.keys(featureData[selectionActive][key]).includes(item)) || null; }; - var getSelectedItemIcon = function getSelectedItemIcon(item) { + const getSelectedItemIcon = item => { if (!selectionActive) { return null; } - var featureKey = getSelectedItemFeatureKey(item); + const featureKey = getSelectedItemFeatureKey(item); if (!featureKey) { return null; } return _SiteMapUtils.FEATURES[featureKey].iconSvg || null; }; - var getSelectedItemDescription = function getSelectedItemDescription(item) { + const getSelectedItemDescription = item => { if (!selectionActive) { return null; } - var featureKey = getSelectedItemFeatureKey(item); + const featureKey = getSelectedItemFeatureKey(item); if (!featureKey) { return null; } @@ -682,16 +657,16 @@ var SiteMapContainer = function SiteMapContainer(props) { /** Render - Selection Summary */ - var renderSelectionSummary = function renderSelectionSummary() { + const renderSelectionSummary = () => { if (!selectionActive) { return null; } - var unit = _SiteMapUtils.FEATURE_TYPES[selectionActive].unit || ''; - var units = _SiteMapUtils.FEATURE_TYPES[selectionActive].units || ''; - var plural = selection.size !== 1; - var title = "".concat(selection.size ? selection.size.toString() : 'No', " ").concat(plural ? units : unit, " selected"); - var icon = /*#__PURE__*/_react.default.createElement(_Remove.default, null); - var color = 'default'; + const unit = _SiteMapUtils.FEATURE_TYPES[selectionActive].unit || ''; + const units = _SiteMapUtils.FEATURE_TYPES[selectionActive].units || ''; + const plural = selection.size !== 1; + const title = "".concat(selection.size ? selection.size.toString() : 'No', " ").concat(plural ? units : unit, " selected"); + let icon = /*#__PURE__*/_react.default.createElement(_Remove.default, null); + let color = 'default'; if (selection.size) { if (selectionValid) { icon = /*#__PURE__*/_react.default.createElement(_Done.default, null); @@ -700,7 +675,7 @@ var SiteMapContainer = function SiteMapContainer(props) { icon = /*#__PURE__*/_react.default.createElement(_Error.default, null); } } - var limit = null; + let limit = null; if (Number.isFinite(selectionLimit)) { limit = "".concat(selectionLimit, " required"); } @@ -711,20 +686,20 @@ var SiteMapContainer = function SiteMapContainer(props) { limit = "min ".concat(selectionLimit[0], "; max ").concat(selectionLimit[1]); } } - var summaryContainerStyle = {}; + const summaryContainerStyle = {}; if (view === _SiteMapUtils.VIEWS.MAP) { summaryContainerStyle.left = '108px'; } - var chipClassName = !selection.size || selectionValid ? classes.selectionChip : "".concat(classes.selectionChip, " ").concat(classes.selectionChipError); - var summaryValidClass = selection.size && selectionValid ? classes.selectionSummaryValid : classes.selectionSummaryInvalid; - var summaryClass = "".concat(classes.selectionSummary, " ").concat(summaryValidClass); - var maxHeight = 72 * 3; + const chipClassName = !selection.size || selectionValid ? classes.selectionChip : "".concat(classes.selectionChip, " ").concat(classes.selectionChipError); + const summaryValidClass = selection.size && selectionValid ? classes.selectionSummaryValid : classes.selectionSummaryInvalid; + const summaryClass = "".concat(classes.selectionSummary, " ").concat(summaryValidClass); + let maxHeight = 72 * 3; if (contentDivRef && contentDivRef.current) { maxHeight = Math.max((contentDivRef.current.clientHeight || 0) - 72 * 2, 72 * 3); maxHeight -= maxHeight % 72; } maxHeight = Math.min(maxHeight, selection.size * 72); - var summaryStyle = { + const summaryStyle = { maxHeight: "".concat(maxHeight + 1, "px") }; return /*#__PURE__*/_react.default.createElement("div", { @@ -739,9 +714,9 @@ var SiteMapContainer = function SiteMapContainer(props) { style: summaryStyle }, /*#__PURE__*/_react.default.createElement(_List.default, { dense: true - }, _toConsumableArray(selection).sort().map(function (selectedItem) { - var src = getSelectedItemIcon(selectedItem); - var remove = "Remove ".concat(selectedItem, " from selection"); + }, [...selection].sort().map(selectedItem => { + const src = getSelectedItemIcon(selectedItem); + const remove = "Remove ".concat(selectedItem, " from selection"); return /*#__PURE__*/_react.default.createElement(_ListItem.default, { key: selectedItem }, !src ? null : /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement("img", { @@ -759,12 +734,10 @@ var SiteMapContainer = function SiteMapContainer(props) { }, /*#__PURE__*/_react.default.createElement(_IconButton.default, { edge: "end", "aria-label": remove, - onClick: function onClick() { - return dispatch({ - type: 'toggleItemSelected', - item: selectedItem - }); - } + onClick: () => dispatch({ + type: 'toggleItemSelected', + item: selectedItem + }) }, /*#__PURE__*/_react.default.createElement(_Delete.default, null))))); })))), /*#__PURE__*/_react.default.createElement(_Chip.default, { icon: icon, @@ -772,30 +745,26 @@ var SiteMapContainer = function SiteMapContainer(props) { label: limit ? "".concat(title, " (").concat(limit, ")") : title, "aria-label": "Current selection status", className: chipClassName, - onClick: function onClick() { - return dispatch({ - type: 'toggleSelectionSummary', - showSummary: !showSummary - }); - }, + onClick: () => dispatch({ + type: 'toggleSelectionSummary', + showSummary: !showSummary + }), deleteIcon: /*#__PURE__*/_react.default.createElement(_Tooltip.default, { enterDelay: 500, enterNextDelay: 200, title: "Deselect all" }, /*#__PURE__*/_react.default.createElement(_Cancel.default, null)), - onDelete: selection.size ? function () { - return dispatch({ - type: 'updateSelectionSet', - selection: new Set() - }); - } : function () {} + onDelete: selection.size ? () => dispatch({ + type: 'updateSelectionSet', + selection: new Set() + }) : () => {} })); }; /** Render - Vertical resize Elements */ - var renderVerticalResizeButton = function renderVerticalResizeButton() { + const renderVerticalResizeButton = () => { if (fullscreen || view === _SiteMapUtils.VIEWS.TABLE && tableFullHeight) { return null; } @@ -820,33 +789,34 @@ var SiteMapContainer = function SiteMapContainer(props) { /** Render - Single Feature Option */ - var renderFeatureOption = function renderFeatureOption(key) { + const renderFeatureOption = key => { if (!_SiteMapUtils.FEATURES[key]) { return null; } - var feature = _SiteMapUtils.FEATURES[key]; - var featureName = feature.name, - iconSvg = feature.iconSvg, - featureShape = feature.featureShape, - _feature$style = feature.style, - featureStyle = _feature$style === void 0 ? {} : _feature$style, - description = feature.description, - descriptionFromParentDataFeatureKey = feature.descriptionFromParentDataFeatureKey, - parentDataFeatureKey = feature.parentDataFeatureKey, - dataSource = feature.dataSource; + const feature = _SiteMapUtils.FEATURES[key]; + const { + name: featureName, + iconSvg, + featureShape, + style: featureStyle = {}, + description, + descriptionFromParentDataFeatureKey, + parentDataFeatureKey, + dataSource + } = feature; // Special case: do not include any features with a dataSource of MANUAL_LOCATIONS if // manualLocationData is not also defined if (dataSource === _SiteMapUtils.FEATURE_DATA_SOURCES.MANUAL_LOCATIONS && !manualLocationData) { return null; } - var handleChange = function handleChange(event) { + const handleChange = event => { dispatch({ type: 'setLegendFeatureOptionVisibility', feature: key, visible: event.target.checked }); }; - var icon = null; + let icon = null; if (iconSvg) { icon = /*#__PURE__*/_react.default.createElement("img", { alt: featureName, @@ -854,7 +824,7 @@ var SiteMapContainer = function SiteMapContainer(props) { className: classes.featureIcon }); } else if (featureShape === 'Circle') { - var circleProps = { + const circleProps = { cx: 14, cy: 14, r: 8, @@ -870,7 +840,7 @@ var SiteMapContainer = function SiteMapContainer(props) { className: classes.featureIcon }, /*#__PURE__*/_react.default.createElement("circle", circleProps)); } else if (featureShape === 'Polyline') { - var polylineProps = { + const polylineProps = { points: '1.5,21.5 15,18.5 13,9.5 26.5,6.5', style: { fill: 'none', @@ -885,7 +855,7 @@ var SiteMapContainer = function SiteMapContainer(props) { className: classes.featureIcon }, /*#__PURE__*/_react.default.createElement("polyline", polylineProps)); } else if (featureShape === 'Polygon') { - var rectProps = { + const rectProps = { width: 25, height: 15, x: 1.5, @@ -907,12 +877,12 @@ var SiteMapContainer = function SiteMapContainer(props) { className: classes.featureIcon }, /*#__PURE__*/_react.default.createElement("rect", rectProps)); } - var allChildren = []; - var visibleChildren = []; - var indeterminate = false; - var collapsed = false; - var label = null; - var tooltip = null; + let allChildren = []; + let visibleChildren = []; + let indeterminate = false; + let collapsed = false; + let label = null; + let tooltip = null; if (description) { tooltip = description; } @@ -921,25 +891,23 @@ var SiteMapContainer = function SiteMapContainer(props) { } if (feature.type === _SiteMapUtils.FEATURE_TYPES.GROUP.KEY) { collapsed = state.filters.features.collapsed.has(key); - var collapseTitle = "".concat(collapsed ? 'Expand' : 'Collapse', " ").concat(feature.name); - allChildren = Object.keys(_SiteMapUtils.FEATURES).filter(function (f) { - return _SiteMapUtils.FEATURES[f].parent === key; - }); - allChildren.sort(function (a, b) { - var _FEATURES$a = _SiteMapUtils.FEATURES[a], - aType = _FEATURES$a.type, - aName = _FEATURES$a.name; - var _FEATURES$b = _SiteMapUtils.FEATURES[b], - bType = _FEATURES$b.type, - bName = _FEATURES$b.name; + const collapseTitle = "".concat(collapsed ? 'Expand' : 'Collapse', " ").concat(feature.name); + allChildren = Object.keys(_SiteMapUtils.FEATURES).filter(f => _SiteMapUtils.FEATURES[f].parent === key); + allChildren.sort((a, b) => { + const { + type: aType, + name: aName + } = _SiteMapUtils.FEATURES[a]; + const { + type: bType, + name: bName + } = _SiteMapUtils.FEATURES[b]; if (aType !== bType && (aType === _SiteMapUtils.FEATURE_TYPES.GROUP.KEY || bType === _SiteMapUtils.FEATURE_TYPES.GROUP.KEY)) { return bType === _SiteMapUtils.FEATURE_TYPES.GROUP.KEY ? -1 : 1; } return aName < bName ? -1 : 1; }); - visibleChildren = allChildren.filter(function (f) { - return state.filters.features.visible[f]; - }); + visibleChildren = allChildren.filter(f => state.filters.features.visible[f]); indeterminate = visibleChildren.length > 0 && visibleChildren.length < allChildren.length; label = /*#__PURE__*/_react.default.createElement("div", { className: classes.legendOptionLabel, @@ -960,13 +928,13 @@ var SiteMapContainer = function SiteMapContainer(props) { style: { margin: _Theme.default.spacing(0, -2, 0, 1) }, - onClick: function onClick(event) { + onClick: event => { event.preventDefault(); // We use setTimeout here so the icon doesn't change before the click event bubbles. // Without it the target of the click event is an SVG that no longer exists in the // DOM tree (thus not contained in the features container, thus seen as a click // outside that will close the features container, when we know it's not). - window.setTimeout(function () { + window.setTimeout(() => { dispatch({ type: "setLegendFeatureOption".concat(collapsed ? 'Expanded' : 'Collapsed'), feature: key @@ -983,7 +951,7 @@ var SiteMapContainer = function SiteMapContainer(props) { className: classes.legendOptionLabel }, icon, /*#__PURE__*/_react.default.createElement("span", null, feature.name)); } - var formControl = /*#__PURE__*/_react.default.createElement(_FormControlLabel.default, { + const formControl = /*#__PURE__*/_react.default.createElement(_FormControlLabel.default, { key: key, label: label, "aria-label": tooltip, @@ -1005,8 +973,10 @@ var SiteMapContainer = function SiteMapContainer(props) { enterDelay: 500, enterNextDelay: 200, placement: "bottom-start", - TransitionComponent: function TransitionComponent(_ref) { - var children = _ref.children; + TransitionComponent: _ref => { + let { + children + } = _ref; return children; } // set no transition by mock component }, formControl) : formControl, !allChildren.length ? null : /*#__PURE__*/_react.default.createElement("div", { @@ -1014,27 +984,26 @@ var SiteMapContainer = function SiteMapContainer(props) { marginLeft: _Theme.default.spacing(3), display: collapsed ? 'none' : 'block' } - }, allChildren.filter(function (f) { - return state.filters.features.available[f]; - }).map(renderFeatureOption))); + }, allChildren.filter(f => state.filters.features.available[f]).map(renderFeatureOption))); }; /** Render - Single Overlay Legend */ - var renderOverlayLegend = function renderOverlayLegend(legend) { - var renderItem = function renderItem(legendKey) { - var _legend$legendKey = legend[legendKey], - itemName = _legend$legendKey.name, - itemColor = _legend$legendKey.color, - itemDescription = _legend$legendKey.description; - var swatch = /*#__PURE__*/_react.default.createElement("div", { + const renderOverlayLegend = legend => { + const renderItem = legendKey => { + const { + name: itemName, + color: itemColor, + description: itemDescription + } = legend[legendKey]; + const swatch = /*#__PURE__*/_react.default.createElement("div", { className: classes.overlayLegendSwatch, style: { backgroundColor: itemColor } }); - var itemLabel = /*#__PURE__*/_react.default.createElement("div", { + const itemLabel = /*#__PURE__*/_react.default.createElement("div", { key: legendKey, className: classes.overlayLegendItem }, swatch, /*#__PURE__*/_react.default.createElement(_Typography.default, { @@ -1048,62 +1017,59 @@ var SiteMapContainer = function SiteMapContainer(props) { enterDelay: 500, enterNextDelay: 200, placement: "left", - TransitionComponent: function TransitionComponent(_ref2) { - var children = _ref2.children; + TransitionComponent: _ref2 => { + let { + children + } = _ref2; return children; } }, itemLabel) : itemLabel; }; - if (!Object.keys(legend).some(function (legendKey) { - return legend[legendKey].category; - })) { + if (!Object.keys(legend).some(legendKey => legend[legendKey].category)) { return /*#__PURE__*/_react.default.createElement("div", { className: classes.overlayLegendContainer }, Object.keys(legend).map(renderItem)); } - var otherCategory = 'Other'; - var categories = Object.keys(legend).reduce(function (acc, cur) { + const otherCategory = 'Other'; + const categories = Object.keys(legend).reduce((acc, cur) => { acc.add(legend[cur].category || otherCategory); return acc; }, new Set()); return /*#__PURE__*/_react.default.createElement("div", { className: classes.overlayLegendContainer - }, Array.from(categories).map(function (category, idx) { - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, { - key: category - }, /*#__PURE__*/_react.default.createElement("div", { - className: classes.overlayLegendCategory, - style: { - marginTop: idx ? '8px' : '0px' - } - }, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "caption" - }, category)), Object.keys(legend).filter(function (legendKey) { - return legend[legendKey].category === category || !legend[legendKey].category && category === otherCategory; - }).map(renderItem)); - })); + }, Array.from(categories).map((category, idx) => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, { + key: category + }, /*#__PURE__*/_react.default.createElement("div", { + className: classes.overlayLegendCategory, + style: { + marginTop: idx ? '8px' : '0px' + } + }, /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "caption" + }, category)), Object.keys(legend).filter(legendKey => legend[legendKey].category === category || !legend[legendKey].category && category === otherCategory).map(renderItem)))); }; /** Render - Single Overlay Option */ - var renderOverlayOption = function renderOverlayOption(key) { - var _OVERLAYS$key = _SiteMapUtils.OVERLAYS[key], - title = _OVERLAYS$key.title, - tooltip = _OVERLAYS$key.description, - legend = _OVERLAYS$key.legend; - var handleChange = function handleChange(event) { + const renderOverlayOption = key => { + const { + title, + description: tooltip, + legend + } = _SiteMapUtils.OVERLAYS[key]; + const handleChange = event => { dispatch({ type: 'setMapOverlayVisibility', overlay: key, visible: event.target.checked }); }; - var collapsed = true; - var label = null; + let collapsed = true; + let label = null; if (legend) { collapsed = !state.filters.overlays.expanded.has(key); - var collapseTitle = "".concat(collapsed ? 'Expand' : 'Collapse', " ").concat(title, " Legend"); + const collapseTitle = "".concat(collapsed ? 'Expand' : 'Collapse', " ").concat(title, " Legend"); label = /*#__PURE__*/_react.default.createElement("div", { className: classes.legendOptionLabel, style: { @@ -1124,13 +1090,13 @@ var SiteMapContainer = function SiteMapContainer(props) { style: { margin: _Theme.default.spacing(0, -2, 0, 1) }, - onClick: function onClick(event) { + onClick: event => { event.preventDefault(); // We use setTimeout here so the icon doesn't change before the click event bubbles. // Without it the target of the click event is an SVG that no longer exists in the // DOM tree (thus not contained in the features container, thus seen as a click // outside that will close the features container, when we know it's not). - window.setTimeout(function () { + window.setTimeout(() => { dispatch({ type: "setLegendOverlayOption".concat(collapsed ? 'Expanded' : 'Collapsed'), overlay: key @@ -1147,7 +1113,7 @@ var SiteMapContainer = function SiteMapContainer(props) { className: classes.legendOptionLabel }, /*#__PURE__*/_react.default.createElement("span", null, title)); } - var formControl = /*#__PURE__*/_react.default.createElement(_FormControlLabel.default, { + const formControl = /*#__PURE__*/_react.default.createElement(_FormControlLabel.default, { key: key, label: label, "aria-label": tooltip, @@ -1168,8 +1134,10 @@ var SiteMapContainer = function SiteMapContainer(props) { enterDelay: 500, enterNextDelay: 200, placement: "bottom-start", - TransitionComponent: function TransitionComponent(_ref3) { - var children = _ref3.children; + TransitionComponent: _ref3 => { + let { + children + } = _ref3; return children; } // set no transition by mock component }, formControl) : formControl, collapsed || !legend ? null : renderOverlayLegend(legend)); @@ -1178,62 +1146,25 @@ var SiteMapContainer = function SiteMapContainer(props) { /** Render - Legend - NEON Observatory Features */ - var renderLegendNEONObservatoryFeatures = function renderLegendNEONObservatoryFeatures() { - return /*#__PURE__*/_react.default.createElement("div", { - className: classes.legendSection - }, /*#__PURE__*/_react.default.createElement("div", { - className: classes.legendSectionTitleContainer - }, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "h6", - className: classes.legendSectionTitle - }, "NEON Observatory Features")), Object.keys(_SiteMapUtils.FEATURES).filter(function (f) { - return state.filters.features.available[f] && !_SiteMapUtils.FEATURES[f].parent; - }).filter(function (f) { - return !_SiteMapUtils.FEATURES[f].generalLegendGroup; - }).map(renderFeatureOption)); - }; + const renderLegendNEONObservatoryFeatures = () => /*#__PURE__*/_react.default.createElement("div", { + className: classes.legendSection + }, /*#__PURE__*/_react.default.createElement("div", { + className: classes.legendSectionTitleContainer + }, /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "h6", + className: classes.legendSectionTitle + }, "NEON Observatory Features")), Object.keys(_SiteMapUtils.FEATURES).filter(f => state.filters.features.available[f] && !_SiteMapUtils.FEATURES[f].parent).filter(f => !_SiteMapUtils.FEATURES[f].generalLegendGroup).map(renderFeatureOption)); /** Render - Legend - Overlays */ - var renderLegendOverlays = function renderLegendOverlays() { - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, Object.keys(_SiteMapUtils.OVERLAY_GROUPS).map(function (groupKey) { - var _OVERLAY_GROUPS$group = _SiteMapUtils.OVERLAY_GROUPS[groupKey], - title = _OVERLAY_GROUPS$group.title, - description = _OVERLAY_GROUPS$group.description; - return /*#__PURE__*/_react.default.createElement("div", { - key: groupKey, - className: classes.legendSection - }, /*#__PURE__*/_react.default.createElement("hr", { - className: classes.legendDivider - }), /*#__PURE__*/_react.default.createElement("div", { - className: classes.legendSectionTitleContainer - }, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "h6", - className: classes.legendSectionTitle - }, title), !description ? null : /*#__PURE__*/_react.default.createElement(_Tooltip.default, { - title: description - }, /*#__PURE__*/_react.default.createElement(_IconButton.default, { - size: "small", - style: { - margin: _Theme.default.spacing(0, -0.75, 0, 1) - }, - "aria-label": "".concat(title, " layer group description") - }, /*#__PURE__*/_react.default.createElement(_HelpOutline.default, { - style: { - fontSize: '1rem' - } - })))), Object.keys(_SiteMapUtils.OVERLAYS).filter(function (o) { - return _SiteMapUtils.OVERLAYS[o].group === groupKey; - }).map(renderOverlayOption)); - })); - }; - - /** - Render - Legend - General Features - */ - var renderLegendGeneralFeatures = function renderLegendGeneralFeatures() { + const renderLegendOverlays = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, Object.keys(_SiteMapUtils.OVERLAY_GROUPS).map(groupKey => { + const { + title, + description + } = _SiteMapUtils.OVERLAY_GROUPS[groupKey]; return /*#__PURE__*/_react.default.createElement("div", { + key: groupKey, className: classes.legendSection }, /*#__PURE__*/_react.default.createElement("hr", { className: classes.legendDivider @@ -1242,26 +1173,47 @@ var SiteMapContainer = function SiteMapContainer(props) { }, /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "h6", className: classes.legendSectionTitle - }, "General Features")), Object.keys(_SiteMapUtils.FEATURES).filter(function (f) { - return state.filters.features.available[f] && !_SiteMapUtils.FEATURES[f].parent; - }).filter(function (f) { - return _SiteMapUtils.FEATURES[f].generalLegendGroup; - }).map(renderFeatureOption)); - }; + }, title), !description ? null : /*#__PURE__*/_react.default.createElement(_Tooltip.default, { + title: description + }, /*#__PURE__*/_react.default.createElement(_IconButton.default, { + size: "small", + style: { + margin: _Theme.default.spacing(0, -0.75, 0, 1) + }, + "aria-label": "".concat(title, " layer group description") + }, /*#__PURE__*/_react.default.createElement(_HelpOutline.default, { + style: { + fontSize: '1rem' + } + })))), Object.keys(_SiteMapUtils.OVERLAYS).filter(o => _SiteMapUtils.OVERLAYS[o].group === groupKey).map(renderOverlayOption)); + })); + + /** + Render - Legend - General Features + */ + const renderLegendGeneralFeatures = () => /*#__PURE__*/_react.default.createElement("div", { + className: classes.legendSection + }, /*#__PURE__*/_react.default.createElement("hr", { + className: classes.legendDivider + }), /*#__PURE__*/_react.default.createElement("div", { + className: classes.legendSectionTitleContainer + }, /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "h6", + className: classes.legendSectionTitle + }, "General Features")), Object.keys(_SiteMapUtils.FEATURES).filter(f => state.filters.features.available[f] && !_SiteMapUtils.FEATURES[f].parent).filter(f => _SiteMapUtils.FEATURES[f].generalLegendGroup).map(renderFeatureOption)); /** Render - Full Component */ - var legendContainerClassName = classes.legendContainer; - var viewLegendButtonsContainerClassName = classes.viewLegendButtonsContainer; + let legendContainerClassName = classes.legendContainer; + let viewLegendButtonsContainerClassName = classes.viewLegendButtonsContainer; if (fullscreen) { /* eslint-disable max-len */ legendContainerClassName = "".concat(classes.legendContainer, " ").concat(classes.legendContainerFullscreen); viewLegendButtonsContainerClassName = "".concat(classes.viewLegendButtonsContainer, " ").concat(classes.viewLegendButtonsContainerFullscreen); /* eslint-enable max-len */ } - - var ret = /*#__PURE__*/_react.default.createElement("div", _extends({}, containerProps, { + const ret = /*#__PURE__*/_react.default.createElement("div", _extends({}, containerProps, { "aria-describedby": progressId }), /*#__PURE__*/_react.default.createElement("div", _extends({ ref: contentDivRef @@ -1287,5 +1239,4 @@ SiteMapContainer.defaultProps = { unusableVerticalSpace: 0, mapUniqueId: 0 }; -var _default = SiteMapContainer; -exports.default = _default; \ No newline at end of file +var _default = exports.default = SiteMapContainer; \ No newline at end of file diff --git a/lib/components/SiteMap/SiteMapContext.js b/lib/components/SiteMap/SiteMapContext.js index 538c6cd6..567df54c 100644 --- a/lib/components/SiteMap/SiteMapContext.js +++ b/lib/components/SiteMap/SiteMapContext.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -19,45 +18,29 @@ var _StateStorageConverter = require("./StateStorageConverter"); var _FetchLocationUtils = require("./FetchLocationUtils"); var _SiteMapUtils = require("./SiteMapUtils"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } // Derive the selected status of a given region (US state or NEON domain). This should run every // time the list of selected items changes depending on the selecatble feature type. It regenerates // selectedStates and selectedDomains in state to each contain a key/value lookup where the key is // the region id (state code or domain code) and the value is either 'total' (all sites selected) // or 'partial' (some sites selected). If no sites are selected for the boundary it is omitted from // the map. -var deriveRegionSelections = function deriveRegionSelections(state) { - var _derived; - var derive = function derive(featureKey) { - var featureType = _SiteMapUtils.FEATURES[featureKey].type; +const deriveRegionSelections = state => { + const derive = featureKey => { + const featureType = _SiteMapUtils.FEATURES[featureKey].type; if (!state.neonContextHydrated || !state.featureData[featureType][featureKey]) { return {}; } - var validSet = state.selection.validSet; - var selectedBoundaries = {}; - Object.keys(state.featureData[featureType][featureKey]).forEach(function (boundaryCode) { - var boundarySitesSet = state.featureData[featureType][featureKey][boundaryCode].sites || new Set(); - var selectableSites = !validSet ? boundarySitesSet : new Set(_toConsumableArray(boundarySitesSet).filter(function (siteCode) { - return validSet.has(siteCode); - })); - var intersection = _toConsumableArray(selectableSites).filter(function (x) { - return state.selection.set.has(x); - }); + const { + validSet + } = state.selection; + const selectedBoundaries = {}; + Object.keys(state.featureData[featureType][featureKey]).forEach(boundaryCode => { + const boundarySitesSet = state.featureData[featureType][featureKey][boundaryCode].sites || new Set(); + const selectableSites = !validSet ? boundarySitesSet : new Set([...boundarySitesSet].filter(siteCode => validSet.has(siteCode))); + const intersection = [...selectableSites].filter(x => state.selection.set.has(x)); if (!intersection.length) { return; } @@ -67,14 +50,17 @@ var deriveRegionSelections = function deriveRegionSelections(state) { }; return _extends({}, state, { selection: _extends({}, state.selection, { - derived: (_derived = {}, _defineProperty(_derived, _SiteMapUtils.FEATURES.STATES.KEY, derive(_SiteMapUtils.FEATURES.STATES.KEY)), _defineProperty(_derived, _SiteMapUtils.FEATURES.DOMAINS.KEY, derive(_SiteMapUtils.FEATURES.DOMAINS.KEY)), _derived) + derived: { + [_SiteMapUtils.FEATURES.STATES.KEY]: derive(_SiteMapUtils.FEATURES.STATES.KEY), + [_SiteMapUtils.FEATURES.DOMAINS.KEY]: derive(_SiteMapUtils.FEATURES.DOMAINS.KEY) + } }) }); }; // Returns a boolean indicating whether an item is selectable -var isSelectable = function isSelectable(item) { - var validSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; +const isSelectable = function (item) { + let validSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; if (!item && item !== 0) { return false; } @@ -82,27 +68,24 @@ var isSelectable = function isSelectable(item) { }; // Filters a set down to only selectable items -var getSelectableSet = function getSelectableSet(setArg) { - var validSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; +const getSelectableSet = function (setArg) { + let validSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; if (!(setArg instanceof Set) && !Array.isArray(setArg)) { return new Set(); } - var set = setArg instanceof Set ? setArg : new Set(setArg); - return validSet instanceof Set ? new Set(_toConsumableArray(set).filter(function (item) { - return isSelectable(item, validSet); - })) : set; + const set = setArg instanceof Set ? setArg : new Set(setArg); + return validSet instanceof Set ? new Set([...set].filter(item => isSelectable(item, validSet))) : set; }; // Set the valid flag for selection based on current limits. Empty selections are always invalid. -var validateSelection = function validateSelection(state) { - var valid = false; - var _state$selection = state.selection, - limit = _state$selection.limit, - set = _state$selection.set, - validSet = _state$selection.validSet; - if (set.size > 0 && (!validSet || _toConsumableArray(set).every(function (item) { - return validSet.has(item); - }))) { +const validateSelection = state => { + let valid = false; + const { + limit, + set, + validSet + } = state.selection; + if (set.size > 0 && (!validSet || [...set].every(item => validSet.has(item)))) { valid = true; if (Number.isFinite(limit) && set.size !== limit || Array.isArray(limit) && (set.size < limit[0] || set.size > limit[1])) { valid = false; @@ -110,7 +93,7 @@ var validateSelection = function validateSelection(state) { } return _extends({}, state, { selection: _extends({}, state.selection, { - valid: valid + valid }) }); }; @@ -119,22 +102,14 @@ var validateSelection = function validateSelection(state) { // them all for a given site in order to differentiate them. This impacts how we structure fetches // for base plot features as well as how we turn those fetch results into feater data. This func // is used to consistently inform when to trigger that behavior for a given feature. -var basePlots = [_SiteMapUtils.FEATURES.DISTRIBUTED_BASE_PLOTS.KEY, _SiteMapUtils.FEATURES.TOWER_BASE_PLOTS.KEY]; -var isBasePlot = function isBasePlot(featureKey) { - return basePlots.includes(featureKey); -}; +const basePlots = [_SiteMapUtils.FEATURES.DISTRIBUTED_BASE_PLOTS.KEY, _SiteMapUtils.FEATURES.TOWER_BASE_PLOTS.KEY]; +const isBasePlot = featureKey => basePlots.includes(featureKey); /** Reducer Helpers (functions used exclusively by the reducer) */ -var zoomIsValid = function zoomIsValid(zoom) { - return Number.isInteger(zoom) && zoom >= _SiteMapUtils.MAP_ZOOM_RANGE[0] && zoom <= _SiteMapUtils.MAP_ZOOM_RANGE[1]; -}; -var centerIsValid = function centerIsValid(center) { - return Array.isArray(center) && center.length === 2 && center.every(function (v) { - return typeof v === 'number' && !Number.isNaN(v); - }); -}; +const zoomIsValid = zoom => Number.isInteger(zoom) && zoom >= _SiteMapUtils.MAP_ZOOM_RANGE[0] && zoom <= _SiteMapUtils.MAP_ZOOM_RANGE[1]; +const centerIsValid = center => Array.isArray(center) && center.length === 2 && center.every(v => typeof v === 'number' && !Number.isNaN(v)); // Creates fetch objects with an AWAITING_CALL status based on current state. // New fetches are created for all fetchable feature data found to be active (the feature is @@ -142,28 +117,24 @@ var centerIsValid = function centerIsValid(center) { // Optionally include required sites to consider "in bounds" (useful for when a focus location // is a site feature like a plot far from the site center so the site itself may not be seen as // "in bounds"). -var calculateFeatureDataFetches = function calculateFeatureDataFetches(state) { - var requiredSites = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; +const calculateFeatureDataFetches = function (state) { + let requiredSites = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; // Determine which sites are in the map from the set of all current sites unless // manualLocationData is non-empty and contains prototpye sites - var fetchablePrototypeSites = (state.manualLocationData || []).filter(function (manualLocation) { - return manualLocation.manualLocationType === _SiteMapUtils.MANUAL_LOCATION_TYPES.PROTOTYPE_SITE && state.sites[manualLocation.siteCode]; - }); - var sitesToConsider = state.sites; + const fetchablePrototypeSites = (state.manualLocationData || []).filter(manualLocation => manualLocation.manualLocationType === _SiteMapUtils.MANUAL_LOCATION_TYPES.PROTOTYPE_SITE && state.sites[manualLocation.siteCode]); + let sitesToConsider = state.sites; if (state.manualLocationData && fetchablePrototypeSites.length) { sitesToConsider = {}; - fetchablePrototypeSites.forEach(function (manualLocation) { + fetchablePrototypeSites.forEach(manualLocation => { sitesToConsider[manualLocation.siteCode] = state.sites[manualLocation.siteCode]; }); } - var sitesInMap = (0, _SiteMapUtils.calculateLocationsInBounds)(sitesToConsider, state.map.bounds, true, 0.06); - var requiredSitesArray = []; + const sitesInMap = (0, _SiteMapUtils.calculateLocationsInBounds)(sitesToConsider, state.map.bounds, true, 0.06); + let requiredSitesArray = []; if (requiredSites && requiredSites.length) { - requiredSitesArray = (Array.isArray(requiredSites) ? requiredSites : [requiredSites]).filter(function (siteCode) { - return Object.keys(state.sites).includes(siteCode); - }); + requiredSitesArray = (Array.isArray(requiredSites) ? requiredSites : [requiredSites]).filter(siteCode => Object.keys(state.sites).includes(siteCode)); } - requiredSitesArray.forEach(function (siteCode) { + requiredSitesArray.forEach(siteCode => { if (!sitesInMap.includes(siteCode)) { sitesInMap.push(siteCode); } @@ -171,20 +142,18 @@ var calculateFeatureDataFetches = function calculateFeatureDataFetches(state) { if (!sitesInMap.length) { return state; } - var domainsInMap = new Set(); - sitesInMap.filter(function (siteCode) { - return state.sites[siteCode]; - }).forEach(function (siteCode) { + const domainsInMap = new Set(); + sitesInMap.filter(siteCode => state.sites[siteCode]).forEach(siteCode => { domainsInMap.add(state.sites[siteCode].domainCode); }); - var newState = _extends({}, state); + const newState = _extends({}, state); // Domain-location hierarchy fetches for individual domains // Only fetch if bounds are not null as that way we can trust sitesInMap is not all the sites if (state.map.zoom >= _SiteMapUtils.SITE_LOCATION_HIERARCHIES_MIN_ZOOM && state.map.bounds) { - var hierarchiesSource = _SiteMapUtils.FEATURE_DATA_SOURCES.REST_LOCATIONS_API; - var hierarchiesType = _SiteMapUtils.FEATURE_TYPES.SITE_LOCATION_HIERARCHIES.KEY; - Array.from(domainsInMap).forEach(function (domainCode) { + const hierarchiesSource = _SiteMapUtils.FEATURE_DATA_SOURCES.REST_LOCATIONS_API; + const hierarchiesType = _SiteMapUtils.FEATURE_TYPES.SITE_LOCATION_HIERARCHIES.KEY; + Array.from(domainsInMap).forEach(domainCode => { if (newState.featureDataFetches[hierarchiesSource][hierarchiesType][domainCode]) { return; } @@ -196,11 +165,11 @@ var calculateFeatureDataFetches = function calculateFeatureDataFetches(state) { } // Feature fetches - ARCGIS_ASSET_API - Object.keys(_SiteMapUtils.FEATURES).filter(function (featureKey) { - return _SiteMapUtils.FEATURES[featureKey].dataSource === _SiteMapUtils.FEATURE_DATA_SOURCES.ARCGIS_ASSETS_API && state.filters.features.available[featureKey] && state.filters.features.visible[featureKey]; - }).forEach(function (featureKey) { - var dataSource = _SiteMapUtils.FEATURES[featureKey].dataSource; - sitesInMap.forEach(function (siteCode) { + Object.keys(_SiteMapUtils.FEATURES).filter(featureKey => _SiteMapUtils.FEATURES[featureKey].dataSource === _SiteMapUtils.FEATURE_DATA_SOURCES.ARCGIS_ASSETS_API && state.filters.features.available[featureKey] && state.filters.features.visible[featureKey]).forEach(featureKey => { + const { + dataSource + } = _SiteMapUtils.FEATURES[featureKey]; + sitesInMap.forEach(siteCode => { if (newState.featureDataFetches[dataSource][featureKey][siteCode]) { return; } @@ -213,30 +182,23 @@ var calculateFeatureDataFetches = function calculateFeatureDataFetches(state) { // Feature fetches - REST_LOCATIONS_API Object.keys(_SiteMapUtils.FEATURES) // Only look at available+visible features that get fetched and have a location type match - .filter(function (featureKey) { - return _SiteMapUtils.FEATURES[featureKey].dataSource === _SiteMapUtils.FEATURE_DATA_SOURCES.REST_LOCATIONS_API && _SiteMapUtils.FEATURES[featureKey].matchLocationType && state.filters.features.available[featureKey] && state.filters.features.visible[featureKey]; - }).forEach(function (featureKey) { - var _FEATURES$featureKey = _SiteMapUtils.FEATURES[featureKey], - dataSource = _FEATURES$featureKey.dataSource, - matchLocationType = _FEATURES$featureKey.matchLocationType; + .filter(featureKey => _SiteMapUtils.FEATURES[featureKey].dataSource === _SiteMapUtils.FEATURE_DATA_SOURCES.REST_LOCATIONS_API && _SiteMapUtils.FEATURES[featureKey].matchLocationType && state.filters.features.available[featureKey] && state.filters.features.visible[featureKey]).forEach(featureKey => { + const { + dataSource, + matchLocationType + } = _SiteMapUtils.FEATURES[featureKey]; // For each feature that warrants fetching; loop through the sites in the map sitesInMap // Domain hierarchy must be completed in order to generate subsequent fetches // (only true if site location hierarchy feature data is there) - .filter(function (siteCode) { - return state.featureData.SITE_LOCATION_HIERARCHIES[siteCode]; - }).forEach(function (siteCode) { + .filter(siteCode => state.featureData.SITE_LOCATION_HIERARCHIES[siteCode]).forEach(siteCode => { if (!newState.featureDataFetches[dataSource][featureKey][siteCode]) { newState.featureDataFetches[dataSource][featureKey][siteCode] = {}; } // Extract matching location IDs from the hierarchy and set them as fetches awaiting call - var hierarchy = state.featureData.SITE_LOCATION_HIERARCHIES[siteCode]; - var locationIsMatch = matchLocationType instanceof RegExp ? function (locationKey) { - return matchLocationType.test(hierarchy[locationKey].type); - } : function (locationKey) { - return hierarchy[locationKey].type === matchLocationType; - }; - Object.keys(hierarchy).filter(locationIsMatch).forEach(function (locationKey) { + const hierarchy = state.featureData.SITE_LOCATION_HIERARCHIES[siteCode]; + const locationIsMatch = matchLocationType instanceof RegExp ? locationKey => matchLocationType.test(hierarchy[locationKey].type) : locationKey => hierarchy[locationKey].type === matchLocationType; + Object.keys(hierarchy).filter(locationIsMatch).forEach(locationKey => { if (newState.featureDataFetches[dataSource][featureKey][siteCode][locationKey]) { return; } @@ -252,48 +214,35 @@ var calculateFeatureDataFetches = function calculateFeatureDataFetches(state) { // Start by looping through all minZoom levels associated with any GraphQL Locations API features // Our goal is to build a single fetch containing a flat list of all locations for this site // that are now visible, clustered by minZoom level. - Object.keys(_SiteMapUtils.GRAPHQL_LOCATIONS_API_CONSTANTS.MINZOOM_TO_FEATURES_MAP).filter(function (minZoom) { - return state.map.zoom >= minZoom; - }).forEach(function (minZoom) { + Object.keys(_SiteMapUtils.GRAPHQL_LOCATIONS_API_CONSTANTS.MINZOOM_TO_FEATURES_MAP).filter(minZoom => state.map.zoom >= minZoom).forEach(minZoom => { // Loop through all available and visible features at this minZoom level - _SiteMapUtils.GRAPHQL_LOCATIONS_API_CONSTANTS.MINZOOM_TO_FEATURES_MAP[minZoom].forEach(function (featureKey) { + _SiteMapUtils.GRAPHQL_LOCATIONS_API_CONSTANTS.MINZOOM_TO_FEATURES_MAP[minZoom].forEach(featureKey => { if (!state.filters.features.available[featureKey] || !state.filters.features.visible[featureKey]) { return; } - var _FEATURES$featureKey2 = _SiteMapUtils.FEATURES[featureKey], - dataSource = _FEATURES$featureKey2.dataSource, - matchLocationType = _FEATURES$featureKey2.matchLocationType, - matchLocationName = _FEATURES$featureKey2.matchLocationName; - var companionFeatureKey = !isBasePlot(featureKey) ? null : basePlots.find(function (key) { - return key !== featureKey; - }); - var companionMinZoom = companionFeatureKey ? _SiteMapUtils.GRAPHQL_LOCATIONS_API_CONSTANTS.FEATURES_TO_MINZOOM_MAP[companionFeatureKey] : null; + const { + dataSource, + matchLocationType, + matchLocationName + } = _SiteMapUtils.FEATURES[featureKey]; + const companionFeatureKey = !isBasePlot(featureKey) ? null : basePlots.find(key => key !== featureKey); + const companionMinZoom = companionFeatureKey ? _SiteMapUtils.GRAPHQL_LOCATIONS_API_CONSTANTS.FEATURES_TO_MINZOOM_MAP[companionFeatureKey] : null; if (!newState.featureDataFetches[dataSource][minZoom]) { newState.featureDataFetches[dataSource][minZoom] = {}; } // We've narrowed to minZoom and feature, now narrow to only the sites in the map sitesInMap // Domain hierarchy must be completely loaded in order to generate subsequent fetches - .filter(function (siteCode) { - return state.featureData.SITE_LOCATION_HIERARCHIES[siteCode]; - }) + .filter(siteCode => state.featureData.SITE_LOCATION_HIERARCHIES[siteCode]) // Site must have meaningful features to fetch at this minZoom level - .filter(function (siteCode) { - return state.sites[siteCode].terrain === _SiteMapUtils.FEATURES[featureKey].siteTerrain; - }).forEach(function (siteCode) { - var getInitialSiteCodeFetchObject = function getInitialSiteCodeFetchObject(fetchMinZoom) { - return { - features: Object.fromEntries(_SiteMapUtils.GRAPHQL_LOCATIONS_API_CONSTANTS.MINZOOM_TO_FEATURES_MAP[fetchMinZoom].filter(function (fKey) { - return state.sites[siteCode].terrain === _SiteMapUtils.FEATURES[fKey].siteTerrain; - }).map(function (fKey) { - return [fKey, { - fetchId: null, - locations: [] - }]; - })), - fetches: {} - }; - }; + .filter(siteCode => state.sites[siteCode].terrain === _SiteMapUtils.FEATURES[featureKey].siteTerrain).forEach(siteCode => { + const getInitialSiteCodeFetchObject = fetchMinZoom => ({ + features: Object.fromEntries(_SiteMapUtils.GRAPHQL_LOCATIONS_API_CONSTANTS.MINZOOM_TO_FEATURES_MAP[fetchMinZoom].filter(fKey => state.sites[siteCode].terrain === _SiteMapUtils.FEATURES[fKey].siteTerrain).map(fKey => [fKey, { + fetchId: null, + locations: [] + }])), + fetches: {} + }); // Initialize the fetch structure for the dataSource / minZoom / siteCode if (!newState.featureDataFetches[dataSource][minZoom][siteCode]) { newState.featureDataFetches[dataSource][minZoom][siteCode] = getInitialSiteCodeFetchObject(minZoom); @@ -303,21 +252,20 @@ var calculateFeatureDataFetches = function calculateFeatureDataFetches(state) { if (!newState.featureDataFetches[dataSource][companionMinZoom][siteCode]) { newState.featureDataFetches[dataSource][companionMinZoom][siteCode] = getInitialSiteCodeFetchObject(companionMinZoom); } else { - var companionFeatureObject = newState.featureDataFetches[dataSource][companionMinZoom][siteCode].features[companionFeatureKey]; + const companionFeatureObject = newState.featureDataFetches[dataSource][companionMinZoom][siteCode].features[companionFeatureKey]; newState.featureDataFetches[dataSource][minZoom][siteCode].features[featureKey] = _extends({}, companionFeatureObject); } } - var _newState$featureData = newState.featureDataFetches[dataSource][minZoom][siteCode], - features = _newState$featureData.features, - fetches = _newState$featureData.fetches; + const { + features, + fetches + } = newState.featureDataFetches[dataSource][minZoom][siteCode]; // Stop if this feature already has a fetchID if (features[featureKey].fetchId !== null) { return; } // Find or create a fetch that's awaiting call with a unique ID - var awaitingFetchKey = Object.keys(fetches).find(function (fetchKey) { - return fetches[fetchKey].status === _SiteMapUtils.FETCH_STATUS.AWAITING_CALL; - }); + let awaitingFetchKey = Object.keys(fetches).find(fetchKey => fetches[fetchKey].status === _SiteMapUtils.FETCH_STATUS.AWAITING_CALL); if (!awaitingFetchKey) { awaitingFetchKey = (0, _uniqueId.default)('f'); newState.featureDataFetches[dataSource][minZoom][siteCode].fetches[awaitingFetchKey] = { @@ -334,24 +282,16 @@ var calculateFeatureDataFetches = function calculateFeatureDataFetches(state) { } // Harvest locations from the hierarchy for this feature/site; append to awaiting fetch // Matching function varies depending on how the feature is set up. - var hierarchy = state.featureData.SITE_LOCATION_HIERARCHIES[siteCode]; - var locationIsMatch = function locationIsMatch() { - return false; - }; + const hierarchy = state.featureData.SITE_LOCATION_HIERARCHIES[siteCode]; + let locationIsMatch = () => false; if (matchLocationType instanceof RegExp) { - locationIsMatch = function locationIsMatch(locationKey) { - return matchLocationType.test(hierarchy[locationKey].type); - }; + locationIsMatch = locationKey => matchLocationType.test(hierarchy[locationKey].type); } else if (typeof matchLocationType === 'string') { - locationIsMatch = function locationIsMatch(locationKey) { - return hierarchy[locationKey].type === matchLocationType; - }; + locationIsMatch = locationKey => hierarchy[locationKey].type === matchLocationType; } else if (matchLocationName instanceof RegExp) { - locationIsMatch = function locationIsMatch(locationKey) { - return matchLocationName.test(locationKey); - }; + locationIsMatch = locationKey => matchLocationName.test(locationKey); } - Object.keys(hierarchy).filter(locationIsMatch).forEach(function (locationKey) { + Object.keys(hierarchy).filter(locationIsMatch).forEach(locationKey => { newState.featureDataFetches[dataSource][minZoom][siteCode].fetches[awaitingFetchKey].locations.push(locationKey); newState.featureDataFetches[dataSource][minZoom][siteCode].features[featureKey].locations.push(locationKey); if (isBasePlot(featureKey) && companionMinZoom && companionFeatureKey) { @@ -366,8 +306,8 @@ var calculateFeatureDataFetches = function calculateFeatureDataFetches(state) { }; // NATGEO_WORLD_MAP has no data at zoom 17 or higher so go to WORLD_IMAGERY (satellite) -var updateMapTileWithZoom = function updateMapTileWithZoom(state) { - var newState = _extends({}, state); +const updateMapTileWithZoom = state => { + const newState = _extends({}, state); if (newState.map.zoom <= 17 && state.map.baseLayer !== _SiteMapUtils.BASE_LAYERS.NATGEO_WORLD_MAP.KEY && state.map.baseLayerAutoChangedAbove17) { newState.map.baseLayer = _SiteMapUtils.BASE_LAYERS.NATGEO_WORLD_MAP.KEY; newState.map.baseLayerAutoChangedAbove17 = false; @@ -385,9 +325,9 @@ var updateMapTileWithZoom = function updateMapTileWithZoom(state) { * @param {boolean} init * @return The updated map state */ -var calculateZoomState = function calculateZoomState(zoom, newState) { - var init = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var appliedState = newState; +const calculateZoomState = function (zoom, newState) { + let init = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + let appliedState = newState; appliedState.map.zoomedIcons = (0, _SiteMapUtils.getZoomedIcons)(zoom); appliedState = updateMapTileWithZoom(appliedState); if (!init) { @@ -399,8 +339,8 @@ var calculateZoomState = function calculateZoomState(zoom, newState) { // Increment the completed count for overall fetch and, if completed and expected are now equal, // reset both (so that subsequent batches of fetches can give an accurate progress metric). -var completeOverallFetch = function completeOverallFetch(state) { - var newState = _extends({}, state); +const completeOverallFetch = state => { + const newState = _extends({}, state); newState.overallFetch.completed += 1; if (newState.overallFetch.expected === newState.overallFetch.completed) { newState.overallFetch.expected = 0; @@ -411,16 +351,14 @@ var completeOverallFetch = function completeOverallFetch(state) { }; // Recursively applies a feature visibility change to children down the tree -var applyFeatureVisibilityToChildren = function applyFeatureVisibilityToChildren(state, feature, visible) { +const applyFeatureVisibilityToChildren = (state, feature, visible) => { if (state.filters.features.visible[feature] === visible) { return state; } - var newState = _extends({}, state); + let newState = _extends({}, state); newState.filters.features.visible[feature] = visible; if (_SiteMapUtils.FEATURES[feature].type === _SiteMapUtils.FEATURE_TYPES.GROUP.KEY) { - Object.keys(_SiteMapUtils.FEATURES).filter(function (f) { - return _SiteMapUtils.FEATURES[f].parent === feature; - }).forEach(function (f) { + Object.keys(_SiteMapUtils.FEATURES).filter(f => _SiteMapUtils.FEATURES[f].parent === feature).forEach(f => { newState = applyFeatureVisibilityToChildren(newState, f, visible); }); } @@ -428,15 +366,11 @@ var applyFeatureVisibilityToChildren = function applyFeatureVisibilityToChildren }; // Recursively applies a feature visibility change to parents up the tree -var applyFeatureVisibilityToParents = function applyFeatureVisibilityToParents(state, feature) { - var newState = _extends({}, state); +const applyFeatureVisibilityToParents = (state, feature) => { + let newState = _extends({}, state); if (_SiteMapUtils.FEATURES[feature].parent) { - var parentVisible = Object.keys(_SiteMapUtils.FEATURES).filter(function (f) { - return _SiteMapUtils.FEATURES[f].parent === _SiteMapUtils.FEATURES[feature].parent; - }) // Of all children... - .some(function (f) { - return newState.filters.features.visible[f]; - }); // ...some child is visible + const parentVisible = Object.keys(_SiteMapUtils.FEATURES).filter(f => _SiteMapUtils.FEATURES[f].parent === _SiteMapUtils.FEATURES[feature].parent) // Of all children... + .some(f => newState.filters.features.visible[f]); // ...some child is visible newState.filters.features.visible[_SiteMapUtils.FEATURES[feature].parent] = parentVisible; newState = applyFeatureVisibilityToParents(newState, _SiteMapUtils.FEATURES[feature].parent); } @@ -444,21 +378,25 @@ var applyFeatureVisibilityToParents = function applyFeatureVisibilityToParents(s }; // Returns a boolean describing whether a fetch status was updated -var setFetchStatusFromAction = function setFetchStatusFromAction(state, action, status) { +const setFetchStatusFromAction = (state, action, status) => { if (!Object.keys(_SiteMapUtils.FETCH_STATUS).includes(status) || status === _SiteMapUtils.FETCH_STATUS.AWAITING_CALL) { return state; } - var dataSource = action.dataSource; + const { + dataSource + } = action; if (!_SiteMapUtils.FEATURE_DATA_SOURCES[dataSource]) { return state; } - var newState = _extends({}, state); + const newState = _extends({}, state); // ARCGIS_ASSETS_API if (dataSource === _SiteMapUtils.FEATURE_DATA_SOURCES.ARCGIS_ASSETS_API) { - var featureKey = action.featureKey, - siteCode = action.siteCode, - data = action.data; + const { + featureKey, + siteCode, + data + } = action; if (!_SiteMapUtils.FEATURES[featureKey]) { return newState; } @@ -468,7 +406,9 @@ var setFetchStatusFromAction = function setFetchStatusFromAction(state, action, newState.featureDataFetches[dataSource][featureKey][siteCode] = status; // If the status is SUCCESS and the action has data, also commit the data if (status === _SiteMapUtils.FETCH_STATUS.SUCCESS && data) { - var featureType = _SiteMapUtils.FEATURES[featureKey].type; + const { + type: featureType + } = _SiteMapUtils.FEATURES[featureKey]; newState.featureData[featureType][featureKey][siteCode] = data; } return newState; @@ -476,29 +416,33 @@ var setFetchStatusFromAction = function setFetchStatusFromAction(state, action, // REST_LOCATIONS_API if (dataSource === _SiteMapUtils.FEATURE_DATA_SOURCES.REST_LOCATIONS_API) { - var _featureKey = action.featureKey, - _siteCode = action.siteCode, - location = action.location, - _data = action.data; - if (!_SiteMapUtils.FEATURES[_featureKey]) { + const { + featureKey, + siteCode, + location, + data + } = action; + if (!_SiteMapUtils.FEATURES[featureKey]) { return newState; } - var _featureType = _SiteMapUtils.FEATURES[_featureKey].type; - if (!newState.featureDataFetches[dataSource] || !newState.featureDataFetches[dataSource][_featureKey] || !newState.featureDataFetches[dataSource][_featureKey][_siteCode] || !newState.featureDataFetches[dataSource][_featureKey][_siteCode][location]) { + const { + type: featureType + } = _SiteMapUtils.FEATURES[featureKey]; + if (!newState.featureDataFetches[dataSource] || !newState.featureDataFetches[dataSource][featureKey] || !newState.featureDataFetches[dataSource][featureKey][siteCode] || !newState.featureDataFetches[dataSource][featureKey][siteCode][location]) { return newState; } - newState.featureDataFetches[dataSource][_featureKey][_siteCode][location] = status; + newState.featureDataFetches[dataSource][featureKey][siteCode][location] = status; // If the status is SUCCESS and the action has data, also commit the data - if (status === _SiteMapUtils.FETCH_STATUS.SUCCESS && _data) { - if (!newState.featureData[_featureType][_featureKey][_siteCode]) { - newState.featureData[_featureType][_featureKey][_siteCode] = {}; + if (status === _SiteMapUtils.FETCH_STATUS.SUCCESS && data) { + if (!newState.featureData[featureType][featureKey][siteCode]) { + newState.featureData[featureType][featureKey][siteCode] = {}; } - newState.featureData[_featureType][_featureKey][_siteCode][location] = _extends({}, _data, { - siteCode: _siteCode, - featureKey: _featureKey, + newState.featureData[featureType][featureKey][siteCode][location] = _extends({}, data, { + siteCode, + featureKey, name: location, - domainCode: state.sites[_siteCode].domainCode, - stateCode: state.sites[_siteCode].stateCode + domainCode: state.sites[siteCode].domainCode, + stateCode: state.sites[siteCode].stateCode }); } return newState; @@ -506,27 +450,31 @@ var setFetchStatusFromAction = function setFetchStatusFromAction(state, action, // GRAPHQL_LOCATIONS_API if (dataSource === _SiteMapUtils.FEATURE_DATA_SOURCES.GRAPHQL_LOCATIONS_API) { - var minZoom = action.minZoom, - _siteCode2 = action.siteCode, - fetchId = action.fetchId, - _data2 = action.data; - if (!newState.featureDataFetches[dataSource] || !newState.featureDataFetches[dataSource][minZoom] || !newState.featureDataFetches[dataSource][minZoom][_siteCode2] || !newState.featureDataFetches[dataSource][minZoom][_siteCode2].fetches[fetchId]) { + const { + minZoom, + siteCode, + fetchId, + data + } = action; + if (!newState.featureDataFetches[dataSource] || !newState.featureDataFetches[dataSource][minZoom] || !newState.featureDataFetches[dataSource][minZoom][siteCode] || !newState.featureDataFetches[dataSource][minZoom][siteCode].fetches[fetchId]) { return newState; } - newState.featureDataFetches[dataSource][minZoom][_siteCode2].fetches[fetchId].status = status; + newState.featureDataFetches[dataSource][minZoom][siteCode].fetches[fetchId].status = status; // If the status is SUCCESS and the action has data, also commit the data - if (status === _SiteMapUtils.FETCH_STATUS.SUCCESS && _data2) { + if (status === _SiteMapUtils.FETCH_STATUS.SUCCESS && data) { // Make a map of location names to feature keys for this fetchId - var features = newState.featureDataFetches[dataSource][minZoom][_siteCode2].features; - var locNamesToFeatures = {}; - Object.keys(features).filter(function (featureKey) { - return features[featureKey].fetchId === fetchId; - }).forEach(function (featureKey) { - features[featureKey].locations.forEach(function (locName) { + const { + features + } = newState.featureDataFetches[dataSource][minZoom][siteCode]; + const locNamesToFeatures = {}; + Object.keys(features).filter(featureKey => features[featureKey].fetchId === fetchId).forEach(featureKey => { + features[featureKey].locations.forEach(locName => { // For *_BASE_PLOT features, which both have the same API locationType, determine // which locations go to which feature by looking at the plotType in the data if (isBasePlot(featureKey)) { - var plotType = _data2[locName].plotType; + const { + plotType + } = data[locName]; if (plotType === 'tower') { locNamesToFeatures[locName] = _SiteMapUtils.FEATURES.TOWER_BASE_PLOTS.KEY; } else if (plotType === 'distributed') { @@ -538,35 +486,37 @@ var setFetchStatusFromAction = function setFetchStatusFromAction(state, action, locNamesToFeatures[locName] = featureKey; }); }); - Object.keys(_data2).forEach(function (locName) { - var featureKey = locNamesToFeatures[locName]; + Object.keys(data).forEach(locName => { + const featureKey = locNamesToFeatures[locName]; if (!_SiteMapUtils.FEATURES[featureKey]) { return; } - var _FEATURES$featureKey3 = _SiteMapUtils.FEATURES[featureKey], - featureType = _FEATURES$featureKey3.type, - parentDataFeatureKey = _FEATURES$featureKey3.parentDataFeatureKey, - matchLocationCoordinateMap = _FEATURES$featureKey3.matchLocationCoordinateMap; + const { + type: featureType, + parentDataFeatureKey, + matchLocationCoordinateMap + } = _SiteMapUtils.FEATURES[featureKey]; // This location is supplemental data to another location, so pipe it to the parent record if (parentDataFeatureKey) { - var coordIdx = matchLocationCoordinateMap.findIndex(function (match) { - return locName.endsWith(match); - }); + const coordIdx = matchLocationCoordinateMap.findIndex(match => locName.endsWith(match)); if (coordIdx === -1) { return; } - var parentDataFeatureType = _SiteMapUtils.FEATURES[parentDataFeatureKey].type; - if (!newState.featureData[parentDataFeatureType][parentDataFeatureKey][_siteCode2]) { - newState.featureData[parentDataFeatureType][parentDataFeatureKey][_siteCode2] = {}; + const { + type: parentDataFeatureType + } = _SiteMapUtils.FEATURES[parentDataFeatureKey]; + if (!newState.featureData[parentDataFeatureType][parentDataFeatureKey][siteCode]) { + newState.featureData[parentDataFeatureType][parentDataFeatureKey][siteCode] = {}; } - var _data2$locName = _data2[locName], - parentLocName = _data2$locName.parent, - latitude = _data2$locName.latitude, - longitude = _data2$locName.longitude; + const { + parent: parentLocName, + latitude, + longitude + } = data[locName]; if (!parentLocName) { return; } - var parentSiteData = newState.featureData[parentDataFeatureType][parentDataFeatureKey][_siteCode2]; // eslint-disable-line max-len + const parentSiteData = newState.featureData[parentDataFeatureType][parentDataFeatureKey][siteCode]; // eslint-disable-line max-len if (!parentSiteData[parentLocName]) { parentSiteData[parentLocName] = {}; } @@ -575,7 +525,7 @@ var setFetchStatusFromAction = function setFetchStatusFromAction(state, action, parentSiteData[parentLocName].geometry = { coordinates: [] }; - for (var c = 0; c < matchLocationCoordinateMap.length; c += 1) { + for (let c = 0; c < matchLocationCoordinateMap.length; c += 1) { parentSiteData[parentLocName].geometry.coordinates.push([]); } } @@ -583,35 +533,31 @@ var setFetchStatusFromAction = function setFetchStatusFromAction(state, action, return; } // This is a "normal" location that is not part of another point-based location - if (!newState.featureData[featureType][featureKey][_siteCode2]) { - newState.featureData[featureType][featureKey][_siteCode2] = {}; + if (!newState.featureData[featureType][featureKey][siteCode]) { + newState.featureData[featureType][featureKey][siteCode] = {}; } // Geometry may be loaded by another sub-location so look for that and don't blow it away! - var geometry = !newState.featureData[featureType][featureKey][_siteCode2][locName] || !newState.featureData[featureType][featureKey][_siteCode2][locName].geometry ? null : _extends({}, newState.featureData[featureType][featureKey][_siteCode2][locName].geometry); // eslint-disable-line max-len - newState.featureData[featureType][featureKey][_siteCode2][locName] = _extends({}, _data2[locName], { - featureKey: featureKey, - domainCode: state.sites[_siteCode2].domainCode, - stateCode: state.sites[_siteCode2].stateCode + const geometry = !newState.featureData[featureType][featureKey][siteCode][locName] || !newState.featureData[featureType][featureKey][siteCode][locName].geometry ? null : _extends({}, newState.featureData[featureType][featureKey][siteCode][locName].geometry); // eslint-disable-line max-len + newState.featureData[featureType][featureKey][siteCode][locName] = _extends({}, data[locName], { + featureKey, + domainCode: state.sites[siteCode].domainCode, + stateCode: state.sites[siteCode].stateCode }); if (geometry) { - newState.featureData[featureType][featureKey][_siteCode2][locName].geometry = geometry; + newState.featureData[featureType][featureKey][siteCode][locName].geometry = geometry; } // Base plot features: also pull sampling module data from the hierarchy if (isBasePlot(featureKey)) { - var hierarchy = newState.featureData[_SiteMapUtils.FEATURE_TYPES.SITE_LOCATION_HIERARCHIES.KEY][_siteCode2]; // eslint-disable-line max-len - var basePlot = locName.replace('all', '').replace('.', '\\.'); - var basePlotRegex = new RegExp("^".concat(basePlot, "([a-z]{3})$")); - newState.featureData[featureType][featureKey][_siteCode2][locName].samplingModules = Object.keys(hierarchy).reduce(function (acc, cur) { - var match = cur.match(basePlotRegex); + const hierarchy = newState.featureData[_SiteMapUtils.FEATURE_TYPES.SITE_LOCATION_HIERARCHIES.KEY][siteCode]; // eslint-disable-line max-len + const basePlot = locName.replace('all', '').replace('.', '\\.'); + const basePlotRegex = new RegExp("^".concat(basePlot, "([a-z]{3})$")); + newState.featureData[featureType][featureKey][siteCode][locName].samplingModules = Object.keys(hierarchy).reduce((acc, cur) => { + const match = cur.match(basePlotRegex); if (match) { acc.push(match[1]); } return acc; - }, []).filter(function (k) { - return k !== 'all' && k !== 'mfb' && _SiteMapUtils.PLOT_SAMPLING_MODULES[k]; - }).sort(function (a, b) { - return _SiteMapUtils.PLOT_SAMPLING_MODULES[a] > _SiteMapUtils.PLOT_SAMPLING_MODULES[b] ? 1 : -1; - }); + }, []).filter(k => k !== 'all' && k !== 'mfb' && _SiteMapUtils.PLOT_SAMPLING_MODULES[k]).sort((a, b) => _SiteMapUtils.PLOT_SAMPLING_MODULES[a] > _SiteMapUtils.PLOT_SAMPLING_MODULES[b] ? 1 : -1); } }); } @@ -623,14 +569,16 @@ var setFetchStatusFromAction = function setFetchStatusFromAction(state, action, /** Reducer */ -var reducer = function reducer(state, action) { - var setMethod = null; - var newState = _extends({}, state); - var validSet = state.selection.validSet; +const reducer = (state, action) => { + let setMethod = null; + let newState = _extends({}, state); + const { + validSet + } = state.selection; // Shortcuts for deailing with hierarchies - var hierarchiesSource = _SiteMapUtils.FEATURE_DATA_SOURCES.REST_LOCATIONS_API; - var hierarchiesType = _SiteMapUtils.FEATURE_TYPES.SITE_LOCATION_HIERARCHIES.KEY; + const hierarchiesSource = _SiteMapUtils.FEATURE_DATA_SOURCES.REST_LOCATIONS_API; + const hierarchiesType = _SiteMapUtils.FEATURE_TYPES.SITE_LOCATION_HIERARCHIES.KEY; switch (action.type) { case 'setView': if (!Object.keys(_SiteMapUtils.VIEWS).includes(action.view)) { @@ -697,7 +645,7 @@ var reducer = function reducer(state, action) { if ((0, _SiteMapUtils.boundsAreValid)(action.bounds)) { newState.map.bounds = action.bounds; } - newState.map.center = _toConsumableArray(action.center); + newState.map.center = [...action.center]; return calculateFeatureDataFetches(newState); case 'setMapBaseLayer': if (action.baseLayer !== null && !Object.keys(_SiteMapUtils.BASE_LAYERS).includes(action.baseLayer)) { @@ -718,9 +666,7 @@ var reducer = function reducer(state, action) { } return newState; case 'setMapOverlays': - if (!Array.isArray(action.overlays) || !action.overlays.every(function (o) { - return _SiteMapUtils.OVERLAYS[o]; - })) { + if (!Array.isArray(action.overlays) || !action.overlays.every(o => _SiteMapUtils.OVERLAYS[o])) { return state; } newState.map.overlays = new Set(action.overlays); @@ -825,7 +771,7 @@ var reducer = function reducer(state, action) { newState = completeOverallFetch(newState); newState.map = (0, _SiteMapUtils.getMapStateForFocusLocation)(newState); newState.focusLocation.map.zoom = newState.map.zoom; - newState.focusLocation.map.center = _toConsumableArray(newState.map.center); + newState.focusLocation.map.center = [...newState.map.center]; newState = updateMapTileWithZoom(newState); newState = (0, _SiteMapUtils.calculateFeatureAvailability)(newState); newState = calculateFeatureDataFetches(newState, newState.focusLocation.data && newState.focusLocation.data.siteCode ? [newState.focusLocation.data.siteCode] : []); @@ -881,7 +827,7 @@ var reducer = function reducer(state, action) { } /* eslint-disable max-len */ newState.featureDataFetches[hierarchiesSource][hierarchiesType][action.domainCode] = _SiteMapUtils.FETCH_STATUS.SUCCESS; - Object.keys(action.data).forEach(function (siteCode) { + Object.keys(action.data).forEach(siteCode => { newState.featureData.SITE_LOCATION_HIERARCHIES[siteCode] = action.data[siteCode]; }); /* eslint-enable max-len */ @@ -948,7 +894,7 @@ var reducer = function reducer(state, action) { return state; } setMethod = state.selection.derived[_SiteMapUtils.FEATURES.STATES.KEY][action.stateCode] === _SiteMapUtils.SELECTION_PORTIONS.TOTAL ? 'delete' : 'add'; - getSelectableSet(newState.featureData[_SiteMapUtils.FEATURE_TYPES.STATES.KEY][_SiteMapUtils.FEATURES.STATES.KEY][action.stateCode].sites, validSet).forEach(function (siteCode) { + getSelectableSet(newState.featureData[_SiteMapUtils.FEATURE_TYPES.STATES.KEY][_SiteMapUtils.FEATURES.STATES.KEY][action.stateCode].sites, validSet).forEach(siteCode => { newState.selection.set[setMethod](siteCode); }); newState.selection.changed = true; @@ -961,7 +907,7 @@ var reducer = function reducer(state, action) { } /* eslint-disable max-len */ setMethod = state.selection.derived[_SiteMapUtils.FEATURES.DOMAINS.KEY][action.domainCode] === _SiteMapUtils.SELECTION_PORTIONS.TOTAL ? 'delete' : 'add'; - getSelectableSet(newState.featureData[_SiteMapUtils.FEATURE_TYPES.DOMAINS.KEY][_SiteMapUtils.FEATURES.DOMAINS.KEY][action.domainCode].sites, validSet).forEach(function (siteCode) { + getSelectableSet(newState.featureData[_SiteMapUtils.FEATURE_TYPES.DOMAINS.KEY][_SiteMapUtils.FEATURES.DOMAINS.KEY][action.domainCode].sites, validSet).forEach(siteCode => { newState.selection.set[setMethod](siteCode); }); /* eslint-enable max-len */ @@ -977,11 +923,11 @@ var reducer = function reducer(state, action) { }; /** Context and Hook */ -var Context = /*#__PURE__*/(0, _react.createContext)(_SiteMapUtils.DEFAULT_STATE); -var useSiteMapContext = function useSiteMapContext() { - var hookResponse = (0, _react.useContext)(Context); +const Context = /*#__PURE__*/(0, _react.createContext)(_SiteMapUtils.DEFAULT_STATE); +const useSiteMapContext = () => { + const hookResponse = (0, _react.useContext)(Context); if (hookResponse.length !== 2) { - return [(0, _cloneDeep.default)(_SiteMapUtils.DEFAULT_STATE), function () {}]; + return [(0, _cloneDeep.default)(_SiteMapUtils.DEFAULT_STATE), () => {}]; } return hookResponse; }; @@ -993,40 +939,41 @@ var useSiteMapContext = function useSiteMapContext() { * Keeping this lookup outside of the context provider function * as to not incur lifecycle interference by storing with useState. */ -var restoreStateLookup = {}; +const restoreStateLookup = {}; /** Context Provider */ -var Provider = function Provider(props) { - var view = props.view, - aspectRatio = props.aspectRatio, - fullscreen = props.fullscreen, - mapUniqueId = props.mapUniqueId, - mapZoom = props.mapZoom, - mapCenter = props.mapCenter, - mapBaseLayer = props.mapBaseLayer, - locationProp = props.location, - selection = props.selection, - validItems = props.validItems, - selectedItems = props.selectedItems, - selectionLimit = props.selectionLimit, - onSelectionChange = props.onSelectionChange, - tableFullHeight = props.tableFullHeight, - manualLocationData = props.manualLocationData, - children = props.children; +const Provider = props => { + const { + view, + aspectRatio, + fullscreen, + mapUniqueId, + mapZoom, + mapCenter, + mapBaseLayer, + location: locationProp, + selection, + validItems, + selectedItems, + selectionLimit, + onSelectionChange, + tableFullHeight, + manualLocationData, + children + } = props; // Neon Context State - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - _NeonContext$useNeonC3 = _NeonContext$useNeonC2[0], - neonContextData = _NeonContext$useNeonC3.data, - neonContextIsFinal = _NeonContext$useNeonC3.isFinal, - neonContextHasError = _NeonContext$useNeonC3.hasError; + const [{ + data: neonContextData, + isFinal: neonContextIsFinal, + hasError: neonContextHasError + }] = _NeonContext.default.useNeonContextState(); /** Initial State and Reducer Setup */ - var initialMapZoom = mapZoom === null ? null : Math.max(Math.min(mapZoom, _SiteMapUtils.MAP_ZOOM_RANGE[1]), _SiteMapUtils.MAP_ZOOM_RANGE[0]); - var initialState = (0, _cloneDeep.default)(_SiteMapUtils.DEFAULT_STATE); + const initialMapZoom = mapZoom === null ? null : Math.max(Math.min(mapZoom, _SiteMapUtils.MAP_ZOOM_RANGE[1]), _SiteMapUtils.MAP_ZOOM_RANGE[0]); + let initialState = (0, _cloneDeep.default)(_SiteMapUtils.DEFAULT_STATE); initialState.view.current = Object.keys(_SiteMapUtils.VIEWS).includes(view.toUpperCase()) ? view.toUpperCase() : _SiteMapUtils.VIEWS.MAP; initialState.fullscreen = fullscreen; initialState.map = _extends({}, initialState.map, { @@ -1046,9 +993,7 @@ var Provider = function Provider(props) { initialState.aspectRatio.isDynamic = false; initialState.aspectRatio.currentValue = aspectRatio; } - if (Object.keys(_SiteMapUtils.FEATURE_TYPES).filter(function (k) { - return _SiteMapUtils.FEATURE_TYPES[k].selectable; - }).includes(selection)) { + if (Object.keys(_SiteMapUtils.FEATURE_TYPES).filter(k => _SiteMapUtils.FEATURE_TYPES[k].selectable).includes(selection)) { initialState.selection.active = selection; initialState.selection.limit = selectionLimit; initialState.selection.onChange = onSelectionChange; @@ -1077,155 +1022,152 @@ var Provider = function Provider(props) { } // get the initial state from storage if present - var stateKey = "siteMapContextState-".concat(mapUniqueId); + const stateKey = "siteMapContextState-".concat(mapUniqueId); if (typeof restoreStateLookup[stateKey] === 'undefined') { restoreStateLookup[stateKey] = true; } - var shouldRestoreState = restoreStateLookup[stateKey]; - var stateStorage = (0, _StateStorageService.default)(stateKey); - var savedState = stateStorage.readState(); + const shouldRestoreState = restoreStateLookup[stateKey]; + const stateStorage = (0, _StateStorageService.default)(stateKey); + const savedState = stateStorage.readState(); if (neonContextIsFinal && !neonContextHasError && !savedState) { initialState = (0, _SiteMapUtils.hydrateNeonContextData)(initialState, neonContextData); } - var hasInitialZoom = typeof mapZoom === 'number' && zoomIsValid(mapZoom); + const hasInitialZoom = typeof mapZoom === 'number' && zoomIsValid(mapZoom); if (hasInitialZoom && !savedState) { initialState = calculateZoomState(initialMapZoom, initialState, true); } if (savedState && shouldRestoreState) { restoreStateLookup[stateKey] = false; - var restoredState = (0, _StateStorageConverter.convertStateFromStorage)(savedState, initialState); + const restoredState = (0, _StateStorageConverter.convertStateFromStorage)(savedState, initialState); stateStorage.removeState(); initialState = calculateZoomState(restoredState.map.zoom, restoredState, true); } - var _useReducer = (0, _react.useReducer)(reducer, initialState), - _useReducer2 = _slicedToArray(_useReducer, 2), - state = _useReducer2[0], - dispatch = _useReducer2[1]; + const [state, dispatch] = (0, _react.useReducer)(reducer, initialState); // The current sign in process uses a separate domain. This function // persists the current state in storage when the button is clicked // so the state may be reloaded when the page is reloaded after sign // in. - (0, _react.useEffect)(function () { - var subscription = _NeonSignInButtonState.default.getObservable().subscribe({ - next: function next() { + (0, _react.useEffect)(() => { + const subscription = _NeonSignInButtonState.default.getObservable().subscribe({ + next: () => { if (!_NeonEnvironment.default.enableGlobalSignInState) return; restoreStateLookup[stateKey] = false; stateStorage.saveState((0, _StateStorageConverter.convertStateForStorage)(state)); } }); - return function () { + return () => { subscription.unsubscribe(); }; }, [state, stateStorage, stateKey]); - var canFetchFeatureData = state.neonContextHydrated && !(state.focusLocation.current && state.focusLocation.fetch.status !== _SiteMapUtils.FETCH_STATUS.SUCCESS); + const canFetchFeatureData = state.neonContextHydrated && !(state.focusLocation.current && state.focusLocation.fetch.status !== _SiteMapUtils.FETCH_STATUS.SUCCESS); /** Effect - trigger focusLocation fetch or short circuit if found in NeonContext or manual data */ - (0, _react.useEffect)(function () { - var noop = function noop() {}; - var _state$focusLocation = state.focusLocation, - current = _state$focusLocation.current, - currentStatus = _state$focusLocation.fetch.status; + (0, _react.useEffect)(() => { + const noop = () => {}; + const { + current, + fetch: { + status: currentStatus + } + } = state.focusLocation; if (!current || currentStatus !== _SiteMapUtils.FETCH_STATUS.AWAITING_CALL || !state.neonContextHydrated) { return noop; } // If the location is a known Domain, State, or Site then pull from NeonContext - var _state$featureData$FE = state.featureData[_SiteMapUtils.FEATURE_TYPES.STATES.KEY][_SiteMapUtils.FEATURES.STATES.KEY], - statesData = _state$featureData$FE === void 0 ? {} : _state$featureData$FE; - var _state$featureData$FE2 = state.featureData[_SiteMapUtils.FEATURE_TYPES.DOMAINS.KEY][_SiteMapUtils.FEATURES.DOMAINS.KEY], - domainsData = _state$featureData$FE2 === void 0 ? {} : _state$featureData$FE2; + const { + [_SiteMapUtils.FEATURES.STATES.KEY]: statesData = {} + } = state.featureData[_SiteMapUtils.FEATURE_TYPES.STATES.KEY]; + const { + [_SiteMapUtils.FEATURES.DOMAINS.KEY]: domainsData = {} + } = state.featureData[_SiteMapUtils.FEATURE_TYPES.DOMAINS.KEY]; if (Object.keys(statesData).includes(current)) { - var _statesData$current$c = statesData[current].center, - latitude = _statesData$current$c[0], - longitude = _statesData$current$c[1]; - var timeout = window.setTimeout(function () { + const { + 0: latitude, + 1: longitude + } = statesData[current].center; + const timeout = window.setTimeout(() => { dispatch({ type: 'setFocusLocationFetchSucceeded', data: { type: 'STATE', - latitude: latitude, - longitude: longitude + latitude, + longitude } }); }, 0); - return function () { - return window.clearTimeout(timeout); - }; + return () => window.clearTimeout(timeout); } if (Object.keys(domainsData).includes(current)) { - var _domainsData$current$ = domainsData[current].center, - _latitude = _domainsData$current$[0], - _longitude = _domainsData$current$[1]; - var _timeout = window.setTimeout(function () { + const { + 0: latitude, + 1: longitude + } = domainsData[current].center; + const timeout = window.setTimeout(() => { dispatch({ type: 'setFocusLocationFetchSucceeded', data: { type: 'DOMAIN', - latitude: _latitude, - longitude: _longitude + latitude, + longitude } }); }, 0); - return function () { - return window.clearTimeout(_timeout); - }; + return () => window.clearTimeout(timeout); } if (Object.keys(state.sites).includes(current)) { - var _state$sites$current = state.sites[current], - _latitude2 = _state$sites$current.latitude, - _longitude2 = _state$sites$current.longitude; - var _timeout2 = window.setTimeout(function () { + const { + latitude, + longitude + } = state.sites[current]; + const timeout = window.setTimeout(() => { dispatch({ type: 'setFocusLocationFetchSucceeded', data: { type: 'SITE', - latitude: _latitude2, - longitude: _longitude2 + latitude, + longitude } }); }, 0); - return function () { - return window.clearTimeout(_timeout2); - }; + return () => window.clearTimeout(timeout); } // If the location is found in manualLocationData then pull from there if (state.manualLocationData) { - var manualSite = state.manualLocationData.find(function (ml) { - return ml.siteCode === current; - }); + const manualSite = state.manualLocationData.find(ml => ml.siteCode === current); if (manualSite) { - var _latitude3 = manualSite.latitude, - _longitude3 = manualSite.longitude; - var _timeout3 = window.setTimeout(function () { + const { + latitude, + longitude + } = manualSite; + const timeout = window.setTimeout(() => { dispatch({ type: 'setFocusLocationFetchSucceeded', data: { type: 'SITE', - latitude: _latitude3, - longitude: _longitude3 + latitude, + longitude } }); }, 0); - return function () { - return window.clearTimeout(_timeout3); - }; + return () => window.clearTimeout(timeout); } } // Trigger focus location fetch dispatch({ type: 'setFocusLocationFetchStarted' }); - (0, _FetchLocationUtils.fetchManyLocationsGraphQL)([current]).then(function (response) { + (0, _FetchLocationUtils.fetchManyLocationsGraphQL)([current]).then(response => { dispatch({ type: 'setFocusLocationFetchSucceeded', data: response[current] }); - }).catch(function (error) { + }).catch(error => { dispatch({ type: 'setFocusLocationFetchFailed', - error: error + error }); }); return noop; @@ -1234,7 +1176,7 @@ var Provider = function Provider(props) { /** Effect - trigger all data fetches and imports */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (!canFetchFeatureData || !state.featureDataFetchesHasAwaiting) { return; } @@ -1242,53 +1184,53 @@ var Provider = function Provider(props) { // SITE_LOCATION_HIERARCHIES Fetches (REST_LOCATIONS_API) // These are not features themselves but constitute critical data in order to generate feature // fetches for anything from the locations API family - var hierarchiesSource = _SiteMapUtils.FEATURE_DATA_SOURCES.REST_LOCATIONS_API; - var hierarchiesType = _SiteMapUtils.FEATURE_TYPES.SITE_LOCATION_HIERARCHIES.KEY; - Object.keys(state.featureDataFetches[hierarchiesSource][hierarchiesType]).forEach(function (domainCode) { + const hierarchiesSource = _SiteMapUtils.FEATURE_DATA_SOURCES.REST_LOCATIONS_API; + const hierarchiesType = _SiteMapUtils.FEATURE_TYPES.SITE_LOCATION_HIERARCHIES.KEY; + Object.keys(state.featureDataFetches[hierarchiesSource][hierarchiesType]).forEach(domainCode => { if (state.featureDataFetches[hierarchiesSource][hierarchiesType][domainCode] !== _SiteMapUtils.FETCH_STATUS.AWAITING_CALL) { return; } // eslint-disable-line max-len dispatch({ type: 'setDomainLocationHierarchyFetchStarted', - domainCode: domainCode + domainCode }); - (0, _FetchLocationUtils.fetchDomainHierarchy)(domainCode).then(function (response) { + (0, _FetchLocationUtils.fetchDomainHierarchy)(domainCode).then(response => { dispatch({ type: 'setDomainLocationHierarchyFetchSucceeded', data: response, - domainCode: domainCode + domainCode }); - }).catch(function (error) { + }).catch(error => { dispatch({ type: 'setDomainLocationHierarchyFetchFailed', - error: error, - domainCode: domainCode + error, + domainCode }); }); }); // ARCGIS_ASSETS_API Fetches - var arcgisSource = _SiteMapUtils.FEATURE_DATA_SOURCES.ARCGIS_ASSETS_API; - Object.keys(state.featureDataFetches[arcgisSource]).forEach(function (featureKey) { - Object.keys(state.featureDataFetches[arcgisSource][featureKey]).forEach(function (siteCode) { - var status = state.featureDataFetches[arcgisSource][featureKey][siteCode] || null; + const arcgisSource = _SiteMapUtils.FEATURE_DATA_SOURCES.ARCGIS_ASSETS_API; + Object.keys(state.featureDataFetches[arcgisSource]).forEach(featureKey => { + Object.keys(state.featureDataFetches[arcgisSource][featureKey]).forEach(siteCode => { + const status = state.featureDataFetches[arcgisSource][featureKey][siteCode] || null; if (status !== _SiteMapUtils.FETCH_STATUS.AWAITING_CALL) { return; } dispatch({ type: 'setFeatureDataFetchStarted', dataSource: arcgisSource, - featureKey: featureKey, - siteCode: siteCode + featureKey, + siteCode }); - _NeonApi.default.getArcgisAssetObservable(featureKey, siteCode).pipe((0, _rxjs.map)(function (response) { + _NeonApi.default.getArcgisAssetObservable(featureKey, siteCode).pipe((0, _rxjs.map)(response => { if (response) { dispatch({ type: 'setFeatureDataFetchSucceeded', dataSource: arcgisSource, data: response, - featureKey: featureKey, - siteCode: siteCode + featureKey, + siteCode }); return (0, _rxjs.of)(true); } @@ -1296,17 +1238,17 @@ var Provider = function Provider(props) { type: 'setFeatureDataFetchFailed', dataSource: arcgisSource, error: 'malformed response', - featureKey: featureKey, - siteCode: siteCode + featureKey, + siteCode }); return (0, _rxjs.of)(false); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { dispatch({ type: 'setFeatureDataFetchFailed', dataSource: arcgisSource, error: error.message, - featureKey: featureKey, - siteCode: siteCode + featureKey, + siteCode }); return (0, _rxjs.of)(false); })).subscribe(); @@ -1314,41 +1256,39 @@ var Provider = function Provider(props) { }); // REST_LOCATIONS_API Fetches - var restLocSource = _SiteMapUtils.FEATURE_DATA_SOURCES.REST_LOCATIONS_API; - var restLocFetches = state.featureDataFetches[restLocSource]; - Object.keys(restLocFetches).filter(function (featureKey) { - return featureKey !== _SiteMapUtils.FEATURE_TYPES.SITE_LOCATION_HIERARCHIES.KEY; - }).forEach(function (featureKey) { - Object.keys(state.featureDataFetches[restLocSource][featureKey]).forEach(function (siteCode) { - var featureSite = state.featureDataFetches[restLocSource][featureKey][siteCode]; - Object.keys(featureSite).forEach(function (location) { + const restLocSource = _SiteMapUtils.FEATURE_DATA_SOURCES.REST_LOCATIONS_API; + const restLocFetches = state.featureDataFetches[restLocSource]; + Object.keys(restLocFetches).filter(featureKey => featureKey !== _SiteMapUtils.FEATURE_TYPES.SITE_LOCATION_HIERARCHIES.KEY).forEach(featureKey => { + Object.keys(state.featureDataFetches[restLocSource][featureKey]).forEach(siteCode => { + const featureSite = state.featureDataFetches[restLocSource][featureKey][siteCode]; + Object.keys(featureSite).forEach(location => { if (featureSite[location] !== _SiteMapUtils.FETCH_STATUS.AWAITING_CALL) { return; } dispatch({ type: 'setFeatureDataFetchStarted', dataSource: restLocSource, - featureKey: featureKey, - siteCode: siteCode, - location: location + featureKey, + siteCode, + location }); - (0, _FetchLocationUtils.fetchSingleLocationREST)(location).then(function (data) { + (0, _FetchLocationUtils.fetchSingleLocationREST)(location).then(data => { dispatch({ type: 'setFeatureDataFetchSucceeded', dataSource: restLocSource, - data: data, - featureKey: featureKey, - siteCode: siteCode, - location: location + data, + featureKey, + siteCode, + location }); - }).catch(function (error) { + }).catch(error => { dispatch({ type: 'setFeatureDataFetchFailed', dataSource: restLocSource, error: error.message, - featureKey: featureKey, - siteCode: siteCode, - location: location + featureKey, + siteCode, + location }); }); }); @@ -1356,37 +1296,35 @@ var Provider = function Provider(props) { }); // GRAPHQL_LOCATIONS_API Fetches - var gqlLocSource = _SiteMapUtils.FEATURE_DATA_SOURCES.GRAPHQL_LOCATIONS_API; - var gqlLocFetches = state.featureDataFetches[gqlLocSource]; - Object.keys(gqlLocFetches).forEach(function (minZoom) { - Object.keys(gqlLocFetches[minZoom]).forEach(function (siteCode) { - Object.keys(gqlLocFetches[minZoom][siteCode].fetches).filter(function (fetchId) { - return gqlLocFetches[minZoom][siteCode].fetches[fetchId].status === _SiteMapUtils.FETCH_STATUS.AWAITING_CALL; - }).forEach(function (fetchId) { + const gqlLocSource = _SiteMapUtils.FEATURE_DATA_SOURCES.GRAPHQL_LOCATIONS_API; + const gqlLocFetches = state.featureDataFetches[gqlLocSource]; + Object.keys(gqlLocFetches).forEach(minZoom => { + Object.keys(gqlLocFetches[minZoom]).forEach(siteCode => { + Object.keys(gqlLocFetches[minZoom][siteCode].fetches).filter(fetchId => gqlLocFetches[minZoom][siteCode].fetches[fetchId].status === _SiteMapUtils.FETCH_STATUS.AWAITING_CALL).forEach(fetchId => { dispatch({ type: 'setFeatureDataFetchStarted', dataSource: gqlLocSource, - minZoom: minZoom, - siteCode: siteCode, - fetchId: fetchId + minZoom, + siteCode, + fetchId }); - (0, _FetchLocationUtils.fetchManyLocationsGraphQL)(gqlLocFetches[minZoom][siteCode].fetches[fetchId].locations).then(function (response) { + (0, _FetchLocationUtils.fetchManyLocationsGraphQL)(gqlLocFetches[minZoom][siteCode].fetches[fetchId].locations).then(response => { dispatch({ type: 'setFeatureDataFetchSucceeded', dataSource: gqlLocSource, - minZoom: minZoom, - siteCode: siteCode, - fetchId: fetchId, + minZoom, + siteCode, + fetchId, data: response }); - }).catch(function (error) { + }).catch(error => { dispatch({ type: 'setFeatureDataFetchFailed', dataSource: gqlLocSource, - minZoom: minZoom, - siteCode: siteCode, - fetchId: fetchId, - error: error + minZoom, + siteCode, + fetchId, + error }); }); }); @@ -1400,7 +1338,7 @@ var Provider = function Provider(props) { /** Effect - trigger onChange for selection whenever selection has changed */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (state.selection.changed) { state.selection.onChange(state.selection); } @@ -1428,30 +1366,27 @@ Provider.defaultProps = _SiteMapUtils.SITE_MAP_DEFAULT_PROPS; /** Export */ -var SiteMapContext = { - Provider: Provider, - useSiteMapContext: useSiteMapContext, +const SiteMapContext = { + Provider, + useSiteMapContext, SORT_DIRECTIONS: _SiteMapUtils.SORT_DIRECTIONS, VIEWS: _SiteMapUtils.VIEWS }; -var _default = SiteMapContext; // Additional items exported for unit testing -exports.default = _default; -var getTestableItems = function getTestableItems() { - return process.env.NODE_ENV !== 'test' ? {} : { - deriveRegionSelections: deriveRegionSelections, - isSelectable: isSelectable, - getSelectableSet: getSelectableSet, - validateSelection: validateSelection, - isBasePlot: isBasePlot, - zoomIsValid: zoomIsValid, - centerIsValid: centerIsValid, - calculateFeatureDataFetches: calculateFeatureDataFetches, - updateMapTileWithZoom: updateMapTileWithZoom, - completeOverallFetch: completeOverallFetch, - applyFeatureVisibilityToChildren: applyFeatureVisibilityToChildren, - applyFeatureVisibilityToParents: applyFeatureVisibilityToParents, - setFetchStatusFromAction: setFetchStatusFromAction, - reducer: reducer - }; +var _default = exports.default = SiteMapContext; // Additional items exported for unit testing +const getTestableItems = () => process.env.NODE_ENV !== 'test' ? {} : { + deriveRegionSelections, + isSelectable, + getSelectableSet, + validateSelection, + isBasePlot, + zoomIsValid, + centerIsValid, + calculateFeatureDataFetches, + updateMapTileWithZoom, + completeOverallFetch, + applyFeatureVisibilityToChildren, + applyFeatureVisibilityToParents, + setFetchStatusFromAction, + reducer }; exports.getTestableItems = getTestableItems; \ No newline at end of file diff --git a/lib/components/SiteMap/SiteMapFeature.js b/lib/components/SiteMap/SiteMapFeature.js index f706f740..39ea39fa 100644 --- a/lib/components/SiteMap/SiteMapFeature.js +++ b/lib/components/SiteMap/SiteMapFeature.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -33,200 +32,180 @@ var _SiteMapContext = _interopRequireDefault(require("./SiteMapContext")); var _SiteMapUtils = require("./SiteMapUtils"); var _Theme = _interopRequireWildcard(require("../Theme/Theme")); var _typeUtil = require("../../util/typeUtil"); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* eslint-disable no-underscore-dangle, jsx-a11y/anchor-is-valid */ -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - selectionSnackbar: { - width: '100%', - color: '#000', - justifyContent: 'center', - padding: theme.spacing(0, 1), - boxShadow: 'none' - }, - unselectableSnackbar: { - backgroundColor: _Theme.COLORS.GREY[100], - border: "1px solid ".concat(_Theme.COLORS.GREY[600], "80") - }, - addToSelectionSnackbar: { - backgroundColor: _Theme.COLORS.GREEN[100], - border: "1px solid ".concat(_Theme.COLORS.GREEN[600], "80") - }, - removeFromSelectionSnackbar: { - backgroundColor: _Theme.COLORS.BROWN[100], - border: "1px solid ".concat(_Theme.COLORS.BROWN[600], "80") - }, - selectedSelectionSnackbar: { - backgroundColor: _Theme.COLORS.LIGHT_BLUE[100], - border: "1px solid ".concat(theme.palette.primary.main, "80") - }, - snackbarIcon: { - marginRight: theme.spacing(2) - }, - unselectableSnackbarIcon: { - color: _Theme.COLORS.GREY[300] - }, - addToSelectionSnackbarIcon: { - color: _Theme.COLORS.GREEN[500] - }, - removeFromSelectionSnackbarIcon: { - color: _Theme.COLORS.BROWN[500] - }, - selectedSelectionSnackbarIcon: { +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable no-underscore-dangle, jsx-a11y/anchor-is-valid */ +const useStyles = (0, _styles.makeStyles)(theme => ({ + selectionSnackbar: { + width: '100%', + color: '#000', + justifyContent: 'center', + padding: theme.spacing(0, 1), + boxShadow: 'none' + }, + unselectableSnackbar: { + backgroundColor: _Theme.COLORS.GREY[100], + border: "1px solid ".concat(_Theme.COLORS.GREY[600], "80") + }, + addToSelectionSnackbar: { + backgroundColor: _Theme.COLORS.GREEN[100], + border: "1px solid ".concat(_Theme.COLORS.GREEN[600], "80") + }, + removeFromSelectionSnackbar: { + backgroundColor: _Theme.COLORS.BROWN[100], + border: "1px solid ".concat(_Theme.COLORS.BROWN[600], "80") + }, + selectedSelectionSnackbar: { + backgroundColor: _Theme.COLORS.LIGHT_BLUE[100], + border: "1px solid ".concat(theme.palette.primary.main, "80") + }, + snackbarIcon: { + marginRight: theme.spacing(2) + }, + unselectableSnackbarIcon: { + color: _Theme.COLORS.GREY[300] + }, + addToSelectionSnackbarIcon: { + color: _Theme.COLORS.GREEN[500] + }, + removeFromSelectionSnackbarIcon: { + color: _Theme.COLORS.BROWN[500] + }, + selectedSelectionSnackbarIcon: { + color: theme.palette.primary.main + }, + popup: { + minWidth: '320px', + '& a': { color: theme.palette.primary.main }, - popup: { - minWidth: '320px', - '& a': { - color: theme.palette.primary.main - }, - '& p': { - margin: 'unset' - }, - '& div.leaflet-popup-content-wrapper': { - borderRadius: '2px !important' - }, - '& a.leaflet-popup-close-button': { - top: theme.spacing(0.5), - right: theme.spacing(0.5) - } + '& p': { + margin: 'unset' }, - popupButtonRow: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center', - marginTop: theme.spacing(2), - '& > :not(:last-child)': { - marginRight: theme.spacing(1) - } + '& div.leaflet-popup-content-wrapper': { + borderRadius: '2px !important' }, - popupButton: { - whiteSpace: 'nowrap', - marginBottom: theme.spacing(1), - '& span': { - pointerEvents: 'none' - } - }, - popupSiteIcon: { - width: theme.spacing(2.5), - height: theme.spacing(2.5), - marginRight: theme.spacing(1), - filter: 'drop-shadow(0px 0px 1.5px #000000bb)' - }, - popupSiteSelectedIcon: { + '& a.leaflet-popup-close-button': { + top: theme.spacing(0.5), + right: theme.spacing(0.5) + } + }, + popupButtonRow: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center', + marginTop: theme.spacing(2), + '& > :not(:last-child)': { marginRight: theme.spacing(1) - }, - popupSiteContainer: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center', - marginBottom: theme.spacing(1) - }, - popupFeatureIcon: { - width: theme.spacing(4.5), - height: theme.spacing(4.5), - marginRight: theme.spacing(1.5), - filter: 'drop-shadow(0px 0px 1.5px #000000bb)' - }, - popupFeaturePolygon: { - marginRight: theme.spacing(1.5) - }, - popupTitleContainer: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center', - marginBottom: theme.spacing(1.5) - }, - startFlex: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center' - }, - centerFlex: { - width: '100%', - display: 'flex', - justifyContent: 'center', - alignItems: 'center' - }, - endFlex: { - display: 'flex', - justifyContent: 'flex-end', - alignItems: 'center' - }, - markerIcon: { - marginRight: '2px', - marginBottom: '-3px', - fontSize: '0.95rem' - }, - unselectable: { - filter: 'saturate(0.3) brightness(2)' - }, - nlcdClass: { - width: '36px', - height: '12px', - border: '1px solid black', - marginLeft: theme.spacing(1.5), - marginBottom: '-2px', - display: 'inline-block' } - }; -}); -var positionsArrayIsValid = function positionsArrayIsValid(positions) { - var checkAllCoords = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + }, + popupButton: { + whiteSpace: 'nowrap', + marginBottom: theme.spacing(1), + '& span': { + pointerEvents: 'none' + } + }, + popupSiteIcon: { + width: theme.spacing(2.5), + height: theme.spacing(2.5), + marginRight: theme.spacing(1), + filter: 'drop-shadow(0px 0px 1.5px #000000bb)' + }, + popupSiteSelectedIcon: { + marginRight: theme.spacing(1) + }, + popupSiteContainer: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center', + marginBottom: theme.spacing(1) + }, + popupFeatureIcon: { + width: theme.spacing(4.5), + height: theme.spacing(4.5), + marginRight: theme.spacing(1.5), + filter: 'drop-shadow(0px 0px 1.5px #000000bb)' + }, + popupFeaturePolygon: { + marginRight: theme.spacing(1.5) + }, + popupTitleContainer: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center', + marginBottom: theme.spacing(1.5) + }, + startFlex: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center' + }, + centerFlex: { + width: '100%', + display: 'flex', + justifyContent: 'center', + alignItems: 'center' + }, + endFlex: { + display: 'flex', + justifyContent: 'flex-end', + alignItems: 'center' + }, + markerIcon: { + marginRight: '2px', + marginBottom: '-3px', + fontSize: '0.95rem' + }, + unselectable: { + filter: 'saturate(0.3) brightness(2)' + }, + nlcdClass: { + width: '36px', + height: '12px', + border: '1px solid black', + marginLeft: theme.spacing(1.5), + marginBottom: '-2px', + display: 'inline-block' + } +})); +const positionsArrayIsValid = function (positions) { + let checkAllCoords = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!Array.isArray(positions) || positions.length === 0) { return false; } if (!checkAllCoords) { return true; } - return positions.every(function (p) { - return Array.isArray(p) && (p.length === 2 && p.every(function (c) { - return Number.isFinite(c); - }) || positionsArrayIsValid(p)); - }); + return positions.every(p => Array.isArray(p) && (p.length === 2 && p.every(c => Number.isFinite(c)) || positionsArrayIsValid(p))); }; -var SiteMapFeature = function SiteMapFeature(props) { - var classes = useStyles(_Theme.default); - var mapRef = props.mapRef, - featureKey = props.featureKey; - var feature = _SiteMapUtils.FEATURES[featureKey] || {}; - var _SiteMapContext$useSi = _SiteMapContext.default.useSiteMapContext(), - _SiteMapContext$useSi2 = _slicedToArray(_SiteMapContext$useSi, 2), - state = _SiteMapContext$useSi2[0], - dispatch = _SiteMapContext$useSi2[1]; - var name = feature.name, - nameSingular = feature.nameSingular, - featureType = feature.type, - description = feature.description, - featureStyle = feature.style, - featureShape = feature.featureShape, - iconSvg = feature.iconSvg, - _feature$primaryIdOnl = feature.primaryIdOnly, - primaryIdOnly = _feature$primaryIdOnl === void 0 ? false : _feature$primaryIdOnl, - _feature$amplifyHighl = feature.amplifyHighlighted, - amplifyHighlighted = _feature$amplifyHighl === void 0 ? false : _feature$amplifyHighl, - parentDataFeatureKey = feature.parentDataFeatureKey; - var featureName = nameSingular || name || featureKey; +const SiteMapFeature = props => { + const classes = useStyles(_Theme.default); + const { + mapRef, + featureKey + } = props; + const feature = _SiteMapUtils.FEATURES[featureKey] || {}; + const [state, dispatch] = _SiteMapContext.default.useSiteMapContext(); + const { + name, + nameSingular, + type: featureType, + description, + style: featureStyle, + featureShape, + iconSvg, + primaryIdOnly = false, + amplifyHighlighted = false, + parentDataFeatureKey + } = feature; + const featureName = nameSingular || name || featureKey; if (!_SiteMapUtils.FEATURES[featureKey] || !mapRef.current) { return null; } - var featureDescription = description; - var parentFeature = null; + let featureDescription = description; + let parentFeature = null; if (parentDataFeatureKey && _SiteMapUtils.FEATURES[parentDataFeatureKey]) { parentFeature = _SiteMapUtils.FEATURES[parentDataFeatureKey]; if (description === 'PARENT') { @@ -242,30 +221,41 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Extract feature data from SiteMapContext state */ - var neonContextHydrated = state.neonContextHydrated, - manualLocationData = state.manualLocationData, - mapBounds = state.map.bounds, - focusLocation = state.focusLocation.current, - featureData = state.featureData[parentFeature ? parentFeature.type : featureType][parentFeature ? parentFeature.KEY : featureKey]; + const { + neonContextHydrated, + manualLocationData, + map: { + bounds: mapBounds + }, + focusLocation: { + current: focusLocation + }, + featureData: { + [parentFeature ? parentFeature.type : featureType]: { + [parentFeature ? parentFeature.KEY : featureKey]: featureData + } + } + } = state; if (!neonContextHydrated || !featureData || !Object.keys(featureData)) { return null; } // Whether this feature can affect selection of items in the map - var _state$selection = state.selection, - selectableFeatureType = _state$selection.active, - selectedItems = _state$selection.set, - validItems = _state$selection.validSet, - selectionLimit = _state$selection.limit, - hideUnselectable = _state$selection.hideUnselectable; - var selectionActive = !!state.selection.active; - var selectionType = selectionActive ? state.selection.active : null; - var selectingCurrentFeatureType = selectionType === featureType; + const { + active: selectableFeatureType, + set: selectedItems, + validSet: validItems, + limit: selectionLimit, + hideUnselectable + } = state.selection; + const selectionActive = !!state.selection.active; + const selectionType = selectionActive ? state.selection.active : null; + const selectingCurrentFeatureType = selectionType === featureType; // Whether interaction on this type means selection of another type (e.g. clicking a state or // domain to affect selection of sites in those regions; distinct from selection states or domains // directly). - var selectingActiveTypeByProxy = false; + let selectingActiveTypeByProxy = false; if (selectionActive && !selectingCurrentFeatureType) { switch (selectionType) { case _SiteMapUtils.FEATURE_TYPES.SITES.KEY: @@ -279,8 +269,8 @@ var SiteMapFeature = function SiteMapFeature(props) { } // Jump-To function to afford map navigation where appropriate - var jumpTo = function jumpTo() { - var locationCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + const jumpTo = function () { + let locationCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; dispatch({ type: 'setNewFocusLocation', location: locationCode @@ -296,29 +286,33 @@ var SiteMapFeature = function SiteMapFeature(props) { popups to render in view) in a different way... specifically by positioning them around their parent element dynamcally based on which direction has the most room to render. */ - var positionPopup = function positionPopup() { - var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var latlng = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var hideCloseButton = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + const positionPopup = function () { + let target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let latlng = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let hideCloseButton = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; if (!target || !latlng || !mapRef.current || !mapRef.current.leafletElement) { return; } - var popup = target._popup, - icon = target._icon; + const { + _popup: popup, + _icon: icon + } = target; popup.setLatLng(latlng); - var containerPoint = mapRef.current.leafletElement.latLngToContainerPoint(latlng); - var iconHeight = icon ? icon.height : 0; - var containerNode = popup._container, - containerLeft = popup._containerLeft, - containerBottom = popup._containerBottom, - tipNode = popup._tipContainer; + const containerPoint = mapRef.current.leafletElement.latLngToContainerPoint(latlng); + const iconHeight = icon ? icon.height : 0; + const { + _container: containerNode, + _containerLeft: containerLeft, + _containerBottom: containerBottom, + _tipContainer: tipNode + } = popup; containerNode.style.marginBottom = '0px'; // Leaflet popups always open above; open below if mouse event is in the top half of the map if (containerPoint.y < mapRef.current.container.clientHeight / 2) { - var contentHeight = containerNode.clientHeight; - var tipHeight = tipNode.clientHeight; - var contentBottom = 0 - iconHeight - contentHeight - tipHeight - 1.5 * containerBottom; - var tipBottom = contentHeight + tipHeight - 1; + const contentHeight = containerNode.clientHeight; + const tipHeight = tipNode.clientHeight; + const contentBottom = 0 - iconHeight - contentHeight - tipHeight - 1.5 * containerBottom; + const tipBottom = contentHeight + tipHeight - 1; containerNode.style.bottom = "".concat(contentBottom, "px"); tipNode.style.transform = "rotate(0.5turn) translate(0px, ".concat(tipBottom, "px)"); } else { @@ -326,13 +320,13 @@ var SiteMapFeature = function SiteMapFeature(props) { popup._tipContainer.style.transform = 'translate(0px, -1px)'; } // For left/right we move the popup horizontally as needed while keeping the tip stationary - var contentWidth = containerNode.clientWidth; - var mapWidth = mapRef.current.container.parentNode.clientWidth || 0; - var nudgeBuffer = 40; - var nudgeLimit = contentWidth / 2 - nudgeBuffer / 2; - var overlap = 0; + const contentWidth = containerNode.clientWidth; + const mapWidth = mapRef.current.container.parentNode.clientWidth || 0; + const nudgeBuffer = 40; + const nudgeLimit = contentWidth / 2 - nudgeBuffer / 2; + let overlap = 0; if (mapWidth > contentWidth + nudgeBuffer * 3) { - var nudge = 0; + let nudge = 0; if (containerPoint.x - contentWidth / 2 < 0) { overlap = containerPoint.x - contentWidth / 2; nudge = Math.min(0 - overlap + nudgeBuffer, nudgeLimit); @@ -349,17 +343,17 @@ var SiteMapFeature = function SiteMapFeature(props) { popup._closeButton.style.display = 'none'; } }; - var markerIcon = /*#__PURE__*/_react.default.createElement(_Place.default, { + const markerIcon = /*#__PURE__*/_react.default.createElement(_Place.default, { className: classes.markerIcon }); /** Render: Popup Title with Feature Icon */ - var renderPopupTitle = function renderPopupTitle(title) { - var withFeatureName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - var renderedTitle = withFeatureName ? /*#__PURE__*/_react.default.createElement("span", null, featureName, /*#__PURE__*/_react.default.createElement("br", null), title) : title; - var icon = null; + const renderPopupTitle = function (title) { + let withFeatureName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + const renderedTitle = withFeatureName ? /*#__PURE__*/_react.default.createElement("span", null, featureName, /*#__PURE__*/_react.default.createElement("br", null), title) : title; + let icon = null; if (iconSvg) { icon = /*#__PURE__*/_react.default.createElement("img", { alt: feature.name, @@ -367,7 +361,7 @@ var SiteMapFeature = function SiteMapFeature(props) { className: classes.popupFeatureIcon }); } else if (featureShape === 'Circle') { - var circleProps = { + const circleProps = { cx: 12, cy: 12, r: 8, @@ -384,7 +378,7 @@ var SiteMapFeature = function SiteMapFeature(props) { }, /*#__PURE__*/_react.default.createElement("circle", circleProps)); } else if (featureStyle && ![_SiteMapUtils.FEATURES.DOMAINS.KEY, _SiteMapUtils.FEATURES.STATES.KEY].includes(featureKey)) { // We don't show the rect for states and domains since those cover the whole map when showing. - var rectProps = { + const rectProps = { width: 33, height: 23, x: 1.5, @@ -420,19 +414,19 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Render: a numerical value with units and optional label */ - var renderNumericalValue = function renderNumericalValue(value) { - var label = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; - var precision = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - var aria = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null; - var right = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; - var parens = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false; + const renderNumericalValue = function (value) { + let label = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + let precision = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + let aria = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null; + let right = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; + let parens = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false; // eslint-disable-line max-len - var numberString = Number.isFinite(value) ? "".concat(value.toFixed(precision)).concat(unit) : '--'; + let numberString = Number.isFinite(value) ? "".concat(value.toFixed(precision)).concat(unit) : '--'; if (parens) { numberString = "(".concat(numberString, ")"); } - var visibleValue = /*#__PURE__*/_react.default.createElement(_Typography.default, { + const visibleValue = /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "caption", "aria-label": aria || label, style: { @@ -454,20 +448,20 @@ var SiteMapFeature = function SiteMapFeature(props) { Optionally ghost (fade) icon if selection is active but it's not selectable. If true and the site is not selectable this will also skip rendering altogether when hideUnselectable is true. */ - var renderSite = function renderSite(siteCode) { - var ghostUnselectable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var site = state.sites[siteCode]; + const renderSite = function (siteCode) { + let ghostUnselectable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const site = state.sites[siteCode]; if (!site) { return null; } - var siteFeatureKey = "".concat(site.terrain, "_").concat(site.type, "_SITES"); + const siteFeatureKey = "".concat(site.terrain, "_").concat(site.type, "_SITES"); if (!_SiteMapUtils.FEATURES[siteFeatureKey]) { return null; } - var isSelected = selectedItems.has(siteCode); - var siteIcon = _SiteMapUtils.FEATURES[siteFeatureKey][isSelected ? 'iconSelectedSvg' : 'iconSvg']; - var selectedIcon = null; - var markerStyle = {}; + const isSelected = selectedItems.has(siteCode); + const siteIcon = _SiteMapUtils.FEATURES[siteFeatureKey][isSelected ? 'iconSelectedSvg' : 'iconSvg']; + let selectedIcon = null; + const markerStyle = {}; if (selectionActive && selectionType === _SiteMapUtils.FEATURE_TYPES.SITES.KEY) { if (validItems && !validItems.has(siteCode)) { // eslint-disable-next-line max-len @@ -494,7 +488,7 @@ var SiteMapFeature = function SiteMapFeature(props) { }); } } - var internal = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, selectedIcon, /*#__PURE__*/_react.default.createElement("img", { + const internal = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, selectedIcon, /*#__PURE__*/_react.default.createElement("img", { src: siteIcon, alt: siteCode, className: classes.popupSiteIcon, @@ -505,7 +499,7 @@ var SiteMapFeature = function SiteMapFeature(props) { textAlign: 'left' } }, "".concat(site.description, " (").concat(site.siteCode, ")"))); - var containerProps = { + const containerProps = { key: siteCode, className: classes.popupSiteContainer, style: { @@ -515,9 +509,7 @@ var SiteMapFeature = function SiteMapFeature(props) { return selectionActive ? /*#__PURE__*/_react.default.createElement("div", containerProps, internal) : /*#__PURE__*/_react.default.createElement(_Link.default, _extends({ variant: "caption", component: "button", - onClick: function onClick() { - return jumpTo(site.siteCode); - }, + onClick: () => jumpTo(site.siteCode), "data-selenium": "sitemap-map-popup-siteLink" }, containerProps), internal); }; @@ -525,16 +517,16 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Render: Latitude / Longitude with Copy to Clipboard */ - var renderLatLon = function renderLatLon(latitude, longitude) { - var right = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var renderSubtitle = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - var iconButtonProps = { + const renderLatLon = function (latitude, longitude) { + let right = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + let renderSubtitle = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + const iconButtonProps = { size: 'small', style: { marginRight: _Theme.default.spacing(0.5) } }; - var coords = Number.isFinite(latitude) && Number.isFinite(longitude) ? /*#__PURE__*/_react.default.createElement("div", { + const coords = Number.isFinite(latitude) && Number.isFinite(longitude) ? /*#__PURE__*/_react.default.createElement("div", { className: classes[right ? 'endFlex' : 'startFlex'], "data-selenium": "sitemap-map-popup-coordinates" }, /*#__PURE__*/_react.default.createElement(_reactCopyToClipboard.CopyToClipboard, { @@ -576,13 +568,15 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Render: Elevation */ - var renderElevation = function renderElevation() { - var loc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var right = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var elevation = loc.elevation, - minimumElevation = loc.minimumElevation, - maximumElevation = loc.maximumElevation; - var hasMinMax = Number.isFinite(minimumElevation) || Number.isFinite(maximumElevation); + const renderElevation = function () { + let loc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let right = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const { + elevation, + minimumElevation, + maximumElevation + } = loc; + const hasMinMax = Number.isFinite(minimumElevation) || Number.isFinite(maximumElevation); return /*#__PURE__*/_react.default.createElement("div", { style: { textAlign: right ? 'right' : 'left' @@ -603,8 +597,8 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Render: Plot Size */ - var renderPlotSize = function renderPlotSize() { - var loc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const renderPlotSize = function () { + let loc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return /*#__PURE__*/_react.default.createElement("div", { "data-selenium": "sitemap-map-popup-plotSize" }, /*#__PURE__*/_react.default.createElement(_Typography.default, { @@ -617,9 +611,9 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Render: Plot Slope */ - var renderPlotSlope = function renderPlotSlope() { - var loc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var right = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const renderPlotSlope = function () { + let loc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let right = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; return /*#__PURE__*/_react.default.createElement("div", { style: { textAlign: right ? 'right' : 'left' @@ -627,15 +621,15 @@ var SiteMapFeature = function SiteMapFeature(props) { "data-selenium": "sitemap-map-popup-plotSlope" }, /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "subtitle2" - }, "Plot Slope"), renderNumericalValue(loc.slopeAspect, 'Aspect', "\xB0", 2, 'Slope Aspect', right), renderNumericalValue(loc.slopeGradient, 'Gradient', '%', 2, 'Slope Gradient', right)); + }, "Plot Slope"), renderNumericalValue(loc.slopeAspect, 'Aspect', '\u00b0', 2, 'Slope Aspect', right), renderNumericalValue(loc.slopeGradient, 'Gradient', '%', 2, 'Slope Gradient', right)); }; /** Render: Plot Sampling Modules */ - var renderPlotSamplingModules = function renderPlotSamplingModules() { - var loc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var count = loc.samplingModules.length ? " (".concat(loc.samplingModules.length, ")") : ''; + const renderPlotSamplingModules = function () { + let loc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const count = loc.samplingModules.length ? " (".concat(loc.samplingModules.length, ")") : ''; return /*#__PURE__*/_react.default.createElement(_Grid.default, { item: true, xs: 12, @@ -645,19 +639,18 @@ var SiteMapFeature = function SiteMapFeature(props) { variant: "subtitle2" }, "Potential Sampling Modules".concat(count)), /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "caption" - }, !loc.samplingModules.length ? /*#__PURE__*/_react.default.createElement("i", null, "none") : loc.samplingModules.map(function (m) { - return _SiteMapUtils.PLOT_SAMPLING_MODULES[m]; - }).join(', '))); + }, !loc.samplingModules.length ? /*#__PURE__*/_react.default.createElement("i", null, "none") : loc.samplingModules.map(m => _SiteMapUtils.PLOT_SAMPLING_MODULES[m]).join(', '))); }; /** Render: Popup Row; Boundary Area */ - var renderBoundaryArea = function renderBoundaryArea() { - var bound = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var _ref = bound.properties || {}, - areaKm2 = _ref.areaKm2; - var areaAcres = Number.isFinite(areaKm2) ? _SiteMapUtils.KM2_TO_ACRES * areaKm2 : null; + const renderBoundaryArea = function () { + let bound = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const { + areaKm2 + } = bound.properties || {}; + const areaAcres = Number.isFinite(areaKm2) ? _SiteMapUtils.KM2_TO_ACRES * areaKm2 : null; return /*#__PURE__*/_react.default.createElement(_Grid.default, { item: true, xs: 12, @@ -666,7 +659,7 @@ var SiteMapFeature = function SiteMapFeature(props) { variant: "subtitle2" }, "Area"), /*#__PURE__*/_react.default.createElement("div", { className: classes.startFlex - }, renderNumericalValue(areaKm2, null, "km\xB2", 2, "Area (km\xB2)"), areaAcres === null ? null : /*#__PURE__*/_react.default.createElement("div", { + }, renderNumericalValue(areaKm2, null, 'km\u00b2', 2, 'Area (km\u00b2)'), areaAcres === null ? null : /*#__PURE__*/_react.default.createElement("div", { style: { marginLeft: _Theme.default.spacing(1) } @@ -676,14 +669,13 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Render Method: Popup Row; Child NEON Sites (e.g. within a domain or state) */ - var renderChildSites = function renderChildSites(boundaryKey) { - var _featureData$boundary = featureData[boundaryKey].sites, - sites = _featureData$boundary === void 0 ? new Set() : _featureData$boundary; - var selectable = null; + const renderChildSites = boundaryKey => { + const { + sites = new Set() + } = featureData[boundaryKey]; + let selectable = null; if (selectionActive && selectionType === _SiteMapUtils.FEATURE_TYPES.SITES.KEY) { - var selectableSites = new Set(_toConsumableArray(sites).filter(function (siteCode) { - return !validItems || validItems.has(siteCode); - })); + const selectableSites = new Set([...sites].filter(siteCode => !validItems || validItems.has(siteCode))); if (!selectableSites.size) { selectable = ', none selectable'; } else { @@ -706,16 +698,14 @@ var SiteMapFeature = function SiteMapFeature(props) { }, /*#__PURE__*/_react.default.createElement("i", null, "none"))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "subtitle2", gutterBottom: true - }, "NEON Sites (".concat(sites.size).concat(selectable || '', "):")), /*#__PURE__*/_react.default.createElement("div", null, _toConsumableArray(sites).map(function (siteCode) { - return renderSite(siteCode, selectionType === _SiteMapUtils.FEATURE_TYPES.SITES.KEY); - })))); + }, "NEON Sites (".concat(sites.size).concat(selectable || '', "):")), /*#__PURE__*/_react.default.createElement("div", null, [...sites].map(siteCode => renderSite(siteCode, selectionType === _SiteMapUtils.FEATURE_TYPES.SITES.KEY))))); }; /** Render: Popup Row; Coordinates and Elevation */ - var renderCoordsAndElevation = function renderCoordsAndElevation(loc) { - var renderCoordsSubtitle = Number.isFinite(loc.minimumElevation) || Number.isFinite(loc.maximumElevation); + const renderCoordsAndElevation = loc => { + const renderCoordsSubtitle = Number.isFinite(loc.minimumElevation) || Number.isFinite(loc.maximumElevation); return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, { key: "coordsAndElevation" }, /*#__PURE__*/_react.default.createElement(_Grid.default, { @@ -730,45 +720,41 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Render: Popup Row; Plot Size and Slope */ - var renderPlotSizeAndSlope = function renderPlotSizeAndSlope(loc) { - return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, { - key: "plotSizeAndSlope" - }, /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 6 - }, renderPlotSize(loc)), /*#__PURE__*/_react.default.createElement(_Grid.default, { - item: true, - xs: 6 - }, renderPlotSlope(loc, true))); - }; + const renderPlotSizeAndSlope = loc => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, { + key: "plotSizeAndSlope" + }, /*#__PURE__*/_react.default.createElement(_Grid.default, { + item: true, + xs: 6 + }, renderPlotSize(loc)), /*#__PURE__*/_react.default.createElement(_Grid.default, { + item: true, + xs: 6 + }, renderPlotSlope(loc, true))); /** Render: Popup Row; Tower Details */ - var renderTowerDetails = function renderTowerDetails(loc) { - return /*#__PURE__*/_react.default.createElement(_Grid.default, { - key: "towerDetails", - item: true, - xs: 12, - "data-selenium": "sitemap-map-popup-towerDetails" - }, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "subtitle2" - }, "Levels"), /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "caption" - }, (loc.children || []).length)); - }; + const renderTowerDetails = loc => /*#__PURE__*/_react.default.createElement(_Grid.default, { + key: "towerDetails", + item: true, + xs: 12, + "data-selenium": "sitemap-map-popup-towerDetails" + }, /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "subtitle2" + }, "Levels"), /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "caption" + }, (loc.children || []).length)); /** Render: Popup Row; NLCD Classes (nationalLandCoverDatabase2001) */ - var renderNlcdClass = function renderNlcdClass(loc) { - var nlcd = /*#__PURE__*/_react.default.createElement("i", null, "n/a"); - var titleStyle = {}; + const renderNlcdClass = loc => { + let nlcd = /*#__PURE__*/_react.default.createElement("i", null, "n/a"); + const titleStyle = {}; if (loc.nlcdClass) { nlcd = loc.nlcdClass; if (_SiteMapUtils.NLCD_CLASSES[loc.nlcdClass]) { titleStyle.marginBottom = '-4px'; - var tooltip = "".concat(_SiteMapUtils.NLCD_CLASSES[loc.nlcdClass].name, " - ").concat(_SiteMapUtils.NLCD_CLASSES[loc.nlcdClass].description); + const tooltip = "".concat(_SiteMapUtils.NLCD_CLASSES[loc.nlcdClass].name, " - ").concat(_SiteMapUtils.NLCD_CLASSES[loc.nlcdClass].description); nlcd = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, _SiteMapUtils.NLCD_CLASSES[loc.nlcdClass].name, /*#__PURE__*/_react.default.createElement("div", { className: classes.nlcdClass, title: _SiteMapUtils.NLCD_CLASSES[loc.nlcdClass].name, @@ -807,13 +793,15 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Render: Popup Row; Location Site and Domain */ - var renderLocationSiteAndDomain = function renderLocationSiteAndDomain(siteCode) { - var site = state.sites[siteCode]; + const renderLocationSiteAndDomain = siteCode => { + const site = state.sites[siteCode]; if (!site || !state.featureData.DOMAINS.DOMAINS[site.domainCode]) { return null; } - var domainName = state.featureData.DOMAINS.DOMAINS[site.domainCode].name; - var domainTitle = "".concat(site.domainCode, " - ").concat(domainName); + const { + name: domainName + } = state.featureData.DOMAINS.DOMAINS[site.domainCode]; + const domainTitle = "".concat(site.domainCode, " - ").concat(domainName); return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, { key: "locationSiteAndDomain" }, /*#__PURE__*/_react.default.createElement(_Grid.default, { @@ -839,13 +827,11 @@ var SiteMapFeature = function SiteMapFeature(props) { style: { textAlign: 'right' }, - onClick: function onClick() { - return jumpTo(site.domainCode); - }, + onClick: () => jumpTo(site.domainCode), "data-selenium": "sitemap-map-popup-domainLink" }, markerIcon, domainTitle)))); }; - var popupProps = { + const popupProps = { className: classes.popup, autoPan: false, id: 'sitemap-map-popup' @@ -856,68 +842,61 @@ var SiteMapFeature = function SiteMapFeature(props) { Standard title with icon, row with coordinates and elevation, row with parent site and domain Optional additional rows will appear between coordinates/elevation and site/domain */ - var renderLocationPopup = function renderLocationPopup(siteCode, location) { - var additionalRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; - var loc = (featureData[siteCode] || {})[location] || {}; + const renderLocationPopup = function (siteCode, location) { + let additionalRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + const loc = (featureData[siteCode] || {})[location] || {}; return /*#__PURE__*/_react.default.createElement(_reactLeaflet.Popup, popupProps, renderPopupTitle(location), /*#__PURE__*/_react.default.createElement(_Grid.default, { container: true, spacing: 1 - }, renderCoordsAndElevation(loc), additionalRows.map(function (row) { - return typeof row === 'function' ? row(loc) : row; - }), loc.nlcdClass ? renderNlcdClass(loc) : null, renderLocationSiteAndDomain(siteCode))); + }, renderCoordsAndElevation(loc), additionalRows.map(row => typeof row === 'function' ? row(loc) : row), loc.nlcdClass ? renderNlcdClass(loc) : null, renderLocationSiteAndDomain(siteCode))); }; /** Render: Boundary popup Standard title with bound outline. Show area if present. */ - var renderBoundaryPopup = function renderBoundaryPopup(key) { - var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var additionalRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; - var _ref2 = featureData[key] || {}, - _ref2$properties = _ref2.properties, - properties = _ref2$properties === void 0 ? {} : _ref2$properties; + const renderBoundaryPopup = function (key) { + let title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let additionalRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + const { + properties = {} + } = featureData[key] || {}; return /*#__PURE__*/_react.default.createElement(_reactLeaflet.Popup, popupProps, renderPopupTitle(title || key, !title), /*#__PURE__*/_react.default.createElement(_Grid.default, { container: true, spacing: 1 - }, properties.areaKm2 ? renderBoundaryArea(featureData[key]) : null, Array.isArray(additionalRows) ? additionalRows.map(function (row) { - return typeof row === 'function' ? row(key) : row; - }) : null, renderLocationSiteAndDomain(key))); + }, properties.areaKm2 ? renderBoundaryArea(featureData[key]) : null, Array.isArray(additionalRows) ? additionalRows.map(row => typeof row === 'function' ? row(key) : row) : null, renderLocationSiteAndDomain(key))); }; /** Render: Region Selection Action */ - var renderRegionSelectionAction = function renderRegionSelectionAction(boundaryFeatureKey, boundaryKey) { + const renderRegionSelectionAction = (boundaryFeatureKey, boundaryKey) => { if (!selectionActive || !state.selection.derived[boundaryFeatureKey] || selectionLimit === 1) { return null; } - var _featureData$boundary2 = featureData[boundaryKey].sites, - boundarySites = _featureData$boundary2 === void 0 ? new Set() : _featureData$boundary2; + const { + sites: boundarySites = new Set() + } = featureData[boundaryKey]; if (!boundarySites.size) { return null; } - var selectionPortion = state.selection.derived[boundaryFeatureKey][boundaryKey] || null; - var selectableSites = !validItems ? boundarySites : new Set(_toConsumableArray(boundarySites).filter(function (siteCode) { - return validItems.has(siteCode); - })); - var selectableCount = selectableSites.size; - var ActionIcon = selectableCount ? _TouchApp.default : _NotInterested.default; - var selectable = boundarySites.size === selectableCount ? '' : ' selectable'; - var thisOne = boundarySites.size === selectableCount ? 'this one' : 'the one'; - var action = selectableCount === 1 ? "add ".concat(thisOne).concat(selectable, " site") : "add all ".concat(selectableCount).concat(selectable, " sites"); - var preposition = 'to'; + const selectionPortion = state.selection.derived[boundaryFeatureKey][boundaryKey] || null; + const selectableSites = !validItems ? boundarySites : new Set([...boundarySites].filter(siteCode => validItems.has(siteCode))); + const selectableCount = selectableSites.size; + const ActionIcon = selectableCount ? _TouchApp.default : _NotInterested.default; + const selectable = boundarySites.size === selectableCount ? '' : ' selectable'; + const thisOne = boundarySites.size === selectableCount ? 'this one' : 'the one'; + let action = selectableCount === 1 ? "add ".concat(thisOne).concat(selectable, " site") : "add all ".concat(selectableCount).concat(selectable, " sites"); + let preposition = 'to'; /* eslint-disable max-len */ - var snackbarClass = classes[selectableCount ? 'addToSelectionSnackbar' : 'unselectableSnackbar']; - var snackbarIconClass = classes[selectableCount ? 'addToSelectionSnackbarIcon' : 'unselectableSnackbarIcon']; + let snackbarClass = classes[selectableCount ? 'addToSelectionSnackbar' : 'unselectableSnackbar']; + let snackbarIconClass = classes[selectableCount ? 'addToSelectionSnackbarIcon' : 'unselectableSnackbarIcon']; /* eslint-enable max-len */ - var actionText = "No sites in this ".concat(_SiteMapUtils.FEATURES[boundaryFeatureKey].nameSingular, " are selectable"); + let actionText = "No sites in this ".concat(_SiteMapUtils.FEATURES[boundaryFeatureKey].nameSingular, " are selectable"); if (selectableCount) { if (selectionPortion === _SiteMapUtils.SELECTION_PORTIONS.PARTIAL) { - var intersection = new Set(_toConsumableArray(selectableSites).filter(function (x) { - return selectedItems.has(x); - })); - var remaining = selectableCount - intersection.size; + const intersection = new Set([...selectableSites].filter(x => selectedItems.has(x))); + const remaining = selectableCount - intersection.size; action = "add remaining ".concat(remaining).concat(selectable, " site").concat(remaining === 1 ? '' : 's'); } if (selectionPortion === _SiteMapUtils.SELECTION_PORTIONS.TOTAL) { @@ -950,19 +929,19 @@ var SiteMapFeature = function SiteMapFeature(props) { Render: Item Selection Action Snackbar for a Popup (Only for selecting the item directly; selection by proxy action snackbars are different) */ - var renderItemSelectionActionSnackbar = function renderItemSelectionActionSnackbar(item) { + const renderItemSelectionActionSnackbar = item => { if (!selectionActive) { return null; } - var unit = _SiteMapUtils.FEATURE_TYPES[selectionType].unit || 'item'; - var isSelectable = !validItems || validItems.has(item); - var isSelected = selectedItems.has(item); - var verb = isSelected ? 'remove' : 'add'; - var preposition = isSelected ? 'from' : 'to'; - var ActionIcon = _NotInterested.default; - var action = "This ".concat(unit, " cannot be selected"); - var snackbarClass = classes.unselectableSnackbar; - var snackbarIconClass = classes.unselectableSnackbarIcon; + const unit = _SiteMapUtils.FEATURE_TYPES[selectionType].unit || 'item'; + const isSelectable = !validItems || validItems.has(item); + const isSelected = selectedItems.has(item); + const verb = isSelected ? 'remove' : 'add'; + const preposition = isSelected ? 'from' : 'to'; + let ActionIcon = _NotInterested.default; + let action = "This ".concat(unit, " cannot be selected"); + let snackbarClass = classes.unselectableSnackbar; + let snackbarIconClass = classes.unselectableSnackbarIcon; if (isSelectable) { ActionIcon = _TouchApp.default; if (selectionLimit === 1) { @@ -992,18 +971,20 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Render: Site Popup */ - var renderSitePopup = function renderSitePopup(siteCode) { - var site = featureData[siteCode] || {}; - var _state$featureData$FE = state.featureData[_SiteMapUtils.FEATURE_TYPES.STATES.KEY][_SiteMapUtils.FEATURES.STATES.KEY][site.stateCode], - usState = _state$featureData$FE === void 0 ? {} : _state$featureData$FE; - var _state$featureData$FE2 = state.featureData[_SiteMapUtils.FEATURE_TYPES.DOMAINS.KEY][_SiteMapUtils.FEATURES.DOMAINS.KEY][site.domainCode], - domain = _state$featureData$FE2 === void 0 ? {} : _state$featureData$FE2; - var stateFieldTitle = site.stateCode === 'PR' ? 'Territory' : 'State'; - var renderActions = function renderActions() { + const renderSitePopup = siteCode => { + const site = featureData[siteCode] || {}; + const { + [site.stateCode]: usState = {} + } = state.featureData[_SiteMapUtils.FEATURE_TYPES.STATES.KEY][_SiteMapUtils.FEATURES.STATES.KEY]; + const { + [site.domainCode]: domain = {} + } = state.featureData[_SiteMapUtils.FEATURE_TYPES.DOMAINS.KEY][_SiteMapUtils.FEATURES.DOMAINS.KEY]; + const stateFieldTitle = site.stateCode === 'PR' ? 'Territory' : 'State'; + const renderActions = () => { if (selectionActive) { return selectingCurrentFeatureType ? renderItemSelectionActionSnackbar(site.siteCode) : null; } - var actionButtonProps = { + const actionButtonProps = { className: classes.popupButton, variant: 'outlined', color: 'primary', @@ -1023,9 +1004,7 @@ var SiteMapFeature = function SiteMapFeature(props) { return /*#__PURE__*/_react.default.createElement(_reactLeaflet.Popup, popupProps, renderPopupTitle("".concat(site.description, " (").concat(site.siteCode, ")"), false), selectionActive ? null : /*#__PURE__*/_react.default.createElement(_Link.default, { variant: "caption", component: "button", - onClick: function onClick() { - return jumpTo(site.siteCode); - }, + onClick: () => jumpTo(site.siteCode), style: { marginLeft: '-2px', marginBottom: '8px' @@ -1062,9 +1041,7 @@ var SiteMapFeature = function SiteMapFeature(props) { style: { textAlign: 'right' }, - onClick: function onClick() { - return jumpTo(site.stateCode); - }, + onClick: () => jumpTo(site.stateCode), "data-selenium": "sitemap-map-popup-stateLink" }, markerIcon, usState.name))), /*#__PURE__*/_react.default.createElement(_Grid.default, { item: true, @@ -1091,9 +1068,7 @@ var SiteMapFeature = function SiteMapFeature(props) { style: { textAlign: 'right' }, - onClick: function onClick() { - return jumpTo(site.domainCode); - }, + onClick: () => jumpTo(site.domainCode), "data-selenium": "sitemap-map-popup-domainLink" }, markerIcon, "".concat(site.domainCode, " - ").concat(domain.name))))), renderActions()); }; @@ -1101,19 +1076,19 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Render: Decommissioned Site Popup */ - var renderDecommissionedSitePopup = function renderDecommissionedSitePopup(siteCode) { - var site = featureData[siteCode] || {}; - var _state$featureData$FE3 = state.featureData[_SiteMapUtils.FEATURE_TYPES.STATES.KEY][_SiteMapUtils.FEATURES.STATES.KEY][site.state], - usState = _state$featureData$FE3 === void 0 ? {} : _state$featureData$FE3; - var _state$featureData$FE4 = state.featureData[_SiteMapUtils.FEATURE_TYPES.DOMAINS.KEY][_SiteMapUtils.FEATURES.DOMAINS.KEY][site.domain], - domain = _state$featureData$FE4 === void 0 ? {} : _state$featureData$FE4; - var stateFieldTitle = site.stateCode === 'PR' ? 'Territory' : 'State'; + const renderDecommissionedSitePopup = siteCode => { + const site = featureData[siteCode] || {}; + const { + [site.state]: usState = {} + } = state.featureData[_SiteMapUtils.FEATURE_TYPES.STATES.KEY][_SiteMapUtils.FEATURES.STATES.KEY]; + const { + [site.domain]: domain = {} + } = state.featureData[_SiteMapUtils.FEATURE_TYPES.DOMAINS.KEY][_SiteMapUtils.FEATURES.DOMAINS.KEY]; + const stateFieldTitle = site.stateCode === 'PR' ? 'Territory' : 'State'; return /*#__PURE__*/_react.default.createElement(_reactLeaflet.Popup, popupProps, renderPopupTitle("".concat(site.siteName, " (").concat(site.siteCode, ")"), false), /*#__PURE__*/_react.default.createElement(_Link.default, { variant: "caption", component: "button", - onClick: function onClick() { - return jumpTo(site.siteCode); - }, + onClick: () => jumpTo(site.siteCode), style: { marginLeft: '-2px', marginBottom: '8px' @@ -1150,9 +1125,7 @@ var SiteMapFeature = function SiteMapFeature(props) { style: { textAlign: 'right' }, - onClick: function onClick() { - return jumpTo(site.state); - }, + onClick: () => jumpTo(site.state), "data-selenium": "sitemap-map-popup-stateLink" }, markerIcon, usState.name))), /*#__PURE__*/_react.default.createElement(_Grid.default, { item: true, @@ -1179,9 +1152,7 @@ var SiteMapFeature = function SiteMapFeature(props) { style: { textAlign: 'right' }, - onClick: function onClick() { - return jumpTo(site.domain); - }, + onClick: () => jumpTo(site.domain), "data-selenium": "sitemap-map-popup-domainLink" }, markerIcon, "".concat(site.domain, " - ").concat(domain.name)))))); }; @@ -1190,10 +1161,8 @@ var SiteMapFeature = function SiteMapFeature(props) { Render - All the Rest of the Popups Convention is alphabetical listing of keys since order here doesn't matter */ - var renderLocationPopupWithPlotSizeAndSlope = function renderLocationPopupWithPlotSizeAndSlope(siteCode, location) { - return renderLocationPopup(siteCode, location, [renderPlotSizeAndSlope]); - }; - var renderPopupFunctions = { + const renderLocationPopupWithPlotSizeAndSlope = (siteCode, location) => renderLocationPopup(siteCode, location, [renderPlotSizeAndSlope]); + const renderPopupFunctions = { AQUATIC_BENCHMARKS: renderLocationPopup, AQUATIC_BUOYS: renderLocationPopup, AQUATIC_CORE_SITES: renderSitePopup, @@ -1210,9 +1179,7 @@ var SiteMapFeature = function SiteMapFeature(props) { AQUATIC_STAFF_GAUGES: renderLocationPopup, AQUATIC_WET_DEPOSITION_POINTS: renderLocationPopup, DECOMMISSIONED_SITES: renderDecommissionedSitePopup, - DISTRIBUTED_BASE_PLOTS: function DISTRIBUTED_BASE_PLOTS(siteCode, location) { - return renderLocationPopup(siteCode, location, [renderPlotSizeAndSlope, renderPlotSamplingModules]); - }, + DISTRIBUTED_BASE_PLOTS: (siteCode, location) => renderLocationPopup(siteCode, location, [renderPlotSizeAndSlope, renderPlotSamplingModules]), DISTRIBUTED_BIRD_GRID_BOUNDARIES: renderLocationPopupWithPlotSizeAndSlope, DISTRIBUTED_BIRD_GRIDS: renderLocationPopupWithPlotSizeAndSlope, DISTRIBUTED_MAMMAL_GRID_BOUNDARIES: renderLocationPopupWithPlotSizeAndSlope, @@ -1220,15 +1187,13 @@ var SiteMapFeature = function SiteMapFeature(props) { DISTRIBUTED_MOSQUITO_POINTS: renderLocationPopupWithPlotSizeAndSlope, DISTRIBUTED_TICK_PLOT_BOUNDARIES: renderLocationPopupWithPlotSizeAndSlope, DISTRIBUTED_TICK_PLOTS: renderLocationPopupWithPlotSizeAndSlope, - DOMAINS: function DOMAINS(domainCode) { - var title = !featureData[domainCode] ? null : /*#__PURE__*/_react.default.createElement("span", null, "NEON Domain ".concat(domainCode.replace('D', ''), " - ").concat(featureData[domainCode].name)); - var jumpLink = selectionActive ? null : /*#__PURE__*/_react.default.createElement(_Link.default, { + DOMAINS: domainCode => { + const title = !featureData[domainCode] ? null : /*#__PURE__*/_react.default.createElement("span", null, "NEON Domain ".concat(domainCode.replace('D', ''), " - ").concat(featureData[domainCode].name)); + const jumpLink = selectionActive ? null : /*#__PURE__*/_react.default.createElement(_Link.default, { key: "jumpLink", variant: "caption", component: "button", - onClick: function onClick() { - return jumpTo(domainCode); - }, + onClick: () => jumpTo(domainCode), style: { marginBottom: '8px' }, @@ -1240,21 +1205,17 @@ var SiteMapFeature = function SiteMapFeature(props) { HUTS: renderLocationPopup, MEGAPITS: renderLocationPopup, // eslint-disable-next-line react/no-unstable-nested-components - POUR_POINTS: function POUR_POINTS(siteCode) { - return /*#__PURE__*/_react.default.createElement(_reactLeaflet.Popup, popupProps, renderPopupTitle("".concat(siteCode, " Watershed Pour Point")), /*#__PURE__*/_react.default.createElement(_Grid.default, { - container: true, - spacing: 1 - }, renderLocationSiteAndDomain(siteCode))); - }, + POUR_POINTS: siteCode => /*#__PURE__*/_react.default.createElement(_reactLeaflet.Popup, popupProps, renderPopupTitle("".concat(siteCode, " Watershed Pour Point")), /*#__PURE__*/_react.default.createElement(_Grid.default, { + container: true, + spacing: 1 + }, renderLocationSiteAndDomain(siteCode))), SAMPLING_BOUNDARIES: renderBoundaryPopup, - STATES: function STATES(stateCode) { - var jumpLink = selectionActive ? null : /*#__PURE__*/_react.default.createElement(_Link.default, { + STATES: stateCode => { + const jumpLink = selectionActive ? null : /*#__PURE__*/_react.default.createElement(_Link.default, { key: "jumpLink", variant: "caption", component: "button", - onClick: function onClick() { - return jumpTo(stateCode); - }, + onClick: () => jumpTo(stateCode), style: { marginBottom: '8px' }, @@ -1265,20 +1226,16 @@ var SiteMapFeature = function SiteMapFeature(props) { TERRESTRIAL_CORE_SITES: renderSitePopup, TERRESTRIAL_GRADIENT_SITES: renderSitePopup, TOWER_AIRSHEDS: renderBoundaryPopup, - TOWER_BASE_PLOTS: function TOWER_BASE_PLOTS(siteCode, location) { - return renderLocationPopup(siteCode, location, [renderPlotSizeAndSlope, renderPlotSamplingModules]); - }, + TOWER_BASE_PLOTS: (siteCode, location) => renderLocationPopup(siteCode, location, [renderPlotSizeAndSlope, renderPlotSamplingModules]), TOWER_PHENOLOGY_PLOT_BOUNDARIES: renderLocationPopupWithPlotSizeAndSlope, TOWER_PHENOLOGY_PLOTS: renderLocationPopupWithPlotSizeAndSlope, TOWER_SOIL_PLOTS: renderLocationPopup, - TOWERS: function TOWERS(siteCode, location) { - return renderLocationPopup(siteCode, location, [renderTowerDetails]); - }, + TOWERS: (siteCode, location) => renderLocationPopup(siteCode, location, [renderTowerDetails]), WATERSHED_BOUNDARIES: renderBoundaryPopup }; - var hasPopup = typeof renderPopupFunctions[featureKey] === 'function'; - var renderPopup = function renderPopup(siteCode) { - var location = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + const hasPopup = typeof renderPopupFunctions[featureKey] === 'function'; + const renderPopup = function (siteCode) { + let location = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; if (!hasPopup || !featureData[siteCode] || location !== null && !featureData[siteCode][location]) { return null; } @@ -1288,33 +1245,31 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Render a single shape (marker, rectangle, or polygon) */ - var baseColor = featureStyle ? featureStyle.color : '#666666'; - var hoverColor = "#".concat((0, _tinycolor.default)(baseColor).lighten(10).toHex()); - var ghostedBaseColor = "#".concat((0, _tinycolor.default)(baseColor).lighten(10).desaturate(60).toHex()); - var ghostedHoverColor = "#".concat((0, _tinycolor.default)(hoverColor).lighten(10).desaturate(60).toHex()); - var darkenedBaseColor = "#".concat((0, _tinycolor.default)(baseColor).darken(15).toHex()); - var darkenedMoreBaseColor = "#".concat((0, _tinycolor.default)(darkenedBaseColor).darken(15).toHex()); - var isPoint = function isPoint(shapeData) { - var shapeKeys = Object.keys(shapeData); - return shapeKeys.includes('geometry') && Object.keys(shapeData.geometry).includes('coordinates') && Array.isArray(shapeData.geometry.coordinates) && shapeData.geometry.coordinates.length === 2 && shapeData.geometry.coordinates.every(function (x) { - return Number.isFinite(x); - }) || shapeKeys.includes('latitude') && shapeKeys.includes('longitude'); + const baseColor = featureStyle ? featureStyle.color : '#666666'; + const hoverColor = "#".concat((0, _tinycolor.default)(baseColor).lighten(10).toHex()); + const ghostedBaseColor = "#".concat((0, _tinycolor.default)(baseColor).lighten(10).desaturate(60).toHex()); + const ghostedHoverColor = "#".concat((0, _tinycolor.default)(hoverColor).lighten(10).desaturate(60).toHex()); + const darkenedBaseColor = "#".concat((0, _tinycolor.default)(baseColor).darken(15).toHex()); + const darkenedMoreBaseColor = "#".concat((0, _tinycolor.default)(darkenedBaseColor).darken(15).toHex()); + const isPoint = shapeData => { + const shapeKeys = Object.keys(shapeData); + return shapeKeys.includes('geometry') && Object.keys(shapeData.geometry).includes('coordinates') && Array.isArray(shapeData.geometry.coordinates) && shapeData.geometry.coordinates.length === 2 && shapeData.geometry.coordinates.every(x => Number.isFinite(x)) || shapeKeys.includes('latitude') && shapeKeys.includes('longitude'); }; - var renderShape = function renderShape(primaryId) { - var secondaryId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var polygonInteractionProps = { - onMouseOver: function onMouseOver(e) { + const renderShape = function (primaryId) { + let secondaryId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + const polygonInteractionProps = { + onMouseOver: e => { e.target._path.setAttribute('stroke', hoverColor); e.target._path.setAttribute('fill', hoverColor); }, - onMouseOut: function onMouseOut(e) { + onMouseOut: e => { e.target._path.setAttribute('stroke', featureStyle.color); e.target._path.setAttribute('fill', featureStyle.color); } }; - var shapeData = secondaryId && featureData[primaryId][secondaryId] ? featureData[primaryId][secondaryId] : featureData[primaryId]; - var isSelectable = null; - var isSelected = false; + const shapeData = secondaryId && featureData[primaryId][secondaryId] ? featureData[primaryId][secondaryId] : featureData[primaryId]; + let isSelectable = null; + let isSelected = false; if (selectionActive) { isSelectable = !validItems || (secondaryId ? validItems.has(secondaryId) : validItems.has(primaryId)); isSelected = secondaryId ? selectedItems.has(secondaryId) : selectedItems.has(primaryId); @@ -1322,25 +1277,25 @@ var SiteMapFeature = function SiteMapFeature(props) { return null; } } - var isHighlighted = primaryIdOnly && !secondaryId && primaryId === focusLocation || !primaryIdOnly && secondaryId && secondaryId === focusLocation; - var key = secondaryId ? "".concat(primaryId, " - ").concat(secondaryId) : primaryId; - var renderedPopup = renderPopup(primaryId, secondaryId); - var shapeKeys = Object.keys(shapeData); - var position = []; - var positions = []; - var icon = null; - var marker = null; - var interaction = {}; - var shapeProps = {}; + const isHighlighted = primaryIdOnly && !secondaryId && primaryId === focusLocation || !primaryIdOnly && secondaryId && secondaryId === focusLocation; + const key = secondaryId ? "".concat(primaryId, " - ").concat(secondaryId) : primaryId; + const renderedPopup = renderPopup(primaryId, secondaryId); + const shapeKeys = Object.keys(shapeData); + let position = []; + let positions = []; + let icon = null; + let marker = null; + let interaction = {}; + let shapeProps = {}; if (shapeData.geometry && shapeData.geometry.coordinates) { positions = shapeData.geometry.coordinates; // Polyline if (featureShape === 'Polyline') { shapeProps = _extends({}, featureStyle || {}, { - onMouseOver: function onMouseOver(e) { + onMouseOver: e => { e.target._path.setAttribute('stroke', hoverColor); }, - onMouseOut: function onMouseOut(e) { + onMouseOut: e => { e.target._path.setAttribute('stroke', baseColor); } }); @@ -1363,17 +1318,15 @@ var SiteMapFeature = function SiteMapFeature(props) { } if (isHighlighted) { shapeProps.color = darkenedBaseColor; - shapeProps.onMouseOut = function (e) { + shapeProps.onMouseOut = e => { e.target._path.setAttribute('stroke', darkenedBaseColor); e.target._path.setAttribute('fill', darkenedBaseColor); }; } else if ((0, _typeUtil.exists)(focusLocation) && amplifyHighlighted) { // Determine if the feature type of the focus location // is set to amplify highlighted for this feature type (eg, same type) - var amplifyFeatureKeys = Object.keys(_SiteMapUtils.FEATURES).filter(function (k) { - return _SiteMapUtils.FEATURES[k].amplifyHighlighted && _SiteMapUtils.FEATURES[k].matchLocationType; - }); - var isFocusAmplifiable = amplifyFeatureKeys.find(function (amplifyFeatureKey) { + const amplifyFeatureKeys = Object.keys(_SiteMapUtils.FEATURES).filter(k => _SiteMapUtils.FEATURES[k].amplifyHighlighted && _SiteMapUtils.FEATURES[k].matchLocationType); + const isFocusAmplifiable = amplifyFeatureKeys.find(amplifyFeatureKey => { if ((0, _typeUtil.exists)(state.focusLocation) && (0, _typeUtil.exists)(state.focusLocation.data) && (0, _typeUtil.exists)(state.focusLocation.data.type)) { return new RegExp(_SiteMapUtils.FEATURES[amplifyFeatureKey].matchLocationType).test(state.focusLocation.data.type); } @@ -1381,15 +1334,15 @@ var SiteMapFeature = function SiteMapFeature(props) { }); if (isFocusAmplifiable) { shapeProps.color = ghostedHoverColor; - shapeProps.onMouseOut = function (e) { + shapeProps.onMouseOut = e => { e.target._path.setAttribute('stroke', ghostedHoverColor); e.target._path.setAttribute('fill', ghostedHoverColor); }; } } if (selectionActive) { - var returnColor = isHighlighted ? darkenedBaseColor : featureStyle.color; - var useHoverColor = hoverColor; + let returnColor = isHighlighted ? darkenedBaseColor : featureStyle.color; + let useHoverColor = hoverColor; if (selectingCurrentFeatureType) { if (state.selection.set.has(primaryId)) { returnColor = darkenedMoreBaseColor; @@ -1400,15 +1353,17 @@ var SiteMapFeature = function SiteMapFeature(props) { } } if (selectingActiveTypeByProxy) { - var _baseColors; - var baseColors = (_baseColors = {}, _defineProperty(_baseColors, _SiteMapUtils.SELECTION_PORTIONS.PARTIAL, darkenedBaseColor), _defineProperty(_baseColors, _SiteMapUtils.SELECTION_PORTIONS.TOTAL, darkenedMoreBaseColor), _baseColors); + const baseColors = { + [_SiteMapUtils.SELECTION_PORTIONS.PARTIAL]: darkenedBaseColor, + [_SiteMapUtils.SELECTION_PORTIONS.TOTAL]: darkenedMoreBaseColor + }; if (state.selection.derived[featureKey] && state.selection.derived[featureKey][primaryId]) { // eslint-disable-next-line max-len returnColor = baseColors[state.selection.derived[featureKey][primaryId]] || featureStyle.color; } } shapeProps.color = returnColor; - shapeProps.onMouseOver = function (e) { + shapeProps.onMouseOver = e => { e.target._path.setAttribute('stroke', useHoverColor); e.target._path.setAttribute('fill', useHoverColor); if (hasPopup) { @@ -1416,12 +1371,12 @@ var SiteMapFeature = function SiteMapFeature(props) { positionPopup(e.target, e.latlng, true); } }; - shapeProps.onMouseMove = function (e) { + shapeProps.onMouseMove = e => { if (hasPopup) { positionPopup(e.target, e.latlng, true); } }; - shapeProps.onMouseOut = function (e) { + shapeProps.onMouseOut = e => { e.target._path.setAttribute('stroke', returnColor); e.target._path.setAttribute('fill', returnColor); if (hasPopup) { @@ -1430,7 +1385,7 @@ var SiteMapFeature = function SiteMapFeature(props) { }; // Onclick to select sites by way of clicking a state or domain to capture sites within if (selectingActiveTypeByProxy && selectionLimit !== 1) { - shapeProps.onClick = function () { + shapeProps.onClick = () => { if (featureKey === _SiteMapUtils.FEATURES.DOMAINS.KEY) { dispatch({ type: 'toggleSitesSelectedForDomain', @@ -1447,7 +1402,7 @@ var SiteMapFeature = function SiteMapFeature(props) { } // Onclick to select states or domains directly if (selectionType === featureType) { - shapeProps.onClick = function () { + shapeProps.onClick = () => { if (isSelectable) { dispatch({ type: 'toggleItemSelected', @@ -1461,18 +1416,16 @@ var SiteMapFeature = function SiteMapFeature(props) { } // Marker if (featureShape === 'Marker' && isPoint(shapeData)) { - position = ['latitude', 'longitude'].every(function (k) { - return shapeKeys.includes(k); - }) ? [shapeData.latitude, shapeData.longitude] : shapeData.geometry.coordinates; + position = ['latitude', 'longitude'].every(k => shapeKeys.includes(k)) ? [shapeData.latitude, shapeData.longitude] : shapeData.geometry.coordinates; if (state.map.zoomedIcons[featureKey] !== null) { - var baseIcon = state.map.zoomedIcons[featureKey]; - var selection = isSelectable && isSelected ? _SiteMapUtils.SELECTION_STATUS.SELECTED : _SiteMapUtils.SELECTION_STATUS.UNSELECTED; - var initialHighlight = isHighlighted ? _SiteMapUtils.HIGHLIGHT_STATUS.HIGHLIGHT : _SiteMapUtils.HIGHLIGHT_STATUS.NONE; + const baseIcon = state.map.zoomedIcons[featureKey]; + const selection = isSelectable && isSelected ? _SiteMapUtils.SELECTION_STATUS.SELECTED : _SiteMapUtils.SELECTION_STATUS.UNSELECTED; + const initialHighlight = isHighlighted ? _SiteMapUtils.HIGHLIGHT_STATUS.HIGHLIGHT : _SiteMapUtils.HIGHLIGHT_STATUS.NONE; if (baseIcon && baseIcon[selection]) { icon = baseIcon[selection][initialHighlight]; interaction = { - onMouseOver: function onMouseOver(e) { - var highlight = _SiteMapUtils.HIGHLIGHT_STATUS.HIGHLIGHT; + onMouseOver: e => { + let highlight = _SiteMapUtils.HIGHLIGHT_STATUS.HIGHLIGHT; if (selectionActive && selectingCurrentFeatureType && isSelectable) { highlight = _SiteMapUtils.HIGHLIGHT_STATUS[isSelected ? 'HIGHLIGHT' : 'SELECT']; } @@ -1483,21 +1436,19 @@ var SiteMapFeature = function SiteMapFeature(props) { positionPopup(e.target, e.latlng, selectionActive); } }, - onMouseOut: function onMouseOut(e) { + onMouseOut: e => { e.target.setIcon(baseIcon[selection][initialHighlight]); if (hasPopup && selectionActive) { e.target.closePopup(); } }, - onClick: function onClick(e) { + onClick: e => { if (!selectionActive && hasPopup) { - var popupOpen = e.target._popup.isOpen(); - var func = function func() { - return positionPopup(e.target, e.latlng, selectionActive); - }; + const popupOpen = e.target._popup.isOpen(); + const func = () => positionPopup(e.target, e.latlng, selectionActive); dispatch({ type: 'setMapRepositionOpenPopupFunc', - func: func + func }); if (popupOpen) { func(); @@ -1568,36 +1519,26 @@ var SiteMapFeature = function SiteMapFeature(props) { /** Main Render */ - var renderableKeys = Object.keys(featureData); + let renderableKeys = Object.keys(featureData); if (Array.isArray(manualLocationData) && manualLocationData.length) { - var hasPrototypeSites = manualLocationData.some(function (ml) { - return ml.manualLocationType === _SiteMapUtils.MANUAL_LOCATION_TYPES.PROTOTYPE_SITE; - }); + const hasPrototypeSites = manualLocationData.some(ml => ml.manualLocationType === _SiteMapUtils.MANUAL_LOCATION_TYPES.PROTOTYPE_SITE); if (hasPrototypeSites && featureType === _SiteMapUtils.FEATURE_TYPES.SITES.KEY) { - var allKeys = Object.keys(featureData); - renderableKeys = manualLocationData.filter(function (ml) { - return ml.manualLocationType === _SiteMapUtils.MANUAL_LOCATION_TYPES.PROTOTYPE_SITE && allKeys.includes(ml.siteCode); - }).map(function (ml) { - return ml.siteCode; - }); + const allKeys = Object.keys(featureData); + renderableKeys = manualLocationData.filter(ml => ml.manualLocationType === _SiteMapUtils.MANUAL_LOCATION_TYPES.PROTOTYPE_SITE && allKeys.includes(ml.siteCode)).map(ml => ml.siteCode); } } return /*#__PURE__*/_react.default.createElement(_reactLeaflet.FeatureGroup, null, renderableKeys // Valid items should render above unselecatbles - .sort(function (a) { + .sort(a => { if (!validItems) { return 0; } return validItems.has(a) ? 1 : -1; }) // Focus location should render above all others - .sort(function (a) { - return a === state.focusLocation.current ? 1 : -1; - }).flatMap(function (keyA) { + .sort(a => a === state.focusLocation.current ? 1 : -1).flatMap(keyA => { if ([_SiteMapUtils.FEATURE_TYPES.LOCATIONS.KEY, _SiteMapUtils.FEATURE_TYPES.SAMPLING_POINTS.KEY].includes(featureType)) { - return Object.keys(featureData[keyA]).map(function (keyB) { - return renderShape(keyA, keyB); - }); + return Object.keys(featureData[keyA]).map(keyB => renderShape(keyA, keyB)); } return renderShape(keyA); })); @@ -1608,5 +1549,4 @@ SiteMapFeature.propTypes = { }).isRequired, featureKey: _propTypes.default.oneOf(Object.keys(_SiteMapUtils.FEATURES)).isRequired }; -var _default = SiteMapFeature; -exports.default = _default; \ No newline at end of file +var _default = exports.default = SiteMapFeature; \ No newline at end of file diff --git a/lib/components/SiteMap/SiteMapLeaflet.js b/lib/components/SiteMap/SiteMapLeaflet.js index 9f8030c4..57639e95 100644 --- a/lib/components/SiteMap/SiteMapLeaflet.js +++ b/lib/components/SiteMap/SiteMapLeaflet.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -30,233 +29,207 @@ var _SiteMapContext = _interopRequireDefault(require("./SiteMapContext")); var _SiteMapFeature = _interopRequireDefault(require("./SiteMapFeature")); var _SiteMapUtils = require("./SiteMapUtils"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* eslint-disable no-underscore-dangle */ -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - map: { - width: '100%', - height: '0px', - // Necessary to set a fixed aspect ratio from props (using paddingBottom) - overflow: 'hidden', - background: theme.palette.grey[50], - '& div.rlglc-wrap': { - boxShadow: 'unset', - margin: '0px', - left: '8px', - top: '8px', - '& .rlglc': { - border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[500]), - borderRadius: '2px' - }, - '& .rlglc-active': { - border: "1px solid ".concat(_Theme.default.palette.grey[300]) - }, - '& .rlglc:not(.rlglc-active) .rlglc-a': { - width: '36px', - height: '36px !important' - }, - '& .rlglc.rlglc-active .rlglc-a': { - width: 'auto !important', - height: 'auto !important', - padding: '12px' - }, - '& .rlglc-open': { - '& .rlglc-input': { - width: '14px', - height: '14px', - margin: '3px 0px 0px 0px', - cursor: 'pointer' - }, - '& .rlglc-title': { - fontFamily: '"Inter",Helvetica,Arial,sans-serif' - }, - '& .rlglc-groupTitle': { - fontFamily: '"Inter",Helvetica,Arial,sans-serif', - fontSize: '13px' - } - } - }, - '& div.leaflet-control-zoom': { - border: 'none' - }, - '& div.leaflet-top.leaflet-right': { - right: 'unset !important', - left: '0px' - }, - '& div.leaflet-bar': { - top: '54px', - left: '8px', - margin: '0px', - borderRadius: '2px', - boxShadow: 'unset', - '& a': { - color: _Theme.default.colors.LIGHT_BLUE[500], - border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[500]), - width: '26px', - height: '26px', - lineHeight: '26px', - fontSize: '18px', - '&:hover, &:active': { - color: _Theme.default.colors.LIGHT_BLUE[400], - borderColor: _Theme.default.colors.LIGHT_BLUE[400] - }, - '&:first-child': { - borderTopLeftRadius: '2px', - borderTopRightRadius: '2px' - }, - '&:last-child': { - borderTop: 'none', - borderBottomLeftRadius: '2px', - borderBottomRightRadius: '2px' - } - } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable no-underscore-dangle */ +const useStyles = (0, _styles.makeStyles)(theme => ({ + map: { + width: '100%', + height: '0px', + // Necessary to set a fixed aspect ratio from props (using paddingBottom) + overflow: 'hidden', + background: theme.palette.grey[50], + '& div.rlglc-wrap': { + boxShadow: 'unset', + margin: '0px', + left: '8px', + top: '8px', + '& .rlglc': { + border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[500]), + borderRadius: '2px' }, - '& div.leaflet-control-attribution': { - borderTopLeftRadius: '2px', - marginRight: '26px', - height: '26px', - padding: '4px 8px' + '& .rlglc-active': { + border: "1px solid ".concat(_Theme.default.palette.grey[300]) }, - '& div.leaflet-control-attribution a': { - color: theme.palette.primary.main + '& .rlglc:not(.rlglc-active) .rlglc-a': { + width: '36px', + height: '36px !important' }, - '& .leaflet-container a': { - color: theme.palette.primary.main + '& .rlglc.rlglc-active .rlglc-a': { + width: 'auto !important', + height: 'auto !important', + padding: '12px' }, - '& input[type="radio"]': { - cursor: 'pointer' + '& .rlglc-open': { + '& .rlglc-input': { + width: '14px', + height: '14px', + margin: '3px 0px 0px 0px', + cursor: 'pointer' + }, + '& .rlglc-title': { + fontFamily: '"Inter",Helvetica,Arial,sans-serif' + }, + '& .rlglc-groupTitle': { + fontFamily: '"Inter",Helvetica,Arial,sans-serif', + fontSize: '13px' + } } }, - mapNoMarkerPointerEvents: { - '& div.leaflet-marker-pane *': { - pointerEvents: 'none' - } + '& div.leaflet-control-zoom': { + border: 'none' }, - mapFullscreen: { - '& div.leaflet-control-attribution': { - marginRight: '0px' - } + '& div.leaflet-top.leaflet-right': { + right: 'unset !important', + left: '0px' }, - attribution: { - color: theme.palette.secondary.main, - fontSize: '11.5px', - cursor: 'help', - display: 'inline' + '& div.leaflet-bar': { + top: '54px', + left: '8px', + margin: '0px', + borderRadius: '2px', + boxShadow: 'unset', + '& a': { + color: _Theme.default.colors.LIGHT_BLUE[500], + border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[500]), + width: '26px', + height: '26px', + lineHeight: '26px', + fontSize: '18px', + '&:hover, &:active': { + color: _Theme.default.colors.LIGHT_BLUE[400], + borderColor: _Theme.default.colors.LIGHT_BLUE[400] + }, + '&:first-child': { + borderTopLeftRadius: '2px', + borderTopRightRadius: '2px' + }, + '&:last-child': { + borderTop: 'none', + borderBottomLeftRadius: '2px', + borderBottomRightRadius: '2px' + } + } }, - startFlex: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center' + '& div.leaflet-control-attribution': { + borderTopLeftRadius: '2px', + marginRight: '26px', + height: '26px', + padding: '4px 8px' }, - endFlex: { - display: 'flex', - justifyContent: 'flex-end', - alignItems: 'center' + '& div.leaflet-control-attribution a': { + color: theme.palette.primary.main }, - progress: { - zIndex: 900, - position: 'absolute', - top: '12px', - left: '56px' + '& .leaflet-container a': { + color: theme.palette.primary.main }, - mapNavButtonContainer: { - position: 'absolute', - zIndex: 999, - margin: '0px', - left: '8px' + '& input[type="radio"]': { + cursor: 'pointer' + } + }, + mapNoMarkerPointerEvents: { + '& div.leaflet-marker-pane *': { + pointerEvents: 'none' + } + }, + mapFullscreen: { + '& div.leaflet-control-attribution': { + marginRight: '0px' + } + }, + attribution: { + color: theme.palette.secondary.main, + fontSize: '11.5px', + cursor: 'help', + display: 'inline' + }, + startFlex: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center' + }, + endFlex: { + display: 'flex', + justifyContent: 'flex-end', + alignItems: 'center' + }, + progress: { + zIndex: 900, + position: 'absolute', + top: '12px', + left: '56px' + }, + mapNavButtonContainer: { + position: 'absolute', + zIndex: 999, + margin: '0px', + left: '8px' + }, + mapNavButton: { + backgroundColor: '#fff !important', + width: '26px', + height: '26px', + padding: 'unset', + borderRadius: '2px 0px 2px 0px', + border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[500]), + '&:hover, &:active': { + color: _Theme.default.colors.LIGHT_BLUE[400], + borderColor: _Theme.default.colors.LIGHT_BLUE[400], + backgroundColor: theme.palette.grey[50] }, - mapNavButton: { - backgroundColor: '#fff !important', + '& svg': { + fontSize: '1.15rem !important' + } + }, + observatoryButton: { + top: '114px' + }, + focusLocationButton: { + top: '148px' + }, + mouseModeToggleButtonGroup: { + borderRadius: '2px', + backgroundColor: 'white', + position: 'absolute', + zIndex: 999, + margin: '0px', + top: '8px', + left: '56px', + '& button': { width: '26px', height: '26px', - padding: 'unset', - borderRadius: '2px 0px 2px 0px', - border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[500]), - '&:hover, &:active': { - color: _Theme.default.colors.LIGHT_BLUE[400], - borderColor: _Theme.default.colors.LIGHT_BLUE[400], - backgroundColor: theme.palette.grey[50] - }, + padding: 'unset !important', '& svg': { - fontSize: '1.15rem !important' - } - }, - observatoryButton: { - top: '114px' - }, - focusLocationButton: { - top: '148px' - }, - mouseModeToggleButtonGroup: { - borderRadius: '2px', - backgroundColor: 'white', - position: 'absolute', - zIndex: 999, - margin: '0px', - top: '8px', - left: '56px', - '& button': { - width: '26px', - height: '26px', - padding: 'unset !important', - '& svg': { - fontSize: '0.9rem' - } + fontSize: '0.9rem' } - }, - areaSelection: { - position: 'absolute', - pointerEvents: 'none', - border: "3px dotted ".concat(_Theme.default.colors.LIGHT_BLUE[500]), - backgroundColor: _Theme.default.colors.LIGHT_BLUE[100], - opacity: 0.6, - zIndex: 999 } - }; -}); + }, + areaSelection: { + position: 'absolute', + pointerEvents: 'none', + border: "3px dotted ".concat(_Theme.default.colors.LIGHT_BLUE[500]), + backgroundColor: _Theme.default.colors.LIGHT_BLUE[100], + opacity: 0.6, + zIndex: 999 + } +})); /** Main Component */ -var SiteMapLeaflet = function SiteMapLeaflet() { - var _mouseModeCursors; - var classes = useStyles(_Theme.default); - var mapRef = (0, _react.useRef)(null); - var _useId = (0, _reactIdGenerator.useId)(), - _useId2 = _slicedToArray(_useId, 1), - mapInstanceId = _useId2[0]; - var mapRefExists = function mapRefExists() { - return mapRef && mapRef.current && mapRef.current.container && mapRef.current.leafletElement && mapRef.current.leafletElement._panes && mapRef.current.leafletElement._layers; - }; +const SiteMapLeaflet = () => { + const classes = useStyles(_Theme.default); + const mapRef = (0, _react.useRef)(null); + const [mapInstanceId] = (0, _reactIdGenerator.useId)(); + const mapRefExists = () => mapRef && mapRef.current && mapRef.current.container && mapRef.current.leafletElement && mapRef.current.leafletElement._panes && mapRef.current.leafletElement._layers; // State, Dispatch, and other stuff from SiteMapContext - var _SiteMapContext$useSi = _SiteMapContext.default.useSiteMapContext(), - _SiteMapContext$useSi2 = _slicedToArray(_SiteMapContext$useSi, 2), - state = _SiteMapContext$useSi2[0], - dispatch = _SiteMapContext$useSi2[1]; - var canRender = state.neonContextHydrated; + const [state, dispatch] = _SiteMapContext.default.useSiteMapContext(); + let canRender = state.neonContextHydrated; if (state.focusLocation.current && state.focusLocation.fetch.status !== _SiteMapUtils.FETCH_STATUS.SUCCESS) { canRender = false; } - var _useState = (0, _react.useState)(false), - _useState2 = _slicedToArray(_useState, 2), - mapRefReady = _useState2[0], - setMapRefReady = _useState2[1]; + const [mapRefReady, setMapRefReady] = (0, _react.useState)(false); /** Effect @@ -264,7 +237,7 @@ var SiteMapLeaflet = function SiteMapLeaflet() { all sites are visible. This depends on the client dimensions of the map and whether height or width is the deciding factor depends on the aspect ratio. */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (!canRender || state.map.zoom !== null || !mapRefExists()) { return; } @@ -281,12 +254,12 @@ var SiteMapLeaflet = function SiteMapLeaflet() { Effect for setting the initial zoom so that we can include the bounds of the map in the initial zoom setting to allow proper feature detection. */ - var mapRefExistsProp = mapRefExists(); - (0, _react.useEffect)(function () { + const mapRefExistsProp = mapRefExists(); + (0, _react.useEffect)(() => { if (state.map.bounds !== null || !mapRefExistsProp) { return; } - var bounds = mapRef.current.leafletElement.getBounds(); + const bounds = mapRef.current.leafletElement.getBounds(); if (state.map.zoom === null) { dispatch({ type: 'setMapBounds', @@ -315,35 +288,31 @@ var SiteMapLeaflet = function SiteMapLeaflet() { SiteMapFeature.jsx where we render the markers, because React-Leaflet does not currently support setting arbitrary styles on markers. =( */ - (0, _react.useLayoutEffect)(function () { - var timeout = window.setTimeout(function () { + (0, _react.useLayoutEffect)(() => { + const timeout = window.setTimeout(() => { if (!mapRefExists() || state.view.current !== _SiteMapUtils.VIEWS.MAP || !state.selection.active || !state.selection.validSet || state.selection.active !== _SiteMapUtils.FEATURE_TYPES.SITES.KEY) { return; } - var markerPane = mapRef.current.leafletElement._panes.markerPane; + const { + markerPane + } = mapRef.current.leafletElement._panes; if (markerPane && markerPane.children && markerPane.children.length) { // Unselectables: apply CSS filters to appear ghosted - _toConsumableArray(markerPane.children).filter(function (marker) { - return !state.selection.validSet.has(marker.title); - }).forEach(function (marker) { + [...markerPane.children].filter(marker => !state.selection.validSet.has(marker.title)).forEach(marker => { // eslint-disable-next-line no-param-reassign marker.style.filter = _SiteMapUtils.UNSELECTABLE_MARKER_FILTER; }); // Selecatbles: Uniformly bump the zIndexOffset to put them all on top - state.selection.validSet.forEach(function (item) { - var layerIdx = Object.keys(mapRef.current.leafletElement._layers).find(function (k) { - return mapRef.current.leafletElement._layers[k].options && mapRef.current.leafletElement._layers[k].options.title === item; - }); + state.selection.validSet.forEach(item => { + const layerIdx = Object.keys(mapRef.current.leafletElement._layers).find(k => mapRef.current.leafletElement._layers[k].options && mapRef.current.leafletElement._layers[k].options.title === item); if (layerIdx !== -1 && mapRef.current.leafletElement._layers[layerIdx]) { - var zIndex = (mapRef.current.leafletElement._layers[layerIdx] || {})._zIndex || 0; + const zIndex = (mapRef.current.leafletElement._layers[layerIdx] || {})._zIndex || 0; mapRef.current.leafletElement._layers[layerIdx].setZIndexOffset(zIndex + 1000); } }); } }, 0); - return function () { - return window.clearTimeout(timeout); - }; + return () => window.clearTimeout(timeout); }, [state.selection.active, state.selection.validSet, state.selection.hideUnselectable, state.map.bounds, state.view]); /** @@ -352,12 +321,12 @@ var SiteMapLeaflet = function SiteMapLeaflet() { to get around race conditions with leaflet initialization and loading the sitemap in dynamic containers like dialogs. */ - var invalidateSize = (0, _react.useCallback)(function () { + const invalidateSize = (0, _react.useCallback)(() => { if (!mapRefExists()) { return; } // setTimeout of 0 to fire after map render cycle completes - window.setTimeout(function () { + window.setTimeout(() => { if (!mapRefExists()) { return; } @@ -370,7 +339,7 @@ var SiteMapLeaflet = function SiteMapLeaflet() { Force a redraw when switching to the map for the first time from another view or when component dimensions (e.g. aspectRatio or widthReference) has changed */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (!mapRefExists() || state.view.current !== _SiteMapUtils.VIEWS.MAP) { return; } @@ -387,7 +356,7 @@ var SiteMapLeaflet = function SiteMapLeaflet() { NOTE: this is not kept in primary state because it's used only when actively selecting and updated frequently during mouse drag. The cycle through the main reducer is too laggy. */ - var areaSelectionDefaultState = { + const areaSelectionDefaultState = { isDragging: false, shiftPressed: false, center: { @@ -399,9 +368,11 @@ var SiteMapLeaflet = function SiteMapLeaflet() { y: null } }; - var areaSelectionReducer = function areaSelectionReducer(areaSelectionState, action) { - var isDragging = areaSelectionState.isDragging; - var newState = _extends({}, areaSelectionState); + const areaSelectionReducer = (areaSelectionState, action) => { + const { + isDragging + } = areaSelectionState; + const newState = _extends({}, areaSelectionState); switch (action.type) { case 'start': if (isDragging || !Number.isInteger(action.x) || !Number.isInteger(action.y)) { @@ -447,10 +418,7 @@ var SiteMapLeaflet = function SiteMapLeaflet() { return areaSelectionState; } }; - var _useReducer = (0, _react.useReducer)(areaSelectionReducer, areaSelectionDefaultState), - _useReducer2 = _slicedToArray(_useReducer, 2), - areaSelection = _useReducer2[0], - areaSelectionDispatch = _useReducer2[1]; + const [areaSelection, areaSelectionDispatch] = (0, _react.useReducer)(areaSelectionReducer, areaSelectionDefaultState); /** Local State / Effect - Whether GroupedLayerControl has been rendered @@ -458,7 +426,7 @@ var SiteMapLeaflet = function SiteMapLeaflet() { as a prop. Thus we must track whether it has rendered with local state. We want to basically re-render the map immediately and only once when the mepRef is set through the first render. */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { // eslint-disable-line react-hooks/exhaustive-deps if (mapRefExists() && !mapRefReady) { setMapRefReady(true); @@ -470,15 +438,19 @@ var SiteMapLeaflet = function SiteMapLeaflet() { Effect Area Selection - event listeners to handle area selection mouse events */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (!mapRef || !mapRef.current || !mapRef.current.container || !mapRef.current.leafletElement || state.map.mouseMode !== _SiteMapUtils.MAP_MOUSE_MODES.AREA_SELECT) { - return function () {}; + return () => {}; } - var leafletElement = mapRef.current.leafletElement; - var isDragging = areaSelection.isDragging, - center = areaSelection.center, - shiftPressed = areaSelection.shiftPressed; - mapRef.current.container.onmousedown = function (event) { + const { + leafletElement + } = mapRef.current; + const { + isDragging, + center, + shiftPressed + } = areaSelection; + mapRef.current.container.onmousedown = event => { if (isDragging) { return; } @@ -488,7 +460,7 @@ var SiteMapLeaflet = function SiteMapLeaflet() { y: event.offsetY }); }; - mapRef.current.container.onmousemove = function (event) { + mapRef.current.container.onmousemove = event => { if (!isDragging) { return; } @@ -498,34 +470,32 @@ var SiteMapLeaflet = function SiteMapLeaflet() { y: event.offsetY }); }; - mapRef.current.container.onmouseup = function (event) { + mapRef.current.container.onmouseup = event => { if (!isDragging) { return; } - var reach = { + const reach = { x: event.offsetX, y: event.offsetY }; - var centerLatLng = leafletElement.containerPointToLatLng(_leaflet.default.point(center.x, center.y)); - var reachLatLng = leafletElement.containerPointToLatLng(_leaflet.default.point(reach.x, reach.y)); - var selectionBounds = { + const centerLatLng = leafletElement.containerPointToLatLng(_leaflet.default.point(center.x, center.y)); + const reachLatLng = leafletElement.containerPointToLatLng(_leaflet.default.point(reach.x, reach.y)); + const selectionBounds = { lat: [Math.min(centerLatLng.lat, reachLatLng.lat), Math.max(centerLatLng.lat, reachLatLng.lat)], lng: [Math.min(centerLatLng.lng, reachLatLng.lng), Math.max(centerLatLng.lng, reachLatLng.lng)] }; - var selectableData = {}; + let selectableData = {}; if (state.selection.active === _SiteMapUtils.FEATURE_TYPES.SITES.KEY) { selectableData = state.sites; } if ([_SiteMapUtils.FEATURE_TYPES.STATES.KEY, _SiteMapUtils.FEATURE_TYPES.DOMAINS.KEY].includes(state.selection.active)) { - var selectableFeatureKey = Object.keys(_SiteMapUtils.FEATURES).find(function (k) { - return _SiteMapUtils.FEATURES[k].type === state.selection.active; - }); + const selectableFeatureKey = Object.keys(_SiteMapUtils.FEATURES).find(k => _SiteMapUtils.FEATURES[k].type === state.selection.active); if (selectableFeatureKey) { selectableData = state.featureData[state.selection.active][selectableFeatureKey]; } } - var newSelectionSet = (0, _SiteMapUtils.calculateLocationsInBounds)(selectableData, selectionBounds); - var finalSelectionSet = new Set([].concat(_toConsumableArray(newSelectionSet), _toConsumableArray(shiftPressed ? Array.from(state.selection.set) : []))); + const newSelectionSet = (0, _SiteMapUtils.calculateLocationsInBounds)(selectableData, selectionBounds); + const finalSelectionSet = new Set([...newSelectionSet, ...(shiftPressed ? Array.from(state.selection.set) : [])]); areaSelectionDispatch({ type: 'end', x: event.offsetX, @@ -536,7 +506,7 @@ var SiteMapLeaflet = function SiteMapLeaflet() { selection: finalSelectionSet }); }; - var handleKeyDown = function handleKeyDown(event) { + const handleKeyDown = event => { if (event.key === 'Shift') { areaSelectionDispatch({ type: 'shift', @@ -544,7 +514,7 @@ var SiteMapLeaflet = function SiteMapLeaflet() { }); } }; - var handleKeyUp = function handleKeyUp(event) { + const handleKeyUp = event => { if (event.key === 'Shift') { areaSelectionDispatch({ type: 'shift', @@ -554,7 +524,7 @@ var SiteMapLeaflet = function SiteMapLeaflet() { }; document.addEventListener('keydown', handleKeyDown); document.addEventListener('keyup', handleKeyUp); - return function () { + return () => { document.removeEventListener('keydown', handleKeyDown); document.removeEventListener('keyup', handleKeyUp); }; @@ -568,9 +538,9 @@ var SiteMapLeaflet = function SiteMapLeaflet() { overlap along shared borders. This is especially useful for visual differentiation of different selection statuses for adjacent states/domains. */ - (0, _react.useLayoutEffect)(function () { + (0, _react.useLayoutEffect)(() => { // setTimeout of 0 to fire after map render cycle completes - window.setTimeout(function () { + window.setTimeout(() => { // Only continue if the map is in a ready / fully rendered state. if (!mapRef || !mapRef.current || !mapRef.current.leafletElement || !mapRef.current._ready || mapRef.current._updating || !mapRef.current.leafletElement._panes || !mapRef.current.leafletElement._panes.overlayPane || !mapRef.current.leafletElement._panes.overlayPane.children.length || mapRef.current.leafletElement._panes.overlayPane.children[0].nodeName !== 'svg') { return; @@ -580,7 +550,7 @@ var SiteMapLeaflet = function SiteMapLeaflet() { return; } // Only continue if the overlay pane has child nodes (rendered feature data) - var svg = mapRef.current.leafletElement._panes.overlayPane.children[0]; + const svg = mapRef.current.leafletElement._panes.overlayPane.children[0]; if (!svg.children.length) { return; } @@ -592,21 +562,19 @@ var SiteMapLeaflet = function SiteMapLeaflet() { if (svg.children.length !== 1 || svg.children[0].nodeName.toLowerCase() !== 'g' || !svg.children[0].children.length) { return; } - var paths = _toConsumableArray(svg.children[0].children); - var svgNS = 'http://www.w3.org/2000/svg'; - var defs = document.createElementNS(svgNS, 'defs'); - var defCount = 0; - paths.filter(function (path) { - return path.attributes.class && path.attributes.class.value.includes('#mask'); - }).forEach(function (path) { + const paths = [...svg.children[0].children]; + const svgNS = 'http://www.w3.org/2000/svg'; + const defs = document.createElementNS(svgNS, 'defs'); + let defCount = 0; + paths.filter(path => path.attributes.class && path.attributes.class.value.includes('#mask')).forEach(path => { defCount += 1; - var baseId = path.attributes.class.value.split(' ')[0]; - var defMaskId = baseId.replace('#', ''); + const baseId = path.attributes.class.value.split(' ')[0]; + const defMaskId = baseId.replace('#', ''); // Create a new element - var defMask = document.createElementNS(svgNS, 'mask'); + const defMask = document.createElementNS(svgNS, 'mask'); defMask.setAttributeNS(null, 'id', defMaskId); // Create a new element with the same coordinates and append it to the mask - var defPath = document.createElementNS(svgNS, 'path'); + const defPath = document.createElementNS(svgNS, 'path'); defPath.setAttributeNS(null, 'd', path.attributes.d.value); defPath.setAttributeNS(null, 'fill', 'white'); defPath.setAttributeNS(null, 'stroke', 'rgba(255, 255, 255, 0.5)'); @@ -635,77 +603,78 @@ var SiteMapLeaflet = function SiteMapLeaflet() { /** Render - Zoom to Observatory Button */ - var renderShowFullObservatoryButton = function renderShowFullObservatoryButton() { - return /*#__PURE__*/_react.default.createElement(_Tooltip.default, { - placement: "right", - title: "Show the full NEON Observatory" - }, /*#__PURE__*/_react.default.createElement("div", { - className: "".concat(classes.mapNavButtonContainer, " ").concat(classes.observatoryButton) - }, /*#__PURE__*/_react.default.createElement(_IconButton.default, { - type: "button", - className: classes.mapNavButton, - onClick: function onClick() { - if (mapRefExists()) { - mapRef.current.leafletElement.invalidateSize(); - } - dispatch({ - type: 'showFullObservatory', - mapRef: mapRef - }); + const renderShowFullObservatoryButton = () => /*#__PURE__*/_react.default.createElement(_Tooltip.default, { + placement: "right", + title: "Show the full NEON Observatory" + }, /*#__PURE__*/_react.default.createElement("div", { + className: "".concat(classes.mapNavButtonContainer, " ").concat(classes.observatoryButton) + }, /*#__PURE__*/_react.default.createElement(_IconButton.default, { + type: "button", + className: classes.mapNavButton, + onClick: () => { + if (mapRefExists()) { + mapRef.current.leafletElement.invalidateSize(); } - }, /*#__PURE__*/_react.default.createElement(_Public.default, { - fontSize: "small" - })))); - }; + dispatch({ + type: 'showFullObservatory', + mapRef + }); + } + }, /*#__PURE__*/_react.default.createElement(_Public.default, { + fontSize: "small" + })))); /** Render - Zoom to Observatory Button */ - var renderReturnToFocusLocationButton = function renderReturnToFocusLocationButton() { - return !state.focusLocation.current ? null : /*#__PURE__*/_react.default.createElement(_Tooltip.default, { - placement: "right", - title: "Return to previous focus location: ".concat(state.focusLocation.current) - }, /*#__PURE__*/_react.default.createElement("div", { - className: "".concat(classes.mapNavButtonContainer, " ").concat(classes.focusLocationButton) - }, /*#__PURE__*/_react.default.createElement(_IconButton.default, { - type: "button", - className: classes.mapNavButton, - onClick: function onClick() { - dispatch({ - type: 'returnToFocusLocation' - }); - }, - disabled: (0, _SiteMapUtils.mapIsAtFocusLocation)(state) - }, /*#__PURE__*/_react.default.createElement(_Place.default, { - fontSize: "small" - })))); - }; + const renderReturnToFocusLocationButton = () => !state.focusLocation.current ? null : /*#__PURE__*/_react.default.createElement(_Tooltip.default, { + placement: "right", + title: "Return to previous focus location: ".concat(state.focusLocation.current) + }, /*#__PURE__*/_react.default.createElement("div", { + className: "".concat(classes.mapNavButtonContainer, " ").concat(classes.focusLocationButton) + }, /*#__PURE__*/_react.default.createElement(_IconButton.default, { + type: "button", + className: classes.mapNavButton, + onClick: () => { + dispatch({ + type: 'returnToFocusLocation' + }); + }, + disabled: (0, _SiteMapUtils.mapIsAtFocusLocation)(state) + }, /*#__PURE__*/_react.default.createElement(_Place.default, { + fontSize: "small" + })))); /** Render - Mouse Mode Buttoms (Pan / Select) */ - var renderMouseModeToggleButtonGroup = function renderMouseModeToggleButtonGroup() { - var _mouseModeTooltips, _mouseModeIcons; + const renderMouseModeToggleButtonGroup = () => { if (!state.selection.active) { return null; } - var units = _SiteMapUtils.FEATURE_TYPES[state.selection.active].units || ''; - var mouseModeTooltips = (_mouseModeTooltips = {}, _defineProperty(_mouseModeTooltips, _SiteMapUtils.MAP_MOUSE_MODES.PAN, 'Click and drag on map to move the map center; shift+drag to zoom to an area'), _defineProperty(_mouseModeTooltips, _SiteMapUtils.MAP_MOUSE_MODES.AREA_SELECT, "Click and drag on map to select ".concat(units, " in an area; shift+drag to add onto selection")), _mouseModeTooltips); - var mouseModeIcons = (_mouseModeIcons = {}, _defineProperty(_mouseModeIcons, _SiteMapUtils.MAP_MOUSE_MODES.PAN, _PanTool.default), _defineProperty(_mouseModeIcons, _SiteMapUtils.MAP_MOUSE_MODES.AREA_SELECT, _CropFree.default), _mouseModeIcons); + const units = _SiteMapUtils.FEATURE_TYPES[state.selection.active].units || ''; + const mouseModeTooltips = { + [_SiteMapUtils.MAP_MOUSE_MODES.PAN]: 'Click and drag on map to move the map center; shift+drag to zoom to an area', + [_SiteMapUtils.MAP_MOUSE_MODES.AREA_SELECT]: "Click and drag on map to select ".concat(units, " in an area; shift+drag to add onto selection") + }; + const mouseModeIcons = { + [_SiteMapUtils.MAP_MOUSE_MODES.PAN]: _PanTool.default, + [_SiteMapUtils.MAP_MOUSE_MODES.AREA_SELECT]: _CropFree.default + }; return /*#__PURE__*/_react.default.createElement(_ToggleButtonGroup.default, { exclusive: true, color: "primary", variant: "outlined", value: state.map.mouseMode, - onChange: function onChange(event, newMouseMode) { + onChange: (event, newMouseMode) => { dispatch({ type: 'setMapMouseMode', mouseMode: newMouseMode }); }, className: classes.mouseModeToggleButtonGroup - }, Object.keys(_SiteMapUtils.MAP_MOUSE_MODES).map(function (key) { - var Icon = mouseModeIcons[key]; + }, Object.keys(_SiteMapUtils.MAP_MOUSE_MODES).map(key => { + const Icon = mouseModeIcons[key]; return /*#__PURE__*/_react.default.createElement(_Tooltip.default, { key: key, title: mouseModeTooltips[key], @@ -727,8 +696,8 @@ var SiteMapLeaflet = function SiteMapLeaflet() { instance id here with the data-id attribute to attempt to force no tile layer reuse between instances of SiteMap components. */ - var renderBaseLayer = function renderBaseLayer() { - var id = "tile-layer-".concat(mapInstanceId); + const renderBaseLayer = () => { + const id = "tile-layer-".concat(mapInstanceId); if (!state.map.baseLayer) { return /*#__PURE__*/_react.default.createElement(_reactLeaflet.TileLayer, { url: "", @@ -736,12 +705,12 @@ var SiteMapLeaflet = function SiteMapLeaflet() { "data-id": id }); } - var baseLayer = _SiteMapUtils.BASE_LAYERS[state.map.baseLayer]; - var attributionNode = /*#__PURE__*/_react.default.createElement("div", { + const baseLayer = _SiteMapUtils.BASE_LAYERS[state.map.baseLayer]; + const attributionNode = /*#__PURE__*/_react.default.createElement("div", { title: baseLayer.fullAttribution, className: classes.attribution }, baseLayer.shortAttribution); - var attributionString = _server.default.renderToStaticMarkup(attributionNode); + const attributionString = _server.default.renderToStaticMarkup(attributionNode); return /*#__PURE__*/_react.default.createElement(_reactLeaflet.TileLayer, { url: baseLayer.url, attribution: attributionString, @@ -752,14 +721,14 @@ var SiteMapLeaflet = function SiteMapLeaflet() { /** Render: Overlay */ - var renderOverlay = function renderOverlay(key) { - var overlay = _SiteMapUtils.OVERLAYS[key]; - var group = _SiteMapUtils.OVERLAY_GROUPS[overlay.group] || {}; - var commonProps = _extends({}, group.commonProps || {}, overlay.commonProps || {}); + const renderOverlay = key => { + const overlay = _SiteMapUtils.OVERLAYS[key]; + const group = _SiteMapUtils.OVERLAY_GROUPS[overlay.group] || {}; + const commonProps = _extends({}, group.commonProps || {}, overlay.commonProps || {}); return /*#__PURE__*/_react.default.createElement(_reactLeaflet.LayerGroup, { key: key - }, overlay.components.map(function (node) { - var Component = null; + }, overlay.components.map(node => { + let Component = null; if (node.type === 'WMSTileLayer') { Component = _reactLeaflet.WMSTileLayer; } @@ -775,14 +744,16 @@ var SiteMapLeaflet = function SiteMapLeaflet() { /** Render: AreaSelection */ - var renderAreaSelection = function renderAreaSelection() { - var isDragging = areaSelection.isDragging, - center = areaSelection.center, - reach = areaSelection.reach; + const renderAreaSelection = () => { + const { + isDragging, + center, + reach + } = areaSelection; if (!isDragging || !Number.isInteger(center.x) || !Number.isInteger(center.y) || !Number.isInteger(reach.x) || !Number.isInteger(reach.y)) { return null; } - var style = { + const style = { width: Math.abs(reach.x - center.x), height: Math.abs(reach.y - center.y), left: Math.min(center.x, reach.x), @@ -797,9 +768,9 @@ var SiteMapLeaflet = function SiteMapLeaflet() { /** Interaction Handlers */ - var handleMoveEnd = function handleMoveEnd(event) { - var center = event.target.getCenter(); - var bounds = event.target.getBounds(); + const handleMoveEnd = event => { + const center = event.target.getCenter(); + const bounds = event.target.getBounds(); dispatch({ type: 'setMapCenter', center: [center.lat, center.lng], @@ -812,9 +783,9 @@ var SiteMapLeaflet = function SiteMapLeaflet() { state.map.repositionOpenPopupFunc(); } }; - var handleZoomEnd = function handleZoomEnd(event) { - var center = event.target.getCenter(); - var bounds = event.target.getBounds(); + const handleZoomEnd = event => { + const center = event.target.getCenter(); + const bounds = event.target.getBounds(); dispatch({ type: 'setMapZoom', zoom: event.target.getZoom(), @@ -828,7 +799,7 @@ var SiteMapLeaflet = function SiteMapLeaflet() { state.map.repositionOpenPopupFunc(); } }; - var handleBaseLayerChange = function handleBaseLayerChange(key) { + const handleBaseLayerChange = key => { if (key !== null && !_SiteMapUtils.BASE_LAYERS[key]) { return; } @@ -837,25 +808,21 @@ var SiteMapLeaflet = function SiteMapLeaflet() { baseLayer: key }); }; - var handleOverlayChange = function handleOverlayChange(overlays) { + const handleOverlayChange = overlays => { dispatch({ type: 'setMapOverlays', - overlays: overlays.filter(function (o) { - return o.checked; - }).map(function (o) { - return o.name; - }) + overlays: overlays.filter(o => o.checked).map(o => o.name) }); }; /** Render: Loading / Progress */ - var renderProgress = function renderProgress() { + const renderProgress = () => { if (state.overallFetch.expected === state.overallFetch.completed) { return null; } - var style = state.selection.active ? { + const style = state.selection.active ? { left: '48px', top: '48px' } : null; @@ -867,8 +834,8 @@ var SiteMapLeaflet = function SiteMapLeaflet() { size: 32 })); } - var progress = state.overallFetch.expected === 0 ? 0 : Math.floor(state.overallFetch.completed / state.overallFetch.expected * 10) * 10; - var progressProps = progress < 60 ? { + const progress = state.overallFetch.expected === 0 ? 0 : Math.floor(state.overallFetch.completed / state.overallFetch.expected * 10) * 10; + const progressProps = progress < 60 ? { size: 32 } : { size: 32, @@ -896,12 +863,10 @@ var SiteMapLeaflet = function SiteMapLeaflet() { /** Render: Map */ - var groupedLayerControlBaseLayers = Object.keys(_SiteMapUtils.BASE_LAYERS).map(function (key) { - return { - name: key, - title: _SiteMapUtils.BASE_LAYERS[key].title - }; - }).concat([{ + const groupedLayerControlBaseLayers = Object.keys(_SiteMapUtils.BASE_LAYERS).map(key => ({ + name: key, + title: _SiteMapUtils.BASE_LAYERS[key].title + })).concat([{ name: null, title: /*#__PURE__*/_react.default.createElement("span", { style: { @@ -910,27 +875,30 @@ var SiteMapLeaflet = function SiteMapLeaflet() { } }, "none") }]); - var groupedLayerControlOverlays = Object.keys(_SiteMapUtils.OVERLAYS).map(function (key) { - var _OVERLAYS$key = _SiteMapUtils.OVERLAYS[key], - name = _OVERLAYS$key.KEY, - title = _OVERLAYS$key.title, - group = _OVERLAYS$key.group; - var checked = state.map.overlays.has(key); - var groupTitle = null; + const groupedLayerControlOverlays = Object.keys(_SiteMapUtils.OVERLAYS).map(key => { + const { + KEY: name, + title, + group + } = _SiteMapUtils.OVERLAYS[key]; + const checked = state.map.overlays.has(key); + let groupTitle = null; if (group && _SiteMapUtils.OVERLAY_GROUPS[group]) { groupTitle = _SiteMapUtils.OVERLAY_GROUPS[group].title; } return { - name: name, - title: title, - groupTitle: groupTitle, - checked: checked + name, + title, + groupTitle, + checked }; // eslint-disable-line object-curly-newline }); - - var canRenderGroupedLayerControl = mapRef && mapRef.current && mapRef.current.leafletElement; - var mouseModeCursors = (_mouseModeCursors = {}, _defineProperty(_mouseModeCursors, _SiteMapUtils.MAP_MOUSE_MODES.PAN, 'grab'), _defineProperty(_mouseModeCursors, _SiteMapUtils.MAP_MOUSE_MODES.AREA_SELECT, 'crosshair'), _mouseModeCursors); - var mouseModeProps = state.map.mouseMode === _SiteMapUtils.MAP_MOUSE_MODES.PAN ? { + const canRenderGroupedLayerControl = mapRef && mapRef.current && mapRef.current.leafletElement; + const mouseModeCursors = { + [_SiteMapUtils.MAP_MOUSE_MODES.PAN]: 'grab', + [_SiteMapUtils.MAP_MOUSE_MODES.AREA_SELECT]: 'crosshair' + }; + const mouseModeProps = state.map.mouseMode === _SiteMapUtils.MAP_MOUSE_MODES.PAN ? { boxZoom: true, dragging: true } : { @@ -938,7 +906,7 @@ var SiteMapLeaflet = function SiteMapLeaflet() { dragging: false, touchZoom: false }; - var className = classes.map; + let className = classes.map; if (state.fullscreen) { className = "".concat(className, " ").concat(classes.mapFullscreen); } @@ -980,17 +948,10 @@ var SiteMapLeaflet = function SiteMapLeaflet() { leaflet: { map: mapRef.current.leafletElement } - }), Object.keys(_SiteMapUtils.FEATURES).filter(function (key) { - return state.filters.features.available[key]; - }).filter(function (key) { - return state.filters.features.visible[key]; - }).map(function (key) { - return /*#__PURE__*/_react.default.createElement(_SiteMapFeature.default, { - key: key, - featureKey: key, - mapRef: mapRef - }); - })), renderAreaSelection(), renderShowFullObservatoryButton(), renderReturnToFocusLocationButton(), renderMouseModeToggleButtonGroup(), renderProgress()); + }), Object.keys(_SiteMapUtils.FEATURES).filter(key => state.filters.features.available[key]).filter(key => state.filters.features.visible[key]).map(key => /*#__PURE__*/_react.default.createElement(_SiteMapFeature.default, { + key: key, + featureKey: key, + mapRef: mapRef + }))), renderAreaSelection(), renderShowFullObservatoryButton(), renderReturnToFocusLocationButton(), renderMouseModeToggleButtonGroup(), renderProgress()); }; -var _default = SiteMapLeaflet; -exports.default = _default; \ No newline at end of file +var _default = exports.default = SiteMapLeaflet; \ No newline at end of file diff --git a/lib/components/SiteMap/SiteMapTable.js b/lib/components/SiteMap/SiteMapTable.js index 9971472c..0d427d7c 100644 --- a/lib/components/SiteMap/SiteMapTable.js +++ b/lib/components/SiteMap/SiteMapTable.js @@ -19,21 +19,11 @@ var _Theme = _interopRequireWildcard(require("../Theme/Theme")); var _SiteMapContext = _interopRequireDefault(require("./SiteMapContext")); var _SiteMapUtils = require("./SiteMapUtils"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint-disable jsx-a11y/anchor-is-valid */ -var ucWord = function ucWord() { - var word = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable jsx-a11y/anchor-is-valid */ +const ucWord = function () { + let word = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; return "".concat(word.slice(0, 1).toUpperCase()).concat(word.slice(1).toLowerCase()); }; @@ -43,53 +33,47 @@ var ucWord = function ucWord() { * Example: '"foo bar" baz' => ['foo bar', 'baz'] * @param {string} input - string to parse into discrete terms */ -var parseSearchTerms = function parseSearchTerms(input) { - var terms = input.replace(/[^\w\s."]/g, '').match(/(".*?"|[^" \s]+)(?=\s* |\s*$)/g); - return (terms || []).map(function (term) { - return term.replace(/"/g, '').toLowerCase(); - }); +const parseSearchTerms = input => { + const terms = input.replace(/[^\w\s."]/g, '').match(/(".*?"|[^" \s]+)(?=\s* |\s*$)/g); + return (terms || []).map(term => term.replace(/"/g, '').toLowerCase()); }; /** * Apply a searchString to a list of string attributes; return boolean for a match */ -var searchOnAttribs = function searchOnAttribs(searchString) { - var searchableAttribs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; - var searchTerms = parseSearchTerms(searchString); +const searchOnAttribs = function (searchString) { + let searchableAttribs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + const searchTerms = parseSearchTerms(searchString); if (!searchTerms.length) { return true; } - return searchTerms.some(function (term) { - return searchableAttribs.some(function (attrib) { - return (attrib || '').toLowerCase().includes(term); - }); - }); + return searchTerms.some(term => searchableAttribs.some(attrib => (attrib || '').toLowerCase().includes(term))); }; -var getFeatureName = function getFeatureName(featureKey) { +const getFeatureName = featureKey => { if (_SiteMapUtils.FEATURES[featureKey]) { return _SiteMapUtils.FEATURES[featureKey].nameSingular || _SiteMapUtils.FEATURES[featureKey].name || featureKey; } return featureKey; }; -var calculateMaxBodyHeight = function calculateMaxBodyHeight(tableRef) { +const calculateMaxBodyHeight = tableRef => { if (!tableRef || !tableRef.current) { return _SiteMapUtils.MIN_TABLE_MAX_BODY_HEIGHT; } - var containerHeight = tableRef.current.clientHeight || 0; - var toolbarHeight = tableRef.current.children[0].children[0].clientHeight || 0; - var pagerHeight = tableRef.current.children[0].children[2].clientHeight || 0; + const containerHeight = tableRef.current.clientHeight || 0; + const toolbarHeight = tableRef.current.children[0].children[0].clientHeight || 0; + const pagerHeight = tableRef.current.children[0].children[2].clientHeight || 0; return Math.max(containerHeight - toolbarHeight - pagerHeight, _SiteMapUtils.MIN_TABLE_MAX_BODY_HEIGHT); }; -var EXPORT_FILENAME = 'NEON-SiteMap-Table'; -var exportCsv = function exportCsv() { - var columns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var rows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; +const EXPORT_FILENAME = 'NEON-SiteMap-Table'; +const exportCsv = function () { + let columns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + let rows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; if (!columns.length || !rows.length) { return; } - var columnHeaders = columns.reduce(function (acc, cur) { + const columnHeaders = columns.reduce((acc, cur) => { if (Array.isArray(cur.csvFields)) { - cur.csvFields.forEach(function (field) { + cur.csvFields.forEach(field => { acc.push(field); }); } else { @@ -97,14 +81,12 @@ var exportCsv = function exportCsv() { } return acc; }, []); - var payloadRows = [columnHeaders.join(',')]; - rows.forEach(function (row) { - var payloadRow = []; - columns.forEach(function (column) { - var render = typeof column.csvRender === 'function' ? column.csvRender : function (r) { - return r[column.field] || null; - }; - payloadRow.push([render(row)].flat().map(function (value) { + const payloadRows = [columnHeaders.join(',')]; + rows.forEach(row => { + const payloadRow = []; + columns.forEach(column => { + const render = typeof column.csvRender === 'function' ? column.csvRender : r => r[column.field] || null; + payloadRow.push([render(row)].flat().map(value => { if (value === null || typeof value === 'undefined' || Number.isNaN(value)) { return ''; } @@ -116,16 +98,16 @@ var exportCsv = function exportCsv() { }); payloadRows.push(payloadRow.join(',')); }); - var payload = payloadRows.join('\n'); - var mimeType = 'text/csv;charset=utf-8'; - var fileName = "".concat(EXPORT_FILENAME, ".csv"); + const payload = payloadRows.join('\n'); + const mimeType = 'text/csv;charset=utf-8'; + const fileName = "".concat(EXPORT_FILENAME, ".csv"); if (navigator.msSaveBlob) { // IE10+ navigator.msSaveBlob(new Blob([payload], { type: mimeType }), fileName); } else { - var link = document.createElement('a'); + const link = document.createElement('a'); if (URL && typeof URL.createObjectURL === 'function') { link.href = URL.createObjectURL(new Blob([payload], { type: mimeType @@ -139,78 +121,79 @@ var exportCsv = function exportCsv() { document.body.removeChild(link); } }; -var useStyles = (0, _styles.makeStyles)(function (theme) { - var _toolbarContainer; - return { - tableContainer: { - backgroundColor: 'white', - overflowWrap: 'normal', - '& table': { - margin: '0px !important', - borderCollapse: 'separate', - '& tr.MuiTableRow-root:empty': { - height: '0px !important' - }, - '& tr.MuiTableRow-head': { - backgroundColor: theme.palette.primary.main, - '& th:first-child span.MuiCheckbox-root': { - margin: theme.spacing(0, 0.5), - backgroundColor: '#ffffff88', - '&:hover': { - backgroundColor: '#ffffffaa' - } +const useStyles = (0, _styles.makeStyles)(theme => ({ + tableContainer: { + backgroundColor: 'white', + overflowWrap: 'normal', + '& table': { + margin: '0px !important', + borderCollapse: 'separate', + '& tr.MuiTableRow-root:empty': { + height: '0px !important' + }, + '& tr.MuiTableRow-head': { + backgroundColor: theme.palette.primary.main, + '& th:first-child span.MuiCheckbox-root': { + margin: theme.spacing(0, 0.5), + backgroundColor: '#ffffff88', + '&:hover': { + backgroundColor: '#ffffffaa' } - }, - '& tbody tr:first-child': { - backgroundColor: theme.palette.grey[50] - }, - '& tfoot': { - paddingRight: '36px' } }, - '& td.MuiTablePagination-root': { - borderBottom: 'none' + '& tbody tr:first-child': { + backgroundColor: theme.palette.grey[50] + }, + '& tfoot': { + paddingRight: '36px' } }, - tableContainerIntegrated: { - position: 'absolute', - width: '100%', - height: '100%' - }, - tableContainerStandalone: { - // ... - }, - featureIcon: { - width: theme.spacing(3), - height: theme.spacing(3), - marginRight: theme.spacing(1), - filter: 'drop-shadow(0px 0px 1.5px #000000bb)' - }, - linkButton: { - textAlign: 'left' - }, - downloadCsvButton: { - marginRight: theme.spacing(2) - }, - startFlex: { - display: 'flex', - alignItems: 'center', - justifyContent: 'flex-start' - }, - endFlex: { - display: 'flex', - alignItems: 'center', - justifyContent: 'flex-end' - }, - toolbarContainer: (_toolbarContainer = { - backgroundColor: theme.palette.grey[50] - }, _defineProperty(_toolbarContainer, theme.breakpoints.down('xs'), { + '& td.MuiTablePagination-root': { + borderBottom: 'none' + } + }, + tableContainerIntegrated: { + position: 'absolute', + width: '100%', + height: '100%' + }, + tableContainerStandalone: { + // ... + }, + featureIcon: { + width: theme.spacing(3), + height: theme.spacing(3), + marginRight: theme.spacing(1), + filter: 'drop-shadow(0px 0px 1.5px #000000bb)' + }, + linkButton: { + textAlign: 'left' + }, + downloadCsvButton: { + marginRight: theme.spacing(2) + }, + startFlex: { + display: 'flex', + alignItems: 'center', + justifyContent: 'flex-start' + }, + endFlex: { + display: 'flex', + alignItems: 'center', + justifyContent: 'flex-end' + }, + toolbarContainer: { + backgroundColor: theme.palette.grey[50], + [theme.breakpoints.down('xs')]: { paddingTop: theme.spacing(4.5) - }), _defineProperty(_toolbarContainer, '& div.MuiToolbar-root', { + }, + '& div.MuiToolbar-root': { width: '100%', padding: theme.spacing(0, 0, 0, 2), backgroundColor: theme.palette.grey[50] - }), _defineProperty(_toolbarContainer, '& button', { + }, + // Make the columns button more prominent (really hard to do with component overriding) + '& button': { color: theme.palette.primary.main, '&:hover, &:active': { color: _Theme.COLORS.LIGHT_BLUE[400], @@ -218,113 +201,114 @@ var useStyles = (0, _styles.makeStyles)(function (theme) { backgroundColor: "".concat(_Theme.COLORS.LIGHT_BLUE[400], "20"), padding: '11px' } - }), _toolbarContainer), - toolbarContainerNoSplit: { - '& div.MuiToolbar-root': { - width: 'calc(100% - 244px)' - }, - // This hides all but the search input, show columns, and export buttons. - // No other way to have material table NOT show a selection title in the toolbar. - '& div.MuiToolbar-root > div:not(:nth-last-child(-n+2))': { - display: 'none' - } - }, - toggleButtonGroup: { - height: theme.spacing(4) - }, - toggleButton: { - height: theme.spacing(4), - fontWeight: 600, - color: theme.palette.primary.main, - borderColor: theme.palette.primary.main, - padding: theme.spacing(0, 1.5), - whiteSpace: 'nowrap' - }, - // Use !important here to override the Mui-selected class with higher priority - toggleButtonSelected: { - color: '#fff !important', - backgroundColor: "".concat(theme.palette.primary.main, " !important") - }, - caption: { - fontFamily: 'monospace', - fontSize: '1.05em', - whiteSpace: 'nowrap' - }, - iconButton: { - marginTop: theme.spacing(-0.25) - }, - siteName: { - display: 'flex', - alignItems: 'center', - justifyContent: 'flex-start', - margin: theme.spacing(1, 0, 0.5, 0), - minWidth: '200px', - textAlign: 'left' - }, - siteLinksDivider: { - margin: theme.spacing(0, 1, 0, 1) - }, - siteDetailsLink: { - fontSize: '80%', - fontStyle: 'italic' - }, - nlcdClassContainer: { - display: 'flex', - alignItems: 'center' - }, - nlcdClass: { - width: '14px', - height: '14px', - border: '1px solid black', - marginRight: theme.spacing(1.5) - }, - tableTitle: { - '& h6': { - fontSize: '1.2rem', - fontWeight: 500 - } + } + }, + toolbarContainerNoSplit: { + '& div.MuiToolbar-root': { + width: 'calc(100% - 244px)' }, - paginationRoot: { - width: 'auto' + // This hides all but the search input, show columns, and export buttons. + // No other way to have material table NOT show a selection title in the toolbar. + '& div.MuiToolbar-root > div:not(:nth-last-child(-n+2))': { + display: 'none' } - }; -}); -var SiteMapTable = function SiteMapTable() { - var classes = useStyles(_Theme.default); - var tableRef = (0, _react.useRef)(null); + }, + toggleButtonGroup: { + height: theme.spacing(4) + }, + toggleButton: { + height: theme.spacing(4), + fontWeight: 600, + color: theme.palette.primary.main, + borderColor: theme.palette.primary.main, + padding: theme.spacing(0, 1.5), + whiteSpace: 'nowrap' + }, + // Use !important here to override the Mui-selected class with higher priority + toggleButtonSelected: { + color: '#fff !important', + backgroundColor: "".concat(theme.palette.primary.main, " !important") + }, + caption: { + fontFamily: 'monospace', + fontSize: '1.05em', + whiteSpace: 'nowrap' + }, + iconButton: { + marginTop: theme.spacing(-0.25) + }, + siteName: { + display: 'flex', + alignItems: 'center', + justifyContent: 'flex-start', + margin: theme.spacing(1, 0, 0.5, 0), + minWidth: '200px', + textAlign: 'left' + }, + siteLinksDivider: { + margin: theme.spacing(0, 1, 0, 1) + }, + siteDetailsLink: { + fontSize: '80%', + fontStyle: 'italic' + }, + nlcdClassContainer: { + display: 'flex', + alignItems: 'center' + }, + nlcdClass: { + width: '14px', + height: '14px', + border: '1px solid black', + marginRight: theme.spacing(1.5) + }, + tableTitle: { + '& h6': { + fontSize: '1.2rem', + fontWeight: 500 + } + }, + paginationRoot: { + width: 'auto' + } +})); +const SiteMapTable = () => { + const classes = useStyles(_Theme.default); + const tableRef = (0, _react.useRef)(null); // Neon Context State - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - _NeonContext$useNeonC3 = _NeonContext$useNeonC2[0], - isFinal = _NeonContext$useNeonC3.isFinal, - hasError = _NeonContext$useNeonC3.hasError; - var canRender = isFinal && !hasError; + const [{ + isFinal, + hasError + }] = _NeonContext.default.useNeonContextState(); + const canRender = isFinal && !hasError; // Site Map State - var _SiteMapContext$useSi = _SiteMapContext.default.useSiteMapContext(), - _SiteMapContext$useSi2 = _slicedToArray(_SiteMapContext$useSi, 2), - state = _SiteMapContext$useSi2[0], - dispatch = _SiteMapContext$useSi2[1]; - var manualLocationData = state.manualLocationData, - _state$view = state.view, - view = _state$view.current, - viewsInitialized = _state$view.initialized; - var _state$table = state.table, - focus = _state$table.focus, - fullHeight = _state$table.fullHeight, - maxBodyHeight = _state$table.maxBodyHeight, - maxBodyHeightUpdateFromAspectRatio = _state$table.maxBodyHeightUpdateFromAspectRatio; - var _state$selection = state.selection, - selection = _state$selection.set, - selectableItems = _state$selection.validSet, - hideUnselectable = _state$selection.hideUnselectable; - var selectionActive = state.selection.active === focus; + const [state, dispatch] = _SiteMapContext.default.useSiteMapContext(); + const { + manualLocationData, + view: { + current: view, + initialized: viewsInitialized + } + } = state; + const { + focus, + fullHeight, + maxBodyHeight, + maxBodyHeightUpdateFromAspectRatio + } = state.table; + const { + set: selection, + validSet: selectableItems, + hideUnselectable + } = state.selection; + const selectionActive = state.selection.active === focus; /** Effect - Initialize table if this is the first time we're seeing it */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (!tableRef || !tableRef.current || view !== _SiteMapUtils.VIEWS.TABLE || viewsInitialized[_SiteMapUtils.VIEWS.TABLE]) { return; } @@ -340,7 +324,7 @@ var SiteMapTable = function SiteMapTable() { /** Effect - Recalculate the max body height from an aspect ratio change (e.g. page resize) */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (view === _SiteMapUtils.VIEWS.TABLE && viewsInitialized[_SiteMapUtils.VIEWS.TABLE] && maxBodyHeightUpdateFromAspectRatio) { dispatch({ type: 'setTableMaxBodyHeight', @@ -352,33 +336,33 @@ var SiteMapTable = function SiteMapTable() { /** Layout Effect - Inject a second horizontal scrollbar above the table linked to the main */ - (0, _react.useLayoutEffect)(function () { - var noop = function noop() {}; + (0, _react.useLayoutEffect)(() => { + const noop = () => {}; // This all only applies to full height table and/or split view (which behaves as full height) if (!fullHeight && view !== _SiteMapUtils.VIEWS.SPLIT) { return noop; } // Collect the nodes we pay attention to. Each one has a distinct purpose. - var tableNode = tableRef.current.querySelector('table'); + const tableNode = tableRef.current.querySelector('table'); if (!tableNode) { return noop; } - var tbodyNode = tableRef.current.querySelector('tbody'); + const tbodyNode = tableRef.current.querySelector('tbody'); if (!tbodyNode) { return noop; } - var scrollingNode = (tableNode.parentElement || {}).parentElement; + const scrollingNode = (tableNode.parentElement || {}).parentElement; if (!scrollingNode) { return noop; } - var containerNode = scrollingNode.parentElement; + const containerNode = scrollingNode.parentElement; if (!containerNode) { return noop; } // Initialize the new scrollbar in this scope - var scrollbar = null; + let scrollbar = null; // Function to do the initial injection fo the scrollbar node - var injectScrollbar = function injectScrollbar() { + const injectScrollbar = () => { scrollbar = document.createElement('div'); scrollbar.appendChild(document.createElement('div')); scrollbar.style.overflow = 'auto'; @@ -387,17 +371,17 @@ var SiteMapTable = function SiteMapTable() { scrollbar.style.backgroundColor = _Theme.default.palette.grey[50]; scrollbar.firstChild.style.width = "".concat(tableNode.scrollWidth || 0, "px"); scrollbar.firstChild.style.paddingTop = '1px'; - scrollbar.onscroll = function () { + scrollbar.onscroll = () => { scrollingNode.scrollLeft = scrollbar.scrollLeft; }; - scrollingNode.onscroll = function () { + scrollingNode.onscroll = () => { scrollbar.scrollLeft = scrollingNode.scrollLeft; }; containerNode.parentNode.insertBefore(scrollbar, containerNode); }; // Function to resize the scrollbar. We can't rely on the scrollWidth being accurate when we // inject as not-yet-fully-rendered table rows may expand the scrollWidth. - var resizeScrollbar = function resizeScrollbar() { + const resizeScrollbar = () => { if (!scrollbar) { return; } @@ -405,15 +389,15 @@ var SiteMapTable = function SiteMapTable() { scrollbar.scrollLeft = scrollingNode.scrollLeft; }; // Inject the scrollbar one step removed from the initial render cycle (with a 0-sec timeout) - var timeout = window.setTimeout(injectScrollbar, 0); + const timeout = window.setTimeout(injectScrollbar, 0); // Observe the childList of the tbody - i.e. rows being added or removed - to trigger a resize // of the injected scrollbar - var observer = new MutationObserver(resizeScrollbar); + const observer = new MutationObserver(resizeScrollbar); observer.observe(tbodyNode, { childList: true }); // Clear any pending timeouts and disconnect our observer on unload to avoid memory leaks - return function () { + return () => { observer.disconnect(); window.clearTimeout(timeout); }; @@ -423,28 +407,20 @@ var SiteMapTable = function SiteMapTable() { } // Selection functions - var rowIsSelected = function rowIsSelected() { - return false; - }; - var rowIsSelectable = function rowIsSelectable() { - return false; - }; + let rowIsSelected = () => false; + let rowIsSelectable = () => false; switch (focus) { case _SiteMapUtils.FEATURE_TYPES.SITES.KEY: - rowIsSelected = function rowIsSelected(row) { - return selection.has(row.siteCode); - }; - rowIsSelectable = function rowIsSelectable(row) { - return !selectableItems || selectableItems.has(row.siteCode); - }; + rowIsSelected = row => selection.has(row.siteCode); + rowIsSelectable = row => !selectableItems || selectableItems.has(row.siteCode); break; default: break; } // Jump-To function to turn location names in the table to map navigation - var jumpTo = function jumpTo() { - var locationCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + const jumpTo = function () { + let locationCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; dispatch({ type: 'setNewFocusLocation', location: locationCode @@ -453,20 +429,22 @@ var SiteMapTable = function SiteMapTable() { // While sites keep a state and domain code locations only keep a site code. // These helper functions will connect the dots to to get site/state/domain/etc. for a location. - var getParent = function getParent(type, location) { - var source = null; + const getParent = (type, location) => { + let source = null; if (type === 'SITE') { - var data = state.sites; + let data = state.sites; if (Array.isArray(manualLocationData) && manualLocationData.length) { data = {}; - manualLocationData.forEach(function (ml) { - var siteCode = ml.siteCode; + manualLocationData.forEach(ml => { + const { + siteCode + } = ml; data[siteCode] = Object.keys(state.sites).includes(siteCode) ? state.sites[siteCode] : ml; }); } source = { code: 'siteCode', - data: data + data }; } else if (type === 'STATE') { source = { @@ -482,30 +460,28 @@ var SiteMapTable = function SiteMapTable() { if (!source) { return null; } - var code = null; + let code = null; if (location[source.code]) { code = location[source.code]; } else if (location.siteCode) { code = state.sites[location.siteCode] ? state.sites[location.siteCode][source.code] : null; } - return source.data[code] ? _extends(_defineProperty({}, source.code, code), source.data[code]) : null; - }; - var getSite = function getSite(location) { - return getParent('SITE', location); + return source.data[code] ? _extends({ + [source.code]: code + }, source.data[code]) : null; }; - var getState = function getState(location) { - return getParent('STATE', location); - }; - var getDomain = function getDomain(location) { - return getParent('DOMAIN', location); - }; - var renderFeatureIcon = function renderFeatureIcon(featureKey) { - var unselectable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const getSite = location => getParent('SITE', location); + const getState = location => getParent('STATE', location); + const getDomain = location => getParent('DOMAIN', location); + const renderFeatureIcon = function (featureKey) { + let unselectable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!_SiteMapUtils.FEATURES[featureKey] || !_SiteMapUtils.FEATURES[featureKey].iconSvg) { return null; } - var iconSvg = _SiteMapUtils.FEATURES[featureKey].iconSvg; - var style = unselectable ? { + const { + iconSvg + } = _SiteMapUtils.FEATURES[featureKey]; + const style = unselectable ? { filter: _SiteMapUtils.UNSELECTABLE_MARKER_FILTER } : {}; return /*#__PURE__*/_react.default.createElement("img", { @@ -515,9 +491,9 @@ var SiteMapTable = function SiteMapTable() { style: style }); }; - var renderCaptionString = function renderCaptionString() { - var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '--'; - var ariaLabel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + const renderCaptionString = function () { + let str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '--'; + let ariaLabel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; return /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "caption", "aria-label": ariaLabel, @@ -528,45 +504,33 @@ var SiteMapTable = function SiteMapTable() { /** Calculate rows */ - var visibleFeatureKeys = Object.keys(state.featureData[focus]).filter(function (featureKey) { - return state.filters.features.available[featureKey] && state.filters.features.visible[featureKey]; - }); - var locations = {}; - visibleFeatureKeys.forEach(function (featureKey) { - Object.keys(state.featureData[focus][featureKey]).forEach(function (siteCode) { + const visibleFeatureKeys = Object.keys(state.featureData[focus]).filter(featureKey => state.filters.features.available[featureKey] && state.filters.features.visible[featureKey]); + const locations = {}; + visibleFeatureKeys.forEach(featureKey => { + Object.keys(state.featureData[focus][featureKey]).forEach(siteCode => { if (focus === _SiteMapUtils.FEATURE_TYPES.SITES.KEY) { locations[siteCode] = state.featureData[focus][featureKey][siteCode]; } if (focus === _SiteMapUtils.FEATURE_TYPES.LOCATIONS.KEY) { - Object.keys(state.featureData[focus][featureKey][siteCode]).forEach(function (locationCode) { + Object.keys(state.featureData[focus][featureKey][siteCode]).forEach(locationCode => { locations[locationCode] = state.featureData[focus][featureKey][siteCode][locationCode]; }); } }); }); - var initialRows = (0, _SiteMapUtils.calculateLocationsInBounds)(locations, state.map.bounds); + let initialRows = (0, _SiteMapUtils.calculateLocationsInBounds)(locations, state.map.bounds); if (selectionActive && selectableItems && hideUnselectable) { - initialRows = initialRows.filter(function (item) { - return selectableItems.has(item); - }); + initialRows = initialRows.filter(item => selectableItems.has(item)); } - var hasPrototypeSites = (manualLocationData || []).some(function (ml) { - return ml.manualLocationType === _SiteMapUtils.MANUAL_LOCATION_TYPES.PROTOTYPE_SITE; - }); + const hasPrototypeSites = (manualLocationData || []).some(ml => ml.manualLocationType === _SiteMapUtils.MANUAL_LOCATION_TYPES.PROTOTYPE_SITE); if (hasPrototypeSites) { - var visibleSites = manualLocationData.map(function (ml) { - return ml.siteCode; - }); - initialRows = initialRows.filter(function (item) { - return visibleSites.includes(item); - }); + const visibleSites = manualLocationData.map(ml => ml.siteCode); + initialRows = initialRows.filter(item => visibleSites.includes(item)); } - var rows = initialRows.map(function (key) { - return locations[key]; - }); + const rows = initialRows.map(key => locations[key]); if (selectionActive) { - rows.forEach(function (row, idx) { - var selected = false; + rows.forEach((row, idx) => { + let selected = false; if (focus === _SiteMapUtils.FEATURE_TYPES.SITES.KEY) { selected = selection.has(row.siteCode); } @@ -581,23 +545,21 @@ var SiteMapTable = function SiteMapTable() { /** Unique sites, domains, and states off of rows */ - var sitesInMap = Array.from(rows.reduce(function (acc, cur) { + const sitesInMap = Array.from(rows.reduce((acc, cur) => { if (cur.siteCode) { acc.add(cur.siteCode); } return acc; }, new Set())); - var domainsInMap = new Set(); - var statesInMap = new Set(); - sitesInMap.filter(function (siteCode) { - return state.sites[siteCode]; - }).forEach(function (siteCode) { + const domainsInMap = new Set(); + const statesInMap = new Set(); + sitesInMap.filter(siteCode => state.sites[siteCode]).forEach(siteCode => { domainsInMap.add(state.sites[siteCode].domainCode); statesInMap.add(state.sites[siteCode].stateCode); }); // Columns that are visible for more than one feature type - var commonColumns = { + const commonColumns = { site: { field: 'siteCode', csvFields: ['siteCode', 'siteName'], @@ -606,10 +568,8 @@ var SiteMapTable = function SiteMapTable() { sorting: true, defaultSort: 'desc', searchable: true, - lookup: Object.fromEntries(Array.from(sitesInMap).sort().map(function (siteCode) { - return [siteCode, siteCode]; - })), - customFilterAndSearch: function customFilterAndSearch(input, row) { + lookup: Object.fromEntries(Array.from(sitesInMap).sort().map(siteCode => [siteCode, siteCode])), + customFilterAndSearch: (input, row) => { if (typeof input === 'string' && input.length) { return searchOnAttribs(input, [row.siteCode, row.description]); } @@ -618,30 +578,30 @@ var SiteMapTable = function SiteMapTable() { } return true; }, - customSort: function customSort(rowA, rowB) { - var siteA = getSite(rowA); - var siteB = getSite(rowB); - var aName = siteA.description; - var bName = siteB.description; + customSort: (rowA, rowB) => { + const siteA = getSite(rowA); + const siteB = getSite(rowB); + const aName = siteA.description; + const bName = siteB.description; return aName > bName ? -1 : 1; }, // eslint-disable-next-line arrow-body-style - render: function render(row) { - var site = getSite(row); + render: row => { + const site = getSite(row); if (!site) { return null; } - var siteCode = site.siteCode, - description = site.description; - var isDecommissioned = site.manualLocationType === _SiteMapUtils.MANUAL_LOCATION_TYPES.PROTOTYPE_SITE; - var featureKey = isDecommissioned ? _SiteMapUtils.FEATURES.DECOMMISSIONED_SITES.KEY : "".concat(site.terrain.toUpperCase(), "_").concat(site.type.toUpperCase(), "_SITES"); - var unselectable = selectionActive && !rowIsSelectable(row); + const { + siteCode, + description + } = site; + const isDecommissioned = site.manualLocationType === _SiteMapUtils.MANUAL_LOCATION_TYPES.PROTOTYPE_SITE; + const featureKey = isDecommissioned ? _SiteMapUtils.FEATURES.DECOMMISSIONED_SITES.KEY : "".concat(site.terrain.toUpperCase(), "_").concat(site.type.toUpperCase(), "_SITES"); + const unselectable = selectionActive && !rowIsSelectable(row); return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Link.default, { component: "button", className: classes.siteName, - onClick: function onClick() { - return jumpTo(siteCode); - }, + onClick: () => jumpTo(siteCode), title: "Click to view ".concat(siteCode, " on the map") }, renderFeatureIcon(featureKey, unselectable), /*#__PURE__*/_react.default.createElement("span", null, "".concat(description || 'Unnamed Site', " (").concat(siteCode, ")"))), /*#__PURE__*/_react.default.createElement("div", { className: classes.startFlex @@ -655,8 +615,8 @@ var SiteMapTable = function SiteMapTable() { href: "".concat((0, _SiteMapUtils.getHref)('EXPLORE_DATA_PRODUCTS_BY_SITE', siteCode)) }, "Explore Data"))); }, - csvRender: function csvRender(row) { - var siteName = null; + csvRender: row => { + let siteName = null; if (state.sites[row.siteCode]) { siteName = state.sites[row.siteCode].description; } @@ -669,22 +629,18 @@ var SiteMapTable = function SiteMapTable() { sorting: true, defaultSort: 'desc', searchable: true, - lookup: Object.fromEntries(Array.from(domainsInMap).sort().map(function (domainCode) { - return [domainCode, domainCode]; - })), - customSort: function customSort(rowA, rowB) { - var domainA = getDomain(rowA); - var domainB = getDomain(rowB); + lookup: Object.fromEntries(Array.from(domainsInMap).sort().map(domainCode => [domainCode, domainCode])), + customSort: (rowA, rowB) => { + const domainA = getDomain(rowA); + const domainB = getDomain(rowB); return domainA.domainCode > domainB.domainCode ? -1 : 1; }, - render: function render(row) { - var domain = getDomain(row); + render: row => { + const domain = getDomain(row); return !domain ? null : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Link.default, { component: "button", className: classes.linkButton, - onClick: function onClick() { - return jumpTo(domain.domainCode); - }, + onClick: () => jumpTo(domain.domainCode), title: "Click to view ".concat(domain.domainCode, " on the map") }, domain.domainCode || '')); } @@ -695,17 +651,15 @@ var SiteMapTable = function SiteMapTable() { sorting: true, defaultSort: 'desc', searchable: true, - lookup: Object.fromEntries(Array.from(statesInMap).sort().map(function (stateCode) { - return [stateCode, state.featureData.STATES.STATES[stateCode].name]; - })), - customSort: function customSort(rowA, rowB) { - var stateA = getState(rowA); - var stateB = getState(rowB); + lookup: Object.fromEntries(Array.from(statesInMap).sort().map(stateCode => [stateCode, state.featureData.STATES.STATES[stateCode].name])), + customSort: (rowA, rowB) => { + const stateA = getState(rowA); + const stateB = getState(rowB); return stateA.name > stateB.name ? -1 : 1; }, - customFilterAndSearch: function customFilterAndSearch(input, row) { + customFilterAndSearch: (input, row) => { if (typeof input === 'string' && input.length) { - var rowState = getState(row); + const rowState = getState(row); return searchOnAttribs(input, [row.stateCode, rowState.name]); } if (Array.isArray(input) && input.length) { @@ -713,15 +667,15 @@ var SiteMapTable = function SiteMapTable() { } return true; }, - render: function render(row) { - var usstate = getState(row); - var stateCode = row.stateCode; + render: row => { + const usstate = getState(row); + const { + stateCode + } = row; return !usstate ? null : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Link.default, { component: "button", className: classes.linkButton, - onClick: function onClick() { - return jumpTo(stateCode); - }, + onClick: () => jumpTo(stateCode), title: "Click to view ".concat(stateCode, " on the map") }, usstate.name || '')); } @@ -733,47 +687,39 @@ var SiteMapTable = function SiteMapTable() { sorting: false, filtering: false, searchable: false, - render: function render(row) { - var rowLatitude = row.latitude, - rowLongitude = row.longitude; - var latitude = Number.isFinite(rowLatitude) ? rowLatitude.toFixed(5) : null; - var longitude = Number.isFinite(rowLongitude) ? rowLongitude.toFixed(5) : null; + render: row => { + const { + latitude: rowLatitude, + longitude: rowLongitude + } = row; + const latitude = Number.isFinite(rowLatitude) ? rowLatitude.toFixed(5) : null; + const longitude = Number.isFinite(rowLongitude) ? rowLongitude.toFixed(5) : null; return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderCaptionString(latitude, 'Latitude'), /*#__PURE__*/_react.default.createElement("br", null), renderCaptionString(longitude, 'Longitude')); }, - csvRender: function csvRender(row) { - return [Number.isFinite(row.latitude) ? row.latitude.toFixed(5) : null, Number.isFinite(row.longitude) ? row.longitude.toFixed(5) : null]; - } + csvRender: row => [Number.isFinite(row.latitude) ? row.latitude.toFixed(5) : null, Number.isFinite(row.longitude) ? row.longitude.toFixed(5) : null] }, latitude: { field: 'latitude', title: 'Latitude', sorting: true, filtering: false, - render: function render(row) { - return renderCaptionString(Number.isFinite(row.latitude) ? row.latitude.toFixed(5) : null, 'Latitude'); - }, - csvRender: function csvRender(row) { - return Number.isFinite(row.latitude) ? row.latitude.toFixed(5) : null; - } + render: row => renderCaptionString(Number.isFinite(row.latitude) ? row.latitude.toFixed(5) : null, 'Latitude'), + csvRender: row => Number.isFinite(row.latitude) ? row.latitude.toFixed(5) : null }, longitude: { field: 'longitude', title: 'Longitude', sorting: true, filtering: false, - render: function render(row) { - return renderCaptionString(Number.isFinite(row.longitude) ? row.longitude.toFixed(5) : null, 'Longitude'); - }, - csvRender: function csvRender(row) { - return Number.isFinite(row.longitude) ? row.longitude.toFixed(5) : null; - } + render: row => renderCaptionString(Number.isFinite(row.longitude) ? row.longitude.toFixed(5) : null, 'Longitude'), + csvRender: row => Number.isFinite(row.longitude) ? row.longitude.toFixed(5) : null } }; /** Define columns from current focus feature type */ - var columns = []; + let columns = []; if (focus === _SiteMapUtils.FEATURE_TYPES.SITES.KEY) { columns = [commonColumns.site, { // Site Type @@ -782,28 +728,16 @@ var SiteMapTable = function SiteMapTable() { sorting: true, defaultSort: 'desc', searchable: true, - lookup: Object.fromEntries(Array.from(new Set(rows.map(function (row) { - return row.type; - }))).sort().map(function (k) { - return [k, ucWord(k)]; - })), - render: function render(row) { - return ucWord(row.type); - } + lookup: Object.fromEntries(Array.from(new Set(rows.map(row => row.type))).sort().map(k => [k, ucWord(k)])), + render: row => ucWord(row.type) }, { // Site Terrain field: 'terrain', title: 'Terrain', sorting: true, defaultSort: 'desc', - lookup: Object.fromEntries(Array.from(new Set(rows.map(function (row) { - return row.terrain; - }))).sort().map(function (k) { - return [k, ucWord(k)]; - })), - render: function render(row) { - return ucWord(row.terrain); - } + lookup: Object.fromEntries(Array.from(new Set(rows.map(row => row.terrain))).sort().map(k => [k, ucWord(k)])), + render: row => ucWord(row.terrain) }, commonColumns.domain, commonColumns.state, commonColumns.coordinates]; } if (focus === _SiteMapUtils.FEATURE_TYPES.LOCATIONS.KEY) { @@ -814,14 +748,14 @@ var SiteMapTable = function SiteMapTable() { sorting: true, defaultSort: 'desc', searchable: true, - render: function render(row) { - var name = row.name; + render: row => { + const { + name + } = row; return /*#__PURE__*/_react.default.createElement(_Link.default, { component: "button", className: classes.linkButton, - onClick: function onClick() { - return jumpTo(name); - }, + onClick: () => jumpTo(name), title: "View ".concat(name, " on map") }, name || ''); } @@ -832,31 +766,25 @@ var SiteMapTable = function SiteMapTable() { sorting: true, defaultSort: 'desc', searchable: true, - lookup: Object.fromEntries(Array.from(new Set(rows.map(function (row) { - return row.featureKey; - }))).sort(function (a, b) { - return getFeatureName(a) > getFeatureName(b) ? 1 : -1; - }).map(function (featureKey) { - return [featureKey, getFeatureName(featureKey)]; - })), - customSort: function customSort(rowA, rowB) { - var typeA = getFeatureName(rowA.featureKey); - var typeB = getFeatureName(rowB.featureKey); + lookup: Object.fromEntries(Array.from(new Set(rows.map(row => row.featureKey))).sort((a, b) => getFeatureName(a) > getFeatureName(b) ? 1 : -1).map(featureKey => [featureKey, getFeatureName(featureKey)])), + customSort: (rowA, rowB) => { + const typeA = getFeatureName(rowA.featureKey); + const typeB = getFeatureName(rowB.featureKey); if (typeA.name === typeB.name) { return 0; } return typeA.name > typeB.name ? -1 : 1; }, - render: function render(row) { - var featureKey = row.featureKey; - var featureName = getFeatureName(featureKey); + render: row => { + const { + featureKey + } = row; + const featureName = getFeatureName(featureKey); return /*#__PURE__*/_react.default.createElement("div", { className: classes.startFlex }, renderFeatureIcon(featureKey), /*#__PURE__*/_react.default.createElement("span", null, featureName)); }, - csvRender: function csvRender(row) { - return getFeatureName(row.featureKey); - } + csvRender: row => getFeatureName(row.featureKey) }, { // Elevation field: 'elevation', @@ -865,12 +793,8 @@ var SiteMapTable = function SiteMapTable() { sorting: true, defaultSort: 'desc', filtering: false, - render: function render(row) { - return renderCaptionString(Number.isFinite(row.elevation) ? "".concat(row.elevation.toFixed(2), "m") : '--', 'Elevation'); - }, - csvRender: function csvRender(row) { - return Number.isFinite(row.elevation) ? row.elevation.toFixed(2) : null; - } + render: row => renderCaptionString(Number.isFinite(row.elevation) ? "".concat(row.elevation.toFixed(2), "m") : '--', 'Elevation'), + csvRender: row => Number.isFinite(row.elevation) ? row.elevation.toFixed(2) : null }, { // NLCD Class field: 'nlcdClass', @@ -878,36 +802,35 @@ var SiteMapTable = function SiteMapTable() { sorting: true, deafultSort: 'asc', searchable: true, - lookup: Object.fromEntries(Object.keys(_SiteMapUtils.NLCD_CLASSES).filter(function (classKey) { - return rows.some(function (row) { - return row.nlcdClass === classKey; - }); - }).sort().map(function (classKey) { - return [classKey, _SiteMapUtils.NLCD_CLASSES[classKey].name]; - })), - render: function render(row) { - var nlcdClass = row.nlcdClass; + lookup: Object.fromEntries(Object.keys(_SiteMapUtils.NLCD_CLASSES).filter(classKey => rows.some(row => row.nlcdClass === classKey)).sort().map(classKey => [classKey, _SiteMapUtils.NLCD_CLASSES[classKey].name])), + render: row => { + const { + nlcdClass + } = row; if (!nlcdClass) { return renderCaptionString(); } if (!_SiteMapUtils.NLCD_CLASSES[nlcdClass]) { return renderCaptionString(nlcdClass, 'NLCD Class'); } - var _NLCD_CLASSES$nlcdCla = _SiteMapUtils.NLCD_CLASSES[nlcdClass], - title = _NLCD_CLASSES$nlcdCla.name, - backgroundColor = _NLCD_CLASSES$nlcdCla.color; + const { + name: title, + color: backgroundColor + } = _SiteMapUtils.NLCD_CLASSES[nlcdClass]; return /*#__PURE__*/_react.default.createElement("div", { className: classes.nlcdClassContainer }, /*#__PURE__*/_react.default.createElement("div", { className: classes.nlcdClass, title: title, style: { - backgroundColor: backgroundColor + backgroundColor } }), renderCaptionString(title, 'NLCD Class')); }, - csvRender: function csvRender(row) { - var nlcdClass = row.nlcdClass; + csvRender: row => { + const { + nlcdClass + } = row; if (!nlcdClass) { return null; } @@ -924,17 +847,21 @@ var SiteMapTable = function SiteMapTable() { sorting: true, deafultSort: 'asc', filtering: false, - render: function render(row) { - var plotDimensions = row.plotDimensions, - plotSize = row.plotSize; + render: row => { + const { + plotDimensions, + plotSize + } = row; if (!plotDimensions) { return renderCaptionString(); } return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, renderCaptionString("".concat(plotDimensions), 'Plot Size (Dimensions)'), Number.isFinite(plotSize) ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("br", null), renderCaptionString("(".concat(plotSize.toFixed(0), "m\xB2)"), 'Plot Size (Area)')) : null); }, - csvRender: function csvRender(row) { - var plotDimensions = row.plotDimensions, - plotSize = row.plotSize; + csvRender: row => { + const { + plotDimensions, + plotSize + } = row; return [plotDimensions || null, Number.isFinite(plotSize) ? plotSize.toFixed(0) : null]; } }, { @@ -945,12 +872,8 @@ var SiteMapTable = function SiteMapTable() { sorting: true, deafultSort: 'asc', filtering: false, - render: function render(row) { - return renderCaptionString(Number.isFinite(row.slopeAspect) ? "".concat(row.slopeAspect.toFixed(2), "\xB0") : '--', 'Slope Aspect'); - }, - csvRender: function csvRender(row) { - return Number.isFinite(row.slopeAspect) ? row.slopeAspect.toFixed(2) : null; - } + render: row => renderCaptionString(Number.isFinite(row.slopeAspect) ? "".concat(row.slopeAspect.toFixed(2), "\xB0") : '--', 'Slope Aspect'), + csvRender: row => Number.isFinite(row.slopeAspect) ? row.slopeAspect.toFixed(2) : null }, { // Plot Slope Gradient field: 'slopeGradient', @@ -959,12 +882,8 @@ var SiteMapTable = function SiteMapTable() { sorting: true, deafultSort: 'asc', filtering: false, - render: function render(row) { - return renderCaptionString(Number.isFinite(row.slopeGradient) ? "".concat(row.slopeGradient.toFixed(2), "%") : '--', 'Slope Gradient'); - }, - csvRender: function csvRender(row) { - return Number.isFinite(row.slopeGradient) ? row.slopeGradient.toFixed(2) : null; - } + render: row => renderCaptionString(Number.isFinite(row.slopeGradient) ? "".concat(row.slopeGradient.toFixed(2), "%") : '--', 'Slope Gradient'), + csvRender: row => Number.isFinite(row.slopeGradient) ? row.slopeGradient.toFixed(2) : null }, { // Sampling Module Count field: 'samplingModules', @@ -974,9 +893,9 @@ var SiteMapTable = function SiteMapTable() { sorting: true, deafultSort: 'asc', searchable: true, - customSort: function customSort(rowA, rowB) { - var a = Array.isArray(rowA.samplingModules) ? rowA.samplingModules.length : null; - var b = Array.isArray(rowB.samplingModules) ? rowB.samplingModules.length : null; + customSort: (rowA, rowB) => { + const a = Array.isArray(rowA.samplingModules) ? rowA.samplingModules.length : null; + const b = Array.isArray(rowB.samplingModules) ? rowB.samplingModules.length : null; if (a === b) { return 0; } @@ -988,8 +907,10 @@ var SiteMapTable = function SiteMapTable() { } return a > b ? 1 : -1; }, - render: function render(row) { - var samplingModules = row.samplingModules; + render: row => { + const { + samplingModules + } = row; if (!Array.isArray(samplingModules)) { return renderCaptionString(); } @@ -1000,11 +921,9 @@ var SiteMapTable = function SiteMapTable() { style: { marginLeft: _Theme.default.spacing(-1) } - }, samplingModules.map(function (m) { - return /*#__PURE__*/_react.default.createElement("li", { - key: m - }, _SiteMapUtils.PLOT_SAMPLING_MODULES[m]); - })) : /*#__PURE__*/_react.default.createElement("i", null, "none") + }, samplingModules.map(m => /*#__PURE__*/_react.default.createElement("li", { + key: m + }, _SiteMapUtils.PLOT_SAMPLING_MODULES[m]))) : /*#__PURE__*/_react.default.createElement("i", null, "none") }, /*#__PURE__*/_react.default.createElement("div", { className: classes.startFlex }, renderCaptionString(samplingModules.length, 'Potential Sampling Modules'), /*#__PURE__*/_react.default.createElement(_IconButton.default, { @@ -1015,36 +934,30 @@ var SiteMapTable = function SiteMapTable() { fontSize: "inherit" })))); }, - csvRender: function csvRender(row) { - return Array.isArray(row.samplingModules) ? row.samplingModules.length : null; - } + csvRender: row => Array.isArray(row.samplingModules) ? row.samplingModules.length : null }, commonColumns.site, commonColumns.domain, commonColumns.state, commonColumns.coordinates]; } - var toolbarClassName = view === _SiteMapUtils.VIEWS.SPLIT ? classes.toolbarContainer : "".concat(classes.toolbarContainer, " ").concat(classes.toolbarContainerNoSplit); - var components = { + const toolbarClassName = view === _SiteMapUtils.VIEWS.SPLIT ? classes.toolbarContainer : "".concat(classes.toolbarContainer, " ").concat(classes.toolbarContainerNoSplit); + const components = { Container: _Box.default, // eslint-disable-next-line react/no-unstable-nested-components - Toolbar: function Toolbar(toolbarProps) { - return /*#__PURE__*/_react.default.createElement("div", { - className: toolbarClassName, - "data-selenium": "sitemap-table-toolbar" - }, /*#__PURE__*/_react.default.createElement(_materialTable.MTableToolbar, _extends({}, toolbarProps, { - classes: { - title: classes.tableTitle - } - }))); - }, + Toolbar: toolbarProps => /*#__PURE__*/_react.default.createElement("div", { + className: toolbarClassName, + "data-selenium": "sitemap-table-toolbar" + }, /*#__PURE__*/_react.default.createElement(_materialTable.MTableToolbar, _extends({}, toolbarProps, { + classes: { + title: classes.tableTitle + } + }))), // eslint-disable-next-line react/no-unstable-nested-components - FilterRow: function FilterRow(filterRowProps) { - return /*#__PURE__*/_react.default.createElement(_materialTable.MTableFilterRow, _extends({}, filterRowProps, { - filterCellStyle: { - padding: '8px', - backgroundColor: _Theme.default.palette.grey[50] - } - })); - } + FilterRow: filterRowProps => /*#__PURE__*/_react.default.createElement(_materialTable.MTableFilterRow, _extends({}, filterRowProps, { + filterCellStyle: { + padding: '8px', + backgroundColor: _Theme.default.palette.grey[50] + } + })) }; - var localization = { + const localization = { toolbar: { searchPlaceholder: "Search ".concat(focus.toLowerCase(), " in view") }, @@ -1056,7 +969,7 @@ var SiteMapTable = function SiteMapTable() { /** Render Table */ - var tableOptions = { + const tableOptions = { padding: 'dense', filtering: true, columnsButton: true, @@ -1070,11 +983,11 @@ var SiteMapTable = function SiteMapTable() { exportButton: { csv: true }, - exportCsv: exportCsv, + exportCsv, exportFileName: EXPORT_FILENAME, emptyRowsWhenPaging: false, thirdSortClick: false, - rowStyle: function rowStyle(row) { + rowStyle: row => { if (selectionActive) { if (!rowIsSelectable(row)) { return { @@ -1090,20 +1003,18 @@ var SiteMapTable = function SiteMapTable() { return {}; }, selection: selectionActive, - selectionProps: !selectionActive ? null : function (row) { - return { - style: { - margin: _Theme.default.spacing(0, 0.5) - }, - disabled: !rowIsSelectable(row) - }; - } + selectionProps: !selectionActive ? null : row => ({ + style: { + margin: _Theme.default.spacing(0, 0.5) + }, + disabled: !rowIsSelectable(row) + }) }; if (!fullHeight && view !== _SiteMapUtils.VIEWS.SPLIT) { tableOptions.maxBodyHeight = "".concat(maxBodyHeight || _SiteMapUtils.MIN_TABLE_MAX_BODY_HEIGHT, "px"); } - var containerClassName = "".concat(classes.tableContainer, " ").concat(classes.tableContainerIntegrated); - var containerStyle = {}; + let containerClassName = "".concat(classes.tableContainer, " ").concat(classes.tableContainerIntegrated); + let containerStyle = {}; if (view === _SiteMapUtils.VIEWS.TABLE && fullHeight) { containerStyle = { position: 'relative' @@ -1125,14 +1036,12 @@ var SiteMapTable = function SiteMapTable() { data: rows, localization: localization, options: tableOptions, - onSelectionChange: !selectionActive ? null : function (newRows) { - var action = { + onSelectionChange: !selectionActive ? null : newRows => { + const action = { type: 'updateSelectionSet', selection: new Set() }; - newRows.filter(function (row) { - return row.tableData.checked; - }).forEach(function (row) { + newRows.filter(row => row.tableData.checked).forEach(row => { if (focus === _SiteMapUtils.FEATURE_TYPES.SITES.KEY) { action.selection.add(row.siteCode); } @@ -1141,16 +1050,13 @@ var SiteMapTable = function SiteMapTable() { } })); }; -var _default = SiteMapTable; // Additional items exported for unit testing -exports.default = _default; -var getTestableItems = function getTestableItems() { - return process.env.NODE_ENV !== 'test' ? {} : { - ucWord: ucWord, - parseSearchTerms: parseSearchTerms, - searchOnAttribs: searchOnAttribs, - calculateMaxBodyHeight: calculateMaxBodyHeight, - getFeatureName: getFeatureName, - exportCsv: exportCsv - }; +var _default = exports.default = SiteMapTable; // Additional items exported for unit testing +const getTestableItems = () => process.env.NODE_ENV !== 'test' ? {} : { + ucWord, + parseSearchTerms, + searchOnAttribs, + calculateMaxBodyHeight, + getFeatureName, + exportCsv }; exports.getTestableItems = getTestableItems; \ No newline at end of file diff --git a/lib/components/SiteMap/SiteMapUtils.js b/lib/components/SiteMap/SiteMapUtils.js index 8bf3957c..b15ca449 100644 --- a/lib/components/SiteMap/SiteMapUtils.js +++ b/lib/components/SiteMap/SiteMapUtils.js @@ -57,73 +57,47 @@ var _iconTowerSoilPlot = _interopRequireDefault(require("./svg/icon-tower-soil-p var _iconWetDepositionPoint = _interopRequireDefault(require("./svg/icon-wet-deposition-point.svg")); var _statesShapes = _interopRequireDefault(require("../../staticJSON/statesShapes.json")); var _domainsShapes = _interopRequireDefault(require("../../staticJSON/domainsShapes.json")); -var _shadow, _shadow2, _shadow3, _shadow4, _initialized, _availableFeatureType, _derived; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // SVGs for all map icons +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } // SVGs for all map icons // Static JSON for Boundary features -var isCoord = function isCoord(c) { - return Array.isArray(c) && c.length === 2 && c.every(function (x) { - return Number.isFinite(x); - }); -}; -var round = function round(x) { - return Number.parseFloat(x.toFixed(4), 10); -}; -var MAP_ZOOM_RANGE = [1, 19]; -exports.MAP_ZOOM_RANGE = MAP_ZOOM_RANGE; -var OBSERVATORY_CENTER = [52.68, -110.75]; -exports.OBSERVATORY_CENTER = OBSERVATORY_CENTER; -var MIN_CONTAINER_HEIGHT = 300; -exports.MIN_CONTAINER_HEIGHT = MIN_CONTAINER_HEIGHT; -var MIN_TABLE_MAX_BODY_HEIGHT = 100; -exports.MIN_TABLE_MAX_BODY_HEIGHT = MIN_TABLE_MAX_BODY_HEIGHT; -var KM2_TO_ACRES = 247.10538146717; +const isCoord = c => Array.isArray(c) && c.length === 2 && c.every(x => Number.isFinite(x)); +const round = x => Number.parseFloat(x.toFixed(4), 10); +const MAP_ZOOM_RANGE = exports.MAP_ZOOM_RANGE = [1, 19]; +const OBSERVATORY_CENTER = exports.OBSERVATORY_CENTER = [52.68, -110.75]; +const MIN_CONTAINER_HEIGHT = exports.MIN_CONTAINER_HEIGHT = 300; +const MIN_TABLE_MAX_BODY_HEIGHT = exports.MIN_TABLE_MAX_BODY_HEIGHT = 100; +const KM2_TO_ACRES = exports.KM2_TO_ACRES = 247.10538146717; // Maximum number of points that will be used for determining whether or not // a location is within the current bounds of the viewport of the map. // This will control how a large set of coordinates is down sampled. -exports.KM2_TO_ACRES = KM2_TO_ACRES; -var LOCATION_BOUNDS_SAMPLING_MAX = 10000; +const LOCATION_BOUNDS_SAMPLING_MAX = exports.LOCATION_BOUNDS_SAMPLING_MAX = 10000; // Minimum zoom level at which location hierarchy fetches are done on a per-domain basis // We don't do per-site because hierarchy query performance is a function of number of immediate // children. Domains top out at 8 or so sites, while sites may have over a hundred children (plots) // Note that while we FETCH at the domain level we parse down to the site level as that's what's // most useful for generating subsequent fetches -exports.LOCATION_BOUNDS_SAMPLING_MAX = LOCATION_BOUNDS_SAMPLING_MAX; -var SITE_LOCATION_HIERARCHIES_MIN_ZOOM = 9; +const SITE_LOCATION_HIERARCHIES_MIN_ZOOM = exports.SITE_LOCATION_HIERARCHIES_MIN_ZOOM = 9; /** Key Sets Used to limit the use of "magic strings" that need to be consistent across many files */ // For consistency in expressing the sort direction for the table -exports.SITE_LOCATION_HIERARCHIES_MIN_ZOOM = SITE_LOCATION_HIERARCHIES_MIN_ZOOM; -var SORT_DIRECTIONS = { +const SORT_DIRECTIONS = exports.SORT_DIRECTIONS = { ASC: 'ASC', DESC: 'DESC' }; // For consistency in expressing site terrain -exports.SORT_DIRECTIONS = SORT_DIRECTIONS; -var SITE_TERRAINS = { +const SITE_TERRAINS = exports.SITE_TERRAINS = { AQUATIC: 'AQUATIC', TERRESTRIAL: 'TERRESTRIAL' }; // For consistency in expressing the types of manual location data fed in through props -exports.SITE_TERRAINS = SITE_TERRAINS; -var MANUAL_LOCATION_TYPES = { +const MANUAL_LOCATION_TYPES = exports.MANUAL_LOCATION_TYPES = { PROTOTYPE_SITE: 'PROTOTYPE_SITE' }; @@ -132,8 +106,7 @@ var MANUAL_LOCATION_TYPES = { // single column definition. But LOCATIONS and SITES shouldn't, as each set has // different common attributes that should map to table columns (yes, sites are locations too, // but we represent and interact with them differently) -exports.MANUAL_LOCATION_TYPES = MANUAL_LOCATION_TYPES; -var FEATURE_TYPES = { +const FEATURE_TYPES = exports.FEATURE_TYPES = { SITES: { unit: 'site', units: 'sites', @@ -175,73 +148,64 @@ var FEATURE_TYPES = { } }; // Replicate keys as attributes to completely eliminate the need to write a feature type key string -exports.FEATURE_TYPES = FEATURE_TYPES; -Object.keys(FEATURE_TYPES).forEach(function (key) { +Object.keys(FEATURE_TYPES).forEach(key => { FEATURE_TYPES[key].KEY = key; }); // For consistency in differentiating where feature data come from // (e.g. various fetch APIs, NeonContext) -var FEATURE_DATA_SOURCES = { +const FEATURE_DATA_SOURCES = exports.FEATURE_DATA_SOURCES = { REST_LOCATIONS_API: 'REST_LOCATIONS_API', GRAPHQL_LOCATIONS_API: 'GRAPHQL_LOCATIONS_API', ARCGIS_ASSETS_API: 'ARCGIS_ASSETS_API', NEON_CONTEXT: 'NEON_CONTEXT', MANUAL_LOCATIONS: 'MANUAL_LOCATIONS' // data injected by manualLocationData prop }; -exports.FEATURE_DATA_SOURCES = FEATURE_DATA_SOURCES; -var SELECTED_ICON_OFFSET = 30; // Number of pixels bigger in one dimension for selected icons +const SELECTED_ICON_OFFSET = 30; // Number of pixels bigger in one dimension for selected icons // For consistency in denoting whether all or some of a region's selectable children are selected -var SELECTION_PORTIONS = { +const SELECTION_PORTIONS = exports.SELECTION_PORTIONS = { PARTIAL: 'PARTIAL', TOTAL: 'TOTAL' }; // For consistency in denoting the selection status of any selectable thing -exports.SELECTION_PORTIONS = SELECTION_PORTIONS; -var SELECTION_STATUS = { +const SELECTION_STATUS = exports.SELECTION_STATUS = { SELECTED: 'SELECTED', UNSELECTED: 'UNSELECTED' }; // For consistency in visually fading unselectable marker icons -exports.SELECTION_STATUS = SELECTION_STATUS; -var UNSELECTABLE_MARKER_FILTER = 'sepia(0.8) contrast(0.3) brightness(1.35)'; +const UNSELECTABLE_MARKER_FILTER = exports.UNSELECTABLE_MARKER_FILTER = 'sepia(0.8) contrast(0.3) brightness(1.35)'; // For consistency in denoting the highlight status of a marker -exports.UNSELECTABLE_MARKER_FILTER = UNSELECTABLE_MARKER_FILTER; -var HIGHLIGHT_STATUS = { +const HIGHLIGHT_STATUS = exports.HIGHLIGHT_STATUS = { NONE: 'NONE', HIGHLIGHT: 'HIGHLIGHT', SELECT: 'SELECT' }; // For consistency in denoting which dinstinct user interfaces are available and which is visible -exports.HIGHLIGHT_STATUS = HIGHLIGHT_STATUS; -var VIEWS = { +const VIEWS = exports.VIEWS = { MAP: 'MAP', TABLE: 'TABLE', SPLIT: 'SPLIT' }; // For consistency in denoting exclusive available mouse behaviors on the map -exports.VIEWS = VIEWS; -var MAP_MOUSE_MODES = { +const MAP_MOUSE_MODES = exports.MAP_MOUSE_MODES = { PAN: 'PAN', AREA_SELECT: 'AREA_SELECT' }; // For consistency in tracking the current status of a fetch or import -exports.MAP_MOUSE_MODES = MAP_MOUSE_MODES; -var FETCH_STATUS = { +const FETCH_STATUS = exports.FETCH_STATUS = { AWAITING_CALL: 'AWAITING_CALL', FETCHING: 'FETCHING', ERROR: 'ERROR', SUCCESS: 'SUCCESS' }; -exports.FETCH_STATUS = FETCH_STATUS; -var PLOT_SAMPLING_MODULES = { +const PLOT_SAMPLING_MODULES = exports.PLOT_SAMPLING_MODULES = { bbc: 'Below Ground Biomass Coring', bet: 'Beetles', bgc: 'Biogeochemistry', @@ -264,8 +228,7 @@ var PLOT_SAMPLING_MODULES = { }; // Source: https://www.mrlc.gov/data/legends/national-land-cover-database-2001-nlcd2001-legend -exports.PLOT_SAMPLING_MODULES = PLOT_SAMPLING_MODULES; -var NLCD_CLASSES = { +const NLCD_CLASSES = exports.NLCD_CLASSES = { openWater: { name: 'Open Water', value: 11, @@ -412,83 +375,98 @@ var NLCD_CLASSES = { Icon SVGs An importable data structure containing all imported SVGs for map and legend icons */ -exports.NLCD_CLASSES = NLCD_CLASSES; -var LOCATION_ICON_SVG_SHAPES = { +const LOCATION_ICON_SVG_SHAPES = exports.LOCATION_ICON_SVG_SHAPES = { CIRCLE: { KEY: 'CIRCLE', iconSize: [80, 80], iconAnchor: [40, 40], popupAnchor: [0, -40], - shadow: (_shadow = {}, _defineProperty(_shadow, HIGHLIGHT_STATUS.NONE, { - svg: _iconShapeCircleShadow.default, - size: [100, 100], - anchor: [50, 50] - }), _defineProperty(_shadow, HIGHLIGHT_STATUS.HIGHLIGHT, { - svg: _iconShapeCircleHighlight.default, - size: [120, 120], - anchor: [60, 60] - }), _defineProperty(_shadow, HIGHLIGHT_STATUS.SELECT, { - svg: _iconShapeCircleSelect.default, - size: [120, 120], - anchor: [60, 60] - }), _shadow) + shadow: { + [HIGHLIGHT_STATUS.NONE]: { + svg: _iconShapeCircleShadow.default, + size: [100, 100], + anchor: [50, 50] + }, + [HIGHLIGHT_STATUS.HIGHLIGHT]: { + svg: _iconShapeCircleHighlight.default, + size: [120, 120], + anchor: [60, 60] + }, + [HIGHLIGHT_STATUS.SELECT]: { + svg: _iconShapeCircleSelect.default, + size: [120, 120], + anchor: [60, 60] + } + } }, DIAMOND: { KEY: 'DIAMOND', iconSize: [100, 100], iconAnchor: [50, 50], popupAnchor: [0, -50], - shadow: (_shadow2 = {}, _defineProperty(_shadow2, HIGHLIGHT_STATUS.NONE, { - svg: _iconShapeDiamondShadow.default, - size: [124, 124], - anchor: [62, 62] - }), _defineProperty(_shadow2, HIGHLIGHT_STATUS.HIGHLIGHT, { - svg: _iconShapeDiamondHighlight.default, - size: [144, 144], - anchor: [72, 72] - }), _defineProperty(_shadow2, HIGHLIGHT_STATUS.SELECT, { - svg: _iconShapeDiamondSelect.default, - size: [144, 144], - anchor: [72, 72] - }), _shadow2) + shadow: { + [HIGHLIGHT_STATUS.NONE]: { + svg: _iconShapeDiamondShadow.default, + size: [124, 124], + anchor: [62, 62] + }, + [HIGHLIGHT_STATUS.HIGHLIGHT]: { + svg: _iconShapeDiamondHighlight.default, + size: [144, 144], + anchor: [72, 72] + }, + [HIGHLIGHT_STATUS.SELECT]: { + svg: _iconShapeDiamondSelect.default, + size: [144, 144], + anchor: [72, 72] + } + } }, HOMEPLATE: { KEY: 'HOMEPLATE', iconSize: [80, 90], iconAnchor: [40, 45], popupAnchor: [0, -45], - shadow: (_shadow3 = {}, _defineProperty(_shadow3, HIGHLIGHT_STATUS.NONE, { - svg: _iconShapeHomeplateShadow.default, - size: [101, 111], - anchor: [50.5, 55.5] - }), _defineProperty(_shadow3, HIGHLIGHT_STATUS.HIGHLIGHT, { - svg: _iconShapeHomeplateHighlight.default, - size: [121, 131], - anchor: [60.5, 65.5] - }), _defineProperty(_shadow3, HIGHLIGHT_STATUS.SELECT, { - svg: _iconShapeHomeplateSelect.default, - size: [121, 131], - anchor: [60.5, 65.5] - }), _shadow3) + shadow: { + [HIGHLIGHT_STATUS.NONE]: { + svg: _iconShapeHomeplateShadow.default, + size: [101, 111], + anchor: [50.5, 55.5] + }, + [HIGHLIGHT_STATUS.HIGHLIGHT]: { + svg: _iconShapeHomeplateHighlight.default, + size: [121, 131], + anchor: [60.5, 65.5] + }, + [HIGHLIGHT_STATUS.SELECT]: { + svg: _iconShapeHomeplateSelect.default, + size: [121, 131], + anchor: [60.5, 65.5] + } + } }, SQUARE: { KEY: 'SQUARE', iconSize: [75, 75], iconAnchor: [37.5, 37.5], popupAnchor: [0, -37.5], - shadow: (_shadow4 = {}, _defineProperty(_shadow4, HIGHLIGHT_STATUS.NONE, { - svg: _iconShapeSquareShadow.default, - size: [94, 94], - anchor: [47, 47] - }), _defineProperty(_shadow4, HIGHLIGHT_STATUS.HIGHLIGHT, { - svg: _iconShapeSquareHighlight.default, - size: [114, 114], - anchor: [57, 57] - }), _defineProperty(_shadow4, HIGHLIGHT_STATUS.SELECT, { - svg: _iconShapeSquareSelect.default, - size: [114, 114], - anchor: [57, 57] - }), _shadow4) + shadow: { + [HIGHLIGHT_STATUS.NONE]: { + svg: _iconShapeSquareShadow.default, + size: [94, 94], + anchor: [47, 47] + }, + [HIGHLIGHT_STATUS.HIGHLIGHT]: { + svg: _iconShapeSquareHighlight.default, + size: [114, 114], + anchor: [57, 57] + }, + [HIGHLIGHT_STATUS.SELECT]: { + svg: _iconShapeSquareSelect.default, + size: [114, 114], + anchor: [57, 57] + } + } } }; @@ -498,8 +476,7 @@ var LOCATION_ICON_SVG_SHAPES = { Convention: all keys are consistently plural Order is draw order on map (so largest boundary features should be first) */ -exports.LOCATION_ICON_SVG_SHAPES = LOCATION_ICON_SVG_SHAPES; -var FEATURES = { +const FEATURES = exports.FEATURES = { // States and Domains STATES: { name: 'US States', @@ -1196,8 +1173,7 @@ var FEATURES = { } }; // Replicate keys as attributes to completely eliminate the need to write a feature key string -exports.FEATURES = FEATURES; -Object.keys(FEATURES).forEach(function (key) { +Object.keys(FEATURES).forEach(key => { FEATURES[key].KEY = key; }); @@ -1208,19 +1184,17 @@ Object.keys(FEATURES).forEach(function (key) { minZoom by feature key and vice versa. These values never change, so derive them now. */ // A mapping of feature key to minZoom for GRAPHQL_LOCATIONS_API dataSource features -var FEATURES_TO_MINZOOM_MAP = {}; -Object.keys(FEATURES).filter(function (featureKey) { - return FEATURES[featureKey].dataSource === FEATURE_DATA_SOURCES.GRAPHQL_LOCATIONS_API; -}).forEach(function (featureKey) { - var feature = FEATURES[featureKey]; - var minZoom = feature.minZoom || (FEATURES[feature.parent] || {}).minZoom || 0; +const FEATURES_TO_MINZOOM_MAP = {}; +Object.keys(FEATURES).filter(featureKey => FEATURES[featureKey].dataSource === FEATURE_DATA_SOURCES.GRAPHQL_LOCATIONS_API).forEach(featureKey => { + const feature = FEATURES[featureKey]; + const minZoom = feature.minZoom || (FEATURES[feature.parent] || {}).minZoom || 0; FEATURES_TO_MINZOOM_MAP[featureKey] = minZoom; }); // A mapping of minZoom level to feature keys (inversion of FEATURES_MINZOOM_MAP) -var MINZOOM_TO_FEATURES_MAP = {}; -Object.keys(FEATURES_TO_MINZOOM_MAP).forEach(function (featureKey) { - var minZoom = FEATURES_TO_MINZOOM_MAP[featureKey]; +const MINZOOM_TO_FEATURES_MAP = {}; +Object.keys(FEATURES_TO_MINZOOM_MAP).forEach(featureKey => { + const minZoom = FEATURES_TO_MINZOOM_MAP[featureKey]; if (!MINZOOM_TO_FEATURES_MAP[minZoom]) { MINZOOM_TO_FEATURES_MAP[minZoom] = []; } @@ -1228,25 +1202,21 @@ Object.keys(FEATURES_TO_MINZOOM_MAP).forEach(function (featureKey) { }); // Roll all that up and export it -var GRAPHQL_LOCATIONS_API_CONSTANTS = { - FEATURES_TO_MINZOOM_MAP: FEATURES_TO_MINZOOM_MAP, - MINZOOM_TO_FEATURES_MAP: MINZOOM_TO_FEATURES_MAP +const GRAPHQL_LOCATIONS_API_CONSTANTS = exports.GRAPHQL_LOCATIONS_API_CONSTANTS = { + FEATURES_TO_MINZOOM_MAP, + MINZOOM_TO_FEATURES_MAP }; // Common colors for selecatble boundary features -exports.GRAPHQL_LOCATIONS_API_CONSTANTS = GRAPHQL_LOCATIONS_API_CONSTANTS; -var BOUNDARY_COLORS = { +const BOUNDARY_COLORS = exports.BOUNDARY_COLORS = { partialSelected: _Theme.COLORS.LIGHT_BLUE[300], totalSelected: _Theme.COLORS.LIGHT_BLUE[500], hover: _Theme.COLORS.LIGHT_BLUE[100] }; -exports.BOUNDARY_COLORS = BOUNDARY_COLORS; -var calculateFeatureAvailability = function calculateFeatureAvailability(state) { - var featureIsAvailable = function featureIsAvailable(feature) { +const calculateFeatureAvailability = state => { + const featureIsAvailable = feature => { // Special case: show SITES group at all zoom levels if DECOMMISSIONED_SITES are also shown - var hasDecomissionedSites = !!(state.manualLocationData || []).filter(function (manualLocation) { - return manualLocation.manualLocationType === MANUAL_LOCATION_TYPES.PROTOTYPE_SITE && !state.sites[manualLocation.siteCode]; - }).length; + const hasDecomissionedSites = !!(state.manualLocationData || []).filter(manualLocation => manualLocation.manualLocationType === MANUAL_LOCATION_TYPES.PROTOTYPE_SITE && !state.sites[manualLocation.siteCode]).length; if (feature.KEY === 'SITE_MARKERS' && hasDecomissionedSites) { return true; } @@ -1254,8 +1224,8 @@ var calculateFeatureAvailability = function calculateFeatureAvailability(state) if (typeof feature.parent === 'string' && !featureIsAvailable(FEATURES[feature.parent])) { return false; } - var hasMinZoom = typeof feature.minZoom === 'number'; - var hasMaxZoom = typeof feature.maxZoom === 'number'; + const hasMinZoom = typeof feature.minZoom === 'number'; + const hasMaxZoom = typeof feature.maxZoom === 'number'; // If zoom is not set then show all features that don't have a min zoom // We don't care about a maxZoom here because null zoom effectively means zoomed all the way out if (state.map.zoom === null) { @@ -1263,27 +1233,19 @@ var calculateFeatureAvailability = function calculateFeatureAvailability(state) } return (!hasMinZoom || state.map.zoom >= feature.minZoom) && (!hasMaxZoom || state.map.zoom <= feature.maxZoom); }; - var newState = _extends({}, state, { + const newState = _extends({}, state, { filters: _extends({}, state.filters, { features: _extends({}, state.filters.features, { - available: Object.fromEntries(Object.entries(FEATURES).map(function (entry) { - return [entry[0], featureIsAvailable(entry[1])]; - })) + available: Object.fromEntries(Object.entries(FEATURES).map(entry => [entry[0], featureIsAvailable(entry[1])])) }) }) }); // Update table focus to reflect availability if need be - Object.keys(state.table.availableFeatureTypes).forEach(function (featureType) { - newState.table.availableFeatureTypes[featureType] = Object.keys(FEATURES).filter(function (featureKey) { - return FEATURES[featureKey].type === featureType; - }).some(function (featureKey) { - return newState.filters.features.available[featureKey]; - }); + Object.keys(state.table.availableFeatureTypes).forEach(featureType => { + newState.table.availableFeatureTypes[featureType] = Object.keys(FEATURES).filter(featureKey => FEATURES[featureKey].type === featureType).some(featureKey => newState.filters.features.available[featureKey]); }); if (!newState.table.availableFeatureTypes[newState.table.focus]) { - var available = Object.keys(newState.table.availableFeatureTypes).filter(function (k) { - return newState.table.availableFeatureTypes[k]; - }); + const available = Object.keys(newState.table.availableFeatureTypes).filter(k => newState.table.availableFeatureTypes[k]); newState.table.focus = available[0] || state.table.focus; } return newState; @@ -1294,9 +1256,9 @@ var calculateFeatureAvailability = function calculateFeatureAvailability(state) Used to construction URLs when linking out to other pages */ exports.calculateFeatureAvailability = calculateFeatureAvailability; -var getHref = function getHref(key) { - var arg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var EXPLORE_DATA_PRODUCTS_BASE = _RouteService.default.getDataProductExplorePath(); +const getHref = function (key) { + let arg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + const EXPLORE_DATA_PRODUCTS_BASE = _RouteService.default.getDataProductExplorePath(); if ((arg || '').length === 0) { return '#'; } @@ -1322,7 +1284,7 @@ var getHref = function getHref(key) { with attributions. Only one base layer can be shown at a time. */ exports.getHref = getHref; -var BASE_LAYERS = { +const BASE_LAYERS = exports.BASE_LAYERS = { NATGEO_WORLD_MAP: { title: 'National Geographic', shortAttribution: '© Natl. Geographic et al.', @@ -1348,10 +1310,8 @@ var BASE_LAYERS = { url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}' } }; -exports.BASE_LAYERS = BASE_LAYERS; -var BASE_LAYERS_BY_TITLE = {}; -exports.BASE_LAYERS_BY_TITLE = BASE_LAYERS_BY_TITLE; -Object.keys(BASE_LAYERS).forEach(function (key) { +const BASE_LAYERS_BY_TITLE = exports.BASE_LAYERS_BY_TITLE = {}; +Object.keys(BASE_LAYERS).forEach(key => { BASE_LAYERS[key].KEY = key; BASE_LAYERS_BY_TITLE[BASE_LAYERS[key].title] = key; }); @@ -1362,7 +1322,7 @@ Object.keys(BASE_LAYERS).forEach(function (key) { to base layers in that they cover most or all of the observatory if not the whole planet. They add additional context from a third party data source, such as NLCD. */ -var OVERLAY_GROUPS = { +const OVERLAY_GROUPS = exports.OVERLAY_GROUPS = { NLCD: { title: 'National Land Cover Database', description: 'National Land Cover Database (NLCD) from the Multi-Resolution Land Characteristics (MRLC) consortium. Release years: 2001 (Alaska, Hawaii, and Puerto Rico) and 2006 (Continental US).', @@ -1372,14 +1332,12 @@ var OVERLAY_GROUPS = { } } }; -exports.OVERLAY_GROUPS = OVERLAY_GROUPS; -var OVERLAY_GROUPS_BY_TITLE = {}; -exports.OVERLAY_GROUPS_BY_TITLE = OVERLAY_GROUPS_BY_TITLE; -Object.keys(OVERLAY_GROUPS).forEach(function (key) { +const OVERLAY_GROUPS_BY_TITLE = exports.OVERLAY_GROUPS_BY_TITLE = {}; +Object.keys(OVERLAY_GROUPS).forEach(key => { OVERLAY_GROUPS[key].KEY = key; OVERLAY_GROUPS_BY_TITLE[OVERLAY_GROUPS[key].title] = key; }); -var OVERLAYS = { +const OVERLAYS = exports.OVERLAYS = { LAND_COVER: { group: OVERLAY_GROUPS.NLCD.KEY, title: 'Land Cover', @@ -1508,25 +1466,27 @@ var OVERLAYS = { }] } }; -exports.OVERLAYS = OVERLAYS; -Object.keys(OVERLAYS).forEach(function (key) { +Object.keys(OVERLAYS).forEach(key => { OVERLAYS[key].KEY = key; }); /** Default State */ -var featureIsHiddenByDefault = function featureIsHiddenByDefault(key) { - var hidden = FEATURES[key].hideByDefault; +const featureIsHiddenByDefault = key => { + let hidden = FEATURES[key].hideByDefault; if (FEATURES[key].parent && !hidden) { hidden = featureIsHiddenByDefault(FEATURES[key].parent); } return hidden; }; -var DEFAULT_STATE = { +const DEFAULT_STATE = exports.DEFAULT_STATE = { view: { current: null, - initialized: (_initialized = {}, _defineProperty(_initialized, VIEWS.MAP, false), _defineProperty(_initialized, VIEWS.TABLE, false), _initialized) + initialized: { + [VIEWS.MAP]: false, + [VIEWS.TABLE]: false + } }, neonContextHydrated: false, // Whether NeonContext data has been one-time hydrated into state @@ -1536,7 +1496,6 @@ var DEFAULT_STATE = { completed: 0, pendingHierarchy: 0 // In-progress hierarchy fetches (ones that will spawn more fetches) }, - focusLocation: { current: null, data: null, @@ -1557,11 +1516,13 @@ var DEFAULT_STATE = { resizeEventListenerInitialized: false, widthReference: 0 // Width of content area we can combine with currentValue to get dimensions }, - table: { // Settings that ONLY apply to the table focus: FEATURE_TYPES.SITES.KEY, - availableFeatureTypes: (_availableFeatureType = {}, _defineProperty(_availableFeatureType, FEATURE_TYPES.SITES.KEY, false), _defineProperty(_availableFeatureType, FEATURE_TYPES.LOCATIONS.KEY, false), _availableFeatureType), + availableFeatureTypes: { + [FEATURE_TYPES.SITES.KEY]: false, + [FEATURE_TYPES.LOCATIONS.KEY]: false + }, fullHeight: false, maxBodyHeight: null, // A way for the SiteMapContainer resizeHandler to inform the SiteMapTable to recalc body height @@ -1597,25 +1558,21 @@ var DEFAULT_STATE = { // whether to show the selection summary element changed: false, // whether selection has changed warranting an onChange event - onChange: function onChange() {}, + onChange: () => {}, // Function that fires whenever state.selection changes - derived: (_derived = {}, _defineProperty(_derived, FEATURES.STATES.KEY, {}), _defineProperty(_derived, FEATURES.DOMAINS.KEY, {}), _derived) + derived: { + // Derived feature-specific mappings of selectable item IDs to SELECTION_PORTIONS + [FEATURES.STATES.KEY]: {}, + // { stateCode: SELECTION_PORTIONS.KEY } + [FEATURES.DOMAINS.KEY]: {} // { domainCode: SELECTION_PORTIONS.KEY } + } }, featureDataFetchesHasAwaiting: false, // Boolean: track whether any data fetches are awaiting call - featureDataFetches: Object.fromEntries(Object.keys(FEATURE_DATA_SOURCES).filter(function (dataSource) { - return ( - // eslint-disable-next-line max-len - ![FEATURE_DATA_SOURCES.MANUAL_LOCATIONS, FEATURE_DATA_SOURCES.NEON_CONTEXT].includes(dataSource) - ); - }).map(function (dataSource) { - return [dataSource, {}]; - })), - featureData: Object.fromEntries(Object.keys(FEATURE_TYPES).filter(function (featureType) { - return featureType !== FEATURE_TYPES.SAMPLING_POINTS.KEY; - }).map(function (featureType) { - return [featureType, {}]; - })), + featureDataFetches: Object.fromEntries(Object.keys(FEATURE_DATA_SOURCES).filter(dataSource => + // eslint-disable-next-line max-len + ![FEATURE_DATA_SOURCES.MANUAL_LOCATIONS, FEATURE_DATA_SOURCES.NEON_CONTEXT].includes(dataSource)).map(dataSource => [dataSource, {}])), + featureData: Object.fromEntries(Object.keys(FEATURE_TYPES).filter(featureType => featureType !== FEATURE_TYPES.SAMPLING_POINTS.KEY).map(featureType => [featureType, {}])), sites: {}, // Sites data is split into 4 features making it hard to look up, so extra refs here filters: { @@ -1626,29 +1583,23 @@ var DEFAULT_STATE = { available: {}, visible: Object.fromEntries( // key/bool map of which available features are visible - Object.keys(FEATURES).map(function (key) { - return [key, !featureIsHiddenByDefault(key)]; - })), + Object.keys(FEATURES).map(key => [key, !featureIsHiddenByDefault(key)])), collapsed: new Set() // Collapsed (not expanded) since the default for features is expanded }, - overlays: { expanded: new Set() // Expanded since the default for overlay legends is collapsed } }, - fullscreen: false, manualLocationData: null }; // Initialize featureData and featureDataFetches objects for all features that have a dataSource -exports.DEFAULT_STATE = DEFAULT_STATE; -Object.keys(FEATURES).filter(function (featureKey) { - return Object.keys(FEATURE_DATA_SOURCES).includes(FEATURES[featureKey].dataSource); -}).forEach(function (featureKey) { - var _FEATURES$featureKey = FEATURES[featureKey], - featureType = _FEATURES$featureKey.type, - dataSource = _FEATURES$featureKey.dataSource; +Object.keys(FEATURES).filter(featureKey => Object.keys(FEATURE_DATA_SOURCES).includes(FEATURES[featureKey].dataSource)).forEach(featureKey => { + const { + type: featureType, + dataSource + } = FEATURES[featureKey]; // Initialize featureData // SAMPLING_POINTS are stored as geometry of their parent locations so don't need initialization if (featureType !== FEATURE_TYPES.SAMPLING_POINTS.KEY) { @@ -1661,7 +1612,7 @@ Object.keys(FEATURES).filter(function (featureKey) { DEFAULT_STATE.featureDataFetches[dataSource][featureKey] = {}; } if (dataSource === FEATURE_DATA_SOURCES.GRAPHQL_LOCATIONS_API) { - var minZoom = GRAPHQL_LOCATIONS_API_CONSTANTS.FEATURES_TO_MINZOOM_MAP[featureKey]; + const minZoom = GRAPHQL_LOCATIONS_API_CONSTANTS.FEATURES_TO_MINZOOM_MAP[featureKey]; DEFAULT_STATE.featureDataFetches[dataSource][minZoom] = {}; } }); @@ -1670,7 +1621,7 @@ Object.keys(FEATURES).filter(function (featureKey) { DEFAULT_STATE.featureDataFetches[FEATURE_DATA_SOURCES.REST_LOCATIONS_API][FEATURE_TYPES.SITE_LOCATION_HIERARCHIES.KEY] = {}; // Initialize feature availability -var availabilityState = calculateFeatureAvailability(DEFAULT_STATE); +const availabilityState = calculateFeatureAvailability(DEFAULT_STATE); DEFAULT_STATE.filters.features.available = _extends({}, availabilityState.filters.features.available); // Populate static JSON featureData @@ -1683,11 +1634,13 @@ DEFAULT_STATE.filters.features.available = _extends({}, availabilityState.filter // -- // States if (_statesShapes.default) { - _statesShapes.default.features.forEach(function (feature) { + _statesShapes.default.features.forEach(feature => { if (!feature.properties || !feature.properties.stateCode) { return; } - var stateCode = feature.properties.stateCode; + const { + stateCode + } = feature.properties; DEFAULT_STATE.featureData[FEATURE_TYPES.STATES.KEY][FEATURES.STATES.KEY][stateCode] = { geometry: feature.geometry, sites: new Set() @@ -1696,11 +1649,13 @@ if (_statesShapes.default) { } // Domains if (_domainsShapes.default) { - _domainsShapes.default.features.forEach(function (feature) { + _domainsShapes.default.features.forEach(feature => { if (!feature.properties || !feature.properties.domainCode) { return; } - var domainCode = feature.properties.domainCode; + const { + domainCode + } = feature.properties; DEFAULT_STATE.featureData[FEATURE_TYPES.DOMAINS.KEY][FEATURES.DOMAINS.KEY][domainCode] = { geometry: feature.geometry, sites: new Set() @@ -1711,8 +1666,10 @@ if (_domainsShapes.default) { /** PropTypes and defaultProps */ -var SelectionLimitPropType = function SelectionLimitPropType(props, propName) { - var prop = props[propName]; +const SelectionLimitPropType = (props, propName) => { + const { + [propName]: prop + } = props; if (prop === null || typeof prop === 'undefined') { return null; } @@ -1723,9 +1680,7 @@ var SelectionLimitPropType = function SelectionLimitPropType(props, propName) { return null; } if (Array.isArray(prop)) { - if (prop.length !== 2 || !prop.every(function (x) { - return Number.isInteger(x) && x > 0; - }) || prop[0] >= prop[1]) { + if (prop.length !== 2 || !prop.every(x => Number.isInteger(x) && x > 0) || prop[0] >= prop[1]) { return new Error( // eslint-disable-next-line max-len "When setting ".concat(propName, " as an array it must contain exactly two distinct non-zero positive integers in ascending order (e.g. [2, 5])")); } @@ -1734,11 +1689,9 @@ var SelectionLimitPropType = function SelectionLimitPropType(props, propName) { return new Error( // eslint-disable-next-line max-len "".concat(propName, " must be null, a positive non-zero integer, or an array of two ascending non-zero positive integers.")); }; -var SITE_MAP_PROP_TYPES = { +const SITE_MAP_PROP_TYPES = exports.SITE_MAP_PROP_TYPES = { // Top-level props - view: _propTypes.default.oneOf(Object.keys(VIEWS).map(function (k) { - return k.toLowerCase(); - })), + view: _propTypes.default.oneOf(Object.keys(VIEWS).map(k => k.toLowerCase())), aspectRatio: _propTypes.default.number, fullscreen: _propTypes.default.bool, unusableVerticalSpace: _propTypes.default.number, @@ -1752,9 +1705,7 @@ var SITE_MAP_PROP_TYPES = { // Initial map focus (overrides mapCenter and mapZoom) location: _propTypes.default.string, // Selection props - selection: _propTypes.default.oneOf(Object.keys(FEATURE_TYPES).filter(function (k) { - return FEATURE_TYPES[k].selectable; - })), + selection: _propTypes.default.oneOf(Object.keys(FEATURE_TYPES).filter(k => FEATURE_TYPES[k].selectable)), selectedItems: _propTypes.default.arrayOf(_propTypes.default.string), validItems: _propTypes.default.arrayOf(_propTypes.default.string), selectionLimit: SelectionLimitPropType, @@ -1767,8 +1718,7 @@ var SITE_MAP_PROP_TYPES = { manualLocationType: _propTypes.default.oneOf(Object.keys(MANUAL_LOCATION_TYPES)).isRequired })) }; -exports.SITE_MAP_PROP_TYPES = SITE_MAP_PROP_TYPES; -var SITE_MAP_DEFAULT_PROPS = { +const SITE_MAP_DEFAULT_PROPS = exports.SITE_MAP_DEFAULT_PROPS = { // Top-level props view: VIEWS.MAP.toLowerCase(), aspectRatio: null, @@ -1788,7 +1738,7 @@ var SITE_MAP_DEFAULT_PROPS = { selectedItems: [], validItems: null, selectionLimit: null, - onSelectionChange: function onSelectionChange() {}, + onSelectionChange: () => {}, // Filter props search: null, features: null, @@ -1804,76 +1754,63 @@ var SITE_MAP_DEFAULT_PROPS = { to the current zoom level and keep that in state. It is regenerated any time the zoom changes. */ // Get a single zoomed Leaflet icon instance -exports.SITE_MAP_DEFAULT_PROPS = SITE_MAP_DEFAULT_PROPS; -var getZoomedIcon = function getZoomedIcon() { - var featureKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - var zoom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3; - var highlight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : HIGHLIGHT_STATUS.NONE; - var selection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : SELECTION_STATUS.UNSELECTED; - var feature = FEATURES[featureKey] || {}; - var featureHasIcon = feature && feature.iconSvg && feature.iconShape && LOCATION_ICON_SVG_SHAPES[feature.iconShape]; - var iconUrl = featureHasIcon ? feature.iconSvg : _iconPlaceholder.default; - var iconShape = featureHasIcon ? feature.iconShape : LOCATION_ICON_SVG_SHAPES.SQUARE.KEY; - var iconScale = featureHasIcon ? feature.iconScale || 1 : 1; - var minZoom = feature.minZoom || (FEATURES[feature.parent] || {}).minZoom || MAP_ZOOM_RANGE[0]; - var maxZoom = feature.maxZoom || (FEATURES[feature.parent] || {}).maxZoom || MAP_ZOOM_RANGE[1]; +const getZoomedIcon = function () { + let featureKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let zoom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3; + let highlight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : HIGHLIGHT_STATUS.NONE; + let selection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : SELECTION_STATUS.UNSELECTED; + const feature = FEATURES[featureKey] || {}; + const featureHasIcon = feature && feature.iconSvg && feature.iconShape && LOCATION_ICON_SVG_SHAPES[feature.iconShape]; + let iconUrl = featureHasIcon ? feature.iconSvg : _iconPlaceholder.default; + const iconShape = featureHasIcon ? feature.iconShape : LOCATION_ICON_SVG_SHAPES.SQUARE.KEY; + const iconScale = featureHasIcon ? feature.iconScale || 1 : 1; + const minZoom = feature.minZoom || (FEATURES[feature.parent] || {}).minZoom || MAP_ZOOM_RANGE[0]; + const maxZoom = feature.maxZoom || (FEATURES[feature.parent] || {}).maxZoom || MAP_ZOOM_RANGE[1]; // Use a deep clone of the base SVG shape object so that we can modify destructured data // for variants like "selected" icons - var baseSvgShape = (0, _cloneDeep.default)(LOCATION_ICON_SVG_SHAPES[iconShape]); - var popupAnchor = baseSvgShape.popupAnchor, - shadow = baseSvgShape.shadow; - var iconSize = baseSvgShape.iconSize, - iconAnchor = baseSvgShape.iconAnchor; - var _ref = shadow[highlight] || {}, - shadowUrl = _ref.svg; - var _ref2 = shadow[highlight] || {}, - shadowSize = _ref2.size, - shadowAnchor = _ref2.anchor; + const baseSvgShape = (0, _cloneDeep.default)(LOCATION_ICON_SVG_SHAPES[iconShape]); + const { + popupAnchor, + shadow + } = baseSvgShape; + let { + iconSize, + iconAnchor + } = baseSvgShape; + const { + svg: shadowUrl + } = shadow[highlight] || {}; + let { + size: shadowSize, + anchor: shadowAnchor + } = shadow[highlight] || {}; // Adjust icon, size, and anchor if selected (and a different "selected" icon is available) if (featureHasIcon && selection === SELECTION_STATUS.SELECTED && feature.iconSelectedSvg) { iconUrl = feature.iconSelectedSvg; - iconSize = iconSize.map(function (d) { - return d + SELECTED_ICON_OFFSET; - }); - iconAnchor = iconAnchor.map(function (d) { - return d + SELECTED_ICON_OFFSET / 2; - }); - shadowSize = shadowUrl ? shadowSize.map(function (d) { - return d + SELECTED_ICON_OFFSET; - }) : null; - shadowAnchor = shadowUrl ? shadowAnchor.map(function (d) { - return d + SELECTED_ICON_OFFSET / 2; - }) : null; + iconSize = iconSize.map(d => d + SELECTED_ICON_OFFSET); + iconAnchor = iconAnchor.map(d => d + SELECTED_ICON_OFFSET / 2); + shadowSize = shadowUrl ? shadowSize.map(d => d + SELECTED_ICON_OFFSET) : null; + shadowAnchor = shadowUrl ? shadowAnchor.map(d => d + SELECTED_ICON_OFFSET / 2) : null; popupAnchor[1] -= SELECTED_ICON_OFFSET / 2; } // Determine Icon Scale // Normalize the scale to a range of at least 0.2 to 0.5 (but as big as 0.2 to 1) based on // current zoom and feature zoom bounds, then multiply by any feature icon scale - var minScale = 0.2; - var maxScale = Math.max((maxZoom - minZoom) / (MAP_ZOOM_RANGE[1] - MAP_ZOOM_RANGE[0]), 0.5); - var baseScale = ((zoom || minZoom) - minZoom) / (maxZoom - minZoom); - var scale = Math.max((minScale + baseScale * (maxScale - minScale)) * iconScale, minScale); - var iconProps = { - iconUrl: iconUrl, + const minScale = 0.2; + const maxScale = Math.max((maxZoom - minZoom) / (MAP_ZOOM_RANGE[1] - MAP_ZOOM_RANGE[0]), 0.5); + const baseScale = ((zoom || minZoom) - minZoom) / (maxZoom - minZoom); + const scale = Math.max((minScale + baseScale * (maxScale - minScale)) * iconScale, minScale); + const iconProps = { + iconUrl, iconRetinaUrl: iconUrl, - iconSize: iconSize.map(function (x) { - return round(x * scale); - }), - iconAnchor: iconAnchor.map(function (x) { - return round(x * scale); - }), - popupAnchor: popupAnchor.map(function (x) { - return round(x * scale); - }) + iconSize: iconSize.map(x => round(x * scale)), + iconAnchor: iconAnchor.map(x => round(x * scale)), + popupAnchor: popupAnchor.map(x => round(x * scale)) }; if (shadowUrl && shadowSize && shadowAnchor) { iconProps.shadowUrl = shadowUrl; - iconProps.shadowSize = shadowSize.map(function (x) { - return round(x * scale); - }); - iconProps.shadowAnchor = shadowAnchor.map(function (x) { - return round(x * scale); - }); + iconProps.shadowSize = shadowSize.map(x => round(x * scale)); + iconProps.shadowAnchor = shadowAnchor.map(x => round(x * scale)); } return new _leaflet.default.Icon(iconProps); }; @@ -1882,19 +1819,17 @@ var getZoomedIcon = function getZoomedIcon() { // state and regenerated any time the zoom level changes. We do this so that we're not generating // a new icon instance for every discrete location in view when several share the same icon. exports.getZoomedIcon = getZoomedIcon; -var getZoomedIcons = function getZoomedIcons(zoom) { - var featureTypes = [FEATURE_TYPES.LOCATIONS.KEY, FEATURE_TYPES.SITES.KEY, FEATURE_TYPES.OTHER.KEY]; - var icons = {}; - Object.keys(FEATURES).filter(function (key) { - return featureTypes.includes(FEATURES[key].type) && FEATURES[key].iconSvg && FEATURES[key].iconShape && LOCATION_ICON_SVG_SHAPES[FEATURES[key].iconShape]; - }).forEach(function (key) { +const getZoomedIcons = zoom => { + const featureTypes = [FEATURE_TYPES.LOCATIONS.KEY, FEATURE_TYPES.SITES.KEY, FEATURE_TYPES.OTHER.KEY]; + const icons = {}; + Object.keys(FEATURES).filter(key => featureTypes.includes(FEATURES[key].type) && FEATURES[key].iconSvg && FEATURES[key].iconShape && LOCATION_ICON_SVG_SHAPES[FEATURES[key].iconShape]).forEach(key => { icons[key] = {}; - Object.keys(SELECTION_STATUS).forEach(function (selection) { + Object.keys(SELECTION_STATUS).forEach(selection => { if (selection === SELECTION_STATUS.SELECTED && !FEATURE_TYPES[FEATURES[key].type].selectable) { return; } icons[key][selection] = {}; - Object.keys(HIGHLIGHT_STATUS).forEach(function (highlight) { + Object.keys(HIGHLIGHT_STATUS).forEach(highlight => { icons[key][selection][highlight] = getZoomedIcon(key, zoom, highlight, selection); }); }); @@ -1905,52 +1840,58 @@ var getZoomedIcons = function getZoomedIcons(zoom) { // Creare a temporary non-rendering empty Leaflet map with dimensions, center, and zoom all // identical to a given state. This is necessary whenever needing to do pixel/latlon projections. exports.getZoomedIcons = getZoomedIcons; -var getPhantomLeafletMap = function getPhantomLeafletMap(state) { - var _state$aspectRatio = state.aspectRatio, - aspectRatio = _state$aspectRatio.currentValue, - widthReference = _state$aspectRatio.widthReference, - _state$map = state.map, - center = _state$map.center, - zoom = _state$map.zoom; - var x = widthReference || 400; - var y = widthReference * aspectRatio || 300; - var PhantomMapClass = _leaflet.default.Map.extend({ +const getPhantomLeafletMap = state => { + const { + aspectRatio: { + currentValue: aspectRatio, + widthReference + }, + map: { + center, + zoom + } + } = state; + const x = widthReference || 400; + const y = widthReference * aspectRatio || 300; + const PhantomMapClass = _leaflet.default.Map.extend({ includes: { - getSize: function getSize() { - return new _leaflet.default.Point(x, y); - } + getSize: () => new _leaflet.default.Point(x, y) } }); - var element = document.createElement('div'); + const element = document.createElement('div'); return new PhantomMapClass(element, { - center: center, - zoom: zoom + center, + zoom }); }; exports.getPhantomLeafletMap = getPhantomLeafletMap; -var mapIsAtFocusLocation = function mapIsAtFocusLocation() { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; +const mapIsAtFocusLocation = function () { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return state.map && state.map.zoom && Array.isArray(state.map.center) && state.map.center.length === 2 && state.focusLocation && state.focusLocation.current && state.focusLocation.map.zoom && Array.isArray(state.focusLocation.map.center) && state.focusLocation.map.center.length === 2 && state.map.zoom === state.focusLocation.map.zoom && state.map.center[0] === state.focusLocation.map.center[0] && state.map.center[1] === state.focusLocation.map.center[1] || false; }; exports.mapIsAtFocusLocation = mapIsAtFocusLocation; -var getMapStateForFocusLocation = function getMapStateForFocusLocation() { - var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var focusLocation = state.focusLocation; +const getMapStateForFocusLocation = function () { + let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const { + focusLocation + } = state; if (!focusLocation || !focusLocation.current) { return state.map; } - var current = focusLocation.current; - var _ref3 = focusLocation.data || {}, - _ref3$type = _ref3.type, - type = _ref3$type === void 0 ? '' : _ref3$type, - latitude = _ref3.latitude, - longitude = _ref3.longitude; + const { + current + } = focusLocation; + const { + type = '', + latitude, + longitude + } = focusLocation.data || {}; // No latitude/longitude: previous map state if (!Number.isFinite(latitude) || !Number.isFinite(longitude)) { return state.map; } - var newState = _extends({}, state); + const newState = _extends({}, state); newState.map.bounds = null; newState.map.zoom = null; @@ -1961,17 +1902,17 @@ var getMapStateForFocusLocation = function getMapStateForFocusLocation() { if (type === 'SITE') { newState.map.zoom = (state.sites[current] || {}).zoom || 12; } else if (type === 'DOMAIN') { - var domainsData = state.featureData[FEATURE_TYPES.DOMAINS.KEY][FEATURES.DOMAINS.KEY]; + const { + [FEATURES.DOMAINS.KEY]: domainsData + } = state.featureData[FEATURE_TYPES.DOMAINS.KEY]; newState.map.zoom = (domainsData[current] || {}).zoom || null; } else if (type === 'STATE') { - var statesData = state.featureData[FEATURE_TYPES.STATES.KEY][FEATURES.STATES.KEY]; + const { + [FEATURES.STATES.KEY]: statesData + } = state.featureData[FEATURE_TYPES.STATES.KEY]; newState.map.zoom = (statesData[current] || {}).zoom || null; } else { - var featureKey = Object.keys(FEATURES).filter(function (key) { - return FEATURES[key].matchLocationType; - }).find(function (key) { - return new RegExp(FEATURES[key].matchLocationType).test(type); - }); + const featureKey = Object.keys(FEATURES).filter(key => FEATURES[key].matchLocationType).find(key => new RegExp(FEATURES[key].matchLocationType).test(type)); if (featureKey) { if (FEATURES[featureKey].focusZoom) { newState.map.zoom = FEATURES[featureKey].focusZoom; @@ -1983,15 +1924,14 @@ var getMapStateForFocusLocation = function getMapStateForFocusLocation() { if (newState.map.zoom !== null) { // Regenerate icons newState.map.zoomedIcons = getZoomedIcons(newState.map.zoom); - var phantomMap = getPhantomLeafletMap(newState); - var newBounds = phantomMap.getBounds() || null; + const phantomMap = getPhantomLeafletMap(newState); + const newBounds = phantomMap.getBounds() || null; newState.map.bounds = !newBounds ? null : { /* eslint-disable no-underscore-dangle */ lat: [round(newBounds._southWest.lat), round(newBounds._northEast.lat)], lng: [round(newBounds._southWest.lng), round(newBounds._northEast.lng)] /* eslint-enable no-underscore-dangle */ }; - phantomMap.remove(); } @@ -1999,22 +1939,22 @@ var getMapStateForFocusLocation = function getMapStateForFocusLocation() { return newState.map; }; exports.getMapStateForFocusLocation = getMapStateForFocusLocation; -var findCentroid = function findCentroid() { - var coords = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; +const findCentroid = function () { + let coords = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; if (!Array.isArray(coords) || !coords.length || !coords.every(isCoord)) { return null; } if (coords.length === 1) { - return _toConsumableArray(coords[0]); + return [...coords[0]]; } - var c = { + const c = { x: 0, y: 0, z: 0 }; - coords.forEach(function (coord) { - var rLat = coord[0] * (Math.PI / 180); - var rLng = coord[1] * (Math.PI / 180); + coords.forEach(coord => { + const rLat = coord[0] * (Math.PI / 180); + const rLng = coord[1] * (Math.PI / 180); c.x += Math.cos(rLat) * Math.cos(rLng); c.y += Math.cos(rLat) * Math.sin(rLng); c.z += Math.sin(rLat); @@ -2022,24 +1962,26 @@ var findCentroid = function findCentroid() { c.x /= coords.length; c.y /= coords.length; c.z /= coords.length; - var cLng = Math.atan2(c.y, c.x); - var cHyp = Math.sqrt(Math.pow(c.x, 2) + Math.pow(c.y, 2)); - var cLat = Math.atan2(c.z, cHyp); + const cLng = Math.atan2(c.y, c.x); + const cHyp = Math.sqrt(c.x ** 2 + c.y ** 2); + const cLat = Math.atan2(c.z, cHyp); return [round(cLat * (180 / Math.PI)), round(cLng * (180 / Math.PI))]; }; exports.findCentroid = findCentroid; -var getMapStateForManualLocationData = function getMapStateForManualLocationData(state) { - var previousMapState = state.map, - manualLocationData = state.manualLocationData; +const getMapStateForManualLocationData = state => { + const { + map: previousMapState, + manualLocationData + } = state; if (!Array.isArray(manualLocationData) || !manualLocationData.length) { return previousMapState; } - var newState = _extends({}, state); + const newState = _extends({}, state); newState.map.zoom = null; newState.map.bounds = null; newState.map.center = SITE_MAP_DEFAULT_PROPS.mapCenter; - var bounds = [[null, null], [null, null]]; - var locationCenters = manualLocationData.reduce(function (acc, cur) { + const bounds = [[null, null], [null, null]]; + const locationCenters = manualLocationData.reduce((acc, cur) => { if (Number.isFinite(cur.latitude) && Number.isFinite(cur.longitude)) { acc.push([cur.latitude, cur.longitude]); if (bounds[0][0] === null || cur.latitude < bounds[0][0]) { @@ -2061,11 +2003,11 @@ var getMapStateForManualLocationData = function getMapStateForManualLocationData return previousMapState; } if (locationCenters.length === 1) { - newState.map.center = _toConsumableArray(locationCenters[0]); + newState.map.center = [...locationCenters[0]]; newState.map.zoom = 6; } else { newState.map.center = findCentroid(locationCenters); - var phantomZoomMap = getPhantomLeafletMap(newState); + const phantomZoomMap = getPhantomLeafletMap(newState); phantomZoomMap.fitBounds(bounds, { animate: false, padding: [10, 10] @@ -2080,15 +2022,14 @@ var getMapStateForManualLocationData = function getMapStateForManualLocationData // from not filling the entirety of the map display newState.map.zoom = Math.max(newState.map.zoom, 3); newState.map.zoomedIcons = getZoomedIcons(newState.map.zoom); - var phantomMap = getPhantomLeafletMap(newState); - var newBounds = phantomMap.getBounds() || null; + const phantomMap = getPhantomLeafletMap(newState); + const newBounds = phantomMap.getBounds() || null; newState.map.bounds = !newBounds ? null : { /* eslint-disable no-underscore-dangle */ lat: [round(newBounds._southWest.lat), round(newBounds._northEast.lat)], lng: [round(newBounds._southWest.lng), round(newBounds._northEast.lng)] /* eslint-enable no-underscore-dangle */ }; - phantomMap.remove(); } @@ -2099,16 +2040,18 @@ var getMapStateForManualLocationData = function getMapStateForManualLocationData // Parse any manualLocationData into the mainfeatureData object so that its entries can be // rendered consistently with other features exports.getMapStateForManualLocationData = getMapStateForManualLocationData; -var parseManualLocationFeatureData = function parseManualLocationFeatureData(state) { +const parseManualLocationFeatureData = state => { if (!state.neonContextHydrated || !Array.isArray(state.manualLocationData) || !state.manualLocationData.length) { return state; } - var newState = _extends({}, state); - state.manualLocationData.forEach(function (manualLocation) { - var siteCode = manualLocation.siteCode; + const newState = _extends({}, state); + state.manualLocationData.forEach(manualLocation => { + const { + siteCode + } = manualLocation; if (manualLocation.manualLocationType === MANUAL_LOCATION_TYPES.PROTOTYPE_SITE && siteCode && !newState.sites[siteCode]) { - var featureType = FEATURE_TYPES.SITES.KEY; - var featureKey = FEATURES.DECOMMISSIONED_SITES.KEY; + const featureType = FEATURE_TYPES.SITES.KEY; + const featureKey = FEATURES.DECOMMISSIONED_SITES.KEY; newState.featureData[featureType][featureKey][siteCode] = manualLocation; // Harmonize some values newState.featureData[featureType][featureKey][siteCode].type = 'Decommissioned'; @@ -2121,31 +2064,27 @@ var parseManualLocationFeatureData = function parseManualLocationFeatureData(sta return newState; }; exports.parseManualLocationFeatureData = parseManualLocationFeatureData; -var hydrateNeonContextData = function hydrateNeonContextData(state, neonContextData) { - var newState = _extends({}, state, { +const hydrateNeonContextData = (state, neonContextData) => { + const newState = _extends({}, state, { neonContextHydrated: true }); // Sites - Object.keys(neonContextData.sites).forEach(function (siteCode) { + Object.keys(neonContextData.sites).forEach(siteCode => { newState.sites[siteCode] = _extends({}, neonContextData.sites[siteCode]); - var featureKey = Object.keys(FEATURES).filter(function (key) { - return FEATURES[key].type === FEATURE_TYPES.SITES.KEY; - }).find(function (key) { - return FEATURES[key].attributes.type === neonContextData.sites[siteCode].type && FEATURES[key].attributes.terrain === neonContextData.sites[siteCode].terrain; - }) || null; + const featureKey = Object.keys(FEATURES).filter(key => FEATURES[key].type === FEATURE_TYPES.SITES.KEY).find(key => FEATURES[key].attributes.type === neonContextData.sites[siteCode].type && FEATURES[key].attributes.terrain === neonContextData.sites[siteCode].terrain) || null; if (featureKey !== null) { // eslint-disable-next-line max-len newState.featureData[FEATURE_TYPES.SITES.KEY][featureKey][siteCode] = newState.sites[siteCode]; } }); // States - Object.keys(neonContextData.states).forEach(function (stateCode) { + Object.keys(neonContextData.states).forEach(stateCode => { newState.featureData[FEATURE_TYPES.STATES.KEY][FEATURES.STATES.KEY][stateCode] = _extends({}, newState.featureData[FEATURE_TYPES.STATES.KEY][FEATURES.STATES.KEY][stateCode] || {}, neonContextData.states[stateCode], { sites: neonContextData.stateSites[stateCode] }); }); // Domains - Object.keys(neonContextData.domains).forEach(function (domainCode) { + Object.keys(neonContextData.domains).forEach(domainCode => { newState.featureData[FEATURE_TYPES.DOMAINS.KEY][FEATURES.DOMAINS.KEY][domainCode] = _extends({}, newState.featureData[FEATURE_TYPES.DOMAINS.KEY][FEATURES.DOMAINS.KEY][domainCode] || {}, neonContextData.domains[domainCode], { sites: neonContextData.domainSites[domainCode] }); @@ -2157,39 +2096,31 @@ var hydrateNeonContextData = function hydrateNeonContextData(state, neonContextD Aspect Ratio */ exports.hydrateNeonContextData = hydrateNeonContextData; -var dynamicAspectRatios = ['1:2', '9:16', '2:3', '5:7', '4:5', '1:1', '5:4', '7:5', '3:2', '16:9', '2:1', '2.5:1', '3:1'].map(function (ratio) { - var parts = /^([\d.]+):([\d.]+)$/.exec(ratio) || ['', '1', '1']; +const dynamicAspectRatios = ['1:2', '9:16', '2:3', '5:7', '4:5', '1:1', '5:4', '7:5', '3:2', '16:9', '2:1', '2.5:1', '3:1'].map(ratio => { + const parts = /^([\d.]+):([\d.]+)$/.exec(ratio) || ['', '1', '1']; return parseFloat(parts[2]) / parseFloat(parts[1]); }); -var getDynamicAspectRatio = function getDynamicAspectRatio() { - var unusableVerticalSpace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var buffer = 100; // Approximate height of the filters row and a bit of margin - var usableVericalSpace = window.innerHeight + buffer - unusableVerticalSpace; - var windowAspectRatio = Math.max(usableVericalSpace, 0) / (window.innerWidth || 1); - var arIdx = dynamicAspectRatios.findIndex(function (ar) { - return ar < windowAspectRatio; - }); +const getDynamicAspectRatio = function () { + let unusableVerticalSpace = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + const buffer = 100; // Approximate height of the filters row and a bit of margin + const usableVericalSpace = window.innerHeight + buffer - unusableVerticalSpace; + const windowAspectRatio = Math.max(usableVericalSpace, 0) / (window.innerWidth || 1); + const arIdx = dynamicAspectRatios.findIndex(ar => ar < windowAspectRatio); return arIdx === -1 ? dynamicAspectRatios[dynamicAspectRatios.length - 1] : dynamicAspectRatios[arIdx]; }; exports.getDynamicAspectRatio = getDynamicAspectRatio; -var boundsAreValid = function boundsAreValid(bounds) { - return _typeof(bounds) === 'object' && bounds !== null && Object.keys(bounds).every(function (key) { - return ['lat', 'lng'].includes(key) && Array.isArray(bounds[key]) && bounds[key].length === 2 && bounds[key].every(function (v) { - return typeof v === 'number'; - }) && bounds[key][1] > bounds[key][0]; - }); -}; +const boundsAreValid = bounds => typeof bounds === 'object' && bounds !== null && Object.keys(bounds).every(key => ['lat', 'lng'].includes(key) && Array.isArray(bounds[key]) && bounds[key].length === 2 && bounds[key].every(v => typeof v === 'number') && bounds[key][1] > bounds[key][0]); // For large sets of coordinates, down sample to compute a general idea // of the location. A "good enough" approximation of the location's coordinates // such that a bounds calculation can be performed in a reasonable space and time // complexity and still yield a relevant result for the view port of the map. exports.boundsAreValid = boundsAreValid; -var downSample = function downSample(items) { +const downSample = items => { if (items.length < LOCATION_BOUNDS_SAMPLING_MAX) return items; - var sampled = []; - var mod = Math.floor(items.length / LOCATION_BOUNDS_SAMPLING_MAX); - items.forEach(function (item, index) { + const sampled = []; + const mod = Math.floor(items.length / LOCATION_BOUNDS_SAMPLING_MAX); + items.forEach((item, index) => { if (index % mod === 0) { sampled.push(item); } @@ -2199,40 +2130,38 @@ var downSample = function downSample(items) { // This function flattens a geometry object to just coordinates so we can check if a boundary // is in the map. NOTE: extendPoints does not work with boundaries, only solitary points. -var flatten = function flatten(items) { - var flat = []; - items.forEach(function (item) { +const flatten = items => { + const flat = []; + items.forEach(item => { if (Array.isArray(item) && !isCoord(item)) { - flat.push.apply(flat, _toConsumableArray(flatten(downSample(item)))); + flat.push(...flatten(downSample(item))); } else { flat.push(item); } }); return flat; }; -var isInBounds = function isInBounds(loc, extendedBounds) { - var extendPoints = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; +const isInBounds = function (loc, extendedBounds) { + let extendPoints = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; if (Number.isFinite(loc.latitude) && Number.isFinite(loc.longitude)) { if (extendPoints > 0) { - var lats = [loc.latitude - extendPoints, loc.latitude + extendPoints]; - var lngs = [loc.longitude - extendPoints, loc.longitude + extendPoints]; + const lats = [loc.latitude - extendPoints, loc.latitude + extendPoints]; + const lngs = [loc.longitude - extendPoints, loc.longitude + extendPoints]; return !(lats[0] > extendedBounds.lat[1] || lats[1] < extendedBounds.lat[0] || lngs[0] > extendedBounds.lng[1] || lngs[1] < extendedBounds.lng[0]); } return loc.latitude >= extendedBounds.lat[0] && loc.latitude <= extendedBounds.lat[1] && loc.longitude >= extendedBounds.lng[0] && loc.longitude <= extendedBounds.lng[1]; } if (loc.geometry && loc.geometry.coordinates) { - var flatCoords = flatten(loc.geometry.coordinates); - return flatCoords.some(function (coord) { - return coord[0] >= extendedBounds.lat[0] && coord[0] <= extendedBounds.lat[1] && coord[1] >= extendedBounds.lng[0] && coord[1] <= extendedBounds.lng[1]; - }); + const flatCoords = flatten(loc.geometry.coordinates); + return flatCoords.some(coord => coord[0] >= extendedBounds.lat[0] && coord[0] <= extendedBounds.lat[1] && coord[1] >= extendedBounds.lng[0] && coord[1] <= extendedBounds.lng[1]); } return false; }; -var calculateLocationsInBounds = function calculateLocationsInBounds(locations) { - var bounds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var extendMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var extendPoints = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; - if (!locations || _typeof(locations) !== 'object' || !Object.keys(locations).length) { +const calculateLocationsInBounds = function (locations) { + let bounds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let extendMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + let extendPoints = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + if (!locations || typeof locations !== 'object' || !Object.keys(locations).length) { return []; } if (bounds === null) { @@ -2241,29 +2170,25 @@ var calculateLocationsInBounds = function calculateLocationsInBounds(locations) if (!boundsAreValid(bounds)) { return []; } - var extendedBounds = !extendMap ? bounds : Object.fromEntries(Object.keys(bounds).map(function (dir) { - var buffer = (bounds[dir][1] - bounds[dir][0]) / 2; + const extendedBounds = !extendMap ? bounds : Object.fromEntries(Object.keys(bounds).map(dir => { + const buffer = (bounds[dir][1] - bounds[dir][0]) / 2; return [dir, [bounds[dir][0] - buffer, bounds[dir][1] + buffer]]; })); - return Object.keys(locations).filter(function (locId) { - return isInBounds(locations[locId], extendedBounds, extendPoints); - }); + return Object.keys(locations).filter(locId => isInBounds(locations[locId], extendedBounds, extendPoints)); }; exports.calculateLocationsInBounds = calculateLocationsInBounds; -var deriveFullObservatoryZoomLevel = function deriveFullObservatoryZoomLevel(mapRef) { - var FALLBACK_ZOOM = 2; - if (_typeof(mapRef) !== 'object' || mapRef === null || !mapRef.current) { +const deriveFullObservatoryZoomLevel = mapRef => { + const FALLBACK_ZOOM = 2; + if (typeof mapRef !== 'object' || mapRef === null || !mapRef.current) { return FALLBACK_ZOOM; } - var container = mapRef.current.container.parentElement; + const container = mapRef.current.container.parentElement; if (!container.clientWidth || !container.clientHeight) { return FALLBACK_ZOOM; } - var divisor = 23 * 8; - var minorDim = Math.min(container.clientWidth / divisor, container.clientHeight / divisor); - var derivedZoom = [1, 2, 4, 6, 11].findIndex(function (m) { - return m > minorDim; - }); + const divisor = 23 * 8; + const minorDim = Math.min(container.clientWidth / divisor, container.clientHeight / divisor); + const derivedZoom = [1, 2, 4, 6, 11].findIndex(m => m > minorDim); return Math.max(derivedZoom, 1); }; exports.deriveFullObservatoryZoomLevel = deriveFullObservatoryZoomLevel; \ No newline at end of file diff --git a/lib/components/SiteMap/StateStorageConverter.js b/lib/components/SiteMap/StateStorageConverter.js index ebfaf354..c77a3ffa 100644 --- a/lib/components/SiteMap/StateStorageConverter.js +++ b/lib/components/SiteMap/StateStorageConverter.js @@ -11,14 +11,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * must be converted to Array objects for serialization. * @param currentState The current state */ -var convertStateForStorage = function convertStateForStorage(state) { - var _state$selection, _state$selection2, _state$filters, _state$filters$featur, _state$filters2, _state$filters2$overl, _state$map; - var selectionSet = (_state$selection = state.selection) === null || _state$selection === void 0 ? void 0 : _state$selection.set; - var selectionValidSet = (_state$selection2 = state.selection) === null || _state$selection2 === void 0 ? void 0 : _state$selection2.validSet; - var filtersFeaturesCollapsed = (_state$filters = state.filters) === null || _state$filters === void 0 ? void 0 : (_state$filters$featur = _state$filters.features) === null || _state$filters$featur === void 0 ? void 0 : _state$filters$featur.collapsed; - var filtersOverlaysExpanded = (_state$filters2 = state.filters) === null || _state$filters2 === void 0 ? void 0 : (_state$filters2$overl = _state$filters2.overlays) === null || _state$filters2$overl === void 0 ? void 0 : _state$filters2$overl.expanded; - var mapOverlays = (_state$map = state.map) === null || _state$map === void 0 ? void 0 : _state$map.overlays; - var newState = (0, _cloneDeep.default)(state); +const convertStateForStorage = state => { + var _state$selection, _state$selection2, _state$filters, _state$filters2, _state$map; + const selectionSet = (_state$selection = state.selection) === null || _state$selection === void 0 ? void 0 : _state$selection.set; + const selectionValidSet = (_state$selection2 = state.selection) === null || _state$selection2 === void 0 ? void 0 : _state$selection2.validSet; + const filtersFeaturesCollapsed = (_state$filters = state.filters) === null || _state$filters === void 0 || (_state$filters = _state$filters.features) === null || _state$filters === void 0 ? void 0 : _state$filters.collapsed; + const filtersOverlaysExpanded = (_state$filters2 = state.filters) === null || _state$filters2 === void 0 || (_state$filters2 = _state$filters2.overlays) === null || _state$filters2 === void 0 ? void 0 : _state$filters2.expanded; + const mapOverlays = (_state$map = state.map) === null || _state$map === void 0 ? void 0 : _state$map.overlays; + const newState = (0, _cloneDeep.default)(state); if (selectionSet instanceof Set) { newState.selection.set = Array.from(selectionSet); } else { @@ -53,17 +53,17 @@ var convertStateForStorage = function convertStateForStorage(state) { * @param storedState The state read from storage. */ exports.convertStateForStorage = convertStateForStorage; -var convertStateFromStorage = function convertStateFromStorage(state, initialState) { - var _state$selection3, _state$selection4, _state$filters3, _state$filters3$featu, _state$filters4, _state$filters4$overl, _state$map2; - var newState = (0, _cloneDeep.default)(state); +const convertStateFromStorage = (state, initialState) => { + var _state$selection3, _state$selection4, _state$filters3, _state$filters4, _state$map2; + const newState = (0, _cloneDeep.default)(state); newState.view = initialState.view; newState.map.zoomedIcons = initialState.map.zoomedIcons; newState.selection.onChange = initialState.selection.onChange; - var setValue = (_state$selection3 = state.selection) === null || _state$selection3 === void 0 ? void 0 : _state$selection3.set; - var validSet = (_state$selection4 = state.selection) === null || _state$selection4 === void 0 ? void 0 : _state$selection4.validSet; - var collapsedValue = (_state$filters3 = state.filters) === null || _state$filters3 === void 0 ? void 0 : (_state$filters3$featu = _state$filters3.features) === null || _state$filters3$featu === void 0 ? void 0 : _state$filters3$featu.collapsed; - var expandedValue = (_state$filters4 = state.filters) === null || _state$filters4 === void 0 ? void 0 : (_state$filters4$overl = _state$filters4.overlays) === null || _state$filters4$overl === void 0 ? void 0 : _state$filters4$overl.expanded; - var mapOverlays = (_state$map2 = state.map) === null || _state$map2 === void 0 ? void 0 : _state$map2.overlays; + const setValue = (_state$selection3 = state.selection) === null || _state$selection3 === void 0 ? void 0 : _state$selection3.set; + const validSet = (_state$selection4 = state.selection) === null || _state$selection4 === void 0 ? void 0 : _state$selection4.validSet; + const collapsedValue = (_state$filters3 = state.filters) === null || _state$filters3 === void 0 || (_state$filters3 = _state$filters3.features) === null || _state$filters3 === void 0 ? void 0 : _state$filters3.collapsed; + const expandedValue = (_state$filters4 = state.filters) === null || _state$filters4 === void 0 || (_state$filters4 = _state$filters4.overlays) === null || _state$filters4 === void 0 ? void 0 : _state$filters4.expanded; + const mapOverlays = (_state$map2 = state.map) === null || _state$map2 === void 0 ? void 0 : _state$map2.overlays; if (Array.isArray(setValue)) { newState.selection.set = new Set(setValue); } else { diff --git a/lib/components/SiteMap/index.js b/lib/components/SiteMap/index.js index 33de10cb..0b077d0e 100644 --- a/lib/components/SiteMap/index.js +++ b/lib/components/SiteMap/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _SiteMap.default; } }); diff --git a/lib/components/StoryMap/StoryMap.js b/lib/components/StoryMap/StoryMap.js index 52f367f5..7ee2007d 100644 --- a/lib/components/StoryMap/StoryMap.js +++ b/lib/components/StoryMap/StoryMap.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -13,29 +12,29 @@ var _OpenInNew = _interopRequireDefault(require("@material-ui/icons/OpenInNew")) var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _FullWidthVisualization = _interopRequireDefault(require("../FullWidthVisualization/FullWidthVisualization")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -var MIN_IFRAME_WIDTH = 240; -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - openInNewLink: { - display: 'block', - width: '100%', - textAlign: 'right', - marginTop: theme.spacing(0.5), - fontSize: '0.8rem' - }, - openInNewIcon: { - fontSize: '0.95rem', - margin: theme.spacing(0, 0.5, -0.25, 0) - } - }; -}); -var StoryMap = function StoryMap(props) { - var url = props.url, - title = props.title; - var classes = useStyles(_Theme.default); - var iframeRef = (0, _react.useRef)(null); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const MIN_IFRAME_WIDTH = 240; +const useStyles = (0, _styles.makeStyles)(theme => ({ + openInNewLink: { + display: 'block', + width: '100%', + textAlign: 'right', + marginTop: theme.spacing(0.5), + fontSize: '0.8rem' + }, + openInNewIcon: { + fontSize: '0.95rem', + margin: theme.spacing(0, 0.5, -0.25, 0) + } +})); +const StoryMap = props => { + const { + url, + title + } = props; + const classes = useStyles(_Theme.default); + const iframeRef = (0, _react.useRef)(null); return /*#__PURE__*/_react.default.createElement(_FullWidthVisualization.default, { vizRef: iframeRef, minWidth: MIN_IFRAME_WIDTH, @@ -67,6 +66,5 @@ StoryMap.propTypes = { StoryMap.defaultProps = { title: null }; -var WrappedStoryMap = _Theme.default.getWrappedComponent(StoryMap); -var _default = WrappedStoryMap; -exports.default = _default; \ No newline at end of file +const WrappedStoryMap = _Theme.default.getWrappedComponent(StoryMap); +var _default = exports.default = WrappedStoryMap; \ No newline at end of file diff --git a/lib/components/StoryMap/index.js b/lib/components/StoryMap/index.js index 1dd6ff6f..4c90a7cf 100644 --- a/lib/components/StoryMap/index.js +++ b/lib/components/StoryMap/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _StoryMap.default; } }); diff --git a/lib/components/SyntaxHighlight/SyntaxHighlight.js b/lib/components/SyntaxHighlight/SyntaxHighlight.js index f6232386..f522d953 100644 --- a/lib/components/SyntaxHighlight/SyntaxHighlight.js +++ b/lib/components/SyntaxHighlight/SyntaxHighlight.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -13,36 +12,35 @@ var _json = _interopRequireDefault(require("highlight.js/lib/languages/json")); var _typescript = _interopRequireDefault(require("highlight.js/lib/languages/typescript")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } _core.default.registerLanguage('javascript', _javascript.default); _core.default.registerLanguage('json', _json.default); _core.default.registerLanguage('typescript', _typescript.default); -var useStyles = (0, _styles.makeStyles)(function (muiTheme) { - return ( - // eslint-disable-next-line implicit-arrow-linebreak - (0, _styles.createStyles)({ - root: { - margin: muiTheme.spacing(2, 0), - '& code': { - padding: "".concat(muiTheme.spacing(0, 2), " !important") - } - } - }) - ); -}); +const useStyles = (0, _styles.makeStyles)(muiTheme => +// eslint-disable-next-line implicit-arrow-linebreak +(0, _styles.createStyles)({ + root: { + margin: muiTheme.spacing(2, 0), + '& code': { + padding: "".concat(muiTheme.spacing(0, 2), " !important") + } + } +})); /** * Syntax highlighter component based on: * https://github.com/bvaughn/react-highlight.js */ -var SyntaxHighlight = function SyntaxHighlight(props) { - var classes = useStyles(_Theme.default); - var children = props.children, - language = props.language, - style = props.style; - var codeRef = (0, _react.useRef)(); - (0, _react.useEffect)(function () { - var element = codeRef.current; +const SyntaxHighlight = props => { + const classes = useStyles(_Theme.default); + const { + children, + language, + style + } = props; + const codeRef = (0, _react.useRef)(); + (0, _react.useEffect)(() => { + const element = codeRef.current; if (!element) { return; } @@ -60,5 +58,4 @@ SyntaxHighlight.defaultProps = { language: 'typescript', style: undefined }; -var _default = SyntaxHighlight; -exports.default = _default; \ No newline at end of file +var _default = exports.default = SyntaxHighlight; \ No newline at end of file diff --git a/lib/components/SyntaxHighlight/index.js b/lib/components/SyntaxHighlight/index.js index fde7918f..6ba79f87 100644 --- a/lib/components/SyntaxHighlight/index.js +++ b/lib/components/SyntaxHighlight/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _SyntaxHighlight.default; } }); diff --git a/lib/components/Theme/Theme.js b/lib/components/Theme/Theme.js index c31738bf..6c41385a 100644 --- a/lib/components/Theme/Theme.js +++ b/lib/components/Theme/Theme.js @@ -15,7 +15,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de // 50-700 https://gka.github.io/palettes/#/8|s|e1e3ea,002c77||1|1 // 700-900 https://gka.github.io/palettes/#/3|s|002c77,00034a||1|1 -var COLORS = { +const COLORS = exports.COLORS = { NEON_BLUE: { 50: '#e1e3ea', 100: '#c5c6d9', @@ -115,8 +115,7 @@ var COLORS = { A700: '#343739' } }; -exports.COLORS = COLORS; -var PALETTES = { +const PALETTES = { PRIMARY: { light: COLORS.LIGHT_BLUE[300], main: COLORS.LIGHT_BLUE[500], @@ -137,12 +136,12 @@ var PALETTES = { }, GREY: COLORS.GREY }; -var COLOR_TEXT_PRIMARY = 'rgba(0, 0, 0, 0.9)'; +const COLOR_TEXT_PRIMARY = 'rgba(0, 0, 0, 0.9)'; // See all customizable Material UI theme keys here: // https://material-ui.com/customization/default-theme/#explore -var baseTheme = (0, _styles2.createTheme)({ +const baseTheme = (0, _styles2.createTheme)({ breakpoints: { values: { xs: 0, @@ -812,7 +811,7 @@ var baseTheme = (0, _styles2.createTheme)({ } } }); -var theme = (0, _styles2.responsiveFontSizes)(baseTheme); +const theme = (0, _styles2.responsiveFontSizes)(baseTheme); theme.isNeonTheme = true; theme.colors = COLORS; @@ -821,17 +820,14 @@ theme.colors = COLORS; Function used to automatically wrap functional components in a ThemeProvider if not already present. Will not wrap in theme if running in jsdom so as not to inject themes into snapshots. */ -theme.getWrappedComponent = function (Component) { - return function (props) { - var currentTheme = (0, _styles2.useTheme)(); - var isJsdom = navigator.userAgent.includes('Node.js') || navigator.userAgent.includes('jsdom'); - if (!currentTheme.isNeonTheme && !isJsdom) { - return /*#__PURE__*/_react.default.createElement(_styles.ThemeProvider, { - theme: theme - }, /*#__PURE__*/_react.default.createElement(_CssBaseline.default, null), /*#__PURE__*/_react.default.createElement(Component, props)); - } - return /*#__PURE__*/_react.default.createElement(Component, props); - }; +theme.getWrappedComponent = Component => props => { + const currentTheme = (0, _styles2.useTheme)(); + const isJsdom = navigator.userAgent.includes('Node.js') || navigator.userAgent.includes('jsdom'); + if (!currentTheme.isNeonTheme && !isJsdom) { + return /*#__PURE__*/_react.default.createElement(_styles.ThemeProvider, { + theme: theme + }, /*#__PURE__*/_react.default.createElement(_CssBaseline.default, null), /*#__PURE__*/_react.default.createElement(Component, props)); + } + return /*#__PURE__*/_react.default.createElement(Component, props); }; -var _default = theme; -exports.default = _default; \ No newline at end of file +var _default = exports.default = theme; \ No newline at end of file diff --git a/lib/components/Theme/index.js b/lib/components/Theme/index.js index 9a8df352..a4973da0 100644 --- a/lib/components/Theme/index.js +++ b/lib/components/Theme/index.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "default", { enumerable: true, - get: function get() { + get: function () { return _Theme.default; } }); diff --git a/lib/components/TimeSeriesViewer/StateStorageConverter.js b/lib/components/TimeSeriesViewer/StateStorageConverter.js index c3aa9643..4f549ee1 100644 --- a/lib/components/TimeSeriesViewer/StateStorageConverter.js +++ b/lib/components/TimeSeriesViewer/StateStorageConverter.js @@ -11,8 +11,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * Alter the current state for valid JSON serialization. * @param currentState The current state */ -var convertStateForStorage = function convertStateForStorage(state) { - var newState = (0, _cloneDeep.default)(state); +const convertStateForStorage = state => { + const newState = (0, _cloneDeep.default)(state); switch (newState.status) { case _constants.TIME_SERIES_VIEWER_STATUS.INIT_PRODUCT: case _constants.TIME_SERIES_VIEWER_STATUS.LOADING_META: @@ -29,12 +29,15 @@ var convertStateForStorage = function convertStateForStorage(state) { break; } // variables - var stateVariables = state.variables; - Object.keys(stateVariables).forEach(function (variableKey, index) { - var _stateVariables$varia = stateVariables[variableKey], - sites = _stateVariables$varia.sites, - tables = _stateVariables$varia.tables, - timeSteps = _stateVariables$varia.timeSteps; + const { + variables: stateVariables + } = state; + Object.keys(stateVariables).forEach((variableKey, index) => { + const { + sites, + tables, + timeSteps + } = stateVariables[variableKey]; if (sites instanceof Set && sites.size > 0) { newState.variables[variableKey].sites = Array.from(sites); } else { @@ -52,9 +55,13 @@ var convertStateForStorage = function convertStateForStorage(state) { } }); // product site variables - var productSites = state.product.sites; - Object.keys(productSites).forEach(function (siteKey, index) { - var siteVariables = productSites[siteKey].variables; + const { + sites: productSites + } = state.product; + Object.keys(productSites).forEach((siteKey, index) => { + const { + variables: siteVariables + } = productSites[siteKey]; if (siteVariables instanceof Set && siteVariables.size > 0) { newState.product.sites[siteKey].variables = Array.from(siteVariables); } else { @@ -62,14 +69,18 @@ var convertStateForStorage = function convertStateForStorage(state) { } }); // available quality flags - var availableQualityFlags = state.availableQualityFlags; + const { + availableQualityFlags + } = state; if (availableQualityFlags instanceof Set) { newState.availableQualityFlags = Array.from(availableQualityFlags); } else { newState.availableQualityFlags = []; } // available time steps - var availableTimeSteps = state.availableTimeSteps; + const { + availableTimeSteps + } = state; if (availableTimeSteps instanceof Set) { newState.availableTimeSteps = Array.from(availableTimeSteps); } else { @@ -83,20 +94,21 @@ var convertStateForStorage = function convertStateForStorage(state) { * @param storedState The state read from storage. */ exports.convertStateForStorage = convertStateForStorage; -var convertStateFromStorage = function convertStateFromStorage(state) { - var newState = (0, _cloneDeep.default)(state); +const convertStateFromStorage = state => { + const newState = (0, _cloneDeep.default)(state); // graphData data - var data = state.graphData.data.map(function (entry) { - return [new Date(entry[0]), entry[1]]; - }); + const data = state.graphData.data.map(entry => [new Date(entry[0]), entry[1]]); newState.graphData.data = data; // state variables - var variables = state.variables; - Object.keys(variables).forEach(function (key, index) { - var _variables$key = variables[key], - sites = _variables$key.sites, - tables = _variables$key.tables, - timeSteps = _variables$key.timeSteps; + const { + variables + } = state; + Object.keys(variables).forEach((key, index) => { + const { + sites, + tables, + timeSteps + } = variables[key]; if (Array.isArray(sites)) { newState.variables[key].sites = new Set(sites); } else { @@ -114,10 +126,14 @@ var convertStateFromStorage = function convertStateFromStorage(state) { } }); // product site variables - var productSites = state.product.sites; + const { + sites: productSites + } = state.product; // get the variables for each site - Object.keys(productSites).forEach(function (siteKey, index) { - var siteVariables = productSites[siteKey].variables; + Object.keys(productSites).forEach((siteKey, index) => { + const { + variables: siteVariables + } = productSites[siteKey]; if (Array.isArray(siteVariables) && siteVariables.length > 0) { newState.product.sites[siteKey].variables = new Set(siteVariables); } else { @@ -125,14 +141,18 @@ var convertStateFromStorage = function convertStateFromStorage(state) { } }); // available quality flags - var availableQualityFlags = state.availableQualityFlags; + const { + availableQualityFlags + } = state; if (Array.isArray(availableQualityFlags)) { newState.availableQualityFlags = new Set(availableQualityFlags); } else { newState.availableQualityFlags = new Set(); } // available quality flags - var availableTimeSteps = state.availableTimeSteps; + const { + availableTimeSteps + } = state; if (Array.isArray(availableTimeSteps)) { newState.availableTimeSteps = new Set(availableTimeSteps); } else { diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewer.js b/lib/components/TimeSeriesViewer/TimeSeriesViewer.js index f38c3eb3..336e5dda 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewer.js +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewer.js @@ -9,11 +9,8 @@ var _NeonContext = _interopRequireDefault(require("../NeonContext/NeonContext")) var _TimeSeriesViewerContainer = _interopRequireDefault(require("./TimeSeriesViewerContainer")); var _TimeSeriesViewerContext = _interopRequireDefault(require("./TimeSeriesViewerContext")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var TimeSeriesViewer = function TimeSeriesViewer(props) { - return /*#__PURE__*/_react.default.createElement(_TimeSeriesViewerContext.default.Provider, props, /*#__PURE__*/_react.default.createElement(_TimeSeriesViewerContainer.default, null)); -}; +const TimeSeriesViewer = props => /*#__PURE__*/_react.default.createElement(_TimeSeriesViewerContext.default.Provider, props, /*#__PURE__*/_react.default.createElement(_TimeSeriesViewerContainer.default, null)); TimeSeriesViewer.propTypes = _TimeSeriesViewerContext.default.TimeSeriesViewerPropTypes; TimeSeriesViewer.defaultProps = _TimeSeriesViewerContext.default.Provider.defaultProps; -var WrappedTimeSeriesViewer = _NeonContext.default.getWrappedComponent(TimeSeriesViewer); -var _default = WrappedTimeSeriesViewer; -exports.default = _default; \ No newline at end of file +const WrappedTimeSeriesViewer = _NeonContext.default.getWrappedComponent(TimeSeriesViewer); +var _default = exports.default = WrappedTimeSeriesViewer; \ No newline at end of file diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerAxes.js b/lib/components/TimeSeriesViewer/TimeSeriesViewerAxes.js index 1d0de9da..184ad353 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerAxes.js +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerAxes.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -20,128 +19,113 @@ var _SwapHoriz = _interopRequireDefault(require("@material-ui/icons/SwapHoriz")) var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _TimeSeriesViewerContext = _interopRequireWildcard(require("./TimeSeriesViewerContext")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - optionsContainer: { - display: 'flex', - alignItems: 'flex-start', - justifyContent: 'flex-start', - flexWrap: 'wrap' - }, - smallButton: { - fontSize: '0.55rem', - padding: theme.spacing(0.25, 0.75), - whiteSpace: 'nowrap' - }, - smallButtonIcon: { - marginRight: theme.spacing(0.5), - fontSize: '0.8rem' - }, - optionButtonGroup: { - height: theme.spacing(4), - display: 'block' - }, - optionButton: { - height: theme.spacing(4), - fontWeight: 600, - color: theme.palette.primary.main, - borderColor: theme.palette.primary.main, - padding: theme.spacing(0, 1.5), - whiteSpace: 'nowrap' - }, - // Use !important here to override the Mui-selected class with higher priority - optionButtonSelected: { - color: '#fff !important', - backgroundColor: "".concat(theme.palette.primary.main, " !important") - }, - optionExtraDescription: { - display: 'block', - marginTop: theme.spacing(-1), - marginBottom: theme.spacing(1), - color: theme.palette.grey[400] - }, - yAxesRangesContainer: { - display: 'flex', - alignItems: 'flex-start', - justifyContent: 'flex-start', - flexWrap: 'wrap' - }, - yAxisRangeOuterContainer: { - width: '100%', - marginTop: theme.spacing(1), - marginBottom: theme.spacing(4), - minWidth: theme.spacing(33) // to accomodate button group - }, - - yAxisRangeInnerContainer: { - height: theme.spacing(15), - display: 'flex', - alignItems: 'flex-start', - marginTop: theme.spacing(2.5) - }, - yAxisRangeOptions: { - display: 'flex', - alignItems: 'center' - }, - yAxisRangeTextfieldContainer: { - marginTop: theme.spacing(-0.5), - marginRight: theme.spacing(2), - display: 'flex', - flexDirection: 'column', - alignItems: 'flex-start' - }, - yAxisRangeTextField: { - marginTop: theme.spacing(0.5), - marginBottom: theme.spacing(1.5), - width: theme.spacing(15) - }, - autoLabelDescription: { - marginLeft: theme.spacing(1), - color: theme.palette.grey[400], - fontSize: '0.75rem' - }, - standardDeviation: { - marginTop: theme.spacing(0.5), - marginBottom: theme.spacing(2), - color: theme.palette.grey[400], - fontSize: '0.75rem' - }, - horizSlider: { - width: "calc(100% - ".concat(theme.spacing(6), "px)"), - marginLeft: theme.spacing(3), - marginBottom: '24px !important' - }, - vertSlider: { - margin: '4px 56px 32px 16px !important' - } - }; -}); +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const useStyles = (0, _styles.makeStyles)(theme => ({ + optionsContainer: { + display: 'flex', + alignItems: 'flex-start', + justifyContent: 'flex-start', + flexWrap: 'wrap' + }, + smallButton: { + fontSize: '0.55rem', + padding: theme.spacing(0.25, 0.75), + whiteSpace: 'nowrap' + }, + smallButtonIcon: { + marginRight: theme.spacing(0.5), + fontSize: '0.8rem' + }, + optionButtonGroup: { + height: theme.spacing(4), + display: 'block' + }, + optionButton: { + height: theme.spacing(4), + fontWeight: 600, + color: theme.palette.primary.main, + borderColor: theme.palette.primary.main, + padding: theme.spacing(0, 1.5), + whiteSpace: 'nowrap' + }, + // Use !important here to override the Mui-selected class with higher priority + optionButtonSelected: { + color: '#fff !important', + backgroundColor: "".concat(theme.palette.primary.main, " !important") + }, + optionExtraDescription: { + display: 'block', + marginTop: theme.spacing(-1), + marginBottom: theme.spacing(1), + color: theme.palette.grey[400] + }, + yAxesRangesContainer: { + display: 'flex', + alignItems: 'flex-start', + justifyContent: 'flex-start', + flexWrap: 'wrap' + }, + yAxisRangeOuterContainer: { + width: '100%', + marginTop: theme.spacing(1), + marginBottom: theme.spacing(4), + minWidth: theme.spacing(33) // to accomodate button group + }, + yAxisRangeInnerContainer: { + height: theme.spacing(15), + display: 'flex', + alignItems: 'flex-start', + marginTop: theme.spacing(2.5) + }, + yAxisRangeOptions: { + display: 'flex', + alignItems: 'center' + }, + yAxisRangeTextfieldContainer: { + marginTop: theme.spacing(-0.5), + marginRight: theme.spacing(2), + display: 'flex', + flexDirection: 'column', + alignItems: 'flex-start' + }, + yAxisRangeTextField: { + marginTop: theme.spacing(0.5), + marginBottom: theme.spacing(1.5), + width: theme.spacing(15) + }, + autoLabelDescription: { + marginLeft: theme.spacing(1), + color: theme.palette.grey[400], + fontSize: '0.75rem' + }, + standardDeviation: { + marginTop: theme.spacing(0.5), + marginBottom: theme.spacing(2), + color: theme.palette.grey[400], + fontSize: '0.75rem' + }, + horizSlider: { + width: "calc(100% - ".concat(theme.spacing(6), "px)"), + marginLeft: theme.spacing(3), + marginBottom: '24px !important' + }, + vertSlider: { + margin: '4px 56px 32px 16px !important' + } +})); /** y Axes - Scale Option */ -var YAxisScaleOption = function YAxisScaleOption() { - var classes = useStyles(_Theme.default); - var _TimeSeriesViewerCont = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont2 = _slicedToArray(_TimeSeriesViewerCont, 2), - state = _TimeSeriesViewerCont2[0], - dispatch = _TimeSeriesViewerCont2[1]; - var _state$selection = state.selection, - yAxes = _state$selection.yAxes, - logscale = _state$selection.logscale; - var classNames = { +const YAxisScaleOption = () => { + const classes = useStyles(_Theme.default); + const [state, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const { + yAxes, + logscale + } = state.selection; + const classNames = { selected: "".concat(classes.optionButton, " ").concat(classes.optionButtonSelected), deselected: classes.optionButton }; @@ -156,7 +140,7 @@ var YAxisScaleOption = function YAxisScaleOption() { size: "small", className: classes.optionButtonGroup, value: logscale ? 'log' : 'lin', - onChange: function onChange(event, value) { + onChange: (event, value) => { dispatch({ type: 'selectLogScale', logscale: value === 'log' @@ -175,7 +159,7 @@ var YAxisScaleOption = function YAxisScaleOption() { }, "Logarithmic")), yAxes.y2.units === null ? null : /*#__PURE__*/_react.default.createElement(_Button.default, { color: "primary", variant: "outlined", - onClick: function onClick() { + onClick: () => { dispatch({ type: 'selectSwapYAxes' }); @@ -192,56 +176,55 @@ var YAxisScaleOption = function YAxisScaleOption() { /** y Axis - Range Option */ -var YAxisRangeOption = function YAxisRangeOption(props) { - var axis = props.axis; - var classes = useStyles(_Theme.default); - var classNames = { +const YAxisRangeOption = props => { + const { + axis + } = props; + const classes = useStyles(_Theme.default); + const classNames = { selected: "".concat(classes.optionButton, " ").concat(classes.optionButtonSelected), deselected: classes.optionButton }; - var _TimeSeriesViewerCont3 = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont4 = _slicedToArray(_TimeSeriesViewerCont3, 2), - state = _TimeSeriesViewerCont4[0], - dispatch = _TimeSeriesViewerCont4[1]; - var _state$selection2 = state.selection, - logscale = _state$selection2.logscale, - _state$selection2$yAx = _state$selection2.yAxes[axis], - units = _state$selection2$yAx.units, - dataRange = _state$selection2$yAx.dataRange, - rangeMode = _state$selection2$yAx.rangeMode, - axisRange = _state$selection2$yAx.axisRange, - precision = _state$selection2$yAx.precision, - standardDeviation = _state$selection2$yAx.standardDeviation; + const [state, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const { + selection: { + logscale, + yAxes: { + [axis]: { + units, + dataRange, + rangeMode, + axisRange, + precision, + standardDeviation + } + } + } + } = state; // Local state for the range min/max as we change it. This lets us change the range with // controlled components without having to send all updates through the main context reducer, // which would otherwise result in poor performance in some places and inability to make changes // we'd expect to be able to make in others. - var _useState = (0, _react.useState)(_toConsumableArray(axisRange)), - _useState2 = _slicedToArray(_useState, 2), - activeRange = _useState2[0], - setActiveRange = _useState2[1]; - var _useState3 = (0, _react.useState)(false), - _useState4 = _slicedToArray(_useState3, 2), - isActivelySetting = _useState4[0], - setIsActivelySetting = _useState4[1]; - (0, _react.useEffect)(function () { + const [activeRange, setActiveRange] = (0, _react.useState)([...axisRange]); + const [isActivelySetting, setIsActivelySetting] = (0, _react.useState)(false); + (0, _react.useEffect)(() => { if ((axisRange[0] !== activeRange[0] || axisRange[1] !== activeRange[1]) && !isActivelySetting) { - setActiveRange(_toConsumableArray(axisRange)); + setActiveRange([...axisRange]); } }, [axisRange, activeRange, isActivelySetting, setActiveRange]); - var render = units && dataRange[0] !== null && dataRange[1] !== null; - var isCustom = rangeMode === _TimeSeriesViewerContext.Y_AXIS_RANGE_MODES.CUSTOM; - var customPad = Math.max((dataRange[1] - dataRange[0]) * 0.3, standardDeviation * 3); - var customMin = dataRange[0] >= 0 || logscale ? 0 : parseFloat(Math.min(axisRange[0], (dataRange[0] || 0) - customPad).toFixed(precision), 10); - var customMax = Math.max(parseFloat(Math.max(axisRange[1], (dataRange[1] || 0) + customPad).toFixed(precision), 10), 0); + const render = units && dataRange[0] !== null && dataRange[1] !== null; + const isCustom = rangeMode === _TimeSeriesViewerContext.Y_AXIS_RANGE_MODES.CUSTOM; + const customPad = Math.max((dataRange[1] - dataRange[0]) * 0.3, standardDeviation * 3); + const customMin = dataRange[0] >= 0 || logscale ? 0 : parseFloat(Math.min(axisRange[0], (dataRange[0] || 0) - customPad).toFixed(precision), 10); + const customMax = Math.max(parseFloat(Math.max(axisRange[1], (dataRange[1] || 0) + customPad).toFixed(precision), 10), 0); // Determine slider marks // There's probably a slick mathematical way to do this, but essentially the goal here is always // 5 marks roughly evenly spaced. If the min is negative then we want a guaranteed mark at zero - var marks = []; + let marks = []; if (customMin !== customMax) { - var spread = customMax - customMin; + const spread = customMax - customMin; if (customMin >= 0) { marks = [customMin, spread * 0.25, spread * 0.5, spread * 0.75, customMax]; } else if (customMax === 0) { @@ -253,37 +236,35 @@ var YAxisRangeOption = function YAxisRangeOption(props) { } else { marks = [customMin, customMin * (2 / 3), customMin * (1 / 3), 0, customMax]; } - marks = marks.map(function (m) { - return { - value: m, - label: m.toFixed(precision) - }; - }); + marks = marks.map(m => ({ + value: m, + label: m.toFixed(precision) + })); } - var step = Math.pow(10, -1 * precision); + const step = 10 ** (-1 * precision); // Debounce onchange functions for the text inputs so that we can type incomplete numbers // without immediately being corrected by the main context recuder. - var setMax = function setMax(value) { - var range = [axisRange[0], Math.min(value, customMax)]; + const setMax = value => { + const range = [axisRange[0], Math.min(value, customMax)]; dispatch({ type: 'selectYAxisCustomRange', - axis: axis, - range: range + axis, + range }); }; - var setMin = function setMin(value) { - var range = [Math.max(value, customMin), axisRange[1]]; + const setMin = value => { + const range = [Math.max(value, customMin), axisRange[1]]; dispatch({ type: 'selectYAxisCustomRange', - axis: axis, - range: range + axis, + range }); }; - var debounceSetMax = (0, _lodash.debounce)(function (value) { + const debounceSetMax = (0, _lodash.debounce)(value => { setMax(value); }, 200); - var debounceSetMin = (0, _lodash.debounce)(function (value) { + const debounceSetMin = (0, _lodash.debounce)(value => { setMin(value); }, 200); return !render ? /*#__PURE__*/_react.default.createElement("div", { @@ -327,22 +308,20 @@ var YAxisRangeOption = function YAxisRangeOption(props) { size: "small", className: classes.optionButtonGroup, value: rangeMode, - onChange: function onChange(event, value) { + onChange: (event, value) => { dispatch({ type: 'selectYAxisRangeMode', - axis: axis, + axis, mode: value }); } - }, Object.keys(_TimeSeriesViewerContext.Y_AXIS_RANGE_MODES).map(function (key) { - return /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { - key: key, - value: key, - size: "small", - className: classNames[rangeMode !== key ? 'deselected' : 'selected'], - title: _TimeSeriesViewerContext.Y_AXIS_RANGE_MODE_DETAILS[key].description - }, _TimeSeriesViewerContext.Y_AXIS_RANGE_MODE_DETAILS[key].name); - })), /*#__PURE__*/_react.default.createElement("div", { + }, Object.keys(_TimeSeriesViewerContext.Y_AXIS_RANGE_MODES).map(key => /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { + key: key, + value: key, + size: "small", + className: classNames[rangeMode !== key ? 'deselected' : 'selected'], + title: _TimeSeriesViewerContext.Y_AXIS_RANGE_MODE_DETAILS[key].description + }, _TimeSeriesViewerContext.Y_AXIS_RANGE_MODE_DETAILS[key].name))), /*#__PURE__*/_react.default.createElement("div", { className: classes.yAxisRangeInnerContainer }, /*#__PURE__*/_react.default.createElement("div", { className: classes.yAxisRangeTextfieldContainer @@ -351,7 +330,7 @@ var YAxisRangeOption = function YAxisRangeOption(props) { type: "number", margin: "dense", inputProps: { - step: step + step }, InputLabelProps: { shrink: true @@ -360,14 +339,14 @@ var YAxisRangeOption = function YAxisRangeOption(props) { disabled: !isCustom, value: activeRange[1], className: classes.yAxisRangeTextField, - onFocus: function onFocus() { + onFocus: () => { setIsActivelySetting(true); }, - onBlur: function onBlur(event) { + onBlur: event => { setMax(event.target.value); setIsActivelySetting(false); }, - onChange: function onChange(event) { + onChange: event => { setActiveRange([activeRange[0], event.target.value]); debounceSetMax(event.target.value); } @@ -376,7 +355,7 @@ var YAxisRangeOption = function YAxisRangeOption(props) { type: "number", margin: "dense", inputProps: { - step: step + step }, InputLabelProps: { shrink: true @@ -385,14 +364,14 @@ var YAxisRangeOption = function YAxisRangeOption(props) { disabled: !isCustom, value: activeRange[0], className: classes.yAxisRangeTextField, - onFocus: function onFocus() { + onFocus: () => { setIsActivelySetting(true); }, - onBlur: function onBlur(event) { + onBlur: event => { setMin(event.target.value); setIsActivelySetting(false); }, - onChange: function onChange(event) { + onChange: event => { setActiveRange([event.target.value, activeRange[1]]); debounceSetMin(event.target.value); } @@ -412,18 +391,14 @@ var YAxisRangeOption = function YAxisRangeOption(props) { valueLabelDisplay: "auto", min: customMin, max: customMax, - value: _toConsumableArray(axisRange), - valueLabelFormat: function valueLabelFormat(x) { - return x.toFixed(precision); - }, - onChange: function onChange(event, values) { - var range = values.map(function (v) { - return parseFloat(Math.min(Math.max(v, customMin), customMax).toFixed(precision), 10); - }); + value: [...axisRange], + valueLabelFormat: x => x.toFixed(precision), + onChange: (event, values) => { + const range = values.map(v => parseFloat(Math.min(Math.max(v, customMin), customMax).toFixed(precision), 10)); dispatch({ type: 'selectYAxisCustomRange', - axis: axis, - range: range + axis, + range }); } }))); @@ -433,52 +408,45 @@ YAxisRangeOption.propTypes = _propTypes.default.oneOf(['y1', 'y2']).isRequired; /** x Axis - Roll Period Option */ -var RollPeriodOption = function RollPeriodOption() { - var _TimeSeriesViewerCont5 = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont6 = _slicedToArray(_TimeSeriesViewerCont5, 2), - state = _TimeSeriesViewerCont6[0], - dispatch = _TimeSeriesViewerCont6[1]; - var classes = useStyles(_Theme.default); - var selection = state.selection; - var currentRollPeriod = selection.rollPeriod, - selectedTimeStep = selection.timeStep, - autoTimeStep = selection.autoTimeStep; - var currentTimeStep = selectedTimeStep === 'auto' ? autoTimeStep : selectedTimeStep; - var dateRangeMonths = selection.continuousDateRange.length; - var timeStepSeconds = currentTimeStep ? _TimeSeriesViewerContext.TIME_STEPS[currentTimeStep].seconds : 1800; - var rollStepsPerMonth = 30 * 24 * 60 * 60 / timeStepSeconds; - var rollMin = 1; - var rollMax = Math.floor(Math.max(dateRangeMonths * rollStepsPerMonth, currentRollPeriod) / 4); +const RollPeriodOption = () => { + const [state, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const classes = useStyles(_Theme.default); + const { + selection + } = state; + const { + rollPeriod: currentRollPeriod, + timeStep: selectedTimeStep, + autoTimeStep + } = selection; + const currentTimeStep = selectedTimeStep === 'auto' ? autoTimeStep : selectedTimeStep; + const dateRangeMonths = selection.continuousDateRange.length; + const timeStepSeconds = currentTimeStep ? _TimeSeriesViewerContext.TIME_STEPS[currentTimeStep].seconds : 1800; + const rollStepsPerMonth = 30 * 24 * 60 * 60 / timeStepSeconds; + const rollMin = 1; + const rollMax = Math.floor(Math.max(dateRangeMonths * rollStepsPerMonth, currentRollPeriod) / 4); // Local state for the slider value as we change it. This lets us change the value with a // controlled slider component without having to send all updates through the main context reducer - var _useState5 = (0, _react.useState)(currentRollPeriod), - _useState6 = _slicedToArray(_useState5, 2), - activeRollPeriod = _useState6[0], - setActiveRollPeriod = _useState6[1]; - var _useState7 = (0, _react.useState)(false), - _useState8 = _slicedToArray(_useState7, 2), - isActivelySetting = _useState8[0], - setIsActivelySetting = _useState8[1]; - (0, _react.useEffect)(function () { + const [activeRollPeriod, setActiveRollPeriod] = (0, _react.useState)(currentRollPeriod); + const [isActivelySetting, setIsActivelySetting] = (0, _react.useState)(false); + (0, _react.useEffect)(() => { if (activeRollPeriod !== currentRollPeriod && !isActivelySetting) { setActiveRollPeriod(currentRollPeriod); } }, [activeRollPeriod, currentRollPeriod, isActivelySetting, setActiveRollPeriod]); // Determine slider marks - var interimMarks = rollMax - rollMin < 8 ? 2 : 3; - var markValues = [1]; - for (var m = 1; m <= interimMarks; m += 1) { + const interimMarks = rollMax - rollMin < 8 ? 2 : 3; + const markValues = [1]; + for (let m = 1; m <= interimMarks; m += 1) { markValues.push(Math.floor(rollMax * (m / (interimMarks + 1)))); } markValues.push(rollMax); - var marks = markValues.map(function (m) { - return { - value: m, - label: (0, _TimeSeriesViewerContext.summarizeTimeSteps)(m, currentTimeStep) - }; - }); + const marks = markValues.map(m => ({ + value: m, + label: (0, _TimeSeriesViewerContext.summarizeTimeSteps)(m, currentTimeStep) + })); return !currentTimeStep ? /*#__PURE__*/_react.default.createElement(_Skeleton.default, { variant: "rect", width: "100%", @@ -494,18 +462,16 @@ var RollPeriodOption = function RollPeriodOption() { "data-selenium": "time-series-viewer.options.roll-period-slider", value: activeRollPeriod, valueLabelDisplay: "auto", - valueLabelFormat: function valueLabelFormat(x) { - return (0, _TimeSeriesViewerContext.summarizeTimeSteps)(x, currentTimeStep); - }, + valueLabelFormat: x => (0, _TimeSeriesViewerContext.summarizeTimeSteps)(x, currentTimeStep), min: rollMin, max: rollMax, - onMouseDown: function onMouseDown() { + onMouseDown: () => { setIsActivelySetting(true); }, - onChange: function onChange(event, value) { + onChange: (event, value) => { setActiveRollPeriod(Math.min(Math.max(value, rollMin), rollMax)); }, - onChangeCommitted: function onChangeCommitted(event, value) { + onChangeCommitted: (event, value) => { setIsActivelySetting(false); dispatch({ type: 'setRollPeriod', @@ -518,18 +484,19 @@ var RollPeriodOption = function RollPeriodOption() { /** x Axis - Time Step Option */ -var TimeStepOption = function TimeStepOption() { - var classes = useStyles(_Theme.default); - var _TimeSeriesViewerCont7 = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont8 = _slicedToArray(_TimeSeriesViewerCont7, 2), - state = _TimeSeriesViewerCont8[0], - dispatch = _TimeSeriesViewerCont8[1]; - var availableTimeSteps = state.availableTimeSteps; - var selectedTimeStep = state.selection.timeStep; - var handleChangeTimeStep = function handleChangeTimeStep(event, timeStep) { +const TimeStepOption = () => { + const classes = useStyles(_Theme.default); + const [state, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const { + availableTimeSteps + } = state; + const { + timeStep: selectedTimeStep + } = state.selection; + const handleChangeTimeStep = (event, timeStep) => { dispatch({ type: 'selectTimeStep', - timeStep: timeStep + timeStep }); }; return /*#__PURE__*/_react.default.createElement(_ToggleButtonGroup.default, { @@ -543,8 +510,8 @@ var TimeStepOption = function TimeStepOption() { style: { marginBottom: _Theme.default.spacing(3) } - }, Array.from(availableTimeSteps).map(function (timeStep) { - var className = timeStep === selectedTimeStep ? "".concat(classes.optionButton, " ").concat(classes.optionButtonSelected) : classes.optionButton; + }, Array.from(availableTimeSteps).map(timeStep => { + const className = timeStep === selectedTimeStep ? "".concat(classes.optionButton, " ").concat(classes.optionButtonSelected) : classes.optionButton; return /*#__PURE__*/_react.default.createElement(_ToggleButton.default, { key: timeStep, value: timeStep, @@ -557,7 +524,7 @@ var TimeStepOption = function TimeStepOption() { /** Option Titles and Descriptions */ -var OPTIONS = { +const OPTIONS = { Y_AXIS_SCALE: { title: 'Scale', description: 'Toggle between linear and logarithmic scales on all y axes', @@ -566,21 +533,17 @@ var OPTIONS = { Y1_AXIS_RANGE: { title: 'y1 Range', description: 'Set min and max range for y1 axis ({units})', - Component: function Component() { - return /*#__PURE__*/_react.default.createElement(YAxisRangeOption, { - axis: "y1" - }); - }, + Component: () => /*#__PURE__*/_react.default.createElement(YAxisRangeOption, { + axis: "y1" + }), axis: 'y1' }, Y2_AXIS_RANGE: { title: 'y2 Range', description: 'Set min and max range for y2 axis ({units})', - Component: function Component() { - return /*#__PURE__*/_react.default.createElement(YAxisRangeOption, { - axis: "y2" - }); - }, + Component: () => /*#__PURE__*/_react.default.createElement(YAxisRangeOption, { + axis: "y2" + }), axis: 'y2' }, ROLL_PERIOD: { @@ -599,18 +562,19 @@ var OPTIONS = { Main Component */ function TimeSeriesViewerAxes() { - var classes = useStyles(_Theme.default); - var _TimeSeriesViewerCont9 = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont10 = _slicedToArray(_TimeSeriesViewerCont9, 1), - state = _TimeSeriesViewerCont10[0]; - var selection = state.selection; - var renderOption = function renderOption(key) { - var _OPTIONS$key = OPTIONS[key], - title = _OPTIONS$key.title, - rawDescription = _OPTIONS$key.description, - Component = _OPTIONS$key.Component, - axis = _OPTIONS$key.axis; - var description = rawDescription; + const classes = useStyles(_Theme.default); + const [state] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const { + selection + } = state; + const renderOption = key => { + const { + title, + description: rawDescription, + Component, + axis + } = OPTIONS[key]; + let description = rawDescription; if (description.indexOf('{units}') && axis) { description = rawDescription.replace('{units}', selection.yAxes[axis].units); } @@ -628,7 +592,7 @@ function TimeSeriesViewerAxes() { } }, /*#__PURE__*/_react.default.createElement(Component, null))); }; - var hasY2Axis = selection.yAxes.y2.units !== null; + const hasY2Axis = selection.yAxes.y2.units !== null; return /*#__PURE__*/_react.default.createElement("div", { className: classes.optionsContainer }, /*#__PURE__*/_react.default.createElement("div", { diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerContainer.js b/lib/components/TimeSeriesViewer/TimeSeriesViewerContainer.js index f8025646..b25d7d88 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerContainer.js +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerContainer.js @@ -36,131 +36,115 @@ var _TimeSeriesViewerDateRange = _interopRequireDefault(require("./TimeSeriesVie var _TimeSeriesViewerVariables = _interopRequireDefault(require("./TimeSeriesViewerVariables")); var _TimeSeriesViewerAxes = _interopRequireDefault(require("./TimeSeriesViewerAxes")); var _TimeSeriesViewerGraph = _interopRequireDefault(require("./TimeSeriesViewerGraph")); -var _TABS; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } // We can't rely on flex-sizing to work during resize events as some components within tabs // won't be able to shrink correctly on resize (notably: Data Product Availability charts). -var VERTICAL_TABS_WIDTH = 150; -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - tabsContainer: _defineProperty({ - display: 'flex', - margin: theme.spacing(0, -0.5, -0.5, -0.5) - }, theme.breakpoints.down('sm'), { +const VERTICAL_TABS_WIDTH = 150; +const useStyles = (0, _styles.makeStyles)(theme => ({ + tabsContainer: { + display: 'flex', + margin: theme.spacing(0, -0.5, -0.5, -0.5), + [theme.breakpoints.down('sm')]: { flexDirection: 'column' - }), - tabsVertical: { - width: "".concat(VERTICAL_TABS_WIDTH, "px") - }, - tabsHorizontal: { - flexShrink: 0 - }, - tabPanels: _defineProperty({ - width: '100%' - }, theme.breakpoints.up('md'), { + } + }, + tabsVertical: { + width: "".concat(VERTICAL_TABS_WIDTH, "px") + }, + tabsHorizontal: { + flexShrink: 0 + }, + tabPanels: { + width: '100%', + [theme.breakpoints.up('md')]: { width: "calc(100% - ".concat(VERTICAL_TABS_WIDTH, "px)"), borderTop: "1.5px solid ".concat(_Theme.COLORS.GREY[200]) - }), - tabPanelContainer: { - padding: theme.spacing(2.5), - width: '100%' - }, - graphContainer: { - zIndex: 0, - position: 'relative', - marginBottom: theme.spacing(2), - padding: theme.spacing(0.5), - borderWidth: '1.5px' - }, - graphOverlay: { - display: 'block', - position: 'absolute', - width: 'calc(100% + 8px)', - height: 'calc(100% + 2px)', - textAlign: 'center', - top: 0, - left: 0, - zIndex: 10, - margin: theme.spacing(-0.5, -0.5, 0, -0.5), - padding: theme.spacing(20, 4, 4, 4), - backgroundColor: 'rgba(255, 255, 255, 0.75)', - '& .MuiTypography-root': { - boxShadow: '0px 0px 20px 25px #fff', - backgroundColor: '#fff' - } - }, - titleContainer: { - marginBottom: theme.spacing(2) - }, - summaryDiv: { - marginBottom: theme.spacing(1) - }, - axisTitle: { - fontWeight: 600, - paddingLeft: '0px', - paddingRight: theme.spacing(1) - }, - axisSettings: { - display: 'flex', - justifyContent: 'flex-start', - flexWrap: 'wrap' - }, - axisSettingTitle: { - textTransform: 'uppercase', - color: theme.palette.grey[300], - fontWeight: 700, - fontSize: '85%', - marginRight: _Theme.default.spacing(1) - }, - errorIcon: { - color: _Theme.default.colors.RED[400] - }, - warningIcon: { - color: _Theme.default.colors.GOLD[500] - }, - releaseChip: { - color: _Theme.default.colors.LIGHT_BLUE[600], - border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[600]), - backgroundColor: _Theme.default.colors.LIGHT_BLUE[50], - fontWeight: 600, - cursor: 'help', - marginTop: _Theme.default.spacing(0.5) - }, - startFlex: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center' } - }; -}); -var useTabsStyles = (0, _styles.makeStyles)(function (theme) { - return { - scroller: _defineProperty({}, theme.breakpoints.up('md'), { + }, + tabPanelContainer: { + padding: theme.spacing(2.5), + width: '100%' + }, + graphContainer: { + zIndex: 0, + position: 'relative', + marginBottom: theme.spacing(2), + padding: theme.spacing(0.5), + borderWidth: '1.5px' + }, + graphOverlay: { + display: 'block', + position: 'absolute', + width: 'calc(100% + 8px)', + height: 'calc(100% + 2px)', + textAlign: 'center', + top: 0, + left: 0, + zIndex: 10, + margin: theme.spacing(-0.5, -0.5, 0, -0.5), + padding: theme.spacing(20, 4, 4, 4), + backgroundColor: 'rgba(255, 255, 255, 0.75)', + '& .MuiTypography-root': { + boxShadow: '0px 0px 20px 25px #fff', + backgroundColor: '#fff' + } + }, + titleContainer: { + marginBottom: theme.spacing(2) + }, + summaryDiv: { + marginBottom: theme.spacing(1) + }, + axisTitle: { + fontWeight: 600, + paddingLeft: '0px', + paddingRight: theme.spacing(1) + }, + axisSettings: { + display: 'flex', + justifyContent: 'flex-start', + flexWrap: 'wrap' + }, + axisSettingTitle: { + textTransform: 'uppercase', + color: theme.palette.grey[300], + fontWeight: 700, + fontSize: '85%', + marginRight: _Theme.default.spacing(1) + }, + errorIcon: { + color: _Theme.default.colors.RED[400] + }, + warningIcon: { + color: _Theme.default.colors.GOLD[500] + }, + releaseChip: { + color: _Theme.default.colors.LIGHT_BLUE[600], + border: "1px solid ".concat(_Theme.default.colors.LIGHT_BLUE[600]), + backgroundColor: _Theme.default.colors.LIGHT_BLUE[50], + fontWeight: 600, + cursor: 'help', + marginTop: _Theme.default.spacing(0.5) + }, + startFlex: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center' + } +})); +const useTabsStyles = (0, _styles.makeStyles)(theme => ({ + scroller: { + [theme.breakpoints.up('md')]: { backgroundColor: theme.palette.grey[200] - }) - }; -}); -var useTabStyles = (0, _styles.makeStyles)(function (theme) { - var _root, _selected; - return { - root: (_root = {}, _defineProperty(_root, theme.breakpoints.up('md'), { + } + } +})); +const useTabStyles = (0, _styles.makeStyles)(theme => ({ + root: { + [theme.breakpoints.up('md')]: { marginLeft: '-1.5px', '&:first-child': { marginBottom: '-0.5px' @@ -168,56 +152,62 @@ var useTabStyles = (0, _styles.makeStyles)(function (theme) { '&:not(:first-child)': { marginTop: '-1.5px' } - }), _defineProperty(_root, theme.breakpoints.down('sm'), { + }, + [theme.breakpoints.down('sm')]: { paddingRight: theme.spacing(2.5), '&:not(:first-child)': { marginLeft: '-1.5px' } - }), _defineProperty(_root, "textTransform", 'none'), _defineProperty(_root, "opacity", 1), _root), - labelIcon: _defineProperty({ - minHeight: theme.spacing(8), - minWidth: theme.spacing(15) - }, theme.breakpoints.down('sm'), { + }, + textTransform: 'none', + opacity: 1 + }, + labelIcon: { + minHeight: theme.spacing(8), + minWidth: theme.spacing(15), + [theme.breakpoints.down('sm')]: { minHeight: theme.spacing(6), minWidth: theme.spacing(17) - }), - wrapper: { - display: 'flex', - flexDirection: 'row', - alignItems: 'center', - justifyContent: 'center', - '& svg': { - margin: "".concat(theme.spacing(0, 1, 0, 0), " !important") - } - }, - selected: (_selected = {}, _defineProperty(_selected, theme.breakpoints.down('sm'), { + } + }, + wrapper: { + display: 'flex', + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + '& svg': { + margin: "".concat(theme.spacing(0, 1, 0, 0), " !important") + } + }, + selected: { + [theme.breakpoints.down('sm')]: { borderBottom: 'none' - }), _defineProperty(_selected, theme.breakpoints.up('md'), { + }, + [theme.breakpoints.up('md')]: { borderRight: 'none', marginLeft: '0px' - }), _selected) - }; -}); + } + } +})); /** Summary Component */ function TimeSeriesViewerSummary() { - var classes = useStyles(_Theme.default); - var _TimeSeriesViewerCont = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont2 = _slicedToArray(_TimeSeriesViewerCont, 1), - state = _TimeSeriesViewerCont2[0]; - var _state$selection = state.selection, - sites = _state$selection.sites, - dateRange = _state$selection.dateRange, - variables = _state$selection.variables, - timeStep = _state$selection.timeStep, - autoTimeStep = _state$selection.autoTimeStep, - logscale = _state$selection.logscale, - qualityFlags = _state$selection.qualityFlags, - rollPeriod = _state$selection.rollPeriod, - yAxes = _state$selection.yAxes; - var skeletonProps = { + const classes = useStyles(_Theme.default); + const [state] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const { + sites, + dateRange, + variables, + timeStep, + autoTimeStep, + logscale, + qualityFlags, + rollPeriod, + yAxes + } = state.selection; + const skeletonProps = { variant: 'rect', height: 10, style: { @@ -227,13 +217,13 @@ function TimeSeriesViewerSummary() { }; // Product - var productHref = _RouteService.default.getProductDetailPath(state.product.productCode); - var productSummaryTitle = /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, { + const productHref = _RouteService.default.getProductDetailPath(state.product.productCode); + let productSummaryTitle = /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "h6" }, "Data Product"), /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body2" }, state.product.productCode)); - var productSummaryDescription = /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Skeleton.default, _extends({}, skeletonProps, { + let productSummaryDescription = /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Skeleton.default, _extends({}, skeletonProps, { width: 200 })), /*#__PURE__*/_react.default.createElement(_Skeleton.default, _extends({}, skeletonProps, { width: "100%" @@ -270,18 +260,16 @@ function TimeSeriesViewerSummary() { } // Release - var useReleaseChip = state.release !== null; - var latestRelease = null; + const useReleaseChip = state.release !== null; + let latestRelease = null; if (state.releases && state.releases.length) { - var sortedReleases = _toConsumableArray(state.releases).sort(function (a, b) { - return a.generationDate > b.generationDate ? -1 : 1; - }); + const sortedReleases = [...state.releases].sort((a, b) => a.generationDate > b.generationDate ? -1 : 1); latestRelease = sortedReleases[0].release; } - var latestReleaseClause = useReleaseChip ? '' : " (release: ".concat(latestRelease || 'unknown', ")"); - var releaseTooltip = state.release === null ? "You are viewing only the latest released and provisional data (release: ".concat(latestRelease || 'unknown', ").") : "You are viewing product data only from the ".concat(state.release, " release (no provisional data will be included)."); - var releaseChipLabel = state.release === null ? "Latest released and provisional data".concat(latestReleaseClause) : "".concat(state.release); - var releaseSummary = !useReleaseChip ? /*#__PURE__*/_react.default.createElement(_Typography.default, { + const latestReleaseClause = useReleaseChip ? '' : " (release: ".concat(latestRelease || 'unknown', ")"); + const releaseTooltip = state.release === null ? "You are viewing only the latest released and provisional data (release: ".concat(latestRelease || 'unknown', ").") : "You are viewing product data only from the ".concat(state.release, " release (no provisional data will be included)."); + const releaseChipLabel = state.release === null ? "Latest released and provisional data".concat(latestReleaseClause) : "".concat(state.release); + const releaseSummary = !useReleaseChip ? /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body2", key: releaseChipLabel }, releaseChipLabel) : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_ReleaseChip.default, { @@ -296,11 +284,13 @@ function TimeSeriesViewerSummary() { })); // Sites - var sitesSummary = !sites.length ? /*#__PURE__*/_react.default.createElement(_Skeleton.default, _extends({}, skeletonProps, { + const sitesSummary = !sites.length ? /*#__PURE__*/_react.default.createElement(_Skeleton.default, _extends({}, skeletonProps, { width: 175 - })) : sites.map(function (site) { - var siteCode = site.siteCode, - positions = site.positions; + })) : sites.map(site => { + const { + siteCode, + positions + } = site; return /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body2", key: siteCode @@ -308,18 +298,16 @@ function TimeSeriesViewerSummary() { }); // Date Range - var dateRangeSummary = /*#__PURE__*/_react.default.createElement(_Skeleton.default, _extends({}, skeletonProps, { + let dateRangeSummary = /*#__PURE__*/_react.default.createElement(_Skeleton.default, _extends({}, skeletonProps, { width: 300 })); if (dateRange.length === 2 && dateRange[0] && dateRange[1]) { - var pluralize = function pluralize(val, unit) { - return val === 1 ? "".concat(val, " ").concat(unit) : "".concat(val, " ").concat(unit, "s"); - }; - var startMoment = (0, _moment.default)("".concat(dateRange[0], "-15")); - var endMoment = (0, _moment.default)("".concat(dateRange[1], "-15")); - var months = Math.ceil(endMoment.diff(startMoment, 'months', true)) + 1; - var years = Math.floor(months / 12); - var diff = "".concat(pluralize(months, 'month')); + const pluralize = (val, unit) => val === 1 ? "".concat(val, " ").concat(unit) : "".concat(val, " ").concat(unit, "s"); + const startMoment = (0, _moment.default)("".concat(dateRange[0], "-15")); + const endMoment = (0, _moment.default)("".concat(dateRange[1], "-15")); + const months = Math.ceil(endMoment.diff(startMoment, 'months', true)) + 1; + const years = Math.floor(months / 12); + let diff = "".concat(pluralize(months, 'month')); if (years > 0) { diff = !(months % 12) ? "".concat(pluralize(years, 'year')) : "".concat(pluralize(years, 'year'), ", ").concat(pluralize(months % 12, 'month')); } @@ -329,7 +317,7 @@ function TimeSeriesViewerSummary() { } // Variables - var variablesSummary = !variables.length ? /*#__PURE__*/_react.default.createElement(_Skeleton.default, _extends({}, skeletonProps, { + const variablesSummary = !variables.length ? /*#__PURE__*/_react.default.createElement(_Skeleton.default, _extends({}, skeletonProps, { width: 250 })) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body2" @@ -338,12 +326,12 @@ function TimeSeriesViewerSummary() { }, "Quality flags: ".concat(qualityFlags.join(', '))) : null); // Axes - var axes = { + const axes = { x: [], y1: [], y2: [] }; - var currentTimeStep = timeStep === 'auto' ? "Auto (".concat(autoTimeStep, ")") : timeStep; + const currentTimeStep = timeStep === 'auto' ? "Auto (".concat(autoTimeStep, ")") : timeStep; axes.x.push({ title: 'Time step', value: currentTimeStep @@ -354,7 +342,7 @@ function TimeSeriesViewerSummary() { value: (0, _TimeSeriesViewerContext.summarizeTimeSteps)(rollPeriod, currentTimeStep, false) }); } - Object.keys(yAxes).forEach(function (yAxis) { + Object.keys(yAxes).forEach(yAxis => { if (yAxes[yAxis].units !== null) { axes[yAxis].push({ title: 'Scale', @@ -364,26 +352,24 @@ function TimeSeriesViewerSummary() { title: 'Units', value: yAxes[yAxis].units }); - var rangeMode = _TimeSeriesViewerContext.Y_AXIS_RANGE_MODE_DETAILS[yAxes[yAxis].rangeMode].name; - var range = "".concat(rangeMode, " (").concat(yAxes[yAxis].axisRange[0].toString(), " - ").concat(yAxes[yAxis].axisRange[1].toString(), " ").concat(yAxes[yAxis].units, ")"); + const rangeMode = _TimeSeriesViewerContext.Y_AXIS_RANGE_MODE_DETAILS[yAxes[yAxis].rangeMode].name; + const range = "".concat(rangeMode, " (").concat(yAxes[yAxis].axisRange[0].toString(), " - ").concat(yAxes[yAxis].axisRange[1].toString(), " ").concat(yAxes[yAxis].units, ")"); axes[yAxis].push({ title: 'Range', value: range }); } }); - var renderAxisSetting = function renderAxisSetting(setting) { - return /*#__PURE__*/_react.default.createElement("div", { - key: setting.title, - style: { - marginRight: _Theme.default.spacing(2), - whiteSpace: 'nowrap' - } - }, /*#__PURE__*/_react.default.createElement("span", { - className: classes.axisSettingTitle - }, "".concat(setting.title, ":")), setting.value); - }; - var axesSummary = /*#__PURE__*/_react.default.createElement(_Table.default, { + const renderAxisSetting = setting => /*#__PURE__*/_react.default.createElement("div", { + key: setting.title, + style: { + marginRight: _Theme.default.spacing(2), + whiteSpace: 'nowrap' + } + }, /*#__PURE__*/_react.default.createElement("span", { + className: classes.axisSettingTitle + }, "".concat(setting.title, ":")), setting.value); + const axesSummary = /*#__PURE__*/_react.default.createElement(_Table.default, { size: "small" }, /*#__PURE__*/_react.default.createElement(_TableBody.default, null, /*#__PURE__*/_react.default.createElement(_TableRow.default, null, /*#__PURE__*/_react.default.createElement(_TableCell.default, { className: classes.axisTitle @@ -426,66 +412,64 @@ function TimeSeriesViewerSummary() { /** Define Tabs */ -var TAB_IDS = { +const TAB_IDS = { SUMMARY: 'SUMMARY', SITES: 'SITES', DATE_RANGE: 'DATE_RANGE', VARIABLES: 'VARIABLES', AXES: 'AXES' }; -var TABS = (_TABS = {}, _defineProperty(_TABS, TAB_IDS.SUMMARY, { - label: 'SUMMARY', - ariaLabel: 'Summary', - Icon: _Toc.default, - Component: TimeSeriesViewerSummary -}), _defineProperty(_TABS, TAB_IDS.SITES, { - // eslint-disable-next-line react/jsx-one-expression-per-line - label: /*#__PURE__*/_react.default.createElement("span", null, "SITES &", /*#__PURE__*/_react.default.createElement("br", null), "POSITIONS"), - ariaLabel: 'Sites and Positions', - Icon: _Place.default, - Component: _TimeSeriesViewerSites.default -}), _defineProperty(_TABS, TAB_IDS.DATE_RANGE, { - label: 'DATE RANGE', - ariaLabel: 'Date Range', - Icon: _DateRange.default, - Component: _TimeSeriesViewerDateRange.default -}), _defineProperty(_TABS, TAB_IDS.VARIABLES, { - label: 'VARIABLES', - ariaLabel: 'Variables', - Icon: _Timeline.default, - Component: _TimeSeriesViewerVariables.default -}), _defineProperty(_TABS, TAB_IDS.AXES, { - label: 'x/y AXES', - ariaLabel: 'x/y Axes', - Icon: _BorderInner.default, - Component: _TimeSeriesViewerAxes.default -}), _TABS); -var DEFAULT_TAB = 'SUMMARY'; +const TABS = { + [TAB_IDS.SUMMARY]: { + label: 'SUMMARY', + ariaLabel: 'Summary', + Icon: _Toc.default, + Component: TimeSeriesViewerSummary + }, + [TAB_IDS.SITES]: { + // eslint-disable-next-line react/jsx-one-expression-per-line + label: /*#__PURE__*/_react.default.createElement("span", null, "SITES &", /*#__PURE__*/_react.default.createElement("br", null), "POSITIONS"), + ariaLabel: 'Sites and Positions', + Icon: _Place.default, + Component: _TimeSeriesViewerSites.default + }, + [TAB_IDS.DATE_RANGE]: { + label: 'DATE RANGE', + ariaLabel: 'Date Range', + Icon: _DateRange.default, + Component: _TimeSeriesViewerDateRange.default + }, + [TAB_IDS.VARIABLES]: { + label: 'VARIABLES', + ariaLabel: 'Variables', + Icon: _Timeline.default, + Component: _TimeSeriesViewerVariables.default + }, + [TAB_IDS.AXES]: { + label: 'x/y AXES', + ariaLabel: 'x/y Axes', + Icon: _BorderInner.default, + Component: _TimeSeriesViewerAxes.default + } +}; +const DEFAULT_TAB = 'SUMMARY'; function TimeSeriesViewerContainer() { - var classes = useStyles(_Theme.default); - var tabClasses = useTabStyles(_Theme.default); - var tabsClasses = useTabsStyles(_Theme.default); - var _TimeSeriesViewerCont3 = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont4 = _slicedToArray(_TimeSeriesViewerCont3, 1), - state = _TimeSeriesViewerCont4[0]; - var belowMd = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('sm')); + const classes = useStyles(_Theme.default); + const tabClasses = useTabStyles(_Theme.default); + const tabsClasses = useTabsStyles(_Theme.default); + const [state] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const belowMd = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('sm')); // console.log('TIME SERIES VIEWER STATE:', state); - var initialTab = DEFAULT_TAB; - var _useState = (0, _react.useState)(initialTab), - _useState2 = _slicedToArray(_useState, 2), - selectedTab = _useState2[0], - setSelectedTab = _useState2[1]; - var _useState3 = (0, _react.useState)(state.product.productCode), - _useState4 = _slicedToArray(_useState3, 2), - loadedProductCode = _useState4[0], - setLoadedProductCode = _useState4[1]; + const initialTab = DEFAULT_TAB; + const [selectedTab, setSelectedTab] = (0, _react.useState)(initialTab); + const [loadedProductCode, setLoadedProductCode] = (0, _react.useState)(state.product.productCode); // Effect to handle a reinitialize event from the context. We track the loaded product code // separate from the context product code so when the latter changes we know to reset the // tab to SUMMARY and completely unmount and remount the TimeSeriesGraph. - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (state.product.productCode === loadedProductCode) { return; } @@ -495,71 +479,70 @@ function TimeSeriesViewerContainer() { // Slider position is not controlled in state because doing so kills mouse drag performance. // Use a ref to deterministically set slider position for all slider-based features. - var dateRangeSliderRef = (0, _react.useRef)(null); - var renderTabs = function renderTabs() { - return /*#__PURE__*/_react.default.createElement(_Tabs.default, { - orientation: belowMd ? 'horizontal' : 'vertical', - scrollButtons: belowMd ? 'on' : 'auto', - variant: "scrollable", - value: selectedTab, - className: belowMd ? classes.tabsHorizontal : classes.tabsVertical, - classes: tabsClasses, - "aria-label": "Time Series Viewer Controls", - onChange: function onChange(event, newTab) { - setSelectedTab(newTab); - }, - TabIndicatorProps: { - style: { - display: 'none' - } + const dateRangeSliderRef = (0, _react.useRef)(null); + const renderTabs = () => /*#__PURE__*/_react.default.createElement(_Tabs.default, { + orientation: belowMd ? 'horizontal' : 'vertical', + scrollButtons: belowMd ? 'on' : 'auto', + variant: "scrollable", + value: selectedTab, + className: belowMd ? classes.tabsHorizontal : classes.tabsVertical, + classes: tabsClasses, + "aria-label": "Time Series Viewer Controls", + onChange: (event, newTab) => { + setSelectedTab(newTab); + }, + TabIndicatorProps: { + style: { + display: 'none' } - }, Object.keys(TABS).map(function (tabId) { - var _TABS$tabId = TABS[tabId], - label = _TABS$tabId.label, - ariaLabel = _TABS$tabId.ariaLabel, - TabIcon = _TABS$tabId.Icon; - return /*#__PURE__*/_react.default.createElement(_Tab.default, { - key: tabId, - value: tabId, - label: label, - "aria-label": ariaLabel || label, - icon: /*#__PURE__*/_react.default.createElement(TabIcon, null), - classes: tabClasses, - id: "time-series-viewer-tab-".concat(tabId), - "aria-controls": "time-series-viewer-tabpanel-".concat(tabId) - }); - })); - }; - var renderTabPanels = function renderTabPanels() { - return /*#__PURE__*/_react.default.createElement("div", { - className: classes.tabPanels - }, Object.keys(TABS).map(function (tabId) { - var TabComponent = TABS[tabId].Component; - var tabComponentProps = { - setSelectedTab: setSelectedTab, - TAB_IDS: TAB_IDS + } + }, Object.keys(TABS).map(tabId => { + const { + label, + ariaLabel, + Icon: TabIcon + } = TABS[tabId]; + return /*#__PURE__*/_react.default.createElement(_Tab.default, { + key: tabId, + value: tabId, + label: label, + "aria-label": ariaLabel || label, + icon: /*#__PURE__*/_react.default.createElement(TabIcon, null), + classes: tabClasses, + id: "time-series-viewer-tab-".concat(tabId), + "aria-controls": "time-series-viewer-tabpanel-".concat(tabId) + }); + })); + const renderTabPanels = () => /*#__PURE__*/_react.default.createElement("div", { + className: classes.tabPanels + }, Object.keys(TABS).map(tabId => { + const { + Component: TabComponent + } = TABS[tabId]; + let tabComponentProps = { + setSelectedTab, + TAB_IDS + }; + if (tabId === TAB_IDS.DATE_RANGE) { + tabComponentProps = { + dateRangeSliderRef }; - if (tabId === TAB_IDS.DATE_RANGE) { - tabComponentProps = { - dateRangeSliderRef: dateRangeSliderRef - }; - } - return /*#__PURE__*/_react.default.createElement("div", { - key: tabId, - role: "tabpanel", - id: "time-series-viewer-tabpanel-".concat(tabId), - "aria-labelledby": "time-series-viewer-tab-".concat(tabId), - style: { - display: selectedTab === tabId ? 'block' : 'none' - }, - className: classes.tabPanelContainer - }, /*#__PURE__*/_react.default.createElement(TabComponent, tabComponentProps)); - })); - }; - var renderGraphOverlay = function renderGraphOverlay() { - var isError = state.status === _constants.TIME_SERIES_VIEWER_STATUS.ERROR; - var isWarning = state.status === _constants.TIME_SERIES_VIEWER_STATUS.WARNING; - var isLoading = !isError && state.status !== _constants.TIME_SERIES_VIEWER_STATUS.READY; + } + return /*#__PURE__*/_react.default.createElement("div", { + key: tabId, + role: "tabpanel", + id: "time-series-viewer-tabpanel-".concat(tabId), + "aria-labelledby": "time-series-viewer-tab-".concat(tabId), + style: { + display: selectedTab === tabId ? 'block' : 'none' + }, + className: classes.tabPanelContainer + }, /*#__PURE__*/_react.default.createElement(TabComponent, tabComponentProps)); + })); + const renderGraphOverlay = () => { + const isError = state.status === _constants.TIME_SERIES_VIEWER_STATUS.ERROR; + const isWarning = state.status === _constants.TIME_SERIES_VIEWER_STATUS.WARNING; + const isLoading = !isError && state.status !== _constants.TIME_SERIES_VIEWER_STATUS.READY; if (isError || isWarning) { return /*#__PURE__*/_react.default.createElement("div", { className: classes.graphOverlay @@ -573,14 +556,14 @@ function TimeSeriesViewerContainer() { className: classes[isError ? 'errorIcon' : 'warningIcon'] })); } - var isLoadingData = isLoading && state.status === _constants.TIME_SERIES_VIEWER_STATUS.LOADING_DATA; + const isLoadingData = isLoading && state.status === _constants.TIME_SERIES_VIEWER_STATUS.LOADING_DATA; if (isLoading) { - var title = _TimeSeriesViewerContext.TIME_SERIES_VIEWER_STATUS_TITLES[state.status] || 'Loading…'; - var progressProps = { + let title = _TimeSeriesViewerContext.TIME_SERIES_VIEWER_STATUS_TITLES[state.status] || 'Loading…'; + const progressProps = { variant: 'indeterminate' }; if (isLoadingData) { - var progress = Math.floor(state.dataFetchProgress || 0); + const progress = Math.floor(state.dataFetchProgress || 0); progressProps.variant = 'determinate'; progressProps.value = progress; title = "".concat(title, " (").concat(progress, "%)"); diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerContext.js b/lib/components/TimeSeriesViewer/TimeSeriesViewerContext.js index ef4916eb..bd2bef13 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerContext.js +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerContext.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -24,37 +23,28 @@ var _DataPackageParser = _interopRequireDefault(require("../../parser/DataPackag var _NeonSignInButtonState = _interopRequireDefault(require("../NeonSignInButton/NeonSignInButtonState")); var _StateStorageService = _interopRequireDefault(require("../../service/StateStorageService")); var _StateStorageConverter = require("./StateStorageConverter"); +var _requestUtil = require("../../util/requestUtil"); var _constants = require("./constants"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } // 'get' is a reserved word so can't be imported with import // eslint-disable-next-line import/extensions -var lodashGet = require('lodash/get.js'); -var VIEWER_MODE = { +const lodashGet = require('lodash/get.js'); +const VIEWER_MODE = { DEFAULT: 'DEFAULT', STATIC: 'STATIC' }; // Every possible status a single fetch request can have -var FETCH_STATUS = { +const FETCH_STATUS = { AWAITING_CALL: 'AWAITING_CALL', FETCHING: 'FETCHING', ERROR: 'ERROR', SUCCESS: 'SUCCESS' }; -var TIME_SERIES_VIEWER_STATUS_TITLES = { +const TIME_SERIES_VIEWER_STATUS_TITLES = exports.TIME_SERIES_VIEWER_STATUS_TITLES = { INIT_PRODUCT: 'Loading data product…', LOADING_META: 'Loading site positions, variables, and data paths…', READY_FOR_DATA: 'Loading series data…', @@ -65,17 +55,15 @@ var TIME_SERIES_VIEWER_STATUS_TITLES = { }; // List of common date-time variable names to use for the x axis ordered by preference -exports.TIME_SERIES_VIEWER_STATUS_TITLES = TIME_SERIES_VIEWER_STATUS_TITLES; -var PREFERRED_DATETIME_VARIABLES = ['startDateTime', 'endDateTime', 'startDate', 'endDate']; +const PREFERRED_DATETIME_VARIABLES = ['startDateTime', 'endDateTime', 'startDate', 'endDate']; // Keys, details, and supporting functions for all possible Y-axis range modes -var Y_AXIS_RANGE_MODES = { +const Y_AXIS_RANGE_MODES = exports.Y_AXIS_RANGE_MODES = { CENTERED: 'CENTERED', FROM_ZERO: 'FROM_ZERO', CUSTOM: 'CUSTOM' }; -exports.Y_AXIS_RANGE_MODES = Y_AXIS_RANGE_MODES; -var Y_AXIS_RANGE_MODE_DETAILS = { +const Y_AXIS_RANGE_MODE_DETAILS = exports.Y_AXIS_RANGE_MODE_DETAILS = { CENTERED: { name: 'Centered', description: 'Center data by one standard deviation above and below' @@ -89,17 +77,15 @@ var Y_AXIS_RANGE_MODE_DETAILS = { description: 'Manually define a minimum and maximum axis range' } }; -exports.Y_AXIS_RANGE_MODE_DETAILS = Y_AXIS_RANGE_MODE_DETAILS; -var generateYAxisRange = function generateYAxisRange() { - var axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var rangeMode = axis.rangeMode, - _axis$dataRange = axis.dataRange, - dataRange = _axis$dataRange === void 0 ? [0, 0] : _axis$dataRange, - _axis$standardDeviati = axis.standardDeviation, - standardDeviation = _axis$standardDeviati === void 0 ? 0 : _axis$standardDeviati, - _axis$precision = axis.precision, - precision = _axis$precision === void 0 ? 0 : _axis$precision, - axisRange = axis.axisRange; +const generateYAxisRange = function () { + let axis = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const { + rangeMode, + dataRange = [0, 0], + standardDeviation = 0, + precision = 0, + axisRange + } = axis; if (!Object.keys(Y_AXIS_RANGE_MODES).includes(rangeMode) || !Number.isFinite(standardDeviation) || !Number.isFinite(precision)) { return axisRange; } @@ -107,14 +93,14 @@ var generateYAxisRange = function generateYAxisRange() { // and below our high and low values of our data range. Edge cases for when stddev is zero: // * Data range is flat at zero: margin of 1 // * Data range is flat at another value: margin of half the absolute value above and below - var margin = 1; + let margin = 1; if (standardDeviation !== 0) { margin = standardDeviation; } else if (dataRange[0] !== 0) { margin = Math.abs(dataRange[0] / 2); } - var low = (dataRange[0] || 0) - margin; - var high = (dataRange[1] || 0) + margin; + let low = (dataRange[0] || 0) - margin; + let high = (dataRange[1] || 0) + margin; low = parseFloat(low.toFixed(precision), 10); high = parseFloat(high.toFixed(precision), 10); if (rangeMode === Y_AXIS_RANGE_MODES.FROM_ZERO) { @@ -129,7 +115,7 @@ var generateYAxisRange = function generateYAxisRange() { // PropTypes for any Tab Component (or component within a tab) for gettingsetSelectedTab // and TAB_IDS as props. This is used by anything in a tab wanting to afford the ability to // route the user to another tab. -var TabComponentPropTypes = { +const TabComponentPropTypes = exports.TabComponentPropTypes = { setSelectedTab: _propTypes.default.func.isRequired, TAB_IDS: _propTypes.default.objectOf(_propTypes.default.string).isRequired }; @@ -137,8 +123,7 @@ var TabComponentPropTypes = { /** Context and Hook Setup */ -exports.TabComponentPropTypes = TabComponentPropTypes; -var DEFAULT_AXIS_STATE = { +const DEFAULT_AXIS_STATE = { units: null, logscale: false, dataRange: [null, null], @@ -147,7 +132,7 @@ var DEFAULT_AXIS_STATE = { rangeMode: Y_AXIS_RANGE_MODES.CENTERED, axisRange: [0, 0] }; -var DEFAULT_STATE = { +const DEFAULT_STATE = exports.DEFAULT_STATE = { mode: VIEWER_MODE.DEFAULT, status: _constants.TIME_SERIES_VIEWER_STATUS.INIT_PRODUCT, displayError: null, @@ -207,12 +192,11 @@ var DEFAULT_STATE = { availableQualityFlags: new Set(), availableTimeSteps: new Set(['auto']) }; -exports.DEFAULT_STATE = DEFAULT_STATE; -var Context = /*#__PURE__*/(0, _react.createContext)((0, _cloneDeep.default)(DEFAULT_STATE)); -var useTimeSeriesViewerState = function useTimeSeriesViewerState() { - var hookResponse = (0, _react.useContext)(Context); +const Context = /*#__PURE__*/(0, _react.createContext)((0, _cloneDeep.default)(DEFAULT_STATE)); +const useTimeSeriesViewerState = () => { + const hookResponse = (0, _react.useContext)(Context); if (hookResponse.length !== 2) { - return [(0, _cloneDeep.default)(DEFAULT_STATE), function () {}]; + return [(0, _cloneDeep.default)(DEFAULT_STATE), () => {}]; } return hookResponse; }; @@ -220,7 +204,7 @@ var useTimeSeriesViewerState = function useTimeSeriesViewerState() { /** Time Step Definitions and Functions */ -var TIME_STEPS = { +const TIME_STEPS = exports.TIME_STEPS = { '1min': { key: '1min', matchFileTableSuffix: ['1min', '1_min', '1minute', '1_minute'], @@ -270,96 +254,69 @@ var TIME_STEPS = { seconds: 86400 } }; -exports.TIME_STEPS = TIME_STEPS; -var getTimeStep = function getTimeStep() { - var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - return Object.keys(TIME_STEPS).find(function (key) { - return TIME_STEPS[key].tmi === input; - }) || null; +const getTimeStep = function () { + let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + return Object.keys(TIME_STEPS).find(key => TIME_STEPS[key].tmi === input) || null; }; -var matchTimeStepForTableName = function matchTimeStepForTableName(key) { - var tableName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; - var allowDefaultFallthrough = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - return tableName.endsWith("_".concat(key)) || TIME_STEPS[key].matchFileTableSuffix.some(function (suffix) { - return tableName.endsWith("_".concat(suffix)); - }) || allowDefaultFallthrough; +const matchTimeStepForTableName = function (key) { + let tableName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + let allowDefaultFallthrough = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + return tableName.endsWith("_".concat(key)) || TIME_STEPS[key].matchFileTableSuffix.some(suffix => tableName.endsWith("_".concat(suffix))) || allowDefaultFallthrough; }; -var getTimeStepForTableName = function getTimeStepForTableName() { - var tableName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var useDefault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - return Object.keys(TIME_STEPS).find(function (key) { - return matchTimeStepForTableName(key, tableName); - }) || (useDefault ? 'default' : null); +const getTimeStepForTableName = function () { + let tableName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + let useDefault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + return Object.keys(TIME_STEPS).find(key => matchTimeStepForTableName(key, tableName)) || (useDefault ? 'default' : null); }; -var summarizeTimeSteps = function summarizeTimeSteps(steps) { - var timeStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var pluralize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; +const summarizeTimeSteps = function (steps) { + let timeStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let pluralize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; if (steps === 1) { return 'none'; } - var timeStepSeconds = timeStep && TIME_STEPS[timeStep] ? TIME_STEPS[timeStep].seconds : 1800; - var seconds = steps * timeStepSeconds; - var breaks = [60, 3600, 86400, 2592000, 31536000]; - var intervals = ['minute', 'hour', 'day', 'month', 'year']; - var breakIdx = breaks.reduce(function (acc, cur, idx) { - return seconds > cur ? idx : acc; - }, 0); - var value = (seconds / breaks[breakIdx]).toFixed(1); + const timeStepSeconds = timeStep && TIME_STEPS[timeStep] ? TIME_STEPS[timeStep].seconds : 1800; + const seconds = steps * timeStepSeconds; + const breaks = [60, 3600, 86400, 2592000, 31536000]; + const intervals = ['minute', 'hour', 'day', 'month', 'year']; + const breakIdx = breaks.reduce((acc, cur, idx) => seconds > cur ? idx : acc, 0); + let value = (seconds / breaks[breakIdx]).toFixed(1); if (value.slice(value.length - 1) === '0') { value = value.slice(0, value.length - 2); } - var plural = pluralize ? 's' : ''; + const plural = pluralize ? 's' : ''; return "".concat(value, " ").concat(intervals[breakIdx]).concat(plural); }; // Array offsets and validators for use when splitting a data file URL exports.summarizeTimeSteps = summarizeTimeSteps; -var DATA_FILE_PARTS = { +const DATA_FILE_PARTS = { POSITION_H: { offset: 6, - isValid: function isValid(p) { - return /^[\d]{3}$/.test(p); - } + isValid: p => /^[\d]{3}$/.test(p) }, POSITION_V: { offset: 7, - isValid: function isValid(p) { - return /^[\d]{3}$/.test(p); - } + isValid: p => /^[\d]{3}$/.test(p) }, TIME_STEP: { offset: 8, - isValid: function isValid(p) { - return Object.keys(TIME_STEPS).some(function (t) { - return TIME_STEPS[t].tmi === p; - }); - } + isValid: p => Object.keys(TIME_STEPS).some(t => TIME_STEPS[t].tmi === p) }, TABLE: { offset: 9, - isValid: function isValid(p) { - return /^[\w]+$/.test(p) && Object.keys(TIME_STEPS).some(function (key) { - return matchTimeStepForTableName(key, p, true); - }); - } + isValid: p => /^[\w]+$/.test(p) && Object.keys(TIME_STEPS).some(key => matchTimeStepForTableName(key, p, true)) }, MONTH: { offset: 10, - isValid: function isValid(p) { - return /^[\d]{4}-[\d]{2}$/.test(p); - } + isValid: p => /^[\d]{4}-[\d]{2}$/.test(p) }, PACKAGE_TYPE: { offset: 11, - isValid: function isValid(p) { - return ['basic', 'expanded'].includes(p); - } + isValid: p => ['basic', 'expanded'].includes(p) }, EXTENSION: { offset: 13, - isValid: function isValid(p) { - return p === 'csv'; - } + isValid: p => p === 'csv' } }; @@ -367,17 +324,18 @@ var DATA_FILE_PARTS = { CSV Fetch/Parse Functions */ // const siteMonthCancelation$ = new Subject(); -var fetchCSV = function fetchCSV(url) { - return (0, _ajax.ajax)({ - method: 'GET', - crossDomain: true, - responseType: 'text', - url: url - }); -}; -var parseCSV = function parseCSV(rawCsv) { - var dedupeLines = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var csv = !dedupeLines ? rawCsv : _toConsumableArray(new Set(rawCsv.split('\n'))).join('\n'); +const fetchCSV = url => (0, _ajax.ajax)({ + method: 'GET', + crossDomain: true, + responseType: 'text', + headers: { + 'User-Agent': (0, _requestUtil.getUserAgentHeader)('Time Series Viewer') + }, + url +}); +const parseCSV = function (rawCsv) { + let dedupeLines = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const csv = !dedupeLines ? rawCsv : [...new Set(rawCsv.split('\n'))].join('\n'); return (0, _papaparse.parse)(csv, { header: true, skipEmptyLines: 'greedy' @@ -392,15 +350,13 @@ var parseCSV = function parseCSV(rawCsv) { compared against the low and high ends of the existing range so as to expand the range to accomodate it. */ -var getUpdatedValueRange = function getUpdatedValueRange(existingRange, newValue) { - var arrayVal = Array.isArray(newValue) ? newValue : [newValue]; - if (arrayVal.some(function (v) { - return typeof v !== 'number'; - })) { +const getUpdatedValueRange = (existingRange, newValue) => { + const arrayVal = Array.isArray(newValue) ? newValue : [newValue]; + if (arrayVal.some(v => typeof v !== 'number')) { return existingRange; } - var newRange = _toConsumableArray(existingRange); - arrayVal.forEach(function (v) { + const newRange = [...existingRange]; + arrayVal.forEach(v => { if (newRange[0] === null || newRange[0] > v) { newRange[0] = v; } @@ -420,24 +376,24 @@ var getUpdatedValueRange = function getUpdatedValueRange(existingRange, newValue * @param {Array} dateRange - array of exactly two "YYYY-MM" strings * @param {boolean} roundToYears - if true then extend each side of the range to whole years */ -var getContinuousDatesArray = function getContinuousDatesArray(dateRange) { - var roundToYears = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var dateRegex = /^\d{4}-\d{2}$/; +const getContinuousDatesArray = function (dateRange) { + let roundToYears = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const dateRegex = /^\d{4}-\d{2}$/; if (!Array.isArray(dateRange) || dateRange.length !== 2 || dateRange[1] < dateRange[0] || !dateRegex.test(dateRange[0]) || !dateRegex.test(dateRange[1])) { return []; } if (dateRange.length === 2 && dateRange[0] === dateRange[1]) { return [dateRange[0]]; } - var startMoment = (0, _moment.default)("".concat(dateRange[0], "-20")); - var endMoment = (0, _moment.default)("".concat(dateRange[1], "-10")).add(1, 'months'); + let startMoment = (0, _moment.default)("".concat(dateRange[0], "-20")); + let endMoment = (0, _moment.default)("".concat(dateRange[1], "-10")).add(1, 'months'); if (roundToYears) { startMoment = (0, _moment.default)("".concat(dateRange[0], "-20")).startOf('year'); endMoment = (0, _moment.default)("".concat(dateRange[1], "-10")).endOf('year').add(1, 'months'); } - var continuousRange = []; - var months = 0; - var MAX_MONTHS = 960; // If we're going more than 80 years then maybe something is wrong? + const continuousRange = []; + let months = 0; + const MAX_MONTHS = 960; // If we're going more than 80 years then maybe something is wrong? while (startMoment.isBefore(endMoment) && months < MAX_MONTHS) { continuousRange.push(startMoment.format('YYYY-MM')); startMoment.add(1, 'months'); @@ -451,9 +407,9 @@ var getContinuousDatesArray = function getContinuousDatesArray(dateRange) { * @param {Object} productData - JSON parse response from product data endpoint * @return {Object} new product object to be applied at state.product */ -var parseProductData = function parseProductData() { - var productData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var product = { +const parseProductData = function () { + let productData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const product = { productCode: productData.productCode, productName: productData.productName, productDescription: productData.productDescription, @@ -462,7 +418,7 @@ var parseProductData = function parseProductData() { variables: {}, sites: {} }; - product.dateRange = (productData.siteCodes || []).reduce(function (acc, site) { + product.dateRange = (productData.siteCodes || []).reduce((acc, site) => { if (!Array.isArray(site.availableMonths) || !site.availableMonths.length) { return acc; } @@ -485,8 +441,8 @@ var parseProductData = function parseProductData() { variables: new Set(), positions: {} }; - var start = site.availableMonths[0]; - var end = site.availableMonths[site.availableMonths.length - 1]; + const start = site.availableMonths[0]; + const end = site.availableMonths[site.availableMonths.length - 1]; return [acc[0] === null || acc[0] > start ? start : acc[0], acc[1] === null || acc[1] < end ? end : acc[1]]; }, [null, null]); product.continuousDateRange = getContinuousDatesArray(product.dateRange, true); @@ -502,12 +458,14 @@ var parseProductData = function parseProductData() { * @return {Set} availableTimeSteps - set containing time steps available for this site month * @return {Boolean} metaFetchQueued - whether any meta fetches (variables or positions) were queued */ -var parseSiteMonthData = function parseSiteMonthData(site, files) { - var newSite = _extends({}, site); - var availableTimeSteps = new Set(); - files.forEach(function (file) { - var name = file.name, - url = file.url; +const parseSiteMonthData = (site, files) => { + const newSite = _extends({}, site); + const availableTimeSteps = new Set(); + files.forEach(file => { + const { + name, + url + } = file; // Must be a CSV file if (!/\.csv$/.test(name)) { return; @@ -529,21 +487,22 @@ var parseSiteMonthData = function parseSiteMonthData(site, files) { return; } // Split file name by (.); all DATA_FILE_PARTS validators must point to a valid part - var parts = name.split('.'); - if (Object.keys(DATA_FILE_PARTS).some(function (part) { - var _DATA_FILE_PARTS$part = DATA_FILE_PARTS[part], - offset = _DATA_FILE_PARTS$part.offset, - isValid = _DATA_FILE_PARTS$part.isValid; + const parts = name.split('.'); + if (Object.keys(DATA_FILE_PARTS).some(part => { + const { + offset, + isValid + } = DATA_FILE_PARTS[part]; return !isValid(parts[offset]); })) { return; } // Extract parts - var position = "".concat(parts[DATA_FILE_PARTS.POSITION_H.offset], ".").concat(parts[DATA_FILE_PARTS.POSITION_V.offset]); - var month = parts[DATA_FILE_PARTS.MONTH.offset]; - var packageType = parts[DATA_FILE_PARTS.PACKAGE_TYPE.offset]; - var timeStep = getTimeStep(parts[DATA_FILE_PARTS.TIME_STEP.offset]); - var tableName = parts[DATA_FILE_PARTS.TABLE.offset]; + const position = "".concat(parts[DATA_FILE_PARTS.POSITION_H.offset], ".").concat(parts[DATA_FILE_PARTS.POSITION_V.offset]); + const month = parts[DATA_FILE_PARTS.MONTH.offset]; + const packageType = parts[DATA_FILE_PARTS.PACKAGE_TYPE.offset]; + const timeStep = getTimeStep(parts[DATA_FILE_PARTS.TIME_STEP.offset]); + const tableName = parts[DATA_FILE_PARTS.TABLE.offset]; // Timestep must be valid if (timeStep === null) { return; @@ -566,7 +525,7 @@ var parseSiteMonthData = function parseSiteMonthData(site, files) { newSite.positions[position].data[month][packageType][timeStep] = {}; } newSite.positions[position].data[month][packageType][timeStep][tableName] = { - url: url, + url, status: FETCH_STATUS.AWAITING_CALL, error: null, series: {} @@ -574,7 +533,7 @@ var parseSiteMonthData = function parseSiteMonthData(site, files) { }); return { siteObject: newSite, - availableTimeSteps: availableTimeSteps + availableTimeSteps }; }; @@ -592,48 +551,48 @@ var parseSiteMonthData = function parseSiteMonthData(site, files) { * * @return {ParseSiteVariablesReturn} */ -var parseSiteVariables = function parseSiteVariables(previousVariables, siteCode, csv) { - var newStateVariables = _extends({}, previousVariables); - var variables = parseCSV(csv); +const parseSiteVariables = (previousVariables, siteCode, csv) => { + const newStateVariables = _extends({}, previousVariables); + const variables = parseCSV(csv); // Build a list of tables we care about. Some products include maintenance tables that should // be ignored altogether. Presently our best mechanism to differentiate is that maintenance // tables will all have a 'uid' field. - var tablesWithUid = {}; - variables.data.forEach(function (variable) { - var table = variable.table, - fieldName = variable.fieldName; + const tablesWithUid = {}; + variables.data.forEach(variable => { + const { + table, + fieldName + } = variable; tablesWithUid[table] = tablesWithUid[table] || fieldName === 'uid'; }); - var validTables = new Set(Object.keys(tablesWithUid).filter(function (k) { - return !tablesWithUid[k]; - })); - var ignoreTables = new Set(['sensor_positions', 'science_review_flags']); + const validTables = new Set(Object.keys(tablesWithUid).filter(k => !tablesWithUid[k])); + const ignoreTables = new Set(['sensor_positions', 'science_review_flags']); // Build the set of variables using only the valid tables - var variablesSet = new Set(); - variables.data.filter(function (variable) { - return validTables.has(variable.table) && !ignoreTables.has(variable.table); - }).forEach(function (variable) { - var table = variable.table, - fieldName = variable.fieldName, - description = variable.description, - dataType = variable.dataType, - units = variable.units, - downloadPkg = variable.downloadPkg; - var timeStep = getTimeStepForTableName(table, true); - var isSelectable = variable.dataType !== 'dateTime' && variable.units !== 'NA' && !/QF$/.test(fieldName); - var canBeDefault = isSelectable && variable.downloadPkg !== 'expanded' && !/QM$/.test(fieldName); + const variablesSet = new Set(); + variables.data.filter(variable => validTables.has(variable.table) && !ignoreTables.has(variable.table)).forEach(variable => { + const { + table, + fieldName, + description, + dataType, + units, + downloadPkg + } = variable; + const timeStep = getTimeStepForTableName(table, true); + const isSelectable = variable.dataType !== 'dateTime' && variable.units !== 'NA' && !/QF$/.test(fieldName); + const canBeDefault = isSelectable && variable.downloadPkg !== 'expanded' && !/QM$/.test(fieldName); variablesSet.add(fieldName); if (!newStateVariables[fieldName]) { newStateVariables[fieldName] = { - dataType: dataType, - description: description, - downloadPkg: downloadPkg, - units: units, + dataType, + description, + downloadPkg, + units, tables: new Set(), timeSteps: new Set(), sites: new Set(), - isSelectable: isSelectable, - canBeDefault: canBeDefault, + isSelectable, + canBeDefault, isDateTime: variable.dataType === 'dateTime' }; } @@ -642,11 +601,11 @@ var parseSiteVariables = function parseSiteVariables(previousVariables, siteCode newStateVariables[fieldName].sites.add(siteCode); }); return { - variablesSet: variablesSet, + variablesSet, variablesObject: newStateVariables }; }; -var parsePosition = function parsePosition(position) { +const parsePosition = position => { if (!(0, _typeUtil.exists)(position)) return position; return _DataPackageParser.default.parseSensorPosition(position); }; @@ -659,13 +618,13 @@ var parsePosition = function parsePosition(position) { * @param {string} csv - unparsed CSV string from a product/site positions fetch response * @return {Object} updated site object to be applied at state.product.sites[{site}] */ -var parseSitePositions = function parseSitePositions(site, csv) { - var newSite = _extends({}, site); - var positions = parseCSV(csv, true); // Duplicated lines have been unintentionally seen here! - positions.data.forEach(function (position) { - var parsedPosition = parsePosition(position); +const parseSitePositions = (site, csv) => { + const newSite = _extends({}, site); + const positions = parseCSV(csv, true); // Duplicated lines have been unintentionally seen here! + positions.data.forEach(position => { + const parsedPosition = parsePosition(position); if ((0, _typeUtil.exists)(parsedPosition)) { - var posId = parsedPosition.horVer; + const posId = parsedPosition.horVer; if (!newSite.positions[posId]) { newSite.positions[posId] = { data: {}, @@ -676,8 +635,8 @@ var parseSitePositions = function parseSitePositions(site, csv) { } }); // Sort position history by start/end time descending - Object.keys(newSite.positions).forEach(function (posId) { - newSite.positions[posId].history.sort(function (a, b) { + Object.keys(newSite.positions).forEach(posId => { + newSite.positions[posId].history.sort((a, b) => { if (!a.sensorEndDateTime) { return 1; } @@ -699,18 +658,20 @@ var parseSitePositions = function parseSitePositions(site, csv) { * @param {Set} invalidDefaultVariables - set of invalid default variables (null data) * @return {Object} updated object to apply to state.selection */ -var applyDefaultsToSelection = function applyDefaultsToSelection(state) { - var invalidDefaultVariables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set(); - var status = state.status, - product = state.product, - variables = state.variables, - selection = state.selection; +const applyDefaultsToSelection = function (state) { + let invalidDefaultVariables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Set(); + const { + status, + product, + variables, + selection + } = state; if (!Object.keys(product.sites).length) { return selection; } // Sites - Ensure the selection has at least one site (default to first in list) if (!selection.sites.length) { - var siteCodes = Object.keys(product.sites); + const siteCodes = Object.keys(product.sites); siteCodes.sort(); selection.sites.push({ siteCode: siteCodes[0], @@ -719,17 +680,21 @@ var applyDefaultsToSelection = function applyDefaultsToSelection(state) { } // Date Range - Ensure the selection has a date range (default to latest month) if (selection.dateRange[0] === null || selection.dateRange[1] === null) { - var availableMonths = product.sites[selection.sites[0].siteCode].availableMonths; - var initialMonth = availableMonths[availableMonths.length - 1]; + const { + availableMonths + } = product.sites[selection.sites[0].siteCode]; + const initialMonth = availableMonths[availableMonths.length - 1]; selection.dateRange = [initialMonth, initialMonth]; } // Positions - Ensure every selected site has at least one selected position - selection.sites.forEach(function (site, idx) { + selection.sites.forEach((site, idx) => { if (site.positions.length > 0) { return; } - var siteCode = site.siteCode; - var positions = Object.keys(state.product.sites[siteCode].positions); + const { + siteCode + } = site; + const positions = Object.keys(state.product.sites[siteCode].positions); if (!positions.length) { return; } @@ -738,14 +703,12 @@ var applyDefaultsToSelection = function applyDefaultsToSelection(state) { }); // Variables selection.derivedVariableTable = {}; - var foundVarWithData = false; - var hasVariablesSelected = Array.isArray(selection.variables) && selection.variables.length > 0; + let foundVarWithData = false; + const hasVariablesSelected = Array.isArray(selection.variables) && selection.variables.length > 0; if (Object.keys(variables).length) { // Ensure the selection has at least one variable if (!hasVariablesSelected) { - var defaultVar = Object.keys(variables).find(function (v) { - return variables[v].canBeDefault && !invalidDefaultVariables.has(v); - }); + const defaultVar = Object.keys(variables).find(v => variables[v].canBeDefault && !invalidDefaultVariables.has(v)); if (defaultVar) { selection.variables.push(defaultVar); selection.yAxes.y1.units = variables[defaultVar].units; @@ -754,13 +717,11 @@ var applyDefaultsToSelection = function applyDefaultsToSelection(state) { // Ensure the selection has at least one dateTime variable. Use the PREFERRED_DATETIME_VARIABLES // list to sort the existing date time variables in order of preference and take the first one. if (!selection.dateTimeVariable) { - var dateTimeVars = Object.keys(variables).filter(function (v) { - return variables[v].isDateTime; - }); + const dateTimeVars = Object.keys(variables).filter(v => variables[v].isDateTime); if (dateTimeVars.length) { - dateTimeVars.sort(function (a, b) { - var aIdx = PREFERRED_DATETIME_VARIABLES.indexOf(a); - var bIdx = PREFERRED_DATETIME_VARIABLES.indexOf(b); + dateTimeVars.sort((a, b) => { + const aIdx = PREFERRED_DATETIME_VARIABLES.indexOf(a); + const bIdx = PREFERRED_DATETIME_VARIABLES.indexOf(b); if (aIdx === bIdx) { return 0; } @@ -779,41 +740,45 @@ var applyDefaultsToSelection = function applyDefaultsToSelection(state) { // Generate a new continuous date range from the dateRange (which only contains bounds) selection.continuousDateRange = getContinuousDatesArray(selection.dateRange); // Generate new cumulative data ranges and standard deviations for all applicable y axes. - var timeStep = selection.timeStep, - autoTimeStep = selection.autoTimeStep; - var dataTimeStep = timeStep === 'auto' ? autoTimeStep : timeStep; - Object.keys(selection.yAxes).forEach(function (yAxis) { + const { + timeStep, + autoTimeStep + } = selection; + const dataTimeStep = timeStep === 'auto' ? autoTimeStep : timeStep; + Object.keys(selection.yAxes).forEach(yAxis => { if (selection.yAxes[yAxis].units === null) { return; } - var combinedSum = 0; - var combinedCount = 0; - var monthCounts = []; - var monthMeans = []; - var monthVariances = []; + let combinedSum = 0; + let combinedCount = 0; + const monthCounts = []; + const monthMeans = []; + const monthVariances = []; selection.yAxes[yAxis].dataRange = [null, null]; selection.yAxes[yAxis].standardDeviation = 0; - selection.variables.filter(function (variable) { - return variables[variable].units === selection.yAxes[yAxis].units; - }).forEach(function (variable) { - var pkg = variables[variable].downloadPkg; - selection.sites.forEach(function (site) { - var siteCode = site.siteCode, - positions = site.positions; - positions.forEach(function (position) { - selection.continuousDateRange.forEach(function (month) { + selection.variables.filter(variable => variables[variable].units === selection.yAxes[yAxis].units).forEach(variable => { + const { + downloadPkg: pkg + } = variables[variable]; + selection.sites.forEach(site => { + const { + siteCode, + positions + } = site; + positions.forEach(position => { + selection.continuousDateRange.forEach(month => { if (!variables[variable].tables) { return; } - var timeStepTables = lodashGet(product.sites[siteCode].positions[position], "data['".concat(month, "']['").concat(pkg, "']['").concat(dataTimeStep, "']"), {}); + const timeStepTables = lodashGet(product.sites[siteCode].positions[position], "data['".concat(month, "']['").concat(pkg, "']['").concat(dataTimeStep, "']"), {}); // Attempt to find a table with data for the specified // variable (associated tables) and time step - var tableWithSeries = Array.from(variables[variable].tables).find(function (table) { - var timeStepTable = timeStepTables[table]; - var variableTableTimeStep = getTimeStepForTableName(table, true); + const tableWithSeries = Array.from(variables[variable].tables).find(table => { + const timeStepTable = timeStepTables[table]; + const variableTableTimeStep = getTimeStepForTableName(table, true); if (timeStepTable && timeStepTable.series) { if (variableTableTimeStep && variableTableTimeStep.localeCompare(dataTimeStep) === 0) { - var checkSeries = timeStepTable.series[variable]; + const checkSeries = timeStepTable.series[variable]; return checkSeries && checkSeries.count; } if (variableTableTimeStep === 'default') { @@ -822,7 +787,7 @@ var applyDefaultsToSelection = function applyDefaultsToSelection(state) { } return false; }); - var series = tableWithSeries ? timeStepTables[tableWithSeries].series[variable] : null; + const series = tableWithSeries ? timeStepTables[tableWithSeries].series[variable] : null; if (!series || !series.count) { return; } @@ -839,16 +804,12 @@ var applyDefaultsToSelection = function applyDefaultsToSelection(state) { }); }); if (combinedCount > 0) { - var dataRangeMax = selection.yAxes[yAxis].dataRange[1]; - var precision = dataRangeMax === null || dataRangeMax <= 0 ? 0 : Math.abs(Math.floor(Math.min(Math.log10(dataRangeMax), 0))) + (Math.log10(dataRangeMax) >= 2 ? 0 : 2); - var combinedMean = combinedSum / combinedCount; - var deviations = monthMeans.map(function (mean) { - return mean - combinedMean; - }); - var standardDeviation = Math.pow(monthVariances.reduce(function (sum, variance, idx) { - return monthCounts[idx] * (variance + Math.pow(deviations[idx], 2)); - }, 0) / combinedCount, 0.5); - var fixedStandardDeviation = parseFloat(standardDeviation.toFixed(precision), 10); + const dataRangeMax = selection.yAxes[yAxis].dataRange[1]; + const precision = dataRangeMax === null || dataRangeMax <= 0 ? 0 : Math.abs(Math.floor(Math.min(Math.log10(dataRangeMax), 0))) + (Math.log10(dataRangeMax) >= 2 ? 0 : 2); + const combinedMean = combinedSum / combinedCount; + const deviations = monthMeans.map(mean => mean - combinedMean); + const standardDeviation = (monthVariances.reduce((sum, variance, idx) => monthCounts[idx] * (variance + deviations[idx] ** 2), 0) / combinedCount) ** 0.5; + const fixedStandardDeviation = parseFloat(standardDeviation.toFixed(precision), 10); selection.yAxes[yAxis].precision = precision; selection.yAxes[yAxis].standardDeviation = fixedStandardDeviation; selection.yAxes[yAxis].axisRange = generateYAxisRange(selection.yAxes[yAxis]); @@ -861,17 +822,13 @@ var applyDefaultsToSelection = function applyDefaultsToSelection(state) { // We'll recurse through the variables available for the site/month/position until we find one // that works or show a meaningful error instructing the user to select a different site, // month, or position. - if (status === _constants.TIME_SERIES_VIEWER_STATUS.READY_FOR_SERIES && (!hasVariablesSelected || !foundVarWithData && selection.isDefault) && selection.variables.length && selection.yAxes.y1.dataRange.every(function (x) { - return x === null; - })) { - var allowedDefaultVars = Object.keys(variables).filter(function (v) { - return variables[v].canBeDefault; - }); + if (status === _constants.TIME_SERIES_VIEWER_STATUS.READY_FOR_SERIES && (!hasVariablesSelected || !foundVarWithData && selection.isDefault) && selection.variables.length && selection.yAxes.y1.dataRange.every(x => x === null)) { + const allowedDefaultVars = Object.keys(variables).filter(v => variables[v].canBeDefault); if (allowedDefaultVars.length > invalidDefaultVariables.size) { invalidDefaultVariables.add(selection.variables[0]); selection.variables = []; return applyDefaultsToSelection(_extends({}, state, { - selection: selection + selection }), invalidDefaultVariables); } } @@ -885,34 +842,34 @@ var applyDefaultsToSelection = function applyDefaultsToSelection(state) { }); return selection; }; -var limitVariablesToTwoUnits = function limitVariablesToTwoUnits(state, variables) { - var selectedUnits = variables.reduce(function (units, variable) { +const limitVariablesToTwoUnits = (state, variables) => { + let selectedUnits = variables.reduce((units, variable) => { units.add(state.variables[variable].units); return units; }, new Set()); if (selectedUnits.size <= 2) { return { selectedUnits: Array.from(selectedUnits), - variables: variables + variables }; } selectedUnits = new Set(Array.from(selectedUnits).slice(0, 2)); return { selectedUnits: Array.from(selectedUnits), - variables: variables.filter(function (variable) { - return selectedUnits.has(state.variables[variable].units); - }) + variables: variables.filter(variable => selectedUnits.has(state.variables[variable].units)) }; }; -var setDataFileFetchStatuses = function setDataFileFetchStatuses(state, fetches) { - var newState = _extends({}, state); - fetches.forEach(function (fetch) { - var siteCode = fetch.siteCode, - position = fetch.position, - month = fetch.month, - downloadPkg = fetch.downloadPkg, - timeStep = fetch.timeStep, - table = fetch.table; +const setDataFileFetchStatuses = (state, fetches) => { + const newState = _extends({}, state); + fetches.forEach(fetch => { + const { + siteCode, + position, + month, + downloadPkg, + timeStep, + table + } = fetch; if (!newState.product || !newState.product.sites || !newState.product.sites[siteCode] || !newState.product.sites[siteCode].positions || !newState.product.sites[siteCode].positions[position] || !newState.product.sites[siteCode].positions[position].data || !newState.product.sites[siteCode].positions[position].data[month] || !newState.product.sites[siteCode].positions[position].data[month][downloadPkg] || !newState.product.sites[siteCode].positions[position].data[month][downloadPkg][timeStep] // eslint-disable-next-line max-len || !newState.product.sites[siteCode].positions[position].data[month][downloadPkg][timeStep][table]) { @@ -926,12 +883,12 @@ var setDataFileFetchStatuses = function setDataFileFetchStatuses(state, fetches) /** Reducer */ -var reducer = function reducer(state, action) { - var newState = _extends({}, state); - var calcSelection = function calcSelection() { +const reducer = (state, action) => { + let newState = _extends({}, state); + const calcSelection = () => { newState.selection = applyDefaultsToSelection(newState); }; - var calcStatus = function calcStatus() { + const calcStatus = () => { if (newState.status === _constants.TIME_SERIES_VIEWER_STATUS.ERROR) { return; } @@ -943,18 +900,18 @@ var reducer = function reducer(state, action) { newState.status = _constants.TIME_SERIES_VIEWER_STATUS.READY_FOR_DATA; } }; - var softFail = function softFail(error) { + const softFail = error => { newState.status = _constants.TIME_SERIES_VIEWER_STATUS.WARNING; newState.displayError = error; return newState; }; - var fail = function fail(error) { + const fail = error => { newState.status = _constants.TIME_SERIES_VIEWER_STATUS.ERROR; newState.displayError = error; return newState; }; - var parsedContent = null; - var selectedSiteIdx = null; + let parsedContent = null; + let selectedSiteIdx = null; switch (action.type) { // Reinitialize case 'reinitialize': @@ -1021,13 +978,13 @@ var reducer = function reducer(state, action) { newState.product.sites[action.siteCode].fetches.siteMonths[action.month].status = FETCH_STATUS.SUCCESS; parsedContent = parseSiteMonthData(newState.product.sites[action.siteCode], action.files); newState.product.sites[action.siteCode] = parsedContent.siteObject; - newState.availableTimeSteps = new Set([].concat(_toConsumableArray(state.availableTimeSteps), _toConsumableArray(parsedContent.availableTimeSteps))); + newState.availableTimeSteps = new Set([...state.availableTimeSteps, ...parsedContent.availableTimeSteps]); if (newState.availableTimeSteps.size === 1) { // Need more than just 'auto' return fail('This data product is not compatible with the Time Series Viewer (no valid time step found)'); } if (state.selection.autoTimeStep === null) { - newState.selection.autoTimeStep = Array.from(newState.availableTimeSteps).reduce(function (acc, cur) { + newState.selection.autoTimeStep = Array.from(newState.availableTimeSteps).reduce((acc, cur) => { if (cur === 'auto') { return acc; } @@ -1069,14 +1026,10 @@ var reducer = function reducer(state, action) { newState.product.sites[action.siteCode].fetches.variables.status = FETCH_STATUS.SUCCESS; parsedContent = parseSiteVariables(newState.variables, action.siteCode, action.csv); newState.variables = _extends({}, state.variables, parsedContent.variablesObject); - newState.product.sites[action.siteCode].variables = new Set([].concat(_toConsumableArray(state.product.sites[action.siteCode].variables), _toConsumableArray(parsedContent.variablesSet))); - newState.availableQualityFlags = new Set([].concat(_toConsumableArray(state.availableQualityFlags), _toConsumableArray(Object.keys(newState.variables).filter(function (v) { - return /QF$/.test(v); - })))); + newState.product.sites[action.siteCode].variables = new Set([...state.product.sites[action.siteCode].variables, ...parsedContent.variablesSet]); + newState.availableQualityFlags = new Set([...state.availableQualityFlags, ...Object.keys(newState.variables).filter(v => /QF$/.test(v) || /QFSciRvw$/.test(v))]); // A valid dateTime variable must be present otherwise we have no x-axis - if (Object.keys(newState.variables).every(function (v) { - return !newState.variables[v].isDateTime; - })) { + if (Object.keys(newState.variables).every(v => !newState.variables[v].isDateTime)) { return fail('This data product is not compatible with the Time Series Viewer (no dateTime data found)'); } calcSelection(); @@ -1085,11 +1038,7 @@ var reducer = function reducer(state, action) { // Regenerate Graph Data Actions case 'regenerateGraphData': - if (!action.graphData.series.length || Object.keys(state.selection.yAxes).every(function (y) { - return state.selection.yAxes[y].dataRange.every(function (x) { - return x === null; - }); - })) { + if (!action.graphData.series.length || Object.keys(state.selection.yAxes).every(y => state.selection.yAxes[y].dataRange.every(x => x === null))) { return softFail('Current selection of dates/sites/positions/variables does not have any valid numeric data.'); } newState.graphData = action.graphData; @@ -1216,9 +1165,7 @@ var reducer = function reducer(state, action) { if (!state.selection.yAxes[action.axis]) { return state; } - if (!(Array.isArray(action.range) && action.range.length === 2 && action.range.every(function (v) { - return typeof v === 'number'; - }) && action.range[0] < action.range[1])) { + if (!(Array.isArray(action.range) && action.range.length === 2 && action.range.every(v => typeof v === 'number') && action.range[0] < action.range[1])) { return state; } newState.selection.isDefault = false; @@ -1269,9 +1216,7 @@ var reducer = function reducer(state, action) { if (action.selected && !state.selection.qualityFlags.includes(action.qualityFlag)) { newState.selection.qualityFlags.push(action.qualityFlag); } else if (!action.selected) { - newState.selection.qualityFlags = _toConsumableArray(state.selection.qualityFlags).filter(function (qf) { - return qf !== action.qualityFlag; - }); + newState.selection.qualityFlags = [...state.selection.qualityFlags].filter(qf => qf !== action.qualityFlag); } calcSelection(); calcStatus(); @@ -1290,9 +1235,7 @@ var reducer = function reducer(state, action) { if (!state.product.sites[action.siteCode]) { return state; } - if (state.selection.sites.some(function (site) { - return site.siteCode === action.siteCode; - })) { + if (state.selection.sites.some(site => site.siteCode === action.siteCode)) { return state; } newState.selection.sites.push({ @@ -1308,21 +1251,17 @@ var reducer = function reducer(state, action) { } newState.selection.isDefault = false; // Remove any sites that are no longer in the selected set - newState.selection.sites = newState.selection.sites.filter(function (site) { - return action.siteCodes.has(site.siteCode); - }); + newState.selection.sites = newState.selection.sites.filter(site => action.siteCodes.has(site.siteCode)); // Add any new sites from the action - action.siteCodes.forEach(function (siteCode) { + action.siteCodes.forEach(siteCode => { if (!state.product.sites[siteCode]) { return; } - if (newState.selection.sites.some(function (site) { - return site.siteCode === siteCode; - })) { + if (newState.selection.sites.some(site => site.siteCode === siteCode)) { return; } newState.selection.sites.push({ - siteCode: siteCode, + siteCode, positions: [] }); }); @@ -1333,35 +1272,27 @@ var reducer = function reducer(state, action) { if (state.selection.sites.length < 2) { return state; } - if (!state.selection.sites.some(function (site) { - return site.siteCode === action.siteCode; - })) { + if (!state.selection.sites.some(site => site.siteCode === action.siteCode)) { return state; } newState.selection.isDefault = false; - newState.selection.sites = newState.selection.sites.filter(function (site) { - return site.siteCode !== action.siteCode; - }); + newState.selection.sites = newState.selection.sites.filter(site => site.siteCode !== action.siteCode); calcSelection(); calcStatus(); return newState; case 'selectSitePositions': - selectedSiteIdx = state.selection.sites.findIndex(function (site) { - return site.siteCode === action.siteCode; - }); + selectedSiteIdx = state.selection.sites.findIndex(site => site.siteCode === action.siteCode); if (selectedSiteIdx === -1) { return state; } if (!state.product.sites[action.siteCode] || !action.positions.length) { return state; } - if (!action.positions.every(function (p) { - return Object.keys(state.product.sites[action.siteCode].positions).includes(p); - })) { + if (!action.positions.every(p => Object.keys(state.product.sites[action.siteCode].positions).includes(p))) { return state; } newState.selection.isDefault = false; - newState.selection.sites[selectedSiteIdx].positions = _toConsumableArray(action.positions); + newState.selection.sites[selectedSiteIdx].positions = [...action.positions]; calcSelection(); calcStatus(); return newState; @@ -1379,23 +1310,25 @@ var reducer = function reducer(state, action) { * Keeping this lookup outside of the context provider function * as to not incur lifecycle interference by storing with useState. */ -var restoreStateLookup = {}; +const restoreStateLookup = {}; /** Context Provider */ -var Provider = function Provider(props) { - var timeSeriesUniqueId = props.timeSeriesUniqueId, - modeProp = props.mode, - productCodeProp = props.productCode, - productDataProp = props.productData, - releaseProp = props.release, - children = props.children; +const Provider = props => { + const { + timeSeriesUniqueId, + mode: modeProp, + productCode: productCodeProp, + productData: productDataProp, + release: releaseProp, + children + } = props; /** Initial State and Reducer Setup */ - var initialState = (0, _cloneDeep.default)(DEFAULT_STATE); + let initialState = (0, _cloneDeep.default)(DEFAULT_STATE); if (typeof modeProp === 'string' && modeProp !== VIEWER_MODE.DEFAULT) { initialState.mode = modeProp; } @@ -1410,41 +1343,42 @@ var Provider = function Provider(props) { initialState.selection = applyDefaultsToSelection(initialState); // get the state from storage if present - var productCode = initialState.product.productCode; - var stateKey = "timeSeriesContextState-".concat(productCode, "-").concat(timeSeriesUniqueId); + const { + productCode + } = initialState.product; + const stateKey = "timeSeriesContextState-".concat(productCode, "-").concat(timeSeriesUniqueId); if (typeof restoreStateLookup[stateKey] === 'undefined') { restoreStateLookup[stateKey] = true; } - var shouldRestoreState = restoreStateLookup[stateKey]; - var stateStorage = (0, _StateStorageService.default)(stateKey); - var savedState = stateStorage.readState(); + const shouldRestoreState = restoreStateLookup[stateKey]; + const stateStorage = (0, _StateStorageService.default)(stateKey); + const savedState = stateStorage.readState(); if (savedState && shouldRestoreState) { restoreStateLookup[stateKey] = false; - var convertedState = (0, _StateStorageConverter.convertStateFromStorage)(savedState); + const convertedState = (0, _StateStorageConverter.convertStateFromStorage)(savedState); stateStorage.removeState(); initialState = convertedState; } - var _useReducer = (0, _react.useReducer)(reducer, initialState), - _useReducer2 = _slicedToArray(_useReducer, 2), - state = _useReducer2[0], - dispatch = _useReducer2[1]; - var viewerStatus = state.viewerStatus; + const [state, dispatch] = (0, _react.useReducer)(reducer, initialState); + const { + viewerStatus + } = state; // The current sign in process uses a separate domain. This function // persists the current state in storage when the button is clicked // so the state may be reloaded when the page is reloaded after sign // in. - (0, _react.useEffect)(function () { - var subscription = _NeonSignInButtonState.default.getObservable().subscribe({ - next: function next() { + (0, _react.useEffect)(() => { + const subscription = _NeonSignInButtonState.default.getObservable().subscribe({ + next: () => { if (!_NeonEnvironment.default.enableGlobalSignInState) return; if (viewerStatus !== _constants.TIME_SERIES_VIEWER_STATUS.READY) return; restoreStateLookup[stateKey] = false; - var convertedState = (0, _StateStorageConverter.convertStateForStorage)(state); + const convertedState = (0, _StateStorageConverter.convertStateForStorage)(state); stateStorage.saveState(convertedState); } }); - return function () { + return () => { subscription.unsubscribe(); }; }, [viewerStatus, state, stateStorage, stateKey]); @@ -1452,7 +1386,7 @@ var Provider = function Provider(props) { /** Effect - Reinitialize state if the product code prop changed */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { // Ignore initialization when in static mode if (state.mode === VIEWER_MODE.STATIC) { return; @@ -1476,7 +1410,7 @@ var Provider = function Provider(props) { /** Effect - Fetch product data if only a product code was provided in props */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { // Ignore fetching product data when in static mode if (state.mode === VIEWER_MODE.STATIC) { return; @@ -1490,9 +1424,9 @@ var Provider = function Provider(props) { dispatch({ type: 'initFetchProductCalled' }); - _NeonGraphQL.default.getDataProductByCode(state.product.productCode, state.release, true).pipe((0, _rxjs.map)(function (response) { - var _response$response, _response$response$da; - if (response !== null && response !== void 0 && (_response$response = response.response) !== null && _response$response !== void 0 && (_response$response$da = _response$response.data) !== null && _response$response$da !== void 0 && _response$response$da.product) { + _NeonGraphQL.default.getDataProductByCode(state.product.productCode, state.release, true).pipe((0, _rxjs.map)(response => { + var _response$response; + if (response !== null && response !== void 0 && (_response$response = response.response) !== null && _response$response !== void 0 && (_response$response = _response$response.data) !== null && _response$response !== void 0 && _response$response.product) { dispatch({ type: 'initFetchProductSucceeded', productData: response.response.data.product @@ -1504,7 +1438,7 @@ var Provider = function Provider(props) { error: 'malformed response' }); return (0, _rxjs.of)(false); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { dispatch({ type: 'initFetchProductFailed', error: error.message @@ -1516,7 +1450,7 @@ var Provider = function Provider(props) { /** Effect - Fetch releases */ - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { // Ignore fetching releases data when in static mode if (state.mode === VIEWER_MODE.STATIC) { return; @@ -1530,7 +1464,7 @@ var Provider = function Provider(props) { dispatch({ type: 'initFetchReleasesCalled' }); - _NeonApi.default.getReleasesObservable().pipe((0, _rxjs.map)(function (response) { + _NeonApi.default.getReleasesObservable().pipe((0, _rxjs.map)(response => { if (response && response.data) { dispatch({ type: 'initFetchReleasesSucceeded', @@ -1543,7 +1477,7 @@ var Provider = function Provider(props) { error: 'malformed response' }); return (0, _rxjs.of)(false); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { dispatch({ type: 'initFetchReleasesFailed', error: error.message @@ -1556,72 +1490,71 @@ var Provider = function Provider(props) { Effect - Handle changes to selection Triggers all necessary fetches for meta data and series data */ - (0, _react.useEffect)(function () { - var getSiteMonthDataURL = function getSiteMonthDataURL(siteCode, month) { - var root = _NeonEnvironment.default.getFullApiPath('data'); - var hasRelease = state.release && typeof state.release === 'string' && state.release.length > 0; - var releaseParam = hasRelease ? "?release=".concat(state.release) : ''; + (0, _react.useEffect)(() => { + const getSiteMonthDataURL = (siteCode, month) => { + const root = _NeonEnvironment.default.getFullApiPath('data'); + const hasRelease = state.release && typeof state.release === 'string' && state.release.length > 0; + const releaseParam = hasRelease ? "?release=".concat(state.release) : ''; return "".concat(root, "/").concat(state.product.productCode, "/").concat(siteCode, "/").concat(month).concat(releaseParam); }; - var _state$selection = state.selection, - selectedTimeStep = _state$selection.timeStep, - autoTimeStep = _state$selection.autoTimeStep; - var timeStep = selectedTimeStep === 'auto' ? autoTimeStep : selectedTimeStep; - var continuousDateRange = getContinuousDatesArray(state.selection.dateRange); - var dataFetchTokens = new Set(); - var dataFetches = []; - var dataActions = []; + const { + timeStep: selectedTimeStep, + autoTimeStep + } = state.selection; + const timeStep = selectedTimeStep === 'auto' ? autoTimeStep : selectedTimeStep; + const continuousDateRange = getContinuousDatesArray(state.selection.dateRange); + const dataFetchTokens = new Set(); + const dataFetches = []; + const dataActions = []; // Track in local scope if we're going to be fetching metadata so we can hold off on // declaring there was no series data to fetch (not because we already loaded it but because // we haven't even initialized the loading of it). - var metaFetchTriggered = false; - var fetchSiteVariables = function fetchSiteVariables(siteCode, url) { + let metaFetchTriggered = false; + const fetchSiteVariables = (siteCode, url) => { dispatch({ type: 'fetchSiteVariables', - siteCode: siteCode + siteCode }); - fetchCSV(url).pipe((0, _rxjs.map)(function (response) { + fetchCSV(url).pipe((0, _rxjs.map)(response => { dispatch({ type: 'fetchSiteVariablesSucceeded', csv: response.response, - siteCode: siteCode + siteCode }); return (0, _rxjs.of)(true); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { dispatch({ type: 'fetchSiteVariablesFailed', error: error.message, - siteCode: siteCode + siteCode }); return (0, _rxjs.of)(false); })).subscribe(); }; - var fetchSitePositions = function fetchSitePositions(siteCode, url) { + const fetchSitePositions = (siteCode, url) => { dispatch({ type: 'fetchSitePositions', - siteCode: siteCode + siteCode }); - fetchCSV(url).pipe((0, _rxjs.map)(function (response) { + fetchCSV(url).pipe((0, _rxjs.map)(response => { dispatch({ type: 'fetchSitePositionsSucceeded', csv: response.response, - siteCode: siteCode + siteCode }); return (0, _rxjs.of)(true); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { dispatch({ type: 'fetchSitePositionsFailed', error: error.message, - siteCode: siteCode + siteCode }); return (0, _rxjs.of)(false); })).subscribe(); }; - var fetchNeededSiteMonths = function fetchNeededSiteMonths(siteCode, fetches) { - continuousDateRange.filter(function (month) { - return !fetches.siteMonths[month]; - }).forEach(function (month) { + const fetchNeededSiteMonths = (siteCode, fetches) => { + continuousDateRange.filter(month => !fetches.siteMonths[month]).forEach(month => { // Don't attempt to fetch any months that are known to be unavailable for a given site if (!state.product.sites[siteCode].availableMonths.includes(month)) { return; @@ -1629,88 +1562,90 @@ var Provider = function Provider(props) { metaFetchTriggered = true; dispatch({ type: 'fetchSiteMonth', - siteCode: siteCode, - month: month + siteCode, + month }); - _NeonApi.default.getJsonObservable(getSiteMonthDataURL(siteCode, month), _NeonApi.default.getApiTokenHeader()).pipe((0, _rxjs.map)(function (response) { + _NeonApi.default.getJsonObservable(getSiteMonthDataURL(siteCode, month), _NeonApi.default.getApiTokenHeader()).pipe((0, _rxjs.map)(response => { if (response && response.data && response.data.files) { dispatch({ type: 'fetchSiteMonthSucceeded', files: response.data.files, - siteCode: siteCode, - month: month + siteCode, + month }); return (0, _rxjs.of)(true); } dispatch({ type: 'fetchSiteMonthFailed', error: 'malformed response', - siteCode: siteCode, - month: month + siteCode, + month }); return (0, _rxjs.of)(false); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { dispatch({ type: 'fetchSiteMonthFailed', error: error.message, - siteCode: siteCode, - month: month + siteCode, + month }); return (0, _rxjs.of)(false); })).subscribe(); }); }; - var prepareDataFetches = function prepareDataFetches(site) { - var siteCode = site.siteCode, - positions = site.positions; - var fetchVariables = state.selection.variables.concat(state.selection.qualityFlags); - fetchVariables.forEach(function (variable) { - var downloadPkg = state.variables[variable].downloadPkg; - positions.forEach(function (position) { - continuousDateRange.forEach(function (month) { + const prepareDataFetches = site => { + const { + siteCode, + positions + } = site; + const fetchVariables = state.selection.variables.concat(state.selection.qualityFlags); + fetchVariables.forEach(variable => { + const { + downloadPkg + } = state.variables[variable]; + positions.forEach(position => { + continuousDateRange.forEach(month => { // eslint-disable-next-line max-len - var path = "sites['".concat(siteCode, "'].positions['").concat(position, "'].data['").concat(month, "']['").concat(downloadPkg, "']['").concat(timeStep, "']"); - var timeStepTables = (0, _get.default)(state.product, path, {}); - Object.keys(timeStepTables).forEach(function (tableName) { - var timeStepTable = timeStepTables[tableName]; - var url = timeStepTable.url, - status = timeStepTable.status; + const path = "sites['".concat(siteCode, "'].positions['").concat(position, "'].data['").concat(month, "']['").concat(downloadPkg, "']['").concat(timeStep, "']"); + const timeStepTables = (0, _get.default)(state.product, path, {}); + Object.keys(timeStepTables).forEach(tableName => { + const timeStepTable = timeStepTables[tableName]; + const { + url, + status + } = timeStepTable; // If the file isn't awaiting a fetch call then don't fetch it if (!url || status !== FETCH_STATUS.AWAITING_CALL) { return; } // Use the dataFetchTokens set to make sure we don't somehow add the same fetch twice - var previousSize = dataFetchTokens.size; - var token = "".concat(siteCode, ";").concat(position, ";").concat(month, ";").concat(downloadPkg, ";").concat(timeStep, ";").concat(tableName); + const previousSize = dataFetchTokens.size; + const token = "".concat(siteCode, ";").concat(position, ";").concat(month, ";").concat(downloadPkg, ";").concat(timeStep, ";").concat(tableName); dataFetchTokens.add(token); if (dataFetchTokens.size === previousSize) { return; } // Save the action props to pass to the fetchDataFiles // action to set all fetch statuses - var actionProps = { - siteCode: siteCode, - position: position, - month: month, - downloadPkg: downloadPkg, - timeStep: timeStep, + const actionProps = { + siteCode, + position, + month, + downloadPkg, + timeStep, table: tableName }; dataActions.push(actionProps); // Add a file fetch observable to the main list - dataFetches.push(fetchCSV(url).pipe((0, _rxjs.map)(function (response) { - return response.response; - }), (0, _rxjs.switchMap)(function (csv) { - return (0, _parseTimeSeriesData.default)({ - csv: csv, - variables: state.variables - }).then(function (series) { - dispatch(_extends({ - type: 'fetchDataFileSucceeded', - series: series - }, actionProps)); - }); - }), (0, _rxjs.catchError)(function (error) { + dataFetches.push(fetchCSV(url).pipe((0, _rxjs.map)(response => response.response), (0, _rxjs.switchMap)(csv => (0, _parseTimeSeriesData.default)({ + csv, + variables: state.variables + }).then(series => { + dispatch(_extends({ + type: 'fetchDataFileSucceeded', + series + }, actionProps)); + })), (0, _rxjs.catchError)(error => { dispatch(_extends({ type: 'fetchDataFileFailed', error: error.message @@ -1724,12 +1659,16 @@ var Provider = function Provider(props) { }; // MAIN LOOP - Trigger fetches as needed for all selected sites - state.selection.sites.forEach(function (site) { - var siteCode = site.siteCode; + state.selection.sites.forEach(site => { + const { + siteCode + } = site; if (!state.product.sites[siteCode]) { return; } - var fetches = state.product.sites[siteCode].fetches; + const { + fetches + } = state.product.sites[siteCode]; switch (state.mode) { case VIEWER_MODE.STATIC: // Fetch any site months in selection that have not been fetched @@ -1772,30 +1711,24 @@ var Provider = function Provider(props) { type: 'noDataFilesFetchNecessary' }); } else { - var masterFetchToken = "fetchDataFiles.".concat((0, _uniqueId.default)()); + const masterFetchToken = "fetchDataFiles.".concat((0, _uniqueId.default)()); dispatch({ type: 'fetchDataFiles', token: masterFetchToken, fetches: dataActions }); - (0, _rxUtil.forkJoinWithProgress)(dataFetches).pipe((0, _rxjs.mergeMap)(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - finalResult = _ref2[0], - progress = _ref2[1]; - return (0, _rxjs.merge)(progress.pipe((0, _rxjs.tap)(function (value) { - return dispatch({ - type: 'fetchDataFilesProgress', - token: masterFetchToken, - value: value - }); - }), (0, _rxjs.ignoreElements)()), finalResult); - })).subscribe(function (value) { - return dispatch({ - type: 'fetchDataFilesCompleted', + (0, _rxUtil.forkJoinWithProgress)(dataFetches).pipe((0, _rxjs.mergeMap)(_ref => { + let [finalResult, progress] = _ref; + return (0, _rxjs.merge)(progress.pipe((0, _rxjs.tap)(value => dispatch({ + type: 'fetchDataFilesProgress', token: masterFetchToken, - value: value - }); - }); + value + })), (0, _rxjs.ignoreElements)()), finalResult); + })).subscribe(value => dispatch({ + type: 'fetchDataFilesCompleted', + token: masterFetchToken, + value + })); } } }, [state.mode, state.status, state.selection, state.selection.digest, state.variables, state.product, state.release]); @@ -1815,10 +1748,12 @@ var Provider = function Provider(props) { /** Prop Types */ -var TimeSeriesViewerPropTypes = { - productCode: function productCode(props, propName, componentName) { - var productCode = props.productCode, - productData = props.productData; +const TimeSeriesViewerPropTypes = { + productCode: (props, propName, componentName) => { + const { + productCode, + productData + } = props; if (!productCode && !productData) { return new Error("One of props 'productCode' or 'productData' was not specified in '".concat(componentName, "'.")); } @@ -1830,20 +1765,18 @@ var TimeSeriesViewerPropTypes = { } return new Error("Props 'productCode' must be a non-empty string in '".concat(componentName, "'.")); }, - productData: function productData(props, propName, componentName) { - var productCode = props.productCode, - productData = props.productData; + productData: (props, propName, componentName) => { + const { + productCode, + productData + } = props; if (!productCode && !productData) { return new Error("One of props 'productCode' or 'productData' was not specified in '".concat(componentName, "'.")); } if (productCode && !productData) { return null; } - if (typeof productData.productCode !== 'string' || !productData.productCode.length || typeof productData.productName !== 'string' || !productData.productName.length || Array.isArray(productData.siteCodes) && !productData.siteCodes.every(function (siteObj) { - return typeof siteObj.siteCode === 'string' && siteObj.siteCode.length && Array.isArray(siteObj.availableMonths) && siteObj.availableMonths.every(function (month) { - return typeof month === 'string' && month.length; - }); - })) { + if (typeof productData.productCode !== 'string' || !productData.productCode.length || typeof productData.productName !== 'string' || !productData.productName.length || Array.isArray(productData.siteCodes) && !productData.siteCodes.every(siteObj => typeof siteObj.siteCode === 'string' && siteObj.siteCode.length && Array.isArray(siteObj.availableMonths) && siteObj.availableMonths.every(month => typeof month === 'string' && month.length))) { return new Error("Prop 'productData' is malformed in '".concat(componentName, "'.")); } return null; @@ -1868,30 +1801,27 @@ Provider.defaultProps = { /** Export */ -var TimeSeriesViewerContext = { - Provider: Provider, - useTimeSeriesViewerState: useTimeSeriesViewerState, - TimeSeriesViewerPropTypes: TimeSeriesViewerPropTypes +const TimeSeriesViewerContext = { + Provider, + useTimeSeriesViewerState, + TimeSeriesViewerPropTypes }; -var _default = TimeSeriesViewerContext; // Additional items exported for unit testing -exports.default = _default; -var getTestableItems = function getTestableItems() { - return process.env.NODE_ENV !== 'test' ? {} : { - DEFAULT_STATE: DEFAULT_STATE, - FETCH_STATUS: FETCH_STATUS, - applyDefaultsToSelection: applyDefaultsToSelection, - generateYAxisRange: generateYAxisRange, - getTimeStep: getTimeStep, - getUpdatedValueRange: getUpdatedValueRange, - getContinuousDatesArray: getContinuousDatesArray, - limitVariablesToTwoUnits: limitVariablesToTwoUnits, - parseProductData: parseProductData, - parseSiteMonthData: parseSiteMonthData, - parseSiteVariables: parseSiteVariables, - parseSitePositions: parseSitePositions, - reducer: reducer, - setDataFileFetchStatuses: setDataFileFetchStatuses, - TimeSeriesViewerPropTypes: TimeSeriesViewerPropTypes - }; +var _default = exports.default = TimeSeriesViewerContext; // Additional items exported for unit testing +const getTestableItems = () => process.env.NODE_ENV !== 'test' ? {} : { + DEFAULT_STATE, + FETCH_STATUS, + applyDefaultsToSelection, + generateYAxisRange, + getTimeStep, + getUpdatedValueRange, + getContinuousDatesArray, + limitVariablesToTwoUnits, + parseProductData, + parseSiteMonthData, + parseSiteVariables, + parseSitePositions, + reducer, + setDataFileFetchStatuses, + TimeSeriesViewerPropTypes }; exports.getTestableItems = getTestableItems; \ No newline at end of file diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerDateRange.js b/lib/components/TimeSeriesViewer/TimeSeriesViewerDateRange.js index 6e49a0a0..dfe5a807 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerDateRange.js +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerDateRange.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -24,127 +23,102 @@ var _ReleaseService = _interopRequireDefault(require("../../service/ReleaseServi var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _TimeSeriesViewerContext = _interopRequireDefault(require("./TimeSeriesViewerContext")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -var getYearMonthMoment = function getYearMonthMoment(yearMonth) { - var day = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 15; +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const getYearMonthMoment = function (yearMonth) { + let day = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 15; return (0, _moment2.default)("".concat(yearMonth, "-").concat(day.toString().padStart(2, '0'))); }; -var svgMinWidth = (_AvailabilityUtils.SVG.CELL_WIDTH + _AvailabilityUtils.SVG.CELL_PADDING) * _AvailabilityUtils.SVG.MIN_CELLS + Math.floor(_AvailabilityUtils.SVG.MIN_CELLS / 12) * _AvailabilityUtils.SVG.YEAR_PADDING; -var svgMinHeight = (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING) * (_AvailabilityUtils.SVG.MIN_ROWS + 1); -var useStyles = (0, _styles.makeStyles)(function () { - return { - svg: { - minWidth: "".concat(svgMinWidth, "px"), - minHeight: "".concat(svgMinHeight, "px") - }, - optionsContainer: { - display: 'flex', - alignItems: 'flex-start', - justifyContent: 'flex-start', - flexWrap: 'wrap' - }, - optionContainer: { - marginRight: _Theme.default.spacing(5), - flexGrow: 1, - flexBasis: 0.5 - }, - slider: { - minWidth: _Theme.default.spacing(40), - width: "calc(100% - ".concat(_Theme.default.spacing(6), "px)"), - marginLeft: _Theme.default.spacing(3), - marginBottom: _Theme.default.spacing(4) - } - }; -}); -var TimeSeriesViewerDateRange = function TimeSeriesViewerDateRange(props) { - var classes = useStyles(_Theme.default); - var dateRangeSliderRef = props.dateRangeSliderRef; - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - neonContextData = _NeonContext$useNeonC2[0].data; - var allSites = neonContextData.sites; - var _TimeSeriesViewerCont = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont2 = _slicedToArray(_TimeSeriesViewerCont, 2), - state = _TimeSeriesViewerCont2[0], - dispatch = _TimeSeriesViewerCont2[1]; - var currentRange = state.selection.dateRange; - var selectableRange = state.product.dateRange; - var displayRange = state.product.continuousDateRange; - var displayMin = 0; - var displayMax = displayRange.length - 1; - var sliderMin = displayRange.indexOf(selectableRange[0]); - var sliderMax = displayRange.indexOf(selectableRange[1]); - var _useState = (0, _react.useState)(_toConsumableArray(currentRange)), - _useState2 = _slicedToArray(_useState, 2), - activelySelectingDateRange = _useState2[0], - setActivelySelectingDateRange = _useState2[1]; - var _useState3 = (0, _react.useState)(false), - _useState4 = _slicedToArray(_useState3, 2), - activelySelecting = _useState4[0], - setActivelySelecting = _useState4[1]; - var sliderValue = activelySelectingDateRange.map(function (v, i) { - return displayRange.indexOf(activelySelectingDateRange[i] || currentRange[i]); - }); - (0, _react.useEffect)(function () { +const svgMinWidth = (_AvailabilityUtils.SVG.CELL_WIDTH + _AvailabilityUtils.SVG.CELL_PADDING) * _AvailabilityUtils.SVG.MIN_CELLS + Math.floor(_AvailabilityUtils.SVG.MIN_CELLS / 12) * _AvailabilityUtils.SVG.YEAR_PADDING; +const svgMinHeight = (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING) * (_AvailabilityUtils.SVG.MIN_ROWS + 1); +const useStyles = (0, _styles.makeStyles)(() => ({ + svg: { + minWidth: "".concat(svgMinWidth, "px"), + minHeight: "".concat(svgMinHeight, "px") + }, + optionsContainer: { + display: 'flex', + alignItems: 'flex-start', + justifyContent: 'flex-start', + flexWrap: 'wrap' + }, + optionContainer: { + marginRight: _Theme.default.spacing(5), + flexGrow: 1, + flexBasis: 0.5 + }, + slider: { + minWidth: _Theme.default.spacing(40), + width: "calc(100% - ".concat(_Theme.default.spacing(6), "px)"), + marginLeft: _Theme.default.spacing(3), + marginBottom: _Theme.default.spacing(4) + } +})); +const TimeSeriesViewerDateRange = props => { + const classes = useStyles(_Theme.default); + const { + dateRangeSliderRef + } = props; + const [{ + data: neonContextData + }] = _NeonContext.default.useNeonContextState(); + const { + sites: allSites + } = neonContextData; + const [state, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const { + dateRange: currentRange + } = state.selection; + const selectableRange = state.product.dateRange; + const displayRange = state.product.continuousDateRange; + const displayMin = 0; + const displayMax = displayRange.length - 1; + const sliderMin = displayRange.indexOf(selectableRange[0]); + const sliderMax = displayRange.indexOf(selectableRange[1]); + const [activelySelectingDateRange, setActivelySelectingDateRange] = (0, _react.useState)([...currentRange]); + const [activelySelecting, setActivelySelecting] = (0, _react.useState)(false); + const sliderValue = activelySelectingDateRange.map((v, i) => displayRange.indexOf(activelySelectingDateRange[i] || currentRange[i])); + (0, _react.useEffect)(() => { if ((currentRange[0] !== activelySelectingDateRange[0] || currentRange[1] !== activelySelectingDateRange[1]) && !activelySelecting) { - setActivelySelectingDateRange(_toConsumableArray(currentRange)); + setActivelySelectingDateRange([...currentRange]); } }, [activelySelecting, activelySelectingDateRange, setActivelySelectingDateRange, currentRange]); // Derive site and availability values for the AvailabilityGrid // eslint-disable-next-line react-hooks/exhaustive-deps - var availabilityDateRange = { + const availabilityDateRange = { value: currentRange, validValues: selectableRange }; - var selectedSites = state.selection.sites.map(function (site) { - return site.siteCode; - }); + const selectedSites = state.selection.sites.map(site => site.siteCode); // eslint-disable-next-line react-hooks/exhaustive-deps - var availabilitySites = { + const availabilitySites = { value: selectedSites, validValues: selectedSites }; // eslint-disable-next-line react-hooks/exhaustive-deps - var availabilityData = { + const availabilityData = { view: 'sites', name: 'Site', selectable: true, rows: {}, getLabel: { - text: function text(key) { - return key; - }, - title: function title(key) { - return allSites[key] ? allSites[key].description : key; - } + text: key => key, + title: key => allSites[key] ? allSites[key].description : key } }; - selectedSites.forEach(function (siteCode) { - var provAvailableMonths = []; - var avaReleases = state.product.sites[siteCode].availableReleases; + selectedSites.forEach(siteCode => { + let provAvailableMonths = []; + const avaReleases = state.product.sites[siteCode].availableReleases; if (Array.isArray(avaReleases)) { - var provRelease = avaReleases.find(function (value) { - return value.release === 'PROVISIONAL'; - }); + const provRelease = avaReleases.find(value => value.release === 'PROVISIONAL'); if (provRelease) { provAvailableMonths = provRelease.availableMonths; } } availabilityData.rows[siteCode] = {}; - state.product.sites[siteCode].availableMonths.forEach(function (month) { - var status = 'available'; + state.product.sites[siteCode].availableMonths.forEach(month => { + let status = 'available'; if (provAvailableMonths && provAvailableMonths.length > 0) { if (provAvailableMonths.includes(month)) { status = 'available-provisional'; @@ -156,27 +130,25 @@ var TimeSeriesViewerDateRange = function TimeSeriesViewerDateRange(props) { availabilityData.rows[siteCode][month].add(status); }); }); - var svgHeight = _AvailabilityUtils.SVG.CELL_PADDING + (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING) * (selectedSites.length + 1); + const svgHeight = _AvailabilityUtils.SVG.CELL_PADDING + (_AvailabilityUtils.SVG.CELL_HEIGHT + _AvailabilityUtils.SVG.CELL_PADDING) * (selectedSites.length + 1); // Set up AvailabilityGrid - var setDateRangeValue = (0, _react.useCallback)(function (dateRange) { - return dispatch({ - type: 'selectDateRange', - dateRange: dateRange - }); - }, [dispatch]); - var svgRef = (0, _react.useRef)(null); - var handleSvgRedraw = (0, _react.useCallback)(function () { + const setDateRangeValue = (0, _react.useCallback)(dateRange => dispatch({ + type: 'selectDateRange', + dateRange + }), [dispatch]); + const svgRef = (0, _react.useRef)(null); + const handleSvgRedraw = (0, _react.useCallback)(() => { (0, _BasicAvailabilityGrid.default)({ data: availabilityData, - svgRef: svgRef, - allSites: allSites, + svgRef, + allSites, sites: availabilitySites, dateRange: availabilityDateRange, - setDateRangeValue: setDateRangeValue + setDateRangeValue }); }, [svgRef, allSites, availabilityData, availabilitySites, availabilityDateRange, setDateRangeValue]); - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { handleSvgRedraw(); }); @@ -213,13 +185,13 @@ var TimeSeriesViewerDateRange = function TimeSeriesViewerDateRange(props) { height: 80 })); } - var marks = [{ + const marks = [{ value: displayMin, label: displayRange[displayMin].substring(0, 4) }]; - var yearsInSlider = Math.floor(displayRange.length / 12); - var innerMark = Math.ceil(yearsInSlider / Math.ceil(yearsInSlider % 3 ? 2 : 3)); - for (var y = 1; y < yearsInSlider; y += 1) { + const yearsInSlider = Math.floor(displayRange.length / 12); + const innerMark = Math.ceil(yearsInSlider / Math.ceil(yearsInSlider % 3 ? 2 : 3)); + for (let y = 1; y < yearsInSlider; y += 1) { marks.push({ value: 12 * y, label: y === innerMark || y === innerMark * 2 ? displayRange[12 * y].substring(0, 4) : null @@ -229,25 +201,23 @@ var TimeSeriesViewerDateRange = function TimeSeriesViewerDateRange(props) { value: displayMax, label: displayRange[displayMax].substring(0, 4) }); - var handleChangeDatePicker = function handleChangeDatePicker(rangeIndex, value) { + const handleChangeDatePicker = (rangeIndex, value) => { // Confirm arguments are sane - var formattedValue = value.format('YYYY-MM'); - var newSliderValue = displayRange.indexOf(formattedValue); + const formattedValue = value.format('YYYY-MM'); + const newSliderValue = displayRange.indexOf(formattedValue); if (!formattedValue || ![0, 1].includes(rangeIndex) || newSliderValue === -1) { return; } // Generate new selected dateRange bounded by min/max - var dateRange = [currentRange[0] === null ? displayRange[sliderMin] : currentRange[0], currentRange[1] === null ? displayRange[sliderMax] : currentRange[1]]; + const dateRange = [currentRange[0] === null ? displayRange[sliderMin] : currentRange[0], currentRange[1] === null ? displayRange[sliderMax] : currentRange[1]]; dateRange[rangeIndex] = formattedValue; dispatch({ type: 'selectDateRange', - dateRange: dateRange + dateRange }); }; - var uniqueSliderMarks = new Set((marks || []).map(function (m) { - return m.value; - })).size; - var renderedSlider = uniqueSliderMarks <= 1 ? null : /*#__PURE__*/_react.default.createElement(_Slider.default, { + const uniqueSliderMarks = new Set((marks || []).map(m => m.value)).size; + const renderedSlider = uniqueSliderMarks <= 1 ? null : /*#__PURE__*/_react.default.createElement(_Slider.default, { "data-selenium": "time-series-viewer.date-range.slider", className: classes.slider, ref: dateRangeSliderRef, @@ -256,24 +226,18 @@ var TimeSeriesViewerDateRange = function TimeSeriesViewerDateRange(props) { min: displayMin, max: displayMax, marks: marks, - valueLabelFormat: function valueLabelFormat(x) { - return displayRange[x]; - }, - onMouseDown: function onMouseDown() { + valueLabelFormat: x => displayRange[x], + onMouseDown: () => { setActivelySelecting(true); }, - onChange: function onChange(event, values) { - setActivelySelectingDateRange([Math.max(values[0], sliderMin), Math.min(values[1], sliderMax)].map(function (x) { - return displayRange[x]; - })); + onChange: (event, values) => { + setActivelySelectingDateRange([Math.max(values[0], sliderMin), Math.min(values[1], sliderMax)].map(x => displayRange[x])); }, - onChangeCommitted: function onChangeCommitted(event, values) { + onChangeCommitted: (event, values) => { setActivelySelecting(false); dispatch({ type: 'selectDateRange', - dateRange: [Math.max(values[0], sliderMin), Math.min(values[1], sliderMax)].map(function (x) { - return displayRange[x]; - }) + dateRange: [Math.max(values[0], sliderMin), Math.min(values[1], sliderMax)].map(x => displayRange[x]) }); } }); @@ -305,9 +269,7 @@ var TimeSeriesViewerDateRange = function TimeSeriesViewerDateRange(props) { margin: "dense", orientation: "portrait", value: getYearMonthMoment(currentRange[0] || displayRange[sliderMin]), - onChange: function onChange(value) { - return handleChangeDatePicker(0, value); - }, + onChange: value => handleChangeDatePicker(0, value), views: ['month', 'year'], label: "Start", openTo: "month", @@ -319,9 +281,7 @@ var TimeSeriesViewerDateRange = function TimeSeriesViewerDateRange(props) { margin: "dense", orientation: "portrait", value: getYearMonthMoment(currentRange[1] || displayRange[sliderMax]), - onChange: function onChange(value) { - return handleChangeDatePicker(1, value); - }, + onChange: value => handleChangeDatePicker(1, value), views: ['month', 'year'], label: "End", openTo: "month", @@ -349,8 +309,7 @@ var TimeSeriesViewerDateRange = function TimeSeriesViewerDateRange(props) { delineateRelease: _ReleaseService.default.determineDelineateAvaRelease(state.release) }))); }; -var _default = TimeSeriesViewerDateRange; -exports.default = _default; +var _default = exports.default = TimeSeriesViewerDateRange; TimeSeriesViewerDateRange.propTypes = { dateRangeSliderRef: _propTypes.default.shape({ current: _propTypes.default.instanceOf(Element) diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerGraph.js b/lib/components/TimeSeriesViewer/TimeSeriesViewerGraph.js index 9d0ee1fd..d960c37d 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerGraph.js +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerGraph.js @@ -29,23 +29,9 @@ var _constants = require("./constants"); var _typeUtil = require("../../util/typeUtil"); var _NSFNEONLogo = _interopRequireDefault(require("../../images/NSF-NEON-logo.png")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint-disable no-underscore-dangle */ +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable no-underscore-dangle */ // Load Dygraph plugins. These are not built as modules and require a global Dygraph instance. =( if (!window.Dygraph) { window.Dygraph = _dygraphs.default; @@ -54,9 +40,9 @@ if (!window.Dygraph) { require('dygraphs/src/extras/shapes.js'); // eslint-disable-next-line import/extensions require('dygraphs/src/extras/crosshair.js'); -var SERIES_COLORS = ['#4e79a7', '#f28e2c', '#e15759', '#76b7b2', '#59a14f', '#edc949', '#af7aa1', '#ff9da7', '#9c755f', '#bab0ab']; -var QUALITY_COLORS = ['#8dd3c7', '#f9f986', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f']; -var BASE_GRAPH_OPTIONS = { +const SERIES_COLORS = ['#4e79a7', '#f28e2c', '#e15759', '#76b7b2', '#59a14f', '#edc949', '#af7aa1', '#ff9da7', '#9c755f', '#bab0ab']; +const QUALITY_COLORS = ['#8dd3c7', '#f9f986', '#bebada', '#fb8072', '#80b1d3', '#fdb462', '#b3de69', '#fccde5', '#d9d9d9', '#bc80bd', '#ccebc5', '#ffed6f']; +const BASE_GRAPH_OPTIONS = { includeZero: true, labelsUTC: true, labelsKMB: false, @@ -70,7 +56,7 @@ var BASE_GRAPH_OPTIONS = { highlightSeriesBackgroundAlpha: 1, highlightSeriesOpts: { strokeWidth: 1.5, - drawHighlightPointCallback: function drawHighlightPointCallback(g, name, ctx, cx, cy, color) { + drawHighlightPointCallback: (g, name, ctx, cx, cy, color) => { ctx.lineWidth = 2; return _dygraphs.default.Circles.SQUARE(g, name, ctx, cx, cy, color, 6); } @@ -79,118 +65,120 @@ var BASE_GRAPH_OPTIONS = { direction: 'vertical' })] }; -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - graphOuterContainer: { - backgroundColor: '#ffffff', - padding: theme.spacing(2) - }, - graphInnerContainer: _defineProperty({ - display: 'flex', - alignItems: 'flex-start' - }, theme.breakpoints.down('sm'), { +const useStyles = (0, _styles.makeStyles)(theme => ({ + graphOuterContainer: { + backgroundColor: '#ffffff', + padding: theme.spacing(2) + }, + graphInnerContainer: { + display: 'flex', + alignItems: 'flex-start', + [theme.breakpoints.down('sm')]: { flexWrap: 'wrap' - }), - graphDiv: _defineProperty({ - minHeight: '320px', - flexGrow: 1, - width: '50%' - }, theme.breakpoints.down('sm'), { + } + }, + graphDiv: { + minHeight: '320px', + flexGrow: 1, + width: '50%', + [theme.breakpoints.down('sm')]: { width: '100%' - }), - buttonsOuterContainer: _defineProperty({ - margin: theme.spacing(0, -0.5, 0, -0.5), - borderTop: "1.5px solid ".concat(_Theme.COLORS.GREY[200]), - backgroundColor: theme.palette.grey[50], - padding: theme.spacing(2) - }, theme.breakpoints.up('md'), { + } + }, + buttonsOuterContainer: { + margin: theme.spacing(0, -0.5, 0, -0.5), + borderTop: "1.5px solid ".concat(_Theme.COLORS.GREY[200]), + backgroundColor: theme.palette.grey[50], + padding: theme.spacing(2), + [theme.breakpoints.up('md')]: { padding: theme.spacing(1.5) - }), - buttonsInnerContainer: { - display: 'flex', - marginTop: theme.spacing(-1.5), - alignItems: 'center', - justifyContent: 'space-between', - flexWrap: 'wrap' - }, - citationContainer: { - marginTop: _Theme.default.spacing(2), - display: 'flex', - alignItems: 'center', - justifyContent: 'flex-start' - }, - citation: { - color: _Theme.default.palette.grey[400] - }, - title: { - textAlign: 'center', - marginBottom: theme.spacing(1.5) - }, - neonLogo: { - maxHeight: theme.spacing(5), - marginRight: theme.spacing(2) - }, - legendDiv: _defineProperty({ - flexShrink: 0, - marginLeft: theme.spacing(1) - }, theme.breakpoints.down('sm'), { + } + }, + buttonsInnerContainer: { + display: 'flex', + marginTop: theme.spacing(-1.5), + alignItems: 'center', + justifyContent: 'space-between', + flexWrap: 'wrap' + }, + citationContainer: { + marginTop: _Theme.default.spacing(2), + display: 'flex', + alignItems: 'center', + justifyContent: 'flex-start' + }, + citation: { + color: _Theme.default.palette.grey[400] + }, + title: { + textAlign: 'center', + marginBottom: theme.spacing(1.5) + }, + neonLogo: { + maxHeight: theme.spacing(5), + marginRight: theme.spacing(2) + }, + legendDiv: { + flexShrink: 0, + marginLeft: theme.spacing(1), + [theme.breakpoints.down('sm')]: { width: '100%', marginTop: theme.spacing(2) - }), - legendSeries: { - display: 'flex', - alignItems: 'center', - justifyContent: 'flex-start', - flexWrap: 'nowrap', - padding: theme.spacing(1), - marginBottom: theme.spacing(1), - backgroundColor: theme.palette.grey[50], - cursor: 'pointer', - '&:hover': { - backgroundColor: '#fff', - borderColor: theme.palette.primary.main - } - }, - legendSeriesActive: { - backgroundColor: '#fff', - borderColor: theme.palette.primary.main - }, - legendSeriesX: { - whiteSpace: 'nowrap', - textAlign: 'center', - fontWeight: 600, - padding: theme.spacing(1), + } + }, + legendSeries: { + display: 'flex', + alignItems: 'center', + justifyContent: 'flex-start', + flexWrap: 'nowrap', + padding: theme.spacing(1), + marginBottom: theme.spacing(1), + backgroundColor: theme.palette.grey[50], + cursor: 'pointer', + '&:hover': { backgroundColor: '#fff', borderColor: theme.palette.primary.main - }, - legendSeriesColor: { - width: theme.spacing(3), - height: '4px', - pointerEvents: 'none' - }, - legendSeriesLabel: { - whiteSpace: 'nowrap', - lineHeight: '1rem', - fontSize: '0.7rem', - marginLeft: theme.spacing(1), - pointerEvents: 'none' - }, - legendQualityColor: { - width: '4px', - height: theme.spacing(3), - margin: theme.spacing(0, 1.25, 0, 1.25), - pointerEvents: 'none' } - }; -}); -var INITIAL_GRAPH_STATE = { + }, + legendSeriesActive: { + backgroundColor: '#fff', + borderColor: theme.palette.primary.main + }, + legendSeriesX: { + whiteSpace: 'nowrap', + textAlign: 'center', + fontWeight: 600, + padding: theme.spacing(1), + backgroundColor: '#fff', + borderColor: theme.palette.primary.main + }, + legendSeriesColor: { + width: theme.spacing(3), + height: '4px', + pointerEvents: 'none' + }, + legendSeriesLabel: { + whiteSpace: 'nowrap', + lineHeight: '1rem', + fontSize: '0.7rem', + marginLeft: theme.spacing(1), + pointerEvents: 'none' + }, + legendQualityColor: { + width: '4px', + height: theme.spacing(3), + margin: theme.spacing(0, 1.25, 0, 1.25), + pointerEvents: 'none' + } +})); +const INITIAL_GRAPH_STATE = { hiddenSeries: new Set(), hiddenQualityFlags: new Set(), pngDimensions: [0, 0] }; -var graphReducer = function graphReducer(state, action) { - var newState = _extends({}, state); - var key = null; +const graphReducer = (state, action) => { + const newState = _extends({}, state); + let key = null; switch (action.type) { case 'reinitialize': return (0, _cloneDeep.default)(INITIAL_GRAPH_STATE); @@ -220,21 +208,19 @@ var graphReducer = function graphReducer(state, action) { } return newState; case 'purgeRemovedHiddenLabels': - Array.from(state.hiddenSeries).forEach(function (label) { + Array.from(state.hiddenSeries).forEach(label => { if (!action.seriesLabels.includes(label)) { newState.hiddenSeries.delete(label); } }); - Array.from(state.hiddenQualityFlags).forEach(function (label) { + Array.from(state.hiddenQualityFlags).forEach(label => { if (!action.qualityLabels.includes(label)) { newState.hiddenQualityFlags.delete(label); } }); return newState; case 'setPngDimensions': - if (!(Array.isArray(action.dimensions) && action.dimensions.length === 2 && action.dimensions.every(function (v) { - return typeof v === 'number' && v >= 0; - }))) { + if (!(Array.isArray(action.dimensions) && action.dimensions.length === 2 && action.dimensions.every(v => typeof v === 'number' && v >= 0))) { return state; } newState.pngDimensions = action.dimensions; @@ -244,37 +230,32 @@ var graphReducer = function graphReducer(state, action) { } }; function TimeSeriesViewerGraph() { - var classes = useStyles(_Theme.default); - var _TimeSeriesViewerCont = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont2 = _slicedToArray(_TimeSeriesViewerCont, 2), - state = _TimeSeriesViewerCont2[0], - dispatch = _TimeSeriesViewerCont2[1]; - var _useReducer = (0, _react.useReducer)(graphReducer, (0, _cloneDeep.default)(INITIAL_GRAPH_STATE)), - _useReducer2 = _slicedToArray(_useReducer, 2), - graphState = _useReducer2[0], - graphDispatch = _useReducer2[1]; - var downloadRef = (0, _react.useRef)(null); - var dygraphRef = (0, _react.useRef)(null); - var dygraphDomRef = (0, _react.useRef)(null); - var graphInnerContainerRef = (0, _react.useRef)(null); - var legendRef = (0, _react.useRef)(null); - var axisCountRef = (0, _react.useRef)(1); - var axisCountChangedRef = (0, _react.useRef)(false); - var belowSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('sm')); - var _state$selection = state.selection, - selectionDigest = _state$selection.selectionDigest, - logscale = _state$selection.logscale, - qualityFlags = _state$selection.qualityFlags, - rollPeriod = _state$selection.rollPeriod, - yAxes = _state$selection.yAxes; + const classes = useStyles(_Theme.default); + const [state, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const [graphState, graphDispatch] = (0, _react.useReducer)(graphReducer, (0, _cloneDeep.default)(INITIAL_GRAPH_STATE)); + const downloadRef = (0, _react.useRef)(null); + const dygraphRef = (0, _react.useRef)(null); + const dygraphDomRef = (0, _react.useRef)(null); + const graphInnerContainerRef = (0, _react.useRef)(null); + const legendRef = (0, _react.useRef)(null); + const axisCountRef = (0, _react.useRef)(1); + const axisCountChangedRef = (0, _react.useRef)(false); + const belowSm = (0, _useMediaQuery.default)(_Theme.default.breakpoints.down('sm')); + const { + selectionDigest, + logscale, + qualityFlags, + rollPeriod, + yAxes + } = state.selection; // let data = cloneDeep(NULL_DATA); - var graphOptions = (0, _cloneDeep.default)(BASE_GRAPH_OPTIONS); + let graphOptions = (0, _cloneDeep.default)(BASE_GRAPH_OPTIONS); // Build the axes option - var buildAxesOption = function buildAxesOption() { - var axes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var axesOption = { + const buildAxesOption = function () { + let axes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + const axesOption = { x: { valueFormatter: _dygraphs.default.dateString_, ticker: _dygraphs.default.dateTicker, @@ -282,33 +263,34 @@ function TimeSeriesViewerGraph() { axisLineWidth: 1.5 } }; - axes.forEach(function (axis) { - var stateAxis = axis.axis === 'y' ? 'y1' : 'y2'; - var _state$selection$yAxe = state.selection.yAxes[stateAxis], - axisRange = _state$selection$yAxe.axisRange, - precision = _state$selection$yAxe.precision; - var axisLabelWidth = precision > 3 ? 75 : 50; - var nonZeroFloor = parseFloat(Math.pow(10, -1 * (precision + 1)).toFixed(precision + 1), 10); - var valueRange = state.selection.logscale ? [axisRange[0] <= 0 ? nonZeroFloor : axisRange[0], axisRange[1]] : _toConsumableArray(axisRange); + axes.forEach(axis => { + const stateAxis = axis.axis === 'y' ? 'y1' : 'y2'; + const { + axisRange, + precision + } = state.selection.yAxes[stateAxis]; + const axisLabelWidth = precision > 3 ? 75 : 50; + const nonZeroFloor = parseFloat((10 ** (-1 * (precision + 1))).toFixed(precision + 1), 10); + const valueRange = state.selection.logscale ? [axisRange[0] <= 0 ? nonZeroFloor : axisRange[0], axisRange[1]] : [...axisRange]; axesOption[axis.axis] = { independentTicks: true, axisLineWidth: 1.5, - axisLabelWidth: axisLabelWidth, - valueRange: valueRange + axisLabelWidth, + valueRange }; }); return axesOption; }; // Build the series option - var buildSeriesOption = function buildSeriesOption() { - var axes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var series = state.graphData.series; - var seriesOption = {}; - series.forEach(function (s) { - var axis = axes.find(function (a) { - return a.units === s.units; - }); + const buildSeriesOption = function () { + let axes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + const { + series + } = state.graphData; + const seriesOption = {}; + series.forEach(s => { + const axis = axes.find(a => a.units === s.units); if (!axis) { return; } @@ -318,7 +300,7 @@ function TimeSeriesViewerGraph() { }); return seriesOption; }; - var calcLegendHeight = function calcLegendHeight() { + const calcLegendHeight = () => { // In order to support hover over coordinate value display for wrapped / small // viewports, we need to give the legend a set height with enough padding to render the // hover over value that causes the height of the element to expand. If we don't @@ -326,20 +308,21 @@ function TimeSeriesViewerGraph() { // and cause flickering as it will constantly re-render and never show // the hover value. Determine height based on number of legend items. if (belowSm) { - var _state$graphData = state.graphData, - _series = _state$graphData.series, - _qualityLabels = _state$graphData.qualityLabels; - var appliedQualityLabels = []; + const { + series, + qualityLabels + } = state.graphData; + let appliedQualityLabels = []; if (qualityFlags.length) { - appliedQualityLabels = _qualityLabels.slice(2); + appliedQualityLabels = qualityLabels.slice(2); } // Account for single legend item containing multiple labels - var hasQualityLabels = appliedQualityLabels.length > 0; - var qualityLabelsHeightPadding = hasQualityLabels && qualityFlags.length > 1 ? (qualityFlags.length - 1) * 16 : 0; - var numLegendItems = _series ? _series.length : 0; - var qualityLabelHeight = (hasQualityLabels ? 50 : 0) + qualityLabelsHeightPadding; + const hasQualityLabels = appliedQualityLabels.length > 0; + const qualityLabelsHeightPadding = hasQualityLabels && qualityFlags.length > 1 ? (qualityFlags.length - 1) * 16 : 0; + const numLegendItems = series ? series.length : 0; + const qualityLabelHeight = (hasQualityLabels ? 50 : 0) + qualityLabelsHeightPadding; if (numLegendItems > 0) { - var appliedHeight = numLegendItems * 50 + numLegendItems * 10 + qualityLabelHeight + 15; + const appliedHeight = numLegendItems * 50 + numLegendItems * 10 + qualityLabelHeight + 15; // Sanity check if (appliedHeight <= 0) { return 'auto'; @@ -349,31 +332,34 @@ function TimeSeriesViewerGraph() { } return 'auto'; }; - var legendFormatter = function legendFormatter(graphData) { - var _state$graphData2 = state.graphData, - series = _state$graphData2.series, - qualityData = _state$graphData2.qualityData, - timestampMap = _state$graphData2.timestampMap, - qualityLabels = _state$graphData2.qualityLabels; + const legendFormatter = graphData => { + const { + series, + qualityData, + timestampMap, + qualityLabels + } = state.graphData; // Series - var seriesLegend = graphData.series.map(function (s, idx) { - var isHidden = graphState.hiddenSeries.has(s.label); - var units = series[idx].units; - var yUnits = units; + const seriesLegend = graphData.series.map((s, idx) => { + const isHidden = graphState.hiddenSeries.has(s.label); + const { + units + } = series[idx]; + let yUnits = units; if (typeof s.y === 'number' && !Number.isNaN(s.y)) { - var yStr = s.y.toString(); + let yStr = s.y.toString(); if (yStr.indexOf('.') !== -1 && yStr.length - yStr.indexOf('.') > 3) { yStr = s.y.toFixed(2).toString(); } - var yUnitsStr = "".concat(yStr, " ").concat(units); + const yUnitsStr = "".concat(yStr, " ").concat(units); yUnits = s.isHighlighted ? /*#__PURE__*/_react.default.createElement("b", null, yUnitsStr) : yUnitsStr; } - var className = s.isHighlighted ? "".concat(classes.legendSeries, " ").concat(classes.legendSeriesActive) : classes.legendSeries; - var seriesStyle = {}; + const className = s.isHighlighted ? "".concat(classes.legendSeries, " ").concat(classes.legendSeriesActive) : classes.legendSeries; + const seriesStyle = {}; if (isHidden) { seriesStyle.opacity = 0.5; } - var colorStyle = { + const colorStyle = { backgroundColor: s.color || _Theme.default.palette.grey[200] }; if (s.isHighlighted) { @@ -395,22 +381,20 @@ function TimeSeriesViewerGraph() { }, s.label, /*#__PURE__*/_react.default.createElement("br", null), yUnits, !belowSm || !s.isHighlighted ? null : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("br", null), _moment.default.utc(graphData.x).format('YYYY-MM-DD HH:mm:ss')))); }); // Quality Flags - var qualityFlagsLegend = null; + let qualityFlagsLegend = null; if (qualityFlags.length) { - var qfOffset = timestampMap[graphData.x]; - var qfData = qualityData[qfOffset] ? qualityData[qfOffset].slice(2) : null; - qualityFlagsLegend = qualityLabels.slice(2).map(function (qualityLabel, qlIdx) { - var isHidden = graphState.hiddenQualityFlags.has(qualityLabel); - var isHighlighted = graphData.series.some(function (s) { - return s.isHighlighted && s.label.includes(qualityLabel); - }); - var qualityStyle = isHighlighted ? { + const qfOffset = timestampMap[graphData.x]; + const qfData = qualityData[qfOffset] ? qualityData[qfOffset].slice(2) : null; + qualityFlagsLegend = qualityLabels.slice(2).map((qualityLabel, qlIdx) => { + const isHidden = graphState.hiddenQualityFlags.has(qualityLabel); + const isHighlighted = graphData.series.some(s => s.isHighlighted && s.label.includes(qualityLabel)); + const qualityStyle = isHighlighted ? { backgroundColor: _Theme.default.palette.grey[100] } : {}; if (isHidden) { qualityStyle.opacity = 0.5; } - var colorStyle = { + const colorStyle = { backgroundColor: QUALITY_COLORS[qlIdx % 12] }; return /*#__PURE__*/_react.default.createElement("div", { @@ -425,20 +409,18 @@ function TimeSeriesViewerGraph() { style: colorStyle }), /*#__PURE__*/_react.default.createElement("div", { className: classes.legendSeriesLabel - }, "".concat(qualityLabel, " - Quality Flags"), /*#__PURE__*/_react.default.createElement("br", null), qualityFlags.map(function (qf, qfIdx) { - return qfData === null || !qfData[qlIdx] ? /*#__PURE__*/_react.default.createElement("div", { - key: qf - }, qf) : /*#__PURE__*/_react.default.createElement("div", { - key: qf, - style: isHighlighted ? { - fontWeight: 600 - } : {} - }, "".concat(qfData[qlIdx][qfIdx], " - ").concat(qf)); - }))); + }, "".concat(qualityLabel, " - Quality Flags"), /*#__PURE__*/_react.default.createElement("br", null), qualityFlags.map((qf, qfIdx) => qfData === null || !qfData[qlIdx] ? /*#__PURE__*/_react.default.createElement("div", { + key: qf + }, qf) : /*#__PURE__*/_react.default.createElement("div", { + key: qf, + style: isHighlighted ? { + fontWeight: 600 + } : {} + }, "".concat(qfData[qlIdx][qfIdx], " - ").concat(qf))))); }); } // Date - var dateLegend = null; + let dateLegend = null; if (graphData.x && !belowSm) { dateLegend = /*#__PURE__*/_react.default.createElement(_Card.default, { variant: "outlined", @@ -450,25 +432,26 @@ function TimeSeriesViewerGraph() { }; // Function to draw quality flags on the graph - var renderQualityFlags = function renderQualityFlags(canvas, area, g) { - var _state$graphData3 = state.graphData, - qualityData = _state$graphData3.qualityData, - qualityLabels = _state$graphData3.qualityLabels; - var qualitySeriesCount = qualityLabels.length - 2 - graphState.hiddenQualityFlags.size; + const renderQualityFlags = (canvas, area, g) => { + const { + qualityData, + qualityLabels + } = state.graphData; + const qualitySeriesCount = qualityLabels.length - 2 - graphState.hiddenQualityFlags.size; if (qualitySeriesCount < 1) { return; } - qualityData.forEach(function (row) { - var startX = g.toDomXCoord(row[0]); - var endX = g.toDomXCoord(row[1]); - var y = area.y, - h = area.h; + qualityData.forEach(row => { + const startX = g.toDomXCoord(row[0]); + const endX = g.toDomXCoord(row[1]); + let { + y, + h + } = area; h /= qualitySeriesCount; - for (var c = 2; c < row.length; c += 1) { + for (let c = 2; c < row.length; c += 1) { if (!graphState.hiddenQualityFlags.has(qualityLabels[c])) { - if (row[c] && row[c].some(function (v) { - return v !== 0 && v !== null; - })) { + if (row[c] && row[c].some(v => v !== 0 && v !== null)) { canvas.fillStyle = QUALITY_COLORS[(c - 2) % 12]; // eslint-disable-line no-param-reassign, max-len canvas.fillRect(startX, y, endX - startX, h); } @@ -477,82 +460,73 @@ function TimeSeriesViewerGraph() { } }); }; - var getUnderlayCallback = function getUnderlayCallback() { - return function (canvas, area, g) { - renderQualityFlags(canvas, area, g); - }; + const getUnderlayCallback = () => (canvas, area, g) => { + renderQualityFlags(canvas, area, g); }; // Effect - Generate all series data for the graph only when necessary, store in TSV global state - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (state.status !== _constants.TIME_SERIES_VIEWER_STATUS.READY_FOR_SERIES) { return; } - (0, _generateTimeSeriesGraphData.default)(state).then(function (graphData) { + (0, _generateTimeSeriesGraphData.default)(state).then(graphData => { // With new series and qualityLabels purge any hidden labels that are no longer present - var newSeries = graphData.series, - newQualityLabels = graphData.qualityLabels; - var seriesLabels = newSeries.map(function (s) { - return s.label; - }); - if (Array.from(graphState.hiddenQualityFlags).some(function (label) { - return !newQualityLabels.includes(label); - }) || Array.from(graphState.hiddenSeries).some(function (label) { - return !seriesLabels.includes(label); - })) { + const { + series: newSeries, + qualityLabels: newQualityLabels + } = graphData; + const seriesLabels = newSeries.map(s => s.label); + if (Array.from(graphState.hiddenQualityFlags).some(label => !newQualityLabels.includes(label)) || Array.from(graphState.hiddenSeries).some(label => !seriesLabels.includes(label))) { graphDispatch({ type: 'purgeRemovedHiddenLabels', qualityLabels: newQualityLabels.slice(2), - seriesLabels: seriesLabels + seriesLabels }); } // Store newly generate graphData in primary context state dispatch({ type: 'regenerateGraphData', - graphData: graphData + graphData }); }); }); if (state.status === _constants.TIME_SERIES_VIEWER_STATUS.READY) { // Determine the set of axes and their units - var previousAxisCount = axisCountRef.current; - var axes = Object.keys(yAxes).map(function (axis) { - return { - axis: axis === 'y1' ? 'y' : 'y2', - units: yAxes[axis].units - // logscale: yAxes[axis].logscale, - }; - }).slice(0, yAxes.y2.units === null ? 1 : 2); + const previousAxisCount = axisCountRef.current; + const axes = Object.keys(yAxes).map(axis => ({ + axis: axis === 'y1' ? 'y' : 'y2', + units: yAxes[axis].units + // logscale: yAxes[axis].logscale, + })).slice(0, yAxes.y2.units === null ? 1 : 2); axisCountChangedRef.current = axes.length !== previousAxisCount; axisCountRef.current = axes.length; // Build graphOptions - var _state$graphData4 = state.graphData, - _series2 = _state$graphData4.series, - labels = _state$graphData4.labels; + const { + series, + labels + } = state.graphData; graphOptions = _extends({}, (0, _cloneDeep.default)(BASE_GRAPH_OPTIONS), { - labels: labels, + labels, axes: buildAxesOption(axes), series: buildSeriesOption(axes), - rollPeriod: rollPeriod, - logscale: logscale, + rollPeriod, + logscale, labelsDiv: legendRef.current, legend: 'always', - legendFormatter: legendFormatter, + legendFormatter, underlayCallback: getUnderlayCallback(), - visibility: _series2.map(function (s) { - return !graphState.hiddenSeries.has(s.label); - }) + visibility: series.map(s => !graphState.hiddenSeries.has(s.label)) }); // Apply axis labels to graphOptions - axes.forEach(function (axis) { + axes.forEach(axis => { graphOptions["".concat(axis.axis, "label")] = axis.units; }); } // Callback to refresh graph dimensions for current DOM - var handleResize = (0, _react.useCallback)(function () { + const handleResize = (0, _react.useCallback)(() => { if (state.status !== _constants.TIME_SERIES_VIEWER_STATUS.READY) { return; } @@ -560,44 +534,44 @@ function TimeSeriesViewerGraph() { return; } // Resize the graph relative to the legend width now that the legend is properly rendered - var MIN_GRAPH_HEIGHT = 320; - var MAX_GRAPH_HEIGHT = 560; - var legendHeight = legendRef.current ? legendRef.current.clientHeight + 40 : 0; - var graphHeight = Math.min(Math.max(legendHeight, MIN_GRAPH_HEIGHT), MAX_GRAPH_HEIGHT); - var legendWidth = legendRef.current.clientWidth + 8; - var graphInnerContainerWidth = graphInnerContainerRef.current.clientWidth; - var graphWidth = graphInnerContainerWidth - legendWidth; + const MIN_GRAPH_HEIGHT = 320; + const MAX_GRAPH_HEIGHT = 560; + const legendHeight = legendRef.current ? legendRef.current.clientHeight + 40 : 0; + const graphHeight = Math.min(Math.max(legendHeight, MIN_GRAPH_HEIGHT), MAX_GRAPH_HEIGHT); + const legendWidth = legendRef.current.clientWidth + 8; + const graphInnerContainerWidth = graphInnerContainerRef.current.clientWidth; + const graphWidth = graphInnerContainerWidth - legendWidth; dygraphRef.current.graphDiv.style.width = "".concat(graphWidth, "px"); dygraphRef.current.graphDiv.style.height = "".concat(graphHeight, "px"); dygraphRef.current.resizeHandler_(); dygraphRef.current.canvas_.style.cursor = 'crosshair'; // Store the updated download PNG dimensions in state so we can display them for the user if (downloadRef.current !== null) { - var dimensions = [Math.ceil(downloadRef.current.clientWidth || 0), Math.ceil(downloadRef.current.clientHeight || 0)]; + const dimensions = [Math.ceil(downloadRef.current.clientWidth || 0), Math.ceil(downloadRef.current.clientHeight || 0)]; if (!(dimensions[0] === graphState.pngDimensions[0] && dimensions[1] === graphState.pngDimensions[1])) { graphDispatch({ type: 'setPngDimensions', - dimensions: dimensions + dimensions }); } } }, [state.status, dygraphRef, legendRef, graphInnerContainerRef, downloadRef, graphState.pngDimensions, graphDispatch]); // Layout effect to keep the graph dimensions in-line with resize events - (0, _react.useLayoutEffect)(function () { + (0, _react.useLayoutEffect)(() => { if (graphInnerContainerRef.current === null) { - return function () {}; + return () => {}; } // Ensure resize observer is in place if (typeof ResizeObserver !== 'function') { window.addEventListener('resize', handleResize); - return function () { + return () => { window.removeEventListener('resize', handleResize); }; } - var resizeObserver = new ResizeObserver(handleResize); + let resizeObserver = new ResizeObserver(handleResize); resizeObserver.observe(graphInnerContainerRef.current); - return function () { + return () => { if (!resizeObserver) { return; } @@ -607,7 +581,7 @@ function TimeSeriesViewerGraph() { }, [graphInnerContainerRef, handleResize]); // Effect to apply latest options/data to the graph and force a resize - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (state.status !== _constants.TIME_SERIES_VIEWER_STATUS.READY) { return; } @@ -633,37 +607,39 @@ function TimeSeriesViewerGraph() { }, [selectionDigest, state.status, state.graphData.data, graphOptions, dygraphRef, handleResize, axisCountChangedRef]); // Effect to register a click handler to the legend for series visibility toggling - (0, _react.useEffect)(function () { + (0, _react.useEffect)(() => { if (!legendRef.current) { - return function () {}; + return () => {}; } - var legendClickHandler = function legendClickHandler(_ref) { - var target = _ref.target; - var container = legendRef.current; + const legendClickHandler = _ref => { + let { + target + } = _ref; + const container = legendRef.current; if (!container.contains(target)) { return; } - var label = target.getAttribute('data-label'); - var kind = target.getAttribute('data-kind'); + const label = target.getAttribute('data-label'); + const kind = target.getAttribute('data-kind'); if (!label || !kind) { return; } graphDispatch({ type: 'toggleLegendVisibility', - label: label, - kind: kind + label, + kind }); }; document.addEventListener('click', legendClickHandler); - return function () { + return () => { document.removeEventListener('click', legendClickHandler); }; }, [legendRef, graphDispatch]); - var buildGraphTitle = function buildGraphTitle() { - var releaseTitle = (0, _typeUtil.isStringNonEmpty)(state.release) ? ", ".concat(state.release, " ") : ''; + const buildGraphTitle = () => { + const releaseTitle = (0, _typeUtil.isStringNonEmpty)(state.release) ? ", ".concat(state.release, " ") : ''; return state.product.productName ? "".concat(state.product.productName, " (").concat(state.product.productCode, ")").concat(releaseTitle) : "".concat(state.product.productCode).concat(releaseTitle); }; - var renderCitation = function renderCitation() { + const renderCitation = () => { if (!state.product || !state.product.productCode) { return null; } @@ -680,25 +656,20 @@ function TimeSeriesViewerGraph() { }; // Download Image Button - var exportGraphImage = function exportGraphImage() { + const exportGraphImage = () => { if (downloadRef.current === null) { return; } - _domToImage.default.toBlob(downloadRef.current).then(function (blob) { - var siteCodes = state.selection.sites.map(function (site) { - return site.siteCode; - }).join(' '); - var fileName = "NEON Time Series - ".concat(state.product.productCode, " - ").concat(state.product.productName, " - ").concat(siteCodes, ".png"); + _domToImage.default.toBlob(downloadRef.current).then(blob => { + const siteCodes = state.selection.sites.map(site => site.siteCode).join(' '); + const fileName = "NEON Time Series - ".concat(state.product.productCode, " - ").concat(state.product.productName, " - ").concat(siteCodes, ".png"); (0, _fileSaver.saveAs)(blob, fileName); - }).catch(function (error) { + }).catch(error => { console.error('Unable to export graph image', error); // eslint-disable-line no-console }); }; - - var getPngDimensions = function getPngDimensions() { - return "".concat(graphState.pngDimensions[0] || '?', "px x ").concat(graphState.pngDimensions[1] || '?', "px"); - }; - var downloadImageButton = /*#__PURE__*/_react.default.createElement(_Button.default, { + const getPngDimensions = () => "".concat(graphState.pngDimensions[0] || '?', "px x ").concat(graphState.pngDimensions[1] || '?', "px"); + const downloadImageButton = /*#__PURE__*/_react.default.createElement(_Button.default, { size: "small", color: "primary", variant: "outlined", @@ -713,17 +684,17 @@ function TimeSeriesViewerGraph() { }, "Download Image (png)"); // Toggle Series Visibility Button - var series = state.graphData.series; - var toggleSeriesVisibility = function toggleSeriesVisibility() { - var allSeries = series.map(function (s) { - return s.label; - }); + const { + series + } = state.graphData; + const toggleSeriesVisibility = () => { + const allSeries = series.map(s => s.label); graphDispatch({ type: 'toggleSeriesVisibility', series: allSeries }); }; - var toggleSeriesVisibilityButton = /*#__PURE__*/_react.default.createElement(_Button.default, { + const toggleSeriesVisibilityButton = /*#__PURE__*/_react.default.createElement(_Button.default, { size: "small", color: "primary", variant: "outlined", @@ -738,14 +709,16 @@ function TimeSeriesViewerGraph() { }, graphState.hiddenSeries.size ? "".concat(belowSm ? '' : 'Show All', " Series") : "".concat(belowSm ? '' : 'Hide All', " Series")); // Toggle Quality Flag Visibility Button - var qualityLabels = state.graphData.qualityLabels; - var toggleQualityFlagsVisibility = function toggleQualityFlagsVisibility() { + const { + qualityLabels + } = state.graphData; + const toggleQualityFlagsVisibility = () => { graphDispatch({ type: 'toggleQualityFlagsVisibility', qualityFlags: qualityLabels.slice(2) }); }; - var toggleQualityFlagsVisibilityButton = /*#__PURE__*/_react.default.createElement(_Button.default, { + const toggleQualityFlagsVisibilityButton = /*#__PURE__*/_react.default.createElement(_Button.default, { size: "small", color: "primary", variant: "outlined", diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerSites.js b/lib/components/TimeSeriesViewer/TimeSeriesViewerSites.js index 57e4afca..ea616790 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerSites.js +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerSites.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -55,27 +54,14 @@ var _iconSiteCoreAquatic = _interopRequireDefault(require("../SiteMap/svg/icon-s var _iconSiteGradientTerrestrial = _interopRequireDefault(require("../SiteMap/svg/icon-site-gradient-terrestrial.svg")); var _iconSiteGradientAquatic = _interopRequireDefault(require("../SiteMap/svg/icon-site-gradient-aquatic.svg")); var _TimeSeriesViewerContext = _interopRequireWildcard(require("./TimeSeriesViewerContext")); -var _excluded = ["inputRef"]; +const _excluded = ["inputRef"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable react/forbid-prop-types */ -var ucWord = function ucWord(word) { - return "".concat(word.slice(0, 1).toUpperCase()).concat(word.slice(1).toLowerCase()); -}; -var ICON_SVGS = { +const ucWord = word => "".concat(word.slice(0, 1).toUpperCase()).concat(word.slice(1).toLowerCase()); +const ICON_SVGS = { CORE: { AQUATIC: _iconSiteCoreAquatic.default, TERRESTRIAL: _iconSiteCoreTerrestrial.default @@ -89,157 +75,147 @@ var ICON_SVGS = { /** Classes and Styles */ -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - root: { - flexGrow: 1, - width: '100%' - }, - input: { - display: 'flex', - padding: '2px', - height: 'auto' - }, - valueContainer: { - display: 'flex', - flexWrap: 'wrap', - flex: 1, - alignItems: 'center', - overflow: 'hidden' - }, - noOptionsMessage: { - padding: theme.spacing(1, 2) - }, - placeholder: { - position: 'absolute', - left: 2, - bottom: 6, - fontSize: 16 - }, - paper: { - position: 'absolute', - zIndex: 1, - marginTop: theme.spacing(1), - left: 0, - right: 0 - }, - divider: { - height: theme.spacing(2) - }, - optionSubtitle: { - fontSize: '0.75rem', - color: _Theme.default.palette.grey[500] - }, - sitesContainer: { - display: 'flex', - alignContent: 'flex-start', - flexFlow: 'row wrap' - }, - siteCard: { - width: '100%', - padding: theme.spacing(1.5, 2, 1.5, 2), - backgroundColor: theme.palette.grey[50], - marginTop: theme.spacing(3) - }, - siteTitleContainer: { - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - marginBottom: _Theme.default.spacing(1.5) - }, - siteDetailsRow: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'space-between' - }, - siteDetailsColumn: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'flex-start', - flexWrap: 'wrap', - marginBottom: _Theme.default.spacing(0.5) - }, - siteDetail: { - marginBottom: _Theme.default.spacing(1), - marginRight: _Theme.default.spacing(4) - }, - noneIcon: { - color: theme.palette.grey[400], - marginRight: theme.spacing(0.5), - fontSize: '1rem' - }, - noneLabel: { - color: theme.palette.grey[400] - }, - positionsTitleContainer: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'center', - marginTop: theme.spacing(2) - }, - positionsCardContainer: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'flex-start', - flexWrap: 'wrap' - }, - positionCard: { - display: 'flex', - alignItems: 'center', - justifyContent: 'flex-start', - padding: theme.spacing(1, 2, 1, 0.5), - backgroundColor: theme.palette.grey[100], - marginTop: theme.spacing(1.5), - marginRight: theme.spacing(1.5), - width: '100%', - maxWidth: '800px' - }, - startFlex: { - display: 'flex', - justifyContent: 'flex-start', - alignItems: 'flex-start' - } - }; -}); -var selectStyles = { - input: function input(base) { - return _extends({}, base, { - color: _Theme.default.palette.text.primary, - '& input': { - font: 'inherit' - } - }); +const useStyles = (0, _styles.makeStyles)(theme => ({ + root: { + flexGrow: 1, + width: '100%' }, - clearIndicator: function clearIndicator(base) { - return _extends({}, base, { - display: 'none' - }); + input: { + display: 'flex', + padding: '2px', + height: 'auto' }, - indicatorSeparator: function indicatorSeparator(base) { - return _extends({}, base, { - display: 'none' - }); + valueContainer: { + display: 'flex', + flexWrap: 'wrap', + flex: 1, + alignItems: 'center', + overflow: 'hidden' }, - dropdownIndicator: function dropdownIndicator(base) { - return _extends({}, base, { - cursor: 'pointer' - }); + noOptionsMessage: { + padding: theme.spacing(1, 2) }, - groupHeading: function groupHeading(base) { - return _extends({}, base, { - fontSize: '1rem', - fontWeight: 600, - color: _Theme.default.palette.primary.main - }); + placeholder: { + position: 'absolute', + left: 2, + bottom: 6, + fontSize: 16 + }, + paper: { + position: 'absolute', + zIndex: 1, + marginTop: theme.spacing(1), + left: 0, + right: 0 + }, + divider: { + height: theme.spacing(2) + }, + optionSubtitle: { + fontSize: '0.75rem', + color: _Theme.default.palette.grey[500] + }, + sitesContainer: { + display: 'flex', + alignContent: 'flex-start', + flexFlow: 'row wrap' + }, + siteCard: { + width: '100%', + padding: theme.spacing(1.5, 2, 1.5, 2), + backgroundColor: theme.palette.grey[50], + marginTop: theme.spacing(3) + }, + siteTitleContainer: { + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + marginBottom: _Theme.default.spacing(1.5) + }, + siteDetailsRow: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'space-between' + }, + siteDetailsColumn: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'flex-start', + flexWrap: 'wrap', + marginBottom: _Theme.default.spacing(0.5) + }, + siteDetail: { + marginBottom: _Theme.default.spacing(1), + marginRight: _Theme.default.spacing(4) + }, + noneIcon: { + color: theme.palette.grey[400], + marginRight: theme.spacing(0.5), + fontSize: '1rem' + }, + noneLabel: { + color: theme.palette.grey[400] + }, + positionsTitleContainer: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'center', + marginTop: theme.spacing(2) + }, + positionsCardContainer: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'flex-start', + flexWrap: 'wrap' + }, + positionCard: { + display: 'flex', + alignItems: 'center', + justifyContent: 'flex-start', + padding: theme.spacing(1, 2, 1, 0.5), + backgroundColor: theme.palette.grey[100], + marginTop: theme.spacing(1.5), + marginRight: theme.spacing(1.5), + width: '100%', + maxWidth: '800px' + }, + startFlex: { + display: 'flex', + justifyContent: 'flex-start', + alignItems: 'flex-start' } +})); +const selectStyles = { + input: base => _extends({}, base, { + color: _Theme.default.palette.text.primary, + '& input': { + font: 'inherit' + } + }), + clearIndicator: base => _extends({}, base, { + display: 'none' + }), + indicatorSeparator: base => _extends({}, base, { + display: 'none' + }), + dropdownIndicator: base => _extends({}, base, { + cursor: 'pointer' + }), + groupHeading: base => _extends({}, base, { + fontSize: '1rem', + fontWeight: 600, + color: _Theme.default.palette.primary.main + }) }; /** Common React-Select Components - used by both site-specific and position-specific react-selects */ function inputComponent(_ref) { - var inputRef = _ref.inputRef, - props = _objectWithoutProperties(_ref, _excluded); + let { + inputRef + } = _ref, + props = _objectWithoutPropertiesLoose(_ref, _excluded); return /*#__PURE__*/_react.default.createElement("div", _extends({ ref: inputRef }, props)); @@ -250,9 +226,13 @@ inputComponent.propTypes = { })]).isRequired }; function ValueContainer(props) { - var selectProps = props.selectProps, - children = props.children; - var valueContainer = selectProps.classes.valueContainer; + const { + selectProps, + children + } = props; + const { + valueContainer + } = selectProps.classes; return /*#__PURE__*/_react.default.createElement("div", { className: valueContainer }, children); @@ -262,10 +242,14 @@ ValueContainer.propTypes = { selectProps: _propTypes.default.object.isRequired }; function Menu(props) { - var selectProps = props.selectProps, - innerProps = props.innerProps, - children = props.children; - var paper = selectProps.classes.paper; + const { + selectProps, + innerProps, + children + } = props; + const { + paper + } = selectProps.classes; return /*#__PURE__*/_react.default.createElement(_Paper.default, _extends({ square: true, className: paper @@ -280,7 +264,7 @@ Menu.propTypes = { /** Common React-Select PropTypes - used by both site-specific and position-specific components */ -var ControlPropTypes = { +const ControlPropTypes = { children: _propTypes.default.node.isRequired, innerProps: _propTypes.default.shape({ onMouseDown: _propTypes.default.func.isRequired @@ -290,7 +274,7 @@ var ControlPropTypes = { })]).isRequired, selectProps: _propTypes.default.object.isRequired }; -var OptionPropTypes = { +const OptionPropTypes = { children: _propTypes.default.node, innerProps: _propTypes.default.shape({ id: _propTypes.default.string.isRequired, @@ -308,29 +292,28 @@ var OptionPropTypes = { isDisabled: _propTypes.default.bool, data: _propTypes.default.object.isRequired }; -var OptionDefaultProps = { +const OptionDefaultProps = { children: null, innerProps: null, innerRef: null, isDisabled: false }; -var positionsDescription = "\n Positions are distinct physical sensor locations at a given site. The x, y, and z coordinates\n describe where the sensor is located relative to the ground-level reference location.\n Positions may change over time.\n"; -var positionsSeriesDescription = "\n Each position selected will become a distinct series in the chart for each variable (example: 2\n positions \xD7 3 variables = 6 distinct series).\n"; +const positionsDescription = "\n Positions are distinct physical sensor locations at a given site. The x, y, and z coordinates\n describe where the sensor is located relative to the ground-level reference location.\n Positions may change over time.\n"; +const positionsSeriesDescription = "\n Each position selected will become a distinct series in the chart for each variable (example: 2\n positions \xD7 3 variables = 6 distinct series).\n"; /** PositionHistoryButton - button that opens a dialog to show all history for a given position */ function PositionHistoryButton(props) { - var classes = useStyles(_Theme.default); - var siteCode = props.siteCode, - position = props.position, - history = props.history, - fullWidth = props.fullWidth; - var disabled = history.length < 2; - var _useState = (0, _react.useState)(false), - _useState2 = _slicedToArray(_useState, 2), - historyDialogOpen = _useState2[0], - setHistoryDialogOpen = _useState2[1]; + const classes = useStyles(_Theme.default); + const { + siteCode, + position, + history, + fullWidth + } = props; + const disabled = history.length < 2; + const [historyDialogOpen, setHistoryDialogOpen] = (0, _react.useState)(false); if (disabled) { return /*#__PURE__*/_react.default.createElement(_Button.default, { fullWidth: fullWidth, @@ -345,14 +328,14 @@ function PositionHistoryButton(props) { fullWidth: fullWidth, size: "small", variant: "outlined", - onClick: function onClick() { + onClick: () => { setHistoryDialogOpen(true); }, title: "Click to show all changes to physical locations for this position over time", startIcon: /*#__PURE__*/_react.default.createElement(_History.default, null) }, "History (".concat(history.length, ")")), /*#__PURE__*/_react.default.createElement(_Dialog.default, { open: historyDialogOpen, - onClose: function onClose() { + onClose: () => { setHistoryDialogOpen(false); }, scroll: "paper", @@ -385,24 +368,24 @@ function PositionHistoryButton(props) { align: "right" }, "z"), /*#__PURE__*/_react.default.createElement(_TableCell.default, { align: "right" - }, "Elevation"))), /*#__PURE__*/_react.default.createElement(_TableBody.default, null, history.map(function (row, idx) { - var _row$sensorStartDateT = row.sensorStartDateTime, - sensorStartDateTime = _row$sensorStartDateT === void 0 ? '' : _row$sensorStartDateT, - _row$sensorEndDateTim = row.sensorEndDateTime, - rawEnd = _row$sensorEndDateTim === void 0 ? '' : _row$sensorEndDateTim, - xOffset = row.xOffset, - yOffset = row.yOffset, - zOffset = row.zOffset, - referenceLocationElevation = row.referenceLocationElevation; - var hasReferenceElevation = (0, _typeUtil.exists)(referenceLocationElevation) && !isNaN(referenceLocationElevation); - var hasXOffset = (0, _typeUtil.exists)(xOffset) && !isNaN(xOffset); - var hasYOffset = (0, _typeUtil.exists)(yOffset) && !isNaN(yOffset); - var hasZOffset = (0, _typeUtil.exists)(zOffset) && !isNaN(zOffset); - var parsedReferenceElevation = hasReferenceElevation ? referenceLocationElevation : NaN; - var parsedXOffset = hasXOffset ? xOffset : NaN; - var parsedYOffset = hasYOffset ? yOffset : NaN; - var parsedZOffset = hasZOffset ? zOffset : NaN; - var elevation = 'unknown'; + }, "Elevation"))), /*#__PURE__*/_react.default.createElement(_TableBody.default, null, history.map((row, idx) => { + const { + sensorStartDateTime = '', + sensorEndDateTime: rawEnd = '', + xOffset, + yOffset, + zOffset, + referenceLocationElevation + } = row; + const hasReferenceElevation = (0, _typeUtil.exists)(referenceLocationElevation) && !isNaN(referenceLocationElevation); + const hasXOffset = (0, _typeUtil.exists)(xOffset) && !isNaN(xOffset); + const hasYOffset = (0, _typeUtil.exists)(yOffset) && !isNaN(yOffset); + const hasZOffset = (0, _typeUtil.exists)(zOffset) && !isNaN(zOffset); + const parsedReferenceElevation = hasReferenceElevation ? referenceLocationElevation : NaN; + const parsedXOffset = hasXOffset ? xOffset : NaN; + const parsedYOffset = hasYOffset ? yOffset : NaN; + const parsedZOffset = hasZOffset ? zOffset : NaN; + let elevation = 'unknown'; if (!isNaN(parsedReferenceElevation)) { if (!isNaN(parsedZOffset)) { elevation = "".concat((parsedReferenceElevation + parsedZOffset).toFixed(2).toString(), "m"); @@ -410,15 +393,15 @@ function PositionHistoryButton(props) { elevation = "".concat(parsedReferenceElevation, "m"); } } - var displayXOffset = hasXOffset ? "".concat(xOffset, "m") : '--'; - var displayYOffset = hasYOffset ? "".concat(yOffset, "m") : '--'; - var displayZOffset = hasZOffset ? "".concat(zOffset, "m") : '--'; - var end = rawEnd === '' ? 'Current' : rawEnd; - var cellStyle = idx !== history.length - 1 ? {} : { + const displayXOffset = hasXOffset ? "".concat(xOffset, "m") : '--'; + const displayYOffset = hasYOffset ? "".concat(yOffset, "m") : '--'; + const displayZOffset = hasZOffset ? "".concat(zOffset, "m") : '--'; + const end = rawEnd === '' ? 'Current' : rawEnd; + const cellStyle = idx !== history.length - 1 ? {} : { fontWeight: '600', borderBottom: 'none' }; - var key = "".concat(sensorStartDateTime).concat(end).concat(parsedXOffset).concat(parsedYOffset).concat(parsedZOffset); + const key = "".concat(sensorStartDateTime).concat(end).concat(parsedXOffset).concat(parsedYOffset).concat(parsedZOffset); return /*#__PURE__*/_react.default.createElement(_TableRow.default, { key: key }, /*#__PURE__*/_react.default.createElement(_TableCell.default, { @@ -443,7 +426,7 @@ function PositionHistoryButton(props) { style: cellStyle }, elevation)); }))))), /*#__PURE__*/_react.default.createElement(_DialogActions.default, null, /*#__PURE__*/_react.default.createElement(_Button.default, { - onClick: function onClick() { + onClick: () => { setHistoryDialogOpen(false); }, color: "primary", @@ -474,33 +457,30 @@ PositionHistoryButton.propTypes = { PositionHistoryButton.defaultProps = { fullWidth: false }; -var POSITION_DETAIL_COMPONENT_XS_UPPER = 300; -var POSITION_DETAIL_COMPONENT_MD_LOWER = 600; +const POSITION_DETAIL_COMPONENT_XS_UPPER = 300; +const POSITION_DETAIL_COMPONENT_MD_LOWER = 600; /** PositionDetail - Component to display neatly-formatted position content */ function PositionDetail(props) { - var siteCode = props.siteCode, - position = props.position, - wide = props.wide; - var classes = useStyles(_Theme.default); - var _TimeSeriesViewerCont = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont2 = _slicedToArray(_TimeSeriesViewerCont, 1), - state = _TimeSeriesViewerCont2[0]; - var containerRef = (0, _react.useRef)(); - var _useState3 = (0, _react.useState)(0), - _useState4 = _slicedToArray(_useState3, 2), - componentWidth = _useState4[0], - setComponentWidth = _useState4[1]; - var atComponentXs = false; - var atComponentMd = false; + const { + siteCode, + position, + wide + } = props; + const classes = useStyles(_Theme.default); + const [state] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const containerRef = (0, _react.useRef)(); + const [componentWidth, setComponentWidth] = (0, _react.useState)(0); + let atComponentXs = false; + let atComponentMd = false; if (componentWidth > 0) { atComponentXs = componentWidth <= POSITION_DETAIL_COMPONENT_XS_UPPER; atComponentMd = componentWidth > POSITION_DETAIL_COMPONENT_MD_LOWER; } - var handleResizeCb = (0, _react.useCallback)(function () { - var container = containerRef.current; + const handleResizeCb = (0, _react.useCallback)(() => { + const container = containerRef.current; if (!container) { return; } @@ -509,21 +489,21 @@ function PositionDetail(props) { } setComponentWidth(container.clientWidth); }, [containerRef, componentWidth, setComponentWidth]); - (0, _react.useLayoutEffect)(function () { - var element = containerRef.current; + (0, _react.useLayoutEffect)(() => { + const element = containerRef.current; if (!element) { - return function () {}; + return () => {}; } handleResizeCb(); if (typeof ResizeObserver !== 'function') { window.addEventListener('resize', handleResizeCb); - return function () { + return () => { window.removeEventListener('resize', handleResizeCb); }; } - var resizeObserver = new ResizeObserver(handleResizeCb); + let resizeObserver = new ResizeObserver(handleResizeCb); resizeObserver.observe(element); - return function () { + return () => { if (!resizeObserver) { return; } @@ -536,27 +516,30 @@ function PositionDetail(props) { variant: "body1" }, position); } - var history = state.product.sites[siteCode].positions[position].history; - var current = history.length - 1 || 0; - var _ref2 = history[current] || {}, - sensorName = _ref2.sensorName, - sensorDescription = _ref2.sensorDescription, - referenceLocationName = _ref2.referenceLocationName, - referenceLocationDescription = _ref2.referenceLocationDescription, - referenceLocationElevation = _ref2.referenceLocationElevation, - xOffset = _ref2.xOffset, - yOffset = _ref2.yOffset, - zOffset = _ref2.zOffset; - var hasReferenceElevation = (0, _typeUtil.exists)(referenceLocationElevation) && !isNaN(referenceLocationElevation); - var hasXOffset = (0, _typeUtil.exists)(xOffset) && !isNaN(xOffset); - var hasYOffset = (0, _typeUtil.exists)(yOffset) && !isNaN(yOffset); - var hasZOffset = (0, _typeUtil.exists)(zOffset) && !isNaN(zOffset); - var parsedReferenceElevation = hasReferenceElevation ? referenceLocationElevation : NaN; - var parsedZOffset = hasZOffset ? zOffset : NaN; - var displayXOffset = hasXOffset ? "".concat(xOffset, "m") : '--'; - var displayYOffset = hasYOffset ? "".concat(yOffset, "m") : '--'; - var displayZOffset = hasZOffset ? "".concat(zOffset, "m") : '--'; - var elevation = '--'; + const { + history + } = state.product.sites[siteCode].positions[position]; + const current = history.length - 1 || 0; + const { + sensorName, + sensorDescription, + referenceLocationName, + referenceLocationDescription, + referenceLocationElevation, + xOffset, + yOffset, + zOffset + } = history[current] || {}; + const hasReferenceElevation = (0, _typeUtil.exists)(referenceLocationElevation) && !isNaN(referenceLocationElevation); + const hasXOffset = (0, _typeUtil.exists)(xOffset) && !isNaN(xOffset); + const hasYOffset = (0, _typeUtil.exists)(yOffset) && !isNaN(yOffset); + const hasZOffset = (0, _typeUtil.exists)(zOffset) && !isNaN(zOffset); + const parsedReferenceElevation = hasReferenceElevation ? referenceLocationElevation : NaN; + const parsedZOffset = hasZOffset ? zOffset : NaN; + const displayXOffset = hasXOffset ? "".concat(xOffset, "m") : '--'; + const displayYOffset = hasYOffset ? "".concat(yOffset, "m") : '--'; + const displayZOffset = hasZOffset ? "".concat(zOffset, "m") : '--'; + let elevation = '--'; if (!isNaN(parsedReferenceElevation)) { if (!isNaN(parsedZOffset)) { elevation = "".concat((parsedReferenceElevation + parsedZOffset).toFixed(2).toString(), "m"); @@ -564,23 +547,23 @@ function PositionDetail(props) { elevation = "".concat(parsedReferenceElevation, "m"); } } - var fadeStyle = { + const fadeStyle = { color: _Theme.default.palette.grey[500] }; - var axisStyle = { + const axisStyle = { marginRight: _Theme.default.spacing(1), fontWeight: 600 }; - var renderDescription = function renderDescription() { - var hasName = (0, _typeUtil.isStringNonEmpty)(sensorName); - var hasDescription = (0, _typeUtil.isStringNonEmpty)(sensorDescription); - var hasReferenceName = (0, _typeUtil.isStringNonEmpty)(referenceLocationName); - var hasReferenceDescription = (0, _typeUtil.isStringNonEmpty)(referenceLocationDescription); - var appliedName = hasName ? sensorName : 'N/A'; - var appliedDescription = hasDescription ? sensorDescription : 'N/A'; - var includeReference = hasReferenceName || hasReferenceDescription; - var appliedReferenceName = hasReferenceName ? referenceLocationName : 'N/A'; - var appliedReferenceDescription = hasReferenceDescription ? referenceLocationDescription : 'N/A'; + const renderDescription = () => { + const hasName = (0, _typeUtil.isStringNonEmpty)(sensorName); + const hasDescription = (0, _typeUtil.isStringNonEmpty)(sensorDescription); + const hasReferenceName = (0, _typeUtil.isStringNonEmpty)(referenceLocationName); + const hasReferenceDescription = (0, _typeUtil.isStringNonEmpty)(referenceLocationDescription); + const appliedName = hasName ? sensorName : 'N/A'; + const appliedDescription = hasDescription ? sensorDescription : 'N/A'; + const includeReference = hasReferenceName || hasReferenceDescription; + const appliedReferenceName = hasReferenceName ? referenceLocationName : 'N/A'; + const appliedReferenceDescription = hasReferenceDescription ? referenceLocationDescription : 'N/A'; return wide ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", { className: classes.startFlex, style: _extends({}, fadeStyle, { @@ -629,15 +612,15 @@ function PositionDetail(props) { variant: "body2" }, "".concat(appliedReferenceDescription, " (").concat(appliedReferenceName, ")"))))); }; - var positionContainerStyle = { + let positionContainerStyle = { alignItems: 'center', justifyContent: 'space-between' }; - var positionSectionsContainerStyle = { + let positionSectionsContainerStyle = { display: 'flex', flexDirection: 'column' }; - var historyButtonContainerStyle = { + let historyButtonContainerStyle = { textAlign: 'right' }; if (atComponentXs) { @@ -759,14 +742,13 @@ PositionDetail.defaultProps = { Selected Position - Component for a single deletable position paper to show within a SelectedSite */ function SelectedPosition(props) { - var classes = useStyles(_Theme.default); - var siteCode = props.siteCode, - position = props.position, - disabled = props.disabled; - var _TimeSeriesViewerCont3 = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont4 = _slicedToArray(_TimeSeriesViewerCont3, 2), - state = _TimeSeriesViewerCont4[0], - dispatch = _TimeSeriesViewerCont4[1]; + const classes = useStyles(_Theme.default); + const { + siteCode, + position, + disabled + } = props; + const [state, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); return /*#__PURE__*/_react.default.createElement(_Card.default, { key: position, variant: "outlined", @@ -778,20 +760,16 @@ function SelectedPosition(props) { marginLeft: _Theme.default.spacing(1), marginRight: _Theme.default.spacing(1) }, - onClick: function onClick() { + onClick: () => { if (disabled) { return; } - var selectedSiteIdx = state.selection.sites.findIndex(function (site) { - return site.siteCode === siteCode; - }); - var positions = state.selection.sites[selectedSiteIdx].positions.filter(function (p) { - return p !== position; - }); + const selectedSiteIdx = state.selection.sites.findIndex(site => site.siteCode === siteCode); + const positions = state.selection.sites[selectedSiteIdx].positions.filter(p => p !== position); dispatch({ type: 'selectSitePositions', - positions: positions, - siteCode: siteCode + positions, + siteCode }); } }, /*#__PURE__*/_react.default.createElement(_Clear.default, { @@ -818,41 +796,34 @@ SelectedPosition.defaultProps = { SelectPositionsButton - button that opens a dialog for position selection */ function SelectPositionsButton(props) { - var selectedSite = props.selectedSite; - var siteCode = selectedSite.siteCode, - selectedPositions = selectedSite.positions; - var _TimeSeriesViewerCont5 = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont6 = _slicedToArray(_TimeSeriesViewerCont5, 2), - state = _TimeSeriesViewerCont6[0], - dispatch = _TimeSeriesViewerCont6[1]; - var availablePositions = state.product.sites[siteCode] ? Object.keys(state.product.sites[siteCode].positions) : []; + const { + selectedSite + } = props; + const { + siteCode, + positions: selectedPositions + } = selectedSite; + const [state, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const availablePositions = state.product.sites[siteCode] ? Object.keys(state.product.sites[siteCode].positions) : []; availablePositions.sort(); - var _useState5 = (0, _react.useState)(false), - _useState6 = _slicedToArray(_useState5, 2), - selectDialogOpen = _useState6[0], - setSelectDialogOpen = _useState6[1]; + const [selectDialogOpen, setSelectDialogOpen] = (0, _react.useState)(false); // Local state for position selections so that no fetches are fired until the dialog is submitted - var _useState7 = (0, _react.useState)(selectedPositions), - _useState8 = _slicedToArray(_useState7, 2), - localSelectedPositions = _useState8[0], - setLocalSelectedPositions = _useState8[1]; - var togglePosition = function togglePosition(position) { + const [localSelectedPositions, setLocalSelectedPositions] = (0, _react.useState)(selectedPositions); + const togglePosition = position => { if (localSelectedPositions.includes(position)) { - setLocalSelectedPositions(localSelectedPositions.filter(function (p) { - return p !== position; - })); + setLocalSelectedPositions(localSelectedPositions.filter(p => p !== position)); } else { - setLocalSelectedPositions([].concat(_toConsumableArray(localSelectedPositions), [position])); + setLocalSelectedPositions([...localSelectedPositions, position]); } }; - var handleApply = function handleApply() { + const handleApply = () => { if (!localSelectedPositions.length) { return; } setSelectDialogOpen(false); dispatch({ type: 'selectSitePositions', - siteCode: siteCode, + siteCode, positions: localSelectedPositions }); }; @@ -863,13 +834,13 @@ function SelectPositionsButton(props) { style: { marginLeft: _Theme.default.spacing(4) }, - onClick: function onClick() { + onClick: () => { setLocalSelectedPositions(selectedPositions); setSelectDialogOpen(true); } }, "Select Positions\u2026"), /*#__PURE__*/_react.default.createElement(_Dialog.default, { open: selectDialogOpen, - onClose: function onClose() { + onClose: () => { setSelectDialogOpen(false); }, scroll: "paper", @@ -905,14 +876,14 @@ function SelectPositionsButton(props) { id: "add-positions-dialog-description", tabIndex: -1, variant: "body2" - }, positionsDescription, /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("br", null), positionsSeriesDescription), /*#__PURE__*/_react.default.createElement(_List.default, null, availablePositions.map(function (position) { - var labelId = "position-list-label-".concat(position); + }, positionsDescription, /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("br", null), positionsSeriesDescription), /*#__PURE__*/_react.default.createElement(_List.default, null, availablePositions.map(position => { + const labelId = "position-list-label-".concat(position); return /*#__PURE__*/_react.default.createElement(_ListItem.default, { key: position, role: undefined, dense: true, button: true, - onClick: function onClick() { + onClick: () => { togglePosition(position); } }, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_Checkbox.default, { @@ -932,7 +903,7 @@ function SelectPositionsButton(props) { }) })); }))), /*#__PURE__*/_react.default.createElement(_DialogActions.default, null, /*#__PURE__*/_react.default.createElement(_Button.default, { - onClick: function onClick() { + onClick: () => { setSelectDialogOpen(false); }, variant: "outlined" @@ -953,19 +924,23 @@ SelectPositionsButton.propTypes = { SitesControl - Component for the top-level Sites search field */ function SitesControl(props) { - var children = props.children, - innerProps = props.innerProps, - innerRef = props.innerRef, - TextFieldProps = props.selectProps.TextFieldProps; + const { + children, + innerProps, + innerRef, + selectProps: { + TextFieldProps + } + } = props; return /*#__PURE__*/_react.default.createElement(_TextField.default, _extends({ fullWidth: true, label: "Add Sites", variant: "outlined", InputProps: { - inputComponent: inputComponent, + inputComponent, inputProps: _extends({ ref: innerRef, - children: children + children }, innerProps), endAdornment: /*#__PURE__*/_react.default.createElement(_InputAdornment.default, { position: "end" @@ -981,28 +956,32 @@ SitesControl.propTypes = ControlPropTypes; SiteOption - Component for a single site as it appears in the drop-down menu */ function SiteOption(props) { - var classes = useStyles(_Theme.default); - var innerRef = props.innerRef, - isFocused = props.isFocused, - isDisabled = props.isDisabled, - innerProps = props.innerProps, - data = props.data; - var siteCode = data.siteCode, - description = data.description, - type = data.type, - terrain = data.terrain, - domainCode = data.domainCode, - domainName = data.domainName, - stateCode = data.stateCode, - latitude = data.latitude, - longitude = data.longitude; - var terrainTypeTitle = "".concat(ucWord(terrain), " ").concat(ucWord(type)); - var optionContent = /*#__PURE__*/_react.default.createElement(_Typography.default, { + const classes = useStyles(_Theme.default); + const { + innerRef, + isFocused, + isDisabled, + innerProps, + data + } = props; + const { + siteCode, + description, + type, + terrain, + domainCode, + domainName, + stateCode, + latitude, + longitude + } = data; + const terrainTypeTitle = "".concat(ucWord(terrain), " ").concat(ucWord(type)); + let optionContent = /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body1", gutterBottom: true }, siteCode); if (stateCode) { - var iconSvg = ICON_SVGS[type] && ICON_SVGS[type][terrain] ? ICON_SVGS[type][terrain] : null; + const iconSvg = ICON_SVGS[type] && ICON_SVGS[type][terrain] ? ICON_SVGS[type][terrain] : null; optionContent = /*#__PURE__*/_react.default.createElement("div", { className: classes.startFlex }, iconSvg ? /*#__PURE__*/_react.default.createElement("img", { @@ -1048,27 +1027,31 @@ SiteOption.defaultProps = OptionDefaultProps; Selected Site - Component for a single deletable site paper to show below the search box */ function SelectedSite(props) { - var classes = useStyles(_Theme.default); - var site = props.site, - disabled = props.disabled, - setSelectedTab = props.setSelectedTab, - TAB_IDS = props.TAB_IDS; - var siteCode = site.siteCode, - positions = site.positions; - var _NeonContext$useNeonC = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC2 = _slicedToArray(_NeonContext$useNeonC, 1), - neonContextData = _NeonContext$useNeonC2[0].data; - var allSites = neonContextData.sites, - allStates = neonContextData.states, - allDomains = neonContextData.domains; - var _TimeSeriesViewerCont7 = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont8 = _slicedToArray(_TimeSeriesViewerCont7, 2), - dispatch = _TimeSeriesViewerCont8[1]; + const classes = useStyles(_Theme.default); + const { + site, + disabled, + setSelectedTab, + TAB_IDS + } = props; + const { + siteCode, + positions + } = site; + const [{ + data: neonContextData + }] = _NeonContext.default.useNeonContextState(); + const { + sites: allSites, + states: allStates, + domains: allDomains + } = neonContextData; + const [, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); // style={{ fontSize: '0.8rem', fontWeight: 600 }} - var dateRangeTabButton = /*#__PURE__*/_react.default.createElement(_Button.default, { + const dateRangeTabButton = /*#__PURE__*/_react.default.createElement(_Button.default, { size: "small", color: "secondary", - onClick: function onClick() { + onClick: () => { setSelectedTab(TAB_IDS.DATE_RANGE); }, style: { @@ -1077,16 +1060,16 @@ function SelectedSite(props) { fontStyle: 'italic' } }, "Date Range"); - var removeSiteButton = /*#__PURE__*/_react.default.createElement(_Button.default, { + const removeSiteButton = /*#__PURE__*/_react.default.createElement(_Button.default, { size: "small", variant: "outlined", - onClick: function onClick() { + onClick: () => { if (disabled) { return; } dispatch({ type: 'selectRemoveSite', - siteCode: siteCode + siteCode }); }, style: { @@ -1096,38 +1079,39 @@ function SelectedSite(props) { disabled: disabled, startIcon: /*#__PURE__*/_react.default.createElement(_Clear.default, null) }, "Remove Site"); - var selectedSiteContent = /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, { + let selectedSiteContent = /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, { variant: "body1", gutterBottom: true }, "".concat(siteCode, " (loading site details\u2026)")), removeSiteButton); if (allSites[siteCode]) { - var _allSites$siteCode = allSites[siteCode], - description = _allSites$siteCode.description, - type = _allSites$siteCode.type, - terrain = _allSites$siteCode.terrain, - domainCode = _allSites$siteCode.domainCode, - stateCode = _allSites$siteCode.stateCode, - latitude = _allSites$siteCode.latitude, - longitude = _allSites$siteCode.longitude; - var typeTitle = 'Core'; - var typeSubtitle = 'fixed location'; + const { + description, + type, + terrain, + domainCode, + stateCode, + latitude, + longitude + } = allSites[siteCode]; + let typeTitle = 'Core'; + let typeSubtitle = 'fixed location'; if (type === 'GRADIENT') { typeTitle = 'Gradient'; typeSubtitle = 'gradient location'; } - var terrainTitle = 'Terrestrial'; - var terrainSubtitle = 'land-based'; + let terrainTitle = 'Terrestrial'; + let terrainSubtitle = 'land-based'; if (terrain === 'AQUATIC') { terrainTitle = 'Aquatic'; terrainSubtitle = 'water-based'; } - var terrainTypeTitle = "".concat(terrainTitle, " ").concat(typeTitle); - var terrainTypeSubtitle = "".concat(terrainSubtitle, "; ").concat(typeSubtitle); - var domainName = allDomains[domainCode] ? allDomains[domainCode].name : null; - var stateName = allStates[stateCode] ? allStates[stateCode].name : null; - var stateFieldTitle = stateCode === 'PR' ? 'Territory' : 'State'; - var iconSvg = ICON_SVGS[type] && ICON_SVGS[type][terrain] ? ICON_SVGS[type][terrain] : null; - var terrainIcon = iconSvg ? /*#__PURE__*/_react.default.createElement("img", { + const terrainTypeTitle = "".concat(terrainTitle, " ").concat(typeTitle); + const terrainTypeSubtitle = "".concat(terrainSubtitle, "; ").concat(typeSubtitle); + const domainName = allDomains[domainCode] ? allDomains[domainCode].name : null; + const stateName = allStates[stateCode] ? allStates[stateCode].name : null; + const stateFieldTitle = stateCode === 'PR' ? 'Territory' : 'State'; + const iconSvg = ICON_SVGS[type] && ICON_SVGS[type][terrain] ? ICON_SVGS[type][terrain] : null; + const terrainIcon = iconSvg ? /*#__PURE__*/_react.default.createElement("img", { src: iconSvg, alt: terrainTypeTitle, title: terrainTypeTitle, @@ -1221,14 +1205,12 @@ function SelectedSite(props) { selectedSite: site })), /*#__PURE__*/_react.default.createElement("div", { className: classes.positionsCardContainer - }, positions.map(function (position) { - return /*#__PURE__*/_react.default.createElement(SelectedPosition, { - key: position, - siteCode: siteCode, - position: position, - disabled: positions.length < 2 - }); - }))) : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", { + }, positions.map(position => /*#__PURE__*/_react.default.createElement(SelectedPosition, { + key: position, + siteCode: siteCode, + position: position, + disabled: positions.length < 2 + })))) : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", { className: classes.startFlex, style: { alignItems: 'center' @@ -1263,69 +1245,52 @@ SelectedSite.defaultProps = { /** Complete Select for Sites */ -var SitesSelectComponents = { +const SitesSelectComponents = { Control: SitesControl, Option: SiteOption, - Menu: Menu, - ValueContainer: ValueContainer, - Placeholder: function Placeholder() { - return null; - }, - MultiValue: function MultiValue() { - return null; - }, - IndicatorsContainer: function IndicatorsContainer() { - return null; - } + Menu, + ValueContainer, + Placeholder: () => null, + MultiValue: () => null, + IndicatorsContainer: () => null }; -var SitesSelect = function SitesSelect() { - var classes = useStyles(_Theme.default); - var _TimeSeriesViewerCont9 = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont10 = _slicedToArray(_TimeSeriesViewerCont9, 2), - state = _TimeSeriesViewerCont10[0], - dispatch = _TimeSeriesViewerCont10[1]; - var _NeonContext$useNeonC3 = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC4 = _slicedToArray(_NeonContext$useNeonC3, 1), - neonContextData = _NeonContext$useNeonC4[0].data; - var allStates = neonContextData.states, - allSites = neonContextData.sites, - allDomains = neonContextData.domains; +const SitesSelect = () => { + const classes = useStyles(_Theme.default); + const [state, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const [{ + data: neonContextData + }] = _NeonContext.default.useNeonContextState(); + const { + states: allStates, + sites: allSites, + domains: allDomains + } = neonContextData; // Build list of selectable sites grouped by US state - var selectableSiteCodes = Object.keys(state.product.sites); - var selectableSitesCount = 0; - var selectableSites = Object.keys(allStates).map(function (stateCode) { - return { - label: allStates[stateCode].name, - stateCode: stateCode, - options: [] - }; - }); - Object.keys(state.product.sites).filter(function (siteCode) { - return selectableSiteCodes.includes(siteCode); - }).forEach(function (siteCode) { - var groupIdx = selectableSites.findIndex(function (group) { - return allSites[siteCode] && group.stateCode === allSites[siteCode].stateCode; - }); + const selectableSiteCodes = Object.keys(state.product.sites); + let selectableSitesCount = 0; + const selectableSites = Object.keys(allStates).map(stateCode => ({ + label: allStates[stateCode].name, + stateCode, + options: [] + })); + Object.keys(state.product.sites).filter(siteCode => selectableSiteCodes.includes(siteCode)).forEach(siteCode => { + const groupIdx = selectableSites.findIndex(group => allSites[siteCode] && group.stateCode === allSites[siteCode].stateCode); if (groupIdx === -1) { return; } - var domain = allDomains[allSites[siteCode].domainCode] || {}; - var usState = allStates[allSites[siteCode].stateCode] || {}; - var search = [siteCode, allSites[siteCode].description, allSites[siteCode].domainCode, allSites[siteCode].stateCode, allSites[siteCode].type, allSites[siteCode].terrain, domain.name || '', usState.name || ''].join(' ').toLowerCase(); + const domain = allDomains[allSites[siteCode].domainCode] || {}; + const usState = allStates[allSites[siteCode].stateCode] || {}; + const search = [siteCode, allSites[siteCode].description, allSites[siteCode].domainCode, allSites[siteCode].stateCode, allSites[siteCode].type, allSites[siteCode].terrain, domain.name || '', usState.name || ''].join(' ').toLowerCase(); selectableSites[groupIdx].options.push(_extends({ value: siteCode, domainName: domain.name || null }, allSites[siteCode], { - search: search + search })); selectableSitesCount += 1; }); - var selectedSites = state.selection.sites.map(function (site) { - return site.siteCode; - }).filter(function (siteCode) { - return selectableSiteCodes.includes(siteCode); - }); + const selectedSites = state.selection.sites.map(site => site.siteCode).filter(siteCode => selectableSiteCodes.includes(siteCode)); if (!selectableSitesCount) { return null; } @@ -1345,10 +1310,8 @@ var SitesSelect = function SitesSelect() { components: SitesSelectComponents, value: selectedSites, controlShouldRenderValue: false, - filterOption: function filterOption(option, searchText) { - return option.data.search.includes(searchText.toLowerCase()); - }, - onChange: function onChange(value, change) { + filterOption: (option, searchText) => option.data.search.includes(searchText.toLowerCase()), + onChange: (value, change) => { if (change.action !== 'select-option') { return; } @@ -1364,15 +1327,14 @@ var SitesSelect = function SitesSelect() { Primary Component */ function TimeSeriesViewerSites(props) { - var classes = useStyles(_Theme.default); - var _TimeSeriesViewerCont11 = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont12 = _slicedToArray(_TimeSeriesViewerCont11, 2), - state = _TimeSeriesViewerCont12[0], - dispatch = _TimeSeriesViewerCont12[1]; - var _NeonContext$useNeonC5 = _NeonContext.default.useNeonContextState(), - _NeonContext$useNeonC6 = _slicedToArray(_NeonContext$useNeonC5, 1), - neonContextData = _NeonContext$useNeonC6[0].data; - var allSites = neonContextData.sites; + const classes = useStyles(_Theme.default); + const [state, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const [{ + data: neonContextData + }] = _NeonContext.default.useNeonContextState(); + const { + sites: allSites + } = neonContextData; if (!state.selection.sites.length || !Object.keys(allSites).length) { return /*#__PURE__*/_react.default.createElement(_Skeleton.default, { variant: "rect", @@ -1380,9 +1342,7 @@ function TimeSeriesViewerSites(props) { height: 56 }); } - var selectedItems = state.selection.sites.map(function (site) { - return site.siteCode; - }); + const selectedItems = state.selection.sites.map(site => site.siteCode); return /*#__PURE__*/_react.default.createElement("div", { className: classes.root }, /*#__PURE__*/_react.default.createElement("div", { @@ -1402,7 +1362,7 @@ function TimeSeriesViewerSites(props) { marginLeft: _Theme.default.spacing(1.5) } }, - onSave: function onSave(newSites) { + onSave: newSites => { dispatch({ type: 'updateSelectedSites', siteCodes: newSites @@ -1410,27 +1370,23 @@ function TimeSeriesViewerSites(props) { } })), /*#__PURE__*/_react.default.createElement("div", { className: classes.sitesContainer - }, state.selection.sites.map(function (site) { - return /*#__PURE__*/_react.default.createElement(SelectedSite, _extends({ - key: site.siteCode, - site: site, - disabled: state.selection.sites.length < 2 - }, props)); - }))); + }, state.selection.sites.map(site => /*#__PURE__*/_react.default.createElement(SelectedSite, _extends({ + key: site.siteCode, + site: site, + disabled: state.selection.sites.length < 2 + }, props))))); } TimeSeriesViewerSites.propTypes = _TimeSeriesViewerContext.TabComponentPropTypes; // Additional items exported for unit testing -var getTestableItems = function getTestableItems() { - return process.env.NODE_ENV !== 'test' ? {} : { - ucWord: ucWord, - PositionHistoryButton: PositionHistoryButton, - PositionDetail: PositionDetail, - SelectedPosition: SelectedPosition, - SelectPositionsButton: SelectPositionsButton, - SitesControl: SitesControl, - SiteOption: SiteOption, - SelectedSite: SelectedSite - }; +const getTestableItems = () => process.env.NODE_ENV !== 'test' ? {} : { + ucWord, + PositionHistoryButton, + PositionDetail, + SelectedPosition, + SelectPositionsButton, + SitesControl, + SiteOption, + SelectedSite }; exports.getTestableItems = getTestableItems; \ No newline at end of file diff --git a/lib/components/TimeSeriesViewer/TimeSeriesViewerVariables.js b/lib/components/TimeSeriesViewer/TimeSeriesViewerVariables.js index 30ef32cd..b76e264b 100644 --- a/lib/components/TimeSeriesViewer/TimeSeriesViewerVariables.js +++ b/lib/components/TimeSeriesViewer/TimeSeriesViewerVariables.js @@ -27,105 +27,96 @@ var _Search = _interopRequireDefault(require("@material-ui/icons/Search")); var _DoneAll = _interopRequireDefault(require("@material-ui/icons/DoneAll")); var _Theme = _interopRequireDefault(require("../Theme/Theme")); var _TimeSeriesViewerContext = _interopRequireDefault(require("./TimeSeriesViewerContext")); -var _excluded = ["inputRef"]; +const _excluded = ["inputRef"]; /* eslint-disable react/forbid-prop-types */ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } -var useStyles = (0, _styles.makeStyles)(function (theme) { - return { - root: { - flexGrow: 1 - }, - input: { - display: 'flex', - padding: '2px', - height: 'auto' - }, - valueContainer: { - display: 'flex', - flexWrap: 'wrap', - flex: 1, - alignItems: 'center', - overflow: 'hidden' - }, - noOptionsMessage: { - padding: theme.spacing(1, 2) - }, - placeholder: { - position: 'absolute', - left: 2, - bottom: 6, - fontSize: 16 - }, - paper: { - position: 'absolute', - zIndex: 1, - marginTop: theme.spacing(1), - left: 0, - right: 0 - }, - divider: { - height: theme.spacing(2) - }, - optionSubtitle: { - fontSize: '0.75rem', - color: _Theme.default.palette.grey[400] - }, - variableCard: { - display: 'inline-flex', - alignItems: 'center', - justifyContent: 'flex-start', - padding: theme.spacing(1, 3, 1, 1), - width: 'fit-content', - backgroundColor: theme.palette.grey[50], - marginRight: theme.spacing(2) - }, - variableCardContainer: { - lineHeight: '7em', - marginTop: theme.spacing(2) - }, - noneContainer: { - color: theme.palette.grey[400], - display: 'flex', - alignItems: 'flex-start' - }, - noneIcon: { - color: theme.palette.grey[400], - margin: theme.spacing(0.375, 0.5, 0, 0), - fontSize: '1rem' - }, - noneLabel: { - fontSize: '0.95rem' - }, - qualityFlagsContainer: { - marginTop: theme.spacing(2) - }, - qualityFlagsHeading: { - fontWeight: 600, - marginBottom: _Theme.default.spacing(0.5) - }, - qualityFlagsButtons: { - marginBottom: theme.spacing(2), - display: 'flex', - alignItems: 'center', - justifyContent: 'flex-start' - } - }; -}); -var ucWord = function ucWord(word) { - return "".concat(word.slice(0, 1).toUpperCase()).concat(word.slice(1).toLowerCase()); -}; +const useStyles = (0, _styles.makeStyles)(theme => ({ + root: { + flexGrow: 1 + }, + input: { + display: 'flex', + padding: '2px', + height: 'auto' + }, + valueContainer: { + display: 'flex', + flexWrap: 'wrap', + flex: 1, + alignItems: 'center', + overflow: 'hidden' + }, + noOptionsMessage: { + padding: theme.spacing(1, 2) + }, + placeholder: { + position: 'absolute', + left: 2, + bottom: 6, + fontSize: 16 + }, + paper: { + position: 'absolute', + zIndex: 1, + marginTop: theme.spacing(1), + left: 0, + right: 0 + }, + divider: { + height: theme.spacing(2) + }, + optionSubtitle: { + fontSize: '0.75rem', + color: _Theme.default.palette.grey[400] + }, + variableCard: { + display: 'inline-flex', + alignItems: 'center', + justifyContent: 'flex-start', + padding: theme.spacing(1, 3, 1, 1), + width: 'fit-content', + backgroundColor: theme.palette.grey[50], + marginRight: theme.spacing(2) + }, + variableCardContainer: { + lineHeight: '7em', + marginTop: theme.spacing(2) + }, + noneContainer: { + color: theme.palette.grey[400], + display: 'flex', + alignItems: 'flex-start' + }, + noneIcon: { + color: theme.palette.grey[400], + margin: theme.spacing(0.375, 0.5, 0, 0), + fontSize: '1rem' + }, + noneLabel: { + fontSize: '0.95rem' + }, + qualityFlagsContainer: { + marginTop: theme.spacing(2) + }, + qualityFlagsHeading: { + fontWeight: 600, + marginBottom: _Theme.default.spacing(0.5) + }, + qualityFlagsButtons: { + marginBottom: theme.spacing(2), + display: 'flex', + alignItems: 'center', + justifyContent: 'flex-start' + } +})); +const ucWord = word => "".concat(word.slice(0, 1).toUpperCase()).concat(word.slice(1).toLowerCase()); function inputComponent(_ref) { - var inputRef = _ref.inputRef, - props = _objectWithoutProperties(_ref, _excluded); + let { + inputRef + } = _ref, + props = _objectWithoutPropertiesLoose(_ref, _excluded); return /*#__PURE__*/_react.default.createElement("div", _extends({ ref: inputRef }, props)); @@ -136,19 +127,23 @@ inputComponent.propTypes = { })]).isRequired }; function Control(props) { - var children = props.children, - innerProps = props.innerProps, - innerRef = props.innerRef, - TextFieldProps = props.selectProps.TextFieldProps; + const { + children, + innerProps, + innerRef, + selectProps: { + TextFieldProps + } + } = props; return /*#__PURE__*/_react.default.createElement(_TextField.default, _extends({ fullWidth: true, label: "Add Variables", variant: "outlined", InputProps: { - inputComponent: inputComponent, + inputComponent, inputProps: _extends({ ref: innerRef, - children: children + children }, innerProps), endAdornment: /*#__PURE__*/_react.default.createElement(_InputAdornment.default, { position: "end" @@ -169,16 +164,20 @@ Control.propTypes = { selectProps: _propTypes.default.object.isRequired }; function Option(props) { - var classes = useStyles(_Theme.default); - var innerRef = props.innerRef, - isFocused = props.isFocused, - isDisabled = props.isDisabled, - innerProps = props.innerProps, - data = props.data; - var value = data.value, - units = data.units, - description = data.description; - var textStyle = isDisabled ? { + const classes = useStyles(_Theme.default); + const { + innerRef, + isFocused, + isDisabled, + innerProps, + data + } = props; + const { + value, + units, + description + } = data; + const textStyle = isDisabled ? { color: _Theme.default.palette.grey[200] } : {}; return /*#__PURE__*/_react.default.createElement(_MenuItem.default, _extends({ @@ -231,9 +230,13 @@ Option.defaultProps = { isDisabled: false }; function ValueContainer(props) { - var selectProps = props.selectProps, - children = props.children; - var valueContainer = selectProps.classes.valueContainer; + const { + selectProps, + children + } = props; + const { + valueContainer + } = selectProps.classes; return /*#__PURE__*/_react.default.createElement("div", { className: valueContainer }, children); @@ -243,10 +246,14 @@ ValueContainer.propTypes = { selectProps: _propTypes.default.object.isRequired }; function Menu(props) { - var selectProps = props.selectProps, - innerProps = props.innerProps, - children = props.children; - var paper = selectProps.classes.paper; + const { + selectProps, + innerProps, + children + } = props; + const { + paper + } = selectProps.classes; return /*#__PURE__*/_react.default.createElement(_Paper.default, _extends({ square: true, className: paper @@ -257,73 +264,56 @@ Menu.propTypes = { innerProps: _propTypes.default.object.isRequired, selectProps: _propTypes.default.object.isRequired }; -var components = { - Control: Control, - Menu: Menu, - Option: Option, - ValueContainer: ValueContainer, - Placeholder: function Placeholder() { - return null; - }, - MultiValue: function MultiValue() { - return null; - }, - IndicatorsContainer: function IndicatorsContainer() { - return null; - } +const components = { + Control, + Menu, + Option, + ValueContainer, + Placeholder: () => null, + MultiValue: () => null, + IndicatorsContainer: () => null }; -var selectStyles = { - input: function input(base) { - return _extends({}, base, { - color: _Theme.default.palette.text.primary, - '& input': { - font: 'inherit' - } - }); - }, - clearIndicator: function clearIndicator(base) { - return _extends({}, base, { - display: 'none' - }); - }, - indicatorSeparator: function indicatorSeparator(base) { - return _extends({}, base, { - display: 'none' - }); - }, - dropdownIndicator: function dropdownIndicator(base) { - return _extends({}, base, { - cursor: 'pointer' - }); - }, - groupHeading: function groupHeading(base) { - return _extends({}, base, { - fontSize: '1rem', - fontWeight: 600, - color: _Theme.default.palette.primary.main - }); - } +const selectStyles = { + input: base => _extends({}, base, { + color: _Theme.default.palette.text.primary, + '& input': { + font: 'inherit' + } + }), + clearIndicator: base => _extends({}, base, { + display: 'none' + }), + indicatorSeparator: base => _extends({}, base, { + display: 'none' + }), + dropdownIndicator: base => _extends({}, base, { + cursor: 'pointer' + }), + groupHeading: base => _extends({}, base, { + fontSize: '1rem', + fontWeight: 600, + color: _Theme.default.palette.primary.main + }) }; /** Quality Flags */ -var QualityFlags = function QualityFlags() { - var classes = useStyles(_Theme.default); - var _TimeSeriesViewerCont = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont2 = _slicedToArray(_TimeSeriesViewerCont, 2), - state = _TimeSeriesViewerCont2[0], - dispatch = _TimeSeriesViewerCont2[1]; - var availableQualityFlags = state.availableQualityFlags; - var selectedQualityFlags = state.selection.qualityFlags; - var toggleFlag = function toggleFlag(qualityFlag) { - return function (event) { - dispatch({ - type: 'selectToggleQualityFlag', - qualityFlag: qualityFlag, - selected: event.target.checked - }); - }; +const QualityFlags = () => { + const classes = useStyles(_Theme.default); + const [state, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const { + availableQualityFlags + } = state; + const { + qualityFlags: selectedQualityFlags + } = state.selection; + const toggleFlag = qualityFlag => event => { + dispatch({ + type: 'selectToggleQualityFlag', + qualityFlag, + selected: event.target.checked + }); }; if (!availableQualityFlags.size) { return /*#__PURE__*/_react.default.createElement("div", { @@ -335,26 +325,28 @@ var QualityFlags = function QualityFlags() { className: classes.noneLabel }, "No Quality Flags Available")); } - var organizedQualityFlags = { + const organizedQualityFlags = { basic: [], expanded: [] }; - Array.from(availableQualityFlags).forEach(function (qf) { + Array.from(availableQualityFlags).forEach(qf => { if (!state.variables[qf]) { return; } - var downloadPkg = state.variables[qf].downloadPkg; + const { + downloadPkg + } = state.variables[qf]; organizedQualityFlags[downloadPkg].push(qf); }); organizedQualityFlags.basic.sort(); organizedQualityFlags.expanded.sort(); - var downloadPkgs = ['basic', 'expanded']; + const downloadPkgs = ['basic', 'expanded']; return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, availableQualityFlags.size > 1 ? /*#__PURE__*/_react.default.createElement("div", { className: classes.qualityFlagsButtons }, /*#__PURE__*/_react.default.createElement(_Button.default, { size: "small", variant: "outlined", - onClick: function onClick() { + onClick: () => { dispatch({ type: 'selectNoneQualityFlags' }); @@ -366,85 +358,76 @@ var QualityFlags = function QualityFlags() { }, "Select None"), /*#__PURE__*/_react.default.createElement(_Button.default, { size: "small", variant: "outlined", - onClick: function onClick() { + onClick: () => { dispatch({ type: 'selectAllQualityFlags' }); }, startIcon: /*#__PURE__*/_react.default.createElement(_DoneAll.default, null) - }, "Select All (".concat(availableQualityFlags.size, ")"))) : null, /*#__PURE__*/_react.default.createElement(_FormGroup.default, null, downloadPkgs.map(function (downloadPkg) { - return /*#__PURE__*/_react.default.createElement("div", { - key: downloadPkg - }, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "subtitle2" - }, ucWord(downloadPkg)), !organizedQualityFlags[downloadPkg].length ? /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "body2", - className: classes.noneLabel - }, "No ".concat(downloadPkg, " quality flags available")) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, organizedQualityFlags[downloadPkg].map(function (qf) { - var checked = selectedQualityFlags.includes(qf); - var captionStyle = { - display: 'block', - color: _Theme.default.palette.grey[400] - }; - return /*#__PURE__*/_react.default.createElement(_FormControlLabel.default, { - key: qf, + }, "Select All (".concat(availableQualityFlags.size, ")"))) : null, /*#__PURE__*/_react.default.createElement(_FormGroup.default, null, downloadPkgs.map(downloadPkg => /*#__PURE__*/_react.default.createElement("div", { + key: downloadPkg + }, /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "subtitle2" + }, ucWord(downloadPkg)), !organizedQualityFlags[downloadPkg].length ? /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "body2", + className: classes.noneLabel + }, "No ".concat(downloadPkg, " quality flags available")) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, organizedQualityFlags[downloadPkg].map(qf => { + const checked = selectedQualityFlags.includes(qf); + const captionStyle = { + display: 'block', + color: _Theme.default.palette.grey[400] + }; + return /*#__PURE__*/_react.default.createElement(_FormControlLabel.default, { + key: qf, + style: { + alignItems: 'flex-start', + marginBottom: _Theme.default.spacing(1) + }, + control: /*#__PURE__*/_react.default.createElement(_Checkbox.default, { + value: qf, + color: "primary", + checked: checked, + onChange: toggleFlag(qf) + }), + label: /*#__PURE__*/_react.default.createElement("div", { style: { - alignItems: 'flex-start', - marginBottom: _Theme.default.spacing(1) - }, - control: /*#__PURE__*/_react.default.createElement(_Checkbox.default, { - value: qf, - color: "primary", - checked: checked, - onChange: toggleFlag(qf) - }), - label: /*#__PURE__*/_react.default.createElement("div", { - style: { - paddingTop: _Theme.default.spacing(0.5) - } - }, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "body2" - }, qf, /*#__PURE__*/_react.default.createElement(_Typography.default, { - variant: "caption", - style: captionStyle - }, state.variables[qf].description))) - }); - }))); - }))); + paddingTop: _Theme.default.spacing(0.5) + } + }, /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "body2" + }, qf, /*#__PURE__*/_react.default.createElement(_Typography.default, { + variant: "caption", + style: captionStyle + }, state.variables[qf].description))) + }); + })))))); }; function TimeSeriesViewerVariables() { - var classes = useStyles(_Theme.default); - var _TimeSeriesViewerCont3 = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(), - _TimeSeriesViewerCont4 = _slicedToArray(_TimeSeriesViewerCont3, 2), - state = _TimeSeriesViewerCont4[0], - dispatch = _TimeSeriesViewerCont4[1]; - var selectedVariables = state.selection.variables.map(function (variable) { - return _extends({}, state.variables[variable], { - value: variable - }); - }); - var selectedUnits = Array.from(state.selection.variables.reduce(function (units, variable) { + const classes = useStyles(_Theme.default); + const [state, dispatch] = _TimeSeriesViewerContext.default.useTimeSeriesViewerState(); + const selectedVariables = state.selection.variables.map(variable => _extends({}, state.variables[variable], { + value: variable + })); + const selectedUnits = Array.from(state.selection.variables.reduce((units, variable) => { if (state.variables[variable]) { units.add(state.variables[variable].units); } return units; }, new Set())); - var selectableVariables = [{ + const selectableVariables = [{ label: 'Basic Variables', options: [] }, { label: 'Expanded Variables', options: [] }]; - var selectableVariablesCount = 0; - Object.keys(state.variables).filter(function (variable) { - return state.variables[variable].isSelectable; - }).forEach(function (variable) { - var groupIdx = state.variables[variable].downloadPkg === 'basic' ? 0 : 1; - var isDisabled = selectedUnits.length === 2 && !selectedUnits.includes(state.variables[variable].units); + let selectableVariablesCount = 0; + Object.keys(state.variables).filter(variable => state.variables[variable].isSelectable).forEach(variable => { + const groupIdx = state.variables[variable].downloadPkg === 'basic' ? 0 : 1; + const isDisabled = selectedUnits.length === 2 && !selectedUnits.includes(state.variables[variable].units); selectableVariables[groupIdx].options.push(_extends({}, state.variables[variable], { value: variable, - isDisabled: isDisabled + isDisabled })); selectableVariablesCount += 1; }); @@ -469,26 +452,23 @@ function TimeSeriesViewerVariables() { components: components, value: selectedVariables, controlShouldRenderValue: false, - filterOption: function filterOption(option, searchText) { - return option.data.value.toLowerCase().includes(searchText.toLowerCase()) || option.data.units.toLowerCase().includes(searchText.toLowerCase()) || option.data.description.toLowerCase().includes(searchText.toLowerCase()); - }, - onChange: function onChange(value) { + filterOption: (option, searchText) => option.data.value.toLowerCase().includes(searchText.toLowerCase()) || option.data.units.toLowerCase().includes(searchText.toLowerCase()) || option.data.description.toLowerCase().includes(searchText.toLowerCase()), + onChange: value => { if (!value) { return; } dispatch({ type: 'selectVariables', - variables: value.map(function (v) { - return v.value; - }) + variables: value.map(v => v.value) }); } })), /*#__PURE__*/_react.default.createElement("div", { className: classes.variableCardContainer - }, state.selection.variables.map(function (variable) { - var _state$variables$vari = state.variables[variable], - units = _state$variables$vari.units, - description = _state$variables$vari.description; + }, state.selection.variables.map(variable => { + const { + units, + description + } = state.variables[variable]; return /*#__PURE__*/_react.default.createElement(_Card.default, { key: variable, variant: "outlined", @@ -499,12 +479,10 @@ function TimeSeriesViewerVariables() { style: { marginRight: _Theme.default.spacing(1) }, - onClick: function onClick() { + onClick: () => { dispatch({ type: 'selectVariables', - variables: state.selection.variables.filter(function (v) { - return v !== variable; - }) + variables: state.selection.variables.filter(v => v !== variable) }); } }, /*#__PURE__*/_react.default.createElement(_Clear.default, { diff --git a/lib/components/TimeSeriesViewer/constants.js b/lib/components/TimeSeriesViewer/constants.js index 20ea9776..1f807029 100644 --- a/lib/components/TimeSeriesViewer/constants.js +++ b/lib/components/TimeSeriesViewer/constants.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = exports.TIME_SERIES_VIEWER_STATUS = void 0; // Every possible top-level status the TimeSeriesViewer component can have -var TIME_SERIES_VIEWER_STATUS = { +const TIME_SERIES_VIEWER_STATUS = exports.TIME_SERIES_VIEWER_STATUS = { INIT_PRODUCT: 'INIT_PRODUCT', // Handling props; fetching product data if needed LOADING_META: 'LOADING_META', @@ -22,9 +22,7 @@ var TIME_SERIES_VIEWER_STATUS = { // Ready to re-calculate series data for the graph READY: 'READY' // Ready for user input }; -exports.TIME_SERIES_VIEWER_STATUS = TIME_SERIES_VIEWER_STATUS; -var TimeSeriesViewerConstants = { - TIME_SERIES_VIEWER_STATUS: TIME_SERIES_VIEWER_STATUS +const TimeSeriesViewerConstants = { + TIME_SERIES_VIEWER_STATUS }; -var _default = TimeSeriesViewerConstants; -exports.default = _default; \ No newline at end of file +var _default = exports.default = TimeSeriesViewerConstants; \ No newline at end of file diff --git a/lib/flow/AsyncFlow.js b/lib/flow/AsyncFlow.js index 2284977f..98f9272c 100644 --- a/lib/flow/AsyncFlow.js +++ b/lib/flow/AsyncFlow.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -9,76 +8,68 @@ var _NeonEnvironment = _interopRequireDefault(require("../components/NeonEnviron var _typeUtil = require("../util/typeUtil"); var _asyncFlow = require("../types/asyncFlow"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /* eslint-disable class-methods-use-this */ /* eslint-disable arrow-parens */ -var AsyncFlowProvider = /*#__PURE__*/_createClass(function AsyncFlowProvider() { - var _this = this; - _classCallCheck(this, AsyncFlowProvider); - /** - * Core async flow reducer. - * @param actionTypes The actions types to apply reduction for - * @param parserFunction The parse function for parsing the completed action's response - * @param state The redux state to update - * @param action The current action to apply reduction for - * @return The updated state - */ - this.createCoreReducer = function (actionTypes, parserFunction, state, action) { - var update; - if ((0, _typeUtil.exists)(state)) { - update = state; - } else { - update = {}; - } - switch (action.type) { - case actionTypes.working: - update = _extends({}, update, { - asyncState: _asyncFlow.AsyncStateType.WORKING, - error: null - }); - break; - case actionTypes.completed: - update = _extends({}, update, { - asyncState: _asyncFlow.AsyncStateType.FULLFILLED, - data: parserFunction(action.data), - error: null - }); - break; - case actionTypes.error: - console.error(action.error); // eslint-disable-line no-console - update = _extends({}, update, { - asyncState: _asyncFlow.AsyncStateType.FAILED, - error: _extends({}, update.error, { - error: action.error, - message: action.message - }) - }); - break; - case actionTypes.reset: - update = _extends({}, update, { - asyncState: _asyncFlow.AsyncStateType.IDLE, - data: null, - error: null - }); - break; - default: - break; - } - return update; - }; - /** - * Creates the reducer for handling all async actions within the flow - * @param actionTypes The action types for the flow - * @param parserFunction The parser function for the flow - * @return The decorated core flow reducer - */ - this.createAsyncFlowReducer = function (actionTypes, parserFunction) { - return function (state, action) { - var update = _this.createCoreReducer(actionTypes, parserFunction, state, action); +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /* eslint-disable class-methods-use-this */ /* eslint-disable arrow-parens */ +class AsyncFlowProvider { + constructor() { + /** + * Core async flow reducer. + * @param actionTypes The actions types to apply reduction for + * @param parserFunction The parse function for parsing the completed action's response + * @param state The redux state to update + * @param action The current action to apply reduction for + * @return The updated state + */ + this.createCoreReducer = (actionTypes, parserFunction, state, action) => { + let update; + if ((0, _typeUtil.exists)(state)) { + update = state; + } else { + update = {}; + } + switch (action.type) { + case actionTypes.working: + update = _extends({}, update, { + asyncState: _asyncFlow.AsyncStateType.WORKING, + error: null + }); + break; + case actionTypes.completed: + update = _extends({}, update, { + asyncState: _asyncFlow.AsyncStateType.FULLFILLED, + data: parserFunction(action.data), + error: null + }); + break; + case actionTypes.error: + console.error(action.error); // eslint-disable-line no-console + update = _extends({}, update, { + asyncState: _asyncFlow.AsyncStateType.FAILED, + error: _extends({}, update.error, { + error: action.error, + message: action.message + }) + }); + break; + case actionTypes.reset: + update = _extends({}, update, { + asyncState: _asyncFlow.AsyncStateType.IDLE, + data: null, + error: null + }); + break; + default: + break; + } + return update; + }; + /** + * Creates the reducer for handling all async actions within the flow + * @param actionTypes The action types for the flow + * @param parserFunction The parser function for the flow + * @return The decorated core flow reducer + */ + this.createAsyncFlowReducer = (actionTypes, parserFunction) => (state, action) => { + let update = this.createCoreReducer(actionTypes, parserFunction, state, action); switch (action.type) { case actionTypes.fetch: update = _extends({}, update, { @@ -90,97 +81,92 @@ var AsyncFlowProvider = /*#__PURE__*/_createClass(function AsyncFlowProvider() { } return update; }; - }; - /** - * Creates the set of async flow action creators to dispatch - * @param actionTypes The action types to create for - * @param parserFunction The parser function to apply - * @return The set of action creators - */ - this.createCoreAsyncFlowActions = function (actionTypes, parserFunction) { - var resetAction = null; - if ((0, _typeUtil.exists)(actionTypes.reset)) { - resetAction = function resetAction() { - return { + /** + * Creates the set of async flow action creators to dispatch + * @param actionTypes The action types to create for + * @param parserFunction The parser function to apply + * @return The set of action creators + */ + this.createCoreAsyncFlowActions = (actionTypes, parserFunction) => { + let resetAction = null; + if ((0, _typeUtil.exists)(actionTypes.reset)) { + resetAction = () => ({ type: actionTypes.reset - }; - }; - } - return { - asyncWorkingAction: function asyncWorkingAction(param) { - return { + }); + } + return { + asyncWorkingAction: param => ({ type: actionTypes.working, - param: param - }; - }, - asyncCompletedAction: function asyncCompletedAction(data) { - return { + param + }), + asyncCompletedAction: data => ({ type: actionTypes.completed, - data: data - }; - }, - asyncErrorAction: function asyncErrorAction(error, message, data) { - return { + data + }), + asyncErrorAction: (error, message, data) => ({ type: actionTypes.error, - error: error, - message: message, - data: data - }; - }, - asyncResetAction: resetAction, - parserFunction: parserFunction + error, + message, + data + }), + asyncResetAction: resetAction, + parserFunction + }; }; - }; - /** - * Creates an async flow handler for unifying asynchronous flows within redux - * state manipulation and reducing boilerplate for doing so - * @param actionTypes The action types for the flow - * @param parserFunction The parser function for the flow - * @param ignoreWhenDevEnv Optionally execute the flow - * @returns The decorated async flow handler - */ - this.create = function (actionTypes, parserFunction, ignoreWhenDevEnv) { - var reducer = _this.createAsyncFlowReducer(actionTypes, parserFunction); - return _extends({ - asyncAction: function asyncAction(param) { - if (_NeonEnvironment.default.isDevEnv && ignoreWhenDevEnv) { + /** + * Creates an async flow handler for unifying asynchronous flows within redux + * state manipulation and reducing boilerplate for doing so + * @param actionTypes The action types for the flow + * @param parserFunction The parser function for the flow + * @param ignoreWhenDevEnv Optionally execute the flow + * @returns The decorated async flow handler + */ + this.create = (actionTypes, parserFunction, ignoreWhenDevEnv) => { + const reducer = this.createAsyncFlowReducer(actionTypes, parserFunction); + return _extends({ + asyncAction: param => { + if (_NeonEnvironment.default.isDevEnv && ignoreWhenDevEnv) { + return { + type: '__DEV_NEON_CORE_ASYNCFLOW_IGNORE_ACTION' + }; + } return { - type: '__DEV_NEON_CORE_ASYNCFLOW_IGNORE_ACTION' + type: actionTypes.fetch, + param }; - } - return { - type: actionTypes.fetch, - param: param - }; - }, - reducer: reducer - }, _this.createCoreAsyncFlowActions(actionTypes, parserFunction)); - }; - /** - * Handles the reduction of an asynchronous flow by propagating the - * result data object from the async state object to the owning state - * upon completion - * @param reducer The async flow reducer to handle async state reduction - * @param state The owning state to reduce - * @param action The current action - * @param fetchStateProp The async state property on the owning state - * @param completedActionType The completed action type to responsd to - * @param stateResultProp The result property on the owning state to set - * @return The resulting owning state - */ - this.reduce = function (reducer, state, action, fetchStateProp, completedActionType, stateResultProp) { - var _extends3; - var update = _extends({}, state, _defineProperty({}, fetchStateProp, reducer(state[fetchStateProp], action))); - switch (action.type) { - case completedActionType: - return _extends({}, state, (_extends3 = {}, _defineProperty(_extends3, fetchStateProp, _extends({}, update[fetchStateProp], { - data: null - })), _defineProperty(_extends3, stateResultProp, update[fetchStateProp].data), _extends3)); - default: - return update; - } - }; -}); -var AsyncFlow = new AsyncFlowProvider(); -var _default = AsyncFlow; -exports.default = _default; \ No newline at end of file + }, + reducer + }, this.createCoreAsyncFlowActions(actionTypes, parserFunction)); + }; + /** + * Handles the reduction of an asynchronous flow by propagating the + * result data object from the async state object to the owning state + * upon completion + * @param reducer The async flow reducer to handle async state reduction + * @param state The owning state to reduce + * @param action The current action + * @param fetchStateProp The async state property on the owning state + * @param completedActionType The completed action type to responsd to + * @param stateResultProp The result property on the owning state to set + * @return The resulting owning state + */ + this.reduce = (reducer, state, action, fetchStateProp, completedActionType, stateResultProp) => { + const update = _extends({}, state, { + [fetchStateProp]: reducer(state[fetchStateProp], action) + }); + switch (action.type) { + case completedActionType: + return _extends({}, state, { + [fetchStateProp]: _extends({}, update[fetchStateProp], { + data: null + }), + [stateResultProp]: update[fetchStateProp].data + }); + default: + return update; + } + }; + } +} +const AsyncFlow = new AsyncFlowProvider(); +var _default = exports.default = AsyncFlow; \ No newline at end of file diff --git a/lib/flow/EpicService.js b/lib/flow/EpicService.js index b23fb2ec..e4833fb1 100644 --- a/lib/flow/EpicService.js +++ b/lib/flow/EpicService.js @@ -7,14 +7,8 @@ exports.default = void 0; var _rxjs = require("rxjs"); var _reduxObservable = require("redux-observable"); var _typeUtil = require("../util/typeUtil"); -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -var transformRequest = function transformRequest(ajax, request, action, ajaxBodyCreator, ajaxRequestInjector, index) { - var transformed = request; +const transformRequest = (ajax, request, action, ajaxBodyCreator, ajaxRequestInjector, index) => { + let transformed = request; if ((0, _typeUtil.exists)(action)) { if ((0, _typeUtil.exists)(ajaxRequestInjector)) { transformed = ajaxRequestInjector(request, action, index); @@ -25,85 +19,71 @@ var transformRequest = function transformRequest(ajax, request, action, ajaxBody } return ajax(transformed); }; -var transformRequests = function transformRequests(ajax, requests, action, ajaxBodyCreator, ajaxRequestInjector) { - return requests.map(function (request, index) { - return transformRequest(ajax, request, action, ajaxBodyCreator, ajaxRequestInjector, index); - }); -}; -var createSingleAjaxObservable = function createSingleAjaxObservable(ajax, ajaxConfig, operators, action, ajaxBodyCreator, ajaxRequestInjector) { - var observable = transformRequest(ajax, ajaxConfig, action, ajaxBodyCreator, ajaxRequestInjector); +const transformRequests = (ajax, requests, action, ajaxBodyCreator, ajaxRequestInjector) => requests.map((request, index) => transformRequest(ajax, request, action, ajaxBodyCreator, ajaxRequestInjector, index)); +const createSingleAjaxObservable = (ajax, ajaxConfig, operators, action, ajaxBodyCreator, ajaxRequestInjector) => { + const observable = transformRequest(ajax, ajaxConfig, action, ajaxBodyCreator, ajaxRequestInjector); if ((0, _typeUtil.exists)(operators.takeUntilOp)) { return observable.pipe(operators.successOp, operators.errorOp, operators.takeUntilOp); } return observable.pipe(operators.successOp, operators.errorOp); }; -var createMultiAjaxObservable = function createMultiAjaxObservable(ajax, ajaxConfigs, operators, action, ajaxBodyCreator, ajaxRequestInjector) { - var observables = transformRequests(ajax, ajaxConfigs, action, ajaxBodyCreator, ajaxRequestInjector); +const createMultiAjaxObservable = (ajax, ajaxConfigs, operators, action, ajaxBodyCreator, ajaxRequestInjector) => { + const observables = transformRequests(ajax, ajaxConfigs, action, ajaxBodyCreator, ajaxRequestInjector); if ((0, _typeUtil.exists)(operators.takeUntilOp)) { - return _rxjs.merge.apply(void 0, _toConsumableArray(observables)).pipe(operators.successOp, operators.errorOp, operators.takeUntilOp); + return (0, _rxjs.merge)(...observables).pipe(operators.successOp, operators.errorOp, operators.takeUntilOp); } - return _rxjs.merge.apply(void 0, _toConsumableArray(observables)).pipe(operators.successOp, operators.errorOp); + return (0, _rxjs.merge)(...observables).pipe(operators.successOp, operators.errorOp); }; -var createForkJoinAjaxObservable = function createForkJoinAjaxObservable(ajax, ajaxConfigs, operators, action, ajaxBodyCreator, ajaxRequestInjector) { - var observables = transformRequests(ajax, ajaxConfigs, action, ajaxBodyCreator, ajaxRequestInjector); +const createForkJoinAjaxObservable = (ajax, ajaxConfigs, operators, action, ajaxBodyCreator, ajaxRequestInjector) => { + const observables = transformRequests(ajax, ajaxConfigs, action, ajaxBodyCreator, ajaxRequestInjector); if ((0, _typeUtil.exists)(operators.takeUntilOp)) { return (0, _rxjs.forkJoin)(observables).pipe(operators.successOp, operators.errorOp, operators.takeUntilOp); } return (0, _rxjs.forkJoin)(observables).pipe(operators.successOp, operators.errorOp); }; -var EpicService = { - createEpic: function createEpic(ofTypeFilter, ajaxConfig, workingAction, successAction, errorAction, takeUntilTypeFilter, ajaxBodyCreator, ajaxRequestInjector, useForkJoin) { - return function (action$, state$, _ref) { - var ajax = _ref.ajax; - var ofTypeFilters = !Array.isArray(ofTypeFilter) ? [ofTypeFilter] : ofTypeFilter; - var takeUntilOperator; - if ((0, _typeUtil.exists)(takeUntilTypeFilter)) { - takeUntilOperator = (0, _rxjs.takeUntil)(action$.pipe((0, _reduxObservable.ofType)(takeUntilTypeFilter))); - } - return action$.pipe( - // @ts-ignore - _reduxObservable.ofType.apply(_reduxObservable.ofType, ofTypeFilters), (0, _rxjs.switchMap)(function (action) { - return (0, _rxjs.concat)((0, _rxjs.of)(workingAction({ - action: action - })), EpicService.createAjaxObservable(ajax, ajaxConfig, successAction, errorAction, action, takeUntilOperator, ajaxBodyCreator, ajaxRequestInjector, useForkJoin)); - })); - }; - }, - createMergeEpic: function createMergeEpic(ofTypeFilter, ajaxConfig, workingAction, successAction, errorAction, takeUntilTypeFilter, ajaxBodyCreator, ajaxRequestInjector, useForkJoin) { - return function (action$, state$, _ref2) { - var ajax = _ref2.ajax; - var ofTypeFilters = !Array.isArray(ofTypeFilter) ? [ofTypeFilter] : ofTypeFilter; - var takeUntilOperator; - if ((0, _typeUtil.exists)(takeUntilTypeFilter)) { - takeUntilOperator = (0, _rxjs.takeUntil)(action$.pipe((0, _reduxObservable.ofType)(takeUntilTypeFilter))); - } - return action$.pipe( - // @ts-ignore - _reduxObservable.ofType.apply(_reduxObservable.ofType, ofTypeFilters), (0, _rxjs.mergeMap)(function (action) { - return (0, _rxjs.concat)((0, _rxjs.of)(workingAction({ - action: action - })), EpicService.createAjaxObservable(ajax, ajaxConfig, successAction, errorAction, action, takeUntilOperator, ajaxBodyCreator, ajaxRequestInjector, useForkJoin)); - })); - }; - }, - createEpicFromProps: function createEpicFromProps(props) { - return EpicService.createEpic(props.ofTypeFilter, props.request, props.workingAction, props.successAction, props.errorAction, props.takeUntilTypeFilter, props.bodyCreator, props.requestInjector, props.useForkJoin); +const EpicService = { + createEpic: (ofTypeFilter, ajaxConfig, workingAction, successAction, errorAction, takeUntilTypeFilter, ajaxBodyCreator, ajaxRequestInjector, useForkJoin) => (action$, state$, _ref) => { + let { + ajax + } = _ref; + const ofTypeFilters = !Array.isArray(ofTypeFilter) ? [ofTypeFilter] : ofTypeFilter; + let takeUntilOperator; + if ((0, _typeUtil.exists)(takeUntilTypeFilter)) { + takeUntilOperator = (0, _rxjs.takeUntil)(action$.pipe((0, _reduxObservable.ofType)(takeUntilTypeFilter))); + } + return action$.pipe( + // @ts-ignore + _reduxObservable.ofType.apply(_reduxObservable.ofType, ofTypeFilters), (0, _rxjs.switchMap)(action => (0, _rxjs.concat)((0, _rxjs.of)(workingAction({ + action + })), EpicService.createAjaxObservable(ajax, ajaxConfig, successAction, errorAction, action, takeUntilOperator, ajaxBodyCreator, ajaxRequestInjector, useForkJoin)))); }, - createMergeEpicFromProps: function createMergeEpicFromProps(props) { - return EpicService.createMergeEpic(props.ofTypeFilter, props.request, props.workingAction, props.successAction, props.errorAction, props.takeUntilTypeFilter, props.bodyCreator, props.requestInjector, props.useForkJoin); + createMergeEpic: (ofTypeFilter, ajaxConfig, workingAction, successAction, errorAction, takeUntilTypeFilter, ajaxBodyCreator, ajaxRequestInjector, useForkJoin) => (action$, state$, _ref2) => { + let { + ajax + } = _ref2; + const ofTypeFilters = !Array.isArray(ofTypeFilter) ? [ofTypeFilter] : ofTypeFilter; + let takeUntilOperator; + if ((0, _typeUtil.exists)(takeUntilTypeFilter)) { + takeUntilOperator = (0, _rxjs.takeUntil)(action$.pipe((0, _reduxObservable.ofType)(takeUntilTypeFilter))); + } + return action$.pipe( + // @ts-ignore + _reduxObservable.ofType.apply(_reduxObservable.ofType, ofTypeFilters), (0, _rxjs.mergeMap)(action => (0, _rxjs.concat)((0, _rxjs.of)(workingAction({ + action + })), EpicService.createAjaxObservable(ajax, ajaxConfig, successAction, errorAction, action, takeUntilOperator, ajaxBodyCreator, ajaxRequestInjector, useForkJoin)))); }, - createAjaxObservable: function createAjaxObservable(ajax, ajaxConfig, successAction, errorAction, action, takeUntilOperator, ajaxBodyCreator, ajaxRequestInjector, useForkJoin) { - var operators = { - successOp: (0, _rxjs.mergeMap)(function (response) { - return successAction(response, action); - }), - errorOp: (0, _rxjs.catchError)(function (error) { - var parsedError = (0, _typeUtil.exists)(error) ? error : null; + createEpicFromProps: props => EpicService.createEpic(props.ofTypeFilter, props.request, props.workingAction, props.successAction, props.errorAction, props.takeUntilTypeFilter, props.bodyCreator, props.requestInjector, props.useForkJoin), + createMergeEpicFromProps: props => EpicService.createMergeEpic(props.ofTypeFilter, props.request, props.workingAction, props.successAction, props.errorAction, props.takeUntilTypeFilter, props.bodyCreator, props.requestInjector, props.useForkJoin), + createAjaxObservable: (ajax, ajaxConfig, successAction, errorAction, action, takeUntilOperator, ajaxBodyCreator, ajaxRequestInjector, useForkJoin) => { + const operators = { + successOp: (0, _rxjs.mergeMap)(response => successAction(response, action)), + errorOp: (0, _rxjs.catchError)(error => { + const parsedError = (0, _typeUtil.exists)(error) ? error : null; return errorAction(parsedError, action); }), takeUntilOp: takeUntilOperator }; - var isArrayRequest = Array.isArray(ajaxConfig); + const isArrayRequest = Array.isArray(ajaxConfig); if (isArrayRequest && useForkJoin) { return createForkJoinAjaxObservable(ajax, ajaxConfig, operators, action, ajaxBodyCreator, ajaxRequestInjector); } @@ -113,5 +93,4 @@ var EpicService = { return createSingleAjaxObservable(ajax, ajaxConfig, operators, action, ajaxBodyCreator, ajaxRequestInjector); } }; -var _default = EpicService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = EpicService; \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index 6811c586..14178da3 100644 --- a/lib/index.js +++ b/lib/index.js @@ -5,139 +5,139 @@ Object.defineProperty(exports, "__esModule", { }); Object.defineProperty(exports, "AopDataViewer", { enumerable: true, - get: function get() { + get: function () { return _AopDataViewer.default; } }); Object.defineProperty(exports, "DataProductAvailability", { enumerable: true, - get: function get() { + get: function () { return _DataProductAvailability.default; } }); Object.defineProperty(exports, "DataThemeIcon", { enumerable: true, - get: function get() { + get: function () { return _DataThemeIcon.default; } }); Object.defineProperty(exports, "DialogBase", { enumerable: true, - get: function get() { + get: function () { return _DialogBase.default; } }); Object.defineProperty(exports, "DownloadDataButton", { enumerable: true, - get: function get() { + get: function () { return _DownloadDataButton.default; } }); Object.defineProperty(exports, "DownloadDataContext", { enumerable: true, - get: function get() { + get: function () { return _DownloadDataContext.default; } }); Object.defineProperty(exports, "DownloadStepForm", { enumerable: true, - get: function get() { + get: function () { return _DownloadStepForm.default; } }); Object.defineProperty(exports, "ExternalHost", { enumerable: true, - get: function get() { + get: function () { return _ExternalHost.default; } }); Object.defineProperty(exports, "ExternalHostInfo", { enumerable: true, - get: function get() { + get: function () { return _ExternalHostInfo.default; } }); Object.defineProperty(exports, "ExternalHostProductSpecificLinks", { enumerable: true, - get: function get() { + get: function () { return _ExternalHostProductSpecificLinks.default; } }); Object.defineProperty(exports, "FullWidthVisualization", { enumerable: true, - get: function get() { + get: function () { return _FullWidthVisualization.default; } }); Object.defineProperty(exports, "NeonAuth", { enumerable: true, - get: function get() { + get: function () { return _NeonAuth.default; } }); Object.defineProperty(exports, "NeonContext", { enumerable: true, - get: function get() { + get: function () { return _NeonContext.default; } }); Object.defineProperty(exports, "NeonEnvironment", { enumerable: true, - get: function get() { + get: function () { return _NeonEnvironment.default; } }); Object.defineProperty(exports, "NeonFooter", { enumerable: true, - get: function get() { + get: function () { return _NeonFooter.default; } }); Object.defineProperty(exports, "NeonGraphQL", { enumerable: true, - get: function get() { + get: function () { return _NeonGraphQL.default; } }); Object.defineProperty(exports, "NeonHeader", { enumerable: true, - get: function get() { + get: function () { return _NeonHeader.default; } }); Object.defineProperty(exports, "NeonJsonLd", { enumerable: true, - get: function get() { + get: function () { return _NeonJsonLd.default; } }); Object.defineProperty(exports, "NeonPage", { enumerable: true, - get: function get() { + get: function () { return _NeonPage.default; } }); Object.defineProperty(exports, "NeonRouter", { enumerable: true, - get: function get() { + get: function () { return _NeonRouter.default; } }); Object.defineProperty(exports, "SiteChip", { enumerable: true, - get: function get() { + get: function () { return _SiteChip.default; } }); Object.defineProperty(exports, "SiteMap", { enumerable: true, - get: function get() { + get: function () { return _SiteMap.default; } }); Object.defineProperty(exports, "Theme", { enumerable: true, - get: function get() { + get: function () { return _Theme.default; } }); diff --git a/lib/parser/BundleParser.js b/lib/parser/BundleParser.js index 860d1a25..449e8bbd 100644 --- a/lib/parser/BundleParser.js +++ b/lib/parser/BundleParser.js @@ -5,19 +5,19 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; var _typeUtil = require("../util/typeUtil"); -var BundleParser = { - parseBundlesResponse: function parseBundlesResponse(response) { +const BundleParser = { + parseBundlesResponse: response => { if (!(0, _typeUtil.exists)(response)) { return []; } - var data = (0, _typeUtil.resolveAny)(response, 'data'); + const data = (0, _typeUtil.resolveAny)(response, 'data'); if (!Array.isArray(data)) { return []; } return data; }, - parseContext: function parseContext(bundlesResponse) { - var bundles = { + parseContext: bundlesResponse => { + const bundles = { bundleProducts: {}, bundleProductsForwardAvailability: {}, bundleDoiLookup: {}, @@ -29,33 +29,39 @@ var BundleParser = { return bundles; } bundles.apiResponse = bundlesResponse; - bundles.apiResponse.forEach(function (releaseBundles) { - var bundleProducts = {}; - var bundleProductForwardAvailability = {}; - var doiLookup = {}; - var splitLookup = {}; - var release = releaseBundles.release, - dataProductBundles = releaseBundles.dataProductBundles; - dataProductBundles.forEach(function (bundle) { - var bundleProductCode = bundle.productCode, - forwardAvailability = bundle.forwardAvailability, - bundledProducts = bundle.bundledProducts; + bundles.apiResponse.forEach(releaseBundles => { + const bundleProducts = {}; + const bundleProductForwardAvailability = {}; + const doiLookup = {}; + const splitLookup = {}; + const { + release, + dataProductBundles + } = releaseBundles; + dataProductBundles.forEach(bundle => { + const { + productCode: bundleProductCode, + forwardAvailability, + bundledProducts + } = bundle; bundles.allBundleProducts[bundleProductCode] = true; if (forwardAvailability) { bundleProductForwardAvailability[bundleProductCode] = true; } bundleProducts[bundleProductCode] = []; - bundledProducts.forEach(function (bundledProduct) { - var productCode = bundledProduct.productCode, - isPrimaryBundle = bundledProduct.isPrimaryBundle; + bundledProducts.forEach(bundledProduct => { + const { + productCode, + isPrimaryBundle + } = bundledProduct; bundles.allBundleProducts[productCode] = true; bundleProducts[bundleProductCode].push(productCode); if (!(0, _typeUtil.exists)(isPrimaryBundle)) { doiLookup[productCode] = bundleProductCode; } else { // Type check guard for positive boolean value, not non falsey - var primary = isPrimaryBundle === true; - var bundleParents = []; + const primary = isPrimaryBundle === true; + let bundleParents = []; if ((0, _typeUtil.exists)(doiLookup[productCode]) && Array.isArray(doiLookup[productCode])) { bundleParents = doiLookup[productCode]; if (primary) { @@ -81,7 +87,7 @@ var BundleParser = { bundles.bundleProductsForwardAvailability[release] = bundleProductForwardAvailability; bundles.bundleDoiLookup[release] = doiLookup; bundles.splitProducts[release] = {}; - Object.keys(splitLookup).forEach(function (key) { + Object.keys(splitLookup).forEach(key => { if (Array.isArray(splitLookup[key]) && splitLookup[key].length > 1) { bundles.splitProducts[release][key] = splitLookup[key]; } @@ -91,5 +97,4 @@ var BundleParser = { } }; Object.freeze(BundleParser); -var _default = BundleParser; -exports.default = _default; \ No newline at end of file +var _default = exports.default = BundleParser; \ No newline at end of file diff --git a/lib/parser/DataPackageParser.js b/lib/parser/DataPackageParser.js index 3eb9acb9..a15598a7 100644 --- a/lib/parser/DataPackageParser.js +++ b/lib/parser/DataPackageParser.js @@ -6,23 +6,23 @@ Object.defineProperty(exports, "__esModule", { exports.default = void 0; var _typeUtil = require("../util/typeUtil"); var _neonDataPackage = require("../types/neonDataPackage"); -var DataPackageParser = { - parseSensorPosition: function parseSensorPosition(position) { +const DataPackageParser = { + parseSensorPosition: position => { if (!(0, _typeUtil.exists)(position)) { return null; } - var result = null; - var resultV2 = _neonDataPackage.sensorPositionV2Schema.safeParse(position); + let result = null; + const resultV2 = _neonDataPackage.sensorPositionV2Schema.safeParse(position); if (!resultV2.success) { // Check for v1 schema - var resultV1 = _neonDataPackage.sensorPositionV1Schema.safeParse(position); + const resultV1 = _neonDataPackage.sensorPositionV1Schema.safeParse(position); if (!resultV1.success) { - var v2ErrorFormat = resultV2.error.format(); - var v1ErrorFormat = resultV1.error.format(); + const v2ErrorFormat = resultV2.error.format(); + const v1ErrorFormat = resultV1.error.format(); // eslint-disable-next-line no-console console.error('Failed to detect sensor position schema', v2ErrorFormat, v1ErrorFormat); } else { - var parsedV1 = resultV1.data; + const parsedV1 = resultV1.data; result = { horVer: parsedV1['HOR.VER'], sensorName: (0, _typeUtil.isStringNonEmpty)(parsedV1.name) ? parsedV1.name : 'N/A', @@ -49,7 +49,7 @@ var DataPackageParser = { }; } } else { - var parsedV2 = resultV2.data; + const parsedV2 = resultV2.data; result = { horVer: parsedV2['HOR.VER'], sensorName: parsedV2.sensorLocationID, @@ -79,5 +79,4 @@ var DataPackageParser = { } }; Object.freeze(DataPackageParser); -var _default = DataPackageParser; -exports.default = _default; \ No newline at end of file +var _default = exports.default = DataPackageParser; \ No newline at end of file diff --git a/lib/parser/DocumentParser.js b/lib/parser/DocumentParser.js index ba2f58e9..c80654aa 100644 --- a/lib/parser/DocumentParser.js +++ b/lib/parser/DocumentParser.js @@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; var _typeUtil = require("../util/typeUtil"); -var DocumentParser = { - parseQuickStartGuideVersionResponse: function parseQuickStartGuideVersionResponse(response) { +const DocumentParser = { + parseQuickStartGuideVersionResponse: response => { if (!(0, _typeUtil.exists)(response)) { return null; } - var data = (0, _typeUtil.resolveAny)(response, 'data'); + const data = (0, _typeUtil.resolveAny)(response, 'data'); if (!(0, _typeUtil.exists)(data)) { return null; } @@ -21,26 +21,21 @@ var DocumentParser = { documents: DocumentParser.parseQuickStartGuideDocuments(data.documents) }; }, - parseQuickStartGuideDocuments: function parseQuickStartGuideDocuments(documents) { + parseQuickStartGuideDocuments: documents => { if (!Array.isArray(documents)) { return []; } - return documents.map(function (document) { - return DocumentParser.parseQuickStartGuideDocument(document); - }); + return documents.map(document => DocumentParser.parseQuickStartGuideDocument(document)); }, - parseQuickStartGuideDocument: function parseQuickStartGuideDocument(document) { - return { - name: document.name, - description: document.description, - type: document.type, - size: document.size, - md5: document.md5, - generationDate: document.generationDate, - url: document.url - }; - } + parseQuickStartGuideDocument: document => ({ + name: document.name, + description: document.description, + type: document.type, + size: document.size, + md5: document.md5, + generationDate: document.generationDate, + url: document.url + }) }; Object.freeze(DocumentParser); -var _default = DocumentParser; -exports.default = _default; \ No newline at end of file +var _default = exports.default = DocumentParser; \ No newline at end of file diff --git a/lib/remoteAssets/drupal-footer.html.d.ts b/lib/remoteAssets/drupal-footer.html.d.ts index 6cfd86e3..6405a3d1 100644 --- a/lib/remoteAssets/drupal-footer.html.d.ts +++ b/lib/remoteAssets/drupal-footer.html.d.ts @@ -1,2 +1,2 @@ -declare const _default: "\n\n\n\n\n"; +declare const _default: "\n\n\n\n\n\n\n"; export default _default; diff --git a/lib/remoteAssets/drupal-footer.html.js b/lib/remoteAssets/drupal-footer.html.js index 39acde64..ef0413e8 100644 --- a/lib/remoteAssets/drupal-footer.html.js +++ b/lib/remoteAssets/drupal-footer.html.js @@ -4,6 +4,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; -var html; -var _default = html = "\n\n\n\n\n"; -exports.default = _default; \ No newline at end of file +let html; +var _default = exports.default = html = "\n\n\n\n\n\n\n"; \ No newline at end of file diff --git a/lib/remoteAssets/drupal-header.html.d.ts b/lib/remoteAssets/drupal-header.html.d.ts index 3a2c31d8..1a8cbf6b 100644 --- a/lib/remoteAssets/drupal-header.html.d.ts +++ b/lib/remoteAssets/drupal-header.html.d.ts @@ -1,2 +1,2 @@ -declare const _default: "\n
\n
\n \n \n \n
\n \n\n
\n
\n
\n
\n \n \n \n\n\n \n\n
\n
\n \n
\n
\n

Search

\n \n\n
\n \n \n
\n
\n \n\n \n
\n
\n\n\n
\n\n
\n\n
\n\n
\n \n\n
\n
\n
\n
\n
\n\n\n"; +declare const _default: "
\n
\n
\n \n \"\n \n\n
\n \n \n
\n \n\n
\n
\n
\n
\n \n \n \n\n\n \n\n
\n
\n \n
\n
\n

Search

\n \n\n
\n \n \n
\n
\n \n\n \n
\n
\n\n\n
\n\n
\n\n
\n\n
\n \n\n
\n
\n
\n
\n
\n\n\n\n"; export default _default; diff --git a/lib/remoteAssets/drupal-header.html.js b/lib/remoteAssets/drupal-header.html.js index e0cb9629..e935930b 100644 --- a/lib/remoteAssets/drupal-header.html.js +++ b/lib/remoteAssets/drupal-header.html.js @@ -4,6 +4,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; -var html; -var _default = html = "\n
\n
\n \n \n \n
\n \n\n
\n
\n
\n
\n \n \n \n\n\n \n\n
\n
\n \n
\n
\n

Search

\n \n\n
\n \n \n
\n
\n \n\n \n
\n
\n\n\n
\n\n
\n\n
\n\n
\n \n\n
\n
\n
\n
\n
\n\n\n"; -exports.default = _default; \ No newline at end of file +let html; +var _default = exports.default = html = "
\n
\n
\n \n \"\n \n\n
\n \n \n
\n \n\n
\n
\n
\n
\n \n \n \n\n\n \n\n
\n
\n \n
\n
\n

Search

\n \n\n
\n \n \n
\n
\n \n\n \n
\n
\n\n\n
\n\n
\n\n
\n\n
\n \n\n
\n
\n
\n
\n
\n\n\n\n"; \ No newline at end of file diff --git a/lib/remoteAssets/drupal-header.js b/lib/remoteAssets/drupal-header.js index 5469007e..5ec2d6fc 100644 --- a/lib/remoteAssets/drupal-header.js +++ b/lib/remoteAssets/drupal-header.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } /******/(function () { // webpackBootstrap /******/ @@ -35,7 +34,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = /* 98 */ /* 105 */ - ,,, /* 3 */ + ,,, ( /* 3 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var global = __webpack_require__(4); var getOwnPropertyDescriptor = __webpack_require__(5).f; @@ -81,7 +80,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { - if (_typeof(sourceProperty) == _typeof(targetProperty)) continue; + if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills @@ -93,25 +92,25 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 4 */ + }), ( /* 4 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { - var check = function check(it) { + var check = function (it) { return it && it.Math == Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = // eslint-disable-next-line es/no-global-this -- safe - check((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) == 'object' && globalThis) || check((typeof window === "undefined" ? "undefined" : _typeof(window)) == 'object' && window) || + check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe - check((typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self) || check(_typeof(__webpack_require__.g) == 'object' && __webpack_require__.g) || + check(typeof self == 'object' && self) || check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) || // eslint-disable-next-line no-new-func -- fallback function () { return this; }() || Function('return this')(); /***/ - }, /* 5 */ + }), ( /* 5 */ /***/function (__unused_webpack_module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(6); var call = __webpack_require__(8); @@ -137,7 +136,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 6 */ + }), ( /* 6 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var fails = __webpack_require__(7); @@ -145,14 +144,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = module.exports = !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { - get: function get() { + get: function () { return 7; } })[1] != 7; }); /***/ - }, /* 7 */ + }), ( /* 7 */ /***/function (module) { module.exports = function (exec) { try { @@ -163,7 +162,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 8 */ + }), ( /* 8 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var NATIVE_BIND = __webpack_require__(9); var call = Function.prototype.call; @@ -172,7 +171,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 9 */ + }), ( /* 9 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var fails = __webpack_require__(7); module.exports = !fails(function () { @@ -183,7 +182,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }); /***/ - }, /* 10 */ + }), ( /* 10 */ /***/function (__unused_webpack_module, exports) { "use strict"; @@ -204,7 +203,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = } : $propertyIsEnumerable; /***/ - }, /* 11 */ + }), ( /* 11 */ /***/function (module) { module.exports = function (bitmap, value) { return { @@ -216,7 +215,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 12 */ + }), ( /* 12 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { // toObject with fallback for non-array-like ES3 strings var IndexedObject = __webpack_require__(13); @@ -226,7 +225,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 13 */ + }), ( /* 13 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var uncurryThis = __webpack_require__(14); var fails = __webpack_require__(7); @@ -244,7 +243,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = } : $Object; /***/ - }, /* 14 */ + }), ( /* 14 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var NATIVE_BIND = __webpack_require__(9); var FunctionPrototype = Function.prototype; @@ -257,7 +256,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 15 */ + }), ( /* 15 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var uncurryThis = __webpack_require__(14); var toString = uncurryThis({}.toString); @@ -267,7 +266,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 16 */ + }), ( /* 16 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var isNullOrUndefined = __webpack_require__(17); var $TypeError = TypeError; @@ -280,7 +279,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 17 */ + }), ( /* 17 */ /***/function (module) { // we can't use just `it == null` since of `document.all` special case // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec @@ -289,7 +288,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 18 */ + }), ( /* 18 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var toPrimitive = __webpack_require__(19); var isSymbol = __webpack_require__(23); @@ -302,7 +301,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 19 */ + }), ( /* 19 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var call = __webpack_require__(8); var isObject = __webpack_require__(20); @@ -330,19 +329,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 20 */ + }), ( /* 20 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var isCallable = __webpack_require__(21); var $documentAll = __webpack_require__(22); var documentAll = $documentAll.all; module.exports = $documentAll.IS_HTMLDDA ? function (it) { - return _typeof(it) == 'object' ? it !== null : isCallable(it) || it === documentAll; + return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll; } : function (it) { - return _typeof(it) == 'object' ? it !== null : isCallable(it); + return typeof it == 'object' ? it !== null : isCallable(it); }; /***/ - }, /* 21 */ + }), ( /* 21 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var $documentAll = __webpack_require__(22); var documentAll = $documentAll.all; @@ -356,9 +355,9 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 22 */ + }), ( /* 22 */ /***/function (module) { - var documentAll = (typeof document === "undefined" ? "undefined" : _typeof(document)) == 'object' && document.all; + var documentAll = typeof document == 'object' && document.all; // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing @@ -369,7 +368,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 23 */ + }), ( /* 23 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var getBuiltIn = __webpack_require__(24); var isCallable = __webpack_require__(21); @@ -377,18 +376,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = var USE_SYMBOL_AS_UID = __webpack_require__(26); var $Object = Object; module.exports = USE_SYMBOL_AS_UID ? function (it) { - return _typeof(it) == 'symbol'; + return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn('Symbol'); return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); }; /***/ - }, /* 24 */ + }), ( /* 24 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var global = __webpack_require__(4); var isCallable = __webpack_require__(21); - var aFunction = function aFunction(argument) { + var aFunction = function (argument) { return isCallable(argument) ? argument : undefined; }; module.exports = function (namespace, method) { @@ -396,20 +395,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 25 */ + }), ( /* 25 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var uncurryThis = __webpack_require__(14); module.exports = uncurryThis({}.isPrototypeOf); /***/ - }, /* 26 */ + }), ( /* 26 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL = __webpack_require__(27); - module.exports = NATIVE_SYMBOL && !Symbol.sham && _typeof(Symbol.iterator) == 'symbol'; + module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol'; /***/ - }, /* 27 */ + }), ( /* 27 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION = __webpack_require__(28); @@ -426,7 +425,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }); /***/ - }, /* 28 */ + }), ( /* 28 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var global = __webpack_require__(4); var userAgent = __webpack_require__(29); @@ -454,12 +453,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = module.exports = version; /***/ - }, /* 29 */ + }), ( /* 29 */ /***/function (module) { module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || ''; /***/ - }, /* 30 */ + }), ( /* 30 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var aCallable = __webpack_require__(31); var isNullOrUndefined = __webpack_require__(17); @@ -472,7 +471,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 31 */ + }), ( /* 31 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var isCallable = __webpack_require__(21); var tryToString = __webpack_require__(32); @@ -485,7 +484,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 32 */ + }), ( /* 32 */ /***/function (module) { var $String = String; module.exports = function (argument) { @@ -497,7 +496,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 33 */ + }), ( /* 33 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var call = __webpack_require__(8); var isCallable = __webpack_require__(21); @@ -515,7 +514,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 34 */ + }), ( /* 34 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var global = __webpack_require__(4); var shared = __webpack_require__(35); @@ -523,18 +522,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = var uid = __webpack_require__(41); var NATIVE_SYMBOL = __webpack_require__(27); var USE_SYMBOL_AS_UID = __webpack_require__(26); - var _Symbol = global.Symbol; + var Symbol = global.Symbol; var WellKnownSymbolsStore = shared('wks'); - var createWellKnownSymbol = USE_SYMBOL_AS_UID ? _Symbol['for'] || _Symbol : _Symbol && _Symbol.withoutSetter || uid; + var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid; module.exports = function (name) { if (!hasOwn(WellKnownSymbolsStore, name)) { - WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(_Symbol, name) ? _Symbol[name] : createWellKnownSymbol('Symbol.' + name); + WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name) ? Symbol[name] : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; /***/ - }, /* 35 */ + }), ( /* 35 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var IS_PURE = __webpack_require__(36); var store = __webpack_require__(37); @@ -549,12 +548,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }); /***/ - }, /* 36 */ + }), ( /* 36 */ /***/function (module) { module.exports = false; /***/ - }, /* 37 */ + }), ( /* 37 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var global = __webpack_require__(4); var defineGlobalProperty = __webpack_require__(38); @@ -563,7 +562,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = module.exports = store; /***/ - }, /* 38 */ + }), ( /* 38 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var global = __webpack_require__(4); @@ -583,7 +582,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 39 */ + }), ( /* 39 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var uncurryThis = __webpack_require__(14); var toObject = __webpack_require__(40); @@ -597,7 +596,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 40 */ + }), ( /* 40 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var requireObjectCoercible = __webpack_require__(16); var $Object = Object; @@ -609,7 +608,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 41 */ + }), ( /* 41 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var uncurryThis = __webpack_require__(14); var id = 0; @@ -620,7 +619,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 42 */ + }), ( /* 42 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(6); var fails = __webpack_require__(7); @@ -630,14 +629,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = module.exports = !DESCRIPTORS && !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement('div'), 'a', { - get: function get() { + get: function () { return 7; } }).a != 7; }); /***/ - }, /* 43 */ + }), ( /* 43 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var global = __webpack_require__(4); var isObject = __webpack_require__(20); @@ -649,7 +648,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 44 */ + }), ( /* 44 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(6); var definePropertyModule = __webpack_require__(45); @@ -662,7 +661,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 45 */ + }), ( /* 45 */ /***/function (__unused_webpack_module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(6); var IE8_DOM_DEFINE = __webpack_require__(42); @@ -709,7 +708,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 46 */ + }), ( /* 46 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(6); var fails = __webpack_require__(7); @@ -725,7 +724,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }); /***/ - }, /* 47 */ + }), ( /* 47 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var isObject = __webpack_require__(20); var $String = String; @@ -738,7 +737,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 48 */ + }), ( /* 48 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var isCallable = __webpack_require__(21); var definePropertyModule = __webpack_require__(45); @@ -766,7 +765,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 49 */ + }), ( /* 49 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var uncurryThis = __webpack_require__(14); var fails = __webpack_require__(7); @@ -829,7 +828,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }, 'toString'); /***/ - }, /* 50 */ + }), ( /* 50 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(6); var hasOwn = __webpack_require__(39); @@ -847,7 +846,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 51 */ + }), ( /* 51 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var uncurryThis = __webpack_require__(14); var isCallable = __webpack_require__(21); @@ -863,7 +862,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = module.exports = store.inspectSource; /***/ - }, /* 52 */ + }), ( /* 52 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var NATIVE_WEAK_MAP = __webpack_require__(53); var global = __webpack_require__(4); @@ -877,10 +876,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = var TypeError = global.TypeError; var WeakMap = global.WeakMap; var set, get, has; - var enforce = function enforce(it) { + var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; - var getterFor = function getterFor(TYPE) { + var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { @@ -896,31 +895,31 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = store.has = store.has; store.set = store.set; /* eslint-enable no-self-assign -- prototype methods protection */ - set = function set(it, metadata) { + set = function (it, metadata) { if (store.has(it)) throw TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; store.set(it, metadata); return metadata; }; - get = function get(it) { + get = function (it) { return store.get(it) || {}; }; - has = function has(it) { + has = function (it) { return store.has(it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; - set = function set(it, metadata) { + set = function (it, metadata) { if (hasOwn(it, STATE)) throw TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty(it, STATE, metadata); return metadata; }; - get = function get(it) { + get = function (it) { return hasOwn(it, STATE) ? it[STATE] : {}; }; - has = function has(it) { + has = function (it) { return hasOwn(it, STATE); }; } @@ -933,7 +932,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 53 */ + }), ( /* 53 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var global = __webpack_require__(4); var isCallable = __webpack_require__(21); @@ -941,7 +940,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); /***/ - }, /* 54 */ + }), ( /* 54 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var shared = __webpack_require__(35); var uid = __webpack_require__(41); @@ -951,12 +950,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 55 */ + }), ( /* 55 */ /***/function (module) { module.exports = {}; /***/ - }, /* 56 */ + }), ( /* 56 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var hasOwn = __webpack_require__(39); var ownKeys = __webpack_require__(57); @@ -975,7 +974,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 57 */ + }), ( /* 57 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var getBuiltIn = __webpack_require__(24); var uncurryThis = __webpack_require__(14); @@ -992,7 +991,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 58 */ + }), ( /* 58 */ /***/function (__unused_webpack_module, exports, __webpack_require__) { var internalObjectKeys = __webpack_require__(59); var enumBugKeys = __webpack_require__(66); @@ -1006,7 +1005,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 59 */ + }), ( /* 59 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var uncurryThis = __webpack_require__(14); var hasOwn = __webpack_require__(39); @@ -1028,14 +1027,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 60 */ + }), ( /* 60 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var toIndexedObject = __webpack_require__(12); var toAbsoluteIndex = __webpack_require__(61); var lengthOfArrayLike = __webpack_require__(64); // `Array.prototype.{ indexOf, includes }` methods implementation - var createMethod = function createMethod(IS_INCLUDES) { + var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = lengthOfArrayLike(O); @@ -1064,7 +1063,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 61 */ + }), ( /* 61 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var toIntegerOrInfinity = __webpack_require__(62); var max = Math.max; @@ -1079,7 +1078,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 62 */ + }), ( /* 62 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var trunc = __webpack_require__(63); @@ -1092,7 +1091,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 63 */ + }), ( /* 63 */ /***/function (module) { var ceil = Math.ceil; var floor = Math.floor; @@ -1106,7 +1105,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 64 */ + }), ( /* 64 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var toLength = __webpack_require__(65); @@ -1117,7 +1116,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 65 */ + }), ( /* 65 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var toIntegerOrInfinity = __webpack_require__(62); var min = Math.min; @@ -1129,24 +1128,24 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 66 */ + }), ( /* 66 */ /***/function (module) { // IE8- don't enum bug keys module.exports = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf']; /***/ - }, /* 67 */ + }), ( /* 67 */ /***/function (__unused_webpack_module, exports) { // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe exports.f = Object.getOwnPropertySymbols; /***/ - }, /* 68 */ + }), ( /* 68 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var fails = __webpack_require__(7); var isCallable = __webpack_require__(21); var replacement = /#|\.prototype\./; - var isForced = function isForced(feature, detection) { + var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection; }; @@ -1159,7 +1158,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = module.exports = isForced; /***/ - }, /* 69 */ + }), ( /* 69 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var classofRaw = __webpack_require__(15); var uncurryThis = __webpack_require__(14); @@ -1171,7 +1170,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - },,,, /* 73 */ + }),,,, ( /* 73 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var classof = __webpack_require__(74); var $String = String; @@ -1181,7 +1180,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 74 */ + }), ( /* 74 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var TO_STRING_TAG_SUPPORT = __webpack_require__(75); var isCallable = __webpack_require__(21); @@ -1196,7 +1195,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }()) == 'Arguments'; // fallback for IE11 Script Access Denied error - var tryGet = function tryGet(it, key) { + var tryGet = function (it, key) { try { return it[key]; } catch (error) {/* empty */} @@ -1215,7 +1214,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 75 */ + }), ( /* 75 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var wellKnownSymbol = __webpack_require__(34); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); @@ -1224,7 +1223,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = module.exports = String(test) === '[object z]'; /***/ - },,,, /* 79 */ + }),,,, ( /* 79 */ /***/function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { // TODO: Remove from `core-js@4` var uncurryThis = __webpack_require__(14); @@ -1246,7 +1245,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = } /***/ - },,, /* 82 */ + }),,, ( /* 82 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -1269,7 +1268,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - },, /* 84 */ + }),, ( /* 84 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { /* global ActiveXObject -- old IE, WSH */ var anObject = __webpack_require__(47); @@ -1284,13 +1283,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = var PROTOTYPE = 'prototype'; var SCRIPT = 'script'; var IE_PROTO = sharedKey('IE_PROTO'); - var EmptyConstructor = function EmptyConstructor() {/* empty */}; - var scriptTag = function scriptTag(content) { + var EmptyConstructor = function () {/* empty */}; + var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype - var NullProtoObjectViaActiveX = function NullProtoObjectViaActiveX(activeXDocument) { + var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; @@ -1299,7 +1298,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; // Create object with fake `null` prototype: use iframe Object with cleared prototype - var NullProtoObjectViaIFrame = function NullProtoObjectViaIFrame() { + var NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; @@ -1321,15 +1320,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug var activeXDocument; - var _NullProtoObject = function NullProtoObject() { + var NullProtoObject = function () { try { activeXDocument = new ActiveXObject('htmlfile'); } catch (error) {/* ignore */} - _NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE + NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH var length = enumBugKeys.length; - while (length--) delete _NullProtoObject[PROTOTYPE][enumBugKeys[length]]; - return _NullProtoObject(); + while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; + return NullProtoObject(); }; hiddenKeys[IE_PROTO] = true; @@ -1344,12 +1343,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; - } else result = _NullProtoObject(); + } else result = NullProtoObject(); return Properties === undefined ? result : definePropertiesModule.f(result, Properties); }; /***/ - }, /* 85 */ + }), ( /* 85 */ /***/function (__unused_webpack_module, exports, __webpack_require__) { var DESCRIPTORS = __webpack_require__(6); var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(46); @@ -1373,7 +1372,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 86 */ + }), ( /* 86 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var internalObjectKeys = __webpack_require__(59); var enumBugKeys = __webpack_require__(66); @@ -1386,13 +1385,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 87 */ + }), ( /* 87 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var getBuiltIn = __webpack_require__(24); module.exports = getBuiltIn('document', 'documentElement'); /***/ - },,,, /* 91 */ + }),,,, ( /* 91 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var NATIVE_BIND = __webpack_require__(9); var FunctionPrototype = Function.prototype; @@ -1400,12 +1399,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = var call = FunctionPrototype.call; // eslint-disable-next-line es/no-reflect -- safe - module.exports = (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () { + module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () { return call.apply(apply, arguments); }); /***/ - },,,,,,,, /* 99 */ + }),,,,,,,, ( /* 99 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var bind = __webpack_require__(100); var uncurryThis = __webpack_require__(14); @@ -1416,7 +1415,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = var push = uncurryThis([].push); // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation - var createMethod = function createMethod(TYPE) { + var createMethod = function (TYPE) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; var IS_SOME = TYPE == 3; @@ -1461,7 +1460,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = } } } - return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; }; }; @@ -1493,7 +1491,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 100 */ + }), ( /* 100 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var uncurryThis = __webpack_require__(69); var aCallable = __webpack_require__(31); @@ -1510,7 +1508,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 101 */ + }), ( /* 101 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var arraySpeciesConstructor = __webpack_require__(102); @@ -1521,7 +1519,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 102 */ + }), ( /* 102 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var isArray = __webpack_require__(103); var isConstructor = __webpack_require__(104); @@ -1546,7 +1544,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 103 */ + }), ( /* 103 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var classof = __webpack_require__(15); @@ -1558,7 +1556,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 104 */ + }), ( /* 104 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var uncurryThis = __webpack_require__(14); var fails = __webpack_require__(7); @@ -1566,7 +1564,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = var classof = __webpack_require__(74); var getBuiltIn = __webpack_require__(24); var inspectSource = __webpack_require__(51); - var noop = function noop() {/* empty */}; + var noop = function () {/* empty */}; var empty = []; var construct = getBuiltIn('Reflect', 'construct'); var constructorRegExp = /^\s*(?:class|function)\b/; @@ -1610,7 +1608,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }) ? isConstructorLegacy : isConstructorModern; /***/ - },, /* 106 */ + }),, ( /* 106 */ /***/function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var TO_STRING_TAG_SUPPORT = __webpack_require__(75); var defineBuiltIn = __webpack_require__(48); @@ -1625,7 +1623,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = } /***/ - }, /* 107 */ + }), ( /* 107 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -1639,14 +1637,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 108 */ + }), ( /* 108 */ /***/function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { // TODO: Remove this module from `core-js@4` since it's split to modules listed below __webpack_require__(109); __webpack_require__(114); /***/ - }, /* 109 */ + }), ( /* 109 */ /***/function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var $ = __webpack_require__(3); var global = __webpack_require__(4); @@ -1664,7 +1662,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }); /***/ - }, /* 110 */ + }), ( /* 110 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -1699,19 +1697,19 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 111 */ + }), ( /* 111 */ /***/function (module) { /* global Bun -- Deno case */ module.exports = typeof Bun == 'function' && Bun && typeof Bun.version == 'string'; /***/ - }, /* 112 */ + }), ( /* 112 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var uncurryThis = __webpack_require__(14); module.exports = uncurryThis([].slice); /***/ - }, /* 113 */ + }), ( /* 113 */ /***/function (module) { var $TypeError = TypeError; module.exports = function (passed, required) { @@ -1720,7 +1718,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 114 */ + }), ( /* 114 */ /***/function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var $ = __webpack_require__(3); var global = __webpack_require__(4); @@ -1738,7 +1736,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }); /***/ - }, /* 115 */ + }), ( /* 115 */ /***/function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -1769,7 +1767,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = addToUnscopables(FIND); /***/ - }, /* 116 */ + }), ( /* 116 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var wellKnownSymbol = __webpack_require__(34); var create = __webpack_require__(84); @@ -1792,7 +1790,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }; /***/ - }, /* 117 */ + }), ( /* 117 */ /***/function (__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { "use strict"; @@ -1828,7 +1826,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = } /***/ - }, /* 118 */ + }), ( /* 118 */ /***/function (module, __unused_webpack_exports, __webpack_require__) { var call = __webpack_require__(8); var hasOwn = __webpack_require__(39); @@ -1842,7 +1840,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = /***/ } - /******/]; + /******/)]; /************************************************************************/ /******/ // The module cache /******/ @@ -1923,13 +1921,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = /******/ !function () { /******/__webpack_require__.g = function () { - /******/if ((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === 'object') return globalThis; + /******/if (typeof globalThis === 'object') return globalThis; /******/ try { /******/return this || new Function('return this')(); /******/ } catch (e) { - /******/if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object') return window; + /******/if (typeof window === 'object') return window; /******/ } /******/ @@ -2039,7 +2037,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" = }); // go throught the header and find all of the ULs }; - var onResize = throttle(function () { // All screens var $header = $(".header"); diff --git a/lib/remoteAssetsMap/remoteAssets.js b/lib/remoteAssetsMap/remoteAssets.js index 6e2414f2..1ade1b2b 100644 --- a/lib/remoteAssetsMap/remoteAssets.js +++ b/lib/remoteAssetsMap/remoteAssets.js @@ -4,17 +4,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.REMOTE_ASSET_PATHS = exports.REMOTE_ASSET_NAMES = void 0; -var REMOTE_ASSET_PATHS = { +const REMOTE_ASSET_PATHS = exports.REMOTE_ASSET_PATHS = { DRUPAL_THEME_CSS: '/themes/custom/neon/dist/css/components/theme/theme.css', DRUPAL_HEADER_JS: '/themes/custom/neon/dist/js/header/header.js', DRUPAL_HEADER_HTML: '/neon-assets/partial/header', DRUPAL_FOOTER_HTML: '/neon-assets/partial/footer' }; -exports.REMOTE_ASSET_PATHS = REMOTE_ASSET_PATHS; -var REMOTE_ASSET_NAMES = { +const REMOTE_ASSET_NAMES = exports.REMOTE_ASSET_NAMES = { DRUPAL_THEME_CSS: 'drupal-theme.css', DRUPAL_HEADER_JS: 'drupal-header.js', DRUPAL_HEADER_HTML: 'drupal-header.html', DRUPAL_FOOTER_HTML: 'drupal-footer.html' -}; -exports.REMOTE_ASSET_NAMES = REMOTE_ASSET_NAMES; \ No newline at end of file +}; \ No newline at end of file diff --git a/lib/remoteAssetsMap/remoteAssetsMap.js b/lib/remoteAssetsMap/remoteAssetsMap.js index 346a2fd5..251fcf92 100644 --- a/lib/remoteAssetsMap/remoteAssetsMap.js +++ b/lib/remoteAssetsMap/remoteAssetsMap.js @@ -12,7 +12,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de // eslint-disable-next-line import/extensions // portal-core-components that we want to cache updated snapshots of at every lib build -var REMOTE_ASSETS = { +const REMOTE_ASSETS = { DRUPAL_THEME_CSS: { name: _remoteAssets.REMOTE_ASSET_NAMES.DRUPAL_THEME_CSS, url: "".concat(_NeonEnvironment.default.getWebHost()).concat(_remoteAssets.REMOTE_ASSET_PATHS.DRUPAL_THEME_CSS) @@ -32,8 +32,7 @@ var REMOTE_ASSETS = { }; // Replicate keys as attributes to allow for all variable references everywhere -Object.keys(REMOTE_ASSETS).forEach(function (key) { +Object.keys(REMOTE_ASSETS).forEach(key => { REMOTE_ASSETS[key].KEY = key; }); -var _default = REMOTE_ASSETS; -exports.default = _default; \ No newline at end of file +var _default = exports.default = REMOTE_ASSETS; \ No newline at end of file diff --git a/lib/service/AnalyticsService.js b/lib/service/AnalyticsService.js index 5040af4a..12425f7b 100644 --- a/lib/service/AnalyticsService.js +++ b/lib/service/AnalyticsService.js @@ -7,28 +7,28 @@ exports.default = void 0; var _debounce = _interopRequireDefault(require("lodash/debounce")); var _typeUtil = require("../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var debouncedGaExploreSearchEvent = (0, _debounce.default)(function (searchTerm) { +const debouncedGaExploreSearchEvent = (0, _debounce.default)(searchTerm => { // @ts-ignore window.gtmDataLayer.push({ event: 'explore_data_products_search', search_term: searchTerm }); }, 1000); -var debouncedGaPrototypeDataSearchEvent = (0, _debounce.default)(function (searchTerm) { +const debouncedGaPrototypeDataSearchEvent = (0, _debounce.default)(searchTerm => { // @ts-ignore window.gtmDataLayer.push({ event: 'prototype_data_search', search_term: searchTerm }); }, 1000); -var _gaPortalHomeSearchEvent = function gaPortalHomeSearchEvent(searchTerm) { +const gaPortalHomeSearchEvent = searchTerm => { // @ts-ignore window.gtmDataLayer.push({ event: 'portal_home_search', search_term: searchTerm }); }; -var checkValid = function checkValid(searchTerm) { +const checkValid = searchTerm => { // @ts-ignore if (!(0, _typeUtil.exists)(window.gtmDataLayer)) { return false; @@ -38,19 +38,18 @@ var checkValid = function checkValid(searchTerm) { } return true; }; -var AnalyticsService = { - gaExploreSearchEvent: function gaExploreSearchEvent(searchTerm) { +const AnalyticsService = { + gaExploreSearchEvent: searchTerm => { if (!checkValid(searchTerm)) return; debouncedGaExploreSearchEvent(searchTerm); }, - gaPrototypeDataSearchEvent: function gaPrototypeDataSearchEvent(searchTerm) { + gaPrototypeDataSearchEvent: searchTerm => { if (!checkValid(searchTerm)) return; debouncedGaPrototypeDataSearchEvent(searchTerm); }, - gaPortalHomeSearchEvent: function gaPortalHomeSearchEvent(searchTerm) { + gaPortalHomeSearchEvent: searchTerm => { if (!checkValid(searchTerm)) return; - _gaPortalHomeSearchEvent(searchTerm); + gaPortalHomeSearchEvent(searchTerm); } }; -var _default = AnalyticsService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = AnalyticsService; \ No newline at end of file diff --git a/lib/service/BundleService.js b/lib/service/BundleService.js index 6ad83dd4..5cb37057 100644 --- a/lib/service/BundleService.js +++ b/lib/service/BundleService.js @@ -1,44 +1,39 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _ReleaseService = _interopRequireWildcard(require("./ReleaseService")); var _typeUtil = require("../util/typeUtil"); -function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } -function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } -var BundleService = { - isProductDefined: function isProductDefined(context, productCode) { - return context.allBundleProducts[productCode] === true; - }, - isProductDefinedForRelease: function isProductDefinedForRelease(context, productCode, release) { +function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } +function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } +const BundleService = { + isProductDefined: (context, productCode) => context.allBundleProducts[productCode] === true, + isProductDefinedForRelease: (context, productCode, release) => { if (!(0, _typeUtil.exists)(context) || !(0, _typeUtil.exists)(context.bundleProducts) || !(0, _typeUtil.exists)(context.bundleProducts[release])) { return false; } - var bundleProductCodes = Object.keys(context.bundleProducts[release]); + const bundleProductCodes = Object.keys(context.bundleProducts[release]); if (!(0, _typeUtil.existsNonEmpty)(bundleProductCodes)) { return false; } if (bundleProductCodes.includes(productCode)) { return true; } - var childCodes = bundleProductCodes.flatMap(function (bundleProductCode) { - return context.bundleProducts[release][bundleProductCode]; - }); + const childCodes = bundleProductCodes.flatMap(bundleProductCode => context.bundleProducts[release][bundleProductCode]); return childCodes.includes(productCode); }, - determineBundleRelease: function determineBundleRelease(release) { - var regex = _ReleaseService.default.getProvReleaseRegex(); - var isLatestProv = false; + determineBundleRelease: release => { + const regex = _ReleaseService.default.getProvReleaseRegex(); + let isLatestProv = false; if (!(0, _typeUtil.isStringNonEmpty)(release) || release.localeCompare(_ReleaseService.LATEST_AND_PROVISIONAL) === 0) { isLatestProv = true; } else if (regex) { - var matches = regex.exec(release); + const matches = regex.exec(release); isLatestProv = (0, _typeUtil.exists)(matches) && matches.length > 0; } - var appliedRelease; + let appliedRelease; if (isLatestProv) { appliedRelease = 'PROVISIONAL'; } else { @@ -46,13 +41,13 @@ var BundleService = { } return appliedRelease; }, - getBundledProductCodes: function getBundledProductCodes(context, release) { + getBundledProductCodes: (context, release) => { if (!(0, _typeUtil.exists)(context) || !(0, _typeUtil.exists)(context.bundleProducts) || !(0, _typeUtil.exists)(context.bundleProducts[release])) { return []; } return Object.keys(context.bundleProducts[release]); }, - isProductInBundle: function isProductInBundle(context, release, productCode) { + isProductInBundle: (context, release, productCode) => { if (!(0, _typeUtil.exists)(context) || !(0, _typeUtil.exists)(context.bundleDoiLookup) || !(0, _typeUtil.exists)(context.bundleDoiLookup[release])) { return false; } @@ -61,20 +56,18 @@ var BundleService = { } return (0, _typeUtil.isStringNonEmpty)(context.bundleDoiLookup[release][productCode]); }, - isBundledProduct: function isBundledProduct(context, release, productCode) { - return BundleService.getBundledProductCodes(context, release).includes(productCode); - }, - isSplitProduct: function isSplitProduct(context, release, productCode) { + isBundledProduct: (context, release, productCode) => BundleService.getBundledProductCodes(context, release).includes(productCode), + isSplitProduct: (context, release, productCode) => { if (!(0, _typeUtil.exists)(context) || !(0, _typeUtil.exists)(context.splitProducts) || !(0, _typeUtil.exists)(context.splitProducts[release])) { return false; } return Array.isArray(context.splitProducts[release][productCode]); }, - getBundleProductCode: function getBundleProductCode(context, release, productCode) { + getBundleProductCode: (context, release, productCode) => { if (!(0, _typeUtil.exists)(context) || !(0, _typeUtil.exists)(context.bundleDoiLookup) || !(0, _typeUtil.exists)(context.bundleDoiLookup[release])) { return null; } - var bundledProductCode = context.bundleDoiLookup[release][productCode]; + const bundledProductCode = context.bundleDoiLookup[release][productCode]; if (Array.isArray(bundledProductCode) && !(0, _typeUtil.existsNonEmpty)(bundledProductCode)) { return null; } @@ -83,61 +76,59 @@ var BundleService = { } return bundledProductCode; }, - shouldForwardAvailability: function shouldForwardAvailability(context, release, productCode, bundleProductCode) { - var isSplit = BundleService.isSplitProduct(context, release, productCode); + shouldForwardAvailability: (context, release, productCode, bundleProductCode) => { + const isSplit = BundleService.isSplitProduct(context, release, productCode); if (isSplit) { if (!(0, _typeUtil.exists)(context) || !(0, _typeUtil.exists)(context.splitProducts) || !(0, _typeUtil.exists)(context.splitProducts[release]) || !(0, _typeUtil.exists)(context.bundleProductsForwardAvailability) || !(0, _typeUtil.exists)(context.bundleProductsForwardAvailability[release])) { return false; } - return context.splitProducts[release][productCode].some(function (splitToProduct) { - return context.bundleProductsForwardAvailability[release][splitToProduct]; - }); + return context.splitProducts[release][productCode].some(splitToProduct => context.bundleProductsForwardAvailability[release][splitToProduct]); } if (!(0, _typeUtil.exists)(context) || !(0, _typeUtil.exists)(context.bundleProductsForwardAvailability) || !(0, _typeUtil.exists)(context.bundleProductsForwardAvailability[release])) { return false; } - var bundleShouldForward = context.bundleProductsForwardAvailability[release][bundleProductCode]; + const bundleShouldForward = context.bundleProductsForwardAvailability[release][bundleProductCode]; if (!(0, _typeUtil.exists)(bundleShouldForward)) { return false; } return bundleShouldForward; }, - getSplitProductBundles: function getSplitProductBundles(context, release, productCode) { - var isSplit = BundleService.isSplitProduct(context, release, productCode); + getSplitProductBundles: (context, release, productCode) => { + const isSplit = BundleService.isSplitProduct(context, release, productCode); if (!isSplit) { return []; } if (!(0, _typeUtil.exists)(context) || !(0, _typeUtil.exists)(context.splitProducts) || !(0, _typeUtil.exists)(context.splitProducts[release])) { return []; } - var bundles = context.splitProducts[release][productCode]; + const bundles = context.splitProducts[release][productCode]; if (!Array.isArray(bundles)) { return []; } return bundles; }, - getBundledProducts: function getBundledProducts(context, release, bundleProductCode) { + getBundledProducts: (context, release, bundleProductCode) => { if (!(0, _typeUtil.exists)(context) || !(0, _typeUtil.exists)(context.bundleProducts) || !(0, _typeUtil.exists)(context.bundleProducts[release])) { return []; } - var bundle = context.bundleProducts[release][bundleProductCode]; + const bundle = context.bundleProducts[release][bundleProductCode]; if (!Array.isArray(bundle)) { return []; } return bundle; }, - determineCitationBundle: function determineCitationBundle(context, release, productCode) { - var bundleParentCode = null; - var bundleParentCodes = []; - var bundleRelease = BundleService.determineBundleRelease(release); - var isBundleChild = BundleService.isProductInBundle(context, bundleRelease, productCode); + determineCitationBundle: (context, release, productCode) => { + let bundleParentCode = null; + let bundleParentCodes = []; + const bundleRelease = BundleService.determineBundleRelease(release); + const isBundleChild = BundleService.isProductInBundle(context, bundleRelease, productCode); if (isBundleChild) { bundleParentCode = BundleService.getBundleProductCode(context, bundleRelease, productCode); - var hasManyParents = BundleService.isSplitProduct(context, bundleRelease, productCode); + const hasManyParents = BundleService.isSplitProduct(context, bundleRelease, productCode); if (hasManyParents) { bundleParentCodes = BundleService.getSplitProductBundles(context, bundleRelease, productCode); } else { - var bundleCode = BundleService.getBundleProductCode(context, bundleRelease, productCode); + const bundleCode = BundleService.getBundleProductCode(context, bundleRelease, productCode); if ((0, _typeUtil.exists)(bundleCode)) { bundleParentCodes = [bundleCode]; } @@ -148,12 +139,12 @@ var BundleService = { doiProductCode: bundleParentCode }; }, - determineAppliedBundleRelease: function determineAppliedBundleRelease(context, release, productCode, doiStatus) { + determineAppliedBundleRelease: (context, release, productCode, doiStatus) => { if (!(0, _typeUtil.exists)(doiStatus)) { return null; } - var appliedDoiStatus; - var bundleParentCodes = null; + let appliedDoiStatus; + let bundleParentCodes = null; if ((0, _typeUtil.exists)(context)) { bundleParentCodes = BundleService.getBundleProductCode(context, release, productCode); } @@ -161,37 +152,32 @@ var BundleService = { if (!(0, _typeUtil.exists)(bundleParentCodes)) { appliedDoiStatus = doiStatus; } else { - var checkProductCode; + let checkProductCode; if (Array.isArray(bundleParentCodes)) { // eslint-disable-next-line prefer-destructuring checkProductCode = bundleParentCodes[0]; } else { checkProductCode = bundleParentCodes; } - var checkDoiStatus = doiStatus; + const checkDoiStatus = doiStatus; if ((0, _typeUtil.exists)(doiStatus) && checkProductCode.localeCompare(checkDoiStatus.productCode) === 0 && release.localeCompare(checkDoiStatus.release) === 0) { appliedDoiStatus = doiStatus; } } } else if (!(0, _typeUtil.exists)(bundleParentCodes)) { - appliedDoiStatus = doiStatus.find(function (ds) { - return (0, _typeUtil.exists)(ds) && productCode.localeCompare(ds.productCode) === 0 && release.localeCompare(ds.release) === 0; - }); + appliedDoiStatus = doiStatus.find(ds => (0, _typeUtil.exists)(ds) && productCode.localeCompare(ds.productCode) === 0 && release.localeCompare(ds.release) === 0); } else { - var _checkProductCode; + let checkProductCode; if (Array.isArray(bundleParentCodes)) { // eslint-disable-next-line prefer-destructuring - _checkProductCode = bundleParentCodes[0]; + checkProductCode = bundleParentCodes[0]; } else { - _checkProductCode = bundleParentCodes; + checkProductCode = bundleParentCodes; } - appliedDoiStatus = doiStatus.find(function (ds) { - return (0, _typeUtil.exists)(ds) && _checkProductCode.localeCompare(ds.productCode) === 0 && release.localeCompare(ds.release) === 0; - }); + appliedDoiStatus = doiStatus.find(ds => (0, _typeUtil.exists)(ds) && checkProductCode.localeCompare(ds.productCode) === 0 && release.localeCompare(ds.release) === 0); } return appliedDoiStatus; } }; Object.freeze(BundleService); -var _default = BundleService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = BundleService; \ No newline at end of file diff --git a/lib/service/CitationService.js b/lib/service/CitationService.js index 4e5c77b4..4ff74f71 100644 --- a/lib/service/CitationService.js +++ b/lib/service/CitationService.js @@ -8,42 +8,43 @@ var _dateformat = _interopRequireDefault(require("dateformat")); var _RouteService = _interopRequireDefault(require("./RouteService")); var _typeUtil = require("../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var NEON = 'NEON (National Ecological Observatory Network)'; -var CitationService = { - getDateFormatted: function getDateFormatted() { - var now = new Date(); +const NEON = 'NEON (National Ecological Observatory Network)'; +const CitationService = { + getDateFormatted: () => { + const now = new Date(); return (0, _dateformat.default)(now, 'mmmm d, yyyy'); }, - buildDataProductCitationText: function buildDataProductCitationText(product, productReleaseObject) { + buildDataProductCitationText: (product, productReleaseObject) => { if (!(0, _typeUtil.exists)(product)) { return ''; } - var hasRelease = (0, _typeUtil.exists)(productReleaseObject) && (0, _typeUtil.isStringNonEmpty)(productReleaseObject.release); - var hasDoi = hasRelease && (0, _typeUtil.exists)(productReleaseObject.productDoi) && (0, _typeUtil.isStringNonEmpty)(productReleaseObject.productDoi.url); - var citationDoi = hasDoi ? productReleaseObject.productDoi.url : null; - var today = CitationService.getDateFormatted(); - var productName = !hasRelease ? "".concat(product.productName, " (").concat(product.productCode, "), provisional data") : "".concat(product.productName, " (").concat(product.productCode, "), ") + "".concat(productReleaseObject.release); - var doiText = citationDoi ? ". ".concat(citationDoi) : ''; - var url = _RouteService.default.getProductDetailPath(product.productCode, hasRelease ? productReleaseObject.release : undefined); - var accessed = !hasRelease ? "Dataset accessed from ".concat(url, " on ").concat(today, ". Data archived at [your DOI].") : "Dataset accessed from ".concat(url, " on ").concat(today, "."); + const hasRelease = (0, _typeUtil.exists)(productReleaseObject) && (0, _typeUtil.isStringNonEmpty)(productReleaseObject.release); + const hasDoi = hasRelease && (0, _typeUtil.exists)(productReleaseObject.productDoi) && (0, _typeUtil.isStringNonEmpty)(productReleaseObject.productDoi.url); + const citationDoi = hasDoi ? productReleaseObject.productDoi.url : null; + const today = CitationService.getDateFormatted(); + const productName = !hasRelease ? "".concat(product.productName, " (").concat(product.productCode, "), provisional data") : "".concat(product.productName, " (").concat(product.productCode, "), ") + "".concat(productReleaseObject.release); + const doiText = citationDoi ? ". ".concat(citationDoi) : ''; + const url = _RouteService.default.getProductDetailPath(product.productCode, hasRelease ? productReleaseObject.release : undefined); + const accessed = !hasRelease ? "Dataset accessed from ".concat(url, " on ").concat(today, ". Data archived at [your DOI].") : "Dataset accessed from ".concat(url, " on ").concat(today, "."); return "".concat(NEON, ". ").concat(productName).concat(doiText, ". ").concat(accessed); }, - buildPrototypeDatasetCitationText: function buildPrototypeDatasetCitationText(dataset) { + buildPrototypeDatasetCitationText: dataset => { if (!dataset) { return ''; } - var doi = dataset.doi, - projectTitle = dataset.projectTitle, - uuid = dataset.uuid, - version = dataset.version; - var hasDoi = doi && doi.url; - var today = CitationService.getDateFormatted(); - var doiId = hasDoi ? doi.url.split('/').slice(-2).join('/') : uuid; - var url = hasDoi ? "".concat(doi.url, ".") : "".concat(_RouteService.default.getPrototypeDatasetDetailPath(uuid)); - var accessed = 'Dataset accessed from ' + "".concat(_RouteService.default.getPrototypeDatasetDetailPath(uuid), " on ").concat(today, "."); - var title = version ? "".concat(projectTitle, ", ").concat(version) : projectTitle; + const { + doi, + projectTitle, + uuid, + version + } = dataset; + const hasDoi = doi && doi.url; + const today = CitationService.getDateFormatted(); + const doiId = hasDoi ? doi.url.split('/').slice(-2).join('/') : uuid; + const url = hasDoi ? "".concat(doi.url, ".") : "".concat(_RouteService.default.getPrototypeDatasetDetailPath(uuid)); + const accessed = 'Dataset accessed from ' + "".concat(_RouteService.default.getPrototypeDatasetDetailPath(uuid), " on ").concat(today, "."); + const title = version ? "".concat(projectTitle, ", ").concat(version) : projectTitle; return "".concat(NEON, ". ").concat(title, " (").concat(doiId, "). ").concat(url, " ").concat(accessed); } }; -var _default = CitationService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = CitationService; \ No newline at end of file diff --git a/lib/service/DataCiteService.js b/lib/service/DataCiteService.js index 541eb6c2..3e04bdde 100644 --- a/lib/service/DataCiteService.js +++ b/lib/service/DataCiteService.js @@ -8,7 +8,7 @@ var _NeonEnvironment = _interopRequireDefault(require("../components/NeonEnviron var _ReleaseService = require("./ReleaseService"); var _typeUtil = require("../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var CitationDownloadType = /*#__PURE__*/function (CitationDownloadType) { +let CitationDownloadType = exports.CitationDownloadType = /*#__PURE__*/function (CitationDownloadType) { CitationDownloadType["DATA_PRODUCT"] = "DATA_PRODUCT"; CitationDownloadType["PROTOTYPE_DATASET"] = "PROTOTYPE_DATASET"; return CitationDownloadType; @@ -16,81 +16,66 @@ var CitationDownloadType = /*#__PURE__*/function (CitationDownloadType) { /** * Service for working with DataCite */ -exports.CitationDownloadType = CitationDownloadType; -var DataCiteService = { - getDoiUrl: function getDoiUrl(doi, format) { - var mime = format.mime; - var doiId = (doi === null || doi === void 0 ? void 0 : doi.split('/').slice(-2).join('/')) || ''; +const DataCiteService = { + getDoiUrl: (doi, format) => { + const { + mime + } = format; + const doiId = (doi === null || doi === void 0 ? void 0 : doi.split('/').slice(-2).join('/')) || ''; return "".concat(_NeonEnvironment.default.getFullApiPath('doiCitations'), "/").concat(mime, "/").concat(doiId); }, - getCitationFormats: function getCitationFormats() { - return [{ - shortName: 'BibTex', - longName: 'BibTex', - mime: 'application/x-bibtex', - extension: 'bib', - applicableDownloadtypes: [CitationDownloadType.DATA_PRODUCT, CitationDownloadType.PROTOTYPE_DATASET], - generateProvisionalCitation: function generateProvisionalCitation(product) { - return "@misc{".concat(product.productCode, "/provisional,\n doi = {},\n url = {").concat(window.location.href, "},\n author = {{National Ecological Observatory Network (NEON)}},\n language = {en},\n title = {").concat(product.productName, " (").concat(product.productCode, ")},\n publisher = {National Ecological Observatory Network (NEON)},\n year = {").concat(new Date().getFullYear(), "}\n}"); - }, - generateProtoDatasetProvisionalCitation: function generateProtoDatasetProvisionalCitation(dataset) { - var id = "".concat(dataset.uuid, "/prototype"); - var doiId = ''; - var version = ''; - if (dataset.doi && dataset.doi.url) { - id = dataset.doi.url; - doiId = id.split('/').slice(-2).join('/'); - } - if (dataset.version) { - version = ", ".concat(dataset.version); - } - return "@misc{".concat(id, ",\n doi = {").concat(doiId, "},\n url = {").concat(window.location.href, "},\n author = {National Ecological Observatory Network (NEON)},\n language = {en},\n title = {").concat(dataset.projectTitle).concat(version, " (").concat(dataset.uuid, ")},\n publisher = {National Ecological Observatory Network (NEON)},\n year = {").concat(new Date().getFullYear(), "}\n}"); + getCitationFormats: () => [{ + shortName: 'BibTex', + longName: 'BibTex', + mime: 'application/x-bibtex', + extension: 'bib', + applicableDownloadtypes: [CitationDownloadType.DATA_PRODUCT, CitationDownloadType.PROTOTYPE_DATASET], + generateProvisionalCitation: product => "@misc{".concat(product.productCode, "/provisional,\n doi = {},\n url = {").concat(window.location.href, "},\n author = {{National Ecological Observatory Network (NEON)}},\n language = {en},\n title = {").concat(product.productName, " (").concat(product.productCode, ")},\n publisher = {National Ecological Observatory Network (NEON)},\n year = {").concat(new Date().getFullYear(), "}\n}"), + generateProtoDatasetProvisionalCitation: dataset => { + let id = "".concat(dataset.uuid, "/prototype"); + let doiId = ''; + let version = ''; + if (dataset.doi && dataset.doi.url) { + id = dataset.doi.url; + doiId = id.split('/').slice(-2).join('/'); } - }, { - shortName: 'RIS', - longName: 'Research Information Systems (RIS)', - mime: 'application/x-research-info-systems', - extension: 'ris', - applicableDownloadtypes: [CitationDownloadType.DATA_PRODUCT, CitationDownloadType.PROTOTYPE_DATASET], - generateProvisionalCitation: function generateProvisionalCitation(product) { - return "TY - DATA\nT1 - ".concat(product.productName, " (").concat(product.productCode, ")\nAU - National Ecological Observatory Network (NEON)\nDO -\nUR - ").concat(window.location.href, "\nPY - ").concat(new Date().getFullYear(), "\nPB - National Ecological Observatory Network (NEON)\nLA - en\nER - "); - }, - generateProtoDatasetProvisionalCitation: function generateProtoDatasetProvisionalCitation(dataset) { - var doiId = ''; - var version = ''; - if (dataset.doi && dataset.doi.url) { - doiId = dataset.doi.url.split('/').slice(-2).join('/'); - } - if (dataset.version) { - version = ", ".concat(dataset.version); - } - return "TY - DATA\nT1 - ".concat(dataset.projectTitle).concat(version, " (").concat(dataset.uuid, ")\nAU - National Ecological Observatory Network (NEON)\nDO - ").concat(doiId, "\nUR - ").concat(window.location.href, "\nAB - ").concat(dataset.datasetAbstract, "\nPY - ").concat(new Date().getFullYear(), "\nPB - National Ecological Observatory Network (NEON)\nLA - en\nER - "); + if (dataset.version) { + version = ", ".concat(dataset.version); } - }]; - }, - getDataProductFormats: function getDataProductFormats() { - return DataCiteService.getCitationFormats().filter(function (value) { - return value.applicableDownloadtypes.includes(CitationDownloadType.DATA_PRODUCT); - }); - }, - getPrototypeDatasetFormats: function getPrototypeDatasetFormats() { - return DataCiteService.getCitationFormats().filter(function (value) { - return value.applicableDownloadtypes.includes(CitationDownloadType.PROTOTYPE_DATASET); - }); - }, - downloadCitation: function downloadCitation(formatShortName, type, target, doi, release, onSuccessCb, onErrorCb) { - var useProvisional = release === _ReleaseService.PROVISIONAL_RELEASE; - var citationFormat = DataCiteService.getCitationFormats().find(function (value) { - return value.shortName.localeCompare(formatShortName) === 0; - }); + return "@misc{".concat(id, ",\n doi = {").concat(doiId, "},\n url = {").concat(window.location.href, "},\n author = {National Ecological Observatory Network (NEON)},\n language = {en},\n title = {").concat(dataset.projectTitle).concat(version, " (").concat(dataset.uuid, ")},\n publisher = {National Ecological Observatory Network (NEON)},\n year = {").concat(new Date().getFullYear(), "}\n}"); + } + }, { + shortName: 'RIS', + longName: 'Research Information Systems (RIS)', + mime: 'application/x-research-info-systems', + extension: 'ris', + applicableDownloadtypes: [CitationDownloadType.DATA_PRODUCT, CitationDownloadType.PROTOTYPE_DATASET], + generateProvisionalCitation: product => "TY - DATA\nT1 - ".concat(product.productName, " (").concat(product.productCode, ")\nAU - National Ecological Observatory Network (NEON)\nDO -\nUR - ").concat(window.location.href, "\nPY - ").concat(new Date().getFullYear(), "\nPB - National Ecological Observatory Network (NEON)\nLA - en\nER - "), + generateProtoDatasetProvisionalCitation: dataset => { + let doiId = ''; + let version = ''; + if (dataset.doi && dataset.doi.url) { + doiId = dataset.doi.url.split('/').slice(-2).join('/'); + } + if (dataset.version) { + version = ", ".concat(dataset.version); + } + return "TY - DATA\nT1 - ".concat(dataset.projectTitle).concat(version, " (").concat(dataset.uuid, ")\nAU - National Ecological Observatory Network (NEON)\nDO - ").concat(doiId, "\nUR - ").concat(window.location.href, "\nAB - ").concat(dataset.datasetAbstract, "\nPY - ").concat(new Date().getFullYear(), "\nPB - National Ecological Observatory Network (NEON)\nLA - en\nER - "); + } + }], + getDataProductFormats: () => DataCiteService.getCitationFormats().filter(value => value.applicableDownloadtypes.includes(CitationDownloadType.DATA_PRODUCT)), + getPrototypeDatasetFormats: () => DataCiteService.getCitationFormats().filter(value => value.applicableDownloadtypes.includes(CitationDownloadType.PROTOTYPE_DATASET)), + downloadCitation: (formatShortName, type, target, doi, release, onSuccessCb, onErrorCb) => { + const useProvisional = release === _ReleaseService.PROVISIONAL_RELEASE; + const citationFormat = DataCiteService.getCitationFormats().find(value => value.shortName.localeCompare(formatShortName) === 0); if (!citationFormat) { if (onErrorCb) { onErrorCb("Unable to download citation for doi: ".concat(doi)); } return; } - var fileName = ''; - var appliedRelease = (0, _typeUtil.isStringNonEmpty)(release) ? release : _ReleaseService.PROVISIONAL_RELEASE; + let fileName = ''; + const appliedRelease = (0, _typeUtil.isStringNonEmpty)(release) ? release : _ReleaseService.PROVISIONAL_RELEASE; switch (type) { case CitationDownloadType.PROTOTYPE_DATASET: fileName = "NEON-Prototype-Dataset-".concat(target.uuid, ".").concat(citationFormat.extension); @@ -101,7 +86,7 @@ var DataCiteService = { break; } if (useProvisional) { - var provCitation = ''; + let provCitation = ''; switch (type) { case CitationDownloadType.PROTOTYPE_DATASET: provCitation = citationFormat.generateProtoDatasetProvisionalCitation(target); @@ -120,26 +105,26 @@ var DataCiteService = { DataCiteService.executeDownload(fileName, citationFormat.mime, provCitation, onSuccessCb, onErrorCb); return; } - var citationUrl = DataCiteService.getDoiUrl(doi, citationFormat); - var init = { + const citationUrl = DataCiteService.getDoiUrl(doi, citationFormat); + const init = { method: 'GET' }; - fetch(citationUrl, init).then(function (response) { + fetch(citationUrl, init).then(response => { if (!response.ok) { - var errMsg = 'Unable to download citation for ' + "doi: ".concat(doi, " and format: ").concat(citationFormat); + const errMsg = 'Unable to download citation for ' + "doi: ".concat(doi, " and format: ").concat(citationFormat); throw new Error(errMsg); } return response.text(); - }).then(function (data) { + }).then(data => { if (!(0, _typeUtil.isStringNonEmpty)(data)) { if (onErrorCb) { - var errMsg = 'Unable to download citation for ' + "doi: ".concat(doi, " and format: ").concat(citationFormat); + const errMsg = 'Unable to download citation for ' + "doi: ".concat(doi, " and format: ").concat(citationFormat); onErrorCb(errMsg); } return; } DataCiteService.executeDownload(fileName, citationFormat.mime, data, onSuccessCb, onErrorCb); - }).catch(function (reason) { + }).catch(reason => { // eslint-disable-next-line no-console console.error("Unable to download citation ".concat(fileName), reason); if (onErrorCb) { @@ -147,9 +132,9 @@ var DataCiteService = { } }); }, - executeDownload: function executeDownload(fileName, mimeType, payload, onSuccessCb, onErrorCb) { + executeDownload: (fileName, mimeType, payload, onSuccessCb, onErrorCb) => { try { - var link = document.createElement('a'); + const link = document.createElement('a'); if (URL) { link.href = URL.createObjectURL(new Blob([payload], { type: mimeType @@ -174,5 +159,4 @@ var DataCiteService = { } }; Object.freeze(DataCiteService); -var _default = DataCiteService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = DataCiteService; \ No newline at end of file diff --git a/lib/service/DocumentService.js b/lib/service/DocumentService.js index 295c95f0..8c14dc9c 100644 --- a/lib/service/DocumentService.js +++ b/lib/service/DocumentService.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -15,289 +14,196 @@ var _GridOn = _interopRequireDefault(require("@material-ui/icons/GridOn")); var _uaParserJs = _interopRequireDefault(require("ua-parser-js")); var _NeonEnvironment = _interopRequireDefault(require("../components/NeonEnvironment/NeonEnvironment")); var _typeUtil = require("../util/typeUtil"); +var _requestUtil = require("../util/requestUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, void 0, groups); }; var _super = RegExp.prototype, _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype); } function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { var i = g[name]; if ("number" == typeof i) groups[name] = result[i];else { for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) k++; groups[name] = result[i[k]]; } return groups; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) { result.groups = buildGroups(result, this); var indices = result.indices; indices && (indices.groups = buildGroups(indices, this)); } return result; }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if ("string" == typeof substitution) { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { var group = groups[name]; return "$" + (Array.isArray(group) ? group.join("$") : group); })); } if ("function" == typeof substitution) { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = arguments; return "object" != _typeof(args[args.length - 1]) && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args); }); } return _super[Symbol.replace].call(this, str, substitution); }, _wrapRegExp.apply(this, arguments); } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var PDF_VIEWER_SUPPORTED_DOC_TYPES = ['application/pdf']; -exports.PDF_VIEWER_SUPPORTED_DOC_TYPES = PDF_VIEWER_SUPPORTED_DOC_TYPES; -var VIEWER_SUPPORTED_DOC_TYPES = ['application/pdf', 'text/html', 'text/markdown', 'text/plain']; +const PDF_VIEWER_SUPPORTED_DOC_TYPES = exports.PDF_VIEWER_SUPPORTED_DOC_TYPES = ['application/pdf']; +const VIEWER_SUPPORTED_DOC_TYPES = exports.VIEWER_SUPPORTED_DOC_TYPES = ['application/pdf', 'text/html', 'text/markdown', 'text/plain']; // See full list of device types here: // https://github.com/faisalman/ua-parser-js#methods -exports.VIEWER_SUPPORTED_DOC_TYPES = VIEWER_SUPPORTED_DOC_TYPES; -var VIEWER_NOT_SUPPORTED_DEVICE_TYPES = ['console', 'mobile', 'tablet', 'smarttv', 'wearable', 'embedded']; -var documentTypes = { +const VIEWER_NOT_SUPPORTED_DEVICE_TYPES = ['console', 'mobile', 'tablet', 'smarttv', 'wearable', 'embedded']; +const documentTypes = { pdf: { - match: function match(type) { - return type === 'application/pdf' || type.includes('pdf'); - }, - title: function title(type) { - return 'PDF'; - }, + match: type => type === 'application/pdf' || type.includes('pdf'), + title: type => 'PDF', Icon: _DescriptionOutlined.default }, markdown: { - match: function match(type) { - return type === 'text/markdown'; - }, - title: function title(type) { - return 'Markdown'; - }, + match: type => type === 'text/markdown', + title: type => 'Markdown', Icon: _DescriptionOutlined.default }, image: { - match: function match(type) { - return ['image/gif', 'image/png', 'image/jpeg'].includes(type) || type.startsWith('image'); - }, - title: function title(type) { - return (0, _typeUtil.isStringNonEmpty)(type) ? "Image (".concat((type.match(/\/(.*)$/) || [])[1] || 'unknown type', ")") : 'unknown type'; - }, + match: type => ['image/gif', 'image/png', 'image/jpeg'].includes(type) || type.startsWith('image'), + title: type => (0, _typeUtil.isStringNonEmpty)(type) ? "Image (".concat((type.match(/\/(.*)$/) || [])[1] || 'unknown type', ")") : 'unknown type', Icon: _Photo.default }, csv: { - match: function match(type) { - return type === 'text/csv' || type.includes('csv'); - }, - title: function title(type) { - return 'CSV'; - }, + match: type => type === 'text/csv' || type.includes('csv'), + title: type => 'CSV', Icon: _GridOn.default }, text: { - match: function match(type) { - return type === 'text/plain'; - }, - title: function title(type) { - return 'Plain text file'; - }, + match: type => type === 'text/plain', + title: type => 'Plain text file', Icon: _DescriptionOutlined.default }, document: { - match: function match(type) { - return ['application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'].includes(type); - }, - title: function title(type) { - return 'Document'; - }, + match: type => ['application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'].includes(type), + title: type => 'Document', Icon: _DescriptionOutlined.default }, spreadsheet: { - match: function match(type) { - return type.includes('spreadsheet') || type.includes('excel'); - }, - title: function title(type) { - return 'Spreadsheet'; - }, + match: type => type.includes('spreadsheet') || type.includes('excel'), + title: type => 'Spreadsheet', Icon: _GridOn.default }, presentation: { - match: function match(type) { - return type.includes('presentation') || type.includes('powerpoint'); - }, - title: function title(type) { - return 'Presentation'; - }, + match: type => type.includes('presentation') || type.includes('powerpoint'), + title: type => 'Presentation', Icon: _Tv.default }, archive: { - match: function match(type) { - return type.includes('zip'); - }, - title: function title(type) { - return 'ZIP archive'; - }, + match: type => type.includes('zip'), + title: type => 'ZIP archive', Icon: _Archive.default }, binary: { - match: function match(type) { - return type === 'application/octet-stream'; - }, - title: function title(type) { - return 'Raw binary data'; - }, + match: type => type === 'application/octet-stream', + title: type => 'Raw binary data', Icon: _InsertDriveFile.default }, xml: { - match: function match(type) { - return type === 'application/xml'; - }, - title: function title(type) { - return 'XML'; - }, + match: type => type === 'application/xml', + title: type => 'XML', Icon: _Code.default }, html: { - match: function match(type) { - return type === 'text/html'; - }, - title: function title(type) { - return 'HTML'; - }, + match: type => type === 'text/html', + title: type => 'HTML', Icon: _Code.default } }; -var documentTypeKeys = Object.keys(documentTypes); -var defaultDocumentType = { - match: function match(type) { - return true; - }, - title: function title(type) { - return 'File type unavailable'; - }, +const documentTypeKeys = Object.keys(documentTypes); +const defaultDocumentType = { + match: type => true, + title: type => 'File type unavailable', Icon: _InsertDriveFile.default }; -var getFilenameFromContentDisposition = function getFilenameFromContentDisposition(response) { - var filename = null; - var contentDisposition = response.headers.get('content-disposition'); +const getFilenameFromContentDisposition = response => { + let filename = null; + const contentDisposition = response.headers.get('content-disposition'); if ((0, _typeUtil.isStringNonEmpty)(contentDisposition)) { - var filenameSplit = contentDisposition === null || contentDisposition === void 0 ? void 0 : contentDisposition.split('filename='); - var splitLength = filenameSplit ? filenameSplit.length : -1; + const filenameSplit = contentDisposition === null || contentDisposition === void 0 ? void 0 : contentDisposition.split('filename='); + const splitLength = filenameSplit ? filenameSplit.length : -1; if ((0, _typeUtil.existsNonEmpty)(filenameSplit) && splitLength >= 2) { - var quotedFilename = filenameSplit[1]; + const quotedFilename = filenameSplit[1]; filename = quotedFilename.replaceAll('"', ''); } } return filename; }; -var DocumentService = { - formatBytes: function formatBytes(bytes) { +const DocumentService = { + formatBytes: bytes => { if (!Number.isInteger(bytes) || bytes < 0) { return '0.000 B'; } - var scales = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']; - var log = Math.log(bytes) / Math.log(1024); - var scale = Math.floor(log); - var precision = Math.floor(3 - (log - scale) * 3); - return "".concat((bytes / Math.pow(1024, scale)).toFixed(precision), " ").concat(scales[scale]); - }, - resolveDocumentType: function resolveDocumentType(document) { - var documentType = DocumentService.getDefaultDocumentTypeListItemDef(); + const scales = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']; + const log = Math.log(bytes) / Math.log(1024); + const scale = Math.floor(log); + const precision = Math.floor(3 - (log - scale) * 3); + return "".concat((bytes / 1024 ** scale).toFixed(precision), " ").concat(scales[scale]); + }, + resolveDocumentType: document => { + let documentType = DocumentService.getDefaultDocumentTypeListItemDef(); if (typeof document.type === 'string') { - var matchKey = DocumentService.getDocumentTypeListItemDefKeys().find(function (key) { - return DocumentService.getDocumentTypeListItemDefs()[key].match(document.type); - }); + const matchKey = DocumentService.getDocumentTypeListItemDefKeys().find(key => DocumentService.getDocumentTypeListItemDefs()[key].match(document.type)); if (matchKey) { documentType = DocumentService.getDocumentTypeListItemDefs()[matchKey]; } } return documentType; }, - getDocumentTypeTitle: function getDocumentTypeTitle(document) { - var documentType = DocumentService.resolveDocumentType(document); - var typeTitle = documentType.title; + getDocumentTypeTitle: document => { + const documentType = DocumentService.resolveDocumentType(document); + const { + title: typeTitle + } = documentType; return typeTitle(document.type); }, - findFirstByDocumentTypeTitle: function findFirstByDocumentTypeTitle(documents, typeTitle) { + findFirstByDocumentTypeTitle: (documents, typeTitle) => { if (!(0, _typeUtil.existsNonEmpty)(documents) || !(0, _typeUtil.isStringNonEmpty)(typeTitle)) { return null; } - return documents.find(function (document) { - var typeTitleString = DocumentService.getDocumentTypeTitle(document); + return documents.find(document => { + const typeTitleString = DocumentService.getDocumentTypeTitle(document); return typeTitle.localeCompare(typeTitleString) === 0; }); }, - getDocumentTypeListItemDefs: function getDocumentTypeListItemDefs() { - return documentTypes; - }, - getDocumentTypeListItemDefKeys: function getDocumentTypeListItemDefKeys() { - return documentTypeKeys; - }, - getDefaultDocumentTypeListItemDef: function getDefaultDocumentTypeListItemDef() { - return defaultDocumentType; - }, - isQuickStartGuide: function isQuickStartGuide(doc) { - return (0, _typeUtil.exists)(doc) && DocumentService.isQuickStartGuideName(doc.name); - }, - isQuickStartGuideName: function isQuickStartGuideName(name) { - return (0, _typeUtil.isStringNonEmpty)(name) && name.startsWith('NEON.QSG.'); - }, - getQuickStartGuideNameRegex: function getQuickStartGuideNameRegex() { - return ( - // eslint-disable-next-line prefer-regex-literals - new RegExp( /*#__PURE__*/_wrapRegExp(/^(NEON[.]QSG[.]DP[0-9]{1}[.][0-9]{5}[.][0-9]{3})(v([0-9]+))*([.]([a-z]+))*$/, { - name: 1, - version: 2, - versionNumber: 3, - extension: 4, - extensionName: 5 - })) - ); - }, - parseQuickStartGuideName: function parseQuickStartGuideName(name) { - var regex = DocumentService.getQuickStartGuideNameRegex(); + getDocumentTypeListItemDefs: () => documentTypes, + getDocumentTypeListItemDefKeys: () => documentTypeKeys, + getDefaultDocumentTypeListItemDef: () => defaultDocumentType, + isQuickStartGuide: doc => (0, _typeUtil.exists)(doc) && DocumentService.isQuickStartGuideName(doc.name), + isQuickStartGuideName: name => (0, _typeUtil.isStringNonEmpty)(name) && name.startsWith('NEON.QSG.'), + getQuickStartGuideNameRegex: () => + // eslint-disable-next-line prefer-regex-literals + new RegExp(/^(?NEON[.]QSG[.]DP[0-9]{1}[.][0-9]{5}[.][0-9]{3})(?v(?[0-9]+))*(?[.](?[a-z]+))*$/), + parseQuickStartGuideName: name => { + const regex = DocumentService.getQuickStartGuideNameRegex(); if (!regex) return null; - var matches = regex.exec(name); + const matches = regex.exec(name); if (!matches) return null; if (matches.length <= 0) return null; return { - name: name, + name, matchedName: matches[1], matchedVersion: matches[2], matchedExtension: matches[4], parsedVersion: (0, _typeUtil.isStringNonEmpty)(matches[3]) ? parseInt(matches[3], 10) : -1 }; }, - isViewerSupported: function isViewerSupported(doc) { - return (0, _typeUtil.exists)(doc) && (0, _typeUtil.isStringNonEmpty)(doc.type) && VIEWER_SUPPORTED_DOC_TYPES.includes(doc.type); - }, - isPdfViewerSupported: function isPdfViewerSupported(doc) { - return (0, _typeUtil.exists)(doc) && (0, _typeUtil.isStringNonEmpty)(doc.type) && PDF_VIEWER_SUPPORTED_DOC_TYPES.includes(doc.type); - }, - isViewerDeviceSupported: function isViewerDeviceSupported() { - var uaParser = new _uaParserJs.default(); - var device = uaParser.getDevice(); - var isSupported = true; + isViewerSupported: doc => (0, _typeUtil.exists)(doc) && (0, _typeUtil.isStringNonEmpty)(doc.type) && VIEWER_SUPPORTED_DOC_TYPES.includes(doc.type), + isPdfViewerSupported: doc => (0, _typeUtil.exists)(doc) && (0, _typeUtil.isStringNonEmpty)(doc.type) && PDF_VIEWER_SUPPORTED_DOC_TYPES.includes(doc.type), + isViewerDeviceSupported: () => { + const uaParser = new _uaParserJs.default(); + const device = uaParser.getDevice(); + let isSupported = true; if ((0, _typeUtil.isStringNonEmpty)(device.type) && VIEWER_NOT_SUPPORTED_DEVICE_TYPES.includes(device.type)) { isSupported = false; } return isSupported; }, - transformSpecs: function transformSpecs(specs) { + transformSpecs: specs => { if (!(0, _typeUtil.existsNonEmpty)(specs)) { return []; } - return specs.map(function (spec) { - return DocumentService.transformSpec(spec); - }); - }, - transformSpec: function transformSpec(spec) { - return { - name: spec.specNumber, - type: spec.specType, - size: spec.specSize, - description: spec.specDescription - }; - }, - transformQuickStartGuideDocuments: function transformQuickStartGuideDocuments(documents) { + return specs.map(spec => DocumentService.transformSpec(spec)); + }, + transformSpec: spec => ({ + name: spec.specNumber, + type: spec.specType, + size: spec.specSize, + description: spec.specDescription + }), + transformQuickStartGuideDocuments: documents => { if (!(0, _typeUtil.existsNonEmpty)(documents)) { return []; } - return documents.map(function (document) { - return DocumentService.transformQuickStartGuideDocument(document); - }); - }, - transformQuickStartGuideDocument: function transformQuickStartGuideDocument(document) { - return { - name: document.name, - type: document.type, - size: document.size, - description: document.description - }; - }, - applyDisplaySort: function applyDisplaySort(documents, reverse, qsgPrecedence) { + return documents.map(document => DocumentService.transformQuickStartGuideDocument(document)); + }, + transformQuickStartGuideDocument: document => ({ + name: document.name, + type: document.type, + size: document.size, + description: document.description + }), + applyDisplaySort: (documents, reverse, qsgPrecedence) => { if (!(0, _typeUtil.existsNonEmpty)(documents)) { return []; } - var appliedReverse = reverse === true; - var appliedQsgPrecedence = qsgPrecedence === true; - var sortedDocs = _toConsumableArray(documents); - sortedDocs.sort(function (a, b) { + const appliedReverse = reverse === true; + const appliedQsgPrecedence = qsgPrecedence === true; + const sortedDocs = [...documents]; + sortedDocs.sort((a, b) => { if (!(0, _typeUtil.exists)(a) && !(0, _typeUtil.exists)(b)) { return 0; } @@ -308,8 +214,8 @@ var DocumentService = { return appliedReverse ? 1 : -1; } if (appliedQsgPrecedence) { - var aQsg = DocumentService.isQuickStartGuide(a); - var bQsg = DocumentService.isQuickStartGuide(b); + const aQsg = DocumentService.isQuickStartGuide(a); + const bQsg = DocumentService.isQuickStartGuide(b); if (!aQsg || !bQsg) { if (aQsg) { return appliedReverse ? 1 : -1; @@ -328,7 +234,7 @@ var DocumentService = { if (!(0, _typeUtil.isStringNonEmpty)(b.description)) { return appliedReverse ? 1 : -1; } - var descriptionCompare = a.description.localeCompare(b.description); + const descriptionCompare = a.description.localeCompare(b.description); if (descriptionCompare === 0) { if (!(0, _typeUtil.isStringNonEmpty)(a.name) && !(0, _typeUtil.isStringNonEmpty)(b.name)) { return 0; @@ -345,26 +251,32 @@ var DocumentService = { }); return sortedDocs; }, - downloadDocument: function downloadDocument(document, onSuccessCb, onErrorCb) { - var apiPath = DocumentService.isQuickStartGuide(document) ? "".concat(_NeonEnvironment.default.getFullApiPath('quickStartGuides'), "/").concat(document.name) : "".concat(_NeonEnvironment.default.getFullApiPath('documents'), "/").concat(document.name); + downloadDocument: (document, onSuccessCb, onErrorCb) => { + const apiPath = DocumentService.isQuickStartGuide(document) ? "".concat(_NeonEnvironment.default.getFullApiPath('quickStartGuides'), "/").concat(document.name) : "".concat(_NeonEnvironment.default.getFullApiPath('documents'), "/").concat(document.name); fetch(apiPath, { method: 'HEAD' - }).then(function (response) { + }).then(response => { if (!response.ok) { throw new Error('Invalid HEAD response'); } - var filename = getFilenameFromContentDisposition(response); + let filename = getFilenameFromContentDisposition(response); if (!(0, _typeUtil.isStringNonEmpty)(filename)) { filename = document.name; } - fetch(apiPath).then(function (downloadResponse) { + const fetchHeaders = { + 'User-Agent': (0, _requestUtil.getUserAgentHeader)('Documents') + }; + fetch(apiPath, { + method: 'GET', + headers: fetchHeaders + }).then(downloadResponse => { if (!downloadResponse.ok || !downloadResponse.body) { throw new Error('Invalid download response'); } return downloadResponse.blob(); - }).then(function (blob) { + }).then(blob => { try { - var link = window.document.createElement('a'); + const link = window.document.createElement('a'); link.href = URL.createObjectURL(blob); link.setAttribute('download', filename); window.document.body.appendChild(link); @@ -380,14 +292,14 @@ var DocumentService = { onErrorCb(document); } } - }).catch(function (err) { + }).catch(err => { // eslint-disable-next-line no-console console.error(err); if (onErrorCb) { onErrorCb(document); } }); - }).catch(function (err) { + }).catch(err => { // eslint-disable-next-line no-console console.error(err); if (onErrorCb) { @@ -404,7 +316,7 @@ var DocumentService = { * @param onErrorCb * @return */ - saveDocument: function saveDocument(document, onSuccessCb, onErrorCb) { + saveDocument: (document, onSuccessCb, onErrorCb) => { if (typeof window.showSaveFilePicker !== 'function') { // eslint-disable-next-line no-console console.error('Operation not supported'); @@ -412,47 +324,45 @@ var DocumentService = { onErrorCb(document); } } - var apiPath = DocumentService.isQuickStartGuide(document) ? "".concat(_NeonEnvironment.default.getFullApiPath('quickStartGuides'), "/").concat(document.name) : "".concat(_NeonEnvironment.default.getFullApiPath('documents'), "/").concat(document.name); + const apiPath = DocumentService.isQuickStartGuide(document) ? "".concat(_NeonEnvironment.default.getFullApiPath('quickStartGuides'), "/").concat(document.name) : "".concat(_NeonEnvironment.default.getFullApiPath('documents'), "/").concat(document.name); fetch(apiPath, { method: 'HEAD' - }).then(function (response) { + }).then(response => { if (!response.ok) { throw new Error('Invalid HEAD response'); } - var filename = getFilenameFromContentDisposition(response); + let filename = getFilenameFromContentDisposition(response); if (!(0, _typeUtil.isStringNonEmpty)(filename)) { filename = document.name; } - var saveOpts = { + const saveOpts = { suggestedName: filename }; - window.showSaveFilePicker(saveOpts).then(function (fileHandle) { - return fileHandle.createWritable(); - }).then(function (writable) { - fetch(apiPath).then(function (downloadResponse) { + window.showSaveFilePicker(saveOpts).then(fileHandle => fileHandle.createWritable()).then(writable => { + fetch(apiPath).then(downloadResponse => { if (!downloadResponse.ok || !downloadResponse.body) { throw new Error('Invalid download response'); } return downloadResponse.body.pipeTo(writable); - }).then(function (value) { + }).then(value => { if (onSuccessCb) { onSuccessCb(document); } - }).catch(function (err) { + }).catch(err => { // eslint-disable-next-line no-console console.error(err); if (onErrorCb) { onErrorCb(document); } }); - }).catch(function (err) { + }).catch(err => { // eslint-disable-next-line no-console console.error(err); if (onErrorCb) { onErrorCb(document); } }); - }).catch(function (err) { + }).catch(err => { // eslint-disable-next-line no-console console.error(err); if (onErrorCb) { @@ -462,5 +372,4 @@ var DocumentService = { } }; Object.freeze(DocumentService); -var _default = DocumentService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = DocumentService; \ No newline at end of file diff --git a/lib/service/DrupalAssetService.js b/lib/service/DrupalAssetService.js index bed41ece..38993452 100644 --- a/lib/service/DrupalAssetService.js +++ b/lib/service/DrupalAssetService.js @@ -1,6 +1,5 @@ "use strict"; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", { value: true }); @@ -8,45 +7,38 @@ exports.default = void 0; var _NeonEnvironment = _interopRequireDefault(require("../components/NeonEnvironment")); var _typeUtil = require("../util/typeUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, void 0, groups); }; var _super = RegExp.prototype, _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); return _groups.set(_this, groups || _groups.get(re)), _setPrototypeOf(_this, BabelRegExp.prototype); } function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { var i = g[name]; if ("number" == typeof i) groups[name] = result[i];else { for (var k = 0; void 0 === result[i[k]] && k + 1 < i.length;) k++; groups[name] = result[i[k]]; } return groups; }, Object.create(null)); } return _inherits(BabelRegExp, RegExp), BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) { result.groups = buildGroups(result, this); var indices = result.indices; indices && (indices.groups = buildGroups(indices, this)); } return result; }, BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if ("string" == typeof substitution) { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { var group = groups[name]; return "$" + (Array.isArray(group) ? group.join("$") : group); })); } if ("function" == typeof substitution) { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = arguments; return "object" != _typeof(args[args.length - 1]) && (args = [].slice.call(args)).push(buildGroups(args, _this)), substitution.apply(this, args); }); } return _super[Symbol.replace].call(this, str, substitution); }, _wrapRegExp.apply(this, arguments); } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -var DrupalAssetService = { - cleanCss: function cleanCss(content) { - var replaceRelativeUrlsWithRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var scrubbedContent = content; +const DrupalAssetService = { + cleanCss: function (content) { + let replaceRelativeUrlsWithRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + let scrubbedContent = content; if (!(0, _typeUtil.isStringNonEmpty)(scrubbedContent)) { return scrubbedContent; } - var matches = scrubbedContent.match(/^(.*url\(["']((?!data|https)).*)$/mg); + const matches = scrubbedContent.match(/^(.*url\(["']((?!data|https)).*)$/mg); if (!(0, _typeUtil.exists)(matches)) { return scrubbedContent; } - matches.forEach(function (match) { - var shouldCommentMatch = true; + matches.forEach(match => { + let shouldCommentMatch = true; if (replaceRelativeUrlsWithRoot) { - var _groups2, _groups3; - var relativeUrlRegex = /*#__PURE__*/_wrapRegExp(/(url\(["']\.\.\/\.\.\/\.\.\/\.\.\/(images\/.+)["']\))/, { - relative: 1, - path: 2 - }); - var matchesRelative = relativeUrlRegex.exec(match); - if ((0, _typeUtil.exists)(matchesRelative) && matchesRelative.length > 0 && (0, _typeUtil.exists)(matchesRelative.groups) && (0, _typeUtil.isStringNonEmpty)((_groups2 = matchesRelative.groups) === null || _groups2 === void 0 ? void 0 : _groups2.relative) && (0, _typeUtil.isStringNonEmpty)((_groups3 = matchesRelative.groups) === null || _groups3 === void 0 ? void 0 : _groups3.path)) { - var _groups4, _groups5; - var replaceRelative = (_groups4 = matchesRelative.groups) === null || _groups4 === void 0 ? void 0 : _groups4.relative; - var replaceRelativePath = (_groups5 = matchesRelative.groups) === null || _groups5 === void 0 ? void 0 : _groups5.path; - var replaceWith = "url(\"".concat(_NeonEnvironment.default.getWebHost(), "/themes/custom/neon/").concat(replaceRelativePath, "\")"); + var _groups, _groups2; + const relativeUrlRegex = /(?url\(["']\.\.\/\.\.\/\.\.\/\.\.\/(?images\/.+)["']\))/; + const matchesRelative = relativeUrlRegex.exec(match); + if ((0, _typeUtil.exists)(matchesRelative) && matchesRelative.length > 0 && (0, _typeUtil.exists)(matchesRelative.groups) && (0, _typeUtil.isStringNonEmpty)((_groups = matchesRelative.groups) === null || _groups === void 0 ? void 0 : _groups.relative) && (0, _typeUtil.isStringNonEmpty)((_groups2 = matchesRelative.groups) === null || _groups2 === void 0 ? void 0 : _groups2.path)) { + var _groups3, _groups4; + const replaceRelative = (_groups3 = matchesRelative.groups) === null || _groups3 === void 0 ? void 0 : _groups3.relative; + const replaceRelativePath = (_groups4 = matchesRelative.groups) === null || _groups4 === void 0 ? void 0 : _groups4.path; + const replaceWith = "url(\"".concat(_NeonEnvironment.default.getWebHost(), "/themes/custom/neon/").concat(replaceRelativePath, "\")"); scrubbedContent = scrubbedContent.replace(replaceRelative, replaceWith); shouldCommentMatch = false; } } if (shouldCommentMatch) { - var replacement = match.endsWith('}') ? "/* ".concat(match.slice(0, -1), " */ }") : "/* ".concat(match, " */"); + const replacement = match.endsWith('}') ? "/* ".concat(match.slice(0, -1), " */ }") : "/* ".concat(match, " */"); scrubbedContent = scrubbedContent.replace(match, replacement); } }); return scrubbedContent; } }; -var _default = DrupalAssetService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = DrupalAssetService; \ No newline at end of file diff --git a/lib/service/NeonContextService.js b/lib/service/NeonContextService.js index 2c565f32..5013bbc1 100644 --- a/lib/service/NeonContextService.js +++ b/lib/service/NeonContextService.js @@ -4,11 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; -var NeonContextService = { - getContextUserReleases: function getContextUserReleases(neonContextState) { - var _neonContextState$aut, _neonContextState$aut2, _neonContextState$aut3; - return (neonContextState === null || neonContextState === void 0 ? void 0 : (_neonContextState$aut = neonContextState.auth) === null || _neonContextState$aut === void 0 ? void 0 : (_neonContextState$aut2 = _neonContextState$aut.userData) === null || _neonContextState$aut2 === void 0 ? void 0 : (_neonContextState$aut3 = _neonContextState$aut2.data) === null || _neonContextState$aut3 === void 0 ? void 0 : _neonContextState$aut3.releases) || []; +const NeonContextService = { + getContextUserReleases: neonContextState => { + var _neonContextState$aut; + return (neonContextState === null || neonContextState === void 0 || (_neonContextState$aut = neonContextState.auth) === null || _neonContextState$aut === void 0 || (_neonContextState$aut = _neonContextState$aut.userData) === null || _neonContextState$aut === void 0 || (_neonContextState$aut = _neonContextState$aut.data) === null || _neonContextState$aut === void 0 ? void 0 : _neonContextState$aut.releases) || []; } }; -var _default = NeonContextService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = NeonContextService; \ No newline at end of file diff --git a/lib/service/ReleaseService.js b/lib/service/ReleaseService.js index 4a417eea..536fcbdb 100644 --- a/lib/service/ReleaseService.js +++ b/lib/service/ReleaseService.js @@ -9,48 +9,38 @@ var _typeUtil = require("../util/typeUtil"); var _internal = require("../types/internal"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -var LATEST_AND_PROVISIONAL = 'LATEST_AND_PROVISIONAL'; -exports.LATEST_AND_PROVISIONAL = LATEST_AND_PROVISIONAL; -var PROVISIONAL_RELEASE = 'provisional'; -exports.PROVISIONAL_RELEASE = PROVISIONAL_RELEASE; -var ReleaseService = { +const LATEST_AND_PROVISIONAL = exports.LATEST_AND_PROVISIONAL = 'LATEST_AND_PROVISIONAL'; +const PROVISIONAL_RELEASE = exports.PROVISIONAL_RELEASE = 'provisional'; +const ReleaseService = { // eslint-disable-next-line prefer-regex-literals - getProvReleaseRegex: function getProvReleaseRegex() { - return new RegExp(/^[A-Z]+$/); - }, - isLatestNonProv: function isLatestNonProv(releaseTag) { - var matches = ReleaseService.getProvReleaseRegex().exec(releaseTag); + getProvReleaseRegex: () => new RegExp(/^[A-Z]+$/), + isLatestNonProv: releaseTag => { + const matches = ReleaseService.getProvReleaseRegex().exec(releaseTag); return (0, _typeUtil.exists)(matches) && matches.length > 0; }, - isNonRelease: function isNonRelease(releaseTag) { + isNonRelease: releaseTag => { // eslint-disable-next-line prefer-regex-literals - var regexLatestProv = new RegExp("^".concat(LATEST_AND_PROVISIONAL, "$"), 'i'); + const regexLatestProv = new RegExp("^".concat(LATEST_AND_PROVISIONAL, "$"), 'i'); // eslint-disable-next-line prefer-regex-literals - var regexProv = new RegExp("^".concat(PROVISIONAL_RELEASE, "$"), 'i'); - var matchesLatestProv = regexLatestProv.exec(releaseTag); - var matchesProv = regexProv.exec(releaseTag); - var isLatestProv = (0, _typeUtil.exists)(matchesLatestProv) && matchesLatestProv.length > 0; - var isProv = (0, _typeUtil.exists)(matchesProv) && matchesProv.length > 0; + const regexProv = new RegExp("^".concat(PROVISIONAL_RELEASE, "$"), 'i'); + const matchesLatestProv = regexLatestProv.exec(releaseTag); + const matchesProv = regexProv.exec(releaseTag); + const isLatestProv = (0, _typeUtil.exists)(matchesLatestProv) && matchesLatestProv.length > 0; + const isProv = (0, _typeUtil.exists)(matchesProv) && matchesProv.length > 0; return isLatestProv || isProv; }, - isProv: function isProv(releaseTag) { + isProv: releaseTag => { if (!(0, _typeUtil.isStringNonEmpty)(releaseTag)) { return true; } // eslint-disable-next-line prefer-regex-literals - var regexProv = new RegExp("^".concat(PROVISIONAL_RELEASE, "$"), 'i'); - var matchesProv = regexProv.exec(releaseTag); + const regexProv = new RegExp("^".concat(PROVISIONAL_RELEASE, "$"), 'i'); + const matchesProv = regexProv.exec(releaseTag); return (0, _typeUtil.exists)(matchesProv) && matchesProv.length > 0; }, - isInternalReleaseLike: function isInternalReleaseLike(release) { - var isLike = true; - for (var p in _internal.ReleaseProps) { + isInternalReleaseLike: release => { + let isLike = true; + for (const p in _internal.ReleaseProps) { if (Object.prototype.hasOwnProperty.call(_internal.ReleaseProps, p)) { if (!(p in release)) { isLike = false; @@ -60,35 +50,31 @@ var ReleaseService = { } return isLike; }, - sortReleases: function sortReleases(unsortedReleases) { - var releases = _toConsumableArray(unsortedReleases); + sortReleases: unsortedReleases => { + const releases = [...unsortedReleases]; if ((0, _typeUtil.existsNonEmpty)(releases) && releases.length > 1) { - releases.sort(function (a, b) { - return a.generationDate < b.generationDate ? 1 : -1; - }); + releases.sort((a, b) => a.generationDate < b.generationDate ? 1 : -1); } return releases; }, - getMostRecentReleaseTag: function getMostRecentReleaseTag(releases) { + getMostRecentReleaseTag: releases => { if (!(0, _typeUtil.existsNonEmpty)(releases)) { return null; } - var sorted = ReleaseService.sortReleases(releases).filter(function (releaseLike) { - return !ReleaseService.isLatestNonProv(releaseLike.release) && !(LATEST_AND_PROVISIONAL.localeCompare(releaseLike.release) === 0) && !(PROVISIONAL_RELEASE.localeCompare(releaseLike.release) === 0); - }); + const sorted = ReleaseService.sortReleases(releases).filter(releaseLike => !ReleaseService.isLatestNonProv(releaseLike.release) && !(LATEST_AND_PROVISIONAL.localeCompare(releaseLike.release) === 0) && !(PROVISIONAL_RELEASE.localeCompare(releaseLike.release) === 0)); if (!(0, _typeUtil.existsNonEmpty)(sorted)) { return null; } return sorted[0].release; }, - applyUserReleases: function applyUserReleases(neonContextState, currentReleases) { - var userReleases = _NeonContextService.default.getContextUserReleases(neonContextState); + applyUserReleases: (neonContextState, currentReleases) => { + const userReleases = _NeonContextService.default.getContextUserReleases(neonContextState); if (!Array.isArray(currentReleases) || !Array.isArray(userReleases)) { return []; } - var combinedReleases = []; - currentReleases.forEach(function (release) { - var r; + const combinedReleases = []; + currentReleases.forEach(release => { + let r; // Ensure we don't override any current releases that have been // initialized as internal release representations. if (ReleaseService.isInternalReleaseLike(release)) { @@ -108,12 +94,10 @@ var ReleaseService = { } combinedReleases.push(r); }); - userReleases.forEach(function (userRelease) { - var hasRelease = currentReleases.some(function (value) { - return (0, _typeUtil.exists)(value) && (0, _typeUtil.isStringNonEmpty)(value.release) && (0, _typeUtil.isStringNonEmpty)(userRelease.releaseTag) && value.release.localeCompare(userRelease.releaseTag) === 0; - }); + userReleases.forEach(userRelease => { + const hasRelease = currentReleases.some(value => (0, _typeUtil.exists)(value) && (0, _typeUtil.isStringNonEmpty)(value.release) && (0, _typeUtil.isStringNonEmpty)(userRelease.releaseTag) && value.release.localeCompare(userRelease.releaseTag) === 0); if (!hasRelease) { - var r = _extends({}, userRelease, { + const r = _extends({}, userRelease, { release: userRelease.releaseTag, description: userRelease.description, generationDate: (0, _typeUtil.exists)(userRelease.generationDate) ? new Date(userRelease.generationDate).toISOString() : new Date().toISOString(), @@ -126,12 +110,12 @@ var ReleaseService = { }); return combinedReleases; }, - transformDoiStatusRelease: function transformDoiStatusRelease(doiStatus) { + transformDoiStatusRelease: doiStatus => { if (!(0, _typeUtil.exists)(doiStatus)) { return null; } - var appliedDoiStatus = doiStatus; - var transformed = { + const appliedDoiStatus = doiStatus; + const transformed = { url: '', productDoi: { url: appliedDoiStatus.url, @@ -146,9 +130,6 @@ var ReleaseService = { }; return transformed; }, - determineDelineateAvaRelease: function determineDelineateAvaRelease(releaseTag) { - return !(0, _typeUtil.isStringNonEmpty)(releaseTag) || releaseTag === LATEST_AND_PROVISIONAL || ReleaseService.isLatestNonProv(releaseTag); - } + determineDelineateAvaRelease: releaseTag => !(0, _typeUtil.isStringNonEmpty)(releaseTag) || releaseTag === LATEST_AND_PROVISIONAL || ReleaseService.isLatestNonProv(releaseTag) }; -var _default = ReleaseService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = ReleaseService; \ No newline at end of file diff --git a/lib/service/RouteService.js b/lib/service/RouteService.js index c355bf01..373809a5 100644 --- a/lib/service/RouteService.js +++ b/lib/service/RouteService.js @@ -11,114 +11,48 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * Service for building routes and paths */ -var RouteService = { - getWebHomePath: function getWebHomePath() { - return _NeonEnvironment.default.getWebHost(); - }, - getUserAccountsPath: function getUserAccountsPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/about/user-accounts"); - }, - getDataPoliciesPath: function getDataPoliciesPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/data/about-data/data-policies"); - }, - getDataPoliciesCitationPath: function getDataPoliciesCitationPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-policies-citation"); - }, - getDataQualityPath: function getDataQualityPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-management/data-quality-program"); - }, - getNewsPath: function getNewsPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/impact/newsroom/neon-news"); - }, - getDataNotificationsPath: function getDataNotificationsPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-notifications"); - }, - getFaqPath: function getFaqPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/about/faq"); - }, - getContactUsPath: function getContactUsPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/about/contact-us"); - }, - getDownloadExplorePath: function getDownloadExplorePath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/resources/learning-hub/tutorials/download-explore-neon-data"); - }, - getFileNamingConventionsPath: function getFileNamingConventionsPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-management/data-formats-conventions"); - }, - getDataRevisionsReleasePath: function getDataRevisionsReleasePath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-management/data-revisions-releases"); - }, - getDataSamplesPath: function getDataSamplesPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples"); - }, - getSamplesPath: function getSamplesPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/samples"); - }, - getDataSamplesDataPath: function getDataSamplesDataPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data"); - }, - getDataAvailabilityPath: function getDataAvailabilityPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-management/data-availability"); - }, - getDataProductBundlesPath: function getDataProductBundlesPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-management/data-product-bundles"); - }, - getNeonUtilitiesDataStackRPath: function getNeonUtilitiesDataStackRPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/resources/learning-hub/tutorials/neondatastackr"); - }, - getObservatoryStatusPath: function getObservatoryStatusPath() { - return "".concat(_NeonEnvironment.default.getWebHost(), "/impact/observatory-blog/observatory-status"); - }, - getThemeDetailPath: function getThemeDetailPath(theme) { - return "".concat(_NeonEnvironment.default.getWebHost(), "/data/data-themes/").concat(theme); - }, - getFieldSiteDetailPath: function getFieldSiteDetailPath(siteCode) { - return "".concat(_NeonEnvironment.default.getWebHost(), "/field-sites/").concat(siteCode); - }, - getDomainDetailPath: function getDomainDetailPath(domainCode) { - return "".concat(_NeonEnvironment.default.getWebHost(), "/domains/").concat(domainCode); - }, - getReleaseDetailPath: function getReleaseDetailPath(release) { - return "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-management/data-revisions-releases/").concat(release); - }, - getDataApiPath: function getDataApiPath() { - return "".concat(_NeonEnvironment.default.getApiHost(), "/data-api"); - }, - getTaxonomicListsPath: function getTaxonomicListsPath() { - return (// TODO: replace with web host once switch over happens - "".concat(_NeonEnvironment.default.getApiHost(), "/taxonomic-lists") - ); - }, - getDataProductCitationDownloadUrl: function getDataProductCitationDownloadUrl() { - return ( - // TODO: replace with web host once switch over happens - _NeonEnvironment.default.getApiHost() - ); - }, - getDataProductExploreSearchPath: function getDataProductExploreSearchPath(query) { - return "".concat(RouteService.getDataProductExplorePath(), "?search=").concat(encodeURIComponent(query)); - }, - getDataProductExplorePath: function getDataProductExplorePath() { - return (// TODO: replace with web host once switch over happens - "".concat(_NeonEnvironment.default.getApiHost(), "/data-products/explore") - ); - }, - getProductDetailPath: function getProductDetailPath(productCode, release) { - var releasePath = (0, _typeUtil.isStringNonEmpty)(release) ? "/".concat(release) : ''; +const RouteService = { + getWebHomePath: () => _NeonEnvironment.default.getWebHost(), + getUserAccountsPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/about/user-accounts"), + getDataPoliciesPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/data/about-data/data-policies"), + getDataPoliciesCitationPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-policies-citation"), + getDataQualityPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-management/data-quality-program"), + getNewsPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/impact/newsroom/neon-news"), + getDataNotificationsPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-notifications"), + getFaqPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/about/faq"), + getContactUsPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/about/contact-us"), + getDownloadExplorePath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/resources/learning-hub/tutorials/download-explore-neon-data"), + getFileNamingConventionsPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-management/data-formats-conventions"), + getDataRevisionsReleasePath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-management/data-revisions-releases"), + getDataSamplesPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples"), + getSamplesPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/samples"), + getDataSamplesDataPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data"), + getDataAvailabilityPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-management/data-availability"), + getDataProductBundlesPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-management/data-product-bundles"), + getNeonUtilitiesDataStackRPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/resources/learning-hub/tutorials/neondatastackr"), + getObservatoryStatusPath: () => "".concat(_NeonEnvironment.default.getWebHost(), "/impact/observatory-blog/observatory-status"), + getThemeDetailPath: theme => "".concat(_NeonEnvironment.default.getWebHost(), "/data/data-themes/").concat(theme), + getFieldSiteDetailPath: siteCode => "".concat(_NeonEnvironment.default.getWebHost(), "/field-sites/").concat(siteCode), + getDomainDetailPath: domainCode => "".concat(_NeonEnvironment.default.getWebHost(), "/domains/").concat(domainCode), + getReleaseDetailPath: release => "".concat(_NeonEnvironment.default.getWebHost(), "/data-samples/data-management/data-revisions-releases/").concat(release), + getDataApiPath: () => "".concat(_NeonEnvironment.default.getApiHost(), "/data-api"), + getTaxonomicListsPath: () => // TODO: replace with web host once switch over happens + "".concat(_NeonEnvironment.default.getApiHost(), "/taxonomic-lists"), + getDataProductCitationDownloadUrl: () => + // TODO: replace with web host once switch over happens + _NeonEnvironment.default.getApiHost(), + getDataProductExploreSearchPath: query => "".concat(RouteService.getDataProductExplorePath(), "?search=").concat(encodeURIComponent(query)), + getDataProductExplorePath: () => // TODO: replace with web host once switch over happens + "".concat(_NeonEnvironment.default.getApiHost(), "/data-products/explore"), + getProductDetailPath: (productCode, release) => { + const releasePath = (0, _typeUtil.isStringNonEmpty)(release) ? "/".concat(release) : ''; // TODO: replace with web host once switch over happens return "".concat(_NeonEnvironment.default.getApiHost(), "/data-products/").concat(productCode).concat(releasePath); }, - getPrototypeDatasetsPath: function getPrototypeDatasetsPath() { - return (// TODO: replace with web host once switch over happens - "".concat(_NeonEnvironment.default.getApiHost(), "/prototype-datasets") - ); - }, - getPrototypeDatasetDetailPath: function getPrototypeDatasetDetailPath(uuid) { - return (// TODO: replace with web host once switch over happens - "".concat(_NeonEnvironment.default.getApiHost(), "/prototype-datasets/").concat(uuid) - ); - } + getPrototypeDatasetsPath: () => // TODO: replace with web host once switch over happens + "".concat(_NeonEnvironment.default.getApiHost(), "/prototype-datasets"), + getPrototypeDatasetDetailPath: uuid => // TODO: replace with web host once switch over happens + "".concat(_NeonEnvironment.default.getApiHost(), "/prototype-datasets/").concat(uuid) }; Object.freeze(RouteService); -var _default = RouteService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = RouteService; \ No newline at end of file diff --git a/lib/service/StateStorageService.js b/lib/service/StateStorageService.js index 9e827c3b..570ce3ee 100644 --- a/lib/service/StateStorageService.js +++ b/lib/service/StateStorageService.js @@ -15,18 +15,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de * @param key The key to identify the entry in storage. * @returns A StateStorage object with functions to store and retrieve application state. */ -var makeStateStorage = function makeStateStorage(key) { - return { - saveState: function saveState(state) { - return _StorageService.default.setObject(key, state); - }, - readState: function readState() { - return _StorageService.default.getObject(key); - }, - removeState: function removeState() { - return _StorageService.default.remove(key); - } - }; -}; -var _default = makeStateStorage; -exports.default = _default; \ No newline at end of file +const makeStateStorage = key => ({ + saveState: state => _StorageService.default.setObject(key, state), + readState: () => _StorageService.default.getObject(key), + removeState: () => _StorageService.default.remove(key) +}); +var _default = exports.default = makeStateStorage; \ No newline at end of file diff --git a/lib/service/StorageService.js b/lib/service/StorageService.js index e925984b..c8ddc171 100644 --- a/lib/service/StorageService.js +++ b/lib/service/StorageService.js @@ -8,20 +8,16 @@ exports.default = void 0; * Interface to define a service for data storage. */ -var StorageService = { - setItem: function setItem(key, value) { - return sessionStorage.setItem(key, value); - }, - getItem: function getItem(key) { - return sessionStorage.getItem(key); - }, - setObject: function setObject(key, object) { +const StorageService = { + setItem: (key, value) => sessionStorage.setItem(key, value), + getItem: key => sessionStorage.getItem(key), + setObject: (key, object) => { if (object) { sessionStorage.setItem(key, JSON.stringify(object)); } }, - getObject: function getObject(key) { - var value = sessionStorage.getItem(key); + getObject: key => { + const value = sessionStorage.getItem(key); if (!value) { return null; } @@ -31,19 +27,10 @@ var StorageService = { return null; } }, - getKey: function getKey(index) { - return sessionStorage.key(index); - }, - remove: function remove(key) { - return sessionStorage.removeItem(key); - }, - clear: function clear() { - return sessionStorage.clear(); - }, - getLength: function getLength() { - return sessionStorage.length; - } + getKey: index => sessionStorage.key(index), + remove: key => sessionStorage.removeItem(key), + clear: () => sessionStorage.clear(), + getLength: () => sessionStorage.length }; Object.freeze(StorageService); -var _default = StorageService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = StorageService; \ No newline at end of file diff --git a/lib/sharedState/SharedState.js b/lib/sharedState/SharedState.js index a6088f04..bcc7be42 100644 --- a/lib/sharedState/SharedState.js +++ b/lib/sharedState/SharedState.js @@ -6,12 +6,6 @@ Object.defineProperty(exports, "__esModule", { exports.default = void 0; var _react = require("react"); var _rxjs = require("rxjs"); -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /** * A function to use a distributed shared state for sharing state between components outside * of the component heirarchy. The subject would be defined in an @@ -20,24 +14,14 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } * @param subject A subject. * @returns The value and function to set the state. */ -var useSharedState = function useSharedState(subject) { - var _useState = (0, _react.useState)(subject.getValue()), - _useState2 = _slicedToArray(_useState, 2), - value = _useState2[0], - setState = _useState2[1]; - (0, _react.useEffect)(function () { - var subscription = subject.pipe((0, _rxjs.skip)(1)).subscribe(function (s) { - return setState(s); - }); - return function () { - return subscription.unsubscribe(); - }; +const useSharedState = subject => { + const [value, setState] = (0, _react.useState)(subject.getValue()); + (0, _react.useEffect)(() => { + const subscription = subject.pipe((0, _rxjs.skip)(1)).subscribe(s => setState(s)); + return () => subscription.unsubscribe(); }, [subject]); - var setDistributedState = function setDistributedState(state) { - return subject.next(state); - }; + const setDistributedState = state => subject.next(state); // @ts-ignore return [value, setDistributedState]; }; -var _default = useSharedState; -exports.default = _default; \ No newline at end of file +var _default = exports.default = useSharedState; \ No newline at end of file diff --git a/lib/types/asyncFlow.js b/lib/types/asyncFlow.js index 699ed964..76f00293 100644 --- a/lib/types/asyncFlow.js +++ b/lib/types/asyncFlow.js @@ -10,7 +10,7 @@ exports.AsyncStateType = void 0; /** * Async action type */ -var AsyncStateType = /*#__PURE__*/function (AsyncStateType) { +let AsyncStateType = exports.AsyncStateType = /*#__PURE__*/function (AsyncStateType) { AsyncStateType[AsyncStateType["IDLE"] = 0] = "IDLE"; AsyncStateType[AsyncStateType["WORKING"] = 1] = "WORKING"; AsyncStateType[AsyncStateType["FULLFILLED"] = 2] = "FULLFILLED"; @@ -55,5 +55,4 @@ var AsyncStateType = /*#__PURE__*/function (AsyncStateType) { */ /** * Async flow handler declaration - */ -exports.AsyncStateType = AsyncStateType; \ No newline at end of file + */ \ No newline at end of file diff --git a/lib/types/core.js b/lib/types/core.js index 15d60c03..3d0e5896 100644 --- a/lib/types/core.js +++ b/lib/types/core.js @@ -10,11 +10,10 @@ exports.AuthSilentType = void 0; /** * Type to encapsulate silent authentication allowance */ -var AuthSilentType = /*#__PURE__*/function (AuthSilentType) { +let AuthSilentType = exports.AuthSilentType = /*#__PURE__*/function (AuthSilentType) { AuthSilentType["DISABLED"] = "DISABLED"; AuthSilentType["PREVENT_ALL"] = "PREVENT_ALL"; AuthSilentType["PREVENT_BROWSER"] = "PREVENT_BROWSER"; AuthSilentType["ALLOW_ALL"] = "ALLOW_ALL"; return AuthSilentType; -}({}); -exports.AuthSilentType = AuthSilentType; \ No newline at end of file +}({}); \ No newline at end of file diff --git a/lib/types/internal.js b/lib/types/internal.js index 71ea1ec2..0e340bc2 100644 --- a/lib/types/internal.js +++ b/lib/types/internal.js @@ -4,11 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.ReleaseProps = void 0; -var ReleaseProps = /*#__PURE__*/function (ReleaseProps) { +let ReleaseProps = exports.ReleaseProps = /*#__PURE__*/function (ReleaseProps) { ReleaseProps["description"] = "description"; ReleaseProps["showCitation"] = "showCitation"; ReleaseProps["showDoi"] = "showDoi"; ReleaseProps["showViz"] = "showViz"; return ReleaseProps; -}({}); -exports.ReleaseProps = ReleaseProps; \ No newline at end of file +}({}); \ No newline at end of file diff --git a/lib/types/manifest.js b/lib/types/manifest.js index 735df64b..9230ed2b 100644 --- a/lib/types/manifest.js +++ b/lib/types/manifest.js @@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.ChecksumAlgorithmType = void 0; -var ChecksumAlgorithmType = /*#__PURE__*/function (ChecksumAlgorithmType) { +let ChecksumAlgorithmType = exports.ChecksumAlgorithmType = /*#__PURE__*/function (ChecksumAlgorithmType) { ChecksumAlgorithmType["MD5"] = "MD5"; ChecksumAlgorithmType["CRC32"] = "CRC32"; ChecksumAlgorithmType["CRC32C"] = "CRC32C"; return ChecksumAlgorithmType; -}({}); -exports.ChecksumAlgorithmType = ChecksumAlgorithmType; \ No newline at end of file +}({}); \ No newline at end of file diff --git a/lib/types/neonApi.js b/lib/types/neonApi.js index 5aa7d172..985f2cdf 100644 --- a/lib/types/neonApi.js +++ b/lib/types/neonApi.js @@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.DoiStatusType = void 0; -var DoiStatusType = /*#__PURE__*/function (DoiStatusType) { +let DoiStatusType = exports.DoiStatusType = /*#__PURE__*/function (DoiStatusType) { DoiStatusType["FINDABLE"] = "FINDABLE"; DoiStatusType["TOMBSTONED"] = "TOMBSTONED"; return DoiStatusType; -}({}); -exports.DoiStatusType = DoiStatusType; \ No newline at end of file +}({}); \ No newline at end of file diff --git a/lib/types/neonDataPackage.js b/lib/types/neonDataPackage.js index 8564c468..61156223 100644 --- a/lib/types/neonDataPackage.js +++ b/lib/types/neonDataPackage.js @@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", { exports.sensorPositionV2Schema = exports.sensorPositionV1Schema = void 0; var _zod = require("zod"); var _typeUtil = require("../util/typeUtil"); -var transformStringToFloat = function transformStringToFloat(val, ctx) { +const transformStringToFloat = (val, ctx) => { if (!(0, _typeUtil.isStringNonEmpty)(val)) return null; return parseFloat(val); }; -var sensorPositionV1Schema = _zod.z.object({ +const sensorPositionV1Schema = exports.sensorPositionV1Schema = _zod.z.object({ 'HOR.VER': _zod.z.string(), name: _zod.z.string().optional().nullable(), description: _zod.z.string().optional().nullable(), @@ -34,8 +34,7 @@ var sensorPositionV1Schema = _zod.z.object({ xAzimuth: _zod.z.string().optional().nullable().transform(transformStringToFloat).nullable(), yAzimuth: _zod.z.string().optional().nullable().transform(transformStringToFloat).nullable() }); -exports.sensorPositionV1Schema = sensorPositionV1Schema; -var sensorPositionV2Schema = _zod.z.object({ +const sensorPositionV2Schema = exports.sensorPositionV2Schema = _zod.z.object({ 'HOR.VER': _zod.z.string(), sensorLocationID: _zod.z.string(), sensorLocationDescription: _zod.z.string().nullable(), @@ -58,5 +57,4 @@ var sensorPositionV2Schema = _zod.z.object({ northOffset: _zod.z.string().optional().nullable().transform(transformStringToFloat).nullable(), xAzimuth: _zod.z.string().optional().nullable().transform(transformStringToFloat).nullable(), yAzimuth: _zod.z.string().optional().nullable().transform(transformStringToFloat).nullable() -}); -exports.sensorPositionV2Schema = sensorPositionV2Schema; \ No newline at end of file +}); \ No newline at end of file diff --git a/lib/util/browserUtil.js b/lib/util/browserUtil.js index 6071b140..ee9518ac 100644 --- a/lib/util/browserUtil.js +++ b/lib/util/browserUtil.js @@ -7,19 +7,16 @@ exports.isSafari = exports.default = void 0; /* eslint-disable dot-notation, wrap-iife, arrow-body-style, func-names */ // @ts-nocheck -var isSafariStore = /constructor/i.test(window.HTMLElement) || function (p) { +const isSafariStore = /constructor/i.test(window.HTMLElement) || function (p) { return p.toString() === '[object SafariRemoteNotification]'; }(!window['safari'] || typeof window.safari !== 'undefined' && window.safari.pushNotification); /** * Duck typing method for determing if the browser is safari */ -var isSafari = function isSafari() { - return isSafariStore; -}; +const isSafari = () => isSafariStore; exports.isSafari = isSafari; -var BrowserService = { +const BrowserService = { getIsSafari: isSafari }; -var _default = BrowserService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = BrowserService; \ No newline at end of file diff --git a/lib/util/historyUtil.js b/lib/util/historyUtil.js index 21056ba9..85b180f1 100644 --- a/lib/util/historyUtil.js +++ b/lib/util/historyUtil.js @@ -8,15 +8,15 @@ var _history = require("history"); var _NeonEnvironment = _interopRequireDefault(require("../components/NeonEnvironment")); var _polyfillUtil = require("./polyfillUtil"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var history = (0, _history.createBrowserHistory)({ +const history = (0, _history.createBrowserHistory)({ basename: _NeonEnvironment.default.getRouterBasePath() }); /** * Cleans the current browser path */ -var cleanPath = function cleanPath() { - var path = history.location.pathname; +const cleanPath = () => { + let path = history.location.pathname; if ((0, _polyfillUtil.endsWithPolyfill)(path, '/')) { while ((0, _polyfillUtil.endsWithPolyfill)(path, '/')) { path = path.slice(0, path.length - 1); @@ -24,9 +24,8 @@ var cleanPath = function cleanPath() { history.replace(path); } }; -var HistoryService = { - history: history, - cleanPath: cleanPath +const HistoryService = { + history, + cleanPath }; -var _default = HistoryService; -exports.default = _default; \ No newline at end of file +var _default = exports.default = HistoryService; \ No newline at end of file diff --git a/lib/util/index.js b/lib/util/index.js index 20bf7c68..c03f3a2e 100644 --- a/lib/util/index.js +++ b/lib/util/index.js @@ -9,7 +9,7 @@ Object.keys(_manifestUtil).forEach(function (key) { if (key in exports && exports[key] === _manifestUtil[key]) return; Object.defineProperty(exports, key, { enumerable: true, - get: function get() { + get: function () { return _manifestUtil[key]; } }); @@ -20,7 +20,7 @@ Object.keys(_polyfillUtil).forEach(function (key) { if (key in exports && exports[key] === _polyfillUtil[key]) return; Object.defineProperty(exports, key, { enumerable: true, - get: function get() { + get: function () { return _polyfillUtil[key]; } }); @@ -31,7 +31,7 @@ Object.keys(_rxUtil).forEach(function (key) { if (key in exports && exports[key] === _rxUtil[key]) return; Object.defineProperty(exports, key, { enumerable: true, - get: function get() { + get: function () { return _rxUtil[key]; } }); @@ -42,7 +42,7 @@ Object.keys(_browserUtil).forEach(function (key) { if (key in exports && exports[key] === _browserUtil[key]) return; Object.defineProperty(exports, key, { enumerable: true, - get: function get() { + get: function () { return _browserUtil[key]; } }); diff --git a/lib/util/liferayNotificationsUtil.js b/lib/util/liferayNotificationsUtil.js index e2fd815b..57c98413 100644 --- a/lib/util/liferayNotificationsUtil.js +++ b/lib/util/liferayNotificationsUtil.js @@ -10,29 +10,25 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de // things, because this whole component is temporary. When Liferay is dead and // React pages can pull notifications from its replacement (Drupal), then this // should be appropriately refactored and hardened. -var getLiferayNotificationsApiPath = function getLiferayNotificationsApiPath() { - return _NeonEnvironment.default.getFullAuthPath('notifications'); -}; +const getLiferayNotificationsApiPath = () => _NeonEnvironment.default.getFullAuthPath('notifications'); // Non-secure string hashing function found here: https://stackoverflow.com/a/8831937 // Use for unique id for notifications for keying nodes and tracking dismissal cookies /* eslint-disable no-bitwise */ exports.getLiferayNotificationsApiPath = getLiferayNotificationsApiPath; -var generateNotificationId = function generateNotificationId(message) { - var hash = 0; +const generateNotificationId = message => { + let hash = 0; if (!message.length) { return hash; } - var char; - for (var i = 0; i < message.length; i += 1) { + let char; + for (let i = 0; i < message.length; i += 1) { char = message.charCodeAt(i); hash = (hash << 5) - hash + char; hash &= hash; // Convert to 32bit integer } - return "notification-".concat(hash); }; /* eslint-enable no-bitwise */ exports.generateNotificationId = generateNotificationId; -var _default = getLiferayNotificationsApiPath; -exports.default = _default; \ No newline at end of file +var _default = exports.default = getLiferayNotificationsApiPath; \ No newline at end of file diff --git a/lib/util/manifestUtil.js b/lib/util/manifestUtil.js index b9c747c4..b94756cc 100644 --- a/lib/util/manifestUtil.js +++ b/lib/util/manifestUtil.js @@ -6,12 +6,11 @@ Object.defineProperty(exports, "__esModule", { exports.getSizeEstimateFromManifestRollupResponse = exports.getSizeEstimateFromManifestResponse = exports.formatBytes = exports.downloadManifest = exports.downloadAopManifest = exports.default = exports.buildSiteCodesParams = exports.buildS3FilesRequestUrl = exports.buildManifestRequestUrl = exports.buildManifestRequestBody = exports.buildManifestConfig = exports.MAX_POST_BODY_SIZE = exports.DOWNLOAD_SIZE_WARN = void 0; var _NeonEnvironment = _interopRequireDefault(require("../components/NeonEnvironment/NeonEnvironment")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } // Build an object from state suitable for manifestUtil.buildManifestRequestUrl() -var buildManifestConfig = function buildManifestConfig(selection) { - var defaultPackageType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'basic'; - var isAop = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - var config = { +const buildManifestConfig = function (selection) { + let defaultPackageType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'basic'; + let isAop = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + const config = { productCode: '', release: '', sites: [], @@ -21,7 +20,7 @@ var buildManifestConfig = function buildManifestConfig(selection) { provisionalData: false, isError: true }; - var manifestConfigError = null; + let manifestConfigError = null; if (!isAop) { if (!selection.productData || !selection.productData.productCode) { manifestConfigError = 'Invalid data product'; @@ -48,48 +47,50 @@ var buildManifestConfig = function buildManifestConfig(selection) { // eslint-disable-next-line no-array-constructor exports.buildManifestConfig = buildManifestConfig; -var buildSiteCodesParams = function buildSiteCodesParams() { - var sites = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Array(); - var camelCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - var param = camelCase ? 'siteCode' : 'sitecode'; - return sites.reduce(function (sitesString, siteCode, index) { - return "".concat(sitesString).concat(index === 0 ? '' : '&').concat(param, "=").concat(siteCode); - }, ''); +const buildSiteCodesParams = function () { + let sites = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Array(); + let camelCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const param = camelCase ? 'siteCode' : 'sitecode'; + return sites.reduce((sitesString, siteCode, index) => "".concat(sitesString).concat(index === 0 ? '' : '&').concat(param, "=").concat(siteCode), ''); }; exports.buildSiteCodesParams = buildSiteCodesParams; -var buildManifestRequestUrl = function buildManifestRequestUrl(config) { - var useBody = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - var productCode = config.productCode, - sites = config.sites, - dateRange = config.dateRange, - packageType = config.packageType, - documentation = config.documentation, - provisionalData = config.provisionalData; - var url = _NeonEnvironment.default.getFullDownloadApiPath('manifestRollup'); +const buildManifestRequestUrl = function (config) { + let useBody = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + const { + productCode, + sites, + dateRange, + packageType, + documentation, + provisionalData + } = config; + let url = _NeonEnvironment.default.getFullDownloadApiPath('manifestRollup'); if (!useBody) { - var siteCodesParam = buildSiteCodesParams(sites); - var productCodeParam = productCode.startsWith('NEON.DOM.SITE') ? productCode : "NEON.DOM.SITE.".concat(productCode); - var params = ["dpcode=".concat(productCodeParam), "startdate=".concat(dateRange[0]), "enddate=".concat(dateRange[1]), "pkgtype=".concat(packageType), "includedocs=".concat(documentation ? 'true' : 'false'), "includeProvisional=".concat(provisionalData ? 'true' : 'false'), siteCodesParam]; + const siteCodesParam = buildSiteCodesParams(sites); + const productCodeParam = productCode.startsWith('NEON.DOM.SITE') ? productCode : "NEON.DOM.SITE.".concat(productCode); + const params = ["dpcode=".concat(productCodeParam), "startdate=".concat(dateRange[0]), "enddate=".concat(dateRange[1]), "pkgtype=".concat(packageType), "includedocs=".concat(documentation ? 'true' : 'false'), "includeProvisional=".concat(provisionalData ? 'true' : 'false'), siteCodesParam]; url = "".concat(url, "?").concat(params.join('&')); } return url; }; exports.buildManifestRequestUrl = buildManifestRequestUrl; -var buildManifestRequestBody = function buildManifestRequestBody(config) { - var productCode = config.productCode, - release = config.release, - sites = config.sites, - dateRange = config.dateRange, - packageType = config.packageType, - documentation = config.documentation, - provisionalData = config.provisionalData; - var productCodeParam = productCode.startsWith('NEON.DOM.SITE') ? productCode : "NEON.DOM.SITE.".concat(productCode); +const buildManifestRequestBody = config => { + const { + productCode, + release, + sites, + dateRange, + packageType, + documentation, + provisionalData + } = config; + const productCodeParam = productCode.startsWith('NEON.DOM.SITE') ? productCode : "NEON.DOM.SITE.".concat(productCode); return { dpCode: productCodeParam, siteCodes: sites, startDateMonth: dateRange[0], endDateMonth: dateRange[1], - release: release, + release, pkgType: packageType, includeDocs: documentation, includeProvisional: provisionalData, @@ -97,36 +98,34 @@ var buildManifestRequestBody = function buildManifestRequestBody(config) { }; }; exports.buildManifestRequestBody = buildManifestRequestBody; -var buildS3FilesRequestUrl = function buildS3FilesRequestUrl(productCode, site, yearMonth, release) { - var productCodeDir = productCode.startsWith('NEON.DOM.SITE') ? productCode : "NEON.DOM.SITE.".concat(productCode); - var releaseParam = typeof release === 'string' && release.length > 0 ? "&release=".concat(release) : ''; - var root = "".concat(_NeonEnvironment.default.getFullApiPath('data'), "/").concat(productCodeDir, "/").concat(site, "/").concat(yearMonth); +const buildS3FilesRequestUrl = (productCode, site, yearMonth, release) => { + const productCodeDir = productCode.startsWith('NEON.DOM.SITE') ? productCode : "NEON.DOM.SITE.".concat(productCode); + const releaseParam = typeof release === 'string' && release.length > 0 ? "&release=".concat(release) : ''; + const root = "".concat(_NeonEnvironment.default.getFullApiPath('data'), "/").concat(productCodeDir, "/").concat(site, "/").concat(yearMonth); return "".concat(root, "?presign=false").concat(releaseParam); }; exports.buildS3FilesRequestUrl = buildS3FilesRequestUrl; -var downloadManifest = function downloadManifest(manifest) { - var form = document.createElement('form'); +const downloadManifest = manifest => { + const form = document.createElement('form'); form.style.display = 'none'; form.action = _NeonEnvironment.default.getFullDownloadApiPath('downloadStream'); form.method = 'POST'; - var input = document.createElement('input'); + const input = document.createElement('input'); input.name = 'manifest'; input.value = JSON.stringify(manifest); form.appendChild(input); document.body.appendChild(form); - var submit = form.submit(); + const submit = form.submit(); document.body.removeChild(form); return submit; }; exports.downloadManifest = downloadManifest; -var downloadAopManifest = function downloadAopManifest(config, s3Files) { - var documentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'include'; - var provisionalData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'exclude'; - var siteCodes = []; - var s3FileValues = s3Files.validValues; - var manifestS3Files = s3FileValues.filter(function (file) { - return s3Files.value.includes(file.url); - }).map(function (file) { +const downloadAopManifest = function (config, s3Files) { + let documentation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'include'; + let provisionalData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'exclude'; + const siteCodes = []; + const s3FileValues = s3Files.validValues; + const manifestS3Files = s3FileValues.filter(file => s3Files.value.includes(file.url)).map(file => { if (!siteCodes.includes(file.site)) { siteCodes.push(file.site); } @@ -143,10 +142,10 @@ var downloadAopManifest = function downloadAopManifest(config, s3Files) { uri: file.url }; }); - var includeDocs = documentation === 'include'; - var includeProvisional = provisionalData === 'include'; - var productCodeParam = config.productCode.startsWith('NEON.DOM.SITE') ? config.productCode : "NEON.DOM.SITE.".concat(config.productCode); - var manifestRequest = { + const includeDocs = documentation === 'include'; + const includeProvisional = provisionalData === 'include'; + const productCodeParam = config.productCode.startsWith('NEON.DOM.SITE') ? config.productCode : "NEON.DOM.SITE.".concat(config.productCode); + const manifestRequest = { dpCode: productCodeParam, startDateMonth: null, endDateMonth: null, @@ -154,43 +153,39 @@ var downloadAopManifest = function downloadAopManifest(config, s3Files) { pkgType: null, presign: true, manifestFiles: manifestS3Files, - siteCodes: siteCodes, - includeDocs: includeDocs, - includeProvisional: includeProvisional + siteCodes, + includeDocs, + includeProvisional }; return downloadManifest(manifestRequest); }; exports.downloadAopManifest = downloadAopManifest; -var MAX_POST_BODY_SIZE = 20 * (1024 * 1024); // 20MiB -exports.MAX_POST_BODY_SIZE = MAX_POST_BODY_SIZE; -var DOWNLOAD_SIZE_WARN = 42949672960; // 40GB -exports.DOWNLOAD_SIZE_WARN = DOWNLOAD_SIZE_WARN; -var formatBytes = function formatBytes(bytes) { +const MAX_POST_BODY_SIZE = exports.MAX_POST_BODY_SIZE = 20 * (1024 * 1024); // 20MiB +const DOWNLOAD_SIZE_WARN = exports.DOWNLOAD_SIZE_WARN = 42949672960; // 40GB + +const formatBytes = bytes => { if (!Number.isInteger(bytes) || bytes < 0) { return '0.000 B'; } - var scales = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']; - var log = Math.log(bytes) / Math.log(1024); - var scale = Math.floor(log); - var precision = Math.floor(3 - (log - scale) * 3); - return "".concat((bytes / Math.pow(1024, scale)).toFixed(precision), " ").concat(scales[scale]); + const scales = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']; + const log = Math.log(bytes) / Math.log(1024); + const scale = Math.floor(log); + const precision = Math.floor(3 - (log - scale) * 3); + return "".concat((bytes / 1024 ** scale).toFixed(precision), " ").concat(scales[scale]); }; exports.formatBytes = formatBytes; -var getSizeEstimateFromManifestResponse = function getSizeEstimateFromManifestResponse(response) { - if (_typeof(response) !== 'object' || response === null || _typeof(response.data) !== 'object' || response.data === null || !Array.isArray(response.data.manifestEntries) || !response.data.manifestEntries.length) { +const getSizeEstimateFromManifestResponse = response => { + if (typeof response !== 'object' || response === null || typeof response.data !== 'object' || response.data === null || !Array.isArray(response.data.manifestEntries) || !response.data.manifestEntries.length) { return 0; } - return response.data.manifestEntries.reduce(function (total, entry) { - return total + (parseInt(entry.fileSizeBytes, 10) || 0); - }, 0); + return response.data.manifestEntries.reduce((total, entry) => total + (parseInt(entry.fileSizeBytes, 10) || 0), 0); }; exports.getSizeEstimateFromManifestResponse = getSizeEstimateFromManifestResponse; -var getSizeEstimateFromManifestRollupResponse = function getSizeEstimateFromManifestRollupResponse(response) { - if (_typeof(response) !== 'object' || response === null || _typeof(response.data) !== 'object' || response.data === null || typeof response.data.totalBytes !== 'number' || response.data.totalBytes === null) { +const getSizeEstimateFromManifestRollupResponse = response => { + if (typeof response !== 'object' || response === null || typeof response.data !== 'object' || response.data === null || typeof response.data.totalBytes !== 'number' || response.data.totalBytes === null) { return 0; } return response.data.totalBytes; }; exports.getSizeEstimateFromManifestRollupResponse = getSizeEstimateFromManifestRollupResponse; -var _default = buildManifestRequestUrl; -exports.default = _default; \ No newline at end of file +var _default = exports.default = buildManifestRequestUrl; \ No newline at end of file diff --git a/lib/util/polyfillUtil.js b/lib/util/polyfillUtil.js index ad6bdd34..f795ae29 100644 --- a/lib/util/polyfillUtil.js +++ b/lib/util/polyfillUtil.js @@ -13,9 +13,7 @@ exports.startsWithPolyfill = exports.endsWithPolyfill = void 0; * * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith#Polyfill */ -var startsWithPolyfill = function startsWithPolyfill(baseString, searchString, position) { - return baseString.substr(position || 0, searchString.length) === searchString; -}; +const startsWithPolyfill = (baseString, searchString, position) => baseString.substr(position || 0, searchString.length) === searchString; /** * Determines if the base string ends with the search string @@ -26,8 +24,8 @@ var startsWithPolyfill = function startsWithPolyfill(baseString, searchString, p * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith#Polyfill */ exports.startsWithPolyfill = startsWithPolyfill; -var endsWithPolyfill = function endsWithPolyfill(baseString, searchString, thisLen) { - var len = thisLen; +const endsWithPolyfill = (baseString, searchString, thisLen) => { + let len = thisLen; if (thisLen === undefined || thisLen > baseString.length) { len = baseString.length; } diff --git a/lib/util/requestUtil.d.ts b/lib/util/requestUtil.d.ts new file mode 100644 index 00000000..532ac8b0 --- /dev/null +++ b/lib/util/requestUtil.d.ts @@ -0,0 +1,5 @@ +export declare const getUserAgentHeader: (component: string) => string; +declare const RequestUtil: { + getUserAgentHeader: (component: string) => string; +}; +export default RequestUtil; diff --git a/lib/util/requestUtil.js b/lib/util/requestUtil.js new file mode 100644 index 00000000..f44508de --- /dev/null +++ b/lib/util/requestUtil.js @@ -0,0 +1,22 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getUserAgentHeader = exports.default = void 0; +var _NeonEnvironment = _interopRequireDefault(require("../components/NeonEnvironment/NeonEnvironment")); +var _typeUtil = require("./typeUtil"); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const getUserAgentHeader = component => { + const appName = _NeonEnvironment.default.getReactAppName(); + const appVersion = _NeonEnvironment.default.getReactAppVersion(); + if (!(0, _typeUtil.isStringNonEmpty)(appName) || !(0, _typeUtil.isStringNonEmpty)(appVersion)) { + return ''; + } + return "".concat(appName, "/").concat(appVersion, " (").concat(component, ")"); +}; +exports.getUserAgentHeader = getUserAgentHeader; +const RequestUtil = { + getUserAgentHeader +}; +var _default = exports.default = RequestUtil; \ No newline at end of file diff --git a/lib/util/rxUtil.js b/lib/util/rxUtil.js index bcdcbb7b..b0d3de4b 100644 --- a/lib/util/rxUtil.js +++ b/lib/util/rxUtil.js @@ -20,12 +20,12 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function * @param {boolean} cors * @return RxJS subscription */ -var getJson = function getJson(url, callback, errorCallback, cancellationSubject$) { - var headers = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined; - var cors = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; - var request = { +const getJson = function (url, callback, errorCallback, cancellationSubject$) { + let headers = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined; + let cors = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; + const request = { method: 'GET', - url: url, + url, responseType: 'json', headers: _extends({ Accept: 'application/json' @@ -35,13 +35,13 @@ var getJson = function getJson(url, callback, errorCallback, cancellationSubject request.crossDomain = true; request.withCredentials = true; } - var rxObs$ = (0, _ajax.ajax)(request).pipe((0, _rxjs.map)(function (response) { - var appliedResponse = (0, _typeUtil.exists)(response) && (0, _typeUtil.exists)(response.response) ? response.response : response; + const rxObs$ = (0, _ajax.ajax)(request).pipe((0, _rxjs.map)(response => { + const appliedResponse = (0, _typeUtil.exists)(response) && (0, _typeUtil.exists)(response.response) ? response.response : response; if (typeof callback === 'function') { return (0, _rxjs.of)(callback(appliedResponse)); } return (0, _rxjs.of)(appliedResponse); - }), (0, _rxjs.catchError)(function (error) { + }), (0, _rxjs.catchError)(error => { console.error(error); // eslint-disable-line no-console if (typeof errorCallback === 'function') { return (0, _rxjs.of)(errorCallback(error)); @@ -51,40 +51,29 @@ var getJson = function getJson(url, callback, errorCallback, cancellationSubject // Placeholders for subscriber events, handled upstream in observable return rxObs$.subscribe({ - next: function next(response) { - return response; - }, - error: function error(_error) { - return _error; - }, - complete: function complete(_complete) { - return _complete; - } + next: response => response, + error: error => error, + complete: complete => complete }); }; exports.getJson = getJson; -var _default = getJson; +var _default = exports.default = getJson; /** Convert an array of obbservables into a single observable block that reports progress (the number of completed observables out of the total) as a percentage from 0 to 100 */ -exports.default = _default; -var forkJoinWithProgress = function forkJoinWithProgress(arrayOfObservables) { - return (0, _rxjs.defer)(function () { - var counter = 0; - var percent$ = new _rxjs.Subject(); - var modifiedObservablesList = arrayOfObservables.map(function (item) { - return item.pipe((0, _rxjs.finalize)(function () { - counter += 1; - var percentValue = counter * 100 / arrayOfObservables.length; - percent$.next(percentValue); - })); - }); - var finalResult$ = (0, _rxjs.forkJoin)(modifiedObservablesList).pipe((0, _rxjs.tap)(function () { - percent$.next(100); - percent$.complete(); - })); - return (0, _rxjs.of)([finalResult$, percent$.asObservable()]); - }); -}; +const forkJoinWithProgress = arrayOfObservables => (0, _rxjs.defer)(() => { + let counter = 0; + const percent$ = new _rxjs.Subject(); + const modifiedObservablesList = arrayOfObservables.map(item => item.pipe((0, _rxjs.finalize)(() => { + counter += 1; + const percentValue = counter * 100 / arrayOfObservables.length; + percent$.next(percentValue); + }))); + const finalResult$ = (0, _rxjs.forkJoin)(modifiedObservablesList).pipe((0, _rxjs.tap)(() => { + percent$.next(100); + percent$.complete(); + })); + return (0, _rxjs.of)([finalResult$, percent$.asObservable()]); +}); exports.forkJoinWithProgress = forkJoinWithProgress; \ No newline at end of file diff --git a/lib/util/typeUtil.js b/lib/util/typeUtil.js index f193f07a..c39a50b1 100644 --- a/lib/util/typeUtil.js +++ b/lib/util/typeUtil.js @@ -4,27 +4,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.resolveAny = exports.isStringNonEmpty = exports.isNum = exports.existsNonEmpty = exports.exists = void 0; -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } -var exists = function exists(o) { - return typeof o !== 'undefined' && o !== null; -}; +const exists = o => typeof o !== 'undefined' && o !== null; exports.exists = exists; -var isStringNonEmpty = function isStringNonEmpty(o) { - return typeof o === 'string' && o.trim().length > 0; -}; +const isStringNonEmpty = o => typeof o === 'string' && o.trim().length > 0; exports.isStringNonEmpty = isStringNonEmpty; -var isNum = function isNum(o) { - return typeof o === 'number' && !Number.isNaN(o); -}; +const isNum = o => typeof o === 'number' && !Number.isNaN(o); exports.isNum = isNum; -var existsNonEmpty = function existsNonEmpty(o) { - return exists(o) && o.length > 0; -}; +const existsNonEmpty = o => exists(o) && o.length > 0; /** * Resolves any value to a record by @@ -34,24 +20,24 @@ var existsNonEmpty = function existsNonEmpty(o) { * @return The coerced inner prop */ exports.existsNonEmpty = existsNonEmpty; -var resolveAny = function resolveAny(o) { +const resolveAny = function (o) { for (var _len = arguments.length, drillProps = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { drillProps[_key - 1] = arguments[_key]; } if (!exists(o) || !existsNonEmpty(drillProps)) { return {}; } - var curProp = drillProps[0]; + const curProp = drillProps[0]; if (drillProps.length === 1) { if (!exists(o[curProp])) { return {}; } return o[curProp]; } - var next = o[curProp]; + const next = o[curProp]; if (!exists(next)) { return {}; } - return resolveAny.apply(void 0, [next].concat(_toConsumableArray(drillProps.slice(1, drillProps.length)))); + return resolveAny(next, ...drillProps.slice(1, drillProps.length)); }; exports.resolveAny = resolveAny; \ No newline at end of file diff --git a/lib/vendor/paralleljs/lib/parallel.js b/lib/vendor/paralleljs/lib/parallel.js index b3f28c94..49fe880f 100644 --- a/lib/vendor/paralleljs/lib/parallel.js +++ b/lib/vendor/paralleljs/lib/parallel.js @@ -4,21 +4,20 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; -function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } -var isCommonJS = typeof module !== 'undefined' && module.exports; +const isCommonJS = typeof module !== 'undefined' && module.exports; // const isNode = !(typeof window !== 'undefined' && this === window); -var isNode = false; +const isNode = false; var setImmediate = setImmediate || function (cb) { setTimeout(cb, 0); }; // const Worker = isNode ? require(`${__dirname}/Worker.js`) : self.Worker; -var Worker = self.Worker; -var URL = typeof self !== 'undefined' ? self.URL ? self.URL : self.webkitURL : null; -var _supports = !!(isNode || self.Worker); // node always supports parallel +const Worker = self.Worker; +const URL = typeof self !== 'undefined' ? self.URL ? self.URL : self.webkitURL : null; +const _supports = !!(isNode || self.Worker); // node always supports parallel function extend(from, to) { if (!to) to = {}; - for (var i in from) { + for (const i in from) { if (to[i] === undefined) to[i] = from[i]; } return to; @@ -33,13 +32,13 @@ Operation.prototype.resolve = function (err, res) { if (!err) { this._resolved = 1; this._result = res; - for (var i = 0; i < this._callbacks.length; ++i) { + for (let i = 0; i < this._callbacks.length; ++i) { this._callbacks[i](res); } } else { this._resolved = 2; this._result = err; - for (var iE = 0; iE < this._errCallbacks.length; ++iE) { + for (let iE = 0; iE < this._errCallbacks.length; ++iE) { this._errCallbacks[iE](err); } } @@ -69,7 +68,7 @@ Operation.prototype.then = function (cb, errCb) { } return this; }; -var defaults = { +const defaults = { // evalPath: isNode ? `${__dirname}/eval.js` : null, evalPath: null, maxWorkers: isNode ? 2 : navigator.hardwareConcurrency || 4, @@ -91,9 +90,9 @@ Parallel.isSupported = function () { return _supports; }; Parallel.prototype.getWorkerSource = function (cb, env) { - var that = this; - var preStr = ''; - var i = 0; + const that = this; + let preStr = ''; + let i = 0; if (!isNode && this.requiredScripts.length !== 0) { preStr += "importScripts(\"".concat(this.requiredScripts.join('","'), "\");\r\n"); } @@ -105,16 +104,16 @@ Parallel.prototype.getWorkerSource = function (cb, env) { } } env = JSON.stringify(env || {}); - var ns = this.options.envNamespace; + const ns = this.options.envNamespace; if (isNode) { return "".concat(preStr, "process.on(\"message\", function(e) {global.").concat(ns, " = ").concat(env, ";process.send(JSON.stringify((").concat(cb.toString(), ")(JSON.parse(e).data)))})"); } return "".concat(preStr, "self.onmessage = function(e) {var global = {}; global.").concat(ns, " = ").concat(env, ";self.postMessage((").concat(cb.toString(), ")(e.data))}"); }; Parallel.prototype.require = function () { - var args = Array.prototype.slice.call(arguments, 0); - var func; - for (var i = 0; i < args.length; i++) { + const args = Array.prototype.slice.call(arguments, 0); + let func; + for (let i = 0; i < args.length; i++) { func = args[i]; if (typeof func === 'string') { this.requiredScripts.push(func); @@ -122,15 +121,15 @@ Parallel.prototype.require = function () { this.requiredFunctions.push({ fn: func }); - } else if (_typeof(func) === 'object') { + } else if (typeof func === 'object') { this.requiredFunctions.push(func); } } return this; }; Parallel.prototype._spawnWorker = function (cb, env) { - var wrk; - var src = this.getWorkerSource(cb, env); + let wrk; + const src = this.getWorkerSource(cb, env); if (isNode) { wrk = new Worker(this.options.evalPath); wrk.postMessage(src); @@ -149,10 +148,10 @@ Parallel.prototype._spawnWorker = function (cb, env) { } else if (!URL) { throw new Error("Can't create a blob URL in this browser!"); } else { - var blob = new Blob([src], { + const blob = new Blob([src], { type: 'text/javascript' }); - var url = URL.createObjectURL(blob); + const url = URL.createObjectURL(blob); wrk = new Worker(url); } } catch (e) { @@ -168,11 +167,11 @@ Parallel.prototype._spawnWorker = function (cb, env) { return wrk; }; Parallel.prototype.spawn = function (cb, env) { - var that = this; - var newOp = new Operation(); - var timeout; + const that = this; + const newOp = new Operation(); + let timeout; env = extend(this.options.env, env || {}); - this.operation.then(function () { + this.operation.then(() => { if (env.timeout) { timeout = setTimeout(function () { if (!newOp.resolved) { @@ -181,7 +180,7 @@ Parallel.prototype.spawn = function (cb, env) { } }, env.timeout); } - var wrk = that._spawnWorker(cb, env); + const wrk = that._spawnWorker(cb, env); if (wrk !== undefined) { wrk.onmessage = function (msg) { if (timeout) clearTimeout(timeout); @@ -196,7 +195,7 @@ Parallel.prototype.spawn = function (cb, env) { }; wrk.postMessage(that.data); } else if (that.options.synchronous) { - setImmediate(function () { + setImmediate(() => { try { that.data = cb(that.data); newOp.resolve(null, that.data); @@ -212,7 +211,7 @@ Parallel.prototype.spawn = function (cb, env) { return this; }; Parallel.prototype._spawnMapWorker = function (i, cb, done, env, wrk) { - var that = this; + const that = this; if (!wrk) wrk = that._spawnWorker(cb, env); if (wrk !== undefined) { wrk.onmessage = function (msg) { @@ -225,7 +224,7 @@ Parallel.prototype._spawnMapWorker = function (i, cb, done, env, wrk) { }; wrk.postMessage(that.data[i]); } else if (that.options.synchronous) { - setImmediate(function () { + setImmediate(() => { that.data[i] = cb(that.data[i]); done(); }); @@ -238,9 +237,9 @@ Parallel.prototype.map = function (cb, env) { if (!this.data.length) { return this.spawn(cb, env); } - var that = this; - var startedOps = 0; - var doneOps = 0; + const that = this; + let startedOps = 0; + let doneOps = 0; function done(err, wrk) { if (err) { newOp.resolve(err, null); @@ -252,18 +251,18 @@ Parallel.prototype.map = function (cb, env) { } else if (wrk) wrk.terminate(); } var newOp = new Operation(); - this.operation.then(function () { + this.operation.then(() => { for (; startedOps - doneOps < that.options.maxWorkers && startedOps < that.data.length; ++startedOps) { that._spawnMapWorker(startedOps, cb, done, env); } - }, function (err) { + }, err => { newOp.resolve(err, null); }); this.operation = newOp; return this; }; Parallel.prototype._spawnReduceWorker = function (data, cb, done, env, wrk) { - var that = this; + const that = this; if (!wrk) wrk = that._spawnWorker(cb, env); if (wrk !== undefined) { wrk.onmessage = function (msg) { @@ -276,7 +275,7 @@ Parallel.prototype._spawnReduceWorker = function (data, cb, done, env, wrk) { }; wrk.postMessage(data); } else if (that.options.synchronous) { - setImmediate(function () { + setImmediate(() => { that.data[that.data.length] = cb(data); done(); }); @@ -289,8 +288,8 @@ Parallel.prototype.reduce = function (cb, env) { if (!this.data.length) { throw new Error("Can't reduce non-array data"); } - var runningWorkers = 0; - var that = this; + let runningWorkers = 0; + const that = this; function done(err, wrk) { --runningWorkers; if (err) { @@ -306,7 +305,7 @@ Parallel.prototype.reduce = function (cb, env) { } else if (wrk) wrk.terminate(); } var newOp = new Operation(); - this.operation.then(function () { + this.operation.then(() => { if (that.data.length === 1) { newOp.resolve(null, that.data[0]); } else { @@ -321,11 +320,11 @@ Parallel.prototype.reduce = function (cb, env) { return this; }; Parallel.prototype.then = function (cb, errCb) { - var that = this; - var newOp = new Operation(); + const that = this; + const newOp = new Operation(); errCb = typeof errCb === 'function' ? errCb : function () {}; - this.operation.then(function () { - var retData; + this.operation.then(() => { + let retData; try { if (cb) { retData = cb(that.data); @@ -345,9 +344,9 @@ Parallel.prototype.then = function (cb, errCb) { newOp.resolve(null, e); } } - }, function (err) { + }, err => { if (errCb) { - var retData = errCb(err); + const retData = errCb(err); if (retData !== undefined) { that.data = retData; } @@ -365,5 +364,4 @@ Parallel.prototype.then = function (cb, errCb) { // } else { // self.Parallel = Parallel; // } -var _default = Parallel; -exports.default = _default; \ No newline at end of file +var _default = exports.default = Parallel; \ No newline at end of file diff --git a/lib/workers/generateTimeSeriesGraphData.js b/lib/workers/generateTimeSeriesGraphData.js index de9bbc91..9520706d 100644 --- a/lib/workers/generateTimeSeriesGraphData.js +++ b/lib/workers/generateTimeSeriesGraphData.js @@ -62,7 +62,7 @@ function monthToNumbers(month) { m: null }; } - var split = month.split('-'); + const split = month.split('-'); return { y: parseInt(split[0], 10), m: parseInt(split[1], 10) @@ -72,18 +72,20 @@ function monthIsValid(month) { if (!monthIsValidFormat(month)) { return false; } - var _monthToNumbers = monthToNumbers(month), - y = _monthToNumbers.y, - m = _monthToNumbers.m; + const { + y, + m + } = monthToNumbers(month); return y !== null && m !== null && y >= 2000 && m >= 1 && m <= 12; } function monthToTicker(month) { if (!monthIsValid(month)) { return 0; } - var _monthToNumbers2 = monthToNumbers(month), - y = _monthToNumbers2.y, - m = _monthToNumbers2.m; + const { + y, + m + } = monthToNumbers(month); return Date.UTC(y, m - 1, 1, 0, 0, 0); } function tickerIsValid(ticker) { @@ -93,44 +95,45 @@ function tickerToMonth(ticker) { if (!tickerIsValid(ticker)) { return null; } - var d = new Date(ticker); - var YYYY = d.getUTCFullYear().toString(); - var MM = (d.getUTCMonth() + 1).toString().padStart(2, '0'); + const d = new Date(ticker); + const YYYY = d.getUTCFullYear().toString(); + const MM = (d.getUTCMonth() + 1).toString().padStart(2, '0'); return "".concat(YYYY, "-").concat(MM); } function tickerToIso(ticker) { - var includeSeconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + let includeSeconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; if (!tickerIsValid(ticker)) { return null; } - var d = new Date(ticker); - var YYYY = d.getUTCFullYear().toString(); - var MM = (d.getUTCMonth() + 1).toString().padStart(2, '0'); - var DD = d.getUTCDate().toString().padStart(2, '0'); - var hh = d.getUTCHours().toString().padStart(2, '0'); - var mm = d.getUTCMinutes().toString().padStart(2, '0'); - var ss = d.getUTCSeconds().toString().padStart(2, '0'); + const d = new Date(ticker); + const YYYY = d.getUTCFullYear().toString(); + const MM = (d.getUTCMonth() + 1).toString().padStart(2, '0'); + const DD = d.getUTCDate().toString().padStart(2, '0'); + const hh = d.getUTCHours().toString().padStart(2, '0'); + const mm = d.getUTCMinutes().toString().padStart(2, '0'); + const ss = d.getUTCSeconds().toString().padStart(2, '0'); return includeSeconds ? "".concat(YYYY, "-").concat(MM, "-").concat(DD, "T").concat(hh, ":").concat(mm, ":").concat(ss, "Z") : "".concat(YYYY, "-").concat(MM, "-").concat(DD, "T").concat(hh, ":").concat(mm, "Z"); } function dateTimeToFloorSeconds(dt) { if (typeof dt === 'undefined' || dt === null) { return null; } - var d = new Date(dt); - var YYYY = d.getUTCFullYear().toString(); - var MM = (d.getUTCMonth() + 1).toString().padStart(2, '0'); - var DD = d.getUTCDate().toString().padStart(2, '0'); - var hh = d.getUTCHours().toString().padStart(2, '0'); - var mm = d.getUTCMinutes().toString().padStart(2, '0'); + const d = new Date(dt); + const YYYY = d.getUTCFullYear().toString(); + const MM = (d.getUTCMonth() + 1).toString().padStart(2, '0'); + const DD = d.getUTCDate().toString().padStart(2, '0'); + const hh = d.getUTCHours().toString().padStart(2, '0'); + const mm = d.getUTCMinutes().toString().padStart(2, '0'); return "".concat(YYYY, "-").concat(MM, "-").concat(DD, "T").concat(hh, ":").concat(mm, ":00Z"); } function getNextMonth(month) { if (!monthIsValid(month)) { return null; } - var _monthToNumbers3 = monthToNumbers(month), - y = _monthToNumbers3.y, - m = _monthToNumbers3.m; + let { + y, + m + } = monthToNumbers(month); m += 1; if (m === 13) { m = 1; @@ -140,17 +143,15 @@ function getNextMonth(month) { } // Additional items exported for unit testing -var getTestableItems = function getTestableItems() { - return process.env.NODE_ENV !== 'test' ? {} : { - monthIsValidFormat: monthIsValidFormat, - monthToNumbers: monthToNumbers, - monthIsValid: monthIsValid, - monthToTicker: monthToTicker, - tickerIsValid: tickerIsValid, - tickerToMonth: tickerToMonth, - tickerToIso: tickerToIso, - getNextMonth: getNextMonth - }; +const getTestableItems = () => process.env.NODE_ENV !== 'test' ? {} : { + monthIsValidFormat, + monthToNumbers, + monthIsValid, + monthToTicker, + tickerIsValid, + tickerToMonth, + tickerToIso, + getNextMonth }; /** @@ -166,28 +167,27 @@ var getTestableItems = function getTestableItems() { */ exports.getTestableItems = getTestableItems; function generateTimeSeriesGraphData() { - var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var worker = new _paralleljs.default(payload).require(getTimeSteps).require(monthIsValidFormat).require(monthToNumbers).require(monthIsValid).require(monthToTicker).require(tickerIsValid).require(tickerToMonth).require(tickerToIso).require(dateTimeToFloorSeconds).require(getNextMonth); - return worker.spawn(function (inData) { - - // Babel polyfills for worker logic - function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } - + let payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const worker = new _paralleljs.default(payload).require(getTimeSteps).require(monthIsValidFormat).require(monthToNumbers).require(monthIsValid).require(monthToTicker).require(tickerIsValid).require(tickerToMonth).require(tickerToIso).require(dateTimeToFloorSeconds).require(getNextMonth); + return worker.spawn(inData => { /** Deconstruct necessary values from state */ - var product = inData.product, - stateVariables = inData.variables, - _inData$selection = inData.selection, - autoTimeStep = _inData$selection.autoTimeStep, - continuousDateRange = _inData$selection.continuousDateRange, - dateRange = _inData$selection.dateRange, - dateTimeVariable = _inData$selection.dateTimeVariable, - qualityFlags = _inData$selection.qualityFlags, - sites = _inData$selection.sites, - derivedVariableTable = _inData$selection.derivedVariableTable, - selectedTimeStep = _inData$selection.timeStep, - selectedVariables = _inData$selection.variables; + const { + product, + variables: stateVariables, + selection: { + autoTimeStep, + continuousDateRange, + dateRange, + dateTimeVariable, + qualityFlags, + sites, + derivedVariableTable, + timeStep: selectedTimeStep, + variables: selectedVariables + } + } = inData; // Optionally toggle to allow a purely positional mapping // of generated, contiguous timestamp values based on the // aggregation level, and the actual timestamps coming back in the @@ -198,30 +198,26 @@ function generateTimeSeriesGraphData() { // Turning this off will resolve to mapping the timestamps from the // data to the matching timestamp in the generated, // contiguous timestamp values. - var ALLOW_POSITIONAL_TS_MAPPING = false; + const ALLOW_POSITIONAL_TS_MAPPING = false; // Optionally toggle to allow truncating series values // in the case where there are more timestamp values than expected // based on the generated, contiguous timestamp values for the aggregation // level. - var ALLOW_POSITIONAL_TS_TRUNCATION = false; - var timeStep = selectedTimeStep === 'auto' ? autoTimeStep : selectedTimeStep; - var getQFNullFill = function getQFNullFill() { - return (qualityFlags || []).map(function () { - return null; - }); - }; - var TIME_STEPS = getTimeSteps(); + const ALLOW_POSITIONAL_TS_TRUNCATION = false; + const timeStep = selectedTimeStep === 'auto' ? autoTimeStep : selectedTimeStep; + const getQFNullFill = () => (qualityFlags || []).map(() => null); + const TIME_STEPS = getTimeSteps(); // Function to match the searchTime in milliseconds since epoch, // against a timestamp in the dataset - var findTimestampIdx = function findTimestampIdx(data, searchTime, startIdx) { - var isodateS = tickerToIso(searchTime, true); - var isodateM = tickerToIso(searchTime, false); - var dateIdx = -1; - for (var i = startIdx; i < data.length; i += 1) { - var dateTimeVal = data[i]; - var dateTimeValZeroS = dateTimeToFloorSeconds(dateTimeVal); - var matched = dateTimeVal === isodateS || dateTimeValZeroS === isodateS || dateTimeVal === isodateM; + const findTimestampIdx = (data, searchTime, startIdx) => { + const isodateS = tickerToIso(searchTime, true); + const isodateM = tickerToIso(searchTime, false); + let dateIdx = -1; + for (let i = startIdx; i < data.length; i += 1) { + const dateTimeVal = data[i]; + const dateTimeValZeroS = dateTimeToFloorSeconds(dateTimeVal); + const matched = dateTimeVal === isodateS || dateTimeValZeroS === isodateS || dateTimeVal === isodateM; if (matched) { dateIdx = i; break; @@ -233,7 +229,7 @@ function generateTimeSeriesGraphData() { /** Validate input (return unmodified state.graphData if anything fails) */ - var outSanityCheckData = { + const outSanityCheckData = { data: [[0, 0]], qualityData: [[0, 0]], monthOffsets: {}, @@ -247,21 +243,15 @@ function generateTimeSeriesGraphData() { return outSanityCheckData; } // Must have valid date range - if (!Array.isArray(dateRange) || dateRange.length !== 2 || dateRange.some(function (month) { - return !monthIsValid(month); - }) || dateRange[0] > dateRange[1]) { + if (!Array.isArray(dateRange) || dateRange.length !== 2 || dateRange.some(month => !monthIsValid(month)) || dateRange[0] > dateRange[1]) { return outSanityCheckData; } // Must have valid continuous date range with same bounds as date range - if (!Array.isArray(continuousDateRange) || continuousDateRange.length < 1 || continuousDateRange.some(function (month) { - return !monthIsValid(month); - }) || dateRange[0] !== continuousDateRange[0] || dateRange[1] !== continuousDateRange[continuousDateRange.length - 1]) { + if (!Array.isArray(continuousDateRange) || continuousDateRange.length < 1 || continuousDateRange.some(month => !monthIsValid(month)) || dateRange[0] !== continuousDateRange[0] || dateRange[1] !== continuousDateRange[continuousDateRange.length - 1]) { return outSanityCheckData; } // Must have qualityFlags that's an array (can be empty) where all entries are valid variables - if (!Array.isArray(qualityFlags) || qualityFlags.length && qualityFlags.some(function (qf) { - return !stateVariables[qf]; - })) { + if (!Array.isArray(qualityFlags) || qualityFlags.length && qualityFlags.some(qf => !stateVariables[qf])) { return outSanityCheckData; } // Must have a valid dateTimeVariable that's represented in stateVariables @@ -269,32 +259,30 @@ function generateTimeSeriesGraphData() { return outSanityCheckData; } // Must have at least one selected variable and all must be in stateVariables - if (!Array.isArray(selectedVariables) || selectedVariables.some(function (v) { - return !stateVariables[v]; - })) { + if (!Array.isArray(selectedVariables) || selectedVariables.some(v => !stateVariables[v])) { return outSanityCheckData; } // Must have a non-empty selected sites array with at least one with proper structure - if (!Array.isArray(sites) || !sites.length || sites.every(function (site) { - return !site.siteCode || !Array.isArray(site.positions) || !site.positions.length; - })) { + if (!Array.isArray(sites) || !sites.length || sites.every(site => !site.siteCode || !Array.isArray(site.positions) || !site.positions.length)) { return outSanityCheckData; } // Requires product must be an object with a sites object - if (_typeof(product) !== 'object' || product === null || _typeof(product.sites) !== 'object' || product.sites === null) { + if (typeof product !== 'object' || product === null || typeof product.sites !== 'object' || product.sites === null) { return outSanityCheckData; } // At least one selected site must have positions, and at least one site/position // combinations must be represented in the product with some data - var productSitesAreValid = false; - sites.forEach(function (site) { - var siteCode = site.siteCode, - positions = site.positions; - if (_typeof(product.sites[siteCode]) === 'object' && product.sites[siteCode] !== null && _typeof(product.sites[siteCode].positions) === 'object' && product.sites[siteCode].positions !== null) { + let productSitesAreValid = false; + sites.forEach(site => { + const { + siteCode, + positions + } = site; + if (typeof product.sites[siteCode] === 'object' && product.sites[siteCode] !== null && typeof product.sites[siteCode].positions === 'object' && product.sites[siteCode].positions !== null) { // Ensure at least one selected position has data to display - var foundValidPositionData = false; - positions.forEach(function (position) { - var invalidPositionData = _typeof(product.sites[siteCode].positions[position]) !== 'object' || product.sites[siteCode].positions[position] === null || _typeof(product.sites[siteCode].positions[position].data) !== 'object' || product.sites[siteCode].positions[position].data === null || Object.keys(product.sites[siteCode].positions[position].data).length < 1; + let foundValidPositionData = false; + positions.forEach(position => { + const invalidPositionData = typeof product.sites[siteCode].positions[position] !== 'object' || product.sites[siteCode].positions[position] === null || typeof product.sites[siteCode].positions[position].data !== 'object' || product.sites[siteCode].positions[position].data === null || Object.keys(product.sites[siteCode].positions[position].data).length < 1; if (!invalidPositionData) { foundValidPositionData = true; } @@ -312,19 +300,21 @@ function generateTimeSeriesGraphData() { Initialize data set with timestep-based times and monthOffsets for registering actual data */ // Reinitialize - var newData = []; - var newQualityData = []; - var newMonthOffsets = {}; - var newTimestampMap = {}; + const newData = []; + const newQualityData = []; + const newMonthOffsets = {}; + const newTimestampMap = {}; // Tick through date range one time step at a time to build data / qualityData / timeStampMap - var seconds = TIME_STEPS[timeStep].seconds; - var ticker = monthToTicker(dateRange[0]); - var endMonth = getNextMonth(dateRange[1]); - var currentMonth = tickerToMonth(ticker); - var previousMonth = null; - var offset = null; - var endStep = null; + const { + seconds + } = TIME_STEPS[timeStep]; + let ticker = monthToTicker(dateRange[0]); + const endMonth = getNextMonth(dateRange[1]); + let currentMonth = tickerToMonth(ticker); + let previousMonth = null; + let offset = null; + let endStep = null; while (currentMonth < endMonth) { newData.push([new Date(ticker)]); endStep = ticker + seconds * 1000; @@ -338,9 +328,9 @@ function generateTimeSeriesGraphData() { ticker += seconds * 1000; currentMonth = tickerToMonth(ticker); } - var derivedVariableTables = []; - Object.keys(derivedVariableTable).forEach(function (k) { - var v = derivedVariableTable[k]; + const derivedVariableTables = []; + Object.keys(derivedVariableTable).forEach(k => { + const v = derivedVariableTable[k]; if (!derivedVariableTables.includes(v)) { derivedVariableTables.push(v); } @@ -350,68 +340,72 @@ function generateTimeSeriesGraphData() { Build the rest of the data structure and labels using selection values */ // Reinitialize - var newSeries = []; - var newLabels = ['x']; - var newQualityLabels = ['start', 'end']; + const newSeries = []; + const newLabels = ['x']; + const newQualityLabels = ['start', 'end']; // Loop through each site - sites.forEach(function (site) { - var siteCode = site.siteCode, - positions = site.positions; + sites.forEach(site => { + const { + siteCode, + positions + } = site; // Loop through each site position - positions.forEach(function (position) { + positions.forEach(position => { // Generate quality flag label and add to the list of quality labels - var qualityLabel = "".concat(siteCode, " - ").concat(position); + const qualityLabel = "".concat(siteCode, " - ").concat(position); if (qualityFlags.length && !newQualityLabels.includes(qualityLabel)) { newQualityLabels.push(qualityLabel); } // For each site position loop through every month in the continuous date range (no gaps) - continuousDateRange.forEach(function (month) { + continuousDateRange.forEach(month => { // Use monthOffsets to determine where in the entire data set this month belongs if (!Object.keys(newMonthOffsets).includes(month)) { return; } - var monthIdx = newMonthOffsets[month]; - var nextMonth = getNextMonth(month); - var monthStepCount = Object.keys(newMonthOffsets).includes(nextMonth) ? newMonthOffsets[nextMonth] - monthIdx : newData.length - monthIdx; + const monthIdx = newMonthOffsets[month]; + const nextMonth = getNextMonth(month); + const monthStepCount = Object.keys(newMonthOffsets).includes(nextMonth) ? newMonthOffsets[nextMonth] - monthIdx : newData.length - monthIdx; // For each site/position/month loop through all selected variables - selectedVariables.forEach(function (variable) { + selectedVariables.forEach(variable => { // Generate series label and add to the list of labels if this is the first we see it - var label = "".concat(siteCode, " - ").concat(position, " - ").concat(variable); + const label = "".concat(siteCode, " - ").concat(position, " - ").concat(variable); if (!newLabels.includes(label)) { newLabels.push(label); newSeries.push({ - siteCode: siteCode, - position: position, - variable: variable, - label: label, + siteCode, + position, + variable, + label, units: stateVariables[variable].units }); } - var columnIdx = newLabels.indexOf(label); + const columnIdx = newLabels.indexOf(label); if (!columnIdx) { return; } // 0 is x, so this should always be 1 or greater - var pkg = stateVariables[variable].downloadPkg; - var derivedTableName = derivedVariableTable[variable]; - var posData = product.sites[siteCode].positions[position].data; + const { + downloadPkg: pkg + } = stateVariables[variable]; + const derivedTableName = derivedVariableTable[variable]; + const posData = product.sites[siteCode].positions[position].data; // Null-fill if this site/position/month/variable has // neither series data nor dateTime data if (!posData[month] || !posData[month][pkg] || !posData[month][pkg][timeStep] || !posData[month][pkg][timeStep][derivedTableName] || !posData[month][pkg][timeStep][derivedTableName].series[variable] || !posData[month][pkg][timeStep][derivedTableName].series[dateTimeVariable]) { - for (var t = monthIdx; t < monthIdx + monthStepCount; t += 1) { + for (let t = monthIdx; t < monthIdx + monthStepCount; t += 1) { newData[t][columnIdx] = null; } return; } // This site/position/month/variable series exists, so add it into the data set // eslint-disable-next-line max-len - var seriesStepCount = posData[month][pkg][timeStep][derivedTableName].series[variable].data.length; + const seriesStepCount = posData[month][pkg][timeStep][derivedTableName].series[variable].data.length; // Series and month data lengths are identical (as expected): // Stream values directly in without matching timestamps if (ALLOW_POSITIONAL_TS_MAPPING) { if (seriesStepCount === monthStepCount) { - posData[month][pkg][timeStep][derivedTableName].series[variable].data.forEach(function (d, datumIdx) { + posData[month][pkg][timeStep][derivedTableName].series[variable].data.forEach((d, datumIdx) => { newData[datumIdx + monthIdx][columnIdx] = d; }); return; @@ -422,7 +416,7 @@ function generateTimeSeriesGraphData() { // exceed month step count if (ALLOW_POSITIONAL_TS_TRUNCATION) { if (seriesStepCount >= monthStepCount) { - posData[month][pkg][timeStep][derivedTableName].series[variable].data.forEach(function (d, datumIdx) { + posData[month][pkg][timeStep][derivedTableName].series[variable].data.forEach((d, datumIdx) => { if (datumIdx >= monthStepCount) { return; } @@ -442,49 +436,48 @@ function generateTimeSeriesGraphData() { // Therefore, if we find a matching timestamp value, we can assume // that the next value won't be found before the last found index in the series data, // allowing us to optimize the search in this scenario. - var lastIdx = 0; + let lastIdx = 0; // eslint-disable-next-line max-len - var dtVarData = posData[month][pkg][timeStep][derivedTableName].series[dateTimeVariable].data; - for (var _t = monthIdx; _t < monthIdx + monthStepCount; _t += 1) { - var dataIdx = findTimestampIdx(dtVarData, newData[_t][0].getTime(), lastIdx); + const dtVarData = posData[month][pkg][timeStep][derivedTableName].series[dateTimeVariable].data; + for (let t = monthIdx; t < monthIdx + monthStepCount; t += 1) { + const dataIdx = findTimestampIdx(dtVarData, newData[t][0].getTime(), lastIdx); if (dataIdx === -1) { - newData[_t][columnIdx] = null; + newData[t][columnIdx] = null; } else { lastIdx = dataIdx + 1; - newData[_t][columnIdx] = posData[month][pkg][timeStep][derivedTableName].series[variable].data[dataIdx]; + newData[t][columnIdx] = posData[month][pkg][timeStep][derivedTableName].series[variable].data[dataIdx]; } } }); // Also for each site/position/month loop through all selected quality flags - qualityFlags.forEach(function (qf, qfIdx) { - var columnIdx = newQualityLabels.indexOf(qualityLabel); + qualityFlags.forEach((qf, qfIdx) => { + const columnIdx = newQualityLabels.indexOf(qualityLabel); if (columnIdx < 2) { return; } // 0 is start and 1 is end - var _stateVariables$qf = stateVariables[qf], - pkg = _stateVariables$qf.downloadPkg, - qfTables = _stateVariables$qf.tables; - var derivedTableName = !qfTables ? null : Array.from(qfTables).find(function (qfTable) { - return derivedVariableTables.includes(qfTable); - }); - var posData = product.sites[siteCode].positions[position].data; + const { + downloadPkg: pkg, + tables: qfTables + } = stateVariables[qf]; + const derivedTableName = !qfTables ? null : Array.from(qfTables).find(qfTable => derivedVariableTables.includes(qfTable)); + const posData = product.sites[siteCode].positions[position].data; // If this site/position/month/variable has no series data then fill with nulls if (!posData[month] || !posData[month][pkg] || !posData[month][pkg][timeStep] || !posData[month][pkg][timeStep][derivedTableName] || !posData[month][pkg][timeStep][derivedTableName].series[qf]) { - for (var t = monthIdx; t < monthIdx + monthStepCount; t += 1) { + for (let t = monthIdx; t < monthIdx + monthStepCount; t += 1) { newQualityData[t][columnIdx] = getQFNullFill(); } return; } // This site/position/month/qf series exists, so add it into the quality data set // eslint-disable-next-line max-len - var seriesStepCount = posData[month][pkg][timeStep][derivedTableName].series[qf].data.length; + const seriesStepCount = posData[month][pkg][timeStep][derivedTableName].series[qf].data.length; // Series and month data lengths are identical as expected so we can stream // values directly in without matching timestamps if (ALLOW_POSITIONAL_TS_MAPPING) { if (seriesStepCount === monthStepCount) { - posData[month][pkg][timeStep][derivedTableName].series[qf].data.forEach(function (d, datumIdx) { - var t = datumIdx + monthIdx; + posData[month][pkg][timeStep][derivedTableName].series[qf].data.forEach((d, datumIdx) => { + const t = datumIdx + monthIdx; if (!Array.isArray(newQualityData[t][columnIdx])) { newQualityData[t][columnIdx] = []; } @@ -498,11 +491,11 @@ function generateTimeSeriesGraphData() { // exceed month step count if (ALLOW_POSITIONAL_TS_TRUNCATION) { if (seriesStepCount > monthStepCount) { - posData[month][pkg][timeStep][derivedTableName].series[qf].data.forEach(function (d, datumIdx) { + posData[month][pkg][timeStep][derivedTableName].series[qf].data.forEach((d, datumIdx) => { if (datumIdx >= monthStepCount) { return; } - var t = datumIdx + monthIdx; + const t = datumIdx + monthIdx; if (!Array.isArray(newQualityData[t][columnIdx])) { newQualityData[t][columnIdx] = []; } @@ -518,20 +511,20 @@ function generateTimeSeriesGraphData() { // Therefore, if we find a matching timestamp value, we can assume // that the next value won't be found before the last found index in the series data, // allowing us to optimize the search in this scenario. - var lastIdx = 0; + let lastIdx = 0; // eslint-disable-next-line max-len - var dtVarData = posData[month][pkg][timeStep][derivedTableName].series[dateTimeVariable].data; - for (var _t2 = monthIdx; _t2 < monthIdx + monthStepCount; _t2 += 1) { - var dataIdx = findTimestampIdx(dtVarData, newQualityData[_t2][0].getTime(), lastIdx); + const dtVarData = posData[month][pkg][timeStep][derivedTableName].series[dateTimeVariable].data; + for (let t = monthIdx; t < monthIdx + monthStepCount; t += 1) { + const dataIdx = findTimestampIdx(dtVarData, newQualityData[t][0].getTime(), lastIdx); if (dataIdx === -1) { - newQualityData[_t2][columnIdx] = getQFNullFill(); + newQualityData[t][columnIdx] = getQFNullFill(); } else { lastIdx = dataIdx + 1; - var d = typeof posData[month][pkg][timeStep][derivedTableName].series[qf].data[dataIdx] !== 'undefined' ? posData[month][pkg][timeStep][derivedTableName].series[qf].data[dataIdx] : null; - if (!Array.isArray(newQualityData[_t2][columnIdx])) { - newQualityData[_t2][columnIdx] = []; + const d = typeof posData[month][pkg][timeStep][derivedTableName].series[qf].data[dataIdx] !== 'undefined' ? posData[month][pkg][timeStep][derivedTableName].series[qf].data[dataIdx] : null; + if (!Array.isArray(newQualityData[t][columnIdx])) { + newQualityData[t][columnIdx] = []; } - newQualityData[_t2][columnIdx][qfIdx] = d; + newQualityData[t][columnIdx][qfIdx] = d; } } }); @@ -542,7 +535,7 @@ function generateTimeSeriesGraphData() { /** Apply generated values and return the result */ - var outData = { + const outData = { data: newData, qualityData: newQualityData, monthOffsets: newMonthOffsets, diff --git a/lib/workers/parseDomainHierarchy.js b/lib/workers/parseDomainHierarchy.js index 979c6f6a..09b93d9f 100644 --- a/lib/workers/parseDomainHierarchy.js +++ b/lib/workers/parseDomainHierarchy.js @@ -29,39 +29,39 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de } */ function parseDomainHierarchy(rawHierarchy) { - var worker = new _paralleljs.default(rawHierarchy); + const worker = new _paralleljs.default(rawHierarchy); return worker.spawn(function () { // Babel polyfills for worker logic function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - var inData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let inData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; // Recursive function to parse a deeply nest hierarchy object into a flat key/value object // where keys are location names and values are objects containing only those location // attributes the hierarchy affords us (type, description, and parent) - var recursiveParseHierarchy = function recursiveParseHierarchy(inHierarchy) { - var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var outHierarchy = {}; - var name = inHierarchy.locationParentHierarchy ? null : inHierarchy.locationName; - var description = inHierarchy.locationDescription || null; - var type = inHierarchy.locationType || null; + const recursiveParseHierarchy = function (inHierarchy) { + let parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + let outHierarchy = {}; + const name = inHierarchy.locationParentHierarchy ? null : inHierarchy.locationName; + const description = inHierarchy.locationDescription || null; + const type = inHierarchy.locationType || null; if ((description || '').includes('Not Used')) { return outHierarchy; } if (name !== null) { outHierarchy[name] = { - type: type, - description: description, - parent: parent + type, + description, + parent }; } - inHierarchy.locationChildHierarchy.forEach(function (subLocation) { + inHierarchy.locationChildHierarchy.forEach(subLocation => { outHierarchy = _extends({}, outHierarchy, recursiveParseHierarchy(subLocation, name)); }); return outHierarchy; }; - var outData = {}; - (inData.locationChildHierarchy || []).forEach(function (child) { + const outData = {}; + (inData.locationChildHierarchy || []).forEach(child => { // At the top level we only care about sites and don't want the HQ test site if (child.locationType !== 'SITE' || child.locationName === 'HQTW') { return; diff --git a/lib/workers/parseLocationsArray.js b/lib/workers/parseLocationsArray.js index bb8cc03c..992111b4 100644 --- a/lib/workers/parseLocationsArray.js +++ b/lib/workers/parseLocationsArray.js @@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { exports.default = parseLocationsArray; var _paralleljs = _interopRequireDefault(require("../vendor/paralleljs")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /** Worker - Parse Locations Array @@ -20,29 +21,19 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de } */ function parseLocationsArray() { - var locationsArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var worker = new _paralleljs.default(locationsArray); - return worker.spawn(function (inData) { - - // Babel polyfills for worker logic - function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } - function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } - function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } - function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - + let locationsArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + const worker = new _paralleljs.default(locationsArray); + return worker.spawn(inData => { // REST_LOCATIONS_API returns a lot of properties we don't need, so specify the ones we do. - var DEFAULT_LOCATION_PROPERTIES_WHITELIST = ['maximumElevation', 'minimumElevation', 'nationalLandCoverDatabase2001', 'plotDimensions', 'plotId', 'plotSize', 'plotSubtype', 'plotType', 'slopeAspect', 'slopeGradient', 'soilTypeOrder,']; + const DEFAULT_LOCATION_PROPERTIES_WHITELIST = ['maximumElevation', 'minimumElevation', 'nationalLandCoverDatabase2001', 'plotDimensions', 'plotId', 'plotSize', 'plotSubtype', 'plotType', 'slopeAspect', 'slopeGradient', 'soilTypeOrder,']; // A mapping of location property names to aliases to be worked with more easily - var RENAME_LOCATION_PROPERTIES = { + const RENAME_LOCATION_PROPERTIES = { nationalLandCoverDatabase2001: 'nlcdClass' }; // Enforce numeric types for select properties - var NUMERIC_LOCATION_PROPERTIES = ['maximumElevation', 'minimumElevation', 'plotSize', 'slopeAspect', 'slopeGradient']; + const NUMERIC_LOCATION_PROPERTIES = ['maximumElevation', 'minimumElevation', 'plotSize', 'slopeAspect', 'slopeGradient']; /** Function to parse a locationProperties value from a locations API response into an object @@ -56,37 +47,31 @@ function parseLocationsArray() { becomes: { fooBar: 123 } */ - var parseLocationProperties = function parseLocationProperties() { - var inProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; - var whiteList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_LOCATION_PROPERTIES_WHITELIST; + const parseLocationProperties = function () { + let inProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + let whiteList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_LOCATION_PROPERTIES_WHITELIST; // Function to convert a prop key into camelCase or, if applicable, a defined alias - var cleanPropKey = function cleanPropKey() { - var inKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var words = inKey.substr(10).replace(/[^A-Za-z0-9_ -]/g, '').replace(/[_-]/g, ' ').toLowerCase().split(' '); - var newPropKey = words.map(function (word, idx) { - return idx === 0 ? word : "".concat(word.substr(0, 1).toUpperCase()).concat(word.substr(1)); - }).join(''); + const cleanPropKey = function () { + let inKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; + const words = inKey.substr(10).replace(/[^A-Za-z0-9_ -]/g, '').replace(/[_-]/g, ' ').toLowerCase().split(' '); + const newPropKey = words.map((word, idx) => idx === 0 ? word : "".concat(word.substr(0, 1).toUpperCase()).concat(word.substr(1))).join(''); return RENAME_LOCATION_PROPERTIES[newPropKey] || newPropKey; }; // Add any aliases to the whitelist - var whiteListAliases = whiteList.filter(function (k) { - return Object.keys(RENAME_LOCATION_PROPERTIES).includes(k); - }).map(function (k) { - return RENAME_LOCATION_PROPERTIES[k]; - }); - var fullWhiteList = whiteList.concat(whiteListAliases); + const whiteListAliases = whiteList.filter(k => Object.keys(RENAME_LOCATION_PROPERTIES).includes(k)).map(k => RENAME_LOCATION_PROPERTIES[k]); + const fullWhiteList = whiteList.concat(whiteListAliases); // outProps is the structure we plan to fill with parsed variables and return - var outProps = {}; + const outProps = {}; if (!Array.isArray(inProps) || !inProps.length) { return outProps; } // Main loop over inProps - inProps.forEach(function (prop) { - var inPropKeys = Object.keys(prop); + inProps.forEach(prop => { + const inPropKeys = Object.keys(prop); if (inPropKeys.length !== 2 || !inPropKeys.includes('locationPropertyName') || !inPropKeys.includes('locationPropertyValue') || !(typeof prop.locationPropertyName === 'string')) { return; } - var propKey = cleanPropKey(prop.locationPropertyName); + const propKey = cleanPropKey(prop.locationPropertyName); if (propKey.length && (!fullWhiteList.length || fullWhiteList.includes(propKey))) { outProps[propKey] = NUMERIC_LOCATION_PROPERTIES.includes(propKey) ? Number.parseFloat(prop.locationPropertyValue) : prop.locationPropertyValue; } @@ -97,35 +82,29 @@ function parseLocationsArray() { /** Function to parse data for a single location response object */ - var parseLocationData = function parseLocationData() { - var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var _data$siteCode = data.siteCode, - siteCode = _data$siteCode === void 0 ? null : _data$siteCode, - _data$locationName = data.locationName, - name = _data$locationName === void 0 ? null : _data$locationName, - _data$locationType = data.locationType, - type = _data$locationType === void 0 ? null : _data$locationType, - _data$locationDescrip = data.locationDescription, - description = _data$locationDescrip === void 0 ? null : _data$locationDescrip, - _data$locationDecimal = data.locationDecimalLatitude, - latitude = _data$locationDecimal === void 0 ? null : _data$locationDecimal, - _data$locationDecimal2 = data.locationDecimalLongitude, - longitude = _data$locationDecimal2 === void 0 ? null : _data$locationDecimal2, - _data$locationPolygon = data.locationPolygon, - polygon = _data$locationPolygon === void 0 ? null : _data$locationPolygon, - _data$locationPropert = data.locationProperties, - locationProperties = _data$locationPropert === void 0 ? {} : _data$locationPropert, - _data$locationParent = data.locationParent, - parent = _data$locationParent === void 0 ? null : _data$locationParent, - children = data.locationChildren; - var _data$locationElevati = data.locationElevation, - elevation = _data$locationElevati === void 0 ? null : _data$locationElevati; - var parsed = _extends({ - name: name, - type: type, - description: description, - siteCode: siteCode, - parent: parent + const parseLocationData = function () { + let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const { + siteCode = null, + locationName: name = null, + locationType: type = null, + locationDescription: description = null, + locationDecimalLatitude: latitude = null, + locationDecimalLongitude: longitude = null, + locationPolygon: polygon = null, + locationProperties = {}, + locationParent: parent = null, + locationChildren: children + } = data; + let { + locationElevation: elevation = null + } = data; + const parsed = _extends({ + name, + type, + description, + siteCode, + parent }, parseLocationProperties(locationProperties)); if (Array.isArray(children) && children.length) { parsed.children = children; @@ -136,19 +115,16 @@ function parseLocationsArray() { } if (polygon !== null) { parsed.geometry = { - coordinates: polygon.coordinates.map(function (c) { - return [c.latitude, c.longitude]; - }) + coordinates: polygon.coordinates.map(c => [c.latitude, c.longitude]) }; // Fill in top-level elevation if not present but geometry with elevation is if (elevation === null) { - var points = 0; - var sum = polygon.coordinates.reduce(function (acc, cur) { + let points = 0; + const sum = polygon.coordinates.reduce((acc, cur) => { if (Number.isFinite(cur.elevation)) { points += 1; acc += cur.elevation; // eslint-disable-line no-param-reassign } - return acc; }, 0); if (points > 0) { @@ -160,17 +136,8 @@ function parseLocationsArray() { parsed.elevation = elevation; } // Have geometry but no lat/lon - calculate a basic lat/lon center for icon positioning - if (!['latitude', 'longitude'].every(function (k) { - return Object.keys(parsed).includes(k); - }) && parsed.geometry && parsed.geometry.coordinates) { - var _parsed$geometry$coor = parsed.geometry.coordinates.reduce(function (acc, cur) { - return [acc[0] + cur[0], acc[1] + cur[1]]; - }, [0, 0]).map(function (c) { - return c / parsed.geometry.coordinates.length; - }); - var _parsed$geometry$coor2 = _slicedToArray(_parsed$geometry$coor, 2); - parsed.latitude = _parsed$geometry$coor2[0]; - parsed.longitude = _parsed$geometry$coor2[1]; + if (!['latitude', 'longitude'].every(k => Object.keys(parsed).includes(k)) && parsed.geometry && parsed.geometry.coordinates) { + [parsed.latitude, parsed.longitude] = parsed.geometry.coordinates.reduce((acc, cur) => [acc[0] + cur[0], acc[1] + cur[1]], [0, 0]).map(c => c / parsed.geometry.coordinates.length); } // Special case: set plotType TOWER_SOIL_PLOTS (not present in locations API) // The 'SOIL_PLOT' type maps to FEATURES.TOWER_SOIL_PLOTS.matchLocationType in SiteMapUtils.js @@ -185,9 +152,11 @@ function parseLocationsArray() { /** Worker main loop - parse each entry in the locations array */ - var outData = {}; - inData.forEach(function (rawLocationData) { - var locationName = rawLocationData.locationName; + const outData = {}; + inData.forEach(rawLocationData => { + const { + locationName + } = rawLocationData; if (!locationName) { return; } diff --git a/lib/workers/parseTimeSeriesData.js b/lib/workers/parseTimeSeriesData.js index d09b40fd..7d10ab74 100644 --- a/lib/workers/parseTimeSeriesData.js +++ b/lib/workers/parseTimeSeriesData.js @@ -20,37 +20,33 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de @return {Object} series object to be applied to state (product/site/position/month/downloadPkg) */ function parseTimeSeriesData() { - var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - var worker = new _paralleljs.default(payload); - return worker.spawn(function (inData) { - - // Babel polyfills for worker logic - function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } - + let payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const worker = new _paralleljs.default(payload); + return worker.spawn(inData => { // Validate payload - var csv = inData.csv, - variables = inData.variables; + const { + csv, + variables + } = inData; if (typeof csv !== 'string' || !csv.length) { return {}; } - if (!variables || _typeof(variables) !== 'object' || !Object.keys(variables).length) { + if (!variables || typeof variables !== 'object' || !Object.keys(variables).length) { return {}; } - var rows = csv.split('\n'); + const rows = csv.split('\n'); // Functions to convert a value to the proper JS data type given a NEON variable dataType - var castFloat = function castFloat(v) { - var cast = parseFloat(v, 10); + const castFloat = v => { + const cast = parseFloat(v, 10); return Number.isNaN(cast) ? null : cast; }; - var castInt = function castInt(v) { - var cast = parseInt(v, 10); + const castInt = v => { + const cast = parseInt(v, 10); return Number.isNaN(cast) ? null : cast; }; - var DATA_TYPE_SETTERS = { - dateTime: function dateTime(v) { - return typeof v === 'string' ? v.replace(/"/g, '') : v; - }, + const DATA_TYPE_SETTERS = { + dateTime: v => typeof v === 'string' ? v.replace(/"/g, '') : v, real: castFloat, 'signed integer': castInt, 'unsigned integer': castInt @@ -58,15 +54,13 @@ function parseTimeSeriesData() { // Function copied from TimeSeriesViewerContext // Expands a nullable high/low value range based on a single new value - var getUpdatedValueRange = function getUpdatedValueRange(existingRange, newValue) { - var arrayVal = Array.isArray(newValue) ? newValue : [newValue]; - if (arrayVal.some(function (v) { - return typeof v !== 'number'; - })) { + const getUpdatedValueRange = (existingRange, newValue) => { + const arrayVal = Array.isArray(newValue) ? newValue : [newValue]; + if (arrayVal.some(v => typeof v !== 'number')) { return existingRange; } - var newRange = [existingRange[0], existingRange[1]]; - arrayVal.forEach(function (v) { + const newRange = [existingRange[0], existingRange[1]]; + arrayVal.forEach(v => { if (newRange[0] === null || newRange[0] > v) { newRange[0] = v; } @@ -76,22 +70,22 @@ function parseTimeSeriesData() { }); return newRange; }; - var series = {}; - var fields = []; + const series = {}; + const fields = []; // Ignore any series that don't map to a known variable. - var skipIndexes = []; - rows[0].split(',').forEach(function (fieldName, idx) { + const skipIndexes = []; + rows[0].split(',').forEach((fieldName, idx) => { if (!variables[fieldName]) { skipIndexes.push(idx); return; } - var dataType = variables[fieldName].dataType; - var field = { - fieldName: fieldName, - setType: DATA_TYPE_SETTERS[dataType] ? DATA_TYPE_SETTERS[dataType] : function (v) { - return v; - } + const { + dataType + } = variables[fieldName]; + const field = { + fieldName, + setType: DATA_TYPE_SETTERS[dataType] ? DATA_TYPE_SETTERS[dataType] : v => v }; fields.push(field); series[fieldName] = { @@ -104,15 +98,13 @@ function parseTimeSeriesData() { }); // Visit each row and column to transpose values into columnar format in series - rows.slice(1).forEach(function (row) { + rows.slice(1).forEach(row => { if (!row.length) { return; } - var values = row.split(','); - values.filter(function (value, idx) { - return !skipIndexes.includes(idx); - }).forEach(function (value, idx) { - var typedValue = fields[idx].setType(value); + const values = row.split(','); + values.filter((value, idx) => !skipIndexes.includes(idx)).forEach((value, idx) => { + const typedValue = fields[idx].setType(value); series[fields[idx].fieldName].data.push(typedValue); // Don't bother updating the range for non-numerical series and quality flags if (typeof typedValue === 'number' && !/QF$/.test(fields[idx].fieldName)) { @@ -124,13 +116,11 @@ function parseTimeSeriesData() { }); // Loop across all numeric non-quality-flag series again to calculate series variance - Object.keys(series).filter(function (fieldName) { - return !/QF$/.test(fieldName) && series[fieldName].count > 0; - }).forEach(function (fieldName) { - var dataType = variables[fieldName].dataType; - var setType = DATA_TYPE_SETTERS[dataType] ? DATA_TYPE_SETTERS[dataType] : function (v) { - return v; - }; + Object.keys(series).filter(fieldName => !/QF$/.test(fieldName) && series[fieldName].count > 0).forEach(fieldName => { + const { + dataType + } = variables[fieldName]; + const setType = DATA_TYPE_SETTERS[dataType] ? DATA_TYPE_SETTERS[dataType] : v => v; if (!['real', 'signed integer', 'unsigned integer'].includes(dataType)) { return; } @@ -138,14 +128,14 @@ function parseTimeSeriesData() { series[fieldName].variance = 0; return; } - var mean = series[fieldName].sum / series[fieldName].count; - var sumOfSquares = 0; - series[fieldName].data.forEach(function (value) { + const mean = series[fieldName].sum / series[fieldName].count; + let sumOfSquares = 0; + series[fieldName].data.forEach(value => { if (value === null) { return; } - var typedValue = setType(value); - sumOfSquares += Math.pow(typedValue - mean, 2); + const typedValue = setType(value); + sumOfSquares += (typedValue - mean) ** 2; }); series[fieldName].variance = sumOfSquares / series[fieldName].count; }); diff --git a/package-lock.json b/package-lock.json index dec4cf2d..32dac2cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,37 +1,37 @@ { "name": "portal-core-components", - "version": "2.6.0", + "version": "2.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "portal-core-components", - "version": "2.6.0", + "version": "2.7.0", "dependencies": { "@date-io/moment": "^1.3.13", - "@fortawesome/fontawesome-svg-core": "^6.4.0", - "@fortawesome/free-regular-svg-icons": "^6.4.0", - "@fortawesome/free-solid-svg-icons": "^6.4.0", + "@fortawesome/fontawesome-svg-core": "^6.5.1", + "@fortawesome/free-regular-svg-icons": "^6.5.1", + "@fortawesome/free-solid-svg-icons": "^6.5.1", "@fortawesome/react-fontawesome": "^0.2.0", "@material-ui/core": "^4.12.4", "@material-ui/icons": "^4.11.3", "@material-ui/lab": "~4.0.0-alpha.61", - "@material-ui/pickers": "^3.3.10", + "@material-ui/pickers": "^3.3.11", "@material-ui/styles": "^4.11.5", "@stomp/rx-stomp": "^2.0.0", "@stomp/stompjs": "^7.0.0", - "@types/dateformat": "^5.0.0", - "@types/lodash": "^4.14.192", - "@types/react": "^17.0.56", - "@types/react-copy-to-clipboard": "^5.0.4", - "@types/react-dom": "^17.0.19", + "@types/dateformat": "^5.0.2", + "@types/lodash": "^4.14.202", + "@types/react": "^17.0.73", + "@types/react-copy-to-clipboard": "^5.0.7", + "@types/react-dom": "^17.0.25", "@types/react-router": "^5.1.20", "@types/react-router-dom": "^5.3.3", - "@types/sockjs-client": "^1.5.1", - "@types/ua-parser-js": "^0.7.36", - "@types/wicg-file-system-access": "^2020.9.5", - "clsx": "^1.2.1", - "core-js": "^3.30.0", + "@types/sockjs-client": "^1.5.4", + "@types/ua-parser-js": "^0.7.39", + "@types/wicg-file-system-access": "^2023.10.4", + "clsx": "^2.0.0", + "core-js": "^3.34.0", "d3-drag": "^3.0.0", "d3-selection": "^3.0.0", "d3-transition": "^3.0.1", @@ -39,74 +39,75 @@ "dom-to-image": "^2.6.0", "dygraphs": "2.1.0", "file-saver": "^2.0.5", - "highlight.js": "^11.7.0", + "highlight.js": "^11.9.0", "history": "^5.3.0", - "html-react-parser": "^3.0.15", + "html-react-parser": "^5.0.7", "leaflet": "~1.6.0", "lodash": "^4.17.21", "material-table": "^1.69.3", "moment": "^2.29.4", "node-lzw": "^0.3.1", "papaparse": "^5.4.1", - "pdfjs-dist": "^3.5.141", + "pdfjs-dist": "~3.5.141", "prop-types": "^15.8.1", "react": "^17.0.2", "react-copy-to-clipboard": "^5.1.0", "react-dom": "^17.0.2", - "react-error-boundary": "^4.0.3", + "react-error-boundary": "^4.0.12", "react-id-generator": "^3.0.2", "react-leaflet": "^2.8.0", "react-leaflet-grouped-layer-control": "0.0.13", - "react-router": "^6.10.0", - "react-router-dom": "^6.10.0", - "react-select": "^5.7.2", + "react-router": "^6.21.0", + "react-router-dom": "^6.21.0", + "react-select": "^5.8.0", "redux": "^4.2.1", "redux-observable": "^2.0.0", - "rxjs": "^7.8.0", + "rxjs": "^7.8.1", "sockjs-client": "^1.6.1", "tinycolor2": "^1.6.0", - "ua-parser-js": "^1.0.35", - "universal-cookie": "^4.0.4", - "zod": "^3.21.4" + "ua-parser-js": "^1.0.37", + "universal-cookie": "^6.1.1", + "zod": "^3.22.4" }, "devDependencies": { - "@babel/cli": "^7.21.0", - "@babel/core": "^7.21.4", + "@babel/cli": "^7.23.4", + "@babel/core": "^7.23.6", "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-proposal-object-rest-spread": "^7.20.7", - "@babel/plugin-transform-object-assign": "^7.18.6", - "@babel/preset-env": "^7.21.4", - "@babel/preset-react": "^7.18.6", - "@babel/preset-typescript": "^7.21.4", - "@jest/globals": "^29.5.0", + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", + "@babel/plugin-transform-object-assign": "^7.23.3", + "@babel/preset-env": "^7.23.6", + "@babel/preset-react": "^7.23.3", + "@babel/preset-typescript": "^7.23.3", + "@jest/globals": "^29.7.0", "@testing-library/react-hooks": "^8.0.1", - "@typescript-eslint/parser": "^5.57.1", - "commander": "^9.5.0", - "cssnano": "^5.1.15", - "eslint": "^8.37.0", + "@typescript-eslint/parser": "~5.62.0", + "commander": "^11.1.0", + "cssnano": "^6.0.2", + "eslint": "^8.55.0", "eslint-config-airbnb": "^19.0.4", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-react": "^7.32.2", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsx-a11y": "^6.8.0", + "eslint-plugin-react": "^7.33.2", "express": "^4.18.2", "html-loader": "^4.2.0", - "jest-canvas-mock": "^2.5.0", - "jsdom": "^20.0.3", - "node-fetch": "^3.3.1", - "postcss": "^8.4.21", - "prettier": "^2.8.7", + "jest-canvas-mock": "^2.5.2", + "jsdom": "^23.0.1", + "node-fetch": "^3.3.2", + "postcss": "^8.4.32", + "prettier": "^3.1.1", "react-scripts": "^5.0.1", "react-test-renderer": "^17.0.2", "typescript": "~4.9.5", "worker-loader": "^3.0.8" }, "peerDependencies": { - "commander": "^9.5.0", - "cssnano": "^5.1.15", - "jsdom": "^20.0.3", - "node-fetch": "^3.3.1", - "postcss": "^8.4.21", - "prettier": "^2.8.7", + "commander": "^11.1.0", + "cssnano": "^6.0.2", + "jsdom": "^23.0.1", + "node-fetch": "^3.3.2", + "postcss": "^8.4.32", + "prettier": "^3.1.1", "worker-loader": "^3.0.8" }, "peerDependenciesMeta": { @@ -133,13 +134,34 @@ } } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.1.0", + "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { @@ -147,14 +169,14 @@ } }, "node_modules/@babel/cli": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.21.0.tgz", - "integrity": "sha512-xi7CxyS8XjSyiwUGCfwf+brtJxjW1/ZTcBUkP10xawIEXLX5HzLn+3aXkgxozcP2UhRhtKTmQurw9Uaes7jZrA==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.23.4.tgz", + "integrity": "sha512-j3luA9xGKCXVyCa5R7lJvOMM+Kc2JEnAEIgz2ggtjQ/j5YUVgfsg/WsG95bbsgq7YLHuiCOzMnoSasuY16qiCw==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.17", "commander": "^4.0.1", - "convert-source-map": "^1.1.0", + "convert-source-map": "^2.0.0", "fs-readdir-recursive": "^1.1.0", "glob": "^7.2.0", "make-dir": "^2.1.0", @@ -185,46 +207,47 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", - "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/compat-data": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.4.tgz", - "integrity": "sha512-/DYyDpeCfaVinT40FPGdkkb+lYSKvsVuMjDAG7jPOWWiM1ibOaB9CXJAlc4d1QpP/U2q2P9jbrSlClKSErd55g==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", + "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.21.4.tgz", - "integrity": "sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.6.tgz", + "integrity": "sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.21.4", - "@babel/generator": "^7.21.4", - "@babel/helper-compilation-targets": "^7.21.4", - "@babel/helper-module-transforms": "^7.21.2", - "@babel/helpers": "^7.21.0", - "@babel/parser": "^7.21.4", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.4", - "@babel/types": "^7.21.4", - "convert-source-map": "^1.7.0", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-compilation-targets": "^7.23.6", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helpers": "^7.23.6", + "@babel/parser": "^7.23.6", + "@babel/template": "^7.22.15", + "@babel/traverse": "^7.23.6", + "@babel/types": "^7.23.6", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2", - "semver": "^6.3.0" + "json5": "^2.2.3", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -235,20 +258,20 @@ } }, "node_modules/@babel/eslint-parser": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.21.3.tgz", - "integrity": "sha512-kfhmPimwo6k4P8zxNs8+T7yR44q1LdpsZdE1NkCsVlfiuTPRfnGgjaF8Qgug9q9Pou17u6wneYF0lDCZJATMFg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.23.3.tgz", + "integrity": "sha512-9bTuNlyx7oSstodm1cR1bECj4fkiknsDa1YniISkJemMY3DGhJNYBECbe6QD/q54mp2J8VO66jW3/7uP//iFCw==", "dev": true, "dependencies": { "@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1", "eslint-visitor-keys": "^2.1.0", - "semver": "^6.3.0" + "semver": "^6.3.1" }, "engines": { "node": "^10.13.0 || ^12.13.0 || >=14.0.0" }, "peerDependencies": { - "@babel/core": ">=7.11.0", + "@babel/core": "^7.11.0", "eslint": "^7.5.0 || ^8.0.0" } }, @@ -262,12 +285,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.4.tgz", - "integrity": "sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", "dev": true, "dependencies": { - "@babel/types": "^7.21.4", + "@babel/types": "^7.23.6", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -276,78 +299,61 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", - "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz", - "integrity": "sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.22.15.tgz", + "integrity": "sha512-QkBXwGgaoC2GtGZRoma6kv7Szfv06khvhFav67ZExau2RaXzy8MpHSMO2PNoP2XtmQphJQRHFfg77Bq731Yizw==", "dev": true, "dependencies": { - "@babel/helper-explode-assignable-expression": "^7.18.6", - "@babel/types": "^7.18.9" + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.4.tgz", - "integrity": "sha512-Fa0tTuOXZ1iL8IeDFUWCzjZcn+sJGd9RZdH9esYVjEejGmzf+FFYQpMi/kZUk2kPy/q1H3/GPw7np8qar/stfg==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.21.4", - "@babel/helper-validator-option": "^7.21.0", - "browserslist": "^4.21.3", + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", "lru-cache": "^5.1.1", - "semver": "^6.3.0" + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.21.4.tgz", - "integrity": "sha512-46QrX2CQlaFRF4TkwfTt6nJD7IHq8539cCL7SDpqWSDeJKY1xylKKY5F/33mJhLZ3mFvKv2gGrVS6NkyF6qs+Q==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.6.tgz", + "integrity": "sha512-cBXU1vZni/CpGF29iTu4YRbOZt3Wat6zCoMDxRF1MayiEc4URxOj31tT65HUM0CRpMowA3HCJaAOVOUnMf96cw==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.21.0", - "@babel/helper-member-expression-to-functions": "^7.21.0", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-replace-supers": "^7.20.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/helper-split-export-declaration": "^7.18.6" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-member-expression-to-functions": "^7.23.0", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.20", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -357,13 +363,14 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.21.4.tgz", - "integrity": "sha512-M00OuhU+0GyZ5iBBN9czjugzWrEq2vDpf/zCYHxxf93ul/Q5rv+a5h+/+0WnI1AebHNVtl5bFV0qsJoH23DbfA==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz", + "integrity": "sha512-29FkPLFjn4TPEa3RE7GpW+qbE8tlsu3jntNYNfcGsc49LphF1PQIiD+vMZ1z1xVOKt+93khA9tc2JBs3kBjA7w==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "regexpu-core": "^5.3.1" + "@babel/helper-annotate-as-pure": "^7.22.5", + "regexpu-core": "^5.3.1", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -373,141 +380,127 @@ } }, "node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz", - "integrity": "sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.4.tgz", + "integrity": "sha512-QcJMILQCu2jm5TFPGA3lCpJJTeEP+mqeXooG/NZbg/h5FTFi6V0+99ahlRsW8/kRLyb24LZVCCiclDedhLKcBA==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.17.7", - "@babel/helper-plugin-utils": "^7.16.7", + "@babel/helper-compilation-targets": "^7.22.6", + "@babel/helper-plugin-utils": "^7.22.5", "debug": "^4.1.1", "lodash.debounce": "^4.0.8", - "resolve": "^1.14.2", - "semver": "^6.1.2" + "resolve": "^1.14.2" }, "peerDependencies": { - "@babel/core": "^7.4.0-0" + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/helper-explode-assignable-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz", - "integrity": "sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==", - "dev": true, - "dependencies": { - "@babel/types": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-function-name": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz", - "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/template": "^7.20.7", - "@babel/types": "^7.21.0" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.21.0.tgz", - "integrity": "sha512-Muu8cdZwNN6mRRNG6lAYErJ5X3bRevgYR2O8wN0yn7jJSnGDu6eG59RfT29JHxGUovyfrh6Pj0XzmR7drNVL3Q==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz", + "integrity": "sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==", "dev": true, "dependencies": { - "@babel/types": "^7.21.0" + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz", - "integrity": "sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", "dependencies": { - "@babel/types": "^7.21.4" + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.21.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.21.2.tgz", - "integrity": "sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.20.2", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.2", - "@babel/types": "^7.21.2" + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz", - "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", + "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", - "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz", - "integrity": "sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.22.20.tgz", + "integrity": "sha512-pBGyV4uBqOns+0UvhsTO8qgl8hO89PmiDYv+/COyp1aeMcmfrfruz+/nCMFiYyFF/Knn0yfrC85ZzNFjembFTw==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-wrap-function": "^7.18.9", - "@babel/types": "^7.18.9" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-wrap-function": "^7.22.20" }, "engines": { "node": ">=6.9.0" @@ -517,119 +510,118 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz", - "integrity": "sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.20.tgz", + "integrity": "sha512-qsW0In3dbwQUbK8kejJ4R7IHVGwHJlV6lpG6UA7a9hSa2YEiAib+N1T2kr6PEeUT+Fl7najmSOS6SmAwCHK6Tw==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-member-expression-to-functions": "^7.20.7", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-member-expression-to-functions": "^7.22.15", + "@babel/helper-optimise-call-expression": "^7.22.5" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", - "integrity": "sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "dependencies": { - "@babel/types": "^7.20.2" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz", - "integrity": "sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", + "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", "dev": true, "dependencies": { - "@babel/types": "^7.20.0" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.19.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", - "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz", - "integrity": "sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz", - "integrity": "sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz", + "integrity": "sha512-pms/UwkOpnQe/PDAEdV/d7dVCoBbB+R4FvYoHGZz+4VPcg7RtYy2KP7S2lbuWM6FCSgob5wshfGESbC/hzNXZw==", "dev": true, "dependencies": { - "@babel/helper-function-name": "^7.19.0", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.5", - "@babel/types": "^7.20.5" + "@babel/helper-function-name": "^7.22.5", + "@babel/template": "^7.22.15", + "@babel/types": "^7.22.19" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.21.0.tgz", - "integrity": "sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.6.tgz", + "integrity": "sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA==", "dev": true, "dependencies": { - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.21.0", - "@babel/types": "^7.21.0" + "@babel/template": "^7.22.15", + "@babel/traverse": "^7.23.6", + "@babel/types": "^7.23.6" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -637,9 +629,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.4.tgz", - "integrity": "sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -649,12 +641,12 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz", - "integrity": "sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.23.3.tgz", + "integrity": "sha512-iRkKcCqb7iGnq9+3G6rZ+Ciz5VywC4XNRHe57lKM+jOeYAoR0lVqdeeDRfh0tQcTfw/+vBhHn926FmQhLtlFLQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -664,14 +656,14 @@ } }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.20.7.tgz", - "integrity": "sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.23.3.tgz", + "integrity": "sha512-WwlxbfMNdVEpQjZmK5mhm7oSwD3dS6eU+Iwsi4Knl9wAletWem7kaRsGOG+8UEbRyqxY4SS5zvtfXwX+jMxUwQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/plugin-proposal-optional-chaining": "^7.20.7" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-transform-optional-chaining": "^7.23.3" }, "engines": { "node": ">=6.9.0" @@ -680,28 +672,27 @@ "@babel/core": "^7.13.0" } }, - "node_modules/@babel/plugin-proposal-async-generator-functions": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz", - "integrity": "sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==", + "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.23.3.tgz", + "integrity": "sha512-XaJak1qcityzrX0/IU5nKHb34VaibwP3saKqG6a/tppelgllOH13LUann4ZCIBcVOeE6H18K4Vx9QKkVww3z/w==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-remap-async-to-generator": "^7.18.9", - "@babel/plugin-syntax-async-generators": "^7.8.4" + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@babel/core": "^7.0.0" } }, "node_modules/@babel/plugin-proposal-class-properties": { "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.", "dev": true, "dependencies": { "@babel/helper-create-class-features-plugin": "^7.18.6", @@ -714,98 +705,18 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-class-static-block": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.21.0.tgz", - "integrity": "sha512-XP5G9MWNUskFuP30IfFSEFB0Z6HzLIUcjYM4bYOPHXl7eiJ9HFv8tWj6TXTN5QODiEhDZAeI4hLok2iHFFV4hw==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.21.0", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-class-static-block": "^7.14.5" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.12.0" - } - }, "node_modules/@babel/plugin-proposal-decorators": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.21.0.tgz", - "integrity": "sha512-MfgX49uRrFUTL/HvWtmx3zmpyzMMr4MTj3d527MLlr/4RTT9G/ytFFP7qet2uM2Ve03b+BkpWUpK+lRXnQ+v9w==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.21.0", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-replace-supers": "^7.20.7", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/plugin-syntax-decorators": "^7.21.0" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-dynamic-import": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz", - "integrity": "sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-dynamic-import": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-export-namespace-from": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz", - "integrity": "sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9", - "@babel/plugin-syntax-export-namespace-from": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-json-strings": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz", - "integrity": "sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-json-strings": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz", - "integrity": "sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.23.6.tgz", + "integrity": "sha512-D7Ccq9LfkBFnow3azZGJvZYgcfeqAw3I1e5LoTpj6UKIFQilh8yqXsIGcRIqbBdsPWIz+Ze7ZZfggSj62Qp+Fg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + "@babel/helper-create-class-features-plugin": "^7.23.6", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.20", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/plugin-syntax-decorators": "^7.23.3" }, "engines": { "node": ">=6.9.0" @@ -818,6 +729,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.18.6", @@ -834,6 +746,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz", "integrity": "sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.18.6", @@ -850,6 +763,7 @@ "version": "7.20.7", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz", "integrity": "sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.", "dev": true, "dependencies": { "@babel/compat-data": "^7.20.5", @@ -865,26 +779,11 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-optional-catch-binding": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz", - "integrity": "sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-proposal-optional-chaining": { "version": "7.21.0", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz", "integrity": "sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.20.2", @@ -902,6 +801,7 @@ "version": "7.18.6", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz", "integrity": "sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.", "dev": true, "dependencies": { "@babel/helper-create-class-features-plugin": "^7.18.6", @@ -915,9 +815,10 @@ } }, "node_modules/@babel/plugin-proposal-private-property-in-object": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0.tgz", - "integrity": "sha512-ha4zfehbJjc5MmXBlHec1igel5TJXXLDDRbuJ4+XT2TJcyD9/V1919BA8gMvsdHcNMBy4WBUBiRb3nw/EQUtBw==", + "version": "7.21.11", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.11.tgz", + "integrity": "sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.18.6", @@ -932,22 +833,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-proposal-unicode-property-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz", - "integrity": "sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==", - "dev": true, - "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-syntax-async-generators": { "version": "7.8.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", @@ -1000,12 +885,12 @@ } }, "node_modules/@babel/plugin-syntax-decorators": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.21.0.tgz", - "integrity": "sha512-tIoPpGBR8UuM4++ccWN3gifhVvQu7ZizuR1fklhRJrd5ewgbkUS+0KVFeWWxELtn18NTLoW32XV7zyOgIAiz+w==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.23.3.tgz", + "integrity": "sha512-cf7Niq4/+/juY67E0PbgH0TDhLQ5J7zS8C/Q5FFx+DWyrRa9sUQdTXkjqKu8zGvuqr7vw1muKiukseihU+PJDA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1039,12 +924,12 @@ } }, "node_modules/@babel/plugin-syntax-flow": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.21.4.tgz", - "integrity": "sha512-l9xd3N+XG4fZRxEP3vXdK6RW7vN1Uf5dxzRC/09wV86wqZ/YYQooBIGNsiRdfNR3/q2/5pPzV4B54J/9ctX5jw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.23.3.tgz", + "integrity": "sha512-YZiAIpkJAwQXBJLIQbRFayR5c+gJ35Vcz3bg954k7cd73zqjvhacJuL9RbrzPz8qPmZdgqP6EUKwy0PCNhaaPA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1054,12 +939,27 @@ } }, "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz", - "integrity": "sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.23.3.tgz", + "integrity": "sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.23.3.tgz", + "integrity": "sha512-pawnE0P9g10xgoP7yKr6CK63K2FMsTE+FZidZO/1PwRdzmAPVs+HS1mAURUsgaoxammTJvULUdIkEK0gOcU2tA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1093,12 +993,12 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.21.4.tgz", - "integrity": "sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", + "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1210,12 +1110,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.21.4.tgz", - "integrity": "sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz", + "integrity": "sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1224,30 +1124,29 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.20.7.tgz", - "integrity": "sha512-3poA5E7dzDomxj9WXWwuD6A5F3kc7VXwIJO+E+J8qtDtS+pXPAhrgEyh+9GBwBgPq1Z+bB+/JD60lp5jsN7JPQ==", + "node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@babel/core": "^7.0.0" } }, - "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.20.7.tgz", - "integrity": "sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q==", + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.23.3.tgz", + "integrity": "sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-remap-async-to-generator": "^7.18.9" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1256,13 +1155,16 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz", - "integrity": "sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==", + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.4.tgz", + "integrity": "sha512-efdkfPhHYTtn0G6n2ddrESE91fgXxjlqLsnUtPWnJs4a4mZIbUaK7ffqKIIUKXSHwcDvaCVX6GXkaJJFqtX7jw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.20", + "@babel/plugin-syntax-async-generators": "^7.8.4" }, "engines": { "node": ">=6.9.0" @@ -1271,13 +1173,15 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.21.0.tgz", - "integrity": "sha512-Mdrbunoh9SxwFZapeHVrwFmri16+oYotcZysSzhNIVDwIAb1UV+kvnxULSYq9J3/q5MDG+4X6w8QVgD1zhBXNQ==", + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.23.3.tgz", + "integrity": "sha512-A7LFsKi4U4fomjqXJlZg/u0ft/n8/7n7lpffUP/ZULx/DtV9SGlNKZolHH6PE8Xl1ngCc0M11OaeZptXVkfKSw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-remap-async-to-generator": "^7.22.20" }, "engines": { "node": ">=6.9.0" @@ -1286,21 +1190,13 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-classes": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.21.0.tgz", - "integrity": "sha512-RZhbYTCEUAe6ntPehC4hlslPWosNHDox+vAs4On/mCLRLfoDVHf6hVEd7kuxr1RnHwJmxFfUM3cZiZRmPxJPXQ==", + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.23.3.tgz", + "integrity": "sha512-vI+0sIaPIO6CNuM9Kk5VmXcMVRiOpDh7w2zZt9GXzmE/9KD70CUEVhvPR/etAeNK/FAEkhxQtXOzVF3EuRL41A==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.21.0", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-replace-supers": "^7.20.7", - "@babel/helper-split-export-declaration": "^7.18.6", - "globals": "^11.1.0" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1309,14 +1205,13 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.20.7.tgz", - "integrity": "sha512-Lz7MvBK6DTjElHAmfu6bfANzKcxpyNPeYBGEafyA6E5HtRpjpZwU+u7Qrgz/2OR0z+5TvKYbPdphfSaAcZBrYQ==", + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.4.tgz", + "integrity": "sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/template": "^7.20.7" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1325,13 +1220,14 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.21.3.tgz", - "integrity": "sha512-bp6hwMFzuiE4HqYEyoGJ/V2LeIWn+hLVKc4pnj++E5XQptwhtcGmSayM029d/j2X1bPKGTlsyPwAubuU22KhMA==", + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.23.3.tgz", + "integrity": "sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-create-class-features-plugin": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1340,29 +1236,38 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz", - "integrity": "sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==", + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.23.4.tgz", + "integrity": "sha512-nsWu/1M+ggti1SOALj3hfx5FXzAY06fwPJsUZD4/A5e1bWi46VUIWtD+kOX6/IdhXGsXBWllLFDSnqSCdUNydQ==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-create-class-features-plugin": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-class-static-block": "^7.14.5" }, "engines": { "node": ">=6.9.0" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@babel/core": "^7.12.0" } }, - "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz", - "integrity": "sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "node_modules/@babel/plugin-transform-classes": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.5.tgz", + "integrity": "sha512-jvOTR4nicqYC9yzOHIhXG5emiFEOpappSJAl73SDSEDcybD+Puuze8Tnpb9p9qEyYup24tq891gkaygIFvWDqg==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.20", + "@babel/helper-split-export-declaration": "^7.22.6", + "globals": "^11.1.0" }, "engines": { "node": ">=6.9.0" @@ -1371,14 +1276,14 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz", - "integrity": "sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==", + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz", + "integrity": "sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw==", "dev": true, "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/template": "^7.22.15" }, "engines": { "node": ">=6.9.0" @@ -1387,14 +1292,13 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-flow-strip-types": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.21.0.tgz", - "integrity": "sha512-FlFA2Mj87a6sDkW4gfGrQQqwY/dLlBAyJa2dJEZ+FHXUVHBflO2wyKvg+OOEzXfrKYIa4HWl0mgmbCzt0cMb7w==", + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.3.tgz", + "integrity": "sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-flow": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1403,13 +1307,14 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-for-of": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.21.0.tgz", - "integrity": "sha512-LlUYlydgDkKpIY7mcBWvyPPmMcOphEyYA27Ef4xpbh1IiDNLr0kZsos2nf92vz3IccvJI25QUwp86Eo5s6HmBQ==", + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.23.3.tgz", + "integrity": "sha512-vgnFYDHAKzFaTVp+mneDsIEbnJ2Np/9ng9iviHw3P/KVcgONxpNULEW/51Z/BaFojG2GI2GwwXck5uV1+1NOYQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-create-regexp-features-plugin": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1418,15 +1323,13 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-function-name": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz", - "integrity": "sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==", + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.23.3.tgz", + "integrity": "sha512-RrqQ+BQmU3Oyav3J+7/myfvRCq7Tbz+kKLLshUmMwNlDHExbGL7ARhajvoBJEvc+fCguPPu887N+3RRXBVKZUA==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.18.9", - "@babel/helper-function-name": "^7.18.9", - "@babel/helper-plugin-utils": "^7.18.9" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1435,13 +1338,14 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-literals": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz", - "integrity": "sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==", + "node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.23.4.tgz", + "integrity": "sha512-V6jIbLhdJK86MaLh4Jpghi8ho5fGzt3imHOBu/x0jlBaPYqDoWz4RDXjmMOfnh+JWNaQleEAByZLV0QzBT4YQQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" }, "engines": { "node": ">=6.9.0" @@ -1450,13 +1354,14 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz", - "integrity": "sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==", + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.23.3.tgz", + "integrity": "sha512-5fhCsl1odX96u7ILKHBj4/Y8vipoqwsJMh4csSA8qFfxrZDEA4Ssku2DyNvMJSmZNOEBT750LfFPbtrnTP90BQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1465,14 +1370,14 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.20.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.20.11.tgz", - "integrity": "sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g==", + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.23.4.tgz", + "integrity": "sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" }, "engines": { "node": ">=6.9.0" @@ -1481,15 +1386,14 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.21.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.21.2.tgz", - "integrity": "sha512-Cln+Yy04Gxua7iPdj6nOV96smLGjpElir5YwzF0LBPKoPlLDNJePNlrGGaybAJkd0zKRnOVXOgizSqPYMNYkzA==", + "node_modules/@babel/plugin-transform-flow-strip-types": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.23.3.tgz", + "integrity": "sha512-26/pQTf9nQSNVJCrLB1IkHUKyPxR+lMrH2QDPG89+Znu9rAMbtrybdbWeE9bb7gzjmE5iXHEY+e0HUwM6Co93Q==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.21.2", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-simple-access": "^7.20.2" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-flow": "^7.23.3" }, "engines": { "node": ">=6.9.0" @@ -1498,16 +1402,144 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.20.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.20.11.tgz", - "integrity": "sha512-vVu5g9BPQKSFEmvt2TA4Da5N+QVS66EX21d8uoOihC+OCpUoGvzVsXeqFdtAEfVa5BILAeFt+U7yVmLbQnAJmw==", + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.23.6.tgz", + "integrity": "sha512-aYH4ytZ0qSuBbpfhuofbg/e96oQ7U2w1Aw/UQmKT+1l39uEhUPoFS3fHevDc1G0OvewyDudfMKY1OulczHzWIw==", "dev": true, "dependencies": { - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-validator-identifier": "^7.19.1" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.23.3.tgz", + "integrity": "sha512-I1QXp1LxIvt8yLaib49dRW5Okt7Q4oaxao6tFVKS/anCdEOMtYwWVKoiOA1p34GOWIZjUK0E+zCp7+l1pfQyiw==", + "dev": true, + "dependencies": { + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-json-strings": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.23.4.tgz", + "integrity": "sha512-81nTOqM1dMwZ/aRXQ59zVubN9wHGqk6UtqRK+/q+ciXmRy8fSolhGVvG09HHRGo4l6fr/c4ZhXUQH0uFW7PZbg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-json-strings": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.23.3.tgz", + "integrity": "sha512-wZ0PIXRxnwZvl9AYpqNUxpZ5BiTGrYt7kueGQ+N5FiQ7RCOD4cm8iShd6S6ggfVIWaJf2EMk8eRzAh52RfP4rQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.23.4.tgz", + "integrity": "sha512-Mc/ALf1rmZTP4JKKEhUwiORU+vcfarFVLfcFiolKUo6sewoxSEgl36ak5t+4WamRsNr6nzjZXQjM35WsU+9vbg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.23.3.tgz", + "integrity": "sha512-sC3LdDBDi5x96LA+Ytekz2ZPk8i/Ck+DEuDbRAll5rknJ5XRTSaPKEYwomLcs1AA8wg9b3KjIQRsnApj+q51Ag==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.23.3.tgz", + "integrity": "sha512-vJYQGxeKM4t8hYCKVBlZX/gtIY2I7mRGFNcm85sgXGMTBcoV3QdVtdpbcWEbzbfUIUZKwvgFT82mRvaQIebZzw==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.3.tgz", + "integrity": "sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA==", + "dev": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.3.tgz", + "integrity": "sha512-ZxyKGTkF9xT9YJuKQRo19ewf3pXpopuYQd8cDXqNzc3mUNbOME0RKMoZxviQk74hwzfQsEe66dE92MaZbdHKNQ==", + "dev": true, + "dependencies": { + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20" }, "engines": { "node": ">=6.9.0" @@ -1517,13 +1549,13 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz", - "integrity": "sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.23.3.tgz", + "integrity": "sha512-zHsy9iXX2nIsCBFPud3jKn1IRPWg3Ing1qOZgeKV39m1ZgIdpJqvlWVeiHBZC6ITRG0MfskhYe9cLgntfSFPIg==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1533,13 +1565,13 @@ } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz", - "integrity": "sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.22.5.tgz", + "integrity": "sha512-YgLLKmS3aUBhHaxp5hi1WJTgOUb/NCuDHzGT9z9WTt3YG+CPRhJs6nprbStx6DnWM4dh6gt7SU3sZodbZ08adQ==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.20.5", - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1549,12 +1581,44 @@ } }, "node_modules/@babel/plugin-transform-new-target": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz", - "integrity": "sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.23.3.tgz", + "integrity": "sha512-YJ3xKqtJMAT5/TIZnpAR3I+K+WaDowYbN3xyxI8zxx/Gsypwf9B9h0VB+1Nh6ACAAPRS5NSRje0uVv5i79HYGQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.4.tgz", + "integrity": "sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-numeric-separator": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.23.4.tgz", + "integrity": "sha512-mps6auzgwjRrwKEZA05cOwuDc9FAzoyFS4ZsG/8F43bTLf/TgkJg7QXOrPO1JO599iA3qgK9MXdMGOEC8O1h6Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" }, "engines": { "node": ">=6.9.0" @@ -1564,12 +1628,31 @@ } }, "node_modules/@babel/plugin-transform-object-assign": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.18.6.tgz", - "integrity": "sha512-mQisZ3JfqWh2gVXvfqYCAAyRs6+7oev+myBsTwW5RnPhYXOTuCEw2oe3YgxlXMViXUS53lG8koulI7mJ+8JE+A==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.23.3.tgz", + "integrity": "sha512-TPJ6O7gVC2rlQH2hvQGRH273G1xdoloCj9Pc07Q7JbIZYDi+Sv5gaE2fu+r5E7qK4zyt6vj0FbZaZTRU5C3OMA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.23.4.tgz", + "integrity": "sha512-9x9K1YyeQVw0iOXJlIzwm8ltobIIv7j2iLyP2jIhEbqPRQ7ScNgwQufU2I0Gq11VjyG4gI4yMXt2VFags+1N3g==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.23.3", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.23.3" }, "engines": { "node": ">=6.9.0" @@ -1579,13 +1662,46 @@ } }, "node_modules/@babel/plugin-transform-object-super": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz", - "integrity": "sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.23.3.tgz", + "integrity": "sha512-BwQ8q0x2JG+3lxCVFohg+KbQM7plfpBwThdW9A6TMtWwLsbDA01Ek2Zb/AgDN39BiZsExm4qrXxjk+P1/fzGrA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-replace-supers": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.20" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.23.4.tgz", + "integrity": "sha512-XIq8t0rJPHf6Wvmbn9nFxU6ao4c7WhghTR5WyV8SrJfUFzyxhCm4nhC+iAp3HFhbAKLfYpgzhJ6t4XCtVwqO5A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.4.tgz", + "integrity": "sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, "engines": { "node": ">=6.9.0" @@ -1595,12 +1711,46 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.21.3.tgz", - "integrity": "sha512-Wxc+TvppQG9xWFYatvCGPvZ6+SIUxQ2ZdiBP+PHYMIjnPXD+uThCshaz4NZOnODAtBjjcVQQ/3OKs9LW28purQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.23.3.tgz", + "integrity": "sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.23.3.tgz", + "integrity": "sha512-UzqRcRtWsDMTLrRWFvUBDwmw06tCQH9Rl1uAjfh6ijMSmGYQ+fpdB+cnqRC8EMh5tuuxSv0/TejGL+7vyj+50g==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.23.4.tgz", + "integrity": "sha512-9G3K1YqTq3F4Vt88Djx1UZ79PDyj+yKRnUy7cZGSMe+a7jkwD259uKKuUzQlPkGam7R+8RJwh5z4xO27fA1o2A==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" }, "engines": { "node": ">=6.9.0" @@ -1610,12 +1760,12 @@ } }, "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz", - "integrity": "sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.23.3.tgz", + "integrity": "sha512-jR3Jn3y7cZp4oEWPFAlRsSWjxKe4PZILGBSd4nis1TsC5qeSpb+nrtihJuDhNI7QHiVbUaiXa0X2RZY3/TI6Nw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1625,12 +1775,12 @@ } }, "node_modules/@babel/plugin-transform-react-constant-elements": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.21.3.tgz", - "integrity": "sha512-4DVcFeWe/yDYBLp0kBmOGFJ6N2UYg7coGid1gdxb4co62dy/xISDMaYBXBVXEDhfgMk7qkbcYiGtwd5Q/hwDDQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.23.3.tgz", + "integrity": "sha512-zP0QKq/p6O42OL94udMgSfKXyse4RyJ0JqbQ34zDAONWjyrEsghYEyTSK5FIpmXmCpB55SHokL1cRRKHv8L2Qw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1640,12 +1790,12 @@ } }, "node_modules/@babel/plugin-transform-react-display-name": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.18.6.tgz", - "integrity": "sha512-TV4sQ+T013n61uMoygyMRm+xf04Bd5oqFpv2jAEQwSZ8NwQA7zeRPg1LMVg2PWi3zWBz+CLKD+v5bcpZ/BS0aA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.23.3.tgz", + "integrity": "sha512-GnvhtVfA2OAtzdX58FJxU19rhoGeQzyVndw3GgtdECQvQFXPEZIOVULHVZGAYmOgmqjXpVpfocAbSjh99V/Fqw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1655,16 +1805,16 @@ } }, "node_modules/@babel/plugin-transform-react-jsx": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.21.0.tgz", - "integrity": "sha512-6OAWljMvQrZjR2DaNhVfRz6dkCAVV+ymcLUmaf8bccGOHn2v5rHJK3tTpij0BuhdYWP4LLaqj5lwcdlpAAPuvg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.23.4.tgz", + "integrity": "sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-jsx": "^7.18.6", - "@babel/types": "^7.21.0" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-jsx": "^7.23.3", + "@babel/types": "^7.23.4" }, "engines": { "node": ">=6.9.0" @@ -1674,12 +1824,12 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-development": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.18.6.tgz", - "integrity": "sha512-SA6HEjwYFKF7WDjWcMcMGUimmw/nhNRDWxr+KaLSCrkD/LMDBvWRmHAYgE1HDeF8KUuI8OAu+RT6EOtKxSW2qA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.22.5.tgz", + "integrity": "sha512-bDhuzwWMuInwCYeDeMzyi7TaBgRQei6DqxhbyniL7/VG4RSS7HtSL2QbY4eESy1KJqlWt8g3xeEBGPuo+XqC8A==", "dev": true, "dependencies": { - "@babel/plugin-transform-react-jsx": "^7.18.6" + "@babel/plugin-transform-react-jsx": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1689,13 +1839,13 @@ } }, "node_modules/@babel/plugin-transform-react-pure-annotations": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.18.6.tgz", - "integrity": "sha512-I8VfEPg9r2TRDdvnHgPepTKvuRomzA8+u+nhY7qSI1fR2hRNebasZEETLyM5mAUr0Ku56OkXJ0I7NHJnO6cJiQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.23.3.tgz", + "integrity": "sha512-qMFdSS+TUhB7Q/3HVPnEdYJDQIk57jkntAwSuz9xfSE4n+3I+vHYCli3HoHawN1Z3RfCz/y1zXA/JXjG6cVImQ==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1705,13 +1855,13 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.20.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz", - "integrity": "sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.23.3.tgz", + "integrity": "sha512-KP+75h0KghBMcVpuKisx3XTu9Ncut8Q8TuvGO4IhY+9D5DFEckQefOuIsB/gQ2tG71lCke4NMrtIPS8pOj18BQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "regenerator-transform": "^0.15.1" + "@babel/helper-plugin-utils": "^7.22.5", + "regenerator-transform": "^0.15.2" }, "engines": { "node": ">=6.9.0" @@ -1721,12 +1871,12 @@ } }, "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz", - "integrity": "sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.23.3.tgz", + "integrity": "sha512-QnNTazY54YqgGxwIexMZva9gqbPa15t/x9VS+0fsEFWplwVpXYZivtgl43Z1vMpc1bdPP2PP8siFeVcnFvA3Cg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1736,17 +1886,17 @@ } }, "node_modules/@babel/plugin-transform-runtime": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.21.4.tgz", - "integrity": "sha512-1J4dhrw1h1PqnNNpzwxQ2UBymJUF8KuPjAAnlLwZcGhHAIqUigFW7cdK6GHoB64ubY4qXQNYknoUeks4Wz7CUA==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.6.tgz", + "integrity": "sha512-kF1Zg62aPseQ11orDhFRw+aPG/eynNQtI+TyY+m33qJa2cJ5EEvza2P2BNTIA9E5MyqFABHEyY6CPHwgdy9aNg==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.21.4", - "@babel/helper-plugin-utils": "^7.20.2", - "babel-plugin-polyfill-corejs2": "^0.3.3", - "babel-plugin-polyfill-corejs3": "^0.6.0", - "babel-plugin-polyfill-regenerator": "^0.4.1", - "semver": "^6.3.0" + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5", + "babel-plugin-polyfill-corejs2": "^0.4.6", + "babel-plugin-polyfill-corejs3": "^0.8.5", + "babel-plugin-polyfill-regenerator": "^0.5.3", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -1756,12 +1906,12 @@ } }, "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz", - "integrity": "sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.23.3.tgz", + "integrity": "sha512-ED2fgqZLmexWiN+YNFX26fx4gh5qHDhn1O2gvEhreLW2iI63Sqm4llRLCXALKrCnbN4Jy0VcMQZl/SAzqug/jg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1771,13 +1921,13 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.20.7.tgz", - "integrity": "sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.23.3.tgz", + "integrity": "sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1787,12 +1937,12 @@ } }, "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz", - "integrity": "sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.23.3.tgz", + "integrity": "sha512-HZOyN9g+rtvnOU3Yh7kSxXrKbzgrm5X4GncPY1QOquu7epga5MxKHVpYu2hvQnry/H+JjckSYRb93iNfsioAGg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1802,12 +1952,12 @@ } }, "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz", - "integrity": "sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.23.3.tgz", + "integrity": "sha512-Flok06AYNp7GV2oJPZZcP9vZdszev6vPBkHLwxwSpaIqx75wn6mUd3UFWsSsA0l8nXAKkyCmL/sR02m8RYGeHg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1817,12 +1967,12 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz", - "integrity": "sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.23.3.tgz", + "integrity": "sha512-4t15ViVnaFdrPC74be1gXBSMzXk3B4Us9lP7uLRQHTFpV5Dvt33pn+2MyyNxmN3VTTm3oTrZVMUmuw3oBnQ2oQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1832,15 +1982,15 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.21.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.21.3.tgz", - "integrity": "sha512-RQxPz6Iqt8T0uw/WsJNReuBpWpBqs/n7mNo18sKLoTbMp+UrEekhH+pKSVC7gWz+DNjo9gryfV8YzCiT45RgMw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.23.6.tgz", + "integrity": "sha512-6cBG5mBvUu4VUD04OHKnYzbuHNP8huDsD3EDqqpIpsswTDoqHCjLoHb6+QgsV1WsT2nipRqCPgxD3LXnEO7XfA==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-create-class-features-plugin": "^7.21.0", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-typescript": "^7.20.0" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.23.6", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-typescript": "^7.23.3" }, "engines": { "node": ">=6.9.0" @@ -1850,12 +2000,28 @@ } }, "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz", - "integrity": "sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.23.3.tgz", + "integrity": "sha512-OMCUx/bU6ChE3r4+ZdylEqAjaQgHAgipgW8nsCfu5pGqDcFytVd91AwRvUJSBZDz0exPGgnjoqhgRYLRjFZc9Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-property-regex": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.23.3.tgz", + "integrity": "sha512-KcLIm+pDZkWZQAFJ9pdfmh89EwVfmNovFBcXko8szpBeF8z68kWIPeKlmSOkT9BXJxs2C0uk+5LxoxIv62MROA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.9" + "@babel/helper-create-regexp-features-plugin": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1865,13 +2031,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz", - "integrity": "sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.23.3.tgz", + "integrity": "sha512-wMHpNA4x2cIA32b/ci3AfwNgheiva2W0WUKWTK7vBHBhDKfPsc5cFGNWm69WBqpwd86u1qwZ9PWevKqm1A3yAw==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-create-regexp-features-plugin": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1880,39 +2046,44 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/preset-env": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.21.4.tgz", - "integrity": "sha512-2W57zHs2yDLm6GD5ZpvNn71lZ0B/iypSdIeq25OurDKji6AdzV07qp4s3n1/x5BqtiGaTrPN3nerlSCaC5qNTw==", + "node_modules/@babel/plugin-transform-unicode-sets-regex": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.23.3.tgz", + "integrity": "sha512-W7lliA/v9bNR83Qc3q1ip9CQMZ09CcHDbHfbLRDNuAhn1Mvkr1ZNF7hPmztMQvtTGVLJ9m8IZqWsTkXOml8dbw==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.21.4", - "@babel/helper-compilation-targets": "^7.21.4", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-validator-option": "^7.21.0", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.18.6", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.20.7", - "@babel/plugin-proposal-async-generator-functions": "^7.20.7", - "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-class-static-block": "^7.21.0", - "@babel/plugin-proposal-dynamic-import": "^7.18.6", - "@babel/plugin-proposal-export-namespace-from": "^7.18.9", - "@babel/plugin-proposal-json-strings": "^7.18.6", - "@babel/plugin-proposal-logical-assignment-operators": "^7.20.7", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", - "@babel/plugin-proposal-numeric-separator": "^7.18.6", - "@babel/plugin-proposal-object-rest-spread": "^7.20.7", - "@babel/plugin-proposal-optional-catch-binding": "^7.18.6", - "@babel/plugin-proposal-optional-chaining": "^7.21.0", - "@babel/plugin-proposal-private-methods": "^7.18.6", - "@babel/plugin-proposal-private-property-in-object": "^7.21.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.18.6", + "@babel/helper-create-regexp-features-plugin": "^7.22.15", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/preset-env": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.6.tgz", + "integrity": "sha512-2XPn/BqKkZCpzYhUUNZ1ssXw7DcXfKQEjv/uXZUXgaebCMYmkEsfZ2yY+vv+xtXv50WmL5SGhyB6/xsWxIvvOQ==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.23.5", + "@babel/helper-compilation-targets": "^7.23.6", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.23.5", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.23.3", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.23.3", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.23.3", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", "@babel/plugin-syntax-class-static-block": "^7.14.5", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-import-assertions": "^7.20.0", + "@babel/plugin-syntax-import-assertions": "^7.23.3", + "@babel/plugin-syntax-import-attributes": "^7.23.3", + "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.3", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", @@ -1922,45 +2093,61 @@ "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-syntax-private-property-in-object": "^7.14.5", "@babel/plugin-syntax-top-level-await": "^7.14.5", - "@babel/plugin-transform-arrow-functions": "^7.20.7", - "@babel/plugin-transform-async-to-generator": "^7.20.7", - "@babel/plugin-transform-block-scoped-functions": "^7.18.6", - "@babel/plugin-transform-block-scoping": "^7.21.0", - "@babel/plugin-transform-classes": "^7.21.0", - "@babel/plugin-transform-computed-properties": "^7.20.7", - "@babel/plugin-transform-destructuring": "^7.21.3", - "@babel/plugin-transform-dotall-regex": "^7.18.6", - "@babel/plugin-transform-duplicate-keys": "^7.18.9", - "@babel/plugin-transform-exponentiation-operator": "^7.18.6", - "@babel/plugin-transform-for-of": "^7.21.0", - "@babel/plugin-transform-function-name": "^7.18.9", - "@babel/plugin-transform-literals": "^7.18.9", - "@babel/plugin-transform-member-expression-literals": "^7.18.6", - "@babel/plugin-transform-modules-amd": "^7.20.11", - "@babel/plugin-transform-modules-commonjs": "^7.21.2", - "@babel/plugin-transform-modules-systemjs": "^7.20.11", - "@babel/plugin-transform-modules-umd": "^7.18.6", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.20.5", - "@babel/plugin-transform-new-target": "^7.18.6", - "@babel/plugin-transform-object-super": "^7.18.6", - "@babel/plugin-transform-parameters": "^7.21.3", - "@babel/plugin-transform-property-literals": "^7.18.6", - "@babel/plugin-transform-regenerator": "^7.20.5", - "@babel/plugin-transform-reserved-words": "^7.18.6", - "@babel/plugin-transform-shorthand-properties": "^7.18.6", - "@babel/plugin-transform-spread": "^7.20.7", - "@babel/plugin-transform-sticky-regex": "^7.18.6", - "@babel/plugin-transform-template-literals": "^7.18.9", - "@babel/plugin-transform-typeof-symbol": "^7.18.9", - "@babel/plugin-transform-unicode-escapes": "^7.18.10", - "@babel/plugin-transform-unicode-regex": "^7.18.6", - "@babel/preset-modules": "^0.1.5", - "@babel/types": "^7.21.4", - "babel-plugin-polyfill-corejs2": "^0.3.3", - "babel-plugin-polyfill-corejs3": "^0.6.0", - "babel-plugin-polyfill-regenerator": "^0.4.1", - "core-js-compat": "^3.25.1", - "semver": "^6.3.0" + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.23.3", + "@babel/plugin-transform-async-generator-functions": "^7.23.4", + "@babel/plugin-transform-async-to-generator": "^7.23.3", + "@babel/plugin-transform-block-scoped-functions": "^7.23.3", + "@babel/plugin-transform-block-scoping": "^7.23.4", + "@babel/plugin-transform-class-properties": "^7.23.3", + "@babel/plugin-transform-class-static-block": "^7.23.4", + "@babel/plugin-transform-classes": "^7.23.5", + "@babel/plugin-transform-computed-properties": "^7.23.3", + "@babel/plugin-transform-destructuring": "^7.23.3", + "@babel/plugin-transform-dotall-regex": "^7.23.3", + "@babel/plugin-transform-duplicate-keys": "^7.23.3", + "@babel/plugin-transform-dynamic-import": "^7.23.4", + "@babel/plugin-transform-exponentiation-operator": "^7.23.3", + "@babel/plugin-transform-export-namespace-from": "^7.23.4", + "@babel/plugin-transform-for-of": "^7.23.6", + "@babel/plugin-transform-function-name": "^7.23.3", + "@babel/plugin-transform-json-strings": "^7.23.4", + "@babel/plugin-transform-literals": "^7.23.3", + "@babel/plugin-transform-logical-assignment-operators": "^7.23.4", + "@babel/plugin-transform-member-expression-literals": "^7.23.3", + "@babel/plugin-transform-modules-amd": "^7.23.3", + "@babel/plugin-transform-modules-commonjs": "^7.23.3", + "@babel/plugin-transform-modules-systemjs": "^7.23.3", + "@babel/plugin-transform-modules-umd": "^7.23.3", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5", + "@babel/plugin-transform-new-target": "^7.23.3", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.23.4", + "@babel/plugin-transform-numeric-separator": "^7.23.4", + "@babel/plugin-transform-object-rest-spread": "^7.23.4", + "@babel/plugin-transform-object-super": "^7.23.3", + "@babel/plugin-transform-optional-catch-binding": "^7.23.4", + "@babel/plugin-transform-optional-chaining": "^7.23.4", + "@babel/plugin-transform-parameters": "^7.23.3", + "@babel/plugin-transform-private-methods": "^7.23.3", + "@babel/plugin-transform-private-property-in-object": "^7.23.4", + "@babel/plugin-transform-property-literals": "^7.23.3", + "@babel/plugin-transform-regenerator": "^7.23.3", + "@babel/plugin-transform-reserved-words": "^7.23.3", + "@babel/plugin-transform-shorthand-properties": "^7.23.3", + "@babel/plugin-transform-spread": "^7.23.3", + "@babel/plugin-transform-sticky-regex": "^7.23.3", + "@babel/plugin-transform-template-literals": "^7.23.3", + "@babel/plugin-transform-typeof-symbol": "^7.23.3", + "@babel/plugin-transform-unicode-escapes": "^7.23.3", + "@babel/plugin-transform-unicode-property-regex": "^7.23.3", + "@babel/plugin-transform-unicode-regex": "^7.23.3", + "@babel/plugin-transform-unicode-sets-regex": "^7.23.3", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "babel-plugin-polyfill-corejs2": "^0.4.6", + "babel-plugin-polyfill-corejs3": "^0.8.5", + "babel-plugin-polyfill-regenerator": "^0.5.3", + "core-js-compat": "^3.31.0", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -1969,34 +2156,44 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/preset-env/node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "dev": true, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/preset-modules": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", - "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", + "version": "0.1.6-no-external-plugins", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", + "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", - "@babel/plugin-transform-dotall-regex": "^7.4.4", "@babel/types": "^7.4.4", "esutils": "^2.0.2" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" } }, "node_modules/@babel/preset-react": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.18.6.tgz", - "integrity": "sha512-zXr6atUmyYdiWRVLOZahakYmOBHtWc2WGCkP8PYTgZi0iJXDY2CN180TdrIW4OGOAdLc7TifzDIvtx6izaRIzg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.23.3.tgz", + "integrity": "sha512-tbkHOS9axH6Ysf2OUEqoSZ6T3Fa2SrNH6WTWSPBboxKzdxNc9qOICeLXkNG0ZEwbQ1HY8liwOce4aN/Ceyuq6w==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/helper-validator-option": "^7.18.6", - "@babel/plugin-transform-react-display-name": "^7.18.6", - "@babel/plugin-transform-react-jsx": "^7.18.6", - "@babel/plugin-transform-react-jsx-development": "^7.18.6", - "@babel/plugin-transform-react-pure-annotations": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.22.15", + "@babel/plugin-transform-react-display-name": "^7.23.3", + "@babel/plugin-transform-react-jsx": "^7.22.15", + "@babel/plugin-transform-react-jsx-development": "^7.22.5", + "@babel/plugin-transform-react-pure-annotations": "^7.23.3" }, "engines": { "node": ">=6.9.0" @@ -2006,16 +2203,16 @@ } }, "node_modules/@babel/preset-typescript": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.21.4.tgz", - "integrity": "sha512-sMLNWY37TCdRH/bJ6ZeeOH1nPuanED7Ai9Y/vH31IPqalioJ6ZNFUWONsakhv4r4n+I6gm5lmoE0olkgib/j/A==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.23.3.tgz", + "integrity": "sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-validator-option": "^7.21.0", - "@babel/plugin-syntax-jsx": "^7.21.4", - "@babel/plugin-transform-modules-commonjs": "^7.21.2", - "@babel/plugin-transform-typescript": "^7.21.3" + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.22.15", + "@babel/plugin-syntax-jsx": "^7.23.3", + "@babel/plugin-transform-modules-commonjs": "^7.23.3", + "@babel/plugin-transform-typescript": "^7.23.3" }, "engines": { "node": ">=6.9.0" @@ -2031,45 +2228,45 @@ "dev": true }, "node_modules/@babel/runtime": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.0.tgz", - "integrity": "sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.6.tgz", + "integrity": "sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ==", "dependencies": { - "regenerator-runtime": "^0.13.11" + "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/template": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz", - "integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.4.tgz", - "integrity": "sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.21.4", - "@babel/generator": "^7.21.4", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.21.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.21.4", - "@babel/types": "^7.21.4", - "debug": "^4.1.0", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz", + "integrity": "sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.6", + "@babel/types": "^7.23.6", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -2077,12 +2274,12 @@ } }, "node_modules/@babel/types": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz", - "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", + "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", "dependencies": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -2409,27 +2606,32 @@ } }, "node_modules/@emotion/babel-plugin": { - "version": "11.10.6", - "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.10.6.tgz", - "integrity": "sha512-p2dAqtVrkhSa7xz1u/m9eHYdLi+en8NowrmXeF/dKtJpU8lCWli8RUAati7NcSl0afsBott48pdnANuD0wh9QQ==", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", + "integrity": "sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==", "dependencies": { "@babel/helper-module-imports": "^7.16.7", "@babel/runtime": "^7.18.3", - "@emotion/hash": "^0.9.0", - "@emotion/memoize": "^0.8.0", - "@emotion/serialize": "^1.1.1", + "@emotion/hash": "^0.9.1", + "@emotion/memoize": "^0.8.1", + "@emotion/serialize": "^1.1.2", "babel-plugin-macros": "^3.1.0", "convert-source-map": "^1.5.0", "escape-string-regexp": "^4.0.0", "find-root": "^1.1.0", "source-map": "^0.5.7", - "stylis": "4.1.3" + "stylis": "4.2.0" } }, "node_modules/@emotion/babel-plugin/node_modules/@emotion/hash": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.0.tgz", - "integrity": "sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ==" + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", + "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" + }, + "node_modules/@emotion/babel-plugin/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" }, "node_modules/@emotion/babel-plugin/node_modules/escape-string-regexp": { "version": "4.0.0", @@ -2451,15 +2653,15 @@ } }, "node_modules/@emotion/cache": { - "version": "11.10.5", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.10.5.tgz", - "integrity": "sha512-dGYHWyzTdmK+f2+EnIGBpkz1lKc4Zbj2KHd4cX3Wi8/OWr5pKslNjc3yABKH4adRGCvSX4VDC0i04mrrq0aiRA==", + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz", + "integrity": "sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==", "dependencies": { - "@emotion/memoize": "^0.8.0", - "@emotion/sheet": "^1.2.1", - "@emotion/utils": "^1.2.0", - "@emotion/weak-memoize": "^0.3.0", - "stylis": "4.1.3" + "@emotion/memoize": "^0.8.1", + "@emotion/sheet": "^1.2.2", + "@emotion/utils": "^1.2.1", + "@emotion/weak-memoize": "^0.3.1", + "stylis": "4.2.0" } }, "node_modules/@emotion/hash": { @@ -2468,22 +2670,22 @@ "integrity": "sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==" }, "node_modules/@emotion/memoize": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.0.tgz", - "integrity": "sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA==" + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", + "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" }, "node_modules/@emotion/react": { - "version": "11.10.6", - "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.10.6.tgz", - "integrity": "sha512-6HT8jBmcSkfzO7mc+N1L9uwvOnlcGoix8Zn7srt+9ga0MjREo6lRpuVX0kzo6Jp6oTqDhREOFsygN6Ew4fEQbw==", + "version": "11.11.1", + "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.1.tgz", + "integrity": "sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==", "dependencies": { "@babel/runtime": "^7.18.3", - "@emotion/babel-plugin": "^11.10.6", - "@emotion/cache": "^11.10.5", - "@emotion/serialize": "^1.1.1", - "@emotion/use-insertion-effect-with-fallbacks": "^1.0.0", - "@emotion/utils": "^1.2.0", - "@emotion/weak-memoize": "^0.3.0", + "@emotion/babel-plugin": "^11.11.0", + "@emotion/cache": "^11.11.0", + "@emotion/serialize": "^1.1.2", + "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", + "@emotion/utils": "^1.2.1", + "@emotion/weak-memoize": "^0.3.1", "hoist-non-react-statics": "^3.3.1" }, "peerDependencies": { @@ -2496,54 +2698,54 @@ } }, "node_modules/@emotion/serialize": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.1.tgz", - "integrity": "sha512-Zl/0LFggN7+L1liljxXdsVSVlg6E/Z/olVWpfxUTxOAmi8NU7YoeWeLfi1RmnB2TATHoaWwIBRoL+FvAJiTUQA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.2.tgz", + "integrity": "sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA==", "dependencies": { - "@emotion/hash": "^0.9.0", - "@emotion/memoize": "^0.8.0", - "@emotion/unitless": "^0.8.0", - "@emotion/utils": "^1.2.0", + "@emotion/hash": "^0.9.1", + "@emotion/memoize": "^0.8.1", + "@emotion/unitless": "^0.8.1", + "@emotion/utils": "^1.2.1", "csstype": "^3.0.2" } }, "node_modules/@emotion/serialize/node_modules/@emotion/hash": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.0.tgz", - "integrity": "sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ==" + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", + "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" }, "node_modules/@emotion/serialize/node_modules/csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/@emotion/sheet": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.1.tgz", - "integrity": "sha512-zxRBwl93sHMsOj4zs+OslQKg/uhF38MB+OMKoCrVuS0nyTkqnau+BM3WGEoOptg9Oz45T/aIGs1qbVAsEFo3nA==" + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.2.tgz", + "integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==" }, "node_modules/@emotion/unitless": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.0.tgz", - "integrity": "sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw==" + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", + "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==" }, "node_modules/@emotion/use-insertion-effect-with-fallbacks": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.0.tgz", - "integrity": "sha512-1eEgUGmkaljiBnRMTdksDV1W4kUnmwgp7X9G8B++9GYwl1lUdqSndSriIrTJ0N7LQaoauY9JJ2yhiOYK5+NI4A==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.1.tgz", + "integrity": "sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==", "peerDependencies": { "react": ">=16.8.0" } }, "node_modules/@emotion/utils": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.0.tgz", - "integrity": "sha512-sn3WH53Kzpw8oQ5mgMmIzzyAaH2ZqFEbozVVBSYp538E06OSE6ytOp7pRAjNQR+Q/orwqdQYJSe2m3hCOeznkw==" + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.1.tgz", + "integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==" }, "node_modules/@emotion/weak-memoize": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.0.tgz", - "integrity": "sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg==" + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz", + "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==" }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", @@ -2561,23 +2763,23 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.0.tgz", - "integrity": "sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, "node_modules/@eslint/eslintrc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.2.tgz", - "integrity": "sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.5.1", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -2593,9 +2795,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -2620,67 +2822,76 @@ } }, "node_modules/@eslint/js": { - "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.37.0.tgz", - "integrity": "sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz", + "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@floating-ui/core": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.2.5.tgz", - "integrity": "sha512-qrcbyfnRVziRlB6IYwjCopYhO7Vud750JlJyuljruIXcPxr22y8zdckcJGsuOdnQ639uVD1tTXddrcH3t3QYIQ==" + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.5.2.tgz", + "integrity": "sha512-Ii3MrfY/GAIN3OhXNzpCKaLxHQfJF9qvwq/kEJYdqDxeIHa01K8sldugal6TmeeXl+WMvhv9cnVzUTaFFJF09A==", + "dependencies": { + "@floating-ui/utils": "^0.1.3" + } }, "node_modules/@floating-ui/dom": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.2.5.tgz", - "integrity": "sha512-+sAUfpQ3Frz+VCbPCqj+cZzvEESy3fjSeT/pDWkYCWOBXYNNKZfuVsHuv8/JO2zze8+Eb/Q7a6hZVgzS81fLbQ==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.3.tgz", + "integrity": "sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==", "dependencies": { - "@floating-ui/core": "^1.2.4" + "@floating-ui/core": "^1.4.2", + "@floating-ui/utils": "^0.1.3" } }, + "node_modules/@floating-ui/utils": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.6.tgz", + "integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==" + }, "node_modules/@fortawesome/fontawesome-common-types": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.0.tgz", - "integrity": "sha512-HNii132xfomg5QVZw0HwXXpN22s7VBHQBv9CeOu9tfJnhsWQNd2lmTNi8CSrnw5B+5YOmzu1UoPAyxaXsJ6RgQ==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.5.1.tgz", + "integrity": "sha512-GkWzv+L6d2bI5f/Vk6ikJ9xtl7dfXtoRu3YGE6nq0p/FFqA1ebMOAWg3XgRyb0I6LYyYkiAo+3/KrwuBp8xG7A==", "hasInstallScript": true, "engines": { "node": ">=6" } }, "node_modules/@fortawesome/fontawesome-svg-core": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.4.0.tgz", - "integrity": "sha512-Bertv8xOiVELz5raB2FlXDPKt+m94MQ3JgDfsVbrqNpLU9+UE2E18GKjLKw+d3XbeYPqg1pzyQKGsrzbw+pPaw==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.5.1.tgz", + "integrity": "sha512-MfRCYlQPXoLlpem+egxjfkEuP9UQswTrlCOsknus/NcMoblTH2g0jPrapbcIb04KGA7E2GZxbAccGZfWoYgsrQ==", "hasInstallScript": true, "dependencies": { - "@fortawesome/fontawesome-common-types": "6.4.0" + "@fortawesome/fontawesome-common-types": "6.5.1" }, "engines": { "node": ">=6" } }, "node_modules/@fortawesome/free-regular-svg-icons": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.4.0.tgz", - "integrity": "sha512-ZfycI7D0KWPZtf7wtMFnQxs8qjBXArRzczABuMQqecA/nXohquJ5J/RCR77PmY5qGWkxAZDxpnUFVXKwtY/jPw==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-6.5.1.tgz", + "integrity": "sha512-m6ShXn+wvqEU69wSP84coxLbNl7sGVZb+Ca+XZq6k30SzuP3X4TfPqtycgUh9ASwlNh5OfQCd8pDIWxl+O+LlQ==", "hasInstallScript": true, "dependencies": { - "@fortawesome/fontawesome-common-types": "6.4.0" + "@fortawesome/fontawesome-common-types": "6.5.1" }, "engines": { "node": ">=6" } }, "node_modules/@fortawesome/free-solid-svg-icons": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.4.0.tgz", - "integrity": "sha512-kutPeRGWm8V5dltFP1zGjQOEAzaLZj4StdQhWVZnfGFCvAPVvHh8qk5bRrU4KXnRRRNni5tKQI9PBAdI6MP8nQ==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-6.5.1.tgz", + "integrity": "sha512-S1PPfU3mIJa59biTtXJz1oI0+KAXW6bkAb31XKhxdxtuXDiUIFsih4JR1v5BbxY7hVHsD1RKq+jRkVRaf773NQ==", "hasInstallScript": true, "dependencies": { - "@fortawesome/fontawesome-common-types": "6.4.0" + "@fortawesome/fontawesome-common-types": "6.5.1" }, "engines": { "node": ">=6" @@ -2699,12 +2910,12 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", + "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", + "@humanwhocodes/object-schema": "^2.0.1", "debug": "^4.1.1", "minimatch": "^3.0.5" }, @@ -2726,9 +2937,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { @@ -2756,6 +2967,19 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -2873,9 +3097,9 @@ } }, "node_modules/@jest/console/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -3113,9 +3337,9 @@ } }, "node_modules/@jest/core/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -3170,6 +3394,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/@jest/core/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "node_modules/@jest/core/node_modules/diff-sequences": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", @@ -3415,9 +3645,9 @@ } }, "node_modules/@jest/core/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3469,72 +3699,72 @@ "dev": true }, "node_modules/@jest/environment": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.5.0.tgz", - "integrity": "sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "dependencies": { - "@jest/fake-timers": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.5.0" + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.5.0.tgz", - "integrity": "sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, "dependencies": { - "expect": "^29.5.0", - "jest-snapshot": "^29.5.0" + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.5.0.tgz", - "integrity": "sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, "dependencies": { - "jest-get-type": "^29.4.3" + "jest-get-type": "^29.6.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/fake-timers": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.5.0.tgz", - "integrity": "sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^29.5.0", - "jest-mock": "^29.5.0", - "jest-util": "^29.5.0" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/globals": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.5.0.tgz", - "integrity": "sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "dependencies": { - "@jest/environment": "^29.5.0", - "@jest/expect": "^29.5.0", - "@jest/types": "^29.5.0", - "jest-mock": "^29.5.0" + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -3627,9 +3857,9 @@ } }, "node_modules/@jest/reporters/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -3684,6 +3914,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/@jest/reporters/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "node_modules/@jest/reporters/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -3808,12 +4044,12 @@ } }, "node_modules/@jest/schemas": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.4.3.tgz", - "integrity": "sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "dependencies": { - "@sinclair/typebox": "^0.25.16" + "@sinclair/typebox": "^0.27.8" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -3865,9 +4101,9 @@ } }, "node_modules/@jest/test-result/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -3975,9 +4211,9 @@ } }, "node_modules/@jest/test-sequencer/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -4135,22 +4371,22 @@ } }, "node_modules/@jest/transform": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.5.0.tgz", - "integrity": "sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", - "@jest/types": "^29.5.0", - "@jridgewell/trace-mapping": "^0.3.15", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", - "jest-regex-util": "^29.4.3", - "jest-util": "^29.5.0", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", @@ -4209,12 +4445,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/@jest/transform/node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, "node_modules/@jest/transform/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -4246,12 +4476,12 @@ } }, "node_modules/@jest/types": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.5.0.tgz", - "integrity": "sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "dependencies": { - "@jest/schemas": "^29.4.3", + "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", @@ -4333,22 +4563,23 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", "dev": true, "engines": { "node": ">=6.0.0" @@ -4364,43 +4595,29 @@ } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" } }, - "node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@leichtgewicht/ip-codec": { @@ -4410,9 +4627,9 @@ "dev": true }, "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", - "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", "optional": true, "dependencies": { "detect-libc": "^2.0.0", @@ -4429,6 +4646,31 @@ "node-pre-gyp": "bin/node-pre-gyp" } }, + "node_modules/@mapbox/node-pre-gyp/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/@mapbox/node-pre-gyp/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -4457,18 +4699,18 @@ } }, "node_modules/@mapbox/node-pre-gyp/node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "optional": true, "bin": { "semver": "bin/semver.js" } }, "node_modules/@mapbox/node-pre-gyp/node_modules/node-fetch": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz", - "integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "optional": true, "dependencies": { "whatwg-url": "^5.0.0" @@ -4486,9 +4728,9 @@ } }, "node_modules/@mapbox/node-pre-gyp/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "optional": true, "dependencies": { "lru-cache": "^6.0.0" @@ -4565,6 +4807,14 @@ } } }, + "node_modules/@material-ui/core/node_modules/clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "engines": { + "node": ">=6" + } + }, "node_modules/@material-ui/icons": { "version": "4.11.3", "resolved": "https://registry.npmjs.org/@material-ui/icons/-/icons-4.11.3.tgz", @@ -4614,11 +4864,19 @@ } } }, + "node_modules/@material-ui/lab/node_modules/clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "engines": { + "node": ">=6" + } + }, "node_modules/@material-ui/pickers": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/@material-ui/pickers/-/pickers-3.3.10.tgz", - "integrity": "sha512-hS4pxwn1ZGXVkmgD4tpFpaumUaAg2ZzbTrxltfC5yPw4BJV+mGkfnQOB4VpWEYZw2jv65Z0wLwDE/piQiPPZ3w==", - "deprecated": "Material UI Pickers v3 doesn't receive active development since January 2020. See the guide https://mui.com/material-ui/guides/pickers-migration/ to upgrade.", + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/@material-ui/pickers/-/pickers-3.3.11.tgz", + "integrity": "sha512-pDYjbjUeabapijS2FpSwK/ruJdk7IGeAshpLbKDa3PRRKRy7Nv6sXxAvUg2F+lID/NwUKgBmCYS5bzrl7Xxqzw==", + "deprecated": "This package no longer supported. It has been relaced by @mui/x-date-pickers", "dependencies": { "@babel/runtime": "^7.6.0", "@date-io/core": "1.x", @@ -4635,6 +4893,14 @@ "react-dom": "^16.8.0 || ^17.0.0" } }, + "node_modules/@material-ui/pickers/node_modules/clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "engines": { + "node": ">=6" + } + }, "node_modules/@material-ui/styles": { "version": "4.11.5", "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.11.5.tgz", @@ -4676,6 +4942,14 @@ } } }, + "node_modules/@material-ui/styles/node_modules/clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "engines": { + "node": ">=6" + } + }, "node_modules/@material-ui/system": { "version": "4.12.2", "resolved": "https://registry.npmjs.org/@material-ui/system/-/system-4.12.2.tgz", @@ -4808,9 +5082,9 @@ } }, "node_modules/@pmmmwh/react-refresh-webpack-plugin": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.10.tgz", - "integrity": "sha512-j0Ya0hCFZPd4x40qLzbhGsh9TMtdb+CJQiso+WxLOPNasohq9cc5SNUcwsZaRH6++Xh91Xkm/xHCkuIiIu0LUA==", + "version": "0.5.11", + "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.11.tgz", + "integrity": "sha512-7j/6vdTym0+qZ6u4XbSAxrWBGYSdCfTzySkj7WAFgDLmSyWlOrWvpyzxlFh5jtw9dn0oL/jtW+06XfFiisN3JQ==", "dev": true, "dependencies": { "ansi-html-community": "^0.0.8", @@ -4830,7 +5104,7 @@ "@types/webpack": "4.x || 5.x", "react-refresh": ">=0.10.0 <1.0.0", "sockjs-client": "^1.4.0", - "type-fest": ">=0.17.0 <4.0.0", + "type-fest": ">=0.17.0 <5.0.0", "webpack": ">=4.43.0 <6.0.0", "webpack-dev-server": "3.x || 4.x", "webpack-hot-middleware": "2.x", @@ -4867,11 +5141,11 @@ } }, "node_modules/@remix-run/router": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.5.0.tgz", - "integrity": "sha512-bkUDCp8o1MvFO+qxkODcbhSqRa6P2GXgrGZVpt0dCXNW2HCSCqYI0ZoAqEOSAjRWmmlKcYgFvN4B4S+zo/f8kg==", + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.14.0.tgz", + "integrity": "sha512-WOHih+ClN7N8oHk9N4JUiMxQJmRVaOxcg8w7F/oHUXzJt920ekASLI/7cYX8XkntDWRhLZtsk6LbGrkgOAvi5A==", "engines": { - "node": ">=14" + "node": ">=14.0.0" } }, "node_modules/@rollup/plugin-babel": { @@ -4954,33 +5228,33 @@ "dev": true }, "node_modules/@rushstack/eslint-patch": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.2.0.tgz", - "integrity": "sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.6.1.tgz", + "integrity": "sha512-UY+FGM/2jjMkzQLn8pxcHGMaVLh9aEitG3zY2CiY7XHdLiz3bZOwa6oDxNqEMv7zZkV+cj5DOdz0cQ1BP5Hjgw==", "dev": true }, "node_modules/@sinclair/typebox": { - "version": "0.25.24", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.24.tgz", - "integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==", + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true }, "node_modules/@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", "dev": true, "dependencies": { "type-detect": "4.0.8" } }, "node_modules/@sinonjs/fake-timers": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz", - "integrity": "sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, "dependencies": { - "@sinonjs/commons": "^2.0.0" + "@sinonjs/commons": "^3.0.0" } }, "node_modules/@stomp/rx-stomp": { @@ -5266,6 +5540,37 @@ "url": "https://github.com/sponsors/fb55" } }, + "node_modules/@svgr/plugin-svgo/node_modules/csso": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", + "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "dev": true, + "dependencies": { + "css-tree": "^1.1.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@svgr/plugin-svgo/node_modules/csso/node_modules/css-tree": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.14", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@svgr/plugin-svgo/node_modules/csso/node_modules/mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "dev": true + }, "node_modules/@svgr/plugin-svgo/node_modules/dom-serializer": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", @@ -5301,6 +5606,19 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/@svgr/plugin-svgo/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@svgr/plugin-svgo/node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", @@ -5439,12 +5757,12 @@ } }, "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "dev": true, "engines": { - "node": ">= 10" + "node": ">= 6" } }, "node_modules/@trysound/sax": { @@ -5457,9 +5775,9 @@ } }, "node_modules/@types/babel__core": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", - "integrity": "sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "dependencies": { "@babel/parser": "^7.20.7", @@ -5470,18 +5788,18 @@ } }, "node_modules/@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "version": "7.6.7", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.7.tgz", + "integrity": "sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ==", "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "dependencies": { "@babel/parser": "^7.1.0", @@ -5489,18 +5807,18 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.3.tgz", - "integrity": "sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==", + "version": "7.20.4", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.4.tgz", + "integrity": "sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA==", "dev": true, "dependencies": { - "@babel/types": "^7.3.0" + "@babel/types": "^7.20.7" } }, "node_modules/@types/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", "dev": true, "dependencies": { "@types/connect": "*", @@ -5508,27 +5826,27 @@ } }, "node_modules/@types/bonjour": { - "version": "3.5.10", - "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.10.tgz", - "integrity": "sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw==", + "version": "3.5.13", + "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.13.tgz", + "integrity": "sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/connect-history-api-fallback": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz", - "integrity": "sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.4.tgz", + "integrity": "sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==", "dev": true, "dependencies": { "@types/express-serve-static-core": "*", @@ -5536,19 +5854,19 @@ } }, "node_modules/@types/cookie": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.3.3.tgz", - "integrity": "sha512-LKVP3cgXBT9RYj+t+9FDKwS5tdI+rPBXaNSkma7hvqy35lc7mAokC2zsqWJH0LaqIt3B962nuYI77hsJoT1gow==" + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.5.4.tgz", + "integrity": "sha512-7z/eR6O859gyWIAjuvBWFzNURmf2oPBmJlfVWkwehU5nzIyjwBsTh7WMmEEV4JFnHuQ3ex4oyTvfKzcyJVDBNA==" }, "node_modules/@types/dateformat": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@types/dateformat/-/dateformat-5.0.0.tgz", - "integrity": "sha512-SZg4JdHIWHQGEokbYGZSDvo5wA4TLYPXaqhigs/wH+REDOejcJzgH+qyY+HtEUtWOZxEUkbhbdYPqQDiEgrXeA==" + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@types/dateformat/-/dateformat-5.0.2.tgz", + "integrity": "sha512-M95hNBMa/hnwErH+a+VOD/sYgTmo15OTYTM2Hr52/e0OdOuY+Crag+kd3/ioZrhg0WGbl9Sm3hR7UU+MH6rfOw==" }, "node_modules/@types/eslint": { - "version": "8.37.0", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.37.0.tgz", - "integrity": "sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ==", + "version": "8.44.9", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.9.tgz", + "integrity": "sha512-6yBxcvwnnYoYT1Uk2d+jvIfsuP4mb2EdIxFnrPABj5a/838qe5bGkNLFOiipX4ULQ7XVQvTxOh7jO+BTAiqsEw==", "dev": true, "dependencies": { "@types/estree": "*", @@ -5556,9 +5874,9 @@ } }, "node_modules/@types/eslint-scope": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", - "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", "dev": true, "dependencies": { "@types/eslint": "*", @@ -5566,15 +5884,15 @@ } }, "node_modules/@types/estree": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", - "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "node_modules/@types/express": { - "version": "4.17.17", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", - "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "dev": true, "dependencies": { "@types/body-parser": "*", @@ -5584,20 +5902,21 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.33", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.33.tgz", - "integrity": "sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==", + "version": "4.17.41", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz", + "integrity": "sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==", "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", - "@types/range-parser": "*" + "@types/range-parser": "*", + "@types/send": "*" } }, "node_modules/@types/graceful-fs": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", - "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "dependencies": { "@types/node": "*" @@ -5609,9 +5928,9 @@ "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==" }, "node_modules/@types/hoist-non-react-statics": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", - "integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz", + "integrity": "sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==", "dependencies": { "@types/react": "*", "hoist-non-react-statics": "^3.3.0" @@ -5623,43 +5942,49 @@ "integrity": "sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg==", "dev": true }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true + }, "node_modules/@types/http-proxy": { - "version": "1.17.10", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.10.tgz", - "integrity": "sha512-Qs5aULi+zV1bwKAg5z1PWnDXWmsn+LxIvUGv6E2+OOMYhclZMO+OXd9pYVf2gLykf2I7IV2u7oTHwChPNsvJ7g==", + "version": "1.17.14", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.14.tgz", + "integrity": "sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", "dev": true }, "node_modules/@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, "dependencies": { "@types/istanbul-lib-coverage": "*" } }, "node_modules/@types/istanbul-reports": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, "dependencies": { "@types/istanbul-lib-report": "*" } }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/json5": { @@ -5669,66 +5994,78 @@ "dev": true }, "node_modules/@types/lodash": { - "version": "4.14.192", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.192.tgz", - "integrity": "sha512-km+Vyn3BYm5ytMO13k9KTp27O75rbQ0NFw+U//g+PX7VZyjCioXaRFisqSIJRECljcTv73G3i6BpglNGHgUQ5A==" + "version": "4.14.202", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", + "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==" }, "node_modules/@types/mime": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", - "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", "dev": true }, "node_modules/@types/node": { - "version": "18.15.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz", - "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==", - "dev": true + "version": "20.10.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", + "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-forge": { + "version": "1.3.10", + "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.10.tgz", + "integrity": "sha512-y6PJDYN4xYBxwd22l+OVH35N+1fCYWiuC3aiP2SlXVE6Lo7SS+rSx9r89hLxrP4pn6n1lBGhHJ12pj3F3Mpttw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } }, "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", + "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==" }, "node_modules/@types/prettier": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", - "integrity": "sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==", + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", + "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", "dev": true }, "node_modules/@types/prop-types": { - "version": "15.7.5", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", - "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" + "version": "15.7.11", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz", + "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" }, "node_modules/@types/q": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.5.tgz", - "integrity": "sha512-L28j2FcJfSZOnL1WBjDYp2vUHCeIFlyYI/53EwD/rKUBQ7MtUUfbQWiyKJGpcnv4/WgrhWsFKrcPstcAt/J0tQ==", + "version": "1.5.8", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.8.tgz", + "integrity": "sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw==", "dev": true }, "node_modules/@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", + "version": "6.9.10", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.10.tgz", + "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==", "dev": true }, "node_modules/@types/raf": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.0.tgz", - "integrity": "sha512-taW5/WYqo36N7V39oYyHP9Ipfd5pNFvGTIQsNGj86xV88YQ7GnI30/yMfKDF7Zgin0m3e+ikX88FvImnK4RjGw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.3.tgz", + "integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==", "optional": true }, "node_modules/@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", "dev": true }, "node_modules/@types/react": { - "version": "17.0.56", - "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.56.tgz", - "integrity": "sha512-Z13f9Qz7Hg8f2g2NsBjiJSVWmON2b3K8RIqFK8mMKCIgvD0CD0ZChTukz87H3lI28X3ukXoNFGzo3ZW1ICTtPA==", + "version": "17.0.73", + "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.73.tgz", + "integrity": "sha512-6AcjgPIVsXTIsFDgsGW0iQhvg0xb2vt2qAWgXyncnVNRaW9ZXTTwAh7RQoh7PzK1AhjPoGDvUBkdAREih9n5oQ==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -5736,25 +6073,25 @@ } }, "node_modules/@types/react-copy-to-clipboard": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@types/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.4.tgz", - "integrity": "sha512-otTJsJpofYAeaIeOwV5xBUGpo6exXG2HX7X4nseToCB2VgPEBxGBHCm/FecZ676doNR7HCSTVtmohxfG2b3/yQ==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/@types/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.7.tgz", + "integrity": "sha512-Gft19D+as4M+9Whq1oglhmK49vqPhcLzk8WfvfLvaYMIPYanyfLy0+CwFucMJfdKoSFyySPmkkWn8/E6voQXjQ==", "dependencies": { "@types/react": "*" } }, "node_modules/@types/react-dom": { - "version": "17.0.19", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.19.tgz", - "integrity": "sha512-PiYG40pnQRdPHnlf7tZnp0aQ6q9tspYr72vD61saO6zFCybLfMqwUCN0va1/P+86DXn18ZWeW30Bk7xlC5eEAQ==", + "version": "17.0.25", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.25.tgz", + "integrity": "sha512-urx7A7UxkZQmThYA4So0NelOVjx3V4rNFVJwp0WZlbIK5eM4rNJDiN3R/E9ix0MBh6kAEojk/9YL+Te6D9zHNA==", "dependencies": { "@types/react": "^17" } }, "node_modules/@types/react-redux": { - "version": "7.1.25", - "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.25.tgz", - "integrity": "sha512-bAGh4e+w5D8dajd6InASVIyCo4pZLJ66oLb80F9OBLO1gKESbZcRCJpTT6uLXX+HAB57zw1WTdwJdAsewuTweg==", + "version": "7.1.33", + "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.33.tgz", + "integrity": "sha512-NF8m5AjWCkert+fosDsN3hAlHzpjSiXlVy9EgQEmLoBhaNXbmyeGs/aj5dQzKuF+/q+S7JQagorGDW8pJ28Hmg==", "dependencies": { "@types/hoist-non-react-statics": "^3.3.0", "@types/react": "*", @@ -5782,17 +6119,17 @@ } }, "node_modules/@types/react-transition-group": { - "version": "4.4.5", - "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.5.tgz", - "integrity": "sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==", + "version": "4.4.10", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz", + "integrity": "sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==", "dependencies": { "@types/react": "*" } }, "node_modules/@types/react/node_modules/csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/@types/resolve": { "version": "1.17.1", @@ -5810,53 +6147,64 @@ "dev": true }, "node_modules/@types/scheduler": { - "version": "0.16.3", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.3.tgz", - "integrity": "sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==" + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", + "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==" }, "node_modules/@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz", + "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==", "dev": true }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, "node_modules/@types/serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg==", + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.4.tgz", + "integrity": "sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug==", "dev": true, "dependencies": { "@types/express": "*" } }, "node_modules/@types/serve-static": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.1.tgz", - "integrity": "sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", + "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", "dev": true, "dependencies": { + "@types/http-errors": "*", "@types/mime": "*", "@types/node": "*" } }, "node_modules/@types/sockjs": { - "version": "0.3.33", - "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz", - "integrity": "sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==", + "version": "0.3.36", + "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz", + "integrity": "sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/sockjs-client": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@types/sockjs-client/-/sockjs-client-1.5.1.tgz", - "integrity": "sha512-bmZM6A1GPdjF0bcuIUC+50hZEMGkzMsiG9by6X9U+7IZFOiPtz7MJ9h05FSpPVxlj4i+TzzoG3ESo1FJlbLb6A==" + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/sockjs-client/-/sockjs-client-1.5.4.tgz", + "integrity": "sha512-zk+uFZeWyvJ5ZFkLIwoGA/DfJ+pYzcZ8eH4H/EILCm2OBZyHH6Hkdna1/UWL/CFruh5wj6ES7g75SvUB0VsH5w==" }, "node_modules/@types/stack-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, "node_modules/@types/styled-jsx": { @@ -5868,57 +6216,57 @@ } }, "node_modules/@types/trusted-types": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.3.tgz", - "integrity": "sha512-NfQ4gyz38SL8sDNrSixxU2Os1a5xcdFxipAFxYEuLUlvU2uDwS4NUpsImcf1//SlWItCVMMLiylsxbmNMToV/g==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", "dev": true }, "node_modules/@types/ua-parser-js": { - "version": "0.7.36", - "resolved": "https://registry.npmjs.org/@types/ua-parser-js/-/ua-parser-js-0.7.36.tgz", - "integrity": "sha512-N1rW+njavs70y2cApeIw1vLMYXRwfBy+7trgavGuuTfOd7j1Yh7QTRc/yqsPl6ncokt72ZXuxEU0PiCp9bSwNQ==" + "version": "0.7.39", + "resolved": "https://registry.npmjs.org/@types/ua-parser-js/-/ua-parser-js-0.7.39.tgz", + "integrity": "sha512-P/oDfpofrdtF5xw433SPALpdSchtJmY7nsJItf8h3KXqOslkbySh8zq4dSWXH2oTjRvJ5PczVEoCZPow6GicLg==" }, "node_modules/@types/wicg-file-system-access": { - "version": "2020.9.5", - "resolved": "https://registry.npmjs.org/@types/wicg-file-system-access/-/wicg-file-system-access-2020.9.5.tgz", - "integrity": "sha512-UYK244awtmcUYQfs7FR8710MJcefL2WvkyHMjA8yJzxd1mo0Gfn88sRZ1Bls7hiUhA2w7ne1gpJ9T5g3G0wOyA==" + "version": "2023.10.4", + "resolved": "https://registry.npmjs.org/@types/wicg-file-system-access/-/wicg-file-system-access-2023.10.4.tgz", + "integrity": "sha512-ewOj7hWhsUTS2+aY6zY+7BwlgqGBj5ZXxKuHt3TAWpIJH0bDW/6bO1N1SdUDAzV8r0Nc+/ZtpAEETYTwrehBMw==" }, "node_modules/@types/ws": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", - "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", + "version": "8.5.10", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", + "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/yargs": { - "version": "17.0.24", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", - "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", + "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", "dev": true, "dependencies": { "@types/yargs-parser": "*" } }, "node_modules/@types/yargs-parser": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.57.1.tgz", - "integrity": "sha512-1MeobQkQ9tztuleT3v72XmY0XuKXVXusAhryoLuU5YZ+mXoYKZP9SQ7Flulh1NX4DTjpGTc2b/eMu4u7M7dhnQ==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", + "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/type-utils": "5.57.1", - "@typescript-eslint/utils": "5.57.1", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/type-utils": "5.62.0", + "@typescript-eslint/utils": "5.62.0", "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.0", "natural-compare-lite": "^1.4.0", "semver": "^7.3.7", @@ -5954,9 +6302,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -5975,12 +6323,12 @@ "dev": true }, "node_modules/@typescript-eslint/experimental-utils": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.57.1.tgz", - "integrity": "sha512-5F5s8mpM1Y0RQ5iWzKQPQm5cmhARgcMfUwyHX1ZZFL8Tm0PyzyQ+9jgYSMaW74XXvpDg9/KdmMICLlwNwKtO7w==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.62.0.tgz", + "integrity": "sha512-RTXpeB3eMkpoclG3ZHft6vG/Z30azNHuqY6wKPBHlVMZFuEvrtlEDe8gMqDb+SO+9hjC/pLekeSCryf9vMZlCw==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "5.57.1" + "@typescript-eslint/utils": "5.62.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -5994,14 +6342,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.57.1.tgz", - "integrity": "sha512-hlA0BLeVSA/wBPKdPGxoVr9Pp6GutGoY380FEhbVi0Ph4WNe8kLvqIRx76RSQt1lynZKfrXKs0/XeEk4zZycuA==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/typescript-estree": "5.57.1", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", "debug": "^4.3.4" }, "engines": { @@ -6021,13 +6369,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.57.1.tgz", - "integrity": "sha512-N/RrBwEUKMIYxSKl0oDK5sFVHd6VI7p9K5MyUlVYAY6dyNb/wHUqndkTd3XhpGlXgnQsBkRZuu4f9kAHghvgPw==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/visitor-keys": "5.57.1" + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -6038,13 +6386,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.57.1.tgz", - "integrity": "sha512-/RIPQyx60Pt6ga86hKXesXkJ2WOS4UemFrmmq/7eOyiYjYv/MUSHPlkhU6k9T9W1ytnTJueqASW+wOmW4KrViw==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.57.1", - "@typescript-eslint/utils": "5.57.1", + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -6065,9 +6413,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.57.1.tgz", - "integrity": "sha512-bSs4LOgyV3bJ08F5RDqO2KXqg3WAdwHCu06zOqcQ6vqbTJizyBhuh1o1ImC69X4bV2g1OJxbH71PJqiO7Y1RuA==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -6078,13 +6426,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.1.tgz", - "integrity": "sha512-A2MZqD8gNT0qHKbk2wRspg7cHbCDCk2tcqt6ScCFLr5Ru8cn+TCfM786DjPhqwseiS+PrYwcXht5ztpEQ6TFTw==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/visitor-keys": "5.57.1", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -6117,9 +6465,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -6138,17 +6486,17 @@ "dev": true }, "node_modules/@typescript-eslint/utils": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.57.1.tgz", - "integrity": "sha512-kN6vzzf9NkEtawECqze6v99LtmDiUJCVpvieTFA1uL7/jDghiJGubGZ5csicYHU1Xoqb3oH/R5cN5df6W41Nfg==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", + "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.57.1", - "@typescript-eslint/types": "5.57.1", - "@typescript-eslint/typescript-estree": "5.57.1", + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", "eslint-scope": "^5.1.1", "semver": "^7.3.7" }, @@ -6198,9 +6546,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -6219,12 +6567,12 @@ "dev": true }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.57.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.1.tgz", - "integrity": "sha512-RjQrAniDU0CEk5r7iphkm731zKlFiUjvcBS2yHAg8WWqFMCaCrD0rKEVOMUyMMcbGPZ0bPp56srkGWrgfZqLRA==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.57.1", + "@typescript-eslint/types": "5.62.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -6235,149 +6583,155 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", - "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", + "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", "dev": true, "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" } }, "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", - "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", "dev": true }, "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", - "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", "dev": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", - "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", + "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", "dev": true }, "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", - "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", "dev": true, "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", - "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", "dev": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", - "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", + "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1" + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6" } }, "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", - "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", "dev": true, "dependencies": { "@xtuc/ieee754": "^1.2.0" } }, "node_modules/@webassemblyjs/leb128": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", - "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", "dev": true, "dependencies": { "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/utf8": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", - "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", "dev": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", - "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", + "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/helper-wasm-section": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-opt": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", - "@webassemblyjs/wast-printer": "1.11.1" + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-opt": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6", + "@webassemblyjs/wast-printer": "1.11.6" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", - "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", + "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", - "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", + "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1" + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", - "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", + "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", - "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", + "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/ast": "1.11.6", "@xtuc/long": "4.2.2" } }, @@ -6397,6 +6751,7 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "deprecated": "Use your platform's native atob() and btoa() methods instead", "dev": true }, "node_modules/abbrev": { @@ -6419,9 +6774,9 @@ } }, "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", + "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -6431,19 +6786,31 @@ } }, "node_modules/acorn-globals": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", - "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", "dev": true, "dependencies": { - "acorn": "^8.1.0", - "acorn-walk": "^8.0.2" + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" + } + }, + "node_modules/acorn-globals/node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" } }, "node_modules/acorn-import-assertions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", "dev": true, "peerDependencies": { "acorn": "^8" @@ -6459,9 +6826,9 @@ } }, "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", "dev": true, "engines": { "node": ">=0.4.0" @@ -6490,15 +6857,15 @@ } }, "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "devOptional": true, + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, "dependencies": { - "debug": "4" + "debug": "^4.3.4" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 14" } }, "node_modules/ajv": { @@ -6663,12 +7030,12 @@ "dev": true }, "node_modules/aria-query": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz", - "integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "dev": true, "dependencies": { - "deep-equal": "^2.0.5" + "dequal": "^2.0.3" } }, "node_modules/array-buffer-byte-length": { @@ -6691,15 +7058,15 @@ "dev": true }, "node_modules/array-includes": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", - "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.7.tgz", + "integrity": "sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "get-intrinsic": "^1.1.3", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", "is-string": "^1.0.7" }, "engines": { @@ -6718,15 +7085,34 @@ "node": ">=8" } }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", + "integrity": "sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-shim-unscopables": "^1.0.0", + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array.prototype.flat": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", - "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", + "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -6737,14 +7123,14 @@ } }, "node_modules/array.prototype.flatmap": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", - "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", + "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0" }, "engines": { @@ -6755,14 +7141,14 @@ } }, "node_modules/array.prototype.reduce": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz", - "integrity": "sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.6.tgz", + "integrity": "sha512-UW+Mz8LG/sPSU8jRDCjVr6J/ZKAGpHfwrZ6kWTG5qCxIEiXdVshqGnu5vEZA8S1y6X4aCSbQZ0/EEsfvEvBiSg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-array-method-boxes-properly": "^1.0.0", "is-string": "^1.0.7" }, @@ -6774,16 +7160,37 @@ } }, "node_modules/array.prototype.tosorted": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.1.tgz", - "integrity": "sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.2.tgz", + "integrity": "sha512-HuQCHOlk1Weat5jzStICBCd83NxiIMwqDg/dHEsoefabn/hJRj5pVdWcPUSpRrwhwxZOsQassMpgN/xRYFBMIg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", "es-shim-unscopables": "^1.0.0", - "get-intrinsic": "^1.1.3" + "get-intrinsic": "^1.2.1" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.2.tgz", + "integrity": "sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "is-array-buffer": "^3.0.2", + "is-shared-array-buffer": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/asap": { @@ -6793,17 +7200,26 @@ "dev": true }, "node_modules/ast-types-flow": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.7.tgz", - "integrity": "sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ast-types-flow/-/ast-types-flow-0.0.8.tgz", + "integrity": "sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==", "dev": true }, "node_modules/async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", "dev": true }, + "node_modules/asynciterator.prototype": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/asynciterator.prototype/-/asynciterator.prototype-1.0.0.tgz", + "integrity": "sha512-wwHYEIS0Q80f5mosx3L/dfG5t5rjEa9Ft51GTaNt862EnpyGHpgz2RkZvLPp1oF5TnAiTohkEKVEu8pQPJI7Vg==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.3" + } + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -6831,9 +7247,9 @@ } }, "node_modules/autoprefixer": { - "version": "10.4.14", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.14.tgz", - "integrity": "sha512-FQzyfOsTlwVzjHxKEqRIAdJx9niO6VCBCoEwax/VLSoQF29ggECcPuBqUMZ+u8jCZOPSy8b8/8KnuFbp0SaFZQ==", + "version": "10.4.16", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz", + "integrity": "sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==", "dev": true, "funding": [ { @@ -6843,12 +7259,16 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "browserslist": "^4.21.5", - "caniuse-lite": "^1.0.30001464", - "fraction.js": "^4.2.0", + "browserslist": "^4.21.10", + "caniuse-lite": "^1.0.30001538", + "fraction.js": "^4.3.6", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", "postcss-value-parser": "^4.2.0" @@ -6876,21 +7296,21 @@ } }, "node_modules/axe-core": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.6.3.tgz", - "integrity": "sha512-/BQzOX780JhsxDnPpH4ZiyrJAzcd8AfzFPkv+89veFSr1rcMjuq2JDCwypKaPeB6ljHp9KjXhPpjgCvQlWYuqg==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.0.tgz", + "integrity": "sha512-M0JtH+hlOL5pLQwHOLNYZaXuhqmvS8oExsqB1SBYgA4Dk7u/xx+YdGHXaK5pyUfed5mYXdlYiphWq3G8cRi5JQ==", "dev": true, "engines": { "node": ">=4" } }, "node_modules/axobject-query": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", - "integrity": "sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", + "integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==", "dev": true, "dependencies": { - "deep-equal": "^2.0.5" + "dequal": "^2.0.3" } }, "node_modules/babel-jest": { @@ -6958,9 +7378,9 @@ } }, "node_modules/babel-jest/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -7015,6 +7435,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/babel-jest/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "node_modules/babel-jest/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -7245,42 +7671,42 @@ } }, "node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz", - "integrity": "sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q==", + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.7.tgz", + "integrity": "sha512-LidDk/tEGDfuHW2DWh/Hgo4rmnw3cduK6ZkOI1NPFceSK3n/yAGeOsNT7FLnSGHkXj3RHGSEVkN3FsCTY6w2CQ==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.17.7", - "@babel/helper-define-polyfill-provider": "^0.3.3", - "semver": "^6.1.1" + "@babel/compat-data": "^7.22.6", + "@babel/helper-define-polyfill-provider": "^0.4.4", + "semver": "^6.3.1" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz", - "integrity": "sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA==", + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.7.tgz", + "integrity": "sha512-KyDvZYxAzkC0Aj2dAPyDzi2Ym15e5JKZSK+maI7NAwSqofvuFglbSsxE7wUOvTg9oFVnHMzVzBKcqEb4PJgtOA==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.3.3", - "core-js-compat": "^3.25.1" + "@babel/helper-define-polyfill-provider": "^0.4.4", + "core-js-compat": "^3.33.1" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz", - "integrity": "sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.4.tgz", + "integrity": "sha512-S/x2iOCvDaCASLYsOOgWOq4bCfKYVqvO/uxjkaYyZ3rVsVE3CeAI/c84NpyuBBymEgNvHgjEot3a9/Z/kXvqsg==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.3.3" + "@babel/helper-define-polyfill-provider": "^0.4.4" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "node_modules/babel-plugin-transform-react-remove-prop-types": { @@ -7374,14 +7800,15 @@ "dev": true }, "node_modules/bfj": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/bfj/-/bfj-7.0.2.tgz", - "integrity": "sha512-+e/UqUzwmzJamNF50tBV6tZPTORow7gQ96iFow+8b562OdMpEK0BcJEq2OSPEDmAbSMBQ7PKZ87ubFkgxpYWgw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/bfj/-/bfj-7.1.0.tgz", + "integrity": "sha512-I6MMLkn+anzNdCUp9hMRyui1HaNEUCco50lxbvNS4+EyXg8lN3nJ48PjPWtbH8UVS9CuMoaKE9U2V3l29DaRQw==", "dev": true, "dependencies": { - "bluebird": "^3.5.5", - "check-types": "^11.1.1", + "bluebird": "^3.7.2", + "check-types": "^11.2.3", "hoopy": "^0.1.4", + "jsonpath": "^1.1.1", "tryer": "^1.0.1" }, "engines": { @@ -7504,9 +7931,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.21.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", - "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "version": "4.22.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz", + "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==", "dev": true, "funding": [ { @@ -7516,13 +7943,17 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "caniuse-lite": "^1.0.30001449", - "electron-to-chromium": "^1.4.284", - "node-releases": "^2.0.8", - "update-browserslist-db": "^1.0.10" + "caniuse-lite": "^1.0.30001565", + "electron-to-chromium": "^1.4.601", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" }, "bin": { "browserslist": "cli.js" @@ -7579,13 +8010,14 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -7640,9 +8072,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001474", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001474.tgz", - "integrity": "sha512-iaIZ8gVrWfemh5DG3T9/YqarVZoYf0r188IjaGwx68j4Pf0SGY6CQkmJUIE+NZHkkecQGohzXmBGEwWDr9aM3Q==", + "version": "1.0.30001570", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz", + "integrity": "sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw==", "dev": true, "funding": [ { @@ -7693,6 +8125,12 @@ "node": ">=10.0.0" } }, + "node_modules/canvg/node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "optional": true + }, "node_modules/case-sensitive-paths-webpack-plugin": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz", @@ -7725,9 +8163,9 @@ } }, "node_modules/check-types": { - "version": "11.2.2", - "resolved": "https://registry.npmjs.org/check-types/-/check-types-11.2.2.tgz", - "integrity": "sha512-HBiYvXvn9Z70Z88XKjz3AEKd4HJhBXsa3j7xFnITAzoS8+q6eIGi8qDB8FKPBAjtuxjI/zFpwuiCb8oDtKOYrA==", + "version": "11.2.3", + "resolved": "https://registry.npmjs.org/check-types/-/check-types-11.2.3.tgz", + "integrity": "sha512-+67P1GkJRaxQD6PKK0Et9DhwQB+vGg3PM5+aavopCpZT1lj9jeqfvpgTLAWErNj8qApkkmXlu/Ug74kmhagkXg==", "dev": true }, "node_modules/chokidar": { @@ -7776,9 +8214,9 @@ } }, "node_modules/ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", "dev": true, "funding": [ { @@ -7791,9 +8229,9 @@ } }, "node_modules/cjs-module-lexer": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", - "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", "dev": true }, "node_modules/classnames": { @@ -7802,9 +8240,9 @@ "integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==" }, "node_modules/clean-css": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.2.0.tgz", - "integrity": "sha512-2639sWGa43EMmG7fn8mdVuBSs6HuWaSor+ZPoFWzenBc6oN+td8YhTfghWXZ25G1NiiSvz8bOFBS7PdSbTiqEA==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.3.tgz", + "integrity": "sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==", "dev": true, "dependencies": { "source-map": "~0.6.0" @@ -7825,9 +8263,9 @@ } }, "node_modules/clsx": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", - "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz", + "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==", "engines": { "node": ">=6" } @@ -7857,9 +8295,9 @@ } }, "node_modules/collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true }, "node_modules/color-convert": { @@ -7891,9 +8329,9 @@ "dev": true }, "node_modules/colorette": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", - "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, "node_modules/combined-stream": { @@ -7909,12 +8347,12 @@ } }, "node_modules/commander": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", - "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", "dev": true, "engines": { - "node": "^12.20.0 || >=14" + "node": ">=16" } }, "node_modules/common-path-prefix": { @@ -8047,15 +8485,15 @@ } }, "node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true }, "node_modules/cookie": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", - "dev": true, "engines": { "node": ">= 0.6" } @@ -8075,9 +8513,9 @@ } }, "node_modules/core-js": { - "version": "3.30.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.30.0.tgz", - "integrity": "sha512-hQotSSARoNh1mYPi9O2YaWeiq/cEB95kOrFb4NCrO4RIFt1qqNpKsaE+vy/L3oiqvND5cThqXzUU3r9F7Efztg==", + "version": "3.34.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.34.0.tgz", + "integrity": "sha512-aDdvlDder8QmY91H88GzNi9EtQi2TjvQhpCX6B1v/dAZHU1AuLgHvRh54RiOerpEhEW46Tkf+vgAViB/CWC0ag==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -8085,12 +8523,12 @@ } }, "node_modules/core-js-compat": { - "version": "3.30.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.30.0.tgz", - "integrity": "sha512-P5A2h/9mRYZFIAP+5Ab8ns6083IyVpSclU74UNvbGVQ8VM7n3n3/g2yF3AkKQ9NXz2O+ioxLbEWKnDtgsFamhg==", + "version": "3.34.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.34.0.tgz", + "integrity": "sha512-4ZIyeNbW/Cn1wkMMDy+mvrRUxrwFNjKwbhCfQpDd+eLgYipDqp8oGFGtLmhh18EDPKA0g3VUBYOxQGGwvWLVpA==", "dev": true, "dependencies": { - "browserslist": "^4.21.5" + "browserslist": "^4.22.2" }, "funding": { "type": "opencollective", @@ -8098,9 +8536,9 @@ } }, "node_modules/core-js-pure": { - "version": "3.30.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.30.0.tgz", - "integrity": "sha512-+2KbMFGeBU0ln/csoPqTe0i/yfHbrd2EUhNMObsGtXMKS/RTtlkYyi+/3twLcevbgNR0yM/r0Psa3TEoQRpFMQ==", + "version": "3.34.0", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.34.0.tgz", + "integrity": "sha512-pmhivkYXkymswFfbXsANmBAewXx86UBfmagP+w0wkK06kLsLlTK5oQmsURPivzMkIBQiYq2cjamcZExIwlFQIg==", "dev": true, "hasInstallScript": true, "funding": { @@ -8179,12 +8617,12 @@ } }, "node_modules/css-declaration-sorter": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.4.0.tgz", - "integrity": "sha512-jDfsatwWMWN0MODAFuHszfjphEXfNw9JUAhmY4pLu3TyTU+ohUpsbVtbU+1MZn4a47D9kqh03i4eyOm+74+zew==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-7.1.1.tgz", + "integrity": "sha512-dZ3bVTEEc1vxr3Bek9vGwfB5Z6ESPULhcRvO472mfjVnj8jRcTnKO8/JTczlvxM10Myb+wBM++1MtdO76eWcaQ==", "dev": true, "engines": { - "node": "^10 || ^12 || >=14" + "node": "^14 || ^16 || >=18" }, "peerDependencies": { "postcss": "^8.0.9" @@ -8218,15 +8656,15 @@ } }, "node_modules/css-loader": { - "version": "6.7.3", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.7.3.tgz", - "integrity": "sha512-qhOH1KlBMnZP8FzRO6YCH9UHXQhVMcEGLyNdb7Hv2cpcmJbW0YrddO+tG1ab5nT41KpHIYGsbeHqxB9xPu1pKQ==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.8.1.tgz", + "integrity": "sha512-xDAXtEVGlD0gJ07iclwWVkLoZOpEvAWaSyf6W18S2pOC//K8+qUDIx8IIT3D+HjnmkJPQeesOPv5aiUaJsCM2g==", "dev": true, "dependencies": { "icss-utils": "^5.1.0", - "postcss": "^8.4.19", + "postcss": "^8.4.21", "postcss-modules-extract-imports": "^3.0.0", - "postcss-modules-local-by-default": "^4.0.0", + "postcss-modules-local-by-default": "^4.0.3", "postcss-modules-scope": "^3.0.0", "postcss-modules-values": "^4.0.0", "postcss-value-parser": "^4.2.0", @@ -8256,9 +8694,9 @@ } }, "node_modules/css-loader/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -8342,113 +8780,692 @@ "ajv": "^8.8.2" } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/css-minimizer-webpack-plugin/node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true, "engines": { - "node": ">=8" + "node": ">= 10" } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/jest-worker": { - "version": "27.5.1", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", - "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "node_modules/css-minimizer-webpack-plugin/node_modules/css-declaration-sorter": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/css-declaration-sorter/-/css-declaration-sorter-6.4.1.tgz", + "integrity": "sha512-rtdthzxKuyq6IzqX6jEcIzQF/YqccluefyCYheovBOLhFT/drQA9zj/UbRAa9J7C0o6EG6u3E6g+vKkay7/k3g==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.0.9" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/css-tree": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", + "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", "dev": true, "dependencies": { - "@types/node": "*", - "merge-stream": "^2.0.0", - "supports-color": "^8.0.0" + "mdn-data": "2.0.14", + "source-map": "^0.6.1" }, "engines": { - "node": ">= 10.13.0" + "node": ">=8.0.0" } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/css-minimizer-webpack-plugin/node_modules/schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", + "node_modules/css-minimizer-webpack-plugin/node_modules/cssnano": { + "version": "5.1.15", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.1.15.tgz", + "integrity": "sha512-j+BKgDcLDQA+eDifLx0EO4XSA56b7uut3BQFH+wbSaSTuGLuiyTa/wbRYthUXX8LC9mLg+WWKe8h+qJuwTAbHw==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" + "cssnano-preset-default": "^5.2.14", + "lilconfig": "^2.0.3", + "yaml": "^1.10.2" }, "engines": { - "node": ">= 12.13.0" + "node": "^10 || ^12 || >=14.0" }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/webpack" + "url": "https://opencollective.com/cssnano" + }, + "peerDependencies": { + "postcss": "^8.2.15" } }, - "node_modules/css-minimizer-webpack-plugin/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "node_modules/css-minimizer-webpack-plugin/node_modules/cssnano-preset-default": { + "version": "5.2.14", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-5.2.14.tgz", + "integrity": "sha512-t0SFesj/ZV2OTylqQVOrFgEh5uanxbO6ZAdeCrNsUQ6fVuXwYTxJPNAGvGTxHbD68ldIJNec7PyYZDBrfDQ+6A==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "css-declaration-sorter": "^6.3.1", + "cssnano-utils": "^3.1.0", + "postcss-calc": "^8.2.3", + "postcss-colormin": "^5.3.1", + "postcss-convert-values": "^5.1.3", + "postcss-discard-comments": "^5.1.2", + "postcss-discard-duplicates": "^5.1.0", + "postcss-discard-empty": "^5.1.1", + "postcss-discard-overridden": "^5.1.0", + "postcss-merge-longhand": "^5.1.7", + "postcss-merge-rules": "^5.1.4", + "postcss-minify-font-values": "^5.1.0", + "postcss-minify-gradients": "^5.1.1", + "postcss-minify-params": "^5.1.4", + "postcss-minify-selectors": "^5.2.1", + "postcss-normalize-charset": "^5.1.0", + "postcss-normalize-display-values": "^5.1.0", + "postcss-normalize-positions": "^5.1.1", + "postcss-normalize-repeat-style": "^5.1.1", + "postcss-normalize-string": "^5.1.0", + "postcss-normalize-timing-functions": "^5.1.0", + "postcss-normalize-unicode": "^5.1.1", + "postcss-normalize-url": "^5.1.0", + "postcss-normalize-whitespace": "^5.1.1", + "postcss-ordered-values": "^5.1.3", + "postcss-reduce-initial": "^5.1.2", + "postcss-reduce-transforms": "^5.1.0", + "postcss-svgo": "^5.1.0", + "postcss-unique-selectors": "^5.1.1" }, "engines": { - "node": ">=10" + "node": "^10 || ^12 || >=14.0" }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "peerDependencies": { + "postcss": "^8.2.15" } }, - "node_modules/css-prefers-color-scheme": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/css-prefers-color-scheme/-/css-prefers-color-scheme-6.0.3.tgz", - "integrity": "sha512-4BqMbZksRkJQx2zAjrokiGMd07RqOa2IxIrrN10lyBe9xhn9DEvjUK79J6jkeiv9D9hQFXKb6g1jwU62jziJZA==", + "node_modules/css-minimizer-webpack-plugin/node_modules/cssnano-utils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-3.1.0.tgz", + "integrity": "sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA==", "dev": true, - "bin": { - "css-prefers-color-scheme": "dist/cli.cjs" - }, "engines": { - "node": "^12 || ^14 || >=16" + "node": "^10 || ^12 || >=14.0" }, "peerDependencies": { - "postcss": "^8.4" + "postcss": "^8.2.15" } }, - "node_modules/css-select": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", - "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "node_modules/css-minimizer-webpack-plugin/node_modules/csso": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", + "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", "dev": true, "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.0.1", - "domhandler": "^4.3.1", - "domutils": "^2.8.0", - "nth-check": "^2.0.1" + "css-tree": "^1.1.2" }, - "funding": { - "url": "https://github.com/sponsors/fb55" + "engines": { + "node": ">=8.0.0" } }, - "node_modules/css-select-base-adapter": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", - "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", - "dev": true + "node_modules/css-minimizer-webpack-plugin/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "node_modules/css-select/node_modules/dom-serializer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", - "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", + "node_modules/css-minimizer-webpack-plugin/node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", "dev": true, "dependencies": { - "domelementtype": "^2.0.1", + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/mdn-data": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", + "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "dev": true + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-calc": { + "version": "8.2.4", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-8.2.4.tgz", + "integrity": "sha512-SmWMSJmB8MRnnULldx0lQIyhSNvuDl9HfrZkaqqE/WHAhToYsAvDq+yAsA/kIyINDszOp3Rh0GFoNuH5Ypsm3Q==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^6.0.9", + "postcss-value-parser": "^4.2.0" + }, + "peerDependencies": { + "postcss": "^8.2.2" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-colormin": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-5.3.1.tgz", + "integrity": "sha512-UsWQG0AqTFQmpBegeLLc1+c3jIqBNB0zlDGRWR+dQ3pRKJL1oeMzyqmH3o2PIfn9MBdNrVPWhDbT769LxCTLJQ==", + "dev": true, + "dependencies": { + "browserslist": "^4.21.4", + "caniuse-api": "^3.0.0", + "colord": "^2.9.1", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-convert-values": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-5.1.3.tgz", + "integrity": "sha512-82pC1xkJZtcJEfiLw6UXnXVXScgtBrjlO5CBmuDQc+dlb88ZYheFsjTn40+zBVi3DkfF7iezO0nJUPLcJK3pvA==", + "dev": true, + "dependencies": { + "browserslist": "^4.21.4", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-discard-comments": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-5.1.2.tgz", + "integrity": "sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-discard-duplicates": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-5.1.0.tgz", + "integrity": "sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-discard-empty": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-5.1.1.tgz", + "integrity": "sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-discard-overridden": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.1.0.tgz", + "integrity": "sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-merge-longhand": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-5.1.7.tgz", + "integrity": "sha512-YCI9gZB+PLNskrK0BB3/2OzPnGhPkBEwmwhfYk1ilBHYVAZB7/tkTHFBAnCrvBBOmeYyMYw3DMjT55SyxMBzjQ==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0", + "stylehacks": "^5.1.1" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-merge-rules": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-5.1.4.tgz", + "integrity": "sha512-0R2IuYpgU93y9lhVbO/OylTtKMVcHb67zjWIfCiKR9rWL3GUk1677LAqD/BcHizukdZEjT8Ru3oHRoAYoJy44g==", + "dev": true, + "dependencies": { + "browserslist": "^4.21.4", + "caniuse-api": "^3.0.0", + "cssnano-utils": "^3.1.0", + "postcss-selector-parser": "^6.0.5" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-minify-font-values": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-5.1.0.tgz", + "integrity": "sha512-el3mYTgx13ZAPPirSVsHqFzl+BBBDrXvbySvPGFnQcTI4iNslrPaFq4muTkLZmKlGk4gyFAYUBMH30+HurREyA==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-minify-gradients": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-5.1.1.tgz", + "integrity": "sha512-VGvXMTpCEo4qHTNSa9A0a3D+dxGFZCYwR6Jokk+/3oB6flu2/PnPXAh2x7x52EkY5xlIHLm+Le8tJxe/7TNhzw==", + "dev": true, + "dependencies": { + "colord": "^2.9.1", + "cssnano-utils": "^3.1.0", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-minify-params": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-5.1.4.tgz", + "integrity": "sha512-+mePA3MgdmVmv6g+30rn57USjOGSAyuxUmkfiWpzalZ8aiBkdPYjXWtHuwJGm1v5Ojy0Z0LaSYhHaLJQB0P8Jw==", + "dev": true, + "dependencies": { + "browserslist": "^4.21.4", + "cssnano-utils": "^3.1.0", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-minify-selectors": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-5.2.1.tgz", + "integrity": "sha512-nPJu7OjZJTsVUmPdm2TcaiohIwxP+v8ha9NehQ2ye9szv4orirRU3SDdtUmKH+10nzn0bAyOXZ0UEr7OpvLehg==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^6.0.5" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-normalize-charset": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.1.0.tgz", + "integrity": "sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-normalize-display-values": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-5.1.0.tgz", + "integrity": "sha512-WP4KIM4o2dazQXWmFaqMmcvsKmhdINFblgSeRgn8BJ6vxaMyaJkwAzpPpuvSIoG/rmX3M+IrRZEz2H0glrQNEA==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-normalize-positions": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-5.1.1.tgz", + "integrity": "sha512-6UpCb0G4eofTCQLFVuI3EVNZzBNPiIKcA1AKVka+31fTVySphr3VUgAIULBhxZkKgwLImhzMR2Bw1ORK+37INg==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-normalize-repeat-style": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.1.1.tgz", + "integrity": "sha512-mFpLspGWkQtBcWIRFLmewo8aC3ImN2i/J3v8YCFUwDnPu3Xz4rLohDO26lGjwNsQxB3YF0KKRwspGzE2JEuS0g==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-normalize-string": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-5.1.0.tgz", + "integrity": "sha512-oYiIJOf4T9T1N4i+abeIc7Vgm/xPCGih4bZz5Nm0/ARVJ7K6xrDlLwvwqOydvyL3RHNf8qZk6vo3aatiw/go3w==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-normalize-timing-functions": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-5.1.0.tgz", + "integrity": "sha512-DOEkzJ4SAXv5xkHl0Wa9cZLF3WCBhF3o1SKVxKQAa+0pYKlueTpCgvkFAHfk+Y64ezX9+nITGrDZeVGgITJXjg==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-normalize-unicode": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-5.1.1.tgz", + "integrity": "sha512-qnCL5jzkNUmKVhZoENp1mJiGNPcsJCs1aaRmURmeJGES23Z/ajaln+EPTD+rBeNkSryI+2WTdW+lwcVdOikrpA==", + "dev": true, + "dependencies": { + "browserslist": "^4.21.4", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-normalize-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-5.1.0.tgz", + "integrity": "sha512-5upGeDO+PVthOxSmds43ZeMeZfKH+/DKgGRD7TElkkyS46JXAUhMzIKiCa7BabPeIy3AQcTkXwVVN7DbqsiCew==", + "dev": true, + "dependencies": { + "normalize-url": "^6.0.1", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-normalize-whitespace": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-5.1.1.tgz", + "integrity": "sha512-83ZJ4t3NUDETIHTa3uEg6asWjSBYL5EdkVB0sDncx9ERzOKBVJIUeDO9RyA9Zwtig8El1d79HBp0JEi8wvGQnA==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-ordered-values": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-5.1.3.tgz", + "integrity": "sha512-9UO79VUhPwEkzbb3RNpqqghc6lcYej1aveQteWY+4POIwlqkYE21HKWaLDF6lWNuqCobEAyTovVhtI32Rbv2RQ==", + "dev": true, + "dependencies": { + "cssnano-utils": "^3.1.0", + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-reduce-initial": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-5.1.2.tgz", + "integrity": "sha512-dE/y2XRaqAi6OvjzD22pjTUQ8eOfc6m/natGHgKFBK9DxFmIm69YmaRVQrGgFlEfc1HePIurY0TmDeROK05rIg==", + "dev": true, + "dependencies": { + "browserslist": "^4.21.4", + "caniuse-api": "^3.0.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-reduce-transforms": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-5.1.0.tgz", + "integrity": "sha512-2fbdbmgir5AvpW9RLtdONx1QoYG2/EtqpNQbFASDlixBbAYuTcJ0dECwlqNqH7VbaUnEnh8SrxOe2sRIn24XyQ==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-svgo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-5.1.0.tgz", + "integrity": "sha512-D75KsH1zm5ZrHyxPakAxJWtkyXew5qwS70v56exwvw542d9CRtTo78K0WeFxZB4G7JXKKMbEZtZayTGdIky/eA==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0", + "svgo": "^2.7.0" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/postcss-unique-selectors": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-5.1.1.tgz", + "integrity": "sha512-5JiODlELrz8L2HwxfPnhOWZYWDxVHWL83ufOv84NrcgipI7TaeRsatAhK4Tr2/ZiYldpK/wBvw5BD3qfaK96GA==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^6.0.5" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/schema-utils": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/stylehacks": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-5.1.1.tgz", + "integrity": "sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==", + "dev": true, + "dependencies": { + "browserslist": "^4.21.4", + "postcss-selector-parser": "^6.0.4" + }, + "engines": { + "node": "^10 || ^12 || >=14.0" + }, + "peerDependencies": { + "postcss": "^8.2.15" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/css-minimizer-webpack-plugin/node_modules/svgo": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", + "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", + "dev": true, + "dependencies": { + "@trysound/sax": "0.2.0", + "commander": "^7.2.0", + "css-select": "^4.1.3", + "css-tree": "^1.1.3", + "csso": "^4.2.0", + "picocolors": "^1.0.0", + "stable": "^0.1.8" + }, + "bin": { + "svgo": "bin/svgo" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/css-prefers-color-scheme": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/css-prefers-color-scheme/-/css-prefers-color-scheme-6.0.3.tgz", + "integrity": "sha512-4BqMbZksRkJQx2zAjrokiGMd07RqOa2IxIrrN10lyBe9xhn9DEvjUK79J6jkeiv9D9hQFXKb6g1jwU62jziJZA==", + "dev": true, + "bin": { + "css-prefers-color-scheme": "dist/cli.cjs" + }, + "engines": { + "node": "^12 || ^14 || >=16" + }, + "peerDependencies": { + "postcss": "^8.4" + } + }, + "node_modules/css-select": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", + "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.0.1", + "domhandler": "^4.3.1", + "domutils": "^2.8.0", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-select-base-adapter": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/css-select-base-adapter/-/css-select-base-adapter-0.1.1.tgz", + "integrity": "sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==", + "dev": true + }, + "node_modules/css-select/node_modules/dom-serializer": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", + "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", + "dev": true, + "dependencies": { + "domelementtype": "^2.0.1", "domhandler": "^4.2.0", "entities": "^2.0.0" }, @@ -8495,16 +9512,16 @@ } }, "node_modules/css-tree": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-1.1.3.tgz", - "integrity": "sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", + "integrity": "sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==", "dev": true, "dependencies": { - "mdn-data": "2.0.14", - "source-map": "^0.6.1" + "mdn-data": "2.0.30", + "source-map-js": "^1.0.1" }, "engines": { - "node": ">=8.0.0" + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" } }, "node_modules/css-vendor": { @@ -8529,14 +9546,20 @@ } }, "node_modules/cssdb": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-7.5.3.tgz", - "integrity": "sha512-NQNRhrEnS6cW+RU/foLphb6xI/MDA70bI3Cy6VxJU8ilxgyTYz1X9zUzFGVTG5nGPylcKAGIt/UNc4deT56lQQ==", + "version": "7.9.1", + "resolved": "https://registry.npmjs.org/cssdb/-/cssdb-7.9.1.tgz", + "integrity": "sha512-fqy6ZnNfpb8qAvTT0qijWyTsUmYThsDX2F2ctMG4ceI7mI4DtsMILSiMBiuuDnVIYTyWvCctdp9Nb08p/6m2SQ==", "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/csstools" - } + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + }, + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + } + ] }, "node_modules/cssesc": { "version": "3.0.0", @@ -8557,117 +9580,131 @@ "dev": true }, "node_modules/cssnano": { - "version": "5.1.15", - "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-5.1.15.tgz", - "integrity": "sha512-j+BKgDcLDQA+eDifLx0EO4XSA56b7uut3BQFH+wbSaSTuGLuiyTa/wbRYthUXX8LC9mLg+WWKe8h+qJuwTAbHw==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-6.0.2.tgz", + "integrity": "sha512-Tu9wv8UdN6CoiQnIVkCNvi+0rw/BwFWOJBlg2bVfEyKaadSuE3Gq/DD8tniVvggTJGwK88UjqZp7zL5sv6t1aA==", "dev": true, "dependencies": { - "cssnano-preset-default": "^5.2.14", - "lilconfig": "^2.0.3", - "yaml": "^1.10.2" + "cssnano-preset-default": "^6.0.2", + "lilconfig": "^3.0.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/cssnano" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/cssnano-preset-default": { - "version": "5.2.14", - "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-5.2.14.tgz", - "integrity": "sha512-t0SFesj/ZV2OTylqQVOrFgEh5uanxbO6ZAdeCrNsUQ6fVuXwYTxJPNAGvGTxHbD68ldIJNec7PyYZDBrfDQ+6A==", - "dev": true, - "dependencies": { - "css-declaration-sorter": "^6.3.1", - "cssnano-utils": "^3.1.0", - "postcss-calc": "^8.2.3", - "postcss-colormin": "^5.3.1", - "postcss-convert-values": "^5.1.3", - "postcss-discard-comments": "^5.1.2", - "postcss-discard-duplicates": "^5.1.0", - "postcss-discard-empty": "^5.1.1", - "postcss-discard-overridden": "^5.1.0", - "postcss-merge-longhand": "^5.1.7", - "postcss-merge-rules": "^5.1.4", - "postcss-minify-font-values": "^5.1.0", - "postcss-minify-gradients": "^5.1.1", - "postcss-minify-params": "^5.1.4", - "postcss-minify-selectors": "^5.2.1", - "postcss-normalize-charset": "^5.1.0", - "postcss-normalize-display-values": "^5.1.0", - "postcss-normalize-positions": "^5.1.1", - "postcss-normalize-repeat-style": "^5.1.1", - "postcss-normalize-string": "^5.1.0", - "postcss-normalize-timing-functions": "^5.1.0", - "postcss-normalize-unicode": "^5.1.1", - "postcss-normalize-url": "^5.1.0", - "postcss-normalize-whitespace": "^5.1.1", - "postcss-ordered-values": "^5.1.3", - "postcss-reduce-initial": "^5.1.2", - "postcss-reduce-transforms": "^5.1.0", - "postcss-svgo": "^5.1.0", - "postcss-unique-selectors": "^5.1.1" - }, - "engines": { - "node": "^10 || ^12 || >=14.0" - }, - "peerDependencies": { - "postcss": "^8.2.15" + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/cssnano-preset-default/-/cssnano-preset-default-6.0.2.tgz", + "integrity": "sha512-VnZybFeZ63AiVqIUNlxqMxpj9VU8B5j0oKgP7WyVt/7mkyf97KsYkNzsPTV/RVmy54Pg7cBhOK4WATbdCB44gw==", + "dev": true, + "dependencies": { + "css-declaration-sorter": "^7.0.0", + "cssnano-utils": "^4.0.1", + "postcss-calc": "^9.0.1", + "postcss-colormin": "^6.0.1", + "postcss-convert-values": "^6.0.1", + "postcss-discard-comments": "^6.0.1", + "postcss-discard-duplicates": "^6.0.1", + "postcss-discard-empty": "^6.0.1", + "postcss-discard-overridden": "^6.0.1", + "postcss-merge-longhand": "^6.0.1", + "postcss-merge-rules": "^6.0.2", + "postcss-minify-font-values": "^6.0.1", + "postcss-minify-gradients": "^6.0.1", + "postcss-minify-params": "^6.0.1", + "postcss-minify-selectors": "^6.0.1", + "postcss-normalize-charset": "^6.0.1", + "postcss-normalize-display-values": "^6.0.1", + "postcss-normalize-positions": "^6.0.1", + "postcss-normalize-repeat-style": "^6.0.1", + "postcss-normalize-string": "^6.0.1", + "postcss-normalize-timing-functions": "^6.0.1", + "postcss-normalize-unicode": "^6.0.1", + "postcss-normalize-url": "^6.0.1", + "postcss-normalize-whitespace": "^6.0.1", + "postcss-ordered-values": "^6.0.1", + "postcss-reduce-initial": "^6.0.1", + "postcss-reduce-transforms": "^6.0.1", + "postcss-svgo": "^6.0.1", + "postcss-unique-selectors": "^6.0.1" + }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, + "peerDependencies": { + "postcss": "^8.4.31" } }, "node_modules/cssnano-utils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-3.1.0.tgz", - "integrity": "sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/cssnano-utils/-/cssnano-utils-4.0.1.tgz", + "integrity": "sha512-6qQuYDqsGoiXssZ3zct6dcMxiqfT6epy7x4R0TQJadd4LWO3sPR6JH6ZByOvVLoZ6EdwPGgd7+DR1EmX3tiXQQ==", "dev": true, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/csso": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/csso/-/csso-4.2.0.tgz", - "integrity": "sha512-wvlcdIbf6pwKEk7vHj8/Bkc0B4ylXZruLvOgs9doS5eOsOpuodOV2zJChSpkp+pRpYQLQMeF04nr3Z68Sta9jA==", + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", "dev": true, "dependencies": { - "css-tree": "^1.1.2" + "css-tree": "~2.2.0" }, "engines": { - "node": ">=8.0.0" + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/csso/node_modules/css-tree": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", + "dev": true, + "dependencies": { + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" } }, + "node_modules/csso/node_modules/mdn-data": { + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", + "dev": true + }, "node_modules/cssom": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", - "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", + "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", "dev": true }, "node_modules/cssstyle": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", - "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", + "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", "dev": true, "dependencies": { - "cssom": "~0.3.6" + "rrweb-cssom": "^0.6.0" }, "engines": { - "node": ">=8" + "node": ">=14" } }, - "node_modules/cssstyle/node_modules/cssom": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", - "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", - "dev": true - }, "node_modules/csstype": { "version": "2.6.21", "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.21.tgz", @@ -8770,17 +9807,16 @@ } }, "node_modules/data-urls": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", - "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", "dev": true, "dependencies": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0" + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/date-fns": { @@ -8843,34 +9879,6 @@ "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", "dev": true }, - "node_modules/deep-equal": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.0.tgz", - "integrity": "sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "es-get-iterator": "^1.1.2", - "get-intrinsic": "^1.1.3", - "is-arguments": "^1.1.1", - "is-array-buffer": "^3.0.1", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "isarray": "^2.0.5", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", - "side-channel": "^1.0.4", - "which-boxed-primitive": "^1.0.2", - "which-collection": "^1.0.1", - "which-typed-array": "^1.1.9" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -8892,10 +9900,24 @@ "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", "dev": true, "dependencies": { - "execa": "^5.0.0" + "execa": "^5.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" }, "engines": { - "node": ">= 10" + "node": ">= 0.4" } }, "node_modules/define-lazy-prop": { @@ -8908,11 +9930,12 @@ } }, "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, "dependencies": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, @@ -8947,6 +9970,15 @@ "node": ">= 0.8" } }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/destroy": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", @@ -8958,9 +9990,9 @@ } }, "node_modules/detect-libc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", - "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", + "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", "optional": true, "engines": { "node": ">=8" @@ -9020,9 +10052,9 @@ "dev": true }, "node_modules/diff-sequences": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", - "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -9053,9 +10085,9 @@ "dev": true }, "node_modules/dns-packet": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.5.0.tgz", - "integrity": "sha512-USawdAUzRkV6xrqTjiAEp6M9YagZEzWcSUaZTcIFAiyQWW1SoI6KyId8y2+/71wbgHKQAKd+iupLv4YvEwYWvA==", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz", + "integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==", "dev": true, "dependencies": { "@leichtgewicht/ip-codec": "^2.0.1" @@ -9095,9 +10127,9 @@ } }, "node_modules/dom-helpers/node_modules/csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/dom-serializer": { "version": "2.0.0", @@ -9129,15 +10161,25 @@ ] }, "node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", + "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "deprecated": "Use your platform's native DOMException instead", "dev": true, "dependencies": { - "webidl-conversions": "^7.0.0" + "webidl-conversions": "^5.0.0" }, "engines": { - "node": ">=12" + "node": ">=8" + } + }, + "node_modules/domexception/node_modules/webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", + "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "dev": true, + "engines": { + "node": ">=8" } }, "node_modules/domhandler": { @@ -9155,19 +10197,19 @@ } }, "node_modules/dompurify": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.5.tgz", - "integrity": "sha512-jggCCd+8Iqp4Tsz0nIvpcb22InKEBrGz5dw3EQJMs8HPJDsKbFIO3STYtAvCfDx26Muevn1MHVI0XxjgFfmiSA==", + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.7.tgz", + "integrity": "sha512-kxxKlPEDa6Nc5WJi+qRgPbOAbgTpSULL+vI3NUXsZMlkJxTqYI9wg5ZTay2sFrdZRWHPWNi+EdAhcJf81WtoMQ==", "optional": true }, "node_modules/domutils": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", - "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", "dependencies": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", - "domhandler": "^5.0.1" + "domhandler": "^5.0.3" }, "funding": { "url": "https://github.com/fb55/domutils?sponsor=1" @@ -9231,9 +10273,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.351", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.351.tgz", - "integrity": "sha512-W35n4jAsyj6OZGxeWe+gA6+2Md4jDO19fzfsRKEt3DBwIdlVTT8O9Uv8ojgUAoQeXASdgG9zMU+8n8Xg/W6dRQ==", + "version": "1.4.614", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.614.tgz", + "integrity": "sha512-X4ze/9Sc3QWs6h92yerwqv7aB/uU8vCjZcrMjA8N9R1pjMFRe44dLsck5FzLilOYvcXuDn93B+bpGYyufc70gQ==", "dev": true }, "node_modules/emittery": { @@ -9273,9 +10315,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz", - "integrity": "sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -9286,9 +10328,9 @@ } }, "node_modules/entities": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", - "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "engines": { "node": ">=0.12" }, @@ -9314,25 +10356,26 @@ } }, "node_modules/es-abstract": { - "version": "1.21.2", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", - "integrity": "sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==", + "version": "1.22.3", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.3.tgz", + "integrity": "sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.0", + "arraybuffer.prototype.slice": "^1.0.2", "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "call-bind": "^1.0.5", "es-set-tostringtag": "^2.0.1", "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.5", - "get-intrinsic": "^1.2.0", + "function.prototype.name": "^1.1.6", + "get-intrinsic": "^1.2.2", "get-symbol-description": "^1.0.0", "globalthis": "^1.0.3", "gopd": "^1.0.1", - "has": "^1.0.3", "has-property-descriptors": "^1.0.0", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", + "hasown": "^2.0.0", "internal-slot": "^1.0.5", "is-array-buffer": "^3.0.2", "is-callable": "^1.2.7", @@ -9340,19 +10383,23 @@ "is-regex": "^1.1.4", "is-shared-array-buffer": "^1.0.2", "is-string": "^1.0.7", - "is-typed-array": "^1.1.10", + "is-typed-array": "^1.1.12", "is-weakref": "^1.0.2", - "object-inspect": "^1.12.3", + "object-inspect": "^1.13.1", "object-keys": "^1.1.1", "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.4.3", + "regexp.prototype.flags": "^1.5.1", + "safe-array-concat": "^1.0.1", "safe-regex-test": "^1.0.0", - "string.prototype.trim": "^1.2.7", - "string.prototype.trimend": "^1.0.6", - "string.prototype.trimstart": "^1.0.6", + "string.prototype.trim": "^1.2.8", + "string.prototype.trimend": "^1.0.7", + "string.prototype.trimstart": "^1.0.7", + "typed-array-buffer": "^1.0.0", + "typed-array-byte-length": "^1.0.0", + "typed-array-byte-offset": "^1.0.0", "typed-array-length": "^1.0.4", "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.9" + "which-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" @@ -9367,53 +10414,55 @@ "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", "dev": true }, - "node_modules/es-get-iterator": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", - "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", + "node_modules/es-iterator-helpers": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.15.tgz", + "integrity": "sha512-GhoY8uYqd6iwUl2kgjTm4CZAf6oo5mHK7BPqx3rKgx893YSsy0LGHV6gfqqQvZt/8xM8xeOnfXBCfqclMKkJ5g==", "dev": true, "dependencies": { + "asynciterator.prototype": "^1.0.0", "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.1", + "es-set-tostringtag": "^2.0.1", + "function-bind": "^1.1.1", + "get-intrinsic": "^1.2.1", + "globalthis": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", "has-symbols": "^1.0.3", - "is-arguments": "^1.1.1", - "is-map": "^2.0.2", - "is-set": "^2.0.2", - "is-string": "^1.0.7", - "isarray": "^2.0.5", - "stop-iteration-iterator": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "internal-slot": "^1.0.5", + "iterator.prototype": "^1.1.2", + "safe-array-concat": "^1.0.1" } }, "node_modules/es-module-lexer": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", - "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", + "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==", "dev": true }, "node_modules/es-set-tostringtag": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", - "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz", + "integrity": "sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.3", - "has": "^1.0.3", - "has-tostringtag": "^1.0.0" + "get-intrinsic": "^1.2.2", + "has-tostringtag": "^1.0.0", + "hasown": "^2.0.0" }, "engines": { "node": ">= 0.4" } }, "node_modules/es-shim-unscopables": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", - "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", + "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", "dev": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" } }, "node_modules/es-to-primitive": { @@ -9457,13 +10506,13 @@ } }, "node_modules/escodegen": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz", - "integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==", + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", "dev": true, "dependencies": { "esprima": "^4.0.1", - "estraverse": "^5.2.0", + "estraverse": "^4.2.0", "esutils": "^2.0.2", "optionator": "^0.8.1" }, @@ -9472,12 +10521,34 @@ "esgenerate": "bin/esgenerate.js" }, "engines": { - "node": ">=6.0" + "node": ">=4.0" }, "optionalDependencies": { "source-map": "~0.6.1" } }, + "node_modules/escodegen/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/escodegen/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/escodegen/node_modules/levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -9530,27 +10601,28 @@ } }, "node_modules/eslint": { - "version": "8.37.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.37.0.tgz", - "integrity": "sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz", + "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.0.2", - "@eslint/js": "8.37.0", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.55.0", + "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-visitor-keys": "^3.4.0", - "espree": "^9.5.1", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -9558,22 +10630,19 @@ "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "bin": { @@ -9655,14 +10724,14 @@ } }, "node_modules/eslint-import-resolver-node": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", - "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "dev": true, "dependencies": { "debug": "^3.2.7", - "is-core-module": "^2.11.0", - "resolve": "^1.22.1" + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" } }, "node_modules/eslint-import-resolver-node/node_modules/debug": { @@ -9675,9 +10744,9 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", - "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, "dependencies": { "debug": "^3.2.7" @@ -9719,26 +10788,28 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.27.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", - "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", + "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", "dev": true, "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flat": "^1.3.1", - "array.prototype.flatmap": "^1.3.1", + "array-includes": "^3.1.7", + "array.prototype.findlastindex": "^1.2.3", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", "debug": "^3.2.7", "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.7", - "eslint-module-utils": "^2.7.4", - "has": "^1.0.3", - "is-core-module": "^2.11.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.8.0", + "hasown": "^2.0.0", + "is-core-module": "^2.13.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", - "object.values": "^1.1.6", - "resolve": "^1.22.1", - "semver": "^6.3.0", - "tsconfig-paths": "^3.14.1" + "object.fromentries": "^2.0.7", + "object.groupby": "^1.0.1", + "object.values": "^1.1.7", + "semver": "^6.3.1", + "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" @@ -9793,27 +10864,27 @@ } }, "node_modules/eslint-plugin-jsx-a11y": { - "version": "6.7.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.7.1.tgz", - "integrity": "sha512-63Bog4iIethyo8smBklORknVjB0T2dwB8Mr/hIC+fBS0uyHdYYpzM/Ed+YC8VxTjlXHEWFOdmgwcDn1U2L9VCA==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.20.7", - "aria-query": "^5.1.3", - "array-includes": "^3.1.6", - "array.prototype.flatmap": "^1.3.1", - "ast-types-flow": "^0.0.7", - "axe-core": "^4.6.2", - "axobject-query": "^3.1.1", + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz", + "integrity": "sha512-Hdh937BS3KdwwbBaKd5+PLCOmYY6U4f2h9Z2ktwtNKvIdIEu137rjYbcb9ApSbVJfWxANNuiKTD/9tOKjK9qOA==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.23.2", + "aria-query": "^5.3.0", + "array-includes": "^3.1.7", + "array.prototype.flatmap": "^1.3.2", + "ast-types-flow": "^0.0.8", + "axe-core": "=4.7.0", + "axobject-query": "^3.2.1", "damerau-levenshtein": "^1.0.8", "emoji-regex": "^9.2.2", - "has": "^1.0.3", - "jsx-ast-utils": "^3.3.3", - "language-tags": "=1.0.5", + "es-iterator-helpers": "^1.0.15", + "hasown": "^2.0.0", + "jsx-ast-utils": "^3.3.5", + "language-tags": "^1.0.9", "minimatch": "^3.1.2", - "object.entries": "^1.1.6", - "object.fromentries": "^2.0.6", - "semver": "^6.3.0" + "object.entries": "^1.1.7", + "object.fromentries": "^2.0.7" }, "engines": { "node": ">=4.0" @@ -9823,15 +10894,16 @@ } }, "node_modules/eslint-plugin-react": { - "version": "7.32.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.32.2.tgz", - "integrity": "sha512-t2fBMa+XzonrrNkyVirzKlvn5RXzzPwRHtMvLAtVZrt8oxgnTQaYbU6SXTOO1mwQgp1y5+toMSKInnzGr0Knqg==", + "version": "7.33.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.33.2.tgz", + "integrity": "sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==", "dev": true, "dependencies": { "array-includes": "^3.1.6", "array.prototype.flatmap": "^1.3.1", "array.prototype.tosorted": "^1.1.1", "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.0.12", "estraverse": "^5.3.0", "jsx-ast-utils": "^2.4.1 || ^3.0.0", "minimatch": "^3.1.2", @@ -9841,7 +10913,7 @@ "object.values": "^1.1.6", "prop-types": "^15.8.1", "resolve": "^2.0.0-next.4", - "semver": "^6.3.0", + "semver": "^6.3.1", "string.prototype.matchall": "^4.0.8" }, "engines": { @@ -9876,12 +10948,12 @@ } }, "node_modules/eslint-plugin-react/node_modules/resolve": { - "version": "2.0.0-next.4", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", - "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", "dev": true, "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -9893,12 +10965,12 @@ } }, "node_modules/eslint-plugin-testing-library": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-testing-library/-/eslint-plugin-testing-library-5.10.2.tgz", - "integrity": "sha512-f1DmDWcz5SDM+IpCkEX0lbFqrrTs8HRsEElzDEqN/EBI0hpRj8Cns5+IVANXswE8/LeybIJqPAOQIFu2j5Y5sw==", + "version": "5.11.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-testing-library/-/eslint-plugin-testing-library-5.11.1.tgz", + "integrity": "sha512-5eX9e1Kc2PqVRed3taaLnAAqPZGEX75C+M/rXzUAI3wIg/ZxzUm1OVAwfe/O+vE+6YXOLetSe9g5GKD2ecXipw==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "^5.43.0" + "@typescript-eslint/utils": "^5.58.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0", @@ -9909,9 +10981,9 @@ } }, "node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", @@ -9919,12 +10991,15 @@ }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-visitor-keys": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz", - "integrity": "sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -10015,15 +11090,15 @@ "dev": true }, "node_modules/eslint-webpack-plugin/node_modules/schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", + "ajv": "^8.9.0", "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" + "ajv-keywords": "^5.1.0" }, "engines": { "node": ">= 12.13.0" @@ -10122,9 +11197,9 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -10170,14 +11245,14 @@ } }, "node_modules/espree": { - "version": "9.5.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.1.tgz", - "integrity": "sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "dependencies": { - "acorn": "^8.8.0", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.0" + "eslint-visitor-keys": "^3.4.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -10187,16 +11262,16 @@ } }, "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", + "integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==", "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" }, "engines": { - "node": ">=4" + "node": ">=0.4.0" } }, "node_modules/esquery": { @@ -10312,16 +11387,16 @@ } }, "node_modules/expect": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.5.0.tgz", - "integrity": "sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "dependencies": { - "@jest/expect-utils": "^29.5.0", - "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0" + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -10390,9 +11465,9 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -10649,12 +11724,13 @@ } }, "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "dependencies": { - "flatted": "^3.1.0", + "flatted": "^3.2.9", + "keyv": "^4.5.3", "rimraf": "^3.0.2" }, "engines": { @@ -10662,15 +11738,15 @@ } }, "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.9.tgz", + "integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==", "dev": true }, "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", "dev": true, "funding": [ { @@ -10855,9 +11931,9 @@ } }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -10932,16 +12008,16 @@ } }, "node_modules/fraction.js": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz", - "integrity": "sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", "dev": true, "engines": { "node": "*" }, "funding": { "type": "patreon", - "url": "https://www.patreon.com/infusion" + "url": "https://github.com/sponsors/rawify" } }, "node_modules/fresh": { @@ -10998,9 +12074,9 @@ "optional": true }, "node_modules/fs-monkey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.3.tgz", - "integrity": "sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.5.tgz", + "integrity": "sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==", "dev": true }, "node_modules/fs-readdir-recursive": { @@ -11016,9 +12092,9 @@ "devOptional": true }, "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, "optional": true, @@ -11030,20 +12106,23 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/function.prototype.name": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", - "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", + "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "es-abstract": "^1.19.0", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "functions-have-names": "^1.2.3" }, "engines": { "node": ">= 0.4" @@ -11100,14 +12179,15 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -11303,10 +12383,10 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, "node_modules/gzip-size": { @@ -11336,17 +12416,6 @@ "integrity": "sha512-HIp/n38R9kQjDEziXyDTuW3vvoxxyxjxFzXLrBr18uB47GnSt+G9D29fqrpM5ZkspMcPICud3XsBJQ4Y2URg8g==", "dev": true }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -11365,12 +12434,12 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", "dev": true, "dependencies": { - "get-intrinsic": "^1.1.1" + "get-intrinsic": "^1.2.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -11421,6 +12490,17 @@ "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", "optional": true }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -11431,9 +12511,9 @@ } }, "node_modules/highlight.js": { - "version": "11.7.0", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.7.0.tgz", - "integrity": "sha512-1rRqesRFhMO/PRF+G86evnyJkCgaZFOI+Z6kdj15TA18funfoqJXvgPCLSf0SWq3SRfg1j3HlDs8o4s3EGq1oQ==", + "version": "11.9.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.9.0.tgz", + "integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==", "engines": { "node": ">=12.0.0" } @@ -11517,31 +12597,41 @@ } }, "node_modules/html-dom-parser": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/html-dom-parser/-/html-dom-parser-3.1.7.tgz", - "integrity": "sha512-cDgNF4YgF6J3H+d9mcldGL19p0GzVdS3iGuDNzYWQpU47q3+IRM85X3Xo07E+nntF4ek4s78A9V24EwxlPTjig==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/html-dom-parser/-/html-dom-parser-5.0.4.tgz", + "integrity": "sha512-azy8THLKd4Ar0OVJpEgX+MSjYvKdNDWlGiRBIlovMqEQYMAnLLXBhhiSwjylDD3RDdcCYT8Utg6uoRDeLHUyHg==", "dependencies": { "domhandler": "5.0.3", - "htmlparser2": "8.0.2" + "htmlparser2": "9.0.0" } }, "node_modules/html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", "dev": true, "dependencies": { - "whatwg-encoding": "^2.0.0" + "whatwg-encoding": "^3.1.1" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/html-entities": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.3.tgz", - "integrity": "sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==", - "dev": true + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.4.0.tgz", + "integrity": "sha512-igBTJcNNNhvZFRtm8uA6xMY6xYleeDwn3PeBCkDz7tHttv4F2hsDI2aPgNERWzvRcNYHNT3ymRaQzllmXj4YsQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ] }, "node_modules/html-escaper": { "version": "2.0.2", @@ -11570,14 +12660,14 @@ } }, "node_modules/html-minifier-terser": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-7.1.0.tgz", - "integrity": "sha512-BvPO2S7Ip0Q5qt+Y8j/27Vclj6uHC6av0TMoDn7/bJPhMWHI2UtR2e/zEgJn3/qYAmxumrGp9q4UHurL6mtW9Q==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-7.2.0.tgz", + "integrity": "sha512-tXgn3QfqPIpGl9o+K5tpcj3/MN4SfLtsx2GWwBC3SSd0tXQGyF3gsSqad8loJgKZGM3ZxbYDd5yhiBIdWpmvLA==", "dev": true, "dependencies": { "camel-case": "^4.1.2", - "clean-css": "5.2.0", - "commander": "^9.4.1", + "clean-css": "~5.3.2", + "commander": "^10.0.0", "entities": "^4.4.0", "param-case": "^3.0.4", "relateurl": "^0.2.7", @@ -11590,24 +12680,33 @@ "node": "^14.13.1 || >=16.0.0" } }, + "node_modules/html-minifier-terser/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } + }, "node_modules/html-react-parser": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/html-react-parser/-/html-react-parser-3.0.15.tgz", - "integrity": "sha512-iM2KUVhNoeIsezbpO6xwOHlFqWH+EYaCGwWWeX7R+jvrgc+mbnuouWaCU8GZRRbPKDD0eJXPZwLoeGVft84QXw==", + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/html-react-parser/-/html-react-parser-5.0.7.tgz", + "integrity": "sha512-00ve/0B7ukLUAcAbmD6Vh74EicB+ktLvAM4APeXJjiBsRiPz2ouochTvyUhOJB8apP2t40xAXvpmd+t50aVnJg==", "dependencies": { "domhandler": "5.0.3", - "html-dom-parser": "3.1.7", - "react-property": "2.0.0", - "style-to-js": "1.1.3" + "html-dom-parser": "5.0.4", + "react-property": "2.0.2", + "style-to-js": "1.1.10" }, "peerDependencies": { "react": "0.14 || 15 || 16 || 17 || 18" } }, "node_modules/html-webpack-plugin": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.5.0.tgz", - "integrity": "sha512-sy88PC2cRTVxvETRgUHFrL4No3UxvcH8G1NepGhqaTT+GXN2kTamqasot0inS5hXeg1cMbFDt27zzo9p35lZVw==", + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.5.4.tgz", + "integrity": "sha512-3wNSaVVxdxcu0jd4FpQFoICdqgxs4zIQQvj+2yQKFfBOnLETQ6X5CDWdeasuGlSsooFlMkEioWDTqBv1wvw5Iw==", "dev": true, "dependencies": { "@types/html-minifier-terser": "^6.0.0", @@ -11627,18 +12726,6 @@ "webpack": "^5.20.0" } }, - "node_modules/html-webpack-plugin/node_modules/clean-css": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.2.tgz", - "integrity": "sha512-JVJbM+f3d3Q704rF4bqQ5UUyTtuJ0JRKNbTKVEeujCCBoMdkEi+V+e8oktO9qGQNSvHrFTM6JZRXrUvGR1czww==", - "dev": true, - "dependencies": { - "source-map": "~0.6.0" - }, - "engines": { - "node": ">= 10.0" - } - }, "node_modules/html-webpack-plugin/node_modules/commander": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", @@ -11683,9 +12770,9 @@ } }, "node_modules/htmlparser2": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", - "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.0.0.tgz", + "integrity": "sha512-uxbSI98wmFT/G4P2zXx4OVx04qWUmyFPrD2/CNepa2Zo3GPNaCaaxElDgwUrwYWkK1nr9fft0Ya8dws8coDLLQ==", "funding": [ "https://github.com/fb55/htmlparser2?sponsor=1", { @@ -11696,8 +12783,8 @@ "dependencies": { "domelementtype": "^2.3.0", "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "entities": "^4.4.0" + "domutils": "^3.1.0", + "entities": "^4.5.0" } }, "node_modules/http-deceiver": { @@ -11742,17 +12829,16 @@ } }, "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", + "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", "dev": true, "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/http-proxy-middleware": { @@ -11780,16 +12866,16 @@ } }, "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "devOptional": true, + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", + "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", + "dev": true, "dependencies": { - "agent-base": "6", + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/human-signals": { @@ -11849,9 +12935,9 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", + "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", "dev": true, "engines": { "node": ">= 4" @@ -11932,18 +13018,18 @@ "dev": true }, "node_modules/inline-style-parser": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.1.1.tgz", - "integrity": "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.2.tgz", + "integrity": "sha512-EcKzdTHVe8wFVOGEYXiW9WmJXPjqi1T+234YpJr98RiFYKHV3cdy1+3mkTE+KHTHxFFLH51SfaGOoUdW+v7ViQ==" }, "node_modules/internal-slot": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", - "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.6.tgz", + "integrity": "sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==", "dev": true, "dependencies": { - "get-intrinsic": "^1.2.0", - "has": "^1.0.3", + "get-intrinsic": "^1.2.2", + "hasown": "^2.0.0", "side-channel": "^1.0.4" }, "engines": { @@ -11959,22 +13045,6 @@ "node": ">= 0.10" } }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-array-buffer": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", @@ -11994,6 +13064,21 @@ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" }, + "node_modules/is-async-function": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", + "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -12047,11 +13132,11 @@ } }, "node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -12096,6 +13181,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-finalizationregistry": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", + "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -12111,7 +13208,22 @@ "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, "engines": { - "node": ">=6" + "node": ">=6" + } + }, + "node_modules/is-generator-function": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-glob": { @@ -12316,16 +13428,12 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", - "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "which-typed-array": "^1.1.11" }, "engines": { "node": ">= 0.4" @@ -12399,9 +13507,9 @@ "dev": true }, "node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, "engines": { "node": ">=8" @@ -12424,17 +13532,17 @@ } }, "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "dependencies": { "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", + "make-dir": "^4.0.0", "supports-color": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" } }, "node_modules/istanbul-lib-report/node_modules/has-flag": { @@ -12446,21 +13554,48 @@ "node": ">=8" } }, + "node_modules/istanbul-lib-report/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/istanbul-lib-report/node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "dependencies": { - "semver": "^6.0.0" + "semver": "^7.5.3" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/istanbul-lib-report/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/istanbul-lib-report/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -12473,6 +13608,12 @@ "node": ">=8" } }, + "node_modules/istanbul-lib-report/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/istanbul-lib-source-maps": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", @@ -12488,9 +13629,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", - "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", "dev": true, "dependencies": { "html-escaper": "^2.0.0", @@ -12500,16 +13641,29 @@ "node": ">=8" } }, + "node_modules/iterator.prototype": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz", + "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==", + "dev": true, + "dependencies": { + "define-properties": "^1.2.1", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "reflect.getprototypeof": "^1.0.4", + "set-function-name": "^2.0.1" + } + }, "node_modules/jake": { - "version": "10.8.5", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.5.tgz", - "integrity": "sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==", + "version": "10.8.7", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz", + "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==", "dev": true, "dependencies": { "async": "^3.2.3", "chalk": "^4.0.2", - "filelist": "^1.0.1", - "minimatch": "^3.0.4" + "filelist": "^1.0.4", + "minimatch": "^3.1.2" }, "bin": { "jake": "bin/cli.js" @@ -12614,9 +13768,9 @@ } }, "node_modules/jest-canvas-mock": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/jest-canvas-mock/-/jest-canvas-mock-2.5.0.tgz", - "integrity": "sha512-s2bmY2f22WPMzhB2YA93kiyf7CAfWAnV/sFfY9s48IVOrGmwui1eSFluDPesq1M+7tSC1hJAit6mzO0ZNXvVBA==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jest-canvas-mock/-/jest-canvas-mock-2.5.2.tgz", + "integrity": "sha512-vgnpPupjOL6+L5oJXzxTxFrlGEIbHdZqFU+LFNdtLxZ3lRDCl17FlTMM7IatoRQkrcyOTMlDinjUguqmQ6bR2A==", "dev": true, "dependencies": { "cssfontparser": "^1.2.1", @@ -12654,9 +13808,9 @@ } }, "node_modules/jest-changed-files/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -12855,9 +14009,9 @@ } }, "node_modules/jest-circus/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -12912,6 +14066,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/jest-circus/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "node_modules/jest-circus/node_modules/diff-sequences": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", @@ -13170,9 +14330,9 @@ } }, "node_modules/jest-circus/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -13274,9 +14434,9 @@ } }, "node_modules/jest-cli/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -13429,9 +14589,9 @@ } }, "node_modules/jest-config/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -13578,15 +14738,15 @@ } }, "node_modules/jest-diff": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.5.0.tgz", - "integrity": "sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "diff-sequences": "^29.4.3", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.5.0" + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -13707,9 +14867,9 @@ } }, "node_modules/jest-each/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -13921,53 +15081,25 @@ "@sinonjs/commons": "^1.7.0" } }, - "node_modules/jest-environment-jsdom/node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/jest-environment-jsdom/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" } }, - "node_modules/jest-environment-jsdom/node_modules/acorn-globals": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", - "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "node_modules/jest-environment-jsdom/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, "dependencies": { - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1" - } - }, - "node_modules/jest-environment-jsdom/node_modules/acorn-globals/node_modules/acorn": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, - "bin": { - "acorn": "bin/acorn" + "debug": "4" }, "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/jest-environment-jsdom/node_modules/acorn-walk": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", - "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", - "dev": true, - "engines": { - "node": ">=0.4.0" + "node": ">= 6.0.0" } }, "node_modules/jest-environment-jsdom/node_modules/ansi-styles": { @@ -14019,10 +15151,22 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/jest-environment-jsdom/node_modules/cssom": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", - "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", + "node_modules/jest-environment-jsdom/node_modules/cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-environment-jsdom/node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", "dev": true }, "node_modules/jest-environment-jsdom/node_modules/data-urls": { @@ -14039,25 +15183,38 @@ "node": ">=10" } }, - "node_modules/jest-environment-jsdom/node_modules/domexception": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", - "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "node_modules/jest-environment-jsdom/node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", "dev": true, "dependencies": { - "webidl-conversions": "^5.0.0" + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" }, "engines": { - "node": ">=8" + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" } }, - "node_modules/jest-environment-jsdom/node_modules/domexception/node_modules/webidl-conversions": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", - "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "node_modules/jest-environment-jsdom/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, "engines": { - "node": ">=8" + "node": ">=4" } }, "node_modules/jest-environment-jsdom/node_modules/form-data": { @@ -14109,6 +15266,19 @@ "node": ">= 6" } }, + "node_modules/jest-environment-jsdom/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/jest-environment-jsdom/node_modules/jest-message-util": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-27.5.1.tgz", @@ -14443,9 +15613,9 @@ } }, "node_modules/jest-environment-node/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -14607,29 +15777,29 @@ } }, "node_modules/jest-get-type": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.4.3.tgz", - "integrity": "sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-haste-map": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.5.0.tgz", - "integrity": "sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.4.3", - "jest-util": "^29.5.0", - "jest-worker": "^29.5.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "walker": "^1.0.8" }, @@ -14761,9 +15931,9 @@ } }, "node_modules/jest-jasmine2/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -14818,6 +15988,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/jest-jasmine2/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "node_modules/jest-jasmine2/node_modules/diff-sequences": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", @@ -15076,9 +16252,9 @@ } }, "node_modules/jest-jasmine2/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -15178,15 +16354,15 @@ } }, "node_modules/jest-matcher-utils": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz", - "integrity": "sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "jest-diff": "^29.5.0", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.5.0" + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -15263,18 +16439,18 @@ } }, "node_modules/jest-message-util": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.5.0.tgz", - "integrity": "sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "dependencies": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.5.0", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -15362,14 +16538,14 @@ } }, "node_modules/jest-mock": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.5.0.tgz", - "integrity": "sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-util": "^29.5.0" + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -15393,9 +16569,9 @@ } }, "node_modules/jest-regex-util": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.4.3.tgz", - "integrity": "sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -15479,9 +16655,9 @@ } }, "node_modules/jest-resolve-dependencies/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -15536,6 +16712,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/jest-resolve-dependencies/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "node_modules/jest-resolve-dependencies/node_modules/diff-sequences": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", @@ -15781,9 +16963,9 @@ } }, "node_modules/jest-resolve-dependencies/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -15851,9 +17033,9 @@ } }, "node_modules/jest-resolve/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -16144,9 +17326,9 @@ } }, "node_modules/jest-runner/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -16201,6 +17383,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/jest-runner/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "node_modules/jest-runner/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -16523,9 +17711,9 @@ } }, "node_modules/jest-runtime/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -16580,6 +17768,12 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/jest-runtime/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "node_modules/jest-runtime/node_modules/diff-sequences": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.5.1.tgz", @@ -16838,9 +18032,9 @@ } }, "node_modules/jest-runtime/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -16905,34 +18099,31 @@ } }, "node_modules/jest-snapshot": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.5.0.tgz", - "integrity": "sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/traverse": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", - "@types/babel__traverse": "^7.0.6", - "@types/prettier": "^2.1.5", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.5.0", + "expect": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-diff": "^29.5.0", - "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "natural-compare": "^1.4.0", - "pretty-format": "^29.5.0", - "semver": "^7.3.5" + "pretty-format": "^29.7.0", + "semver": "^7.5.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -17009,9 +18200,9 @@ } }, "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -17042,12 +18233,12 @@ "dev": true }, "node_modules/jest-util": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.5.0.tgz", - "integrity": "sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -17162,9 +18353,9 @@ } }, "node_modules/jest-validate/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -17624,9 +18815,9 @@ } }, "node_modules/jest-watch-typeahead/node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dev": true, "dependencies": { "ansi-regex": "^6.0.1" @@ -17697,9 +18888,9 @@ } }, "node_modules/jest-watcher/node_modules/@types/yargs": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.5.tgz", - "integrity": "sha512-AxO/ADJOBFJScHbWhq2xAhlWP24rY4aCEG/NFaMvbT3X2MgRsLjhjQwsn0Zi5zn0LG9jUhCCZMeX9Dkuw6k+vQ==", + "version": "16.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.9.tgz", + "integrity": "sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -17793,13 +18984,13 @@ } }, "node_modules/jest-worker": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.5.0.tgz", - "integrity": "sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "dependencies": { "@types/node": "*", - "jest-util": "^29.5.0", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -17832,24 +19023,14 @@ } }, "node_modules/jiti": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.18.2.tgz", - "integrity": "sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==", + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", + "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", "dev": true, "bin": { "jiti": "bin/jiti.js" } }, - "node_modules/js-sdsl": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", - "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -17868,43 +19049,38 @@ } }, "node_modules/jsdom": { - "version": "20.0.3", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", - "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", + "version": "23.0.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.0.1.tgz", + "integrity": "sha512-2i27vgvlUsGEBO9+/kJQRbtqtm+191b5zAZrU/UezVmnC2dlDAFLgDYJvAEi94T4kjsRKkezEtLQTgsNEsW2lQ==", "dev": true, "dependencies": { - "abab": "^2.0.6", - "acorn": "^8.8.1", - "acorn-globals": "^7.0.0", - "cssom": "^0.5.0", - "cssstyle": "^2.3.0", - "data-urls": "^3.0.2", - "decimal.js": "^10.4.2", - "domexception": "^4.0.0", - "escodegen": "^2.0.0", + "cssstyle": "^3.0.0", + "data-urls": "^5.0.0", + "decimal.js": "^10.4.3", "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.1", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.2", - "parse5": "^7.1.1", + "nwsapi": "^2.2.7", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.6.0", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.2", - "w3c-xmlserializer": "^4.0.0", + "tough-cookie": "^4.1.3", + "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^11.0.0", - "ws": "^8.11.0", - "xml-name-validator": "^4.0.0" + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0", + "ws": "^8.14.2", + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" }, "peerDependencies": { - "canvas": "^2.5.0" + "canvas": "^2.11.2" }, "peerDependenciesMeta": { "canvas": { @@ -17924,6 +19100,12 @@ "node": ">=4" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -17971,6 +19153,17 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonpath": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz", + "integrity": "sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==", + "dev": true, + "dependencies": { + "esprima": "1.2.2", + "static-eval": "2.0.2", + "underscore": "1.12.1" + } + }, "node_modules/jsonpointer": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-5.0.1.tgz", @@ -18086,23 +19279,34 @@ } }, "node_modules/jss/node_modules/csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/jsx-ast-utils": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz", - "integrity": "sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", "dev": true, "dependencies": { - "array-includes": "^3.1.5", - "object.assign": "^4.1.3" + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" }, "engines": { "node": ">=4.0" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -18137,22 +19341,25 @@ "dev": true }, "node_modules/language-tags": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.5.tgz", - "integrity": "sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/language-tags/-/language-tags-1.0.9.tgz", + "integrity": "sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==", "dev": true, "dependencies": { - "language-subtag-registry": "~0.3.2" + "language-subtag-registry": "^0.3.20" + }, + "engines": { + "node": ">=0.10" } }, "node_modules/launch-editor": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.6.0.tgz", - "integrity": "sha512-JpDCcQnyAAzZZaZ7vEiSqL690w7dAEyLao+KC96zBplnYbJS7TYNjvM3M7y3dGz+v7aIsJk3hllWuc0kWAjyRQ==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.6.1.tgz", + "integrity": "sha512-eB/uXmFVpY4zezmGp5XtU21kwo7GBbKB+EQ+UZeWtGb9yAM5xt/Evk+lYH3eRNAtId+ej4u7TYPFZ07w4s7rRw==", "dev": true, "dependencies": { "picocolors": "^1.0.0", - "shell-quote": "^1.7.3" + "shell-quote": "^1.8.1" } }, "node_modules/leaflet": { @@ -18183,12 +19390,12 @@ } }, "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", + "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", "dev": true, "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/lines-and-columns": { @@ -18321,9 +19528,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" @@ -18367,7 +19574,7 @@ "version": "3.2.2", "resolved": "https://registry.npmjs.org/@material-ui/pickers/-/pickers-3.2.2.tgz", "integrity": "sha512-on/J1yyKeJ4CkLnItpf/jPDKMZVWvHDklkh5FS7wkZ0s1OPoqTsPubLWfA7eND6xREnVRyLFzVTlE3VlWYdQWw==", - "deprecated": "Material UI Pickers v3 doesn't receive active development since January 2020. See the guide https://mui.com/material-ui/guides/pickers-migration/ to upgrade.", + "deprecated": "This package no longer supported. It has been relaced by @mui/x-date-pickers", "dependencies": { "@babel/runtime": "^7.2.0", "@types/styled-jsx": "^2.2.8", @@ -18384,6 +19591,14 @@ "react-dom": "^16.8.4" } }, + "node_modules/material-table/node_modules/clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "engines": { + "node": ">=6" + } + }, "node_modules/material-table/node_modules/fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", @@ -18427,9 +19642,9 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "node_modules/mdn-data": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.14.tgz", - "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==", + "version": "2.0.30", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.30.tgz", + "integrity": "sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==", "dev": true }, "node_modules/media-typer": { @@ -18442,12 +19657,12 @@ } }, "node_modules/memfs": { - "version": "3.4.13", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.13.tgz", - "integrity": "sha512-omTM41g3Skpvx5dSYeZIbXKcXoAVc/AoMNwn9TKx++L/gaen/+4TTttmu8ZSch5vfVJ8uJvGbroTsIlslRg6lg==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.5.3.tgz", + "integrity": "sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==", "dev": true, "dependencies": { - "fs-monkey": "^1.0.3" + "fs-monkey": "^1.0.4" }, "engines": { "node": ">= 4.0.0" @@ -18556,9 +19771,9 @@ } }, "node_modules/mini-css-extract-plugin": { - "version": "2.7.5", - "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.5.tgz", - "integrity": "sha512-9HaR++0mlgom81s95vvNjxkg52n2b5s//3ZTI1EtzFb98awsLSivs2LMsVqnQ3ay0PVhqWcGNyDaTE961FOcjQ==", + "version": "2.7.6", + "resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.6.tgz", + "integrity": "sha512-Qk7HcgaPkGG6eD77mLvZS1nmxlao3j+9PkrT9Uc7HAE1id3F41+DdBRYRYkbyfNRGzm8/YWtzhw7nVPmwhqTQw==", "dev": true, "dependencies": { "schema-utils": "^4.0.0" @@ -18609,15 +19824,15 @@ "dev": true }, "node_modules/mini-css-extract-plugin/node_modules/schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", + "ajv": "^8.9.0", "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" + "ajv-keywords": "^5.1.0" }, "engines": { "node": ">= 12.13.0" @@ -18655,9 +19870,9 @@ } }, "node_modules/minipass": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.5.tgz", - "integrity": "sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "optional": true, "engines": { "node": ">=8" @@ -18759,15 +19974,15 @@ } }, "node_modules/nan": { - "version": "2.17.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", - "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==", + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz", + "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==", "optional": true }, "node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true, "funding": [ { @@ -18839,9 +20054,9 @@ } }, "node_modules/node-fetch": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", - "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "dev": true, "dependencies": { "data-uri-to-buffer": "^4.0.0", @@ -18883,9 +20098,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", - "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, "node_modules/nopt": { @@ -18970,9 +20185,9 @@ } }, "node_modules/nwsapi": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.2.tgz", - "integrity": "sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw==", + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", + "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", "dev": true }, "node_modules/object-assign": { @@ -18993,26 +20208,10 @@ } }, "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-is": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -19027,13 +20226,13 @@ } }, "node_modules/object.assign": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", + "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.1.4", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, @@ -19045,28 +20244,28 @@ } }, "node_modules/object.entries": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.6.tgz", - "integrity": "sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.7.tgz", + "integrity": "sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" } }, "node_modules/object.fromentries": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.6.tgz", - "integrity": "sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.7.tgz", + "integrity": "sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" @@ -19076,15 +20275,16 @@ } }, "node_modules/object.getownpropertydescriptors": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.5.tgz", - "integrity": "sha512-yDNzckpM6ntyQiGTik1fKV1DcVDRS+w8bvpWNCBanvH5LfRX9O8WTHqQzG4RZwRAM4I0oU7TV11Lj5v0g20ibw==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.7.tgz", + "integrity": "sha512-PrJz0C2xJ58FNn11XV2lr4Jt5Gzl94qpy9Lu0JlfEj14z88sqbSBJCBEzdlNUCzY2gburhbrwOZ5BHCmuNUy0g==", "dev": true, "dependencies": { - "array.prototype.reduce": "^1.0.5", + "array.prototype.reduce": "^1.0.6", "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "safe-array-concat": "^1.0.0" }, "engines": { "node": ">= 0.8" @@ -19093,28 +20293,40 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.groupby": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", + "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1" + } + }, "node_modules/object.hasown": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.2.tgz", - "integrity": "sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.3.tgz", + "integrity": "sha512-fFI4VcYpRHvSLXxP7yiZOMAd331cPfd2p7PFDVbgUsYOfCT3tICVqXWngbjr4m49OvsBwUBQ6O2uQoJvy3RexA==", "dev": true, "dependencies": { - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object.values": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", - "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.7.tgz", + "integrity": "sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" @@ -19192,17 +20404,17 @@ } }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -19437,9 +20649,9 @@ } }, "node_modules/pirates": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", - "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true, "engines": { "node": ">= 6" @@ -19588,9 +20800,9 @@ "integrity": "sha512-Kjw8nKRl1m+VrSFCoVGPph93W/qrSO7ZkqPpTf7F4bk/sqcfWK019dWBUpE/fBOsOQY1dks/Bmcbfn1heM/IsA==" }, "node_modules/postcss": { - "version": "8.4.21", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.21.tgz", - "integrity": "sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==", + "version": "8.4.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.32.tgz", + "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==", "dev": true, "funding": [ { @@ -19600,10 +20812,14 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "nanoid": "^3.3.4", + "nanoid": "^3.3.7", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -19644,14 +20860,17 @@ } }, "node_modules/postcss-calc": { - "version": "8.2.4", - "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-8.2.4.tgz", - "integrity": "sha512-SmWMSJmB8MRnnULldx0lQIyhSNvuDl9HfrZkaqqE/WHAhToYsAvDq+yAsA/kIyINDszOp3Rh0GFoNuH5Ypsm3Q==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-9.0.1.tgz", + "integrity": "sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ==", "dev": true, "dependencies": { - "postcss-selector-parser": "^6.0.9", + "postcss-selector-parser": "^6.0.11", "postcss-value-parser": "^4.2.0" }, + "engines": { + "node": "^14 || ^16 || >=18.0" + }, "peerDependencies": { "postcss": "^8.2.2" } @@ -19729,9 +20948,9 @@ } }, "node_modules/postcss-colormin": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-5.3.1.tgz", - "integrity": "sha512-UsWQG0AqTFQmpBegeLLc1+c3jIqBNB0zlDGRWR+dQ3pRKJL1oeMzyqmH3o2PIfn9MBdNrVPWhDbT769LxCTLJQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-6.0.1.tgz", + "integrity": "sha512-Tb9aR2wCJCzKuNjIeMzVNd0nXjQy25HDgFmmaRsHnP0eP/k8uQWE4S8voX5S2coO5CeKrp+USFs1Ayv9Tpxx6w==", "dev": true, "dependencies": { "browserslist": "^4.21.4", @@ -19740,26 +20959,26 @@ "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-convert-values": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-5.1.3.tgz", - "integrity": "sha512-82pC1xkJZtcJEfiLw6UXnXVXScgtBrjlO5CBmuDQc+dlb88ZYheFsjTn40+zBVi3DkfF7iezO0nJUPLcJK3pvA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-6.0.1.tgz", + "integrity": "sha512-zTd4Vh0HxGkhg5aHtfCogcRHzGkvblfdWlQ53lIh1cJhYcGyIxh2hgtKoVh40AMktRERet+JKdB04nNG19kjmA==", "dev": true, "dependencies": { "browserslist": "^4.21.4", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-custom-media": { @@ -19839,51 +21058,51 @@ } }, "node_modules/postcss-discard-comments": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-5.1.2.tgz", - "integrity": "sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-6.0.1.tgz", + "integrity": "sha512-f1KYNPtqYLUeZGCHQPKzzFtsHaRuECe6jLakf/RjSRqvF5XHLZnM2+fXLhb8Qh/HBFHs3M4cSLb1k3B899RYIg==", "dev": true, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-discard-duplicates": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-5.1.0.tgz", - "integrity": "sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-6.0.1.tgz", + "integrity": "sha512-1hvUs76HLYR8zkScbwyJ8oJEugfPV+WchpnA+26fpJ7Smzs51CzGBHC32RS03psuX/2l0l0UKh2StzNxOrKCYg==", "dev": true, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-discard-empty": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-5.1.1.tgz", - "integrity": "sha512-zPz4WljiSuLWsI0ir4Mcnr4qQQ5e1Ukc3i7UfE2XcrwKK2LIPIqE5jxMRxO6GbI3cv//ztXDsXwEWT3BHOGh3A==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-6.0.1.tgz", + "integrity": "sha512-yitcmKwmVWtNsrrRqGJ7/C0YRy53i0mjexBDQ9zYxDwTWVBgbU4+C9jIZLmQlTDT9zhml+u0OMFJh8+31krmOg==", "dev": true, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-discard-overridden": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-5.1.0.tgz", - "integrity": "sha512-21nOL7RqWR1kasIVdKs8HNqQJhFxLsyRfAnUDm4Fe4t4mCWL9OJiHvlHPjcd8zc5Myu89b/7wZDnOSjFgeWRtw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-6.0.1.tgz", + "integrity": "sha512-qs0ehZMMZpSESbRkw1+inkf51kak6OOzNRaoLd/U7Fatp0aN2HQ1rxGOrJvYcRAN9VpX8kUF13R2ofn8OlvFVA==", "dev": true, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-double-position-gradients": { @@ -20005,9 +21224,9 @@ } }, "node_modules/postcss-import": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-14.1.0.tgz", - "integrity": "sha512-flwI+Vgm4SElObFVPpTIT7SU7R3qk2L7PyduMcokiaVKuWv9d/U+Gm/QAd8NDLuykTWTkcrjOeD2Pp1rMeBTGw==", + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", + "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", "dev": true, "dependencies": { "postcss-value-parser": "^4.0.0", @@ -20015,7 +21234,7 @@ "resolve": "^1.1.7" }, "engines": { - "node": ">=10.0.0" + "node": ">=14.0.0" }, "peerDependencies": { "postcss": "^8.0.0" @@ -20070,20 +21289,26 @@ } }, "node_modules/postcss-load-config": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-3.1.4.tgz", - "integrity": "sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-4.0.2.tgz", + "integrity": "sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==", "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "dependencies": { - "lilconfig": "^2.0.5", - "yaml": "^1.10.2" + "lilconfig": "^3.0.0", + "yaml": "^2.3.4" }, "engines": { - "node": ">= 10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" + "node": ">= 14" }, "peerDependencies": { "postcss": ">=8.0.9", @@ -20098,6 +21323,15 @@ } } }, + "node_modules/postcss-load-config/node_modules/yaml": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", + "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "dev": true, + "engines": { + "node": ">= 14" + } + }, "node_modules/postcss-loader": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-6.2.1.tgz", @@ -20133,9 +21367,9 @@ } }, "node_modules/postcss-loader/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -20178,101 +21412,101 @@ } }, "node_modules/postcss-merge-longhand": { - "version": "5.1.7", - "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-5.1.7.tgz", - "integrity": "sha512-YCI9gZB+PLNskrK0BB3/2OzPnGhPkBEwmwhfYk1ilBHYVAZB7/tkTHFBAnCrvBBOmeYyMYw3DMjT55SyxMBzjQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-6.0.1.tgz", + "integrity": "sha512-vmr/HZQzaPXc45FRvSctqFTF05UaDnTn5ABX+UtQPJznDWT/QaFbVc/pJ5C2YPxx2J2XcfmWowlKwtCDwiQ5hA==", "dev": true, "dependencies": { "postcss-value-parser": "^4.2.0", - "stylehacks": "^5.1.1" + "stylehacks": "^6.0.1" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-merge-rules": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-5.1.4.tgz", - "integrity": "sha512-0R2IuYpgU93y9lhVbO/OylTtKMVcHb67zjWIfCiKR9rWL3GUk1677LAqD/BcHizukdZEjT8Ru3oHRoAYoJy44g==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-6.0.2.tgz", + "integrity": "sha512-6lm8bl0UfriSfxI+F/cezrebqqP8w702UC6SjZlUlBYwuRVNbmgcJuQU7yePIvD4MNT53r/acQCUAyulrpgmeQ==", "dev": true, "dependencies": { "browserslist": "^4.21.4", "caniuse-api": "^3.0.0", - "cssnano-utils": "^3.1.0", + "cssnano-utils": "^4.0.1", "postcss-selector-parser": "^6.0.5" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-minify-font-values": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-5.1.0.tgz", - "integrity": "sha512-el3mYTgx13ZAPPirSVsHqFzl+BBBDrXvbySvPGFnQcTI4iNslrPaFq4muTkLZmKlGk4gyFAYUBMH30+HurREyA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-6.0.1.tgz", + "integrity": "sha512-tIwmF1zUPoN6xOtA/2FgVk1ZKrLcCvE0dpZLtzyyte0j9zUeB8RTbCqrHZGjJlxOvNWKMYtunLrrl7HPOiR46w==", "dev": true, "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-minify-gradients": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-5.1.1.tgz", - "integrity": "sha512-VGvXMTpCEo4qHTNSa9A0a3D+dxGFZCYwR6Jokk+/3oB6flu2/PnPXAh2x7x52EkY5xlIHLm+Le8tJxe/7TNhzw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-6.0.1.tgz", + "integrity": "sha512-M1RJWVjd6IOLPl1hYiOd5HQHgpp6cvJVLrieQYS9y07Yo8itAr6jaekzJphaJFR0tcg4kRewCk3kna9uHBxn/w==", "dev": true, "dependencies": { "colord": "^2.9.1", - "cssnano-utils": "^3.1.0", + "cssnano-utils": "^4.0.1", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-minify-params": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-5.1.4.tgz", - "integrity": "sha512-+mePA3MgdmVmv6g+30rn57USjOGSAyuxUmkfiWpzalZ8aiBkdPYjXWtHuwJGm1v5Ojy0Z0LaSYhHaLJQB0P8Jw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-6.0.1.tgz", + "integrity": "sha512-eFvGWArqh4khPIgPDu6SZNcaLctx97nO7c59OXnRtGntAp5/VS4gjMhhW9qUFsK6mQ27pEZGt2kR+mPizI+Z9g==", "dev": true, "dependencies": { "browserslist": "^4.21.4", - "cssnano-utils": "^3.1.0", + "cssnano-utils": "^4.0.1", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-minify-selectors": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-5.2.1.tgz", - "integrity": "sha512-nPJu7OjZJTsVUmPdm2TcaiohIwxP+v8ha9NehQ2ye9szv4orirRU3SDdtUmKH+10nzn0bAyOXZ0UEr7OpvLehg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-6.0.1.tgz", + "integrity": "sha512-mfReq5wrS6vkunxvJp6GDuOk+Ak6JV7134gp8L+ANRnV9VwqzTvBtX6lpohooVU750AR0D3pVx2Zn6uCCwOAfQ==", "dev": true, "dependencies": { "postcss-selector-parser": "^6.0.5" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-modules-extract-imports": { @@ -20288,9 +21522,9 @@ } }, "node_modules/postcss-modules-local-by-default": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz", - "integrity": "sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.3.tgz", + "integrity": "sha512-2/u2zraspoACtrbFRnTijMiQtb4GW4BvatjaG/bCjYQo8kLTdevCUlwuBHx2sCnSyrI3x3qj4ZK1j5LQBgzmwA==", "dev": true, "dependencies": { "icss-utils": "^5.0.0", @@ -20335,12 +21569,12 @@ } }, "node_modules/postcss-nested": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.0.0.tgz", - "integrity": "sha512-0DkamqrPcmkBDsLn+vQDIrtkSbNkv5AD/M322ySo9kqFkCIYklym2xEmWkwo+Y3/qZo34tzEPNUw4y7yMCdv5w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.0.1.tgz", + "integrity": "sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==", "dev": true, "dependencies": { - "postcss-selector-parser": "^6.0.10" + "postcss-selector-parser": "^6.0.11" }, "engines": { "node": ">=12.0" @@ -20392,137 +21626,136 @@ } }, "node_modules/postcss-normalize-charset": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-5.1.0.tgz", - "integrity": "sha512-mSgUJ+pd/ldRGVx26p2wz9dNZ7ji6Pn8VWBajMXFf8jk7vUoSrZ2lt/wZR7DtlZYKesmZI680qjr2CeFF2fbUg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-6.0.1.tgz", + "integrity": "sha512-aW5LbMNRZ+oDV57PF9K+WI1Z8MPnF+A8qbajg/T8PP126YrGX1f9IQx21GI2OlGz7XFJi/fNi0GTbY948XJtXg==", "dev": true, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-display-values": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-5.1.0.tgz", - "integrity": "sha512-WP4KIM4o2dazQXWmFaqMmcvsKmhdINFblgSeRgn8BJ6vxaMyaJkwAzpPpuvSIoG/rmX3M+IrRZEz2H0glrQNEA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-display-values/-/postcss-normalize-display-values-6.0.1.tgz", + "integrity": "sha512-mc3vxp2bEuCb4LgCcmG1y6lKJu1Co8T+rKHrcbShJwUmKJiEl761qb/QQCfFwlrvSeET3jksolCR/RZuMURudw==", "dev": true, "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-positions": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-5.1.1.tgz", - "integrity": "sha512-6UpCb0G4eofTCQLFVuI3EVNZzBNPiIKcA1AKVka+31fTVySphr3VUgAIULBhxZkKgwLImhzMR2Bw1ORK+37INg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-positions/-/postcss-normalize-positions-6.0.1.tgz", + "integrity": "sha512-HRsq8u/0unKNvm0cvwxcOUEcakFXqZ41fv3FOdPn916XFUrympjr+03oaLkuZENz3HE9RrQE9yU0Xv43ThWjQg==", "dev": true, "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-repeat-style": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.1.1.tgz", - "integrity": "sha512-mFpLspGWkQtBcWIRFLmewo8aC3ImN2i/J3v8YCFUwDnPu3Xz4rLohDO26lGjwNsQxB3YF0KKRwspGzE2JEuS0g==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-6.0.1.tgz", + "integrity": "sha512-Gbb2nmCy6tTiA7Sh2MBs3fj9W8swonk6lw+dFFeQT68B0Pzwp1kvisJQkdV6rbbMSd9brMlS8I8ts52tAGWmGQ==", "dev": true, "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-string": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-5.1.0.tgz", - "integrity": "sha512-oYiIJOf4T9T1N4i+abeIc7Vgm/xPCGih4bZz5Nm0/ARVJ7K6xrDlLwvwqOydvyL3RHNf8qZk6vo3aatiw/go3w==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-string/-/postcss-normalize-string-6.0.1.tgz", + "integrity": "sha512-5Fhx/+xzALJD9EI26Aq23hXwmv97Zfy2VFrt5PLT8lAhnBIZvmaT5pQk+NuJ/GWj/QWaKSKbnoKDGLbV6qnhXg==", "dev": true, "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-timing-functions": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-5.1.0.tgz", - "integrity": "sha512-DOEkzJ4SAXv5xkHl0Wa9cZLF3WCBhF3o1SKVxKQAa+0pYKlueTpCgvkFAHfk+Y64ezX9+nITGrDZeVGgITJXjg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-timing-functions/-/postcss-normalize-timing-functions-6.0.1.tgz", + "integrity": "sha512-4zcczzHqmCU7L5dqTB9rzeqPWRMc0K2HoR+Bfl+FSMbqGBUcP5LRfgcH4BdRtLuzVQK1/FHdFoGT3F7rkEnY+g==", "dev": true, "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-unicode": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-5.1.1.tgz", - "integrity": "sha512-qnCL5jzkNUmKVhZoENp1mJiGNPcsJCs1aaRmURmeJGES23Z/ajaln+EPTD+rBeNkSryI+2WTdW+lwcVdOikrpA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-unicode/-/postcss-normalize-unicode-6.0.1.tgz", + "integrity": "sha512-ok9DsI94nEF79MkvmLfHfn8ddnKXA7w+8YuUoz5m7b6TOdoaRCpvu/QMHXQs9+DwUbvp+ytzz04J55CPy77PuQ==", "dev": true, "dependencies": { "browserslist": "^4.21.4", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-5.1.0.tgz", - "integrity": "sha512-5upGeDO+PVthOxSmds43ZeMeZfKH+/DKgGRD7TElkkyS46JXAUhMzIKiCa7BabPeIy3AQcTkXwVVN7DbqsiCew==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-6.0.1.tgz", + "integrity": "sha512-jEXL15tXSvbjm0yzUV7FBiEXwhIa9H88JOXDGQzmcWoB4mSjZIsmtto066s2iW9FYuIrIF4k04HA2BKAOpbsaQ==", "dev": true, "dependencies": { - "normalize-url": "^6.0.1", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-normalize-whitespace": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-5.1.1.tgz", - "integrity": "sha512-83ZJ4t3NUDETIHTa3uEg6asWjSBYL5EdkVB0sDncx9ERzOKBVJIUeDO9RyA9Zwtig8El1d79HBp0JEi8wvGQnA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-whitespace/-/postcss-normalize-whitespace-6.0.1.tgz", + "integrity": "sha512-76i3NpWf6bB8UHlVuLRxG4zW2YykF9CTEcq/9LGAiz2qBuX5cBStadkk0jSkg9a9TCIXbMQz7yzrygKoCW9JuA==", "dev": true, "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-opacity-percentage": { @@ -20548,19 +21781,19 @@ } }, "node_modules/postcss-ordered-values": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-5.1.3.tgz", - "integrity": "sha512-9UO79VUhPwEkzbb3RNpqqghc6lcYej1aveQteWY+4POIwlqkYE21HKWaLDF6lWNuqCobEAyTovVhtI32Rbv2RQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-6.0.1.tgz", + "integrity": "sha512-XXbb1O/MW9HdEhnBxitZpPFbIvDgbo9NK4c/5bOfiKpnIGZDoL2xd7/e6jW5DYLsWxBbs+1nZEnVgnjnlFViaA==", "dev": true, "dependencies": { - "cssnano-utils": "^3.1.0", + "cssnano-utils": "^4.0.1", "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-overflow-shorthand": { @@ -20697,34 +21930,34 @@ } }, "node_modules/postcss-reduce-initial": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-5.1.2.tgz", - "integrity": "sha512-dE/y2XRaqAi6OvjzD22pjTUQ8eOfc6m/natGHgKFBK9DxFmIm69YmaRVQrGgFlEfc1HePIurY0TmDeROK05rIg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-6.0.1.tgz", + "integrity": "sha512-cgzsI2ThG1PMSdSyM9A+bVxiiVgPIVz9f5c6H+TqEv0CA89iCOO81mwLWRWLgOKFtQkKob9nNpnkxG/1RlgFcA==", "dev": true, "dependencies": { "browserslist": "^4.21.4", "caniuse-api": "^3.0.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-reduce-transforms": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-5.1.0.tgz", - "integrity": "sha512-2fbdbmgir5AvpW9RLtdONx1QoYG2/EtqpNQbFASDlixBbAYuTcJ0dECwlqNqH7VbaUnEnh8SrxOe2sRIn24XyQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-6.0.1.tgz", + "integrity": "sha512-fUbV81OkUe75JM+VYO1gr/IoA2b/dRiH6HvMwhrIBSUrxq3jNZQZitSnugcTLDi1KkQh1eR/zi+iyxviUNBkcQ==", "dev": true, "dependencies": { "postcss-value-parser": "^4.2.0" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-replace-overflow-wrap": { @@ -20756,9 +21989,9 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.0.11", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz", - "integrity": "sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g==", + "version": "6.0.13", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", + "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", "dev": true, "dependencies": { "cssesc": "^3.0.0", @@ -20769,34 +22002,34 @@ } }, "node_modules/postcss-svgo": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-5.1.0.tgz", - "integrity": "sha512-D75KsH1zm5ZrHyxPakAxJWtkyXew5qwS70v56exwvw542d9CRtTo78K0WeFxZB4G7JXKKMbEZtZayTGdIky/eA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-6.0.1.tgz", + "integrity": "sha512-eWV4Rrqa06LzTgqirOv5Ln6WTGyU7Pbeqj9WEyKo9tpnWixNATVJMeaEcOHOW1ZYyjcG8wSJwX/28DvU3oy3HA==", "dev": true, "dependencies": { "postcss-value-parser": "^4.2.0", - "svgo": "^2.7.0" + "svgo": "^3.0.5" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >= 18" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-unique-selectors": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-5.1.1.tgz", - "integrity": "sha512-5JiODlELrz8L2HwxfPnhOWZYWDxVHWL83ufOv84NrcgipI7TaeRsatAhK4Tr2/ZiYldpK/wBvw5BD3qfaK96GA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-6.0.1.tgz", + "integrity": "sha512-/KCCEpNNR7oXVJ38/Id7GC9Nt0zxO1T3zVbhVaq6F6LSG+3gU3B7+QuTHfD0v8NPEHlzewAout29S0InmB78EQ==", "dev": true, "dependencies": { "postcss-selector-parser": "^6.0.5" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/postcss-value-parser": { @@ -20815,15 +22048,15 @@ } }, "node_modules/prettier": { - "version": "2.8.7", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.7.tgz", - "integrity": "sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.1.1.tgz", + "integrity": "sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -20852,12 +22085,12 @@ } }, "node_modules/pretty-format": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.5.0.tgz", - "integrity": "sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.4.3", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -20946,9 +22179,9 @@ "dev": true }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "engines": { "node": ">=6" @@ -21004,18 +22237,6 @@ } ] }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/raf": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", @@ -21092,6 +22313,12 @@ "node": ">=14" } }, + "node_modules/react-app-polyfill/node_modules/regenerator-runtime": { + "version": "0.13.11", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", + "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==", + "dev": true + }, "node_modules/react-copy-to-clipboard": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/react-copy-to-clipboard/-/react-copy-to-clipboard-5.1.0.tgz", @@ -21255,9 +22482,9 @@ } }, "node_modules/react-error-boundary": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-4.0.3.tgz", - "integrity": "sha512-IzNKP/ViHWp2QRDgsDMirEcf0XLsLueN6Wgzm1TVwgbAH+paX8Z42VyKvZcFFRHgd+rPK2P4TLrOrHC/dommew==", + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-4.0.12.tgz", + "integrity": "sha512-kJdxdEYlb7CPC1A0SeUY38cHpjuu6UkvzKiAmqmOFL21VRfMhOcWxTCBgLVCO0VEMh9JhFNcVaXlV4/BTpiwOA==", "dependencies": { "@babel/runtime": "^7.12.5" }, @@ -21306,9 +22533,9 @@ "integrity": "sha512-+esm6AJ52uCbKbG5o5Td0olVDcQBOd0dDb0j0iw7mdOe5SOiN6HtWx1Sq2GkIfxWPjuDPUs6UmnzkQYp2Ppoag==" }, "node_modules/react-property": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/react-property/-/react-property-2.0.0.tgz", - "integrity": "sha512-kzmNjIgU32mO4mmH5+iUyrqlpFQhF8K2k7eZ4fdLSOPFrD1XgEuSBv9LDEgxRXTMBqMd8ppT0x6TIzqE5pdGdw==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/react-property/-/react-property-2.0.2.tgz", + "integrity": "sha512-+PbtI3VuDV0l6CleQMsx2gtK0JZbZKbpdu5ynr+lbsuvtmgbNcS3VM0tuY2QjFNOcWxvXeHjDpy42RO+4U2rug==" }, "node_modules/react-redux": { "version": "7.2.9", @@ -21344,29 +22571,29 @@ } }, "node_modules/react-router": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.10.0.tgz", - "integrity": "sha512-Nrg0BWpQqrC3ZFFkyewrflCud9dio9ME3ojHCF/WLsprJVzkq3q3UeEhMCAW1dobjeGbWgjNn/PVF6m46ANxXQ==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.21.0.tgz", + "integrity": "sha512-hGZ0HXbwz3zw52pLZV3j3+ec+m/PQ9cTpBvqjFQmy2XVUWGn5MD+31oXHb6dVTxYzmAeaiUBYjkoNz66n3RGCg==", "dependencies": { - "@remix-run/router": "1.5.0" + "@remix-run/router": "1.14.0" }, "engines": { - "node": ">=14" + "node": ">=14.0.0" }, "peerDependencies": { "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "6.10.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.10.0.tgz", - "integrity": "sha512-E5dfxRPuXKJqzwSe/qGcqdwa18QiWC6f3H3cWXM24qj4N0/beCIf/CWTipop2xm7mR0RCS99NnaqPNjHtrAzCg==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.21.0.tgz", + "integrity": "sha512-1dUdVj3cwc1npzJaf23gulB562ESNvxf7E4x8upNJycqyUm5BRRZ6dd3LrlzhtLaMrwOCO8R0zoiYxdaJx4LlQ==", "dependencies": { - "@remix-run/router": "1.5.0", - "react-router": "6.10.0" + "@remix-run/router": "1.14.0", + "react-router": "6.21.0" }, "engines": { - "node": ">=14" + "node": ">=14.0.0" }, "peerDependencies": { "react": ">=16.8", @@ -21471,9 +22698,9 @@ } }, "node_modules/react-scripts/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -21492,9 +22719,9 @@ "dev": true }, "node_modules/react-select": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.2.tgz", - "integrity": "sha512-cTlJkQ8YjV6T/js8wW0owTzht0hHGABh29vjLscY4HfZGkv7hc3FFTmRp9NzY/Ib1uQ36GieAKEjxpHdpCFpcA==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.8.0.tgz", + "integrity": "sha512-TfjLDo58XrhP6VG5M/Mi56Us0Yt8X7xD6cDybC7yoRMUNm7BGO7qk8J0TLQOua/prb8vUOtsfnXZwfm30HGsAA==", "dependencies": { "@babel/runtime": "^7.12.0", "@emotion/cache": "^11.4.0", @@ -21635,6 +22862,26 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz", + "integrity": "sha512-ECkTw8TmJwW60lOTR+ZkODISW6RQ8+2CL3COqtiJKLd6MmB45hN51HprHFziKLGkAuTGQhBb91V8cy+KHlaCjw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", + "globalthis": "^1.0.3", + "which-builtin-type": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -21642,9 +22889,9 @@ "dev": true }, "node_modules/regenerate-unicode-properties": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz", - "integrity": "sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.1.tgz", + "integrity": "sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==", "dev": true, "dependencies": { "regenerate": "^1.4.2" @@ -21654,14 +22901,14 @@ } }, "node_modules/regenerator-runtime": { - "version": "0.13.11", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz", - "integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==" + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" }, "node_modules/regenerator-transform": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.1.tgz", - "integrity": "sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==", + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.2.tgz", + "integrity": "sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==", "dev": true, "dependencies": { "@babel/runtime": "^7.8.4" @@ -21674,14 +22921,14 @@ "dev": true }, "node_modules/regexp.prototype.flags": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", - "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.3", - "functions-have-names": "^1.2.2" + "define-properties": "^1.2.0", + "set-function-name": "^2.0.0" }, "engines": { "node": ">= 0.4" @@ -21845,11 +23092,11 @@ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -21917,6 +23164,12 @@ } } }, + "node_modules/resolve-url-loader/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "node_modules/resolve-url-loader/node_modules/picocolors": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-0.2.1.tgz", @@ -22078,6 +23331,12 @@ "node": ">=8" } }, + "node_modules/rrweb-cssom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "dev": true + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -22102,13 +23361,31 @@ } }, "node_modules/rxjs": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.0.tgz", - "integrity": "sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==", + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", "dependencies": { "tslib": "^2.1.0" } }, + "node_modules/safe-array-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.1.tgz", + "integrity": "sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "has-symbols": "^1.0.3", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -22220,9 +23497,9 @@ } }, "node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.8", @@ -22244,11 +23521,12 @@ "dev": true }, "node_modules/selfsigned": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz", - "integrity": "sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.4.1.tgz", + "integrity": "sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==", "dev": true, "dependencies": { + "@types/node-forge": "^1.3.0", "node-forge": "^1" }, "engines": { @@ -22256,9 +23534,9 @@ } }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -22417,6 +23695,35 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "optional": true }, + "node_modules/set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -22445,9 +23752,9 @@ } }, "node_modules/shell-quote": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.0.tgz", - "integrity": "sha512-QHsz8GgQIGKlRi24yFc6a6lN69Idnx634w49ay6+jA5yFh7a1UY+4Rp6HPx/L/1zcEDPEij8cIsiqR6bQsE5VQ==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz", + "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -22704,9 +24011,9 @@ } }, "node_modules/stackblur-canvas": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.5.0.tgz", - "integrity": "sha512-EeNzTVfj+1In7aSLPKDD03F/ly4RxEuF/EX0YcOG0cKoPXs+SLZxDawQbexQDBzwROs4VKLWTOaZQlZkGBFEIQ==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.6.0.tgz", + "integrity": "sha512-8S1aIA+UoF6erJYnglGPug6MaHYGo1Ot7h5fuXx4fUPvcvQfcdw2o/ppCse63+eZf8PPidSu4v1JnmEVtEDnpg==", "optional": true, "engines": { "node": ">=0.1.14" @@ -22718,6 +24025,15 @@ "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", "dev": true }, + "node_modules/static-eval": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", + "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", + "dev": true, + "dependencies": { + "escodegen": "^1.8.1" + } + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -22727,18 +24043,6 @@ "node": ">= 0.8" } }, - "node_modules/stop-iteration-iterator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", - "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", - "dev": true, - "dependencies": { - "internal-slot": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -22788,18 +24092,19 @@ "devOptional": true }, "node_modules/string.prototype.matchall": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz", - "integrity": "sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==", + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz", + "integrity": "sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4", - "get-intrinsic": "^1.1.3", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "get-intrinsic": "^1.2.1", "has-symbols": "^1.0.3", - "internal-slot": "^1.0.3", - "regexp.prototype.flags": "^1.4.3", + "internal-slot": "^1.0.5", + "regexp.prototype.flags": "^1.5.0", + "set-function-name": "^2.0.0", "side-channel": "^1.0.4" }, "funding": { @@ -22807,14 +24112,14 @@ } }, "node_modules/string.prototype.trim": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", - "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz", + "integrity": "sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "engines": { "node": ">= 0.4" @@ -22824,28 +24129,28 @@ } }, "node_modules/string.prototype.trimend": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", - "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz", + "integrity": "sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/string.prototype.trimstart": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", - "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz", + "integrity": "sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "define-properties": "^1.1.4", - "es-abstract": "^1.20.4" + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -22917,9 +24222,9 @@ } }, "node_modules/style-loader": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.2.tgz", - "integrity": "sha512-RHs/vcrKdQK8wZliteNK4NKzxvLBzpuHMqYmUVWeKa6MkaIQ97ZTOS0b+zapZhy6GcrgWnvWYCMHRirC3FsUmw==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.3.tgz", + "integrity": "sha512-53BiGLXAcll9maCYtZi2RCQZKa8NQQai5C4horqKyRmHj9H7QmcUyucrH+4KW/gBQbXM2AsB0axoEcFZPlfPcw==", "dev": true, "engines": { "node": ">= 12.13.0" @@ -22933,48 +24238,49 @@ } }, "node_modules/style-to-js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.3.tgz", - "integrity": "sha512-zKI5gN/zb7LS/Vm0eUwjmjrXWw8IMtyA8aPBJZdYiQTXj4+wQ3IucOLIOnF7zCHxvW8UhIGh/uZh/t9zEHXNTQ==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.10.tgz", + "integrity": "sha512-VC7MBJa+y0RZhpnLKDPmVRLRswsASLmixkiZ5R8xZpNT9VyjeRzwnXd2pBzAWdgSGv/pCNNH01gPCCUsB9exYg==", "dependencies": { - "style-to-object": "0.4.1" + "style-to-object": "1.0.5" } }, "node_modules/style-to-object": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.4.1.tgz", - "integrity": "sha512-HFpbb5gr2ypci7Qw+IOhnP2zOU7e77b+rzM+wTzXzfi1PrtBCX0E7Pk4wL4iTLnhzZ+JgEGAhX81ebTg/aYjQw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.5.tgz", + "integrity": "sha512-rDRwHtoDD3UMMrmZ6BzOW0naTjMsVZLIjsGleSKS/0Oz+cgCfAPRspaqJuE8rDzpKha/nEvnM0IF4seEAZUTKQ==", "dependencies": { - "inline-style-parser": "0.1.1" + "inline-style-parser": "0.2.2" } }, "node_modules/stylehacks": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-5.1.1.tgz", - "integrity": "sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-6.0.1.tgz", + "integrity": "sha512-jTqG2aIoX2fYg0YsGvqE4ooE/e75WmaEjnNiP6Ag7irLtHxML8NJRxRxS0HyDpde8DRGuEXTFVHVfR5Tmbxqzg==", "dev": true, "dependencies": { "browserslist": "^4.21.4", "postcss-selector-parser": "^6.0.4" }, "engines": { - "node": "^10 || ^12 || >=14.0" + "node": "^14 || ^16 || >=18.0" }, "peerDependencies": { - "postcss": "^8.2.15" + "postcss": "^8.4.31" } }, "node_modules/stylis": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.1.3.tgz", - "integrity": "sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA==" + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", + "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==" }, "node_modules/sucrase": { - "version": "3.31.0", - "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.31.0.tgz", - "integrity": "sha512-6QsHnkqyVEzYcaiHsOKkzOtOgdJcb8i54x6AV2hDwyZcY9ZyykGZVw6L/YN98xC0evwTP6utsWWrKRaa8QlfEQ==", + "version": "3.34.0", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.34.0.tgz", + "integrity": "sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==", "dev": true, "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", "commander": "^4.0.0", "glob": "7.1.6", "lines-and-columns": "^1.1.6", @@ -23091,24 +24397,28 @@ } }, "node_modules/svgo": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-2.8.0.tgz", - "integrity": "sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.1.0.tgz", + "integrity": "sha512-R5SnNA89w1dYgNv570591F66v34b3eQShpIBcQtZtM5trJwm1VvxbIoMpRYY3ybTAutcKTLEmTsdnaknOHbiQA==", "dev": true, "dependencies": { "@trysound/sax": "0.2.0", "commander": "^7.2.0", - "css-select": "^4.1.3", - "css-tree": "^1.1.3", - "csso": "^4.2.0", - "picocolors": "^1.0.0", - "stable": "^0.1.8" + "css-select": "^5.1.0", + "css-tree": "^2.2.1", + "css-what": "^6.1.0", + "csso": "5.0.5", + "picocolors": "^1.0.0" }, "bin": { "svgo": "bin/svgo" }, "engines": { - "node": ">=10.13.0" + "node": ">=14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/svgo" } }, "node_modules/svgo/node_modules/commander": { @@ -23120,6 +24430,22 @@ "node": ">= 10" } }, + "node_modules/svgo/node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/symbol-tree": { "version": "3.2.4", "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", @@ -23127,53 +24453,42 @@ "dev": true }, "node_modules/tailwindcss": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.1.tgz", - "integrity": "sha512-Vkiouc41d4CEq0ujXl6oiGFQ7bA3WEhUZdTgXAhtKxSy49OmKs8rEfQmupsfF0IGW8fv2iQkp1EVUuapCFrZ9g==", + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.6.tgz", + "integrity": "sha512-AKjF7qbbLvLaPieoKeTjG1+FyNZT6KaJMJPFeQyLfIp7l82ggH1fbHJSsYIvnbTFQOlkh+gBYpyby5GT1LIdLw==", "dev": true, "dependencies": { + "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", "chokidar": "^3.5.3", - "color-name": "^1.1.4", "didyoumean": "^1.2.2", "dlv": "^1.1.3", - "fast-glob": "^3.2.12", + "fast-glob": "^3.3.0", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", - "jiti": "^1.17.2", - "lilconfig": "^2.0.6", + "jiti": "^1.19.1", + "lilconfig": "^2.1.0", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", "object-hash": "^3.0.0", "picocolors": "^1.0.0", - "postcss": "^8.0.9", - "postcss-import": "^14.1.0", - "postcss-js": "^4.0.0", - "postcss-load-config": "^3.1.4", - "postcss-nested": "6.0.0", + "postcss": "^8.4.23", + "postcss-import": "^15.1.0", + "postcss-js": "^4.0.1", + "postcss-load-config": "^4.0.1", + "postcss-nested": "^6.0.1", "postcss-selector-parser": "^6.0.11", - "postcss-value-parser": "^4.2.0", - "quick-lru": "^5.1.1", - "resolve": "^1.22.1", - "sucrase": "^3.29.0" + "resolve": "^1.22.2", + "sucrase": "^3.32.0" }, "bin": { "tailwind": "lib/cli.js", "tailwindcss": "lib/cli.js" }, "engines": { - "node": ">=12.13.0" - }, - "peerDependencies": { - "postcss": "^8.0.9" + "node": ">=14.0.0" } }, - "node_modules/tailwindcss/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/tailwindcss/node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -23186,6 +24501,15 @@ "node": ">=10.13.0" } }, + "node_modules/tailwindcss/node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -23196,14 +24520,14 @@ } }, "node_modules/tar": { - "version": "6.1.13", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.13.tgz", - "integrity": "sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", + "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", "optional": true, "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", - "minipass": "^4.0.0", + "minipass": "^5.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" @@ -23274,13 +24598,13 @@ } }, "node_modules/terser": { - "version": "5.16.8", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.8.tgz", - "integrity": "sha512-QI5g1E/ef7d+PsDifb+a6nnVgC4F22Bg6T0xrBrz6iloVB4PUkkunp6V8nzoOOZJIzjWVdAGqCdlKlhLq/TbIA==", + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.26.0.tgz", + "integrity": "sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ==", "dev": true, "dependencies": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -23292,16 +24616,16 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.7", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.7.tgz", - "integrity": "sha512-AfKwIktyP7Cu50xNjXF/6Qb5lBNzYaWpU6YfoX3uZicTx0zTy0stDDCsvjDapKsSDvOeWo5MEq4TmdBy2cNoHw==", + "version": "5.3.9", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", + "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.17", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.1", - "terser": "^5.16.5" + "terser": "^5.16.8" }, "engines": { "node": ">= 10.13.0" @@ -23487,9 +24811,9 @@ } }, "node_modules/tough-cookie": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz", - "integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dev": true, "dependencies": { "psl": "^1.1.33", @@ -23511,15 +24835,15 @@ } }, "node_modules/tr46": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", - "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", "dev": true, "dependencies": { - "punycode": "^2.1.1" + "punycode": "^2.3.1" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/tryer": { @@ -23535,9 +24859,9 @@ "dev": true }, "node_modules/tsconfig-paths": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", - "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, "dependencies": { "@types/json5": "^0.0.29", @@ -23568,9 +24892,9 @@ } }, "node_modules/tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -23639,6 +24963,57 @@ "node": ">= 0.6" } }, + "node_modules/typed-array-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz", + "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz", + "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", + "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "has-proto": "^1.0.1", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/typed-array-length": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", @@ -23676,9 +25051,9 @@ } }, "node_modules/ua-parser-js": { - "version": "1.0.35", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.35.tgz", - "integrity": "sha512-fKnGuqmTBnIE+/KXSzCn4db8RTigUzw1AN0DmdU6hJovUTbYJKyqj+8Mt1c4VfRDnOVJnENmfYkIPZ946UrSAA==", + "version": "1.0.37", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.37.tgz", + "integrity": "sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==", "funding": [ { "type": "opencollective", @@ -23687,6 +25062,10 @@ { "type": "paypal", "url": "https://paypal.me/faisalman" + }, + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" } ], "engines": { @@ -23708,6 +25087,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/underscore": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", + "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==", + "dev": true + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -23761,26 +25152,18 @@ } }, "node_modules/universal-cookie": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/universal-cookie/-/universal-cookie-4.0.4.tgz", - "integrity": "sha512-lbRVHoOMtItjWbM7TwDLdl8wug7izB0tq3/YVKhT/ahB4VDvWMyvnADfnJI8y6fSvsjh51Ix7lTGC6Tn4rMPhw==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/universal-cookie/-/universal-cookie-6.1.1.tgz", + "integrity": "sha512-33S9x3CpdUnnjwTNs2Fgc41WGve2tdLtvaK2kPSbZRc5pGpz2vQFbRWMxlATsxNNe/Cy8SzmnmbuBM85jpZPtA==", "dependencies": { - "@types/cookie": "^0.3.3", - "cookie": "^0.4.0" - } - }, - "node_modules/universal-cookie/node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "engines": { - "node": ">= 0.6" + "@types/cookie": "^0.5.1", + "cookie": "^0.5.0" } }, "node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "engines": { "node": ">= 10.0.0" @@ -23812,9 +25195,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "dev": true, "funding": [ { @@ -23824,6 +25207,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { @@ -23831,7 +25218,7 @@ "picocolors": "^1.0.0" }, "bin": { - "browserslist-lint": "cli.js" + "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" @@ -23922,9 +25309,13 @@ } }, "node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "peer": true, "bin": { "uuid": "dist/bin/uuid" @@ -23944,6 +25335,12 @@ "node": ">=10.12.0" } }, + "node_modules/v8-to-istanbul/node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, "node_modules/v8-to-istanbul/node_modules/source-map": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", @@ -23973,15 +25370,15 @@ } }, "node_modules/w3c-xmlserializer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", - "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", "dev": true, "dependencies": { - "xml-name-validator": "^4.0.0" + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/walker": { @@ -24041,22 +25438,22 @@ } }, "node_modules/webpack": { - "version": "5.77.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.77.0.tgz", - "integrity": "sha512-sbGNjBr5Ya5ss91yzjeJTLKyfiwo5C628AFjEa6WSXcZa4E+F57om3Cc8xLb1Jh0b243AWuSYRf3dn7HVeFQ9Q==", + "version": "5.89.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.89.0.tgz", + "integrity": "sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", - "@types/estree": "^0.0.51", - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/wasm-edit": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", + "@types/estree": "^1.0.0", + "@webassemblyjs/ast": "^1.11.5", + "@webassemblyjs/wasm-edit": "^1.11.5", + "@webassemblyjs/wasm-parser": "^1.11.5", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.7.6", + "acorn-import-assertions": "^1.9.0", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.10.0", - "es-module-lexer": "^0.9.0", + "enhanced-resolve": "^5.15.0", + "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", @@ -24065,9 +25462,9 @@ "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.0", + "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.1.3", + "terser-webpack-plugin": "^5.3.7", "watchpack": "^2.4.0", "webpack-sources": "^3.2.3" }, @@ -24145,15 +25542,15 @@ "dev": true }, "node_modules/webpack-dev-middleware/node_modules/schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", + "ajv": "^8.9.0", "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" + "ajv-keywords": "^5.1.0" }, "engines": { "node": ">= 12.13.0" @@ -24164,9 +25561,9 @@ } }, "node_modules/webpack-dev-server": { - "version": "4.13.2", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.13.2.tgz", - "integrity": "sha512-5i6TrGBRxG4vnfDpB6qSQGfnB6skGBXNL5/542w2uRGLimX6qeE5BQMLrzIC3JYV/xlGOv+s+hTleI9AZKUQNw==", + "version": "4.15.1", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.15.1.tgz", + "integrity": "sha512-5hbAst3h3C3L8w6W4P96L5vaV0PxSmJhxZvWKYIdgxOQm8pNZ5dEOmmSLBVpP85ReeyRt6AS1QJNyo/oFFPeVA==", "dev": true, "dependencies": { "@types/bonjour": "^3.5.9", @@ -24175,7 +25572,7 @@ "@types/serve-index": "^1.9.1", "@types/serve-static": "^1.13.10", "@types/sockjs": "^0.3.33", - "@types/ws": "^8.5.1", + "@types/ws": "^8.5.5", "ansi-html-community": "^0.0.8", "bonjour-service": "^1.0.11", "chokidar": "^3.5.3", @@ -24251,9 +25648,9 @@ } }, "node_modules/webpack-dev-server/node_modules/ipaddr.js": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", - "integrity": "sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", + "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==", "dev": true, "engines": { "node": ">= 10" @@ -24266,15 +25663,15 @@ "dev": true }, "node_modules/webpack-dev-server/node_modules/schema-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz", - "integrity": "sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "ajv": "^8.8.0", + "ajv": "^8.9.0", "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.0.0" + "ajv-keywords": "^5.1.0" }, "engines": { "node": ">= 12.13.0" @@ -24322,12 +25719,6 @@ "node": ">=10.13.0" } }, - "node_modules/webpack/node_modules/@types/estree": { - "version": "0.0.51", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", - "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", - "dev": true - }, "node_modules/webpack/node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -24372,15 +25763,15 @@ } }, "node_modules/whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", "dev": true, "dependencies": { "iconv-lite": "0.6.3" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-encoding/node_modules/iconv-lite": { @@ -24396,31 +25787,31 @@ } }, "node_modules/whatwg-fetch": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", - "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==", + "version": "3.6.20", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", + "integrity": "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==", "dev": true }, "node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", "dev": true, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-url": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", - "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz", + "integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==", "dev": true, "dependencies": { - "tr46": "^3.0.0", + "tr46": "^5.0.0", "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/which": { @@ -24454,6 +25845,32 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/which-builtin-type": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.3.tgz", + "integrity": "sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==", + "dev": true, + "dependencies": { + "function.prototype.name": "^1.1.5", + "has-tostringtag": "^1.0.0", + "is-async-function": "^2.0.0", + "is-date-object": "^1.0.5", + "is-finalizationregistry": "^1.0.2", + "is-generator-function": "^1.0.10", + "is-regex": "^1.1.4", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.0.2", + "which-collection": "^1.0.1", + "which-typed-array": "^1.1.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/which-collection": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", @@ -24470,17 +25887,16 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", - "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", + "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "call-bind": "^1.0.4", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0", - "is-typed-array": "^1.1.10" + "has-tostringtag": "^1.0.0" }, "engines": { "node": ">= 0.4" @@ -24499,37 +25915,37 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/workbox-background-sync": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-background-sync/-/workbox-background-sync-6.5.4.tgz", - "integrity": "sha512-0r4INQZMyPky/lj4Ou98qxcThrETucOde+7mRGJl13MPJugQNKeZQOdIJe/1AchOP23cTqHcN/YVpD6r8E6I8g==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-background-sync/-/workbox-background-sync-6.6.0.tgz", + "integrity": "sha512-jkf4ZdgOJxC9u2vztxLuPT/UjlH7m/nWRQ/MgGL0v8BJHoZdVGJd18Kck+a0e55wGXdqyHO+4IQTk0685g4MUw==", "dev": true, "dependencies": { "idb": "^7.0.1", - "workbox-core": "6.5.4" + "workbox-core": "6.6.0" } }, "node_modules/workbox-broadcast-update": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-broadcast-update/-/workbox-broadcast-update-6.5.4.tgz", - "integrity": "sha512-I/lBERoH1u3zyBosnpPEtcAVe5lwykx9Yg1k6f8/BGEPGaMMgZrwVrqL1uA9QZ1NGGFoyE6t9i7lBjOlDhFEEw==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-broadcast-update/-/workbox-broadcast-update-6.6.0.tgz", + "integrity": "sha512-nm+v6QmrIFaB/yokJmQ/93qIJ7n72NICxIwQwe5xsZiV2aI93MGGyEyzOzDPVz5THEr5rC3FJSsO3346cId64Q==", "dev": true, "dependencies": { - "workbox-core": "6.5.4" + "workbox-core": "6.6.0" } }, "node_modules/workbox-build": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-build/-/workbox-build-6.5.4.tgz", - "integrity": "sha512-kgRevLXEYvUW9WS4XoziYqZ8Q9j/2ziJYEtTrjdz5/L/cTUa2XfyMP2i7c3p34lgqJ03+mTiz13SdFef2POwbA==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-build/-/workbox-build-6.6.0.tgz", + "integrity": "sha512-Tjf+gBwOTuGyZwMz2Nk/B13Fuyeo0Q84W++bebbVsfr9iLkDSo6j6PST8tET9HYA58mlRXwlMGpyWO8ETJiXdQ==", "dev": true, "dependencies": { "@apideck/better-ajv-errors": "^0.3.1", @@ -24554,21 +25970,21 @@ "strip-comments": "^2.0.1", "tempy": "^0.6.0", "upath": "^1.2.0", - "workbox-background-sync": "6.5.4", - "workbox-broadcast-update": "6.5.4", - "workbox-cacheable-response": "6.5.4", - "workbox-core": "6.5.4", - "workbox-expiration": "6.5.4", - "workbox-google-analytics": "6.5.4", - "workbox-navigation-preload": "6.5.4", - "workbox-precaching": "6.5.4", - "workbox-range-requests": "6.5.4", - "workbox-recipes": "6.5.4", - "workbox-routing": "6.5.4", - "workbox-strategies": "6.5.4", - "workbox-streams": "6.5.4", - "workbox-sw": "6.5.4", - "workbox-window": "6.5.4" + "workbox-background-sync": "6.6.0", + "workbox-broadcast-update": "6.6.0", + "workbox-cacheable-response": "6.6.0", + "workbox-core": "6.6.0", + "workbox-expiration": "6.6.0", + "workbox-google-analytics": "6.6.0", + "workbox-navigation-preload": "6.6.0", + "workbox-precaching": "6.6.0", + "workbox-range-requests": "6.6.0", + "workbox-recipes": "6.6.0", + "workbox-routing": "6.6.0", + "workbox-strategies": "6.6.0", + "workbox-streams": "6.6.0", + "workbox-sw": "6.6.0", + "workbox-window": "6.6.0" }, "engines": { "node": ">=10.0.0" @@ -24667,130 +26083,131 @@ } }, "node_modules/workbox-cacheable-response": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-cacheable-response/-/workbox-cacheable-response-6.5.4.tgz", - "integrity": "sha512-DCR9uD0Fqj8oB2TSWQEm1hbFs/85hXXoayVwFKLVuIuxwJaihBsLsp4y7J9bvZbqtPJ1KlCkmYVGQKrBU4KAug==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-cacheable-response/-/workbox-cacheable-response-6.6.0.tgz", + "integrity": "sha512-JfhJUSQDwsF1Xv3EV1vWzSsCOZn4mQ38bWEBR3LdvOxSPgB65gAM6cS2CX8rkkKHRgiLrN7Wxoyu+TuH67kHrw==", + "deprecated": "workbox-background-sync@6.6.0", "dev": true, "dependencies": { - "workbox-core": "6.5.4" + "workbox-core": "6.6.0" } }, "node_modules/workbox-core": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-core/-/workbox-core-6.5.4.tgz", - "integrity": "sha512-OXYb+m9wZm8GrORlV2vBbE5EC1FKu71GGp0H4rjmxmF4/HLbMCoTFws87M3dFwgpmg0v00K++PImpNQ6J5NQ6Q==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-core/-/workbox-core-6.6.0.tgz", + "integrity": "sha512-GDtFRF7Yg3DD859PMbPAYPeJyg5gJYXuBQAC+wyrWuuXgpfoOrIQIvFRZnQ7+czTIQjIr1DhLEGFzZanAT/3bQ==", "dev": true }, "node_modules/workbox-expiration": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-expiration/-/workbox-expiration-6.5.4.tgz", - "integrity": "sha512-jUP5qPOpH1nXtjGGh1fRBa1wJL2QlIb5mGpct3NzepjGG2uFFBn4iiEBiI9GUmfAFR2ApuRhDydjcRmYXddiEQ==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-expiration/-/workbox-expiration-6.6.0.tgz", + "integrity": "sha512-baplYXcDHbe8vAo7GYvyAmlS4f6998Jff513L4XvlzAOxcl8F620O91guoJ5EOf5qeXG4cGdNZHkkVAPouFCpw==", "dev": true, "dependencies": { "idb": "^7.0.1", - "workbox-core": "6.5.4" + "workbox-core": "6.6.0" } }, "node_modules/workbox-google-analytics": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-google-analytics/-/workbox-google-analytics-6.5.4.tgz", - "integrity": "sha512-8AU1WuaXsD49249Wq0B2zn4a/vvFfHkpcFfqAFHNHwln3jK9QUYmzdkKXGIZl9wyKNP+RRX30vcgcyWMcZ9VAg==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-google-analytics/-/workbox-google-analytics-6.6.0.tgz", + "integrity": "sha512-p4DJa6OldXWd6M9zRl0H6vB9lkrmqYFkRQ2xEiNdBFp9U0LhsGO7hsBscVEyH9H2/3eZZt8c97NB2FD9U2NJ+Q==", "dev": true, "dependencies": { - "workbox-background-sync": "6.5.4", - "workbox-core": "6.5.4", - "workbox-routing": "6.5.4", - "workbox-strategies": "6.5.4" + "workbox-background-sync": "6.6.0", + "workbox-core": "6.6.0", + "workbox-routing": "6.6.0", + "workbox-strategies": "6.6.0" } }, "node_modules/workbox-navigation-preload": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-navigation-preload/-/workbox-navigation-preload-6.5.4.tgz", - "integrity": "sha512-IIwf80eO3cr8h6XSQJF+Hxj26rg2RPFVUmJLUlM0+A2GzB4HFbQyKkrgD5y2d84g2IbJzP4B4j5dPBRzamHrng==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-navigation-preload/-/workbox-navigation-preload-6.6.0.tgz", + "integrity": "sha512-utNEWG+uOfXdaZmvhshrh7KzhDu/1iMHyQOV6Aqup8Mm78D286ugu5k9MFD9SzBT5TcwgwSORVvInaXWbvKz9Q==", "dev": true, "dependencies": { - "workbox-core": "6.5.4" + "workbox-core": "6.6.0" } }, "node_modules/workbox-precaching": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-precaching/-/workbox-precaching-6.5.4.tgz", - "integrity": "sha512-hSMezMsW6btKnxHB4bFy2Qfwey/8SYdGWvVIKFaUm8vJ4E53JAY+U2JwLTRD8wbLWoP6OVUdFlXsTdKu9yoLTg==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-precaching/-/workbox-precaching-6.6.0.tgz", + "integrity": "sha512-eYu/7MqtRZN1IDttl/UQcSZFkHP7dnvr/X3Vn6Iw6OsPMruQHiVjjomDFCNtd8k2RdjLs0xiz9nq+t3YVBcWPw==", "dev": true, "dependencies": { - "workbox-core": "6.5.4", - "workbox-routing": "6.5.4", - "workbox-strategies": "6.5.4" + "workbox-core": "6.6.0", + "workbox-routing": "6.6.0", + "workbox-strategies": "6.6.0" } }, "node_modules/workbox-range-requests": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-range-requests/-/workbox-range-requests-6.5.4.tgz", - "integrity": "sha512-Je2qR1NXCFC8xVJ/Lux6saH6IrQGhMpDrPXWZWWS8n/RD+WZfKa6dSZwU+/QksfEadJEr/NfY+aP/CXFFK5JFg==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-range-requests/-/workbox-range-requests-6.6.0.tgz", + "integrity": "sha512-V3aICz5fLGq5DpSYEU8LxeXvsT//mRWzKrfBOIxzIdQnV/Wj7R+LyJVTczi4CQ4NwKhAaBVaSujI1cEjXW+hTw==", "dev": true, "dependencies": { - "workbox-core": "6.5.4" + "workbox-core": "6.6.0" } }, "node_modules/workbox-recipes": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-recipes/-/workbox-recipes-6.5.4.tgz", - "integrity": "sha512-QZNO8Ez708NNwzLNEXTG4QYSKQ1ochzEtRLGaq+mr2PyoEIC1xFW7MrWxrONUxBFOByksds9Z4//lKAX8tHyUA==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-recipes/-/workbox-recipes-6.6.0.tgz", + "integrity": "sha512-TFi3kTgYw73t5tg73yPVqQC8QQjxJSeqjXRO4ouE/CeypmP2O/xqmB/ZFBBQazLTPxILUQ0b8aeh0IuxVn9a6A==", "dev": true, "dependencies": { - "workbox-cacheable-response": "6.5.4", - "workbox-core": "6.5.4", - "workbox-expiration": "6.5.4", - "workbox-precaching": "6.5.4", - "workbox-routing": "6.5.4", - "workbox-strategies": "6.5.4" + "workbox-cacheable-response": "6.6.0", + "workbox-core": "6.6.0", + "workbox-expiration": "6.6.0", + "workbox-precaching": "6.6.0", + "workbox-routing": "6.6.0", + "workbox-strategies": "6.6.0" } }, "node_modules/workbox-routing": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-routing/-/workbox-routing-6.5.4.tgz", - "integrity": "sha512-apQswLsbrrOsBUWtr9Lf80F+P1sHnQdYodRo32SjiByYi36IDyL2r7BH1lJtFX8fwNHDa1QOVY74WKLLS6o5Pg==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-routing/-/workbox-routing-6.6.0.tgz", + "integrity": "sha512-x8gdN7VDBiLC03izAZRfU+WKUXJnbqt6PG9Uh0XuPRzJPpZGLKce/FkOX95dWHRpOHWLEq8RXzjW0O+POSkKvw==", "dev": true, "dependencies": { - "workbox-core": "6.5.4" + "workbox-core": "6.6.0" } }, "node_modules/workbox-strategies": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-strategies/-/workbox-strategies-6.5.4.tgz", - "integrity": "sha512-DEtsxhx0LIYWkJBTQolRxG4EI0setTJkqR4m7r4YpBdxtWJH1Mbg01Cj8ZjNOO8etqfA3IZaOPHUxCs8cBsKLw==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-strategies/-/workbox-strategies-6.6.0.tgz", + "integrity": "sha512-eC07XGuINAKUWDnZeIPdRdVja4JQtTuc35TZ8SwMb1ztjp7Ddq2CJ4yqLvWzFWGlYI7CG/YGqaETntTxBGdKgQ==", "dev": true, "dependencies": { - "workbox-core": "6.5.4" + "workbox-core": "6.6.0" } }, "node_modules/workbox-streams": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-streams/-/workbox-streams-6.5.4.tgz", - "integrity": "sha512-FXKVh87d2RFXkliAIheBojBELIPnWbQdyDvsH3t74Cwhg0fDheL1T8BqSM86hZvC0ZESLsznSYWw+Va+KVbUzg==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-streams/-/workbox-streams-6.6.0.tgz", + "integrity": "sha512-rfMJLVvwuED09CnH1RnIep7L9+mj4ufkTyDPVaXPKlhi9+0czCu+SJggWCIFbPpJaAZmp2iyVGLqS3RUmY3fxg==", "dev": true, "dependencies": { - "workbox-core": "6.5.4", - "workbox-routing": "6.5.4" + "workbox-core": "6.6.0", + "workbox-routing": "6.6.0" } }, "node_modules/workbox-sw": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-sw/-/workbox-sw-6.5.4.tgz", - "integrity": "sha512-vo2RQo7DILVRoH5LjGqw3nphavEjK4Qk+FenXeUsknKn14eCNedHOXWbmnvP4ipKhlE35pvJ4yl4YYf6YsJArA==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-sw/-/workbox-sw-6.6.0.tgz", + "integrity": "sha512-R2IkwDokbtHUE4Kus8pKO5+VkPHD2oqTgl+XJwh4zbF1HyjAbgNmK/FneZHVU7p03XUt9ICfuGDYISWG9qV/CQ==", "dev": true }, "node_modules/workbox-webpack-plugin": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-webpack-plugin/-/workbox-webpack-plugin-6.5.4.tgz", - "integrity": "sha512-LmWm/zoaahe0EGmMTrSLUi+BjyR3cdGEfU3fS6PN1zKFYbqAKuQ+Oy/27e4VSXsyIwAw8+QDfk1XHNGtZu9nQg==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-webpack-plugin/-/workbox-webpack-plugin-6.6.0.tgz", + "integrity": "sha512-xNZIZHalboZU66Wa7x1YkjIqEy1gTR+zPM+kjrYJzqN7iurYZBctBLISyScjhkJKYuRrZUP0iqViZTh8rS0+3A==", "dev": true, "dependencies": { "fast-json-stable-stringify": "^2.1.0", "pretty-bytes": "^5.4.1", "upath": "^1.2.0", "webpack-sources": "^1.4.3", - "workbox-build": "6.5.4" + "workbox-build": "6.6.0" }, "engines": { "node": ">=10.0.0" @@ -24810,13 +26227,13 @@ } }, "node_modules/workbox-window": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/workbox-window/-/workbox-window-6.5.4.tgz", - "integrity": "sha512-HnLZJDwYBE+hpG25AQBO8RUWBJRaCsI9ksQJEp3aCOFCaG5kqaToAYXFRAHxzRluM2cQbGzdQF5rjKPWPA1fug==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/workbox-window/-/workbox-window-6.6.0.tgz", + "integrity": "sha512-L4N9+vka17d16geaJXXRjENLFldvkWy7JyGxElRD0JvBxvFEd8LOhr+uXCcar/NzAmIBRv9EZ+M+Qr4mOoBITw==", "dev": true, "dependencies": { "@types/trusted-types": "^2.0.2", - "workbox-core": "6.5.4" + "workbox-core": "6.6.0" } }, "node_modules/worker-loader": { @@ -24909,9 +26326,9 @@ } }, "node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.15.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.15.1.tgz", + "integrity": "sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==", "dev": true, "engines": { "node": ">=10.0.0" @@ -24930,12 +26347,12 @@ } }, "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", "dev": true, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/xmlchars": { @@ -25007,9 +26424,9 @@ } }, "node_modules/zod": { - "version": "3.21.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz", - "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==", + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index 8eb0c857..d16ab01b 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,34 @@ { "name": "portal-core-components", - "version": "2.6.0", + "version": "2.7.0", "main": "./lib/index.js", "private": true, "homepage": "http://localhost:3010/core-components", "dependencies": { "@date-io/moment": "^1.3.13", - "@fortawesome/fontawesome-svg-core": "^6.4.0", - "@fortawesome/free-regular-svg-icons": "^6.4.0", - "@fortawesome/free-solid-svg-icons": "^6.4.0", + "@fortawesome/fontawesome-svg-core": "^6.5.1", + "@fortawesome/free-regular-svg-icons": "^6.5.1", + "@fortawesome/free-solid-svg-icons": "^6.5.1", "@fortawesome/react-fontawesome": "^0.2.0", "@material-ui/core": "^4.12.4", "@material-ui/icons": "^4.11.3", "@material-ui/lab": "~4.0.0-alpha.61", - "@material-ui/pickers": "^3.3.10", + "@material-ui/pickers": "^3.3.11", "@material-ui/styles": "^4.11.5", "@stomp/rx-stomp": "^2.0.0", "@stomp/stompjs": "^7.0.0", - "@types/dateformat": "^5.0.0", - "@types/lodash": "^4.14.192", - "@types/react": "^17.0.56", - "@types/react-copy-to-clipboard": "^5.0.4", - "@types/react-dom": "^17.0.19", + "@types/dateformat": "^5.0.2", + "@types/lodash": "^4.14.202", + "@types/react": "^17.0.73", + "@types/react-copy-to-clipboard": "^5.0.7", + "@types/react-dom": "^17.0.25", "@types/react-router": "^5.1.20", "@types/react-router-dom": "^5.3.3", - "@types/sockjs-client": "^1.5.1", - "@types/ua-parser-js": "^0.7.36", - "@types/wicg-file-system-access": "^2020.9.5", - "clsx": "^1.2.1", - "core-js": "^3.30.0", + "@types/sockjs-client": "^1.5.4", + "@types/ua-parser-js": "^0.7.39", + "@types/wicg-file-system-access": "^2023.10.4", + "clsx": "^2.0.0", + "core-js": "^3.34.0", "d3-drag": "^3.0.0", "d3-selection": "^3.0.0", "d3-transition": "^3.0.1", @@ -36,80 +36,95 @@ "dom-to-image": "^2.6.0", "dygraphs": "2.1.0", "file-saver": "^2.0.5", - "highlight.js": "^11.7.0", + "highlight.js": "^11.9.0", "history": "^5.3.0", - "html-react-parser": "^3.0.15", + "html-react-parser": "^5.0.7", "leaflet": "~1.6.0", "lodash": "^4.17.21", "material-table": "^1.69.3", "moment": "^2.29.4", "node-lzw": "^0.3.1", "papaparse": "^5.4.1", - "pdfjs-dist": "^3.5.141", + "pdfjs-dist": "~3.5.141", "prop-types": "^15.8.1", "react": "^17.0.2", "react-copy-to-clipboard": "^5.1.0", "react-dom": "^17.0.2", - "react-error-boundary": "^4.0.3", + "react-error-boundary": "^4.0.12", "react-id-generator": "^3.0.2", "react-leaflet": "^2.8.0", "react-leaflet-grouped-layer-control": "0.0.13", - "react-router": "^6.10.0", - "react-router-dom": "^6.10.0", - "react-select": "^5.7.2", + "react-router": "^6.21.0", + "react-router-dom": "^6.21.0", + "react-select": "^5.8.0", "redux": "^4.2.1", "redux-observable": "^2.0.0", - "rxjs": "^7.8.0", + "rxjs": "^7.8.1", "sockjs-client": "^1.6.1", "tinycolor2": "^1.6.0", - "ua-parser-js": "^1.0.35", - "universal-cookie": "^4.0.4", - "zod": "^3.21.4" + "ua-parser-js": "^1.0.37", + "universal-cookie": "^6.1.1", + "zod": "^3.22.4" }, "peerDependencies": { - "commander": "^9.5.0", - "cssnano": "^5.1.15", - "jsdom": "^20.0.3", - "node-fetch": "^3.3.1", - "postcss": "^8.4.21", - "prettier": "^2.8.7", + "commander": "^11.1.0", + "cssnano": "^6.0.2", + "jsdom": "^23.0.1", + "node-fetch": "^3.3.2", + "postcss": "^8.4.32", + "prettier": "^3.1.1", "worker-loader": "^3.0.8" }, "peerDependenciesMeta": { - "commander": { "optional": true }, - "cssnano": { "optional": true }, - "jsdom": { "optional": true }, - "node-fetch": { "optional": true }, - "postcss": { "optional": true }, - "prettier": { "optional": true }, - "worker-loader": { "optional": true } + "commander": { + "optional": true + }, + "cssnano": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "node-fetch": { + "optional": true + }, + "postcss": { + "optional": true + }, + "prettier": { + "optional": true + }, + "worker-loader": { + "optional": true + } }, "devDependencies": { - "@babel/cli": "^7.21.0", - "@babel/core": "^7.21.4", + "@babel/cli": "^7.23.4", + "@babel/core": "^7.23.6", "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-proposal-object-rest-spread": "^7.20.7", - "@babel/plugin-transform-object-assign": "^7.18.6", - "@babel/preset-env": "^7.21.4", - "@babel/preset-react": "^7.18.6", - "@babel/preset-typescript": "^7.21.4", - "@jest/globals": "^29.5.0", + "@babel/plugin-proposal-private-property-in-object": "^7.21.11", + "@babel/plugin-transform-object-assign": "^7.23.3", + "@babel/preset-env": "^7.23.6", + "@babel/preset-react": "^7.23.3", + "@babel/preset-typescript": "^7.23.3", + "@jest/globals": "^29.7.0", "@testing-library/react-hooks": "^8.0.1", - "@typescript-eslint/parser": "^5.57.1", - "commander": "^9.5.0", - "cssnano": "^5.1.15", - "eslint": "^8.37.0", + "@typescript-eslint/parser": "~5.62.0", + "commander": "^11.1.0", + "cssnano": "^6.0.2", + "eslint": "^8.55.0", "eslint-config-airbnb": "^19.0.4", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-react": "^7.32.2", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsx-a11y": "^6.8.0", + "eslint-plugin-react": "^7.33.2", "express": "^4.18.2", "html-loader": "^4.2.0", - "jest-canvas-mock": "^2.5.0", - "jsdom": "^20.0.3", - "node-fetch": "^3.3.1", - "postcss": "^8.4.21", - "prettier": "^2.8.7", + "jest-canvas-mock": "^2.5.2", + "jsdom": "^23.0.1", + "node-fetch": "^3.3.2", + "postcss": "^8.4.32", + "prettier": "^3.1.1", "react-scripts": "^5.0.1", "react-test-renderer": "^17.0.2", "typescript": "~4.9.5", diff --git a/public/assets/css/drupal-theme.98af391f0797dc8df157fb52a8a37b1d.min.css b/public/assets/css/drupal-theme.98af391f0797dc8df157fb52a8a37b1d.min.css index 87ea1812..077ab0f9 100644 --- a/public/assets/css/drupal-theme.98af391f0797dc8df157fb52a8a37b1d.min.css +++ b/public/assets/css/drupal-theme.98af391f0797dc8df157fb52a8a37b1d.min.css @@ -1,2 +1,2 @@ -@charset "UTF-8";#footer,#header{color:#141516;font-family:Inter,sans-serif}#footer,#footer html,#header,#header html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#footer html,#header html{font-family:sans-serif}#footer body,#header body{margin:0}#footer article,#footer aside,#footer details,#footer figcaption,#footer figure,#footer footer,#footer header,#footer hgroup,#footer main,#footer nav,#footer section,#footer summary,#header article,#header aside,#header details,#header figcaption,#header figure,#header footer,#header header,#header hgroup,#header main,#header nav,#header section,#header summary{display:block}#footer audio,#footer canvas,#footer progress,#footer video,#header audio,#header canvas,#header progress,#header video{display:inline-block;vertical-align:baseline}#footer audio:not([controls]),#header audio:not([controls]){display:none;height:0}#footer [hidden],#footer template,#header [hidden],#header template{display:none}#footer a,#header a{background:transparent}#footer a:active,#footer a:hover,#header a:active,#header a:hover{outline:0}#footer abbr[title],#header abbr[title]{border-bottom:1px dotted}#footer b,#footer strong,#header b,#header strong{font-weight:700}#footer dfn,#header dfn{font-style:italic}#footer mark,#header mark{background:#ff0;color:#000}#footer small,#header small{font-size:80%}#footer sub,#footer sup,#header sub,#header sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}#footer sup,#header sup{top:-.5em}#footer sub,#header sub{bottom:-.25em}#footer img,#header img{border:0}#footer svg:not(:root),#header svg:not(:root){overflow:hidden}#footer hr,#header hr{-webkit-box-sizing:border-box;box-sizing:border-box;height:0}#footer pre,#header pre{overflow:auto;white-space:pre-wrap;word-break:break-all}#footer code,#footer kbd,#footer pre,#footer samp,#header code,#header kbd,#header pre,#header samp{font-family:monospace,monospace}#footer table,#header table{border-collapse:collapse;border-spacing:0}#footer td,#footer th,#header td,#header th{padding:0}#footer .hidden,#header .hidden{display:none}#footer .visually-hidden,#header .visually-hidden{clip:rect(1px,1px,1px,1px);word-wrap:normal;height:1px;overflow:hidden;position:absolute!important;width:1px}#footer .visually-hidden.focusable:active,#footer .visually-hidden.focusable:focus,#header .visually-hidden.focusable:active,#header .visually-hidden.focusable:focus{clip:auto;height:auto;overflow:visible;position:static!important;width:auto}#footer .invisible,#header .invisible{visibility:hidden}@media (min-width:0px) and (max-width:1199.98px){#footer .isDesktop,#header .isDesktop{display:none!important}}@media (min-width:992px){#footer .isDesktop,#header .isDesktop{display:inherit}}@media (min-width:0px) and (max-width:1199.98px){#footer .isMobile,#header .isMobile{display:inherit}}@media (min-width:1200px){#footer .isMobile,#header .isMobile{display:none!important}}@media (min-width:0px) and (max-width:1199.98px){#footer .hiddenDesktop,#header .hiddenDesktop{display:inherit}}@media (min-width:1200px){#footer .hiddenDesktop,#header .hiddenDesktop{background:none!important;opacity:0!important;visibility:hidden!important}}@font-face{#footer,#header{font-display:swap;font-family:Inter;font-style:normal;font-style:italic;font-weight:100;font-weight:200;font-weight:300;font-weight:400;font-weight:500;font-weight:600;font-weight:700;font-weight:800;font-weight:900}}#footer *,#footer :after,#footer :before,#header *,#header :after,#header :before{-webkit-box-sizing:border-box;box-sizing:border-box}#footer html,#header html{font-size:100%}#footer body,#header body{-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";background:#fff!important;color:#141516;font-family:Inter,sans-serif;overflow-x:hidden}@media (min-width:0px){#footer body,#header body{font-size:1.125rem}}@media (min-width:600px){#footer body,#header body{font-size:1.25rem}}#footer :focus,#header :focus{outline:1px dashed rgba(253,196,0,.6)}#footer :active,#header :active{outline:0}#footer h1,#header h1{-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";color:#000;font-family:Inter,sans-serif;font-weight:400;line-height:1;margin:1em 0}@media (min-width:0px){#footer h1,#header h1{font-size:2.125rem}}@media (min-width:600px){#footer h1,#header h1{font-size:3.375rem}}#footer h2,#header h2{-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";color:#000;font-family:Inter,sans-serif;font-weight:400;line-height:1;margin:1em 0}@media (min-width:0px){#footer h2,#header h2{font-size:1.375rem}}@media (min-width:600px){#footer h2,#header h2{font-size:1.875rem}}#footer h3,#header h3{-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";color:#000;font-family:Inter,sans-serif;font-weight:400;margin:1em 0}@media (min-width:0px){#footer h3,#header h3{font-size:1.25rem}}@media (min-width:600px){#footer h3,#header h3{font-size:1.5rem}}#footer h4,#header h4{-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";color:#000;font-family:Inter,sans-serif;font-weight:400;line-height:1;margin:1em 0}@media (min-width:0px){#footer h4,#header h4{font-size:1.125rem}}@media (min-width:600px){#footer h4,#header h4{font-size:1.25rem}}#footer h5,#header h5{-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";color:#000;font-family:Inter,sans-serif;font-weight:400;line-height:1;margin:1em 0}@media (min-width:0px){#footer h5,#header h5{font-size:1rem}}@media (min-width:600px){#footer h5,#header h5{font-size:1.125rem}}#footer h6,#header h6{-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";color:#000;font-family:Inter,sans-serif;font-weight:400;line-height:1;margin:1em 0}@media (min-width:0px){#footer h6,#header h6{font-size:.9375rem}}@media (min-width:600px){#footer h6,#header h6{font-size:1rem}}#footer body.page-node-type-page .layout-content h1,#header body.page-node-type-page .layout-content h1{margin:0 0 1.875rem}@media (min-width:768px){#footer body.page-node-type-page .layout-content h1,#header body.page-node-type-page .layout-content h1{margin:0 0 3.75rem}}#footer body.page-node-type-update .layout-content h1,#header body.page-node-type-update .layout-content h1{margin:0 0 1.125rem}@media (min-width:768px){#footer body.page-node-type-update .layout-content h1,#header body.page-node-type-update .layout-content h1{margin:0 0 1.5rem}}#footer p,#header p{color:#000;line-height:1.6;margin:1em 0}@media (min-width:0px){#footer p,#header p{font-size:1rem}}@media (min-width:600px){#footer p,#header p{font-size:1.125rem}}#footer blockquote:not([class]),#header blockquote:not([class]){border-left:6px solid #0073cf;margin:2rem 0;padding-left:1.5rem}@media (min-width:992px){#footer blockquote:not([class]),#header blockquote:not([class]){margin:4rem 0;padding-left:3.5rem}}#footer blockquote:not([class]),#footer blockquote:not([class]) p,#header blockquote:not([class]),#header blockquote:not([class]) p{color:#000!important;font-size:1.125rem;font-style:italic}@media (min-width:992px){#footer blockquote:not([class]),#footer blockquote:not([class]) p,#header blockquote:not([class]),#header blockquote:not([class]) p{font-size:1.3125rem}}#footer main dl:not([class]),#footer main ol:not([class]),#footer main ul:not([class]),#header main dl:not([class]),#header main ol:not([class]),#header main ul:not([class]){margin:1.25rem 0;padding-left:40px}#footer main li:not([class]),#header main li:not([class]){color:#565a5c;display:block;line-height:1.6;margin-bottom:.625rem;position:relative}@media (min-width:0px){#footer main li:not([class]),#header main li:not([class]){font-size:1rem}}@media (min-width:600px){#footer main li:not([class]),#header main li:not([class]){font-size:1.125rem}}#footer main li:not([class]):last-child,#header main li:not([class]):last-child{margin-bottom:0}#footer main ul li:not([class]):after,#header main ul li:not([class]):after{color:#558807;content:"•";display:block;left:-25px;position:absolute;top:0}#footer main ul li:not([class]) ul,#header main ul li:not([class]) ul{margin:.625rem 0}#footer main ol:not([class]),#header main ol:not([class]){counter-reset:item}#footer main ol:not([class]) li:not([class]):before,#header main ol:not([class]) li:not([class]):before{color:#558807;content:counter(item) ". ";counter-increment:item;left:-30px;position:absolute;top:0}#footer dt,#header dt{font-weight:600}#footer a:not([class]),#header a:not([class]){color:#0073cf}#footer a:not([class]):active,#footer a:not([class]):focus,#footer a:not([class]):hover,#header a:not([class]):active,#header a:not([class]):focus,#header a:not([class]):hover{color:#0092e2}h1>#footer a:not([class]),h1>#header a:not([class]),h2>#footer a:not([class]),h2>#header a:not([class]),h3>#footer a:not([class]),h3>#header a:not([class]),h4>#footer a:not([class]),h4>#header a:not([class]),h5>#footer a:not([class]),h5>#header a:not([class]),h6>#footer a:not([class]),h6>#header a:not([class]){text-decoration:none}@media (min-width:0px) and (max-width:767.98px){#footer a:not([class]),#header a:not([class]){word-wrap:break-word;word-break:break-all}}#footer hr:not([class]),#header hr:not([class]){border:0;border-bottom:1px solid #e4e6e7}#footer img,#header img{display:block;height:auto;max-width:100%}#footer figure:not([class]),#header figure:not([class]){margin:0}#footer figure:not([class]) img,#header figure:not([class]) img{display:block}#footer figcaption,#header figcaption{margin:1em 0}#footer div.responsive--video,#footer p.responsive--video,#header div.responsive--video,#header p.responsive--video{display:block;margin:2.5rem 0 0;max-width:560px;position:relative;width:100%}#footer div.responsive--video iframe,#footer p.responsive--video iframe,#header div.responsive--video iframe,#header p.responsive--video iframe{border:0;left:0;top:0;width:100%}#footer .video-embed-field-responsive-video:after,#header .video-embed-field-responsive-video:after{display:none}#footer .toolbar .toolbar-bar,#header .toolbar .toolbar-bar{z-index:100!important}#footer .ui-autocomplete,#header .ui-autocomplete{z-index:102}#footer .jumpmenu__heading a,#header .jumpmenu__heading a{font-weight:500;text-decoration:none}@media (min-width:0px){#footer .jumpmenu__heading a,#header .jumpmenu__heading a{font-size:.75rem}}@media (min-width:600px){#footer .jumpmenu__heading a,#header .jumpmenu__heading a{font-size:.8125rem}}#footer .jumpmenu__heading a.is-active,#header .jumpmenu__heading a.is-active{color:#565a5c;text-decoration:none}#footer .jumpmenu__heading a:active,#footer .jumpmenu__heading a:focus,#footer .jumpmenu__heading a:hover,#header .jumpmenu__heading a:active,#header .jumpmenu__heading a:focus,#header .jumpmenu__heading a:hover{color:#0092e2;text-decoration:underline}#footer .jumpmenu__heading a:visited,#header .jumpmenu__heading a:visited{color:#0073cf;text-decoration:none}#footer .jumpmenu__heading a:visited.is-active,#header .jumpmenu__heading a:visited.is-active{color:#565a5c}#footer .layout,#header .layout{padding:2.5rem 7.4074074074%}@media (min-width:1200px){#footer .layout,#header .layout{padding:3.75rem 7.4074074074%}}@media (min-width:1620px){#footer .layout,#header .layout{padding:3.75rem 0}}#footer body.path-frontpage .layout,#header body.path-frontpage .layout{padding:2.5rem 7.4074074074%}#footer .layout-wide,#header .layout-wide{padding:0}#footer .l--constrained,#header .l--constrained{-webkit-box-sizing:border-box;box-sizing:border-box;margin-left:auto;margin-right:auto;max-width:1380px}#footer .l--narrow,#header .l--narrow{margin-left:auto;margin-right:auto;max-width:960px;width:100%}#footer .l--gutters,#header .l--gutters{padding-left:60px;padding-right:60px}#footer .l--offset-wide,#header .l--offset-wide{margin:0 auto;max-width:1620px;padding:0 3.125rem 0 2.25rem}#footer .sidebar .l--offset-wide,#header .sidebar .l--offset-wide{padding:0 2.25rem}@media (min-width:992px){#footer .sidebar .l--offset-wide,#header .sidebar .l--offset-wide{padding:0}}@media (min-width:1200px){#footer .sidebar .l--offset-wide,#header .sidebar .l--offset-wide{padding:0}}#footer .sidebar .page-content--wrapper .l--offset-wide,#header .sidebar .page-content--wrapper .l--offset-wide{padding:0}#footer body.page-node-type-page .l--offset-wide.page__default--withSidebar-wrapper .l--constrained,#header body.page-node-type-page .l--offset-wide.page__default--withSidebar-wrapper .l--constrained{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:1620px;padding:0 3.125rem 0 2.25rem;width:100%}#footer .l--offset-full,#header .l--offset-full{margin:0 auto;max-width:1620px}#footer .l--offset,#header .l--offset{padding-left:7.4074074074%;padding-right:7.4074074074%}@media (min-width:1620px){#footer .l--offset,#header .l--offset{padding-left:120px;padding-right:120px}}#footer .l--padded,#header .l--padded{padding-bottom:60px;padding-top:60px}#footer .l--vertical-spacing,#header .l--vertical-spacing{margin:2.5rem 0;width:100%}@media (min-width:1200px){#footer .l--vertical-spacing,#header .l--vertical-spacing{margin:3.75rem 0}}#footer .l--wrapper,#header .l--wrapper{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:flex;flex-direction:column}@media (min-width:992px){#footer .l--wrapper,#header .l--wrapper{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}#footer .l--wrapper .layout-sidebar,#header .l--wrapper .layout-sidebar{-webkit-box-flex:0;-webkit-box-ordinal-group:2;flex:none;order:1;width:300px}}#footer .l--wrapper .layout-sidebar .sidebar--wrapper,#header .l--wrapper .layout-sidebar .sidebar--wrapper{margin:1.875rem}@media (min-width:992px){#footer .l--wrapper .layout-sidebar .sidebar--wrapper,#header .l--wrapper .layout-sidebar .sidebar--wrapper{margin:1.875rem}}#footer .l--wrapper .page-content--wrapper,#header .l--wrapper .page-content--wrapper{-webkit-box-ordinal-group:3;order:2;padding:1.875rem 0}@media (min-width:992px){#footer .l--wrapper .page-content--wrapper,#header .l--wrapper .page-content--wrapper{-webkit-box-flex:1;flex:1;padding:4.875rem 1.875rem 3.75rem 3.75rem}}@media (min-width:1200px){#footer .l--wrapper .page-content--wrapper,#header .l--wrapper .page-content--wrapper{-webkit-box-flex:1;flex:1;padding:4.875rem 1.875rem 3.75rem 3.75rem}}@media (min-width:1440px){#footer .l--wrapper .page-content--wrapper,#header .l--wrapper .page-content--wrapper{-webkit-box-flex:1;flex:1;padding:4.875rem 1.875rem 4.5rem 7.5rem}}#footer .l--2col-wrapper,#header .l--2col-wrapper{width:100%}@media (min-width:992px){#footer .l--2col-wrapper,#header .l--2col-wrapper{display:-webkit-box;display:flex}}#footer .l--2col-wrapper .page-content--main-content,#header .l--2col-wrapper .page-content--main-content{-webkit-box-ordinal-group:2;-webkit-box-flex:1;flex:1;order:1}#footer .l--2col-wrapper .page-content--secondary,#header .l--2col-wrapper .page-content--secondary{border-top:1px solid #d7d9d9;margin-top:1.875rem;padding-top:1.875rem}@media (min-width:992px){#footer .l--2col-wrapper .page-content--secondary,#header .l--2col-wrapper .page-content--secondary{-webkit-box-flex:0;-webkit-box-ordinal-group:3;border-top:none;flex:none;margin-left:3.75rem;margin-top:0;order:2;padding-top:0;width:180px}}@media (min-width:1200px){#footer .l--2col-wrapper .page-content--secondary,#header .l--2col-wrapper .page-content--secondary{margin-left:7.5rem;width:240px}}#footer .l--2col-wrapper .layout,#header .l--2col-wrapper .layout{padding-top:0}#footer .l--1col-wrapper,#header .l--1col-wrapper{width:100%}#footer .sticky,#header .sticky{margin-bottom:0;position:static}@media (min-width:992px){#footer .sticky,#header .sticky{margin-bottom:3.75rem;position:sticky;top:0}}#footer body.page-node-type-page .page-landing-page .paragraph--type--section:first-of-type .layout:first-of-type,#header body.page-node-type-page .page-landing-page .paragraph--type--section:first-of-type .layout:first-of-type{padding-top:0}#footer body.page-node-type-page .page-full .page__default--content .layout.default-layout,#footer main>.sidebar .paragraph--type--section .layout,#header body.page-node-type-page .page-full .page__default--content .layout.default-layout,#header main>.sidebar .paragraph--type--section .layout{padding-left:0;padding-right:0}#footer .l--layout-onecolumn-contained .l--constrained,#header .l--layout-onecolumn-contained .l--constrained{max-width:100%}#footer body.page-node-type-page h1.page__default--title,#header body.page-node-type-page h1.page__default--title{margin-bottom:0}#footer body.page-node-type-page .page__default--body p,#footer body.page-node-type-update .page__default--body p,#header body.page-node-type-page .page__default--body p,#header body.page-node-type-update .page__default--body p{color:#565a5c}#footer body.page-node-type-page .field--name-body>p.intro-style:first-of-type,#footer body.page-node-type-page .page__default--body>p.intro-style:first-of-type,#footer body.page-node-type-update .field--name-body>p.intro-style:first-of-type,#footer body.page-node-type-update .page__default--body>p.intro-style:first-of-type,#header body.page-node-type-page .field--name-body>p.intro-style:first-of-type,#header body.page-node-type-page .page__default--body>p.intro-style:first-of-type,#header body.page-node-type-update .field--name-body>p.intro-style:first-of-type,#header body.page-node-type-update .page__default--body>p.intro-style:first-of-type{margin-top:0}#footer body.page-node-type-page .field--name-body>p.intro-style,#footer body.page-node-type-page .page__default--body>p.intro-style,#footer body.page-node-type-update .field--name-body>p.intro-style,#footer body.page-node-type-update .page__default--body>p.intro-style,#header body.page-node-type-page .field--name-body>p.intro-style,#header body.page-node-type-page .page__default--body>p.intro-style,#header body.page-node-type-update .field--name-body>p.intro-style,#header body.page-node-type-update .page__default--body>p.intro-style{color:#141516;line-height:1.75}@media (min-width:0px){#footer body.page-node-type-page .field--name-body>p.intro-style,#footer body.page-node-type-page .page__default--body>p.intro-style,#footer body.page-node-type-update .field--name-body>p.intro-style,#footer body.page-node-type-update .page__default--body>p.intro-style,#header body.page-node-type-page .field--name-body>p.intro-style,#header body.page-node-type-page .page__default--body>p.intro-style,#header body.page-node-type-update .field--name-body>p.intro-style,#header body.page-node-type-update .page__default--body>p.intro-style{font-size:1.1875rem}}@media (min-width:600px){#footer body.page-node-type-page .field--name-body>p.intro-style,#footer body.page-node-type-page .page__default--body>p.intro-style,#footer body.page-node-type-update .field--name-body>p.intro-style,#footer body.page-node-type-update .page__default--body>p.intro-style,#header body.page-node-type-page .field--name-body>p.intro-style,#header body.page-node-type-page .page__default--body>p.intro-style,#header body.page-node-type-update .field--name-body>p.intro-style,#header body.page-node-type-update .page__default--body>p.intro-style{font-size:1.3125rem}}#footer .field--name-body>.embed:first-child figure,#header .field--name-body>.embed:first-child figure{margin-top:0}#footer .align-left,#header .align-left{float:none;margin:1.875rem 0}@media (min-width:768px){#footer .align-left,#header .align-left{float:left;margin:0 3.75rem 1.875rem 0;max-width:45%}}#footer .align-right,#header .align-right{float:none;margin:1.875rem 0}@media (min-width:768px){#footer .align-right,#header .align-right{float:right;margin:0 0 1.875rem 3.75rem;max-width:45%}}#footer .align-center,#header .align-center{display:block;margin:1.875rem 0}#footer figure,#header figure{margin:0}#footer figure img,#header figure img{width:100%}#footer figure .field--name-field-caption,#footer figure figcaption,#header figure .field--name-field-caption,#header figure figcaption{background:#f5f6f7;border-radius:0 0 6px 6px;color:#565a5c;font-size:15px;margin:0;padding:1.125rem 1.875rem}#footer figure .field--name-field-caption p,#footer figure figcaption p,#header figure .field--name-field-caption p,#header figure figcaption p{background:#f5f6f7;border-radius:0 0 6px 6px;font-size:15px;margin:0;padding:0}#footer article>figcaption,#header article>figcaption{margin:0}#footer article>figcaption p,#header article>figcaption p{background:#f5f6f7;border-radius:0 0 6px 6px;color:#565a5c;font-size:15px;margin:0;padding:1.125rem 1.875rem}#footer .field.field--type-image img,#header .field.field--type-image img{width:100%}#footer .field.field--type-image,#header .field.field--type-image{margin-bottom:0}#footer .field.field--type-image .field__item,#header .field.field--type-image .field__item{margin:0}#footer .field.field--name-thumbnail img,#header .field.field--name-thumbnail img{width:auto}#footer input[type=file],#header input[type=file]{height:inherit}#footer input[type=checkbox]:not(.nav-trigger),#header input[type=checkbox]:not(.nav-trigger){height:auto}#footer label,#footer legend,#header label,#header legend{margin:1em 0}#footer select,#header select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#f7f6f7;border-color:#c3c1c3;border-radius:0;height:2.1875rem;padding:0 10px;text-indent:.01px;-o-text-overflow:"";text-overflow:""}#footer select::-ms-expand,#header select::-ms-expand{display:none}#footer button::-moz-focus-inner,#footer input::-moz-focus-inner,#header button::-moz-focus-inner,#header input::-moz-focus-inner{border:0;padding:0}#footer input,#header input{line-height:normal}#footer input[type=checkbox]:not(.nav-trigger),#footer input[type=radio],#header input[type=checkbox]:not(.nav-trigger),#header input[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}#footer input[type=number]::-webkit-inner-spin-button,#footer input[type=number]::-webkit-outer-spin-button,#header input[type=number]::-webkit-inner-spin-button,#header input[type=number]::-webkit-outer-spin-button{height:auto}#footer input[type=search],#header input[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:border-box;box-sizing:border-box}#footer input[type=search]::-webkit-search-cancel-button,#footer input[type=search]::-webkit-search-decoration,#header input[type=search]::-webkit-search-cancel-button,#header input[type=search]::-webkit-search-decoration{-webkit-appearance:none}#footer fieldset,#header fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}#footer legend,#header legend{border:0;padding:0}#footer textarea,#header textarea{overflow:auto}#footer button,#footer input,#footer optgroup,#footer select,#footer textarea,#header button,#header input,#header optgroup,#header select,#header textarea{color:inherit;font:inherit;margin:0}#footer button,#header button{overflow:visible}#footer button,#footer select,#header button,#header select{text-transform:none}#footer button,#footer html input[type=button],#footer input[type=reset],#footer input[type=submit],#header button,#header html input[type=button],#header input[type=reset],#header input[type=submit]{-webkit-appearance:button;cursor:pointer}#footer button[disabled],#footer html input[disabled],#header button[disabled],#header html input[disabled]{cursor:default}#footer optgroup,#header optgroup{font-weight:700}#footer .form-item,#header .form-item{margin:1em 0}#footer .field,#header .field{margin-bottom:2em}#footer .field:last-child,#header .field:last-child{margin-bottom:0}#footer .field__label,#header .field__label{font-weight:700}#footer .views-field.views-field-entity-browser-select,#header .views-field.views-field-entity-browser-select{padding-bottom:0;padding-top:0}#footer .views-field.views-field-entity-browser-select .form-item,#header .views-field.views-field-entity-browser-select .form-item{margin:0}#footer .views-field.views-field-entity-browser-select .visually-hidden,#header .views-field.views-field-entity-browser-select .visually-hidden{margin:10px 0 0 -8px;padding:0}#footer .form-item label,#header .form-item label{color:#000;display:block;font-weight:600;margin-bottom:.375rem}@media (min-width:0px){#footer .form-item label,#header .form-item label{font-size:.9375rem}}@media (min-width:600px){#footer .form-item label,#header .form-item label{font-size:1rem}}#footer input[type=date]:not(.MuiInputBase-input),#footer input[type=email]:not(.MuiInputBase-input),#footer input[type=number]:not(.MuiInputBase-input),#footer input[type=password]:not(.MuiInputBase-input),#footer input[type=text]:not(.MuiInputBase-input),#footer input[type=time]:not(.MuiInputBase-input),#header input[type=date]:not(.MuiInputBase-input),#header input[type=email]:not(.MuiInputBase-input),#header input[type=number]:not(.MuiInputBase-input),#header input[type=password]:not(.MuiInputBase-input),#header input[type=text]:not(.MuiInputBase-input),#header input[type=time]:not(.MuiInputBase-input){border:1px solid #d7d9d9;border-radius:2px;-webkit-box-shadow:inset 0 1px 0 #7c7f80;box-shadow:inset 0 1px 0 #7c7f80;color:#000;font-weight:400;height:3rem;padding:.75rem 1.125rem;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer input[type=date]:not(.MuiInputBase-input):not(.form-autocomplete),#footer input[type=email]:not(.MuiInputBase-input):not(.form-autocomplete),#footer input[type=number]:not(.MuiInputBase-input):not(.form-autocomplete),#footer input[type=password]:not(.MuiInputBase-input):not(.form-autocomplete),#footer input[type=text]:not(.MuiInputBase-input):not(.form-autocomplete),#footer input[type=time]:not(.MuiInputBase-input):not(.form-autocomplete),#header input[type=date]:not(.MuiInputBase-input):not(.form-autocomplete),#header input[type=email]:not(.MuiInputBase-input):not(.form-autocomplete),#header input[type=number]:not(.MuiInputBase-input):not(.form-autocomplete),#header input[type=password]:not(.MuiInputBase-input):not(.form-autocomplete),#header input[type=text]:not(.MuiInputBase-input):not(.form-autocomplete),#header input[type=time]:not(.MuiInputBase-input):not(.form-autocomplete){background:#fff}@media (min-width:0px){#footer input[type=date]:not(.MuiInputBase-input),#footer input[type=email]:not(.MuiInputBase-input),#footer input[type=number]:not(.MuiInputBase-input),#footer input[type=password]:not(.MuiInputBase-input),#footer input[type=text]:not(.MuiInputBase-input),#footer input[type=time]:not(.MuiInputBase-input),#header input[type=date]:not(.MuiInputBase-input),#header input[type=email]:not(.MuiInputBase-input),#header input[type=number]:not(.MuiInputBase-input),#header input[type=password]:not(.MuiInputBase-input),#header input[type=text]:not(.MuiInputBase-input),#header input[type=time]:not(.MuiInputBase-input){font-size:.9375rem}}@media (min-width:600px){#footer input[type=date]:not(.MuiInputBase-input),#footer input[type=email]:not(.MuiInputBase-input),#footer input[type=number]:not(.MuiInputBase-input),#footer input[type=password]:not(.MuiInputBase-input),#footer input[type=text]:not(.MuiInputBase-input),#footer input[type=time]:not(.MuiInputBase-input),#header input[type=date]:not(.MuiInputBase-input),#header input[type=email]:not(.MuiInputBase-input),#header input[type=number]:not(.MuiInputBase-input),#header input[type=password]:not(.MuiInputBase-input),#header input[type=text]:not(.MuiInputBase-input),#header input[type=time]:not(.MuiInputBase-input){font-size:1rem}}#footer input[type=date]:not(.MuiInputBase-input):hover,#footer input[type=email]:not(.MuiInputBase-input):hover,#footer input[type=number]:not(.MuiInputBase-input):hover,#footer input[type=password]:not(.MuiInputBase-input):hover,#footer input[type=text]:not(.MuiInputBase-input):hover,#footer input[type=time]:not(.MuiInputBase-input):hover,#header input[type=date]:not(.MuiInputBase-input):hover,#header input[type=email]:not(.MuiInputBase-input):hover,#header input[type=number]:not(.MuiInputBase-input):hover,#header input[type=password]:not(.MuiInputBase-input):hover,#header input[type=text]:not(.MuiInputBase-input):hover,#header input[type=time]:not(.MuiInputBase-input):hover{border:1px solid #0073cf!important;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer input[type=date]:not(.MuiInputBase-input):active,#footer input[type=date]:not(.MuiInputBase-input):focus,#footer input[type=email]:not(.MuiInputBase-input):active,#footer input[type=email]:not(.MuiInputBase-input):focus,#footer input[type=number]:not(.MuiInputBase-input):active,#footer input[type=number]:not(.MuiInputBase-input):focus,#footer input[type=password]:not(.MuiInputBase-input):active,#footer input[type=password]:not(.MuiInputBase-input):focus,#footer input[type=text]:not(.MuiInputBase-input):active,#footer input[type=text]:not(.MuiInputBase-input):focus,#footer input[type=time]:not(.MuiInputBase-input):active,#footer input[type=time]:not(.MuiInputBase-input):focus,#header input[type=date]:not(.MuiInputBase-input):active,#header input[type=date]:not(.MuiInputBase-input):focus,#header input[type=email]:not(.MuiInputBase-input):active,#header input[type=email]:not(.MuiInputBase-input):focus,#header input[type=number]:not(.MuiInputBase-input):active,#header input[type=number]:not(.MuiInputBase-input):focus,#header input[type=password]:not(.MuiInputBase-input):active,#header input[type=password]:not(.MuiInputBase-input):focus,#header input[type=text]:not(.MuiInputBase-input):active,#header input[type=text]:not(.MuiInputBase-input):focus,#header input[type=time]:not(.MuiInputBase-input):active,#header input[type=time]:not(.MuiInputBase-input):focus{border:1px solid #0073cf!important;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4;outline:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer input[type=date]:not(.MuiInputBase-input):disabled,#footer input[type=email]:not(.MuiInputBase-input):disabled,#footer input[type=number]:not(.MuiInputBase-input):disabled,#footer input[type=password]:not(.MuiInputBase-input):disabled,#footer input[type=text]:not(.MuiInputBase-input):disabled,#footer input[type=time]:not(.MuiInputBase-input):disabled,#header input[type=date]:not(.MuiInputBase-input):disabled,#header input[type=email]:not(.MuiInputBase-input):disabled,#header input[type=number]:not(.MuiInputBase-input):disabled,#header input[type=password]:not(.MuiInputBase-input):disabled,#header input[type=text]:not(.MuiInputBase-input):disabled,#header input[type=time]:not(.MuiInputBase-input):disabled{background:#f5f6f7;border:1px solid #d7d9d9;-webkit-box-shadow:inset 0 1px 0 #7c7f80;box-shadow:inset 0 1px 0 #7c7f80;-webkit-box-sizing:border-box;box-sizing:border-box;color:#a2a4a3}#footer .time-start,#header .time-start{display:-webkit-box;display:flex}#footer textarea,#header textarea{background:#fff;border:1px solid #d7d9d9;border-radius:2px;-webkit-box-shadow:inset 0 1px 0 #7c7f80;box-shadow:inset 0 1px 0 #7c7f80;color:#000;font-weight:400;padding:.75rem 1.125rem;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}@media (min-width:0px){#footer textarea,#header textarea{font-size:.9375rem}}@media (min-width:600px){#footer textarea,#header textarea{font-size:1rem}}#footer textarea:hover,#header textarea:hover{border:1px solid #0073cf!important;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer textarea:active,#footer textarea:focus,#header textarea:active,#header textarea:focus{border:1px solid #0073cf!important;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4;outline:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer textarea:disabled,#header textarea:disabled{background:#f5f6f7;border:1px solid #d7d9d9;-webkit-box-shadow:inset 0 1px 0 #7c7f80;box-shadow:inset 0 1px 0 #7c7f80;-webkit-box-sizing:border-box;box-sizing:border-box;color:#a2a4a3}#footer select,#header select{background:#fff;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='10' height='6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 1 5 5 1 1' stroke='%230073CF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-position:97% 50%;background-repeat:no-repeat;border:1px solid #d7d9d9;border-radius:2px;-webkit-box-shadow:inset 0 -1px 0 #7c7f80;box-shadow:inset 0 -1px 0 #7c7f80;color:#000;font-weight:400;height:3rem;padding:.75rem 2.25rem .75rem 1.125rem;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}@media (min-width:0px){#footer select,#header select{font-size:.9375rem}}@media (min-width:600px){#footer select,#header select{font-size:1rem}}#footer select:hover,#header select:hover{border:1px solid #0073cf!important;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer select:active,#footer select:focus,#header select:active,#header select:focus{border:1px solid #0073cf!important;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4;outline:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer select:disabled,#header select:disabled{background:#f5f6f7;border:1px solid #d7d9d9;-webkit-box-shadow:inset 0 1px 0 #7c7f80;box-shadow:inset 0 1px 0 #7c7f80;-webkit-box-sizing:border-box;box-sizing:border-box;color:#a2a4a3}#footer .select2-selection.select2-selection--multiple,#header .select2-selection.select2-selection--multiple{background:#fff;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='10' height='6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 1 5 5 1 1' stroke='%230073CF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-position:97% 50%;background-repeat:no-repeat;border:1px solid #d7d9d9;border-radius:2px;-webkit-box-shadow:inset 0 -1px 0 #7c7f80;box-shadow:inset 0 -1px 0 #7c7f80;color:#000;font-weight:400;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}@media (min-width:0px){#footer .select2-selection.select2-selection--multiple,#header .select2-selection.select2-selection--multiple{font-size:.9375rem}}@media (min-width:600px){#footer .select2-selection.select2-selection--multiple,#header .select2-selection.select2-selection--multiple{font-size:1rem}}#footer .select2-selection.select2-selection--multiple:hover,#header .select2-selection.select2-selection--multiple:hover{border:1px solid #0073cf!important;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .select2-selection.select2-selection--multiple:active,#footer .select2-selection.select2-selection--multiple:focus,#header .select2-selection.select2-selection--multiple:active,#header .select2-selection.select2-selection--multiple:focus{border:1px solid #0073cf!important;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4;outline:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .select2-selection.select2-selection--multiple:disabled,#header .select2-selection.select2-selection--multiple:disabled{background:#f5f6f7;border:1px solid #d7d9d9;-webkit-box-shadow:inset 0 1px 0 #7c7f80;box-shadow:inset 0 1px 0 #7c7f80;-webkit-box-sizing:border-box;box-sizing:border-box;color:#a2a4a3}#footer .select2-selection.select2-selection--multiple .select2-container--default .select2-results__option--highlighted[data-selected],#header .select2-selection.select2-selection--multiple .select2-container--default .select2-results__option--highlighted[data-selected]{background-color:#0073cf;color:#fff}#footer .select2-selection.select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove,#header .select2-selection.select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove{padding:.1875rem}#footer ::-webkit-file-upload-button,#footer button.button.form-submit.ui-button,#footer button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close),#footer input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res),#header ::-webkit-file-upload-button,#header button.button.form-submit.ui-button,#header button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close),#header input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res){-webkit-appearance:none;background:#0073cf;border:1px solid #0073cf;border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);color:#fff;font-size:13px;font-weight:700;letter-spacing:.1em;padding:.75rem 1.125rem;text-transform:uppercase;-webkit-transition:all .25s;transition:all .25s}#footer ::-webkit-file-upload-button:hover,#footer button.button.form-submit.ui-button:hover,#footer button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):hover,#footer input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):hover,#header ::-webkit-file-upload-button:hover,#header button.button.form-submit.ui-button:hover,#header button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):hover,#header input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):hover{background:#0092e2;border:1px solid #0092e2;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);-webkit-transition:all .25s;transition:all .25s}#footer ::-webkit-file-upload-button:active,#footer ::-webkit-file-upload-button:focus,#footer button.button.form-submit.ui-button:active,#footer button.button.form-submit.ui-button:focus,#footer button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):active,#footer button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):focus,#footer input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):active,#footer input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):focus,#header ::-webkit-file-upload-button:active,#header ::-webkit-file-upload-button:focus,#header button.button.form-submit.ui-button:active,#header button.button.form-submit.ui-button:focus,#header button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):active,#header button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):focus,#header input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):active,#header input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):focus{background:#0092e2;border:1px solid #0073cf;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4;-webkit-transition:all .25s;transition:all .25s}#footer ::-webkit-file-upload-button:disabled,#footer button.button.form-submit.ui-button:disabled,#footer button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):disabled,#footer input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):disabled,#header ::-webkit-file-upload-button:disabled,#header button.button.form-submit.ui-button:disabled,#header button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):disabled,#header input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):disabled{background:#d7d9d9;color:#a2a4a3}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked,#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked),#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked){left:-9999px;position:absolute}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label,#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label{cursor:pointer;padding-left:1.95em;position:relative}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label:before,#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label:before{background:#fff;border:1px solid #d7d9d9;border-radius:50%;content:"";height:16px;left:0;position:absolute;top:0;width:16px}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label:after,#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label:after,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label:after,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='8' height='8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='8' height='8' rx='4' fill='%23000'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;content:"";display:block;height:8px;left:4px;position:absolute;top:4px;width:8px}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label:after,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label:after{opacity:0;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label:after,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label:after{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):disabled:checked+label:before,#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):disabled:not(:checked)+label:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):disabled:checked+label:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):disabled:not(:checked)+label:before{background-color:#fff;border-color:#d7d9d9;-webkit-box-shadow:none;box-shadow:none}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked:focus+label:before,#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked):focus+label:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked:focus+label:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked):focus+label:before{border:1px solid #0073cf;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input)+label:hover:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input)+label:hover:before{border:1px solid #0073cf!important}#footer .form-no-label .visually-hidden,#header .form-no-label .visually-hidden{height:auto;overflow:visible;overflow:initial;text-indent:-10000px;width:auto}#footer .js-form-item input.form-checkbox:not(.allday):checked,#footer .js-form-item input.form-checkbox:not(.allday):not(:checked),#header .js-form-item input.form-checkbox:not(.allday):checked,#header .js-form-item input.form-checkbox:not(.allday):not(:checked){position:absolute}#footer .js-form-item input.form-checkbox:not(.allday):checked+label,#footer .js-form-item input.form-checkbox:not(.allday):not(:checked)+label,#header .js-form-item input.form-checkbox:not(.allday):checked+label,#header .js-form-item input.form-checkbox:not(.allday):not(:checked)+label{cursor:pointer;padding-left:1.95em;position:relative;z-index:1}#footer .js-form-item input.form-checkbox:not(.allday):checked+label:before,#footer .js-form-item input.form-checkbox:not(.allday):not(:checked)+label:before,#header .js-form-item input.form-checkbox:not(.allday):checked+label:before,#header .js-form-item input.form-checkbox:not(.allday):not(:checked)+label:before{background:#fff;border:1px solid #d7d9d9;border-radius:2px;content:"";height:16px;left:0;position:absolute;top:0;width:16px}#footer .js-form-item input.form-checkbox:not(.allday):checked+label:after,#footer .js-form-item input.form-checkbox:not(.allday):not(:checked)+label:after,#header .js-form-item input.form-checkbox:not(.allday):checked+label:after,#header .js-form-item input.form-checkbox:not(.allday):not(:checked)+label:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m1 4 3 3 6-6' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;content:"";display:block;height:8px;left:3px;position:absolute;top:4px;width:11px}#footer .js-form-item input.form-checkbox:not(.allday):not(:checked)+label:after,#header .js-form-item input.form-checkbox:not(.allday):not(:checked)+label:after{opacity:0;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}#footer .js-form-item input.form-checkbox:not(.allday):checked+label:after,#header .js-form-item input.form-checkbox:not(.allday):checked+label:after{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}#footer .js-form-item input.form-checkbox:not(.allday):disabled:checked+label:before,#footer .js-form-item input.form-checkbox:not(.allday):disabled:not(:checked)+label:before,#header .js-form-item input.form-checkbox:not(.allday):disabled:checked+label:before,#header .js-form-item input.form-checkbox:not(.allday):disabled:not(:checked)+label:before{background-color:#fff;border-color:#d7d9d9;-webkit-box-shadow:none;box-shadow:none}#footer .js-form-item input.form-checkbox:not(.allday):checked:focus+label:before,#footer .js-form-item input.form-checkbox:not(.allday):not(:checked):focus+label:before,#header .js-form-item input.form-checkbox:not(.allday):checked:focus+label:before,#header .js-form-item input.form-checkbox:not(.allday):not(:checked):focus+label:before{border:1px solid #0073cf;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4}#footer .js-form-item input.form-checkbox:not(.allday)+label:hover:before,#header .js-form-item input.form-checkbox:not(.allday)+label:hover:before{border:1px solid #0073cf!important}#footer .webform-element-description,#header .webform-element-description{color:#565a5c}@media (min-width:0px){#footer .webform-element-description,#header .webform-element-description{font-size:.875rem}}@media (min-width:600px){#footer .webform-element-description,#header .webform-element-description{font-size:.9375rem}}#footer #linkit-editor-dialog-form,#header #linkit-editor-dialog-form{min-height:400px}#footer .smartdate--time-inline,#header .smartdate--time-inline{grid-column-gap:.5em;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-align:baseline;-webkit-box-pack:start;align-content:center;align-items:baseline;display:-webkit-box;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-start}#footer .table-wrapper,#header .table-wrapper{background:-webkit-gradient(linear,left top,right top,from(#fff),to(hsla(0,0%,100%,0))),-webkit-gradient(linear,right top,left top,from(#fff),to(hsla(0,0%,100%,0))) 100% 0,radial-gradient(farthest-side at 0 50%,rgba(0,0,0,.2),transparent),radial-gradient(farthest-side at 100% 50%,rgba(0,0,0,.2),transparent) 100% 0;background:-o-linear-gradient(left,#fff 0,hsla(0,0%,100%,0)),-o-linear-gradient(right,#fff 0,hsla(0,0%,100%,0)) 100% 0,-o-radial-gradient(0 50%,farthest-side,rgba(0,0,0,.2),transparent),-o-radial-gradient(100% 50%,farthest-side,rgba(0,0,0,.2),transparent) 100% 0;background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0)),linear-gradient(-90deg,#fff,hsla(0,0%,100%,0)) 100% 0,radial-gradient(farthest-side at 0 50%,rgba(0,0,0,.2),transparent),radial-gradient(farthest-side at 100% 50%,rgba(0,0,0,.2),transparent) 100% 0;background-attachment:local,local,scroll,scroll;background-color:#fff;background-repeat:no-repeat;background-size:100px 100%,100px 100%,14px 100%,14px 100%;display:grid;overflow-x:auto}#footer .table-wrapper::-webkit-scrollbar,#header .table-wrapper::-webkit-scrollbar{-webkit-appearance:none;height:10px}#footer .table-wrapper::-webkit-scrollbar-thumb,#header .table-wrapper::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.5);border-radius:3px;-webkit-box-shadow:0 0 1px hsla(0,0%,100%,.5)}#footer table:not(.MuiTable-root),#header table:not(.MuiTable-root){border:none;border-collapse:collapse;border-spacing:0;caption-side:bottom;color:#000;margin:0;min-width:100%;text-align:left;vertical-align:top}@media (min-width:0px){#footer table:not(.MuiTable-root),#header table:not(.MuiTable-root){font-size:.75rem}}@media (min-width:600px){#footer table:not(.MuiTable-root),#header table:not(.MuiTable-root){font-size:.8125rem}}#footer table:not(.MuiTable-root) p,#header table:not(.MuiTable-root) p{color:inherit;font-size:inherit;line-height:inherit}#footer table:not(.MuiTable-root) td,#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) th{border:none}#footer table:not(.MuiTable-root) thead th,#header table:not(.MuiTable-root) thead th{vertical-align:middle}#footer table:not(.MuiTable-root) thead th a,#header table:not(.MuiTable-root) thead th a{padding:0}@media (min-width:0px){#footer table:not(.MuiTable-root) thead th a,#header table:not(.MuiTable-root) thead th a{font-size:.75rem}}@media (min-width:600px){#footer table:not(.MuiTable-root) thead th a,#header table:not(.MuiTable-root) thead th a{font-size:.8125rem}}#footer table:not(.MuiTable-root) td,#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) th{padding:.625rem;vertical-align:top}@media (min-width:768px){#footer table:not(.MuiTable-root) td,#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) th{padding:.625rem 1rem}}@media (min-width:992px){#footer table:not(.MuiTable-root) td,#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) th{padding:1rem 1.25rem}}#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) th{border-left:1px solid #002c77}#footer table:not(.MuiTable-root) th:first-child,#header table:not(.MuiTable-root) th:first-child{border-left:none}#footer table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) td{border-left:1px solid #d7d9d9}@media (min-width:0px){#footer table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) td{font-size:.75rem}}@media (min-width:600px){#footer table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) td{font-size:.8125rem}}#footer table:not(.MuiTable-root) td a,#header table:not(.MuiTable-root) td a{color:#0073cf;line-height:1.25}#footer table:not(.MuiTable-root) td:first-child,#header table:not(.MuiTable-root) td:first-child{border-left:none}#footer table:not(.MuiTable-root) tr:nth-of-type(odd),#header table:not(.MuiTable-root) tr:nth-of-type(odd){background-color:rgba(20,21,22,.04)}#footer table:not(.MuiTable-root) tr:nth-of-type(2n),#header table:not(.MuiTable-root) tr:nth-of-type(2n){background:none}#footer table:not(.MuiTable-root) caption,#header table:not(.MuiTable-root) caption{padding:1rem}#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) th{background:#0073cf;-webkit-box-shadow:inset 0 -1px 0 #002c77;box-shadow:inset 0 -1px 0 #002c77;color:#fff;letter-spacing:.2em;text-transform:uppercase}@media (min-width:0px){#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) th{font-size:.75rem}}@media (min-width:600px){#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) th{font-size:.8125rem}}#footer table:not(.MuiTable-root) th a,#header table:not(.MuiTable-root) th a{word-wrap:break-word;color:#fff;text-decoration:none}#footer code,#header code{background:#fff;border-radius:3px;-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(0,0,0,.1);color:#000;display:inline;font-family:monospace,serif;padding:.1875rem .3125rem}#footer pre code,#header pre code{background:#e4e6e7;border-radius:3px;display:block;padding:.2rem}@media (min-width:0px){#footer pre code,#header pre code{font-size:1rem}}@media (min-width:600px){#footer pre code,#header pre code{font-size:1.125rem}}#footer .hljs-comment,#footer .hljs-quote,#header .hljs-comment,#header .hljs-quote{color:#969896}#footer .hljs-deletion,#footer .hljs-name,#footer .hljs-regexp,#footer .hljs-selector-class,#footer .hljs-selector-id,#footer .hljs-tag,#footer .hljs-template-variable,#footer .hljs-variable,#header .hljs-deletion,#header .hljs-name,#header .hljs-regexp,#header .hljs-selector-class,#header .hljs-selector-id,#header .hljs-tag,#header .hljs-template-variable,#header .hljs-variable{color:#c66}#footer .hljs-built_in,#footer .hljs-builtin-name,#footer .hljs-link,#footer .hljs-literal,#footer .hljs-meta,#footer .hljs-number,#footer .hljs-params,#footer .hljs-type,#header .hljs-built_in,#header .hljs-builtin-name,#header .hljs-link,#header .hljs-literal,#header .hljs-meta,#header .hljs-number,#header .hljs-params,#header .hljs-type{color:#de935f}#footer .hljs-attribute,#header .hljs-attribute{color:#f0c674}#footer .hljs-addition,#footer .hljs-bullet,#footer .hljs-string,#footer .hljs-symbol,#header .hljs-addition,#header .hljs-bullet,#header .hljs-string,#header .hljs-symbol{color:#b5bd68}#footer .hljs-section,#footer .hljs-title,#header .hljs-section,#header .hljs-title{color:#81a2be}#footer .hljs-keyword,#footer .hljs-selector-tag,#header .hljs-keyword,#header .hljs-selector-tag{color:#b294bb}#footer .hljs,#header .hljs{background:#fff;border-radius:3px;-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(0,0,0,.1);display:inline;font-family:monospace,serif;padding:.1875rem .3125rem}#footer pre .hljs,#header pre .hljs{background:#1d1f21;border-radius:3px;color:#c5c8c6;display:block;overflow-x:auto;padding:1.25rem 1.875rem}#footer .hljs-emphasis,#header .hljs-emphasis{font-style:italic}#footer .hljs-strong,#header .hljs-strong{font-weight:700}#footer #ds-objectives,#header #ds-objectives{background:#f3f8fb;border:1px solid #0073cf;border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:1.875rem 0;padding:.75rem .9375rem}@media (min-width:992px){#footer #ds-objectives,#header #ds-objectives{margin:3.75rem 0;padding:1.5rem 1.875rem}}#footer #ds-objectives h3,#header #ds-objectives h3{color:#000;font-weight:700;letter-spacing:.2em;margin:1.125rem 0 .25rem;text-transform:uppercase}@media (min-width:0px){#footer #ds-objectives h3,#header #ds-objectives h3{font-size:.75rem}}@media (min-width:600px){#footer #ds-objectives h3,#header #ds-objectives h3{font-size:.8125rem}}#footer #ds-objectives h2:first-child,#footer #ds-objectives h3:first-child,#header #ds-objectives h2:first-child,#header #ds-objectives h3:first-child{margin-top:0}#footer .link--button.link--arrow,#header .link--button.link--arrow{border:1px solid #0073cf;border-radius:2px;color:#0073cf;display:inline-block;font-weight:700;letter-spacing:.1em;line-height:24px;margin:1.875rem 0 0;padding:.5625rem 2.25rem .5625rem 1.125rem;text-decoration:none;text-transform:uppercase;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}@media (min-width:0px){#footer .link--button.link--arrow,#header .link--button.link--arrow{font-size:.75rem}}@media (min-width:600px){#footer .link--button.link--arrow,#header .link--button.link--arrow{font-size:.8125rem}}@media (min-width:992px){#footer .link--button.link--arrow,#header .link--button.link--arrow{padding:.75rem 2.25rem .75rem 1.125rem}}#footer .link--button.link--arrow svg,#header .link--button.link--arrow svg{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px);-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .link--button.link--arrow svg .line,#header .link--button.link--arrow svg .line{stroke-dasharray:11;stroke-dashoffset:11;-webkit-animation:arrowOut .1s linear forwards;animation:arrowOut .1s linear forwards}#footer .link--button.link--arrow:active,#footer .link--button.link--arrow:focus,#footer .link--button.link--arrow:hover,#header .link--button.link--arrow:active,#header .link--button.link--arrow:focus,#header .link--button.link--arrow:hover{border:1px solid #0092e2;color:#0092e2;text-decoration:underline;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .link--button.link--arrow:active svg,#footer .link--button.link--arrow:focus svg,#footer .link--button.link--arrow:hover svg,#header .link--button.link--arrow:active svg,#header .link--button.link--arrow:focus svg,#header .link--button.link--arrow:hover svg{-webkit-transform:translateX(15px);-ms-transform:translateX(15px);transform:translateX(15px);-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .link--button.link--arrow:active svg .line,#footer .link--button.link--arrow:focus svg .line,#footer .link--button.link--arrow:hover svg .line,#header .link--button.link--arrow:active svg .line,#header .link--button.link--arrow:focus svg .line,#header .link--button.link--arrow:hover svg .line{-webkit-animation:arrowIn .15s linear forwards;animation:arrowIn .15s linear forwards}#footer .link--button.link--arrow:active svg path,#footer .link--button.link--arrow:focus svg path,#footer .link--button.link--arrow:hover svg path,#header .link--button.link--arrow:active svg path,#header .link--button.link--arrow:focus svg path,#header .link--button.link--arrow:hover svg path{stroke:#0092e2}#footer .link--button.link--arrow.solid,#header .link--button.link--arrow.solid{background:#0073cf;color:#fff}#footer .link--button.link--arrow.solid svg path,#header .link--button.link--arrow.solid svg path{stroke:#fff}#footer .link--button.link--arrow.no-borders,#header .link--button.link--arrow.no-borders{border:none;margin:0;padding:0}#footer #ds-challenge,#header #ds-challenge{background:rgba(85,136,7,.15);border:1px solid #558807;border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:1.875rem 0;padding:.75rem .9375rem}@media (min-width:992px){#footer #ds-challenge,#header #ds-challenge{margin:3.75rem 0;padding:1.5rem 1.875rem}}#footer #ds-challenge h3,#header #ds-challenge h3{color:#000;font-weight:700;letter-spacing:.2em;margin:1.125rem 0 .25rem;text-transform:uppercase}@media (min-width:0px){#footer #ds-challenge h3,#header #ds-challenge h3{font-size:.75rem}}@media (min-width:600px){#footer #ds-challenge h3,#header #ds-challenge h3{font-size:.8125rem}}#footer #ds-challenge h2:first-child,#footer #ds-challenge h3:first-child,#header #ds-challenge h2:first-child,#header #ds-challenge h3:first-child{margin-top:0}#footer #ds-dataTip,#header #ds-dataTip{background:#f5f6f7;border:1px solid #d7d9d9;border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:1.875rem 0;padding:.75rem .9375rem}@media (min-width:992px){#footer #ds-dataTip,#header #ds-dataTip{margin:3.75rem 0;padding:1.5rem 1.875rem}}#footer #ds-dataTip h3,#header #ds-dataTip h3{color:#000;font-weight:700;letter-spacing:.2em;margin:1.125rem 0 .25rem;text-transform:uppercase}@media (min-width:0px){#footer #ds-dataTip h3,#header #ds-dataTip h3{font-size:.75rem}}@media (min-width:600px){#footer #ds-dataTip h3,#header #ds-dataTip h3{font-size:.8125rem}}#footer #ds-dataTip h2:first-child,#footer #ds-dataTip h3:first-child,#header #ds-dataTip h2:first-child,#header #ds-dataTip h3:first-child{margin-top:0}#footer .ui-widget .lpb-component-list .lpb-component-list__search,#header .ui-widget .lpb-component-list .lpb-component-list__search{top:auto}#footer #edit-footer+#edit-actions,#footer .entity-content-form-footer.form-wrapper,#footer .field--name-field-display-mode.field--widget-entity-display-mode-select,#footer .field--type-entity-reference.field--name-field-image,#footer .field-group-html-element.other-content,#footer .js-form-item.js-form-type-vertical-tabs,#footer form.node-confirm-form.confirmation,#footer form.node-form:not(.node-page-edit-form),#footer form.node-update-form,#header #edit-footer+#edit-actions,#header .entity-content-form-footer.form-wrapper,#header .field--name-field-display-mode.field--widget-entity-display-mode-select,#header .field--type-entity-reference.field--name-field-image,#header .field-group-html-element.other-content,#header .js-form-item.js-form-type-vertical-tabs,#header form.node-confirm-form.confirmation,#header form.node-form:not(.node-page-edit-form),#header form.node-update-form{margin-left:auto;margin-right:auto;max-width:1380px;padding-left:1.875rem;padding-right:1.875rem}@media (min-width:992px){#footer #edit-footer+#edit-actions,#footer .entity-content-form-footer.form-wrapper,#footer .field--name-field-display-mode.field--widget-entity-display-mode-select,#footer .field--type-entity-reference.field--name-field-image,#footer .field-group-html-element.other-content,#footer .js-form-item.js-form-type-vertical-tabs,#footer form.node-confirm-form.confirmation,#footer form.node-form:not(.node-page-edit-form),#footer form.node-update-form,#header #edit-footer+#edit-actions,#header .entity-content-form-footer.form-wrapper,#header .field--name-field-display-mode.field--widget-entity-display-mode-select,#header .field--type-entity-reference.field--name-field-image,#header .field-group-html-element.other-content,#header .js-form-item.js-form-type-vertical-tabs,#header form.node-confirm-form.confirmation,#header form.node-form:not(.node-page-edit-form),#header form.node-update-form{padding-left:3.125rem;padding-right:3.125rem}}#footer #edit-footer+#edit-actions,#footer #node-page-edit-form>#edit-actions,#footer form.node-confirm-form.confirmation #edit-actions,#header #edit-footer+#edit-actions,#header #node-page-edit-form>#edit-actions,#header form.node-confirm-form.confirmation #edit-actions{margin-bottom:1.875rem}@media (min-width:992px){#footer #edit-footer+#edit-actions,#footer #node-page-edit-form>#edit-actions,#footer form.node-confirm-form.confirmation #edit-actions,#header #edit-footer+#edit-actions,#header #node-page-edit-form>#edit-actions,#header form.node-confirm-form.confirmation #edit-actions{margin-bottom:3.75rem}}#footer #node-page-edit-form .paragraphs-dropdown-action.button,#footer #node-page-form .paragraphs-dropdown-action.button,#footer form.node-form .paragraphs-dropdown-action.button,#footer form.node-update-form .paragraphs-dropdown-action.button,#header #node-page-edit-form .paragraphs-dropdown-action.button,#header #node-page-form .paragraphs-dropdown-action.button,#header form.node-form .paragraphs-dropdown-action.button,#header form.node-update-form .paragraphs-dropdown-action.button{color:#141516}#footer #node-page-edit-form .field--widget-paragraphs td,#footer #node-page-form .field--widget-paragraphs td,#footer form.node-form .field--widget-paragraphs td,#footer form.node-update-form .field--widget-paragraphs td,#header #node-page-edit-form .field--widget-paragraphs td,#header #node-page-form .field--widget-paragraphs td,#header form.node-form .field--widget-paragraphs td,#header form.node-update-form .field--widget-paragraphs td{padding:.75rem 1.125rem}@media (min-width:0px){#footer #node-page-edit-form .field--widget-paragraphs .form-wrapper>h4,#footer #node-page-form .field--widget-paragraphs .form-wrapper>h4,#footer form.node-form .field--widget-paragraphs .form-wrapper>h4,#footer form.node-update-form .field--widget-paragraphs .form-wrapper>h4,#header #node-page-edit-form .field--widget-paragraphs .form-wrapper>h4,#header #node-page-form .field--widget-paragraphs .form-wrapper>h4,#header form.node-form .field--widget-paragraphs .form-wrapper>h4,#header form.node-update-form .field--widget-paragraphs .form-wrapper>h4{font-size:.9375rem}}@media (min-width:600px){#footer #node-page-edit-form .field--widget-paragraphs .form-wrapper>h4,#footer #node-page-form .field--widget-paragraphs .form-wrapper>h4,#footer form.node-form .field--widget-paragraphs .form-wrapper>h4,#footer form.node-update-form .field--widget-paragraphs .form-wrapper>h4,#header #node-page-edit-form .field--widget-paragraphs .form-wrapper>h4,#header #node-page-form .field--widget-paragraphs .form-wrapper>h4,#header form.node-form .field--widget-paragraphs .form-wrapper>h4,#header form.node-update-form .field--widget-paragraphs .form-wrapper>h4{font-size:1rem}}@media (min-width:0px){#footer #node-page-edit-form li,#footer #node-page-form li,#footer form.node-form li,#footer form.node-update-form li,#header #node-page-edit-form li,#header #node-page-form li,#header form.node-form li,#header form.node-update-form li{font-size:.9375rem}}@media (min-width:600px){#footer #node-page-edit-form li,#footer #node-page-form li,#footer form.node-form li,#footer form.node-update-form li,#header #node-page-edit-form li,#header #node-page-form li,#header form.node-form li,#header form.node-update-form li{font-size:1rem}}#footer #node-page-edit-form #edit-field-display-mode-wrapper,#footer #node-page-edit-form #edit-field-image-wrapper,#footer #node-page-edit-form .entity-content-form-footer,#footer #node-page-edit-form .js-form-type-vertical-tabs,#footer #node-page-edit-form .other-content,#footer #node-page-form #edit-field-display-mode-wrapper,#footer #node-page-form #edit-field-image-wrapper,#footer #node-page-form .entity-content-form-footer,#footer #node-page-form .js-form-type-vertical-tabs,#footer #node-page-form .other-content,#footer form.node-form #edit-field-display-mode-wrapper,#footer form.node-form #edit-field-image-wrapper,#footer form.node-form .entity-content-form-footer,#footer form.node-form .js-form-type-vertical-tabs,#footer form.node-form .other-content,#footer form.node-update-form #edit-field-display-mode-wrapper,#footer form.node-update-form #edit-field-image-wrapper,#footer form.node-update-form .entity-content-form-footer,#footer form.node-update-form .js-form-type-vertical-tabs,#footer form.node-update-form .other-content,#header #node-page-edit-form #edit-field-display-mode-wrapper,#header #node-page-edit-form #edit-field-image-wrapper,#header #node-page-edit-form .entity-content-form-footer,#header #node-page-edit-form .js-form-type-vertical-tabs,#header #node-page-edit-form .other-content,#header #node-page-form #edit-field-display-mode-wrapper,#header #node-page-form #edit-field-image-wrapper,#header #node-page-form .entity-content-form-footer,#header #node-page-form .js-form-type-vertical-tabs,#header #node-page-form .other-content,#header form.node-form #edit-field-display-mode-wrapper,#header form.node-form #edit-field-image-wrapper,#header form.node-form .entity-content-form-footer,#header form.node-form .js-form-type-vertical-tabs,#header form.node-form .other-content,#header form.node-update-form #edit-field-display-mode-wrapper,#header form.node-update-form #edit-field-image-wrapper,#header form.node-update-form .entity-content-form-footer,#header form.node-update-form .js-form-type-vertical-tabs,#header form.node-update-form .other-content{margin:1.875rem auto;max-width:1380px;padding-left:1.875rem;padding-right:1.875rem}@media (min-width:992px){#footer #node-page-edit-form #edit-field-display-mode-wrapper,#footer #node-page-edit-form #edit-field-image-wrapper,#footer #node-page-edit-form .entity-content-form-footer,#footer #node-page-edit-form .js-form-type-vertical-tabs,#footer #node-page-edit-form .other-content,#footer #node-page-form #edit-field-display-mode-wrapper,#footer #node-page-form #edit-field-image-wrapper,#footer #node-page-form .entity-content-form-footer,#footer #node-page-form .js-form-type-vertical-tabs,#footer #node-page-form .other-content,#footer form.node-form #edit-field-display-mode-wrapper,#footer form.node-form #edit-field-image-wrapper,#footer form.node-form .entity-content-form-footer,#footer form.node-form .js-form-type-vertical-tabs,#footer form.node-form .other-content,#footer form.node-update-form #edit-field-display-mode-wrapper,#footer form.node-update-form #edit-field-image-wrapper,#footer form.node-update-form .entity-content-form-footer,#footer form.node-update-form .js-form-type-vertical-tabs,#footer form.node-update-form .other-content,#header #node-page-edit-form #edit-field-display-mode-wrapper,#header #node-page-edit-form #edit-field-image-wrapper,#header #node-page-edit-form .entity-content-form-footer,#header #node-page-edit-form .js-form-type-vertical-tabs,#header #node-page-edit-form .other-content,#header #node-page-form #edit-field-display-mode-wrapper,#header #node-page-form #edit-field-image-wrapper,#header #node-page-form .entity-content-form-footer,#header #node-page-form .js-form-type-vertical-tabs,#header #node-page-form .other-content,#header form.node-form #edit-field-display-mode-wrapper,#header form.node-form #edit-field-image-wrapper,#header form.node-form .entity-content-form-footer,#header form.node-form .js-form-type-vertical-tabs,#header form.node-form .other-content,#header form.node-update-form #edit-field-display-mode-wrapper,#header form.node-update-form #edit-field-image-wrapper,#header form.node-update-form .entity-content-form-footer,#header form.node-update-form .js-form-type-vertical-tabs,#header form.node-update-form .other-content{margin:3.75rem auto;padding-left:3.125rem;padding-right:3.125rem}}#footer #node-page-edit-form .button+.button,#footer #node-page-form .button+.button,#footer form.node-form .button+.button,#footer form.node-update-form .button+.button,#header #node-page-edit-form .button+.button,#header #node-page-form .button+.button,#header form.node-form .button+.button,#header form.node-update-form .button+.button{margin-left:.75rem}#footer #node-page-edit-form a.button--danger,#footer #node-page-edit-form button.button--danger,#footer #node-page-form a.button--danger,#footer #node-page-form button.button--danger,#footer form.node-form a.button--danger,#footer form.node-form button.button--danger,#footer form.node-update-form a.button--danger,#footer form.node-update-form button.button--danger,#header #node-page-edit-form a.button--danger,#header #node-page-edit-form button.button--danger,#header #node-page-form a.button--danger,#header #node-page-form button.button--danger,#header form.node-form a.button--danger,#header form.node-form button.button--danger,#header form.node-update-form a.button--danger,#header form.node-update-form button.button--danger{-webkit-appearance:none;background:#d7d9d9;border:1px solid #d7d9d9;border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);color:#565a5c;font-size:13px;font-weight:700;letter-spacing:.1em;padding:.75rem 1.125rem;text-decoration:none;text-transform:uppercase;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer #node-page-edit-form a.button--danger:hover,#footer #node-page-edit-form button.button--danger:hover,#footer #node-page-form a.button--danger:hover,#footer #node-page-form button.button--danger:hover,#footer form.node-form a.button--danger:hover,#footer form.node-form button.button--danger:hover,#footer form.node-update-form a.button--danger:hover,#footer form.node-update-form button.button--danger:hover,#header #node-page-edit-form a.button--danger:hover,#header #node-page-edit-form button.button--danger:hover,#header #node-page-form a.button--danger:hover,#header #node-page-form button.button--danger:hover,#header form.node-form a.button--danger:hover,#header form.node-form button.button--danger:hover,#header form.node-update-form a.button--danger:hover,#header form.node-update-form button.button--danger:hover{background:#f5f6f7;color:#565a5c;-webkit-transition:all .45s;-o-transition:all .45s;transition:all .45s}#footer #node-page-edit-form .filter-wrapper,#footer #node-page-form .filter-wrapper,#footer form.node-form .filter-wrapper,#footer form.node-update-form .filter-wrapper,#header #node-page-edit-form .filter-wrapper,#header #node-page-form .filter-wrapper,#header form.node-form .filter-wrapper,#header form.node-update-form .filter-wrapper{border-top:1px solid #d7d9d9}#footer #node-page-edit-form input.form-autocomplete,#footer #node-page-edit-form textarea.text-full.form-textarea,#footer #node-page-form input.form-autocomplete,#footer #node-page-form textarea.text-full.form-textarea,#footer form.node-form input.form-autocomplete,#footer form.node-form textarea.text-full.form-textarea,#footer form.node-update-form input.form-autocomplete,#footer form.node-update-form textarea.text-full.form-textarea,#header #node-page-edit-form input.form-autocomplete,#header #node-page-edit-form textarea.text-full.form-textarea,#header #node-page-form input.form-autocomplete,#header #node-page-form textarea.text-full.form-textarea,#header form.node-form input.form-autocomplete,#header form.node-form textarea.text-full.form-textarea,#header form.node-update-form input.form-autocomplete,#header form.node-update-form textarea.text-full.form-textarea{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%}#footer #node-page-edit-form table.field-multiple-table th h4,#footer #node-page-form table.field-multiple-table th h4,#footer form.node-form table.field-multiple-table th h4,#footer form.node-update-form table.field-multiple-table th h4,#header #node-page-edit-form table.field-multiple-table th h4,#header #node-page-form table.field-multiple-table th h4,#header form.node-form table.field-multiple-table th h4,#header form.node-update-form table.field-multiple-table th h4{background:#0073cf;color:#fff;letter-spacing:.2em;margin:0;text-transform:uppercase}@media (min-width:0px){#footer #node-page-edit-form table.field-multiple-table th h4,#footer #node-page-form table.field-multiple-table th h4,#footer form.node-form table.field-multiple-table th h4,#footer form.node-update-form table.field-multiple-table th h4,#header #node-page-edit-form table.field-multiple-table th h4,#header #node-page-form table.field-multiple-table th h4,#header form.node-form table.field-multiple-table th h4,#header form.node-update-form table.field-multiple-table th h4{font-size:.75rem}}@media (min-width:600px){#footer #node-page-edit-form table.field-multiple-table th h4,#footer #node-page-form table.field-multiple-table th h4,#footer form.node-form table.field-multiple-table th h4,#footer form.node-update-form table.field-multiple-table th h4,#header #node-page-edit-form table.field-multiple-table th h4,#header #node-page-form table.field-multiple-table th h4,#header form.node-form table.field-multiple-table th h4,#header form.node-update-form table.field-multiple-table th h4{font-size:.8125rem}}#footer #node-page-edit-form .vertical-tabs .entity-meta.vertical-tabs__panes,#footer #node-page-form .vertical-tabs .entity-meta.vertical-tabs__panes,#footer form.node-form .vertical-tabs .entity-meta.vertical-tabs__panes,#footer form.node-update-form .vertical-tabs .entity-meta.vertical-tabs__panes,#header #node-page-edit-form .vertical-tabs .entity-meta.vertical-tabs__panes,#header #node-page-form .vertical-tabs .entity-meta.vertical-tabs__panes,#header form.node-form .vertical-tabs .entity-meta.vertical-tabs__panes,#header form.node-update-form .vertical-tabs .entity-meta.vertical-tabs__panes{padding:1.25rem}#footer #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#footer #node-page-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-update-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-update-form .vertical-tabs .vertical-tabs__menu-item{background-color:#f5f6f7;font-size:1rem}@media (min-width:37.5em){#footer #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#footer #node-page-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-update-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-update-form .vertical-tabs .vertical-tabs__menu-item{font-size:1rem}}@media (min-width:48em){#footer #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#footer #node-page-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-update-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-update-form .vertical-tabs .vertical-tabs__menu-item{font-size:.9rem}}@media (min-width:64em){#footer #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#footer #node-page-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-update-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-update-form .vertical-tabs .vertical-tabs__menu-item{font-size:.9rem}}#footer #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item a,#footer #node-page-form .vertical-tabs .vertical-tabs__menu-item a,#footer form.node-form .vertical-tabs .vertical-tabs__menu-item a,#footer form.node-update-form .vertical-tabs .vertical-tabs__menu-item a,#header #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item a,#header #node-page-form .vertical-tabs .vertical-tabs__menu-item a,#header form.node-form .vertical-tabs .vertical-tabs__menu-item a,#header form.node-update-form .vertical-tabs .vertical-tabs__menu-item a{color:#777277;padding:1.125rem}#footer #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#footer #node-page-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#footer form.node-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#footer form.node-update-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#header #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#header #node-page-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#header form.node-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#header form.node-update-form .vertical-tabs .vertical-tabs__menu-item.is-selected{background-color:#fff;border-right-width:0}#footer #node-page-edit-form details,#footer #node-page-form details,#footer form.node-form details,#footer form.node-update-form details,#header #node-page-edit-form details,#header #node-page-form details,#header form.node-form details,#header form.node-update-form details{background-color:#fcfcfa;border:1px solid #bfbfbf;border-radius:3px;margin-bottom:1em;margin-top:1em;padding:.95em 1.45em}#footer #node-page-edit-form details summary,#footer #node-page-form details summary,#footer form.node-form details summary,#footer form.node-update-form details summary,#header #node-page-edit-form details summary,#header #node-page-form details summary,#header form.node-form details summary,#header form.node-update-form details summary{color:#0074bd;cursor:pointer;display:block;font-size:.8rem;font-weight:700;text-shadow:0 1px 0 #fff;text-transform:uppercase}#footer #node-page-edit-form details summary:focus,#footer #node-page-form details summary:focus,#footer form.node-form details summary:focus,#footer form.node-update-form details summary:focus,#header #node-page-edit-form details summary:focus,#header #node-page-form details summary:focus,#header form.node-form details summary:focus,#header form.node-update-form details summary:focus{color:#004f80;outline:none;text-decoration:underline}#footer #node-page-edit-form .form-item .description,#footer #node-page-edit-form div.description,#footer #node-page-edit-form ul.tips,#footer #node-page-form .form-item .description,#footer #node-page-form div.description,#footer #node-page-form ul.tips,#footer form.node-form .form-item .description,#footer form.node-form div.description,#footer form.node-form ul.tips,#footer form.node-update-form .form-item .description,#footer form.node-update-form div.description,#footer form.node-update-form ul.tips,#header #node-page-edit-form .form-item .description,#header #node-page-edit-form div.description,#header #node-page-edit-form ul.tips,#header #node-page-form .form-item .description,#header #node-page-form div.description,#header #node-page-form ul.tips,#header form.node-form .form-item .description,#header form.node-form div.description,#header form.node-form ul.tips,#header form.node-update-form .form-item .description,#header form.node-update-form div.description,#header form.node-update-form ul.tips{color:#595959;font-size:.8rem;margin:8px 0 0}#footer #node-page-edit-form button.link.js-media-library-widget-toggle-weight,#footer #node-page-form button.link.js-media-library-widget-toggle-weight,#footer form.node-form button.link.js-media-library-widget-toggle-weight,#footer form.node-update-form button.link.js-media-library-widget-toggle-weight,#header #node-page-edit-form button.link.js-media-library-widget-toggle-weight,#header #node-page-form button.link.js-media-library-widget-toggle-weight,#header form.node-form button.link.js-media-library-widget-toggle-weight,#header form.node-update-form button.link.js-media-library-widget-toggle-weight{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:#0074bd;cursor:pointer;display:inline;font-size:.9rem;margin:0;padding:0;position:absolute;right:15px;text-decoration:none;top:20px}#footer #node-page-edit-form fieldset:not(.fieldgroup),#footer #node-page-form fieldset:not(.fieldgroup),#footer form.node-form fieldset:not(.fieldgroup),#footer form.node-update-form fieldset:not(.fieldgroup),#header #node-page-edit-form fieldset:not(.fieldgroup),#header #node-page-form fieldset:not(.fieldgroup),#header form.node-form fieldset:not(.fieldgroup),#header form.node-update-form fieldset:not(.fieldgroup){border-radius:2px;margin:1em 0;min-width:0;padding:30px 18px 18px;position:relative}#footer #node-page-edit-form .js-hide,#footer #node-page-form .js-hide,#footer form.node-form .js-hide,#footer form.node-update-form .js-hide,#header #node-page-edit-form .js-hide,#header #node-page-form .js-hide,#header form.node-form .js-hide,#header form.node-update-form .js-hide{display:none!important}#footer #node-page-edit-form tr.draggable td:nth-child(2),#footer #node-page-form tr.draggable td:nth-child(2),#footer form.node-form tr.draggable td:nth-child(2),#footer form.node-update-form tr.draggable td:nth-child(2),#header #node-page-edit-form tr.draggable td:nth-child(2),#header #node-page-form tr.draggable td:nth-child(2),#header form.node-form tr.draggable td:nth-child(2),#header form.node-update-form tr.draggable td:nth-child(2){border-left:none}#footer #node-page-edit-form tr.draggable td.field-multiple-drag,#footer #node-page-form tr.draggable td.field-multiple-drag,#footer form.node-form tr.draggable td.field-multiple-drag,#footer form.node-update-form tr.draggable td.field-multiple-drag,#header #node-page-edit-form tr.draggable td.field-multiple-drag,#header #node-page-form tr.draggable td.field-multiple-drag,#header form.node-form tr.draggable td.field-multiple-drag,#header form.node-update-form tr.draggable td.field-multiple-drag{width:22px}#footer #node-page-edit-form tr.draggable td,#footer #node-page-form tr.draggable td,#footer form.node-form tr.draggable td,#footer form.node-update-form tr.draggable td,#header #node-page-edit-form tr.draggable td,#header #node-page-form tr.draggable td,#header form.node-form tr.draggable td,#header form.node-update-form tr.draggable td{font-size:1rem;padding:0;vertical-align:middle}#footer #node-page-edit-form tr.draggable td input,#footer #node-page-form tr.draggable td input,#footer form.node-form tr.draggable td input,#footer form.node-update-form tr.draggable td input,#header #node-page-edit-form tr.draggable td input,#header #node-page-form tr.draggable td input,#header form.node-form tr.draggable td input,#header form.node-update-form tr.draggable td input{height:auto}#footer #node-page-edit-form tr.draggable td a.tabledrag-handle,#footer #node-page-form tr.draggable td a.tabledrag-handle,#footer form.node-form tr.draggable td a.tabledrag-handle,#footer form.node-update-form tr.draggable td a.tabledrag-handle,#header #node-page-edit-form tr.draggable td a.tabledrag-handle,#header #node-page-form tr.draggable td a.tabledrag-handle,#header form.node-form tr.draggable td a.tabledrag-handle,#header form.node-update-form tr.draggable td a.tabledrag-handle{height:auto;margin-left:0}#footer #node-page-edit-form tr.draggable td a.tabledrag-handle .handle,#footer #node-page-form tr.draggable td a.tabledrag-handle .handle,#footer form.node-form tr.draggable td a.tabledrag-handle .handle,#footer form.node-update-form tr.draggable td a.tabledrag-handle .handle,#header #node-page-edit-form tr.draggable td a.tabledrag-handle .handle,#header #node-page-form tr.draggable td a.tabledrag-handle .handle,#header form.node-form tr.draggable td a.tabledrag-handle .handle,#header form.node-update-form tr.draggable td a.tabledrag-handle .handle{height:22px;width:22px}#footer #node-page-edit-form .ui-dialog,#footer #node-page-form .ui-dialog,#footer form.node-form .ui-dialog,#footer form.node-update-form .ui-dialog,#header #node-page-edit-form .ui-dialog,#header #node-page-form .ui-dialog,#header form.node-form .ui-dialog,#header form.node-update-form .ui-dialog{-webkit-box-shadow:0 5px 60px rgba(19,15,19,.25),0 1px 10px rgba(19,15,19,.5);box-shadow:0 5px 60px rgba(19,15,19,.25),0 1px 10px rgba(19,15,19,.5);font-family:IBM Plex Sans,Helvetica,Helvetica Neue,Arial,sans-serif;padding:0}#footer #node-page-edit-form .ui-dialog .ui-dialog-titlebar,#footer #node-page-edit-form .ui-draggable .ui-dialog-titlebar,#footer #node-page-form .ui-dialog .ui-dialog-titlebar,#footer #node-page-form .ui-draggable .ui-dialog-titlebar,#footer form.node-form .ui-dialog .ui-dialog-titlebar,#footer form.node-form .ui-draggable .ui-dialog-titlebar,#footer form.node-update-form .ui-dialog .ui-dialog-titlebar,#footer form.node-update-form .ui-draggable .ui-dialog-titlebar,#header #node-page-edit-form .ui-dialog .ui-dialog-titlebar,#header #node-page-edit-form .ui-draggable .ui-dialog-titlebar,#header #node-page-form .ui-dialog .ui-dialog-titlebar,#header #node-page-form .ui-draggable .ui-dialog-titlebar,#header form.node-form .ui-dialog .ui-dialog-titlebar,#header form.node-form .ui-draggable .ui-dialog-titlebar,#header form.node-update-form .ui-dialog .ui-dialog-titlebar,#header form.node-update-form .ui-draggable .ui-dialog-titlebar{padding:15px 30px}#footer #node-page-edit-form .ui-dialog .ui-dialog-titlebar-close,#footer #node-page-form .ui-dialog .ui-dialog-titlebar-close,#footer form.node-form .ui-dialog .ui-dialog-titlebar-close,#footer form.node-update-form .ui-dialog .ui-dialog-titlebar-close,#header #node-page-edit-form .ui-dialog .ui-dialog-titlebar-close,#header #node-page-form .ui-dialog .ui-dialog-titlebar-close,#header form.node-form .ui-dialog .ui-dialog-titlebar-close,#header form.node-update-form .ui-dialog .ui-dialog-titlebar-close{background:none;border:none;height:30px;margin:0;padding:0;right:30px;top:30px;-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%);width:30px}#footer #node-page-edit-form .ui-dialog .ui-dialog-titlebar-close:hover,#footer #node-page-form .ui-dialog .ui-dialog-titlebar-close:hover,#footer form.node-form .ui-dialog .ui-dialog-titlebar-close:hover,#footer form.node-update-form .ui-dialog .ui-dialog-titlebar-close:hover,#header #node-page-edit-form .ui-dialog .ui-dialog-titlebar-close:hover,#header #node-page-form .ui-dialog .ui-dialog-titlebar-close:hover,#header form.node-form .ui-dialog .ui-dialog-titlebar-close:hover,#header form.node-update-form .ui-dialog .ui-dialog-titlebar-close:hover{border:none}#footer #node-page-edit-form .ui-button .ui-icon,#footer #node-page-form .ui-button .ui-icon,#footer form.node-form .ui-button .ui-icon,#footer form.node-update-form .ui-button .ui-icon,#header #node-page-edit-form .ui-button .ui-icon,#header #node-page-form .ui-button .ui-icon,#header form.node-form .ui-button .ui-icon,#header form.node-update-form .ui-button .ui-icon{background:none;height:100%;left:0;margin:0;top:0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%;width:100%}#footer #node-page-edit-form .ui-button .ui-icon:before,#footer #node-page-form .ui-button .ui-icon:before,#footer form.node-form .ui-button .ui-icon:before,#footer form.node-update-form .ui-button .ui-icon:before,#header #node-page-edit-form .ui-button .ui-icon:before,#header #node-page-form .ui-button .ui-icon:before,#header form.node-form .ui-button .ui-icon:before,#header form.node-update-form .ui-button .ui-icon:before{background-color:#9d999d;content:"";height:100%;left:50%;margin-left:-1px;position:absolute;top:0;width:2px}#footer #node-page-edit-form .ui-button .ui-icon:after,#footer #node-page-form .ui-button .ui-icon:after,#footer form.node-form .ui-button .ui-icon:after,#footer form.node-update-form .ui-button .ui-icon:after,#header #node-page-edit-form .ui-button .ui-icon:after,#header #node-page-form .ui-button .ui-icon:after,#header form.node-form .ui-button .ui-icon:after,#header form.node-update-form .ui-button .ui-icon:after{background-color:#9d999d;content:"";height:2px;left:0;margin-top:-1px;position:absolute;top:50%;width:100%}#footer #node-page-edit-form .ui-button:hover .ui-icon,#footer #node-page-form .ui-button:hover .ui-icon,#footer form.node-form .ui-button:hover .ui-icon,#footer form.node-update-form .ui-button:hover .ui-icon,#header #node-page-edit-form .ui-button:hover .ui-icon,#header #node-page-form .ui-button:hover .ui-icon,#header form.node-form .ui-button:hover .ui-icon,#header form.node-update-form .ui-button:hover .ui-icon{background:none}#footer #node-page-edit-form .ui-button:hover .ui-icon:after,#footer #node-page-edit-form .ui-button:hover .ui-icon:before,#footer #node-page-form .ui-button:hover .ui-icon:after,#footer #node-page-form .ui-button:hover .ui-icon:before,#footer form.node-form .ui-button:hover .ui-icon:after,#footer form.node-form .ui-button:hover .ui-icon:before,#footer form.node-update-form .ui-button:hover .ui-icon:after,#footer form.node-update-form .ui-button:hover .ui-icon:before,#header #node-page-edit-form .ui-button:hover .ui-icon:after,#header #node-page-edit-form .ui-button:hover .ui-icon:before,#header #node-page-form .ui-button:hover .ui-icon:after,#header #node-page-form .ui-button:hover .ui-icon:before,#header form.node-form .ui-button:hover .ui-icon:after,#header form.node-form .ui-button:hover .ui-icon:before,#header form.node-update-form .ui-button:hover .ui-icon:after,#header form.node-update-form .ui-button:hover .ui-icon:before{background:#504b50}#footer #node-page-edit-form .ui-dialog .ui-dialog-title,#footer #node-page-form .ui-dialog .ui-dialog-title,#footer form.node-form .ui-dialog .ui-dialog-title,#footer form.node-update-form .ui-dialog .ui-dialog-title,#header #node-page-edit-form .ui-dialog .ui-dialog-title,#header #node-page-form .ui-dialog .ui-dialog-title,#header form.node-form .ui-dialog .ui-dialog-title,#header form.node-update-form .ui-dialog .ui-dialog-title{line-height:30px;margin:0}#footer #node-page-edit-form .ui-dialog .ui-dialog-content,#footer #node-page-form .ui-dialog .ui-dialog-content,#footer form.node-form .ui-dialog .ui-dialog-content,#footer form.node-update-form .ui-dialog .ui-dialog-content,#header #node-page-edit-form .ui-dialog .ui-dialog-content,#header #node-page-form .ui-dialog .ui-dialog-content,#header form.node-form .ui-dialog .ui-dialog-content,#header form.node-update-form .ui-dialog .ui-dialog-content{padding:30px}#footer #node-page-edit-form .ui-corner-all,#footer #node-page-edit-form .ui-corner-bl,#footer #node-page-edit-form .ui-corner-bottom,#footer #node-page-edit-form .ui-corner-left,#footer #node-page-form .ui-corner-all,#footer #node-page-form .ui-corner-bl,#footer #node-page-form .ui-corner-bottom,#footer #node-page-form .ui-corner-left,#footer form.node-form .ui-corner-all,#footer form.node-form .ui-corner-bl,#footer form.node-form .ui-corner-bottom,#footer form.node-form .ui-corner-left,#footer form.node-update-form .ui-corner-all,#footer form.node-update-form .ui-corner-bl,#footer form.node-update-form .ui-corner-bottom,#footer form.node-update-form .ui-corner-left,#header #node-page-edit-form .ui-corner-all,#header #node-page-edit-form .ui-corner-bl,#header #node-page-edit-form .ui-corner-bottom,#header #node-page-edit-form .ui-corner-left,#header #node-page-form .ui-corner-all,#header #node-page-form .ui-corner-bl,#header #node-page-form .ui-corner-bottom,#header #node-page-form .ui-corner-left,#header form.node-form .ui-corner-all,#header form.node-form .ui-corner-bl,#header form.node-form .ui-corner-bottom,#header form.node-form .ui-corner-left,#header form.node-update-form .ui-corner-all,#header form.node-update-form .ui-corner-bl,#header form.node-update-form .ui-corner-bottom,#header form.node-update-form .ui-corner-left{border:0;border-radius:0}#footer #node-page-edit-form .ui-widget.ui-widget-content,#footer #node-page-form .ui-widget.ui-widget-content,#footer form.node-form .ui-widget.ui-widget-content,#footer form.node-update-form .ui-widget.ui-widget-content,#header #node-page-edit-form .ui-widget.ui-widget-content,#header #node-page-form .ui-widget.ui-widget-content,#header form.node-form .ui-widget.ui-widget-content,#header form.node-update-form .ui-widget.ui-widget-content{border:none}#footer #node-page-edit-form .horizontal-tabs,#footer #node-page-form .horizontal-tabs,#footer form.node-form .horizontal-tabs,#footer form.node-update-form .horizontal-tabs,#header #node-page-edit-form .horizontal-tabs,#header #node-page-form .horizontal-tabs,#header form.node-form .horizontal-tabs,#header form.node-update-form .horizontal-tabs{background:transparent;border:none;padding:0}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list{border-bottom:none;margin:0 -.5rem;padding:.5rem .5rem 0}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list:before,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list:before,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list:before,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list:before,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list:after,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list:before,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list:after,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list:before,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list:after,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list:before,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list:after,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list:before{content:" ";display:table}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list:after,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list:after,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list:after,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list:after,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list:after{clear:both}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li{display:block;float:left;list-style:none;margin-bottom:0;margin-right:1px;margin-top:0;min-width:0;padding:0}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a{display:block;font-family:IBM Plex Sans,Helvetica,Helvetica Neue,Arial,sans-serif;font-size:calc(12.02326px + .23256vw);font-weight:600;letter-spacing:.05em;padding:.5rem 1rem;text-decoration:none;text-transform:uppercase;-webkit-transition:all .15s ease-in-out;-o-transition:all .15s ease-in-out;transition:all .15s ease-in-out}@media screen and (min-width:1280px){#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a{font-size:15px}}@media screen and (max-width:420px){#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a{font-size:13px}}#footer #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a{background-color:#777277;border-radius:0;color:#e1e0e1}#footer #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#footer #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#footer form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#footer form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#header #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#header #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#header form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#header form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover{background-color:#9d999d}#footer #node-page-edit-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-update-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-edit-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-update-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a{border-radius:0}#footer #node-page-edit-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer #node-page-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer form.node-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer form.node-update-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header #node-page-edit-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header #node-page-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header form.node-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header form.node-update-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover{background-color:#e1e0e1}#footer #node-page-edit-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#footer #node-page-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#footer form.node-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#footer form.node-update-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#header #node-page-edit-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#header #node-page-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#header form.node-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#header form.node-update-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active{text-decoration:underline}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a{background-color:#fff;color:#261f26}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li:before{content:none}#footer #node-page-edit-form .horizontal-tabs .horizontal-tabs-pane,#footer #node-page-form .horizontal-tabs .horizontal-tabs-pane,#footer form.node-form .horizontal-tabs .horizontal-tabs-pane,#footer form.node-update-form .horizontal-tabs .horizontal-tabs-pane,#header #node-page-edit-form .horizontal-tabs .horizontal-tabs-pane,#header #node-page-form .horizontal-tabs .horizontal-tabs-pane,#header form.node-form .horizontal-tabs .horizontal-tabs-pane,#header form.node-update-form .horizontal-tabs .horizontal-tabs-pane{padding:0}#footer #node-page-edit-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#footer #node-page-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#footer form.node-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#footer form.node-update-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#header #node-page-edit-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#header #node-page-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#header form.node-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#header form.node-update-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper{padding:1.875rem 0}#footer #node-page-edit-form .entities-list .item-container,#footer #node-page-form .entities-list .item-container,#footer form.node-form .entities-list .item-container,#footer form.node-update-form .entities-list .item-container,#header #node-page-edit-form .entities-list .item-container,#header #node-page-form .entities-list .item-container,#header form.node-form .entities-list .item-container,#header form.node-update-form .entities-list .item-container{display:-webkit-box;display:flex;flex-wrap:wrap;width:40%}#footer #node-page-edit-form .entities-list .item-container figure,#footer #node-page-form .entities-list .item-container figure,#footer form.node-form .entities-list .item-container figure,#footer form.node-update-form .entities-list .item-container figure,#header #node-page-edit-form .entities-list .item-container figure,#header #node-page-form .entities-list .item-container figure,#header form.node-form .entities-list .item-container figure,#header form.node-update-form .entities-list .item-container figure{width:100%}#footer #node-page-edit-form .entities-list .item-container>input.button,#footer #node-page-form .entities-list .item-container>input.button,#footer form.node-form .entities-list .item-container>input.button,#footer form.node-update-form .entities-list .item-container>input.button,#header #node-page-edit-form .entities-list .item-container>input.button,#header #node-page-form .entities-list .item-container>input.button,#header form.node-form .entities-list .item-container>input.button,#header form.node-update-form .entities-list .item-container>input.button{width:50%}#footer #node-page-edit-form .entities-list .item-container>input.remove-button,#footer #node-page-form .entities-list .item-container>input.remove-button,#footer form.node-form .entities-list .item-container>input.remove-button,#footer form.node-update-form .entities-list .item-container>input.remove-button,#header #node-page-edit-form .entities-list .item-container>input.remove-button,#header #node-page-form .entities-list .item-container>input.remove-button,#header form.node-form .entities-list .item-container>input.remove-button,#header form.node-update-form .entities-list .item-container>input.remove-button{border-bottom-right-radius:0;border-top-right-radius:0}#footer #node-page-edit-form .entities-list .item-container>input.edit-button,#footer #node-page-form .entities-list .item-container>input.edit-button,#footer form.node-form .entities-list .item-container>input.edit-button,#footer form.node-update-form .entities-list .item-container>input.edit-button,#header #node-page-edit-form .entities-list .item-container>input.edit-button,#header #node-page-form .entities-list .item-container>input.edit-button,#header form.node-form .entities-list .item-container>input.edit-button,#header form.node-update-form .entities-list .item-container>input.edit-button{border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}#footer #node-page-edit-form .entities-list.sortable .item-container,#footer #node-page-form .entities-list.sortable .item-container,#footer form.node-form .entities-list.sortable .item-container,#footer form.node-update-form .entities-list.sortable .item-container,#header #node-page-edit-form .entities-list.sortable .item-container,#header #node-page-form .entities-list.sortable .item-container,#header form.node-form .entities-list.sortable .item-container,#header form.node-update-form .entities-list.sortable .item-container{margin:2px;padding:12px}#footer #node-page-edit-form .entities-list.sortable .item-container:hover,#footer #node-page-form .entities-list.sortable .item-container:hover,#footer form.node-form .entities-list.sortable .item-container:hover,#footer form.node-update-form .entities-list.sortable .item-container:hover,#header #node-page-edit-form .entities-list.sortable .item-container:hover,#header #node-page-form .entities-list.sortable .item-container:hover,#header form.node-form .entities-list.sortable .item-container:hover,#header form.node-update-form .entities-list.sortable .item-container:hover{opacity:1}#footer #node-page-edit-form .entities-list.sortable .item-container:hover figure,#footer #node-page-form .entities-list.sortable .item-container:hover figure,#footer form.node-form .entities-list.sortable .item-container:hover figure,#footer form.node-update-form .entities-list.sortable .item-container:hover figure,#header #node-page-edit-form .entities-list.sortable .item-container:hover figure,#header #node-page-form .entities-list.sortable .item-container:hover figure,#header form.node-form .entities-list.sortable .item-container:hover figure,#header form.node-update-form .entities-list.sortable .item-container:hover figure{background-color:#fff}#footer #node-page-edit-form .js-pager__items,#footer #node-page-form .js-pager__items,#footer form.node-form .js-pager__items,#footer form.node-update-form .js-pager__items,#header #node-page-edit-form .js-pager__items,#header #node-page-form .js-pager__items,#header form.node-form .js-pager__items,#header form.node-update-form .js-pager__items{list-style-type:none;margin:0;padding:0}#footer #node-page-edit-form .views-infinite-scroll-content-wrapper+.js-pager__items,#footer #node-page-form .views-infinite-scroll-content-wrapper+.js-pager__items,#footer form.node-form .views-infinite-scroll-content-wrapper+.js-pager__items,#footer form.node-update-form .views-infinite-scroll-content-wrapper+.js-pager__items,#header #node-page-edit-form .views-infinite-scroll-content-wrapper+.js-pager__items,#header #node-page-form .views-infinite-scroll-content-wrapper+.js-pager__items,#header form.node-form .views-infinite-scroll-content-wrapper+.js-pager__items,#header form.node-update-form .views-infinite-scroll-content-wrapper+.js-pager__items{margin-top:.75rem}#footer #node-page-edit-form .js-form-type-checkbox:not(:last-child),#footer #node-page-form .js-form-type-checkbox:not(:last-child),#footer form.node-form .js-form-type-checkbox:not(:last-child),#footer form.node-update-form .js-form-type-checkbox:not(:last-child),#header #node-page-edit-form .js-form-type-checkbox:not(:last-child),#header #node-page-form .js-form-type-checkbox:not(:last-child),#header form.node-form .js-form-type-checkbox:not(:last-child),#header form.node-update-form .js-form-type-checkbox:not(:last-child){margin-bottom:.375rem}#footer #node-page-edit-form .js-form-type-checkbox:not(:first-child),#footer #node-page-form .js-form-type-checkbox:not(:first-child),#footer form.node-form .js-form-type-checkbox:not(:first-child),#footer form.node-update-form .js-form-type-checkbox:not(:first-child),#header #node-page-edit-form .js-form-type-checkbox:not(:first-child),#header #node-page-form .js-form-type-checkbox:not(:first-child),#header form.node-form .js-form-type-checkbox:not(:first-child),#header form.node-update-form .js-form-type-checkbox:not(:first-child){margin-top:.375rem}#footer #node-page-edit-form .entity-browser-media-browser-form,#footer #node-page-form .entity-browser-media-browser-form,#footer form.node-form .entity-browser-media-browser-form,#footer form.node-update-form .entity-browser-media-browser-form,#header #node-page-edit-form .entity-browser-media-browser-form,#header #node-page-form .entity-browser-media-browser-form,#header form.node-form .entity-browser-media-browser-form,#header form.node-update-form .entity-browser-media-browser-form{padding-bottom:4.5rem}#footer #node-page-edit-form .eb-media+.form-actions.form-wrapper,#footer #node-page-form .eb-media+.form-actions.form-wrapper,#footer form.node-form .eb-media+.form-actions.form-wrapper,#footer form.node-update-form .eb-media+.form-actions.form-wrapper,#header #node-page-edit-form .eb-media+.form-actions.form-wrapper,#header #node-page-form .eb-media+.form-actions.form-wrapper,#header form.node-form .eb-media+.form-actions.form-wrapper,#header form.node-update-form .eb-media+.form-actions.form-wrapper{background-color:#504b50;bottom:0;left:0;margin-top:0;padding:.75rem;position:fixed;right:0}#footer #node-page-edit-form .entity-browser-iframe-container,#footer #node-page-form .entity-browser-iframe-container,#footer form.node-form .entity-browser-iframe-container,#footer form.node-update-form .entity-browser-iframe-container,#header #node-page-edit-form .entity-browser-iframe-container,#header #node-page-form .entity-browser-iframe-container,#header form.node-form .entity-browser-iframe-container,#header form.node-update-form .entity-browser-iframe-container{position:relative}#footer #node-page-edit-form .entity-browser-iframe-container iframe,#footer #node-page-form .entity-browser-iframe-container iframe,#footer form.node-form .entity-browser-iframe-container iframe,#footer form.node-update-form .entity-browser-iframe-container iframe,#header #node-page-edit-form .entity-browser-iframe-container iframe,#header #node-page-form .entity-browser-iframe-container iframe,#header form.node-form .entity-browser-iframe-container iframe,#header form.node-update-form .entity-browser-iframe-container iframe{display:block}#footer #node-page-edit-form .entity-browser-iframe-container:before,#footer #node-page-form .entity-browser-iframe-container:before,#footer form.node-form .entity-browser-iframe-container:before,#footer form.node-update-form .entity-browser-iframe-container:before,#header #node-page-edit-form .entity-browser-iframe-container:before,#header #node-page-form .entity-browser-iframe-container:before,#header form.node-form .entity-browser-iframe-container:before,#header form.node-update-form .entity-browser-iframe-container:before{-webkit-box-shadow:inset 0 0 5px rgba(19,15,19,.25);box-shadow:inset 0 0 5px rgba(19,15,19,.25);content:"";height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:504}#footer #node-page-edit-form .page-node-add dl,#footer #node-page-form .page-node-add dl,#footer form.node-form .page-node-add dl,#footer form.node-update-form .page-node-add dl,#header #node-page-edit-form .page-node-add dl,#header #node-page-form .page-node-add dl,#header form.node-form .page-node-add dl,#header form.node-update-form .page-node-add dl{border-bottom:1px dotted #c3c1c3;padding-bottom:.9rem}#footer #node-page-edit-form .page-node-add dl dd,#footer #node-page-edit-form .page-node-add dl dt,#footer #node-page-form .page-node-add dl dd,#footer #node-page-form .page-node-add dl dt,#footer form.node-form .page-node-add dl dd,#footer form.node-form .page-node-add dl dt,#footer form.node-update-form .page-node-add dl dd,#footer form.node-update-form .page-node-add dl dt,#header #node-page-edit-form .page-node-add dl dd,#header #node-page-edit-form .page-node-add dl dt,#header #node-page-form .page-node-add dl dd,#header #node-page-form .page-node-add dl dt,#header form.node-form .page-node-add dl dd,#header form.node-form .page-node-add dl dt,#header form.node-update-form .page-node-add dl dd,#header form.node-update-form .page-node-add dl dt{font-size:calc(13.05882px + .29412vw)}@media screen and (min-width:1680px){#footer #node-page-edit-form .page-node-add dl dd,#footer #node-page-edit-form .page-node-add dl dt,#footer #node-page-form .page-node-add dl dd,#footer #node-page-form .page-node-add dl dt,#footer form.node-form .page-node-add dl dd,#footer form.node-form .page-node-add dl dt,#footer form.node-update-form .page-node-add dl dd,#footer form.node-update-form .page-node-add dl dt,#header #node-page-edit-form .page-node-add dl dd,#header #node-page-edit-form .page-node-add dl dt,#header #node-page-form .page-node-add dl dd,#header #node-page-form .page-node-add dl dt,#header form.node-form .page-node-add dl dd,#header form.node-form .page-node-add dl dt,#header form.node-update-form .page-node-add dl dd,#header form.node-update-form .page-node-add dl dt{font-size:18px}}@media screen and (max-width:320px){#footer #node-page-edit-form .page-node-add dl dd,#footer #node-page-edit-form .page-node-add dl dt,#footer #node-page-form .page-node-add dl dd,#footer #node-page-form .page-node-add dl dt,#footer form.node-form .page-node-add dl dd,#footer form.node-form .page-node-add dl dt,#footer form.node-update-form .page-node-add dl dd,#footer form.node-update-form .page-node-add dl dt,#header #node-page-edit-form .page-node-add dl dd,#header #node-page-edit-form .page-node-add dl dt,#header #node-page-form .page-node-add dl dd,#header #node-page-form .page-node-add dl dt,#header form.node-form .page-node-add dl dd,#header form.node-form .page-node-add dl dt,#header form.node-update-form .page-node-add dl dd,#header form.node-update-form .page-node-add dl dt{font-size:14px}}#footer #node-page-edit-form .page-node-add dl dt,#footer #node-page-form .page-node-add dl dt,#footer form.node-form .page-node-add dl dt,#footer form.node-update-form .page-node-add dl dt,#header #node-page-edit-form .page-node-add dl dt,#header #node-page-form .page-node-add dl dt,#header form.node-form .page-node-add dl dt,#header form.node-update-form .page-node-add dl dt{border-top:1px dotted #c3c1c3;margin-top:1.125rem;padding-top:1.125rem}#footer #node-page-edit-form .page-node-add dl dt:first-child,#footer #node-page-form .page-node-add dl dt:first-child,#footer form.node-form .page-node-add dl dt:first-child,#footer form.node-update-form .page-node-add dl dt:first-child,#header #node-page-edit-form .page-node-add dl dt:first-child,#header #node-page-form .page-node-add dl dt:first-child,#header form.node-form .page-node-add dl dt:first-child,#header form.node-update-form .page-node-add dl dt:first-child{margin-top:0}#footer #node-page-edit-form .page-node-add dl dt a,#footer #node-page-form .page-node-add dl dt a,#footer form.node-form .page-node-add dl dt a,#footer form.node-update-form .page-node-add dl dt a,#header #node-page-edit-form .page-node-add dl dt a,#header #node-page-form .page-node-add dl dt a,#header form.node-form .page-node-add dl dt a,#header form.node-update-form .page-node-add dl dt a{color:#130f13;display:block;font-weight:500}#footer #node-page-edit-form .page-node-add dl dd,#footer #node-page-form .page-node-add dl dd,#footer form.node-form .page-node-add dl dd,#footer form.node-update-form .page-node-add dl dd,#header #node-page-edit-form .page-node-add dl dd,#header #node-page-form .page-node-add dl dd,#header form.node-form .page-node-add dl dd,#header form.node-update-form .page-node-add dl dd{color:#777277;margin:0;width:80%}@media (min-width:48em){#footer #node-page-edit-form .page-node-add dl,#footer #node-page-form .page-node-add dl,#footer form.node-form .page-node-add dl,#footer form.node-update-form .page-node-add dl,#header #node-page-edit-form .page-node-add dl,#header #node-page-form .page-node-add dl,#header form.node-form .page-node-add dl,#header form.node-update-form .page-node-add dl{display:-webkit-box;display:flex;flex-wrap:wrap}#footer #node-page-edit-form .page-node-add dl dt,#footer #node-page-form .page-node-add dl dt,#footer form.node-form .page-node-add dl dt,#footer form.node-update-form .page-node-add dl dt,#header #node-page-edit-form .page-node-add dl dt,#header #node-page-form .page-node-add dl dt,#header form.node-form .page-node-add dl dt,#header form.node-update-form .page-node-add dl dt{width:20%}#footer #node-page-edit-form .page-node-add dl dd,#footer #node-page-form .page-node-add dl dd,#footer form.node-form .page-node-add dl dd,#footer form.node-update-form .page-node-add dl dd,#header #node-page-edit-form .page-node-add dl dd,#header #node-page-form .page-node-add dl dd,#header form.node-form .page-node-add dl dd,#header form.node-update-form .page-node-add dl dd{border-top:1px dotted #c3c1c3;margin-top:1.125rem;padding-top:1.125rem;width:80%}#footer #node-page-edit-form .page-node-add dl dt:first-child+dd,#footer #node-page-form .page-node-add dl dt:first-child+dd,#footer form.node-form .page-node-add dl dt:first-child+dd,#footer form.node-update-form .page-node-add dl dt:first-child+dd,#header #node-page-edit-form .page-node-add dl dt:first-child+dd,#header #node-page-form .page-node-add dl dt:first-child+dd,#header form.node-form .page-node-add dl dt:first-child+dd,#header form.node-update-form .page-node-add dl dt:first-child+dd{margin-top:0}}#footer #node-page-edit-form .paragraph--type--webform .form-item:not(:last-child),#footer #node-page-edit-form .paragraph--type--webform h2,#footer #node-page-form .paragraph--type--webform .form-item:not(:last-child),#footer #node-page-form .paragraph--type--webform h2,#footer form.node-form .paragraph--type--webform .form-item:not(:last-child),#footer form.node-form .paragraph--type--webform h2,#footer form.node-update-form .paragraph--type--webform .form-item:not(:last-child),#footer form.node-update-form .paragraph--type--webform h2,#header #node-page-edit-form .paragraph--type--webform .form-item:not(:last-child),#header #node-page-edit-form .paragraph--type--webform h2,#header #node-page-form .paragraph--type--webform .form-item:not(:last-child),#header #node-page-form .paragraph--type--webform h2,#header form.node-form .paragraph--type--webform .form-item:not(:last-child),#header form.node-form .paragraph--type--webform h2,#header form.node-update-form .paragraph--type--webform .form-item:not(:last-child),#header form.node-update-form .paragraph--type--webform h2{margin-bottom:3.75rem}#footer #node-page-edit-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#footer #node-page-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#footer form.node-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#footer form.node-update-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#header #node-page-edit-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#header #node-page-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#header form.node-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#header form.node-update-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label{display:none}#footer #node-page-edit-form .cke_bottom,#footer #node-page-form .cke_bottom,#footer form.node-form .cke_bottom,#footer form.node-update-form .cke_bottom,#header #node-page-edit-form .cke_bottom,#header #node-page-form .cke_bottom,#header form.node-form .cke_bottom,#header form.node-update-form .cke_bottom{display:none!important}#footer .js-component,#header .js-component{position:relative;z-index:1}#footer .views-element-container,#header .views-element-container{margin-bottom:1.875rem}@media (min-width:1200px){#footer .views-element-container,#header .views-element-container{margin-bottom:3.75rem}}#footer .paragraph--type--section .layout .l__region .views-element-container,#header .paragraph--type--section .layout .l__region .views-element-container{margin-bottom:0}#footer .view--empty,#header .view--empty{margin-top:1.875rem}@media (min-width:1200px){#footer .view--empty,#header .view--empty{margin-top:3.75rem}}#footer .view--empty p,#header .view--empty p{color:#565a5c;font-weight:400;line-height:1.5}@media (min-width:0px){#footer .view--empty p,#header .view--empty p{font-size:1rem}}@media (min-width:600px){#footer .view--empty p,#header .view--empty p{font-size:1.125rem}}#footer .view--empty p:first-child,#header .view--empty p:first-child{margin-top:0}#footer .view--empty p:last-child,#header .view--empty p:last-child{margin-bottom:0}@media (min-width:0px){#footer .views-view-grid.cols-3,#header .views-view-grid.cols-3{font-size:.75rem}}@media (min-width:600px){#footer .views-view-grid.cols-3,#header .views-view-grid.cols-3{font-size:.8125rem}}#footer .views-view-grid.cols-3 .views-col,#header .views-view-grid.cols-3 .views-col{border-left:1px solid #d7d9d9;padding:1rem 1.25rem}#footer .views-view-grid.cols-3 .views-col:first-child,#header .views-view-grid.cols-3 .views-col:first-child{border-left:none}#footer .views-view-grid.cols-3 .views-row,#header .views-view-grid.cols-3 .views-row{margin-bottom:0}#footer table td.views-field-entity-browser-select,#header table td.views-field-entity-browser-select{vertical-align:middle}#footer table td.views-field-entity-browser-select .js-form-item input.form-checkbox,#header table td.views-field-entity-browser-select .js-form-item input.form-checkbox{position:static}@media (min-width:0px) and (max-width:1199.98px){#footer .js-prevent-scroll,#header .js-prevent-scroll{height:100%;overflow:hidden;position:fixed;width:100%}}#footer .header,#header .header{background-color:#fff;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);position:fixed;top:0;width:100%;z-index:99}#footer .header__inner,#header .header__inner{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-box-pack:justify;background-color:#fff;display:-webkit-box;display:flex;flex-direction:row;flex-wrap:nowrap;height:120px;justify-content:space-between}@media (min-width:0px) and (max-width:1199.98px){#footer .header__inner,#header .header__inner{-webkit-box-align:center;align-items:center;height:60px}}#footer [id],#header [id]{scroll-margin-top:120px}@media (min-width:0px) and (max-width:1199.98px){#footer [id],#header [id]{scroll-margin-top:60px}}#footer .header__logo,#header .header__logo{-webkit-box-align:center;-webkit-box-pack:center;align-items:center;display:-webkit-box;display:flex;justify-content:center;padding:0;width:88px;z-index:1}#footer .header__logo a,#footer .header__logo img,#header .header__logo a,#header .header__logo img{display:block;width:100%}@media (min-width:992px){#footer .header__logo,#header .header__logo{margin:24px 0;width:140px}}@media (min-width:1200px){#footer .header__logo,#header .header__logo{margin:24px 0;width:140px}}@media (min-width:0px) and (max-width:1199.98px){#footer .header__site-navigation,#header .header__site-navigation{bottom:0;left:0;position:fixed;right:0;top:60px;width:100%;z-index:-1}}@media (min-width:1200px){#footer .header__site-navigation,#header .header__site-navigation{-webkit-box-align:end;-webkit-box-align:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;align-items:flex-end;align-items:center;display:-webkit-box;display:flex;flex-direction:row;flex-wrap:nowrap}}@media (min-width:0px) and (max-width:1199.98px){#footer body.user-logged-in .header__site-navigation,#header body.user-logged-in .header__site-navigation{top:99px}#footer body.toolbar-fixed.toolbar-tray-open .header__site-navigation,#header body.toolbar-fixed.toolbar-tray-open .header__site-navigation{top:138px}}#footer .header__utilities,#header .header__utilities{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-pack:end;display:-webkit-box;display:flex;flex-direction:column;height:90px;justify-content:flex-end;margin-bottom:22px;width:126px}@media (min-width:992px) and (max-width:1199.98px){#footer .header__utilities,#header .header__utilities{height:66px;width:90px}}#footer .nav-trigger,#header .nav-trigger{clip:rect(0,0,0,0);position:absolute}#footer label[for=nav-trigger],#header label[for=nav-trigger]{cursor:pointer;height:30px;margin:auto;position:absolute;right:30px;width:30px;z-index:2}@media (min-width:1200px){#footer label[for=nav-trigger],#header label[for=nav-trigger]{display:none}}#footer .nav-trigger__icon,#header .nav-trigger__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}#footer .nav-trigger__icon path,#header .nav-trigger__icon path{fill:#0073cf}#footer .nav-trigger__icon--expand,#header .nav-trigger__icon--expand{bottom:0;left:0;margin:auto;opacity:1;position:absolute;right:0;top:0;-webkit-transform:rotate(0) scale(1);-ms-transform:rotate(0) scale(1);transform:rotate(0) scale(1);-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}#footer .nav-trigger__icon--collapse,#header .nav-trigger__icon--collapse{margin:auto;opacity:0;position:absolute;-webkit-transform:rotate(-90deg) scale(0);-ms-transform:rotate(-90deg) scale(0);transform:rotate(-90deg) scale(0);-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}@media (min-width:0px) and (max-width:1199.98px){#footer .header__site-navigation,#header .header__site-navigation{opacity:0;-webkit-transform:translateY(-100%);-ms-transform:translateY(-100%);transform:translateY(-100%);-webkit-transition:all .375s ease-in-out;-o-transition:all .375s ease-in-out;transition:all .375s ease-in-out}#footer .nav-trigger:checked~.header__site-navigation,#header .nav-trigger:checked~.header__site-navigation{opacity:1;overflow-y:auto;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}#footer .nav-trigger:checked~label .nav-trigger__icon--collapse,#header .nav-trigger:checked~label .nav-trigger__icon--collapse{opacity:1;-webkit-transform:rotate(0) scale(1);-ms-transform:rotate(0) scale(1);transform:rotate(0) scale(1)}#footer .nav-trigger:checked~label .nav-trigger__icon--expand,#header .nav-trigger:checked~label .nav-trigger__icon--expand{opacity:0;-webkit-transform:rotate(90deg) scale(0);-ms-transform:rotate(90deg) scale(0);transform:rotate(90deg) scale(0)}#footer nav#block-neon-main-menu>ul,#header nav#block-neon-main-menu>ul{background:#fff;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.5);box-shadow:0 2px 4px rgba(0,0,0,.5);height:100%;margin:0;overflow-x:hidden;padding:0;width:100%}#footer nav#block-neon-main-menu>ul li,#header nav#block-neon-main-menu>ul li{-webkit-box-pack:justify;-webkit-box-align:center;align-items:center;border-left:6px solid #fff;display:-webkit-box;display:flex;justify-content:space-between;margin:12px auto;padding:15px 30px 18px 24px;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}#footer nav#block-neon-main-menu>ul li.menu__item.menu__item--expanded:hover,#header nav#block-neon-main-menu>ul li.menu__item.menu__item--expanded:hover{border-left:6px solid #0073cf;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}#footer nav#block-neon-main-menu>ul li a,#header nav#block-neon-main-menu>ul li a{color:#0073cf;display:inline-block;font-size:18px;font-weight:600;line-height:30px;text-decoration:none}#footer nav#block-neon-main-menu>ul li>.arrow,#header nav#block-neon-main-menu>ul li>.arrow{clip:auto;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:3px;height:24px;margin-top:0;opacity:1;right:26px;-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);-webkit-transition:all .15s ease-in-out;-o-transition:all .15s ease-in-out;transition:all .15s ease-in-out;visibility:visible;width:24px}#footer nav#block-neon-main-menu>ul li>.arrow svg,#header nav#block-neon-main-menu>ul li>.arrow svg{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}#footer nav#block-neon-main-menu>ul li>.arrow svg path,#header nav#block-neon-main-menu>ul li>.arrow svg path{stroke:#0073cf}#footer nav#block-neon-main-menu>ul li>.arrow:active,#footer nav#block-neon-main-menu>ul li>.arrow:focus,#footer nav#block-neon-main-menu>ul li>.arrow:hover,#footer nav#block-neon-main-menu>ul li>.arrow[focus-within],#header nav#block-neon-main-menu>ul li>.arrow:active,#header nav#block-neon-main-menu>ul li>.arrow:focus,#header nav#block-neon-main-menu>ul li>.arrow:hover,#header nav#block-neon-main-menu>ul li>.arrow[focus-within]{background:none;position:absolute!important}}@media (min-width:0px) and (max-width:1199.98px){#footer nav#block-neon-main-menu>ul li>.arrow:active,#footer nav#block-neon-main-menu>ul li>.arrow:focus,#footer nav#block-neon-main-menu>ul li>.arrow:focus-within,#footer nav#block-neon-main-menu>ul li>.arrow:hover,#header nav#block-neon-main-menu>ul li>.arrow:active,#header nav#block-neon-main-menu>ul li>.arrow:focus,#header nav#block-neon-main-menu>ul li>.arrow:focus-within,#header nav#block-neon-main-menu>ul li>.arrow:hover{position:absolute!important}#footer nav#block-neon-main-menu>ul li>.arrow:active,#footer nav#block-neon-main-menu>ul li>.arrow:focus,#footer nav#block-neon-main-menu>ul li>.arrow:focus-within,#footer nav#block-neon-main-menu>ul li>.arrow:hover,#header nav#block-neon-main-menu>ul li>.arrow:active,#header nav#block-neon-main-menu>ul li>.arrow:focus,#header nav#block-neon-main-menu>ul li>.arrow:focus-within,#header nav#block-neon-main-menu>ul li>.arrow:hover{background:none}#footer nav#block-neon-main-menu>ul>li.myAccount,#footer nav#block-neon-main-menu>ul>li.siteSearch,#header nav#block-neon-main-menu>ul>li.myAccount,#header nav#block-neon-main-menu>ul>li.siteSearch{background:#f5f6f7;border:none;margin:0}#footer nav#block-neon-main-menu>ul>li.myAccount,#header nav#block-neon-main-menu>ul>li.myAccount{-webkit-box-flex:0;flex:none;text-align:center;width:100%}#footer nav#block-neon-main-menu>ul>li.myAccount a,#header nav#block-neon-main-menu>ul>li.myAccount a{background:#e4e6e7;border:1px solid #e4e6e7;border-radius:2px;color:#565a5c;font-size:12px;font-weight:600;letter-spacing:1.2px;padding:6px 12px;text-decoration:none;text-transform:uppercase;-webkit-transition:all .15s ease;-o-transition:all .15s ease;transition:all .15s ease}#footer nav#block-neon-main-menu>ul>li.myAccount a:hover,#header nav#block-neon-main-menu>ul>li.myAccount a:hover{color:#0073cf;-webkit-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease}#footer nav#block-neon-main-menu>ul>li.menu__item.menu__item--expanded.over>.subNavWrapper.depthZero,#header nav#block-neon-main-menu>ul>li.menu__item.menu__item--expanded.over>.subNavWrapper.depthZero{-webkit-box-orient:vertical;-webkit-box-direction:normal;background:#002c77;display:-webkit-box;display:flex;flex-direction:column;-webkit-transform:translateZ(0) translateX(0);transform:translateZ(0) translateX(0)}#footer nav#block-neon-main-menu ul[data-depth="0"] ul,#header nav#block-neon-main-menu ul[data-depth="0"] ul{background:#002c77;height:100%;-webkit-transition:-webkit-transform .12s;transition:-webkit-transform .12s;-o-transition:transform .12s;transition:transform .12s;transition:transform .12s,-webkit-transform .12s}#footer nav#block-neon-main-menu ul[data-depth="0"] ul li,#header nav#block-neon-main-menu ul[data-depth="0"] ul li{-webkit-box-pack:justify;-webkit-box-align:center;align-items:center;border-left:6px solid #002c77;color:#c2deea;display:-webkit-box;display:flex;font-weight:400;justify-content:space-between;padding:15px 30px 15px 24px}#footer nav#block-neon-main-menu ul[data-depth="0"] ul li a,#header nav#block-neon-main-menu ul[data-depth="0"] ul li a{color:#c2deea;font-weight:400}#footer nav#block-neon-main-menu ul[data-depth="0"] ul .mini-arrow,#header nav#block-neon-main-menu ul[data-depth="0"] ul .mini-arrow{-webkit-box-pack:center;-webkit-box-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:3px;display:-webkit-box;display:flex;height:48px;justify-content:center;margin-top:0;right:26px;width:48px}#footer nav#block-neon-main-menu ul[data-depth="0"],#header nav#block-neon-main-menu ul[data-depth="0"]{-webkit-overflow-scrolling:touch;position:fixed;right:0;-webkit-transform:translateX(0) translateZ(0);transform:translateX(0) translateZ(0);visibility:visible;width:100%;z-index:1}#footer nav#block-neon-main-menu ul[data-depth="1"],#header nav#block-neon-main-menu ul[data-depth="1"]{left:0;margin:0;padding:0;position:absolute;top:0;width:100%}#footer nav#block-neon-main-menu ul[data-depth="1"]>li.active ul[data-depth="2"],#header nav#block-neon-main-menu ul[data-depth="1"]>li.active ul[data-depth="2"]{-webkit-transform:translateZ(0) translateX(0);transform:translateZ(0) translateX(0);-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;-o-transition:transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}#footer nav#block-neon-main-menu ul[data-depth="2"],#header nav#block-neon-main-menu ul[data-depth="2"]{left:0;margin:0;padding:0;position:absolute;top:0;-webkit-transform:translateZ(0) translateX(100%);transform:translateZ(0) translateX(100%);width:100%}#footer nav#block-neon-main-menu ul[data-depth="2"]>li.active ul[data-depth="3"],#header nav#block-neon-main-menu ul[data-depth="2"]>li.active ul[data-depth="3"]{-webkit-transform:translateZ(0) translateX(0);transform:translateZ(0) translateX(0)}#footer nav#block-neon-main-menu ul[data-depth="3"],#header nav#block-neon-main-menu ul[data-depth="3"]{left:0;margin:0;padding:0;position:absolute;top:0;-webkit-transform:translateZ(0) translateX(100%);transform:translateZ(0) translateX(100%);width:100%}#footer nav#block-neon-main-menu ul[data-depth="3"]>li.active ul[data-depth="4"],#header nav#block-neon-main-menu ul[data-depth="3"]>li.active ul[data-depth="4"]{-webkit-transform:translateZ(0) translateX(0);transform:translateZ(0) translateX(0)}#footer nav#block-neon-main-menu ul[data-depth="4"],#header nav#block-neon-main-menu ul[data-depth="4"]{left:0;margin:0;padding:0;position:absolute;top:0;-webkit-transform:translateZ(0) translateX(100%);transform:translateZ(0) translateX(100%);width:100%}#footer nav#block-neon-main-menu ul[data-depth="4"]>li.active ul[data-depth="5"],#header nav#block-neon-main-menu ul[data-depth="4"]>li.active ul[data-depth="5"]{-webkit-transform:translateZ(0) translateX(0);transform:translateZ(0) translateX(0)}#footer nav#block-neon-main-menu ul[data-depth="5"],#header nav#block-neon-main-menu ul[data-depth="5"]{left:0;margin:0;padding:0;position:absolute;top:0;-webkit-transform:translateZ(0) translateX(100%);transform:translateZ(0) translateX(100%);width:100%}#footer nav#block-neon-main-menu .subNavWrapper,#header nav#block-neon-main-menu .subNavWrapper{-webkit-overflow-scrolling:touch;height:100%;left:0;overflow:auto;position:fixed;right:0;top:0;-webkit-transform:translateZ(0) translateX(100%);transform:translateZ(0) translateX(100%);-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;-o-transition:transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;z-index:1}#footer nav#block-neon-main-menu .subNavWrapper .innerSubNavWrapper,#header nav#block-neon-main-menu .subNavWrapper .innerSubNavWrapper{-webkit-box-ordinal-group:3;height:100%;order:2;overflow:hidden;position:relative;width:100%}#footer nav#block-neon-main-menu .subNavWrapper .subNavLabelWrapper,#header nav#block-neon-main-menu .subNavWrapper .subNavLabelWrapper{-webkit-box-ordinal-group:2;order:1;width:100%}#footer nav#block-neon-main-menu .subNavWrapper .subNavLabelWrapper .mobileBack,#header nav#block-neon-main-menu .subNavWrapper .subNavLabelWrapper .mobileBack{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-align:center;-webkit-box-pack:center;align-items:center;background:#fff;border:none;border-radius:3px;display:-webkit-box;display:flex;flex-direction:column;height:30px;justify-content:center;margin:18px 0 0 30px;width:30px}}@media (min-width:1200px){#footer .subNavWrapper ul[data-depth="1"] .expandable:not(.active) ul,#header .subNavWrapper ul[data-depth="1"] .expandable:not(.active) ul{height:0;overflow:hidden}#footer .subNavWrapper ul[data-depth="1"] li.active ul[data-depth="2"],#footer .subNavWrapper ul[data-depth="1"] li.active ul[data-depth="3"],#footer .subNavWrapper ul[data-depth="3"] li.active ul[data-depth="4"],#footer .subNavWrapper ul[data-depth="3"] li.active ul[data-depth="5"],#header .subNavWrapper ul[data-depth="1"] li.active ul[data-depth="2"],#header .subNavWrapper ul[data-depth="1"] li.active ul[data-depth="3"],#header .subNavWrapper ul[data-depth="3"] li.active ul[data-depth="4"],#header .subNavWrapper ul[data-depth="3"] li.active ul[data-depth="5"]{height:auto;overflow:visible}#footer .header__menu-main,#header .header__menu-main{-webkit-box-align:center;align-items:center;display:-webkit-box;display:flex;height:100%}#footer nav#block-neon-main-menu,#header nav#block-neon-main-menu{-webkit-box-align:center;align-items:center;display:-webkit-box;display:flex;height:100%;position:inherit!important}#footer nav#block-neon-main-menu>ul.menu--main,#header nav#block-neon-main-menu>ul.menu--main{-webkit-box-align:stretch;align-items:stretch;display:-webkit-box;display:flex;height:100%;margin:0;padding:0}#footer nav#block-neon-main-menu>ul.menu--main>li,#header nav#block-neon-main-menu>ul.menu--main>li{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-align:center;-webkit-box-pack:center;align-items:center;border-bottom:6px solid #fff;display:-webkit-box;display:flex;flex-direction:column;justify-content:center;margin-right:50px}#footer nav#block-neon-main-menu>ul.menu--main>li:last-child,#header nav#block-neon-main-menu>ul.menu--main>li:last-child{margin-right:0}#footer nav#block-neon-main-menu>ul.menu--main>li>a:not([myAccount]),#footer nav#block-neon-main-menu>ul.menu--main>li>a:not([siteSearch]),#header nav#block-neon-main-menu>ul.menu--main>li>a:not([myAccount]),#header nav#block-neon-main-menu>ul.menu--main>li>a:not([siteSearch]){color:#0073cf;font-size:18px;font-weight:600;margin-bottom:auto;margin-top:42px;padding-bottom:6px;padding-top:6px;text-decoration:none}#footer nav#block-neon-main-menu>ul.menu--main>li:not(.menu__item--expanded)>a,#header nav#block-neon-main-menu>ul.menu--main>li:not(.menu__item--expanded)>a{margin-bottom:auto}#footer nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:focus .arrow,#footer nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:hover .arrow,#footer nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded[focus-within] .arrow,#header nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:focus .arrow,#header nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:hover .arrow,#header nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded[focus-within] .arrow{clip:auto;background:#0073cf;opacity:1;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;visibility:visible;z-index:4}#footer nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:focus .arrow,#footer nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:focus-within .arrow,#footer nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:hover .arrow,#header nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:focus .arrow,#header nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:focus-within .arrow,#header nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:hover .arrow{clip:auto;background:#0073cf;opacity:1;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;visibility:visible;z-index:4}#footer nav#block-neon-main-menu>ul.menu--main>li>.arrow,#header nav#block-neon-main-menu>ul.menu--main>li>.arrow{background:none;border:0;border-radius:0 0 3px 3px;bottom:-37px;display:block;height:34px;opacity:0;position:relative!important;text-align:center;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;visibility:hidden;width:calc(100% - 14px);z-index:0}#footer nav#block-neon-main-menu>ul.menu--main>li>.arrow svg,#header nav#block-neon-main-menu>ul.menu--main>li>.arrow svg{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}#footer nav#block-neon-main-menu>ul.menu--main>li>.arrow.hidden,#header nav#block-neon-main-menu>ul.menu--main>li>.arrow.hidden{display:none!important}#footer nav#block-neon-main-menu>ul.menu--main>li.over,#header nav#block-neon-main-menu>ul.menu--main>li.over{border-bottom:6px solid #0073cf}#footer nav#block-neon-main-menu>ul.menu--main>li.myAccount,#header nav#block-neon-main-menu>ul.menu--main>li.myAccount{-webkit-box-flex:0;flex:none;margin:0 0 25px;width:100%}#footer nav#block-neon-main-menu>ul.menu--main>li.myAccount a,#header nav#block-neon-main-menu>ul.menu--main>li.myAccount a{background:#e4e6e7;border:1px solid #e4e6e7;border-radius:2px;color:#565a5c;font-size:12px;font-weight:600;letter-spacing:1.2px;line-height:18px;margin-bottom:auto;padding:6px 12px;text-decoration:none;text-transform:uppercase;-webkit-transition:all .25s ease;-o-transition:all .25s ease;transition:all .25s ease}#footer nav#block-neon-main-menu>ul.menu--main>li.myAccount a:hover,#header nav#block-neon-main-menu>ul.menu--main>li.myAccount a:hover{background:#fff;border:1px solid #fff;color:#0073cf;-webkit-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease}}@media (min-width:1200px) and (min-width:768px){#footer nav#block-neon-main-menu>ul.menu--main>li.myAccount,#header nav#block-neon-main-menu>ul.menu--main>li.myAccount{margin:0 30px 0 0;width:auto}}@media (min-width:1200px){#footer nav#block-neon-main-menu>ul.menu--main>li.siteSearch,#header nav#block-neon-main-menu>ul.menu--main>li.siteSearch{-webkit-box-flex:0;flex:none;margin-right:0;width:20px}#footer nav#block-neon-main-menu>ul.menu--main>li.siteSearch a,#header nav#block-neon-main-menu>ul.menu--main>li.siteSearch a{background:url(https://www.neonscience.org/themes/custom/neon/images/icons/search.svg) 50% no-repeat;display:block;margin-bottom:auto;overflow:hidden;position:relative;text-indent:100%;white-space:nowrap}#footer nav#block-neon-main-menu>ul.menu--main>li.siteSearch a:after,#footer nav#block-neon-main-menu>ul.menu--main>li.siteSearch a:before,#header nav#block-neon-main-menu>ul.menu--main>li.siteSearch a:after,#header nav#block-neon-main-menu>ul.menu--main>li.siteSearch a:before{background:url(https://www.neonscience.org/themes/custom/neon/images/icons/search_hover.svg);content:"";display:none;height:0;width:0}#footer nav#block-neon-main-menu>ul.menu--main>li.siteSearch a:hover,#header nav#block-neon-main-menu>ul.menu--main>li.siteSearch a:hover{background:url(https://www.neonscience.org/themes/custom/neon/images/icons/search_hover.svg) no-repeat 50%}#footer .subNavWrapper,#header .subNavWrapper{-webkit-box-orient:vertical;-webkit-box-direction:normal;background:#002c77;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.25),inset 0 1px 1px rgba(0,0,0,.25);box-shadow:inset 0 1px 3px rgba(0,0,0,.25),inset 0 1px 1px rgba(0,0,0,.25);display:-webkit-box;display:flex;flex-direction:column;height:100%;left:0;margin:0;opacity:0;overflow-x:hidden;overflow-y:auto;position:fixed;top:120px;-webkit-transition:opacity .2s ease-in-out;-o-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;visibility:hidden;white-space:nowrap;width:100%;z-index:-1}#footer .subNavWrapper .subNavLabelWrapper,#header .subNavWrapper .subNavLabelWrapper{-webkit-box-ordinal-group:2;-webkit-box-flex:0;-webkit-box-pack:start;border-bottom:1px solid #0073cf;display:-webkit-box;display:flex;flex:none;justify-content:flex-start;order:1;padding:1.875rem 2.25rem 1.875rem 1.875rem;position:relative}#footer .subNavWrapper .subNavLabelWrapper h3,#header .subNavWrapper .subNavLabelWrapper h3{color:#fff;font-weight:300;line-height:.8;margin:0 0 0 .3125rem;padding:0;white-space:normal}}@media (min-width:1200px) and (min-width:0px){#footer .subNavWrapper .subNavLabelWrapper h3,#header .subNavWrapper .subNavLabelWrapper h3{font-size:1.5rem}}@media (min-width:1200px) and (min-width:600px){#footer .subNavWrapper .subNavLabelWrapper h3,#header .subNavWrapper .subNavLabelWrapper h3{font-size:2.25rem}}@media (min-width:1200px){#footer .subNavWrapper .subNavLabelWrapper .subNavClose,#header .subNavWrapper .subNavLabelWrapper .subNavClose{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;left:40px;top:40px}#footer .subNavWrapper .innerSubNavWrapper,#header .subNavWrapper .innerSubNavWrapper{-webkit-box-flex:0;-webkit-box-ordinal-group:3;flex:none;height:100%;order:2;position:relative}#footer .subNavWrapper.depthOne .innerSubNavWrapper:before,#header .subNavWrapper.depthOne .innerSubNavWrapper:before{background:#00235f;border-left:1px solid #0073cf;content:"";height:100%;left:33.3333333333%;position:absolute;top:0;width:100%}#footer .subNavWrapper.depthThree .innerSubNavWrapper:after,#header .subNavWrapper.depthThree .innerSubNavWrapper:after{background:#001c4c;border-left:1px solid #0073cf;content:"";height:100%;position:absolute;right:0;top:0;width:33.3333333333%}#footer nav#block-neon-main-menu ul.menu--main li.over .subNavWrapper,#header nav#block-neon-main-menu ul.menu--main li.over .subNavWrapper{opacity:1;-webkit-transition:opacity .2s ease-in-out;-o-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;visibility:visible;z-index:3}#footer nav#block-neon-main-menu ul.menu--main li.over .subNavWrapper ul[data-depth="1"],#header nav#block-neon-main-menu ul.menu--main li.over .subNavWrapper ul[data-depth="1"]{opacity:1;visibility:visible}#footer nav#block-neon-main-menu ul.menu--main li ul li,#header nav#block-neon-main-menu ul.menu--main li ul li{color:#f5f6f7;display:block}#footer nav#block-neon-main-menu ul.menu--main li ul li a,#header nav#block-neon-main-menu ul.menu--main li ul li a{color:#f5f6f7;display:inline-block;text-decoration:none}#footer nav#block-neon-main-menu ul.menu--main li ul li span,#header nav#block-neon-main-menu ul.menu--main li ul li span{color:#f5f6f7;display:inline-block}#footer nav#block-neon-main-menu ul.menu--main li ul li>ul a,#footer nav#block-neon-main-menu ul.menu--main li ul li>ul li,#footer nav#block-neon-main-menu ul.menu--main li ul li>ul span,#header nav#block-neon-main-menu ul.menu--main li ul li>ul a,#header nav#block-neon-main-menu ul.menu--main li ul li>ul li,#header nav#block-neon-main-menu ul.menu--main li ul li>ul span{font-size:15px}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"],#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]{margin:0;opacity:0;padding:0;position:absolute;top:12px;visibility:hidden;width:33.3%}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li{padding:16px 60px}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:last-child,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:last-child{margin-bottom:0}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable .mini-arrow,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable .mini-arrow{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:3px;height:48px;margin-top:-12px;padding-right:26px;position:absolute;right:0;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out;width:48px}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable .mini-arrow svg,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable .mini-arrow svg{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable.active,#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable:hover,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable.active,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable:hover{-webkit-transition:background-color .25s ease-in-out;-o-transition:background-color .25s ease-in-out;transition:background-color .25s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable.active>a,#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable:hover>a,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable.active>a,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable:hover>a{border-bottom:2px solid #fff;color:#fff;text-shadow:0 0 .65px #fff,0 0 .65px #fff;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable.active,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable.active{background:-webkit-gradient(linear,left bottom,left top,from(rgba(0,115,207,.2)),to(rgba(0,115,207,.2))),#002c77;background:-o-linear-gradient(bottom,rgba(0,115,207,.2),rgba(0,115,207,.2)),#002c77;background:linear-gradient(0deg,rgba(0,115,207,.2),rgba(0,115,207,.2)),#002c77}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li>a,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li>a{border:none;font-size:18px;font-weight:400;line-height:24px;text-decoration:none;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:hover,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:hover{-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:hover>a,#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:hover>span,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:hover>a,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:hover>span{color:#fff;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"],#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"],#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"],#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]{left:calc(108% + 2px);margin:0;opacity:0;padding:0;position:absolute;top:0;-webkit-transition:all .15s ease-in-out;-o-transition:all .15s ease-in-out;transition:all .15s ease-in-out;visibility:hidden;width:100%}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li{margin:0;padding:0}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li.expandable .mini-arrow,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li.expandable .mini-arrow,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li.expandable .mini-arrow,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li.expandable .mini-arrow{margin-top:0}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li>a,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li>a{font-size:15px;font-weight:600;margin:0;padding:25px 60px 12px}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li:not([class])>a,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li:not([class])>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li:not([class])>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li:not([class])>a{padding:22px 60px 20px}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li:not([class]):not(:last-child)>a,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li:not([class]):not(:last-child)>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li:not([class]):not(:last-child)>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li:not([class]):not(:last-child)>a{position:relative}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li:not([class]):not(:last-child)>a:after,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li:not([class]):not(:last-child)>a:after,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li:not([class]):not(:last-child)>a:after,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li:not([class]):not(:last-child)>a:after{background:#004b97;bottom:0;content:"";height:1px;left:60px;position:absolute;width:100%}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"],#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]{border-bottom:1px solid #004b97;margin:0;padding:0}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li{margin:0;padding:0}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li>a{font-size:15px;font-weight:400;margin:0;padding:10px 0 10px 90px;position:relative}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li>a:before,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li>a:before{background:#f5f6f7;content:"";height:1px;left:60px;position:absolute;top:20px;width:10px}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable{-webkit-box-pack:justify;-webkit-box-align:center;align-items:center;cursor:pointer;display:-webkit-box;display:flex;justify-content:space-between}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable button.mini-arrow.focusable,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable button.mini-arrow.focusable{margin:0;position:relative;right:auto}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable.active,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable.active{background:-webkit-gradient(linear,left bottom,left top,from(rgba(0,115,207,.2)),to(rgba(0,115,207,.2))),#002c77;background:-o-linear-gradient(bottom,rgba(0,115,207,.2),rgba(0,115,207,.2)),#002c77;background:linear-gradient(0deg,rgba(0,115,207,.2),rgba(0,115,207,.2)),#002c77}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable.active,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable:hover,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable.active,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable:hover{-webkit-transition:background-color .25s ease-in-out;-o-transition:background-color .25s ease-in-out;transition:background-color .25s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable.active>a,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable:hover>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable.active>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable:hover>a{color:#fff;display:inline-block;text-shadow:0 0 .65px #fff,0 0 .65px #fff;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li:not([class]):after,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li:not([class]):after{display:none}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="4"],#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="4"]{left:calc(100% + 1px);margin:0;opacity:0;padding:0;position:absolute;top:0;-webkit-transition:all .15s ease-in-out;-o-transition:all .15s ease-in-out;transition:all .15s ease-in-out;visibility:hidden;width:100%}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="4"] li a,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="4"] li a{width:100%}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="4"] li.expandable:before,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="4"] li.expandable:before{display:none}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"],#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]{border-bottom:1px solid #004b97;margin:0;padding:0}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li{margin:0;padding:0}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li>a{font-size:15px;font-weight:400;margin:0;padding:10px 0 10px 90px;position:relative;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;width:100%}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li>a:hover,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li>a:hover{text-shadow:0 0 .65px #fff,0 0 .65px #fff;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li>a:before,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li>a:before{background:#f5f6f7;content:"";height:1px;left:60px;position:absolute;top:20px;width:10px}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li:last-child>a:last-child,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li:last-child>a:last-child{padding-bottom:20px;position:relative}#footer nav#block-neon-main-menu ul.menu--main li ul li.active>ul[data-depth="2"],#header nav#block-neon-main-menu ul.menu--main li ul li.active>ul[data-depth="2"]{left:calc(100% + 2px);opacity:1;-webkit-transition:all .15s ease-out;-o-transition:all .15s ease-out;transition:all .15s ease-out;visibility:visible}#footer nav#block-neon-main-menu ul.menu--main li ul li.active ul li.active>ul[data-depth="4"],#header nav#block-neon-main-menu ul.menu--main li ul li.active ul li.active>ul[data-depth="4"]{left:calc(100% + 2px);opacity:1;-webkit-transition:all .15s ease-out;-o-transition:all .15s ease-out;transition:all .15s ease-out;visibility:visible;z-index:1}}#footer .header__search,#header .header__search{background:#f5f6f7;opacity:1;position:relative;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;visibility:visible;z-index:1}#footer .header__search.visually-hidden,#header .header__search.visually-hidden{opacity:0;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;visibility:hidden}@media (min-width:0px) and (max-width:1199.98px){#footer nav#block-neon-main-menu>ul>li.myAccount,#header nav#block-neon-main-menu>ul>li.myAccount{padding:1.5rem 0 0}#footer nav#block-neon-main-menu>ul>li.myAccount a,#header nav#block-neon-main-menu>ul>li.myAccount a{margin:0 auto}}@media (min-width:1200px){#footer #header nav#block-neon-main-menu>ul.menu--main>li,#footer #root nav#block-neon-main-menu>ul.menu--main>li,#footer body:not([class]) nav#block-neon-main-menu>ul.menu--main>li,#header #header nav#block-neon-main-menu>ul.menu--main>li,#header #root nav#block-neon-main-menu>ul.menu--main>li,#header body:not([class]) nav#block-neon-main-menu>ul.menu--main>li{height:100%}}#footer li.myAccount,#header li.myAccount{display:none!important}#footer .ui-widget-overlay,#header .ui-widget-overlay{opacity:.9}#footer .js-media-library-item-preview .field--name-thumbnail img,#header .js-media-library-item-preview .field--name-thumbnail img{width:auto!important}#footer .authContainer,#header .authContainer{border:1px solid #0073cf;position:absolute;text-align:right;z-index:10}#footer .authContainer .openid-connect-login-form form>div,#header .authContainer .openid-connect-login-form form>div{border:none}#footer .authContainer .openid-connect-login-form .form-submit,#header .authContainer .openid-connect-login-form .form-submit{background:none;border:none}@media (max-width:1199.95px){#footer .authContainer,#header .authContainer{border:1px solid #0073cf;right:72px;top:13px}#footer .authContainer .form-submit,#footer .authContainer a,#header .authContainer .form-submit,#header .authContainer a{color:#0073cf!important;display:inline-block;font-family:Inter,Helvetica,Arial,sans-serif!important;font-size:.55rem!important;font-weight:600!important;line-height:1.75!important;padding:5px 10px;text-decoration:none;text-transform:uppercase!important;white-space:nowrap}#footer .authContainer .form-submit:hover,#footer .authContainer a:hover,#header .authContainer .form-submit:hover,#header .authContainer a:hover{text-decoration:underline}#footer .authContainer :first-child,#header .authContainer :first-child{border-right:1px solid;border-top-left-radius:0}#footer .authContainer :last-child,#header .authContainer :last-child{border-bottom-right-radius:0;border-right:none;border-top-right-radius:0}}@media (min-width:1200px){#footer .authContainer,#header .authContainer{border:1px solid #0073cf;padding:0;right:0;top:-1px}#footer .authContainer .form-submit,#footer .authContainer a,#header .authContainer .form-submit,#header .authContainer a{color:#0073cf!important;display:inline-block;font-family:Inter,Helvetica,Arial,sans-serif!important;font-size:.55rem!important;font-weight:600!important;line-height:1.75!important;padding:5px 10px;text-decoration:none;text-transform:uppercase!important;white-space:nowrap}#footer .authContainer .form-submit:hover,#footer .authContainer a:hover,#header .authContainer .form-submit:hover,#header .authContainer a:hover{text-decoration:underline}#footer .authContainer :first-child,#header .authContainer :first-child{border-right:1px solid;border-top-left-radius:0}#footer .authContainer :last-child,#header .authContainer :last-child{border-bottom-right-radius:0;border-right:none;border-top-right-radius:0}}#footer .footer-top__wrapper,#header .footer-top__wrapper{background-color:#352723;color:#e4e6e7}#footer .footer-top__wrapper .footer-top__inner,#header .footer-top__wrapper .footer-top__inner{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:flex;flex-direction:column;padding-bottom:20px;padding-top:30px}@media (min-width:500px){#footer .footer-top__wrapper .footer-top__inner,#header .footer-top__wrapper .footer-top__inner{-webkit-box-pack:justify;-webkit-box-align:center;align-items:center;justify-content:space-between}}@media (min-width:768px){#footer .footer-top__wrapper .footer-top__inner,#header .footer-top__wrapper .footer-top__inner{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}}#footer .footer-top__logo-social,#header .footer-top__logo-social{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-flex:0;display:-webkit-box;display:flex;flex:none;flex-direction:column;margin-bottom:15px;width:auto}@media (min-width:500px){#footer .footer-top__logo-social,#header .footer-top__logo-social{-webkit-box-pack:justify;-webkit-box-align:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;align-items:center;flex-direction:row;justify-content:space-between;margin-bottom:0}}@media (min-width:768px){#footer .footer-top__logo-social,#header .footer-top__logo-social{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;margin-right:30px}}@media (min-width:992px){#footer .footer-top__logo-social,#header .footer-top__logo-social{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}}@media (min-width:1200px){#footer .footer-top__logo-social,#header .footer-top__logo-social{margin-right:60px}}#footer .footer-top__logo,#header .footer-top__logo{margin-bottom:10px}@media (min-width:500px){#footer .footer-top__logo,#header .footer-top__logo{margin-right:30px}}@media (min-width:992px){#footer .footer-top__logo,#header .footer-top__logo{margin-bottom:0}}@media (min-width:1200px){#footer .footer-top__logo,#header .footer-top__logo{margin-right:60px}}@media (min-width:1440px){#footer .footer-top__logo,#header .footer-top__logo{margin-right:80px}}#footer .footer-top__social,#header .footer-top__social{-webkit-box-align:center;align-items:center;display:-webkit-box;display:flex}#footer .footer-top__social h4,#header .footer-top__social h4{color:#e4e6e7;font-size:14px;font-weight:400;line-height:25px;margin:0}#footer .footer-top__social ul,#header .footer-top__social ul{-webkit-box-align:baseline;align-items:baseline;display:-webkit-box;display:flex;margin:0;padding:0}#footer .footer-top__social ul li,#header .footer-top__social ul li{display:block}#footer .footer-top__social ul li svg,#header .footer-top__social ul li svg{fill:#c2deea;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s;width:16px}#footer .footer-top__social ul li a,#header .footer-top__social ul li a{display:block;padding:0 10px}#footer .footer-top__social ul li a:hover svg,#header .footer-top__social ul li a:hover svg{fill:#0073cf;-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s}#footer .footer-top__social ul li.facebook svg,#header .footer-top__social ul li.facebook svg{height:20px}#footer .footer-top__newsletter,#header .footer-top__newsletter{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:flex;flex-direction:column;margin-bottom:15px}@media (min-width:500px){#footer .footer-top__newsletter,#header .footer-top__newsletter{-webkit-box-align:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;align-items:center;flex-direction:row}}#footer .footer-top__newsletter .footer-top__newsletter-text h4,#header .footer-top__newsletter .footer-top__newsletter-text h4{color:#e4e6e7;font-family:Inter,sans-serif;font-weight:400;line-height:25px;margin:0}@media (min-width:600px){#footer .footer-top__newsletter .footer-top__newsletter-text h4,#header .footer-top__newsletter .footer-top__newsletter-text h4{font-size:20px}}#footer .footer-top__newsletter .footer-top__newsletter-text p,#header .footer-top__newsletter .footer-top__newsletter-text p{color:#e4e6e7;font-size:14px;line-height:25px;margin:10px 0 0}#footer .footer-top__newsletter .footer-top__newsletter-btn,#header .footer-top__newsletter .footer-top__newsletter-btn{-webkit-box-flex:0;flex:none;margin-top:20px}@media (min-width:500px){#footer .footer-top__newsletter .footer-top__newsletter-btn,#header .footer-top__newsletter .footer-top__newsletter-btn{margin-left:30px;margin-top:0}}@media (min-width:1440px){#footer .footer-top__newsletter .footer-top__newsletter-btn,#header .footer-top__newsletter .footer-top__newsletter-btn{margin-left:60px}}#footer .footer-top__newsletter .footer-top__newsletter-btn a,#header .footer-top__newsletter .footer-top__newsletter-btn a{border:1px solid #f5f6f7;border-radius:2px;color:#f5f6f7;display:inline-block;font-family:Inter,sans-serif;font-size:12px;font-weight:600;letter-spacing:2.4px;line-height:18px;padding:12px 22px 12px 18px;text-decoration:none;text-transform:uppercase;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .footer-top__newsletter .footer-top__newsletter-btn a svg,#header .footer-top__newsletter .footer-top__newsletter-btn a svg{-webkit-transform:translateX(-4px);-ms-transform:translateX(-4px);transform:translateX(-4px);-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .footer-top__newsletter .footer-top__newsletter-btn a svg .line,#header .footer-top__newsletter .footer-top__newsletter-btn a svg .line{stroke-dasharray:11;stroke-dashoffset:11;-webkit-animation:arrowOut .1s linear forwards;animation:arrowOut .1s linear forwards}#footer .footer-top__newsletter .footer-top__newsletter-btn a:active,#footer .footer-top__newsletter .footer-top__newsletter-btn a:focus,#footer .footer-top__newsletter .footer-top__newsletter-btn a:hover,#header .footer-top__newsletter .footer-top__newsletter-btn a:active,#header .footer-top__newsletter .footer-top__newsletter-btn a:focus,#header .footer-top__newsletter .footer-top__newsletter-btn a:hover{background-color:#fff;border:1px solid #fff;color:#352723;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .footer-top__newsletter .footer-top__newsletter-btn a:active svg,#footer .footer-top__newsletter .footer-top__newsletter-btn a:focus svg,#footer .footer-top__newsletter .footer-top__newsletter-btn a:hover svg,#header .footer-top__newsletter .footer-top__newsletter-btn a:active svg,#header .footer-top__newsletter .footer-top__newsletter-btn a:focus svg,#header .footer-top__newsletter .footer-top__newsletter-btn a:hover svg{-webkit-transform:translateX(6px);-ms-transform:translateX(6px);transform:translateX(6px);-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .footer-top__newsletter .footer-top__newsletter-btn a:active svg .line,#footer .footer-top__newsletter .footer-top__newsletter-btn a:focus svg .line,#footer .footer-top__newsletter .footer-top__newsletter-btn a:hover svg .line,#header .footer-top__newsletter .footer-top__newsletter-btn a:active svg .line,#header .footer-top__newsletter .footer-top__newsletter-btn a:focus svg .line,#header .footer-top__newsletter .footer-top__newsletter-btn a:hover svg .line{-webkit-animation:arrowIn .15s linear forwards;animation:arrowIn .15s linear forwards}#footer .footer-top__newsletter .footer-top__newsletter-btn a:active svg path,#footer .footer-top__newsletter .footer-top__newsletter-btn a:focus svg path,#footer .footer-top__newsletter .footer-top__newsletter-btn a:hover svg path,#header .footer-top__newsletter .footer-top__newsletter-btn a:active svg path,#header .footer-top__newsletter .footer-top__newsletter-btn a:focus svg path,#header .footer-top__newsletter .footer-top__newsletter-btn a:hover svg path{stroke:#352723}@-webkit-keyframes arrowIn{0%{stroke-dashoffset:11}to{stroke-dashoffset:0}}@keyframes arrowIn{0%{stroke-dashoffset:11}to{stroke-dashoffset:0}}@-webkit-keyframes arrowOut{0%{stroke-dashoffset:0}to{stroke-dashoffset:11}}@keyframes arrowOut{0%{stroke-dashoffset:0}to{stroke-dashoffset:11}}#footer .footer-bottom__wrapper,#header .footer-bottom__wrapper{background:#4b372e url(https://www.neonscience.org/themes/custom/neon/images/footer_bottom_rip.png) repeat-x top;color:#fff;padding-top:30px}#footer .footer-bottom__wrapper .footer-bottom__inner,#header .footer-bottom__wrapper .footer-bottom__inner{-webkit-box-pack:justify;justify-content:space-between;padding-bottom:55px;padding-top:30px}@media (min-width:992px){#footer .footer-bottom__wrapper .footer-bottom__inner,#header .footer-bottom__wrapper .footer-bottom__inner{display:-webkit-box;display:flex;flex-wrap:wrap}}#footer #block-footer .menu--footer,#header #block-footer .menu--footer{-webkit-box-pack:start;-webkit-box-align:center;align-items:center;display:-webkit-box;display:flex;flex-wrap:wrap;justify-content:flex-start;margin:0 0 35px;padding:0}#footer #block-footer .menu--footer li,#header #block-footer .menu--footer li{display:block;margin-right:30px}#footer #block-footer .menu--footer li:last-child,#header #block-footer .menu--footer li:last-child{margin-right:0}#footer #block-footer .menu--footer li a,#header #block-footer .menu--footer li a{border-bottom:1px solid #c2deea;color:#c2deea;font-size:14px;font-weight:600;line-height:25px;text-decoration:none;-webkit-transition:all .25s ease;-o-transition:all .25s ease;transition:all .25s ease}#footer #block-footer .menu--footer li a:hover,#header #block-footer .menu--footer li a:hover{border-bottom:none;color:#fff;-webkit-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease}#footer #block-footer .menu--footer li.myAccount,#header #block-footer .menu--footer li.myAccount{-webkit-box-flex:0;flex:none;margin:0 0 25px;width:100%}#footer #block-footer .menu--footer li.myAccount a,#header #block-footer .menu--footer li.myAccount a{background:#e4e6e7;border:1px solid #e4e6e7;border-radius:2px;color:#565a5c;font-size:12px;font-weight:600;letter-spacing:1.2px;padding:6px 12px;text-decoration:none;text-transform:uppercase;-webkit-transition:all .25s ease;-o-transition:all .25s ease;transition:all .25s ease}#footer #block-footer .menu--footer li.myAccount a:hover,#header #block-footer .menu--footer li.myAccount a:hover{background:#fff;border:1px solid #fff;color:#0073cf;-webkit-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease}@media (min-width:768px){#footer #block-footer .menu--footer li.myAccount,#header #block-footer .menu--footer li.myAccount{margin:0 30px 0 0;width:auto}}@media (min-width:992px){#footer #block-footer .menu--footer,#header #block-footer .menu--footer{margin:0}}#footer .footer-bottom__copyright p,#header .footer-bottom__copyright p{color:#fff;font-size:14px;line-height:25px;margin:0}#footer .footer-bottom__message,#header .footer-bottom__message{-webkit-box-flex:0;flex:none;margin:30px 0 0;width:100%}#footer .footer-bottom__message p,#header .footer-bottom__message p{color:#fff;font-size:14px;line-height:25px;margin:0 0 10px}#footer .footer-bottom__message p:last-child,#header .footer-bottom__message p:last-child{margin:0} +@charset "UTF-8";#footer,#header{color:#141516;font-family:Inter,sans-serif}#footer,#footer html,#header,#header html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#footer html,#header html{font-family:sans-serif}#footer body,#header body{margin:0}#footer article,#footer aside,#footer details,#footer figcaption,#footer figure,#footer footer,#footer header,#footer hgroup,#footer main,#footer nav,#footer section,#footer summary,#header article,#header aside,#header details,#header figcaption,#header figure,#header footer,#header header,#header hgroup,#header main,#header nav,#header section,#header summary{display:block}#footer audio,#footer canvas,#footer progress,#footer video,#header audio,#header canvas,#header progress,#header video{display:inline-block;vertical-align:baseline}#footer audio:not([controls]),#header audio:not([controls]){display:none;height:0}#footer [hidden],#footer template,#header [hidden],#header template{display:none}#footer a,#header a{background:transparent}#footer a:active,#footer a:hover,#header a:active,#header a:hover{outline:0}#footer abbr[title],#header abbr[title]{border-bottom:1px dotted}#footer b,#footer strong,#header b,#header strong{font-weight:700}#footer dfn,#header dfn{font-style:italic}#footer mark,#header mark{background:#ff0;color:#000}#footer small,#header small{font-size:80%}#footer sub,#footer sup,#header sub,#header sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}#footer sup,#header sup{top:-.5em}#footer sub,#header sub{bottom:-.25em}#footer img,#header img{border:0}#footer svg:not(:root),#header svg:not(:root){overflow:hidden}#footer hr,#header hr{-webkit-box-sizing:border-box;box-sizing:border-box;height:0}#footer pre,#header pre{overflow:auto;white-space:pre-wrap;word-break:break-all}#footer code,#footer kbd,#footer pre,#footer samp,#header code,#header kbd,#header pre,#header samp{font-family:monospace,monospace}#footer table,#header table{border-collapse:collapse;border-spacing:0}#footer td,#footer th,#header td,#header th{padding:0}#footer .hidden,#header .hidden{display:none}#footer .visually-hidden,#header .visually-hidden{overflow:hidden;position:absolute!important;clip:rect(1px,1px,1px,1px);height:1px;width:1px;word-wrap:normal}#footer .visually-hidden.focusable:active,#footer .visually-hidden.focusable:focus,#header .visually-hidden.focusable:active,#header .visually-hidden.focusable:focus{overflow:visible;position:static!important;clip:auto;height:auto;width:auto}#footer .invisible,#header .invisible{visibility:hidden}@media (min-width:0px) and (max-width:1199.98px){#footer .isDesktop,#header .isDesktop{display:none!important}}@media (min-width:992px){#footer .isDesktop,#header .isDesktop{display:inherit}}@media (min-width:0px) and (max-width:1199.98px){#footer .isMobile,#header .isMobile{display:inherit}}@media (min-width:1200px){#footer .isMobile,#header .isMobile{display:none!important}}@media (min-width:0px) and (max-width:1199.98px){#footer .hiddenDesktop,#header .hiddenDesktop{display:inherit}}@media (min-width:1200px){#footer .hiddenDesktop,#header .hiddenDesktop{background:none!important;opacity:0!important;visibility:hidden!important}}@font-face{#footer,#header{font-display:swap;font-family:Inter;font-style:normal;font-style:italic;font-weight:100;font-weight:200;font-weight:300;font-weight:400;font-weight:500;font-weight:600;font-weight:700;font-weight:800;font-weight:900}}#footer *,#footer :after,#footer :before,#header *,#header :after,#header :before{-webkit-box-sizing:border-box;box-sizing:border-box}#footer html,#header html{font-size:100%}#footer body,#header body{background:#fff!important;color:#141516;font-family:Inter,sans-serif;-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";overflow-x:hidden}@media (min-width:0px){#footer body,#header body{font-size:1.125rem}}@media (min-width:600px){#footer body,#header body{font-size:1.25rem}}#footer :focus,#header :focus{outline:1px dashed rgba(253,196,0,.6)}#footer :active,#header :active{outline:0}#footer h1,#header h1{color:#000;font-family:Inter,sans-serif;-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";font-weight:400;line-height:1;margin:1em 0}@media (min-width:0px){#footer h1,#header h1{font-size:2.125rem}}@media (min-width:600px){#footer h1,#header h1{font-size:3.375rem}}#footer h2,#header h2{color:#000;font-family:Inter,sans-serif;-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";font-weight:400;line-height:1;margin:1em 0}@media (min-width:0px){#footer h2,#header h2{font-size:1.375rem}}@media (min-width:600px){#footer h2,#header h2{font-size:1.875rem}}#footer h3,#header h3{color:#000;font-family:Inter,sans-serif;-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";font-weight:400;margin:1em 0}@media (min-width:0px){#footer h3,#header h3{font-size:1.25rem}}@media (min-width:600px){#footer h3,#header h3{font-size:1.5rem}}#footer h4,#header h4{color:#000;font-family:Inter,sans-serif;-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";font-weight:400;line-height:1;margin:1em 0}@media (min-width:0px){#footer h4,#header h4{font-size:1.125rem}}@media (min-width:600px){#footer h4,#header h4{font-size:1.25rem}}#footer h5,#header h5{color:#000;font-family:Inter,sans-serif;-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";font-weight:400;line-height:1;margin:1em 0}@media (min-width:0px){#footer h5,#header h5{font-size:1rem}}@media (min-width:600px){#footer h5,#header h5{font-size:1.125rem}}#footer h6,#header h6{color:#000;font-family:Inter,sans-serif;-webkit-font-feature-settings:"ss01","ss03","ss04";font-feature-settings:"ss01","ss03","ss04";font-weight:400;line-height:1;margin:1em 0}@media (min-width:0px){#footer h6,#header h6{font-size:.9375rem}}@media (min-width:600px){#footer h6,#header h6{font-size:1rem}}#footer body.page-node-type-page .layout-content h1,#header body.page-node-type-page .layout-content h1{margin:0 0 1.875rem}@media (min-width:768px){#footer body.page-node-type-page .layout-content h1,#header body.page-node-type-page .layout-content h1{margin:0 0 3.75rem}}#footer body.page-node-type-update .layout-content h1,#header body.page-node-type-update .layout-content h1{margin:0 0 1.125rem}@media (min-width:768px){#footer body.page-node-type-update .layout-content h1,#header body.page-node-type-update .layout-content h1{margin:0 0 1.5rem}}#footer p,#header p{color:#000;line-height:1.6;margin:1em 0}@media (min-width:0px){#footer p,#header p{font-size:1rem}}@media (min-width:600px){#footer p,#header p{font-size:1.125rem}}#footer blockquote:not([class]),#header blockquote:not([class]){border-left:6px solid #0073cf;margin:2rem 0;padding-left:1.5rem}@media (min-width:992px){#footer blockquote:not([class]),#header blockquote:not([class]){margin:4rem 0;padding-left:3.5rem}}#footer blockquote:not([class]),#footer blockquote:not([class]) p,#header blockquote:not([class]),#header blockquote:not([class]) p{color:#000!important;font-size:1.125rem;font-style:italic}@media (min-width:992px){#footer blockquote:not([class]),#footer blockquote:not([class]) p,#header blockquote:not([class]),#header blockquote:not([class]) p{font-size:1.3125rem}}#footer main dl:not([class]),#footer main ol:not([class]),#footer main ul:not([class]),#header main dl:not([class]),#header main ol:not([class]),#header main ul:not([class]){margin:1.25rem 0;padding-left:40px}#footer main li:not([class]),#header main li:not([class]){color:#565a5c;display:block;line-height:1.6;margin-bottom:.625rem;position:relative}@media (min-width:0px){#footer main li:not([class]),#header main li:not([class]){font-size:1rem}}@media (min-width:600px){#footer main li:not([class]),#header main li:not([class]){font-size:1.125rem}}#footer main li:not([class]):last-child,#header main li:not([class]):last-child{margin-bottom:0}#footer main ul li:not([class]):after,#header main ul li:not([class]):after{color:#558807;content:"•";display:block;left:-25px;position:absolute;top:0}#footer main ul li:not([class]) ul,#header main ul li:not([class]) ul{margin:.625rem 0}#footer main ol:not([class]),#header main ol:not([class]){counter-reset:item}#footer main ol:not([class]) li:not([class]):before,#header main ol:not([class]) li:not([class]):before{color:#558807;content:counter(item) ". ";counter-increment:item;left:-30px;position:absolute;top:0}#footer dt,#header dt{font-weight:600}#footer a:not([class]),#header a:not([class]){color:#0073cf}#footer a:not([class]):active,#footer a:not([class]):focus,#footer a:not([class]):hover,#header a:not([class]):active,#header a:not([class]):focus,#header a:not([class]):hover{color:#0092e2}h1>#footer a:not([class]),h1>#header a:not([class]),h2>#footer a:not([class]),h2>#header a:not([class]),h3>#footer a:not([class]),h3>#header a:not([class]),h4>#footer a:not([class]),h4>#header a:not([class]),h5>#footer a:not([class]),h5>#header a:not([class]),h6>#footer a:not([class]),h6>#header a:not([class]){text-decoration:none}@media (min-width:0px) and (max-width:767.98px){#footer a:not([class]),#header a:not([class]){word-wrap:break-word;word-break:break-all}}#footer hr:not([class]),#header hr:not([class]){border:0;border-bottom:1px solid #e4e6e7}#footer img,#header img{display:block;height:auto;max-width:100%}#footer figure:not([class]),#header figure:not([class]){margin:0}#footer figure:not([class]) img,#header figure:not([class]) img{display:block}#footer figcaption,#header figcaption{margin:1em 0}#footer div.responsive--video,#footer p.responsive--video,#header div.responsive--video,#header p.responsive--video{display:block;margin:2.5rem 0 0;max-width:560px;position:relative;width:100%}#footer div.responsive--video iframe,#footer p.responsive--video iframe,#header div.responsive--video iframe,#header p.responsive--video iframe{border:0;left:0;top:0;width:100%}#footer .video-embed-field-responsive-video:after,#header .video-embed-field-responsive-video:after{display:none}#footer .toolbar .toolbar-bar,#header .toolbar .toolbar-bar{z-index:100!important}#footer .ui-autocomplete,#header .ui-autocomplete{z-index:102}#footer .jumpmenu__heading a,#header .jumpmenu__heading a{font-weight:500;text-decoration:none}@media (min-width:0px){#footer .jumpmenu__heading a,#header .jumpmenu__heading a{font-size:.75rem}}@media (min-width:600px){#footer .jumpmenu__heading a,#header .jumpmenu__heading a{font-size:.8125rem}}#footer .jumpmenu__heading a.is-active,#header .jumpmenu__heading a.is-active{color:#565a5c;text-decoration:none}#footer .jumpmenu__heading a:active,#footer .jumpmenu__heading a:focus,#footer .jumpmenu__heading a:hover,#header .jumpmenu__heading a:active,#header .jumpmenu__heading a:focus,#header .jumpmenu__heading a:hover{color:#0092e2;text-decoration:underline}#footer .jumpmenu__heading a:visited,#header .jumpmenu__heading a:visited{color:#0073cf;text-decoration:none}#footer .jumpmenu__heading a:visited.is-active,#header .jumpmenu__heading a:visited.is-active{color:#565a5c}#footer .layout,#header .layout{padding:2.5rem 7.4074074074%}@media (min-width:1200px){#footer .layout,#header .layout{padding:3.75rem 7.4074074074%}}@media (min-width:1620px){#footer .layout,#header .layout{padding:3.75rem 0}}#footer body.path-frontpage .layout,#header body.path-frontpage .layout{padding:2.5rem 7.4074074074%}#footer .layout-wide,#header .layout-wide{padding:0}#footer .l--constrained,#header .l--constrained{-webkit-box-sizing:border-box;box-sizing:border-box;margin-left:auto;margin-right:auto;max-width:1380px}#footer .l--narrow,#header .l--narrow{margin-left:auto;margin-right:auto;max-width:960px;width:100%}#footer .l--gutters,#header .l--gutters{padding-left:60px;padding-right:60px}#footer .l--offset-wide,#header .l--offset-wide{margin:0 auto;max-width:1620px;padding:0 3.125rem 0 2.25rem}#footer .sidebar .l--offset-wide,#header .sidebar .l--offset-wide{padding:0 2.25rem}@media (min-width:992px){#footer .sidebar .l--offset-wide,#header .sidebar .l--offset-wide{padding:0}}@media (min-width:1200px){#footer .sidebar .l--offset-wide,#header .sidebar .l--offset-wide{padding:0}}#footer .sidebar .page-content--wrapper .l--offset-wide,#header .sidebar .page-content--wrapper .l--offset-wide{padding:0}#footer body.page-node-type-page .l--offset-wide.page__default--withSidebar-wrapper .l--constrained,#header body.page-node-type-page .l--offset-wide.page__default--withSidebar-wrapper .l--constrained{-webkit-box-sizing:border-box;box-sizing:border-box;max-width:1620px;padding:0 3.125rem 0 2.25rem;width:100%}#footer .l--offset-full,#header .l--offset-full{margin:0 auto;max-width:1620px}#footer .l--offset,#header .l--offset{padding-left:7.4074074074%;padding-right:7.4074074074%}@media (min-width:1620px){#footer .l--offset,#header .l--offset{padding-left:120px;padding-right:120px}}#footer .l--padded,#header .l--padded{padding-bottom:60px;padding-top:60px}#footer .l--vertical-spacing,#header .l--vertical-spacing{margin:2.5rem 0;width:100%}@media (min-width:1200px){#footer .l--vertical-spacing,#header .l--vertical-spacing{margin:3.75rem 0}}#footer .l--wrapper,#header .l--wrapper{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media (min-width:992px){#footer .l--wrapper,#header .l--wrapper{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}#footer .l--wrapper .layout-sidebar,#header .l--wrapper .layout-sidebar{width:300px;-webkit-box-flex:0;flex:none;-webkit-box-ordinal-group:2;order:1}}#footer .l--wrapper .layout-sidebar .sidebar--wrapper,#header .l--wrapper .layout-sidebar .sidebar--wrapper{margin:1.875rem}@media (min-width:992px){#footer .l--wrapper .layout-sidebar .sidebar--wrapper,#header .l--wrapper .layout-sidebar .sidebar--wrapper{margin:1.875rem}}#footer .l--wrapper .page-content--wrapper,#header .l--wrapper .page-content--wrapper{-webkit-box-ordinal-group:3;order:2;padding:1.875rem 0}@media (min-width:992px){#footer .l--wrapper .page-content--wrapper,#header .l--wrapper .page-content--wrapper{-webkit-box-flex:1;flex:1;padding:4.875rem 1.875rem 3.75rem 3.75rem}}@media (min-width:1200px){#footer .l--wrapper .page-content--wrapper,#header .l--wrapper .page-content--wrapper{-webkit-box-flex:1;flex:1;padding:4.875rem 1.875rem 3.75rem 3.75rem}}@media (min-width:1440px){#footer .l--wrapper .page-content--wrapper,#header .l--wrapper .page-content--wrapper{-webkit-box-flex:1;flex:1;padding:4.875rem 1.875rem 4.5rem 7.5rem}}#footer .l--2col-wrapper,#header .l--2col-wrapper{width:100%}@media (min-width:992px){#footer .l--2col-wrapper,#header .l--2col-wrapper{display:-webkit-box;display:flex}}#footer .l--2col-wrapper .page-content--main-content,#header .l--2col-wrapper .page-content--main-content{-webkit-box-ordinal-group:2;order:1;-webkit-box-flex:1;flex:1}#footer .l--2col-wrapper .page-content--secondary,#header .l--2col-wrapper .page-content--secondary{border-top:1px solid #d7d9d9;margin-top:1.875rem;padding-top:1.875rem}@media (min-width:992px){#footer .l--2col-wrapper .page-content--secondary,#header .l--2col-wrapper .page-content--secondary{border-top:none;margin-left:3.75rem;margin-top:0;padding-top:0;width:180px;-webkit-box-flex:0;flex:none;-webkit-box-ordinal-group:3;order:2}}@media (min-width:1200px){#footer .l--2col-wrapper .page-content--secondary,#header .l--2col-wrapper .page-content--secondary{margin-left:7.5rem;width:240px}}#footer .l--2col-wrapper .layout,#header .l--2col-wrapper .layout{padding-top:0}#footer .l--1col-wrapper,#header .l--1col-wrapper{width:100%}#footer .sticky,#header .sticky{margin-bottom:0;position:static}@media (min-width:992px){#footer .sticky,#header .sticky{margin-bottom:3.75rem;position:sticky;top:0}}#footer body.page-node-type-page .page-landing-page .paragraph--type--section:first-of-type .layout:first-of-type,#header body.page-node-type-page .page-landing-page .paragraph--type--section:first-of-type .layout:first-of-type{padding-top:0}#footer body.page-node-type-page .page-full .page__default--content .layout.default-layout,#footer main>.sidebar .paragraph--type--section .layout,#header body.page-node-type-page .page-full .page__default--content .layout.default-layout,#header main>.sidebar .paragraph--type--section .layout{padding-left:0;padding-right:0}#footer .l--layout-onecolumn-contained .l--constrained,#header .l--layout-onecolumn-contained .l--constrained{max-width:100%}#footer body.page-node-type-page h1.page__default--title,#header body.page-node-type-page h1.page__default--title{margin-bottom:0}#footer body.page-node-type-page .page__default--body p,#footer body.page-node-type-update .page__default--body p,#header body.page-node-type-page .page__default--body p,#header body.page-node-type-update .page__default--body p{color:#565a5c}#footer body.page-node-type-page .field--name-body>p.intro-style:first-of-type,#footer body.page-node-type-page .page__default--body>p.intro-style:first-of-type,#footer body.page-node-type-update .field--name-body>p.intro-style:first-of-type,#footer body.page-node-type-update .page__default--body>p.intro-style:first-of-type,#header body.page-node-type-page .field--name-body>p.intro-style:first-of-type,#header body.page-node-type-page .page__default--body>p.intro-style:first-of-type,#header body.page-node-type-update .field--name-body>p.intro-style:first-of-type,#header body.page-node-type-update .page__default--body>p.intro-style:first-of-type{margin-top:0}#footer body.page-node-type-page .field--name-body>p.intro-style,#footer body.page-node-type-page .page__default--body>p.intro-style,#footer body.page-node-type-update .field--name-body>p.intro-style,#footer body.page-node-type-update .page__default--body>p.intro-style,#header body.page-node-type-page .field--name-body>p.intro-style,#header body.page-node-type-page .page__default--body>p.intro-style,#header body.page-node-type-update .field--name-body>p.intro-style,#header body.page-node-type-update .page__default--body>p.intro-style{color:#141516;line-height:1.75}@media (min-width:0px){#footer body.page-node-type-page .field--name-body>p.intro-style,#footer body.page-node-type-page .page__default--body>p.intro-style,#footer body.page-node-type-update .field--name-body>p.intro-style,#footer body.page-node-type-update .page__default--body>p.intro-style,#header body.page-node-type-page .field--name-body>p.intro-style,#header body.page-node-type-page .page__default--body>p.intro-style,#header body.page-node-type-update .field--name-body>p.intro-style,#header body.page-node-type-update .page__default--body>p.intro-style{font-size:1.1875rem}}@media (min-width:600px){#footer body.page-node-type-page .field--name-body>p.intro-style,#footer body.page-node-type-page .page__default--body>p.intro-style,#footer body.page-node-type-update .field--name-body>p.intro-style,#footer body.page-node-type-update .page__default--body>p.intro-style,#header body.page-node-type-page .field--name-body>p.intro-style,#header body.page-node-type-page .page__default--body>p.intro-style,#header body.page-node-type-update .field--name-body>p.intro-style,#header body.page-node-type-update .page__default--body>p.intro-style{font-size:1.3125rem}}#footer .field--name-body>.embed:first-child figure,#header .field--name-body>.embed:first-child figure{margin-top:0}#footer .align-left,#header .align-left{float:none;margin:1.875rem 0}@media (min-width:768px){#footer .align-left,#header .align-left{float:left;margin:0 3.75rem 1.875rem 0;max-width:45%}}#footer .align-right,#header .align-right{float:none;margin:1.875rem 0}@media (min-width:768px){#footer .align-right,#header .align-right{float:right;margin:0 0 1.875rem 3.75rem;max-width:45%}}#footer .align-center,#header .align-center{display:block;margin:1.875rem 0}#footer figure,#header figure{margin:0}#footer figure img,#header figure img{width:100%}#footer figure .field--name-field-caption,#footer figure figcaption,#header figure .field--name-field-caption,#header figure figcaption{background:#f5f6f7;border-radius:0 0 6px 6px;color:#565a5c;font-size:15px;margin:0;padding:1.125rem 1.875rem}#footer figure .field--name-field-caption p,#footer figure figcaption p,#header figure .field--name-field-caption p,#header figure figcaption p{background:#f5f6f7;border-radius:0 0 6px 6px;font-size:15px;margin:0;padding:0}#footer article>figcaption,#header article>figcaption{margin:0}#footer article>figcaption p,#header article>figcaption p{background:#f5f6f7;border-radius:0 0 6px 6px;color:#565a5c;font-size:15px;margin:0;padding:1.125rem 1.875rem}#footer .field.field--type-image img,#header .field.field--type-image img{width:100%}#footer .field.field--type-image,#header .field.field--type-image{margin-bottom:0}#footer .field.field--type-image .field__item,#header .field.field--type-image .field__item{margin:0}#footer .field.field--name-thumbnail img,#header .field.field--name-thumbnail img{width:auto}#footer input[type=file],#header input[type=file]{height:inherit}#footer input[type=checkbox]:not(.nav-trigger),#header input[type=checkbox]:not(.nav-trigger){height:auto}#footer label,#footer legend,#header label,#header legend{margin:1em 0}#footer select,#header select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#f7f6f7;border-color:#c3c1c3;border-radius:0;height:2.1875rem;padding:0 10px;text-indent:.01px;-o-text-overflow:"";text-overflow:""}#footer select::-ms-expand,#header select::-ms-expand{display:none}#footer button::-moz-focus-inner,#footer input::-moz-focus-inner,#header button::-moz-focus-inner,#header input::-moz-focus-inner{border:0;padding:0}#footer input,#header input{line-height:normal}#footer input[type=checkbox]:not(.nav-trigger),#footer input[type=radio],#header input[type=checkbox]:not(.nav-trigger),#header input[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}#footer input[type=number]::-webkit-inner-spin-button,#footer input[type=number]::-webkit-outer-spin-button,#header input[type=number]::-webkit-inner-spin-button,#header input[type=number]::-webkit-outer-spin-button{height:auto}#footer input[type=search],#header input[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:border-box;box-sizing:border-box}#footer input[type=search]::-webkit-search-cancel-button,#footer input[type=search]::-webkit-search-decoration,#header input[type=search]::-webkit-search-cancel-button,#header input[type=search]::-webkit-search-decoration{-webkit-appearance:none}#footer fieldset,#header fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}#footer legend,#header legend{border:0;padding:0}#footer textarea,#header textarea{overflow:auto}#footer button,#footer input,#footer optgroup,#footer select,#footer textarea,#header button,#header input,#header optgroup,#header select,#header textarea{color:inherit;font:inherit;margin:0}#footer button,#header button{overflow:visible}#footer button,#footer select,#header button,#header select{text-transform:none}#footer button,#footer html input[type=button],#footer input[type=reset],#footer input[type=submit],#header button,#header html input[type=button],#header input[type=reset],#header input[type=submit]{-webkit-appearance:button;cursor:pointer}#footer button[disabled],#footer html input[disabled],#header button[disabled],#header html input[disabled]{cursor:default}#footer optgroup,#header optgroup{font-weight:700}#footer .form-item,#header .form-item{margin:1em 0}#footer .field,#header .field{margin-bottom:2em}#footer .field:last-child,#header .field:last-child{margin-bottom:0}#footer .field__label,#header .field__label{font-weight:700}#footer .views-field.views-field-entity-browser-select,#header .views-field.views-field-entity-browser-select{padding-bottom:0;padding-top:0}#footer .views-field.views-field-entity-browser-select .form-item,#header .views-field.views-field-entity-browser-select .form-item{margin:0}#footer .views-field.views-field-entity-browser-select .visually-hidden,#header .views-field.views-field-entity-browser-select .visually-hidden{margin:10px 0 0 -8px;padding:0}#footer .form-item label,#header .form-item label{color:#000;display:block;font-weight:600;margin-bottom:.375rem}@media (min-width:0px){#footer .form-item label,#header .form-item label{font-size:.9375rem}}@media (min-width:600px){#footer .form-item label,#header .form-item label{font-size:1rem}}#footer input[type=date]:not(.MuiInputBase-input),#footer input[type=email]:not(.MuiInputBase-input),#footer input[type=number]:not(.MuiInputBase-input),#footer input[type=password]:not(.MuiInputBase-input),#footer input[type=text]:not(.MuiInputBase-input),#footer input[type=time]:not(.MuiInputBase-input),#header input[type=date]:not(.MuiInputBase-input),#header input[type=email]:not(.MuiInputBase-input),#header input[type=number]:not(.MuiInputBase-input),#header input[type=password]:not(.MuiInputBase-input),#header input[type=text]:not(.MuiInputBase-input),#header input[type=time]:not(.MuiInputBase-input){border:1px solid #d7d9d9;border-radius:2px;-webkit-box-shadow:inset 0 1px 0 #7c7f80;box-shadow:inset 0 1px 0 #7c7f80;color:#000;font-weight:400;height:3rem;padding:.75rem 1.125rem;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer input[type=date]:not(.MuiInputBase-input):not(.form-autocomplete),#footer input[type=email]:not(.MuiInputBase-input):not(.form-autocomplete),#footer input[type=number]:not(.MuiInputBase-input):not(.form-autocomplete),#footer input[type=password]:not(.MuiInputBase-input):not(.form-autocomplete),#footer input[type=text]:not(.MuiInputBase-input):not(.form-autocomplete),#footer input[type=time]:not(.MuiInputBase-input):not(.form-autocomplete),#header input[type=date]:not(.MuiInputBase-input):not(.form-autocomplete),#header input[type=email]:not(.MuiInputBase-input):not(.form-autocomplete),#header input[type=number]:not(.MuiInputBase-input):not(.form-autocomplete),#header input[type=password]:not(.MuiInputBase-input):not(.form-autocomplete),#header input[type=text]:not(.MuiInputBase-input):not(.form-autocomplete),#header input[type=time]:not(.MuiInputBase-input):not(.form-autocomplete){background:#fff}@media (min-width:0px){#footer input[type=date]:not(.MuiInputBase-input),#footer input[type=email]:not(.MuiInputBase-input),#footer input[type=number]:not(.MuiInputBase-input),#footer input[type=password]:not(.MuiInputBase-input),#footer input[type=text]:not(.MuiInputBase-input),#footer input[type=time]:not(.MuiInputBase-input),#header input[type=date]:not(.MuiInputBase-input),#header input[type=email]:not(.MuiInputBase-input),#header input[type=number]:not(.MuiInputBase-input),#header input[type=password]:not(.MuiInputBase-input),#header input[type=text]:not(.MuiInputBase-input),#header input[type=time]:not(.MuiInputBase-input){font-size:.9375rem}}@media (min-width:600px){#footer input[type=date]:not(.MuiInputBase-input),#footer input[type=email]:not(.MuiInputBase-input),#footer input[type=number]:not(.MuiInputBase-input),#footer input[type=password]:not(.MuiInputBase-input),#footer input[type=text]:not(.MuiInputBase-input),#footer input[type=time]:not(.MuiInputBase-input),#header input[type=date]:not(.MuiInputBase-input),#header input[type=email]:not(.MuiInputBase-input),#header input[type=number]:not(.MuiInputBase-input),#header input[type=password]:not(.MuiInputBase-input),#header input[type=text]:not(.MuiInputBase-input),#header input[type=time]:not(.MuiInputBase-input){font-size:1rem}}#footer input[type=date]:not(.MuiInputBase-input):hover,#footer input[type=email]:not(.MuiInputBase-input):hover,#footer input[type=number]:not(.MuiInputBase-input):hover,#footer input[type=password]:not(.MuiInputBase-input):hover,#footer input[type=text]:not(.MuiInputBase-input):hover,#footer input[type=time]:not(.MuiInputBase-input):hover,#header input[type=date]:not(.MuiInputBase-input):hover,#header input[type=email]:not(.MuiInputBase-input):hover,#header input[type=number]:not(.MuiInputBase-input):hover,#header input[type=password]:not(.MuiInputBase-input):hover,#header input[type=text]:not(.MuiInputBase-input):hover,#header input[type=time]:not(.MuiInputBase-input):hover{border:1px solid #0073cf!important;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer input[type=date]:not(.MuiInputBase-input):active,#footer input[type=date]:not(.MuiInputBase-input):focus,#footer input[type=email]:not(.MuiInputBase-input):active,#footer input[type=email]:not(.MuiInputBase-input):focus,#footer input[type=number]:not(.MuiInputBase-input):active,#footer input[type=number]:not(.MuiInputBase-input):focus,#footer input[type=password]:not(.MuiInputBase-input):active,#footer input[type=password]:not(.MuiInputBase-input):focus,#footer input[type=text]:not(.MuiInputBase-input):active,#footer input[type=text]:not(.MuiInputBase-input):focus,#footer input[type=time]:not(.MuiInputBase-input):active,#footer input[type=time]:not(.MuiInputBase-input):focus,#header input[type=date]:not(.MuiInputBase-input):active,#header input[type=date]:not(.MuiInputBase-input):focus,#header input[type=email]:not(.MuiInputBase-input):active,#header input[type=email]:not(.MuiInputBase-input):focus,#header input[type=number]:not(.MuiInputBase-input):active,#header input[type=number]:not(.MuiInputBase-input):focus,#header input[type=password]:not(.MuiInputBase-input):active,#header input[type=password]:not(.MuiInputBase-input):focus,#header input[type=text]:not(.MuiInputBase-input):active,#header input[type=text]:not(.MuiInputBase-input):focus,#header input[type=time]:not(.MuiInputBase-input):active,#header input[type=time]:not(.MuiInputBase-input):focus{border:1px solid #0073cf!important;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4;outline:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer input[type=date]:not(.MuiInputBase-input):disabled,#footer input[type=email]:not(.MuiInputBase-input):disabled,#footer input[type=number]:not(.MuiInputBase-input):disabled,#footer input[type=password]:not(.MuiInputBase-input):disabled,#footer input[type=text]:not(.MuiInputBase-input):disabled,#footer input[type=time]:not(.MuiInputBase-input):disabled,#header input[type=date]:not(.MuiInputBase-input):disabled,#header input[type=email]:not(.MuiInputBase-input):disabled,#header input[type=number]:not(.MuiInputBase-input):disabled,#header input[type=password]:not(.MuiInputBase-input):disabled,#header input[type=text]:not(.MuiInputBase-input):disabled,#header input[type=time]:not(.MuiInputBase-input):disabled{background:#f5f6f7;border:1px solid #d7d9d9;-webkit-box-shadow:inset 0 1px 0 #7c7f80;box-shadow:inset 0 1px 0 #7c7f80;-webkit-box-sizing:border-box;box-sizing:border-box;color:#a2a4a3}#footer .time-start,#header .time-start{display:-webkit-box;display:flex}#footer textarea,#header textarea{background:#fff;border:1px solid #d7d9d9;border-radius:2px;-webkit-box-shadow:inset 0 1px 0 #7c7f80;box-shadow:inset 0 1px 0 #7c7f80;color:#000;font-weight:400;padding:.75rem 1.125rem;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}@media (min-width:0px){#footer textarea,#header textarea{font-size:.9375rem}}@media (min-width:600px){#footer textarea,#header textarea{font-size:1rem}}#footer textarea:hover,#header textarea:hover{border:1px solid #0073cf!important;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer textarea:active,#footer textarea:focus,#header textarea:active,#header textarea:focus{border:1px solid #0073cf!important;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4;outline:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer textarea:disabled,#header textarea:disabled{background:#f5f6f7;border:1px solid #d7d9d9;-webkit-box-shadow:inset 0 1px 0 #7c7f80;box-shadow:inset 0 1px 0 #7c7f80;-webkit-box-sizing:border-box;box-sizing:border-box;color:#a2a4a3}#footer select,#header select{background:#fff;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath stroke='%230073CF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 1 5 5 1 1'/%3E%3C/svg%3E");background-position:97% 50%;background-repeat:no-repeat;border:1px solid #d7d9d9;border-radius:2px;-webkit-box-shadow:inset 0 -1px 0 #7c7f80;box-shadow:inset 0 -1px 0 #7c7f80;color:#000;font-weight:400;height:3rem;padding:.75rem 2.25rem .75rem 1.125rem;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}@media (min-width:0px){#footer select,#header select{font-size:.9375rem}}@media (min-width:600px){#footer select,#header select{font-size:1rem}}#footer select:hover,#header select:hover{border:1px solid #0073cf!important;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer select:active,#footer select:focus,#header select:active,#header select:focus{border:1px solid #0073cf!important;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4;outline:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer select:disabled,#header select:disabled{background:#f5f6f7;border:1px solid #d7d9d9;-webkit-box-shadow:inset 0 1px 0 #7c7f80;box-shadow:inset 0 1px 0 #7c7f80;-webkit-box-sizing:border-box;box-sizing:border-box;color:#a2a4a3}#footer .select2-selection.select2-selection--multiple,#header .select2-selection.select2-selection--multiple{background:#fff;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath stroke='%230073CF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 1 5 5 1 1'/%3E%3C/svg%3E");background-position:97% 50%;background-repeat:no-repeat;border:1px solid #d7d9d9;border-radius:2px;-webkit-box-shadow:inset 0 -1px 0 #7c7f80;box-shadow:inset 0 -1px 0 #7c7f80;color:#000;font-weight:400;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}@media (min-width:0px){#footer .select2-selection.select2-selection--multiple,#header .select2-selection.select2-selection--multiple{font-size:.9375rem}}@media (min-width:600px){#footer .select2-selection.select2-selection--multiple,#header .select2-selection.select2-selection--multiple{font-size:1rem}}#footer .select2-selection.select2-selection--multiple:hover,#header .select2-selection.select2-selection--multiple:hover{border:1px solid #0073cf!important;-webkit-box-shadow:none;box-shadow:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .select2-selection.select2-selection--multiple:active,#footer .select2-selection.select2-selection--multiple:focus,#header .select2-selection.select2-selection--multiple:active,#header .select2-selection.select2-selection--multiple:focus{border:1px solid #0073cf!important;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4;outline:none;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .select2-selection.select2-selection--multiple:disabled,#header .select2-selection.select2-selection--multiple:disabled{background:#f5f6f7;border:1px solid #d7d9d9;-webkit-box-shadow:inset 0 1px 0 #7c7f80;box-shadow:inset 0 1px 0 #7c7f80;-webkit-box-sizing:border-box;box-sizing:border-box;color:#a2a4a3}#footer .select2-selection.select2-selection--multiple .select2-container--default .select2-results__option--highlighted[data-selected],#header .select2-selection.select2-selection--multiple .select2-container--default .select2-results__option--highlighted[data-selected]{background-color:#0073cf;color:#fff}#footer .select2-selection.select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove,#header .select2-selection.select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove{padding:.1875rem}#footer ::-webkit-file-upload-button,#footer button.button.form-submit.ui-button,#footer button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close),#footer input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res),#header ::-webkit-file-upload-button,#header button.button.form-submit.ui-button,#header button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close),#header input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res){-webkit-appearance:none;background:#0073cf;border:1px solid #0073cf;border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);color:#fff;font-size:13px;font-weight:700;letter-spacing:.1em;padding:.75rem 1.125rem;text-transform:uppercase;-webkit-transition:all .25s;transition:all .25s}#footer ::-webkit-file-upload-button:hover,#footer button.button.form-submit.ui-button:hover,#footer button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):hover,#footer input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):hover,#header ::-webkit-file-upload-button:hover,#header button.button.form-submit.ui-button:hover,#header button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):hover,#header input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):hover{background:#0092e2;border:1px solid #0092e2;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);-webkit-transition:all .25s;transition:all .25s}#footer ::-webkit-file-upload-button:active,#footer ::-webkit-file-upload-button:focus,#footer button.button.form-submit.ui-button:active,#footer button.button.form-submit.ui-button:focus,#footer button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):active,#footer button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):focus,#footer input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):active,#footer input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):focus,#header ::-webkit-file-upload-button:active,#header ::-webkit-file-upload-button:focus,#header button.button.form-submit.ui-button:active,#header button.button.form-submit.ui-button:focus,#header button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):active,#header button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):focus,#header input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):active,#header input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):focus{background:#0092e2;border:1px solid #0073cf;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4;-webkit-transition:all .25s;transition:all .25s}#footer ::-webkit-file-upload-button:disabled,#footer button.button.form-submit.ui-button:disabled,#footer button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):disabled,#footer input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):disabled,#header ::-webkit-file-upload-button:disabled,#header button.button.form-submit.ui-button:disabled,#header button:not(.paragraphs-dropdown-togagle) :not(.erl-edit) :not(.ui-button) :not(.button--danger) :not(.layout-paragraphs-add-content__toggle) :not(.layout-handle) :not(.layout-up) :not(.layout-down) :not(.layout-handle) :not(.trigger) :not(.toolbar-item) :not(.toolbar-icon) :not(.MuiButtonBase-root) :not(.MuiLink-root) :not(.filter--trigger) :not(.filter--trigger-secondary) :not(.filter--trigger-tutorials) :not(.paragraphs-dropdown-toggle) :not(.isDesktop) :not(.subNavClose) :not(.focusable) :not(.mini-arrow) :not(.button--search) :not(.button__search-close):disabled,#header input[type=submit] :not(.paragraphs-dropdown-action) :not(.erl-edit) :not(.erl-remove) :not(#edit-submit-staff) :not(#edit-submit-blog) :not(.button--search) :not(.search-form__button) :not(#edit-submit-flight-res):disabled{background:#d7d9d9;color:#a2a4a3}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked,#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked),#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked){left:-9999px;position:absolute}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label,#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label{cursor:pointer;padding-left:1.95em;position:relative}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label:before,#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label:before{background:#fff;border:1px solid #d7d9d9;border-radius:50%;content:"";height:16px;left:0;position:absolute;top:0;width:16px}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label:after,#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label:after,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label:after,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' fill='none'%3E%3Crect width='8' height='8' fill='%23000' rx='4'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;content:"";display:block;height:8px;left:4px;position:absolute;top:4px;width:8px}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label:after,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked)+label:after{opacity:0;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label:after,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked+label:after{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):disabled:checked+label:before,#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):disabled:not(:checked)+label:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):disabled:checked+label:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):disabled:not(:checked)+label:before{background-color:#fff;border-color:#d7d9d9;-webkit-box-shadow:none;box-shadow:none}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked:focus+label:before,#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked):focus+label:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):checked:focus+label:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input):not(:checked):focus+label:before{border:1px solid #0073cf;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4}#footer form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input)+label:hover:before,#header form:not(.layout-paragraphs-component-form) input[type=radio]:not(.rlglc-input)+label:hover:before{border:1px solid #0073cf!important}#footer .form-no-label .visually-hidden,#header .form-no-label .visually-hidden{height:auto;overflow:visible;overflow:initial;text-indent:-10000px;width:auto}#footer .js-form-item input.form-checkbox:not(.allday):checked,#footer .js-form-item input.form-checkbox:not(.allday):not(:checked),#header .js-form-item input.form-checkbox:not(.allday):checked,#header .js-form-item input.form-checkbox:not(.allday):not(:checked){position:absolute}#footer .js-form-item input.form-checkbox:not(.allday):checked+label,#footer .js-form-item input.form-checkbox:not(.allday):not(:checked)+label,#header .js-form-item input.form-checkbox:not(.allday):checked+label,#header .js-form-item input.form-checkbox:not(.allday):not(:checked)+label{cursor:pointer;padding-left:1.95em;position:relative;z-index:1}#footer .js-form-item input.form-checkbox:not(.allday):checked+label:before,#footer .js-form-item input.form-checkbox:not(.allday):not(:checked)+label:before,#header .js-form-item input.form-checkbox:not(.allday):checked+label:before,#header .js-form-item input.form-checkbox:not(.allday):not(:checked)+label:before{background:#fff;border:1px solid #d7d9d9;border-radius:2px;content:"";height:16px;left:0;position:absolute;top:0;width:16px}#footer .js-form-item input.form-checkbox:not(.allday):checked+label:after,#footer .js-form-item input.form-checkbox:not(.allday):not(:checked)+label:after,#header .js-form-item input.form-checkbox:not(.allday):checked+label:after,#header .js-form-item input.form-checkbox:not(.allday):not(:checked)+label:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='8' fill='none'%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 4 3 3 6-6'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;content:"";display:block;height:8px;left:3px;position:absolute;top:4px;width:11px}#footer .js-form-item input.form-checkbox:not(.allday):not(:checked)+label:after,#header .js-form-item input.form-checkbox:not(.allday):not(:checked)+label:after{opacity:0;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}#footer .js-form-item input.form-checkbox:not(.allday):checked+label:after,#header .js-form-item input.form-checkbox:not(.allday):checked+label:after{opacity:1;-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}#footer .js-form-item input.form-checkbox:not(.allday):disabled:checked+label:before,#footer .js-form-item input.form-checkbox:not(.allday):disabled:not(:checked)+label:before,#header .js-form-item input.form-checkbox:not(.allday):disabled:checked+label:before,#header .js-form-item input.form-checkbox:not(.allday):disabled:not(:checked)+label:before{background-color:#fff;border-color:#d7d9d9;-webkit-box-shadow:none;box-shadow:none}#footer .js-form-item input.form-checkbox:not(.allday):checked:focus+label:before,#footer .js-form-item input.form-checkbox:not(.allday):not(:checked):focus+label:before,#header .js-form-item input.form-checkbox:not(.allday):checked:focus+label:before,#header .js-form-item input.form-checkbox:not(.allday):not(:checked):focus+label:before{border:1px solid #0073cf;-webkit-box-shadow:0 0 0 4px #c4c4c4;box-shadow:0 0 0 4px #c4c4c4}#footer .js-form-item input.form-checkbox:not(.allday)+label:hover:before,#header .js-form-item input.form-checkbox:not(.allday)+label:hover:before{border:1px solid #0073cf!important}#footer .webform-element-description,#header .webform-element-description{color:#565a5c}@media (min-width:0px){#footer .webform-element-description,#header .webform-element-description{font-size:.875rem}}@media (min-width:600px){#footer .webform-element-description,#header .webform-element-description{font-size:.9375rem}}#footer #linkit-editor-dialog-form,#header #linkit-editor-dialog-form{min-height:400px}#footer .smartdate--time-inline,#header .smartdate--time-inline{display:-webkit-box;display:flex;grid-column-gap:.5em;-webkit-box-orient:horizontal;-webkit-box-direction:normal;align-content:center;flex-direction:row;flex-wrap:nowrap;-webkit-box-align:baseline;align-items:baseline;-webkit-box-pack:start;justify-content:flex-start}#footer .table-wrapper,#header .table-wrapper{background:-webkit-gradient(linear,left top,right top,from(#fff),to(hsla(0,0%,100%,0))),-webkit-gradient(linear,right top,left top,from(#fff),to(hsla(0,0%,100%,0))) 100% 0,radial-gradient(farthest-side at 0 50%,rgba(0,0,0,.2),transparent),radial-gradient(farthest-side at 100% 50%,rgba(0,0,0,.2),transparent) 100% 0;background:-o-linear-gradient(left,#fff 0,hsla(0,0%,100%,0)),-o-linear-gradient(right,#fff 0,hsla(0,0%,100%,0)) 100% 0,-o-radial-gradient(0 50%,farthest-side,rgba(0,0,0,.2),transparent),-o-radial-gradient(100% 50%,farthest-side,rgba(0,0,0,.2),transparent) 100% 0;background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0)),linear-gradient(-90deg,#fff,hsla(0,0%,100%,0)) 100% 0,radial-gradient(farthest-side at 0 50%,rgba(0,0,0,.2),transparent),radial-gradient(farthest-side at 100% 50%,rgba(0,0,0,.2),transparent) 100% 0;background-attachment:local,local,scroll,scroll;background-color:#fff;background-repeat:no-repeat;background-size:100px 100%,100px 100%,14px 100%,14px 100%;display:grid;overflow-x:auto}#footer .table-wrapper::-webkit-scrollbar,#header .table-wrapper::-webkit-scrollbar{-webkit-appearance:none;height:10px}#footer .table-wrapper::-webkit-scrollbar-thumb,#header .table-wrapper::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.5);border-radius:3px;-webkit-box-shadow:0 0 1px hsla(0,0%,100%,.5)}#footer table:not(.MuiTable-root),#header table:not(.MuiTable-root){border:none;border-collapse:collapse;border-spacing:0;caption-side:bottom;color:#000;margin:0;min-width:100%;text-align:left;vertical-align:top}@media (min-width:0px){#footer table:not(.MuiTable-root),#header table:not(.MuiTable-root){font-size:.75rem}}@media (min-width:600px){#footer table:not(.MuiTable-root),#header table:not(.MuiTable-root){font-size:.8125rem}}#footer table:not(.MuiTable-root) p,#header table:not(.MuiTable-root) p{color:inherit;font-size:inherit;line-height:inherit}#footer table:not(.MuiTable-root) td,#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) th{border:none}#footer table:not(.MuiTable-root) thead th,#header table:not(.MuiTable-root) thead th{vertical-align:middle}#footer table:not(.MuiTable-root) thead th a,#header table:not(.MuiTable-root) thead th a{padding:0}@media (min-width:0px){#footer table:not(.MuiTable-root) thead th a,#header table:not(.MuiTable-root) thead th a{font-size:.75rem}}@media (min-width:600px){#footer table:not(.MuiTable-root) thead th a,#header table:not(.MuiTable-root) thead th a{font-size:.8125rem}}#footer table:not(.MuiTable-root) td,#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) th{padding:.625rem;vertical-align:top}@media (min-width:768px){#footer table:not(.MuiTable-root) td,#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) th{padding:.625rem 1rem}}@media (min-width:992px){#footer table:not(.MuiTable-root) td,#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) th{padding:1rem 1.25rem}}#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) th{border-left:1px solid #002c77}#footer table:not(.MuiTable-root) th:first-child,#header table:not(.MuiTable-root) th:first-child{border-left:none}#footer table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) td{border-left:1px solid #d7d9d9}@media (min-width:0px){#footer table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) td{font-size:.75rem}}@media (min-width:600px){#footer table:not(.MuiTable-root) td,#header table:not(.MuiTable-root) td{font-size:.8125rem}}#footer table:not(.MuiTable-root) td a,#header table:not(.MuiTable-root) td a{color:#0073cf;line-height:1.25}#footer table:not(.MuiTable-root) td:first-child,#header table:not(.MuiTable-root) td:first-child{border-left:none}#footer table:not(.MuiTable-root) tr:nth-of-type(odd),#header table:not(.MuiTable-root) tr:nth-of-type(odd){background-color:rgba(20,21,22,.04)}#footer table:not(.MuiTable-root) tr:nth-of-type(2n),#header table:not(.MuiTable-root) tr:nth-of-type(2n){background:none}#footer table:not(.MuiTable-root) caption,#header table:not(.MuiTable-root) caption{padding:1rem}#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) th{background:#0073cf;-webkit-box-shadow:inset 0 -1px 0 #002c77;box-shadow:inset 0 -1px 0 #002c77;color:#fff;letter-spacing:.2em;text-transform:uppercase}@media (min-width:0px){#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) th{font-size:.75rem}}@media (min-width:600px){#footer table:not(.MuiTable-root) th,#header table:not(.MuiTable-root) th{font-size:.8125rem}}#footer table:not(.MuiTable-root) th a,#header table:not(.MuiTable-root) th a{color:#fff;text-decoration:none;word-wrap:break-word}#footer code,#header code{background:#fff;border-radius:3px;-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(0,0,0,.1);color:#000;display:inline;font-family:monospace,serif;padding:.1875rem .3125rem}#footer pre code,#header pre code{background:#e4e6e7;border-radius:3px;display:block;padding:.2rem}@media (min-width:0px){#footer pre code,#header pre code{font-size:1rem}}@media (min-width:600px){#footer pre code,#header pre code{font-size:1.125rem}}#footer .hljs-comment,#footer .hljs-quote,#header .hljs-comment,#header .hljs-quote{color:#969896}#footer .hljs-deletion,#footer .hljs-name,#footer .hljs-regexp,#footer .hljs-selector-class,#footer .hljs-selector-id,#footer .hljs-tag,#footer .hljs-template-variable,#footer .hljs-variable,#header .hljs-deletion,#header .hljs-name,#header .hljs-regexp,#header .hljs-selector-class,#header .hljs-selector-id,#header .hljs-tag,#header .hljs-template-variable,#header .hljs-variable{color:#c66}#footer .hljs-built_in,#footer .hljs-builtin-name,#footer .hljs-link,#footer .hljs-literal,#footer .hljs-meta,#footer .hljs-number,#footer .hljs-params,#footer .hljs-type,#header .hljs-built_in,#header .hljs-builtin-name,#header .hljs-link,#header .hljs-literal,#header .hljs-meta,#header .hljs-number,#header .hljs-params,#header .hljs-type{color:#de935f}#footer .hljs-attribute,#header .hljs-attribute{color:#f0c674}#footer .hljs-addition,#footer .hljs-bullet,#footer .hljs-string,#footer .hljs-symbol,#header .hljs-addition,#header .hljs-bullet,#header .hljs-string,#header .hljs-symbol{color:#b5bd68}#footer .hljs-section,#footer .hljs-title,#header .hljs-section,#header .hljs-title{color:#81a2be}#footer .hljs-keyword,#footer .hljs-selector-tag,#header .hljs-keyword,#header .hljs-selector-tag{color:#b294bb}#footer .hljs,#header .hljs{background:#fff;border-radius:3px;-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.1);box-shadow:0 0 0 1px rgba(0,0,0,.1);display:inline;font-family:monospace,serif;padding:.1875rem .3125rem}#footer pre .hljs,#header pre .hljs{background:#1d1f21;border-radius:3px;color:#c5c8c6;display:block;overflow-x:auto;padding:1.25rem 1.875rem}#footer .hljs-emphasis,#header .hljs-emphasis{font-style:italic}#footer .hljs-strong,#header .hljs-strong{font-weight:700}#footer #ds-objectives,#header #ds-objectives{background:#f3f8fb;border:1px solid #0073cf;border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:1.875rem 0;padding:.75rem .9375rem}@media (min-width:992px){#footer #ds-objectives,#header #ds-objectives{margin:3.75rem 0;padding:1.5rem 1.875rem}}#footer #ds-objectives h3,#header #ds-objectives h3{color:#000;font-weight:700;letter-spacing:.2em;margin:1.125rem 0 .25rem;text-transform:uppercase}@media (min-width:0px){#footer #ds-objectives h3,#header #ds-objectives h3{font-size:.75rem}}@media (min-width:600px){#footer #ds-objectives h3,#header #ds-objectives h3{font-size:.8125rem}}#footer #ds-objectives h2:first-child,#footer #ds-objectives h3:first-child,#header #ds-objectives h2:first-child,#header #ds-objectives h3:first-child{margin-top:0}#footer .link--button.link--arrow,#header .link--button.link--arrow{border:1px solid #0073cf;border-radius:2px;color:#0073cf;display:inline-block;font-weight:700;letter-spacing:.1em;line-height:24px;margin:1.875rem 0 0;padding:.5625rem 2.25rem .5625rem 1.125rem;text-decoration:none;text-transform:uppercase;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}@media (min-width:0px){#footer .link--button.link--arrow,#header .link--button.link--arrow{font-size:.75rem}}@media (min-width:600px){#footer .link--button.link--arrow,#header .link--button.link--arrow{font-size:.8125rem}}@media (min-width:992px){#footer .link--button.link--arrow,#header .link--button.link--arrow{padding:.75rem 2.25rem .75rem 1.125rem}}#footer .link--button.link--arrow svg,#header .link--button.link--arrow svg{-webkit-transform:translateX(10px);-ms-transform:translateX(10px);transform:translateX(10px);-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .link--button.link--arrow svg .line,#header .link--button.link--arrow svg .line{stroke-dasharray:11;stroke-dashoffset:11;-webkit-animation:arrowOut .1s linear forwards;animation:arrowOut .1s linear forwards}#footer .link--button.link--arrow:active,#footer .link--button.link--arrow:focus,#footer .link--button.link--arrow:hover,#header .link--button.link--arrow:active,#header .link--button.link--arrow:focus,#header .link--button.link--arrow:hover{border:1px solid #0092e2;color:#0092e2;text-decoration:underline;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .link--button.link--arrow:active svg,#footer .link--button.link--arrow:focus svg,#footer .link--button.link--arrow:hover svg,#header .link--button.link--arrow:active svg,#header .link--button.link--arrow:focus svg,#header .link--button.link--arrow:hover svg{-webkit-transform:translateX(15px);-ms-transform:translateX(15px);transform:translateX(15px);-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .link--button.link--arrow:active svg .line,#footer .link--button.link--arrow:focus svg .line,#footer .link--button.link--arrow:hover svg .line,#header .link--button.link--arrow:active svg .line,#header .link--button.link--arrow:focus svg .line,#header .link--button.link--arrow:hover svg .line{-webkit-animation:arrowIn .15s linear forwards;animation:arrowIn .15s linear forwards}#footer .link--button.link--arrow:active svg path,#footer .link--button.link--arrow:focus svg path,#footer .link--button.link--arrow:hover svg path,#header .link--button.link--arrow:active svg path,#header .link--button.link--arrow:focus svg path,#header .link--button.link--arrow:hover svg path{stroke:#0092e2}#footer .link--button.link--arrow.solid,#header .link--button.link--arrow.solid{background:#0073cf;color:#fff}#footer .link--button.link--arrow.solid svg path,#header .link--button.link--arrow.solid svg path{stroke:#fff}#footer .link--button.link--arrow.no-borders,#header .link--button.link--arrow.no-borders{border:none;margin:0;padding:0}#footer #ds-challenge,#header #ds-challenge{background:rgba(85,136,7,.15);border:1px solid #558807;border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:1.875rem 0;padding:.75rem .9375rem}@media (min-width:992px){#footer #ds-challenge,#header #ds-challenge{margin:3.75rem 0;padding:1.5rem 1.875rem}}#footer #ds-challenge h3,#header #ds-challenge h3{color:#000;font-weight:700;letter-spacing:.2em;margin:1.125rem 0 .25rem;text-transform:uppercase}@media (min-width:0px){#footer #ds-challenge h3,#header #ds-challenge h3{font-size:.75rem}}@media (min-width:600px){#footer #ds-challenge h3,#header #ds-challenge h3{font-size:.8125rem}}#footer #ds-challenge h2:first-child,#footer #ds-challenge h3:first-child,#header #ds-challenge h2:first-child,#header #ds-challenge h3:first-child{margin-top:0}#footer #ds-dataTip,#header #ds-dataTip{background:#f5f6f7;border:1px solid #d7d9d9;border-radius:3px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:1.875rem 0;padding:.75rem .9375rem}@media (min-width:992px){#footer #ds-dataTip,#header #ds-dataTip{margin:3.75rem 0;padding:1.5rem 1.875rem}}#footer #ds-dataTip h3,#header #ds-dataTip h3{color:#000;font-weight:700;letter-spacing:.2em;margin:1.125rem 0 .25rem;text-transform:uppercase}@media (min-width:0px){#footer #ds-dataTip h3,#header #ds-dataTip h3{font-size:.75rem}}@media (min-width:600px){#footer #ds-dataTip h3,#header #ds-dataTip h3{font-size:.8125rem}}#footer #ds-dataTip h2:first-child,#footer #ds-dataTip h3:first-child,#header #ds-dataTip h2:first-child,#header #ds-dataTip h3:first-child{margin-top:0}#footer .ui-widget .lpb-component-list .lpb-component-list__search,#header .ui-widget .lpb-component-list .lpb-component-list__search{top:auto}#footer #edit-footer+#edit-actions,#footer .entity-content-form-footer.form-wrapper,#footer .field--name-field-display-mode.field--widget-entity-display-mode-select,#footer .field--type-entity-reference.field--name-field-image,#footer .field-group-html-element.other-content,#footer .js-form-item.js-form-type-vertical-tabs,#footer form.node-confirm-form.confirmation,#footer form.node-form:not(.node-page-edit-form),#footer form.node-update-form,#header #edit-footer+#edit-actions,#header .entity-content-form-footer.form-wrapper,#header .field--name-field-display-mode.field--widget-entity-display-mode-select,#header .field--type-entity-reference.field--name-field-image,#header .field-group-html-element.other-content,#header .js-form-item.js-form-type-vertical-tabs,#header form.node-confirm-form.confirmation,#header form.node-form:not(.node-page-edit-form),#header form.node-update-form{margin-left:auto;margin-right:auto;max-width:1380px;padding-left:1.875rem;padding-right:1.875rem}@media (min-width:992px){#footer #edit-footer+#edit-actions,#footer .entity-content-form-footer.form-wrapper,#footer .field--name-field-display-mode.field--widget-entity-display-mode-select,#footer .field--type-entity-reference.field--name-field-image,#footer .field-group-html-element.other-content,#footer .js-form-item.js-form-type-vertical-tabs,#footer form.node-confirm-form.confirmation,#footer form.node-form:not(.node-page-edit-form),#footer form.node-update-form,#header #edit-footer+#edit-actions,#header .entity-content-form-footer.form-wrapper,#header .field--name-field-display-mode.field--widget-entity-display-mode-select,#header .field--type-entity-reference.field--name-field-image,#header .field-group-html-element.other-content,#header .js-form-item.js-form-type-vertical-tabs,#header form.node-confirm-form.confirmation,#header form.node-form:not(.node-page-edit-form),#header form.node-update-form{padding-left:3.125rem;padding-right:3.125rem}}#footer #edit-footer+#edit-actions,#footer #node-page-edit-form>#edit-actions,#footer form.node-confirm-form.confirmation #edit-actions,#header #edit-footer+#edit-actions,#header #node-page-edit-form>#edit-actions,#header form.node-confirm-form.confirmation #edit-actions{margin-bottom:1.875rem}@media (min-width:992px){#footer #edit-footer+#edit-actions,#footer #node-page-edit-form>#edit-actions,#footer form.node-confirm-form.confirmation #edit-actions,#header #edit-footer+#edit-actions,#header #node-page-edit-form>#edit-actions,#header form.node-confirm-form.confirmation #edit-actions{margin-bottom:3.75rem}}#footer #node-page-edit-form .paragraphs-dropdown-action.button,#footer #node-page-form .paragraphs-dropdown-action.button,#footer form.node-form .paragraphs-dropdown-action.button,#footer form.node-update-form .paragraphs-dropdown-action.button,#header #node-page-edit-form .paragraphs-dropdown-action.button,#header #node-page-form .paragraphs-dropdown-action.button,#header form.node-form .paragraphs-dropdown-action.button,#header form.node-update-form .paragraphs-dropdown-action.button{color:#141516}#footer #node-page-edit-form .field--widget-paragraphs td,#footer #node-page-form .field--widget-paragraphs td,#footer form.node-form .field--widget-paragraphs td,#footer form.node-update-form .field--widget-paragraphs td,#header #node-page-edit-form .field--widget-paragraphs td,#header #node-page-form .field--widget-paragraphs td,#header form.node-form .field--widget-paragraphs td,#header form.node-update-form .field--widget-paragraphs td{padding:.75rem 1.125rem}@media (min-width:0px){#footer #node-page-edit-form .field--widget-paragraphs .form-wrapper>h4,#footer #node-page-form .field--widget-paragraphs .form-wrapper>h4,#footer form.node-form .field--widget-paragraphs .form-wrapper>h4,#footer form.node-update-form .field--widget-paragraphs .form-wrapper>h4,#header #node-page-edit-form .field--widget-paragraphs .form-wrapper>h4,#header #node-page-form .field--widget-paragraphs .form-wrapper>h4,#header form.node-form .field--widget-paragraphs .form-wrapper>h4,#header form.node-update-form .field--widget-paragraphs .form-wrapper>h4{font-size:.9375rem}}@media (min-width:600px){#footer #node-page-edit-form .field--widget-paragraphs .form-wrapper>h4,#footer #node-page-form .field--widget-paragraphs .form-wrapper>h4,#footer form.node-form .field--widget-paragraphs .form-wrapper>h4,#footer form.node-update-form .field--widget-paragraphs .form-wrapper>h4,#header #node-page-edit-form .field--widget-paragraphs .form-wrapper>h4,#header #node-page-form .field--widget-paragraphs .form-wrapper>h4,#header form.node-form .field--widget-paragraphs .form-wrapper>h4,#header form.node-update-form .field--widget-paragraphs .form-wrapper>h4{font-size:1rem}}@media (min-width:0px){#footer #node-page-edit-form li,#footer #node-page-form li,#footer form.node-form li,#footer form.node-update-form li,#header #node-page-edit-form li,#header #node-page-form li,#header form.node-form li,#header form.node-update-form li{font-size:.9375rem}}@media (min-width:600px){#footer #node-page-edit-form li,#footer #node-page-form li,#footer form.node-form li,#footer form.node-update-form li,#header #node-page-edit-form li,#header #node-page-form li,#header form.node-form li,#header form.node-update-form li{font-size:1rem}}#footer #node-page-edit-form #edit-field-display-mode-wrapper,#footer #node-page-edit-form #edit-field-image-wrapper,#footer #node-page-edit-form .entity-content-form-footer,#footer #node-page-edit-form .js-form-type-vertical-tabs,#footer #node-page-edit-form .other-content,#footer #node-page-form #edit-field-display-mode-wrapper,#footer #node-page-form #edit-field-image-wrapper,#footer #node-page-form .entity-content-form-footer,#footer #node-page-form .js-form-type-vertical-tabs,#footer #node-page-form .other-content,#footer form.node-form #edit-field-display-mode-wrapper,#footer form.node-form #edit-field-image-wrapper,#footer form.node-form .entity-content-form-footer,#footer form.node-form .js-form-type-vertical-tabs,#footer form.node-form .other-content,#footer form.node-update-form #edit-field-display-mode-wrapper,#footer form.node-update-form #edit-field-image-wrapper,#footer form.node-update-form .entity-content-form-footer,#footer form.node-update-form .js-form-type-vertical-tabs,#footer form.node-update-form .other-content,#header #node-page-edit-form #edit-field-display-mode-wrapper,#header #node-page-edit-form #edit-field-image-wrapper,#header #node-page-edit-form .entity-content-form-footer,#header #node-page-edit-form .js-form-type-vertical-tabs,#header #node-page-edit-form .other-content,#header #node-page-form #edit-field-display-mode-wrapper,#header #node-page-form #edit-field-image-wrapper,#header #node-page-form .entity-content-form-footer,#header #node-page-form .js-form-type-vertical-tabs,#header #node-page-form .other-content,#header form.node-form #edit-field-display-mode-wrapper,#header form.node-form #edit-field-image-wrapper,#header form.node-form .entity-content-form-footer,#header form.node-form .js-form-type-vertical-tabs,#header form.node-form .other-content,#header form.node-update-form #edit-field-display-mode-wrapper,#header form.node-update-form #edit-field-image-wrapper,#header form.node-update-form .entity-content-form-footer,#header form.node-update-form .js-form-type-vertical-tabs,#header form.node-update-form .other-content{margin:1.875rem auto;max-width:1380px;padding-left:1.875rem;padding-right:1.875rem}@media (min-width:992px){#footer #node-page-edit-form #edit-field-display-mode-wrapper,#footer #node-page-edit-form #edit-field-image-wrapper,#footer #node-page-edit-form .entity-content-form-footer,#footer #node-page-edit-form .js-form-type-vertical-tabs,#footer #node-page-edit-form .other-content,#footer #node-page-form #edit-field-display-mode-wrapper,#footer #node-page-form #edit-field-image-wrapper,#footer #node-page-form .entity-content-form-footer,#footer #node-page-form .js-form-type-vertical-tabs,#footer #node-page-form .other-content,#footer form.node-form #edit-field-display-mode-wrapper,#footer form.node-form #edit-field-image-wrapper,#footer form.node-form .entity-content-form-footer,#footer form.node-form .js-form-type-vertical-tabs,#footer form.node-form .other-content,#footer form.node-update-form #edit-field-display-mode-wrapper,#footer form.node-update-form #edit-field-image-wrapper,#footer form.node-update-form .entity-content-form-footer,#footer form.node-update-form .js-form-type-vertical-tabs,#footer form.node-update-form .other-content,#header #node-page-edit-form #edit-field-display-mode-wrapper,#header #node-page-edit-form #edit-field-image-wrapper,#header #node-page-edit-form .entity-content-form-footer,#header #node-page-edit-form .js-form-type-vertical-tabs,#header #node-page-edit-form .other-content,#header #node-page-form #edit-field-display-mode-wrapper,#header #node-page-form #edit-field-image-wrapper,#header #node-page-form .entity-content-form-footer,#header #node-page-form .js-form-type-vertical-tabs,#header #node-page-form .other-content,#header form.node-form #edit-field-display-mode-wrapper,#header form.node-form #edit-field-image-wrapper,#header form.node-form .entity-content-form-footer,#header form.node-form .js-form-type-vertical-tabs,#header form.node-form .other-content,#header form.node-update-form #edit-field-display-mode-wrapper,#header form.node-update-form #edit-field-image-wrapper,#header form.node-update-form .entity-content-form-footer,#header form.node-update-form .js-form-type-vertical-tabs,#header form.node-update-form .other-content{margin:3.75rem auto;padding-left:3.125rem;padding-right:3.125rem}}#footer #node-page-edit-form .button+.button,#footer #node-page-form .button+.button,#footer form.node-form .button+.button,#footer form.node-update-form .button+.button,#header #node-page-edit-form .button+.button,#header #node-page-form .button+.button,#header form.node-form .button+.button,#header form.node-update-form .button+.button{margin-left:.75rem}#footer #node-page-edit-form a.button--danger,#footer #node-page-edit-form button.button--danger,#footer #node-page-form a.button--danger,#footer #node-page-form button.button--danger,#footer form.node-form a.button--danger,#footer form.node-form button.button--danger,#footer form.node-update-form a.button--danger,#footer form.node-update-form button.button--danger,#header #node-page-edit-form a.button--danger,#header #node-page-edit-form button.button--danger,#header #node-page-form a.button--danger,#header #node-page-form button.button--danger,#header form.node-form a.button--danger,#header form.node-form button.button--danger,#header form.node-update-form a.button--danger,#header form.node-update-form button.button--danger{-webkit-appearance:none;background:#d7d9d9;border:1px solid #d7d9d9;border-radius:2px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);color:#565a5c;font-size:13px;font-weight:700;letter-spacing:.1em;padding:.75rem 1.125rem;text-decoration:none;text-transform:uppercase;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer #node-page-edit-form a.button--danger:hover,#footer #node-page-edit-form button.button--danger:hover,#footer #node-page-form a.button--danger:hover,#footer #node-page-form button.button--danger:hover,#footer form.node-form a.button--danger:hover,#footer form.node-form button.button--danger:hover,#footer form.node-update-form a.button--danger:hover,#footer form.node-update-form button.button--danger:hover,#header #node-page-edit-form a.button--danger:hover,#header #node-page-edit-form button.button--danger:hover,#header #node-page-form a.button--danger:hover,#header #node-page-form button.button--danger:hover,#header form.node-form a.button--danger:hover,#header form.node-form button.button--danger:hover,#header form.node-update-form a.button--danger:hover,#header form.node-update-form button.button--danger:hover{background:#f5f6f7;color:#565a5c;-webkit-transition:all .45s;-o-transition:all .45s;transition:all .45s}#footer #node-page-edit-form .filter-wrapper,#footer #node-page-form .filter-wrapper,#footer form.node-form .filter-wrapper,#footer form.node-update-form .filter-wrapper,#header #node-page-edit-form .filter-wrapper,#header #node-page-form .filter-wrapper,#header form.node-form .filter-wrapper,#header form.node-update-form .filter-wrapper{border-top:1px solid #d7d9d9}#footer #node-page-edit-form input.form-autocomplete,#footer #node-page-edit-form textarea.text-full.form-textarea,#footer #node-page-form input.form-autocomplete,#footer #node-page-form textarea.text-full.form-textarea,#footer form.node-form input.form-autocomplete,#footer form.node-form textarea.text-full.form-textarea,#footer form.node-update-form input.form-autocomplete,#footer form.node-update-form textarea.text-full.form-textarea,#header #node-page-edit-form input.form-autocomplete,#header #node-page-edit-form textarea.text-full.form-textarea,#header #node-page-form input.form-autocomplete,#header #node-page-form textarea.text-full.form-textarea,#header form.node-form input.form-autocomplete,#header form.node-form textarea.text-full.form-textarea,#header form.node-update-form input.form-autocomplete,#header form.node-update-form textarea.text-full.form-textarea{-webkit-box-sizing:border-box;box-sizing:border-box;width:100%}#footer #node-page-edit-form table.field-multiple-table th h4,#footer #node-page-form table.field-multiple-table th h4,#footer form.node-form table.field-multiple-table th h4,#footer form.node-update-form table.field-multiple-table th h4,#header #node-page-edit-form table.field-multiple-table th h4,#header #node-page-form table.field-multiple-table th h4,#header form.node-form table.field-multiple-table th h4,#header form.node-update-form table.field-multiple-table th h4{background:#0073cf;color:#fff;letter-spacing:.2em;margin:0;text-transform:uppercase}@media (min-width:0px){#footer #node-page-edit-form table.field-multiple-table th h4,#footer #node-page-form table.field-multiple-table th h4,#footer form.node-form table.field-multiple-table th h4,#footer form.node-update-form table.field-multiple-table th h4,#header #node-page-edit-form table.field-multiple-table th h4,#header #node-page-form table.field-multiple-table th h4,#header form.node-form table.field-multiple-table th h4,#header form.node-update-form table.field-multiple-table th h4{font-size:.75rem}}@media (min-width:600px){#footer #node-page-edit-form table.field-multiple-table th h4,#footer #node-page-form table.field-multiple-table th h4,#footer form.node-form table.field-multiple-table th h4,#footer form.node-update-form table.field-multiple-table th h4,#header #node-page-edit-form table.field-multiple-table th h4,#header #node-page-form table.field-multiple-table th h4,#header form.node-form table.field-multiple-table th h4,#header form.node-update-form table.field-multiple-table th h4{font-size:.8125rem}}#footer #node-page-edit-form .vertical-tabs .entity-meta.vertical-tabs__panes,#footer #node-page-form .vertical-tabs .entity-meta.vertical-tabs__panes,#footer form.node-form .vertical-tabs .entity-meta.vertical-tabs__panes,#footer form.node-update-form .vertical-tabs .entity-meta.vertical-tabs__panes,#header #node-page-edit-form .vertical-tabs .entity-meta.vertical-tabs__panes,#header #node-page-form .vertical-tabs .entity-meta.vertical-tabs__panes,#header form.node-form .vertical-tabs .entity-meta.vertical-tabs__panes,#header form.node-update-form .vertical-tabs .entity-meta.vertical-tabs__panes{padding:1.25rem}#footer #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#footer #node-page-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-update-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-update-form .vertical-tabs .vertical-tabs__menu-item{background-color:#f5f6f7;font-size:1rem}@media (min-width:37.5em){#footer #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#footer #node-page-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-update-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-update-form .vertical-tabs .vertical-tabs__menu-item{font-size:1rem}}@media (min-width:48em){#footer #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#footer #node-page-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-update-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-update-form .vertical-tabs .vertical-tabs__menu-item{font-size:.9rem}}@media (min-width:64em){#footer #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#footer #node-page-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-form .vertical-tabs .vertical-tabs__menu-item,#footer form.node-update-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item,#header #node-page-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-form .vertical-tabs .vertical-tabs__menu-item,#header form.node-update-form .vertical-tabs .vertical-tabs__menu-item{font-size:.9rem}}#footer #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item a,#footer #node-page-form .vertical-tabs .vertical-tabs__menu-item a,#footer form.node-form .vertical-tabs .vertical-tabs__menu-item a,#footer form.node-update-form .vertical-tabs .vertical-tabs__menu-item a,#header #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item a,#header #node-page-form .vertical-tabs .vertical-tabs__menu-item a,#header form.node-form .vertical-tabs .vertical-tabs__menu-item a,#header form.node-update-form .vertical-tabs .vertical-tabs__menu-item a{color:#777277;padding:1.125rem}#footer #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#footer #node-page-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#footer form.node-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#footer form.node-update-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#header #node-page-edit-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#header #node-page-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#header form.node-form .vertical-tabs .vertical-tabs__menu-item.is-selected,#header form.node-update-form .vertical-tabs .vertical-tabs__menu-item.is-selected{background-color:#fff;border-right-width:0}#footer #node-page-edit-form details,#footer #node-page-form details,#footer form.node-form details,#footer form.node-update-form details,#header #node-page-edit-form details,#header #node-page-form details,#header form.node-form details,#header form.node-update-form details{background-color:#fcfcfa;border:1px solid #bfbfbf;border-radius:3px;margin-bottom:1em;margin-top:1em;padding:.95em 1.45em}#footer #node-page-edit-form details summary,#footer #node-page-form details summary,#footer form.node-form details summary,#footer form.node-update-form details summary,#header #node-page-edit-form details summary,#header #node-page-form details summary,#header form.node-form details summary,#header form.node-update-form details summary{color:#0074bd;cursor:pointer;display:block;font-size:.8rem;font-weight:700;text-shadow:0 1px 0 #fff;text-transform:uppercase}#footer #node-page-edit-form details summary:focus,#footer #node-page-form details summary:focus,#footer form.node-form details summary:focus,#footer form.node-update-form details summary:focus,#header #node-page-edit-form details summary:focus,#header #node-page-form details summary:focus,#header form.node-form details summary:focus,#header form.node-update-form details summary:focus{color:#004f80;outline:none;text-decoration:underline}#footer #node-page-edit-form .form-item .description,#footer #node-page-edit-form div.description,#footer #node-page-edit-form ul.tips,#footer #node-page-form .form-item .description,#footer #node-page-form div.description,#footer #node-page-form ul.tips,#footer form.node-form .form-item .description,#footer form.node-form div.description,#footer form.node-form ul.tips,#footer form.node-update-form .form-item .description,#footer form.node-update-form div.description,#footer form.node-update-form ul.tips,#header #node-page-edit-form .form-item .description,#header #node-page-edit-form div.description,#header #node-page-edit-form ul.tips,#header #node-page-form .form-item .description,#header #node-page-form div.description,#header #node-page-form ul.tips,#header form.node-form .form-item .description,#header form.node-form div.description,#header form.node-form ul.tips,#header form.node-update-form .form-item .description,#header form.node-update-form div.description,#header form.node-update-form ul.tips{color:#595959;font-size:.8rem;margin:8px 0 0}#footer #node-page-edit-form button.link.js-media-library-widget-toggle-weight,#footer #node-page-form button.link.js-media-library-widget-toggle-weight,#footer form.node-form button.link.js-media-library-widget-toggle-weight,#footer form.node-update-form button.link.js-media-library-widget-toggle-weight,#header #node-page-edit-form button.link.js-media-library-widget-toggle-weight,#header #node-page-form button.link.js-media-library-widget-toggle-weight,#header form.node-form button.link.js-media-library-widget-toggle-weight,#header form.node-update-form button.link.js-media-library-widget-toggle-weight{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;color:#0074bd;cursor:pointer;display:inline;font-size:.9rem;margin:0;padding:0;position:absolute;right:15px;text-decoration:none;top:20px}#footer #node-page-edit-form fieldset:not(.fieldgroup),#footer #node-page-form fieldset:not(.fieldgroup),#footer form.node-form fieldset:not(.fieldgroup),#footer form.node-update-form fieldset:not(.fieldgroup),#header #node-page-edit-form fieldset:not(.fieldgroup),#header #node-page-form fieldset:not(.fieldgroup),#header form.node-form fieldset:not(.fieldgroup),#header form.node-update-form fieldset:not(.fieldgroup){border-radius:2px;margin:1em 0;min-width:0;padding:30px 18px 18px;position:relative}#footer #node-page-edit-form .js-hide,#footer #node-page-form .js-hide,#footer form.node-form .js-hide,#footer form.node-update-form .js-hide,#header #node-page-edit-form .js-hide,#header #node-page-form .js-hide,#header form.node-form .js-hide,#header form.node-update-form .js-hide{display:none!important}#footer #node-page-edit-form tr.draggable td:nth-child(2),#footer #node-page-form tr.draggable td:nth-child(2),#footer form.node-form tr.draggable td:nth-child(2),#footer form.node-update-form tr.draggable td:nth-child(2),#header #node-page-edit-form tr.draggable td:nth-child(2),#header #node-page-form tr.draggable td:nth-child(2),#header form.node-form tr.draggable td:nth-child(2),#header form.node-update-form tr.draggable td:nth-child(2){border-left:none}#footer #node-page-edit-form tr.draggable td.field-multiple-drag,#footer #node-page-form tr.draggable td.field-multiple-drag,#footer form.node-form tr.draggable td.field-multiple-drag,#footer form.node-update-form tr.draggable td.field-multiple-drag,#header #node-page-edit-form tr.draggable td.field-multiple-drag,#header #node-page-form tr.draggable td.field-multiple-drag,#header form.node-form tr.draggable td.field-multiple-drag,#header form.node-update-form tr.draggable td.field-multiple-drag{width:22px}#footer #node-page-edit-form tr.draggable td,#footer #node-page-form tr.draggable td,#footer form.node-form tr.draggable td,#footer form.node-update-form tr.draggable td,#header #node-page-edit-form tr.draggable td,#header #node-page-form tr.draggable td,#header form.node-form tr.draggable td,#header form.node-update-form tr.draggable td{font-size:1rem;padding:0;vertical-align:middle}#footer #node-page-edit-form tr.draggable td input,#footer #node-page-form tr.draggable td input,#footer form.node-form tr.draggable td input,#footer form.node-update-form tr.draggable td input,#header #node-page-edit-form tr.draggable td input,#header #node-page-form tr.draggable td input,#header form.node-form tr.draggable td input,#header form.node-update-form tr.draggable td input{height:auto}#footer #node-page-edit-form tr.draggable td a.tabledrag-handle,#footer #node-page-form tr.draggable td a.tabledrag-handle,#footer form.node-form tr.draggable td a.tabledrag-handle,#footer form.node-update-form tr.draggable td a.tabledrag-handle,#header #node-page-edit-form tr.draggable td a.tabledrag-handle,#header #node-page-form tr.draggable td a.tabledrag-handle,#header form.node-form tr.draggable td a.tabledrag-handle,#header form.node-update-form tr.draggable td a.tabledrag-handle{height:auto;margin-left:0}#footer #node-page-edit-form tr.draggable td a.tabledrag-handle .handle,#footer #node-page-form tr.draggable td a.tabledrag-handle .handle,#footer form.node-form tr.draggable td a.tabledrag-handle .handle,#footer form.node-update-form tr.draggable td a.tabledrag-handle .handle,#header #node-page-edit-form tr.draggable td a.tabledrag-handle .handle,#header #node-page-form tr.draggable td a.tabledrag-handle .handle,#header form.node-form tr.draggable td a.tabledrag-handle .handle,#header form.node-update-form tr.draggable td a.tabledrag-handle .handle{height:22px;width:22px}#footer #node-page-edit-form .ui-dialog,#footer #node-page-form .ui-dialog,#footer form.node-form .ui-dialog,#footer form.node-update-form .ui-dialog,#header #node-page-edit-form .ui-dialog,#header #node-page-form .ui-dialog,#header form.node-form .ui-dialog,#header form.node-update-form .ui-dialog{-webkit-box-shadow:0 5px 60px rgba(19,15,19,.25),0 1px 10px rgba(19,15,19,.5);box-shadow:0 5px 60px rgba(19,15,19,.25),0 1px 10px rgba(19,15,19,.5);font-family:IBM Plex Sans,Helvetica,Helvetica Neue,Arial,sans-serif;padding:0}#footer #node-page-edit-form .ui-dialog .ui-dialog-titlebar,#footer #node-page-edit-form .ui-draggable .ui-dialog-titlebar,#footer #node-page-form .ui-dialog .ui-dialog-titlebar,#footer #node-page-form .ui-draggable .ui-dialog-titlebar,#footer form.node-form .ui-dialog .ui-dialog-titlebar,#footer form.node-form .ui-draggable .ui-dialog-titlebar,#footer form.node-update-form .ui-dialog .ui-dialog-titlebar,#footer form.node-update-form .ui-draggable .ui-dialog-titlebar,#header #node-page-edit-form .ui-dialog .ui-dialog-titlebar,#header #node-page-edit-form .ui-draggable .ui-dialog-titlebar,#header #node-page-form .ui-dialog .ui-dialog-titlebar,#header #node-page-form .ui-draggable .ui-dialog-titlebar,#header form.node-form .ui-dialog .ui-dialog-titlebar,#header form.node-form .ui-draggable .ui-dialog-titlebar,#header form.node-update-form .ui-dialog .ui-dialog-titlebar,#header form.node-update-form .ui-draggable .ui-dialog-titlebar{padding:15px 30px}#footer #node-page-edit-form .ui-dialog .ui-dialog-titlebar-close,#footer #node-page-form .ui-dialog .ui-dialog-titlebar-close,#footer form.node-form .ui-dialog .ui-dialog-titlebar-close,#footer form.node-update-form .ui-dialog .ui-dialog-titlebar-close,#header #node-page-edit-form .ui-dialog .ui-dialog-titlebar-close,#header #node-page-form .ui-dialog .ui-dialog-titlebar-close,#header form.node-form .ui-dialog .ui-dialog-titlebar-close,#header form.node-update-form .ui-dialog .ui-dialog-titlebar-close{background:none;border:none;height:30px;margin:0;padding:0;right:30px;top:30px;-webkit-transform:translate(50%,-50%);-ms-transform:translate(50%,-50%);transform:translate(50%,-50%);width:30px}#footer #node-page-edit-form .ui-dialog .ui-dialog-titlebar-close:hover,#footer #node-page-form .ui-dialog .ui-dialog-titlebar-close:hover,#footer form.node-form .ui-dialog .ui-dialog-titlebar-close:hover,#footer form.node-update-form .ui-dialog .ui-dialog-titlebar-close:hover,#header #node-page-edit-form .ui-dialog .ui-dialog-titlebar-close:hover,#header #node-page-form .ui-dialog .ui-dialog-titlebar-close:hover,#header form.node-form .ui-dialog .ui-dialog-titlebar-close:hover,#header form.node-update-form .ui-dialog .ui-dialog-titlebar-close:hover{border:none}#footer #node-page-edit-form .ui-button .ui-icon,#footer #node-page-form .ui-button .ui-icon,#footer form.node-form .ui-button .ui-icon,#footer form.node-update-form .ui-button .ui-icon,#header #node-page-edit-form .ui-button .ui-icon,#header #node-page-form .ui-button .ui-icon,#header form.node-form .ui-button .ui-icon,#header form.node-update-form .ui-button .ui-icon{background:none;height:100%;left:0;margin:0;top:0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%;width:100%}#footer #node-page-edit-form .ui-button .ui-icon:before,#footer #node-page-form .ui-button .ui-icon:before,#footer form.node-form .ui-button .ui-icon:before,#footer form.node-update-form .ui-button .ui-icon:before,#header #node-page-edit-form .ui-button .ui-icon:before,#header #node-page-form .ui-button .ui-icon:before,#header form.node-form .ui-button .ui-icon:before,#header form.node-update-form .ui-button .ui-icon:before{background-color:#9d999d;content:"";height:100%;left:50%;margin-left:-1px;position:absolute;top:0;width:2px}#footer #node-page-edit-form .ui-button .ui-icon:after,#footer #node-page-form .ui-button .ui-icon:after,#footer form.node-form .ui-button .ui-icon:after,#footer form.node-update-form .ui-button .ui-icon:after,#header #node-page-edit-form .ui-button .ui-icon:after,#header #node-page-form .ui-button .ui-icon:after,#header form.node-form .ui-button .ui-icon:after,#header form.node-update-form .ui-button .ui-icon:after{background-color:#9d999d;content:"";height:2px;left:0;margin-top:-1px;position:absolute;top:50%;width:100%}#footer #node-page-edit-form .ui-button:hover .ui-icon,#footer #node-page-form .ui-button:hover .ui-icon,#footer form.node-form .ui-button:hover .ui-icon,#footer form.node-update-form .ui-button:hover .ui-icon,#header #node-page-edit-form .ui-button:hover .ui-icon,#header #node-page-form .ui-button:hover .ui-icon,#header form.node-form .ui-button:hover .ui-icon,#header form.node-update-form .ui-button:hover .ui-icon{background:none}#footer #node-page-edit-form .ui-button:hover .ui-icon:after,#footer #node-page-edit-form .ui-button:hover .ui-icon:before,#footer #node-page-form .ui-button:hover .ui-icon:after,#footer #node-page-form .ui-button:hover .ui-icon:before,#footer form.node-form .ui-button:hover .ui-icon:after,#footer form.node-form .ui-button:hover .ui-icon:before,#footer form.node-update-form .ui-button:hover .ui-icon:after,#footer form.node-update-form .ui-button:hover .ui-icon:before,#header #node-page-edit-form .ui-button:hover .ui-icon:after,#header #node-page-edit-form .ui-button:hover .ui-icon:before,#header #node-page-form .ui-button:hover .ui-icon:after,#header #node-page-form .ui-button:hover .ui-icon:before,#header form.node-form .ui-button:hover .ui-icon:after,#header form.node-form .ui-button:hover .ui-icon:before,#header form.node-update-form .ui-button:hover .ui-icon:after,#header form.node-update-form .ui-button:hover .ui-icon:before{background:#504b50}#footer #node-page-edit-form .ui-dialog .ui-dialog-title,#footer #node-page-form .ui-dialog .ui-dialog-title,#footer form.node-form .ui-dialog .ui-dialog-title,#footer form.node-update-form .ui-dialog .ui-dialog-title,#header #node-page-edit-form .ui-dialog .ui-dialog-title,#header #node-page-form .ui-dialog .ui-dialog-title,#header form.node-form .ui-dialog .ui-dialog-title,#header form.node-update-form .ui-dialog .ui-dialog-title{line-height:30px;margin:0}#footer #node-page-edit-form .ui-dialog .ui-dialog-content,#footer #node-page-form .ui-dialog .ui-dialog-content,#footer form.node-form .ui-dialog .ui-dialog-content,#footer form.node-update-form .ui-dialog .ui-dialog-content,#header #node-page-edit-form .ui-dialog .ui-dialog-content,#header #node-page-form .ui-dialog .ui-dialog-content,#header form.node-form .ui-dialog .ui-dialog-content,#header form.node-update-form .ui-dialog .ui-dialog-content{padding:30px}#footer #node-page-edit-form .ui-corner-all,#footer #node-page-edit-form .ui-corner-bl,#footer #node-page-edit-form .ui-corner-bottom,#footer #node-page-edit-form .ui-corner-left,#footer #node-page-form .ui-corner-all,#footer #node-page-form .ui-corner-bl,#footer #node-page-form .ui-corner-bottom,#footer #node-page-form .ui-corner-left,#footer form.node-form .ui-corner-all,#footer form.node-form .ui-corner-bl,#footer form.node-form .ui-corner-bottom,#footer form.node-form .ui-corner-left,#footer form.node-update-form .ui-corner-all,#footer form.node-update-form .ui-corner-bl,#footer form.node-update-form .ui-corner-bottom,#footer form.node-update-form .ui-corner-left,#header #node-page-edit-form .ui-corner-all,#header #node-page-edit-form .ui-corner-bl,#header #node-page-edit-form .ui-corner-bottom,#header #node-page-edit-form .ui-corner-left,#header #node-page-form .ui-corner-all,#header #node-page-form .ui-corner-bl,#header #node-page-form .ui-corner-bottom,#header #node-page-form .ui-corner-left,#header form.node-form .ui-corner-all,#header form.node-form .ui-corner-bl,#header form.node-form .ui-corner-bottom,#header form.node-form .ui-corner-left,#header form.node-update-form .ui-corner-all,#header form.node-update-form .ui-corner-bl,#header form.node-update-form .ui-corner-bottom,#header form.node-update-form .ui-corner-left{border:0;border-radius:0}#footer #node-page-edit-form .ui-widget.ui-widget-content,#footer #node-page-form .ui-widget.ui-widget-content,#footer form.node-form .ui-widget.ui-widget-content,#footer form.node-update-form .ui-widget.ui-widget-content,#header #node-page-edit-form .ui-widget.ui-widget-content,#header #node-page-form .ui-widget.ui-widget-content,#header form.node-form .ui-widget.ui-widget-content,#header form.node-update-form .ui-widget.ui-widget-content{border:none}#footer #node-page-edit-form .horizontal-tabs,#footer #node-page-form .horizontal-tabs,#footer form.node-form .horizontal-tabs,#footer form.node-update-form .horizontal-tabs,#header #node-page-edit-form .horizontal-tabs,#header #node-page-form .horizontal-tabs,#header form.node-form .horizontal-tabs,#header form.node-update-form .horizontal-tabs{background:transparent;border:none;padding:0}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list{border-bottom:none;margin:0 -.5rem;padding:.5rem .5rem 0}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list:before,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list:before,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list:before,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list:before,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list:after,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list:before,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list:after,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list:before,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list:after,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list:before,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list:after,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list:before{content:" ";display:table}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list:after,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list:after,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list:after,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list:after,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list:after,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list:after{clear:both}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li{display:block;float:left;list-style:none;margin-bottom:0;margin-right:1px;margin-top:0;min-width:0;padding:0}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a{display:block;font-family:IBM Plex Sans,Helvetica,Helvetica Neue,Arial,sans-serif;font-size:calc(12.02326px + .23256vw);font-weight:600;letter-spacing:.05em;padding:.5rem 1rem;text-decoration:none;text-transform:uppercase;-webkit-transition:all .15s ease-in-out;-o-transition:all .15s ease-in-out;transition:all .15s ease-in-out}@media screen and (min-width:1280px){#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a{font-size:15px}}@media screen and (max-width:420px){#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a{font-size:13px}}#footer #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a{background-color:#777277;border-radius:0;color:#e1e0e1}#footer #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#footer #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#footer form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#footer form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#header #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header #node-page-edit-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#header #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header #node-page-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#header form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header form.node-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover,#header form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header form.node-update-form .tabs--primary .horizontal-tabs ul.horizontal-tabs-list>li.selected>a:hover{background-color:#9d999d}#footer #node-page-edit-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer #node-page-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#footer form.node-update-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-edit-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#header #node-page-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a,#header form.node-update-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a{border-radius:0}#footer #node-page-edit-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer #node-page-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer form.node-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#footer form.node-update-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header #node-page-edit-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header #node-page-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header form.node-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover,#header form.node-update-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a:hover{background-color:#e1e0e1}#footer #node-page-edit-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#footer #node-page-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#footer form.node-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#footer form.node-update-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#header #node-page-edit-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#header #node-page-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#header form.node-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active,#header form.node-update-form .tabs--secondary .horizontal-tabs ul.horizontal-tabs-list>li a.is-active{text-decoration:underline}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.is-active>a:hover,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li.selected>a{background-color:#fff;color:#261f26}#footer #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#footer #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#footer form.node-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#footer form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#header #node-page-edit-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#header #node-page-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#header form.node-form .horizontal-tabs ul.horizontal-tabs-list>li:before,#header form.node-update-form .horizontal-tabs ul.horizontal-tabs-list>li:before{content:none}#footer #node-page-edit-form .horizontal-tabs .horizontal-tabs-pane,#footer #node-page-form .horizontal-tabs .horizontal-tabs-pane,#footer form.node-form .horizontal-tabs .horizontal-tabs-pane,#footer form.node-update-form .horizontal-tabs .horizontal-tabs-pane,#header #node-page-edit-form .horizontal-tabs .horizontal-tabs-pane,#header #node-page-form .horizontal-tabs .horizontal-tabs-pane,#header form.node-form .horizontal-tabs .horizontal-tabs-pane,#header form.node-update-form .horizontal-tabs .horizontal-tabs-pane{padding:0}#footer #node-page-edit-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#footer #node-page-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#footer form.node-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#footer form.node-update-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#header #node-page-edit-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#header #node-page-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#header form.node-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper,#header form.node-update-form .horizontal-tabs .horizontal-tabs-panes>details>.details-wrapper{padding:1.875rem 0}#footer #node-page-edit-form .entities-list .item-container,#footer #node-page-form .entities-list .item-container,#footer form.node-form .entities-list .item-container,#footer form.node-update-form .entities-list .item-container,#header #node-page-edit-form .entities-list .item-container,#header #node-page-form .entities-list .item-container,#header form.node-form .entities-list .item-container,#header form.node-update-form .entities-list .item-container{display:-webkit-box;display:flex;flex-wrap:wrap;width:40%}#footer #node-page-edit-form .entities-list .item-container figure,#footer #node-page-form .entities-list .item-container figure,#footer form.node-form .entities-list .item-container figure,#footer form.node-update-form .entities-list .item-container figure,#header #node-page-edit-form .entities-list .item-container figure,#header #node-page-form .entities-list .item-container figure,#header form.node-form .entities-list .item-container figure,#header form.node-update-form .entities-list .item-container figure{width:100%}#footer #node-page-edit-form .entities-list .item-container>input.button,#footer #node-page-form .entities-list .item-container>input.button,#footer form.node-form .entities-list .item-container>input.button,#footer form.node-update-form .entities-list .item-container>input.button,#header #node-page-edit-form .entities-list .item-container>input.button,#header #node-page-form .entities-list .item-container>input.button,#header form.node-form .entities-list .item-container>input.button,#header form.node-update-form .entities-list .item-container>input.button{width:50%}#footer #node-page-edit-form .entities-list .item-container>input.remove-button,#footer #node-page-form .entities-list .item-container>input.remove-button,#footer form.node-form .entities-list .item-container>input.remove-button,#footer form.node-update-form .entities-list .item-container>input.remove-button,#header #node-page-edit-form .entities-list .item-container>input.remove-button,#header #node-page-form .entities-list .item-container>input.remove-button,#header form.node-form .entities-list .item-container>input.remove-button,#header form.node-update-form .entities-list .item-container>input.remove-button{border-bottom-right-radius:0;border-top-right-radius:0}#footer #node-page-edit-form .entities-list .item-container>input.edit-button,#footer #node-page-form .entities-list .item-container>input.edit-button,#footer form.node-form .entities-list .item-container>input.edit-button,#footer form.node-update-form .entities-list .item-container>input.edit-button,#header #node-page-edit-form .entities-list .item-container>input.edit-button,#header #node-page-form .entities-list .item-container>input.edit-button,#header form.node-form .entities-list .item-container>input.edit-button,#header form.node-update-form .entities-list .item-container>input.edit-button{border-bottom-left-radius:0;border-top-left-radius:0;margin-left:-1px}#footer #node-page-edit-form .entities-list.sortable .item-container,#footer #node-page-form .entities-list.sortable .item-container,#footer form.node-form .entities-list.sortable .item-container,#footer form.node-update-form .entities-list.sortable .item-container,#header #node-page-edit-form .entities-list.sortable .item-container,#header #node-page-form .entities-list.sortable .item-container,#header form.node-form .entities-list.sortable .item-container,#header form.node-update-form .entities-list.sortable .item-container{margin:2px;padding:12px}#footer #node-page-edit-form .entities-list.sortable .item-container:hover,#footer #node-page-form .entities-list.sortable .item-container:hover,#footer form.node-form .entities-list.sortable .item-container:hover,#footer form.node-update-form .entities-list.sortable .item-container:hover,#header #node-page-edit-form .entities-list.sortable .item-container:hover,#header #node-page-form .entities-list.sortable .item-container:hover,#header form.node-form .entities-list.sortable .item-container:hover,#header form.node-update-form .entities-list.sortable .item-container:hover{opacity:1}#footer #node-page-edit-form .entities-list.sortable .item-container:hover figure,#footer #node-page-form .entities-list.sortable .item-container:hover figure,#footer form.node-form .entities-list.sortable .item-container:hover figure,#footer form.node-update-form .entities-list.sortable .item-container:hover figure,#header #node-page-edit-form .entities-list.sortable .item-container:hover figure,#header #node-page-form .entities-list.sortable .item-container:hover figure,#header form.node-form .entities-list.sortable .item-container:hover figure,#header form.node-update-form .entities-list.sortable .item-container:hover figure{background-color:#fff}#footer #node-page-edit-form .js-pager__items,#footer #node-page-form .js-pager__items,#footer form.node-form .js-pager__items,#footer form.node-update-form .js-pager__items,#header #node-page-edit-form .js-pager__items,#header #node-page-form .js-pager__items,#header form.node-form .js-pager__items,#header form.node-update-form .js-pager__items{list-style-type:none;margin:0;padding:0}#footer #node-page-edit-form .views-infinite-scroll-content-wrapper+.js-pager__items,#footer #node-page-form .views-infinite-scroll-content-wrapper+.js-pager__items,#footer form.node-form .views-infinite-scroll-content-wrapper+.js-pager__items,#footer form.node-update-form .views-infinite-scroll-content-wrapper+.js-pager__items,#header #node-page-edit-form .views-infinite-scroll-content-wrapper+.js-pager__items,#header #node-page-form .views-infinite-scroll-content-wrapper+.js-pager__items,#header form.node-form .views-infinite-scroll-content-wrapper+.js-pager__items,#header form.node-update-form .views-infinite-scroll-content-wrapper+.js-pager__items{margin-top:.75rem}#footer #node-page-edit-form .js-form-type-checkbox:not(:last-child),#footer #node-page-form .js-form-type-checkbox:not(:last-child),#footer form.node-form .js-form-type-checkbox:not(:last-child),#footer form.node-update-form .js-form-type-checkbox:not(:last-child),#header #node-page-edit-form .js-form-type-checkbox:not(:last-child),#header #node-page-form .js-form-type-checkbox:not(:last-child),#header form.node-form .js-form-type-checkbox:not(:last-child),#header form.node-update-form .js-form-type-checkbox:not(:last-child){margin-bottom:.375rem}#footer #node-page-edit-form .js-form-type-checkbox:not(:first-child),#footer #node-page-form .js-form-type-checkbox:not(:first-child),#footer form.node-form .js-form-type-checkbox:not(:first-child),#footer form.node-update-form .js-form-type-checkbox:not(:first-child),#header #node-page-edit-form .js-form-type-checkbox:not(:first-child),#header #node-page-form .js-form-type-checkbox:not(:first-child),#header form.node-form .js-form-type-checkbox:not(:first-child),#header form.node-update-form .js-form-type-checkbox:not(:first-child){margin-top:.375rem}#footer #node-page-edit-form .entity-browser-media-browser-form,#footer #node-page-form .entity-browser-media-browser-form,#footer form.node-form .entity-browser-media-browser-form,#footer form.node-update-form .entity-browser-media-browser-form,#header #node-page-edit-form .entity-browser-media-browser-form,#header #node-page-form .entity-browser-media-browser-form,#header form.node-form .entity-browser-media-browser-form,#header form.node-update-form .entity-browser-media-browser-form{padding-bottom:4.5rem}#footer #node-page-edit-form .eb-media+.form-actions.form-wrapper,#footer #node-page-form .eb-media+.form-actions.form-wrapper,#footer form.node-form .eb-media+.form-actions.form-wrapper,#footer form.node-update-form .eb-media+.form-actions.form-wrapper,#header #node-page-edit-form .eb-media+.form-actions.form-wrapper,#header #node-page-form .eb-media+.form-actions.form-wrapper,#header form.node-form .eb-media+.form-actions.form-wrapper,#header form.node-update-form .eb-media+.form-actions.form-wrapper{background-color:#504b50;bottom:0;left:0;margin-top:0;padding:.75rem;position:fixed;right:0}#footer #node-page-edit-form .entity-browser-iframe-container,#footer #node-page-form .entity-browser-iframe-container,#footer form.node-form .entity-browser-iframe-container,#footer form.node-update-form .entity-browser-iframe-container,#header #node-page-edit-form .entity-browser-iframe-container,#header #node-page-form .entity-browser-iframe-container,#header form.node-form .entity-browser-iframe-container,#header form.node-update-form .entity-browser-iframe-container{position:relative}#footer #node-page-edit-form .entity-browser-iframe-container iframe,#footer #node-page-form .entity-browser-iframe-container iframe,#footer form.node-form .entity-browser-iframe-container iframe,#footer form.node-update-form .entity-browser-iframe-container iframe,#header #node-page-edit-form .entity-browser-iframe-container iframe,#header #node-page-form .entity-browser-iframe-container iframe,#header form.node-form .entity-browser-iframe-container iframe,#header form.node-update-form .entity-browser-iframe-container iframe{display:block}#footer #node-page-edit-form .entity-browser-iframe-container:before,#footer #node-page-form .entity-browser-iframe-container:before,#footer form.node-form .entity-browser-iframe-container:before,#footer form.node-update-form .entity-browser-iframe-container:before,#header #node-page-edit-form .entity-browser-iframe-container:before,#header #node-page-form .entity-browser-iframe-container:before,#header form.node-form .entity-browser-iframe-container:before,#header form.node-update-form .entity-browser-iframe-container:before{-webkit-box-shadow:inset 0 0 5px rgba(19,15,19,.25);box-shadow:inset 0 0 5px rgba(19,15,19,.25);content:"";height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%;z-index:504}#footer #node-page-edit-form .page-node-add dl,#footer #node-page-form .page-node-add dl,#footer form.node-form .page-node-add dl,#footer form.node-update-form .page-node-add dl,#header #node-page-edit-form .page-node-add dl,#header #node-page-form .page-node-add dl,#header form.node-form .page-node-add dl,#header form.node-update-form .page-node-add dl{border-bottom:1px dotted #c3c1c3;padding-bottom:.9rem}#footer #node-page-edit-form .page-node-add dl dd,#footer #node-page-edit-form .page-node-add dl dt,#footer #node-page-form .page-node-add dl dd,#footer #node-page-form .page-node-add dl dt,#footer form.node-form .page-node-add dl dd,#footer form.node-form .page-node-add dl dt,#footer form.node-update-form .page-node-add dl dd,#footer form.node-update-form .page-node-add dl dt,#header #node-page-edit-form .page-node-add dl dd,#header #node-page-edit-form .page-node-add dl dt,#header #node-page-form .page-node-add dl dd,#header #node-page-form .page-node-add dl dt,#header form.node-form .page-node-add dl dd,#header form.node-form .page-node-add dl dt,#header form.node-update-form .page-node-add dl dd,#header form.node-update-form .page-node-add dl dt{font-size:calc(13.05882px + .29412vw)}@media screen and (min-width:1680px){#footer #node-page-edit-form .page-node-add dl dd,#footer #node-page-edit-form .page-node-add dl dt,#footer #node-page-form .page-node-add dl dd,#footer #node-page-form .page-node-add dl dt,#footer form.node-form .page-node-add dl dd,#footer form.node-form .page-node-add dl dt,#footer form.node-update-form .page-node-add dl dd,#footer form.node-update-form .page-node-add dl dt,#header #node-page-edit-form .page-node-add dl dd,#header #node-page-edit-form .page-node-add dl dt,#header #node-page-form .page-node-add dl dd,#header #node-page-form .page-node-add dl dt,#header form.node-form .page-node-add dl dd,#header form.node-form .page-node-add dl dt,#header form.node-update-form .page-node-add dl dd,#header form.node-update-form .page-node-add dl dt{font-size:18px}}@media screen and (max-width:320px){#footer #node-page-edit-form .page-node-add dl dd,#footer #node-page-edit-form .page-node-add dl dt,#footer #node-page-form .page-node-add dl dd,#footer #node-page-form .page-node-add dl dt,#footer form.node-form .page-node-add dl dd,#footer form.node-form .page-node-add dl dt,#footer form.node-update-form .page-node-add dl dd,#footer form.node-update-form .page-node-add dl dt,#header #node-page-edit-form .page-node-add dl dd,#header #node-page-edit-form .page-node-add dl dt,#header #node-page-form .page-node-add dl dd,#header #node-page-form .page-node-add dl dt,#header form.node-form .page-node-add dl dd,#header form.node-form .page-node-add dl dt,#header form.node-update-form .page-node-add dl dd,#header form.node-update-form .page-node-add dl dt{font-size:14px}}#footer #node-page-edit-form .page-node-add dl dt,#footer #node-page-form .page-node-add dl dt,#footer form.node-form .page-node-add dl dt,#footer form.node-update-form .page-node-add dl dt,#header #node-page-edit-form .page-node-add dl dt,#header #node-page-form .page-node-add dl dt,#header form.node-form .page-node-add dl dt,#header form.node-update-form .page-node-add dl dt{border-top:1px dotted #c3c1c3;margin-top:1.125rem;padding-top:1.125rem}#footer #node-page-edit-form .page-node-add dl dt:first-child,#footer #node-page-form .page-node-add dl dt:first-child,#footer form.node-form .page-node-add dl dt:first-child,#footer form.node-update-form .page-node-add dl dt:first-child,#header #node-page-edit-form .page-node-add dl dt:first-child,#header #node-page-form .page-node-add dl dt:first-child,#header form.node-form .page-node-add dl dt:first-child,#header form.node-update-form .page-node-add dl dt:first-child{margin-top:0}#footer #node-page-edit-form .page-node-add dl dt a,#footer #node-page-form .page-node-add dl dt a,#footer form.node-form .page-node-add dl dt a,#footer form.node-update-form .page-node-add dl dt a,#header #node-page-edit-form .page-node-add dl dt a,#header #node-page-form .page-node-add dl dt a,#header form.node-form .page-node-add dl dt a,#header form.node-update-form .page-node-add dl dt a{color:#130f13;display:block;font-weight:500}#footer #node-page-edit-form .page-node-add dl dd,#footer #node-page-form .page-node-add dl dd,#footer form.node-form .page-node-add dl dd,#footer form.node-update-form .page-node-add dl dd,#header #node-page-edit-form .page-node-add dl dd,#header #node-page-form .page-node-add dl dd,#header form.node-form .page-node-add dl dd,#header form.node-update-form .page-node-add dl dd{color:#777277;margin:0;width:80%}@media (min-width:48em){#footer #node-page-edit-form .page-node-add dl,#footer #node-page-form .page-node-add dl,#footer form.node-form .page-node-add dl,#footer form.node-update-form .page-node-add dl,#header #node-page-edit-form .page-node-add dl,#header #node-page-form .page-node-add dl,#header form.node-form .page-node-add dl,#header form.node-update-form .page-node-add dl{display:-webkit-box;display:flex;flex-wrap:wrap}#footer #node-page-edit-form .page-node-add dl dt,#footer #node-page-form .page-node-add dl dt,#footer form.node-form .page-node-add dl dt,#footer form.node-update-form .page-node-add dl dt,#header #node-page-edit-form .page-node-add dl dt,#header #node-page-form .page-node-add dl dt,#header form.node-form .page-node-add dl dt,#header form.node-update-form .page-node-add dl dt{width:20%}#footer #node-page-edit-form .page-node-add dl dd,#footer #node-page-form .page-node-add dl dd,#footer form.node-form .page-node-add dl dd,#footer form.node-update-form .page-node-add dl dd,#header #node-page-edit-form .page-node-add dl dd,#header #node-page-form .page-node-add dl dd,#header form.node-form .page-node-add dl dd,#header form.node-update-form .page-node-add dl dd{border-top:1px dotted #c3c1c3;margin-top:1.125rem;padding-top:1.125rem;width:80%}#footer #node-page-edit-form .page-node-add dl dt:first-child+dd,#footer #node-page-form .page-node-add dl dt:first-child+dd,#footer form.node-form .page-node-add dl dt:first-child+dd,#footer form.node-update-form .page-node-add dl dt:first-child+dd,#header #node-page-edit-form .page-node-add dl dt:first-child+dd,#header #node-page-form .page-node-add dl dt:first-child+dd,#header form.node-form .page-node-add dl dt:first-child+dd,#header form.node-update-form .page-node-add dl dt:first-child+dd{margin-top:0}}#footer #node-page-edit-form .paragraph--type--webform .form-item:not(:last-child),#footer #node-page-edit-form .paragraph--type--webform h2,#footer #node-page-form .paragraph--type--webform .form-item:not(:last-child),#footer #node-page-form .paragraph--type--webform h2,#footer form.node-form .paragraph--type--webform .form-item:not(:last-child),#footer form.node-form .paragraph--type--webform h2,#footer form.node-update-form .paragraph--type--webform .form-item:not(:last-child),#footer form.node-update-form .paragraph--type--webform h2,#header #node-page-edit-form .paragraph--type--webform .form-item:not(:last-child),#header #node-page-edit-form .paragraph--type--webform h2,#header #node-page-form .paragraph--type--webform .form-item:not(:last-child),#header #node-page-form .paragraph--type--webform h2,#header form.node-form .paragraph--type--webform .form-item:not(:last-child),#header form.node-form .paragraph--type--webform h2,#header form.node-update-form .paragraph--type--webform .form-item:not(:last-child),#header form.node-update-form .paragraph--type--webform h2{margin-bottom:3.75rem}#footer #node-page-edit-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#footer #node-page-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#footer form.node-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#footer form.node-update-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#header #node-page-edit-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#header #node-page-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#header form.node-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label,#header form.node-update-form .entity-type-text.ui-dialog-content .field--name-field-content .js-form-type-textarea label{display:none}#footer #node-page-edit-form .cke_bottom,#footer #node-page-form .cke_bottom,#footer form.node-form .cke_bottom,#footer form.node-update-form .cke_bottom,#header #node-page-edit-form .cke_bottom,#header #node-page-form .cke_bottom,#header form.node-form .cke_bottom,#header form.node-update-form .cke_bottom{display:none!important}#footer .js-component,#header .js-component{position:relative;z-index:1}#footer .views-element-container,#header .views-element-container{margin-bottom:1.875rem}@media (min-width:1200px){#footer .views-element-container,#header .views-element-container{margin-bottom:3.75rem}}#footer .paragraph--type--section .layout .l__region .views-element-container,#header .paragraph--type--section .layout .l__region .views-element-container{margin-bottom:0}#footer .view--empty,#header .view--empty{margin-top:1.875rem}@media (min-width:1200px){#footer .view--empty,#header .view--empty{margin-top:3.75rem}}#footer .view--empty p,#header .view--empty p{color:#565a5c;font-weight:400;line-height:1.5}@media (min-width:0px){#footer .view--empty p,#header .view--empty p{font-size:1rem}}@media (min-width:600px){#footer .view--empty p,#header .view--empty p{font-size:1.125rem}}#footer .view--empty p:first-child,#header .view--empty p:first-child{margin-top:0}#footer .view--empty p:last-child,#header .view--empty p:last-child{margin-bottom:0}@media (min-width:0px){#footer .views-view-grid.cols-3,#header .views-view-grid.cols-3{font-size:.75rem}}@media (min-width:600px){#footer .views-view-grid.cols-3,#header .views-view-grid.cols-3{font-size:.8125rem}}#footer .views-view-grid.cols-3 .views-col,#header .views-view-grid.cols-3 .views-col{border-left:1px solid #d7d9d9;padding:1rem 1.25rem}#footer .views-view-grid.cols-3 .views-col:first-child,#header .views-view-grid.cols-3 .views-col:first-child{border-left:none}#footer .views-view-grid.cols-3 .views-row,#header .views-view-grid.cols-3 .views-row{margin-bottom:0}#footer table td.views-field-entity-browser-select,#header table td.views-field-entity-browser-select{vertical-align:middle}#footer table td.views-field-entity-browser-select .js-form-item input.form-checkbox,#header table td.views-field-entity-browser-select .js-form-item input.form-checkbox{position:static}@media (min-width:0px) and (max-width:1199.98px){#footer .js-prevent-scroll,#header .js-prevent-scroll{height:100%;overflow:hidden;position:fixed;width:100%}}#footer .header,#header .header{background-color:#fff;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);box-shadow:0 1px 3px rgba(0,0,0,.25),0 1px 1px rgba(0,0,0,.25);position:fixed;top:0;width:100%;z-index:99}#footer .header__inner,#header .header__inner{background-color:#fff;display:-webkit-box;display:flex;height:120px;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;flex-wrap:nowrap;-webkit-box-pack:justify;justify-content:space-between}@media (min-width:0px) and (max-width:1199.98px){#footer .header__inner,#header .header__inner{-webkit-box-align:center;align-items:center;height:60px}}#footer [id],#header [id]{scroll-margin-top:120px}@media (min-width:0px) and (max-width:1199.98px){#footer [id],#header [id]{scroll-margin-top:60px}}#footer .header__logo,#header .header__logo{-webkit-box-align:center;align-items:center;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;padding:0;width:88px;z-index:1}#footer .header__logo a,#footer .header__logo img,#header .header__logo a,#header .header__logo img{display:block;width:100%}@media (min-width:992px){#footer .header__logo,#header .header__logo{margin:24px 0;width:140px}}@media (min-width:1200px){#footer .header__logo,#header .header__logo{margin:24px 0;width:140px}}@media (min-width:0px) and (max-width:1199.98px){#footer .header__site-navigation,#header .header__site-navigation{bottom:0;left:0;position:fixed;right:0;top:60px;width:100%;z-index:-1}}@media (min-width:1200px){#footer .header__site-navigation,#header .header__site-navigation{-webkit-box-align:end;align-items:flex-end;-webkit-box-align:center;align-items:center;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;flex-wrap:nowrap}}@media (min-width:0px) and (max-width:1199.98px){#footer body.user-logged-in .header__site-navigation,#header body.user-logged-in .header__site-navigation{top:99px}#footer body.toolbar-fixed.toolbar-tray-open .header__site-navigation,#header body.toolbar-fixed.toolbar-tray-open .header__site-navigation{top:138px}}#footer .header__utilities,#header .header__utilities{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;height:90px;-webkit-box-pack:end;justify-content:flex-end;margin-bottom:22px;width:126px}@media (min-width:992px) and (max-width:1199.98px){#footer .header__utilities,#header .header__utilities{height:66px;width:90px}}#footer .nav-trigger,#header .nav-trigger{clip:rect(0,0,0,0);position:absolute}#footer label[for=nav-trigger],#header label[for=nav-trigger]{cursor:pointer;height:30px;margin:auto;position:absolute;right:30px;width:30px;z-index:2}@media (min-width:1200px){#footer label[for=nav-trigger],#header label[for=nav-trigger]{display:none}}#footer .nav-trigger__icon,#header .nav-trigger__icon{bottom:0;left:0;margin:auto;position:absolute;right:0;top:0}#footer .nav-trigger__icon path,#header .nav-trigger__icon path{fill:#0073cf}#footer .nav-trigger__icon--expand,#header .nav-trigger__icon--expand{bottom:0;left:0;margin:auto;opacity:1;position:absolute;right:0;top:0;-webkit-transform:rotate(0) scale(1);-ms-transform:rotate(0) scale(1);transform:rotate(0) scale(1);-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}#footer .nav-trigger__icon--collapse,#header .nav-trigger__icon--collapse{margin:auto;opacity:0;position:absolute;-webkit-transform:rotate(-90deg) scale(0);-ms-transform:rotate(-90deg) scale(0);transform:rotate(-90deg) scale(0);-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}@media (min-width:0px) and (max-width:1199.98px){#footer .header__site-navigation,#header .header__site-navigation{opacity:0;-webkit-transform:translateY(-100%);-ms-transform:translateY(-100%);transform:translateY(-100%);-webkit-transition:all .375s ease-in-out;-o-transition:all .375s ease-in-out;transition:all .375s ease-in-out}#footer .nav-trigger:checked~.header__site-navigation,#header .nav-trigger:checked~.header__site-navigation{opacity:1;overflow-y:auto;-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}#footer .nav-trigger:checked~label .nav-trigger__icon--collapse,#header .nav-trigger:checked~label .nav-trigger__icon--collapse{opacity:1;-webkit-transform:rotate(0) scale(1);-ms-transform:rotate(0) scale(1);transform:rotate(0) scale(1)}#footer .nav-trigger:checked~label .nav-trigger__icon--expand,#header .nav-trigger:checked~label .nav-trigger__icon--expand{opacity:0;-webkit-transform:rotate(90deg) scale(0);-ms-transform:rotate(90deg) scale(0);transform:rotate(90deg) scale(0)}#footer nav#block-neon-main-menu>ul,#header nav#block-neon-main-menu>ul{background:#fff;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.5);box-shadow:0 2px 4px rgba(0,0,0,.5);height:100%;margin:0;overflow-x:hidden;padding:0;width:100%}#footer nav#block-neon-main-menu>ul li,#header nav#block-neon-main-menu>ul li{border-left:6px solid #fff;display:-webkit-box;display:flex;margin:12px auto;padding:15px 30px 18px 24px;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center}#footer nav#block-neon-main-menu>ul li.menu__item.menu__item--expanded:hover,#header nav#block-neon-main-menu>ul li.menu__item.menu__item--expanded:hover{border-left:6px solid #0073cf;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}#footer nav#block-neon-main-menu>ul li a,#header nav#block-neon-main-menu>ul li a{color:#0073cf;display:inline-block;font-size:18px;font-weight:600;line-height:30px;text-decoration:none}#footer nav#block-neon-main-menu>ul li>.arrow,#header nav#block-neon-main-menu>ul li>.arrow{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:3px;height:24px;margin-top:0;right:26px;-webkit-transition:all .15s ease-in-out;-o-transition:all .15s ease-in-out;transition:all .15s ease-in-out;width:24px;clip:auto;opacity:1;-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg);visibility:visible}#footer nav#block-neon-main-menu>ul li>.arrow svg,#header nav#block-neon-main-menu>ul li>.arrow svg{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}#footer nav#block-neon-main-menu>ul li>.arrow svg path,#header nav#block-neon-main-menu>ul li>.arrow svg path{stroke:#0073cf}#footer nav#block-neon-main-menu>ul li>.arrow:active,#footer nav#block-neon-main-menu>ul li>.arrow:focus,#footer nav#block-neon-main-menu>ul li>.arrow:hover,#footer nav#block-neon-main-menu>ul li>.arrow[focus-within],#header nav#block-neon-main-menu>ul li>.arrow:active,#header nav#block-neon-main-menu>ul li>.arrow:focus,#header nav#block-neon-main-menu>ul li>.arrow:hover,#header nav#block-neon-main-menu>ul li>.arrow[focus-within]{background:none;position:absolute!important}}@media (min-width:0px) and (max-width:1199.98px){#footer nav#block-neon-main-menu>ul li>.arrow:active,#footer nav#block-neon-main-menu>ul li>.arrow:focus,#footer nav#block-neon-main-menu>ul li>.arrow:focus-within,#footer nav#block-neon-main-menu>ul li>.arrow:hover,#header nav#block-neon-main-menu>ul li>.arrow:active,#header nav#block-neon-main-menu>ul li>.arrow:focus,#header nav#block-neon-main-menu>ul li>.arrow:focus-within,#header nav#block-neon-main-menu>ul li>.arrow:hover{position:absolute!important}#footer nav#block-neon-main-menu>ul li>.arrow:active,#footer nav#block-neon-main-menu>ul li>.arrow:focus,#footer nav#block-neon-main-menu>ul li>.arrow:focus-within,#footer nav#block-neon-main-menu>ul li>.arrow:hover,#header nav#block-neon-main-menu>ul li>.arrow:active,#header nav#block-neon-main-menu>ul li>.arrow:focus,#header nav#block-neon-main-menu>ul li>.arrow:focus-within,#header nav#block-neon-main-menu>ul li>.arrow:hover{background:none}#footer nav#block-neon-main-menu>ul>li.myAccount,#footer nav#block-neon-main-menu>ul>li.siteSearch,#header nav#block-neon-main-menu>ul>li.myAccount,#header nav#block-neon-main-menu>ul>li.siteSearch{background:#f5f6f7;border:none;margin:0}#footer nav#block-neon-main-menu>ul>li.myAccount,#header nav#block-neon-main-menu>ul>li.myAccount{-webkit-box-flex:0;flex:none;text-align:center;width:100%}#footer nav#block-neon-main-menu>ul>li.myAccount a,#header nav#block-neon-main-menu>ul>li.myAccount a{background:#e4e6e7;border:1px solid #e4e6e7;border-radius:2px;color:#565a5c;font-size:12px;font-weight:600;letter-spacing:1.2px;padding:6px 12px;text-decoration:none;text-transform:uppercase;-webkit-transition:all .15s ease;-o-transition:all .15s ease;transition:all .15s ease}#footer nav#block-neon-main-menu>ul>li.myAccount a:hover,#header nav#block-neon-main-menu>ul>li.myAccount a:hover{color:#0073cf;-webkit-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease}#footer nav#block-neon-main-menu>ul>li.menu__item.menu__item--expanded.over>.subNavWrapper.depthZero,#header nav#block-neon-main-menu>ul>li.menu__item.menu__item--expanded.over>.subNavWrapper.depthZero{background:#002c77;display:-webkit-box;display:flex;-webkit-transform:translateZ(0) translateX(0);transform:translateZ(0) translateX(0);-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}#footer nav#block-neon-main-menu ul[data-depth="0"] ul,#header nav#block-neon-main-menu ul[data-depth="0"] ul{background:#002c77;height:100%;-webkit-transition:-webkit-transform .12s;transition:-webkit-transform .12s;-o-transition:transform .12s;transition:transform .12s;transition:transform .12s,-webkit-transform .12s}#footer nav#block-neon-main-menu ul[data-depth="0"] ul li,#header nav#block-neon-main-menu ul[data-depth="0"] ul li{border-left:6px solid #002c77;color:#c2deea;display:-webkit-box;display:flex;font-weight:400;padding:15px 30px 15px 24px;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center}#footer nav#block-neon-main-menu ul[data-depth="0"] ul li a,#header nav#block-neon-main-menu ul[data-depth="0"] ul li a{color:#c2deea;font-weight:400}#footer nav#block-neon-main-menu ul[data-depth="0"] ul .mini-arrow,#header nav#block-neon-main-menu ul[data-depth="0"] ul .mini-arrow{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:3px;display:-webkit-box;display:flex;height:48px;margin-top:0;right:26px;width:48px;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center}#footer nav#block-neon-main-menu ul[data-depth="0"],#header nav#block-neon-main-menu ul[data-depth="0"]{position:fixed;right:0;visibility:visible;width:100%;-webkit-overflow-scrolling:touch;-webkit-transform:translateX(0) translateZ(0);transform:translateX(0) translateZ(0);z-index:1}#footer nav#block-neon-main-menu ul[data-depth="1"],#header nav#block-neon-main-menu ul[data-depth="1"]{left:0;margin:0;padding:0;position:absolute;top:0;width:100%}#footer nav#block-neon-main-menu ul[data-depth="1"]>li.active ul[data-depth="2"],#header nav#block-neon-main-menu ul[data-depth="1"]>li.active ul[data-depth="2"]{-webkit-transform:translateZ(0) translateX(0);transform:translateZ(0) translateX(0);-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;-o-transition:transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}#footer nav#block-neon-main-menu ul[data-depth="2"],#header nav#block-neon-main-menu ul[data-depth="2"]{left:0;margin:0;padding:0;position:absolute;top:0;-webkit-transform:translateZ(0) translateX(100%);transform:translateZ(0) translateX(100%);width:100%}#footer nav#block-neon-main-menu ul[data-depth="2"]>li.active ul[data-depth="3"],#header nav#block-neon-main-menu ul[data-depth="2"]>li.active ul[data-depth="3"]{-webkit-transform:translateZ(0) translateX(0);transform:translateZ(0) translateX(0)}#footer nav#block-neon-main-menu ul[data-depth="3"],#header nav#block-neon-main-menu ul[data-depth="3"]{left:0;margin:0;padding:0;position:absolute;top:0;-webkit-transform:translateZ(0) translateX(100%);transform:translateZ(0) translateX(100%);width:100%}#footer nav#block-neon-main-menu ul[data-depth="3"]>li.active ul[data-depth="4"],#header nav#block-neon-main-menu ul[data-depth="3"]>li.active ul[data-depth="4"]{-webkit-transform:translateZ(0) translateX(0);transform:translateZ(0) translateX(0)}#footer nav#block-neon-main-menu ul[data-depth="4"],#header nav#block-neon-main-menu ul[data-depth="4"]{left:0;margin:0;padding:0;position:absolute;top:0;-webkit-transform:translateZ(0) translateX(100%);transform:translateZ(0) translateX(100%);width:100%}#footer nav#block-neon-main-menu ul[data-depth="4"]>li.active ul[data-depth="5"],#header nav#block-neon-main-menu ul[data-depth="4"]>li.active ul[data-depth="5"]{-webkit-transform:translateZ(0) translateX(0);transform:translateZ(0) translateX(0)}#footer nav#block-neon-main-menu ul[data-depth="5"],#header nav#block-neon-main-menu ul[data-depth="5"]{left:0;margin:0;padding:0;position:absolute;top:0;-webkit-transform:translateZ(0) translateX(100%);transform:translateZ(0) translateX(100%);width:100%}#footer nav#block-neon-main-menu .subNavWrapper,#header nav#block-neon-main-menu .subNavWrapper{height:100%;left:0;overflow:auto;position:fixed;right:0;top:0;-webkit-overflow-scrolling:touch;-webkit-transform:translateZ(0) translateX(100%);transform:translateZ(0) translateX(100%);-webkit-transition:-webkit-transform .15s;transition:-webkit-transform .15s;-o-transition:transform .15s;transition:transform .15s;transition:transform .15s,-webkit-transform .15s;z-index:1}#footer nav#block-neon-main-menu .subNavWrapper .innerSubNavWrapper,#header nav#block-neon-main-menu .subNavWrapper .innerSubNavWrapper{height:100%;overflow:hidden;position:relative;width:100%;-webkit-box-ordinal-group:3;order:2}#footer nav#block-neon-main-menu .subNavWrapper .subNavLabelWrapper,#header nav#block-neon-main-menu .subNavWrapper .subNavLabelWrapper{-webkit-box-ordinal-group:2;order:1;width:100%}#footer nav#block-neon-main-menu .subNavWrapper .subNavLabelWrapper .mobileBack,#header nav#block-neon-main-menu .subNavWrapper .subNavLabelWrapper .mobileBack{background:#fff;border:none;border-radius:3px;display:-webkit-box;display:flex;height:30px;margin:18px 0 0 30px;width:30px;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}}@media (min-width:1200px){#footer .subNavWrapper ul[data-depth="1"] .expandable:not(.active) ul,#header .subNavWrapper ul[data-depth="1"] .expandable:not(.active) ul{height:0;overflow:hidden}#footer .subNavWrapper ul[data-depth="1"] li.active ul[data-depth="2"],#footer .subNavWrapper ul[data-depth="1"] li.active ul[data-depth="3"],#footer .subNavWrapper ul[data-depth="3"] li.active ul[data-depth="4"],#footer .subNavWrapper ul[data-depth="3"] li.active ul[data-depth="5"],#header .subNavWrapper ul[data-depth="1"] li.active ul[data-depth="2"],#header .subNavWrapper ul[data-depth="1"] li.active ul[data-depth="3"],#header .subNavWrapper ul[data-depth="3"] li.active ul[data-depth="4"],#header .subNavWrapper ul[data-depth="3"] li.active ul[data-depth="5"]{height:auto;overflow:visible}#footer .header__menu-main,#header .header__menu-main{display:-webkit-box;display:flex;height:100%;-webkit-box-align:center;align-items:center}#footer nav#block-neon-main-menu,#header nav#block-neon-main-menu{display:-webkit-box;display:flex;height:100%;position:inherit!important;-webkit-box-align:center;align-items:center}#footer nav#block-neon-main-menu>ul.menu--main,#header nav#block-neon-main-menu>ul.menu--main{display:-webkit-box;display:flex;height:100%;-webkit-box-align:stretch;align-items:stretch;margin:0;padding:0}#footer nav#block-neon-main-menu>ul.menu--main>li,#header nav#block-neon-main-menu>ul.menu--main>li{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;margin-right:50px;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;border-bottom:6px solid #fff;justify-content:center}#footer nav#block-neon-main-menu>ul.menu--main>li:last-child,#header nav#block-neon-main-menu>ul.menu--main>li:last-child{margin-right:0}#footer nav#block-neon-main-menu>ul.menu--main>li>a:not([myAccount]),#footer nav#block-neon-main-menu>ul.menu--main>li>a:not([siteSearch]),#header nav#block-neon-main-menu>ul.menu--main>li>a:not([myAccount]),#header nav#block-neon-main-menu>ul.menu--main>li>a:not([siteSearch]){color:#0073cf;font-size:18px;font-weight:600;margin-bottom:auto;margin-top:42px;padding-bottom:6px;padding-top:6px;text-decoration:none}#footer nav#block-neon-main-menu>ul.menu--main>li:not(.menu__item--expanded)>a,#header nav#block-neon-main-menu>ul.menu--main>li:not(.menu__item--expanded)>a{margin-bottom:auto}#footer nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:focus .arrow,#footer nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:hover .arrow,#footer nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded[focus-within] .arrow,#header nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:focus .arrow,#header nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:hover .arrow,#header nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded[focus-within] .arrow{-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;clip:auto;background:#0073cf;opacity:1;visibility:visible;z-index:4}#footer nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:focus .arrow,#footer nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:focus-within .arrow,#footer nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:hover .arrow,#header nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:focus .arrow,#header nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:focus-within .arrow,#header nav#block-neon-main-menu>ul.menu--main>li.menu__item--expanded:hover .arrow{-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;clip:auto;background:#0073cf;opacity:1;visibility:visible;z-index:4}#footer nav#block-neon-main-menu>ul.menu--main>li>.arrow,#header nav#block-neon-main-menu>ul.menu--main>li>.arrow{background:none;border:0;border-radius:0 0 3px 3px;bottom:-37px;display:block;height:34px;opacity:0;position:relative!important;text-align:center;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;visibility:hidden;width:calc(100% - 14px);z-index:0}#footer nav#block-neon-main-menu>ul.menu--main>li>.arrow svg,#header nav#block-neon-main-menu>ul.menu--main>li>.arrow svg{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}#footer nav#block-neon-main-menu>ul.menu--main>li>.arrow.hidden,#header nav#block-neon-main-menu>ul.menu--main>li>.arrow.hidden{display:none!important}#footer nav#block-neon-main-menu>ul.menu--main>li.over,#header nav#block-neon-main-menu>ul.menu--main>li.over{border-bottom:6px solid #0073cf}#footer nav#block-neon-main-menu>ul.menu--main>li.myAccount,#header nav#block-neon-main-menu>ul.menu--main>li.myAccount{-webkit-box-flex:0;flex:none;margin:0 0 25px;width:100%}#footer nav#block-neon-main-menu>ul.menu--main>li.myAccount a,#header nav#block-neon-main-menu>ul.menu--main>li.myAccount a{background:#e4e6e7;border:1px solid #e4e6e7;border-radius:2px;color:#565a5c;font-size:12px;font-weight:600;letter-spacing:1.2px;line-height:18px;margin-bottom:auto;padding:6px 12px;text-decoration:none;text-transform:uppercase;-webkit-transition:all .25s ease;-o-transition:all .25s ease;transition:all .25s ease}#footer nav#block-neon-main-menu>ul.menu--main>li.myAccount a:hover,#header nav#block-neon-main-menu>ul.menu--main>li.myAccount a:hover{background:#fff;border:1px solid #fff;color:#0073cf;-webkit-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease}}@media (min-width:1200px) and (min-width:768px){#footer nav#block-neon-main-menu>ul.menu--main>li.myAccount,#header nav#block-neon-main-menu>ul.menu--main>li.myAccount{margin:0 30px 0 0;width:auto}}@media (min-width:1200px){#footer nav#block-neon-main-menu>ul.menu--main>li.siteSearch,#header nav#block-neon-main-menu>ul.menu--main>li.siteSearch{margin-right:0;-webkit-box-flex:0;flex:none;width:20px}#footer nav#block-neon-main-menu>ul.menu--main>li.siteSearch a,#header nav#block-neon-main-menu>ul.menu--main>li.siteSearch a{background:url(https://www.neonscience.org/themes/custom/neon/images/icons/search.svg) 50% no-repeat;display:block;margin-bottom:auto;overflow:hidden;position:relative;text-indent:100%;white-space:nowrap}#footer nav#block-neon-main-menu>ul.menu--main>li.siteSearch a:after,#footer nav#block-neon-main-menu>ul.menu--main>li.siteSearch a:before,#header nav#block-neon-main-menu>ul.menu--main>li.siteSearch a:after,#header nav#block-neon-main-menu>ul.menu--main>li.siteSearch a:before{background:url(https://www.neonscience.org/themes/custom/neon/images/icons/search_hover.svg);content:"";display:none;height:0;width:0}#footer nav#block-neon-main-menu>ul.menu--main>li.siteSearch a:hover,#header nav#block-neon-main-menu>ul.menu--main>li.siteSearch a:hover{background:url(https://www.neonscience.org/themes/custom/neon/images/icons/search_hover.svg) no-repeat 50%}#footer .subNavWrapper,#header .subNavWrapper{background:#002c77;display:-webkit-box;display:flex;height:100%;left:0;margin:0;opacity:0;overflow-x:hidden;overflow-y:auto;position:fixed;top:120px;-webkit-transition:opacity .2s ease-in-out;-o-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;visibility:hidden;white-space:nowrap;width:100%;z-index:-1;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.25),inset 0 1px 1px rgba(0,0,0,.25);box-shadow:inset 0 1px 3px rgba(0,0,0,.25),inset 0 1px 1px rgba(0,0,0,.25);flex-direction:column}#footer .subNavWrapper .subNavLabelWrapper,#header .subNavWrapper .subNavLabelWrapper{border-bottom:1px solid #0073cf;padding:1.875rem 2.25rem 1.875rem 1.875rem;-webkit-box-ordinal-group:2;order:1;position:relative;-webkit-box-flex:0;display:-webkit-box;display:flex;flex:none;-webkit-box-pack:start;justify-content:flex-start}#footer .subNavWrapper .subNavLabelWrapper h3,#header .subNavWrapper .subNavLabelWrapper h3{color:#fff;font-weight:300;line-height:.8;margin:0 0 0 .3125rem;padding:0;white-space:normal}}@media (min-width:1200px) and (min-width:0px){#footer .subNavWrapper .subNavLabelWrapper h3,#header .subNavWrapper .subNavLabelWrapper h3{font-size:1.5rem}}@media (min-width:1200px) and (min-width:600px){#footer .subNavWrapper .subNavLabelWrapper h3,#header .subNavWrapper .subNavLabelWrapper h3{font-size:2.25rem}}@media (min-width:1200px){#footer .subNavWrapper .subNavLabelWrapper .subNavClose,#header .subNavWrapper .subNavLabelWrapper .subNavClose{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;left:40px;top:40px}#footer .subNavWrapper .innerSubNavWrapper,#header .subNavWrapper .innerSubNavWrapper{height:100%;-webkit-box-flex:0;flex:none;position:relative;-webkit-box-ordinal-group:3;order:2}#footer .subNavWrapper.depthOne .innerSubNavWrapper:before,#header .subNavWrapper.depthOne .innerSubNavWrapper:before{background:#00235f;border-left:1px solid #0073cf;content:"";height:100%;left:33.3333333333%;position:absolute;top:0;width:100%}#footer .subNavWrapper.depthThree .innerSubNavWrapper:after,#header .subNavWrapper.depthThree .innerSubNavWrapper:after{background:#001c4c;border-left:1px solid #0073cf;content:"";height:100%;position:absolute;right:0;top:0;width:33.3333333333%}#footer nav#block-neon-main-menu ul.menu--main li.over .subNavWrapper,#header nav#block-neon-main-menu ul.menu--main li.over .subNavWrapper{opacity:1;-webkit-transition:opacity .2s ease-in-out;-o-transition:opacity .2s ease-in-out;transition:opacity .2s ease-in-out;visibility:visible;z-index:3}#footer nav#block-neon-main-menu ul.menu--main li.over .subNavWrapper ul[data-depth="1"],#header nav#block-neon-main-menu ul.menu--main li.over .subNavWrapper ul[data-depth="1"]{opacity:1;visibility:visible}#footer nav#block-neon-main-menu ul.menu--main li ul li,#header nav#block-neon-main-menu ul.menu--main li ul li{color:#f5f6f7;display:block}#footer nav#block-neon-main-menu ul.menu--main li ul li a,#header nav#block-neon-main-menu ul.menu--main li ul li a{color:#f5f6f7;display:inline-block;text-decoration:none}#footer nav#block-neon-main-menu ul.menu--main li ul li span,#header nav#block-neon-main-menu ul.menu--main li ul li span{color:#f5f6f7;display:inline-block}#footer nav#block-neon-main-menu ul.menu--main li ul li>ul a,#footer nav#block-neon-main-menu ul.menu--main li ul li>ul li,#footer nav#block-neon-main-menu ul.menu--main li ul li>ul span,#header nav#block-neon-main-menu ul.menu--main li ul li>ul a,#header nav#block-neon-main-menu ul.menu--main li ul li>ul li,#header nav#block-neon-main-menu ul.menu--main li ul li>ul span{font-size:15px}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"],#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]{margin:0;opacity:0;padding:0;position:absolute;top:12px;visibility:hidden;width:33.3%}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li{padding:16px 60px}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:last-child,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:last-child{margin-bottom:0}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable .mini-arrow,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable .mini-arrow{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:0;border-radius:3px;height:48px;margin-top:-12px;padding-right:26px;position:absolute;right:0;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out;width:48px}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable .mini-arrow svg,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable .mini-arrow svg{left:50%;position:absolute;top:50%;-webkit-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable.active,#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable:hover,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable.active,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable:hover{-webkit-transition:background-color .25s ease-in-out;-o-transition:background-color .25s ease-in-out;transition:background-color .25s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable.active>a,#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable:hover>a,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable.active>a,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable:hover>a{border-bottom:2px solid #fff;color:#fff;text-shadow:0 0 .65px #fff,0 0 .65px #fff;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable.active,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li.expandable.active{background:-webkit-gradient(linear,left bottom,left top,from(rgba(0,115,207,.2)),to(rgba(0,115,207,.2))),#002c77;background:-o-linear-gradient(bottom,rgba(0,115,207,.2),rgba(0,115,207,.2)),#002c77;background:linear-gradient(0deg,rgba(0,115,207,.2),rgba(0,115,207,.2)),#002c77}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li>a,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li>a{border:none;font-size:18px;font-weight:400;line-height:24px;text-decoration:none;-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:hover,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:hover{-webkit-transition:all .25s ease-in-out;-o-transition:all .25s ease-in-out;transition:all .25s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:hover>a,#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:hover>span,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:hover>a,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="1"]>li:hover>span{color:#fff;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"],#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"],#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"],#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]{left:calc(108% + 2px);margin:0;opacity:0;padding:0;position:absolute;top:0;-webkit-transition:all .15s ease-in-out;-o-transition:all .15s ease-in-out;transition:all .15s ease-in-out;visibility:hidden;width:100%}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li{margin:0;padding:0}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li.expandable .mini-arrow,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li.expandable .mini-arrow,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li.expandable .mini-arrow,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li.expandable .mini-arrow{margin-top:0}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li>a,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li>a{font-size:15px;font-weight:600;margin:0;padding:25px 60px 12px}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li:not([class])>a,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li:not([class])>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li:not([class])>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li:not([class])>a{padding:22px 60px 20px}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li:not([class]):not(:last-child)>a,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li:not([class]):not(:last-child)>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li:not([class]):not(:last-child)>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li:not([class]):not(:last-child)>a{position:relative}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li:not([class]):not(:last-child)>a:after,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li:not([class]):not(:last-child)>a:after,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="2"]>li:not([class]):not(:last-child)>a:after,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="4"]>li:not([class]):not(:last-child)>a:after{background:#004b97;bottom:0;content:"";height:1px;left:60px;position:absolute;width:100%}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"],#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]{border-bottom:1px solid #004b97;margin:0;padding:0}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li{margin:0;padding:0}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li>a{font-size:15px;font-weight:400;margin:0;padding:10px 0 10px 90px;position:relative}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li>a:before,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li>a:before{background:#f5f6f7;content:"";height:1px;left:60px;position:absolute;top:20px;width:10px}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable{cursor:pointer;display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable button.mini-arrow.focusable,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable button.mini-arrow.focusable{margin:0;position:relative;right:auto}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable.active,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable.active{background:-webkit-gradient(linear,left bottom,left top,from(rgba(0,115,207,.2)),to(rgba(0,115,207,.2))),#002c77;background:-o-linear-gradient(bottom,rgba(0,115,207,.2),rgba(0,115,207,.2)),#002c77;background:linear-gradient(0deg,rgba(0,115,207,.2),rgba(0,115,207,.2)),#002c77}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable.active,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable:hover,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable.active,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable:hover{-webkit-transition:background-color .25s ease-in-out;-o-transition:background-color .25s ease-in-out;transition:background-color .25s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable.active>a,#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable:hover>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable.active>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li.expandable:hover>a{color:#fff;display:inline-block;text-shadow:0 0 .65px #fff,0 0 .65px #fff;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li:not([class]):after,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="3"]>li:not([class]):after{display:none}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="4"],#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="4"]{left:calc(100% + 1px);margin:0;opacity:0;padding:0;position:absolute;top:0;-webkit-transition:all .15s ease-in-out;-o-transition:all .15s ease-in-out;transition:all .15s ease-in-out;visibility:hidden;width:100%}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="4"] li a,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="4"] li a{width:100%}#footer nav#block-neon-main-menu ul.menu--main li ul[data-depth="4"] li.expandable:before,#header nav#block-neon-main-menu ul.menu--main li ul[data-depth="4"] li.expandable:before{display:none}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"],#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]{border-bottom:1px solid #004b97;margin:0;padding:0}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li{margin:0;padding:0}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li>a,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li>a{font-size:15px;font-weight:400;margin:0;padding:10px 0 10px 90px;position:relative;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;width:100%}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li>a:hover,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li>a:hover{text-shadow:0 0 .65px #fff,0 0 .65px #fff;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li>a:before,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li>a:before{background:#f5f6f7;content:"";height:1px;left:60px;position:absolute;top:20px;width:10px}#footer nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li:last-child>a:last-child,#header nav#block-neon-main-menu ul.menu--main li ul li ul[data-depth="5"]>li:last-child>a:last-child{padding-bottom:20px;position:relative}#footer nav#block-neon-main-menu ul.menu--main li ul li.active>ul[data-depth="2"],#header nav#block-neon-main-menu ul.menu--main li ul li.active>ul[data-depth="2"]{left:calc(100% + 2px);opacity:1;-webkit-transition:all .15s ease-out;-o-transition:all .15s ease-out;transition:all .15s ease-out;visibility:visible}#footer nav#block-neon-main-menu ul.menu--main li ul li.active ul li.active>ul[data-depth="4"],#header nav#block-neon-main-menu ul.menu--main li ul li.active ul li.active>ul[data-depth="4"]{left:calc(100% + 2px);opacity:1;-webkit-transition:all .15s ease-out;-o-transition:all .15s ease-out;transition:all .15s ease-out;visibility:visible;z-index:1}}#footer .header__search,#header .header__search{background:#f5f6f7;opacity:1;position:relative;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;visibility:visible;z-index:1}#footer .header__search.visually-hidden,#header .header__search.visually-hidden{opacity:0;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;visibility:hidden}@media (min-width:0px) and (max-width:1199.98px){#footer nav#block-neon-main-menu>ul>li.myAccount,#header nav#block-neon-main-menu>ul>li.myAccount{padding:1.5rem 0 0}#footer nav#block-neon-main-menu>ul>li.myAccount a,#header nav#block-neon-main-menu>ul>li.myAccount a{margin:0 auto}}@media (min-width:1200px){#footer #header nav#block-neon-main-menu>ul.menu--main>li,#footer #root nav#block-neon-main-menu>ul.menu--main>li,#footer body:not([class]) nav#block-neon-main-menu>ul.menu--main>li,#header #header nav#block-neon-main-menu>ul.menu--main>li,#header #root nav#block-neon-main-menu>ul.menu--main>li,#header body:not([class]) nav#block-neon-main-menu>ul.menu--main>li{height:100%}}#footer li.myAccount,#header li.myAccount{display:none!important}#footer .ui-widget-overlay,#header .ui-widget-overlay{opacity:.9}#footer .js-media-library-item-preview .field--name-thumbnail img,#header .js-media-library-item-preview .field--name-thumbnail img{width:auto!important}#footer .authContainer,#header .authContainer{border:1px solid #0073cf;position:absolute;text-align:right;z-index:10}#footer .authContainer .openid-connect-login-form form>div,#header .authContainer .openid-connect-login-form form>div{border:none}#footer .authContainer .openid-connect-login-form .form-submit,#header .authContainer .openid-connect-login-form .form-submit{background:none;border:none}@media (max-width:1199.95px){#footer .authContainer,#header .authContainer{border:1px solid #0073cf;right:72px;top:13px}#footer .authContainer .form-submit,#footer .authContainer a,#header .authContainer .form-submit,#header .authContainer a{color:#0073cf!important;display:inline-block;font-family:Inter,Helvetica,Arial,sans-serif!important;font-size:.55rem!important;font-weight:600!important;line-height:1.75!important;padding:5px 10px;text-decoration:none;text-transform:uppercase!important;white-space:nowrap}#footer .authContainer .form-submit:hover,#footer .authContainer a:hover,#header .authContainer .form-submit:hover,#header .authContainer a:hover{text-decoration:underline}#footer .authContainer :first-child,#header .authContainer :first-child{border-right:1px solid;border-top-left-radius:0}#footer .authContainer :last-child,#header .authContainer :last-child{border-bottom-right-radius:0;border-right:none;border-top-right-radius:0}}@media (min-width:1200px){#footer .authContainer,#header .authContainer{border:1px solid #0073cf;padding:0;right:0;top:-1px}#footer .authContainer .form-submit,#footer .authContainer a,#header .authContainer .form-submit,#header .authContainer a{color:#0073cf!important;display:inline-block;font-family:Inter,Helvetica,Arial,sans-serif!important;font-size:.55rem!important;font-weight:600!important;line-height:1.75!important;padding:5px 10px;text-decoration:none;text-transform:uppercase!important;white-space:nowrap}#footer .authContainer .form-submit:hover,#footer .authContainer a:hover,#header .authContainer .form-submit:hover,#header .authContainer a:hover{text-decoration:underline}#footer .authContainer :first-child,#header .authContainer :first-child{border-right:1px solid;border-top-left-radius:0}#footer .authContainer :last-child,#header .authContainer :last-child{border-bottom-right-radius:0;border-right:none;border-top-right-radius:0}}#footer .footer-top__wrapper,#header .footer-top__wrapper{background-color:#352723;color:#e4e6e7}#footer .footer-top__wrapper .footer-top__inner,#header .footer-top__wrapper .footer-top__inner{display:-webkit-box;display:flex;padding-bottom:20px;padding-top:30px;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media (min-width:500px){#footer .footer-top__wrapper .footer-top__inner,#header .footer-top__wrapper .footer-top__inner{-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center}}@media (min-width:768px){#footer .footer-top__wrapper .footer-top__inner,#header .footer-top__wrapper .footer-top__inner{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}}#footer .footer-top__logo-social,#header .footer-top__logo-social{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-flex:0;flex:none;margin-bottom:15px;width:auto}@media (min-width:500px){#footer .footer-top__logo-social,#header .footer-top__logo-social{-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;margin-bottom:0}}@media (min-width:768px){#footer .footer-top__logo-social,#header .footer-top__logo-social{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;margin-right:30px}}@media (min-width:992px){#footer .footer-top__logo-social,#header .footer-top__logo-social{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}}@media (min-width:1200px){#footer .footer-top__logo-social,#header .footer-top__logo-social{margin-right:60px}}#footer .footer-top__logo,#header .footer-top__logo{margin-bottom:10px}@media (min-width:500px){#footer .footer-top__logo,#header .footer-top__logo{margin-right:30px}}@media (min-width:992px){#footer .footer-top__logo,#header .footer-top__logo{margin-bottom:0}}@media (min-width:1200px){#footer .footer-top__logo,#header .footer-top__logo{margin-right:60px}}@media (min-width:1440px){#footer .footer-top__logo,#header .footer-top__logo{margin-right:80px}}#footer .footer-top__social,#header .footer-top__social{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}#footer .footer-top__social h4,#header .footer-top__social h4{color:#e4e6e7;font-size:14px;font-weight:400;line-height:25px;margin:0}#footer .footer-top__social ul,#header .footer-top__social ul{display:-webkit-box;display:flex;-webkit-box-align:baseline;align-items:baseline;margin:0;padding:0}#footer .footer-top__social ul li,#header .footer-top__social ul li{display:block}#footer .footer-top__social ul li svg,#header .footer-top__social ul li svg{fill:#c2deea;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s;width:16px}#footer .footer-top__social ul li a,#header .footer-top__social ul li a{display:block;padding:0 10px}#footer .footer-top__social ul li a:hover svg,#header .footer-top__social ul li a:hover svg{fill:#0073cf;-webkit-transition:all .3s;-o-transition:all .3s;transition:all .3s}#footer .footer-top__social ul li.facebook svg,#header .footer-top__social ul li.facebook svg{height:20px}#footer .footer-top__newsletter,#header .footer-top__newsletter{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;margin-bottom:15px}@media (min-width:500px){#footer .footer-top__newsletter,#header .footer-top__newsletter{-webkit-box-align:center;align-items:center;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}}#footer .footer-top__newsletter .footer-top__newsletter-text h4,#header .footer-top__newsletter .footer-top__newsletter-text h4{color:#e4e6e7;font-family:Inter,sans-serif;font-weight:400;line-height:25px;margin:0}@media (min-width:600px){#footer .footer-top__newsletter .footer-top__newsletter-text h4,#header .footer-top__newsletter .footer-top__newsletter-text h4{font-size:20px}}#footer .footer-top__newsletter .footer-top__newsletter-text p,#header .footer-top__newsletter .footer-top__newsletter-text p{color:#e4e6e7;font-size:14px;line-height:25px;margin:10px 0 0}#footer .footer-top__newsletter .footer-top__newsletter-btn,#header .footer-top__newsletter .footer-top__newsletter-btn{-webkit-box-flex:0;flex:none;margin-top:20px}@media (min-width:500px){#footer .footer-top__newsletter .footer-top__newsletter-btn,#header .footer-top__newsletter .footer-top__newsletter-btn{margin-left:30px;margin-top:0}}@media (min-width:1440px){#footer .footer-top__newsletter .footer-top__newsletter-btn,#header .footer-top__newsletter .footer-top__newsletter-btn{margin-left:60px}}#footer .footer-top__newsletter .footer-top__newsletter-btn a,#header .footer-top__newsletter .footer-top__newsletter-btn a{border:1px solid #f5f6f7;border-radius:2px;color:#f5f6f7;display:inline-block;font-family:Inter,sans-serif;font-size:12px;font-weight:600;letter-spacing:2.4px;line-height:18px;padding:12px 22px 12px 18px;text-decoration:none;text-transform:uppercase;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .footer-top__newsletter .footer-top__newsletter-btn a svg,#header .footer-top__newsletter .footer-top__newsletter-btn a svg{-webkit-transform:translateX(-4px);-ms-transform:translateX(-4px);transform:translateX(-4px);-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .footer-top__newsletter .footer-top__newsletter-btn a svg .line,#header .footer-top__newsletter .footer-top__newsletter-btn a svg .line{stroke-dasharray:11;stroke-dashoffset:11;-webkit-animation:arrowOut .1s linear forwards;animation:arrowOut .1s linear forwards}#footer .footer-top__newsletter .footer-top__newsletter-btn a:active,#footer .footer-top__newsletter .footer-top__newsletter-btn a:focus,#footer .footer-top__newsletter .footer-top__newsletter-btn a:hover,#header .footer-top__newsletter .footer-top__newsletter-btn a:active,#header .footer-top__newsletter .footer-top__newsletter-btn a:focus,#header .footer-top__newsletter .footer-top__newsletter-btn a:hover{background-color:#fff;border:1px solid #fff;color:#352723;-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .footer-top__newsletter .footer-top__newsletter-btn a:active svg,#footer .footer-top__newsletter .footer-top__newsletter-btn a:focus svg,#footer .footer-top__newsletter .footer-top__newsletter-btn a:hover svg,#header .footer-top__newsletter .footer-top__newsletter-btn a:active svg,#header .footer-top__newsletter .footer-top__newsletter-btn a:focus svg,#header .footer-top__newsletter .footer-top__newsletter-btn a:hover svg{-webkit-transform:translateX(6px);-ms-transform:translateX(6px);transform:translateX(6px);-webkit-transition:all .25s;-o-transition:all .25s;transition:all .25s}#footer .footer-top__newsletter .footer-top__newsletter-btn a:active svg .line,#footer .footer-top__newsletter .footer-top__newsletter-btn a:focus svg .line,#footer .footer-top__newsletter .footer-top__newsletter-btn a:hover svg .line,#header .footer-top__newsletter .footer-top__newsletter-btn a:active svg .line,#header .footer-top__newsletter .footer-top__newsletter-btn a:focus svg .line,#header .footer-top__newsletter .footer-top__newsletter-btn a:hover svg .line{-webkit-animation:arrowIn .15s linear forwards;animation:arrowIn .15s linear forwards}#footer .footer-top__newsletter .footer-top__newsletter-btn a:active svg path,#footer .footer-top__newsletter .footer-top__newsletter-btn a:focus svg path,#footer .footer-top__newsletter .footer-top__newsletter-btn a:hover svg path,#header .footer-top__newsletter .footer-top__newsletter-btn a:active svg path,#header .footer-top__newsletter .footer-top__newsletter-btn a:focus svg path,#header .footer-top__newsletter .footer-top__newsletter-btn a:hover svg path{stroke:#352723}@-webkit-keyframes arrowIn{0%{stroke-dashoffset:11}to{stroke-dashoffset:0}}@keyframes arrowIn{0%{stroke-dashoffset:11}to{stroke-dashoffset:0}}@-webkit-keyframes arrowOut{0%{stroke-dashoffset:0}to{stroke-dashoffset:11}}@keyframes arrowOut{0%{stroke-dashoffset:0}to{stroke-dashoffset:11}}#footer .footer-bottom__wrapper,#header .footer-bottom__wrapper{background:#4b372e url(https://www.neonscience.org/themes/custom/neon/images/footer_bottom_rip.png) repeat-x top;color:#fff;padding-top:30px}#footer .footer-bottom__wrapper .footer-bottom__inner,#header .footer-bottom__wrapper .footer-bottom__inner{-webkit-box-pack:justify;justify-content:space-between;padding-bottom:55px;padding-top:30px}@media (min-width:992px){#footer .footer-bottom__wrapper .footer-bottom__inner,#header .footer-bottom__wrapper .footer-bottom__inner{display:-webkit-box;display:flex;flex-wrap:wrap}}#footer #block-footer .menu--footer,#header #block-footer .menu--footer{display:-webkit-box;display:flex;-webkit-box-pack:start;flex-wrap:wrap;justify-content:flex-start;-webkit-box-align:center;align-items:center;margin:0 0 35px;padding:0}#footer #block-footer .menu--footer li,#header #block-footer .menu--footer li{display:block;margin-right:30px}#footer #block-footer .menu--footer li:last-child,#header #block-footer .menu--footer li:last-child{margin-right:0}#footer #block-footer .menu--footer li a,#header #block-footer .menu--footer li a{border-bottom:1px solid #c2deea;color:#c2deea;font-size:14px;font-weight:600;line-height:25px;text-decoration:none;-webkit-transition:all .25s ease;-o-transition:all .25s ease;transition:all .25s ease}#footer #block-footer .menu--footer li a:hover,#header #block-footer .menu--footer li a:hover{border-bottom:none;color:#fff;-webkit-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease}#footer #block-footer .menu--footer li.myAccount,#header #block-footer .menu--footer li.myAccount{-webkit-box-flex:0;flex:none;margin:0 0 25px;width:100%}#footer #block-footer .menu--footer li.myAccount a,#header #block-footer .menu--footer li.myAccount a{background:#e4e6e7;border:1px solid #e4e6e7;border-radius:2px;color:#565a5c;font-size:12px;font-weight:600;letter-spacing:1.2px;padding:6px 12px;text-decoration:none;text-transform:uppercase;-webkit-transition:all .25s ease;-o-transition:all .25s ease;transition:all .25s ease}#footer #block-footer .menu--footer li.myAccount a:hover,#header #block-footer .menu--footer li.myAccount a:hover{background:#fff;border:1px solid #fff;color:#0073cf;-webkit-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease}@media (min-width:768px){#footer #block-footer .menu--footer li.myAccount,#header #block-footer .menu--footer li.myAccount{margin:0 30px 0 0;width:auto}}@media (min-width:992px){#footer #block-footer .menu--footer,#header #block-footer .menu--footer{margin:0}}#footer .footer-bottom__copyright p,#header .footer-bottom__copyright p{color:#fff;font-size:14px;line-height:25px;margin:0}#footer .footer-bottom__message,#header .footer-bottom__message{margin:30px 0 0;-webkit-box-flex:0;flex:none;width:100%}#footer .footer-bottom__message p,#header .footer-bottom__message p{color:#fff;font-size:14px;line-height:25px;margin:0 0 10px}#footer .footer-bottom__message p:last-child,#header .footer-bottom__message p:last-child{margin:0} /*# sourceMappingURL=drupal-theme.98af391f0797dc8df157fb52a8a37b1d.min.css.map */ \ No newline at end of file diff --git a/public/index.html b/public/index.html index 299baa9f..719302fc 100644 --- a/public/index.html +++ b/public/index.html @@ -1,4 +1,4 @@ - + NEON | Portal Core Components diff --git a/scripts/lib/lib-cache-remote-assets.js b/scripts/lib/lib-cache-remote-assets.js index e999d532..91577922 100644 --- a/scripts/lib/lib-cache-remote-assets.js +++ b/scripts/lib/lib-cache-remote-assets.js @@ -276,7 +276,13 @@ const writeContent = async (key, content, fileName) => { } let indexFileOutput = dom.serialize(); if (config.prettifyIndex) { - indexFileOutput = prettier.format(indexFileOutput, { parser: 'html', printWidth: 100 }); + indexFileOutput = await prettier.format( + indexFileOutput, + { + parser: 'html', + printWidth: 100, + }, + ); } fs.writeFileSync(indexFilePath, indexFileOutput, { encoding: 'utf8' }); } diff --git a/scripts/sync-assets.js b/scripts/sync-assets.js index 677c4bfa..a445b6fd 100644 --- a/scripts/sync-assets.js +++ b/scripts/sync-assets.js @@ -86,7 +86,7 @@ const syncCssAssets = () => { fs.writeFileSync(createFile, syncFileData, { encoding: 'utf8' }); } }); - Object.keys(SYNC_CSS_ASSET_INDEX).forEach((assetKey) => { + Object.keys(SYNC_CSS_ASSET_INDEX).forEach(async (assetKey) => { const assetIndex = SYNC_CSS_ASSET_INDEX[assetKey]; if (assetFileName.startsWith(assetIndex.prefix)) { const indexFilePath = path.join(PUBLIC_OUTPUT_PATH, 'index.html'); @@ -100,13 +100,20 @@ const syncCssAssets = () => { } let indexFileOutput = dom.serialize(); if (config.prettifyIndex) { - indexFileOutput = prettier.format(indexFileOutput, { parser: 'html', printWidth: 100 }); + indexFileOutput = await prettier.format( + indexFileOutput, + { + parser: 'html', + printWidth: 100, + }, + ); } fs.writeFileSync(indexFilePath, indexFileOutput, { encoding: 'utf8' }); } } }); }); + console.log('Finished processing assets'); }; syncCssAssets(); diff --git a/src/App.jsx b/src/App.jsx index 01323403..41fe81e7 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -9,6 +9,8 @@ import NeonPage from './lib_components/components/NeonPage/NeonPage'; import NeonRouter from './lib_components/components/NeonRouter/NeonRouter'; import Home from './components/Home'; +import NeonEnvironment from './lib_components/components/NeonEnvironment/NeonEnvironment'; +import { isStringNonEmpty } from './lib_components/util/typeUtil'; const BasicComponents = React.lazy( () => import('./components/BasicComponents'), @@ -333,8 +335,9 @@ const sidebarLinks = [ export default function App() { let sidebarSubtitle = null; - if (process.env.REACT_APP_VERSION) { - sidebarSubtitle = `version ${process.env.REACT_APP_VERSION}`; + const appVersion = NeonEnvironment.getReactAppVersion(); + if (isStringNonEmpty(appVersion)) { + sidebarSubtitle = `version ${appVersion}`; } return ( diff --git a/src/lib_components/components/NeonEnvironment/NeonEnvironment.ts b/src/lib_components/components/NeonEnvironment/NeonEnvironment.ts index b000a454..109f83fa 100644 --- a/src/lib_components/components/NeonEnvironment/NeonEnvironment.ts +++ b/src/lib_components/components/NeonEnvironment/NeonEnvironment.ts @@ -72,6 +72,9 @@ export interface INeonEnvironment { enableGlobalSignInState: boolean; fetchDrupalAssets: boolean; + getReactAppName: () => string; + getReactAppVersion: () => string; + getRootApiPath: () => string; getRootGraphqlPath: () => string; getRootJsonLdPath: () => string; @@ -138,6 +141,9 @@ const NeonEnvironment: INeonEnvironment = { enableGlobalSignInState: process.env.REACT_APP_NEON_ENABLE_GLOBAL_SIGNIN_STATE === 'true', fetchDrupalAssets: process.env.REACT_APP_NEON_FETCH_DRUPAL_ASSETS !== 'false', + getReactAppName: () => process.env.REACT_APP_NAME || '', + getReactAppVersion: () => process.env.REACT_APP_VERSION || '', + getRootApiPath: () => process.env.REACT_APP_NEON_PATH_API || '/api/v0', getRootGraphqlPath: () => process.env.REACT_APP_NEON_PATH_PUBLIC_GRAPHQL || '/graphql', getRootJsonLdPath: () => `${NeonEnvironment.getRootApiPath()}${process.env.REACT_APP_NEON_PATH_LD_API}`, diff --git a/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerContext.jsx b/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerContext.jsx index 9ee7be2e..5778a626 100644 --- a/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerContext.jsx +++ b/src/lib_components/components/TimeSeriesViewer/TimeSeriesViewerContext.jsx @@ -37,6 +37,7 @@ import DataPackageParser from '../../parser/DataPackageParser'; import NeonSignInButtonState from '../NeonSignInButton/NeonSignInButtonState'; import makeStateStorage from '../../service/StateStorageService'; import { convertStateForStorage, convertStateFromStorage } from './StateStorageConverter'; +import { getUserAgentHeader } from '../../util/requestUtil'; import { TIME_SERIES_VIEWER_STATUS } from './constants'; // 'get' is a reserved word so can't be imported with import @@ -326,6 +327,9 @@ const fetchCSV = (url) => ajax({ method: 'GET', crossDomain: true, responseType: 'text', + headers: { + 'User-Agent': getUserAgentHeader('Time Series Viewer'), + }, url, }); const parseCSV = (rawCsv, dedupeLines = false) => { @@ -984,7 +988,7 @@ const reducer = (state, action) => { ]); newState.availableQualityFlags = new Set([ ...state.availableQualityFlags, - ...Object.keys(newState.variables).filter((v) => /QF$/.test(v)), + ...Object.keys(newState.variables).filter((v) => /QF$/.test(v) || /QFSciRvw$/.test(v)), ]); // A valid dateTime variable must be present otherwise we have no x-axis if (Object.keys(newState.variables).every((v) => !newState.variables[v].isDateTime)) { diff --git a/src/lib_components/remoteAssets/drupal-footer.html.js b/src/lib_components/remoteAssets/drupal-footer.html.js index aabeb448..9b175871 100644 --- a/src/lib_components/remoteAssets/drupal-footer.html.js +++ b/src/lib_components/remoteAssets/drupal-footer.html.js @@ -37,6 +37,7 @@ export default html = ` + + `; \ No newline at end of file diff --git a/src/lib_components/remoteAssets/drupal-header.html.js b/src/lib_components/remoteAssets/drupal-header.html.js index 9ce806cf..a9bab90f 100644 --- a/src/lib_components/remoteAssets/drupal-header.html.js +++ b/src/lib_components/remoteAssets/drupal-header.html.js @@ -1,17 +1,12 @@ let html; -export default html = ` -