@gen3/frontend 0.12.45 → 0.12.46

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.
Files changed (54) hide show
  1. package/dist/dts/features/Workspace/WorkspaceNotebook.d.ts +1 -1
  2. package/dist/dts/features/Workspace/WorkspaceNotebook.d.ts.map +1 -1
  3. package/dist/dts/features/Workspace/WorkspaceNotebook.js +69 -5
  4. package/dist/dts/features/Workspace/WorkspaceNotebook.js.map +1 -1
  5. package/dist/dts/index.d.ts +2 -1
  6. package/dist/dts/index.d.ts.map +1 -1
  7. package/dist/dts/index.js +2 -1
  8. package/dist/dts/index.js.map +1 -1
  9. package/dist/dts/lib/session/constants.d.ts +2 -0
  10. package/dist/dts/lib/session/constants.d.ts.map +1 -0
  11. package/dist/dts/lib/session/constants.js +2 -0
  12. package/dist/dts/lib/session/constants.js.map +1 -0
  13. package/dist/dts/lib/session/session.d.ts.map +1 -1
  14. package/dist/dts/lib/session/session.js +1 -1
  15. package/dist/dts/lib/session/session.js.map +1 -1
  16. package/dist/index/cjs/QueryPanel-C6_EtaDO.js +39 -0
  17. package/dist/index/cjs/QueryPanel-C6_EtaDO.js.map +1 -0
  18. package/dist/index/cjs/QueryPanel-Dpn_GGDU.js +39 -0
  19. package/dist/index/cjs/QueryPanel-Dpn_GGDU.js.map +1 -0
  20. package/dist/index/cjs/index-CSXtX5eA.js +38902 -0
  21. package/dist/index/cjs/index-CSXtX5eA.js.map +1 -0
  22. package/dist/index/cjs/index-rCd246Nh.js +38893 -0
  23. package/dist/index/cjs/index-rCd246Nh.js.map +1 -0
  24. package/dist/index/cjs/index.js +2 -1
  25. package/dist/index/cjs/index.js.map +1 -1
  26. package/dist/index/esm/QueryPanel-BFecvXaF.js +37 -0
  27. package/dist/index/esm/QueryPanel-BFecvXaF.js.map +1 -0
  28. package/dist/index/esm/QueryPanel-DZ_DkGW8.js +37 -0
  29. package/dist/index/esm/QueryPanel-DZ_DkGW8.js.map +1 -0
  30. package/dist/index/esm/index-C2wxUU0I.js +38645 -0
  31. package/dist/index/esm/index-C2wxUU0I.js.map +1 -0
  32. package/dist/index/esm/index-XWpB4JSs.js +38636 -0
  33. package/dist/index/esm/index-XWpB4JSs.js.map +1 -0
  34. package/dist/index/esm/index.js +1 -1
  35. package/dist/index.d.ts +3 -1
  36. package/dist/pages/cjs/CohortBuilder-DSb4NbaV.js +570 -0
  37. package/dist/pages/cjs/CohortBuilder-DSb4NbaV.js.map +1 -0
  38. package/dist/pages/cjs/CohortBuilder-DZfy_UsD.js +570 -0
  39. package/dist/pages/cjs/CohortBuilder-DZfy_UsD.js.map +1 -0
  40. package/dist/pages/cjs/index-BoO7NZz4.js +29027 -0
  41. package/dist/pages/cjs/index-BoO7NZz4.js.map +1 -0
  42. package/dist/pages/cjs/index-LxlqqT9v.js +29018 -0
  43. package/dist/pages/cjs/index-LxlqqT9v.js.map +1 -0
  44. package/dist/pages/cjs/index.js +1 -1
  45. package/dist/pages/esm/CohortBuilder-BtRdgox5.js +567 -0
  46. package/dist/pages/esm/CohortBuilder-BtRdgox5.js.map +1 -0
  47. package/dist/pages/esm/CohortBuilder-CRvBOJOa.js +567 -0
  48. package/dist/pages/esm/CohortBuilder-CRvBOJOa.js.map +1 -0
  49. package/dist/pages/esm/index-BM37HQIq.js +28942 -0
  50. package/dist/pages/esm/index-BM37HQIq.js.map +1 -0
  51. package/dist/pages/esm/index-CaxiVweb.js +28933 -0
  52. package/dist/pages/esm/index-CaxiVweb.js.map +1 -0
  53. package/dist/pages/esm/index.js +1 -1
  54. package/package.json +5 -5
@@ -1,4 +1,4 @@
1
- export { A as AISearchPageGetServerSideProps, a as AccessLevel, b as AccordionPanel, c as ActionBar, d as ActionButton, e as AdminAuthZPageGetServerSideProps, f as AiSearch, g as AiSearchPage, h as AnalysisCenter, i as AnalysisCenterWithSections, j as AnalysisEditorPage, k as AnalysisEditorPageGetServerSideProps, l as AnalysisPage, m as AnalysisPageGetServerSideProps, n as AuthzPage, B as BAD_DATA_MESSAGE, o as Banner, p as BaseModal, C as CardContainer, q as Charts, r as ClinicalDataAnalysisPage, s as ClinicalDataAnalysisServerSideProps, t as CohortActionButton, u as CohortBuilder, v as CohortDropdownActionButton, w as CohortManager, x as CohortManagerAndExpression, y as CollapsableCharts, z as CollapsableSidebar, D as ColorThemePage, E as ColorThemePageGetServerSideProps, F as ContentSource, G as CountsValue, H as CreateCredentialsAPIKeyModal, I as CrosswalkPage, J as CrosswalkPageGetServerSideProps, K as Custom403Page, L as Custom403PageGetServerSideProps, M as Custom404Page, N as Custom404PageGetServerSideProps, O as DAYS_IN_YEAR, P as DEFAULT_MAXIMUM, Q as DEFAULT_MINIMUM, R as DEFAULT_VISIBLE_ITEMS, S as DataDictionaryPage, T as DataLibraryPage, U as DataLibraryPageGetServerSideProps, V as DefaultAuthorizedRoutesConfig, W as DictionaryPageGetServerSideProps, X as DictionaryWithContext, Y as DiscoveryCellRendererFactory, Z as DiscoveryConfigProvider, _ as DiscoveryIndexPanel, $ as DiscoveryPage, a0 as DiscoveryPageGetServerSideProps, a1 as DownloadButton, a2 as DownloadsPanel, a3 as DropdownButton, a4 as DropdownPanel, a5 as DropdownWithIcon, a6 as EmptyTableMessage, a7 as EnumFacet, a8 as EnumFacetChart, a9 as ErrorCard, aa as ExactValueFacet, ab as ExplorerPage, ac as ExplorerPageGetServerSideProps, ad as ExplorerPageGetServerSidePropsForConfigId, ae as ExplorerTable, af as ExplorerTableCellRendererFactory, ag as ExplorerTableDetailsPanelFactory, ah as FacetControlsHeader, ai as FacetExpander, aj as FacetSelector, ak as FacetSortPanel, al as FacetTabs, am as FileSummary, an as FiltersPanel, ao as FirstTimeModal, ap as Footer, aq as Gen3Button, ar as Gen3ButtonReverse, as as Gen3Link, at as Gen3ModalsProvider, au as Gen3Provider, av as GqlQueryEditor, aw as Header, ax as HoverLink, ay as IconButton, az as InfoRolloverButton, aA as JSONObjectDownloadButton, aB as LandingPage, aC as LandingPageGetServerSideProps, aD as LoginButton, aE as LoginPage, aF as LoginPageGetServerSideProps, aG as LoginPanel, aH as LoginProvidersPanel, aI as MessageCard, aJ as MessagePage, aK as MetadataDictionary, aL as MinutesToMilliseconds, aM as MultiSelectValueFacet, aN as NavPageLayout, aO as NavigationBar, aP as NavigationButton, aQ as NavigationRail, aR as NoAccessModal, aS as NotebookLitePage, aT as NotebookLitePageGetStaticProps, aU as OverflowTooltippedLabel, aV as PanelErrorBoundary, aW as Profile, aX as ProfilePage, aY as ProfilePageGetServerSideProps, aZ as ProfileProvider, a_ as ProtectedContent, a$ as ProtectedContentUI, b0 as ProtectedOverlay, b1 as QueryExpression, b2 as QueryExpressionContext, b3 as QueryExpressionSection, b4 as QueryPage, b5 as QueryPageGetServerSideProps, b6 as RangeFacet, b7 as ReactECharts, b8 as Repository, b9 as RepositoryPage, ba as RepositoryPageGetServerSideProps, bb as ResourcesFilters, bc as SPECIAL_CASE_FIELDS, bd as SegmentedControl, be as SessionExpiredModal, bf as SinglePageStudyDetailsPanel, bg as StaticNotebookIFrame, bh as StudyDetailsPanel, bi as StudyGroup, bj as StudyGroupPanel, bk as StudyProvider, bl as SubmissionPage, bm as SubmissionPageGetServerSideProps, bn as TabbedCohortBuilder, bo as TabbedCohortBuilderPage, bp as TabbedCohortBuilderPageGetServerSideProps, bq as TabbedPanel, br as TableXPositionContext, bs as TagCloud, bt as TailwindConfig, bu as TopBar, bv as UploadJSONButton, bw as User, bx as WarningCard, by as Workspace, bz as WorkspaceNoAccessPage, bA as WorkspaceNoAccessPageServerSideProps, bB as WorkspacePage, bC as WorkspacePageGetServerSideProps, bD as accessibleFieldName, bE as addIntersectionToIncludes, bF as addUnion, bG as analysisApiCohortDiscovery, bH as capitalize, bI as classifyFacets, bJ as compareKeysAscending, bK as compareKeysDescending, bL as computeRowSpan, bM as convertMinutesToMilliseconds, bN as convertPathsToTree, bO as convertSecondsToMilliseconds, bP as convertToStringArray, bQ as createCSSVariables, bR as createLabelFromHistogramData, bS as createMantineTheme, bT as credentialsLogin, bU as credentialsLogout, bV as extractObjectKey, bW as extractRangeValues, bX as filterAggregationsDataKeys, bY as focusStyles, bZ as gen3Modals, b_ as getAllFieldsFromFilterConfigs, b$ as getByPath, c0 as getCurrentUnixTimestamp, c1 as getFormattedTimestamp, c2 as getHighResolutionTimestamp, c3 as getNavPageLayoutPropsFromConfig, c4 as getParamsValueAsString, c5 as getTagInfo, c6 as hasOwnProperty, c7 as isArrayOfString, c8 as isEnumFacetResponse, c9 as isHeaderMetadata, ca as isPropertyKey, cb as isTextTransform, cc as isTimeGreaterThan, cd as itemsInCart, ce as mapFacetSortToSortType, cf as measureExecutionTime, cg as mergeDefaultTailwindClassnames, ch as processBucketData, ci as processDefinedRangeData, cj as processLabel, ck as processRangeData, cl as processRangeKeyLabel, cm as registerCohortBuilderDefaultPreviewRenderers, cn as registerCohortDiscoveryApp, co as registerCohortSimilarityApp, cp as registerDefaultDiscoveryDataLoaders, cq as registerDiscoveryDefaultCellRenderers, cr as registerDownloadButtonAction, cs as registerExplorerDefaultCellRenderers, ct as registerIGVApp, cu as registerMetadataSchemaApp, cv as removeIntersectionFromEnum, cw as removeKey, cx as removeMultipleSlashes, cy as removeUnion, cz as resourcePathFromProjectID, cA as sessionLogout, cB as sessionToken, cC as stripTrailingSlash, cD as toDisplayName, cE as truncateString, cF as unixTimeToString, cG as updateFacetEnum, cH as useClearFilters, cI as useDiscoveryContext, cJ as useExtractEnumFilterValues, cK as useExtractRangeFilterValues, cL as useFieldNameToLabel, cM as useGetFacetFilters, cN as useGuppyActionButton, cO as useUpdateFilters, cP as useUpdateFiltersFlat, cQ as userHasMethodForServiceOnResource, cR as validateObjectHasRequiredFields } from './index-DQaSrL6f.js';
1
+ export { A as ACTIVITY_CHANNEL, a as AISearchPageGetServerSideProps, b as AccessLevel, c as AccordionPanel, d as ActionBar, e as ActionButton, f as AdminAuthZPageGetServerSideProps, g as AiSearch, h as AiSearchPage, i as AnalysisCenter, j as AnalysisCenterWithSections, k as AnalysisEditorPage, l as AnalysisEditorPageGetServerSideProps, m as AnalysisPage, n as AnalysisPageGetServerSideProps, o as AuthzPage, B as BAD_DATA_MESSAGE, p as Banner, q as BaseModal, C as CardContainer, r as Charts, s as ClinicalDataAnalysisPage, t as ClinicalDataAnalysisServerSideProps, u as CohortActionButton, v as CohortBuilder, w as CohortDropdownActionButton, x as CohortManager, y as CohortManagerAndExpression, z as CollapsableCharts, D as CollapsableSidebar, E as ColorThemePage, F as ColorThemePageGetServerSideProps, G as ContentSource, H as CountsValue, I as CreateCredentialsAPIKeyModal, J as CrosswalkPage, K as CrosswalkPageGetServerSideProps, L as Custom403Page, M as Custom403PageGetServerSideProps, N as Custom404Page, O as Custom404PageGetServerSideProps, P as DAYS_IN_YEAR, Q as DEFAULT_MAXIMUM, R as DEFAULT_MINIMUM, S as DEFAULT_VISIBLE_ITEMS, T as DataDictionaryPage, U as DataLibraryPage, V as DataLibraryPageGetServerSideProps, W as DefaultAuthorizedRoutesConfig, X as DictionaryPageGetServerSideProps, Y as DictionaryWithContext, Z as DiscoveryCellRendererFactory, _ as DiscoveryConfigProvider, $ as DiscoveryIndexPanel, a0 as DiscoveryPage, a1 as DiscoveryPageGetServerSideProps, a2 as DownloadButton, a3 as DownloadsPanel, a4 as DropdownButton, a5 as DropdownPanel, a6 as DropdownWithIcon, a7 as EmptyTableMessage, a8 as EnumFacet, a9 as EnumFacetChart, aa as ErrorCard, ab as ExactValueFacet, ac as ExplorerPage, ad as ExplorerPageGetServerSideProps, ae as ExplorerPageGetServerSidePropsForConfigId, af as ExplorerTable, ag as ExplorerTableCellRendererFactory, ah as ExplorerTableDetailsPanelFactory, ai as FacetControlsHeader, aj as FacetExpander, ak as FacetSelector, al as FacetSortPanel, am as FacetTabs, an as FileSummary, ao as FiltersPanel, ap as FirstTimeModal, aq as Footer, ar as Gen3Button, as as Gen3ButtonReverse, at as Gen3Link, au as Gen3ModalsProvider, av as Gen3Provider, aw as GqlQueryEditor, ax as Header, ay as HoverLink, az as IconButton, aA as InfoRolloverButton, aB as JSONObjectDownloadButton, aC as LandingPage, aD as LandingPageGetServerSideProps, aE as LoginButton, aF as LoginPage, aG as LoginPageGetServerSideProps, aH as LoginPanel, aI as LoginProvidersPanel, aJ as MessageCard, aK as MessagePage, aL as MetadataDictionary, aM as MinutesToMilliseconds, aN as MultiSelectValueFacet, aO as NavPageLayout, aP as NavigationBar, aQ as NavigationButton, aR as NavigationRail, aS as NoAccessModal, aT as NotebookLitePage, aU as NotebookLitePageGetStaticProps, aV as OverflowTooltippedLabel, aW as PanelErrorBoundary, aX as Profile, aY as ProfilePage, aZ as ProfilePageGetServerSideProps, a_ as ProfileProvider, a$ as ProtectedContent, b0 as ProtectedContentUI, b1 as ProtectedOverlay, b2 as QueryExpression, b3 as QueryExpressionContext, b4 as QueryExpressionSection, b5 as QueryPage, b6 as QueryPageGetServerSideProps, b7 as RangeFacet, b8 as ReactECharts, b9 as Repository, ba as RepositoryPage, bb as RepositoryPageGetServerSideProps, bc as ResourcesFilters, bd as SPECIAL_CASE_FIELDS, be as SegmentedControl, bf as SessionExpiredModal, bg as SinglePageStudyDetailsPanel, bh as StaticNotebookIFrame, bi as StudyDetailsPanel, bj as StudyGroup, bk as StudyGroupPanel, bl as StudyProvider, bm as SubmissionPage, bn as SubmissionPageGetServerSideProps, bo as TabbedCohortBuilder, bp as TabbedCohortBuilderPage, bq as TabbedCohortBuilderPageGetServerSideProps, br as TabbedPanel, bs as TableXPositionContext, bt as TagCloud, bu as TailwindConfig, bv as TopBar, bw as UploadJSONButton, bx as User, by as WarningCard, bz as Workspace, bA as WorkspaceNoAccessPage, bB as WorkspaceNoAccessPageServerSideProps, bC as WorkspacePage, bD as WorkspacePageGetServerSideProps, bE as accessibleFieldName, bF as addIntersectionToIncludes, bG as addUnion, bH as analysisApiCohortDiscovery, bI as capitalize, bJ as classifyFacets, bK as compareKeysAscending, bL as compareKeysDescending, bM as computeRowSpan, bN as convertMinutesToMilliseconds, bO as convertPathsToTree, bP as convertSecondsToMilliseconds, bQ as convertToStringArray, bR as createCSSVariables, bS as createLabelFromHistogramData, bT as createMantineTheme, bU as credentialsLogin, bV as credentialsLogout, bW as extractObjectKey, bX as extractRangeValues, bY as filterAggregationsDataKeys, bZ as focusStyles, b_ as gen3Modals, b$ as getAllFieldsFromFilterConfigs, c0 as getByPath, c1 as getCurrentUnixTimestamp, c2 as getFormattedTimestamp, c3 as getHighResolutionTimestamp, c4 as getNavPageLayoutPropsFromConfig, c5 as getParamsValueAsString, c6 as getTagInfo, c7 as hasOwnProperty, c8 as isArrayOfString, c9 as isEnumFacetResponse, ca as isHeaderMetadata, cb as isPropertyKey, cc as isTextTransform, cd as isTimeGreaterThan, ce as itemsInCart, cf as mapFacetSortToSortType, cg as measureExecutionTime, ch as mergeDefaultTailwindClassnames, ci as processBucketData, cj as processDefinedRangeData, ck as processLabel, cl as processRangeData, cm as processRangeKeyLabel, cn as registerCohortBuilderDefaultPreviewRenderers, co as registerCohortDiscoveryApp, cp as registerCohortSimilarityApp, cq as registerDefaultDiscoveryDataLoaders, cr as registerDiscoveryDefaultCellRenderers, cs as registerDownloadButtonAction, ct as registerExplorerDefaultCellRenderers, cu as registerIGVApp, cv as registerMetadataSchemaApp, cw as removeIntersectionFromEnum, cx as removeKey, cy as removeMultipleSlashes, cz as removeUnion, cA as resourcePathFromProjectID, cB as sessionLogout, cC as sessionToken, cD as stripTrailingSlash, cE as toDisplayName, cF as truncateString, cG as unixTimeToString, cH as updateFacetEnum, cI as useClearFilters, cJ as useDiscoveryContext, cK as useExtractEnumFilterValues, cL as useExtractRangeFilterValues, cM as useFieldNameToLabel, cN as useGetFacetFilters, cO as useGuppyActionButton, cP as useUpdateFilters, cQ as useUpdateFiltersFlat, cR as userHasMethodForServiceOnResource, cS as validateObjectHasRequiredFields } from './index-C2wxUU0I.js';
2
2
  import '@gen3/core';
3
3
  import 'react/jsx-runtime';
4
4
  import 'react';
package/dist/index.d.ts CHANGED
@@ -2900,6 +2900,8 @@ type NavigationRailProps = {
2900
2900
  };
2901
2901
  declare const NavigationRail: ({ items, label, defaultValue, width, collapsedWidth, expanded, onExpandChange, }: NavigationRailProps) => react_jsx_runtime.JSX.Element;
2902
2902
 
2903
+ declare const ACTIVITY_CHANNEL = "gen3-user-activity";
2904
+
2903
2905
  declare const WarningCard: React__default.FunctionComponent<MessageTextProps>;
2904
2906
 
2905
2907
  interface CardContainerProps {
@@ -3398,5 +3400,5 @@ declare const FileSummary: ({ guid }: {
3398
3400
  guid: string;
3399
3401
  }) => react_jsx_runtime.JSX.Element;
3400
3402
 
3401
- export { AISearchPageGetServerSideProps, AccessLevel, AccordionPanel, ActionBar, ActionButton, AdminAuthZPageGetServerSideProps, AiSearch, AISearchPage as AiSearchPage, AnalysisCenter, AnalysisCenterWithSections, AnalysisEditorPage, AnalysisEditorPageGetServerSideProps, AnalysisPage, AnalysisPageGetServerSideProps, AuthzPage, BAD_DATA_MESSAGE, Banner, BaseModal, CardContainer, Charts, ClinicalDataAnalysisPage, ClinicalDataAnalysisServerSideProps, _default$1 as CohortActionButton, CohortBuilder, _default as CohortDropdownActionButton, CohortManager, CohortManagerAndExpression, CollapsableCharts, CollapsableSidebar, ColorThemePage, ColorThemePageGetServerSideProps, _default$2 as ContentSource, CountsValue, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom403Page, Custom403PageGetServerSideProps, Custom404Page, Custom404PageGetServerSideProps, DAYS_IN_YEAR, DEFAULT_MAXIMUM, DEFAULT_MINIMUM, DEFAULT_VISIBLE_ITEMS, DictionaryPage as DataDictionaryPage, DataLibraryPage, DataLibraryPageGetServerSideProps, DefaultAuthorizedRoutesConfig, DictionaryPageGetServerSideProps, DictionaryWithContext, DiscoveryCellRendererFactory, DiscoveryProvider as DiscoveryConfigProvider, DiscoveryIndexPanel, DiscoveryPage, DiscoveryPageGetServerSideProps, DownloadButton, DownloadsPanel, DropdownButton, DropdownPanel, DropdownWithIcon, EmptyTableMessage, EnumFacet, EnumFacetChart, ErrorCard, ExactValueFacet, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerPageGetServerSidePropsForConfigId, ExplorerTable, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FacetControlsHeader, FacetExpander, FacetSelector, FacetSortPanel, FacetTabs, FileSummary, FiltersPanel, FirstTimeModal, Footer, Gen3Button, Gen3ButtonReverse, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor, Header, HoverLink, IconButton, InfoRolloverButton, JSONObjectDownloadButton, LandingPage, LandingPageGetServerSideProps, LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, MessageCard, MessagePage, MetadataDictionary, MinutesToMilliseconds, MultiSelectValueFacet, NavPageLayout, NavigationBar, NavigationButton, NavigationRail, NoAccessModal, NotebookLitePage, NotebookLitePageGetStaticProps, OverflowTooltippedLabel, PanelErrorBoundary, Profile, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, ProtectedContent, ProtectedContentUI, ProtectedOverlay, QueryExpression, QueryExpressionContext, QueryExpressionSection, QueryPage, QueryPageGetServerSideProps, RangeFacet, ReactECharts, Repository, RepositoryPage, RepositoryPageGetServerSideProps, ResourcesFilters, SPECIAL_CASE_FIELDS, SegmentedControl, SessionExpiredModal, SinglePageStudyDetailsPanel, StaticNotebookIFrame, StudyDetailsPanel, StudyGroup, StudyGroupPanel, StudyProvider, SubmissionPage, SubmissionPageGetServerSideProps, TabbedCohortBuilder, TabbedCohortBuilderPage, TabbedCohortBuilderPageGetServerSideProps, TabbedPanel, TableXPositionContext, TagCloud, TailwindConfig, TopBar, UploadJSONButton, User$1 as User, WarningCard, Workspace, WorkspaceNoAccessPage, WorkspaceNoAccessPageServerSideProps, WorkspacePage, WorkspacePageGetServerSideProps, accessibleFieldName, addIntersectionToIncludes, addUnion, export_default as analysisApiCohortDiscovery, capitalize, classifyFacets, compareKeysAscending, compareKeysDescending, computeRowSpan, convertMinutesToMilliseconds, convertPathsToTree, convertSecondsToMilliseconds, convertToStringArray, createCSSVariables, createLabelFromHistogramData, createMantineTheme, export_default$2 as credentialsLogin, export_default$1 as credentialsLogout, extractObjectKey, extractRangeValues, filterAggregationsDataKeys, focusStyles, gen3Modals, getAllFieldsFromFilterConfigs, getByPath, getCurrentUnixTimestamp, getFormattedTimestamp, getHighResolutionTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isEnumFacetResponse, isHeaderMetadata, isPropertyKey, isTextTransform, isTimeGreaterThan, itemsInCart, mapFacetSortToSortType, measureExecutionTime, mergeDefaultTailwindClassnames, processBucketData, processDefinedRangeData, processLabel, processRangeData, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerCohortDiscoveryApp, registerCohortSimilarityApp, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDownloadButtonAction, registerExplorerDefaultCellRenderers, registerIGVApp, registerMetadataSchemaApp, removeIntersectionFromEnum, removeKey, removeMultipleSlashes, removeUnion, resourcePathFromProjectID, export_default$3 as sessionLogout, handler as sessionToken, stripTrailingSlash, toDisplayName, truncateString, unixTimeToString, updateFacetEnum, useClearFilters, useDiscoveryContext, useExtractEnumFilterValues, useExtractRangeFilterValues, useFieldNameToLabel, useGetFacetFilters, useGuppyActionButton, useUpdateFilters, useUpdateFiltersFlat, userHasMethodForServiceOnResource, validateObjectHasRequiredFields };
3403
+ export { ACTIVITY_CHANNEL, AISearchPageGetServerSideProps, AccessLevel, AccordionPanel, ActionBar, ActionButton, AdminAuthZPageGetServerSideProps, AiSearch, AISearchPage as AiSearchPage, AnalysisCenter, AnalysisCenterWithSections, AnalysisEditorPage, AnalysisEditorPageGetServerSideProps, AnalysisPage, AnalysisPageGetServerSideProps, AuthzPage, BAD_DATA_MESSAGE, Banner, BaseModal, CardContainer, Charts, ClinicalDataAnalysisPage, ClinicalDataAnalysisServerSideProps, _default$1 as CohortActionButton, CohortBuilder, _default as CohortDropdownActionButton, CohortManager, CohortManagerAndExpression, CollapsableCharts, CollapsableSidebar, ColorThemePage, ColorThemePageGetServerSideProps, _default$2 as ContentSource, CountsValue, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom403Page, Custom403PageGetServerSideProps, Custom404Page, Custom404PageGetServerSideProps, DAYS_IN_YEAR, DEFAULT_MAXIMUM, DEFAULT_MINIMUM, DEFAULT_VISIBLE_ITEMS, DictionaryPage as DataDictionaryPage, DataLibraryPage, DataLibraryPageGetServerSideProps, DefaultAuthorizedRoutesConfig, DictionaryPageGetServerSideProps, DictionaryWithContext, DiscoveryCellRendererFactory, DiscoveryProvider as DiscoveryConfigProvider, DiscoveryIndexPanel, DiscoveryPage, DiscoveryPageGetServerSideProps, DownloadButton, DownloadsPanel, DropdownButton, DropdownPanel, DropdownWithIcon, EmptyTableMessage, EnumFacet, EnumFacetChart, ErrorCard, ExactValueFacet, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerPageGetServerSidePropsForConfigId, ExplorerTable, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FacetControlsHeader, FacetExpander, FacetSelector, FacetSortPanel, FacetTabs, FileSummary, FiltersPanel, FirstTimeModal, Footer, Gen3Button, Gen3ButtonReverse, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor, Header, HoverLink, IconButton, InfoRolloverButton, JSONObjectDownloadButton, LandingPage, LandingPageGetServerSideProps, LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, MessageCard, MessagePage, MetadataDictionary, MinutesToMilliseconds, MultiSelectValueFacet, NavPageLayout, NavigationBar, NavigationButton, NavigationRail, NoAccessModal, NotebookLitePage, NotebookLitePageGetStaticProps, OverflowTooltippedLabel, PanelErrorBoundary, Profile, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, ProtectedContent, ProtectedContentUI, ProtectedOverlay, QueryExpression, QueryExpressionContext, QueryExpressionSection, QueryPage, QueryPageGetServerSideProps, RangeFacet, ReactECharts, Repository, RepositoryPage, RepositoryPageGetServerSideProps, ResourcesFilters, SPECIAL_CASE_FIELDS, SegmentedControl, SessionExpiredModal, SinglePageStudyDetailsPanel, StaticNotebookIFrame, StudyDetailsPanel, StudyGroup, StudyGroupPanel, StudyProvider, SubmissionPage, SubmissionPageGetServerSideProps, TabbedCohortBuilder, TabbedCohortBuilderPage, TabbedCohortBuilderPageGetServerSideProps, TabbedPanel, TableXPositionContext, TagCloud, TailwindConfig, TopBar, UploadJSONButton, User$1 as User, WarningCard, Workspace, WorkspaceNoAccessPage, WorkspaceNoAccessPageServerSideProps, WorkspacePage, WorkspacePageGetServerSideProps, accessibleFieldName, addIntersectionToIncludes, addUnion, export_default as analysisApiCohortDiscovery, capitalize, classifyFacets, compareKeysAscending, compareKeysDescending, computeRowSpan, convertMinutesToMilliseconds, convertPathsToTree, convertSecondsToMilliseconds, convertToStringArray, createCSSVariables, createLabelFromHistogramData, createMantineTheme, export_default$2 as credentialsLogin, export_default$1 as credentialsLogout, extractObjectKey, extractRangeValues, filterAggregationsDataKeys, focusStyles, gen3Modals, getAllFieldsFromFilterConfigs, getByPath, getCurrentUnixTimestamp, getFormattedTimestamp, getHighResolutionTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isEnumFacetResponse, isHeaderMetadata, isPropertyKey, isTextTransform, isTimeGreaterThan, itemsInCart, mapFacetSortToSortType, measureExecutionTime, mergeDefaultTailwindClassnames, processBucketData, processDefinedRangeData, processLabel, processRangeData, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerCohortDiscoveryApp, registerCohortSimilarityApp, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDownloadButtonAction, registerExplorerDefaultCellRenderers, registerIGVApp, registerMetadataSchemaApp, removeIntersectionFromEnum, removeKey, removeMultipleSlashes, removeUnion, resourcePathFromProjectID, export_default$3 as sessionLogout, handler as sessionToken, stripTrailingSlash, toDisplayName, truncateString, unixTimeToString, updateFacetEnum, useClearFilters, useDiscoveryContext, useExtractEnumFilterValues, useExtractRangeFilterValues, useFieldNameToLabel, useGetFacetFilters, useGuppyActionButton, useUpdateFilters, useUpdateFiltersFlat, userHasMethodForServiceOnResource, validateObjectHasRequiredFields };
3402
3404
  export type { AnalysisCenterSection, AnalysisCenterWithSectionsConfiguration, AnalysisPageLayoutProps, AnalysisToolConfiguration, AuthorizationValues, AuthorizedRoutesConfig, BannerLevelCategories, BannerProps, CellRenderFunctionProps, CellRendererFunctionProps, ChartProps, ClearFacetFunction, ClearFacetHook, ClearIndexedFacetFunction, CohortBuilderCategoryConfig, CohortBuilderConfiguration, CohortBuilderProps, CohortBuilderTabCategoryConfig, CohortPanelConfiguration, CollapsableChartsPanelConfiguration, ConfigVersionAndName, CustomFacetHooks, DataAuthorization, DataDictionary, DataTypeConfigWithManifest, DictionaryConfig, DictionaryNode, DictionaryProps, DiscoveryConfig, DownloadButtonConfig, DropdownsWithButtonsProps, EnumChartProps, EnumFacetData, EnumFacetDataChangedFunction, EnumFacetDataHooks, EnumFacetResponse, EnumOperandValue, ExplorerPageProps, FacetCardProps, FacetCommonHooks, FacetDataFunctionType, FacetDataHooks, FacetHooks, FacetRequiredHooks, FacetResponse, FacetSortType, FacetValueLabel, FieldToName, Fonts, FooterProps, FromToRange, FromToRangeValues, Gen3AppConfigData, GetEnumFacetDataFunction, GetFacetCombineModeFunction, GetFacetDataFunction, GetNumericRangeFacetDataFunction, GetRangeFacetDataFunction, GetRangeFacetWithDefinedRangesDataFunction, GetTotalCountsFunction, HeaderMetadata, HeaderProps, InfoRolloverButtonProps, LoginConfig, ModalsConfig, NavPageLayoutProps, NavigationProps, NavigationRailItem, NumericFacetCardProps, NumericFacetProps, NumericRangeFacetHooks, NumericUnits, ProfileConfig, QueryConfiguration, QueryOptions, QueryPageLayoutProps, RangeBucketElement, RangeFacetDataHooks, RangeFacetResponse, RangeFromOp, RangeToOp, ReactEChartsProps, RegisteredIcons, RepositoryConfiguration, RouteConfig, SelectFacetFilterFunction, SelectedFields$1 as SelectedFields, SessionConfiguration, SetFacetCombineModeFunction, SortBy, SortType, StudyDetailsField, StylingMergeMode, StylingOverride, StylingOverrideWithMergeControl, SummaryChart, SummaryTable, TabConfig, TabbedCohortBuilderConfiguration, TabbedCohortBuilderFacetConfig, TableDetailsPanelProps, TabsConfig, TagData, TagsConfig, TenStringArray, TitleAndDescription, ToggleFacetDataHooks, TopBarProps, TopIconButtonPropsWithLink, UpdateFacetFilterFunction, UpdateFacetFilterHook, UploadFacetDataHooks, UserAuthMapping, WorkspaceConfig, fieldNameToLabelFunction };
@@ -0,0 +1,570 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var useDeepCompare = require('use-deep-compare');
6
+ var core$1 = require('@mantine/core');
7
+ var _ = require('lodash');
8
+ var core = require('@gen3/core');
9
+ var index = require('./index-BoO7NZz4.js');
10
+ require('echarts');
11
+ var hooks = require('@mantine/hooks');
12
+ require('victory');
13
+ require('react-icons/bs');
14
+ require('react-icons/io');
15
+ require('@mantine/form');
16
+ require('react-icons/md');
17
+ require('react-icons/ri');
18
+ require('react-icons/fa');
19
+ require('react-icons/pi');
20
+ require('@iconify-icon/react');
21
+ require('@mantine/modals');
22
+ require('tailwind-merge');
23
+ require('next/navigation');
24
+ require('next/image');
25
+ require('next/link');
26
+ require('next/router');
27
+ require('cookies-next');
28
+ require('swr');
29
+ require('jose');
30
+ require('cookie');
31
+ require('@gen3/core/server');
32
+ require('@mantine/notifications');
33
+ require('react-markdown');
34
+ require('react-icons/ai');
35
+ require('next/head');
36
+ require('remark-gfm');
37
+ require('rehype-sanitize');
38
+ require('fs');
39
+ require('path');
40
+ require('mantine-react-table-open');
41
+ require('react-icons/ti');
42
+ require('react-icons/fi');
43
+ require('react-minisearch');
44
+ require('minisearch');
45
+ require('file-saver');
46
+ require('tailwind-styled-components');
47
+ require('jsonpath-plus');
48
+ require('react-icons/lu');
49
+ require('react-dom');
50
+ require('lodash/uniq');
51
+ require('lodash/sum');
52
+ require('react-icons/fa6');
53
+ require('@tanstack/react-table');
54
+ require('@theothergothamdev/pluralize-ts');
55
+ require('next/dynamic');
56
+ require('react-cookie');
57
+ require('default-composer');
58
+ require('filesize');
59
+ require('@dnd-kit/core');
60
+ require('@dnd-kit/sortable');
61
+ require('@dnd-kit/utilities');
62
+ require('@dnd-kit/modifiers');
63
+ require('universal-cookie');
64
+
65
+ const toDisplayName = (field)=>{
66
+ const parsed = field.split('.');
67
+ const fieldName = parsed.at(-1);
68
+ if (!fieldName) return 'NotSet';
69
+ return fieldName.split('_').map((w)=>_.capitalize(w)).join(' ');
70
+ };
71
+
72
+ /**
73
+ * Hook that sets up an event bus for components to subscribe to and fire off events
74
+ * when an active Sower job is completed.
75
+ */ const useSowerJobEventBus = ()=>{
76
+ const [listeners, setListeners] = React.useState({});
77
+ const [pollers, setPollers] = React.useState(new Set());
78
+ const [trigger, statusResult] = core.useLazyGetMultipleSowerJobStatusQuery({
79
+ pollingInterval: 10000,
80
+ skipPollingIfUnfocused: true
81
+ });
82
+ /**
83
+ * Function for component to subscribe to sower job updates
84
+ * @param listenerKey unique key for component
85
+ * @param newPollers list of jobs to poll the status of
86
+ * @param callback function to call when a job completes
87
+ */ const on = (listenerKey, newPollers, callback)=>{
88
+ setListeners({
89
+ ...listeners,
90
+ [listenerKey]: callback
91
+ });
92
+ setPollers(new Set([
93
+ ...pollers,
94
+ ...newPollers
95
+ ]));
96
+ };
97
+ /**
98
+ * Function for component to unsubscribe to updates
99
+ * @param listenerKey unique key for component
100
+ */ const off = (listenerKey)=>{
101
+ setListeners(Object.fromEntries(Object.entries(listeners).filter(([key])=>key === listenerKey)));
102
+ };
103
+ /**
104
+ * Function to update the jobs that are polling
105
+ * @param job new job to add to pollers
106
+ */ const update = (job)=>{
107
+ setPollers(new Set([
108
+ ...pollers,
109
+ job
110
+ ]));
111
+ };
112
+ React.useEffect(()=>{
113
+ trigger(Array.from(pollers));
114
+ }, [
115
+ pollers
116
+ ]);
117
+ React.useEffect(()=>{
118
+ if (statusResult.isSuccess) {
119
+ Object.entries(statusResult.currentData || {}).map(([job, response])=>{
120
+ if (response.status === 'Completed') {
121
+ Object.values(listeners).forEach((callback)=>callback(job));
122
+ // Remove job from pollers after it has completed
123
+ setPollers(new Set([
124
+ ...pollers
125
+ ].filter((poller)=>poller !== job)));
126
+ }
127
+ });
128
+ }
129
+ }, [
130
+ statusResult
131
+ ]);
132
+ return {
133
+ on,
134
+ off,
135
+ update
136
+ };
137
+ };
138
+
139
+ const EmptyData = {};
140
+ /**
141
+ * CohortPanel is a React component that provides an interactive interface for cohort exploration and filtering.
142
+ * It integrates with data services and facilitates visualization, filtering, and analysis tasks.
143
+ *
144
+ * @param {Object} props The properties required to configure the CohortPanel component.
145
+ * @param {Object} props.guppyConfig Configuration object for Guppy, including field mappings and data type information.
146
+ * @param {Object} props.filters Configuration for filter tabs, including filter fields and layout.
147
+ * @param {Object} [props.charts={}] Optional set of chart configuration objects for rendering summaries.
148
+ * @param {Object} [props.chartsSection] Optional configuration for an additional section of charts.
149
+ * @param {Object} props.table Reference to the table configuration or component for displaying data.
150
+ * @param {string} props.tabTitle Title for the filter tab section.
151
+ * @param {Object[]|undefined} props.dropdowns Dropdown menu configuration, allowing for additional filter options or actions.
152
+ * @param {Object[]|undefined} props.buttons List of button configurations for actions such as downloads.
153
+ * @param {boolean} props.loginForDownload Determines whether login is required to enable download functionality.
154
+ * @param {boolean} [props.showAccessLevel=false] Indicates if the user access level should be displayed on the panel.
155
+ *
156
+ * @returns {JSX.Element} Returns a JSX element rendering the CohortPanel. This includes filter options,
157
+ * summary charts, cohort manager, and data display components.
158
+ */ const CohortPanel = ({ guppyConfig, filters, charts = {}, chartsSection = undefined, table, tabTitle, dropdowns, buttons, loginForDownload, showAccessLevel = false })=>{
159
+ const isSm = hooks.useMediaQuery('(min-width: 639px)');
160
+ const isMd = hooks.useMediaQuery('(min-width: 1373px)');
161
+ const isXl = hooks.useMediaQuery('(min-width: 1600px)');
162
+ const [accessLevel, setAccessLevel] = React.useState(core.Accessibility.ALL);
163
+ const sharedFiltersMap = core.useCoreSelector((state)=>core.selectSharedFilters(state));
164
+ const defaultDropdowns = React.useMemo(()=>dropdowns ?? {}, [
165
+ dropdowns
166
+ ]);
167
+ const defaultButtons = React.useMemo(()=>buttons ?? [], [
168
+ buttons
169
+ ]);
170
+ const numCols = React.useMemo(()=>{
171
+ if (isSm) return 1;
172
+ if (isMd) return 2;
173
+ if (isXl) return 4;
174
+ return 3;
175
+ }, [
176
+ isSm,
177
+ isMd,
178
+ isXl
179
+ ]);
180
+ const index$1 = guppyConfig.dataType;
181
+ const indexPrefix = guppyConfig?.indexPrefix ?? '';
182
+ const fields = React.useMemo(()=>index.getAllFieldsFromFilterConfigs(filters?.tabs ?? []), [
183
+ filters?.tabs
184
+ ]);
185
+ const coreDispatch = core.useCoreDispatch();
186
+ const [facetDefinitions, setFacetDefinitions] = React.useState({});
187
+ const [summaryCharts, setSummaryCharts] = React.useState({});
188
+ const cohortFilters = core.useCoreSelector((state)=>core.selectIndexFilters(state, index$1));
189
+ const cohortId = core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
190
+ const allFiltersCollapsed = core.useCoreSelector((state)=>core.selectAllCohortFiltersCollapsed(state, index$1));
191
+ const toggleAllFiltersExpanded = (expand)=>{
192
+ coreDispatch(core.toggleCohortBuilderAllFilters({
193
+ expand,
194
+ index: index$1
195
+ }));
196
+ };
197
+ const clearAllFilters = React.useCallback(()=>{
198
+ coreDispatch(core.clearCohortFilters({
199
+ index: index$1
200
+ }));
201
+ }, [
202
+ coreDispatch,
203
+ index$1
204
+ ]);
205
+ const { data, isSuccess, isFetching: isAggsQueryFetching, isError: isAggsQueryError } = core.useGetAggsQuery({
206
+ type: index$1,
207
+ fields: fields,
208
+ filters: cohortFilters,
209
+ accessibility: accessLevel,
210
+ queryId: cohortId,
211
+ indexPrefix: indexPrefix
212
+ });
213
+ const chartKeys = useDeepCompare.useDeepCompareMemo(()=>[
214
+ ...Object.keys(chartsSection?.charts ?? {}),
215
+ ...Object.keys(charts)
216
+ ], [
217
+ chartsSection?.charts,
218
+ charts
219
+ ]);
220
+ const { data: chartData, isSuccess: isChartSuccess, isFetching: isChartFetching, isError: isChartError } = core.useGetAggsQuery({
221
+ type: index$1,
222
+ fields: chartKeys,
223
+ filters: cohortFilters,
224
+ accessibility: accessLevel,
225
+ filterSelf: true,
226
+ queryId: cohortId,
227
+ indexPrefix: indexPrefix
228
+ }, {
229
+ skip: chartKeys.length === 0
230
+ });
231
+ const cleanChartData = useDeepCompare.useDeepCompareMemo(()=>{
232
+ if (isChartSuccess && chartData) {
233
+ const cleanedData = {};
234
+ const totalCount = chartData._totalCount[0]?.count;
235
+ Object.keys(summaryCharts).forEach((key)=>{
236
+ if (!(key in chartData)) {
237
+ return;
238
+ } // handle missing key in data
239
+ // remove empty keys
240
+ cleanedData[key] = chartData[key].filter((x)=>typeof x.key !== 'string' ? true : x.key !== '');
241
+ const facetDef = facetDefinitions?.[key];
242
+ if (facetDef?.excludeValues) {
243
+ cleanedData[key] = cleanedData[key].filter((x)=>typeof x.key !== 'string' ? true : facetDef?.excludeValues?.includes(String(x.key)) === false);
244
+ }
245
+ if (cleanedData[key].length === 0 && totalCount) {
246
+ // if no keys adds back no data
247
+ cleanedData[key] = [
248
+ {
249
+ key: 'no data',
250
+ count: totalCount
251
+ }
252
+ ];
253
+ }
254
+ });
255
+ return cleanedData;
256
+ }
257
+ return chartData;
258
+ }, [
259
+ chartData,
260
+ isChartSuccess,
261
+ summaryCharts
262
+ ]);
263
+ const getEnumFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
264
+ let filters = undefined;
265
+ let combineMode = 'or';
266
+ if (field in cohortFilters.root) {
267
+ if (core.isIntersection(cohortFilters.root[field])) {
268
+ const intersectionFilters = index.removeIntersectionFromEnum(cohortFilters.root[field]);
269
+ if (intersectionFilters) {
270
+ filters = core.extractEnumFilterValue(intersectionFilters);
271
+ combineMode = 'and';
272
+ }
273
+ } else {
274
+ filters = core.extractEnumFilterValue(cohortFilters.root[field]);
275
+ }
276
+ }
277
+ return {
278
+ data: index.processBucketData(data?.[field]),
279
+ enumFilters: filters,
280
+ combineMode: combineMode,
281
+ isSuccess: isSuccess
282
+ };
283
+ }, [
284
+ cohortFilters.root,
285
+ data,
286
+ isSuccess
287
+ ]);
288
+ const getRangeFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
289
+ return {
290
+ data: index.processRangeData(data?.[field]),
291
+ filters: index.extractRangeValues(cohortFilters.root[field]),
292
+ isSuccess: isSuccess
293
+ };
294
+ }, [
295
+ data,
296
+ cohortFilters.root,
297
+ isSuccess
298
+ ]);
299
+ // Set up the hooks for the facet components to use based on the required index
300
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
301
+ // @ts-ignore
302
+ const facetDataHooks = useDeepCompare.useDeepCompareMemo(()=>{
303
+ return {
304
+ // TODO: see if there a better way to do this
305
+ enum: {
306
+ useGetFacetData: getEnumFacetData,
307
+ useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
308
+ useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
309
+ useClearFilter: _.partial(index.useClearFilters, index$1),
310
+ useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
311
+ useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
312
+ useGetCombineMode: _.partial(index.useCohortFilterCombineState, index$1),
313
+ useSetCombineMode: _.partial(index.useSetCohortFilterCombineState, index$1),
314
+ useFieldNameToLabel: index.useFieldNameToLabel,
315
+ useTotalCounts: undefined
316
+ },
317
+ exact: {
318
+ useGetFacetData: getEnumFacetData,
319
+ useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
320
+ useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
321
+ useClearFilter: _.partial(index.useClearFilters, index$1),
322
+ useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
323
+ useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
324
+ useFieldNameToLabel: index.useFieldNameToLabel,
325
+ useTotalCounts: undefined
326
+ },
327
+ multiselect: {
328
+ useGetFacetData: getEnumFacetData,
329
+ useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
330
+ useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
331
+ useClearFilter: _.partial(index.useClearFilters, index$1),
332
+ useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
333
+ useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
334
+ useFieldNameToLabel: index.useFieldNameToLabel,
335
+ useTotalCounts: undefined
336
+ },
337
+ range: {
338
+ useGetFacetData: getRangeFacetData,
339
+ useUpdateFacetFilters: _.partial(index.useUpdateFilters, index$1),
340
+ useGetFacetFilters: _.partial(index.useGetFacetFilters, index$1),
341
+ useClearFilter: _.partial(index.useClearFilters, index$1),
342
+ useFilterExpanded: _.partial(index.useFilterExpandedState, index$1),
343
+ useToggleExpandFilter: _.partial(index.useToggleExpandFilter, index$1),
344
+ useFieldNameToLabel: index.useFieldNameToLabel,
345
+ useTotalCounts: undefined
346
+ }
347
+ };
348
+ }, [
349
+ getEnumFacetData,
350
+ getRangeFacetData,
351
+ index$1
352
+ ]);
353
+ // Set the facet definitions based on the data only the first time the data is loaded
354
+ useDeepCompare.useDeepCompareEffect(()=>{
355
+ if (isSuccess && Object.keys(facetDefinitions).length === 0) {
356
+ const configFacetDefs = filters?.tabs.reduce((acc, tab)=>{
357
+ return {
358
+ ...tab.fieldsConfig,
359
+ ...acc
360
+ };
361
+ }, {});
362
+ const facetDefs = index.classifyFacets(data, index$1, guppyConfig?.fieldMapping ?? [], configFacetDefs ?? {}, sharedFiltersMap);
363
+ setFacetDefinitions(facetDefs);
364
+ // setup summary charts since nested fields can be listed by the split field name
365
+ const chartDefinitions = chartsSection?.charts ?? charts;
366
+ const summaryCharts = Object.keys(chartDefinitions).reduce((acc, field)=>{
367
+ let chartField = field;
368
+ if (facetDefs?.[field] === undefined) {
369
+ const res = Object.values(facetDefs).filter((def)=>{
370
+ return def.dataField === field;
371
+ });
372
+ if (res.length > 0) {
373
+ chartField = res[0].field;
374
+ }
375
+ }
376
+ return {
377
+ ...acc,
378
+ [chartField]: chartDefinitions[field]
379
+ };
380
+ }, {});
381
+ setSummaryCharts(summaryCharts);
382
+ }
383
+ }, [
384
+ isSuccess,
385
+ data,
386
+ facetDefinitions,
387
+ index$1,
388
+ guppyConfig.fieldMapping,
389
+ charts,
390
+ chartsSection
391
+ ]);
392
+ const { data: counts, isFetching: isCountsFetching, isError: isCountsError } = core.useGetCountsQuery({
393
+ type: index$1,
394
+ filters: cohortFilters,
395
+ accessibility: accessLevel,
396
+ queryId: cohortId
397
+ });
398
+ const [submitJob, result] = core.useSubmitSowerJobMutation();
399
+ const { update } = useSowerJobEventBus();
400
+ React.useEffect(()=>{
401
+ if (result?.data) {
402
+ update(result.data?.uid);
403
+ }
404
+ }, [
405
+ result
406
+ ]);
407
+ if (isCountsError || isAggsQueryError) {
408
+ return /*#__PURE__*/ jsxRuntime.jsx(index.ErrorCard, {
409
+ message: "Unable to fetch data from server"
410
+ }); // TODO: replace with configurable message
411
+ }
412
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
413
+ className: "flex flex-col mt-3 relative px-4 bg-base-lightest w-full",
414
+ children: [
415
+ /*#__PURE__*/ jsxRuntime.jsx(index.QueryExpression, {
416
+ index: index$1
417
+ }),
418
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
419
+ className: "flex w-full",
420
+ children: [
421
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
422
+ id: "cohort-builder-filters",
423
+ className: "flex-shrink-0 md:w-1/4 lg:w-1/5",
424
+ children: filters?.tabs && /*#__PURE__*/ jsxRuntime.jsx(index.DropdownPanel, {
425
+ filters: filters,
426
+ tabTitle: tabTitle,
427
+ facetDefinitions: facetDefinitions,
428
+ facetDataHooks: facetDataHooks,
429
+ onAccessChange: setAccessLevel,
430
+ accessLevel: accessLevel,
431
+ showAccessLevel: showAccessLevel,
432
+ allFiltersCollapsed: allFiltersCollapsed,
433
+ toggleAllFiltersExpanded: toggleAllFiltersExpanded,
434
+ clearAllFilters: clearAllFilters
435
+ })
436
+ }),
437
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
438
+ id: "cohort-builder-content",
439
+ className: "flex flex-col md:w-3/4 lg:w-4/5 pl-4",
440
+ children: [
441
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
442
+ className: "flex justify-between mb-2 ml-2",
443
+ children: [
444
+ /*#__PURE__*/ jsxRuntime.jsx(index.DownloadsPanel, {
445
+ dropdowns: defaultDropdowns,
446
+ buttons: defaultButtons,
447
+ loginForDownload: loginForDownload,
448
+ index: index$1,
449
+ totalCount: counts ?? 0,
450
+ fields: table?.fields ?? [],
451
+ filter: cohortFilters
452
+ }),
453
+ /*#__PURE__*/ jsxRuntime.jsx(index.CountsValue, {
454
+ label: guppyConfig?.nodeCountTitle || toDisplayName(index$1),
455
+ counts: counts,
456
+ isFetching: isCountsFetching,
457
+ isError: isCountsError
458
+ })
459
+ ]
460
+ }),
461
+ chartsSection?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(index.CollapsableCharts, {
462
+ config: {
463
+ ...chartsSection,
464
+ charts: summaryCharts
465
+ },
466
+ data: cleanChartData ?? EmptyData,
467
+ isSuccess: isChartSuccess,
468
+ isFetching: isChartFetching,
469
+ isError: isChartError
470
+ }) : /*#__PURE__*/ jsxRuntime.jsx(index.Charts, {
471
+ charts: summaryCharts,
472
+ data: cleanChartData ?? EmptyData,
473
+ counts: counts,
474
+ isSuccess: isChartSuccess,
475
+ isError: isChartError,
476
+ numCols: numCols
477
+ }),
478
+ table?.enabled && /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
479
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
480
+ className: "mt-2 flex flex-col",
481
+ children: /*#__PURE__*/ jsxRuntime.jsx(index.ExplorerTable, {
482
+ index: index$1,
483
+ tableConfig: table,
484
+ accessibility: accessLevel
485
+ })
486
+ })
487
+ })
488
+ ]
489
+ })
490
+ ]
491
+ })
492
+ ]
493
+ });
494
+ };
495
+
496
+ const TabsLayoutToComponentProp = (tabsLayout)=>{
497
+ if (!tabsLayout) {
498
+ return 'flex-start';
499
+ }
500
+ switch(tabsLayout){
501
+ case 'left':
502
+ {
503
+ return 'flex-start';
504
+ }
505
+ case 'right':
506
+ {
507
+ return 'flex-end';
508
+ }
509
+ case 'center':
510
+ {
511
+ return 'center';
512
+ }
513
+ default:
514
+ {
515
+ return 'flex-start';
516
+ }
517
+ }
518
+ };
519
+
520
+ const useGetCurrentCohort = ()=>{
521
+ return core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
522
+ };
523
+ const CohortBuilder = ({ explorerConfig, sharedFiltersMap = null, tabsLayout = 'left', enableCohortManager = true, activeTab })=>{
524
+ const dispatch = core.useCoreDispatch();
525
+ dispatch(core.setSharedFilters(sharedFiltersMap ?? {}));
526
+ const configuration = useDeepCompare.useDeepCompareMemo(()=>explorerConfig, [
527
+ explorerConfig
528
+ ]);
529
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
530
+ className: "flex flex-col w-full mt-2",
531
+ children: [
532
+ enableCohortManager ? /*#__PURE__*/ jsxRuntime.jsx(index.CohortManager, {}) : null,
533
+ /*#__PURE__*/ jsxRuntime.jsxs(core$1.Tabs, {
534
+ color: "primary.5",
535
+ variant: explorerConfig[0]?.tabType,
536
+ keepMounted: true,
537
+ defaultValue: activeTab ?? explorerConfig[0].tabTitle,
538
+ children: [
539
+ /*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.List, {
540
+ className: "w-full",
541
+ justify: TabsLayoutToComponentProp(tabsLayout),
542
+ children: configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Tab, {
543
+ value: panelConfig.tabTitle,
544
+ children: panelConfig.tabTitle
545
+ }, `${panelConfig.tabTitle}-tabList`))
546
+ }),
547
+ configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Panel, {
548
+ value: panelConfig.tabTitle,
549
+ children: /*#__PURE__*/ jsxRuntime.jsx(CohortPanel, {
550
+ guppyConfig: panelConfig.guppyConfig,
551
+ chartsSection: panelConfig?.chartsSection,
552
+ charts: panelConfig?.charts,
553
+ filters: panelConfig.filters,
554
+ tabTitle: panelConfig.tabTitle,
555
+ table: panelConfig.table,
556
+ dropdowns: panelConfig.dropdowns,
557
+ buttons: panelConfig.buttons,
558
+ loginForDownload: panelConfig.loginForDownload,
559
+ sharedFiltersMap: panelConfig.sharedFiltersMap
560
+ }, `${panelConfig.tabTitle}-CohortPanel`)
561
+ }, `${panelConfig.tabTitle}-tabPanel`))
562
+ ]
563
+ })
564
+ ]
565
+ });
566
+ };
567
+
568
+ exports.default = CohortBuilder;
569
+ exports.useGetCurrentCohort = useGetCurrentCohort;
570
+ //# sourceMappingURL=CohortBuilder-DSb4NbaV.js.map