udp-react-enterprise-component-library 25.18.1-beta.64 → 25.18.1-beta.66

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 (86) hide show
  1. package/dist/AgTable-B2xTzAm2.js.map +1 -1
  2. package/dist/AmChart-CTixft8X.js.map +1 -1
  3. package/dist/{AmbientToggleButtonGroup-Bi9yW5gC.js → AmbientToggleButtonGroup-DgFod3VK.js} +1 -1
  4. package/dist/{AmbientToggleButtonGroup-Bi9yW5gC.js.map → AmbientToggleButtonGroup-DgFod3VK.js.map} +1 -1
  5. package/dist/{AmbientVisualizationCard-BmTQR121.js → AmbientVisualizationCard-CAxx4QWe.js} +2 -2
  6. package/dist/{AmbientVisualizationCard-BmTQR121.js.map → AmbientVisualizationCard-CAxx4QWe.js.map} +1 -1
  7. package/dist/AuthProvider-J79EBNDc.js.map +1 -1
  8. package/dist/DashboardWidget-CsOrr74H.js.map +1 -1
  9. package/dist/Field-Cda5rJe2.js.map +1 -1
  10. package/dist/Form-DbOA5j38.js.map +1 -1
  11. package/dist/FormButtons-BTCO-pzW.js.map +1 -1
  12. package/dist/LayoutUnit-D4jJvonh.js.map +1 -1
  13. package/dist/MenuProvider-BqEZve2y.js.map +1 -1
  14. package/dist/{Notes-YAF2dipI.js → Notes-BPaEmexk.js} +2 -2
  15. package/dist/{Notes-YAF2dipI.js.map → Notes-BPaEmexk.js.map} +1 -1
  16. package/dist/NumberOperator-p4HsHHx3.js.map +1 -1
  17. package/dist/PAHAdditionalRightComponent-DMOU9Mho.js.map +1 -1
  18. package/dist/PDFViewer-B4nJKbIy.js.map +1 -1
  19. package/dist/PageContext-BpOBJHpb.js.map +1 -1
  20. package/dist/{PaymentForm-DFJrSIy8.js → PaymentForm-Dum5p1mf.js} +2 -2
  21. package/dist/PaymentForm-Dum5p1mf.js.map +1 -0
  22. package/dist/PrimaryActionHeader-DBJpROPu.js.map +1 -1
  23. package/dist/SearchOperator-D9838PIe.js.map +1 -1
  24. package/dist/SearchUtilities-DUW0kaw_.js.map +1 -1
  25. package/dist/TenantProvider-BeFMHYP8.js.map +1 -1
  26. package/dist/{TrimForAvatar-BmM2bU6E.js → TrimForAvatar-BP1gZWd5.js} +1 -1
  27. package/dist/{TrimForAvatar-BmM2bU6E.js.map → TrimForAvatar-BP1gZWd5.js.map} +1 -1
  28. package/dist/UI/dataDisplay/notes/index.js +1 -1
  29. package/dist/UI/inputs/buttons/UdpActionCard/index.js +1 -1
  30. package/dist/UI/inputs/buttons/index.js +3 -3
  31. package/dist/UI/surfaces/cards/chartDisplayCards/index.js +1 -1
  32. package/dist/{UdpActionCard-D-YAYE-C.js → UdpActionCard-VtAacuCM.js} +1 -1
  33. package/dist/{UdpActionCard-D-YAYE-C.js.map → UdpActionCard-VtAacuCM.js.map} +1 -1
  34. package/dist/UdpAppProvider-DXgzyeHZ.js.map +1 -1
  35. package/dist/UdpBarChart-D2bfgm7n.js.map +1 -1
  36. package/dist/UdpMapToolbar-B410Zi_h.js.map +1 -1
  37. package/dist/{UdpTransactionTypesPage-CWA-n7y0.js → UdpTransactionTypesPage-DgFxT4pz.js} +138 -32
  38. package/dist/UdpTransactionTypesPage-DgFxT4pz.js.map +1 -0
  39. package/dist/{UdpTransactionsPage-CDyNjmyo.js → UdpTransactionsPage-KgkwaNGG.js} +28 -28
  40. package/dist/UdpTransactionsPage-KgkwaNGG.js.map +1 -0
  41. package/dist/UnityIconLibrary-CjIwzfjv.js.map +1 -1
  42. package/dist/actionSummary-D0CwyTXJ.js.map +1 -1
  43. package/dist/advancedSearchBuilder-7ixhIwLW.js.map +1 -1
  44. package/dist/aggridHelpers-BvrSzjdD.js.map +1 -1
  45. package/dist/apiHelpers-WIR8pqy0.js.map +1 -1
  46. package/dist/auth-BWJ4-JF-.js.map +1 -1
  47. package/dist/{buttons-CuLiERQe.js → buttons-DyKpA2qY.js} +1 -1
  48. package/dist/{buttons-CuLiERQe.js.map → buttons-DyKpA2qY.js.map} +1 -1
  49. package/dist/catalogStore-DP2GxpTJ.js.map +1 -1
  50. package/dist/charts-pX01x8rO.js.map +1 -1
  51. package/dist/form-Dj1zVw6K.js.map +1 -1
  52. package/dist/hooks-BNndjGer.js.map +1 -1
  53. package/dist/index.js +7 -7
  54. package/dist/lookupsStore-DPI8oD9R.js.map +1 -1
  55. package/dist/maps-BgmvNpkU.js.map +1 -1
  56. package/dist/newGrid-zmtQXU5G.js.map +1 -1
  57. package/dist/profile-7BieC5qc.js.map +1 -1
  58. package/dist/shellStore-C8zfPsZ-.js.map +1 -1
  59. package/dist/stepper-BaIo_Rol.js.map +1 -1
  60. package/dist/{stringUtils-B2JFmevx.js → stringUtils-CLVoXAz_.js} +1 -1
  61. package/dist/{stringUtils-B2JFmevx.js.map → stringUtils-CLVoXAz_.js.map} +1 -1
  62. package/dist/teleporterStore-CjUFtATo.js.map +1 -1
  63. package/dist/tenantStore-CFYu7ndZ.js.map +1 -1
  64. package/dist/types/src/udp/pages/UdpTransactionTypesPage/UdpTransactionTypesPage.d.ts.map +1 -1
  65. package/dist/types/src/udp/pages/UdpTransactionTypesPage/forms/UdpTransactionTypeForm.d.ts.map +1 -1
  66. package/dist/types/src/udp/pages/UdpTransactionTypesPage/sidesheets/UdpTransactionTypeSidesheet.d.ts.map +1 -1
  67. package/dist/types/src/udp/pages/UdpTransactionsPage/UdpTransactionGrid.d.ts.map +1 -1
  68. package/dist/types/src/udp/pages/UdpTransactionsPage/sidesheets/AttachmentTransaction.d.ts.map +1 -1
  69. package/dist/types/src/utilities/transactions/useTransactionEngine.d.ts.map +1 -1
  70. package/dist/types/tsconfig.tsbuildinfo +1 -1
  71. package/dist/udp/pages/UdpPages/index.js +2 -2
  72. package/dist/udp/pages/UdpTransactionTypesPage/index.js +1 -1
  73. package/dist/udp/pages/UdpTransactionsPage/index.js +1 -1
  74. package/dist/useAuthedUser-Bhr7Yhlg.js.map +1 -1
  75. package/dist/useQueryExecutors-DuuHrj2M.js.map +1 -1
  76. package/dist/useUser-wpHGo6jU.js.map +1 -1
  77. package/dist/utilities/form/paymentForm/index.js +1 -1
  78. package/dist/utilities/index.js +2 -2
  79. package/dist/workflowStore-CCoN5uHd.js.map +1 -1
  80. package/export-map.json +1 -1
  81. package/package.json +1 -1
  82. package/dist/PaymentForm-DFJrSIy8.js.map +0 -1
  83. package/dist/UdpTransactionTypesPage-CWA-n7y0.js.map +0 -1
  84. package/dist/UdpTransactionsPage-CDyNjmyo.js.map +0 -1
  85. /package/dist/{iconLibrary-Bw7pnkIf.js → iconLibrary-CMA3TPMW.js} +0 -0
  86. /package/dist/{utilities-C1bpHZ4f.js → utilities-WN7twALD.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"actionSummary-D0CwyTXJ.js","names":["useStyles","ActionSummaryCard: FC<ActionSummaryProps>","useStyles","ActionSummaryListContainer: FC<\n ActionSummaryListContainerProps\n>","count: number","useStyles","ActionSummaryHeader: FC<ActionSummaryHeaderProps>","useStyles","ActionSummaryListItem: FC<ActionSummaryListItemProps>","Typography"],"sources":["../src/actions/actionSummary/ActionSummaryCard.tsx","../src/actions/actionSummary/ActionSummaryListContainer.tsx","../src/actions/actionSummary/ActionSummaryHeader.tsx","../src/actions/actionSummary/ActionSummaryListItem.tsx","../src/actions/actionSummary/ActionSummaryPopover.jsx"],"sourcesContent":["import React, { FC, useState } from 'react';\nimport { makeStyles, Typography } from '@material-ui/core';\nimport { FluentSearchField } from '../../UI/inputs/textField/FluentSearchField';\nimport {\n ActionSummaryHeader,\n ActionSummaryListContainer,\n ActionSummaryListItemProps\n} from '.';\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n width: 750,\n paddingLeft: 12,\n paddingRight: 12,\n maxHeight: 750,\n overflowY: 'scroll'\n },\n header: {\n display: 'flex',\n justifyContent: 'space-between'\n //backgroundColor: 'red'\n }\n}));\n\nexport type ActionSummaryProps = {\n actionMenuContent: Array<ActionSummaryContent>;\n selectedNode: object | null | undefined;\n};\n\nexport type ActionSummaryContent = {\n header: string;\n icon: string;\n iconType?: string;\n items: Array<ActionSummaryListItemProps>;\n};\n\nexport const ActionSummaryCard: FC<ActionSummaryProps> = ({\n actionMenuContent,\n selectedNode\n}: ActionSummaryProps) => {\n const classes = useStyles();\n const [searchValue, setSearchValue] = useState<string>('');\n\n return (\n <div className={classes.root}>\n <div className={classes.header}>\n <div\n style={{\n display: 'flex',\n justifyContent: 'center',\n flexDirection: 'column'\n }}\n >\n <Typography variant='h6'>Actions</Typography>\n </div>\n <FluentSearchField\n id='udpRecord-ActionSummaryCard-Search'\n udprecordid='udpRecord-ActionSummaryCard-Search'\n value={searchValue}\n onChange={(e: any) => setSearchValue(e.target.value)}\n variant='filled'\n // searchOptions={searchOptions}\n style={{ marginTop: 0, paddingTop: 0 }}\n />\n </div>\n {actionMenuContent.map((section: ActionSummaryContent, i: number) => (\n <>\n <ActionSummaryHeader\n key={i}\n iconType={section.iconType}\n icon={section.icon}\n header={section.header}\n />\n <ActionSummaryListContainer\n key={i}\n selectedNode={selectedNode}\n items={section.items.map((item): ActionSummaryListItemProps => {\n const highlighted =\n item?.value &&\n item.value.toLowerCase().includes(searchValue.toLowerCase()) &&\n searchValue.length > 0;\n return { ...item, highlighted: highlighted || item.highlighted };\n })}\n />\n </>\n ))}\n </div>\n );\n};\n","import { List, makeStyles, Typography, ListItem } from '@material-ui/core';\nimport React, { FC, MutableRefObject } from 'react';\nimport { ActionSummaryListItemProps, ActionSummaryListItem } from '.';\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n display: 'flex',\n flexWrap: 'wrap',\n overflowY: 'scroll',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n itemContainer: {\n display: 'flex',\n flexDirection: 'column',\n paddingLeft: 1,\n // paddingBottom: theme.spacing(2),\n width: '33%'\n }\n}));\n\ntype ActionSummaryListContainerProps = {\n items: Array<ActionSummaryListItemProps>;\n selectedNode?: object;\n};\n\nexport const ActionSummaryListContainer: FC<\n ActionSummaryListContainerProps\n> = ({ items, selectedNode }: ActionSummaryListContainerProps) => {\n const classes = useStyles();\n function* keyGenerator() {\n let count: number = 0;\n while (true) {\n yield count++;\n }\n }\n const countGen = keyGenerator();\n return (\n <div className={classes.root}>\n <div className={classes.itemContainer}>\n <List disablePadding>\n {items\n .filter((item, i) => i % 3 === 0)\n .map((item: ActionSummaryListItemProps) => (\n <ActionSummaryListItem\n selectedNode={selectedNode}\n {...item}\n key={countGen.next().value as number}\n />\n ))}\n </List>\n </div>\n <div className={classes.itemContainer}>\n <List disablePadding>\n {items\n .filter((item, i) => i % 3 === 1)\n .map((item: ActionSummaryListItemProps) => (\n <ActionSummaryListItem\n selectedNode={selectedNode}\n {...item}\n key={countGen.next().value as number}\n />\n ))}\n </List>\n </div>\n <div className={classes.itemContainer}>\n <List disablePadding>\n {items\n .filter((item, i) => i % 3 === 2)\n .map((item: ActionSummaryListItemProps) => (\n <ActionSummaryListItem\n selectedNode={selectedNode}\n {...item}\n key={countGen.next().value as number}\n />\n ))}\n </List>\n </div>\n </div>\n );\n};\n","import * as Icons from \"@fluentui/react-icons\";\nimport { makeStyles, Typography } from \"@material-ui/core\";\nimport React, { FC } from \"react\";\nimport { UnityFluentIcon } from '../../utilities/iconLibrary/UnityFluentIcon'\n\ntype ActionSummaryHeaderProps = {\n icon: string;\n header: string;\n iconType?: string\n};\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n backgroundColor: theme.palette.primary.main + '1A',\n display: \"flex\",\n padding: 5,\n gap: 10,\n },\n container: {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center'\n\n },\n icon: {\n color: theme.palette.primary.main\n }\n}));\n\nexport const ActionSummaryHeader: FC<ActionSummaryHeaderProps> = (\n {\n icon,\n header,\n iconType\n }: ActionSummaryHeaderProps\n) => {\n const classes = useStyles();\n return (\n <div className={classes.root}>\n <div className={classes.container}>\n <UnityFluentIcon className={classes.icon} type={iconType} component={Icons[icon]} />\n </div>\n <div className={classes.container}>\n <Typography display='inline' variant='h6' >{header}</Typography>\n </div>\n </div>\n );\n};\n","import React, { FC, useMemo, MutableRefObject } from 'react';\nimport { Chip, makeStyles } from '@material-ui/core';\nimport { useActions } from '../../hooks/useActions';\nimport { UdpTheme } from '../../utilities/theme/theme.types';\n\nexport type ActionSummaryListItemProps = {\n value: string;\n highlighted?: boolean; // gives an mui chip background\n enabled?: boolean; // greys out the item\n actionId: string;\n setLoading: Function;\n selectedNode?: any;\n};\n\nconst useStyles = makeStyles((theme: UdpTheme) => ({\n listItemWithChip: {\n paddingTop: 1,\n paddingBottom: 1,\n alignItems: 'start'\n },\n listItemGutters: {\n paddingLeft: 10\n },\n chipSelected: {\n backgroundColor: theme.palette.secondary.main + '1A',\n color: theme?.getThemeData()?.mode === 'light' ? 'black' : 'white'\n },\n chipWhite: {\n color: theme?.getThemeData()?.mode === 'light' ? 'black' : 'white',\n backgroundColor: theme.palette.background.paper\n },\n chipRoot: {\n width: '100%',\n justifyContent: 'start',\n paddingTop: 1\n },\n chipWhiteDeselected: {\n color: 'grey',\n backgroundColor: theme.palette.background.paper\n },\n chipHover: {\n '&:hover': {\n backgroundColor: theme.palette.secondary.main + '3A'\n },\n '&:focus': {\n backgroundColor: theme.palette.secondary.main + '3A'\n }\n }\n}));\n\nexport const ActionSummaryListItem: FC<ActionSummaryListItemProps> = ({\n value,\n highlighted,\n enabled,\n actionId,\n selectedNode\n}: ActionSummaryListItemProps) => {\n const classes = useStyles();\n const { triggerAction } = useActions();\n const render = useMemo(() => {\n return (\n <div className={classes.listItemWithChip}>\n <Chip\n color='primary'\n clickable={enabled}\n onClick={\n enabled\n ? () => triggerAction(actionId, selectedNode?.nodeObj)\n : () => {}\n }\n classes={{\n colorPrimary: enabled\n ? highlighted\n ? classes.chipSelected\n : classes.chipWhite\n : classes.chipWhiteDeselected,\n root: classes.chipRoot,\n clickableColorPrimary: classes.chipHover\n }}\n label={value}\n />\n </div>\n );\n }, [highlighted, enabled, value]);\n\n return render;\n};\n","import { MoreVerticalIcon } from '@fluentui/react-icons';\nimport { makeStyles, Popover } from '@material-ui/core';\nimport PropTypes from 'prop-types';\nimport React, { useState, useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { ActionSummaryCard } from './';\nimport { evaluateRule, mapRule } from '../../utilities/rules/RuleUtilities';\nimport { PrimaryActionButton } from '../../UI/inputs/buttons/PrimaryActionButton';\nimport { Typography } from '../../UI/dataDisplay/typography/Typography';\n\nconst useStyles = makeStyles((theme) => ({\n root: {},\n actionsMenu: {\n color: theme?.palette?.getContrastText(theme?.palette?.primary?.main)\n }\n}));\n\nexport const ActionSummaryPopover = (props) => {\n const { panelActions, noContrastColor, selectedNode, setLoading } = props;\n const classes = useStyles();\n const [anchorEl, setAnchorEl] = useState(null);\n const { t } = useTranslation();\n\n const handleClick = (event) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const actionSummaryPopoverActions = useMemo(() => {\n return panelActions?.reduce((actions, current) => {\n if (!current.enabled) return actions;\n\n const passRule =\n current.action.actionRules?.reduce((boolValue, rule) => {\n const ruleExpression = mapRule(rule.mapping, rule.jsonLogic);\n return (\n boolValue &&\n evaluateRule(\n ruleExpression,\n selectedNode?.nodeObj,\n selectedNode?.properties?.joiningEntityCatalogObjectKey,\n selectedNode?.wasLazyLoaded\n )\n );\n }, true) ?? true;\n\n if (!passRule && current?.hideAction) return actions;\n\n const currentVal = {\n value: current.action.name,\n actionId: current.actionId,\n sequence: current.sequence,\n enabled: passRule\n };\n\n const group = actions.find(\n (action) =>\n action?.header?.toLowerCase() === current?.groupName?.toLowerCase()\n );\n if (group) {\n group.items.push(currentVal);\n group.items.sort((a, b) => a.sequence - b.sequence);\n } else {\n actions.push({\n header: current.groupName,\n icon: current.icon.name,\n iconType: current.icon.type,\n items: [currentVal]\n });\n }\n return actions;\n }, []);\n }, [panelActions, selectedNode]);\n\n const open = Boolean(anchorEl);\n const id = open ? 'action-summary-popover' : undefined;\n\n return (\n <>\n <PrimaryActionButton onClick={handleClick} icon={<MoreVerticalIcon />}>\n <Typography>{t('Actions')}</Typography>\n </PrimaryActionButton>\n\n <Popover\n id={id}\n open={open}\n anchorEl={anchorEl}\n onClose={handleClose}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'left'\n }}\n >\n <ActionSummaryCard\n actionMenuContent={actionSummaryPopoverActions}\n setLoading={setLoading}\n selectedNode={selectedNode}\n />\n </Popover>\n </>\n );\n};\n\nActionSummaryPopover.propTypes = {\n /**\n * Actions configured within Action Panel\n */\n panelActions: PropTypes.array,\n /**\n * Boolean to toggle contrast color\n */\n noContrastColor: PropTypes.bool,\n /**\n * Action Panels\n */\n selectedNode: PropTypes.object\n};\n"],"mappings":";;;;;;;;;;;;;;AASA,MAAMA,cAAY,YAAY,WAAW;CACvC,MAAM;EACJ,OAAO;EACP,aAAa;EACb,cAAc;EACd,WAAW;EACX,WAAW;EACZ;CACD,QAAQ;EACN,SAAS;EACT,gBAAgB;EAEjB;CACF,EAAE;AAcH,MAAaC,qBAA6C,EACxD,mBACA,mBACwB;CACxB,MAAM,UAAUD,aAAW;CAC3B,MAAM,CAAC,aAAa,kBAAkB,SAAiB,GAAG;AAE1D,QACE,oCAAC,SAAI,WAAW,QAAQ,QACtB,oCAAC,SAAI,WAAW,QAAQ,UACtB,oCAAC,SACC,OAAO;EACL,SAAS;EACT,gBAAgB;EAChB,eAAe;EAChB,IAED,oCAAC,cAAW,SAAQ,QAAK,UAAoB,CACzC,EACN,oCAAC;EACC,IAAG;EACH,aAAY;EACZ,OAAO;EACP,WAAW,MAAW,eAAe,EAAE,OAAO,MAAM;EACpD,SAAQ;EAER,OAAO;GAAE,WAAW;GAAG,YAAY;GAAG;GACtC,CACE,EACL,kBAAkB,KAAK,SAA+B,MACrD,0DACE,oCAAC;EACC,KAAK;EACL,UAAU,QAAQ;EAClB,MAAM,QAAQ;EACd,QAAQ,QAAQ;GAChB,EACF,oCAAC;EACC,KAAK;EACS;EACd,OAAO,QAAQ,MAAM,KAAK,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W;AAC5B,UAAM,MAAM,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,SAAS;SAEnD,SAAQ,KAAK;IACX,QAAQ,QAAQ;IAChB,MAAM,QAAQ,KAAK;IACnB,UAAU,QAAQ,KAAK;IACvB,OAAO,CAAC,WAAW;IACpB,CAAC;AAEJ,UAAO;KACN,EAAE,CAAC;IACL,CAAC,cAAc,aAAa,CAAC;CAEhC,MAAM,OAAO,QAAQ,SAAS;CAC9B,MAAM,KAAK,OAAO,2BAA2B;AAE7C,QACE,0DACE,oCAAC;EAAoB,SAAS;EAAa,MAAM,oCAAC,uBAAmB;IACnE,oCAACE,oBAAY,EAAE,UAAU,CAAc,CACnB,EAEtB,oCAAC;EACK;EACE;EACI;EACV,SAAS;EACT,cAAc;GACZ,UAAU;GACV,YAAY;GACb;IAED,oCAAC;EACC,mBAAmB;EACP;EACE;GACd,CACM,CACT;;AAIP,qBAAqB,YAAY;CAI/B,cAAc,UAAU;CAIxB,iBAAiB,UAAU;CAI3B,cAAc,UAAU;CACzB"}
1
+ {"version":3,"file":"actionSummary-D0CwyTXJ.js","names":["useStyles","useStyles","useStyles","useStyles","Typography"],"sources":["../src/actions/actionSummary/ActionSummaryCard.tsx","../src/actions/actionSummary/ActionSummaryListContainer.tsx","../src/actions/actionSummary/ActionSummaryHeader.tsx","../src/actions/actionSummary/ActionSummaryListItem.tsx","../src/actions/actionSummary/ActionSummaryPopover.jsx"],"sourcesContent":["import React, { FC, useState } from 'react';\nimport { makeStyles, Typography } from '@material-ui/core';\nimport { FluentSearchField } from '../../UI/inputs/textField/FluentSearchField';\nimport {\n ActionSummaryHeader,\n ActionSummaryListContainer,\n ActionSummaryListItemProps\n} from '.';\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n width: 750,\n paddingLeft: 12,\n paddingRight: 12,\n maxHeight: 750,\n overflowY: 'scroll'\n },\n header: {\n display: 'flex',\n justifyContent: 'space-between'\n //backgroundColor: 'red'\n }\n}));\n\nexport type ActionSummaryProps = {\n actionMenuContent: Array<ActionSummaryContent>;\n selectedNode: object | null | undefined;\n};\n\nexport type ActionSummaryContent = {\n header: string;\n icon: string;\n iconType?: string;\n items: Array<ActionSummaryListItemProps>;\n};\n\nexport const ActionSummaryCard: FC<ActionSummaryProps> = ({\n actionMenuContent,\n selectedNode\n}: ActionSummaryProps) => {\n const classes = useStyles();\n const [searchValue, setSearchValue] = useState<string>('');\n\n return (\n <div className={classes.root}>\n <div className={classes.header}>\n <div\n style={{\n display: 'flex',\n justifyContent: 'center',\n flexDirection: 'column'\n }}\n >\n <Typography variant='h6'>Actions</Typography>\n </div>\n <FluentSearchField\n id='udpRecord-ActionSummaryCard-Search'\n udprecordid='udpRecord-ActionSummaryCard-Search'\n value={searchValue}\n onChange={(e: any) => setSearchValue(e.target.value)}\n variant='filled'\n // searchOptions={searchOptions}\n style={{ marginTop: 0, paddingTop: 0 }}\n />\n </div>\n {actionMenuContent.map((section: ActionSummaryContent, i: number) => (\n <>\n <ActionSummaryHeader\n key={i}\n iconType={section.iconType}\n icon={section.icon}\n header={section.header}\n />\n <ActionSummaryListContainer\n key={i}\n selectedNode={selectedNode}\n items={section.items.map((item): ActionSummaryListItemProps => {\n const highlighted =\n item?.value &&\n item.value.toLowerCase().includes(searchValue.toLowerCase()) &&\n searchValue.length > 0;\n return { ...item, highlighted: highlighted || item.highlighted };\n })}\n />\n </>\n ))}\n </div>\n );\n};\n","import { List, makeStyles, Typography, ListItem } from '@material-ui/core';\nimport React, { FC, MutableRefObject } from 'react';\nimport { ActionSummaryListItemProps, ActionSummaryListItem } from '.';\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n display: 'flex',\n flexWrap: 'wrap',\n overflowY: 'scroll',\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n itemContainer: {\n display: 'flex',\n flexDirection: 'column',\n paddingLeft: 1,\n // paddingBottom: theme.spacing(2),\n width: '33%'\n }\n}));\n\ntype ActionSummaryListContainerProps = {\n items: Array<ActionSummaryListItemProps>;\n selectedNode?: object;\n};\n\nexport const ActionSummaryListContainer: FC<\n ActionSummaryListContainerProps\n> = ({ items, selectedNode }: ActionSummaryListContainerProps) => {\n const classes = useStyles();\n function* keyGenerator() {\n let count: number = 0;\n while (true) {\n yield count++;\n }\n }\n const countGen = keyGenerator();\n return (\n <div className={classes.root}>\n <div className={classes.itemContainer}>\n <List disablePadding>\n {items\n .filter((item, i) => i % 3 === 0)\n .map((item: ActionSummaryListItemProps) => (\n <ActionSummaryListItem\n selectedNode={selectedNode}\n {...item}\n key={countGen.next().value as number}\n />\n ))}\n </List>\n </div>\n <div className={classes.itemContainer}>\n <List disablePadding>\n {items\n .filter((item, i) => i % 3 === 1)\n .map((item: ActionSummaryListItemProps) => (\n <ActionSummaryListItem\n selectedNode={selectedNode}\n {...item}\n key={countGen.next().value as number}\n />\n ))}\n </List>\n </div>\n <div className={classes.itemContainer}>\n <List disablePadding>\n {items\n .filter((item, i) => i % 3 === 2)\n .map((item: ActionSummaryListItemProps) => (\n <ActionSummaryListItem\n selectedNode={selectedNode}\n {...item}\n key={countGen.next().value as number}\n />\n ))}\n </List>\n </div>\n </div>\n );\n};\n","import * as Icons from \"@fluentui/react-icons\";\nimport { makeStyles, Typography } from \"@material-ui/core\";\nimport React, { FC } from \"react\";\nimport { UnityFluentIcon } from '../../utilities/iconLibrary/UnityFluentIcon'\n\ntype ActionSummaryHeaderProps = {\n icon: string;\n header: string;\n iconType?: string\n};\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n backgroundColor: theme.palette.primary.main + '1A',\n display: \"flex\",\n padding: 5,\n gap: 10,\n },\n container: {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center'\n\n },\n icon: {\n color: theme.palette.primary.main\n }\n}));\n\nexport const ActionSummaryHeader: FC<ActionSummaryHeaderProps> = (\n {\n icon,\n header,\n iconType\n }: ActionSummaryHeaderProps\n) => {\n const classes = useStyles();\n return (\n <div className={classes.root}>\n <div className={classes.container}>\n <UnityFluentIcon className={classes.icon} type={iconType} component={Icons[icon]} />\n </div>\n <div className={classes.container}>\n <Typography display='inline' variant='h6' >{header}</Typography>\n </div>\n </div>\n );\n};\n","import React, { FC, useMemo, MutableRefObject } from 'react';\nimport { Chip, makeStyles } from '@material-ui/core';\nimport { useActions } from '../../hooks/useActions';\nimport { UdpTheme } from '../../utilities/theme/theme.types';\n\nexport type ActionSummaryListItemProps = {\n value: string;\n highlighted?: boolean; // gives an mui chip background\n enabled?: boolean; // greys out the item\n actionId: string;\n setLoading: Function;\n selectedNode?: any;\n};\n\nconst useStyles = makeStyles((theme: UdpTheme) => ({\n listItemWithChip: {\n paddingTop: 1,\n paddingBottom: 1,\n alignItems: 'start'\n },\n listItemGutters: {\n paddingLeft: 10\n },\n chipSelected: {\n backgroundColor: theme.palette.secondary.main + '1A',\n color: theme?.getThemeData()?.mode === 'light' ? 'black' : 'white'\n },\n chipWhite: {\n color: theme?.getThemeData()?.mode === 'light' ? 'black' : 'white',\n backgroundColor: theme.palette.background.paper\n },\n chipRoot: {\n width: '100%',\n justifyContent: 'start',\n paddingTop: 1\n },\n chipWhiteDeselected: {\n color: 'grey',\n backgroundColor: theme.palette.background.paper\n },\n chipHover: {\n '&:hover': {\n backgroundColor: theme.palette.secondary.main + '3A'\n },\n '&:focus': {\n backgroundColor: theme.palette.secondary.main + '3A'\n }\n }\n}));\n\nexport const ActionSummaryListItem: FC<ActionSummaryListItemProps> = ({\n value,\n highlighted,\n enabled,\n actionId,\n selectedNode\n}: ActionSummaryListItemProps) => {\n const classes = useStyles();\n const { triggerAction } = useActions();\n const render = useMemo(() => {\n return (\n <div className={classes.listItemWithChip}>\n <Chip\n color='primary'\n clickable={enabled}\n onClick={\n enabled\n ? () => triggerAction(actionId, selectedNode?.nodeObj)\n : () => {}\n }\n classes={{\n colorPrimary: enabled\n ? highlighted\n ? classes.chipSelected\n : classes.chipWhite\n : classes.chipWhiteDeselected,\n root: classes.chipRoot,\n clickableColorPrimary: classes.chipHover\n }}\n label={value}\n />\n </div>\n );\n }, [highlighted, enabled, value]);\n\n return render;\n};\n","import { MoreVerticalIcon } from '@fluentui/react-icons';\nimport { makeStyles, Popover } from '@material-ui/core';\nimport PropTypes from 'prop-types';\nimport React, { useState, useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { ActionSummaryCard } from './';\nimport { evaluateRule, mapRule } from '../../utilities/rules/RuleUtilities';\nimport { PrimaryActionButton } from '../../UI/inputs/buttons/PrimaryActionButton';\nimport { Typography } from '../../UI/dataDisplay/typography/Typography';\n\nconst useStyles = makeStyles((theme) => ({\n root: {},\n actionsMenu: {\n color: theme?.palette?.getContrastText(theme?.palette?.primary?.main)\n }\n}));\n\nexport const ActionSummaryPopover = (props) => {\n const { panelActions, noContrastColor, selectedNode, setLoading } = props;\n const classes = useStyles();\n const [anchorEl, setAnchorEl] = useState(null);\n const { t } = useTranslation();\n\n const handleClick = (event) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const actionSummaryPopoverActions = useMemo(() => {\n return panelActions?.reduce((actions, current) => {\n if (!current.enabled) return actions;\n\n const passRule =\n current.action.actionRules?.reduce((boolValue, rule) => {\n const ruleExpression = mapRule(rule.mapping, rule.jsonLogic);\n return (\n boolValue &&\n evaluateRule(\n ruleExpression,\n selectedNode?.nodeObj,\n selectedNode?.properties?.joiningEntityCatalogObjectKey,\n selectedNode?.wasLazyLoaded\n )\n );\n }, true) ?? true;\n\n if (!passRule && current?.hideAction) return actions;\n\n const currentVal = {\n value: current.action.name,\n actionId: current.actionId,\n sequence: current.sequence,\n enabled: passRule\n };\n\n const group = actions.find(\n (action) =>\n action?.header?.toLowerCase() === current?.groupName?.toLowerCase()\n );\n if (group) {\n group.items.push(currentVal);\n group.items.sort((a, b) => a.sequence - b.sequence);\n } else {\n actions.push({\n header: current.groupName,\n icon: current.icon.name,\n iconType: current.icon.type,\n items: [currentVal]\n });\n }\n return actions;\n }, []);\n }, [panelActions, selectedNode]);\n\n const open = Boolean(anchorEl);\n const id = open ? 'action-summary-popover' : undefined;\n\n return (\n <>\n <PrimaryActionButton onClick={handleClick} icon={<MoreVerticalIcon />}>\n <Typography>{t('Actions')}</Typography>\n </PrimaryActionButton>\n\n <Popover\n id={id}\n open={open}\n anchorEl={anchorEl}\n onClose={handleClose}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'left'\n }}\n >\n <ActionSummaryCard\n actionMenuContent={actionSummaryPopoverActions}\n setLoading={setLoading}\n selectedNode={selectedNode}\n />\n </Popover>\n </>\n );\n};\n\nActionSummaryPopover.propTypes = {\n /**\n * Actions configured within Action Panel\n */\n panelActions: PropTypes.array,\n /**\n * Boolean to toggle contrast color\n */\n noContrastColor: PropTypes.bool,\n /**\n * Action Panels\n */\n selectedNode: PropTypes.object\n};\n"],"mappings":";;;;;;;;;;;;;;AASA,MAAMA,cAAY,YAAY,WAAW;CACvC,MAAM;EACJ,OAAO;EACP,aAAa;EACb,cAAc;EACd,WAAW;EACX,WAAW;EACZ;CACD,QAAQ;EACN,SAAS;EACT,gBAAgB;EAEjB;CACF,EAAE;AAcH,MAAa,qBAA6C,EACxD,mBACA,mBACwB;CACxB,MAAM,UAAUA,aAAW;CAC3B,MAAM,CAAC,aAAa,kBAAkB,SAAiB,GAAG;AAE1D,QACE,oCAAC,SAAI,WAAW,QAAQ,QACtB,oCAAC,SAAI,WAAW,QAAQ,UACtB,oCAAC,SACC,OAAO;EACL,SAAS;EACT,gBAAgB;EAChB,eAAe;EAChB,IAED,oCAAC,cAAW,SAAQ,QAAK,UAAoB,CACzC,EACN,oCAAC;EACC,IAAG;EACH,aAAY;EACZ,OAAO;EACP,WAAW,MAAW,eAAe,EAAE,OAAO,MAAM;EACpD,SAAQ;EAER,OAAO;GAAE,WAAW;GAAG,YAAY;GAAG;GACtC,CACE,EACL,kBAAkB,KAAK,SAA+B,MACrD,0DACE,oCAAC;EACC,KAAK;EACL,UAAU,QAAQ;EAClB,MAAM,QAAQ;EACd,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a,KAAK,SAAS,WAAW,aAAa,CACtE;AACD,OAAI,OAAO;AACT,UAAM,MAAM,KAAK,WAAW;AAC5B,UAAM,MAAM,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,SAAS;SAEnD,SAAQ,KAAK;IACX,QAAQ,QAAQ;IAChB,MAAM,QAAQ,KAAK;IACnB,UAAU,QAAQ,KAAK;IACvB,OAAO,CAAC,WAAW;IACpB,CAAC;AAEJ,UAAO;KACN,EAAE,CAAC;IACL,CAAC,cAAc,aAAa,CAAC;CAEhC,MAAM,OAAO,QAAQ,SAAS;CAC9B,MAAM,KAAK,OAAO,2BAA2B;AAE7C,QACE,0DACE,oCAAC;EAAoB,SAAS;EAAa,MAAM,oCAAC,uBAAmB;IACnE,oCAACC,oBAAY,EAAE,UAAU,CAAc,CACnB,EAEtB,oCAAC;EACK;EACE;EACI;EACV,SAAS;EACT,cAAc;GACZ,UAAU;GACV,YAAY;GACb;IAED,oCAAC;EACC,mBAAmB;EACP;EACE;GACd,CACM,CACT;;AAIP,qBAAqB,YAAY;CAI/B,cAAc,UAAU;CAIxB,iBAAiB,UAAU;CAI3B,cAAc,UAAU;CACzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"advancedSearchBuilder-7ixhIwLW.js","names":["UdpAdvancedSearchBuilder: React.FC<any>","UdpAdvancedSearchBuilderStencil"],"sources":["../src/UI/advancedSearchBuilder/UdpAdvancedSearchBuilder.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { UdpAdvancedSearchBuilder as UdpAdvancedSearchBuilderStencil } from 'udp-react-stencil-component-library';\nimport { useCatalogStore } from '../../stores/catalogStore';\n\nexport const UdpAdvancedSearchBuilder: React.FC<any> = (props) => {\n const { catalogsMap, currentApiCatalogId } = useCatalogStore();\n\n const catalogObjectList = useMemo(() => {\n if (\n catalogsMap &&\n currentApiCatalogId &&\n catalogsMap[currentApiCatalogId]\n ) {\n return catalogsMap[currentApiCatalogId]?.ctlg?.catalogObjectList;\n }\n }, [catalogsMap, currentApiCatalogId]);\n\n return (\n <div>\n {/* @ts-ignore */}\n <UdpAdvancedSearchBuilderStencil\n {...props}\n catalogObjectList={catalogObjectList}\n />\n </div>\n );\n};\n"],"mappings":";;;;;AAIA,MAAaA,8BAA2C,UAAU;CAChE,MAAM,EAAE,aAAa,wBAAwB,iBAAiB;CAE9D,MAAM,oBAAoB,cAAc;AACtC,MACE,eACA,uBACA,YAAY,qBAEZ,QAAO,YAAY,sBAAsB,MAAM;IAEhD,CAAC,aAAa,oBAAoB,CAAC;AAEtC,QACE,oCAAC,aAEC,oCAACC;EACC,GAAI;EACe;GACnB,CACE"}
1
+ {"version":3,"file":"advancedSearchBuilder-7ixhIwLW.js","names":["UdpAdvancedSearchBuilder","UdpAdvancedSearchBuilderStencil"],"sources":["../src/UI/advancedSearchBuilder/UdpAdvancedSearchBuilder.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { UdpAdvancedSearchBuilder as UdpAdvancedSearchBuilderStencil } from 'udp-react-stencil-component-library';\nimport { useCatalogStore } from '../../stores/catalogStore';\n\nexport const UdpAdvancedSearchBuilder: React.FC<any> = (props) => {\n const { catalogsMap, currentApiCatalogId } = useCatalogStore();\n\n const catalogObjectList = useMemo(() => {\n if (\n catalogsMap &&\n currentApiCatalogId &&\n catalogsMap[currentApiCatalogId]\n ) {\n return catalogsMap[currentApiCatalogId]?.ctlg?.catalogObjectList;\n }\n }, [catalogsMap, currentApiCatalogId]);\n\n return (\n <div>\n {/* @ts-ignore */}\n <UdpAdvancedSearchBuilderStencil\n {...props}\n catalogObjectList={catalogObjectList}\n />\n </div>\n );\n};\n"],"mappings":";;;;;AAIA,MAAaA,8BAA2C,UAAU;CAChE,MAAM,EAAE,aAAa,wBAAwB,iBAAiB;CAE9D,MAAM,oBAAoB,cAAc;AACtC,MACE,eACA,uBACA,YAAY,qBAEZ,QAAO,YAAY,sBAAsB,MAAM;IAEhD,CAAC,aAAa,oBAAoB,CAAC;AAEtC,QACE,oCAAC,aAEC,oCAACC;EACC,GAAI;EACe;GACnB,CACE"}
@@ -1 +1 @@
1
- {"version":3,"file":"aggridHelpers-BvrSzjdD.js","names":["sortInfo: any","searchFilters: any","element","search: any"],"sources":["../src/utilities/aggrid/aggridHelpers.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n IServerSideDatasource,\n IServerSideGetRowsParams\n} from '@ag-grid-community/core';\nimport { SearchGroupingType } from '../../enums/unitySystemEnums';\nimport { useConvertFilterModelToSearchFilters } from '../search/SearchUtilities';\n\nexport const useServerSideDatasource = (\n refetchData: Function,\n refetchGroupData: any,\n filterChanged: any, // a ref (from useRef()) for detecting when a grid's filters have been changed\n setFilterChanged: any\n) => {\n const convertFilterModelToSearchFilters =\n useConvertFilterModelToSearchFilters();\n\n const dataSource = useMemo(() => {\n const ds: IServerSideDatasource = {\n async getRows(params: IServerSideGetRowsParams) {\n if (!params) return;\n const {\n startRow,\n endRow,\n sortModel,\n filterModel,\n rowGroupCols,\n groupKeys\n } = params?.request || {};\n let refetch = refetchData;\n const pageSize = params?.api?.paginationGetPageSize();\n let pageNumber =\n filterChanged.current === true ? 1 : (endRow as number) / pageSize;\n if (isNaN(pageNumber)) {\n pageNumber = 1;\n }\n\n // Sorting\n let column = sortModel[0]?.colId ?? '';\n let sortDirection = sortModel[0]?.sort ?? '';\n let sortInfo: any = [];\n if (column && sortDirection) {\n sortInfo.push({ sortColumn: column, sortDirection: sortDirection });\n }\n\n // Filtering\n let searchFilters: any = [];\n searchFilters = convertFilterModelToSearchFilters(filterModel);\n\n // Grouping\n const groupingColumns = rowGroupCols?.map((col) => col.id);\n let groupingType = '';\n // As we are attempting to mimic the grouping functionality of the unity-fluent-library component AmbientGridTemplate which allows\n // grouping on only one column/property at a time, the following logic is to ensure the appropriate grouping endpoint is hit\n // and that the grouping portion of the query in the back-end is added (setting groupingType = AGGREGATE or DISTINCT takes care of this)\n // only when selecting a column to group by. Then, expanding that group would hit a different endpoint to retrieve all rows using the grouping\n // value as a filter value.\n if (groupingColumns.length > 0 && groupKeys.length === 0) {\n groupingType = SearchGroupingType.Distinct;\n refetch = refetchGroupData ? refetchGroupData : refetchData;\n }\n\n // Create the filter for the grouped column\n if (groupKeys.length) {\n if (groupKeys.length === rowGroupCols.length) {\n groupKeys.forEach((key, index) => {\n const rowGroupCol = rowGroupCols[index];\n const element = searchFilters.find(\n (element: any) => element.searchField === rowGroupCol.field\n );\n if (element) {\n element.searchValue = key;\n element.searchOperator = '=';\n } else {\n searchFilters.push({\n searchField: rowGroupCol.field ?? rowGroupCol.id,\n searchValue: key,\n searchOperator: '=',\n searchValueType: 0\n });\n }\n });\n }\n }\n\n let search: any;\n search = {\n eagerLoad: groupingType ? false : true,\n pageNumber: pageNumber,\n pageSize: pageSize,\n orderElements: sortInfo,\n filterElements: searchFilters,\n groupingType: groupingType,\n groupProperty: groupingColumns\n };\n\n params.api.hideOverlay();\n\n const response = await refetch({ data: search }).catch(() => {\n params.success({ rowData: [], rowCount: 0 });\n params.api.showNoRowsOverlay();\n });\n\n if (response) {\n const rowData = response.data;\n if (rowData) {\n // we are expecting response of type Univerus.Unity.Commons.Api.Model.Page, but need to maintain support for MDM\n if (typeof rowData === 'object' && rowData.pageList) {\n params.success({\n rowData: rowData.pageList,\n rowCount: parseInt(rowData.total)\n });\n } else if (rowData.length > 0) {\n params.success({\n rowData: rowData,\n rowCount: parseInt(response.headers['totalrows'])\n });\n } else {\n params.success({ rowData: [], rowCount: 0 });\n }\n if (filterChanged.current === true) {\n params.api.paginationGoToFirstPage();\n setFilterChanged(false);\n }\n } else {\n params.success({ rowData: [], rowCount: 0 });\n params.api.showNoRowsOverlay();\n }\n } else {\n params.fail();\n }\n }\n };\n return ds;\n }, [\n convertFilterModelToSearchFilters,\n filterChanged,\n refetchData,\n refetchGroupData,\n setFilterChanged\n ]);\n return dataSource;\n};\n"],"mappings":";;;;;AAQA,MAAa,2BACX,aACA,kBACA,eACA,qBACG;CACH,MAAM,oCACJ,sCAAsC;AA8HxC,QA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C3D,WAAO,QAAQ;KAAE,SAAS,EAAE;KAAE,UAAU;KAAG,CAAC;AAC5C,WAAO,IAAI,mBAAmB;KAC9B;AAEF,OAAI,UAAU;IACZ,MAAM,UAAU,SAAS;AACzB,QAAI,SAAS;AAEX,SAAI,OAAO,YAAY,YAAY,QAAQ,SACzC,QAAO,QAAQ;MACb,SAAS,QAAQ;MACjB,UAAU,SAAS,QAAQ,MAAM;MAClC,CAAC;cACO,QAAQ,SAAS,EAC1B,QAAO,QAAQ;MACJ;MACT,UAAU,SAAS,SAAS,QAAQ,aAAa;MAClD,CAAC;SAEF,QAAO,QAAQ;MAAE,SAAS,EAAE;MAAE,UAAU;MAAG,CAAC;AAE9C,SAAI,cAAc,YAAY,MAAM;AAClC,aAAO,IAAI,yBAAyB;AACpC,uBAAiB,MAAM;;WAEpB;AACL,YAAO,QAAQ;MAAE,SAAS,EAAE;MAAE,UAAU;MAAG,CAAC;AAC5C,YAAO,IAAI,mBAAmB;;SAGhC,QAAO,MAAM;KAGlB;IAEA;EACD;EACA;EACA;EACA;EACA;EACD,CAAC"}
1
+ {"version":3,"file":"aggridHelpers-BvrSzjdD.js","names":["element"],"sources":["../src/utilities/aggrid/aggridHelpers.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n IServerSideDatasource,\n IServerSideGetRowsParams\n} from '@ag-grid-community/core';\nimport { SearchGroupingType } from '../../enums/unitySystemEnums';\nimport { useConvertFilterModelToSearchFilters } from '../search/SearchUtilities';\n\nexport const useServerSideDatasource = (\n refetchData: Function,\n refetchGroupData: any,\n filterChanged: any, // a ref (from useRef()) for detecting when a grid's filters have been changed\n setFilterChanged: any\n) => {\n const convertFilterModelToSearchFilters =\n useConvertFilterModelToSearchFilters();\n\n const dataSource = useMemo(() => {\n const ds: IServerSideDatasource = {\n async getRows(params: IServerSideGetRowsParams) {\n if (!params) return;\n const {\n startRow,\n endRow,\n sortModel,\n filterModel,\n rowGroupCols,\n groupKeys\n } = params?.request || {};\n let refetch = refetchData;\n const pageSize = params?.api?.paginationGetPageSize();\n let pageNumber =\n filterChanged.current === true ? 1 : (endRow as number) / pageSize;\n if (isNaN(pageNumber)) {\n pageNumber = 1;\n }\n\n // Sorting\n let column = sortModel[0]?.colId ?? '';\n let sortDirection = sortModel[0]?.sort ?? '';\n let sortInfo: any = [];\n if (column && sortDirection) {\n sortInfo.push({ sortColumn: column, sortDirection: sortDirection });\n }\n\n // Filtering\n let searchFilters: any = [];\n searchFilters = convertFilterModelToSearchFilters(filterModel);\n\n // Grouping\n const groupingColumns = rowGroupCols?.map((col) => col.id);\n let groupingType = '';\n // As we are attempting to mimic the grouping functionality of the unity-fluent-library component AmbientGridTemplate which allows\n // grouping on only one column/property at a time, the following logic is to ensure the appropriate grouping endpoint is hit\n // and that the grouping portion of the query in the back-end is added (setting groupingType = AGGREGATE or DISTINCT takes care of this)\n // only when selecting a column to group by. Then, expanding that group would hit a different endpoint to retrieve all rows using the grouping\n // value as a filter value.\n if (groupingColumns.length > 0 && groupKeys.length === 0) {\n groupingType = SearchGroupingType.Distinct;\n refetch = refetchGroupData ? refetchGroupData : refetchData;\n }\n\n // Create the filter for the grouped column\n if (groupKeys.length) {\n if (groupKeys.length === rowGroupCols.length) {\n groupKeys.forEach((key, index) => {\n const rowGroupCol = rowGroupCols[index];\n const element = searchFilters.find(\n (element: any) => element.searchField === rowGroupCol.field\n );\n if (element) {\n element.searchValue = key;\n element.searchOperator = '=';\n } else {\n searchFilters.push({\n searchField: rowGroupCol.field ?? rowGroupCol.id,\n searchValue: key,\n searchOperator: '=',\n searchValueType: 0\n });\n }\n });\n }\n }\n\n let search: any;\n search = {\n eagerLoad: groupingType ? false : true,\n pageNumber: pageNumber,\n pageSize: pageSize,\n orderElements: sortInfo,\n filterElements: searchFilters,\n groupingType: groupingType,\n groupProperty: groupingColumns\n };\n\n params.api.hideOverlay();\n\n const response = await refetch({ data: search }).catch(() => {\n params.success({ rowData: [], rowCount: 0 });\n params.api.showNoRowsOverlay();\n });\n\n if (response) {\n const rowData = response.data;\n if (rowData) {\n // we are expecting response of type Univerus.Unity.Commons.Api.Model.Page, but need to maintain support for MDM\n if (typeof rowData === 'object' && rowData.pageList) {\n params.success({\n rowData: rowData.pageList,\n rowCount: parseInt(rowData.total)\n });\n } else if (rowData.length > 0) {\n params.success({\n rowData: rowData,\n rowCount: parseInt(response.headers['totalrows'])\n });\n } else {\n params.success({ rowData: [], rowCount: 0 });\n }\n if (filterChanged.current === true) {\n params.api.paginationGoToFirstPage();\n setFilterChanged(false);\n }\n } else {\n params.success({ rowData: [], rowCount: 0 });\n params.api.showNoRowsOverlay();\n }\n } else {\n params.fail();\n }\n }\n };\n return ds;\n }, [\n convertFilterModelToSearchFilters,\n filterChanged,\n refetchData,\n refetchGroupData,\n setFilterChanged\n ]);\n return dataSource;\n};\n"],"mappings":";;;;;AAQA,MAAa,2BACX,aACA,kBACA,eACA,qBACG;CACH,MAAM,oCACJ,sCAAsC;AA8HxC,QA5HmB,cAAc;AAoH/B,SAnHkC,EAChC,MAAM,QAAQ,QAAkC;AAC9C,OAAI,CAAC,OAAQ;GACb,MAAM,EACJ,UACA,QACA,WACA,aACA,cACA,cACE,QAAQ,WAAW,EAAE;GACzB,IAAI,UAAU;GACd,MAAM,WAAW,QAAQ,KAAK,uBAAuB;GACrD,IAAI,aACF,cAAc,YAAY,OAAO,IAAK,SAAoB;AAC5D,OAAI,MAAM,WAAW,CACnB,cAAa;GAIf,IAAI,SAAS,UAAU,IAAI,SAAS;GACpC,IAAI,gBAAgB,UAAU,IAAI,QAAQ;GAC1C,IAAI,WAAgB,EAAE;AACtB,OAAI,UAAU,cACZ,UAAS,KAAK;IAAE,YAAY;IAAuB;IAAe,CAAC;GAIrE,IAAI,gBAAqB,EAAE;AAC3B,mBAAgB,kCAAkC,YAAY;GAG9D,MAAM,kBAAkB,cAAc,KAAK,QAAQ,IAAI,GAAG;GAC1D,IAAI,eAAe;AAMnB,OAAI,gBAAgB,SAAS,KAAK,UAAU,WAAW,GA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EACA;EACA;EACA;EACA;EACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"apiHelpers-WIR8pqy0.js","names":["useLoginAction: LoginFunction","loginRedirect: () => void"],"sources":["../src/utilities/auth/signInAuthProvider.js","../src/utilities/auth/whitelistedPaths.js","../src/utilities/auth/authActions.ts","../src/utilities/apiHelpers.jsx"],"sourcesContent":["import { PublicClientApplication, EventType } from '@azure/msal-browser';\nimport { ConfigService } from '../../configService';\n\nlet signInAuthProviderInstance = null;\nlet loginRequestInstance = null;\nlet tokenRequestInstance = null;\nlet apiAccessScopeValue = null;\n\nexport async function initSignInAuthProvider() {\n if (signInAuthProviderInstance) {\n return; // Already initialized\n }\n\n const PUBLIC_URL = new URL(\n import.meta.env.BASE_URL || '/',\n window.location.origin\n ).href.replace(/\\/$/, '');\n\n const REDIRECT_URL_BASE = ConfigService.config.USE_AAD_REDIRECT\n ? ConfigService.config.UNITY_URL\n : PUBLIC_URL;\n\n if (!ConfigService.config.MSAL_TENANT)\n throw new Error('MSAL_TENANT not configured');\n if (!ConfigService.config.MSAL_CLIENT_ID)\n throw new Error('MSAL_CLIENT_ID not configured');\n\n const tenant = ConfigService.config.MSAL_TENANT;\n\n // Determine idp_target and id_token_hint for Unified Policy\n const currentPath = window.location.pathname;\n const searchParams = new URLSearchParams(window.location.search);\n\n let domainHint = searchParams.get('domain_hint');\n\n if (currentPath === '/sso/entra') {\n domainHint = 'entra';\n }\n\n if (currentPath === '/sso/entra') {\n domainHint = 'entra';\n window.history.replaceState(null, '', '/');\n }\n\n const idTokenHint = searchParams.get('id_token_hint');\n\n const signInPolicy = ConfigService.config.SIGN_IN_POLICY;\n\n const applicationID = ConfigService.config.MSAL_CLIENT_ID;\n const reactRedirectUri = `${REDIRECT_URL_BASE}/${ConfigService.config.USE_AAD_REDIRECT ? 'aad_redirect' : 'aad_callback'\n }`;\n const tenantSubdomain = tenant.split('.')[0];\n const instance = `https://${tenantSubdomain}.b2clogin.com/`;\n const signInAuthority = `${instance}${tenant}/${signInPolicy}`;\n apiAccessScopeValue = `https://${tenant}/${ConfigService.config.MSAL_API_ACCESS_SCOPE}`;\n\n const ua = window.navigator.userAgent;\n const msie = ua.indexOf('MSIE ');\n const msie11 = ua.indexOf('Trident/');\n const msedge = ua.indexOf('Edge/');\n const firefox = ua.indexOf('Firefox');\n const isIE = msie > 0 || msie11 > 0;\n const isEdge = msedge > 0;\n const isFirefox = firefox > 0; // Only needed if you need to support the redirect flow in Firefox incognito\n\n // Msal Configurations\n const signInConfig = {\n auth: {\n authority: signInAuthority,\n knownAuthorities: [`${tenantSubdomain}.b2clogin.com`],\n clientId: applicationID,\n redirectUri: reactRedirectUri,\n postLogoutRedirectUri: PUBLIC_URL + '/',\n navigateToLoginRequestUrl: false,\n },\n cache: {\n cacheLocation: 'sessionStorage',\n storeAuthStateInCookie: isIE || isEdge || isFirefox,\n },\n system: {\n allowRedirectInIframe: true,\n },\n };\n\n signInAuthProviderInstance = new PublicClientApplication(signInConfig);\n\n await signInAuthProviderInstance.initialize();\n\n if (\n !signInAuthProviderInstance.getActiveAccount() &&\n signInAuthProviderInstance.getAllAccounts().length > 0\n ) {\n signInAuthProviderInstance.setActiveAccount(\n signInAuthProviderInstance.getAllAccounts()[0]\n );\n }\n\n // Check if the active account is an Entra account to set the hint\n const activeAccount = signInAuthProviderInstance.getActiveAccount();\n if (activeAccount && !domainHint) {\n const idp = activeAccount.idTokenClaims?.idp;\n if (idp && idp.includes('login.microsoftonline.com')) {\n domainHint = 'entra';\n }\n }\n\n signInAuthProviderInstance.addEventCallback((event) => {\n if (event.eventType === EventType.LOGIN_SUCCESS && event.payload.account) {\n const account = event.payload.account;\n signInAuthProviderInstance.setActiveAccount(account);\n }\n });\n\n tokenRequestInstance = { scopes: [apiAccessScopeValue] };\n\n loginRequestInstance = {\n scopes: [apiAccessScopeValue, 'openid', 'offline_access'],\n state: `${PUBLIC_URL}/aad_callback`,\n extraQueryParameters: {\n ...(idTokenHint && { id_token_hint: idTokenHint, flow: 'redeem' }),\n ...(domainHint && !idTokenHint && { domain_hint: 'entra' }),\n },\n };\n}\n\nexport const getSignInAuthProvider = () => {\n if (!signInAuthProviderInstance) {\n throw new Error(\n 'signInAuthProvider is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return signInAuthProviderInstance;\n};\n\nexport const getLoginRequest = () => {\n if (!loginRequestInstance) {\n throw new Error(\n 'loginRequest is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return loginRequestInstance;\n};\n\nexport const getTokenRequest = () => {\n if (!tokenRequestInstance) {\n throw new Error(\n 'tokenRequest is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return tokenRequestInstance;\n};\n\nexport const getApiAccessScope = () => {\n if (!apiAccessScopeValue) {\n throw new Error(\n 'apiAccessScope is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return apiAccessScopeValue;\n};\n","import { UdpPageEnums } from \"../../enums/pageEnums\";\n\nexport const whitelistedPaths = [\n '/verify', \n `/page/${UdpPageEnums.Udp_Public_Forms_Page}`, // Public forms page\n '/aad_redirect',\n '/passwordresetsuccess'\n];\n","import {\n getSignInAuthProvider,\n getTokenRequest,\n getLoginRequest,\n} from './signInAuthProvider';\nimport { BrowserUtils } from '@azure/msal-browser';\nimport { storeCurrentPath } from '../redirect/LocalRedirectUrlStorage';\nimport { whitelistedPaths } from './whitelistedPaths';\nexport type LoginFunction = () => void;\nexport type LogoutFunction = () => void;\n/**\n * Hook providing auth \"actions\" such as login/logout\n */\n\nexport const useLoginAction: LoginFunction = () => loginRedirect;\nexport const loginRedirect: () => void = () => {\n const signInAuthProvider = getSignInAuthProvider();\n signInAuthProvider.loginRedirect(getLoginRequest());\n};\n\nexport function useLogoutAction(): LogoutFunction {\n return async () => {\n const signInAuthProvider = getSignInAuthProvider();\n await signInAuthProvider.logoutRedirect({\n account: signInAuthProvider.getActiveAccount(),\n });\n };\n}\n\nexport async function acquireAccessToken(): Promise<string | void> {\n const signInAuthProvider = getSignInAuthProvider();\n const account = signInAuthProvider.getActiveAccount() ?? undefined;\n\n if (account) {\n return signInAuthProvider\n .acquireTokenSilent({ ...getTokenRequest(), account })\n .then((response) => {\n return response.accessToken;\n })\n .catch(async (error) => {\n const currentPathIsWhitelisted = whitelistedPaths.includes(\n window.location.pathname\n );\n if (!currentPathIsWhitelisted) {\n signInAuthProvider.loginRedirect(getLoginRequest());\n }\n });\n }\n}\n","import React from \"react\";\nimport { acquireAccessToken } from './auth/authActions';\nimport { InteractionRequiredAuthError } from '@azure/msal-browser';\nimport { getStoredTenant } from './storage/UnitySessionStorage';\nimport { useSnackbar } from 'notistack';\nimport { Button } from '@material-ui/core';\nimport { useCallback } from 'react';\nimport { useHistory } from 'react-router-dom';\n\nexport const getMergedConfig = (accessToken, config) => {\n const headers = config?.headers ?? {};\n\n headers.currentTenantId ||= getStoredTenant();\n if (accessToken) headers.Authorization ||= `Bearer ${accessToken}`;\n\n config.headers = headers;\n return config;\n};\n\nexport const handleResponseErrors = async (error) => {\n if (error?.response?.status === 401) {\n await acquireAccessToken();\n }\n};\n\nexport const getAccessToken = async () => {\n return await acquireAccessToken();\n};\n\n/**\n * Checks to make sure the error isn't cancelled, if so just return w/o doing anything\n *Otherwise call a pre-method, create a snackbar, then call a post-method\n *preCallBack returns a bool, true = show snackbar\n */\nexport const useHandleAxiosSnackbar = () => {\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n const history = useHistory();\n\n const dismissSnackbar = useCallback(\n (key, callback) => {\n closeSnackbar(key);\n callback?.();\n },\n [closeSnackbar]\n );\n\n const handleErrorSnackbar = useCallback(\n (error, customMessage, preCallBack, callback) => {\n const fallbackErrorMessage = 'Error executing request';\n if (\n error?.toString()?.toLowerCase() === 'cancel' ||\n error?.code === 'ERR_CANCELED'\n )\n return;\n\n // Don't call the preCallback unless we actually failed.\n const showSnackBar = preCallBack?.();\n if (preCallBack && !showSnackBar) return;\n\n let errorMessage =\n customMessage ??\n (error?.response?.data || error?.message || fallbackErrorMessage);\n if (\n typeof errorMessage !== 'string' ||\n !errorMessage ||\n errorMessage.length === 0\n ) {\n errorMessage = fallbackErrorMessage;\n }\n\n enqueueSnackbar(errorMessage, {\n variant: 'error',\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'center'\n },\n action: (key) => (\n <Button\n color='secondary'\n size='small'\n onClick={() => {\n dismissSnackbar(key);\n }}\n >\n Ok\n </Button>\n )\n });\n\n callback?.();\n },\n [dismissSnackbar, enqueueSnackbar]\n );\n\n const handleSuccessSnackbar = useCallback(\n (message, preCallBack, callback, navigationPath, buttonText) => {\n const fallbackSuccessMessage = 'Executed request successfully';\n const showMessage = preCallBack?.();\n if (preCallBack && !showMessage) return;\n\n let successMessage = message ?? fallbackSuccessMessage;\n if (\n typeof successMessage !== 'string' ||\n !successMessage ||\n successMessage.length === 0\n ) {\n successMessage = fallbackSuccessMessage;\n }\n\n const options = {\n variant: 'default',\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'center'\n },\n action: (key) => (\n <>\n {navigationPath && (\n <Button\n color='secondary'\n size='small'\n onClick={() => {\n history.push(navigationPath);\n dismissSnackbar(key);\n }}\n >\n {buttonText? buttonText : 'Go to page'}\n </Button>\n )}\n <Button\n color='secondary'\n size='small'\n onClick={() => {\n dismissSnackbar(key);\n }}\n >\n Ok\n </Button>\n </>\n )\n };\n\n enqueueSnackbar(successMessage, options);\n },\n [dismissSnackbar, enqueueSnackbar]\n );\n\n return { handleErrorSnackbar, handleSuccessSnackbar };\n};\n"],"mappings":";;;;;;;;;;AAGA,IAAI,6BAA6B;AACjC,IAAI,uBAAuB;AAC3B,IAAI,uBAAuB;AAC3B,IAAI,sBAAsB;AAE1B,eAAsB,yBAAyB;AAC7C,KAAI,2BACF;CAGF,MAAM,aAAa,IAAI,IACrB,OAAO,KAAK,IAAI,YAAY,KAC5B,OAAO,SAAS,OACjB,CAAC,KAAK,QAAQ,OAAO,GAAG;CAEzB,MAAM,oBAAoB,cAAc,OAAO,mBAC3C,cAAc,OAAO,YACrB;AAE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,YACxB,CAAC,gBACD,aAAa,WAAW,EAExB,gBAAe;AAGjB,mBAAgB,cAAc;IAC5B,SAAS;IACT,cAAc;KACZ,UAAU;KACV,YAAY;KACb;IACD,SAAS,QACP,oCAAC;KACC,OAAM;KACN,MAAK;KACL,eAAe;AACb,sBAAgB,IAAI;;OAEvB,KAEQ;IAEZ,CAAC;AAEF,eAAY;KAEd,CAAC,iBAAiB,gBAAgB,CACnC;EAuD6B,uBArDA,aAC3B,SAAS,aAAa,UAAU,gBAAgB,eAAe;GAC9D,MAAM,yBAAyB;GAC/B,MAAM,cAAc,eAAe;AACnC,OAAI,eAAe,CAAC,YAAa;GAEjC,IAAI,iBAAiB,WAAW;AAChC,OACE,OAAO,mBAAmB,YAC1B,CAAC,kBACD,eAAe,WAAW,EAE1B,kBAAiB;AAoCnB,mBAAgB,gBAjCA;IACd,SAAS;IACT,cAAc;KACZ,UAAU;KACV,YAAY;KACb;IACD,SAAS,QACP,0DACG,kBACC,oCAAC;KACC,OAAM;KACN,MAAK;KACL,eAAe;AACb,cAAQ,KAAK,eAAe;AAC5B,sBAAgB,IAAI;;OAGrB,aAAY,aAAa,aACnB,EAEX,oCAAC;KACC,OAAM;KACN,MAAK;KACL,eAAe;AACb,sBAAgB,IAAI;;OAEvB,KAEQ,CACR;IAEN,CAEuC;KAE1C,CAAC,iBAAiB,gBAAgB,CACnC;EAEoD"}
1
+ {"version":3,"file":"apiHelpers-WIR8pqy0.js","names":[],"sources":["../src/utilities/auth/signInAuthProvider.js","../src/utilities/auth/whitelistedPaths.js","../src/utilities/auth/authActions.ts","../src/utilities/apiHelpers.jsx"],"sourcesContent":["import { PublicClientApplication, EventType } from '@azure/msal-browser';\nimport { ConfigService } from '../../configService';\n\nlet signInAuthProviderInstance = null;\nlet loginRequestInstance = null;\nlet tokenRequestInstance = null;\nlet apiAccessScopeValue = null;\n\nexport async function initSignInAuthProvider() {\n if (signInAuthProviderInstance) {\n return; // Already initialized\n }\n\n const PUBLIC_URL = new URL(\n import.meta.env.BASE_URL || '/',\n window.location.origin\n ).href.replace(/\\/$/, '');\n\n const REDIRECT_URL_BASE = ConfigService.config.USE_AAD_REDIRECT\n ? ConfigService.config.UNITY_URL\n : PUBLIC_URL;\n\n if (!ConfigService.config.MSAL_TENANT)\n throw new Error('MSAL_TENANT not configured');\n if (!ConfigService.config.MSAL_CLIENT_ID)\n throw new Error('MSAL_CLIENT_ID not configured');\n\n const tenant = ConfigService.config.MSAL_TENANT;\n\n // Determine idp_target and id_token_hint for Unified Policy\n const currentPath = window.location.pathname;\n const searchParams = new URLSearchParams(window.location.search);\n\n let domainHint = searchParams.get('domain_hint');\n\n if (currentPath === '/sso/entra') {\n domainHint = 'entra';\n }\n\n if (currentPath === '/sso/entra') {\n domainHint = 'entra';\n window.history.replaceState(null, '', '/');\n }\n\n const idTokenHint = searchParams.get('id_token_hint');\n\n const signInPolicy = ConfigService.config.SIGN_IN_POLICY;\n\n const applicationID = ConfigService.config.MSAL_CLIENT_ID;\n const reactRedirectUri = `${REDIRECT_URL_BASE}/${ConfigService.config.USE_AAD_REDIRECT ? 'aad_redirect' : 'aad_callback'\n }`;\n const tenantSubdomain = tenant.split('.')[0];\n const instance = `https://${tenantSubdomain}.b2clogin.com/`;\n const signInAuthority = `${instance}${tenant}/${signInPolicy}`;\n apiAccessScopeValue = `https://${tenant}/${ConfigService.config.MSAL_API_ACCESS_SCOPE}`;\n\n const ua = window.navigator.userAgent;\n const msie = ua.indexOf('MSIE ');\n const msie11 = ua.indexOf('Trident/');\n const msedge = ua.indexOf('Edge/');\n const firefox = ua.indexOf('Firefox');\n const isIE = msie > 0 || msie11 > 0;\n const isEdge = msedge > 0;\n const isFirefox = firefox > 0; // Only needed if you need to support the redirect flow in Firefox incognito\n\n // Msal Configurations\n const signInConfig = {\n auth: {\n authority: signInAuthority,\n knownAuthorities: [`${tenantSubdomain}.b2clogin.com`],\n clientId: applicationID,\n redirectUri: reactRedirectUri,\n postLogoutRedirectUri: PUBLIC_URL + '/',\n navigateToLoginRequestUrl: false,\n },\n cache: {\n cacheLocation: 'sessionStorage',\n storeAuthStateInCookie: isIE || isEdge || isFirefox,\n },\n system: {\n allowRedirectInIframe: true,\n },\n };\n\n signInAuthProviderInstance = new PublicClientApplication(signInConfig);\n\n await signInAuthProviderInstance.initialize();\n\n if (\n !signInAuthProviderInstance.getActiveAccount() &&\n signInAuthProviderInstance.getAllAccounts().length > 0\n ) {\n signInAuthProviderInstance.setActiveAccount(\n signInAuthProviderInstance.getAllAccounts()[0]\n );\n }\n\n // Check if the active account is an Entra account to set the hint\n const activeAccount = signInAuthProviderInstance.getActiveAccount();\n if (activeAccount && !domainHint) {\n const idp = activeAccount.idTokenClaims?.idp;\n if (idp && idp.includes('login.microsoftonline.com')) {\n domainHint = 'entra';\n }\n }\n\n signInAuthProviderInstance.addEventCallback((event) => {\n if (event.eventType === EventType.LOGIN_SUCCESS && event.payload.account) {\n const account = event.payload.account;\n signInAuthProviderInstance.setActiveAccount(account);\n }\n });\n\n tokenRequestInstance = { scopes: [apiAccessScopeValue] };\n\n loginRequestInstance = {\n scopes: [apiAccessScopeValue, 'openid', 'offline_access'],\n state: `${PUBLIC_URL}/aad_callback`,\n extraQueryParameters: {\n ...(idTokenHint && { id_token_hint: idTokenHint, flow: 'redeem' }),\n ...(domainHint && !idTokenHint && { domain_hint: 'entra' }),\n },\n };\n}\n\nexport const getSignInAuthProvider = () => {\n if (!signInAuthProviderInstance) {\n throw new Error(\n 'signInAuthProvider is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return signInAuthProviderInstance;\n};\n\nexport const getLoginRequest = () => {\n if (!loginRequestInstance) {\n throw new Error(\n 'loginRequest is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return loginRequestInstance;\n};\n\nexport const getTokenRequest = () => {\n if (!tokenRequestInstance) {\n throw new Error(\n 'tokenRequest is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return tokenRequestInstance;\n};\n\nexport const getApiAccessScope = () => {\n if (!apiAccessScopeValue) {\n throw new Error(\n 'apiAccessScope is not initialized. Call initSignInAuthProvider first.'\n );\n }\n return apiAccessScopeValue;\n};\n","import { UdpPageEnums } from \"../../enums/pageEnums\";\n\nexport const whitelistedPaths = [\n '/verify', \n `/page/${UdpPageEnums.Udp_Public_Forms_Page}`, // Public forms page\n '/aad_redirect',\n '/passwordresetsuccess'\n];\n","import {\n getSignInAuthProvider,\n getTokenRequest,\n getLoginRequest,\n} from './signInAuthProvider';\nimport { BrowserUtils } from '@azure/msal-browser';\nimport { storeCurrentPath } from '../redirect/LocalRedirectUrlStorage';\nimport { whitelistedPaths } from './whitelistedPaths';\nexport type LoginFunction = () => void;\nexport type LogoutFunction = () => void;\n/**\n * Hook providing auth \"actions\" such as login/logout\n */\n\nexport const useLoginAction: LoginFunction = () => loginRedirect;\nexport const loginRedirect: () => void = () => {\n const signInAuthProvider = getSignInAuthProvider();\n signInAuthProvider.loginRedirect(getLoginRequest());\n};\n\nexport function useLogoutAction(): LogoutFunction {\n return async () => {\n const signInAuthProvider = getSignInAuthProvider();\n await signInAuthProvider.logoutRedirect({\n account: signInAuthProvider.getActiveAccount(),\n });\n };\n}\n\nexport async function acquireAccessToken(): Promise<string | void> {\n const signInAuthProvider = getSignInAuthProvider();\n const account = signInAuthProvider.getActiveAccount() ?? undefined;\n\n if (account) {\n return signInAuthProvider\n .acquireTokenSilent({ ...getTokenRequest(), account })\n .then((response) => {\n return response.accessToken;\n })\n .catch(async (error) => {\n const currentPathIsWhitelisted = whitelistedPaths.includes(\n window.location.pathname\n );\n if (!currentPathIsWhitelisted) {\n signInAuthProvider.loginRedirect(getLoginRequest());\n }\n });\n }\n}\n","import React from \"react\";\nimport { acquireAccessToken } from './auth/authActions';\nimport { InteractionRequiredAuthError } from '@azure/msal-browser';\nimport { getStoredTenant } from './storage/UnitySessionStorage';\nimport { useSnackbar } from 'notistack';\nimport { Button } from '@material-ui/core';\nimport { useCallback } from 'react';\nimport { useHistory } from 'react-router-dom';\n\nexport const getMergedConfig = (accessToken, config) => {\n const headers = config?.headers ?? {};\n\n headers.currentTenantId ||= getStoredTenant();\n if (accessToken) headers.Authorization ||= `Bearer ${accessToken}`;\n\n config.headers = headers;\n return config;\n};\n\nexport const handleResponseErrors = async (error) => {\n if (error?.response?.status === 401) {\n await acquireAccessToken();\n }\n};\n\nexport const getAccessToken = async () => {\n return await acquireAccessToken();\n};\n\n/**\n * Checks to make sure the error isn't cancelled, if so just return w/o doing anything\n *Otherwise call a pre-method, create a snackbar, then call a post-method\n *preCallBack returns a bool, true = show snackbar\n */\nexport const useHandleAxiosSnackbar = () => {\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n const history = useHistory();\n\n const dismissSnackbar = useCallback(\n (key, callback) => {\n closeSnackbar(key);\n callback?.();\n },\n [closeSnackbar]\n );\n\n const handleErrorSnackbar = useCallback(\n (error, customMessage, preCallBack, callback) => {\n const fallbackErrorMessage = 'Error executing request';\n if (\n error?.toString()?.toLowerCase() === 'cancel' ||\n error?.code === 'ERR_CANCELED'\n )\n return;\n\n // Don't call the preCallback unless we actually failed.\n const showSnackBar = preCallBack?.();\n if (preCallBack && !showSnackBar) return;\n\n let errorMessage =\n customMessage ??\n (error?.response?.data || error?.message || fallbackErrorMessage);\n if (\n typeof errorMessage !== 'string' ||\n !errorMessage ||\n errorMessage.length === 0\n ) {\n errorMessage = fallbackErrorMessage;\n }\n\n enqueueSnackbar(errorMessage, {\n variant: 'error',\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'center'\n },\n action: (key) => (\n <Button\n color='secondary'\n size='small'\n onClick={() => {\n dismissSnackbar(key);\n }}\n >\n Ok\n </Button>\n )\n });\n\n callback?.();\n },\n [dismissSnackbar, enqueueSnackbar]\n );\n\n const handleSuccessSnackbar = useCallback(\n (message, preCallBack, callback, navigationPath, buttonText) => {\n const fallbackSuccessMessage = 'Executed request successfully';\n const showMessage = preCallBack?.();\n if (preCallBack && !showMessage) return;\n\n let successMessage = message ?? fallbackSuccessMessage;\n if (\n typeof successMessage !== 'string' ||\n !successMessage ||\n successMessage.length === 0\n ) {\n successMessage = fallbackSuccessMessage;\n }\n\n const options = {\n variant: 'default',\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'center'\n },\n action: (key) => (\n <>\n {navigationPath && (\n <Button\n color='secondary'\n size='small'\n onClick={() => {\n history.push(navigationPath);\n dismissSnackbar(key);\n }}\n >\n {buttonText? buttonText : 'Go to page'}\n </Button>\n )}\n <Button\n color='secondary'\n size='small'\n onClick={() => {\n dismissSnackbar(key);\n }}\n >\n Ok\n </Button>\n </>\n )\n };\n\n enqueueSnackbar(successMessage, options);\n },\n [dismissSnackbar, enqueueSnackbar]\n );\n\n return { handleErrorSnackbar, handleSuccessSnackbar };\n};\n"],"mappings":";;;;;;;;;;AAGA,IAAI,6BAA6B;AACjC,IAAI,uBAAuB;AAC3B,IAAI,uBAAuB;AAC3B,IAAI,sBAAsB;AAE1B,eAAsB,yBAAyB;AAC7C,KAAI,2BACF;CAGF,MAAM,aAAa,IAAI,IACrB,OAAO,KAAK,IAAI,YAAY,KAC5B,OAAO,SAAS,OACjB,CAAC,KAAK,QAAQ,OAAO,GAAG;CAEzB,MAAM,oBAAoB,cAAc,OAAO,mBAC3C,cAAc,OAAO,YACrB;AAEJ,KAAI,CAAC,cAAc,OAAO,YACxB,OAAM,IAAI,MAAM,6BAA6B;AAC/C,KAAI,CAAC,cAAc,OAAO,eACxB,OAAM,IAAI,MAAM,gCAAgC;CAElD,MAAM,SAAS,cAAc,OAAO;CAGpC,MAAM,cAAc,OAAO,SAAS;CACpC,MAAM,eAAe,IAAI,gBAAgB,OAAO,SAAS,OAAO;CAEhE,IAAI,aAAa,aAAa,IAAI,cAAc;AAEhD,KAAI,gBAAgB,aAClB,cAAa;AAGf,KAAI,gBAAgB,cAAc;AAChC,eAAa;AACb,SAAO,QAAQ,aAAa,MAAM,IAAI,IAAI;;CAG5C,MAAM,cAAc,aAAa,IAAI,gBAAgB;CAErD,MAAM,eAAe,cA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B,YAC1B,CAAC,kBACD,eAAe,WAAW,EAE1B,kBAAiB;AAoCnB,mBAAgB,gBAjCA;IACd,SAAS;IACT,cAAc;KACZ,UAAU;KACV,YAAY;KACb;IACD,SAAS,QACP,0DACG,kBACC,oCAAC;KACC,OAAM;KACN,MAAK;KACL,eAAe;AACb,cAAQ,KAAK,eAAe;AAC5B,sBAAgB,IAAI;;OAGrB,aAAY,aAAa,aACnB,EAEX,oCAAC;KACC,OAAM;KACN,MAAK;KACL,eAAe;AACb,sBAAgB,IAAI;;OAEvB,KAEQ,CACR;IAEN,CAEuC;KAE1C,CAAC,iBAAiB,gBAAgB,CACnC;EAEoD"}
@@ -1 +1 @@
1
- {"version":3,"file":"auth-BWJ4-JF-.js","names":["useSingleLogout: () => () => void"],"sources":["../src/utilities/auth/AuthProviderWrapper.jsx","../src/utilities/auth/useSingleLogout.ts","../src/utilities/auth/useAccessToken.js"],"sourcesContent":["import React from 'react';\n// import { LocalAuthProvider } from './LocalAuthProvider';\nimport { AuthProvider } from './AuthProvider';\n\nexport const AuthProviderWrapper = props => {\n const { children } = props;\n\n return <AuthProvider {...props}> {children}</AuthProvider>\n\n};\n","import 'react';\nimport { clearStoredPath } from '../redirect/LocalRedirectUrlStorage';\nimport { clearStoredExternalPath } from '../redirect/ExternalRedirectUrlStorage';\nimport {clearStoredTenant} from '../storage/UnitySessionStorage'\nimport {useLogoutAction} from './authActions';\n\nexport const useSingleLogout: () => () => void = () => {\n const logout = useLogoutAction();\n return () => {\n clearStoredPath();\n clearStoredExternalPath();\n clearStoredTenant();\n logout()\n }\n\n};\n","import { useState } from 'react';\nimport { acquireAccessToken } from './authActions';\n\nexport const useAccessToken = () => {\n const [accessToken, setAccessToken] = useState(null);\n\n acquireAccessToken().then((token) => {\n if (accessToken !== token) {\n setAccessToken(token);\n }\n });\n\n return accessToken;\n};\n"],"mappings":";;;;;;;;AAIA,MAAa,uBAAsB,UAAS;CAC1C,MAAM,EAAE,aAAa;AAErB,QAAO,oCAAC,cAAiB,OAAO,KAAE,SAAwB;;;;;ACD5D,MAAaA,wBAA0C;CACrD,MAAM,SAAS,iBAAiB;AAChC,cAAa;AACX,mBAAiB;AACjB,2BAAyB;AACzB,qBAAmB;AACnB,UAAQ;;;;;;ACTZ,MAAa,uBAAuB;CAClC,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;AAEpD,qBAAoB,CAAC,MAAM,UAAU;AACnC,MAAI,gBAAgB,MAClB,gBAAe,MAAM;GAEvB;AAEF,QAAO"}
1
+ {"version":3,"file":"auth-BWJ4-JF-.js","names":[],"sources":["../src/utilities/auth/AuthProviderWrapper.jsx","../src/utilities/auth/useSingleLogout.ts","../src/utilities/auth/useAccessToken.js"],"sourcesContent":["import React from 'react';\n// import { LocalAuthProvider } from './LocalAuthProvider';\nimport { AuthProvider } from './AuthProvider';\n\nexport const AuthProviderWrapper = props => {\n const { children } = props;\n\n return <AuthProvider {...props}> {children}</AuthProvider>\n\n};\n","import 'react';\nimport { clearStoredPath } from '../redirect/LocalRedirectUrlStorage';\nimport { clearStoredExternalPath } from '../redirect/ExternalRedirectUrlStorage';\nimport {clearStoredTenant} from '../storage/UnitySessionStorage'\nimport {useLogoutAction} from './authActions';\n\nexport const useSingleLogout: () => () => void = () => {\n const logout = useLogoutAction();\n return () => {\n clearStoredPath();\n clearStoredExternalPath();\n clearStoredTenant();\n logout()\n }\n\n};\n","import { useState } from 'react';\nimport { acquireAccessToken } from './authActions';\n\nexport const useAccessToken = () => {\n const [accessToken, setAccessToken] = useState(null);\n\n acquireAccessToken().then((token) => {\n if (accessToken !== token) {\n setAccessToken(token);\n }\n });\n\n return accessToken;\n};\n"],"mappings":";;;;;;;;AAIA,MAAa,uBAAsB,UAAS;CAC1C,MAAM,EAAE,aAAa;AAErB,QAAO,oCAAC,cAAiB,OAAO,KAAE,SAAwB;;;;;ACD5D,MAAa,wBAA0C;CACrD,MAAM,SAAS,iBAAiB;AAChC,cAAa;AACX,mBAAiB;AACjB,2BAAyB;AACzB,qBAAmB;AACnB,UAAQ;;;;;;ACTZ,MAAa,uBAAuB;CAClC,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;AAEpD,qBAAoB,CAAC,MAAM,UAAU;AACnC,MAAI,gBAAgB,MAClB,gBAAe,MAAM;GAEvB;AAEF,QAAO"}
@@ -156,4 +156,4 @@ const FluentUploadIconButton = (props) => {
156
156
 
157
157
  //#endregion
158
158
  export { FluentMenuListItem as a, FluentMenuListButton as i, FluentCompoundButton as n, FluentUploadButton as r, FluentUploadIconButton as t };
159
- //# sourceMappingURL=buttons-CuLiERQe.js.map
159
+ //# sourceMappingURL=buttons-DyKpA2qY.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buttons-CuLiERQe.js","names":["useStyles","useStyles","useStyles","makeStyles","useStyles","makeStyles"],"sources":["../src/UI/inputs/buttons/FluentMenuListItem.jsx","../src/UI/inputs/buttons/FluentMenuListButton.jsx","../src/UI/inputs/buttons/FluentUploadButton.jsx","../src/UI/inputs/buttons/FluentCompoundButton.jsx","../src/UI/inputs/buttons/FluentUploadIconButton.jsx"],"sourcesContent":["import React from 'react';\nimport { ButtonBase, Typography, makeStyles, Divider } from '@material-ui/core';\nimport { IncreaseIndentArrowIcon } from '@fluentui/react-icons';\nimport PropTypes from 'prop-types';\n\nconst useStyles = makeStyles(\n (theme) => ({\n wrapper: {\n display: 'flex',\n flexDirection: 'row',\n // height: theme.spacing(5),\n padding: theme.spacing(0.5),\n '&:hover': { color: theme.palette.secondary.main },\n width: '100%'\n },\n titleWrapper: {\n display: 'flex',\n width: '100%',\n textAlign: 'left'\n },\n labelWrapper: {\n marginTop: 4\n },\n label: {\n marginBottom: 4\n }\n }),\n { name: 'FluentMenuListItem' }\n);\n\nexport const FluentMenuListItem = (props) => {\n const classes = useStyles();\n const { label, value, arrow = true, ...otherProps } = props;\n\n return (\n <div>\n <ButtonBase\n classes={{\n root: classes.root\n }}\n className={classes.wrapper}\n disableRipple\n {...otherProps}\n >\n <div className={classes.titleWrapper}>\n <div className={classes.labelWrapper}>\n <div className={classes.label}>\n {' '}\n <Typography variant='caption'>\n {' '}\n <span style={{ fontWeight: 700 }}>{label}</span>{' '}\n </Typography>\n </div>\n <div>\n <Typography variant='subtitle2'>{value}</Typography>\n </div>\n </div>\n {/* @todo Change to component for size */}\n {arrow && <IncreaseIndentArrowIcon style={{ fontSize: 24 }} />}\n </div>\n </ButtonBase>\n <Divider />\n </div>\n );\n};\n\nFluentMenuListItem.propTypes = {\n /**\n * Button label\n */\n label: PropTypes.string.isRequired\n};\n","import React from 'react';\nimport { ButtonBase, Typography, makeStyles, Divider } from '@material-ui/core';\nimport { IncreaseIndentArrowIcon } from '@fluentui/react-icons';\nimport PropTypes from 'prop-types';\n\nconst useStyles = makeStyles(\n (theme) => ({\n wrapper: {\n display: 'flex',\n flexDirection: 'row',\n // height: theme.spacing(5),\n padding: theme.spacing(0.5),\n '&:hover': { color: theme.palette.secondary.main },\n width: '100%'\n },\n titleWrapper: {\n display: 'flex',\n width: '100%',\n textAlign: 'left'\n },\n labelWrapper: {\n marginTop: 4\n },\n label: {\n marginBottom: 4\n }\n }),\n { name: 'FluentMenuListButton' }\n);\n\nexport const FluentMenuListButton = (props) => {\n const classes = useStyles();\n const { label, value, arrow = true, ...otherProps } = props;\n\n return (\n <div>\n <ButtonBase\n classes={{\n root: classes.root\n }}\n className={classes.wrapper}\n disableRipple\n {...otherProps}\n >\n <div className={classes.titleWrapper}>\n <div className={classes.labelWrapper}>\n <div className={classes.label}>\n {' '}\n <Typography variant='caption'>\n {' '}\n <span style={{ fontWeight: 700 }}>{label}</span>{' '}\n </Typography>\n </div>\n <div>\n <Typography variant='subtitle2'>{value}</Typography>\n </div>\n </div>\n {/* @todo Change to component for size */}\n {arrow && <IncreaseIndentArrowIcon style={{ fontSize: 24 }} />}\n </div>\n </ButtonBase>\n <Divider />\n </div>\n );\n};\n\nFluentMenuListButton.propTypes = {\n /**\n * Button label\n */\n label: PropTypes.string.isRequired\n};\n","import React from 'react'\nimport { makeStyles } from '@material-ui/core/styles'\nimport { FluentButton } from './FluentButton'\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n '& > *': {\n margin: theme.spacing(1)\n }\n },\n input: {\n display: 'none'\n }\n}))\n\nexport const FluentUploadButton = (props) => {\n const classes = useStyles()\n const { color, label, accept, id, onChange, onClick, variant } = props\n\n return (\n <div className={classes.root}>\n <input\n accept={accept}\n className={classes.input}\n id={id}\n multiple\n type='file'\n onChange={onChange}\n />\n <label htmlFor={id}>\n <FluentButton\n onClick={onClick}\n variant={variant}\n color={color}\n component='span'\n >\n {label}\n </FluentButton>\n </label>\n <input accept={accept} className={classes.input} id={id} type='file' />\n </div>\n )\n}\n","import React from 'react'\nimport { makeStyles, Typography } from '@material-ui/core'\nimport { Button } from '@material-ui/core'\n\nconst useStyles = makeStyles({\n root: {\n borderRadius: 2,\n minHeight: 72,\n padding: '0 16px',\n minWidth: 80,\n border: (props) => `1px solid ${props.color}`\n },\n label: {\n textTransform: 'capitalize',\n fontSize: '0.875rem',\n fontWeight: 600,\n textAlign: 'left'\n }\n})\n\nexport const FluentCompoundButton = (props) => {\n const classes = useStyles(props)\n const { children, textSecondary, ...otherProps } = props\n return (\n <Button\n {...otherProps}\n disableElevation\n classes={{\n root: classes.root,\n label: classes.label\n }}\n >\n <div>\n <div>{children}</div>\n <div>\n <Typography variant='caption'>{textSecondary}</Typography>\n </div>\n </div>\n </Button>\n )\n}\n","import React from 'react'\nimport { makeStyles } from '@material-ui/core/styles'\nimport { FluentIconButton } from './FluentIconButton'\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n '& > *': {\n margin: theme.spacing(1)\n }\n },\n input: {\n display: 'none'\n }\n}))\n\nexport const FluentUploadIconButton = (props) => {\n const classes = useStyles()\n const { color, icon, aria, accept, id, onChange, onClick } = props\n\n return (\n <div className={classes.root}>\n <input\n accept={accept}\n className={classes.input}\n id={id}\n type='file'\n onChange={onChange}\n />\n <label htmlFor={id}>\n <FluentIconButton\n icon={icon}\n color={color}\n aria-label={aria}\n id={id}\n component='span'\n onClick={onClick}\n />\n </label>\n <input accept={accept} className={classes.input} id={id} type='file' />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAKA,MAAMA,cAAY,YACf,WAAW;CACV,SAAS;EACP,SAAS;EACT,eAAe;EAEf,SAAS,MAAM,QAAQ,GAAI;EAC3B,WAAW,EAAE,OAAO,MAAM,QAAQ,UAAU,MAAM;EAClD,OAAO;EACR;CACD,cAAc;EACZ,SAAS;EACT,OAAO;EACP,WAAW;EACZ;CACD,cAAc,EACZ,WAAW,GACZ;CACD,OAAO,EACL,cAAc,GACf;CACF,GACD,EAAE,MAAM,sBAAsB,CAC/B;AAED,MAAa,sBAAsB,UAAU;CAC3C,MAAM,UAAUA,aAAW;CAC3B,MAAM,EAAE,OAAO,OAAO,QAAQ,MAAM,GAAG,eAAe;AAEtD,QACE,oCAAC,aACC,oCAAC;EACC,SAAS,EACP,MAAM,QAAQ,MACf;EACD,WAAW,QAAQ;EACnB;EACA,GAAI;IAEJ,oCAAC,SAAI,WAAW,QAAQ,gBACtB,oCAAC,SAAI,WAAW,QAAQ,gBACtB,oCAAC,SAAI,WAAW,QAAQ,SACrB,KACD,oCAAC,cAAW,SAAQ,aACjB,KACD,oCAAC,UAAK,OAAO,EAAE,YAAY,KAAK,IAAG,MAAa,EAAC,IACtC,CACT,EACN,oCAAC,aACC,oCAAC,cAAW,SAAQ,eAAa,MAAmB,CAChD,CACF,EAEL,SAAS,oCAAC,2BAAwB,OAAO,EAAE,UAAU,IAAI,GAAI,CAC1D,CACK,EACb,oCAAC,cAAU,CACP;;AAIV,mBAAmB,YAAY,EAI7B,OAAO,UAAU,OAAO,YACzB;;;;AClED,MAAMC,cAAY,YACf,WAAW;CACV,SAAS;EACP,SAAS;EACT,eAAe;EAEf,SAAS,MAAM,QAAQ,GAAI;EAC3B,WAAW,EAAE,OAAO,MAAM,QAAQ,UAAU,MAAM;EAClD,OAAO;EACR;CACD,cAA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;EAAW;EAAI,MAAK;GAAS,CACnE;;;;;ACpCV,MAAME,cAAY,WAAW;CAC3B,MAAM;EACJ,cAAc;EACd,WAAW;EACX,SAAS;EACT,UAAU;EACV,SAAS,UAAU,aAAa,MAAM;EACvC;CACD,OAAO;EACL,eAAe;EACf,UAAU;EACV,YAAY;EACZ,WAAW;EACZ;CACF,CAAC;AAEF,MAAa,wBAAwB,UAAU;CAC7C,MAAM,UAAUA,YAAU,MAAM;CAChC,MAAM,EAAE,UAAU,eAAe,GAAG,eAAe;AACnD,QACE,oCAAC;EACC,GAAI;EACJ;EACA,SAAS;GACP,MAAM,QAAQ;GACd,OAAO,QAAQ;GAChB;IAED,oCAAC,aACC,oCAAC,aAAK,SAAe,EACrB,oCAAC,aACC,oCAAC,cAAW,SAAQ,aAAW,cAA2B,CACtD,CACF,CACC;;;;;AClCb,MAAM,YAAYC,cAAY,WAAW;CACvC,MAAM,EACJ,SAAS,EACP,QAAQ,MAAM,QAAQ,EAAE,EACzB,EACF;CACD,OAAO,EACL,SAAS,QACV;CACF,EAAE;AAEH,MAAa,0BAA0B,UAAU;CAC/C,MAAM,UAAU,WAAW;CAC3B,MAAM,EAAE,OAAO,MAAM,MAAM,QAAQ,IAAI,UAAU,YAAY;AAE7D,QACE,oCAAC,SAAI,WAAW,QAAQ,QACtB,oCAAC;EACS;EACR,WAAW,QAAQ;EACf;EACJ,MAAK;EACK;GACV,EACF,oCAAC,WAAM,SAAS,MACd,oCAAC;EACO;EACC;EACP,cAAY;EACR;EACJ,WAAU;EACD;GACT,CACI,EACR,oCAAC;EAAc;EAAQ,WAAW,QAAQ;EAAW;EAAI,MAAK;GAAS,CACnE"}
1
+ {"version":3,"file":"buttons-DyKpA2qY.js","names":["useStyles","useStyles","useStyles","makeStyles","useStyles","makeStyles"],"sources":["../src/UI/inputs/buttons/FluentMenuListItem.jsx","../src/UI/inputs/buttons/FluentMenuListButton.jsx","../src/UI/inputs/buttons/FluentUploadButton.jsx","../src/UI/inputs/buttons/FluentCompoundButton.jsx","../src/UI/inputs/buttons/FluentUploadIconButton.jsx"],"sourcesContent":["import React from 'react';\nimport { ButtonBase, Typography, makeStyles, Divider } from '@material-ui/core';\nimport { IncreaseIndentArrowIcon } from '@fluentui/react-icons';\nimport PropTypes from 'prop-types';\n\nconst useStyles = makeStyles(\n (theme) => ({\n wrapper: {\n display: 'flex',\n flexDirection: 'row',\n // height: theme.spacing(5),\n padding: theme.spacing(0.5),\n '&:hover': { color: theme.palette.secondary.main },\n width: '100%'\n },\n titleWrapper: {\n display: 'flex',\n width: '100%',\n textAlign: 'left'\n },\n labelWrapper: {\n marginTop: 4\n },\n label: {\n marginBottom: 4\n }\n }),\n { name: 'FluentMenuListItem' }\n);\n\nexport const FluentMenuListItem = (props) => {\n const classes = useStyles();\n const { label, value, arrow = true, ...otherProps } = props;\n\n return (\n <div>\n <ButtonBase\n classes={{\n root: classes.root\n }}\n className={classes.wrapper}\n disableRipple\n {...otherProps}\n >\n <div className={classes.titleWrapper}>\n <div className={classes.labelWrapper}>\n <div className={classes.label}>\n {' '}\n <Typography variant='caption'>\n {' '}\n <span style={{ fontWeight: 700 }}>{label}</span>{' '}\n </Typography>\n </div>\n <div>\n <Typography variant='subtitle2'>{value}</Typography>\n </div>\n </div>\n {/* @todo Change to component for size */}\n {arrow && <IncreaseIndentArrowIcon style={{ fontSize: 24 }} />}\n </div>\n </ButtonBase>\n <Divider />\n </div>\n );\n};\n\nFluentMenuListItem.propTypes = {\n /**\n * Button label\n */\n label: PropTypes.string.isRequired\n};\n","import React from 'react';\nimport { ButtonBase, Typography, makeStyles, Divider } from '@material-ui/core';\nimport { IncreaseIndentArrowIcon } from '@fluentui/react-icons';\nimport PropTypes from 'prop-types';\n\nconst useStyles = makeStyles(\n (theme) => ({\n wrapper: {\n display: 'flex',\n flexDirection: 'row',\n // height: theme.spacing(5),\n padding: theme.spacing(0.5),\n '&:hover': { color: theme.palette.secondary.main },\n width: '100%'\n },\n titleWrapper: {\n display: 'flex',\n width: '100%',\n textAlign: 'left'\n },\n labelWrapper: {\n marginTop: 4\n },\n label: {\n marginBottom: 4\n }\n }),\n { name: 'FluentMenuListButton' }\n);\n\nexport const FluentMenuListButton = (props) => {\n const classes = useStyles();\n const { label, value, arrow = true, ...otherProps } = props;\n\n return (\n <div>\n <ButtonBase\n classes={{\n root: classes.root\n }}\n className={classes.wrapper}\n disableRipple\n {...otherProps}\n >\n <div className={classes.titleWrapper}>\n <div className={classes.labelWrapper}>\n <div className={classes.label}>\n {' '}\n <Typography variant='caption'>\n {' '}\n <span style={{ fontWeight: 700 }}>{label}</span>{' '}\n </Typography>\n </div>\n <div>\n <Typography variant='subtitle2'>{value}</Typography>\n </div>\n </div>\n {/* @todo Change to component for size */}\n {arrow && <IncreaseIndentArrowIcon style={{ fontSize: 24 }} />}\n </div>\n </ButtonBase>\n <Divider />\n </div>\n );\n};\n\nFluentMenuListButton.propTypes = {\n /**\n * Button label\n */\n label: PropTypes.string.isRequired\n};\n","import React from 'react'\nimport { makeStyles } from '@material-ui/core/styles'\nimport { FluentButton } from './FluentButton'\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n '& > *': {\n margin: theme.spacing(1)\n }\n },\n input: {\n display: 'none'\n }\n}))\n\nexport const FluentUploadButton = (props) => {\n const classes = useStyles()\n const { color, label, accept, id, onChange, onClick, variant } = props\n\n return (\n <div className={classes.root}>\n <input\n accept={accept}\n className={classes.input}\n id={id}\n multiple\n type='file'\n onChange={onChange}\n />\n <label htmlFor={id}>\n <FluentButton\n onClick={onClick}\n variant={variant}\n color={color}\n component='span'\n >\n {label}\n </FluentButton>\n </label>\n <input accept={accept} className={classes.input} id={id} type='file' />\n </div>\n )\n}\n","import React from 'react'\nimport { makeStyles, Typography } from '@material-ui/core'\nimport { Button } from '@material-ui/core'\n\nconst useStyles = makeStyles({\n root: {\n borderRadius: 2,\n minHeight: 72,\n padding: '0 16px',\n minWidth: 80,\n border: (props) => `1px solid ${props.color}`\n },\n label: {\n textTransform: 'capitalize',\n fontSize: '0.875rem',\n fontWeight: 600,\n textAlign: 'left'\n }\n})\n\nexport const FluentCompoundButton = (props) => {\n const classes = useStyles(props)\n const { children, textSecondary, ...otherProps } = props\n return (\n <Button\n {...otherProps}\n disableElevation\n classes={{\n root: classes.root,\n label: classes.label\n }}\n >\n <div>\n <div>{children}</div>\n <div>\n <Typography variant='caption'>{textSecondary}</Typography>\n </div>\n </div>\n </Button>\n )\n}\n","import React from 'react'\nimport { makeStyles } from '@material-ui/core/styles'\nimport { FluentIconButton } from './FluentIconButton'\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n '& > *': {\n margin: theme.spacing(1)\n }\n },\n input: {\n display: 'none'\n }\n}))\n\nexport const FluentUploadIconButton = (props) => {\n const classes = useStyles()\n const { color, icon, aria, accept, id, onChange, onClick } = props\n\n return (\n <div className={classes.root}>\n <input\n accept={accept}\n className={classes.input}\n id={id}\n type='file'\n onChange={onChange}\n />\n <label htmlFor={id}>\n <FluentIconButton\n icon={icon}\n color={color}\n aria-label={aria}\n id={id}\n component='span'\n onClick={onClick}\n />\n </label>\n <input accept={accept} className={classes.input} id={id} type='file' />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAKA,MAAMA,cAAY,YACf,WAAW;CACV,SAAS;EACP,SAAS;EACT,eAAe;EAEf,SAAS,MAAM,QAAQ,GAAI;EAC3B,WAAW,EAAE,OAAO,MAAM,QAAQ,UAAU,MAAM;EAClD,OAAO;EACR;CACD,cAAc;EACZ,SAAS;EACT,OAAO;EACP,WAAW;EACZ;CACD,cAAc,EACZ,WAAW,GACZ;CACD,OAAO,EACL,cAAc,GACf;CACF,GACD,EAAE,MAAM,sBAAsB,CAC/B;AAED,MAAa,sBAAsB,UAAU;CAC3C,MAAM,UAAUA,aAAW;CAC3B,MAAM,EAAE,OAAO,OAAO,QAAQ,MAAM,GAAG,eAAe;AAEtD,QACE,oCAAC,aACC,oCAAC;EACC,SAAS,EACP,MAAM,QAAQ,MACf;EACD,WAAW,QAA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D,OAAO,EACL,SAAS,QACV;CACF,EAAE;AAEH,MAAa,0BAA0B,UAAU;CAC/C,MAAM,UAAU,WAAW;CAC3B,MAAM,EAAE,OAAO,MAAM,MAAM,QAAQ,IAAI,UAAU,YAAY;AAE7D,QACE,oCAAC,SAAI,WAAW,QAAQ,QACtB,oCAAC;EACS;EACR,WAAW,QAAQ;EACf;EACJ,MAAK;EACK;GACV,EACF,oCAAC,WAAM,SAAS,MACd,oCAAC;EACO;EACC;EACP,cAAY;EACR;EACJ,WAAU;EACD;GACT,CACI,EACR,oCAAC;EAAc;EAAQ,WAAW,QAAQ;EAAW;EAAI,MAAK;GAAS,CACnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"catalogStore-DP2GxpTJ.js","names":["useCatalogStore: () => CatalogState"],"sources":["../src/stores/catalogStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\n\ninterface CatalogState {\n currentApiCatalogId: string | null | undefined;\n setCurrentApiCatalogId: (apiCatalogId: string) => void;\n catalogsMap: Object | null | undefined;\n setCatalogsMap: (catalog: Object) => void;\n promotedEntityMap: Object | null | undefined;\n setPromotedEntityMap: (catalog: Object) => void;\n promotedMethodEntitiesMap: Object | null | undefined;\n setPromotedMethodEntitiesMap: (catalog: Object) => void;\n}\n\nexport const useCatalogStore: () => CatalogState = create<CatalogState>()(\n devtools((set) => ({\n currentApiCatalogId: '',\n setCurrentApiCatalogId: (apiCatalogId) => {\n sessionStorage.setItem('current-api-catalog-id', apiCatalogId);\n set((state) => ({ currentApiCatalogId: apiCatalogId }));\n },\n catalogsMap: {},\n setCatalogsMap: (catalogsMap) =>\n set((state) => ({\n catalogsMap: { ...state.catalogsMap, ...catalogsMap }\n })),\n promotedEntityMap: {},\n setPromotedEntityMap: (promotedEntityMap) =>\n set((state) => ({\n promotedEntityMap: { ...state.promotedEntityMap, ...promotedEntityMap }\n })),\n promotedMethodEntitiesMap: {},\n setPromotedMethodEntitiesMap: (promotedMethodEntitiesMap) =>\n set((state) => ({\n promotedMethodEntitiesMap: {\n ...state.promotedMethodEntitiesMap,\n ...promotedMethodEntitiesMap\n }\n }))\n }))\n);\n"],"mappings":";;;;AAcA,MAAaA,kBAAsC,QAAsB,CACvE,UAAU,SAAS;CACjB,qBAAqB;CACrB,yBAAyB,iBAAiB;AACxC,iBAAe,QAAQ,0BAA0B,aAAa;AAC9D,OAAK,WAAW,EAAE,qBAAqB,cAAc,EAAE;;CAEzD,aAAa,EAAE;CACf,iBAAiB,gBACf,KAAK,WAAW,EACd,aAAa;EAAE,GAAG,MAAM;EAAa,GAAG;EAAa,EACtD,EAAE;CACL,mBAAmB,EAAE;CACrB,uBAAuB,sBACrB,KAAK,WAAW,EACd,mBAAmB;EAAE,GAAG,MAAM;EAAmB,GAAG;EAAmB,EACxE,EAAE;CACL,2BAA2B,EAAE;CAC7B,+BAA+B,8BAC7B,KAAK,WAAW,EACd,2BAA2B;EACzB,GAAG,MAAM;EACT,GAAG;EACJ,EACF,EAAE;CACN,EAAE,CACJ"}
1
+ {"version":3,"file":"catalogStore-DP2GxpTJ.js","names":[],"sources":["../src/stores/catalogStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\n\ninterface CatalogState {\n currentApiCatalogId: string | null | undefined;\n setCurrentApiCatalogId: (apiCatalogId: string) => void;\n catalogsMap: Object | null | undefined;\n setCatalogsMap: (catalog: Object) => void;\n promotedEntityMap: Object | null | undefined;\n setPromotedEntityMap: (catalog: Object) => void;\n promotedMethodEntitiesMap: Object | null | undefined;\n setPromotedMethodEntitiesMap: (catalog: Object) => void;\n}\n\nexport const useCatalogStore: () => CatalogState = create<CatalogState>()(\n devtools((set) => ({\n currentApiCatalogId: '',\n setCurrentApiCatalogId: (apiCatalogId) => {\n sessionStorage.setItem('current-api-catalog-id', apiCatalogId);\n set((state) => ({ currentApiCatalogId: apiCatalogId }));\n },\n catalogsMap: {},\n setCatalogsMap: (catalogsMap) =>\n set((state) => ({\n catalogsMap: { ...state.catalogsMap, ...catalogsMap }\n })),\n promotedEntityMap: {},\n setPromotedEntityMap: (promotedEntityMap) =>\n set((state) => ({\n promotedEntityMap: { ...state.promotedEntityMap, ...promotedEntityMap }\n })),\n promotedMethodEntitiesMap: {},\n setPromotedMethodEntitiesMap: (promotedMethodEntitiesMap) =>\n set((state) => ({\n promotedMethodEntitiesMap: {\n ...state.promotedMethodEntitiesMap,\n ...promotedMethodEntitiesMap\n }\n }))\n }))\n);\n"],"mappings":";;;;AAcA,MAAa,kBAAsC,QAAsB,CACvE,UAAU,SAAS;CACjB,qBAAqB;CACrB,yBAAyB,iBAAiB;AACxC,iBAAe,QAAQ,0BAA0B,aAAa;AAC9D,OAAK,WAAW,EAAE,qBAAqB,cAAc,EAAE;;CAEzD,aAAa,EAAE;CACf,iBAAiB,gBACf,KAAK,WAAW,EACd,aAAa;EAAE,GAAG,MAAM;EAAa,GAAG;EAAa,EACtD,EAAE;CACL,mBAAmB,EAAE;CACrB,uBAAuB,sBACrB,KAAK,WAAW,EACd,mBAAmB;EAAE,GAAG,MAAM;EAAmB,GAAG;EAAmB,EACxE,EAAE;CACL,2BAA2B,EAAE;CAC7B,+BAA+B,8BAC7B,KAAK,WAAW,EACd,2BAA2B;EACzB,GAAG,MAAM;EACT,GAAG;EACJ,EACF,EAAE;CACN,EAAE,CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"charts-pX01x8rO.js","names":["InsightRenderer: React.FC<InsightRendererProps>","properties: InsightTypeProperties","UdpCharts","kpis:\n | { value?: string; label?: string; active?: boolean }[]\n | undefined","kpiField: { operation?: string; property?: string }","dataConfig: { [key: string]: any } | null","dataMapping: {\n name: string;\n value: { name: string; operation: string | undefined };\n alias?: string;\n }[]"],"sources":["../src/UI/charts/InsightRenderer.tsx"],"sourcesContent":["import React, { useMemo, useState, useEffect } from 'react';\nimport * as UdpCharts from './amcharts';\nimport { Insight, InsightTypeField, InsightTypeProperties } from './types';\nimport { useUser } from '../../utilities/auth/useUser';\nimport { useAxiosGet } from '../../utilities/useAxiosGet';\nimport QueryResult from '../../models/QueryResult';\nimport { ConfigService } from '../../configService';\nexport type UdpChart =\n | 'UdpBarChart'\n | 'UdpDonutChart'\n | 'UdpLineChart'\n | 'UdpDistributionChart';\nexport interface InsightRendererProps {\n insight: Insight | undefined;\n data: QueryResult | undefined;\n insightId: string | undefined;\n}\n\nconst capitilizeFirstLetter = (s: string): string =>\n s?.charAt?.(0)?.toUpperCase?.() + s?.slice?.(1);\nconst decapitilizeFirstLetter = (s: string): string =>\n s?.charAt?.(0)?.toLowerCase?.() + s?.slice?.(1);\n\nfunction getAggregateValue<T>(data: QueryResult | undefined, key: string): T {\n return data?.aggregateResults?.[0]?.[key] as T;\n}\n/**\n * InsightRenderer component\n *\n * This component is responsible for rendering insights based on the provided props.\n *\n * @prop {Insight} `insight` - The insight metadata\n * @prop {any} `data` - Search results associated with the insight\n * @prop {string} `insightId` - InsightId, if included the component will get the data from server\n * @returns {JSX.Element} - The rendered insight component.\n */\nexport const InsightRenderer: React.FC<InsightRendererProps> = (props: InsightRendererProps) => {\n const { insight: insightProp, data, insightId } = props;\n const user = useUser();\n const [{ data: loadedInsight }] = useAxiosGet(\n ConfigService.integrationV2ApiUrl,\n `Insight/${insightId}/Full`,\n {},\n !insightId || !user\n ) as unknown as [{ data: Insight }];\n\n // Use the insight passed in or the insightId\n const insight = useMemo(() => {\n if (!!insightId) return loadedInsight;\n else return insightProp;\n }, [loadedInsight, insightId, insightProp]);\n\n // determine chart component\n const Chart = useMemo(() => {\n if (!insight?.insightInsightType?.properties) return null;\n let properties: InsightTypeProperties;\n if (typeof insight?.insightInsightType?.properties === 'string') {\n properties = JSON.parse(\n insight?.insightInsightType?.properties as unknown as string\n ) as InsightTypeProperties;\n } else {\n properties = insight?.insightInsightType?.properties;\n }\n // @ts-ignore\n return UdpCharts?.[properties?.component];\n }, [insight?.insightInsightType]);\n\n const kpis:\n | { value?: string; label?: string; active?: boolean }[]\n | undefined = useMemo(() => {\n if (insight == null) return undefined;\n return insight?.insightInsightKpi?.map?.((kpi) => {\n const kpiField: { operation?: string; property?: string } =\n typeof kpi.field === 'object' ? kpi.field : JSON.parse(kpi.field);\n console.log(kpiField);\n return {\n label: kpi.label,\n active: kpi.active,\n value: getAggregateValue<string>(\n data,\n `${\n decapitilizeFirstLetter(kpiField.property ?? '') ?? ''\n }${capitilizeFirstLetter(kpiField.operation?.toLowerCase() ?? '')}`\n )\n };\n });\n }, [data, insight?.insightInsightKpi]);\n\n const dataConfig: { [key: string]: any } | null = useMemo(() => {\n if (insight == null) return null;\n const dataMapping: {\n name: string;\n value: { name: string; operation: string | undefined };\n alias?: string;\n }[] =\n typeof insight.dataMapping === 'object'\n ? insight.dataMapping\n : JSON.parse(insight.dataMapping ?? '{}');\n const dataFields: InsightTypeField[] =\n typeof insight.insightInsightType?.dataFields === 'object'\n ? insight.insightInsightType?.dataFields\n : JSON.parse(insight.insightInsightType?.dataFields ?? '{}');\n\n return dataFields?.reduce?.((value: { [key: string]: any }, field) => {\n const fieldValue = dataMapping?.find?.(\n (dm) => dm.name === field.name\n )?.value;\n if (fieldValue?.operation != undefined) {\n value[field.name] =\n decapitilizeFirstLetter(fieldValue?.name) + fieldValue.operation;\n } else {\n // @ts-ignore\n value[field.name] = fieldValue?.alias ?? fieldValue?.name ?? fieldValue;\n }\n\n return value;\n }, {});\n }, [insight?.dataMapping, insight?.insightInsightType]);\n const combinedData = useMemo(() => {\n if (data?.aggregateResults == null || data?.aggregateResults?.length === 0)\n return data?.pageList;\n return data?.pageList.map((page, i) => ({\n ...page,\n ...data?.aggregateResults?.[i]\n }));\n }, [data]);\n if (Chart == null) return null;\n return (\n <Chart\n data={combinedData}\n title={insight?.title}\n subheader={insight?.subheader}\n {...dataConfig}\n kpis={kpis?.filter((kpi) => kpi.active)}\n />\n );\n};\n"],"mappings":";;;;;;;AAkBA,MAAM,yBAAyB,MAC7B,GAAG,SAAS,EAAE,EAAE,eAAe,GAAG,GAAG,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,cAKJ,OAAO,QAAQ,gBAAgB,WAC3B,QAAQ,cACR,KAAK,MAAM,QAAQ,eAAe,KAAK;AAM7C,UAJE,OAAO,QAAQ,oBAAoB,eAAe,WAC9C,QAAQ,oBAAoB,aAC5B,KAAK,MAAM,QAAQ,oBAAoB,cAAc,KAAK,GAE7C,UAAU,OAA+B,UAAU;GACpE,MAAM,aAAa,aAAa,QAC7B,OAAO,GAAG,SAAS,MAAM,KAC3B,EAAE;AACH,OAAI,YAAY,aAAa,OAC3B,OAAM,MAAM,QACV,wBAAwB,YAAY,KAAK,GAAG,WAAW;OAGzD,OAAM,MAAM,QAAQ,YAAY,SAAS,YAAY,QAAQ;AAG/D,UAAO;KACN,EAAE,CAAC;IACL,CAAC,SAAS,aAAa,SAAS,mBAAmB,CAAC;CACvD,MAAM,eAAe,cAAc;AACjC,MAAI,MAAM,oBAAoB,QAAQ,MAAM,kBAAkB,WAAW,EACvE,QAAO,MAAM;AACf,SAAO,MAAM,SAAS,KAAK,MAAM,OAAO;GACtC,GAAG;GACH,GAAG,MAAM,mBAAmB;GAC7B,EAAE;IACF,CAAC,KAAK,CAAC;AACV,KAAI,SAAS,KAAM,QAAO;AAC1B,QACE,oCAAC;EACC,MAAM;EACN,OAAO,SAAS;EAChB,WAAW,SAAS;EACpB,GAAI;EACJ,MAAM,MAAM,QAAQ,QAAQ,IAAI,OAAO;GACvC"}
1
+ {"version":3,"file":"charts-pX01x8rO.js","names":["UdpCharts"],"sources":["../src/UI/charts/InsightRenderer.tsx"],"sourcesContent":["import React, { useMemo, useState, useEffect } from 'react';\nimport * as UdpCharts from './amcharts';\nimport { Insight, InsightTypeField, InsightTypeProperties } from './types';\nimport { useUser } from '../../utilities/auth/useUser';\nimport { useAxiosGet } from '../../utilities/useAxiosGet';\nimport QueryResult from '../../models/QueryResult';\nimport { ConfigService } from '../../configService';\nexport type UdpChart =\n | 'UdpBarChart'\n | 'UdpDonutChart'\n | 'UdpLineChart'\n | 'UdpDistributionChart';\nexport interface InsightRendererProps {\n insight: Insight | undefined;\n data: QueryResult | undefined;\n insightId: string | undefined;\n}\n\nconst capitilizeFirstLetter = (s: string): string =>\n s?.charAt?.(0)?.toUpperCase?.() + s?.slice?.(1);\nconst decapitilizeFirstLetter = (s: string): string =>\n s?.charAt?.(0)?.toLowerCase?.() + s?.slice?.(1);\n\nfunction getAggregateValue<T>(data: QueryResult | undefined, key: string): T {\n return data?.aggregateResults?.[0]?.[key] as T;\n}\n/**\n * InsightRenderer component\n *\n * This component is responsible for rendering insights based on the provided props.\n *\n * @prop {Insight} `insight` - The insight metadata\n * @prop {any} `data` - Search results associated with the insight\n * @prop {string} `insightId` - InsightId, if included the component will get the data from server\n * @returns {JSX.Element} - The rendered insight component.\n */\nexport const InsightRenderer: React.FC<InsightRendererProps> = (props: InsightRendererProps) => {\n const { insight: insightProp, data, insightId } = props;\n const user = useUser();\n const [{ data: loadedInsight }] = useAxiosGet(\n ConfigService.integrationV2ApiUrl,\n `Insight/${insightId}/Full`,\n {},\n !insightId || !user\n ) as unknown as [{ data: Insight }];\n\n // Use the insight passed in or the insightId\n const insight = useMemo(() => {\n if (!!insightId) return loadedInsight;\n else return insightProp;\n }, [loadedInsight, insightId, insightProp]);\n\n // determine chart component\n const Chart = useMemo(() => {\n if (!insight?.insightInsightType?.properties) return null;\n let properties: InsightTypeProperties;\n if (typeof insight?.insightInsightType?.properties === 'string') {\n properties = JSON.parse(\n insight?.insightInsightType?.properties as unknown as string\n ) as InsightTypeProperties;\n } else {\n properties = insight?.insightInsightType?.properties;\n }\n // @ts-ignore\n return UdpCharts?.[properties?.component];\n }, [insight?.insightInsightType]);\n\n const kpis:\n | { value?: string; label?: string; active?: boolean }[]\n | undefined = useMemo(() => {\n if (insight == null) return undefined;\n return insight?.insightInsightKpi?.map?.((kpi) => {\n const kpiField: { operation?: string; property?: string } =\n typeof kpi.field === 'object' ? kpi.field : JSON.parse(kpi.field);\n console.log(kpiField);\n return {\n label: kpi.label,\n active: kpi.active,\n value: getAggregateValue<string>(\n data,\n `${\n decapitilizeFirstLetter(kpiField.property ?? '') ?? ''\n }${capitilizeFirstLetter(kpiField.operation?.toLowerCase() ?? '')}`\n )\n };\n });\n }, [data, insight?.insightInsightKpi]);\n\n const dataConfig: { [key: string]: any } | null = useMemo(() => {\n if (insight == null) return null;\n const dataMapping: {\n name: string;\n value: { name: string; operation: string | undefined };\n alias?: string;\n }[] =\n typeof insight.dataMapping === 'object'\n ? insight.dataMapping\n : JSON.parse(insight.dataMapping ?? '{}');\n const dataFields: InsightTypeField[] =\n typeof insight.insightInsightType?.dataFields === 'object'\n ? insight.insightInsightType?.dataFields\n : JSON.parse(insight.insightInsightType?.dataFields ?? '{}');\n\n return dataFields?.reduce?.((value: { [key: string]: any }, field) => {\n const fieldValue = dataMapping?.find?.(\n (dm) => dm.name === field.name\n )?.value;\n if (fieldValue?.operation != undefined) {\n value[field.name] =\n decapitilizeFirstLetter(fieldValue?.name) + fieldValue.operation;\n } else {\n // @ts-ignore\n value[field.name] = fieldValue?.alias ?? fieldValue?.name ?? fieldValue;\n }\n\n return value;\n }, {});\n }, [insight?.dataMapping, insight?.insightInsightType]);\n const combinedData = useMemo(() => {\n if (data?.aggregateResults == null || data?.aggregateResults?.length === 0)\n return data?.pageList;\n return data?.pageList.map((page, i) => ({\n ...page,\n ...data?.aggregateResults?.[i]\n }));\n }, [data]);\n if (Chart == null) return null;\n return (\n <Chart\n data={combinedData}\n title={insight?.title}\n subheader={insight?.subheader}\n {...dataConfig}\n kpis={kpis?.filter((kpi) => kpi.active)}\n />\n );\n};\n"],"mappings":";;;;;;;AAkBA,MAAM,yBAAyB,MAC7B,GAAG,SAAS,EAAE,EAAE,eAAe,GAAG,GAAG,QAAQ,EAAE;AACjD,MAAM,2BAA2B,MAC/B,GAAG,SAAS,EAAE,EAAE,eAAe,GAAG,GAAG,QAAQ,EAAE;AAEjD,SAAS,kBAAqB,MAA+B,KAAgB;AAC3E,QAAO,MAAM,mBAAmB,KAAK;;;;;;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cAAc,KAAK,GAE7C,UAAU,OAA+B,UAAU;GACpE,MAAM,aAAa,aAAa,QAC7B,OAAO,GAAG,SAAS,MAAM,KAC3B,EAAE;AACH,OAAI,YAAY,aAAa,OAC3B,OAAM,MAAM,QACV,wBAAwB,YAAY,KAAK,GAAG,WAAW;OAGzD,OAAM,MAAM,QAAQ,YAAY,SAAS,YAAY,QAAQ;AAG/D,UAAO;KACN,EAAE,CAAC;IACL,CAAC,SAAS,aAAa,SAAS,mBAAmB,CAAC;CACvD,MAAM,eAAe,cAAc;AACjC,MAAI,MAAM,oBAAoB,QAAQ,MAAM,kBAAkB,WAAW,EACvE,QAAO,MAAM;AACf,SAAO,MAAM,SAAS,KAAK,MAAM,OAAO;GACtC,GAAG;GACH,GAAG,MAAM,mBAAmB;GAC7B,EAAE;IACF,CAAC,KAAK,CAAC;AACV,KAAI,SAAS,KAAM,QAAO;AAC1B,QACE,oCAAC;EACC,MAAM;EACN,OAAO,SAAS;EAChB,WAAW,SAAS;EACpB,GAAI;EACJ,MAAM,MAAM,QAAQ,QAAQ,IAAI,OAAO;GACvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"form-Dj1zVw6K.js","names":["FormError: FC<FormErrorProps>","createDecorator","FormSpy: FC<FormSpyProps>","FinalFormSpy","useForm","useFinalForm","useField","useFinalField","useFormState","useFinalFormState"],"sources":["../src/utilities/form/FormError.tsx","../src/utilities/form/useFieldChangeListener.ts","../src/utilities/form/FormSpy.tsx","../src/utilities/form/formHooks.js"],"sourcesContent":["import { Typography, TypographyProps } from '@material-ui/core';\nimport React, { FC } from 'react';\nimport { FormSpy } from 'react-final-form';\n\nexport type FormErrorProps = TypographyProps<'p', {}>;\n\n/**\n * Displays form-wide validation and submit errors in a MUI Typography error element\n */\nexport const FormError: FC<FormErrorProps> = props => {\n return (\n <FormSpy subscription={{ error: true, submitError: true }}>\n {({ error, submitError }) => {\n if (error || submitError) {\n return (\n <Typography component=\"p\" paragraph {...props} color=\"error\">\n {error || submitError}\n </Typography>\n );\n }\n\n return null;\n }}\n </FormSpy>\n );\n};\n","import { useEffect } from 'react';\nimport { useForm } from 'react-final-form';\nimport { FormApi } from 'final-form';\n\nexport type FieldChangeCallback<T> = (\n form: FormApi,\n value: T,\n prevValue: T\n) => void;\n\n/**\n * Form helper hook that runs a callback when the value of a field has changed\n * Usefull for creating effects where changes to one field affect the value of another field imperatively\n */\nexport function useFieldChangeListener<T>(\n name: string,\n cb: FieldChangeCallback<T>\n) {\n const form = useForm();\n\n useEffect(() => {\n let lastValue = form.getFieldState(name)?.value;\n\n const unsubscribe = form.subscribe(\n ({ values }) => {\n const value = values[name];\n if (value !== lastValue) {\n cb(form, value, lastValue);\n }\n\n lastValue = values[name];\n },\n { values: true }\n );\n return unsubscribe;\n }, [form, name, cb]);\n}\n","import React, { FC } from 'react';\nimport {\n AnyObject,\n FormSpy as FinalFormSpy,\n FormSpyProps as FinalFormSpyProps,\n FormSpyRenderProps\n} from 'react-final-form';\nimport createDecorator from './final-form-scroll/createDecorator';\n\nexport interface FormSpyProps<FormValues = AnyObject>\n extends FinalFormSpyProps<FormValues> {\n children?: (props: FormSpyRenderProps<FormValues>) => React.ReactNode;\n id?: string;\n}\n\nconst scrollToError = createDecorator();\n\n/**\n * final-form Form Spy wrapper\n */\nexport const FormSpy: FC<FormSpyProps> = ({\n render: renderProp,\n children,\n ...props\n}) => {\n const render = renderProp || children;\n return (\n <FinalFormSpy {...props}>\n {(params) => (\n <>{typeof render === 'function' ? render(params) : render}</>\n )}\n </FinalFormSpy>\n );\n};\n","import {\n useForm as useFinalForm,\n useField as useFinalField,\n useFormState as useFinalFormState\n} from 'react-final-form';\n/**\n * @returns {any}\n */\nexport const useForm = () => useFinalForm();\n/**\n * @returns {any}\n */\nexport const useField = () => useFinalField();\n/**\n * @returns {any}\n */\nexport const useFormState = () => useFinalFormState();\n"],"mappings":";;;;;;;;;;AASA,MAAaA,aAAgC,UAAS;AACpD,QACE,oCAAC,WAAQ,cAAc;EAAE,OAAO;EAAM,aAAa;EAAM,KACrD,EAAE,OAAO,kBAAkB;AAC3B,MAAI,SAAS,YACX,QACE,oCAAC;GAAW,WAAU;GAAI;GAAU,GAAI;GAAO,OAAM;KAClD,SAAS,YACC;AAIjB,SAAO;GAED;;;;;;;;;ACTd,SAAgB,uBACd,MACA,IACA;CACA,MAAM,OAAO,SAAS;AAEtB,iBAAgB;EACd,IAAI,YAAY,KAAK,cAAc,KAAK,EAAE;AAa1C,SAXoB,KAAK,WACtB,EAAE,aAAa;GACd,MAAM,QAAQ,OAAO;AACrB,OAAI,UAAU,UACZ,IAAG,MAAM,OAAO,UAAU;AAG5B,eAAY,OAAO;KAErB,EAAE,QAAQ,MAAM,CACjB;IAEA;EAAC;EAAM;EAAM;EAAG,CAAC;;;;;ACpBAC,yBAAiB;;;;AAKvC,MAAaC,aAA6B,EACxC,QAAQ,YACR,UACA,GAAG,YACC;CACJ,MAAM,SAAS,cAAc;AAC7B,QACE,oCAACC,SAAiB,QACd,WACA,0DAAG,OAAO,WAAW,aAAa,OAAO,OAAO,GAAG,OAAU,CAElD;;;;;;;;ACvBnB,MAAaC,kBAAgBC,SAAc;;;;AAI3C,MAAaC,mBAAiBC,UAAe;;;;AAI7C,MAAaC,uBAAqBC,cAAmB"}
1
+ {"version":3,"file":"form-Dj1zVw6K.js","names":["createDecorator","FormSpy","FinalFormSpy","useForm","useFinalForm","useField","useFinalField","useFormState","useFinalFormState"],"sources":["../src/utilities/form/FormError.tsx","../src/utilities/form/useFieldChangeListener.ts","../src/utilities/form/FormSpy.tsx","../src/utilities/form/formHooks.js"],"sourcesContent":["import { Typography, TypographyProps } from '@material-ui/core';\nimport React, { FC } from 'react';\nimport { FormSpy } from 'react-final-form';\n\nexport type FormErrorProps = TypographyProps<'p', {}>;\n\n/**\n * Displays form-wide validation and submit errors in a MUI Typography error element\n */\nexport const FormError: FC<FormErrorProps> = props => {\n return (\n <FormSpy subscription={{ error: true, submitError: true }}>\n {({ error, submitError }) => {\n if (error || submitError) {\n return (\n <Typography component=\"p\" paragraph {...props} color=\"error\">\n {error || submitError}\n </Typography>\n );\n }\n\n return null;\n }}\n </FormSpy>\n );\n};\n","import { useEffect } from 'react';\nimport { useForm } from 'react-final-form';\nimport { FormApi } from 'final-form';\n\nexport type FieldChangeCallback<T> = (\n form: FormApi,\n value: T,\n prevValue: T\n) => void;\n\n/**\n * Form helper hook that runs a callback when the value of a field has changed\n * Usefull for creating effects where changes to one field affect the value of another field imperatively\n */\nexport function useFieldChangeListener<T>(\n name: string,\n cb: FieldChangeCallback<T>\n) {\n const form = useForm();\n\n useEffect(() => {\n let lastValue = form.getFieldState(name)?.value;\n\n const unsubscribe = form.subscribe(\n ({ values }) => {\n const value = values[name];\n if (value !== lastValue) {\n cb(form, value, lastValue);\n }\n\n lastValue = values[name];\n },\n { values: true }\n );\n return unsubscribe;\n }, [form, name, cb]);\n}\n","import React, { FC } from 'react';\nimport {\n AnyObject,\n FormSpy as FinalFormSpy,\n FormSpyProps as FinalFormSpyProps,\n FormSpyRenderProps\n} from 'react-final-form';\nimport createDecorator from './final-form-scroll/createDecorator';\n\nexport interface FormSpyProps<FormValues = AnyObject>\n extends FinalFormSpyProps<FormValues> {\n children?: (props: FormSpyRenderProps<FormValues>) => React.ReactNode;\n id?: string;\n}\n\nconst scrollToError = createDecorator();\n\n/**\n * final-form Form Spy wrapper\n */\nexport const FormSpy: FC<FormSpyProps> = ({\n render: renderProp,\n children,\n ...props\n}) => {\n const render = renderProp || children;\n return (\n <FinalFormSpy {...props}>\n {(params) => (\n <>{typeof render === 'function' ? render(params) : render}</>\n )}\n </FinalFormSpy>\n );\n};\n","import {\n useForm as useFinalForm,\n useField as useFinalField,\n useFormState as useFinalFormState\n} from 'react-final-form';\n/**\n * @returns {any}\n */\nexport const useForm = () => useFinalForm();\n/**\n * @returns {any}\n */\nexport const useField = () => useFinalField();\n/**\n * @returns {any}\n */\nexport const useFormState = () => useFinalFormState();\n"],"mappings":";;;;;;;;;;AASA,MAAa,aAAgC,UAAS;AACpD,QACE,oCAAC,WAAQ,cAAc;EAAE,OAAO;EAAM,aAAa;EAAM,KACrD,EAAE,OAAO,kBAAkB;AAC3B,MAAI,SAAS,YACX,QACE,oCAAC;GAAW,WAAU;GAAI;GAAU,GAAI;GAAO,OAAM;KAClD,SAAS,YACC;AAIjB,SAAO;GAED;;;;;;;;;ACTd,SAAgB,uBACd,MACA,IACA;CACA,MAAM,OAAO,SAAS;AAEtB,iBAAgB;EACd,IAAI,YAAY,KAAK,cAAc,KAAK,EAAE;AAa1C,SAXoB,KAAK,WACtB,EAAE,aAAa;GACd,MAAM,QAAQ,OAAO;AACrB,OAAI,UAAU,UACZ,IAAG,MAAM,OAAO,UAAU;AAG5B,eAAY,OAAO;KAErB,EAAE,QAAQ,MAAM,CACjB;IAEA;EAAC;EAAM;EAAM;EAAG,CAAC;;;;;ACpBAA,yBAAiB;;;;AAKvC,MAAaC,aAA6B,EACxC,QAAQ,YACR,UACA,GAAG,YACC;CACJ,MAAM,SAAS,cAAc;AAC7B,QACE,oCAACC,SAAiB,QACd,WACA,0DAAG,OAAO,WAAW,aAAa,OAAO,OAAO,GAAG,OAAU,CAElD;;;;;;;;ACvBnB,MAAaC,kBAAgBC,SAAc;;;;AAI3C,MAAaC,mBAAiBC,UAAe;;;;AAI7C,MAAaC,uBAAqBC,cAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-BNndjGer.js","names":["dateTimeOptions: Intl.DateTimeFormatOptions","localeString: string","error"],"sources":["../src/hooks/useOutlook.js","../src/hooks/useProductVersion.js","../src/hooks/useDateLocale.ts","../src/hooks/useWorkflow.js","../src/hooks/usePreloadPages.js"],"sourcesContent":["import { apiMutate } from '../utilities/useAxiosMutate';\nimport { useEffect } from 'react';\nimport { ConfigService } from '../configService';\n\nexport const useOutlook = (callbackUri, onLogin) => {\n\n const invalidateUserSession = async () => {\n try {\n // if (ConfigService.integrationV2ApiUrl === undefined) {\n // throw new Error('REACT_APP_INTEGRATION_V2_API_BASE is undefined')\n // }\n // const accessToken = localStorage.getItem('outlookAccessToken');\n // const response = await apiMutate(\n // ConfigService.integrationV2ApiUrl,\n // `OutlookIntegrationAccessToken/invalidateUserSession`,\n // {\n // method: \"post\",\n // headers : {\n // OutlookAccessToken: accessToken\n // }\n // }\n // )\n\n } catch (error) {\n console.error('Error refreshing access token:', error);\n return null;\n // }\n } finally {\n try {\n localStorage.removeItem('outlookAccessToken');\n } catch (error) {\n console.error('Error removing accessToken:', error);\n }\n\n try {\n localStorage.removeItem('outlookRefreshToken');\n } catch (error) {\n console.error('Error removing refreshToken:', error);\n }\n\n try {\n localStorage.removeItem('outlookExpiresAt');\n } catch (error) {\n console.error('Error removing expiresAt:', error);\n }\n\n }\n }\n\n const getAccessToken = async () => {\n let accessToken = localStorage.getItem('outlookAccessToken');\n\n if (!accessToken) {\n throw(new Error(\"No access token found\"));\n }\n\n const expiresAt = localStorage.getItem('outlookExpiresAt');\n if (expiresAt && !isBeforeCurrentTime(expiresAt)) {\n return accessToken;\n }\n\n const refreshToken = localStorage.getItem('outlookRefreshToken');\n if (!refreshToken) {\n throw(new Error(\"No refresh token found\"));\n }\n\n try {\n if (ConfigService.integrationV2ApiUrl === undefined) {\n throw new Error('REACT_APP_INTEGRATION_V2_API_BASE is undefined')\n }\n const response = await apiMutate(\n ConfigService.integrationV2ApiUrl,\n `OutlookIntegrationAccessToken/getAccessToken`,\n {\n method: \"post\",\n data: {\n option: \"refresh_token\",\n value: refreshToken,\n redirectUri: ConfigService.config.UNITY_URL + \"/aad_redirect\"\n }\n }\n )\n const data = response.data;\n if (data.accessToken != null && data.refreshToken != null && data.expiresIn != null) {\n localStorage.setItem('outlookAccessToken', data.accessToken);\n localStorage.setItem('outlookRefreshToken', data.refreshToken);\n localStorage.setItem('outlookExpiresAt', addSecondsToCurrentTimeUnix(data.expiresIn));\n return data.accessToken;\n } else {\n throw(new Error(\"Error: unable to get access token\"));\n }\n\n } catch (error) {\n console.error('Error refreshing access token:', error);\n return null;\n }\n };\n\n const login = () => {\n\n const baseUrl = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize';\n const clientId = process.env.REACT_APP_MSAL_API_CLIENT_ID;\n const responseType = 'code';\n const redirectUri = `${ConfigService.config.UNITY_URL}/aad_redirect`;\n const responseMode = 'query';\n const scope = [\n 'https://graph.microsoft.com/Calendars.ReadWrite',\n 'https://graph.microsoft.com/Calendars.ReadWrite.Shared',\n 'https://graph.microsoft.com/OnlineMeetingTranscript.Read.All',\n 'https://graph.microsoft.com/OnlineMeetings.Read',\n ].join('%20'); // Join scopes with URL-encoded space\n\n const authUrl = `${baseUrl}?client_id=${clientId}&response_type=${responseType}&redirect_uri=${redirectUri}&response_mode=${responseMode}&scope=${scope}&state=${callbackUri}`;\n openLoginPopup(authUrl)\n // window.location.href = authUrl;\n }\n\n\n function openLoginPopup(url) {\n var width = 600;\n var height = 600;\n var left = (screen.width - width) / 2;\n var top = (screen.height - height) / 2;\n var features = `width=${width},height=${height},top=${top},left=${left},status=no,toolbar=no,menubar=no,location=no`;\n\n var popup = window.open(url, 'LoginPopup', features);\n return popup;\n }\n function addSecondsToCurrentTimeUnix(seconds) {\n var now = new Date();\n now.setSeconds(now.getSeconds() + seconds);\n return now.getTime();\n }\n\n function isBeforeCurrentTime(unixTime) {\n var now = new Date().getTime();\n return unixTime < now;\n }\n\n const isUserSignedIn = () => {\n const accessToken = localStorage.getItem('outlookAccessToken');\n const refreshToken = localStorage.getItem('outlookRefreshToken');\n const expiresAt = localStorage.getItem('outlookExpiresAt');\n if (accessToken && refreshToken && expiresAt && !isBeforeCurrentTime(expiresAt)) {\n return true;\n } else {\n return false;\n }\n }\n\n useEffect(() => {\n const handleStorageChange = (event) => {\n if (event.key === 'outlookAccessToken') {\n onLogin();\n }\n };\n\n window.addEventListener('storage', handleStorageChange);\n\n // Clean up the event listener\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n };\n }, []);\n return {getAccessToken, invalidateUserSession, login, isUserSignedIn};\n}\n","import { useUser } from '../utilities/auth/useUser';\n\nexport const useProductVersion = (productId) => {\n const user = useUser();\n\n const matchingProduct = user?.products?.find(\n (product) => product?.productId === productId\n );\n\n return matchingProduct?.currentProductVersionId || '';\n};\n","import React, { useMemo } from 'react'\nimport {DateTime} from 'luxon'\n\n// TODO: tie in datetime config at the user or tenant level\n\nexport interface UseDateLocaleReturn {\n convertISOStringToLocalDateTime: (date: string) => string | null;\n convertISOStringToLocalDate: (date: string) => string | null;\n getISODate: () => string;\n}\n\nexport const useDateLocale = (\n datetimeFormatOptions : Intl.DateTimeFormatOptions | null = null,\n locale: string | null = null\n): UseDateLocaleReturn => {\n\n const dateTimeOptions: Intl.DateTimeFormatOptions = useMemo(() => (datetimeFormatOptions ?? {\n timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n hour12: true,\n }), [datetimeFormatOptions]);\n\n const localeString: string = useMemo(() => locale ?? navigator.language,[locale]);\n\n const convertISOStringToLocalDateTime = (date: string): string | null => {\n const luxonDateTime = DateTime.fromISO(date, {zone: 'utc'});\n luxonDateTime.setZone(dateTimeOptions.timeZone);\n\n luxonDateTime.setLocale(localeString);\n\n if(!luxonDateTime.isValid)\n {\n return null;\n }\n return luxonDateTime.toLocaleString(dateTimeOptions);\n\n }\n\n const convertISOStringToLocalDate = (date: string): string | null => {\n const luxonDateTime = DateTime.fromISO(date);\n luxonDateTime.setZone(dateTimeOptions.timeZone);\n\n luxonDateTime.setLocale(localeString);\n if(!luxonDateTime.isValid)\n {\n return null;\n }\n const { hour, minute, ...dateOptions} = dateTimeOptions;\n return luxonDateTime.toLocaleString(dateOptions);\n }\n\n const getISODate = ():string => {\n return DateTime.now().toISO({includeOffset:true, suppressMilliseconds: true})\n }\n\n return {\n convertISOStringToLocalDateTime: convertISOStringToLocalDateTime,\n convertISOStringToLocalDate: convertISOStringToLocalDate,\n getISODate: getISODate\n };\n}\n","import { useCallback } from 'react';\nimport { useWorkflowStore } from '../stores/workflowStore';\n\nexport const useWorkflow = () => {\n const { updateTaskDataMap } = useWorkflowStore();\n\n const setWorkflowTaskPageData = useCallback(\n (taskId, pageId, data) => {\n updateTaskDataMap(taskId, pageId, data);\n },\n [updateTaskDataMap]\n );\n\n return {\n setWorkflowTaskPageData\n };\n};\n","import { useEffect, useState, useCallback, useRef } from 'react';\nimport { useUser } from '../utilities/auth/useUser';\nimport { ConfigService } from '../configService';\nimport { useAxiosGet } from '../utilities/useAxiosGet';\nimport {useShellStore} from '../stores/shellStore';\n\n// Global cache to store preloaded modules (persists across component re-renders)\n// This prevents re-fetching modules when navigating to pages\nconst preloadedModulesCache = new Map();\n\n/**\n * Custom hook to preload all pages for a product.\n * This eliminates sequential server calls when navigating to /page/<id>\n * by fetching all page metadata in a single API call on mount.\n * After fetching metadata, it preloads the actual widget modules in the background.\n *\n * @param {Function} getWidget - Function to load widget modules\n * @returns {Object} - { pages, loading, error, refetch, preloadingWidgets }\n */\nexport const usePreloadPages = () => {\n const user = useUser();\n const [preloadingWidgets, setPreloadingWidgets] = useState(false);\n const [preloadedWidgets, setPreloadedWidgets] = useState(new Set());\n const { getWidget } = useShellStore();\n const preloadingRef = useRef(false); // Prevent duplicate preloading\n\n\n // Build the query parameters for the pages endpoint\n const queryParams = `page/product/${ConfigService.config.UNITY_PRODUCT_ID}?includeUdpPages=true`;\n\n // Fetch pages data - manual is true if user is not available\n const [{ data: pages, loading, error }, refetch] = useAxiosGet(\n ConfigService.tenantV1ApiUrl,\n queryParams,\n {},\n !!!user?.id || !!!user?.currentTenantId, // Skip if user info not available\n false // Don't use cache for fresh data\n );\n\n // Preload widget modules in the background after pages are fetched\n useEffect(() => {\n if (!pages || pages.length === 0 || !getWidget || preloadingRef.current) {\n return;\n }\n\n // Background preloading function\n const preloadWidgets = async () => {\n preloadingRef.current = true;\n setPreloadingWidgets(true);\n\n // Collect all unique widget types from all pages\n const widgetTypes = new Set();\n\n for (const page of pages) {\n try {\n // Parse the widgets field which contains JSON string\n if (page.widgets) {\n // The widgets field is a JSON object where the key is the pageId\n // and the value is a JSON string containing an array of widgets\n const widgetsObj = JSON.parse(page.widgets);\n const widgetsJson = widgetsObj[page.pageId];\n\n if (widgetsJson) {\n const widgetsList = JSON.parse(widgetsJson);\n\n // Extract widget types from the array\n if (Array.isArray(widgetsList)) {\n widgetsList.forEach(widget => {\n if (widget.widgetType && widget.widgetType !== '0') {\n widgetTypes.add(widget.widgetType);\n }\n });\n }\n }\n }\n } catch (error) {\n console.warn(`Failed to parse widgets for page ${page.name || page.pageId}:`, error);\n }\n }\n\n // Iterate through unique widget types and preload each module\n for (const widgetType of widgetTypes) {\n // Skip if already preloaded or no valid widget type\n if (!widgetType || preloadedWidgets.has(widgetType) || preloadedModulesCache.has(widgetType)) {\n continue;\n }\n\n try {\n // Call getWidget in the background to preload the module\n const lazyComponent = await getWidget(widgetType);\n\n // If it's a React.lazy component, we need to resolve its internal promise\n // React.lazy components have a _payload that stores the loading state\n if (lazyComponent && typeof lazyComponent === 'object' && lazyComponent._payload) {\n const payload = lazyComponent._payload;\n\n // Check if the payload is still pending (status: -1 = pending, 0 = error, 1 = success)\n if (payload._status === undefined || payload._status === -1) {\n // The module hasn't been loaded yet - trigger the import\n if (typeof payload._result === 'function') {\n // _result is the import() function - call it\n try {\n const module = await payload._result();\n // Update the lazy component's internal state\n payload._status = 1; // Success\n payload._result = module;\n console.log(widgetType, module);\n preloadedModulesCache.set(widgetType, module);\n console.log(`✓ Preloaded and cached: ${widgetType}`);\n } catch (err) {\n payload._status = 0; // Error\n payload._result = err;\n throw err;\n }\n }\n } else if (payload._status === 1) {\n // Already loaded - just cache it\n preloadedModulesCache.set(widgetType, payload._result);\n console.log(`✓ Already loaded: ${widgetType}`);\n }\n }\n\n // Mark as preloaded\n setPreloadedWidgets((prev) => new Set([...prev, widgetType]));\n } catch (error) {\n // Silently fail - don't want to block or show errors for background preloading\n console.warn(`✗ Failed to preload widget: ${widgetType}`, error);\n }\n }\n\n setPreloadingWidgets(false);\n };\n\n // Run preloading in background without blocking\n preloadWidgets();\n }, [pages, getWidget, preloadedWidgets]);\n\n /**\n * Helper function to find a page by ID from the preloaded pages\n * @param {string} pageId - The page ID to search for\n * @returns {Object|undefined} - The page object if found\n */\n const getPageById = useCallback(\n (pageId) => {\n if (!pages || !Array.isArray(pages)) return undefined;\n return pages.find((page) => page.pageId === pageId || page.id === pageId);\n },\n [pages]\n );\n\n /**\n * Helper function to check if a page name is valid (exists in preloaded pages)\n * @param {string} pageName - The page name to check\n * @returns {boolean} - True if the page name exists\n */\n const isValidPageName = useCallback(\n (pageName) => {\n if (!pages || !Array.isArray(pages)) return false;\n return pages.some(\n (page) => page.name === pageName || page.componentName === pageName\n );\n },\n [pages]\n );\n\n /**\n * Check if a module has been preloaded and cached\n * @param {string} pageName - The page/widget name\n * @returns {boolean} - True if the module is cached\n */\n const isModulePreloaded = useCallback(\n (pageName) => preloadedModulesCache.has(pageName),\n []\n );\n\n /**\n * Get a preloaded module from cache (if available)\n * @param {string} pageName - The page/widget name\n * @returns {Object|undefined} - The cached module or undefined\n */\n const getPreloadedModule = useCallback(\n (pageName) => preloadedModulesCache.get(pageName),\n []\n );\n\n return {\n pages,\n loading,\n error,\n refetch,\n getPageById,\n isValidPageName,\n preloadingWidgets,\n preloadedCount: preloadedWidgets.size,\n isModulePreloaded,\n getPreloadedModule,\n // Expose the cache for debugging\n _cache: preloadedModulesCache\n };\n};\n"],"mappings":";;;;;;;;;;AAIA,MAAa,cAAc,aAAa,YAAY;CAEhD,MAAM,wBAAwB,YAAY;AAsBlC,MAAI;AACA,gBAAa,WAAW,qBAAqB;WACtC,OAAO;AACd,WAAQ,MAAM,+BAA+B,MAAM;;AAGrD,MAAI;AACF,gBAAa,WAAW,sBAAsB;WACvC,OAAO;AACd,WAAQ,MAAM,gCAAgC,MAAM;;AAGtD,MAAI;AACF,gBAAa,WAAW,mBAAmB;WACpC,OAAO;AACd,WAAQ,M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,KAAK,+BAA+B,cAAcA,QAAM;;;AAIpE,wBAAqB,MAAM;;AAI7B,kBAAgB;IACf;EAAC;EAAO;EAAW;EAAiB,CAAC;;;;;;CAOxC,MAAM,cAAc,aACjB,WAAW;AACV,MAAI,CAAC,SAAS,CAAC,MAAM,QAAQ,MAAM,CAAE,QAAO;AAC5C,SAAO,MAAM,MAAM,SAAS,KAAK,WAAW,UAAU,KAAK,OAAO,OAAO;IAE3E,CAAC,MAAM,CACR;;;;;;CAOD,MAAM,kBAAkB,aACrB,aAAa;AACZ,MAAI,CAAC,SAAS,CAAC,MAAM,QAAQ,MAAM,CAAE,QAAO;AAC5C,SAAO,MAAM,MACV,SAAS,KAAK,SAAS,YAAY,KAAK,kBAAkB,SAC5D;IAEH,CAAC,MAAM,CACR;;;;;;CAOD,MAAM,oBAAoB,aACvB,aAAa,sBAAsB,IAAI,SAAS,EACjD,EAAE,CACH;;;;;;CAOD,MAAM,qBAAqB,aACxB,aAAa,sBAAsB,IAAI,SAAS,EACjD,EAAE,CACH;AAED,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAAgB,iBAAiB;EACjC;EACA;EAEA,QAAQ;EACT"}
1
+ {"version":3,"file":"hooks-BNndjGer.js","names":["error"],"sources":["../src/hooks/useOutlook.js","../src/hooks/useProductVersion.js","../src/hooks/useDateLocale.ts","../src/hooks/useWorkflow.js","../src/hooks/usePreloadPages.js"],"sourcesContent":["import { apiMutate } from '../utilities/useAxiosMutate';\nimport { useEffect } from 'react';\nimport { ConfigService } from '../configService';\n\nexport const useOutlook = (callbackUri, onLogin) => {\n\n const invalidateUserSession = async () => {\n try {\n // if (ConfigService.integrationV2ApiUrl === undefined) {\n // throw new Error('REACT_APP_INTEGRATION_V2_API_BASE is undefined')\n // }\n // const accessToken = localStorage.getItem('outlookAccessToken');\n // const response = await apiMutate(\n // ConfigService.integrationV2ApiUrl,\n // `OutlookIntegrationAccessToken/invalidateUserSession`,\n // {\n // method: \"post\",\n // headers : {\n // OutlookAccessToken: accessToken\n // }\n // }\n // )\n\n } catch (error) {\n console.error('Error refreshing access token:', error);\n return null;\n // }\n } finally {\n try {\n localStorage.removeItem('outlookAccessToken');\n } catch (error) {\n console.error('Error removing accessToken:', error);\n }\n\n try {\n localStorage.removeItem('outlookRefreshToken');\n } catch (error) {\n console.error('Error removing refreshToken:', error);\n }\n\n try {\n localStorage.removeItem('outlookExpiresAt');\n } catch (error) {\n console.error('Error removing expiresAt:', error);\n }\n\n }\n }\n\n const getAccessToken = async () => {\n let accessToken = localStorage.getItem('outlookAccessToken');\n\n if (!accessToken) {\n throw(new Error(\"No access token found\"));\n }\n\n const expiresAt = localStorage.getItem('outlookExpiresAt');\n if (expiresAt && !isBeforeCurrentTime(expiresAt)) {\n return accessToken;\n }\n\n const refreshToken = localStorage.getItem('outlookRefreshToken');\n if (!refreshToken) {\n throw(new Error(\"No refresh token found\"));\n }\n\n try {\n if (ConfigService.integrationV2ApiUrl === undefined) {\n throw new Error('REACT_APP_INTEGRATION_V2_API_BASE is undefined')\n }\n const response = await apiMutate(\n ConfigService.integrationV2ApiUrl,\n `OutlookIntegrationAccessToken/getAccessToken`,\n {\n method: \"post\",\n data: {\n option: \"refresh_token\",\n value: refreshToken,\n redirectUri: ConfigService.config.UNITY_URL + \"/aad_redirect\"\n }\n }\n )\n const data = response.data;\n if (data.accessToken != null && data.refreshToken != null && data.expiresIn != null) {\n localStorage.setItem('outlookAccessToken', data.accessToken);\n localStorage.setItem('outlookRefreshToken', data.refreshToken);\n localStorage.setItem('outlookExpiresAt', addSecondsToCurrentTimeUnix(data.expiresIn));\n return data.accessToken;\n } else {\n throw(new Error(\"Error: unable to get access token\"));\n }\n\n } catch (error) {\n console.error('Error refreshing access token:', error);\n return null;\n }\n };\n\n const login = () => {\n\n const baseUrl = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize';\n const clientId = process.env.REACT_APP_MSAL_API_CLIENT_ID;\n const responseType = 'code';\n const redirectUri = `${ConfigService.config.UNITY_URL}/aad_redirect`;\n const responseMode = 'query';\n const scope = [\n 'https://graph.microsoft.com/Calendars.ReadWrite',\n 'https://graph.microsoft.com/Calendars.ReadWrite.Shared',\n 'https://graph.microsoft.com/OnlineMeetingTranscript.Read.All',\n 'https://graph.microsoft.com/OnlineMeetings.Read',\n ].join('%20'); // Join scopes with URL-encoded space\n\n const authUrl = `${baseUrl}?client_id=${clientId}&response_type=${responseType}&redirect_uri=${redirectUri}&response_mode=${responseMode}&scope=${scope}&state=${callbackUri}`;\n openLoginPopup(authUrl)\n // window.location.href = authUrl;\n }\n\n\n function openLoginPopup(url) {\n var width = 600;\n var height = 600;\n var left = (screen.width - width) / 2;\n var top = (screen.height - height) / 2;\n var features = `width=${width},height=${height},top=${top},left=${left},status=no,toolbar=no,menubar=no,location=no`;\n\n var popup = window.open(url, 'LoginPopup', features);\n return popup;\n }\n function addSecondsToCurrentTimeUnix(seconds) {\n var now = new Date();\n now.setSeconds(now.getSeconds() + seconds);\n return now.getTime();\n }\n\n function isBeforeCurrentTime(unixTime) {\n var now = new Date().getTime();\n return unixTime < now;\n }\n\n const isUserSignedIn = () => {\n const accessToken = localStorage.getItem('outlookAccessToken');\n const refreshToken = localStorage.getItem('outlookRefreshToken');\n const expiresAt = localStorage.getItem('outlookExpiresAt');\n if (accessToken && refreshToken && expiresAt && !isBeforeCurrentTime(expiresAt)) {\n return true;\n } else {\n return false;\n }\n }\n\n useEffect(() => {\n const handleStorageChange = (event) => {\n if (event.key === 'outlookAccessToken') {\n onLogin();\n }\n };\n\n window.addEventListener('storage', handleStorageChange);\n\n // Clean up the event listener\n return () => {\n window.removeEventListener('storage', handleStorageChange);\n };\n }, []);\n return {getAccessToken, invalidateUserSession, login, isUserSignedIn};\n}\n","import { useUser } from '../utilities/auth/useUser';\n\nexport const useProductVersion = (productId) => {\n const user = useUser();\n\n const matchingProduct = user?.products?.find(\n (product) => product?.productId === productId\n );\n\n return matchingProduct?.currentProductVersionId || '';\n};\n","import React, { useMemo } from 'react'\nimport {DateTime} from 'luxon'\n\n// TODO: tie in datetime config at the user or tenant level\n\nexport interface UseDateLocaleReturn {\n convertISOStringToLocalDateTime: (date: string) => string | null;\n convertISOStringToLocalDate: (date: string) => string | null;\n getISODate: () => string;\n}\n\nexport const useDateLocale = (\n datetimeFormatOptions : Intl.DateTimeFormatOptions | null = null,\n locale: string | null = null\n): UseDateLocaleReturn => {\n\n const dateTimeOptions: Intl.DateTimeFormatOptions = useMemo(() => (datetimeFormatOptions ?? {\n timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n hour12: true,\n }), [datetimeFormatOptions]);\n\n const localeString: string = useMemo(() => locale ?? navigator.language,[locale]);\n\n const convertISOStringToLocalDateTime = (date: string): string | null => {\n const luxonDateTime = DateTime.fromISO(date, {zone: 'utc'});\n luxonDateTime.setZone(dateTimeOptions.timeZone);\n\n luxonDateTime.setLocale(localeString);\n\n if(!luxonDateTime.isValid)\n {\n return null;\n }\n return luxonDateTime.toLocaleString(dateTimeOptions);\n\n }\n\n const convertISOStringToLocalDate = (date: string): string | null => {\n const luxonDateTime = DateTime.fromISO(date);\n luxonDateTime.setZone(dateTimeOptions.timeZone);\n\n luxonDateTime.setLocale(localeString);\n if(!luxonDateTime.isValid)\n {\n return null;\n }\n const { hour, minute, ...dateOptions} = dateTimeOptions;\n return luxonDateTime.toLocaleString(dateOptions);\n }\n\n const getISODate = ():string => {\n return DateTime.now().toISO({includeOffset:true, suppressMilliseconds: true})\n }\n\n return {\n convertISOStringToLocalDateTime: convertISOStringToLocalDateTime,\n convertISOStringToLocalDate: convertISOStringToLocalDate,\n getISODate: getISODate\n };\n}\n","import { useCallback } from 'react';\nimport { useWorkflowStore } from '../stores/workflowStore';\n\nexport const useWorkflow = () => {\n const { updateTaskDataMap } = useWorkflowStore();\n\n const setWorkflowTaskPageData = useCallback(\n (taskId, pageId, data) => {\n updateTaskDataMap(taskId, pageId, data);\n },\n [updateTaskDataMap]\n );\n\n return {\n setWorkflowTaskPageData\n };\n};\n","import { useEffect, useState, useCallback, useRef } from 'react';\nimport { useUser } from '../utilities/auth/useUser';\nimport { ConfigService } from '../configService';\nimport { useAxiosGet } from '../utilities/useAxiosGet';\nimport {useShellStore} from '../stores/shellStore';\n\n// Global cache to store preloaded modules (persists across component re-renders)\n// This prevents re-fetching modules when navigating to pages\nconst preloadedModulesCache = new Map();\n\n/**\n * Custom hook to preload all pages for a product.\n * This eliminates sequential server calls when navigating to /page/<id>\n * by fetching all page metadata in a single API call on mount.\n * After fetching metadata, it preloads the actual widget modules in the background.\n *\n * @param {Function} getWidget - Function to load widget modules\n * @returns {Object} - { pages, loading, error, refetch, preloadingWidgets }\n */\nexport const usePreloadPages = () => {\n const user = useUser();\n const [preloadingWidgets, setPreloadingWidgets] = useState(false);\n const [preloadedWidgets, setPreloadedWidgets] = useState(new Set());\n const { getWidget } = useShellStore();\n const preloadingRef = useRef(false); // Prevent duplicate preloading\n\n\n // Build the query parameters for the pages endpoint\n const queryParams = `page/product/${ConfigService.config.UNITY_PRODUCT_ID}?includeUdpPages=true`;\n\n // Fetch pages data - manual is true if user is not available\n const [{ data: pages, loading, error }, refetch] = useAxiosGet(\n ConfigService.tenantV1ApiUrl,\n queryParams,\n {},\n !!!user?.id || !!!user?.currentTenantId, // Skip if user info not available\n false // Don't use cache for fresh data\n );\n\n // Preload widget modules in the background after pages are fetched\n useEffect(() => {\n if (!pages || pages.length === 0 || !getWidget || preloadingRef.current) {\n return;\n }\n\n // Background preloading function\n const preloadWidgets = async () => {\n preloadingRef.current = true;\n setPreloadingWidgets(true);\n\n // Collect all unique widget types from all pages\n const widgetTypes = new Set();\n\n for (const page of pages) {\n try {\n // Parse the widgets field which contains JSON string\n if (page.widgets) {\n // The widgets field is a JSON object where the key is the pageId\n // and the value is a JSON string containing an array of widgets\n const widgetsObj = JSON.parse(page.widgets);\n const widgetsJson = widgetsObj[page.pageId];\n\n if (widgetsJson) {\n const widgetsList = JSON.parse(widgetsJson);\n\n // Extract widget types from the array\n if (Array.isArray(widgetsList)) {\n widgetsList.forEach(widget => {\n if (widget.widgetType && widget.widgetType !== '0') {\n widgetTypes.add(widget.widgetType);\n }\n });\n }\n }\n }\n } catch (error) {\n console.warn(`Failed to parse widgets for page ${page.name || page.pageId}:`, error);\n }\n }\n\n // Iterate through unique widget types and preload each module\n for (const widgetType of widgetTypes) {\n // Skip if already preloaded or no valid widget type\n if (!widgetType || preloadedWidgets.has(widgetType) || preloadedModulesCache.has(widgetType)) {\n continue;\n }\n\n try {\n // Call getWidget in the background to preload the module\n const lazyComponent = await getWidget(widgetType);\n\n // If it's a React.lazy component, we need to resolve its internal promise\n // React.lazy components have a _payload that stores the loading state\n if (lazyComponent && typeof lazyComponent === 'object' && lazyComponent._payload) {\n const payload = lazyComponent._payload;\n\n // Check if the payload is still pending (status: -1 = pending, 0 = error, 1 = success)\n if (payload._status === undefined || payload._status === -1) {\n // The module hasn't been loaded yet - trigger the import\n if (typeof payload._result === 'function') {\n // _result is the import() function - call it\n try {\n const module = await payload._result();\n // Update the lazy component's internal state\n payload._status = 1; // Success\n payload._result = module;\n console.log(widgetType, module);\n preloadedModulesCache.set(widgetType, module);\n console.log(`✓ Preloaded and cached: ${widgetType}`);\n } catch (err) {\n payload._status = 0; // Error\n payload._result = err;\n throw err;\n }\n }\n } else if (payload._status === 1) {\n // Already loaded - just cache it\n preloadedModulesCache.set(widgetType, payload._result);\n console.log(`✓ Already loaded: ${widgetType}`);\n }\n }\n\n // Mark as preloaded\n setPreloadedWidgets((prev) => new Set([...prev, widgetType]));\n } catch (error) {\n // Silently fail - don't want to block or show errors for background preloading\n console.warn(`✗ Failed to preload widget: ${widgetType}`, error);\n }\n }\n\n setPreloadingWidgets(false);\n };\n\n // Run preloading in background without blocking\n preloadWidgets();\n }, [pages, getWidget, preloadedWidgets]);\n\n /**\n * Helper function to find a page by ID from the preloaded pages\n * @param {string} pageId - The page ID to search for\n * @returns {Object|undefined} - The page object if found\n */\n const getPageById = useCallback(\n (pageId) => {\n if (!pages || !Array.isArray(pages)) return undefined;\n return pages.find((page) => page.pageId === pageId || page.id === pageId);\n },\n [pages]\n );\n\n /**\n * Helper function to check if a page name is valid (exists in preloaded pages)\n * @param {string} pageName - The page name to check\n * @returns {boolean} - True if the page name exists\n */\n const isValidPageName = useCallback(\n (pageName) => {\n if (!pages || !Array.isArray(pages)) return false;\n return pages.some(\n (page) => page.name === pageName || page.componentName === pageName\n );\n },\n [pages]\n );\n\n /**\n * Check if a module has been preloaded and cached\n * @param {string} pageName - The page/widget name\n * @returns {boolean} - True if the module is cached\n */\n const isModulePreloaded = useCallback(\n (pageName) => preloadedModulesCache.has(pageName),\n []\n );\n\n /**\n * Get a preloaded module from cache (if available)\n * @param {string} pageName - The page/widget name\n * @returns {Object|undefined} - The cached module or undefined\n */\n const getPreloadedModule = useCallback(\n (pageName) => preloadedModulesCache.get(pageName),\n []\n );\n\n return {\n pages,\n loading,\n error,\n refetch,\n getPageById,\n isValidPageName,\n preloadingWidgets,\n preloadedCount: preloadedWidgets.size,\n isModulePreloaded,\n getPreloadedModule,\n // Expose the cache for debugging\n _cache: preloadedModulesCache\n };\n};\n"],"mappings":";;;;;;;;;;AAIA,MAAa,cAAc,aAAa,YAAY;CAEhD,MAAM,wBAAwB,YAAY;AAsBlC,MAAI;AACA,gBAAa,WAAW,qBAAqB;WACtC,OAAO;AACd,WAAQ,MAAM,+BAA+B,MAAM;;AAGrD,MAAI;AACF,gBAAa,WAAW,sBAAsB;WACvC,OAAO;AACd,WAAQ,MAAM,gCAAgC,MAAM;;AAGtD,MAAI;AACF,gBAAa,WAAW,mBAAmB;WACpC,OAAO;AACd,WAAQ,MAAM,6BAA6B,MAAM;;;CAM7D,MAAM,iBAAiB,YAAY;EAC/B,IAAI,cAAc,aAAa,QAAQ,qBAAqB;AAE5D,MAAI,CAAC,YACD,uBAAM,IAAI,MAAM,wBAAwB;EAG5C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AAI,CAAC,SAAS,CAAC,MAAM,QAAQ,MAAM,CAAE,QAAO;AAC5C,SAAO,MAAM,MAAM,SAAS,KAAK,WAAW,UAAU,KAAK,OAAO,OAAO;IAE3E,CAAC,MAAM,CACR;;;;;;CAOD,MAAM,kBAAkB,aACrB,aAAa;AACZ,MAAI,CAAC,SAAS,CAAC,MAAM,QAAQ,MAAM,CAAE,QAAO;AAC5C,SAAO,MAAM,MACV,SAAS,KAAK,SAAS,YAAY,KAAK,kBAAkB,SAC5D;IAEH,CAAC,MAAM,CACR;;;;;;CAOD,MAAM,oBAAoB,aACvB,aAAa,sBAAsB,IAAI,SAAS,EACjD,EAAE,CACH;;;;;;CAOD,MAAM,qBAAqB,aACxB,aAAa,sBAAsB,IAAI,SAAS,EACjD,EAAE,CACH;AAED,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAAgB,iBAAiB;EACjC;EACA;EAEA,QAAQ;EACT"}
package/dist/index.js CHANGED
@@ -111,7 +111,7 @@ import { t as useQueryExecutors } from "./useQueryExecutors-DuuHrj2M.js";
111
111
  import { t as useSearchFilterParamsMap } from "./useSearchFilterParamsMap-hAHx2Rav.js";
112
112
  import { a as AmbientSummaryListHeader, c as AlertFlag, i as FilterSearch, n as NodeColumnHeader, o as AmbientListItem, r as FlagBlock, s as ItemDescription } from "./inquiry-CKJOeOAS.js";
113
113
  import { t as SummaryBlock } from "./SummaryBlock-BjUNDl4q.js";
114
- import { n as AmbientSplitStatCard, t as AmbientVisualizationCard } from "./AmbientVisualizationCard-BmTQR121.js";
114
+ import { n as AmbientSplitStatCard, t as AmbientVisualizationCard } from "./AmbientVisualizationCard-CAxx4QWe.js";
115
115
  import { a as InquiryTreeMenuItem, c as ExecuteApiDialog, i as InquiryTreeMenu, n as InquiryContainer, o as NodeDetails, r as NodeList, s as InquiryWrapper, t as Inquiry } from "./Inquiry-KKLgba3g.js";
116
116
  import { C as TextPropertyWidget_exports, _ as DatePropertyWidget_exports, a as DateTimePropertyWidget_exports, d as FloatPropertyWidget_exports, h as MultilineTextPropertyWidget_exports, l as TimePropertyWidget_exports, p as SelectPropertyWidget_exports, r as AutoCompletePropertyWidget_exports, s as BooleanPropertyWidget_exports, x as IntegerPropertyWidget_exports, y as NumericPropertyWidget_exports } from "./widgets-CtrxUwuu.js";
117
117
  import { n as DateField, t as TimeField } from "./TimeField-BZYVtp3p.js";
@@ -243,10 +243,10 @@ import { t as ImportDataFromFileMapping } from "./ImportDataFromFileMapping-3XXg
243
243
  import { i as EntityMaintenanceUdpGrid, n as ApiMethodInstanceUdpGrid, r as BackwardsCompatibleGrid, t as ServerSideUdpGrid } from "./newGrid-zmtQXU5G.js";
244
244
  import { r as useUdpExport, t as ExportSidesheet } from "./ExportSidesheet-DWkoiwxC.js";
245
245
  import { t as ClientSideUdpGrid } from "./ClientSideUdpGrid-D5fGumO-.js";
246
- import { t as TrimForAvatar } from "./TrimForAvatar-BmM2bU6E.js";
247
- import { i as FluentMenuListButton, n as FluentCompoundButton, r as FluentUploadButton, t as FluentUploadIconButton } from "./buttons-CuLiERQe.js";
248
- import { t as AmbientToggleButtonGroup } from "./AmbientToggleButtonGroup-Bi9yW5gC.js";
249
- import { n as UdpTransactionsPage_default } from "./UdpTransactionsPage-CDyNjmyo.js";
246
+ import { i as FluentMenuListButton, n as FluentCompoundButton, r as FluentUploadButton, t as FluentUploadIconButton } from "./buttons-DyKpA2qY.js";
247
+ import { t as AmbientToggleButtonGroup } from "./AmbientToggleButtonGroup-DgFod3VK.js";
248
+ import { t as TrimForAvatar } from "./TrimForAvatar-BP1gZWd5.js";
249
+ import { n as UdpTransactionsPage_default } from "./UdpTransactionsPage-KgkwaNGG.js";
250
250
  import { t as AccountFlags } from "./status-moefSFBs.js";
251
251
  import { n as FormHeader, r as FormSubHeader, t as StylizedTitle } from "./typography-CvW7cAl8.js";
252
252
  import { t as Attachments } from "./uploader-YWjDebFN.js";
@@ -256,7 +256,7 @@ import { t as GraphCard } from "./GraphCard-BhcSveF4.js";
256
256
  import { n as DirectoryListItem, t as Directory } from "./Directory-MpK8T6IZ.js";
257
257
  import { t as EntityHeader } from "./EntityHeader-C3Ae5BLK.js";
258
258
  import { n as ColorKey, t as IconKey } from "./IconKey-BLHF3hfg.js";
259
- import { n as useStyles, r as Note, t as Notes } from "./Notes-YAF2dipI.js";
259
+ import { n as useStyles, r as Note, t as Notes } from "./Notes-BPaEmexk.js";
260
260
  import { n as StatusLineItem, r as NotificationElement, t as TicketCard } from "./TicketCard-CpttpQoj.js";
261
261
  import { t as AmbientVisualizer } from "./AmbientVisualizer-BABKxgsK.js";
262
262
  import { t as FluentLink } from "./FluentLink-CkA7BUEB.js";
@@ -283,7 +283,7 @@ import { t as LineGraphWidget_exports } from "./LineGraphWidget-OkrYlfsd.js";
283
283
  import { t as SparsePlotWidget_exports } from "./SparsePlotWidget-DSjCtlMJ.js";
284
284
  import { t as useServerSideDatasource } from "./aggridHelpers-BvrSzjdD.js";
285
285
  import { n as useScreenControl, t as useNoticeUpdate } from "./gridVisualizationFunctions-Cmh4EUIL.js";
286
- import { t as PaymentForm } from "./PaymentForm-DFJrSIy8.js";
286
+ import { t as PaymentForm } from "./PaymentForm-Dum5p1mf.js";
287
287
  import { t as OutlookCallback } from "./OutlookCallback-D3no-Urx.js";
288
288
  import { t as ContentContainer } from "./ContentContainer-C2CcA6oX.js";
289
289
  import { n as ThemeProvider, r as useSystemColor, t as useTheme } from "./theme-_CEHumbt.js";
@@ -1 +1 @@
1
- {"version":3,"file":"lookupsStore-DPI8oD9R.js","names":["useLookupsStore: () => LookupsState"],"sources":["../src/stores/lookupsStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\n\ninterface LookupsState {\n lookupApiMethodId: string | null | undefined;\n setLookupApiMethodId: (apiMethodId: string) => void;\n lookupsDataMap: Object | null | undefined;\n setLookupsDataMap: (\n lookupsDataMap: Object,\n replace: boolean | null | undefined\n ) => void;\n}\n\nexport const useLookupsStore: () => LookupsState = create<LookupsState>()(\n devtools((set) => ({\n lookupApiMethodId: '',\n setLookupApiMethodId: (apiMethodId) =>\n set((state) => ({ lookupApiMethodId: apiMethodId })),\n lookupsDataMap: null,\n setLookupsDataMap: (lookupsDataMap, replace = false) => {\n if (replace) {\n set((state) => ({\n lookupsDataMap: lookupsDataMap\n }));\n } else {\n set((state) => ({\n lookupsDataMap: { ...state.lookupsDataMap, ...lookupsDataMap }\n }));\n }\n }\n }))\n);\n"],"mappings":";;;;AAaA,MAAaA,kBAAsC,QAAsB,CACvE,UAAU,SAAS;CACjB,mBAAmB;CACnB,uBAAuB,gBACrB,KAAK,WAAW,EAAE,mBAAmB,aAAa,EAAE;CACtD,gBAAgB;CAChB,oBAAoB,gBAAgB,UAAU,UAAU;AACtD,MAAI,QACF,MAAK,WAAW,EACE,gBACjB,EAAE;MAEH,MAAK,WAAW,EACd,gBAAgB;GAAE,GAAG,MAAM;GAAgB,GAAG;GAAgB,EAC/D,EAAE;;CAGR,EAAE,CACJ"}
1
+ {"version":3,"file":"lookupsStore-DPI8oD9R.js","names":[],"sources":["../src/stores/lookupsStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\n\ninterface LookupsState {\n lookupApiMethodId: string | null | undefined;\n setLookupApiMethodId: (apiMethodId: string) => void;\n lookupsDataMap: Object | null | undefined;\n setLookupsDataMap: (\n lookupsDataMap: Object,\n replace: boolean | null | undefined\n ) => void;\n}\n\nexport const useLookupsStore: () => LookupsState = create<LookupsState>()(\n devtools((set) => ({\n lookupApiMethodId: '',\n setLookupApiMethodId: (apiMethodId) =>\n set((state) => ({ lookupApiMethodId: apiMethodId })),\n lookupsDataMap: null,\n setLookupsDataMap: (lookupsDataMap, replace = false) => {\n if (replace) {\n set((state) => ({\n lookupsDataMap: lookupsDataMap\n }));\n } else {\n set((state) => ({\n lookupsDataMap: { ...state.lookupsDataMap, ...lookupsDataMap }\n }));\n }\n }\n }))\n);\n"],"mappings":";;;;AAaA,MAAa,kBAAsC,QAAsB,CACvE,UAAU,SAAS;CACjB,mBAAmB;CACnB,uBAAuB,gBACrB,KAAK,WAAW,EAAE,mBAAmB,aAAa,EAAE;CACtD,gBAAgB;CAChB,oBAAoB,gBAAgB,UAAU,UAAU;AACtD,MAAI,QACF,MAAK,WAAW,EACE,gBACjB,EAAE;MAEH,MAAK,WAAW,EACd,gBAAgB;GAAE,GAAG,MAAM;GAAgB,GAAG;GAAgB,EAC/D,EAAE;;CAGR,EAAE,CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"maps-BgmvNpkU.js","names":["UdpMap: React.FC<UdpMapProps>","Map"],"sources":["../src/UI/maps/UdpMap.tsx"],"sourcesContent":["import React from 'react';\nimport { UdpMap as Map } from 'udp-react-stencil-component-library';\n\nexport interface UdpMapProps {\n /* Enables the toolbar */\n enableToolbar?: boolean;\n\n /* Title appearing on map */\n mapTitle?: string;\n\n /* Feature data (in either Geo-JSON format or not). Geo-JSON format: [{ type: string, id: string, geometry: { type: 'Point' | 'LineString' | 'Polygon', coordinates: Coordinate }, properties: any }] */\n data?: any[];\n\n /* Boolean stating if the data is in Geo-JSON format */\n isGeoJsonFormat?: boolean;\n\n /* Method - If data is not in Geo-JSON format, returns data in Geo-JSON format */\n geoJsonMappingConfig?: any;\n\n /* Allows zoom */\n enableZoom?: boolean;\n\n /* Default map zoom */\n mapZoom?: number;\n\n /* Default map center */\n mapCenter?: any;\n\n /* Map height */\n mapHeight?: string;\n\n /* Coordinate reference system used */\n crs?: any;\n\n /* Map feature projection used */\n mapProjection?: string;\n\n /* Map data projection used */\n mapDataProjection?: string;\n\n /* Method - Custom filter for map features */\n getFilteredMapData?: any;\n\n /* Method - Returns custom styles for features */\n getFeatureStyles?: any;\n\n /* Method - Returns custom styles for selected features */\n getSelectedFeatureStyles?: any;\n\n /* Custom filter panel */\n filterPanel?: string;\n\n /* Method - Callback to filter features from custom filter panel */\n filterPanelCallback?: any;\n\n /* Allows selecting tile layer */\n enableTileSelection?: boolean;\n\n /* List of tile layers visible on the map */\n tileLayersOptions?: any[];\n\n /* Default tile layer name */\n defaultTileOptionName?: string;\n\n /* List of options for vector layers */\n layerOptions?: any[];\n\n /* Vector layers selected in the layer filter on initial map load */\n initialSelectedLayers?: any[];\n\n /* Callback to return layers that are selected */\n handleSelectLayersCallback: any;\n\n /* Custom action panel for selected features */\n bulkSelectedFeaturesActionPanel?: string;\n\n /* Method - Retrieves selected features when bulk selected */\n handleSetSelectedFeaturesOnBulkSelect: any;\n\n /* Method - Retrieves selected feature when individually selected */\n handleSetSelectedFeatureOnSelect: any;\n\n /* Enables filtering layers by role */\n filterLayersByRole: boolean;\n\n /* Layer keys to get the current feature layer when adding layers with features to the map */\n layerKeys?: string[];\n\n /* Layer key separator to get the current feature layer when adding layers with features to the map */\n layerKeySeparator?: string;\n\n /* Authenticated user from Unity - used to filter layers by role */\n user?: any;\n\n /* Layers assigned to roles */\n layerRoles?: any;\n\n /* Callback method to refresh map */\n handleRefresh?: any;\n\n /* Custom tooltip message on refresh button */\n refreshButtonTooltip?: string;\n\n /* Map is read-only (setting true removes the add, edit, delete functionality) */\n readOnlyMap: boolean;\n\n /* Enables adding a new feature by drawing on the map */\n enableAdd: boolean;\n\n /* When adding features on the map by drawing, this callback method returns the newly added features */\n handleAddNewFeatures: any;\n\n /* When adding features by drawing, add multiple features */\n addMultipleFeatures: boolean;\n\n /* Enables splitting line strings on the map */\n enableSplitFeature: boolean;\n\n /* Callback function to return split feature */\n handleSplitFeature: any;\n\n /* Enables viewing a selected feature */\n enableViewFeature: boolean;\n\n /* Method to enable viewing a selected feature */\n handleViewFeature: any;\n\n /* Enables deleting a selected feature */\n enableDeleteFeature: boolean;\n\n /* Callback method to handle deleting a selected feature */\n handleDeleteFeature?: any;\n\n /* Enables editing a selected feature */\n enableEditFeature: boolean;\n\n /* Callback method to handle editing a selected feature */\n handleEditFeature?: any;\n\n /* Callback method to return map zoom and extent when the resolution changes */\n handleGetZoomExtent?: any;\n\n /* Configuration object for customizing the popover card's appearance or behavior */\n cardConfig?: any;\n\n /* Array of primary action configurations for the popover (e.g., buttons) */\n popoverPrimaryActions?: { id?: string; name: string; iconName: string; onClick: (data: any) => void }[];\n\n /* Array of additional actions for the popover's \"more\" icon button (e.g., menu items) */\n popoverMoreIconButtonActions?: { id?: string; name: string; iconName: string; onClick: (data: any) => void }[];\n\n /* Function to get the message text to display in the popover, based on feature data */\n getMessagePopover?: (data: any) => string;\n\n /* Function to get the icon to display in the popover, based on feature data */\n getMessageIconPopover?: (data: any) => any;\n\n /* Boolean to control whether the message icon in the popover should be hidden */\n hideMessageIconPopover?: boolean;\n\n /* List of layers that are read only */\n readOnlyLayers?: string[];\n\n minZoom?: number;\n maxZoom?: number\n}\n\nexport const UdpMap: React.FC<UdpMapProps> = (props: UdpMapProps) => {\n return <Map {...props} />;\n};\n"],"mappings":";;;;AAuKA,MAAaA,YAAiC,UAAuB;AACnE,QAAO,oCAACC,QAAQ,MAAS"}
1
+ {"version":3,"file":"maps-BgmvNpkU.js","names":["UdpMap","Map"],"sources":["../src/UI/maps/UdpMap.tsx"],"sourcesContent":["import React from 'react';\nimport { UdpMap as Map } from 'udp-react-stencil-component-library';\n\nexport interface UdpMapProps {\n /* Enables the toolbar */\n enableToolbar?: boolean;\n\n /* Title appearing on map */\n mapTitle?: string;\n\n /* Feature data (in either Geo-JSON format or not). Geo-JSON format: [{ type: string, id: string, geometry: { type: 'Point' | 'LineString' | 'Polygon', coordinates: Coordinate }, properties: any }] */\n data?: any[];\n\n /* Boolean stating if the data is in Geo-JSON format */\n isGeoJsonFormat?: boolean;\n\n /* Method - If data is not in Geo-JSON format, returns data in Geo-JSON format */\n geoJsonMappingConfig?: any;\n\n /* Allows zoom */\n enableZoom?: boolean;\n\n /* Default map zoom */\n mapZoom?: number;\n\n /* Default map center */\n mapCenter?: any;\n\n /* Map height */\n mapHeight?: string;\n\n /* Coordinate reference system used */\n crs?: any;\n\n /* Map feature projection used */\n mapProjection?: string;\n\n /* Map data projection used */\n mapDataProjection?: string;\n\n /* Method - Custom filter for map features */\n getFilteredMapData?: any;\n\n /* Method - Returns custom styles for features */\n getFeatureStyles?: any;\n\n /* Method - Returns custom styles for selected features */\n getSelectedFeatureStyles?: any;\n\n /* Custom filter panel */\n filterPanel?: string;\n\n /* Method - Callback to filter features from custom filter panel */\n filterPanelCallback?: any;\n\n /* Allows selecting tile layer */\n enableTileSelection?: boolean;\n\n /* List of tile layers visible on the map */\n tileLayersOptions?: any[];\n\n /* Default tile layer name */\n defaultTileOptionName?: string;\n\n /* List of options for vector layers */\n layerOptions?: any[];\n\n /* Vector layers selected in the layer filter on initial map load */\n initialSelectedLayers?: any[];\n\n /* Callback to return layers that are selected */\n handleSelectLayersCallback: any;\n\n /* Custom action panel for selected features */\n bulkSelectedFeaturesActionPanel?: string;\n\n /* Method - Retrieves selected features when bulk selected */\n handleSetSelectedFeaturesOnBulkSelect: any;\n\n /* Method - Retrieves selected feature when individually selected */\n handleSetSelectedFeatureOnSelect: any;\n\n /* Enables filtering layers by role */\n filterLayersByRole: boolean;\n\n /* Layer keys to get the current feature layer when adding layers with features to the map */\n layerKeys?: string[];\n\n /* Layer key separator to get the current feature layer when adding layers with features to the map */\n layerKeySeparator?: string;\n\n /* Authenticated user from Unity - used to filter layers by role */\n user?: any;\n\n /* Layers assigned to roles */\n layerRoles?: any;\n\n /* Callback method to refresh map */\n handleRefresh?: any;\n\n /* Custom tooltip message on refresh button */\n refreshButtonTooltip?: string;\n\n /* Map is read-only (setting true removes the add, edit, delete functionality) */\n readOnlyMap: boolean;\n\n /* Enables adding a new feature by drawing on the map */\n enableAdd: boolean;\n\n /* When adding features on the map by drawing, this callback method returns the newly added features */\n handleAddNewFeatures: any;\n\n /* When adding features by drawing, add multiple features */\n addMultipleFeatures: boolean;\n\n /* Enables splitting line strings on the map */\n enableSplitFeature: boolean;\n\n /* Callback function to return split feature */\n handleSplitFeature: any;\n\n /* Enables viewing a selected feature */\n enableViewFeature: boolean;\n\n /* Method to enable viewing a selected feature */\n handleViewFeature: any;\n\n /* Enables deleting a selected feature */\n enableDeleteFeature: boolean;\n\n /* Callback method to handle deleting a selected feature */\n handleDeleteFeature?: any;\n\n /* Enables editing a selected feature */\n enableEditFeature: boolean;\n\n /* Callback method to handle editing a selected feature */\n handleEditFeature?: any;\n\n /* Callback method to return map zoom and extent when the resolution changes */\n handleGetZoomExtent?: any;\n\n /* Configuration object for customizing the popover card's appearance or behavior */\n cardConfig?: any;\n\n /* Array of primary action configurations for the popover (e.g., buttons) */\n popoverPrimaryActions?: { id?: string; name: string; iconName: string; onClick: (data: any) => void }[];\n\n /* Array of additional actions for the popover's \"more\" icon button (e.g., menu items) */\n popoverMoreIconButtonActions?: { id?: string; name: string; iconName: string; onClick: (data: any) => void }[];\n\n /* Function to get the message text to display in the popover, based on feature data */\n getMessagePopover?: (data: any) => string;\n\n /* Function to get the icon to display in the popover, based on feature data */\n getMessageIconPopover?: (data: any) => any;\n\n /* Boolean to control whether the message icon in the popover should be hidden */\n hideMessageIconPopover?: boolean;\n\n /* List of layers that are read only */\n readOnlyLayers?: string[];\n\n minZoom?: number;\n maxZoom?: number\n}\n\nexport const UdpMap: React.FC<UdpMapProps> = (props: UdpMapProps) => {\n return <Map {...props} />;\n};\n"],"mappings":";;;;AAuKA,MAAaA,YAAiC,UAAuB;AACnE,QAAO,oCAACC,QAAQ,MAAS"}