@corva/ui 3.30.0-9 → 3.30.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs-bundle/components/Drillstring/BHAComponentDetail/constants.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentDetail/constants.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentIcon.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentIcon.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHASchematic.js +1 -1
- package/cjs-bundle/components/Drillstring/BHASchematic.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHATileIcon.js +1 -1
- package/cjs-bundle/components/Drillstring/BHATileIcon.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV4/OffsetWellPickerV4.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV4/OffsetWellPickerV4.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/AdvancedSearch/AutoCompleteAssetSearch.js +1 -1
- package/cjs-bundle/components/OffsetWellPickerV4/components/OffsetWellsTable/AdvancedSearch/AutoCompleteAssetSearch.js.map +1 -1
- package/cjs-bundle/components/OffsetWellPickerV4/effects/useGlobalOffsetWellsSync.js +2 -0
- package/cjs-bundle/components/OffsetWellPickerV4/effects/useGlobalOffsetWellsSync.js.map +1 -0
- package/cjs-bundle/componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/useLoadAssets.js +1 -1
- package/cjs-bundle/constants/bha.js +1 -1
- package/cjs-bundle/constants/bha.js.map +1 -1
- package/cjs-bundle/constants/drillstring.js +1 -1
- package/cjs-bundle/constants/drillstring.js.map +1 -1
- package/cjs-bundle/utils/DrillstringUtils.js +1 -1
- package/cjs-bundle/utils/DrillstringUtils.js.map +1 -1
- package/cjs-bundle/utils/bha.js +1 -1
- package/cjs-bundle/utils/bha.js.map +1 -1
- package/cjs-bundle/utils/drillstring/conversion.js +1 -1
- package/cjs-bundle/utils/drillstring/conversion.js.map +1 -1
- package/cjs-bundle/utils/drillstring/schematic.js +1 -1
- package/cjs-bundle/utils/drillstring/schematic.js.map +1 -1
- package/cjs-bundle/utils/drillstring/validation.js +1 -1
- package/cjs-bundle/utils/drillstring/validation.js.map +1 -1
- package/components/Drillstring/BHAComponentDetail/constants.d.ts.map +1 -1
- package/components/Drillstring/BHAComponentDetail/constants.js +1 -1
- package/components/Drillstring/BHAComponentDetail/constants.js.map +1 -1
- package/components/Drillstring/BHAComponentIcon.d.ts.map +1 -1
- package/components/Drillstring/BHAComponentIcon.js +1 -1
- package/components/Drillstring/BHAComponentIcon.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.d.ts.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.d.ts.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js.map +1 -1
- package/components/Drillstring/BHASchematic.d.ts.map +1 -1
- package/components/Drillstring/BHASchematic.js +1 -1
- package/components/Drillstring/BHASchematic.js.map +1 -1
- package/components/Drillstring/BHATileIcon.d.ts.map +1 -1
- package/components/Drillstring/BHATileIcon.js +1 -1
- package/components/Drillstring/BHATileIcon.js.map +1 -1
- package/components/OffsetWellPickerV4/OffsetWellPickerV4.d.ts.map +1 -1
- package/components/OffsetWellPickerV4/OffsetWellPickerV4.js +1 -1
- package/components/OffsetWellPickerV4/OffsetWellPickerV4.js.map +1 -1
- package/components/OffsetWellPickerV4/components/OffsetWellsTable/AdvancedSearch/AutoCompleteAssetSearch.js +1 -1
- package/components/OffsetWellPickerV4/components/OffsetWellsTable/AdvancedSearch/AutoCompleteAssetSearch.js.map +1 -1
- package/components/OffsetWellPickerV4/effects/index.d.ts +1 -0
- package/components/OffsetWellPickerV4/effects/useGlobalOffsetWellsSync.d.ts +2 -0
- package/components/OffsetWellPickerV4/effects/useGlobalOffsetWellsSync.d.ts.map +1 -0
- package/components/OffsetWellPickerV4/effects/useGlobalOffsetWellsSync.js +2 -0
- package/components/OffsetWellPickerV4/effects/useGlobalOffsetWellsSync.js.map +1 -0
- package/componentsV2/AppHeader/V3/AppHeaderV3.stories.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/useLoadAssets.d.ts.map +1 -1
- package/componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/useLoadAssets.js +1 -1
- package/constants/bha.d.ts +1 -0
- package/constants/bha.d.ts.map +1 -1
- package/constants/bha.js +1 -1
- package/constants/bha.js.map +1 -1
- package/constants/drillstring.d.ts.map +1 -1
- package/constants/drillstring.js +1 -1
- package/constants/drillstring.js.map +1 -1
- package/package.json +2 -2
- package/utils/DrillstringUtils.d.ts.map +1 -1
- package/utils/DrillstringUtils.js +1 -1
- package/utils/DrillstringUtils.js.map +1 -1
- package/utils/bha.js +1 -1
- package/utils/bha.js.map +1 -1
- package/utils/drillstring/conversion.d.ts.map +1 -1
- package/utils/drillstring/conversion.js +1 -1
- package/utils/drillstring/conversion.js.map +1 -1
- package/utils/drillstring/schematic.js +1 -1
- package/utils/drillstring/schematic.js.map +1 -1
- package/utils/drillstring/validation.d.ts.map +1 -1
- package/utils/drillstring/validation.js +1 -1
- package/utils/drillstring/validation.js.map +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/asyncToGenerator";import o from"@babel/runtime/helpers/defineProperty";import s from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as i,useRef as r,useEffect as p,useCallback as c,useMemo as m}from"react";import l from"classnames";import{uniqBy as a,uniq as d,sortBy as u,isEmpty as j}from"lodash";import{Replay as f,InfoOutlined as C}from"@material-ui/icons";import{useFetchWells as A}from"./effects/useFetchWells.js";import{useAdvancedWells as v}from"./effects/useAdvancedWells.js";import{useBicWells as g}from"./effects/useBicWells.js";import{useCompanyMetricKey as S}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as h}from"./effects/useFilterOptions.js";import{useFilteredWells as b}from"./effects/useFilteredWells.js";import{useSortedWells as V}from"./effects/useSortedWells.js";import"./effects/useAssetsData.js";import{useTableColumns as I}from"./effects/useTableColumns.js";import{useCompanyProvider as D}from"./effects/useCompanyProvider.js";import{AppHeader as T}from"./components/AppHeader/AppHeader.js";import{Toolbar as P}from"./components/Toolbar/Toolbar.js";import{Filter as y}from"./components/Filter/Filter.js";import{WellsMap as x}from"./components/Map/WellsMap.js";import W from"./components/OffsetWellsTable/OffsetWellsTable.js";import{ALL_SECTION_KEY as B,ViewType as M,TOP_GRADIENT_MAP as F,ColumnType as E,COMPANY_PROVIDERS_FOR_IDAS as L,FilterType as O,ROWS_PER_PAGE as k,RESYNC_STATUS as H,LEAVE_TOUCH_DELAY as w,IOS_DEVICE as N,DEFAULT_LOCAL_OFFSET_SIZE as R,MAX_OFFSET_SIZE as G,SMALL_SCREEN_WIDTH as q,SMALL_SCREEN_HEIGHT as z,DEFAULT_BIC_OFFSET_SIZE as U}from"./constants.js";import{SEARCH_CATEGORIES as _}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";import{getCoordinatedWells as K,getMobileOperatingSystem as Z}from"./utils/index.js";import X from"./OffsetWellPickerV4.module.css.js";import"../../utils/index.js";import"../../clients/subscriptions/constants.js";import"querystring";import"uuid/v1";import"../../clients/subscriptions.v1.js";import"../../clients/jsonApi/index.js";import"../../clients/subscriptions/subscriptions-client.factory.js";import"../../constants/goals.js";import"../../constants/segment.js";import"../../constants/alerts.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import"../../constants/completion.js";import"../../constants/appPackages.js";import"../../constants/notifications.js";import"../../constants/feed.js";import"../../constants/bha.js";import"../../constants/corvaCompanyId.js";import"../GradientManager/configuration/constants.js";import"uuid";import"jsona";import"../../utils/env.js";import"../StatusBadge/constants.js";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../clients/api/apiCore.js";import"../../clients/constants.js";import"../../clients/sso/auth0.js";import"../../clients/sso/oauth2.js";import"lodash/isEmpty";import"lodash/sortBy";import"../../constants/streamSourceType.js";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import{jsxs as J,jsx as Q,Fragment as Y}from"react/jsx-runtime";import{useAppCommons as $}from"../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"@material-ui/core/Snackbar";import"../Notifications/Toast.js";import"../Notifications/Notifications.scss.js";import{NotificationsContainer as ee}from"../Notifications/NotificationsContainer.js";import{isMobileDetected as te,isNativeDetected as oe}from"../../utils/mobileDetect.js";import se from"../../styles/typography/index.js";import"../../styles/counter/counter.module.scss.js";import{Regular14 as ne,Regular12 as ie}from"../Typography.js";import re from"../Modal/Modal.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../AppIcon/AppIcon.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"@material-ui/core";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../componentsV2/Text/Text.js";import"../../componentsV2/Grid/Grid.js";import"../../componentsV2/Grid/Grid.scss.js";import"../../componentsV2/Header/Header.scss.js";import"../../componentsV2/Button/Button.js";import"../../componentsV2/ButtonIcon/ButtonIcon.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/IsInsideIsolatedDcAppProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../../componentsV2/Tooltip/Tooltip.scss.js";import"../../componentsV2/Popover/Popover.js";import"../../componentsV2/Radio/Radio.js";import"../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../componentsV2/Checkbox/Checkbox.js";import"../../componentsV2/TextInput/TextInput.js";import"../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../componentsV2/TextLink/TextLink.js";import"../../componentsV2/Chip/Chip.js";import"../../componentsV2/ChipAlert/ChipAlert.js";import"../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../componentsV2/Avatar/Avatar.js";import"../../componentsV2/Avatar/constants.js";import"../../componentsV2/AvatarGroup/AvatarGroup.scss.js";import"@material-ui/lab";import"../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../componentsV2/Paper/Paper.js";import"../../componentsV2/ModalWindow/ModalWindow.scss.js";import"@icon-park/react/es/all";import"../../icons/IconParkProvider.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../componentsV2/Modal/Modal.scss.js";import"../../componentsV2/Menu/Menu.js";import"../../componentsV2/Counter/Counter.js";import"../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../componentsV2/Switch/Switch.js";import"../../componentsV2/Tabs/Tabs.js";import"../../componentsV2/EmptyState/EmptyState.scss.js";import"../../componentsV2/FileIcon/FileIcon.js";import"../../componentsV2/Tag/Tag.js";import"react-dropzone";import"../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../componentsV2/FilesLoader/FilesLoader.scss.js";import"../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../componentsV2/Skeleton/Skeleton.scss.js";import"../../utils/main.js";import"../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../componentsV2/Stepper/Step/Step.scss.js";import"../../componentsV2/Stepper/Stepper.scss.js";import"../../componentsV2/ButtonLive/ButtonLive.js";import"../../componentsV2/ButtonText/ButtonText.js";import"../../componentsV2/LiveDotIndicator/LiveDotIndicator.scss.js";import"../../componentsV2/IndicatorLive/IndicatorLive.scss.js";import"../../componentsV2/Accordion/Accordion.scss.js";import"../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../componentsV2/BadgeComment/BadgeComment.js";import"../../componentsV2/AppContainer/AppContainer.js";import"../../componentsV2/AppContainer/AppContainer.constants.js";import"../../componentsV2/AppFooter/AppFooter.js";import"../../componentsV2/AppHeader/AppHeader.constants.js";import"../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../componentsV2/AppHeader/AppAssets/utils.js";import"../../componentsV2/AppHeader/AppAssets/AppAssets.scss.js";import"../PadModeSelect/PadModeSelect.js";import"../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../types/shared/Completions.js";import"../PadModeSelect/types.js";import"lodash/flatten";import"lodash/partition";import"../../componentsV2/PadModeSelect/FracModeLabel/FracModeLabel.js";import"../../componentsV2/PadModeSelect/FracModeLabel/FracModeLabel.constants.js";import"../../componentsV2/PadModeSelect/WellStreamActivityStatus/WellStreamActivityStatus.scss.js";import"../../componentsV2/PadModeSelect/PadModeSelect.constants.js";import"../../componentsV2/PadModeSelect/PadModeSelect.scss.js";import"../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.js";import"../../componentsV2/AppFooter/DqPopover/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.scss.js";import"../../componentsV2/AppDqPopover/DqAlert/DqAlert.scss.js";import"../../componentsV2/AppDqPopover/DqAsset/DqAsset.scss.js";import"../../componentsV2/AppDqPopover/AppDqPopover.scss.js";import"../../utils/getSingleAsset.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/loadAssets.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelector.scss.js";import"../../componentsV2/AppHeader/V3/AppTitle/AppTitle.constants.js";import"../../componentsV2/AppContainer/headerCommon.scss.js";import"../../componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js";import"../../componentsV2/AppHeader/V3/constants.scss.js";import"@babel/runtime/helpers/typeof";import"../../componentsV2/AppSizeProvider/AppSizeProvider.js";import"../../componentsV2/AppSettings/AppSettings.js";import"../../componentsV2/AppSettings/AppSettings.constants.js";import"../../componentsV2/AppSettings/AppSettingsPinningContext.js";import"../../componentsV2/AppHeader/V3/SettingsPopover/SettingsPopover.constants.js";import"../../componentsV2/AppHeader/V3/SettingsPopover/SettingsPopover.scss.js";import"../../componentsV2/AppHeader/V3/Actions/Actions.constants.js";import"../../componentsV2/AppHeader/V3/Actions/Actions.scss.js";import"../../componentsV2/AppHeader/V3/AppHeaderV3.scss.js";import"../../componentsV2/AppHeader/AppHeader.scss.js";import"../../componentsV2/OffsetWellsButton/OffsetWellsButton.scss.js";import"../../componentsV2/Autocomplete/Autocomplete.scss.js";import"../../componentsV2/Menu/MenuItem/MenuItem.scss.js";import"../../componentsV2/AppSettingsDivider/AppSettingsDivider.scss.js";import"../../componentsV2/WellArchivedMessage/WellArchivedMessage.js";import"../../componentsV2/DatePicker/CalendarControls/CalendarControls.scss.js";import"../../componentsV2/DatePicker/TimePicker/TimePicker.js";import"../../componentsV2/DatePicker/Input/Input.js";import"../../componentsV2/DatePicker/CalendarGrid/CalendarGrid.scss.js";import"../../componentsV2/DatePicker/DatePicker.scss.js";import"../../componentsV2/DragHandle/DragHandle.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"rollbar";import"@rollbar/react";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../Toaster/Toaster.js";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../AssetEditor/index.js";import"../AssetEditorV2/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import pe from"../LoadingIndicator/LoadingIndicator.js";import"../RealTimeValuesSidebar/RealTimeSidebar.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"slate";import"../EmptyState/EmptyState.js";import"../ParameterCharts/ParameterCharts.js";import"../ParameterCharts/AddEditTrack.js";import"../ChartActionsList/ChartActionsList.js";import"../CopyToClipboard/CopyToClipboard.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/SingleAssetEditor.js";import"react-color";import"../SettingEditors/ColorEditor/style.css.js";import"../SettingEditors/DropdownEditor/index.js";import"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../Chart/components/ChartButton.js";import"../Chart/components/ChartButtons.js";import"../Chart/components/ChartWrapper.js";import"../Chart/components/AxisDropdown.js";import"../Chart/components/ChartSelect.js";import"../Chart/components/buttons/DragToZoomButton.js";import"../Chart/components/buttons/ZoomInButton.js";import"../Chart/components/buttons/ZoomOutButton.js";import"../Chart/components/buttons/PanButton.js";import"../Chart/components/buttons/ResetZoomButton.js";import"../Chart/components/buttons/HideAxesButton.js";import"../Chart/components/buttons/ChartTypeButton.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../MiddleTruncatedText/MiddleTruncatedText.js";import"../RangeSlider/constants.js";import"../RangeSlider/Input.css.js";import"../RangeSlider/RangeSlider.css.js";import"../AdvancedSlider/AdvancedSlider.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import ce from"../Button/components/Button/index.js";import"moment-timezone";import"../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../Button/components/LiveButton/styles.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../IconButton/index.js";import"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../Select/SelectFilterBy.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../GradientPicker/GradientPicker.js";import"../GradientManager/GradientList.js";import"@material-ui/icons/AddCircle";import"../GradientManager/GradientPreview/GradientPreview.js";import"../GradientManager/GradientSelect.styles.js";import"../GradientManager/GradientManager.styles.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Drillstring/BHATileIcon.js";import"../Drillstring/BHATile/BHATile.js";import"../Drillstring/BHAList/BHAList.js";import"../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../Casing/CasingTable/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTileIcon.js";import"../Casing/CasingTableV2/CasingTableV2.js";import"../Casing/CasingTile/CasingTile.js";import"../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../BICOffsetPickerDialog/index.js";import"../OffsetWellButton/OffsetWellButton.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../OffsetWellChips/Chip.js";import"../OffsetWellChips/ChipsContainer.js";import"../OffsetWellMap/OffsetWellMap.js";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../Template/TemplateSharingDialog/index.js";import"../MenuItem/index.js";import"../MiddleTruncate/MiddleTruncate.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../Table/TableToolbar/TableToolbar.js";import"../Table/TableContainer/TableContainer.js";import"../Table/TableCell/TableCell.js";import"../Table/TablePagination/TablePagination.js";import"../Table/TablePaginationActions/TablePaginationActions.js";import{Tooltip as me}from"../Tooltip/Tooltip.js";import"../Tooltip/ScrollableTooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Stepper.js";import"../Stepper/Step/Step.js";import"../Stepper/StepsWrapper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../ColorPickerPalette/ColorPickerPalette.js";import"../Search/Search.js";import"../Search/components/Listbox.js";import"../Search/components/Paper.js";import"../Search/components/RecentSearches.js";import"../Search/components/Groups.js";import"../Search/components/SelectAllListItem.js";import"../StatusBadge/index.js";import"../Attachment/index.js";import"../EmojiIconButton.js";import"../FileUploadIconButton.js";import"../FilePreview/index.js";import"../FailedFileUploading.js";import"../UserMention/index.js";import"../CommentsInfo/index.js";import"../CommentInput/index.js";import"../Comment/index.js";import"../CommentLoader.js";import"../AssetNameLabel/AssetStatusBadge.js";import"../AssetEditorV2/components/PrimaryAssetSelect.js";import"../AssetEditorV2/components/SecondaryAssetSelect.js";import"../AssetEditorV2/components/SelectItem.js";import"../AssetEditorV2/components/MultipleAssetsToggle.js";import"../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../EChartsWrapper/EChartsWrapper.js";import"../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../GoogleDocsViewer/index.js";import"../NewDocumentViewer/effects/useFileContent.js";import"../NewDocumentViewer/styles.js";import"../FilesLoaderV2/styles.js";import"../FilesDropzone/styles.js";import"../FilesProcessor/styles.js";import"../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../Formula/useFormulaStyles.js";import"../Formula/RootXIcon.js";import"../Formula/FormulaTextEditor.js";import"../Formula/CloseSuggestion.js";import"../Formula/SuggestionsMenu.js";import{showInfoNotification as le}from"../../utils/notificationToasts.js";function ae(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,s)}return o}function de(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(s),!0).forEach((function(t){o(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ae(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var ue="OffsetWellPickerV4",je=function(ae){var je,fe,Ce,Ae=ae.open,ve=ae.isWDUser,ge=ae.defaultSubjectWell,Se=ae.currentUser,he=ae.offsetSettings,be=ae.addWellsUsabilityInfo,Ve=ae.isViewOnly,Ie=ae.onClose,De=ae.onSave,Te=ae.maxOffsetSize,Pe=void 0===Te?U:Te,ye=ae.localMaxOffsetSize,xe=void 0===ye?R:ye,We=ae.syncAutoEnabled,Be=ae.isManualWellsEnabled,Me=void 0!==Be&&Be,Fe=$(),Ee=null==Fe?void 0:Fe.globalOffsetWells,Le=i(null),Oe=s(Le,2),ke=Oe[0],He=Oe[1],we=Math.min(Pe+1,xe+1,G+1),Ne=Math.min(Math.max(we,xe+1),G+1),Re=i(null==he?void 0:he.filterExpanded),Ge=s(Re,2),qe=Ge[0],ze=Ge[1],Ue=i(null==he?void 0:he.mapHidden),_e=s(Ue,2),Ke=_e[0],Ze=_e[1],Xe=+(null==ge?void 0:ge.companyId)||+(null==Se?void 0:Se.company_id),Je=null==ge?void 0:ge.asset_id,Qe=i((null==he?void 0:he.filters)||{}),Ye=s(Qe,2),$e=Ye[0],et=Ye[1],tt=i((null==he?void 0:he.wellSection)||B),ot=s(tt,2),st=ot[0],nt=ot[1],it=r(!0),rt=i([]),pt=s(rt,2),ct=pt[0],mt=pt[1],lt=i(null),at=s(lt,2),dt=at[0],ut=at[1],jt=i(!0),ft=s(jt,2),Ct=ft[0],At=ft[1];p((function(){if(Ee&&Array.isArray(Ee)){var e=de(de({},he),{},{selectedWellIds:Ee.map((function(e){return e.id}))});De(e,Ee)}}),[Ee]);var vt=i(!1),gt=s(vt,2),St=gt[0],ht=gt[1],bt=i(!1),Vt=s(bt,2),It=Vt[0],Dt=Vt[1],Tt=r(),Pt=r(),yt=i(M.none),xt=s(yt,2),Wt=xt[0],Bt=xt[1],Mt=r(),Ft=i(!1),Et=s(Ft,2),Lt=Et[0],Ot=Et[1],kt=Ne<=(null==ct?void 0:ct.length),Ht=F[Wt],wt=r(),Nt=i(!0),Rt=s(Nt,2),Gt=Rt[0],qt=Rt[1];p((function(){var e,t,o;(Ae&&kt&&le("App can’t process more than (".concat(Ne-1,") Offset Wells.")),Ae)||((null==he||null===(e=he.selectedWellIds)||void 0===e?void 0:e.length)===(null===(t=wt.current)||void 0===t?void 0:t.length)&&(null==he||null===(o=he.selectedWellIds)||void 0===o?void 0:o.every((function(e){var t;return null===(t=wt.current)||void 0===t?void 0:t.includes(e)})))||(it.current=!0),wt.current=null==he?void 0:he.selectedWellIds)}),[kt,Ae,he]),p((function(){function e(){window.innerWidth<=q||te||oe?Bt(M.mobile):window.innerHeight<=z?Bt(M.small):Bt(M.normal)}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[Ae]),p((function(){Mt.current&&Wt===Mt.current||(Mt.current=Wt,Wt===M.small||Wt===M.mobile?(Ze(!0),ze(!1)):(ze(!Ve&&(null==he?void 0:he.filterExpanded)),Ze(!Ve&&(null==he?void 0:he.mapHidden))),et((null==he?void 0:he.filters)||{}),nt((null==he?void 0:he.wellSection)||B))}),[he,Ve,Wt]);var zt=A(Xe,be),Ut=s(zt,2),_t=Ut[0],Kt=Ut[1],Zt=D(Xe),Xt=s(Zt,1)[0],Jt=g(ve,Se,Je,_t,Me),Qt=s(Jt,7),Yt=Qt[0],$t=Qt[1],eo=Qt[2],to=Qt[3],oo=Qt[4],so=Qt[5],no=Qt[6];p((function(){qt(!0),$t(null),to(null)}),[Je]);var io=S(Xe,null==he?void 0:he.metricsKeys),ro=s(io,2),po=ro[0],co=ro[1],mo=v(Xe,_t,Yt,eo,Je,po,Ae),lo=!Kt&&(null==mo?void 0:mo.length)===(null==_t?void 0:_t.length);p((function(){if(lo){var e,o=(e=t(n.mark((function e(){var t,o,s,i,r,p,c,m,l,a;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=void 0===(null==he?void 0:he.isSynced)||(null==he?void 0:he.isSynced),o=!0,!t){e.next=19;break}if(i=eo[B]||[],r=((null==he?void 0:he.selectedWellIds)||[]).every((function(e){return i.includes(e)})),i.length===(null==he||null===(s=he.selectedWellIds)||void 0===s?void 0:s.length)&&r){e.next=16;break}return e.next=8,K(i,Je);case 8:p=e.sent,c=p.slice(0,we+1).map((function(e){return e.id})),c=p.slice(0,xe+1).map((function(e){return e.id})),m=de(de({},he),{},{subjectWellId:Je,selectedWellIds:c,offsetWellsLimited:Ne<=c.length}),l=p.filter((function(e){return c.includes(e.id)})),De(m,l),e.next=17;break;case 16:o=!1;case 17:e.next=20;break;case 19:o=!1;case 20:if(o){e.next=25;break}return e.next=23,K((null==he?void 0:he.selectedWellIds)||[],Je);case 23:a=e.sent,De(he,a);case 25:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)});We&&Gt&&he&&eo&&(o(),qt(!1))}}),[he,eo,Je,Ne,We]);var ao=h(mo);p((function(){if(mo&&Yt){var e=mo.find((function(e){return e.id===Je}));if(e){var t=Yt.filter((function(e){return e.value!==B})).map((function(e){return e.label})),s=de(de({},e),t.length>0&&o({},E.wellSection,t));ut(s)}else ut(null)}}),[Yt,mo]);var uo=I(po),jo=b(mo,$e);p((function(){if(jo&&lo)if(it.current){var e=mo.filter((function(e){return((null==he?void 0:he.selectedWellIds)||[]).includes(e.id)}));dt&&(e=e.concat(dt)),mt(a(e,"id")),it.current=!1}else mt((function(e){var t=(jo||[]).filter((function(t){return!!e.find((function(e){var o=e.id;return t.id===o}))}));return dt&&(t=t.concat(dt)),a(t,"id")}))}),[mo,jo,null==he?void 0:he.selectedWellIds,lo]);var fo=V(dt,jo,ct,At),Co=s(fo,5),Ao=Co[0],vo=Co[1],go=Co[2],So=Co[3],ho=Co[4],bo=c((function(e,t,o){var s;s=o===_.well.name?t:t.reduce((function(e,t){var o,s=null===(o=mo.find((function(e){return e.id===t})))||void 0===o?void 0:o.rigName,n=mo.filter((function(e){return e.rigName===s})).map((function(e){return e.id}));return e.concat(n)}),[]);var n=mo.filter((function(e){var t=e.id;return s.includes(t)}));e?(n=n.slice(0,Math.min(n.length,Ne-ct.length)),mt((function(e){return a(e.concat(n),"id")}))):mt((function(e){return d(e.filter((function(e){var t=e.id;return!n.find((function(e){return e.id===t}))})))}))}),[mo,ct]),Vo=c((function(){Dt(!0)}),[]),Io=c((function(e){co(e)}),[]),Do=c((function(t,o){mt(o?function(o){return[].concat(e(o),[t])}:function(e){return e.filter((function(e){return e.id!==t.id}))})}),[]),To=c((function(e){if(e){var t=dt?jo.concat(dt):jo,o=u(a(t,"id"),"distance");mt(o.slice(0,Ne))}else mt(dt?[dt]:[])}),[jo,dt,Ne]),Po=function(e){if(eo){var t=(null==mo?void 0:mo.filter((function(t){var o;return null===(o=eo[e])||void 0===o?void 0:o.includes(t.id)})))||[],o=u(t,"distance");mt(o.slice(0,we))}else mt(dt?[dt]:[])},yo=c((function(e){nt(e),Po(e)}),[Po]),xo=m((function(){return ct.find((function(e){return e.id===Je}))?ct.length-1:ct.length}),[ct,Je]),Wo=m((function(){if(!eo)return!1;var e=ct.map((function(e){return e.id})),t=eo[st]||[];return Math.min(t.length,we)===e.length&&e.every((function(e){return t.includes(e)}))}),[eo,ct,st,we]),Bo=m((function(){return!!Xt&&L.includes(Xt)}),[Xt]),Mo=m((function(){return Bo?"IDAS generated offsets.":ve?"Offset Selection App.":"WellHub."}),[Bo,ve]),Fo=function(){var e=(mo||[]).filter((function(e){return((null==he?void 0:he.selectedWellIds)||[]).includes(e.id)}));dt&&(e=e.concat(dt)),mt(a(e,"id"));var t=de(de({},he),{},{mapHidden:Ke,filterExpanded:qe});De(t),et((null==he?void 0:he.filters)||{}),nt((null==he?void 0:he.wellSection)||B),Ie()},Eo=Ct||Kt,Lo=m((function(){return!Eo&&(!Wo||(!(j($e)||!$e[O.sideTracks])||st!==B))}),[Wo,$e,st,Eo]),Oo=function(){et({}),nt(B),Po(B)},ko=!mo||!Yt||!ho||Wt===M.none,Ho=i(!1),wo=s(Ho,2),No=wo[0],Ro=wo[1],Go=i(k),qo=s(Go,2),zo=qo[0],Uo=qo[1],_o=i([]),Ko=s(_o,2),Zo=Ko[0],Xo=Ko[1];p((function(){if(ho){var e=ho.slice(0,zo);Xo(e)}}),[ho,zo,dt]),p((function(){oo===H.SUCCEEDED&&Oo()}),[eo]);return J(re,{open:Ae,onClose:Fo,title:Q(T,{isWDUser:ve,viewType:Wt,totalCount:null!==(je=null==mo?void 0:mo.length)&&void 0!==je?je:0,selectedCount:xo,isViewOnly:Ve,maxOffsetWellNumber:Ne}),isMobile:Wt===M.mobile,contentContainerClassName:l(X.offsetWellDialog),contentClassName:l(X.contentContainer,(fe={},o(fe,X.smallContainer,Wt===M.small),o(fe,X.contentContainerMobile,Wt===M.mobile),fe)),actionsClassName:X.modalActions,actions:!Ve&&J("div",{className:X.actionsWrapper,children:[!ko&&Lo?Q(me,{placement:"bottom-start",title:"Reset to Synced Offsets in ".concat(ve?"Offset App":"Wellhub"),children:Q("div",{children:Q(ce,{"data-testid":"".concat(ue,"_reset"),onClick:Oo,color:"primary",startIcon:Wt!==M.mobile&&Q(f,{}),classes:Wt===M.mobile&&{root:X.resetButtonMobile},children:Wt!==M.mobile?"Reset":Q(f,{})})})}):Q("div",{className:Wt===M.mobile&&X.infoIconContainer,children:Wt!==M.mobile?J(Y,{children:[Q("span",{className:l(se.regular12,se.colors.t6),children:"The offset list is being automatically populated by "}),Q("span",{className:l(se.medium12,se.colors.t6),children:Mo})]}):Q(me,{title:J("div",{children:[Q("span",{className:l(se.regular12,se.colors.t1),children:"The offset list is being automatically populated by "}),Q("span",{className:l(se.medium12,se.colors.t1),children:Mo})]}),enterTouchDelay:0,leaveTouchDelay:w,children:Q(C,{className:X.infoIcon})})}),J("div",{className:X.buttonGap,children:[Q(ce,{"data-testid":"".concat(ue,"_cancel"),onClick:Fo,color:"primary",children:"Cancel"}),J(ce,{"data-testid":"".concat(ue,"_selectedWells"),variant:"contained",color:"primary",onClick:function(){Ie();var e=de(de({},he),{},{companyId:Xe,subjectWellId:Je,selectedWellIds:ct.map((function(e){return e.id})),filters:$e,metricsKeys:po,wellSection:st,isSynced:Wo,mapHidden:Ke,filterExpanded:qe,offsetWellsLimited:kt});De(e,ct)},children:["Select (",xo,")"]})]})]}),children:[Q(ee,{}),ko?Q(pe,{fullscreen:!1}):J("div",{className:l(X.contentWrapper,o({},X.contentBlocked,Eo)),ref:Tt,children:[Wt===M.mobile&&J("div",{className:l(X.countContainer,o({},X.countContainerMobile,Wt===M.mobile)),children:[Q(ne,{className:X.totalLabel,children:"Total:"}),Q(ne,{"data-testid":"".concat(ue,"_totalWells"),className:X.countValue,children:mo.length}),Q(ne,{className:X.selectedLabel,children:"Selected:"}),Q(ne,{"data-testid":"".concat(ue,"_selected"),className:X.countValue,children:xo}),Q(me,{title:"App can’t process more than (".concat(Ne-1,") Offset Wells."),placement:"right",children:J(ie,{"data-testid":"".concat(ue,"_maxOffsetSize"),className:X.maxOffsetSize,children:["/",Ne-1]})})]}),Wt===M.normal&&Q(P,{isViewOnly:Ve,isXtoProvider:Bo,viewType:Wt,filters:$e,setFilters:et,isFilterExpanded:qe,setIsFilterExpanded:ze,isMapHidden:Ke,setIsMapHidden:Ze,resyncStatus:oo,setResyncStatus:so}),Lt&&Q("div",{className:X.topGradient,style:{top:Ht}}),J("div",{className:l(X.content,(Ce={},o(Ce,X.contentBlocked,Eo),o(Ce,X.contentMobile,Wt===M.mobile),o(Ce,X.contentiOSMobile,Z()===N),Ce)),ref:Pt,onScroll:function(e){return function(e){e.target&&(It&&(e.target.scrollLeft=0,Dt(!1)),e.target.scrollLeft<=5&&No&&Ro(!1),e.target.scrollLeft>5&&!No&&Ro(!0),e.target.scrollTop<=5&&Lt&&Ot(!1),e.target.scrollTop>5&&!Lt&&Ot(!0),e.target.scrollHeight!==e.target.offsetHeight&&Math.round(e.target.scrollTop+e.target.offsetHeight+2)>=e.target.scrollHeight&&zo<ho.length&&Uo((function(e){return e+k})))}(e)},children:[Wt!==M.normal&&Q(P,{isViewOnly:Ve,isXtoProvider:Bo,viewType:Wt,filters:$e,setFilters:et,isFilterExpanded:qe,setIsFilterExpanded:ze,isMapHidden:Ke,setIsMapHidden:Ze,resyncStatus:oo,setResyncStatus:so}),!Ke&&Ae&&Q(x,{isViewOnly:Ve,mapHidden:Ke,subjectWell:dt,offsetWellIds:ct.map((function(e){return e.id})),wells:jo,radius:$e[O.radius],handleChangeOffsetWell:Do,activeWellId:ke,viewType:Wt}),Q(y,{isHidden:!qe,isWDUser:ve,filterOptions:ao,filters:$e,wellSections:Yt,selectedWellSection:st,subjectWell:dt,onChangeFilters:function(e){At(!0),setTimeout((function(){return et(e)}),0)},onChangeBicWells:yo}),Q(W,{open:Ae,isTableLoading:Eo,companyId:Xe,subjectWellId:Je,sortBy:Ao,setSortBy:vo,sortDirection:go,setSortDirection:So,columnsWithDict:uo,wells:Zo,metricsKeys:po,setMetricsKeys:Io,handleChangeOffsetWell:Do,handleChangeAllOffsetWells:To,handleAddRemoveAssets:bo,isWellNameExpand:St,setIsWellNameExpand:ht,isHScrollMoved:No,onHideAdvancedSearch:Vo,isViewOnly:Ve,isLastWell:ho.length<=zo,contentRef:Tt,offsetWellsContainerRef:Pt,isLimitedOffsetWells:kt,maxOffsetWellNumber:Ne,wellSections:Yt,setActiveWellId:He,viewType:Wt,isWDUser:ve,taScores:no})]}),Ve&&J("div",{className:X.viewOnlyInfoContainer,children:[Q("span",{className:l(se.regular12,se.colors.t6),children:"The offset list is being automatically populated by "}),Q("span",{className:l(se.medium12,se.colors.t6),children:Mo})]})]})]})};export{je as default};
|
|
1
|
+
import e from"@babel/runtime/helpers/toConsumableArray";import t from"@babel/runtime/helpers/defineProperty";import o from"@babel/runtime/helpers/asyncToGenerator";import s from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as i,useRef as r,useEffect as p,useCallback as c,useMemo as m}from"react";import l from"classnames";import{uniqBy as a,uniq as d,sortBy as u,isEmpty as j}from"lodash";import{Replay as f,InfoOutlined as C}from"@material-ui/icons";import{useFetchWells as A}from"./effects/useFetchWells.js";import{useAdvancedWells as v}from"./effects/useAdvancedWells.js";import{useBicWells as S}from"./effects/useBicWells.js";import{useCompanyMetricKey as g}from"./effects/useCompanyMetricKey.js";import{useFilterOptions as h}from"./effects/useFilterOptions.js";import{useFilteredWells as b}from"./effects/useFilteredWells.js";import{useSortedWells as V}from"./effects/useSortedWells.js";import"./effects/useAssetsData.js";import{useTableColumns as I}from"./effects/useTableColumns.js";import{useCompanyProvider as D}from"./effects/useCompanyProvider.js";import{useGlobalOffsetWellsSync as T}from"./effects/useGlobalOffsetWellsSync.js";import{AppHeader as P}from"./components/AppHeader/AppHeader.js";import{Toolbar as y}from"./components/Toolbar/Toolbar.js";import{Filter as x}from"./components/Filter/Filter.js";import{WellsMap as W}from"./components/Map/WellsMap.js";import B from"./components/OffsetWellsTable/OffsetWellsTable.js";import{ALL_SECTION_KEY as M,ViewType as F,TOP_GRADIENT_MAP as E,ColumnType as L,COMPANY_PROVIDERS_FOR_IDAS as O,FilterType as k,ROWS_PER_PAGE as H,RESYNC_STATUS as w,LEAVE_TOUCH_DELAY as N,IOS_DEVICE as R,DEFAULT_LOCAL_OFFSET_SIZE as G,MAX_OFFSET_SIZE as q,SMALL_SCREEN_WIDTH as z,SMALL_SCREEN_HEIGHT as U,DEFAULT_BIC_OFFSET_SIZE as _}from"./constants.js";import{SEARCH_CATEGORIES as K}from"./components/OffsetWellsTable/AdvancedSearch/constants.js";import{getCoordinatedWells as Z,getMobileOperatingSystem as X}from"./utils/index.js";import J from"./OffsetWellPickerV4.module.css.js";import"../../utils/index.js";import{jsxs as Q,jsx as Y,Fragment as $}from"react/jsx-runtime";import"@material-ui/core/Snackbar";import"../Notifications/Toast.js";import"../Notifications/Notifications.scss.js";import{NotificationsContainer as ee}from"../Notifications/NotificationsContainer.js";import{isMobileDetected as te,isNativeDetected as oe}from"../../utils/mobileDetect.js";import se from"../../styles/typography/index.js";import"../../styles/counter/counter.module.scss.js";import{Regular14 as ne,Regular12 as ie}from"../Typography.js";import re from"../Modal/Modal.js";import"../IconMenu/index.js";import"../StyledMenuItem/index.js";import"../AppIcon/AppIcon.js";import"../DevCenter/AppHeader/AppHeader.js";import"../DevCenter/AppSideBar/AppSideBar.js";import"../DevCenter/AppsDataProvider/AppsDataProvider.js";import"@material-ui/core";import"../DevCenter/AppContext.js";import"../DevCenter/DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenter/DevCenterRouterContext/UniversalLink/UniversalLink.js";import"@babel/runtime/helpers/objectWithoutProperties";import"react-router";import"../../constants/goals.js";import"../../constants/segment.js";import"../../constants/alerts.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import"../../constants/completion.js";import"../../constants/appPackages.js";import"../../constants/notifications.js";import"../../constants/feed.js";import"../../constants/bha.js";import"../../constants/corvaCompanyId.js";import"../GradientManager/configuration/constants.js";import"../DevCenter/DevCenterAppContainer/components/AppActions/AppActions.css.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/AppSettingsDialog.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/RemoveAppButton.js";import"../DevCenter/DevCenterAppContainer/components/AppSettingsDialog/components/SettingsAccordion.js";import"../DevCenter/DevCenterAppContainer/components/AnnotationsButton/AnnotationsButton.js";import"../../componentsV2/Text/Text.js";import"../../componentsV2/Grid/Grid.js";import"../../componentsV2/Grid/Grid.scss.js";import"../../componentsV2/Header/Header.scss.js";import"../../componentsV2/Button/Button.js";import"../../componentsV2/ButtonIcon/ButtonIcon.js";import"../DevCenter/DevCenterAppContainer/components/IsInsideIsolatedDcAppProvider/IsInsideIsolatedDcAppProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";import"../DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"uuid";import"../../componentsV2/Tooltip/Tooltip.scss.js";import"../../componentsV2/Popover/Popover.js";import"../../componentsV2/Radio/Radio.js";import"../../componentsV2/RadioAndCheckboxGroup/RadioAndCheckboxGroup.scss.js";import"../../componentsV2/Checkbox/Checkbox.js";import"../../componentsV2/TextInput/TextInput.js";import"../../componentsV2/TextEndTruncated/TextEndTruncated.scss.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.constants.js";import"../../componentsV2/TextMiddleTruncated/TextMiddleTruncated.scss.js";import"../../componentsV2/TextLink/TextLink.js";import"../../componentsV2/Chip/Chip.js";import"../../componentsV2/ChipAlert/ChipAlert.js";import"../../componentsV2/ChipIndicator/ChipIndicator.js";import"../../componentsV2/Avatar/Avatar.js";import"../../componentsV2/Avatar/constants.js";import"../../componentsV2/AvatarGroup/AvatarGroup.scss.js";import"@material-ui/lab";import"../../componentsV2/ToggleButtons/ToggleButtons.scss.js";import"../../componentsV2/Paper/Paper.js";import"../../componentsV2/ModalWindow/ModalWindow.scss.js";import"@icon-park/react/es/all";import"../../icons/IconParkProvider.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import"../../icons/customIcons/icons/Pad.js";import"../../icons/customIcons/icons/DrilloutUnit.js";import"../../icons/customIcons/icons/FracFleet.js";import"../../icons/customIcons/icons/Global.js";import"../../icons/customIcons/icons/Program.js";import"../../icons/customIcons/icons/Rig.js";import"../../icons/customIcons/icons/Well.js";import"../../icons/customIcons/icons/Gap.js";import"../../icons/customIcons/icons/Pin.js";import"../../icons/customIcons/icons/CloseOneFilled.js";import"../../icons/customIcons/icons/AttentionFilled.js";import"../../icons/customIcons/icons/CheckOneFilled.js";import"../../icons/customIcons/icons/Archive.js";import"../../icons/customIcons/icons/ArchiveCancel.js";import"../../icons/customIcons/icons/Unarchive.js";import"../../icons/customIcons/icons/Archived.js";import"../../componentsV2/Modal/Modal.scss.js";import"../../componentsV2/Menu/Menu.js";import"../../componentsV2/Counter/Counter.js";import"../../componentsV2/BadgeBase/BadgeBase.scss.js";import"../../componentsV2/BadgeDot/BadgeDot.scss.js";import"../../componentsV2/LoaderLinear/LoaderLinear.scss.js";import"../../componentsV2/LoaderLogo/LoaderLogo.constants.js";import"../../componentsV2/LoaderLogo/LoaderLogo.scss.js";import"../../componentsV2/Switch/Switch.js";import"../../componentsV2/Tabs/Tabs.js";import"../../componentsV2/EmptyState/EmptyState.scss.js";import"../../componentsV2/FileIcon/FileIcon.js";import"../../componentsV2/Tag/Tag.js";import"react-dropzone";import"../../componentsV2/FilesDropzone/FilesDropzone.scss.js";import"../../componentsV2/FilesLoader/FilesLoader.scss.js";import"../../componentsV2/FilesProcessor/FilesProcessor.scss.js";import"../../componentsV2/Skeleton/Skeleton.scss.js";import"../../utils/main.js";import"../../componentsV2/CopyToClipboard/CopyToClipboard.scss.js";import"../../componentsV2/Stepper/Step/Step.scss.js";import"../../componentsV2/Stepper/Stepper.scss.js";import"../../componentsV2/ButtonLive/ButtonLive.js";import"../../componentsV2/ButtonText/ButtonText.js";import"../../componentsV2/LiveDotIndicator/LiveDotIndicator.scss.js";import"../../componentsV2/IndicatorLive/IndicatorLive.scss.js";import"../../componentsV2/Accordion/Accordion.scss.js";import"../../componentsV2/Breadcrumbs/Breadcrumbs.scss.js";import"../../componentsV2/BadgeComment/BadgeComment.js";import"../../componentsV2/AppContainer/AppContainer.js";import"../../componentsV2/AppContainer/AppContainer.constants.js";import"../../componentsV2/AppFooter/AppFooter.js";import"../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import"../../componentsV2/AppHeader/AppHeader.constants.js";import"../../componentsV2/AppHeader/AppBadge/AppBadge.scss.js";import"../../componentsV2/AppHeader/AppAssets/utils.js";import"../../componentsV2/AppHeader/AppAssets/AppAssets.scss.js";import"../PadModeSelect/PadModeSelect.js";import"../../componentsV2/AppHeader/PadMode/PadMode.scss.js";import"../../constants/streamSourceType.js";import"../../types/shared/Completions.js";import"../PadModeSelect/types.js";import"lodash/flatten";import"lodash/partition";import"../../componentsV2/PadModeSelect/FracModeLabel/FracModeLabel.js";import"../../componentsV2/PadModeSelect/FracModeLabel/FracModeLabel.constants.js";import"../../clients/jsonApi/index.js";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../clients/subscriptions/constants.js";import"../../clients/subscriptions.v1.js";import"../../clients/subscriptions/subscriptions-client.factory.js";import"../../clients/api/apiCore.js";import"../../clients/constants.js";import"../../clients/sso/auth0.js";import"../../clients/sso/oauth2.js";import"../../componentsV2/PadModeSelect/WellStreamActivityStatus/WellStreamActivityStatus.scss.js";import"../../componentsV2/PadModeSelect/PadModeSelect.constants.js";import"../../componentsV2/PadModeSelect/PadModeSelect.scss.js";import"querystring";import"uuid/v1";import"jsona";import"../../utils/env.js";import"../StatusBadge/constants.js";import"lodash/isEmpty";import"lodash/sortBy";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import"../../componentsV2/AppHeader/V3/VersionSelect/VersionSelect.js";import"../../componentsV2/UniversalLink/UniversalLink.scss.js";import"../../componentsV2/AppHeader/V3/AssetChips/AssetChips.scss.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppHeader/V3/DqStatusIcon/DqStatusIcon.constants.js";import"../../componentsV2/AppFooter/DqPopover/DqStatusIcon/DqStatusIcon.js";import"../../componentsV2/AppDqPopover/DqAlertTooltip/DqAlertTooltip.scss.js";import"../../componentsV2/AppDqPopover/DqAlert/DqAlert.scss.js";import"../../componentsV2/AppDqPopover/DqAsset/DqAsset.scss.js";import"../../componentsV2/AppDqPopover/AppDqPopover.scss.js";import"../../utils/getSingleAsset.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorChip/AssetSelectorChip.js";import"../../componentsV2/AppHeader/V3/AssetSelector/constants.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/AssetSelectorSelect.scss.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelectorSelect/loadAssets.js";import"../../componentsV2/AppHeader/V3/AssetSelector/AssetSelector.scss.js";import"../../componentsV2/AppHeader/V3/AppTitle/AppTitle.constants.js";import"../../componentsV2/AppContainer/headerCommon.scss.js";import"../../componentsV2/AppHeader/V3/AppTitle/AppTitle.scss.js";import"../../componentsV2/AppHeader/V3/constants.scss.js";import"@babel/runtime/helpers/typeof";import"../../componentsV2/AppSizeProvider/AppSizeProvider.js";import"../../componentsV2/AppSettings/AppSettings.js";import"../../componentsV2/AppSettings/AppSettings.constants.js";import"../../componentsV2/AppSettings/AppSettingsPinningContext.js";import"../../componentsV2/AppHeader/V3/SettingsPopover/SettingsPopover.constants.js";import"../../componentsV2/AppHeader/V3/SettingsPopover/SettingsPopover.scss.js";import"../../componentsV2/AppHeader/V3/Actions/Actions.constants.js";import"../../componentsV2/AppHeader/V3/Actions/Actions.scss.js";import"../../componentsV2/AppHeader/V3/AppHeaderV3.scss.js";import"../../componentsV2/AppHeader/AppHeader.scss.js";import"../../componentsV2/OffsetWellsButton/OffsetWellsButton.scss.js";import"../../componentsV2/Autocomplete/Autocomplete.scss.js";import"../../componentsV2/Menu/MenuItem/MenuItem.scss.js";import"../../componentsV2/AppSettingsDivider/AppSettingsDivider.scss.js";import"../../componentsV2/WellArchivedMessage/WellArchivedMessage.js";import"../../componentsV2/DatePicker/CalendarControls/CalendarControls.scss.js";import"../../componentsV2/DatePicker/TimePicker/TimePicker.js";import"../../componentsV2/DatePicker/Input/Input.js";import"../../componentsV2/DatePicker/CalendarGrid/CalendarGrid.scss.js";import"../../componentsV2/DatePicker/DatePicker.scss.js";import"../../componentsV2/DragHandle/DragHandle.js";import"../DevCenter/DevCenterAppContainer/components/FullscreenButton/FullscreenButton.js";import"../DevCenter/DevCenterAppContainer/components/AppInfoMessage/AppInfoMessage.js";import"../DevCenter/DevCenterAppContainer/components/DevCenterAppView/DevCenterAppView.js";import"../DevCenter/DevCenterAppContainer/components/RestoreAppSizeButton/index.js";import"rollbar";import"@rollbar/react";import"../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchButton.scss.js";import"../DevCenter/DevCenterAppContainer/DevCenterAppContainer.css.js";import"../Icons/AnnotationIcon.js";import"../Annotations/components/AnnotationsList/index.js";import"../Annotations/components/LastAnnotation/index.js";import"../Annotations/AnnotationsContext.js";import"../Toaster/Toaster.js";import"../HelpCenter/HelpCenterIcon.js";import"../DevCenter/NavigationBar/NavigationBar.js";import"../DevCenter/SideBar/SideBar.js";import"../DevCenter/AppSettingsPopover/AppSettingsPopover.js";import"../DevCenter/AppFilterPanelLayout/AppFilterPanelLayout.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedAppPage.js";import"../DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js";import"../AssetEditor/index.js";import"../AssetEditorV2/index.js";import"../AppVersionsSelect/AppVersionsSelect.js";import pe from"../LoadingIndicator/LoadingIndicator.js";import"../RealTimeValuesSidebar/RealTimeSidebar.js";import"../CollapsableSidebar.js";import"../DateTimePicker/index.js";import"../DatePicker/index.js";import"../ErrorBoundary/ErrorBoundary.js";import"../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js";import"../SlateFormattedText/SlateFormattedText.js";import"../SlateFormattedText/RenderElements.js";import"slate";import"../EmptyState/EmptyState.js";import"../ParameterCharts/ParameterCharts.js";import"../ParameterCharts/AddEditTrack.js";import"../ChartActionsList/ChartActionsList.js";import"../CopyToClipboard/CopyToClipboard.js";import"../AssetEditor/AssetEditorAutocomplete.js";import"../AssetEditor/SingleAssetEditor.js";import"react-color";import"../SettingEditors/ColorEditor/style.css.js";import"../SettingEditors/DropdownEditor/index.js";import"../SwitchControl/index.js";import"../ColorPicker/ColorPicker.js";import"../Chart/components/ChartButton.js";import"../Chart/components/ChartButtons.js";import"../Chart/components/ChartWrapper.js";import"../Chart/components/AxisDropdown.js";import"../Chart/components/ChartSelect.js";import"../Chart/components/buttons/DragToZoomButton.js";import"../Chart/components/buttons/ZoomInButton.js";import"../Chart/components/buttons/ZoomOutButton.js";import"../Chart/components/buttons/PanButton.js";import"../Chart/components/buttons/ResetZoomButton.js";import"../Chart/components/buttons/HideAxesButton.js";import"../Chart/components/buttons/ChartTypeButton.js";import"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";import"../TruncatedText/index.js";import"../MiddleTruncatedText/MiddleTruncatedText.js";import"../RangeSlider/constants.js";import"../RangeSlider/Input.css.js";import"../RangeSlider/RangeSlider.css.js";import"../AdvancedSlider/AdvancedSlider.js";import"../Breadcrumbs/index.js";import"../VirtualizedTable/index.js";import"../EmptyView/EmptyView.js";import"../EmptyView/EmptyAppView/EmptyAppView.js";import ce from"../Button/components/Button/index.js";import"moment-timezone";import"../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../Button/components/LiveButton/styles.js";import"../ContextMenuItem/index.js";import"../FolderMenuItem/index.js";import"../EditableItem/EditableItem/index.js";import"../EditableItem/EditableItemWithBadge/index.js";import"../Checkbox/index.js";import"../FolderMenuItemWithLinks/index.js";import"../IconButton/index.js";import"../TextField/index.js";import"../Chip/index.js";import"../Counter/index.js";import"../AnchorsList/AnchorsList.js";import"../Select/index.js";import"../Select/SelectFilterBy.js";import"../CustomSelect/index.js";import"../Tabs/Tabs.js";import"../Tabs/Tab.js";import"../ResizableTable/ResizableTable.js";import"../GradientPicker/GradientPicker.js";import"../GradientManager/GradientList.js";import"@material-ui/icons/AddCircle";import"../GradientManager/GradientPreview/GradientPreview.js";import"../GradientManager/GradientSelect.styles.js";import"../GradientManager/GradientManager.styles.js";import"../Drillstring/BHASchematic.js";import"../Drillstring/BHATable/index.js";import"../Drillstring/BHAComponentIcon.js";import"../Drillstring/BHAComponentDetail/index.js";import"../Drillstring/BHATileIcon.js";import"../Drillstring/BHATile/BHATile.js";import"../Drillstring/BHAList/BHAList.js";import"../Drillstring/BHAComponentsTable/BHAComponentsTable.js";import"../Casing/CasingTable/index.js";import"../Casing/CasingComponentIcon.js";import"../Casing/CasingTileIcon.js";import"../Casing/CasingTableV2/CasingTableV2.js";import"../Casing/CasingTile/CasingTile.js";import"../DisabledSettingsMessage/DisabledSettingsMessage.js";import"../WellSummary/WellSummaryItemLabel.js";import"../WellSummary/WellSummaryItemTitle.js";import"../WellSummary/WellSummaryItemValue.js";import"../WellSummary/ActivitySummaryChart.js";import"../WellSummary/FracWirelineTimeChart.js";import"../BICOffsetPickerDialog/index.js";import"../OffsetWellButton/OffsetWellButton.js";import"../OffsetWellPickerV2/OffsetWellPickerDialog.js";import"../OffsetWellPickerV3/index.js";import"../OffsetWellChips/Chip.js";import"../OffsetWellChips/ChipsContainer.js";import"../OffsetWellMap/OffsetWellMap.js";import"../ConfirmationDialog.js";import"../TextLink/index.js";import"../Avatar/index.js";import"../Template/TemplatePopover/index.js";import"../Template/TemplateSharingDialog/index.js";import"../MenuItem/index.js";import"../MiddleTruncate/MiddleTruncate.js";import"../PinnableFilters/PinnableFilters.js";import"../HeaderLayout/HeaderLayout.js";import"../PadOffsetsPicker/PadOffsetsPicker.js";import"../PadOffsetsPicker/OffsetAssetChip.js";import"../PadOffsetsPicker/OffsetAssetsListExpander.js";import"../PadOffsetsPicker/StagesSelector.js";import"../PadOffsetsPickerV2/PadOffsetsPickerV2.js";import"../Table/TableToolbar/TableToolbar.js";import"../Table/TableContainer/TableContainer.js";import"../Table/TableCell/TableCell.js";import"../Table/TablePagination/TablePagination.js";import"../Table/TablePaginationActions/TablePaginationActions.js";import{Tooltip as me}from"../Tooltip/Tooltip.js";import"../Tooltip/ScrollableTooltip.js";import"../PriceInput/PriceInput.js";import"../LabelsCounter/LabelsCounter.js";import"../Stepper/Stepper.js";import"../Stepper/Step/Step.js";import"../Stepper/StepsWrapper.js";import"../Comment/CommentIcon/index.js";import"../FilesLoader/FilesLoader.js";import"../SearchInput/index.js";import"../FeedItem/FeedItem.js";import"../FeedItem/FeedItemEditProvider/FeedItemEditProvider.js";import"../PostInput/PostInput.js";import"../KeyboardDateTimePicker.js";import"../AddComment/Popover.js";import"../AddComment/Popup.js";import"../StageDesignVActual/ComparisonBar/ComparisonBar.js";import"../StageDesignVActual/ElementsComparison/ElementsComparison.js";import"../StageDesignVActual/ComparisonHeader.js";import"../StageDesignVActual/ComparisonRow.js";import"../EmbeddedApp/DevCenterEmbeddedApp.js";import"../EmbeddedApp/EmbeddedApp.js";import"../Autocomplete/Autocomplete.js";import"../DocumentViewer/DocumentViewer.js";import"../ColorPickerPalette/ColorPickerPalette.js";import"../Search/Search.js";import"../Search/components/Listbox.js";import"../Search/components/Paper.js";import"../Search/components/RecentSearches.js";import"../Search/components/Groups.js";import"../Search/components/SelectAllListItem.js";import"../StatusBadge/index.js";import"../Attachment/index.js";import"../EmojiIconButton.js";import"../FileUploadIconButton.js";import"../FilePreview/index.js";import"../FailedFileUploading.js";import"../UserMention/index.js";import"../CommentsInfo/index.js";import"../CommentInput/index.js";import"../Comment/index.js";import"../CommentLoader.js";import"../AssetNameLabel/AssetStatusBadge.js";import"../AssetEditorV2/components/PrimaryAssetSelect.js";import"../AssetEditorV2/components/SecondaryAssetSelect.js";import"../AssetEditorV2/components/SelectItem.js";import"../AssetEditorV2/components/MultipleAssetsToggle.js";import"../AssetEditorV2/components/PrimaryAssetSelectV2.js";import"../EChartsWrapper/EChartsWrapper.js";import"../AssetsMultipleSelector/AssetsMultipleSelector.js";import"@material-ui/icons/Close";import"@material-ui/icons/GetApp";import"../GoogleDocsViewer/index.js";import"../NewDocumentViewer/effects/useFileContent.js";import"../NewDocumentViewer/styles.js";import"../FilesLoaderV2/styles.js";import"../FilesDropzone/styles.js";import"../FilesProcessor/styles.js";import"../Hint/styles.js";import"@babel/runtime/helpers/taggedTemplateLiteral";import"fparser";import"../Formula/useFormulaStyles.js";import"../Formula/RootXIcon.js";import"../Formula/FormulaTextEditor.js";import"../Formula/CloseSuggestion.js";import"../Formula/SuggestionsMenu.js";import{showInfoNotification as le}from"../../utils/notificationToasts.js";function ae(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,s)}return o}function de(e){for(var o=1;o<arguments.length;o++){var s=null!=arguments[o]?arguments[o]:{};o%2?ae(Object(s),!0).forEach((function(o){t(e,o,s[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ae(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}var ue="OffsetWellPickerV4",je=function(ae){var je,fe,Ce,Ae=ae.open,ve=ae.isWDUser,Se=ae.defaultSubjectWell,ge=ae.currentUser,he=ae.offsetSettings,be=ae.addWellsUsabilityInfo,Ve=ae.isViewOnly,Ie=ae.onClose,De=ae.onSave,Te=ae.maxOffsetSize,Pe=void 0===Te?_:Te,ye=ae.localMaxOffsetSize,xe=void 0===ye?G:ye,We=ae.syncAutoEnabled,Be=ae.isManualWellsEnabled,Me=void 0!==Be&&Be;T(he,De);var Fe=i(null),Ee=s(Fe,2),Le=Ee[0],Oe=Ee[1],ke=Math.min(Pe+1,xe+1,q+1),He=Math.min(Math.max(ke,xe+1),q+1),we=i(null==he?void 0:he.filterExpanded),Ne=s(we,2),Re=Ne[0],Ge=Ne[1],qe=i(null==he?void 0:he.mapHidden),ze=s(qe,2),Ue=ze[0],_e=ze[1],Ke=+(null==Se?void 0:Se.companyId)||+(null==ge?void 0:ge.company_id),Ze=null==Se?void 0:Se.asset_id,Xe=i((null==he?void 0:he.filters)||{}),Je=s(Xe,2),Qe=Je[0],Ye=Je[1],$e=i((null==he?void 0:he.wellSection)||M),et=s($e,2),tt=et[0],ot=et[1],st=r(!0),nt=i([]),it=s(nt,2),rt=it[0],pt=it[1],ct=i(null),mt=s(ct,2),lt=mt[0],at=mt[1],dt=i(!0),ut=s(dt,2),jt=ut[0],ft=ut[1],Ct=i(!1),At=s(Ct,2),vt=At[0],St=At[1],gt=i(!1),ht=s(gt,2),bt=ht[0],Vt=ht[1],It=r(),Dt=r(),Tt=i(F.none),Pt=s(Tt,2),yt=Pt[0],xt=Pt[1],Wt=r(),Bt=i(!1),Mt=s(Bt,2),Ft=Mt[0],Et=Mt[1],Lt=He<=(null==rt?void 0:rt.length),Ot=E[yt],kt=r(),Ht=i(!0),wt=s(Ht,2),Nt=wt[0],Rt=wt[1];p((function(){var e,t,o;(Ae&&Lt&&le("App can’t process more than (".concat(He-1,") Offset Wells.")),Ae)||((null==he||null===(e=he.selectedWellIds)||void 0===e?void 0:e.length)===(null===(t=kt.current)||void 0===t?void 0:t.length)&&(null==he||null===(o=he.selectedWellIds)||void 0===o?void 0:o.every((function(e){var t;return null===(t=kt.current)||void 0===t?void 0:t.includes(e)})))||(st.current=!0),kt.current=null==he?void 0:he.selectedWellIds)}),[Lt,Ae,he]),p((function(){function e(){window.innerWidth<=z||te||oe?xt(F.mobile):window.innerHeight<=U?xt(F.small):xt(F.normal)}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[Ae]),p((function(){Wt.current&&yt===Wt.current||(Wt.current=yt,yt===F.small||yt===F.mobile?(_e(!0),Ge(!1)):(Ge(!Ve&&(null==he?void 0:he.filterExpanded)),_e(!Ve&&(null==he?void 0:he.mapHidden))),Ye((null==he?void 0:he.filters)||{}),ot((null==he?void 0:he.wellSection)||M))}),[he,Ve,yt]);var Gt=A(Ke,be),qt=s(Gt,2),zt=qt[0],Ut=qt[1],_t=D(Ke),Kt=s(_t,1)[0],Zt=S(ve,ge,Ze,zt,Me),Xt=s(Zt,7),Jt=Xt[0],Qt=Xt[1],Yt=Xt[2],$t=Xt[3],eo=Xt[4],to=Xt[5],oo=Xt[6];p((function(){Rt(!0),Qt(null),$t(null)}),[Ze]);var so=g(Ke,null==he?void 0:he.metricsKeys),no=s(so,2),io=no[0],ro=no[1],po=v(Ke,zt,Jt,Yt,Ze,io,Ae),co=!Ut&&(null==po?void 0:po.length)===(null==zt?void 0:zt.length);p((function(){if(co){var e,t=(e=o(n.mark((function e(){var t,o,s,i,r,p,c,m,l,a;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=void 0===(null==he?void 0:he.isSynced)||(null==he?void 0:he.isSynced),o=!0,!t){e.next=19;break}if(i=Yt[M]||[],r=((null==he?void 0:he.selectedWellIds)||[]).every((function(e){return i.includes(e)})),i.length===(null==he||null===(s=he.selectedWellIds)||void 0===s?void 0:s.length)&&r){e.next=16;break}return e.next=8,Z(i,Ze);case 8:p=e.sent,c=p.slice(0,ke+1).map((function(e){return e.id})),c=p.slice(0,xe+1).map((function(e){return e.id})),m=de(de({},he),{},{subjectWellId:Ze,selectedWellIds:c,offsetWellsLimited:He<=c.length}),l=p.filter((function(e){return c.includes(e.id)})),De(m,l),e.next=17;break;case 16:o=!1;case 17:e.next=20;break;case 19:o=!1;case 20:if(o){e.next=25;break}return e.next=23,Z((null==he?void 0:he.selectedWellIds)||[],Ze);case 23:a=e.sent,De(he,a);case 25:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)});We&&Nt&&he&&Yt&&(t(),Rt(!1))}}),[he,Yt,Ze,He,We]);var mo=h(po);p((function(){if(po&&Jt){var e=po.find((function(e){return e.id===Ze}));if(e){var o=Jt.filter((function(e){return e.value!==M})).map((function(e){return e.label})),s=de(de({},e),o.length>0&&t({},L.wellSection,o));at(s)}else at(null)}}),[Jt,po]);var lo=I(io),ao=b(po,Qe);p((function(){if(ao&&co)if(st.current){var e=po.filter((function(e){return((null==he?void 0:he.selectedWellIds)||[]).includes(e.id)}));lt&&(e=e.concat(lt)),pt(a(e,"id")),st.current=!1}else pt((function(e){var t=(ao||[]).filter((function(t){return!!e.find((function(e){var o=e.id;return t.id===o}))}));return lt&&(t=t.concat(lt)),a(t,"id")}))}),[po,ao,null==he?void 0:he.selectedWellIds,co]);var uo=V(lt,ao,rt,ft),jo=s(uo,5),fo=jo[0],Co=jo[1],Ao=jo[2],vo=jo[3],So=jo[4],go=c((function(e,t,o){var s;s=o===K.well.name?t:t.reduce((function(e,t){var o,s=null===(o=po.find((function(e){return e.id===t})))||void 0===o?void 0:o.rigName,n=po.filter((function(e){return e.rigName===s})).map((function(e){return e.id}));return e.concat(n)}),[]);var n=po.filter((function(e){var t=e.id;return s.includes(t)}));e?(n=n.slice(0,Math.min(n.length,He-rt.length)),pt((function(e){return a(e.concat(n),"id")}))):pt((function(e){return d(e.filter((function(e){var t=e.id;return!n.find((function(e){return e.id===t}))})))}))}),[po,rt]),ho=c((function(){Vt(!0)}),[]),bo=c((function(e){ro(e)}),[]),Vo=c((function(t,o){pt(o?function(o){return[].concat(e(o),[t])}:function(e){return e.filter((function(e){return e.id!==t.id}))})}),[]),Io=c((function(e){if(e){var t=lt?ao.concat(lt):ao,o=u(a(t,"id"),"distance");pt(o.slice(0,He))}else pt(lt?[lt]:[])}),[ao,lt,He]),Do=function(e){if(Yt){var t=(null==po?void 0:po.filter((function(t){var o;return null===(o=Yt[e])||void 0===o?void 0:o.includes(t.id)})))||[],o=u(t,"distance");pt(o.slice(0,ke))}else pt(lt?[lt]:[])},To=c((function(e){ot(e),Do(e)}),[Do]),Po=m((function(){return rt.find((function(e){return e.id===Ze}))?rt.length-1:rt.length}),[rt,Ze]),yo=m((function(){if(!Yt)return!1;var e=rt.map((function(e){return e.id})),t=Yt[tt]||[];return Math.min(t.length,ke)===e.length&&e.every((function(e){return t.includes(e)}))}),[Yt,rt,tt,ke]),xo=m((function(){return!!Kt&&O.includes(Kt)}),[Kt]),Wo=m((function(){return xo?"IDAS generated offsets.":ve?"Offset Selection App.":"WellHub."}),[xo,ve]),Bo=function(){var e=(po||[]).filter((function(e){return((null==he?void 0:he.selectedWellIds)||[]).includes(e.id)}));lt&&(e=e.concat(lt)),pt(a(e,"id"));var t=de(de({},he),{},{mapHidden:Ue,filterExpanded:Re});De(t),Ye((null==he?void 0:he.filters)||{}),ot((null==he?void 0:he.wellSection)||M),Ie()},Mo=jt||Ut,Fo=m((function(){return!Mo&&(!yo||(!(j(Qe)||!Qe[k.sideTracks])||tt!==M))}),[yo,Qe,tt,Mo]),Eo=function(){Ye({}),ot(M),Do(M)},Lo=!po||!Jt||!So||yt===F.none,Oo=i(!1),ko=s(Oo,2),Ho=ko[0],wo=ko[1],No=i(H),Ro=s(No,2),Go=Ro[0],qo=Ro[1],zo=i([]),Uo=s(zo,2),_o=Uo[0],Ko=Uo[1];p((function(){if(So){var e=So.slice(0,Go);Ko(e)}}),[So,Go,lt]),p((function(){eo===w.SUCCEEDED&&Eo()}),[Yt]);return Q(re,{open:Ae,onClose:Bo,title:Y(P,{isWDUser:ve,viewType:yt,totalCount:null!==(je=null==po?void 0:po.length)&&void 0!==je?je:0,selectedCount:Po,isViewOnly:Ve,maxOffsetWellNumber:He}),isMobile:yt===F.mobile,contentContainerClassName:l(J.offsetWellDialog),contentClassName:l(J.contentContainer,(fe={},t(fe,J.smallContainer,yt===F.small),t(fe,J.contentContainerMobile,yt===F.mobile),fe)),actionsClassName:J.modalActions,actions:!Ve&&Q("div",{className:J.actionsWrapper,children:[!Lo&&Fo?Y(me,{placement:"bottom-start",title:"Reset to Synced Offsets in ".concat(ve?"Offset App":"Wellhub"),children:Y("div",{children:Y(ce,{"data-testid":"".concat(ue,"_reset"),onClick:Eo,color:"primary",startIcon:yt!==F.mobile&&Y(f,{}),classes:yt===F.mobile&&{root:J.resetButtonMobile},children:yt!==F.mobile?"Reset":Y(f,{})})})}):Y("div",{className:yt===F.mobile&&J.infoIconContainer,children:yt!==F.mobile?Q($,{children:[Y("span",{className:l(se.regular12,se.colors.t6),children:"The offset list is being automatically populated by "}),Y("span",{className:l(se.medium12,se.colors.t6),children:Wo})]}):Y(me,{title:Q("div",{children:[Y("span",{className:l(se.regular12,se.colors.t1),children:"The offset list is being automatically populated by "}),Y("span",{className:l(se.medium12,se.colors.t1),children:Wo})]}),enterTouchDelay:0,leaveTouchDelay:N,children:Y(C,{className:J.infoIcon})})}),Q("div",{className:J.buttonGap,children:[Y(ce,{"data-testid":"".concat(ue,"_cancel"),onClick:Bo,color:"primary",children:"Cancel"}),Q(ce,{"data-testid":"".concat(ue,"_selectedWells"),variant:"contained",color:"primary",onClick:function(){Ie();var e=de(de({},he),{},{companyId:Ke,subjectWellId:Ze,selectedWellIds:rt.map((function(e){return e.id})),filters:Qe,metricsKeys:io,wellSection:tt,isSynced:yo,mapHidden:Ue,filterExpanded:Re,offsetWellsLimited:Lt});De(e,rt)},children:["Select (",Po,")"]})]})]}),children:[Y(ee,{}),Lo?Y(pe,{fullscreen:!1}):Q("div",{className:l(J.contentWrapper,t({},J.contentBlocked,Mo)),ref:It,children:[yt===F.mobile&&Q("div",{className:l(J.countContainer,t({},J.countContainerMobile,yt===F.mobile)),children:[Y(ne,{className:J.totalLabel,children:"Total:"}),Y(ne,{"data-testid":"".concat(ue,"_totalWells"),className:J.countValue,children:po.length}),Y(ne,{className:J.selectedLabel,children:"Selected:"}),Y(ne,{"data-testid":"".concat(ue,"_selected"),className:J.countValue,children:Po}),Y(me,{title:"App can’t process more than (".concat(He-1,") Offset Wells."),placement:"right",children:Q(ie,{"data-testid":"".concat(ue,"_maxOffsetSize"),className:J.maxOffsetSize,children:["/",He-1]})})]}),yt===F.normal&&Y(y,{isViewOnly:Ve,isXtoProvider:xo,viewType:yt,filters:Qe,setFilters:Ye,isFilterExpanded:Re,setIsFilterExpanded:Ge,isMapHidden:Ue,setIsMapHidden:_e,resyncStatus:eo,setResyncStatus:to}),Ft&&Y("div",{className:J.topGradient,style:{top:Ot}}),Q("div",{className:l(J.content,(Ce={},t(Ce,J.contentBlocked,Mo),t(Ce,J.contentMobile,yt===F.mobile),t(Ce,J.contentiOSMobile,X()===R),Ce)),ref:Dt,onScroll:function(e){return function(e){e.target&&(bt&&(e.target.scrollLeft=0,Vt(!1)),e.target.scrollLeft<=5&&Ho&&wo(!1),e.target.scrollLeft>5&&!Ho&&wo(!0),e.target.scrollTop<=5&&Ft&&Et(!1),e.target.scrollTop>5&&!Ft&&Et(!0),e.target.scrollHeight!==e.target.offsetHeight&&Math.round(e.target.scrollTop+e.target.offsetHeight+2)>=e.target.scrollHeight&&Go<So.length&&qo((function(e){return e+H})))}(e)},children:[yt!==F.normal&&Y(y,{isViewOnly:Ve,isXtoProvider:xo,viewType:yt,filters:Qe,setFilters:Ye,isFilterExpanded:Re,setIsFilterExpanded:Ge,isMapHidden:Ue,setIsMapHidden:_e,resyncStatus:eo,setResyncStatus:to}),!Ue&&Ae&&Y(W,{isViewOnly:Ve,mapHidden:Ue,subjectWell:lt,offsetWellIds:rt.map((function(e){return e.id})),wells:ao,radius:Qe[k.radius],handleChangeOffsetWell:Vo,activeWellId:Le,viewType:yt}),Y(x,{isHidden:!Re,isWDUser:ve,filterOptions:mo,filters:Qe,wellSections:Jt,selectedWellSection:tt,subjectWell:lt,onChangeFilters:function(e){ft(!0),setTimeout((function(){return Ye(e)}),0)},onChangeBicWells:To}),Y(B,{open:Ae,isTableLoading:Mo,companyId:Ke,subjectWellId:Ze,sortBy:fo,setSortBy:Co,sortDirection:Ao,setSortDirection:vo,columnsWithDict:lo,wells:_o,metricsKeys:io,setMetricsKeys:bo,handleChangeOffsetWell:Vo,handleChangeAllOffsetWells:Io,handleAddRemoveAssets:go,isWellNameExpand:vt,setIsWellNameExpand:St,isHScrollMoved:Ho,onHideAdvancedSearch:ho,isViewOnly:Ve,isLastWell:So.length<=Go,contentRef:It,offsetWellsContainerRef:Dt,isLimitedOffsetWells:Lt,maxOffsetWellNumber:He,wellSections:Jt,setActiveWellId:Oe,viewType:yt,isWDUser:ve,taScores:oo})]}),Ve&&Q("div",{className:J.viewOnlyInfoContainer,children:[Y("span",{className:l(se.regular12,se.colors.t6),children:"The offset list is being automatically populated by "}),Y("span",{className:l(se.medium12,se.colors.t6),children:Wo})]})]})]})};export{je as default};
|
|
2
2
|
//# sourceMappingURL=OffsetWellPickerV4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OffsetWellPickerV4.js","sources":["../../../src/components/OffsetWellPickerV4/OffsetWellPickerV4.js"],"sourcesContent":["import { useState, useEffect, useRef, useCallback, useMemo } from 'react';\nimport classNames from 'classnames';\nimport { isEmpty, uniq, uniqBy, sortBy as sortArray } from 'lodash';\nimport { InfoOutlined, Replay as ReplayIcon } from '@material-ui/icons';\n\nimport {\n useAdvancedWells,\n useBicWells,\n useFilterOptions,\n useCompanyMetricKey,\n useFilteredWells,\n useSortedWells,\n useTableColumns,\n useCompanyProvider,\n} from './effects';\nimport { useFetchWells } from './effects/useFetchWells';\nimport { AppHeader } from './components/AppHeader';\nimport { Toolbar } from './components/Toolbar';\nimport { Filter } from './components/Filter';\nimport { WellsMap } from './components/Map';\nimport { OffsetWellsTable } from './components/OffsetWellsTable';\nimport {\n ALL_SECTION_KEY,\n ColumnType,\n COMPANY_PROVIDERS_FOR_IDAS,\n DEFAULT_BIC_OFFSET_SIZE,\n DEFAULT_LOCAL_OFFSET_SIZE,\n FilterType,\n IOS_DEVICE,\n LEAVE_TOUCH_DELAY,\n MAX_OFFSET_SIZE,\n ROWS_PER_PAGE,\n SMALL_SCREEN_HEIGHT,\n SMALL_SCREEN_WIDTH,\n TOP_GRADIENT_MAP,\n ViewType,\n RESYNC_STATUS,\n} from './constants';\nimport { SEARCH_CATEGORIES } from './components/OffsetWellsTable/AdvancedSearch/constants';\nimport { getCoordinatedWells, getMobileOperatingSystem } from './utils';\n\nimport styles from './OffsetWellPickerV4.module.css';\n\nimport { showInfoNotification } from '~/utils';\nimport { useAppCommons } from '~/effects';\nimport { NotificationsContainer } from '~/components/Notifications';\nimport { isMobileDetected, isNativeDetected } from '~/utils/mobileDetect';\nimport { typography } from '~/styles';\nimport { Regular12, Regular14 } from '~/components/Typography';\nimport { Button, Modal, LoadingIndicator, Tooltip } from '~/components';\n\nconst PAGE_NAME = 'OffsetWellPickerV4';\n\n/**\n * @type {React.FC<import('./OffsetWellPickerV4.types').OffsetWellPickerV4Props>}\n */\nconst OffsetWellPickerV4 = ({\n open,\n isWDUser,\n defaultSubjectWell,\n currentUser,\n offsetSettings,\n addWellsUsabilityInfo,\n isViewOnly,\n onClose,\n onSave,\n maxOffsetSize: offsetSize = DEFAULT_BIC_OFFSET_SIZE,\n localMaxOffsetSize = DEFAULT_LOCAL_OFFSET_SIZE,\n syncAutoEnabled,\n isManualWellsEnabled = false,\n}) => {\n const appCommons = useAppCommons();\n const globalOffsetWells = appCommons?.globalOffsetWells;\n\n const [activeWellId, setActiveWellId] = useState(null);\n const maxOffsetSize = Math.min(offsetSize + 1, localMaxOffsetSize + 1, MAX_OFFSET_SIZE + 1);\n const maxOffsetWellNumber = Math.min(\n Math.max(maxOffsetSize, localMaxOffsetSize + 1),\n MAX_OFFSET_SIZE + 1\n );\n\n const [isFilterExpanded, setIsFilterExpanded] = useState(offsetSettings?.filterExpanded);\n const [isMapHidden, setIsMapHidden] = useState(offsetSettings?.mapHidden);\n const assetCompanyId = +defaultSubjectWell?.companyId || +currentUser?.company_id;\n const subjectWellId = defaultSubjectWell?.asset_id;\n const [filters, setFilters] = useState(offsetSettings?.filters || {});\n const [selectedWellSection, setSelectedWellSection] = useState(\n offsetSettings?.wellSection || ALL_SECTION_KEY\n );\n const initLoading = useRef(true);\n const [selectedWells, setSelectedWells] = useState([]);\n const [subjectWell, setSubjectWell] = useState(null);\n const [isTableLoading, setIsTableLoading] = useState(true);\n\n useEffect(() => {\n if (!globalOffsetWells || !Array.isArray(globalOffsetWells)) return;\n const newOffsetSettings = {\n ...offsetSettings,\n selectedWellIds: globalOffsetWells.map(w => w.id),\n };\n onSave(newOffsetSettings, globalOffsetWells);\n }, [globalOffsetWells]);\n const [isWellNameExpand, setIsWellNameExpand] = useState(false);\n const [isAdvancedSearchHidden, setIsAdvancedSearchHidden] = useState(false);\n const contentRef = useRef();\n const offsetWellsContainerRef = useRef();\n /** @type {ReturnType<typeof useState<string>>} */\n const [viewType, setViewType] = useState(ViewType.none);\n\n /** @type {ReturnType<typeof useRef<string>>} */\n const prevViewType = useRef();\n const [isTopGradientShow, setIsTopGradientShow] = useState(false);\n const isLimitedOffsetWells = maxOffsetWellNumber <= selectedWells?.length;\n const topGradientTop = TOP_GRADIENT_MAP[viewType];\n\n /** @type {ReturnType<typeof useRef<number[]>>} */\n const prevSelectedWellIds = useRef();\n const [appLoading, setAppLoading] = useState(true);\n\n useEffect(() => {\n if (open && isLimitedOffsetWells) {\n showInfoNotification(\n `App can’t process more than (${maxOffsetWellNumber - 1}) Offset Wells.`\n );\n }\n // NOTE: Refresh when the offset well changes externally\n if (!open) {\n const isNotChanged =\n offsetSettings?.selectedWellIds?.length === prevSelectedWellIds.current?.length &&\n offsetSettings?.selectedWellIds?.every(id => prevSelectedWellIds.current?.includes(id));\n if (!isNotChanged) {\n initLoading.current = true;\n }\n prevSelectedWellIds.current = offsetSettings?.selectedWellIds;\n }\n }, [isLimitedOffsetWells, open, offsetSettings]);\n\n useEffect(() => {\n function handleResize() {\n if (window.innerWidth <= SMALL_SCREEN_WIDTH || isMobileDetected || isNativeDetected) {\n setViewType(ViewType.mobile);\n } else if (window.innerHeight <= SMALL_SCREEN_HEIGHT) {\n setViewType(ViewType.small);\n } else {\n setViewType(ViewType.normal);\n }\n }\n handleResize();\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [open]);\n\n useEffect(() => {\n if (prevViewType.current && viewType === prevViewType.current) return;\n prevViewType.current = viewType;\n if (viewType === ViewType.small || viewType === ViewType.mobile) {\n setIsMapHidden(true);\n setIsFilterExpanded(false);\n } else {\n setIsFilterExpanded(!isViewOnly && offsetSettings?.filterExpanded);\n setIsMapHidden(!isViewOnly && offsetSettings?.mapHidden);\n }\n setFilters(offsetSettings?.filters || {});\n setSelectedWellSection(offsetSettings?.wellSection || ALL_SECTION_KEY);\n }, [offsetSettings, isViewOnly, viewType]);\n\n // NOTE: Fetch all wells\n const [rawWells, areWellsLoading] = useFetchWells(assetCompanyId, addWellsUsabilityInfo);\n const [companyProvider] = useCompanyProvider(assetCompanyId);\n const [\n wellSections,\n setWellSections,\n bicWells,\n setBicWells,\n resyncStatus,\n setResyncStatus,\n taScores,\n ] = useBicWells(isWDUser, currentUser, subjectWellId, rawWells, isManualWellsEnabled);\n\n useEffect(() => {\n setAppLoading(true);\n setWellSections(null);\n setBicWells(null);\n }, [subjectWellId]);\n\n const [metricsKeys, setMetricsKeys] = useCompanyMetricKey(\n assetCompanyId,\n offsetSettings?.metricsKeys\n );\n\n // NOTE: Calculate wells with coordinates, metrics and well section name\n const wells = useAdvancedWells(\n assetCompanyId,\n rawWells,\n wellSections,\n bicWells,\n subjectWellId,\n metricsKeys,\n open\n );\n\n const isAllWellsLoaded = !areWellsLoading && wells?.length === rawWells?.length;\n\n useEffect(() => {\n if (!isAllWellsLoaded) return;\n const syncOffsetWells = async () => {\n const isSynced = typeof offsetSettings?.isSynced === 'undefined' || offsetSettings?.isSynced;\n let offsetWellsChanged = true;\n if (isSynced) {\n const bicWellIds = bicWells[ALL_SECTION_KEY] || [];\n const isMatched = (offsetSettings?.selectedWellIds || []).every(wellId =>\n bicWellIds.includes(wellId)\n );\n // if well hub or offset selection app be changed\n if (bicWellIds.length !== offsetSettings?.selectedWellIds?.length || !isMatched) {\n const wellsByDistance = await getCoordinatedWells(bicWellIds, subjectWellId);\n let selectedWellIds = wellsByDistance.slice(0, maxOffsetSize + 1).map(well => well.id);\n selectedWellIds = wellsByDistance.slice(0, localMaxOffsetSize + 1).map(well => well.id);\n const newOffsetSetting = {\n ...offsetSettings,\n subjectWellId,\n selectedWellIds,\n offsetWellsLimited: maxOffsetWellNumber <= selectedWellIds.length,\n };\n const offsetWells = wellsByDistance.filter(well => selectedWellIds.includes(well.id));\n onSave(newOffsetSetting, offsetWells);\n } else {\n offsetWellsChanged = false;\n }\n } else {\n offsetWellsChanged = false;\n }\n\n if (!offsetWellsChanged) {\n const offsetWells = await getCoordinatedWells(\n offsetSettings?.selectedWellIds || [],\n subjectWellId\n );\n onSave(offsetSettings, offsetWells);\n }\n };\n\n if (syncAutoEnabled && appLoading && offsetSettings && bicWells) {\n syncOffsetWells();\n setAppLoading(false);\n }\n }, [offsetSettings, bicWells, subjectWellId, maxOffsetWellNumber, syncAutoEnabled]);\n\n const filterOptions = useFilterOptions(wells);\n\n // NOTE: Subject well\n useEffect(() => {\n if (wells && wellSections) {\n const defaultSubjectWell = wells.find(well => well.id === subjectWellId);\n if (defaultSubjectWell) {\n const allSectionNames = wellSections\n .filter(item => item.value !== ALL_SECTION_KEY)\n .map(({ label }) => label);\n const subjectWellWithSection = {\n ...defaultSubjectWell,\n ...(allSectionNames.length > 0 && { [ColumnType.wellSection]: allSectionNames }),\n };\n setSubjectWell(subjectWellWithSection);\n } else {\n setSubjectWell(null);\n }\n }\n }, [wellSections, wells]);\n\n // NOTE: Table columns with metrics\n const columnsWithDict = useTableColumns(metricsKeys);\n\n // NOTE: Filter wells\n const filteredWells = useFilteredWells(wells, filters);\n\n useEffect(() => {\n if (!filteredWells || !isAllWellsLoaded) return;\n\n if (initLoading.current) {\n let data = wells.filter(well => (offsetSettings?.selectedWellIds || []).includes(well.id));\n if (subjectWell) data = data.concat(subjectWell);\n setSelectedWells(uniqBy(data, 'id'));\n initLoading.current = false;\n } else {\n setSelectedWells(prev => {\n let newSelectedWells = (filteredWells || []).filter(\n well => !!prev.find(({ id }) => well.id === id)\n );\n if (subjectWell) newSelectedWells = newSelectedWells.concat(subjectWell);\n return uniqBy(newSelectedWells, 'id');\n });\n }\n }, [wells, filteredWells, offsetSettings?.selectedWellIds, isAllWellsLoaded]);\n\n // NOTE: Sort wells\n const [sortBy, setSortBy, sortDirection, setSortDirection, sortedWells] = useSortedWells(\n subjectWell,\n filteredWells,\n selectedWells,\n setIsTableLoading\n );\n\n // NOTE: Add advanced wells\n const handleAddRemoveAssets = useCallback(\n (isAdding, newAssets, assetType) => {\n let addingWellIds;\n if (assetType === SEARCH_CATEGORIES.well.name) {\n addingWellIds = newAssets;\n } else {\n addingWellIds = newAssets.reduce((acc, assetId) => {\n const rigName = wells.find(well => well.id === assetId)?.rigName;\n const rigWellIds = wells.filter(well => well.rigName === rigName).map(well => well.id);\n return acc.concat(rigWellIds);\n }, []);\n }\n let addingWells = wells.filter(({ id }) => addingWellIds.includes(id));\n if (isAdding) {\n addingWells = addingWells.slice(\n 0,\n Math.min(addingWells.length, maxOffsetWellNumber - selectedWells.length)\n );\n setSelectedWells(selectedWells => uniqBy(selectedWells.concat(addingWells), 'id'));\n } else {\n setSelectedWells(selectedWells =>\n uniq(selectedWells.filter(({ id }) => !addingWells.find(well => well.id === id)))\n );\n }\n },\n [wells, selectedWells]\n );\n\n const handleHideAdvancedSearch = useCallback(() => {\n setIsAdvancedSearchHidden(true);\n }, []);\n\n // NOTE: Change metrics keys\n const handleChangeMetricsKeys = useCallback(newMetricsKeys => {\n setMetricsKeys(newMetricsKeys);\n }, []);\n\n // NOTE: Check and Uncheck one offset well\n const handleChangeOffsetWell = useCallback((well, checked) => {\n if (checked) {\n setSelectedWells(prevWells => [...prevWells, well]);\n } else {\n setSelectedWells(prevWells => prevWells.filter(item => item.id !== well.id));\n }\n }, []);\n\n // NOTE: Select and Unselect All wells\n const handleChangeAllOffsetWells = useCallback(\n checked => {\n if (checked) {\n const data = subjectWell ? filteredWells.concat(subjectWell) : filteredWells;\n const sortedData = sortArray(uniqBy(data, 'id'), 'distance');\n setSelectedWells(sortedData.slice(0, maxOffsetWellNumber));\n } else {\n setSelectedWells(subjectWell ? [subjectWell] : []);\n }\n },\n [filteredWells, subjectWell, maxOffsetWellNumber]\n );\n\n // NOTE: Well Section change filter\n const updateSelectedWellsBySection = section => {\n if (bicWells) {\n const sectionWells = wells?.filter(well => bicWells[section]?.includes(well.id)) || [];\n const limitedWells = sortArray(sectionWells, 'distance');\n setSelectedWells(limitedWells.slice(0, maxOffsetSize));\n } else {\n setSelectedWells(subjectWell ? [subjectWell] : []);\n }\n };\n\n const handleChangeWellSection = useCallback(\n section => {\n setSelectedWellSection(section);\n updateSelectedWellsBySection(section);\n },\n [updateSelectedWellsBySection]\n );\n\n // NOTE: Get Selected wells count\n const selectedWellsCount = useMemo(() => {\n if (selectedWells.find(well => well.id === subjectWellId)) {\n return selectedWells.length - 1;\n }\n return selectedWells.length;\n }, [selectedWells, subjectWellId]);\n\n // NOTE: Save offset setting\n const isSynced = useMemo(() => {\n if (!bicWells) return false;\n const selectedWellIds = selectedWells.map(({ id }) => id);\n let synced;\n const owsWellIds = bicWells[selectedWellSection] || [];\n const owsWellIdsLength = Math.min(owsWellIds.length, maxOffsetSize);\n\n if (owsWellIdsLength !== selectedWellIds.length) {\n synced = false;\n } else {\n synced = selectedWellIds.every(id => owsWellIds.includes(id));\n }\n return synced;\n }, [bicWells, selectedWells, selectedWellSection, maxOffsetSize]);\n\n const isXtoProvider = useMemo(() => {\n return companyProvider ? COMPANY_PROVIDERS_FOR_IDAS.includes(companyProvider) : false;\n }, [companyProvider]);\n\n const offsetLabel = useMemo(() => {\n if (isXtoProvider) {\n return 'IDAS generated offsets.';\n }\n\n return isWDUser ? 'Offset Selection App.' : 'WellHub.';\n }, [isXtoProvider, isWDUser]);\n\n const handleSave = () => {\n onClose();\n\n const newOffsetSetting = {\n ...offsetSettings,\n companyId: assetCompanyId,\n subjectWellId,\n selectedWellIds: selectedWells.map(({ id }) => id),\n filters,\n metricsKeys,\n wellSection: selectedWellSection,\n isSynced,\n mapHidden: isMapHidden,\n filterExpanded: isFilterExpanded,\n offsetWellsLimited: isLimitedOffsetWells,\n };\n onSave(newOffsetSetting, selectedWells);\n };\n\n const handleCancel = () => {\n let data = (wells || []).filter(well =>\n (offsetSettings?.selectedWellIds || []).includes(well.id)\n );\n if (subjectWell) data = data.concat(subjectWell);\n setSelectedWells(uniqBy(data, 'id'));\n\n const newOffsetSetting = {\n ...offsetSettings,\n mapHidden: isMapHidden,\n filterExpanded: isFilterExpanded,\n };\n onSave(newOffsetSetting);\n setFilters(offsetSettings?.filters || {});\n setSelectedWellSection(offsetSettings?.wellSection || ALL_SECTION_KEY);\n onClose();\n };\n\n const isTableFullLoading = isTableLoading || areWellsLoading;\n\n // NOTE: Reset processing\n const isResetVisible = useMemo(() => {\n if (isTableFullLoading) return false;\n if (!isSynced) return true;\n if (!isEmpty(filters) && filters[FilterType.sideTracks]) return true;\n if (selectedWellSection !== ALL_SECTION_KEY) return true;\n return false;\n }, [isSynced, filters, selectedWellSection, isTableFullLoading]);\n\n const handleReset = () => {\n setFilters({});\n setSelectedWellSection(ALL_SECTION_KEY);\n updateSelectedWellsBySection(ALL_SECTION_KEY);\n };\n\n const isLoading = !wells || !wellSections || !sortedWells || viewType === ViewType.none;\n\n // NOTE: Well Name shadow\n const [isHScrollMoved, setIsHScrollMoved] = useState(false);\n const [tableRowsCount, setTableRowsCount] = useState(ROWS_PER_PAGE);\n const [tableWells, setTableWells] = useState([]);\n\n useEffect(() => {\n if (!sortedWells) return;\n\n const wells = sortedWells.slice(0, tableRowsCount);\n setTableWells(wells);\n }, [sortedWells, tableRowsCount, subjectWell]);\n\n useEffect(() => {\n if (resyncStatus === RESYNC_STATUS.SUCCEEDED) {\n handleReset();\n }\n }, [bicWells]);\n\n const handleScroll = e => {\n if (!e.target) return;\n\n if (isAdvancedSearchHidden) {\n e.target.scrollLeft = 0;\n setIsAdvancedSearchHidden(false);\n }\n\n // Check if H-Scroll is visible\n if (e.target.scrollLeft <= 5 && isHScrollMoved) {\n setIsHScrollMoved(false);\n }\n if (e.target.scrollLeft > 5 && !isHScrollMoved) {\n setIsHScrollMoved(true);\n }\n\n if (e.target.scrollTop <= 5 && isTopGradientShow) {\n setIsTopGradientShow(false);\n }\n if (e.target.scrollTop > 5 && !isTopGradientShow) {\n setIsTopGradientShow(true);\n }\n\n // Check if scroll has reached top or bottom\n if (e.target.scrollHeight === e.target.offsetHeight) return;\n\n const currentScrollBottom = Math.round(e.target.scrollTop + e.target.offsetHeight + 2);\n\n if (currentScrollBottom >= e.target.scrollHeight && tableRowsCount < sortedWells.length) {\n setTableRowsCount(count => count + ROWS_PER_PAGE);\n }\n };\n\n const tooltipContainer = () => {\n return (\n <div>\n <span className={classNames(typography.regular12, typography.colors.t1)}>\n The offset list is being automatically populated by \n </span>\n <span className={classNames(typography.medium12, typography.colors.t1)}>{offsetLabel}</span>\n </div>\n );\n };\n\n return (\n <Modal\n open={open}\n onClose={handleCancel}\n title={\n <AppHeader\n isWDUser={isWDUser}\n viewType={viewType}\n totalCount={wells?.length ?? 0}\n selectedCount={selectedWellsCount}\n isViewOnly={isViewOnly}\n maxOffsetWellNumber={maxOffsetWellNumber}\n />\n }\n isMobile={viewType === ViewType.mobile}\n contentContainerClassName={classNames(styles.offsetWellDialog)}\n contentClassName={classNames(styles.contentContainer, {\n [styles.smallContainer]: viewType === ViewType.small,\n [styles.contentContainerMobile]: viewType === ViewType.mobile,\n })}\n actionsClassName={styles.modalActions}\n actions={\n !isViewOnly && (\n <div className={styles.actionsWrapper}>\n {!isLoading && isResetVisible ? (\n <Tooltip\n placement=\"bottom-start\"\n title={`Reset to Synced Offsets in ${isWDUser ? 'Offset App' : 'Wellhub'}`}\n >\n <div>\n <Button\n data-testid={`${PAGE_NAME}_reset`}\n onClick={handleReset}\n color=\"primary\"\n startIcon={viewType !== ViewType.mobile && <ReplayIcon />}\n classes={viewType === ViewType.mobile && { root: styles.resetButtonMobile }}\n >\n {viewType !== ViewType.mobile ? 'Reset' : <ReplayIcon />}\n </Button>\n </div>\n </Tooltip>\n ) : (\n <div className={viewType === ViewType.mobile && styles.infoIconContainer}>\n {viewType !== ViewType.mobile ? (\n <>\n <span className={classNames(typography.regular12, typography.colors.t6)}>\n The offset list is being automatically populated by \n </span>\n <span className={classNames(typography.medium12, typography.colors.t6)}>\n {offsetLabel}\n </span>\n </>\n ) : (\n <Tooltip\n title={tooltipContainer()}\n enterTouchDelay={0}\n leaveTouchDelay={LEAVE_TOUCH_DELAY}\n >\n <InfoOutlined className={styles.infoIcon} />\n </Tooltip>\n )}\n </div>\n )}\n <div className={styles.buttonGap}>\n <Button data-testid={`${PAGE_NAME}_cancel`} onClick={handleCancel} color=\"primary\">\n Cancel\n </Button>\n <Button\n data-testid={`${PAGE_NAME}_selectedWells`}\n variant=\"contained\"\n color=\"primary\"\n onClick={handleSave}\n >\n Select ({selectedWellsCount})\n </Button>\n </div>\n </div>\n )\n }\n >\n <NotificationsContainer />\n {!isLoading ? (\n <div\n className={classNames(styles.contentWrapper, {\n [styles.contentBlocked]: isTableFullLoading,\n })}\n ref={contentRef}\n >\n {viewType === ViewType.mobile && (\n <div\n className={classNames(styles.countContainer, {\n [styles.countContainerMobile]: viewType === ViewType.mobile,\n })}\n >\n <Regular14 className={styles.totalLabel}>Total:</Regular14>\n <Regular14 data-testid={`${PAGE_NAME}_totalWells`} className={styles.countValue}>\n {wells.length}\n </Regular14>\n <Regular14 className={styles.selectedLabel}>Selected:</Regular14>\n <Regular14 data-testid={`${PAGE_NAME}_selected`} className={styles.countValue}>\n {selectedWellsCount}\n </Regular14>\n <Tooltip\n title={`App can’t process more than (${maxOffsetWellNumber - 1}) Offset Wells.`}\n placement=\"right\"\n >\n <Regular12\n data-testid={`${PAGE_NAME}_maxOffsetSize`}\n className={styles.maxOffsetSize}\n >\n /{maxOffsetWellNumber - 1}\n </Regular12>\n </Tooltip>\n </div>\n )}\n\n {viewType === ViewType.normal && (\n <Toolbar\n isViewOnly={isViewOnly}\n isXtoProvider={isXtoProvider}\n viewType={viewType}\n filters={filters}\n setFilters={setFilters}\n isFilterExpanded={isFilterExpanded}\n setIsFilterExpanded={setIsFilterExpanded}\n isMapHidden={isMapHidden}\n setIsMapHidden={setIsMapHidden}\n resyncStatus={resyncStatus}\n setResyncStatus={setResyncStatus}\n />\n )}\n\n {isTopGradientShow && (\n <div className={styles.topGradient} style={{ top: topGradientTop }} />\n )}\n <div\n className={classNames(styles.content, {\n [styles.contentBlocked]: isTableFullLoading,\n [styles.contentMobile]: viewType === ViewType.mobile,\n [styles.contentiOSMobile]: getMobileOperatingSystem() === IOS_DEVICE,\n })}\n ref={offsetWellsContainerRef}\n onScroll={e => handleScroll(e)}\n >\n {viewType !== ViewType.normal && (\n <Toolbar\n isViewOnly={isViewOnly}\n isXtoProvider={isXtoProvider}\n viewType={viewType}\n filters={filters}\n setFilters={setFilters}\n isFilterExpanded={isFilterExpanded}\n setIsFilterExpanded={setIsFilterExpanded}\n isMapHidden={isMapHidden}\n setIsMapHidden={setIsMapHidden}\n resyncStatus={resyncStatus}\n setResyncStatus={setResyncStatus}\n />\n )}\n {!isMapHidden && open && (\n <WellsMap\n isViewOnly={isViewOnly}\n mapHidden={isMapHidden}\n subjectWell={subjectWell}\n offsetWellIds={selectedWells.map(({ id }) => id)}\n wells={filteredWells}\n radius={filters[FilterType.radius]}\n handleChangeOffsetWell={handleChangeOffsetWell}\n activeWellId={activeWellId}\n viewType={viewType}\n />\n )}\n <Filter\n isHidden={!isFilterExpanded}\n isWDUser={isWDUser}\n filterOptions={filterOptions}\n filters={filters}\n wellSections={wellSections}\n selectedWellSection={selectedWellSection}\n subjectWell={subjectWell}\n onChangeFilters={value => {\n setIsTableLoading(true);\n setTimeout(() => setFilters(value), 0);\n }}\n onChangeBicWells={handleChangeWellSection}\n />\n <OffsetWellsTable\n open={open}\n isTableLoading={isTableFullLoading}\n companyId={assetCompanyId}\n subjectWellId={subjectWellId}\n sortBy={sortBy}\n setSortBy={setSortBy}\n sortDirection={sortDirection}\n setSortDirection={setSortDirection}\n columnsWithDict={columnsWithDict}\n wells={tableWells}\n metricsKeys={metricsKeys}\n setMetricsKeys={handleChangeMetricsKeys}\n handleChangeOffsetWell={handleChangeOffsetWell}\n handleChangeAllOffsetWells={handleChangeAllOffsetWells}\n handleAddRemoveAssets={handleAddRemoveAssets}\n isWellNameExpand={isWellNameExpand}\n setIsWellNameExpand={setIsWellNameExpand}\n isHScrollMoved={isHScrollMoved}\n onHideAdvancedSearch={handleHideAdvancedSearch}\n isViewOnly={isViewOnly}\n isLastWell={sortedWells.length <= tableRowsCount}\n contentRef={contentRef}\n offsetWellsContainerRef={offsetWellsContainerRef}\n isLimitedOffsetWells={isLimitedOffsetWells}\n maxOffsetWellNumber={maxOffsetWellNumber}\n wellSections={wellSections}\n setActiveWellId={setActiveWellId}\n viewType={viewType}\n isWDUser={isWDUser}\n taScores={taScores}\n />\n </div>\n {isViewOnly && (\n <div className={styles.viewOnlyInfoContainer}>\n <span className={classNames(typography.regular12, typography.colors.t6)}>\n The offset list is being automatically populated by \n </span>\n <span className={classNames(typography.medium12, typography.colors.t6)}>\n {offsetLabel}\n </span>\n </div>\n )}\n </div>\n ) : (\n <LoadingIndicator fullscreen={false} />\n )}\n </Modal>\n );\n};\n\nexport default OffsetWellPickerV4;\n"],"names":["PAGE_NAME","OffsetWellPickerV4","_ref","_wells$length","_classNames","_classNames4","open","isWDUser","defaultSubjectWell","currentUser","offsetSettings","addWellsUsabilityInfo","isViewOnly","onClose","onSave","_ref$maxOffsetSize","maxOffsetSize","offsetSize","DEFAULT_BIC_OFFSET_SIZE","_ref$localMaxOffsetSi","localMaxOffsetSize","DEFAULT_LOCAL_OFFSET_SIZE","syncAutoEnabled","_ref$isManualWellsEna","isManualWellsEnabled","appCommons","useAppCommons","globalOffsetWells","useState","_useState2","_slicedToArray","_useState","activeWellId","setActiveWellId","Math","min","MAX_OFFSET_SIZE","maxOffsetWellNumber","max","filterExpanded","_useState4","_useState3","isFilterExpanded","setIsFilterExpanded","mapHidden","_useState6","_useState5","isMapHidden","setIsMapHidden","assetCompanyId","companyId","company_id","subjectWellId","asset_id","_useState7","filters","_useState8","setFilters","_useState9","wellSection","ALL_SECTION_KEY","_useState10","selectedWellSection","setSelectedWellSection","initLoading","useRef","_useState12","_useState11","selectedWells","setSelectedWells","_useState14","_useState13","subjectWell","setSubjectWell","_useState16","_useState15","isTableLoading","setIsTableLoading","useEffect","Array","isArray","newOffsetSettings","selectedWellIds","map","w","id","_useState18","_useState17","isWellNameExpand","setIsWellNameExpand","_useState20","_useState19","isAdvancedSearchHidden","setIsAdvancedSearchHidden","contentRef","offsetWellsContainerRef","_useState21","ViewType","none","_useState22","viewType","setViewType","prevViewType","_useState24","_useState23","isTopGradientShow","setIsTopGradientShow","isLimitedOffsetWells","length","topGradientTop","TOP_GRADIENT_MAP","prevSelectedWellIds","_useState26","_useState25","appLoading","setAppLoading","_offsetSettings$selec","_prevSelectedWellIds$","_offsetSettings$selec2","showInfoNotification","current","every","_prevSelectedWellIds$2","includes","handleResize","window","innerWidth","SMALL_SCREEN_WIDTH","isMobileDetected","isNativeDetected","mobile","innerHeight","SMALL_SCREEN_HEIGHT","small","normal","addEventListener","removeEventListener","_useFetchWells","useFetchWells","_useFetchWells2","rawWells","areWellsLoading","useCompanyProvider","companyProvider","_useCompanyProvider","useBicWells","_useBicWells2","_useBicWells","wellSections","setWellSections","bicWells","setBicWells","resyncStatus","setResyncStatus","taScores","useCompanyMetricKey","metricsKeys","_useCompanyMetricKey2","_useCompanyMetricKey","setMetricsKeys","wells","useAdvancedWells","isAllWellsLoaded","_ref2","syncOffsetWells","_asyncToGenerator","_regeneratorRuntime","mark","_callee","isSynced","offsetWellsChanged","_offsetSettings$selec3","bicWellIds","isMatched","wellsByDistance","newOffsetSetting","offsetWells","_offsetWells","wrap","_context","prev","next","wellId","getCoordinatedWells","sent","slice","well","offsetWellsLimited","filter","stop","apply","this","arguments","filterOptions","useFilterOptions","find","allSectionNames","item","value","_ref3","label","subjectWellWithSection","_defineProperty","ColumnType","columnsWithDict","useTableColumns","filteredWells","useFilteredWells","data","concat","uniqBy","newSelectedWells","_ref5","useSortedWells","_useSortedWells2","_useSortedWells","sortBy","setSortBy","sortDirection","setSortDirection","sortedWells","handleAddRemoveAssets","useCallback","isAdding","newAssets","assetType","addingWellIds","SEARCH_CATEGORIES","name","reduce","acc","assetId","_wells$find","rigName","rigWellIds","addingWells","_ref6","uniq","_ref7","handleHideAdvancedSearch","handleChangeMetricsKeys","newMetricsKeys","handleChangeOffsetWell","checked","prevWells","handleChangeAllOffsetWells","sortedData","sortArray","updateSelectedWellsBySection","section","sectionWells","_bicWells$section","limitedWells","handleChangeWellSection","selectedWellsCount","useMemo","_ref8","owsWellIds","isXtoProvider","COMPANY_PROVIDERS_FOR_IDAS","offsetLabel","handleCancel","isTableFullLoading","isResetVisible","isEmpty","FilterType","sideTracks","handleReset","isLoading","_useState28","_useState27","isHScrollMoved","setIsHScrollMoved","ROWS_PER_PAGE","_useState30","_useState29","tableRowsCount","setTableRowsCount","_useState32","_useState31","tableWells","setTableWells","RESYNC_STATUS","SUCCEEDED","_jsxs","Modal","title","_jsx","AppHeader","totalCount","selectedCount","isMobile","contentContainerClassName","classNames","styles","offsetWellDialog","contentClassName","contentContainer","smallContainer","contentContainerMobile","actionsClassName","modalActions","actions","className","actionsWrapper","children","Tooltip","placement","Button","onClick","color","startIcon","ReplayIcon","classes","root","resetButtonMobile","infoIconContainer","_Fragment","typography","regular12","colors","t6","medium12","t1","enterTouchDelay","leaveTouchDelay","LEAVE_TOUCH_DELAY","InfoOutlined","infoIcon","buttonGap","variant","_ref9","NotificationsContainer","LoadingIndicator","fullscreen","contentWrapper","contentBlocked","ref","countContainer","countContainerMobile","Regular14","totalLabel","countValue","selectedLabel","Regular12","Toolbar","topGradient","style","top","content","contentMobile","contentiOSMobile","getMobileOperatingSystem","IOS_DEVICE","onScroll","e","target","scrollLeft","scrollTop","scrollHeight","offsetHeight","round","count","handleScroll","WellsMap","offsetWellIds","_ref10","radius","Filter","isHidden","onChangeFilters","setTimeout","onChangeBicWells","OffsetWellsTable","onHideAdvancedSearch","isLastWell","viewOnlyInfoContainer"],"mappings":"opuBAmDA,IAAMA,GAAY,qBAKZC,GAAqB,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MA,GACNsE,eAAgB0L,GAChBpN,UAAWD,GACXG,cAAeA,GACfoK,OAAQA,GACRC,UAAWA,GACXC,cAAeA,GACfC,iBAAkBA,GAClBf,gBAAiBA,GACjB5C,MAAOwH,GACP5H,YAAaA,GACbG,eAAgBiF,GAChBE,uBAAwBA,GACxBG,2BAA4BA,GAC5BxB,sBAAuBA,GACvBrI,iBAAkBA,GAClBC,oBAAqBA,GACrBsL,eAAgBA,GAChBuG,qBAAsBvI,GACtBnO,WAAYA,GACZ2W,WAAY3J,GAAYhH,QAAUwK,GAClCtL,WAAYA,GACZC,wBAAyBA,GACzBY,qBAAsBA,GACtBtE,oBAAqBA,GACrB+G,aAAcA,GACdnH,gBAAiBA,GACjBmE,SAAUA,GACV7F,SAAUA,GACVmJ,SAAUA,QAGb9I,IACCgR,EAAA,MAAA,CAAKmB,UAAWT,EAAOkF,sBAAsBvE,SAC3C,CAAAlB,EAAA,OAAA,CAAMgB,UAAWV,EAAWyB,GAAWC,UAAWD,GAAWE,OAAOC,IAAIhB,SAAA,yDAGxElB,EAAA,OAAA,CAAMgB,UAAWV,EAAWyB,GAAWI,SAAUJ,GAAWE,OAAOC,IAAIhB,SACpE7C,aAUjB"}
|
|
1
|
+
{"version":3,"file":"OffsetWellPickerV4.js","sources":["../../../src/components/OffsetWellPickerV4/OffsetWellPickerV4.js"],"sourcesContent":["import { useState, useEffect, useRef, useCallback, useMemo } from 'react';\nimport classNames from 'classnames';\nimport { isEmpty, uniq, uniqBy, sortBy as sortArray } from 'lodash';\nimport { InfoOutlined, Replay as ReplayIcon } from '@material-ui/icons';\n\nimport {\n useAdvancedWells,\n useBicWells,\n useFilterOptions,\n useCompanyMetricKey,\n useFilteredWells,\n useSortedWells,\n useTableColumns,\n useCompanyProvider,\n useGlobalOffsetWellsSync,\n} from './effects';\nimport { useFetchWells } from './effects/useFetchWells';\nimport { AppHeader } from './components/AppHeader';\nimport { Toolbar } from './components/Toolbar';\nimport { Filter } from './components/Filter';\nimport { WellsMap } from './components/Map';\nimport { OffsetWellsTable } from './components/OffsetWellsTable';\nimport {\n ALL_SECTION_KEY,\n ColumnType,\n COMPANY_PROVIDERS_FOR_IDAS,\n DEFAULT_BIC_OFFSET_SIZE,\n DEFAULT_LOCAL_OFFSET_SIZE,\n FilterType,\n IOS_DEVICE,\n LEAVE_TOUCH_DELAY,\n MAX_OFFSET_SIZE,\n ROWS_PER_PAGE,\n SMALL_SCREEN_HEIGHT,\n SMALL_SCREEN_WIDTH,\n TOP_GRADIENT_MAP,\n ViewType,\n RESYNC_STATUS,\n} from './constants';\nimport { SEARCH_CATEGORIES } from './components/OffsetWellsTable/AdvancedSearch/constants';\nimport { getCoordinatedWells, getMobileOperatingSystem } from './utils';\n\nimport styles from './OffsetWellPickerV4.module.css';\n\nimport { showInfoNotification } from '~/utils';\nimport { NotificationsContainer } from '~/components/Notifications';\nimport { isMobileDetected, isNativeDetected } from '~/utils/mobileDetect';\nimport { typography } from '~/styles';\nimport { Regular12, Regular14 } from '~/components/Typography';\nimport { Button, Modal, LoadingIndicator, Tooltip } from '~/components';\n\nconst PAGE_NAME = 'OffsetWellPickerV4';\n\n/**\n * @type {React.FC<import('./OffsetWellPickerV4.types').OffsetWellPickerV4Props>}\n */\nconst OffsetWellPickerV4 = ({\n open,\n isWDUser,\n defaultSubjectWell,\n currentUser,\n offsetSettings,\n addWellsUsabilityInfo,\n isViewOnly,\n onClose,\n onSave,\n maxOffsetSize: offsetSize = DEFAULT_BIC_OFFSET_SIZE,\n localMaxOffsetSize = DEFAULT_LOCAL_OFFSET_SIZE,\n syncAutoEnabled,\n isManualWellsEnabled = false,\n}) => {\n useGlobalOffsetWellsSync(offsetSettings, onSave);\n\n const [activeWellId, setActiveWellId] = useState(null);\n const maxOffsetSize = Math.min(offsetSize + 1, localMaxOffsetSize + 1, MAX_OFFSET_SIZE + 1);\n const maxOffsetWellNumber = Math.min(\n Math.max(maxOffsetSize, localMaxOffsetSize + 1),\n MAX_OFFSET_SIZE + 1\n );\n\n const [isFilterExpanded, setIsFilterExpanded] = useState(offsetSettings?.filterExpanded);\n const [isMapHidden, setIsMapHidden] = useState(offsetSettings?.mapHidden);\n const assetCompanyId = +defaultSubjectWell?.companyId || +currentUser?.company_id;\n const subjectWellId = defaultSubjectWell?.asset_id;\n const [filters, setFilters] = useState(offsetSettings?.filters || {});\n const [selectedWellSection, setSelectedWellSection] = useState(\n offsetSettings?.wellSection || ALL_SECTION_KEY\n );\n const initLoading = useRef(true);\n const [selectedWells, setSelectedWells] = useState([]);\n const [subjectWell, setSubjectWell] = useState(null);\n const [isTableLoading, setIsTableLoading] = useState(true);\n const [isWellNameExpand, setIsWellNameExpand] = useState(false);\n const [isAdvancedSearchHidden, setIsAdvancedSearchHidden] = useState(false);\n const contentRef = useRef();\n const offsetWellsContainerRef = useRef();\n /** @type {ReturnType<typeof useState<string>>} */\n const [viewType, setViewType] = useState(ViewType.none);\n\n /** @type {ReturnType<typeof useRef<string>>} */\n const prevViewType = useRef();\n const [isTopGradientShow, setIsTopGradientShow] = useState(false);\n const isLimitedOffsetWells = maxOffsetWellNumber <= selectedWells?.length;\n const topGradientTop = TOP_GRADIENT_MAP[viewType];\n\n /** @type {ReturnType<typeof useRef<number[]>>} */\n const prevSelectedWellIds = useRef();\n const [appLoading, setAppLoading] = useState(true);\n\n useEffect(() => {\n if (open && isLimitedOffsetWells) {\n showInfoNotification(\n `App can’t process more than (${maxOffsetWellNumber - 1}) Offset Wells.`\n );\n }\n // NOTE: Refresh when the offset well changes externally\n if (!open) {\n const isNotChanged =\n offsetSettings?.selectedWellIds?.length === prevSelectedWellIds.current?.length &&\n offsetSettings?.selectedWellIds?.every(id => prevSelectedWellIds.current?.includes(id));\n if (!isNotChanged) {\n initLoading.current = true;\n }\n prevSelectedWellIds.current = offsetSettings?.selectedWellIds;\n }\n }, [isLimitedOffsetWells, open, offsetSettings]);\n\n useEffect(() => {\n function handleResize() {\n if (window.innerWidth <= SMALL_SCREEN_WIDTH || isMobileDetected || isNativeDetected) {\n setViewType(ViewType.mobile);\n } else if (window.innerHeight <= SMALL_SCREEN_HEIGHT) {\n setViewType(ViewType.small);\n } else {\n setViewType(ViewType.normal);\n }\n }\n handleResize();\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [open]);\n\n useEffect(() => {\n if (prevViewType.current && viewType === prevViewType.current) return;\n prevViewType.current = viewType;\n if (viewType === ViewType.small || viewType === ViewType.mobile) {\n setIsMapHidden(true);\n setIsFilterExpanded(false);\n } else {\n setIsFilterExpanded(!isViewOnly && offsetSettings?.filterExpanded);\n setIsMapHidden(!isViewOnly && offsetSettings?.mapHidden);\n }\n setFilters(offsetSettings?.filters || {});\n setSelectedWellSection(offsetSettings?.wellSection || ALL_SECTION_KEY);\n }, [offsetSettings, isViewOnly, viewType]);\n\n // NOTE: Fetch all wells\n const [rawWells, areWellsLoading] = useFetchWells(assetCompanyId, addWellsUsabilityInfo);\n const [companyProvider] = useCompanyProvider(assetCompanyId);\n const [\n wellSections,\n setWellSections,\n bicWells,\n setBicWells,\n resyncStatus,\n setResyncStatus,\n taScores,\n ] = useBicWells(isWDUser, currentUser, subjectWellId, rawWells, isManualWellsEnabled);\n\n useEffect(() => {\n setAppLoading(true);\n setWellSections(null);\n setBicWells(null);\n }, [subjectWellId]);\n\n const [metricsKeys, setMetricsKeys] = useCompanyMetricKey(\n assetCompanyId,\n offsetSettings?.metricsKeys\n );\n\n // NOTE: Calculate wells with coordinates, metrics and well section name\n const wells = useAdvancedWells(\n assetCompanyId,\n rawWells,\n wellSections,\n bicWells,\n subjectWellId,\n metricsKeys,\n open\n );\n\n const isAllWellsLoaded = !areWellsLoading && wells?.length === rawWells?.length;\n\n useEffect(() => {\n if (!isAllWellsLoaded) return;\n const syncOffsetWells = async () => {\n const isSynced = typeof offsetSettings?.isSynced === 'undefined' || offsetSettings?.isSynced;\n let offsetWellsChanged = true;\n if (isSynced) {\n const bicWellIds = bicWells[ALL_SECTION_KEY] || [];\n const isMatched = (offsetSettings?.selectedWellIds || []).every(wellId =>\n bicWellIds.includes(wellId)\n );\n // if well hub or offset selection app be changed\n if (bicWellIds.length !== offsetSettings?.selectedWellIds?.length || !isMatched) {\n const wellsByDistance = await getCoordinatedWells(bicWellIds, subjectWellId);\n let selectedWellIds = wellsByDistance.slice(0, maxOffsetSize + 1).map(well => well.id);\n selectedWellIds = wellsByDistance.slice(0, localMaxOffsetSize + 1).map(well => well.id);\n const newOffsetSetting = {\n ...offsetSettings,\n subjectWellId,\n selectedWellIds,\n offsetWellsLimited: maxOffsetWellNumber <= selectedWellIds.length,\n };\n const offsetWells = wellsByDistance.filter(well => selectedWellIds.includes(well.id));\n onSave(newOffsetSetting, offsetWells);\n } else {\n offsetWellsChanged = false;\n }\n } else {\n offsetWellsChanged = false;\n }\n\n if (!offsetWellsChanged) {\n const offsetWells = await getCoordinatedWells(\n offsetSettings?.selectedWellIds || [],\n subjectWellId\n );\n onSave(offsetSettings, offsetWells);\n }\n };\n\n if (syncAutoEnabled && appLoading && offsetSettings && bicWells) {\n syncOffsetWells();\n setAppLoading(false);\n }\n }, [offsetSettings, bicWells, subjectWellId, maxOffsetWellNumber, syncAutoEnabled]);\n\n const filterOptions = useFilterOptions(wells);\n\n // NOTE: Subject well\n useEffect(() => {\n if (wells && wellSections) {\n const defaultSubjectWell = wells.find(well => well.id === subjectWellId);\n if (defaultSubjectWell) {\n const allSectionNames = wellSections\n .filter(item => item.value !== ALL_SECTION_KEY)\n .map(({ label }) => label);\n const subjectWellWithSection = {\n ...defaultSubjectWell,\n ...(allSectionNames.length > 0 && { [ColumnType.wellSection]: allSectionNames }),\n };\n setSubjectWell(subjectWellWithSection);\n } else {\n setSubjectWell(null);\n }\n }\n }, [wellSections, wells]);\n\n // NOTE: Table columns with metrics\n const columnsWithDict = useTableColumns(metricsKeys);\n\n // NOTE: Filter wells\n const filteredWells = useFilteredWells(wells, filters);\n\n useEffect(() => {\n if (!filteredWells || !isAllWellsLoaded) return;\n\n if (initLoading.current) {\n let data = wells.filter(well => (offsetSettings?.selectedWellIds || []).includes(well.id));\n if (subjectWell) data = data.concat(subjectWell);\n setSelectedWells(uniqBy(data, 'id'));\n initLoading.current = false;\n } else {\n setSelectedWells(prev => {\n let newSelectedWells = (filteredWells || []).filter(\n well => !!prev.find(({ id }) => well.id === id)\n );\n if (subjectWell) newSelectedWells = newSelectedWells.concat(subjectWell);\n return uniqBy(newSelectedWells, 'id');\n });\n }\n }, [wells, filteredWells, offsetSettings?.selectedWellIds, isAllWellsLoaded]);\n\n // NOTE: Sort wells\n const [sortBy, setSortBy, sortDirection, setSortDirection, sortedWells] = useSortedWells(\n subjectWell,\n filteredWells,\n selectedWells,\n setIsTableLoading\n );\n\n // NOTE: Add advanced wells\n const handleAddRemoveAssets = useCallback(\n (isAdding, newAssets, assetType) => {\n let addingWellIds;\n if (assetType === SEARCH_CATEGORIES.well.name) {\n addingWellIds = newAssets;\n } else {\n addingWellIds = newAssets.reduce((acc, assetId) => {\n const rigName = wells.find(well => well.id === assetId)?.rigName;\n const rigWellIds = wells.filter(well => well.rigName === rigName).map(well => well.id);\n return acc.concat(rigWellIds);\n }, []);\n }\n let addingWells = wells.filter(({ id }) => addingWellIds.includes(id));\n if (isAdding) {\n addingWells = addingWells.slice(\n 0,\n Math.min(addingWells.length, maxOffsetWellNumber - selectedWells.length)\n );\n setSelectedWells(selectedWells => uniqBy(selectedWells.concat(addingWells), 'id'));\n } else {\n setSelectedWells(selectedWells =>\n uniq(selectedWells.filter(({ id }) => !addingWells.find(well => well.id === id)))\n );\n }\n },\n [wells, selectedWells]\n );\n\n const handleHideAdvancedSearch = useCallback(() => {\n setIsAdvancedSearchHidden(true);\n }, []);\n\n // NOTE: Change metrics keys\n const handleChangeMetricsKeys = useCallback(newMetricsKeys => {\n setMetricsKeys(newMetricsKeys);\n }, []);\n\n // NOTE: Check and Uncheck one offset well\n const handleChangeOffsetWell = useCallback((well, checked) => {\n if (checked) {\n setSelectedWells(prevWells => [...prevWells, well]);\n } else {\n setSelectedWells(prevWells => prevWells.filter(item => item.id !== well.id));\n }\n }, []);\n\n // NOTE: Select and Unselect All wells\n const handleChangeAllOffsetWells = useCallback(\n checked => {\n if (checked) {\n const data = subjectWell ? filteredWells.concat(subjectWell) : filteredWells;\n const sortedData = sortArray(uniqBy(data, 'id'), 'distance');\n setSelectedWells(sortedData.slice(0, maxOffsetWellNumber));\n } else {\n setSelectedWells(subjectWell ? [subjectWell] : []);\n }\n },\n [filteredWells, subjectWell, maxOffsetWellNumber]\n );\n\n // NOTE: Well Section change filter\n const updateSelectedWellsBySection = section => {\n if (bicWells) {\n const sectionWells = wells?.filter(well => bicWells[section]?.includes(well.id)) || [];\n const limitedWells = sortArray(sectionWells, 'distance');\n setSelectedWells(limitedWells.slice(0, maxOffsetSize));\n } else {\n setSelectedWells(subjectWell ? [subjectWell] : []);\n }\n };\n\n const handleChangeWellSection = useCallback(\n section => {\n setSelectedWellSection(section);\n updateSelectedWellsBySection(section);\n },\n [updateSelectedWellsBySection]\n );\n\n // NOTE: Get Selected wells count\n const selectedWellsCount = useMemo(() => {\n if (selectedWells.find(well => well.id === subjectWellId)) {\n return selectedWells.length - 1;\n }\n return selectedWells.length;\n }, [selectedWells, subjectWellId]);\n\n // NOTE: Save offset setting\n const isSynced = useMemo(() => {\n if (!bicWells) return false;\n const selectedWellIds = selectedWells.map(({ id }) => id);\n let synced;\n const owsWellIds = bicWells[selectedWellSection] || [];\n const owsWellIdsLength = Math.min(owsWellIds.length, maxOffsetSize);\n\n if (owsWellIdsLength !== selectedWellIds.length) {\n synced = false;\n } else {\n synced = selectedWellIds.every(id => owsWellIds.includes(id));\n }\n return synced;\n }, [bicWells, selectedWells, selectedWellSection, maxOffsetSize]);\n\n const isXtoProvider = useMemo(() => {\n return companyProvider ? COMPANY_PROVIDERS_FOR_IDAS.includes(companyProvider) : false;\n }, [companyProvider]);\n\n const offsetLabel = useMemo(() => {\n if (isXtoProvider) {\n return 'IDAS generated offsets.';\n }\n\n return isWDUser ? 'Offset Selection App.' : 'WellHub.';\n }, [isXtoProvider, isWDUser]);\n\n const handleSave = () => {\n onClose();\n\n const newOffsetSetting = {\n ...offsetSettings,\n companyId: assetCompanyId,\n subjectWellId,\n selectedWellIds: selectedWells.map(({ id }) => id),\n filters,\n metricsKeys,\n wellSection: selectedWellSection,\n isSynced,\n mapHidden: isMapHidden,\n filterExpanded: isFilterExpanded,\n offsetWellsLimited: isLimitedOffsetWells,\n };\n onSave(newOffsetSetting, selectedWells);\n };\n\n const handleCancel = () => {\n let data = (wells || []).filter(well =>\n (offsetSettings?.selectedWellIds || []).includes(well.id)\n );\n if (subjectWell) data = data.concat(subjectWell);\n setSelectedWells(uniqBy(data, 'id'));\n\n const newOffsetSetting = {\n ...offsetSettings,\n mapHidden: isMapHidden,\n filterExpanded: isFilterExpanded,\n };\n onSave(newOffsetSetting);\n setFilters(offsetSettings?.filters || {});\n setSelectedWellSection(offsetSettings?.wellSection || ALL_SECTION_KEY);\n onClose();\n };\n\n const isTableFullLoading = isTableLoading || areWellsLoading;\n\n // NOTE: Reset processing\n const isResetVisible = useMemo(() => {\n if (isTableFullLoading) return false;\n if (!isSynced) return true;\n if (!isEmpty(filters) && filters[FilterType.sideTracks]) return true;\n if (selectedWellSection !== ALL_SECTION_KEY) return true;\n return false;\n }, [isSynced, filters, selectedWellSection, isTableFullLoading]);\n\n const handleReset = () => {\n setFilters({});\n setSelectedWellSection(ALL_SECTION_KEY);\n updateSelectedWellsBySection(ALL_SECTION_KEY);\n };\n\n const isLoading = !wells || !wellSections || !sortedWells || viewType === ViewType.none;\n\n // NOTE: Well Name shadow\n const [isHScrollMoved, setIsHScrollMoved] = useState(false);\n const [tableRowsCount, setTableRowsCount] = useState(ROWS_PER_PAGE);\n const [tableWells, setTableWells] = useState([]);\n\n useEffect(() => {\n if (!sortedWells) return;\n\n const wells = sortedWells.slice(0, tableRowsCount);\n setTableWells(wells);\n }, [sortedWells, tableRowsCount, subjectWell]);\n\n useEffect(() => {\n if (resyncStatus === RESYNC_STATUS.SUCCEEDED) {\n handleReset();\n }\n }, [bicWells]);\n\n const handleScroll = e => {\n if (!e.target) return;\n\n if (isAdvancedSearchHidden) {\n e.target.scrollLeft = 0;\n setIsAdvancedSearchHidden(false);\n }\n\n // Check if H-Scroll is visible\n if (e.target.scrollLeft <= 5 && isHScrollMoved) {\n setIsHScrollMoved(false);\n }\n if (e.target.scrollLeft > 5 && !isHScrollMoved) {\n setIsHScrollMoved(true);\n }\n\n if (e.target.scrollTop <= 5 && isTopGradientShow) {\n setIsTopGradientShow(false);\n }\n if (e.target.scrollTop > 5 && !isTopGradientShow) {\n setIsTopGradientShow(true);\n }\n\n // Check if scroll has reached top or bottom\n if (e.target.scrollHeight === e.target.offsetHeight) return;\n\n const currentScrollBottom = Math.round(e.target.scrollTop + e.target.offsetHeight + 2);\n\n if (currentScrollBottom >= e.target.scrollHeight && tableRowsCount < sortedWells.length) {\n setTableRowsCount(count => count + ROWS_PER_PAGE);\n }\n };\n\n const tooltipContainer = () => {\n return (\n <div>\n <span className={classNames(typography.regular12, typography.colors.t1)}>\n The offset list is being automatically populated by \n </span>\n <span className={classNames(typography.medium12, typography.colors.t1)}>{offsetLabel}</span>\n </div>\n );\n };\n\n return (\n <Modal\n open={open}\n onClose={handleCancel}\n title={\n <AppHeader\n isWDUser={isWDUser}\n viewType={viewType}\n totalCount={wells?.length ?? 0}\n selectedCount={selectedWellsCount}\n isViewOnly={isViewOnly}\n maxOffsetWellNumber={maxOffsetWellNumber}\n />\n }\n isMobile={viewType === ViewType.mobile}\n contentContainerClassName={classNames(styles.offsetWellDialog)}\n contentClassName={classNames(styles.contentContainer, {\n [styles.smallContainer]: viewType === ViewType.small,\n [styles.contentContainerMobile]: viewType === ViewType.mobile,\n })}\n actionsClassName={styles.modalActions}\n actions={\n !isViewOnly && (\n <div className={styles.actionsWrapper}>\n {!isLoading && isResetVisible ? (\n <Tooltip\n placement=\"bottom-start\"\n title={`Reset to Synced Offsets in ${isWDUser ? 'Offset App' : 'Wellhub'}`}\n >\n <div>\n <Button\n data-testid={`${PAGE_NAME}_reset`}\n onClick={handleReset}\n color=\"primary\"\n startIcon={viewType !== ViewType.mobile && <ReplayIcon />}\n classes={viewType === ViewType.mobile && { root: styles.resetButtonMobile }}\n >\n {viewType !== ViewType.mobile ? 'Reset' : <ReplayIcon />}\n </Button>\n </div>\n </Tooltip>\n ) : (\n <div className={viewType === ViewType.mobile && styles.infoIconContainer}>\n {viewType !== ViewType.mobile ? (\n <>\n <span className={classNames(typography.regular12, typography.colors.t6)}>\n The offset list is being automatically populated by \n </span>\n <span className={classNames(typography.medium12, typography.colors.t6)}>\n {offsetLabel}\n </span>\n </>\n ) : (\n <Tooltip\n title={tooltipContainer()}\n enterTouchDelay={0}\n leaveTouchDelay={LEAVE_TOUCH_DELAY}\n >\n <InfoOutlined className={styles.infoIcon} />\n </Tooltip>\n )}\n </div>\n )}\n <div className={styles.buttonGap}>\n <Button data-testid={`${PAGE_NAME}_cancel`} onClick={handleCancel} color=\"primary\">\n Cancel\n </Button>\n <Button\n data-testid={`${PAGE_NAME}_selectedWells`}\n variant=\"contained\"\n color=\"primary\"\n onClick={handleSave}\n >\n Select ({selectedWellsCount})\n </Button>\n </div>\n </div>\n )\n }\n >\n <NotificationsContainer />\n {!isLoading ? (\n <div\n className={classNames(styles.contentWrapper, {\n [styles.contentBlocked]: isTableFullLoading,\n })}\n ref={contentRef}\n >\n {viewType === ViewType.mobile && (\n <div\n className={classNames(styles.countContainer, {\n [styles.countContainerMobile]: viewType === ViewType.mobile,\n })}\n >\n <Regular14 className={styles.totalLabel}>Total:</Regular14>\n <Regular14 data-testid={`${PAGE_NAME}_totalWells`} className={styles.countValue}>\n {wells.length}\n </Regular14>\n <Regular14 className={styles.selectedLabel}>Selected:</Regular14>\n <Regular14 data-testid={`${PAGE_NAME}_selected`} className={styles.countValue}>\n {selectedWellsCount}\n </Regular14>\n <Tooltip\n title={`App can’t process more than (${maxOffsetWellNumber - 1}) Offset Wells.`}\n placement=\"right\"\n >\n <Regular12\n data-testid={`${PAGE_NAME}_maxOffsetSize`}\n className={styles.maxOffsetSize}\n >\n /{maxOffsetWellNumber - 1}\n </Regular12>\n </Tooltip>\n </div>\n )}\n\n {viewType === ViewType.normal && (\n <Toolbar\n isViewOnly={isViewOnly}\n isXtoProvider={isXtoProvider}\n viewType={viewType}\n filters={filters}\n setFilters={setFilters}\n isFilterExpanded={isFilterExpanded}\n setIsFilterExpanded={setIsFilterExpanded}\n isMapHidden={isMapHidden}\n setIsMapHidden={setIsMapHidden}\n resyncStatus={resyncStatus}\n setResyncStatus={setResyncStatus}\n />\n )}\n\n {isTopGradientShow && (\n <div className={styles.topGradient} style={{ top: topGradientTop }} />\n )}\n <div\n className={classNames(styles.content, {\n [styles.contentBlocked]: isTableFullLoading,\n [styles.contentMobile]: viewType === ViewType.mobile,\n [styles.contentiOSMobile]: getMobileOperatingSystem() === IOS_DEVICE,\n })}\n ref={offsetWellsContainerRef}\n onScroll={e => handleScroll(e)}\n >\n {viewType !== ViewType.normal && (\n <Toolbar\n isViewOnly={isViewOnly}\n isXtoProvider={isXtoProvider}\n viewType={viewType}\n filters={filters}\n setFilters={setFilters}\n isFilterExpanded={isFilterExpanded}\n setIsFilterExpanded={setIsFilterExpanded}\n isMapHidden={isMapHidden}\n setIsMapHidden={setIsMapHidden}\n resyncStatus={resyncStatus}\n setResyncStatus={setResyncStatus}\n />\n )}\n {!isMapHidden && open && (\n <WellsMap\n isViewOnly={isViewOnly}\n mapHidden={isMapHidden}\n subjectWell={subjectWell}\n offsetWellIds={selectedWells.map(({ id }) => id)}\n wells={filteredWells}\n radius={filters[FilterType.radius]}\n handleChangeOffsetWell={handleChangeOffsetWell}\n activeWellId={activeWellId}\n viewType={viewType}\n />\n )}\n <Filter\n isHidden={!isFilterExpanded}\n isWDUser={isWDUser}\n filterOptions={filterOptions}\n filters={filters}\n wellSections={wellSections}\n selectedWellSection={selectedWellSection}\n subjectWell={subjectWell}\n onChangeFilters={value => {\n setIsTableLoading(true);\n setTimeout(() => setFilters(value), 0);\n }}\n onChangeBicWells={handleChangeWellSection}\n />\n <OffsetWellsTable\n open={open}\n isTableLoading={isTableFullLoading}\n companyId={assetCompanyId}\n subjectWellId={subjectWellId}\n sortBy={sortBy}\n setSortBy={setSortBy}\n sortDirection={sortDirection}\n setSortDirection={setSortDirection}\n columnsWithDict={columnsWithDict}\n wells={tableWells}\n metricsKeys={metricsKeys}\n setMetricsKeys={handleChangeMetricsKeys}\n handleChangeOffsetWell={handleChangeOffsetWell}\n handleChangeAllOffsetWells={handleChangeAllOffsetWells}\n handleAddRemoveAssets={handleAddRemoveAssets}\n isWellNameExpand={isWellNameExpand}\n setIsWellNameExpand={setIsWellNameExpand}\n isHScrollMoved={isHScrollMoved}\n onHideAdvancedSearch={handleHideAdvancedSearch}\n isViewOnly={isViewOnly}\n isLastWell={sortedWells.length <= tableRowsCount}\n contentRef={contentRef}\n offsetWellsContainerRef={offsetWellsContainerRef}\n isLimitedOffsetWells={isLimitedOffsetWells}\n maxOffsetWellNumber={maxOffsetWellNumber}\n wellSections={wellSections}\n setActiveWellId={setActiveWellId}\n viewType={viewType}\n isWDUser={isWDUser}\n taScores={taScores}\n />\n </div>\n {isViewOnly && (\n <div className={styles.viewOnlyInfoContainer}>\n <span className={classNames(typography.regular12, typography.colors.t6)}>\n The offset list is being automatically populated by \n </span>\n <span className={classNames(typography.medium12, typography.colors.t6)}>\n {offsetLabel}\n </span>\n </div>\n )}\n </div>\n ) : (\n <LoadingIndicator fullscreen={false} />\n )}\n </Modal>\n );\n};\n\nexport default OffsetWellPickerV4;\n"],"names":["PAGE_NAME","OffsetWellPickerV4","_ref","_wells$length","_classNames","_classNames4","open","isWDUser","defaultSubjectWell","currentUser","offsetSettings","addWellsUsabilityInfo","isViewOnly","onClose","onSave","_ref$maxOffsetSize","maxOffsetSize","offsetSize","DEFAULT_BIC_OFFSET_SIZE","_ref$localMaxOffsetSi","localMaxOffsetSize","DEFAULT_LOCAL_OFFSET_SIZE","syncAutoEnabled","_ref$isManualWellsEna","isManualWellsEnabled","useGlobalOffsetWellsSync","useState","_useState2","_slicedToArray","_useState","activeWellId","setActiveWellId","Math","min","MAX_OFFSET_SIZE","maxOffsetWellNumber","max","filterExpanded","_useState4","_useState3","isFilterExpanded","setIsFilterExpanded","mapHidden","_useState6","_useState5","isMapHidden","setIsMapHidden","assetCompanyId","companyId","company_id","subjectWellId","asset_id","_useState7","filters","_useState8","setFilters","_useState9","wellSection","ALL_SECTION_KEY","_useState10","selectedWellSection","setSelectedWellSection","initLoading","useRef","_useState12","_useState11","selectedWells","setSelectedWells","_useState14","_useState13","subjectWell","setSubjectWell","_useState16","_useState15","isTableLoading","setIsTableLoading","_useState18","_useState17","isWellNameExpand","setIsWellNameExpand","_useState20","_useState19","isAdvancedSearchHidden","setIsAdvancedSearchHidden","contentRef","offsetWellsContainerRef","_useState21","ViewType","none","_useState22","viewType","setViewType","prevViewType","_useState24","_useState23","isTopGradientShow","setIsTopGradientShow","isLimitedOffsetWells","length","topGradientTop","TOP_GRADIENT_MAP","prevSelectedWellIds","_useState26","_useState25","appLoading","setAppLoading","useEffect","_offsetSettings$selec","_prevSelectedWellIds$","_offsetSettings$selec2","showInfoNotification","selectedWellIds","current","every","id","_prevSelectedWellIds$2","includes","handleResize","window","innerWidth","SMALL_SCREEN_WIDTH","isMobileDetected","isNativeDetected","mobile","innerHeight","SMALL_SCREEN_HEIGHT","small","normal","addEventListener","removeEventListener","_useFetchWells","useFetchWells","_useFetchWells2","rawWells","areWellsLoading","useCompanyProvider","companyProvider","_useCompanyProvider","useBicWells","_useBicWells2","_useBicWells","wellSections","setWellSections","bicWells","setBicWells","resyncStatus","setResyncStatus","taScores","useCompanyMetricKey","metricsKeys","_useCompanyMetricKey2","_useCompanyMetricKey","setMetricsKeys","wells","useAdvancedWells","isAllWellsLoaded","_ref2","syncOffsetWells","_asyncToGenerator","_regeneratorRuntime","mark","_callee","isSynced","offsetWellsChanged","_offsetSettings$selec3","bicWellIds","isMatched","wellsByDistance","newOffsetSetting","offsetWells","_offsetWells","wrap","_context","prev","next","wellId","getCoordinatedWells","sent","slice","map","well","offsetWellsLimited","filter","stop","apply","this","arguments","filterOptions","useFilterOptions","find","allSectionNames","item","value","_ref3","label","subjectWellWithSection","_defineProperty","ColumnType","columnsWithDict","useTableColumns","filteredWells","useFilteredWells","data","concat","uniqBy","newSelectedWells","_ref5","useSortedWells","_useSortedWells2","_useSortedWells","sortBy","setSortBy","sortDirection","setSortDirection","sortedWells","handleAddRemoveAssets","useCallback","isAdding","newAssets","assetType","addingWellIds","SEARCH_CATEGORIES","name","reduce","acc","assetId","_wells$find","rigName","rigWellIds","addingWells","_ref6","uniq","_ref7","handleHideAdvancedSearch","handleChangeMetricsKeys","newMetricsKeys","handleChangeOffsetWell","checked","prevWells","handleChangeAllOffsetWells","sortedData","sortArray","updateSelectedWellsBySection","section","sectionWells","_bicWells$section","limitedWells","handleChangeWellSection","selectedWellsCount","useMemo","_ref8","owsWellIds","isXtoProvider","COMPANY_PROVIDERS_FOR_IDAS","offsetLabel","handleCancel","isTableFullLoading","isResetVisible","isEmpty","FilterType","sideTracks","handleReset","isLoading","_useState28","_useState27","isHScrollMoved","setIsHScrollMoved","ROWS_PER_PAGE","_useState30","_useState29","tableRowsCount","setTableRowsCount","_useState32","_useState31","tableWells","setTableWells","RESYNC_STATUS","SUCCEEDED","_jsxs","Modal","title","_jsx","AppHeader","totalCount","selectedCount","isMobile","contentContainerClassName","classNames","styles","offsetWellDialog","contentClassName","contentContainer","smallContainer","contentContainerMobile","actionsClassName","modalActions","actions","className","actionsWrapper","children","Tooltip","placement","Button","onClick","color","startIcon","ReplayIcon","classes","root","resetButtonMobile","infoIconContainer","_Fragment","typography","regular12","colors","t6","medium12","t1","enterTouchDelay","leaveTouchDelay","LEAVE_TOUCH_DELAY","InfoOutlined","infoIcon","buttonGap","variant","_ref9","NotificationsContainer","LoadingIndicator","fullscreen","contentWrapper","contentBlocked","ref","countContainer","countContainerMobile","Regular14","totalLabel","countValue","selectedLabel","Regular12","Toolbar","topGradient","style","top","content","contentMobile","contentiOSMobile","getMobileOperatingSystem","IOS_DEVICE","onScroll","e","target","scrollLeft","scrollTop","scrollHeight","offsetHeight","round","count","handleScroll","WellsMap","offsetWellIds","_ref10","radius","Filter","isHidden","onChangeFilters","setTimeout","onChangeBicWells","OffsetWellsTable","onHideAdvancedSearch","isLastWell","viewOnlyInfoContainer"],"mappings":"6suBAmDA,IAAMA,GAAY,qBAKZC,GAAqB,SAcrBC,IAAA,IAAAC,GAAAC,GAAAC,GAbJC,MAAAA,KACAC,MAAAA,SACAC,MAAAA,mBACAC,MAAAA,YACAC,MAAAA,eACAC,MAAAA,sBACAC,MAAAA,WACAC,MAAAA,QACAC,MAAAA,OAAMC,GAAAb,GACNc,cAAeC,eAAaC,EAAuBH,GAAAI,GAAAjB,GACnDkB,mBAAAA,eAAqBC,EAAyBF,GAC9CG,MAAAA,gBAAeC,GAAArB,GACfsB,qBAAAA,gBAA4BD,GAE5BE,EAAyBf,GAAgBI,IAEzC,IAAwCY,GAAAA,EAAS,MAAKC,GAAAC,EAAAC,GAAA,GAA/CC,GAAYH,GAAA,GAAEI,GAAeJ,GAAA,GAC9BX,GAAgBgB,KAAKC,IAAIhB,GAAa,EAAGG,GAAqB,EAAGc,EAAkB,GACnFC,GAAsBH,KAAKC,IAC/BD,KAAKI,IAAIpB,GAAeI,GAAqB,GAC7Cc,EAAkB,GAG4BR,GAAAA,EAAShB,cAAAA,EAAAA,GAAgB2B,gBAAeC,GAAAV,EAAAW,GAAA,GAAjFC,GAAgBF,GAAA,GAAEG,GAAmBH,GAAA,GACNZ,GAAAA,EAAShB,cAAAA,EAAAA,GAAgBgC,WAAUC,GAAAf,EAAAgB,GAAA,GAAlEC,GAAWF,GAAA,GAAEG,GAAcH,GAAA,GAC5BI,KAAkBvC,gBAAAA,GAAoBwC,cAAcvC,cAAAA,EAAAA,GAAawC,YAC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AW,WAAA,OAAMtT,GAAWyI,EAAM,GAAE,EACpC,EACF8K,iBAAkBvH,KAEpBkC,EAACsF,EAAgB,CACfzW,KAAMA,GACNoE,eAAgBsL,GAChBhN,UAAWD,GACXG,cAAeA,GACfgK,OAAQA,GACRC,UAAWA,GACXC,cAAeA,GACfC,iBAAkBA,GAClBf,gBAAiBA,GACjB7C,MAAOyH,GACP7H,YAAaA,GACbG,eAAgBkF,GAChBE,uBAAwBA,GACxBG,2BAA4BA,GAC5BxB,sBAAuBA,GACvBzI,iBAAkBA,GAClBC,oBAAqBA,GACrB0L,eAAgBA,GAChBuG,qBAAsBvI,GACtB7N,WAAYA,GACZqW,WAAY3J,GAAYpH,QAAU4K,GAClC1L,WAAYA,GACZC,wBAAyBA,GACzBY,qBAAsBA,GACtB9D,oBAAqBA,GACrB0G,aAAcA,GACd9G,gBAAiBA,GACjB2D,SAAUA,GACVnF,SAAUA,GACV4I,SAAUA,QAGbvI,IACC0Q,EAAA,MAAA,CAAKmB,UAAWT,EAAOkF,sBAAsBvE,SAC3C,CAAAlB,EAAA,OAAA,CAAMgB,UAAWV,EAAWyB,GAAWC,UAAWD,GAAWE,OAAOC,IAAIhB,SAAA,yDAGxElB,EAAA,OAAA,CAAMgB,UAAWV,EAAWyB,GAAWI,SAAUJ,GAAWE,OAAOC,IAAIhB,SACpE7C,aAUjB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from"@babel/runtime/helpers/slicedToArray";import{useState as e,useMemo as o,useRef as r,useEffect as n}from"react";import i from"prop-types";import{get as s}from"lodash";import{withStyles as a,Tooltip as p,makeStyles as l,Chip as c,Input as m}from"@material-ui/core";import u from"@material-ui/icons/Close";import"../../../utils/apiCalls.js";import"../../../effects/useAdvancedWells.js";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/defineProperty";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../constants.js";import"../../../../../utils/index.js";import"../../../../../constants/goals.js";import"../../../../../constants/segment.js";import"../../../../../constants/alerts.js";import"../../../../../constants/apps.js";import"../../../../../constants/drillstring.js";import"../../../../../constants/completion.js";import"../../../../../constants/appPackages.js";import"../../../../../constants/notifications.js";import"../../../../../constants/feed.js";import"../../../../../constants/bha.js";import"../../../../../constants/corvaCompanyId.js";import"../../../../GradientManager/configuration/constants.js";import"@babel/runtime/helpers/typeof";import"moment";import"react-virtualized";import{useAssetsData as d}from"../../../effects/useAssetsData.js";import"../../../../../clients/subscriptions/constants.js";import"querystring";import"uuid/v1";import"../../../../../clients/subscriptions.v1.js";import"../../../../../clients/jsonApi/index.js";import"../../../../../clients/subscriptions/subscriptions-client.factory.js";import"uuid";import"jsona";import"../../../../../utils/env.js";import"../../../../StatusBadge/constants.js";import"lodash/set";import"lodash/get";import"lodash/unset";import"../../../../../clients/api/apiCore.js";import"../../../../../clients/constants.js";import"../../../../../clients/sso/auth0.js";import"../../../../../clients/sso/oauth2.js";import"lodash/isEmpty";import"lodash/sortBy";import"../../../../../constants/streamSourceType.js";import"../../../../DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js";import{jsxs as f,jsx as h,Fragment as x}from"react/jsx-runtime";import"../../../../../componentsV2/AppCommonsProvider/AppCommonsContext.js";import g from"./AssetTypesSection.js";import j from"./AssetResultSection.js";import{SEARCH_CATEGORIES as b,CATEGORY_KEY_VALUES as C}from"./constants.js";var y=a((function(){return{tooltip:{backgroundColor:"#414141",color:"#ffffff",fontSize:"11px",lineHeight:"16px",borderRadius:"4px",boxShadow:"0px 4px 4px rgba(0, 0, 0, 0.12)",padding:"4px"}}}))(p),v=l((function(t){return{wrapper:{width:function(t){return t.searchWidth},maxWidth:"996px",display:"flex",flexDirection:"column",padding:16},inputWrapper:{display:"flex",width:"auto",margin:"0 8px 8px",alignItems:"center",flexWrap:"nowrap",justifyContent:"space-between"},selectedChip:{height:"24px",margin:"4px"},selectedChipDeleteIcon:{width:"16px",height:"16px",color:t.palette.primary.text6,"&:hover":{color:t.palette.primary.text1}},selectedLabel:{fontWeight:400,fontSize:"16px",lineHeight:"22px",color:t.palette.primary.text1,whiteSpace:"nowrap",paddingLeft:"4px",paddingRight:"8px"},disabledIcon:{width:"16px",height:"16px",color:t.palette.primary.text6,opacity:.4},closeIconButton:{padding:0,"&:hover $closeIcon":{color:t.palette.primary.text1}},searchInput:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",borderBottom:"2px solid #03BCD4"},closeIcon:{color:t.palette.primary.text6,fontSize:"18px"}}})),I=function(i){var a=i.company,p=i.subjectWellId,l=i.value,I=i.selectedWellIds,A=i.onChange,w=e(null),W=t(w,2),S=W[0],D=W[1],R=e(null),k=t(R,2),T=k[0],q=k[1],z=e(1),B=t(z,2),N=B[0],L=B[1],P=o((function(){return window.innerWidth-32}),[]),G=v({searchWidth:P}),H=r();n((function(){q(l)}),[l]);var K=d(T,S,N,a,I),O=t(K,2),U=O[0],E=O[1],F=o((function(){return S&&E&&0!==E.length?E[0][1].filter((function(t){return t.checked})).length:0}),[S,E]);return f("div",{className:G.wrapper,children:[h("div",{className:G.inputWrapper,children:f("div",{className:G.searchInput,children:[S&&f(x,{children:[h(c,{"data-not-migrated-muichip":!0,classes:{root:G.selectedChip,deleteIcon:G.selectedChipDeleteIcon},label:s(b,[S,"labelPlural"],"Assets"),deleteIcon:h(u,{}),onDelete:function(){D(null)}}),F>0&&f("span",{className:G.selectedLabel,children:[F," Selected"]})]}),h(m,{"data-testid":"".concat("AutoCompleteAssetSearch","_searchInput"),inputRef:H,autoFocus:!0,disableUnderline:!0,fullWidth:!0,value:T||"",placeholder:"Add Offset ...",onChange:function(t){var e=t.target.value;H.current.focus(),q(e),L(1)},onKeyUp:function(e){var o=e.target.value,r=e.keyCode,n=C.find((function(e){var r=t(e,2);return r[0],r[1].autoCategorizedKey===o.trim().toLowerCase()}));if(n&&(13===r||32===r))return q(""),D(n[0]),void L(1);""===o&&8===r&&(D(null),L(1))}}),h(y,{title:"Clear",children:h(u,{className:S||T?G.selectedChipDeleteIcon:G.disabledIcon,onClick:function(){H.current.focus(),q(""),D(null),L(1)}})})]})}),!S&&!T&&h(g,{onClickAssetType:function(t){H.current.focus(),D(t),L(1)}}),(S||T)&&h(j,{subjectWellId:p,page:N,assetType:S,loading:U,groupedAssets:E,onClickAsset:function(t,e){A(!t.checked,[t.redirectAssetId],e)},onClickAllAsset:function(t,e){var o=E[0][1];A(t,o.map((function(t){return t.redirectAssetId})),e)},onScrollReached:function(t){"top"===t&&N>1&&L((function(t){return t-1})),"bottom"===t&&L((function(t){return t+1}))}})]})};I.propTypes={subjectWellId:i.number.isRequired,company:i.number.isRequired,value:i.string.isRequired,selectedWellIds:i.arrayOf(i.number).isRequired,onChange:i.func.isRequired};export{I as default};
|
|
2
2
|
//# sourceMappingURL=AutoCompleteAssetSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoCompleteAssetSearch.js","sources":["../../../../../../src/components/OffsetWellPickerV4/components/OffsetWellsTable/AdvancedSearch/AutoCompleteAssetSearch.js"],"sourcesContent":["import { useState, useRef, useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { get } from 'lodash';\nimport { makeStyles, Chip, Input, Tooltip, withStyles } from '@material-ui/core';\nimport CloseIcon from '@material-ui/icons/Close';\n\nimport { useAssetsData } from '../../../effects';\n\nimport AssetTypesSection from './AssetTypesSection';\nimport AssetResultSection from './AssetResultSection';\nimport { SEARCH_CATEGORIES, CATEGORY_KEY_VALUES } from './constants';\n\nconst PAGE_NAME = 'AutoCompleteAssetSearch';\n\nconst StyledTooltip = withStyles(() => ({\n tooltip: {\n backgroundColor: '#414141',\n color: '#ffffff',\n fontSize: '11px',\n lineHeight: '16px',\n borderRadius: '4px',\n boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.12)',\n padding: '4px',\n },\n}))(Tooltip);\n\nconst useStyles = makeStyles(theme => ({\n wrapper: {\n width: ({ searchWidth }) => searchWidth,\n maxWidth: '996px',\n display: 'flex',\n flexDirection: 'column',\n padding: 16,\n },\n inputWrapper: {\n display: 'flex',\n width: 'auto',\n margin: '0 8px 8px',\n alignItems: 'center',\n flexWrap: 'nowrap',\n justifyContent: 'space-between',\n },\n selectedChip: {\n height: '24px',\n margin: '4px',\n },\n selectedChipDeleteIcon: {\n width: '16px',\n height: '16px',\n color: theme.palette.primary.text6,\n '&:hover': {\n color: theme.palette.primary.text1,\n },\n },\n selectedLabel: {\n fontWeight: 400,\n fontSize: '16px',\n lineHeight: '22px',\n color: theme.palette.primary.text1,\n whiteSpace: 'nowrap',\n paddingLeft: '4px',\n paddingRight: '8px',\n },\n disabledIcon: {\n width: '16px',\n height: '16px',\n color: theme.palette.primary.text6,\n opacity: 0.4,\n },\n closeIconButton: {\n padding: 0,\n '&:hover $closeIcon': {\n color: theme.palette.primary.text1,\n },\n },\n searchInput: {\n width: '100%',\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n borderBottom: '2px solid #03BCD4',\n },\n closeIcon: {\n color: theme.palette.primary.text6,\n fontSize: '18px',\n },\n}));\n\nconst AutoCompleteAssetSearch = ({ company, subjectWellId, value, selectedWellIds, onChange }) => {\n const [assetType, setAssetType] = useState(null);\n const [searchKey, setSearchKey] = useState(null);\n const [page, setPage] = useState(1);\n const searchWidth = useMemo(() => window.innerWidth - 32, []);\n const classes = useStyles({ searchWidth });\n const searchInputRef = useRef();\n\n useEffect(() => {\n setSearchKey(value);\n }, [value]);\n\n const [loading, groupedAssets] = useAssetsData(\n searchKey,\n assetType,\n page,\n company,\n selectedWellIds\n );\n\n const selectedCount = useMemo(() => {\n if (!assetType || !groupedAssets || groupedAssets.length === 0) return 0;\n return groupedAssets[0][1].filter(asset => asset.checked).length;\n }, [assetType, groupedAssets]);\n\n const handleDeleteAssetType = () => {\n setAssetType(null);\n };\n\n const handleChangeAssetType = key => {\n searchInputRef.current.focus();\n setAssetType(key);\n setPage(1);\n };\n\n const handleChangeSearchKey = ({ target: { value } }) => {\n searchInputRef.current.focus();\n setSearchKey(value);\n setPage(1);\n };\n\n const handleKeyPress = e => {\n const { value } = e.target;\n const { keyCode } = e;\n\n const availableCategory = CATEGORY_KEY_VALUES.find(\n ([_, item]) => item.autoCategorizedKey === value.trim().toLowerCase()\n );\n\n // NOTE: when type one of categories defined and press enter key or space key\n // then asset type will be auto selected and clear input field\n if (availableCategory && (keyCode === 13 || keyCode === 32)) {\n setSearchKey('');\n setAssetType(availableCategory[0]);\n setPage(1);\n return;\n }\n\n // NOTE: when there is no value in input field and press back space key,\n // then clear asset type as well.\n if (value === '' && keyCode === 8) {\n setAssetType(null);\n setPage(1);\n }\n };\n\n const handleSearchClear = () => {\n searchInputRef.current.focus();\n setSearchKey('');\n setAssetType(null);\n setPage(1);\n };\n\n const handleScrollReached = position => {\n if (position === 'top' && page > 1) {\n setPage(prev => prev - 1);\n }\n if (position === 'bottom') {\n setPage(prev => prev + 1);\n }\n };\n\n const handleChangeAsset = (asset, assetType) => {\n onChange(!asset.checked, [asset.redirectAssetId], assetType);\n };\n\n const handleChangeAllAssets = (isAllAdding, assetType) => {\n const assets = groupedAssets[0][1];\n onChange(\n isAllAdding,\n assets.map(asset => asset.redirectAssetId),\n assetType\n );\n };\n\n return (\n <div className={classes.wrapper}>\n <div className={classes.inputWrapper}>\n <div className={classes.searchInput}>\n {assetType && (\n <>\n <Chip\n data-not-migrated-muichip\n classes={{ root: classes.selectedChip, deleteIcon: classes.selectedChipDeleteIcon }}\n label={get(SEARCH_CATEGORIES, [assetType, 'labelPlural'], 'Assets')}\n deleteIcon={<CloseIcon />}\n onDelete={handleDeleteAssetType}\n />\n {selectedCount > 0 && (\n <span className={classes.selectedLabel}>{selectedCount} Selected</span>\n )}\n </>\n )}\n <Input\n data-testid={`${PAGE_NAME}_searchInput`}\n inputRef={searchInputRef}\n autoFocus\n disableUnderline\n fullWidth\n value={searchKey || ''}\n placeholder=\"Add Offset ...\"\n onChange={handleChangeSearchKey}\n onKeyUp={handleKeyPress}\n />\n <StyledTooltip title=\"Clear\">\n <CloseIcon\n className={\n assetType || searchKey ? classes.selectedChipDeleteIcon : classes.disabledIcon\n }\n onClick={handleSearchClear}\n />\n </StyledTooltip>\n </div>\n </div>\n\n {!assetType && !searchKey && <AssetTypesSection onClickAssetType={handleChangeAssetType} />}\n {(assetType || searchKey) && (\n <AssetResultSection\n subjectWellId={subjectWellId}\n page={page}\n assetType={assetType}\n loading={loading}\n groupedAssets={groupedAssets}\n onClickAsset={handleChangeAsset}\n onClickAllAsset={handleChangeAllAssets}\n onScrollReached={handleScrollReached}\n />\n )}\n </div>\n );\n};\n\nAutoCompleteAssetSearch.propTypes = {\n subjectWellId: PropTypes.number.isRequired,\n company: PropTypes.number.isRequired,\n value: PropTypes.string.isRequired,\n selectedWellIds: PropTypes.arrayOf(PropTypes.number).isRequired,\n onChange: PropTypes.func.isRequired,\n};\n\nexport default AutoCompleteAssetSearch;\n"],"names":["StyledTooltip","withStyles","tooltip","backgroundColor","color","fontSize","lineHeight","borderRadius","boxShadow","padding","Tooltip","useStyles","makeStyles","theme","wrapper","width","_ref","searchWidth","maxWidth","display","flexDirection","inputWrapper","margin","alignItems","flexWrap","justifyContent","selectedChip","height","selectedChipDeleteIcon","palette","primary","text6","text1","selectedLabel","fontWeight","whiteSpace","paddingLeft","paddingRight","disabledIcon","opacity","closeIconButton","searchInput","borderBottom","closeIcon","AutoCompleteAssetSearch","_ref2","company","subjectWellId","value","selectedWellIds","onChange","useState","_useState2","_slicedToArray","_useState","assetType","setAssetType","_useState4","_useState3","searchKey","setSearchKey","_useState6","_useState5","page","setPage","useMemo","window","innerWidth","classes","searchInputRef","useRef","useEffect","useAssetsData","_useAssetsData2","_useAssetsData","loading","groupedAssets","selectedCount","length","filter","asset","checked","_jsxs","className","children","_jsx","_Fragment","Chip","root","deleteIcon","label","get","SEARCH_CATEGORIES","CloseIcon","onDelete","Input","concat","inputRef","autoFocus","disableUnderline","fullWidth","placeholder","_ref3","target","current","focus","onKeyUp","e","keyCode","availableCategory","CATEGORY_KEY_VALUES","find","_ref4","_ref5","autoCategorizedKey","trim","toLowerCase","title","onClick","AssetTypesSection","onClickAssetType","key","AssetResultSection","onClickAsset","redirectAssetId","onClickAllAsset","isAllAdding","assets","map","onScrollReached","position","prev","propTypes","PropTypes","number","isRequired","string","arrayOf","func"],"mappings":"2hDAYA,IAEMA,EAAgBC,GAAW,WAAA,MAAO,CACtCC,QAAS,CACPC,gBAAiB,UACjBC,MAAO,UACPC,SAAU,OACVC,WAAY,OACZC,aAAc,MACdC,UAAW,kCACXC,QAAS,OAEZ,GAVqBR,CAUlBS,GAEEC,EAAYC,GAAW,SAAAC,GAAK,MAAK,CACrCC,QAAS,CACPC,MAAO,SAAAC,GAAc,SAAXC,WAA6B,EACvCC,SAAU,QACVC,QAAS,OACTC,cAAe,SACfX,QAAS,IAEXY,aAAc,CACZF,QAAS,OACTJ,MAAO,OACPO,OAAQ,YACRC,WAAY,SACZC,SAAU,SACVC,eAAgB,iBAElBC,aAAc,CACZC,OAAQ,OACRL,OAAQ,OAEVM,uBAAwB,CACtBb,MAAO,OACPY,OAAQ,OACRvB,MAAOS,EAAMgB,QAAQC,QAAQC,MAC7B,UAAW,CACT3B,MAAOS,EAAMgB,QAAQC,QAAQE,QAGjCC,cAAe,CACbC,WAAY,IACZ7B,SAAU,OACVC,WAAY,OACZF,MAAOS,EAAMgB,QAAQC,QAAQE,MAC7BG,WAAY,SACZC,YAAa,MACbC,aAAc,OAEhBC,aAAc,CACZvB,MAAO,OACPY,OAAQ,OACRvB,MAAOS,EAAMgB,QAAQC,QAAQC,MAC7BQ,QAAS,IAEXC,gBAAiB,CACf/B,QAAS,EACT,qBAAsB,CACpBL,MAAOS,EAAMgB,QAAQC,QAAQE,QAGjCS,YAAa,CACX1B,MAAO,OACPI,QAAS,OACTC,cAAe,MACfK,eAAgB,gBAChBF,WAAY,SACZmB,aAAc,qBAEhBC,UAAW,C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MA,EACNR,UAAWA,EACXoB,QAASA,EACTC,cAAeA,EACf+C,aA7DkB,SAAC3C,EAAOzB,GAChCL,GAAU8B,EAAMC,QAAS,CAACD,EAAM4C,iBAAkBrE,IA6D5CsE,gBA1DsB,SAACC,EAAavE,GAC1C,IAAMwE,EAASnD,EAAc,GAAG,GAChC1B,EACE4E,EACAC,EAAOC,KAAI,SAAAhD,GAAK,OAAIA,EAAM4C,mBAC1BrE,IAsDI0E,gBAxEoB,SAAAC,GACT,QAAbA,GAAsBnE,EAAO,GAC/BC,GAAQ,SAAAmE,GAAI,OAAIA,EAAO,KAER,WAAbD,GACFlE,GAAQ,SAAAmE,GAAI,OAAIA,EAAO,UAwE7B,EAEAvF,EAAwBwF,UAAY,CAClCrF,cAAesF,EAAUC,OAAOC,WAChCzF,QAASuF,EAAUC,OAAOC,WAC1BvF,MAAOqF,EAAUG,OAAOD,WACxBtF,gBAAiBoF,EAAUI,QAAQJ,EAAUC,QAAQC,WACrDrF,SAAUmF,EAAUK,KAAKH"}
|
|
1
|
+
{"version":3,"file":"AutoCompleteAssetSearch.js","sources":["../../../../../../src/components/OffsetWellPickerV4/components/OffsetWellsTable/AdvancedSearch/AutoCompleteAssetSearch.js"],"sourcesContent":["import { useState, useRef, useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { get } from 'lodash';\nimport { makeStyles, Chip, Input, Tooltip, withStyles } from '@material-ui/core';\nimport CloseIcon from '@material-ui/icons/Close';\n\nimport { useAssetsData } from '../../../effects';\n\nimport AssetTypesSection from './AssetTypesSection';\nimport AssetResultSection from './AssetResultSection';\nimport { SEARCH_CATEGORIES, CATEGORY_KEY_VALUES } from './constants';\n\nconst PAGE_NAME = 'AutoCompleteAssetSearch';\n\nconst StyledTooltip = withStyles(() => ({\n tooltip: {\n backgroundColor: '#414141',\n color: '#ffffff',\n fontSize: '11px',\n lineHeight: '16px',\n borderRadius: '4px',\n boxShadow: '0px 4px 4px rgba(0, 0, 0, 0.12)',\n padding: '4px',\n },\n}))(Tooltip);\n\nconst useStyles = makeStyles(theme => ({\n wrapper: {\n width: ({ searchWidth }) => searchWidth,\n maxWidth: '996px',\n display: 'flex',\n flexDirection: 'column',\n padding: 16,\n },\n inputWrapper: {\n display: 'flex',\n width: 'auto',\n margin: '0 8px 8px',\n alignItems: 'center',\n flexWrap: 'nowrap',\n justifyContent: 'space-between',\n },\n selectedChip: {\n height: '24px',\n margin: '4px',\n },\n selectedChipDeleteIcon: {\n width: '16px',\n height: '16px',\n color: theme.palette.primary.text6,\n '&:hover': {\n color: theme.palette.primary.text1,\n },\n },\n selectedLabel: {\n fontWeight: 400,\n fontSize: '16px',\n lineHeight: '22px',\n color: theme.palette.primary.text1,\n whiteSpace: 'nowrap',\n paddingLeft: '4px',\n paddingRight: '8px',\n },\n disabledIcon: {\n width: '16px',\n height: '16px',\n color: theme.palette.primary.text6,\n opacity: 0.4,\n },\n closeIconButton: {\n padding: 0,\n '&:hover $closeIcon': {\n color: theme.palette.primary.text1,\n },\n },\n searchInput: {\n width: '100%',\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n borderBottom: '2px solid #03BCD4',\n },\n closeIcon: {\n color: theme.palette.primary.text6,\n fontSize: '18px',\n },\n}));\n\nconst AutoCompleteAssetSearch = ({ company, subjectWellId, value, selectedWellIds, onChange }) => {\n const [assetType, setAssetType] = useState(null);\n const [searchKey, setSearchKey] = useState(null);\n const [page, setPage] = useState(1);\n const searchWidth = useMemo(() => window.innerWidth - 32, []);\n const classes = useStyles({ searchWidth });\n const searchInputRef = useRef();\n\n useEffect(() => {\n setSearchKey(value);\n }, [value]);\n\n const [loading, groupedAssets] = useAssetsData(\n searchKey,\n assetType,\n page,\n company,\n selectedWellIds\n );\n\n const selectedCount = useMemo(() => {\n if (!assetType || !groupedAssets || groupedAssets.length === 0) return 0;\n return groupedAssets[0][1].filter(asset => asset.checked).length;\n }, [assetType, groupedAssets]);\n\n const handleDeleteAssetType = () => {\n setAssetType(null);\n };\n\n const handleChangeAssetType = key => {\n searchInputRef.current.focus();\n setAssetType(key);\n setPage(1);\n };\n\n const handleChangeSearchKey = ({ target: { value } }) => {\n searchInputRef.current.focus();\n setSearchKey(value);\n setPage(1);\n };\n\n const handleKeyPress = e => {\n const { value } = e.target;\n const { keyCode } = e;\n\n const availableCategory = CATEGORY_KEY_VALUES.find(\n ([_, item]) => item.autoCategorizedKey === value.trim().toLowerCase()\n );\n\n // NOTE: when type one of categories defined and press enter key or space key\n // then asset type will be auto selected and clear input field\n if (availableCategory && (keyCode === 13 || keyCode === 32)) {\n setSearchKey('');\n setAssetType(availableCategory[0]);\n setPage(1);\n return;\n }\n\n // NOTE: when there is no value in input field and press back space key,\n // then clear asset type as well.\n if (value === '' && keyCode === 8) {\n setAssetType(null);\n setPage(1);\n }\n };\n\n const handleSearchClear = () => {\n searchInputRef.current.focus();\n setSearchKey('');\n setAssetType(null);\n setPage(1);\n };\n\n const handleScrollReached = position => {\n if (position === 'top' && page > 1) {\n setPage(prev => prev - 1);\n }\n if (position === 'bottom') {\n setPage(prev => prev + 1);\n }\n };\n\n const handleChangeAsset = (asset, assetType) => {\n onChange(!asset.checked, [asset.redirectAssetId], assetType);\n };\n\n const handleChangeAllAssets = (isAllAdding, assetType) => {\n const assets = groupedAssets[0][1];\n onChange(\n isAllAdding,\n assets.map(asset => asset.redirectAssetId),\n assetType\n );\n };\n\n return (\n <div className={classes.wrapper}>\n <div className={classes.inputWrapper}>\n <div className={classes.searchInput}>\n {assetType && (\n <>\n <Chip\n data-not-migrated-muichip\n classes={{ root: classes.selectedChip, deleteIcon: classes.selectedChipDeleteIcon }}\n label={get(SEARCH_CATEGORIES, [assetType, 'labelPlural'], 'Assets')}\n deleteIcon={<CloseIcon />}\n onDelete={handleDeleteAssetType}\n />\n {selectedCount > 0 && (\n <span className={classes.selectedLabel}>{selectedCount} Selected</span>\n )}\n </>\n )}\n <Input\n data-testid={`${PAGE_NAME}_searchInput`}\n inputRef={searchInputRef}\n autoFocus\n disableUnderline\n fullWidth\n value={searchKey || ''}\n placeholder=\"Add Offset ...\"\n onChange={handleChangeSearchKey}\n onKeyUp={handleKeyPress}\n />\n <StyledTooltip title=\"Clear\">\n <CloseIcon\n className={\n assetType || searchKey ? classes.selectedChipDeleteIcon : classes.disabledIcon\n }\n onClick={handleSearchClear}\n />\n </StyledTooltip>\n </div>\n </div>\n\n {!assetType && !searchKey && <AssetTypesSection onClickAssetType={handleChangeAssetType} />}\n {(assetType || searchKey) && (\n <AssetResultSection\n subjectWellId={subjectWellId}\n page={page}\n assetType={assetType}\n loading={loading}\n groupedAssets={groupedAssets}\n onClickAsset={handleChangeAsset}\n onClickAllAsset={handleChangeAllAssets}\n onScrollReached={handleScrollReached}\n />\n )}\n </div>\n );\n};\n\nAutoCompleteAssetSearch.propTypes = {\n subjectWellId: PropTypes.number.isRequired,\n company: PropTypes.number.isRequired,\n value: PropTypes.string.isRequired,\n selectedWellIds: PropTypes.arrayOf(PropTypes.number).isRequired,\n onChange: PropTypes.func.isRequired,\n};\n\nexport default AutoCompleteAssetSearch;\n"],"names":["StyledTooltip","withStyles","tooltip","backgroundColor","color","fontSize","lineHeight","borderRadius","boxShadow","padding","Tooltip","useStyles","makeStyles","theme","wrapper","width","_ref","searchWidth","maxWidth","display","flexDirection","inputWrapper","margin","alignItems","flexWrap","justifyContent","selectedChip","height","selectedChipDeleteIcon","palette","primary","text6","text1","selectedLabel","fontWeight","whiteSpace","paddingLeft","paddingRight","disabledIcon","opacity","closeIconButton","searchInput","borderBottom","closeIcon","AutoCompleteAssetSearch","_ref2","company","subjectWellId","value","selectedWellIds","onChange","useState","_useState2","_slicedToArray","_useState","assetType","setAssetType","_useState4","_useState3","searchKey","setSearchKey","_useState6","_useState5","page","setPage","useMemo","window","innerWidth","classes","searchInputRef","useRef","useEffect","useAssetsData","_useAssetsData2","_useAssetsData","loading","groupedAssets","selectedCount","length","filter","asset","checked","_jsxs","className","children","_jsx","_Fragment","Chip","root","deleteIcon","label","get","SEARCH_CATEGORIES","CloseIcon","onDelete","Input","concat","inputRef","autoFocus","disableUnderline","fullWidth","placeholder","_ref3","target","current","focus","onKeyUp","e","keyCode","availableCategory","CATEGORY_KEY_VALUES","find","_ref4","_ref5","autoCategorizedKey","trim","toLowerCase","title","onClick","AssetTypesSection","onClickAssetType","key","AssetResultSection","onClickAsset","redirectAssetId","onClickAllAsset","isAllAdding","assets","map","onScrollReached","position","prev","propTypes","PropTypes","number","isRequired","string","arrayOf","func"],"mappings":"w5EAYA,IAEMA,EAAgBC,GAAW,WAAA,MAAO,CACtCC,QAAS,CACPC,gBAAiB,UACjBC,MAAO,UACPC,SAAU,OACVC,WAAY,OACZC,aAAc,MACdC,UAAW,kCACXC,QAAS,OAEZ,GAVqBR,CAUlBS,GAEEC,EAAYC,GAAW,SAAAC,GAAK,MAAK,CACrCC,QAAS,CACPC,MAAO,SAAAC,GAAc,SAAXC,WAA6B,EACvCC,SAAU,QACVC,QAAS,OACTC,cAAe,SACfX,QAAS,IAEXY,aAAc,CACZF,QAAS,OACTJ,MAAO,OACPO,OAAQ,YACRC,WAAY,SACZC,SAAU,SACVC,eAAgB,iBAElBC,aAAc,CACZC,OAAQ,OACRL,OAAQ,OAEVM,uBAAwB,CACtBb,MAAO,OACPY,OAAQ,OACRvB,MAAOS,EAAMgB,QAAQC,QAAQC,MAC7B,UAAW,CACT3B,MAAOS,EAAMgB,QAAQC,QAAQE,QAGjCC,cAAe,CACbC,WAAY,IACZ7B,SAAU,OACVC,WAAY,OACZF,MAAOS,EAAMgB,QAAQC,QAAQE,MAC7BG,WAAY,SACZC,YAAa,MACbC,aAAc,OAEhBC,aAAc,CACZvB,MAAO,OACPY,OAAQ,OACRvB,MAAOS,EAAMgB,QAAQC,QAAQC,MAC7BQ,QAAS,IAEXC,gBAAiB,CACf/B,QAAS,EACT,qBAAsB,CACpBL,MAAOS,EAAMgB,QAAQC,QAAQE,QAGjCS,YAAa,CACX1B,MAAO,OACPI,QAAS,O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