@gen3/frontend 0.12.8 → 0.12.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/LICENSE +201 -0
  2. package/dist/dts/components/Providers/Gen3Provider.d.ts +6 -6
  3. package/dist/dts/features/Analysis/AnalysisCardCompact.stories.d.ts +22 -22
  4. package/dist/dts/features/CohortSimilarity/cohortSimilarityApi.d.ts +6 -6
  5. package/dist/dts/features/Navigation/NavigationBar.d.ts.map +1 -1
  6. package/dist/dts/features/Navigation/NavigationBar.js +18 -9
  7. package/dist/dts/features/Navigation/NavigationBar.js.map +1 -1
  8. package/dist/dts/features/Navigation/TopBar/AccountButton.d.ts.map +1 -1
  9. package/dist/dts/features/Navigation/TopBar/AccountButton.js +11 -1
  10. package/dist/dts/features/Navigation/TopBar/AccountButton.js.map +1 -1
  11. package/dist/dts/features/Navigation/TopBar/LoginButton.d.ts.map +1 -1
  12. package/dist/dts/features/Navigation/TopBar/LoginButton.js +11 -2
  13. package/dist/dts/features/Navigation/TopBar/LoginButton.js.map +1 -1
  14. package/dist/dts/lib/session/session.d.ts.map +1 -1
  15. package/dist/dts/lib/session/session.js +16 -0
  16. package/dist/dts/lib/session/session.js.map +1 -1
  17. package/dist/dts/utils/index.d.ts +1 -2
  18. package/dist/dts/utils/index.d.ts.map +1 -1
  19. package/dist/dts/utils/index.js +1 -2
  20. package/dist/dts/utils/index.js.map +1 -1
  21. package/dist/index/cjs/QueryPanel-BnA4J2AG.js +24 -0
  22. package/dist/index/cjs/QueryPanel-BnA4J2AG.js.map +1 -0
  23. package/dist/index/cjs/QueryPanel-Df-i2v74.js +24 -0
  24. package/dist/index/cjs/QueryPanel-Df-i2v74.js.map +1 -0
  25. package/dist/index/cjs/index-BI9JrLhi.js +31011 -0
  26. package/dist/index/cjs/index-BI9JrLhi.js.map +1 -0
  27. package/dist/index/cjs/index-Dia_4amP.js +30930 -0
  28. package/dist/index/cjs/index-Dia_4amP.js.map +1 -0
  29. package/dist/index/cjs/index.js +2 -5
  30. package/dist/index/cjs/index.js.map +1 -1
  31. package/dist/index/esm/QueryPanel-BLqr7UKl.js +22 -0
  32. package/dist/index/esm/QueryPanel-BLqr7UKl.js.map +1 -0
  33. package/dist/index/esm/QueryPanel-Bx_ECLYq.js +22 -0
  34. package/dist/index/esm/QueryPanel-Bx_ECLYq.js.map +1 -0
  35. package/dist/index/esm/index-B0GVp0DQ.js +30688 -0
  36. package/dist/index/esm/index-B0GVp0DQ.js.map +1 -0
  37. package/dist/index/esm/index-BY3rApNY.js +30767 -0
  38. package/dist/index/esm/index-BY3rApNY.js.map +1 -0
  39. package/dist/index/esm/index.js +2 -3
  40. package/dist/index/esm/index.js.map +1 -1
  41. package/dist/index.d.ts +7 -10
  42. package/dist/pages/cjs/CohortBuilder-BBuNjs02.js +483 -0
  43. package/dist/pages/cjs/CohortBuilder-BBuNjs02.js.map +1 -0
  44. package/dist/pages/cjs/CohortBuilder-vrahe-85.js +482 -0
  45. package/dist/pages/cjs/CohortBuilder-vrahe-85.js.map +1 -0
  46. package/dist/pages/cjs/index-DZzhGid9.js +22729 -0
  47. package/dist/pages/cjs/index-DZzhGid9.js.map +1 -0
  48. package/dist/pages/cjs/index-DcjJdonn.js +22726 -0
  49. package/dist/pages/cjs/index-DcjJdonn.js.map +1 -0
  50. package/dist/pages/cjs/index.js +2 -3
  51. package/dist/pages/cjs/index.js.map +1 -1
  52. package/dist/pages/esm/CohortBuilder-4bldHVrA.js +479 -0
  53. package/dist/pages/esm/CohortBuilder-4bldHVrA.js.map +1 -0
  54. package/dist/pages/esm/CohortBuilder-zOcXjW9H.js +480 -0
  55. package/dist/pages/esm/CohortBuilder-zOcXjW9H.js.map +1 -0
  56. package/dist/pages/esm/index-Bmx2MDWU.js +22647 -0
  57. package/dist/pages/esm/index-Bmx2MDWU.js.map +1 -0
  58. package/dist/pages/esm/index-DqZnojQ4.js +22644 -0
  59. package/dist/pages/esm/index-DqZnojQ4.js.map +1 -0
  60. package/dist/pages/esm/index.js +2 -3
  61. package/dist/pages/esm/index.js.map +1 -1
  62. package/package.json +3 -4
@@ -1,4 +1,4 @@
1
- export { Y as AISearchPageGetServerSideProps, cD as AccessLevel, bj as AccordionPanel, bI as ActionBar, A as ActionButton, x as AdminAuthZPageGetServerSideProps, bH as AiSearch, X as AiSearchPage, c9 as AnalysisCenter, ca as AnalysisCenterWithSections, a6 as AnalysisEditorPage, a7 as AnalysisEditorPageGetServerSideProps, F as AnalysisPage, H as AnalysisPageGetServerSideProps, w as AuthzPage, bh as BAD_DATA_MESSAGE, bv as Banner, am as BaseModal, as as CardContainer, ax as Charts, b$ as CohortActionButton, bR as CohortBuilder, c1 as CohortDropdownActionButton, bS as CohortManager, bT as CohortManagerAndExpression, ay as CollapsableCharts, a as CollapsableSidebar, j as ColorThemePage, k as ColorThemePageGetServerSideProps, C as ContentSource, e as CountsValue, ap as CreateCredentialsAPIKeyModal, Z as CrosswalkPage, _ as CrosswalkPageGetServerSideProps, I as Custom403Page, K as Custom404Page, bi as DAYS_IN_YEAR, bg as DEFAULT_MAXIMUM, bf as DEFAULT_MINIMUM, be as DEFAULT_VISIBLE_ITEMS, l as DataDictionaryPage, a1 as DataLibraryPage, a2 as DataLibraryPageGetServerSideProps, af as DefaultAuthorizedRoutesConfig, m as DictionaryPageGetServerSideProps, bJ as DictionaryWithContext, bD as DiscoveryCellRendererFactory, bF as DiscoveryConfigProvider, by as DiscoveryIndexPanel, f as DiscoveryPage, g as DiscoveryPageGetServerSideProps, bE as DiscoveryRowRendererFactory, D as DownloadButton, c3 as DownloadsPanel, b as DropdownButton, bk as DropdownPanel, c as DropdownWithIcon, aw as EmptyTableMessage, aJ as EnumFacet, az as EnumFacetChart, E as ErrorCard, aK as ExactValueFacet, n as ExplorerPage, o as ExplorerPageGetServerSideProps, p as ExplorerPageGetServerSidePropsForConfigId, c2 as ExplorerTable, bU as ExplorerTableCellRendererFactory, bV as ExplorerTableDetailsPanelFactory, aO as FacetControlsHeader, aQ as FacetExpander, aI as FacetSelector, aP as FacetSortPanel, aN as FacetTabs, aR as FiltersPanel, an as FirstTimeModal, bo as Footer, G as Gen3Button, d as Gen3ButtonReverse, bp as Gen3Link, ar as Gen3ModalsProvider, u as Gen3Provider, c7 as GqlQueryEditor, bq as Header, br as HoverLink, bx as IconButton, J as JSONObjectDownloadButton, L as LandingPage, i as LandingPageGetServerSideProps, aj as LoginButton, r as LoginPage, s as LoginPageGetServerSideProps, al as LoginPanel, ak as LoginProvidersPanel, au as MessageCard, av as MessagePage, bK as MetadataDictionary, cB as MinutesToMilliseconds, aM as MultiSelectValueFacet, bu as NavPageLayout, bs as NavigationBar, bt as NavigationButton, aq as NoAccessModal, a3 as NotebookLitePage, a4 as NotebookLitePageGetStaticProps, cc as Profile, P as ProfilePage, q as ProfilePageGetServerSideProps, ah as ProfileProvider, bm as ProtectedContent, bn as ProtectedContentUI, bY as QueryExpression, c4 as QueryExpressionContext, bZ as QueryExpressionSection, Q as QueryPage, h as QueryPageGetServerSideProps, aL as RangeFacet, aA as ReactECharts, c6 as Repository, aa as RepositoryPage, ab as RepositoryPageGetServerSideProps, ai as ResourcesFilters, cm as SPECIAL_CASE_FIELDS, S as SegmentedControl, ao as SessionExpiredModal, bO as SinglePageStudyDetailsPanel, cb as StaticNotebookIFrame, bP as StudyDetailsPanel, bM as StudyGroup, bN as StudyGroupPanel, bL as StudyProvider, $ as SubmissionPage, a0 as SubmissionPageGetServerSideProps, b_ as TabbedCohortBuilder, a8 as TabbedCohortBuilderPage, a9 as TabbedCohortBuilderPageGetServerSideProps, bl as TabbedPanel, c5 as TableXPositionContext, bz as TagCloud, t as TailwindConfig, T as TopBar, U as UploadJSONButton, ag as User, at as WarningCard, c8 as Workspace, z as WorkspaceNoAccessPage, B as WorkspaceNoAccessPageServerSideProps, W as WorkspacePage, y as WorkspacePageGetServerSideProps, cC as accessibleFieldName, b6 as addIntersectionToIncludes, b4 as addUnion, ae as analysisApiCohortDiscovery, aB as capitalize, a_ as classifyFacets, b9 as compareKeysAscending, ba as compareKeysDescending, aG as computeRowSpan, cv as convertMinutesToMilliseconds, ch as convertPathsToTree, cw as convertSecondsToMilliseconds, b3 as convertToStringArray, ce as create10ColorAccessibleContrast, cd as create10ColorPallet, V as createMantineTheme, O as credentialsLogin, R as credentialsLogout, cu as extractObjectKey, b2 as extractRangeValues, aH as filterAggregationsDataKeys, ck as focusStyles, aU as getAllFieldsFromFilterConfigs, aV as getByPath, cf as getCurrentUnixTimestamp, cx as getFormattedTimestamp, cA as getHighResolutionTimestamp, v as getNavPageLayoutPropsFromConfig, ct as getParamsValueAsString, bQ as getTagInfo, cs as hasOwnProperty, cp as isArrayOfString, aT as isEnumFacetResponse, bw as isHeaderMetadata, cr as isPropertyKey, cq as isTextTransform, cy as isTimeGreaterThan, cE as itemsInCart, b8 as mapFacetSortToSortType, cz as measureExecutionTime, aW as processBucketData, aY as processDefinedRangeData, aE as processLabel, aX as processRangeData, aF as processRangeKeyLabel, bX as registerCohortBuilderDefaultPreviewRenderers, ac as registerCohortDiscoveryApp, ad as registerCohortSimilarityApp, bC as registerDefaultDiscoveryDataLoaders, bA as registerDiscoveryDefaultCellRenderers, bB as registerDiscoveryDefaultStudyPreviewRenderers, bW as registerExplorerDefaultCellRenderers, a5 as registerMetadataSchemaApp, b7 as removeIntersectionFromEnum, aD as removeKey, b5 as removeUnion, ci as resourcePathFromProjectID, N as sessionLogout, M as sessionToken, cl as stripTrailingSlash, co as toCountsString, cn as toDisplayName, aC as truncateString, cg as unixTimeToString, aZ as updateFacetEnum, bb as useClearFilters, bG as useDiscoveryContext, bc as useExtractEnumFilterValues, bd as useExtractRangeFilterValues, aS as useFieldNameToTitle, b1 as useGetFacetFilters, c0 as useGuppyActionButton, a$ as useUpdateFilters, b0 as useUpdateFiltersFlat, cj as userHasMethodForServiceOnResource, cF as validateObjectHasRequiredFields } from './index-BzImfKNU.js';
1
+ export { Y as AISearchPageGetServerSideProps, cB as AccessLevel, bj as AccordionPanel, bI as ActionBar, A as ActionButton, x as AdminAuthZPageGetServerSideProps, bH as AiSearch, X as AiSearchPage, c9 as AnalysisCenter, ca as AnalysisCenterWithSections, a6 as AnalysisEditorPage, a7 as AnalysisEditorPageGetServerSideProps, F as AnalysisPage, H as AnalysisPageGetServerSideProps, w as AuthzPage, bh as BAD_DATA_MESSAGE, bv as Banner, am as BaseModal, as as CardContainer, ax as Charts, b$ as CohortActionButton, bR as CohortBuilder, c1 as CohortDropdownActionButton, bS as CohortManager, bT as CohortManagerAndExpression, ay as CollapsableCharts, a as CollapsableSidebar, j as ColorThemePage, k as ColorThemePageGetServerSideProps, C as ContentSource, e as CountsValue, ap as CreateCredentialsAPIKeyModal, Z as CrosswalkPage, _ as CrosswalkPageGetServerSideProps, I as Custom403Page, K as Custom404Page, bi as DAYS_IN_YEAR, bg as DEFAULT_MAXIMUM, bf as DEFAULT_MINIMUM, be as DEFAULT_VISIBLE_ITEMS, l as DataDictionaryPage, a1 as DataLibraryPage, a2 as DataLibraryPageGetServerSideProps, af as DefaultAuthorizedRoutesConfig, m as DictionaryPageGetServerSideProps, bJ as DictionaryWithContext, bD as DiscoveryCellRendererFactory, bF as DiscoveryConfigProvider, by as DiscoveryIndexPanel, f as DiscoveryPage, g as DiscoveryPageGetServerSideProps, bE as DiscoveryRowRendererFactory, D as DownloadButton, c3 as DownloadsPanel, b as DropdownButton, bk as DropdownPanel, c as DropdownWithIcon, aw as EmptyTableMessage, aJ as EnumFacet, az as EnumFacetChart, E as ErrorCard, aK as ExactValueFacet, n as ExplorerPage, o as ExplorerPageGetServerSideProps, p as ExplorerPageGetServerSidePropsForConfigId, c2 as ExplorerTable, bU as ExplorerTableCellRendererFactory, bV as ExplorerTableDetailsPanelFactory, aO as FacetControlsHeader, aQ as FacetExpander, aI as FacetSelector, aP as FacetSortPanel, aN as FacetTabs, aR as FiltersPanel, an as FirstTimeModal, bo as Footer, G as Gen3Button, d as Gen3ButtonReverse, bp as Gen3Link, ar as Gen3ModalsProvider, u as Gen3Provider, c7 as GqlQueryEditor, bq as Header, br as HoverLink, bx as IconButton, J as JSONObjectDownloadButton, L as LandingPage, i as LandingPageGetServerSideProps, aj as LoginButton, r as LoginPage, s as LoginPageGetServerSideProps, al as LoginPanel, ak as LoginProvidersPanel, au as MessageCard, av as MessagePage, bK as MetadataDictionary, cz as MinutesToMilliseconds, aM as MultiSelectValueFacet, bu as NavPageLayout, bs as NavigationBar, bt as NavigationButton, aq as NoAccessModal, a3 as NotebookLitePage, a4 as NotebookLitePageGetStaticProps, cc as Profile, P as ProfilePage, q as ProfilePageGetServerSideProps, ah as ProfileProvider, bm as ProtectedContent, bn as ProtectedContentUI, bY as QueryExpression, c4 as QueryExpressionContext, bZ as QueryExpressionSection, Q as QueryPage, h as QueryPageGetServerSideProps, aL as RangeFacet, aA as ReactECharts, c6 as Repository, aa as RepositoryPage, ab as RepositoryPageGetServerSideProps, ai as ResourcesFilters, ck as SPECIAL_CASE_FIELDS, S as SegmentedControl, ao as SessionExpiredModal, bO as SinglePageStudyDetailsPanel, cb as StaticNotebookIFrame, bP as StudyDetailsPanel, bM as StudyGroup, bN as StudyGroupPanel, bL as StudyProvider, $ as SubmissionPage, a0 as SubmissionPageGetServerSideProps, b_ as TabbedCohortBuilder, a8 as TabbedCohortBuilderPage, a9 as TabbedCohortBuilderPageGetServerSideProps, bl as TabbedPanel, c5 as TableXPositionContext, bz as TagCloud, t as TailwindConfig, T as TopBar, U as UploadJSONButton, ag as User, at as WarningCard, c8 as Workspace, z as WorkspaceNoAccessPage, B as WorkspaceNoAccessPageServerSideProps, W as WorkspacePage, y as WorkspacePageGetServerSideProps, cA as accessibleFieldName, b6 as addIntersectionToIncludes, b4 as addUnion, ae as analysisApiCohortDiscovery, aB as capitalize, a_ as classifyFacets, b9 as compareKeysAscending, ba as compareKeysDescending, aG as computeRowSpan, ct as convertMinutesToMilliseconds, cf as convertPathsToTree, cu as convertSecondsToMilliseconds, b3 as convertToStringArray, V as createMantineTheme, O as credentialsLogin, R as credentialsLogout, cs as extractObjectKey, b2 as extractRangeValues, aH as filterAggregationsDataKeys, ci as focusStyles, aU as getAllFieldsFromFilterConfigs, aV as getByPath, cd as getCurrentUnixTimestamp, cv as getFormattedTimestamp, cy as getHighResolutionTimestamp, v as getNavPageLayoutPropsFromConfig, cr as getParamsValueAsString, bQ as getTagInfo, cq as hasOwnProperty, cn as isArrayOfString, aT as isEnumFacetResponse, bw as isHeaderMetadata, cp as isPropertyKey, co as isTextTransform, cw as isTimeGreaterThan, cC as itemsInCart, b8 as mapFacetSortToSortType, cx as measureExecutionTime, aW as processBucketData, aY as processDefinedRangeData, aE as processLabel, aX as processRangeData, aF as processRangeKeyLabel, bX as registerCohortBuilderDefaultPreviewRenderers, ac as registerCohortDiscoveryApp, ad as registerCohortSimilarityApp, bC as registerDefaultDiscoveryDataLoaders, bA as registerDiscoveryDefaultCellRenderers, bB as registerDiscoveryDefaultStudyPreviewRenderers, bW as registerExplorerDefaultCellRenderers, a5 as registerMetadataSchemaApp, b7 as removeIntersectionFromEnum, aD as removeKey, b5 as removeUnion, cg as resourcePathFromProjectID, N as sessionLogout, M as sessionToken, cj as stripTrailingSlash, cm as toCountsString, cl as toDisplayName, aC as truncateString, ce as unixTimeToString, aZ as updateFacetEnum, bb as useClearFilters, bG as useDiscoveryContext, bc as useExtractEnumFilterValues, bd as useExtractRangeFilterValues, aS as useFieldNameToTitle, b1 as useGetFacetFilters, c0 as useGuppyActionButton, a$ as useUpdateFilters, b0 as useUpdateFiltersFlat, ch as userHasMethodForServiceOnResource, cD as validateObjectHasRequiredFields } from './index-B0GVp0DQ.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@mantine/core';
@@ -17,7 +17,7 @@ import 'jose';
17
17
  import 'cookie';
18
18
  import '@gen3/core/server';
19
19
  import '@mantine/notifications';
20
- import 'tinycolor2';
20
+ import '@mantine/hooks';
21
21
  import 'lodash';
22
22
  import 'tailwind-merge';
23
23
  import 'react-icons/io';
@@ -25,7 +25,6 @@ import 'react-markdown';
25
25
  import 'remark-gfm';
26
26
  import 'react-cookie';
27
27
  import 'file-saver';
28
- import '@mantine/hooks';
29
28
  import 'default-composer';
30
29
  import '@iconify-icon/react';
31
30
  import 'echarts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -805,9 +805,6 @@ interface DetailsPanelComponentProps extends Record<string, unknown> {
805
805
  row?: MRT_Row<Record<string, any>>;
806
806
  }
807
807
 
808
- declare const create10ColorPallet: (mainColor: string) => Record<string, string>;
809
- declare const create10ColorAccessibleContrast: (pallet: Record<string, string>) => Record<string, string>;
810
-
811
808
  type TenStringArray = [
812
809
  string?,
813
810
  string?,
@@ -2650,8 +2647,8 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2650
2647
  radius?: {
2651
2648
  [x: string & {}]: string | undefined;
2652
2649
  sm?: string | undefined;
2653
- md?: string | undefined;
2654
2650
  xs?: string | undefined;
2651
+ md?: string | undefined;
2655
2652
  lg?: string | undefined;
2656
2653
  xl?: string | undefined;
2657
2654
  } | undefined;
@@ -2660,40 +2657,40 @@ declare const createMantineTheme: (fonts: Fonts, colors: Record<string, TenStrin
2660
2657
  [x: number]: string | undefined;
2661
2658
  [x: string & {}]: string | undefined;
2662
2659
  sm?: string | undefined;
2663
- md?: string | undefined;
2664
2660
  xs?: string | undefined;
2661
+ md?: string | undefined;
2665
2662
  lg?: string | undefined;
2666
2663
  xl?: string | undefined;
2667
2664
  } | undefined;
2668
2665
  fontSizes?: {
2669
2666
  [x: string & {}]: string | undefined;
2670
2667
  sm?: string | undefined;
2671
- md?: string | undefined;
2672
2668
  xs?: string | undefined;
2669
+ md?: string | undefined;
2673
2670
  lg?: string | undefined;
2674
2671
  xl?: string | undefined;
2675
2672
  } | undefined;
2676
2673
  lineHeights?: {
2677
2674
  [x: string & {}]: string | undefined;
2678
2675
  sm?: string | undefined;
2679
- md?: string | undefined;
2680
2676
  xs?: string | undefined;
2677
+ md?: string | undefined;
2681
2678
  lg?: string | undefined;
2682
2679
  xl?: string | undefined;
2683
2680
  } | undefined;
2684
2681
  breakpoints?: {
2685
2682
  [x: string & {}]: string | undefined;
2686
2683
  sm?: string | undefined;
2687
- md?: string | undefined;
2688
2684
  xs?: string | undefined;
2685
+ md?: string | undefined;
2689
2686
  lg?: string | undefined;
2690
2687
  xl?: string | undefined;
2691
2688
  } | undefined;
2692
2689
  shadows?: {
2693
2690
  [x: string & {}]: string | undefined;
2694
2691
  sm?: string | undefined;
2695
- md?: string | undefined;
2696
2692
  xs?: string | undefined;
2693
+ md?: string | undefined;
2697
2694
  lg?: string | undefined;
2698
2695
  xl?: string | undefined;
2699
2696
  } | undefined;
@@ -3156,5 +3153,5 @@ declare function export_default$1(req: NextApiRequest, res: NextApiResponse): Pr
3156
3153
 
3157
3154
  declare function export_default(req: NextApiRequest, res: NextApiResponse): Promise<void>;
3158
3155
 
3159
- 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, CohortActionButton, CohortBuilder, CohortDropdownActionButton, CohortManager, CohortManagerAndExpression, CollapsableCharts, CollapsableSidebar, ColorThemePage, ColorThemePageGetServerSideProps, _default as ContentSource, CountsValue, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom403Page, Custom404Page, 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, DiscoveryRowRendererFactory, DownloadButton, DownloadsPanel, DropdownButton, DropdownPanel, DropdownWithIcon, EmptyTableMessage, EnumFacet, EnumFacetChart, ErrorCard, ExactValueFacet, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerPageGetServerSidePropsForConfigId, ExplorerTable, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FacetControlsHeader, FacetExpander, FacetSelector, FacetSortPanel, FacetTabs, FiltersPanel, FirstTimeModal, Footer, Gen3Button, Gen3ButtonReverse, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor, Header, HoverLink, IconButton, JSONObjectDownloadButton, LandingPage, LandingPageGetServerSideProps, LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, MessageCard, MessagePage, MetadataDictionary, MinutesToMilliseconds, MultiSelectValueFacet, NavPageLayout, NavigationBar, NavigationButton, NoAccessModal, NotebookLitePage, NotebookLitePageGetStaticProps, Profile, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, ProtectedContent, ProtectedContentUI, 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, create10ColorAccessibleContrast, create10ColorPallet, createMantineTheme, export_default$2 as credentialsLogin, export_default$1 as credentialsLogout, extractObjectKey, extractRangeValues, filterAggregationsDataKeys, focusStyles, getAllFieldsFromFilterConfigs, getByPath, getCurrentUnixTimestamp, getFormattedTimestamp, getHighResolutionTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isEnumFacetResponse, isHeaderMetadata, isPropertyKey, isTextTransform, isTimeGreaterThan, itemsInCart, mapFacetSortToSortType, measureExecutionTime, processBucketData, processDefinedRangeData, processLabel, processRangeData, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerCohortDiscoveryApp, registerCohortSimilarityApp, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDiscoveryDefaultStudyPreviewRenderers, registerExplorerDefaultCellRenderers, registerMetadataSchemaApp, removeIntersectionFromEnum, removeKey, removeUnion, resourcePathFromProjectID, export_default$3 as sessionLogout, handler as sessionToken, stripTrailingSlash, toCountsString, toDisplayName, truncateString, unixTimeToString, updateFacetEnum, useClearFilters, useDiscoveryContext, useExtractEnumFilterValues, useExtractRangeFilterValues, useFieldNameToTitle, useGetFacetFilters, useGuppyActionButton, useUpdateFilters, useUpdateFiltersFlat, userHasMethodForServiceOnResource, validateObjectHasRequiredFields };
3156
+ 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, CohortActionButton, CohortBuilder, CohortDropdownActionButton, CohortManager, CohortManagerAndExpression, CollapsableCharts, CollapsableSidebar, ColorThemePage, ColorThemePageGetServerSideProps, _default as ContentSource, CountsValue, CreateCredentialsAPIKeyModal, CrosswalkPage, CrosswalkPageGetServerSideProps, Custom403Page, Custom404Page, 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, DiscoveryRowRendererFactory, DownloadButton, DownloadsPanel, DropdownButton, DropdownPanel, DropdownWithIcon, EmptyTableMessage, EnumFacet, EnumFacetChart, ErrorCard, ExactValueFacet, ExplorerPage, ExplorerPageGetServerSideProps, ExplorerPageGetServerSidePropsForConfigId, ExplorerTable, ExplorerTableCellRendererFactory, ExplorerTableDetailsPanelFactory, FacetControlsHeader, FacetExpander, FacetSelector, FacetSortPanel, FacetTabs, FiltersPanel, FirstTimeModal, Footer, Gen3Button, Gen3ButtonReverse, Gen3Link, Gen3ModalsProvider, Gen3Provider, GqlQueryEditor, Header, HoverLink, IconButton, JSONObjectDownloadButton, LandingPage, LandingPageGetServerSideProps, LoginButton, LoginPage, LoginPageGetServerSideProps, LoginPanel, LoginProvidersPanel, MessageCard, MessagePage, MetadataDictionary, MinutesToMilliseconds, MultiSelectValueFacet, NavPageLayout, NavigationBar, NavigationButton, NoAccessModal, NotebookLitePage, NotebookLitePageGetStaticProps, Profile, ProfilePage, ProfilePageGetServerSideProps, ProfileProvider, ProtectedContent, ProtectedContentUI, 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, createMantineTheme, export_default$2 as credentialsLogin, export_default$1 as credentialsLogout, extractObjectKey, extractRangeValues, filterAggregationsDataKeys, focusStyles, getAllFieldsFromFilterConfigs, getByPath, getCurrentUnixTimestamp, getFormattedTimestamp, getHighResolutionTimestamp, getNavPageLayoutPropsFromConfig, getParamsValueAsString, getTagInfo, hasOwnProperty, isArrayOfString, isEnumFacetResponse, isHeaderMetadata, isPropertyKey, isTextTransform, isTimeGreaterThan, itemsInCart, mapFacetSortToSortType, measureExecutionTime, processBucketData, processDefinedRangeData, processLabel, processRangeData, processRangeKeyLabel, registerCohortBuilderDefaultPreviewRenderers, registerCohortDiscoveryApp, registerCohortSimilarityApp, registerDefaultDiscoveryDataLoaders, registerDiscoveryDefaultCellRenderers, registerDiscoveryDefaultStudyPreviewRenderers, registerExplorerDefaultCellRenderers, registerMetadataSchemaApp, removeIntersectionFromEnum, removeKey, removeUnion, resourcePathFromProjectID, export_default$3 as sessionLogout, handler as sessionToken, stripTrailingSlash, toCountsString, toDisplayName, truncateString, unixTimeToString, updateFacetEnum, useClearFilters, useDiscoveryContext, useExtractEnumFilterValues, useExtractRangeFilterValues, useFieldNameToTitle, useGetFacetFilters, useGuppyActionButton, useUpdateFilters, useUpdateFiltersFlat, userHasMethodForServiceOnResource, validateObjectHasRequiredFields };
3160
3157
  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, FieldNameToTitleFunction, FieldToName, Fonts, FooterProps, FromToRange, FromToRangeValues, Gen3AppConfigData, GetEnumFacetDataFunction, GetFacetCombineModeFunction, GetFacetDataFunction, GetNumericRangeFacetDataFunction, GetRangeFacetDataFunction, GetRangeFacetWithDefinedRangesDataFunction, GetTotalCountsFunction, HeaderMetadata, HeaderProps, LoginConfig, ModalsConfig, NavPageLayoutProps, NavigationProps, NumericFacetCardProps, NumericFacetProps, NumericRangeFacetHooks, NumericUnits, ProfileConfig, QueryOptions, QueryPageLayoutProps, QueryProps, RangeBucketElement, RangeFacetDataHooks, RangeFacetResponse, RangeFromOp, RangeToOp, ReactEChartsProps, RegisteredIcons, RepositoryConfiguration, RouteConfig, RowRenderFunctionParams, 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 };
@@ -0,0 +1,483 @@
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 lodash = require('lodash');
8
+ var core = require('@gen3/core');
9
+ var index = require('./index-DZzhGid9.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/head');
24
+ require('next/link');
25
+ require('next/image');
26
+ require('next/router');
27
+ require('next/navigation');
28
+ require('cookies-next');
29
+ require('swr');
30
+ require('jose');
31
+ require('cookie');
32
+ require('@gen3/core/server');
33
+ require('@mantine/notifications');
34
+ require('tinycolor2');
35
+ require('react-markdown');
36
+ require('react-icons/ai');
37
+ require('remark-gfm');
38
+ require('fs');
39
+ require('path');
40
+ require('mantine-react-table');
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-dom');
49
+ require('lodash/uniq');
50
+ require('lodash/sum');
51
+ require('react-icons/lu');
52
+ require('next/dynamic');
53
+ require('react-cookie');
54
+ require('default-composer');
55
+ require('filesize');
56
+ require('@dnd-kit/core');
57
+ require('@dnd-kit/sortable');
58
+ require('@dnd-kit/utilities');
59
+ require('@dnd-kit/modifiers');
60
+ require('universal-cookie');
61
+
62
+ const EmptyData = {};
63
+ /**
64
+ * CohortPanel is a React component that provides an interactive interface for cohort exploration and filtering.
65
+ * It integrates with data services and facilitates visualization, filtering, and analysis tasks.
66
+ *
67
+ * @param {Object} props The properties required to configure the CohortPanel component.
68
+ * @param {Object} props.guppyConfig Configuration object for Guppy, including field mappings and data type information.
69
+ * @param {Object} props.filters Configuration for filter tabs, including filter fields and layout.
70
+ * @param {Object} [props.charts={}] Optional set of chart configuration objects for rendering summaries.
71
+ * @param {Object} [props.chartsSection] Optional configuration for an additional section of charts.
72
+ * @param {Object} props.table Reference to the table configuration or component for displaying data.
73
+ * @param {string} props.tabTitle Title for the filter tab section.
74
+ * @param {Object[]|undefined} props.dropdowns Dropdown menu configuration, allowing for additional filter options or actions.
75
+ * @param {Object[]|undefined} props.buttons List of button configurations for actions such as downloads.
76
+ * @param {boolean} props.loginForDownload Determines whether login is required to enable download functionality.
77
+ * @param {boolean} [props.showAccessLevel=false] Indicates if the user access level should be displayed on the panel.
78
+ *
79
+ * @returns {JSX.Element} Returns a JSX element rendering the CohortPanel. This includes filter options,
80
+ * summary charts, cohort manager, and data display components.
81
+ */ const CohortPanel = ({ guppyConfig, filters, charts = {}, chartsSection = undefined, table, tabTitle, dropdowns, buttons, loginForDownload, showAccessLevel = false })=>{
82
+ const isSm = hooks.useMediaQuery('(min-width: 639px)');
83
+ const isMd = hooks.useMediaQuery('(min-width: 1373px)');
84
+ const isXl = hooks.useMediaQuery('(min-width: 1600px)');
85
+ const [accessLevel, setAccessLevel] = React.useState(core.Accessibility.ALL);
86
+ const sharedFiltersMap = core.useCoreSelector((state)=>core.selectSharedFilters(state));
87
+ const defaultDropdowns = React.useMemo(()=>dropdowns ?? {}, [
88
+ dropdowns
89
+ ]);
90
+ const defaultButtons = React.useMemo(()=>buttons ?? [], [
91
+ buttons
92
+ ]);
93
+ const numCols = React.useMemo(()=>{
94
+ if (isSm) return 1;
95
+ if (isMd) return 2;
96
+ if (isXl) return 4;
97
+ return 3;
98
+ }, [
99
+ isSm,
100
+ isMd,
101
+ isXl
102
+ ]);
103
+ const index$1 = guppyConfig.dataType;
104
+ const indexPrefix = guppyConfig?.indexPrefix ?? '';
105
+ const fields = React.useMemo(()=>index.getAllFieldsFromFilterConfigs(filters?.tabs ?? []), [
106
+ filters?.tabs
107
+ ]);
108
+ const coreDispatch = core.useCoreDispatch();
109
+ const [facetDefinitions, setFacetDefinitions] = React.useState({});
110
+ const [summaryCharts, setSummaryCharts] = React.useState({});
111
+ const cohortFilters = core.useCoreSelector((state)=>core.selectIndexFilters(state, index$1));
112
+ const cohortId = core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
113
+ const allFiltersCollapsed = core.useCoreSelector((state)=>core.selectAllCohortFiltersCollapsed(state, index$1));
114
+ const toggleAllFiltersExpanded = (expand)=>{
115
+ coreDispatch(core.toggleCohortBuilderAllFilters({
116
+ expand,
117
+ index: index$1
118
+ }));
119
+ };
120
+ const clearAllFilters = React.useCallback(()=>{
121
+ coreDispatch(core.clearCohortFilters({
122
+ index: index$1
123
+ }));
124
+ }, [
125
+ coreDispatch,
126
+ index$1
127
+ ]);
128
+ const { data, isSuccess, isFetching: isAggsQueryFetching, isError: isAggsQueryError } = core.useGetAggsQuery({
129
+ type: index$1,
130
+ fields: fields,
131
+ filters: cohortFilters,
132
+ accessibility: accessLevel,
133
+ queryId: cohortId,
134
+ indexPrefix: indexPrefix
135
+ });
136
+ const chartKeys = useDeepCompare.useDeepCompareMemo(()=>[
137
+ ...Object.keys(chartsSection?.charts ?? {}),
138
+ ...Object.keys(charts)
139
+ ], [
140
+ chartsSection?.charts,
141
+ charts
142
+ ]);
143
+ const { data: chartData, isSuccess: isChartSuccess, isFetching: isChartFetching, isError: isChartError } = core.useGetAggsQuery({
144
+ type: index$1,
145
+ fields: chartKeys,
146
+ filters: cohortFilters,
147
+ accessibility: accessLevel,
148
+ filterSelf: true,
149
+ queryId: cohortId,
150
+ indexPrefix: indexPrefix
151
+ }, {
152
+ skip: chartKeys.length === 0
153
+ });
154
+ const cleanChartData = useDeepCompare.useDeepCompareMemo(()=>{
155
+ if (isChartSuccess && chartData) {
156
+ const cleanedData = {};
157
+ const totalCount = chartData._totalCount[0]?.count;
158
+ Object.keys(summaryCharts).forEach((key)=>{
159
+ if (!(key in chartData)) {
160
+ return;
161
+ } // handle missing key in data
162
+ // remove empty keys
163
+ cleanedData[key] = chartData[key].filter((x)=>typeof x.key !== 'string' ? true : x.key !== '');
164
+ const facetDef = facetDefinitions?.[key];
165
+ if (facetDef?.excludeValues) {
166
+ cleanedData[key] = cleanedData[key].filter((x)=>typeof x.key !== 'string' ? true : facetDef?.excludeValues?.includes(String(x.key)) === false);
167
+ }
168
+ if (cleanedData[key].length === 0 && totalCount) {
169
+ // if no keys adds back no data
170
+ cleanedData[key] = [
171
+ {
172
+ key: 'no data',
173
+ count: totalCount
174
+ }
175
+ ];
176
+ }
177
+ });
178
+ return cleanedData;
179
+ }
180
+ return chartData;
181
+ }, [
182
+ chartData,
183
+ isChartSuccess,
184
+ summaryCharts
185
+ ]);
186
+ const getEnumFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
187
+ let filters = undefined;
188
+ let combineMode = 'or';
189
+ if (field in cohortFilters.root) {
190
+ if (core.isIntersection(cohortFilters.root[field])) {
191
+ const intersectionFilters = index.removeIntersectionFromEnum(cohortFilters.root[field]);
192
+ if (intersectionFilters) {
193
+ filters = core.extractEnumFilterValue(intersectionFilters);
194
+ combineMode = 'and';
195
+ }
196
+ } else {
197
+ filters = core.extractEnumFilterValue(cohortFilters.root[field]);
198
+ }
199
+ }
200
+ return {
201
+ data: index.processBucketData(data?.[field]),
202
+ enumFilters: filters,
203
+ combineMode: combineMode,
204
+ isSuccess: isSuccess
205
+ };
206
+ }, [
207
+ cohortFilters.root,
208
+ data,
209
+ isSuccess
210
+ ]);
211
+ const getRangeFacetData = useDeepCompare.useDeepCompareCallback((field)=>{
212
+ return {
213
+ data: index.processRangeData(data?.[field]),
214
+ filters: index.extractRangeValues(cohortFilters.root[field]),
215
+ isSuccess: isSuccess
216
+ };
217
+ }, [
218
+ data,
219
+ cohortFilters.root,
220
+ isSuccess
221
+ ]);
222
+ // Set up the hooks for the facet components to use based on the required index
223
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
224
+ // @ts-ignore
225
+ const facetDataHooks = useDeepCompare.useDeepCompareMemo(()=>{
226
+ return {
227
+ // TODO: see if there a better way to do this
228
+ enum: {
229
+ useGetFacetData: getEnumFacetData,
230
+ useUpdateFacetFilters: lodash.partial(index.useUpdateFilters, index$1),
231
+ useGetFacetFilters: lodash.partial(index.useGetFacetFilters, index$1),
232
+ useClearFilter: lodash.partial(index.useClearFilters, index$1),
233
+ useFilterExpanded: lodash.partial(index.useFilterExpandedState, index$1),
234
+ useToggleExpandFilter: lodash.partial(index.useToggleExpandFilter, index$1),
235
+ useGetCombineMode: lodash.partial(index.useCohortFilterCombineState, index$1),
236
+ useSetCombineMode: lodash.partial(index.useSetCohortFilterCombineState, index$1),
237
+ useFieldNameToTitle: index.useFieldNameToTitle,
238
+ useTotalCounts: undefined
239
+ },
240
+ exact: {
241
+ useGetFacetData: getEnumFacetData,
242
+ useUpdateFacetFilters: lodash.partial(index.useUpdateFilters, index$1),
243
+ useGetFacetFilters: lodash.partial(index.useGetFacetFilters, index$1),
244
+ useClearFilter: lodash.partial(index.useClearFilters, index$1),
245
+ useFilterExpanded: lodash.partial(index.useFilterExpandedState, index$1),
246
+ useToggleExpandFilter: lodash.partial(index.useToggleExpandFilter, index$1),
247
+ useFieldNameToTitle: index.useFieldNameToTitle,
248
+ useTotalCounts: undefined
249
+ },
250
+ multiselect: {
251
+ useGetFacetData: getEnumFacetData,
252
+ useUpdateFacetFilters: lodash.partial(index.useUpdateFilters, index$1),
253
+ useGetFacetFilters: lodash.partial(index.useGetFacetFilters, index$1),
254
+ useClearFilter: lodash.partial(index.useClearFilters, index$1),
255
+ useFilterExpanded: lodash.partial(index.useFilterExpandedState, index$1),
256
+ useToggleExpandFilter: lodash.partial(index.useToggleExpandFilter, index$1),
257
+ useFieldNameToTitle: index.useFieldNameToTitle,
258
+ useTotalCounts: undefined
259
+ },
260
+ range: {
261
+ useGetFacetData: getRangeFacetData,
262
+ useUpdateFacetFilters: lodash.partial(index.useUpdateFilters, index$1),
263
+ useGetFacetFilters: lodash.partial(index.useGetFacetFilters, index$1),
264
+ useClearFilter: lodash.partial(index.useClearFilters, index$1),
265
+ useFilterExpanded: lodash.partial(index.useFilterExpandedState, index$1),
266
+ useToggleExpandFilter: lodash.partial(index.useToggleExpandFilter, index$1),
267
+ useFieldNameToTitle: index.useFieldNameToTitle,
268
+ useTotalCounts: undefined
269
+ }
270
+ };
271
+ }, [
272
+ getEnumFacetData,
273
+ getRangeFacetData,
274
+ index$1
275
+ ]);
276
+ // Set the facet definitions based on the data only the first time the data is loaded
277
+ useDeepCompare.useDeepCompareEffect(()=>{
278
+ if (isSuccess && Object.keys(facetDefinitions).length === 0) {
279
+ const configFacetDefs = filters?.tabs.reduce((acc, tab)=>{
280
+ return {
281
+ ...tab.fieldsConfig,
282
+ ...acc
283
+ };
284
+ }, {});
285
+ const facetDefs = index.classifyFacets(data, index$1, guppyConfig?.fieldMapping ?? [], configFacetDefs ?? {}, sharedFiltersMap);
286
+ setFacetDefinitions(facetDefs);
287
+ // setup summary charts since nested fields can be listed by the split field name
288
+ const chartDefinitions = chartsSection?.charts ?? charts;
289
+ const summaryCharts = Object.keys(chartDefinitions).reduce((acc, field)=>{
290
+ let chartField = field;
291
+ if (facetDefs?.[field] === undefined) {
292
+ const res = Object.values(facetDefs).filter((def)=>{
293
+ return def.dataField === field;
294
+ });
295
+ if (res.length > 0) {
296
+ chartField = res[0].field;
297
+ }
298
+ }
299
+ return {
300
+ ...acc,
301
+ [chartField]: chartDefinitions[field]
302
+ };
303
+ }, {});
304
+ setSummaryCharts(summaryCharts);
305
+ }
306
+ }, [
307
+ isSuccess,
308
+ data,
309
+ facetDefinitions,
310
+ index$1,
311
+ guppyConfig.fieldMapping,
312
+ charts,
313
+ chartsSection
314
+ ]);
315
+ const { data: counts, isFetching: isCountsFetching, isError: isCountsError } = core.useGetCountsQuery({
316
+ type: index$1,
317
+ filters: cohortFilters,
318
+ accessibility: accessLevel,
319
+ queryId: cohortId
320
+ });
321
+ if (isCountsError || isAggsQueryError) {
322
+ return /*#__PURE__*/ jsxRuntime.jsx(index.ErrorCard, {
323
+ message: "Unable to fetch data from server"
324
+ }); // TODO: replace with configurable message
325
+ }
326
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
327
+ className: "flex flex-col mt-3 relative px-4 bg-base-lightest w-full",
328
+ children: [
329
+ /*#__PURE__*/ jsxRuntime.jsx(index.QueryExpression, {
330
+ index: index$1
331
+ }),
332
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
333
+ className: "flex w-full",
334
+ children: [
335
+ /*#__PURE__*/ jsxRuntime.jsx("div", {
336
+ id: "cohort-builder-filters",
337
+ className: "flex-shrink-0 md:w-1/4 lg:w-1/5",
338
+ children: filters?.tabs && /*#__PURE__*/ jsxRuntime.jsx(index.DropdownPanel, {
339
+ filters: filters,
340
+ tabTitle: tabTitle,
341
+ facetDefinitions: facetDefinitions,
342
+ facetDataHooks: facetDataHooks,
343
+ onAccessChange: setAccessLevel,
344
+ accessLevel: accessLevel,
345
+ showAccessLevel: showAccessLevel,
346
+ allFiltersCollapsed: allFiltersCollapsed,
347
+ toggleAllFiltersExpanded: toggleAllFiltersExpanded,
348
+ clearAllFilters: clearAllFilters
349
+ })
350
+ }),
351
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
352
+ id: "cohort-builder-content",
353
+ className: "flex flex-col md:w-3/4 lg:w-4/5 pl-4",
354
+ children: [
355
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
356
+ className: "flex justify-between mb-2 ml-2",
357
+ children: [
358
+ /*#__PURE__*/ jsxRuntime.jsx(index.DownloadsPanel, {
359
+ dropdowns: defaultDropdowns,
360
+ buttons: defaultButtons,
361
+ loginForDownload: loginForDownload,
362
+ index: index$1,
363
+ totalCount: counts ?? 0,
364
+ fields: table?.fields ?? [],
365
+ filter: cohortFilters
366
+ }),
367
+ /*#__PURE__*/ jsxRuntime.jsx(index.CountsValue, {
368
+ label: guppyConfig?.nodeCountTitle || index.toDisplayName(index$1),
369
+ configuration: guppyConfig?.nodeCountConfiguration,
370
+ counts: counts,
371
+ isFetching: isCountsFetching,
372
+ isError: isCountsError
373
+ })
374
+ ]
375
+ }),
376
+ chartsSection?.enabled ? /*#__PURE__*/ jsxRuntime.jsx(index.CollapsableCharts, {
377
+ config: {
378
+ ...chartsSection,
379
+ charts: summaryCharts
380
+ },
381
+ data: cleanChartData ?? EmptyData,
382
+ isSuccess: isChartSuccess,
383
+ isFetching: isChartFetching,
384
+ isError: isChartError
385
+ }) : /*#__PURE__*/ jsxRuntime.jsx(index.Charts, {
386
+ charts: summaryCharts,
387
+ data: cleanChartData ?? EmptyData,
388
+ counts: counts,
389
+ isSuccess: isChartSuccess,
390
+ isError: isChartError,
391
+ numCols: numCols
392
+ }),
393
+ table?.enabled && /*#__PURE__*/ jsxRuntime.jsx("div", {
394
+ className: "mt-2 flex flex-col",
395
+ children: /*#__PURE__*/ jsxRuntime.jsx(index.ExplorerTable, {
396
+ index: index$1,
397
+ tableConfig: table,
398
+ accessibility: accessLevel
399
+ })
400
+ })
401
+ ]
402
+ })
403
+ ]
404
+ })
405
+ ]
406
+ });
407
+ };
408
+
409
+ const TabsLayoutToComponentProp = (tabsLayout)=>{
410
+ if (!tabsLayout) {
411
+ return 'flex-start';
412
+ }
413
+ switch(tabsLayout){
414
+ case 'left':
415
+ {
416
+ return 'flex-start';
417
+ }
418
+ case 'right':
419
+ {
420
+ return 'flex-end';
421
+ }
422
+ case 'center':
423
+ {
424
+ return 'center';
425
+ }
426
+ default:
427
+ {
428
+ return 'flex-start';
429
+ }
430
+ }
431
+ };
432
+
433
+ const useGetCurrentCohort = ()=>{
434
+ return core.useCoreSelector((state)=>core.selectCurrentCohortId(state));
435
+ };
436
+ const CohortBuilder = ({ explorerConfig, sharedFiltersMap = null, tabsLayout = 'left', enableCohortManager = true })=>{
437
+ const dispatch = core.useCoreDispatch();
438
+ dispatch(core.setSharedFilters(sharedFiltersMap ?? {}));
439
+ const configuration = useDeepCompare.useDeepCompareMemo(()=>explorerConfig, [
440
+ explorerConfig
441
+ ]);
442
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
443
+ className: "flex flex-col w-full mt-2",
444
+ children: [
445
+ enableCohortManager ? /*#__PURE__*/ jsxRuntime.jsx(index.CohortManager, {}) : null,
446
+ /*#__PURE__*/ jsxRuntime.jsxs(core$1.Tabs, {
447
+ color: "primary.5",
448
+ variant: explorerConfig[0]?.tabType,
449
+ keepMounted: true,
450
+ defaultValue: explorerConfig[0].tabTitle,
451
+ children: [
452
+ /*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.List, {
453
+ className: "w-full",
454
+ justify: TabsLayoutToComponentProp(tabsLayout),
455
+ children: configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Tab, {
456
+ value: panelConfig.tabTitle,
457
+ children: panelConfig.tabTitle
458
+ }, `${panelConfig.tabTitle}-tabList`))
459
+ }),
460
+ configuration.map((panelConfig)=>/*#__PURE__*/ jsxRuntime.jsx(core$1.Tabs.Panel, {
461
+ value: panelConfig.tabTitle,
462
+ children: /*#__PURE__*/ jsxRuntime.jsx(CohortPanel, {
463
+ guppyConfig: panelConfig.guppyConfig,
464
+ chartsSection: panelConfig?.chartsSection,
465
+ charts: panelConfig?.charts,
466
+ filters: panelConfig.filters,
467
+ tabTitle: panelConfig.tabTitle,
468
+ table: panelConfig.table,
469
+ dropdowns: panelConfig.dropdowns,
470
+ buttons: panelConfig.buttons,
471
+ loginForDownload: panelConfig.loginForDownload,
472
+ sharedFiltersMap: panelConfig.sharedFiltersMap
473
+ }, `${panelConfig.tabTitle}-CohortPanel`)
474
+ }, `${panelConfig.tabTitle}-tabPanel`))
475
+ ]
476
+ })
477
+ ]
478
+ });
479
+ };
480
+
481
+ exports.default = CohortBuilder;
482
+ exports.useGetCurrentCohort = useGetCurrentCohort;
483
+ //# sourceMappingURL=CohortBuilder-BBuNjs02.js.map