synapse-react-client 4.0.38 → 4.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SWC.index.d.ts +1 -0
- package/dist/SWC.index.d.ts.map +1 -1
- package/dist/SWC.index.js +2 -1
- package/dist/SWC.index.js.map +1 -1
- package/dist/aridhia-queries/useAridhiaQuery.d.ts +6 -2
- package/dist/aridhia-queries/useAridhiaQuery.d.ts.map +1 -1
- package/dist/aridhia-queries/useAridhiaQuery.js +3 -0
- package/dist/aridhia-queries/useAridhiaQuery.js.map +1 -1
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.d.ts +1 -0
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.d.ts.map +1 -1
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.js +12 -12
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.js.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.d.ts +2 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.d.ts.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.js +57 -31
- package/dist/components/Aridhia/AridhiaAccessStatus.js.map +1 -1
- package/dist/components/Aridhia/AridhiaDarStatusPopover.d.ts +12 -0
- package/dist/components/Aridhia/AridhiaDarStatusPopover.d.ts.map +1 -0
- package/dist/components/Aridhia/AridhiaDarStatusPopover.js +56 -0
- package/dist/components/Aridhia/AridhiaDarStatusPopover.js.map +1 -0
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.d.ts.map +1 -1
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.js +38 -30
- package/dist/components/Aridhia/DarWizard/AridhiaDarWizard.js.map +1 -1
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js +15 -14
- package/dist/components/Aridhia/DarWizard/DarSubmittedPanel.js.map +1 -1
- package/dist/components/Aridhia/RdcaDapEligibilityDialog.d.ts +11 -0
- package/dist/components/Aridhia/RdcaDapEligibilityDialog.d.ts.map +1 -0
- package/dist/components/Aridhia/RdcaDapEligibilityDialog.js +37 -0
- package/dist/components/Aridhia/RdcaDapEligibilityDialog.js.map +1 -0
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.js +2 -2
- package/dist/components/Aridhia/aridhiaAccessStatusUtils.js.map +1 -1
- package/dist/components/Aridhia/aridhiaFairPortalUrls.d.ts +10 -0
- package/dist/components/Aridhia/aridhiaFairPortalUrls.d.ts.map +1 -0
- package/dist/components/Aridhia/aridhiaFairPortalUrls.js +11 -0
- package/dist/components/Aridhia/aridhiaFairPortalUrls.js.map +1 -0
- package/dist/components/Aridhia/rdcaDapConstants.d.ts +3 -0
- package/dist/components/Aridhia/rdcaDapConstants.d.ts.map +1 -0
- package/dist/components/Aridhia/rdcaDapConstants.js +6 -0
- package/dist/components/Aridhia/rdcaDapConstants.js.map +1 -0
- package/dist/components/Authentication/Constants.d.ts +4 -0
- package/dist/components/Authentication/Constants.d.ts.map +1 -1
- package/dist/components/Authentication/Constants.js +5 -2
- package/dist/components/Authentication/Constants.js.map +1 -1
- package/dist/components/Authentication/RecoveryCodeGrid.d.ts.map +1 -1
- package/dist/components/Authentication/RecoveryCodeGrid.js +8 -1
- package/dist/components/Authentication/RecoveryCodeGrid.js.map +1 -1
- package/dist/components/Authentication/RegenerateBackupCodesWarning.js +4 -1
- package/dist/components/Authentication/RegenerateBackupCodesWarning.js.map +1 -1
- package/dist/components/Authentication/TOTPForm.d.ts.map +1 -1
- package/dist/components/Authentication/TOTPForm.js +20 -18
- package/dist/components/Authentication/TOTPForm.js.map +1 -1
- package/dist/components/Authentication/TwoFactorBackupCodes.d.ts.map +1 -1
- package/dist/components/Authentication/TwoFactorBackupCodes.js +41 -12
- package/dist/components/Authentication/TwoFactorBackupCodes.js.map +1 -1
- package/dist/components/Authentication/TwoFactorEnrollmentForm.d.ts.map +1 -1
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js +74 -71
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.css +1 -1
- package/dist/components/DataExplorer/DataExplorer.d.ts.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.js +50 -50
- package/dist/components/DataExplorer/DataExplorer.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.js +16 -16
- package/dist/components/DataExplorer/DataExplorer.module.js.map +1 -1
- package/dist/components/DataExplorer/DataExplorer.module.scss +29 -6
- package/dist/components/DataGrid/columns/DateTimeColumn.d.ts +16 -7
- package/dist/components/DataGrid/columns/DateTimeColumn.d.ts.map +1 -1
- package/dist/components/DataGrid/columns/DateTimeColumn.js +79 -57
- package/dist/components/DataGrid/columns/DateTimeColumn.js.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js +43 -46
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.d.ts.map +1 -1
- package/dist/components/DataGrid/utils/columnFactory.js +11 -8
- package/dist/components/DataGrid/utils/columnFactory.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +10 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.js +18 -0
- package/dist/components/DatePicker/DatePicker.js.map +1 -0
- package/dist/components/EntityCitation/EntityCitation.d.ts.map +1 -1
- package/dist/components/EntityCitation/EntityCitation.js +8 -5
- package/dist/components/EntityCitation/EntityCitation.js.map +1 -1
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.d.ts +11 -0
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js +61 -0
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts +33 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js +187 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.d.ts +14 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.js +83 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.js.map +1 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.d.ts +13 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.js +33 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.js.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.d.ts +32 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.js +75 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.js.map +1 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts +25 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js +66 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js.map +1 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.d.ts +28 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.js +39 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.js.map +1 -0
- package/dist/components/FormTemplateEditor/utils.d.ts +21 -0
- package/dist/components/FormTemplateEditor/utils.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/utils.js +27 -0
- package/dist/components/FormTemplateEditor/utils.js.map +1 -0
- package/dist/components/HasAccess/AccessIcon.d.ts +3 -1
- package/dist/components/HasAccess/AccessIcon.d.ts.map +1 -1
- package/dist/components/HasAccess/AccessIcon.js +11 -1
- package/dist/components/HasAccess/AccessIcon.js.map +1 -1
- package/dist/components/JsonSchemaForm/CustomFormContext.d.ts +1 -1
- package/dist/components/JsonSchemaForm/CustomFormContext.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.css +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.js +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.js.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.scss +6 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js +4 -0
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js.map +1 -1
- package/dist/components/PortalHomePageHeader/PortalHomePageHeader.d.ts +2 -1
- package/dist/components/PortalHomePageHeader/PortalHomePageHeader.d.ts.map +1 -1
- package/dist/components/PortalHomePageHeader/PortalHomePageHeader.js +81 -53
- package/dist/components/PortalHomePageHeader/PortalHomePageHeader.js.map +1 -1
- package/dist/components/ProjectInfo/ProjectInfo.d.ts.map +1 -1
- package/dist/components/ProjectInfo/ProjectInfo.js +3 -2
- package/dist/components/ProjectInfo/ProjectInfo.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.css +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts +8 -0
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts.map +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.js +260 -0
- package/dist/components/QueryBuilder/FilterConditionRow.js.map +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.module.js +16 -0
- package/dist/components/QueryBuilder/FilterConditionRow.module.js.map +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.module.scss +101 -0
- package/dist/components/QueryBuilder/FilterGroupNode.css +1 -0
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts +11 -0
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts.map +1 -0
- package/dist/components/QueryBuilder/FilterGroupNode.js +134 -0
- package/dist/components/QueryBuilder/FilterGroupNode.js.map +1 -0
- package/dist/components/QueryBuilder/FilterGroupNode.module.js +16 -0
- package/dist/components/QueryBuilder/FilterGroupNode.module.js.map +1 -0
- package/dist/components/QueryBuilder/FilterGroupNode.module.scss +92 -0
- package/dist/components/QueryBuilder/QBDragHandle.d.ts +10 -0
- package/dist/components/QueryBuilder/QBDragHandle.d.ts.map +1 -0
- package/dist/components/QueryBuilder/QBDragHandle.js +22 -0
- package/dist/components/QueryBuilder/QBDragHandle.js.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.css +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.d.ts +21 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.d.ts.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.js +143 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.js.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.module.js +17 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.module.js.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.module.scss +79 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts +39 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.js +19 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.js.map +1 -0
- package/dist/components/QueryBuilder/qbTreeToReadable.d.ts +14 -0
- package/dist/components/QueryBuilder/qbTreeToReadable.d.ts.map +1 -0
- package/dist/components/QueryBuilder/qbTreeToReadable.js +89 -0
- package/dist/components/QueryBuilder/qbTreeToReadable.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.d.ts +27 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.js +41 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.css +1 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.module.js +8 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.module.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.module.scss +12 -0
- package/dist/components/QueryBuilder/queryBuilderId.d.ts +2 -0
- package/dist/components/QueryBuilder/queryBuilderId.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderId.js +9 -0
- package/dist/components/QueryBuilder/queryBuilderId.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts +24 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.js +91 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.d.ts +71 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.js +203 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts +3 -2
- package/dist/components/QueryBuilder/queryBuilderTranslation.d.ts.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderTranslation.js +82 -84
- package/dist/components/QueryBuilder/queryBuilderTranslation.js.map +1 -1
- package/dist/components/QueryBuilder/useQBCombinedSql.d.ts +11 -0
- package/dist/components/QueryBuilder/useQBCombinedSql.d.ts.map +1 -0
- package/dist/components/QueryBuilder/useQBCombinedSql.js +29 -0
- package/dist/components/QueryBuilder/useQBCombinedSql.js.map +1 -0
- package/dist/components/QueryBuilder/useQBFacetSourceMetadata.d.ts +18 -0
- package/dist/components/QueryBuilder/useQBFacetSourceMetadata.d.ts.map +1 -0
- package/dist/components/QueryBuilder/useQBFacetSourceMetadata.js +27 -0
- package/dist/components/QueryBuilder/useQBFacetSourceMetadata.js.map +1 -0
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts +14 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +183 -119
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.d.ts +1 -0
- package/dist/components/RssFeedCards/RssFeedCards.d.ts.map +1 -1
- package/dist/components/RssFeedCards/RssFeedCards.js +11 -11
- package/dist/components/RssFeedCards/RssFeedCards.js.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.d.ts +7 -1
- package/dist/components/SynapseChat/SynapseChat.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapseChat.js +76 -71
- package/dist/components/SynapseChat/SynapseChat.js.map +1 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.d.ts +3 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.d.ts.map +1 -1
- package/dist/components/SynapseChat/SynapsePortalChatDialog.js +24 -13
- package/dist/components/SynapseChat/SynapsePortalChatDialog.js.map +1 -1
- package/dist/components/SynapseChat/portalChatSessionStorage.d.ts +23 -0
- package/dist/components/SynapseChat/portalChatSessionStorage.d.ts.map +1 -0
- package/dist/components/SynapseChat/portalChatSessionStorage.js +29 -0
- package/dist/components/SynapseChat/portalChatSessionStorage.js.map +1 -0
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts +6 -0
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.d.ts.map +1 -1
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js +92 -79
- package/dist/components/SynapseTable/TopLevelControls/TopLevelControls.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts +3 -4
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +2 -2
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.d.ts.map +1 -1
- package/dist/components/entity/page/action_menu/EntityActionMenu.js +9 -2
- package/dist/components/entity/page/action_menu/EntityActionMenu.js.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts +0 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +36 -37
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
- package/dist/components/menu/ComplexMenu.js +1 -1
- package/dist/components/menu/ComplexMenu.js.map +1 -1
- package/dist/components/menu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/menu/DropdownMenu.js +4 -0
- package/dist/components/menu/DropdownMenu.js.map +1 -1
- package/dist/components/styled/LeftRightPanel.d.ts.map +1 -1
- package/dist/components/styled/LeftRightPanel.js +19 -2
- package/dist/components/styled/LeftRightPanel.js.map +1 -1
- package/dist/features/entity/metadata-task/hooks/useMarkCurationTaskInProgress.d.ts +10 -0
- package/dist/features/entity/metadata-task/hooks/useMarkCurationTaskInProgress.d.ts.map +1 -0
- package/dist/features/entity/metadata-task/hooks/useMarkCurationTaskInProgress.js +20 -0
- package/dist/features/entity/metadata-task/hooks/useMarkCurationTaskInProgress.js.map +1 -0
- package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.js +29 -20
- package/dist/features/entity/metadata-task/hooks/useOpenCuratorButton.js.map +1 -1
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts +16 -0
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts.map +1 -0
- package/dist/mocks/accessRequirement/mockFormTemplates.js +63 -0
- package/dist/mocks/accessRequirement/mockFormTemplates.js.map +1 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts +7 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts.map +1 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js +47 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js.map +1 -0
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts +27 -0
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts.map +1 -0
- package/dist/mocks/accessRequirement/mockJsonSchemas.js +83 -0
- package/dist/mocks/accessRequirement/mockJsonSchemas.js.map +1 -0
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts +18 -1
- package/dist/mocks/msw/handlers/aridhiaHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/aridhiaHandlers.js +39 -33
- package/dist/mocks/msw/handlers/aridhiaHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts +41 -14
- package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/asyncJobHandlers.js +53 -44
- package/dist/mocks/msw/handlers/asyncJobHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/chatHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/chatHandlers.js +19 -13
- package/dist/mocks/msw/handlers/chatHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts +5 -0
- package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts.map +1 -0
- package/dist/mocks/msw/handlers/formTemplateHandlers.js +65 -0
- package/dist/mocks/msw/handlers/formTemplateHandlers.js.map +1 -0
- package/dist/mocks/msw/handlers/schemaHandlers.d.ts +2 -1
- package/dist/mocks/msw/handlers/schemaHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/schemaHandlers.js +13 -7
- package/dist/mocks/msw/handlers/schemaHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/searchQueryHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/searchQueryHandlers.js +24 -18
- package/dist/mocks/msw/handlers/searchQueryHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/tableQueryHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/tableQueryHandlers.js +35 -16
- package/dist/mocks/msw/handlers/tableQueryHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers.js +49 -47
- package/dist/mocks/msw/handlers.js.map +1 -1
- package/dist/style/abstracts/_cssVariables.scss +7 -0
- package/dist/style/components/_query-wrapper-plot-nav.scss +9 -0
- package/dist/style/main.css +1 -1
- package/dist/synapse-queries/KeyFactory.d.ts +5 -1
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +14 -2
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/chat/useChat.d.ts.map +1 -1
- package/dist/synapse-queries/chat/useChat.js +2 -4
- package/dist/synapse-queries/chat/useChat.js.map +1 -1
- package/dist/synapse-queries/dataaccess/index.d.ts +1 -0
- package/dist/synapse-queries/dataaccess/index.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/index.js +4 -3
- package/dist/synapse-queries/dataaccess/useFormTemplate.d.ts +41 -0
- package/dist/synapse-queries/dataaccess/useFormTemplate.d.ts.map +1 -0
- package/dist/synapse-queries/dataaccess/useFormTemplate.js +63 -0
- package/dist/synapse-queries/dataaccess/useFormTemplate.js.map +1 -0
- package/dist/synapse-queries/index.js +186 -180
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts +9 -0
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts.map +1 -0
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js +22 -0
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js.map +1 -0
- package/dist/testutils/ReactQueryMockUtils.js.map +1 -1
- package/dist/testutils/vitest.setup.js +18 -9
- package/dist/testutils/vitest.setup.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/APIConstants.d.ts +1 -0
- package/dist/utils/APIConstants.d.ts.map +1 -1
- package/dist/utils/APIConstants.js +2 -2
- package/dist/utils/APIConstants.js.map +1 -1
- package/dist/utils/appendFinalQueryParamKey.d.ts.map +1 -1
- package/dist/utils/appendFinalQueryParamKey.js +4 -1
- package/dist/utils/appendFinalQueryParamKey.js.map +1 -1
- package/dist/utils/functions/ArrayUtils.d.ts +3 -0
- package/dist/utils/functions/ArrayUtils.d.ts.map +1 -1
- package/dist/utils/functions/ArrayUtils.js +7 -1
- package/dist/utils/functions/ArrayUtils.js.map +1 -1
- package/dist/utils/jsonschema/generateDataAccessSchema.d.ts +26 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.d.ts.map +1 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.js +28 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.js.map +1 -0
- package/dist/utils/jsonschema/getType.d.ts.map +1 -1
- package/dist/utils/jsonschema/getType.js +4 -1
- package/dist/utils/jsonschema/getType.js.map +1 -1
- package/dist/utils/jsonschema/submissionContext.d.ts +86 -0
- package/dist/utils/jsonschema/submissionContext.d.ts.map +1 -0
- package/dist/utils/jsonschema/submissionContext.js +186 -0
- package/dist/utils/jsonschema/submissionContext.js.map +1 -0
- package/package.json +10 -8
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.d.ts +0 -6
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.d.ts.map +0 -1
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js +0 -32
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js.map +0 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts +0 -9
- package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts.map +0 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.js +0 -24
- package/dist/components/entity/page/title_bar/TitleBarProperties.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegenerateBackupCodesWarning.js","names":[],"sources":["../../../src/components/Authentication/RegenerateBackupCodesWarning.tsx"],"sourcesContent":["import FrontHand from '@/assets/icons/FrontHand'\nimport { Avatar, Box, Button, Paper, Typography, useTheme } from '@mui/material'\n\ntype RegenerateBackupCodesWarningProps = {\n onConfirm: () => void\n onCancel: () => void\n}\n\nexport function RegenerateBackupCodesWarning(\n props: RegenerateBackupCodesWarningProps,\n) {\n const { onConfirm, onCancel } = props\n const theme = useTheme()\n return (\n <Paper sx={{ m: 'auto', maxWidth: '500px', p: 8 }}>\n <Avatar\n sx={{\n bgcolor: theme.palette.primary.main,\n height: '100px',\n width: '100px',\n }}\n >\n <FrontHand sx={{ height: '54px', width: '54px' }} />\n </Avatar>\n <Box sx={{ my: 5 }}>\n <Typography variant={'headline1'} sx={{ mb: 2 }}>\n Really regenerate backup codes?\n </Typography>\n <Typography variant={'body1'} sx={{ my: 1 }}>\n This will invalidate your old backup codes\n </Typography>\n <Typography variant={'body1'} sx={{ my: 1 }}>\n If you click “yes”, below, we will generate 10 new backup codes,\n replacing your old ones, which will no longer function.\n </Typography>\n </Box>\n <Button\n fullWidth\n variant=\"contained\"\n onClick={onConfirm}\n sx={{ height: '50px', my: 1 }}\n >\n Yes, regenerate backup codes\n </Button>\n <Button\n fullWidth\n variant=\"text\"\n onClick={onCancel}\n sx={{ height: '50px', my: 1 }}\n >\n Nevermind\n </Button>\n </Paper>\n )\n}\n"],"mappings":";;;;AAQA,SAAgB,EACd,GACA;CACA,IAAM,EAAE,cAAW,gBAAa;CAEhC,OACE,kBAAC,GAAD;EAAO,IAAI;GAAE,GAAG;GAAQ,UAAU;GAAS,GAAG;EAAE;
|
|
1
|
+
{"version":3,"file":"RegenerateBackupCodesWarning.js","names":[],"sources":["../../../src/components/Authentication/RegenerateBackupCodesWarning.tsx"],"sourcesContent":["import FrontHand from '@/assets/icons/FrontHand'\nimport { Avatar, Box, Button, Paper, Typography, useTheme } from '@mui/material'\n\ntype RegenerateBackupCodesWarningProps = {\n onConfirm: () => void\n onCancel: () => void\n}\n\nexport function RegenerateBackupCodesWarning(\n props: RegenerateBackupCodesWarningProps,\n) {\n const { onConfirm, onCancel } = props\n const theme = useTheme()\n return (\n <Paper sx={{ m: 'auto', maxWidth: '500px', p: { xs: '20px', md: 8 } }}>\n <Avatar\n sx={{\n bgcolor: theme.palette.primary.main,\n height: '100px',\n width: '100px',\n }}\n >\n <FrontHand sx={{ height: '54px', width: '54px' }} />\n </Avatar>\n <Box sx={{ my: 5 }}>\n <Typography variant={'headline1'} sx={{ mb: 2 }}>\n Really regenerate backup codes?\n </Typography>\n <Typography variant={'body1'} sx={{ my: 1 }}>\n This will invalidate your old backup codes\n </Typography>\n <Typography variant={'body1'} sx={{ my: 1 }}>\n If you click “yes”, below, we will generate 10 new backup codes,\n replacing your old ones, which will no longer function.\n </Typography>\n </Box>\n <Button\n fullWidth\n variant=\"contained\"\n onClick={onConfirm}\n sx={{ height: '50px', my: 1 }}\n >\n Yes, regenerate backup codes\n </Button>\n <Button\n fullWidth\n variant=\"text\"\n onClick={onCancel}\n sx={{ height: '50px', my: 1 }}\n >\n Nevermind\n </Button>\n </Paper>\n )\n}\n"],"mappings":";;;;AAQA,SAAgB,EACd,GACA;CACA,IAAM,EAAE,cAAW,gBAAa;CAEhC,OACE,kBAAC,GAAD;EAAO,IAAI;GAAE,GAAG;GAAQ,UAAU;GAAS,GAAG;IAAE,IAAI;IAAQ,IAAI;GAAE;EAAE;YAApE;GACE,kBAAC,GAAD;IACE,IAAI;KACF,SALM,EAKG,EAAM,QAAQ,QAAQ;KAC/B,QAAQ;KACR,OAAO;IACT;cAEA,kBAAC,GAAD,EAAW,IAAI;KAAE,QAAQ;KAAQ,OAAO;IAAO,EAAI,CAAA;GAC7C,CAAA;GACR,kBAAC,GAAD;IAAK,IAAI,EAAE,IAAI,EAAE;cAAjB;KACE,kBAAC,GAAD;MAAY,SAAS;MAAa,IAAI,EAAE,IAAI,EAAE;gBAAG;KAErC,CAAA;KACZ,kBAAC,GAAD;MAAY,SAAS;MAAS,IAAI,EAAE,IAAI,EAAE;gBAAG;KAEjC,CAAA;KACZ,kBAAC,GAAD;MAAY,SAAS;MAAS,IAAI,EAAE,IAAI,EAAE;gBAAG;KAGjC,CAAA;IACT;;GACL,kBAAC,GAAD;IACE,WAAA;IACA,SAAQ;IACR,SAAS;IACT,IAAI;KAAE,QAAQ;KAAQ,IAAI;IAAE;cAC7B;GAEO,CAAA;GACR,kBAAC,GAAD;IACE,WAAA;IACA,SAAQ;IACR,SAAS;IACT,IAAI;KAAE,QAAQ;KAAQ,IAAI;IAAE;cAC7B;GAEO,CAAA;EACH;;AAEX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TOTPForm.d.ts","sourceRoot":"","sources":["../../../src/components/Authentication/TOTPForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"TOTPForm.d.ts","sourceRoot":"","sources":["../../../src/components/Authentication/TOTPForm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAS9C,KAAK,aAAa,GAAG;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAA;CACjD,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,aAAa,2CA6DpD"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { NUMERIC_CODE_HTML_INPUT_PROPS as e } from "./Constants.js";
|
|
2
|
+
import { useState as t } from "react";
|
|
3
|
+
import { Box as n, Button as r } from "@mui/material";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { MuiOtpInput as o } from "mui-one-time-password-input";
|
|
5
6
|
//#region src/components/Authentication/TOTPForm.tsx
|
|
6
|
-
var
|
|
7
|
+
var s = 6, c = [
|
|
7
8
|
"0",
|
|
8
9
|
"1",
|
|
9
10
|
"2",
|
|
@@ -15,15 +16,16 @@ var o = 6, s = [
|
|
|
15
16
|
"8",
|
|
16
17
|
"9"
|
|
17
18
|
];
|
|
18
|
-
function
|
|
19
|
-
let { onSubmit:
|
|
20
|
-
return /* @__PURE__ */
|
|
19
|
+
function l(l) {
|
|
20
|
+
let { onSubmit: u, loginIsPending: d } = l, [f, p] = t("");
|
|
21
|
+
return /* @__PURE__ */ a(n, { children: [/* @__PURE__ */ i(o, {
|
|
21
22
|
autoFocus: !0,
|
|
22
|
-
length:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
length: s,
|
|
24
|
+
TextFieldsProps: { slotProps: { htmlInput: e } },
|
|
25
|
+
value: f,
|
|
26
|
+
onChange: p,
|
|
27
|
+
onComplete: u,
|
|
28
|
+
validateChar: (e) => c.includes(e) || e === "",
|
|
27
29
|
gap: "2px",
|
|
28
30
|
sx: {
|
|
29
31
|
mx: "auto",
|
|
@@ -42,7 +44,7 @@ function c(c) {
|
|
|
42
44
|
},
|
|
43
45
|
".MuiFormControl-root:not(:first-of-type):not(:last-of-type) > .MuiInputBase-root": { borderRadius: 0 }
|
|
44
46
|
}
|
|
45
|
-
}), /* @__PURE__ */ r
|
|
47
|
+
}), /* @__PURE__ */ i(r, {
|
|
46
48
|
fullWidth: !0,
|
|
47
49
|
type: "submit",
|
|
48
50
|
color: "primary",
|
|
@@ -52,14 +54,14 @@ function c(c) {
|
|
|
52
54
|
mt: 4,
|
|
53
55
|
mb: 2
|
|
54
56
|
},
|
|
55
|
-
disabled:
|
|
57
|
+
disabled: f.length !== s || d,
|
|
56
58
|
onClick: (e) => {
|
|
57
|
-
e.preventDefault(),
|
|
59
|
+
e.preventDefault(), u(f);
|
|
58
60
|
},
|
|
59
|
-
children:
|
|
61
|
+
children: d ? "Verifying..." : "Submit"
|
|
60
62
|
})] });
|
|
61
63
|
}
|
|
62
64
|
//#endregion
|
|
63
|
-
export {
|
|
65
|
+
export { l as default };
|
|
64
66
|
|
|
65
67
|
//# sourceMappingURL=TOTPForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TOTPForm.js","names":[],"sources":["../../../src/components/Authentication/TOTPForm.tsx"],"sourcesContent":["import { UseLoginReturn } from '@/utils/hooks'\nimport { Box, Button } from '@mui/material'\nimport { MuiOtpInput } from 'mui-one-time-password-input'\nimport { useState } from 'react'\n\nconst TOTP_LENGTH = 6\nconst DIGIT_CHARACTERS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']\n\ntype TOTPFormProps = {\n onSubmit: (value: string) => void\n loginIsPending: UseLoginReturn['loginIsPending']\n}\n\nexport default function TOTPForm(props: TOTPFormProps) {\n const { onSubmit, loginIsPending } = props\n const [verificationCode, setVerificationCode] = useState('')\n return (\n <Box>\n <MuiOtpInput\n autoFocus\n length={TOTP_LENGTH}\n value={verificationCode}\n onChange={setVerificationCode}\n onComplete={onSubmit}\n validateChar={(character: string) => {\n return DIGIT_CHARACTERS.includes(character) || character === ''\n }}\n gap={'2px'}\n sx={{\n mx: 'auto',\n maxWidth: '350px',\n '.MuiInputBase-root': {\n paddingLeft: '5px',\n paddingRight: '5px',\n },\n '.MuiFormControl-root:first-of-type > .MuiInputBase-root': {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n '.MuiFormControl-root:last-of-type > .MuiInputBase-root': {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n '.MuiFormControl-root:not(:first-of-type):not(:last-of-type) > .MuiInputBase-root':\n {\n borderRadius: 0,\n },\n }}\n />\n <Button\n fullWidth\n type=\"submit\"\n color=\"primary\"\n variant=\"contained\"\n sx={{\n height: '50px',\n mt: 4,\n mb: 2,\n }}\n disabled={verificationCode.length !== TOTP_LENGTH || loginIsPending}\n onClick={e => {\n e.preventDefault()\n onSubmit(verificationCode)\n }}\n >\n {loginIsPending ? 'Verifying...' : 'Submit'}\n </Button>\n </Box>\n )\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TOTPForm.js","names":[],"sources":["../../../src/components/Authentication/TOTPForm.tsx"],"sourcesContent":["import { UseLoginReturn } from '@/utils/hooks'\nimport { Box, Button } from '@mui/material'\nimport { MuiOtpInput } from 'mui-one-time-password-input'\nimport { useState } from 'react'\nimport { NUMERIC_CODE_HTML_INPUT_PROPS } from './Constants'\n\nconst TOTP_LENGTH = 6\nconst DIGIT_CHARACTERS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']\n\ntype TOTPFormProps = {\n onSubmit: (value: string) => void\n loginIsPending: UseLoginReturn['loginIsPending']\n}\n\nexport default function TOTPForm(props: TOTPFormProps) {\n const { onSubmit, loginIsPending } = props\n const [verificationCode, setVerificationCode] = useState('')\n return (\n <Box>\n <MuiOtpInput\n autoFocus\n length={TOTP_LENGTH}\n TextFieldsProps={{\n slotProps: {\n htmlInput: NUMERIC_CODE_HTML_INPUT_PROPS,\n },\n }}\n value={verificationCode}\n onChange={setVerificationCode}\n onComplete={onSubmit}\n validateChar={(character: string) => {\n return DIGIT_CHARACTERS.includes(character) || character === ''\n }}\n gap={'2px'}\n sx={{\n mx: 'auto',\n maxWidth: '350px',\n '.MuiInputBase-root': {\n paddingLeft: '5px',\n paddingRight: '5px',\n },\n '.MuiFormControl-root:first-of-type > .MuiInputBase-root': {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n '.MuiFormControl-root:last-of-type > .MuiInputBase-root': {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n '.MuiFormControl-root:not(:first-of-type):not(:last-of-type) > .MuiInputBase-root':\n {\n borderRadius: 0,\n },\n }}\n />\n <Button\n fullWidth\n type=\"submit\"\n color=\"primary\"\n variant=\"contained\"\n sx={{\n height: '50px',\n mt: 4,\n mb: 2,\n }}\n disabled={verificationCode.length !== TOTP_LENGTH || loginIsPending}\n onClick={e => {\n e.preventDefault()\n onSubmit(verificationCode)\n }}\n >\n {loginIsPending ? 'Verifying...' : 'Submit'}\n </Button>\n </Box>\n )\n}\n"],"mappings":";;;;;;AAMA,IAAM,IAAc,GACd,IAAmB;CAAC;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;AAAG;AAO1E,SAAwB,EAAS,GAAsB;CACrD,IAAM,EAAE,aAAU,sBAAmB,GAC/B,CAAC,GAAkB,KAAuB,EAAS,EAAE;CAC3D,OACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;EACE,WAAA;EACA,QAAQ;EACR,iBAAiB,EACf,WAAW,EACT,WAAW,EACb,EACF;EACA,OAAO;EACP,UAAU;EACV,YAAY;EACZ,eAAe,MACN,EAAiB,SAAS,CAAS,KAAK,MAAc;EAE/D,KAAK;EACL,IAAI;GACF,IAAI;GACJ,UAAU;GACV,sBAAsB;IACpB,aAAa;IACb,cAAc;GAChB;GACA,2DAA2D;IACzD,sBAAsB;IACtB,yBAAyB;GAC3B;GACA,0DAA0D;IACxD,qBAAqB;IACrB,wBAAwB;GAC1B;GACA,oFACE,EACE,cAAc,EAChB;EACJ;CACD,CAAA,GACD,kBAAC,GAAD;EACE,WAAA;EACA,MAAK;EACL,OAAM;EACN,SAAQ;EACR,IAAI;GACF,QAAQ;GACR,IAAI;GACJ,IAAI;EACN;EACA,UAAU,EAAiB,WAAW,KAAe;EACrD,UAAS,MAAK;GAEZ,AADA,EAAE,eAAe,GACjB,EAAS,CAAgB;EAC3B;YAEC,IAAiB,iBAAiB;CAC7B,CAAA,CACL,EAAA,CAAA;AAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwoFactorBackupCodes.d.ts","sourceRoot":"","sources":["../../../src/components/Authentication/TwoFactorBackupCodes.tsx"],"names":[],"mappings":"AAyBA,MAAM,MAAM,yBAAyB,GAAG;IAEtC,0BAA0B,CAAC,EAAE,OAAO,CAAA;IAEpC,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"TwoFactorBackupCodes.d.ts","sourceRoot":"","sources":["../../../src/components/Authentication/TwoFactorBackupCodes.tsx"],"names":[],"mappings":"AAyBA,MAAM,MAAM,yBAAyB,GAAG;IAEtC,0BAA0B,CAAC,EAAE,OAAO,CAAA;IAEpC,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,2CAuL5E"}
|
|
@@ -40,10 +40,15 @@ function S(S) {
|
|
|
40
40
|
className: M,
|
|
41
41
|
leftContent: /* @__PURE__ */ b(m, {
|
|
42
42
|
sx: {
|
|
43
|
-
py:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
py: {
|
|
44
|
+
xs: "10px",
|
|
45
|
+
md: 10
|
|
46
|
+
},
|
|
47
|
+
px: {
|
|
48
|
+
xs: "10px",
|
|
49
|
+
md: 8
|
|
50
|
+
},
|
|
51
|
+
height: "100%"
|
|
47
52
|
},
|
|
48
53
|
children: [
|
|
49
54
|
/* @__PURE__ */ y(g, {
|
|
@@ -52,8 +57,14 @@ function S(S) {
|
|
|
52
57
|
className: N,
|
|
53
58
|
sx: {
|
|
54
59
|
position: "absolute",
|
|
55
|
-
top:
|
|
56
|
-
|
|
60
|
+
top: {
|
|
61
|
+
xs: 0,
|
|
62
|
+
md: T.spacing(2)
|
|
63
|
+
},
|
|
64
|
+
left: {
|
|
65
|
+
xs: 0,
|
|
66
|
+
md: T.spacing(2)
|
|
67
|
+
}
|
|
57
68
|
},
|
|
58
69
|
children: /* @__PURE__ */ y(i, {
|
|
59
70
|
icon: "arrowBack",
|
|
@@ -66,7 +77,10 @@ function S(S) {
|
|
|
66
77
|
}),
|
|
67
78
|
/* @__PURE__ */ y(_, {
|
|
68
79
|
variant: "headline1",
|
|
69
|
-
sx: { mt:
|
|
80
|
+
sx: { mt: {
|
|
81
|
+
xs: 0,
|
|
82
|
+
md: 7
|
|
83
|
+
} },
|
|
70
84
|
children: "Backup codes"
|
|
71
85
|
}),
|
|
72
86
|
C && /* @__PURE__ */ b(p, {
|
|
@@ -119,20 +133,35 @@ function S(S) {
|
|
|
119
133
|
}),
|
|
120
134
|
rightContent: /* @__PURE__ */ y(m, {
|
|
121
135
|
sx: {
|
|
122
|
-
|
|
136
|
+
padding: {
|
|
137
|
+
xs: "60px 0 0 0",
|
|
138
|
+
md: 10
|
|
139
|
+
},
|
|
123
140
|
height: "100%",
|
|
124
|
-
background:
|
|
141
|
+
background: {
|
|
142
|
+
xs: "none",
|
|
143
|
+
md: "url(https://s3.amazonaws.com/static.synapse.org/images/twofactor-graphic.svg) no-repeat right bottom"
|
|
144
|
+
},
|
|
125
145
|
backgroundSize: "100%"
|
|
126
146
|
},
|
|
127
147
|
children: /* @__PURE__ */ b(m, {
|
|
128
148
|
sx: {
|
|
129
|
-
mt:
|
|
130
|
-
|
|
149
|
+
mt: {
|
|
150
|
+
xs: 0,
|
|
151
|
+
md: 7
|
|
152
|
+
},
|
|
153
|
+
px: {
|
|
154
|
+
xs: "10px",
|
|
155
|
+
md: 9
|
|
156
|
+
}
|
|
131
157
|
},
|
|
132
158
|
children: [
|
|
133
159
|
/* @__PURE__ */ y(_, {
|
|
134
160
|
variant: "headline1",
|
|
135
|
-
sx:
|
|
161
|
+
sx: (e) => ({
|
|
162
|
+
mb: 2.5,
|
|
163
|
+
[e.breakpoints.down("md")]: { fontSize: "18px" }
|
|
164
|
+
}),
|
|
136
165
|
children: "Save these codes"
|
|
137
166
|
}),
|
|
138
167
|
/* @__PURE__ */ y(_, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwoFactorBackupCodes.js","names":[],"sources":["../../../src/components/Authentication/TwoFactorBackupCodes.tsx"],"sourcesContent":["import {\n LeftRightPanel,\n StyledOuterContainer,\n} from '@/components/styled/LeftRightPanel'\nimport { createRecoveryCodes } from '@/synapse-client/SynapseClient'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport { useMediaPrintOnly } from '@/utils/hooks/useMediaPrintOnly'\nimport {\n Alert,\n Box,\n Button,\n IconButton,\n Typography,\n useTheme,\n} from '@mui/material'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { TwoFactorAuthRecoveryCodes } from '@sage-bionetworks/synapse-types'\nimport { useMutation } from '@tanstack/react-query'\nimport { useCallback, useEffect, useState } from 'react'\nimport IconSvg from '../IconSvg/IconSvg'\nimport { displayToast } from '../ToastMessage/ToastMessage'\nimport { RecoveryCodeGrid } from './RecoveryCodeGrid'\nimport { RegenerateBackupCodesWarning } from './RegenerateBackupCodesWarning'\nimport { copyStringToClipboard } from '@/utils/functions/StringUtils'\n\nexport type TwoFactorBackupCodesProps = {\n /* Whether to show a warning before generating new codes, to prevent users from overwriting their existing codes */\n showReplaceOldCodesWarning?: boolean\n /* Invoked when the user decides not to generate new codes, or has acknowledged new codes. */\n onClose: () => void\n}\n\nexport default function TwoFactorBackupCodes(props: TwoFactorBackupCodesProps) {\n const { showReplaceOldCodesWarning, onClose } = props\n const theme = useTheme()\n const [hasConfirmedRegeneration, setHasConfirmedRegeneration] = useState(\n !showReplaceOldCodesWarning,\n )\n\n const { accessToken } = useSynapseContext()\n\n const {\n mutate: generateCodes,\n data: recoveryCodes,\n error,\n } = useMutation<TwoFactorAuthRecoveryCodes, SynapseClientError>({\n mutationFn: () => createRecoveryCodes(accessToken),\n onMutate: () => {\n setHasConfirmedRegeneration(true)\n },\n })\n\n // Generate codes on mount if no warning is shown\n useEffect(() => {\n if (!showReplaceOldCodesWarning) {\n generateCodes()\n }\n // Run on mount only\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const { visibleOnPrintClassName, hiddenOnPrintClassName } =\n useMediaPrintOnly()\n\n const copyCodesToClipboard = useCallback(() => {\n const codes = (recoveryCodes?.codes || []).join('\\n')\n copyStringToClipboard(codes).then(() => {\n displayToast('Recovery codes copied to clipboard', 'success')\n })\n }, [recoveryCodes])\n\n if (showReplaceOldCodesWarning && !hasConfirmedRegeneration) {\n return (\n <StyledOuterContainer sx={{ display: 'flex', flexDirection: 'column' }}>\n <RegenerateBackupCodesWarning\n onConfirm={generateCodes}\n onCancel={onClose}\n />\n </StyledOuterContainer>\n )\n }\n\n return (\n <LeftRightPanel\n className={visibleOnPrintClassName}\n leftContent={\n <Box\n sx={{\n py: 10,\n px: 8,\n height: '100%',\n
|
|
1
|
+
{"version":3,"file":"TwoFactorBackupCodes.js","names":[],"sources":["../../../src/components/Authentication/TwoFactorBackupCodes.tsx"],"sourcesContent":["import {\n LeftRightPanel,\n StyledOuterContainer,\n} from '@/components/styled/LeftRightPanel'\nimport { createRecoveryCodes } from '@/synapse-client/SynapseClient'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport { useMediaPrintOnly } from '@/utils/hooks/useMediaPrintOnly'\nimport {\n Alert,\n Box,\n Button,\n IconButton,\n Typography,\n useTheme,\n} from '@mui/material'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { TwoFactorAuthRecoveryCodes } from '@sage-bionetworks/synapse-types'\nimport { useMutation } from '@tanstack/react-query'\nimport { useCallback, useEffect, useState } from 'react'\nimport IconSvg from '../IconSvg/IconSvg'\nimport { displayToast } from '../ToastMessage/ToastMessage'\nimport { RecoveryCodeGrid } from './RecoveryCodeGrid'\nimport { RegenerateBackupCodesWarning } from './RegenerateBackupCodesWarning'\nimport { copyStringToClipboard } from '@/utils/functions/StringUtils'\n\nexport type TwoFactorBackupCodesProps = {\n /* Whether to show a warning before generating new codes, to prevent users from overwriting their existing codes */\n showReplaceOldCodesWarning?: boolean\n /* Invoked when the user decides not to generate new codes, or has acknowledged new codes. */\n onClose: () => void\n}\n\nexport default function TwoFactorBackupCodes(props: TwoFactorBackupCodesProps) {\n const { showReplaceOldCodesWarning, onClose } = props\n const theme = useTheme()\n const [hasConfirmedRegeneration, setHasConfirmedRegeneration] = useState(\n !showReplaceOldCodesWarning,\n )\n\n const { accessToken } = useSynapseContext()\n\n const {\n mutate: generateCodes,\n data: recoveryCodes,\n error,\n } = useMutation<TwoFactorAuthRecoveryCodes, SynapseClientError>({\n mutationFn: () => createRecoveryCodes(accessToken),\n onMutate: () => {\n setHasConfirmedRegeneration(true)\n },\n })\n\n // Generate codes on mount if no warning is shown\n useEffect(() => {\n if (!showReplaceOldCodesWarning) {\n generateCodes()\n }\n // Run on mount only\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const { visibleOnPrintClassName, hiddenOnPrintClassName } =\n useMediaPrintOnly()\n\n const copyCodesToClipboard = useCallback(() => {\n const codes = (recoveryCodes?.codes || []).join('\\n')\n copyStringToClipboard(codes).then(() => {\n displayToast('Recovery codes copied to clipboard', 'success')\n })\n }, [recoveryCodes])\n\n if (showReplaceOldCodesWarning && !hasConfirmedRegeneration) {\n return (\n <StyledOuterContainer sx={{ display: 'flex', flexDirection: 'column' }}>\n <RegenerateBackupCodesWarning\n onConfirm={generateCodes}\n onCancel={onClose}\n />\n </StyledOuterContainer>\n )\n }\n\n return (\n <LeftRightPanel\n className={visibleOnPrintClassName}\n leftContent={\n <Box\n sx={{\n py: { xs: '10px', md: 10 },\n px: { xs: '10px', md: 8 },\n height: '100%',\n }}\n >\n <IconButton\n type=\"button\"\n onClick={onClose}\n className={hiddenOnPrintClassName}\n sx={{\n position: 'absolute',\n top: { xs: 0, md: theme.spacing(2) },\n left: { xs: 0, md: theme.spacing(2) },\n }}\n >\n <IconSvg\n icon=\"arrowBack\"\n wrap={false}\n sx={{ height: '24px', width: '24px' }}\n />\n </IconButton>\n <Typography variant=\"headline1\" sx={{ mt: { xs: 0, md: 7 } }}>\n Backup codes\n </Typography>\n {showReplaceOldCodesWarning && (\n <Alert\n severity=\"warning\"\n className={hiddenOnPrintClassName}\n sx={{\n my: 2,\n }}\n icon={false}\n >\n <strong>These new codes have replaced your old codes.</strong>{' '}\n Please save these codes and use them from now on.\n </Alert>\n )}\n <RecoveryCodeGrid recoveryCodes={recoveryCodes} />\n {error && (\n <Alert severity={'error'} sx={{ my: 2 }} icon={false}>\n {error.message}\n </Alert>\n )}\n <Box\n className={hiddenOnPrintClassName}\n sx={{\n display: 'grid',\n gridTemplateColumns: '1fr 1fr',\n gap: '10px',\n mb: '10px',\n }}\n >\n <Button\n variant={'outlined'}\n onClick={copyCodesToClipboard}\n disabled={!recoveryCodes}\n >\n Copy Codes\n </Button>\n <Button\n variant={'outlined'}\n disabled={!recoveryCodes}\n onClick={window.print}\n >\n Print Codes\n </Button>\n </Box>\n <Button\n variant={'contained'}\n className={hiddenOnPrintClassName}\n fullWidth\n disabled={!recoveryCodes}\n onClick={onClose}\n >\n Done\n </Button>\n </Box>\n }\n rightContent={\n <Box\n sx={{\n padding: { xs: '60px 0 0 0', md: 10 },\n height: '100%',\n background: {\n xs: 'none',\n md: `url(https://s3.amazonaws.com/static.synapse.org/images/twofactor-graphic.svg) no-repeat right bottom`,\n },\n backgroundSize: '100%',\n }}\n >\n <Box\n sx={{\n mt: { xs: 0, md: 7 },\n px: { xs: '10px', md: 9 },\n }}\n >\n <Typography\n variant=\"headline1\"\n sx={theme => ({\n mb: 2.5,\n [theme.breakpoints.down('md')]: { fontSize: '18px' },\n })}\n >\n Save these codes\n </Typography>\n <Typography\n variant=\"body1\"\n sx={{\n my: 2,\n }}\n >\n You can use these 10 backup codes to access your account if you\n ever lose access to your authentication device.\n </Typography>\n <Typography\n variant=\"body1\"\n sx={{\n my: 2,\n }}\n >\n Each code can only be used once.\n </Typography>\n </Box>\n </Box>\n }\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAgCA,SAAwB,EAAqB,GAAkC;CAC7E,IAAM,EAAE,+BAA4B,eAAY,GAC1C,IAAQ,EAAS,GACjB,CAAC,GAA0B,KAA+B,EAC9D,CAAC,CACH,GAEM,EAAE,mBAAgB,EAAkB,GAEpC,EACJ,QAAQ,GACR,MAAM,GACN,aACE,EAA4D;EAC9D,kBAAkB,EAAoB,CAAW;EACjD,gBAAgB;GACd,EAA4B,EAAI;EAClC;CACF,CAAC;CAGD,QAAgB;EACd,AAAK,KACH,EAAc;CAIlB,GAAG,CAAC,CAAC;CAEL,IAAM,EAAE,4BAAyB,8BAC/B,EAAkB,GAEd,IAAuB,QAAkB;EAE7C,GADe,GAAe,SAAS,CAAC,GAAG,KAAK,IAC1B,CAAK,EAAE,WAAW;GACtC,EAAa,sCAAsC,SAAS;EAC9D,CAAC;CACH,GAAG,CAAC,CAAa,CAAC;CAalB,OAXI,KAA8B,CAAC,IAE/B,kBAAC,GAAD;EAAsB,IAAI;GAAE,SAAS;GAAQ,eAAe;EAAS;YACnE,kBAAC,GAAD;GACE,WAAW;GACX,UAAU;EACX,CAAA;CACmB,CAAA,IAKxB,kBAAC,GAAD;EACE,WAAW;EACX,aACE,kBAAC,GAAD;GACE,IAAI;IACF,IAAI;KAAE,IAAI;KAAQ,IAAI;IAAG;IACzB,IAAI;KAAE,IAAI;KAAQ,IAAI;IAAE;IACxB,QAAQ;GACV;aALF;IAOE,kBAAC,GAAD;KACE,MAAK;KACL,SAAS;KACT,WAAW;KACX,IAAI;MACF,UAAU;MACV,KAAK;OAAE,IAAI;OAAG,IAAI,EAAM,QAAQ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AME,kBAAC,GAAD;MACE,SAAQ;MACR,KAAI,OAAU;OACZ,IAAI;QACH,EAAM,YAAY,KAAK,IAAI,IAAI,EAAE,UAAU,OAAO;MACrD;gBACD;KAEW,CAAA;KACZ,kBAAC,GAAD;MACE,SAAQ;MACR,IAAI,EACF,IAAI,EACN;gBACD;KAGW,CAAA;KACZ,kBAAC,GAAD;MACE,SAAQ;MACR,IAAI,EACF,IAAI,EACN;gBACD;KAEW,CAAA;IACT;;EACF,CAAA;CAER,CAAA;AAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwoFactorEnrollmentForm.d.ts","sourceRoot":"","sources":["../../../src/components/Authentication/TwoFactorEnrollmentForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TwoFactorEnrollmentForm.d.ts","sourceRoot":"","sources":["../../../src/components/Authentication/TwoFactorEnrollmentForm.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAW5D;;;;GAIG;AACH,iBAAS,YAAY,CAAC,MAAM,EAAE,UAAU,UAEvC;AA6BD,eAAO,MAAM,oBAAoB,+HAC6F,CAAA;AAE9H,MAAM,MAAM,4BAA4B,GAAG;IACzC,UAAU,EAAE,UAAU,CAAA;IACtB,4BAA4B,EAAE,MAAM,IAAI,CAAA;IACxC,aAAa,EAAE,MAAM,IAAI,CAAA;CAC1B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,KAAK,EAAE,4BAA4B,2CAqOpC;AAED,eAAO,MAAM,yBAAyB;;CAAmB,CAAA"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import e from "../FullWidthAlert/FullWidthAlert.js";
|
|
2
|
-
import "./Constants.js";
|
|
3
|
-
import { SynapseSpinner as
|
|
4
|
-
import { useFinishTwoFactorEnrollment as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { StyledOuterContainer as
|
|
8
|
-
import
|
|
9
|
-
import { useEffect as
|
|
10
|
-
import { Box as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import * as
|
|
2
|
+
import { NUMERIC_CODE_HTML_INPUT_PROPS as t } from "./Constants.js";
|
|
3
|
+
import { SynapseSpinner as n } from "../LoadingScreen/LoadingScreen.js";
|
|
4
|
+
import { useFinishTwoFactorEnrollment as r } from "../../synapse-queries/auth/useTwoFactorEnrollment.js";
|
|
5
|
+
import i from "../IconSvg/IconSvg.js";
|
|
6
|
+
import a from "../TextField/TextField.js";
|
|
7
|
+
import { StyledOuterContainer as o } from "../styled/LeftRightPanel.js";
|
|
8
|
+
import s from "./TwoFactorSecretDialog.js";
|
|
9
|
+
import { useEffect as c, useRef as l, useState as u } from "react";
|
|
10
|
+
import { Box as d, Button as f, Divider as p, IconButton as m, Link as h, Paper as g, Stack as _, Typography as v, styled as y } from "@mui/material";
|
|
11
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
12
|
+
import * as S from "qrcode";
|
|
13
13
|
//#region src/components/Authentication/TwoFactorEnrollmentForm.tsx
|
|
14
|
-
var { toCanvas:
|
|
15
|
-
function
|
|
14
|
+
var { toCanvas: C } = S;
|
|
15
|
+
function w(e) {
|
|
16
16
|
return `otpauth://totp/Synapse:${e.username}?secret=${e.secret}&issuer=Sage%20Bionetworks&algorithm=${e.alg}&digits=${e.digits}&period=${e.period}`;
|
|
17
17
|
}
|
|
18
|
-
var
|
|
18
|
+
var T = y((e) => /* @__PURE__ */ b(d, {
|
|
19
19
|
sx: {
|
|
20
20
|
my: 3,
|
|
21
21
|
...e.sx
|
|
22
22
|
},
|
|
23
23
|
...e
|
|
24
|
-
}), { label: "Section" })(() => ({})),
|
|
24
|
+
}), { label: "Section" })(() => ({})), E = y(d, { label: "SectionInnerGrid" })(({ theme: e }) => ({
|
|
25
25
|
display: "grid",
|
|
26
26
|
gridTemplateColumns: "auto 200px",
|
|
27
27
|
columnGap: e.spacing(5),
|
|
@@ -29,19 +29,19 @@ var w = v((e) => /* @__PURE__ */ y(u, {
|
|
|
29
29
|
gridTemplateColumns: "1fr",
|
|
30
30
|
gap: "18px"
|
|
31
31
|
}
|
|
32
|
-
})),
|
|
33
|
-
function
|
|
34
|
-
let { onTwoFactorEnrollmentSuccess:
|
|
35
|
-
return
|
|
32
|
+
})), D = "https://help.synapse.org/docs/Managing-Your-Account.2055405596.html#Adding-Two-Factor-Authentication-(2FA)-to-your-account";
|
|
33
|
+
function O(y) {
|
|
34
|
+
let { onTwoFactorEnrollmentSuccess: S, onBackClicked: O, totpSecret: k } = y, [A, j] = u(""), [M, N] = u(!1), [P, F] = u(!1), I = l(null), { mutate: L, isPending: R, error: z } = r({ onSuccess: S });
|
|
35
|
+
return c(() => {
|
|
36
36
|
async function e() {
|
|
37
|
-
|
|
37
|
+
k && I.current && (await C(I.current, w(k), {
|
|
38
38
|
version: 10,
|
|
39
39
|
margin: 0,
|
|
40
40
|
scale: 3.5
|
|
41
|
-
}),
|
|
41
|
+
}), N(!0));
|
|
42
42
|
}
|
|
43
43
|
e();
|
|
44
|
-
}, [
|
|
44
|
+
}, [k]), /* @__PURE__ */ b(o, { children: /* @__PURE__ */ x(g, {
|
|
45
45
|
sx: {
|
|
46
46
|
position: "relative",
|
|
47
47
|
width: {
|
|
@@ -53,17 +53,17 @@ function D(v) {
|
|
|
53
53
|
mx: "auto"
|
|
54
54
|
},
|
|
55
55
|
children: [
|
|
56
|
-
|
|
56
|
+
O && /* @__PURE__ */ b(m, {
|
|
57
57
|
type: "button",
|
|
58
58
|
onClick: () => {
|
|
59
|
-
|
|
59
|
+
O();
|
|
60
60
|
},
|
|
61
61
|
sx: (e) => ({
|
|
62
62
|
position: "absolute",
|
|
63
63
|
top: e.spacing(2),
|
|
64
64
|
left: e.spacing(2)
|
|
65
65
|
}),
|
|
66
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ b(i, {
|
|
67
67
|
icon: "arrowBack",
|
|
68
68
|
wrap: !1,
|
|
69
69
|
sx: {
|
|
@@ -72,11 +72,11 @@ function D(v) {
|
|
|
72
72
|
}
|
|
73
73
|
})
|
|
74
74
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ x(T, { children: [/* @__PURE__ */ b(v, {
|
|
76
76
|
variant: "headline2",
|
|
77
77
|
sx: { mb: 3 },
|
|
78
78
|
children: "Activate Two-factor Authentication"
|
|
79
|
-
}), /* @__PURE__ */
|
|
79
|
+
}), /* @__PURE__ */ x(v, {
|
|
80
80
|
variant: "body1",
|
|
81
81
|
children: [
|
|
82
82
|
"After setting up 2FA, you’ll use an authenticator app as part of your login process, in addition to your existing password. If you log in using your Google",
|
|
@@ -84,53 +84,53 @@ function D(v) {
|
|
|
84
84
|
" or ORCiD account, you may need to use 2FA as part of",
|
|
85
85
|
"that process as well.",
|
|
86
86
|
" ",
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
href:
|
|
87
|
+
/* @__PURE__ */ b(h, {
|
|
88
|
+
href: D,
|
|
89
89
|
children: "Learn more about 2FA"
|
|
90
90
|
}),
|
|
91
91
|
"."
|
|
92
92
|
]
|
|
93
93
|
})] }),
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ b(T, { children: /* @__PURE__ */ x(E, { children: [/* @__PURE__ */ x(d, { children: [/* @__PURE__ */ b(v, {
|
|
95
95
|
variant: "body1",
|
|
96
96
|
sx: { fontWeight: 700 },
|
|
97
97
|
children: "Step 1. Get one of these apps"
|
|
98
|
-
}), /* @__PURE__ */
|
|
98
|
+
}), /* @__PURE__ */ b(v, {
|
|
99
99
|
variant: "body1",
|
|
100
100
|
children: "Download and install one of these authentication apps to set up 2FA on your mobile device, tablet, or desktop. If you have one of these apps already installed, you can skip this step."
|
|
101
|
-
})] }), /* @__PURE__ */
|
|
101
|
+
})] }), /* @__PURE__ */ x(_, {
|
|
102
102
|
sx: (e) => ({
|
|
103
103
|
justifyContent: "space-between",
|
|
104
104
|
flexShrink: 0,
|
|
105
105
|
[e.breakpoints.down("sm")]: { gap: "20px" }
|
|
106
106
|
}),
|
|
107
107
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
108
|
+
/* @__PURE__ */ b(h, {
|
|
109
109
|
href: "https://authy.com/download/",
|
|
110
110
|
children: "Authy"
|
|
111
111
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ b(h, {
|
|
113
113
|
href: "https://duo.com/product/multi-factor-authentication-mfa/duo-mobile-app",
|
|
114
114
|
children: "DUO Mobile"
|
|
115
115
|
}),
|
|
116
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ b(h, {
|
|
117
117
|
href: "https://googleauthenticator.net/",
|
|
118
118
|
children: "Google Authenticator"
|
|
119
119
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ b(h, {
|
|
121
121
|
href: "https://www.microsoft.com/en-us/security/mobile-authenticator-app",
|
|
122
122
|
children: "Microsoft Authenticator"
|
|
123
123
|
})
|
|
124
124
|
]
|
|
125
125
|
})] }) }),
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ b(p, {}),
|
|
127
|
+
/* @__PURE__ */ b(T, { children: /* @__PURE__ */ x(E, { children: [/* @__PURE__ */ x(d, { children: [
|
|
128
|
+
/* @__PURE__ */ b(v, {
|
|
129
129
|
variant: "body1",
|
|
130
130
|
sx: { fontWeight: 700 },
|
|
131
131
|
children: "Step 2. Scan the QR Code"
|
|
132
132
|
}),
|
|
133
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ x(v, {
|
|
134
134
|
component: "ol",
|
|
135
135
|
variant: "body1",
|
|
136
136
|
sx: {
|
|
@@ -138,81 +138,84 @@ function D(v) {
|
|
|
138
138
|
my: 1
|
|
139
139
|
},
|
|
140
140
|
children: [
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ b("li", { children: "Open your authenticator app" }),
|
|
142
|
+
/* @__PURE__ */ b("li", { children: "Tap the \"+\" button" }),
|
|
143
|
+
/* @__PURE__ */ b("li", { children: "Use your camera to scan the image to the right" })
|
|
144
144
|
]
|
|
145
145
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ b(h, {
|
|
147
147
|
onClick: () => {
|
|
148
|
-
|
|
148
|
+
F(!0);
|
|
149
149
|
},
|
|
150
150
|
children: "Can't use your camera?"
|
|
151
151
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
secret:
|
|
154
|
-
open:
|
|
155
|
-
onClose: () =>
|
|
152
|
+
/* @__PURE__ */ b(s, {
|
|
153
|
+
secret: k?.secret ?? "",
|
|
154
|
+
open: P,
|
|
155
|
+
onClose: () => F(!1)
|
|
156
156
|
})
|
|
157
|
-
] }), /* @__PURE__ */
|
|
157
|
+
] }), /* @__PURE__ */ x(d, {
|
|
158
158
|
sx: {
|
|
159
159
|
display: "flex",
|
|
160
160
|
justifyContent: "center",
|
|
161
161
|
alignItems: "middle",
|
|
162
162
|
height: "auto"
|
|
163
163
|
},
|
|
164
|
-
children: [!
|
|
165
|
-
style: { display:
|
|
166
|
-
ref:
|
|
164
|
+
children: [!M && /* @__PURE__ */ b(n, { size: 50 }), /* @__PURE__ */ b("canvas", {
|
|
165
|
+
style: { display: M ? void 0 : "none" },
|
|
166
|
+
ref: I
|
|
167
167
|
})]
|
|
168
168
|
})] }) }),
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ b(p, {}),
|
|
170
|
+
/* @__PURE__ */ b(T, { children: /* @__PURE__ */ x(E, { children: [/* @__PURE__ */ x(d, { children: [/* @__PURE__ */ b(v, {
|
|
171
171
|
variant: "body1",
|
|
172
172
|
sx: { fontWeight: 700 },
|
|
173
173
|
children: "Step 3. Enter the Verification Code"
|
|
174
|
-
}), /* @__PURE__ */
|
|
174
|
+
}), /* @__PURE__ */ b(v, {
|
|
175
175
|
variant: "body1",
|
|
176
176
|
children: "After scanning in the QR code in step 2, your app will provide a 6-digit code. Enter it in in the field to the right."
|
|
177
|
-
})] }), /* @__PURE__ */
|
|
177
|
+
})] }), /* @__PURE__ */ b("form", {
|
|
178
178
|
onSubmit: (e) => {
|
|
179
|
-
e.preventDefault(),
|
|
180
|
-
secretId:
|
|
181
|
-
totp:
|
|
179
|
+
e.preventDefault(), L({
|
|
180
|
+
secretId: k.secretId,
|
|
181
|
+
totp: A
|
|
182
182
|
});
|
|
183
183
|
},
|
|
184
|
-
children: /* @__PURE__ */
|
|
184
|
+
children: /* @__PURE__ */ x(_, {
|
|
185
185
|
direction: "row",
|
|
186
186
|
sx: {
|
|
187
187
|
gap: 2,
|
|
188
188
|
height: "48px"
|
|
189
189
|
},
|
|
190
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ b(a, {
|
|
191
191
|
autoFocus: !0,
|
|
192
|
-
slotProps: { htmlInput: {
|
|
193
|
-
|
|
192
|
+
slotProps: { htmlInput: {
|
|
193
|
+
...t,
|
|
194
|
+
maxLength: k?.digits
|
|
195
|
+
} },
|
|
196
|
+
value: A,
|
|
194
197
|
onChange: (e) => {
|
|
195
|
-
|
|
198
|
+
j(e.target.value);
|
|
196
199
|
}
|
|
197
|
-
}), /* @__PURE__ */
|
|
200
|
+
}), /* @__PURE__ */ b(f, {
|
|
198
201
|
type: "submit",
|
|
199
202
|
variant: "contained",
|
|
200
203
|
sx: { flexShrink: 0 },
|
|
201
|
-
disabled:
|
|
204
|
+
disabled: R || A.length != k?.digits,
|
|
202
205
|
children: "Activate"
|
|
203
206
|
})]
|
|
204
207
|
})
|
|
205
208
|
})] }) }),
|
|
206
|
-
|
|
209
|
+
z && /* @__PURE__ */ b(e, {
|
|
207
210
|
variant: "danger",
|
|
208
211
|
isGlobal: !1,
|
|
209
|
-
description:
|
|
212
|
+
description: z.reason.toLowerCase().includes("invalid totp code") ? `${z.reason}. Please ensure automatic date and time is enabled in your device settings and try again.` : z.reason
|
|
210
213
|
})
|
|
211
214
|
]
|
|
212
215
|
}) });
|
|
213
216
|
}
|
|
214
|
-
var
|
|
217
|
+
var k = { toOtpAuthUrl: w };
|
|
215
218
|
//#endregion
|
|
216
|
-
export {
|
|
219
|
+
export { k as EXPORTED_FOR_UNIT_TESTING, D as TWO_FACTOR_DOCS_LINK, O as default };
|
|
217
220
|
|
|
218
221
|
//# sourceMappingURL=TwoFactorEnrollmentForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TwoFactorEnrollmentForm.js","names":[],"sources":["../../../src/components/Authentication/TwoFactorEnrollmentForm.tsx"],"sourcesContent":["import { StyledOuterContainer } from '@/components/styled/LeftRightPanel'\nimport { TOTP_CLOCK_SKEW_ERROR_APPENDAGE } from '@/components/Authentication/Constants'\nimport { useFinishTwoFactorEnrollment } from '@/synapse-queries/auth/useTwoFactorEnrollment'\nimport { StyledComponent } from '@emotion/styled'\nimport {\n Box,\n BoxProps,\n Button,\n Divider,\n IconButton,\n Link,\n Paper,\n Stack,\n styled,\n Typography,\n} from '@mui/material'\nimport { TotpSecret } from '@sage-bionetworks/synapse-types'\nimport * as qrcode from 'qrcode'\n// qrcode is CJS-only; use namespace import for Vite dev mode CJS interop.\nconst { toCanvas } = qrcode\nimport { useEffect, useRef, useState } from 'react'\nimport FullWidthAlert from '../FullWidthAlert/FullWidthAlert'\nimport IconSvg from '../IconSvg/IconSvg'\nimport { SynapseSpinner } from '../LoadingScreen/LoadingScreen'\nimport TextField from '../TextField/TextField'\nimport TwoFactorSecretDialog from './TwoFactorSecretDialog'\n\n/**\n * Returns a URL that can be used to generate a QR code that 2FA authenticator apps can interpret.\n * This uses the username fro TotpSecret to create the friendly name for the account in the authenticator app.\n * @param secret\n */\nfunction toOtpAuthUrl(secret: TotpSecret) {\n return `otpauth://totp/Synapse:${secret.username}?secret=${secret.secret}&issuer=Sage%20Bionetworks&algorithm=${secret.alg}&digits=${secret.digits}&period=${secret.period}`\n}\n\nconst Section: StyledComponent<BoxProps> = styled(\n (props: BoxProps) => (\n <Box\n sx={{\n my: 3,\n ...props.sx,\n }}\n {...props}\n />\n ),\n {\n label: 'Section',\n },\n)(() => ({}))\n\nconst SectionInnerGrid = styled(Box, { label: 'SectionInnerGrid' })(\n ({ theme }) => ({\n display: 'grid',\n gridTemplateColumns: 'auto 200px',\n columnGap: theme.spacing(5),\n [theme.breakpoints.down('sm')]: {\n gridTemplateColumns: '1fr',\n gap: '18px',\n },\n }),\n)\n\nexport const TWO_FACTOR_DOCS_LINK =\n 'https://help.synapse.org/docs/Managing-Your-Account.2055405596.html#Adding-Two-Factor-Authentication-(2FA)-to-your-account'\n\nexport type TwoFactorEnrollmentFormProps = {\n totpSecret: TotpSecret\n onTwoFactorEnrollmentSuccess: () => void\n onBackClicked: () => void\n}\n\nexport default function TwoFactorEnrollmentForm(\n props: TwoFactorEnrollmentFormProps,\n) {\n const { onTwoFactorEnrollmentSuccess, onBackClicked, totpSecret } = props\n\n const [totp, setTotp] = useState('')\n const [hasQrCode, setHasQrCode] = useState(false)\n const [showSecretInModal, setShowSecretInModal] = useState(false)\n const qrCodeCanvasElement = useRef<HTMLCanvasElement>(null)\n\n const {\n mutate: finishEnrollment,\n isPending: isFinishingEnrollment,\n error,\n } = useFinishTwoFactorEnrollment({\n onSuccess: onTwoFactorEnrollmentSuccess,\n })\n\n useEffect(() => {\n async function createQrCode() {\n if (totpSecret && qrCodeCanvasElement.current) {\n await toCanvas(qrCodeCanvasElement.current, toOtpAuthUrl(totpSecret), {\n version: 10,\n margin: 0,\n scale: 3.5,\n })\n setHasQrCode(true)\n }\n }\n void createQrCode()\n }, [totpSecret])\n\n return (\n <StyledOuterContainer>\n <Paper\n sx={{\n position: 'relative',\n width: { xs: '100%', md: '800px' },\n py: 6.5,\n px: 8,\n mx: 'auto',\n }}\n >\n {onBackClicked && (\n <IconButton\n type=\"button\"\n onClick={() => {\n onBackClicked()\n }}\n sx={theme => ({\n position: 'absolute',\n top: theme.spacing(2),\n left: theme.spacing(2),\n })}\n >\n <IconSvg\n icon=\"arrowBack\"\n wrap={false}\n sx={{ height: '24px', width: '24px' }}\n />\n </IconButton>\n )}\n <Section>\n <Typography variant=\"headline2\" sx={{ mb: 3 }}>\n Activate Two-factor Authentication\n </Typography>\n <Typography variant=\"body1\">\n After setting up 2FA, you’ll use an authenticator app as part of\n your login process, in addition to your existing password. If you\n log in using your Google\n {/* oxlint-disable-next-line no-constant-binary-expression -- Remove conditionality when NIH RAS login is supported */}\n {false && ', NIH RAS,'} or ORCiD account, you may need to use 2FA as\n part of\n {/*those processes*/}\n that process as well.{' '}\n <Link href={TWO_FACTOR_DOCS_LINK}>Learn more about 2FA</Link>.\n </Typography>\n </Section>\n <Section>\n <SectionInnerGrid>\n <Box>\n <Typography variant=\"body1\" sx={{ fontWeight: 700 }}>\n Step 1. Get one of these apps\n </Typography>\n <Typography variant=\"body1\">\n Download and install one of these authentication apps to set up\n 2FA on your mobile device, tablet, or desktop. If you have one\n of these apps already installed, you can skip this step.\n </Typography>\n </Box>\n <Stack\n sx={theme => ({\n justifyContent: 'space-between',\n flexShrink: 0,\n [theme.breakpoints.down('sm')]: {\n gap: '20px',\n },\n })}\n >\n <Link href={'https://authy.com/download/'}>Authy</Link>\n <Link\n href={\n 'https://duo.com/product/multi-factor-authentication-mfa/duo-mobile-app'\n }\n >\n DUO Mobile\n </Link>\n <Link href={'https://googleauthenticator.net/'}>\n Google Authenticator\n </Link>\n <Link\n href={\n 'https://www.microsoft.com/en-us/security/mobile-authenticator-app'\n }\n >\n Microsoft Authenticator\n </Link>\n </Stack>\n </SectionInnerGrid>\n </Section>\n <Divider />\n <Section>\n <SectionInnerGrid>\n <Box>\n <Typography variant=\"body1\" sx={{ fontWeight: 700 }}>\n Step 2. Scan the QR Code\n </Typography>\n <Typography component=\"ol\" variant=\"body1\" sx={{ pl: 2, my: 1 }}>\n <li>Open your authenticator app</li>\n <li>Tap the "+" button</li>\n <li>Use your camera to scan the image to the right</li>\n </Typography>\n <Link\n onClick={() => {\n setShowSecretInModal(true)\n }}\n >\n Can't use your camera?\n </Link>\n <TwoFactorSecretDialog\n secret={totpSecret?.secret ?? ''}\n open={showSecretInModal}\n onClose={() => setShowSecretInModal(false)}\n />\n </Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'middle',\n height: 'auto',\n }}\n >\n {!hasQrCode && <SynapseSpinner size={50} />}\n <canvas\n style={{ display: hasQrCode ? undefined : 'none' }}\n ref={qrCodeCanvasElement}\n />\n </Box>\n </SectionInnerGrid>\n </Section>\n <Divider />\n <Section>\n <SectionInnerGrid>\n <Box>\n <Typography variant=\"body1\" sx={{ fontWeight: 700 }}>\n Step 3. Enter the Verification Code\n </Typography>\n <Typography variant=\"body1\">\n After scanning in the QR code in step 2, your app will provide a\n 6-digit code. Enter it in in the field to the right.\n </Typography>\n </Box>\n <form\n onSubmit={e => {\n e.preventDefault()\n finishEnrollment({\n secretId: totpSecret.secretId,\n totp,\n })\n }}\n >\n <Stack\n direction={'row'}\n sx={{\n gap: 2,\n height: '48px',\n }}\n >\n <TextField\n autoFocus\n slotProps={{ htmlInput: { maxLength: totpSecret?.digits } }}\n value={totp}\n onChange={e => {\n setTotp(e.target.value)\n }}\n />\n <Button\n type={'submit'}\n variant={'contained'}\n sx={{ flexShrink: 0 }}\n disabled={\n isFinishingEnrollment || totp.length != totpSecret?.digits\n }\n >\n Activate\n </Button>\n </Stack>\n </form>\n </SectionInnerGrid>\n </Section>\n {error && (\n <FullWidthAlert\n variant={'danger'}\n isGlobal={false}\n description={\n error.reason.toLowerCase().includes('invalid totp code')\n ? `${error.reason}. ${TOTP_CLOCK_SKEW_ERROR_APPENDAGE}`\n : error.reason\n }\n />\n )}\n </Paper>\n </StyledOuterContainer>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AAK;MACL,QAAQ;KACV;eALF,CAOE,kBAAC,GAAD;MACE,WAAA;MACA,WAAW,EAAE,WAAW,EAAE,WAAW,GAAY,OAAO,EAAE;MAC1D,OAAO;MACP,WAAU,MAAK;OACb,EAAQ,EAAE,OAAO,KAAK;MACxB;KACD,CAAA,GACD,kBAAC,GAAD;MACE,MAAM;MACN,SAAS;MACT,IAAI,EAAE,YAAY,EAAE;MACpB,UACE,KAAyB,EAAK,UAAU,GAAY;gBAEvD;KAEO,CAAA,CACH;;GACH,CAAA,CACU,EAAA,CAAA,EACX,CAAA;GACR,KACC,kBAAC,GAAD;IACE,SAAS;IACT,UAAU;IACV,aACE,EAAM,OAAO,YAAY,EAAE,SAAS,mBAAmB,IACnD,GAAG,EAAM,OAAO,6FAChB,EAAM;GAEb,CAAA;EAEE;IACa,CAAA;AAE1B;AAEA,IAAa,IAA4B,EAAE,gBAAa"}
|
|
1
|
+
{"version":3,"file":"TwoFactorEnrollmentForm.js","names":[],"sources":["../../../src/components/Authentication/TwoFactorEnrollmentForm.tsx"],"sourcesContent":["import { StyledOuterContainer } from '@/components/styled/LeftRightPanel'\nimport {\n NUMERIC_CODE_HTML_INPUT_PROPS,\n TOTP_CLOCK_SKEW_ERROR_APPENDAGE,\n} from '@/components/Authentication/Constants'\nimport { useFinishTwoFactorEnrollment } from '@/synapse-queries/auth/useTwoFactorEnrollment'\nimport { StyledComponent } from '@emotion/styled'\nimport {\n Box,\n BoxProps,\n Button,\n Divider,\n IconButton,\n Link,\n Paper,\n Stack,\n styled,\n Typography,\n} from '@mui/material'\nimport { TotpSecret } from '@sage-bionetworks/synapse-types'\nimport * as qrcode from 'qrcode'\n// qrcode is CJS-only; use namespace import for Vite dev mode CJS interop.\nconst { toCanvas } = qrcode\nimport { useEffect, useRef, useState } from 'react'\nimport FullWidthAlert from '../FullWidthAlert/FullWidthAlert'\nimport IconSvg from '../IconSvg/IconSvg'\nimport { SynapseSpinner } from '../LoadingScreen/LoadingScreen'\nimport TextField from '../TextField/TextField'\nimport TwoFactorSecretDialog from './TwoFactorSecretDialog'\n\n/**\n * Returns a URL that can be used to generate a QR code that 2FA authenticator apps can interpret.\n * This uses the username fro TotpSecret to create the friendly name for the account in the authenticator app.\n * @param secret\n */\nfunction toOtpAuthUrl(secret: TotpSecret) {\n return `otpauth://totp/Synapse:${secret.username}?secret=${secret.secret}&issuer=Sage%20Bionetworks&algorithm=${secret.alg}&digits=${secret.digits}&period=${secret.period}`\n}\n\nconst Section: StyledComponent<BoxProps> = styled(\n (props: BoxProps) => (\n <Box\n sx={{\n my: 3,\n ...props.sx,\n }}\n {...props}\n />\n ),\n {\n label: 'Section',\n },\n)(() => ({}))\n\nconst SectionInnerGrid = styled(Box, { label: 'SectionInnerGrid' })(\n ({ theme }) => ({\n display: 'grid',\n gridTemplateColumns: 'auto 200px',\n columnGap: theme.spacing(5),\n [theme.breakpoints.down('sm')]: {\n gridTemplateColumns: '1fr',\n gap: '18px',\n },\n }),\n)\n\nexport const TWO_FACTOR_DOCS_LINK =\n 'https://help.synapse.org/docs/Managing-Your-Account.2055405596.html#Adding-Two-Factor-Authentication-(2FA)-to-your-account'\n\nexport type TwoFactorEnrollmentFormProps = {\n totpSecret: TotpSecret\n onTwoFactorEnrollmentSuccess: () => void\n onBackClicked: () => void\n}\n\nexport default function TwoFactorEnrollmentForm(\n props: TwoFactorEnrollmentFormProps,\n) {\n const { onTwoFactorEnrollmentSuccess, onBackClicked, totpSecret } = props\n\n const [totp, setTotp] = useState('')\n const [hasQrCode, setHasQrCode] = useState(false)\n const [showSecretInModal, setShowSecretInModal] = useState(false)\n const qrCodeCanvasElement = useRef<HTMLCanvasElement>(null)\n\n const {\n mutate: finishEnrollment,\n isPending: isFinishingEnrollment,\n error,\n } = useFinishTwoFactorEnrollment({\n onSuccess: onTwoFactorEnrollmentSuccess,\n })\n\n useEffect(() => {\n async function createQrCode() {\n if (totpSecret && qrCodeCanvasElement.current) {\n await toCanvas(qrCodeCanvasElement.current, toOtpAuthUrl(totpSecret), {\n version: 10,\n margin: 0,\n scale: 3.5,\n })\n setHasQrCode(true)\n }\n }\n void createQrCode()\n }, [totpSecret])\n\n return (\n <StyledOuterContainer>\n <Paper\n sx={{\n position: 'relative',\n width: { xs: '100%', md: '800px' },\n py: 6.5,\n px: 8,\n mx: 'auto',\n }}\n >\n {onBackClicked && (\n <IconButton\n type=\"button\"\n onClick={() => {\n onBackClicked()\n }}\n sx={theme => ({\n position: 'absolute',\n top: theme.spacing(2),\n left: theme.spacing(2),\n })}\n >\n <IconSvg\n icon=\"arrowBack\"\n wrap={false}\n sx={{ height: '24px', width: '24px' }}\n />\n </IconButton>\n )}\n <Section>\n <Typography variant=\"headline2\" sx={{ mb: 3 }}>\n Activate Two-factor Authentication\n </Typography>\n <Typography variant=\"body1\">\n After setting up 2FA, you’ll use an authenticator app as part of\n your login process, in addition to your existing password. If you\n log in using your Google\n {/* oxlint-disable-next-line no-constant-binary-expression -- Remove conditionality when NIH RAS login is supported */}\n {false && ', NIH RAS,'} or ORCiD account, you may need to use 2FA as\n part of\n {/*those processes*/}\n that process as well.{' '}\n <Link href={TWO_FACTOR_DOCS_LINK}>Learn more about 2FA</Link>.\n </Typography>\n </Section>\n <Section>\n <SectionInnerGrid>\n <Box>\n <Typography variant=\"body1\" sx={{ fontWeight: 700 }}>\n Step 1. Get one of these apps\n </Typography>\n <Typography variant=\"body1\">\n Download and install one of these authentication apps to set up\n 2FA on your mobile device, tablet, or desktop. If you have one\n of these apps already installed, you can skip this step.\n </Typography>\n </Box>\n <Stack\n sx={theme => ({\n justifyContent: 'space-between',\n flexShrink: 0,\n [theme.breakpoints.down('sm')]: {\n gap: '20px',\n },\n })}\n >\n <Link href={'https://authy.com/download/'}>Authy</Link>\n <Link\n href={\n 'https://duo.com/product/multi-factor-authentication-mfa/duo-mobile-app'\n }\n >\n DUO Mobile\n </Link>\n <Link href={'https://googleauthenticator.net/'}>\n Google Authenticator\n </Link>\n <Link\n href={\n 'https://www.microsoft.com/en-us/security/mobile-authenticator-app'\n }\n >\n Microsoft Authenticator\n </Link>\n </Stack>\n </SectionInnerGrid>\n </Section>\n <Divider />\n <Section>\n <SectionInnerGrid>\n <Box>\n <Typography variant=\"body1\" sx={{ fontWeight: 700 }}>\n Step 2. Scan the QR Code\n </Typography>\n <Typography component=\"ol\" variant=\"body1\" sx={{ pl: 2, my: 1 }}>\n <li>Open your authenticator app</li>\n <li>Tap the "+" button</li>\n <li>Use your camera to scan the image to the right</li>\n </Typography>\n <Link\n onClick={() => {\n setShowSecretInModal(true)\n }}\n >\n Can't use your camera?\n </Link>\n <TwoFactorSecretDialog\n secret={totpSecret?.secret ?? ''}\n open={showSecretInModal}\n onClose={() => setShowSecretInModal(false)}\n />\n </Box>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'middle',\n height: 'auto',\n }}\n >\n {!hasQrCode && <SynapseSpinner size={50} />}\n <canvas\n style={{ display: hasQrCode ? undefined : 'none' }}\n ref={qrCodeCanvasElement}\n />\n </Box>\n </SectionInnerGrid>\n </Section>\n <Divider />\n <Section>\n <SectionInnerGrid>\n <Box>\n <Typography variant=\"body1\" sx={{ fontWeight: 700 }}>\n Step 3. Enter the Verification Code\n </Typography>\n <Typography variant=\"body1\">\n After scanning in the QR code in step 2, your app will provide a\n 6-digit code. Enter it in in the field to the right.\n </Typography>\n </Box>\n <form\n onSubmit={e => {\n e.preventDefault()\n finishEnrollment({\n secretId: totpSecret.secretId,\n totp,\n })\n }}\n >\n <Stack\n direction={'row'}\n sx={{\n gap: 2,\n height: '48px',\n }}\n >\n <TextField\n autoFocus\n slotProps={{\n htmlInput: {\n ...NUMERIC_CODE_HTML_INPUT_PROPS,\n maxLength: totpSecret?.digits,\n },\n }}\n value={totp}\n onChange={e => {\n setTotp(e.target.value)\n }}\n />\n <Button\n type={'submit'}\n variant={'contained'}\n sx={{ flexShrink: 0 }}\n disabled={\n isFinishingEnrollment || totp.length != totpSecret?.digits\n }\n >\n Activate\n </Button>\n </Stack>\n </form>\n </SectionInnerGrid>\n </Section>\n {error && (\n <FullWidthAlert\n variant={'danger'}\n isGlobal={false}\n description={\n error.reason.toLowerCase().includes('invalid totp code')\n ? `${error.reason}. ${TOTP_CLOCK_SKEW_ERROR_APPENDAGE}`\n : error.reason\n }\n />\n )}\n </Paper>\n </StyledOuterContainer>\n )\n}\n\nexport const EXPORTED_FOR_UNIT_TESTING = { toOtpAuthUrl }\n"],"mappings":";;;;;;;;;;;;;AAsBA,IAAM,EAAE,gBAAa;AAarB,SAAS,EAAa,GAAoB;CACxC,OAAO,0BAA0B,EAAO,SAAS,UAAU,EAAO,OAAO,uCAAuC,EAAO,IAAI,UAAU,EAAO,OAAO,UAAU,EAAO;AACtK;AAEA,IAAM,IAAqC,GACxC,MACC,kBAAC,GAAD;CACE,IAAI;EACF,IAAI;EACJ,GAAG,EAAM;CACX;CACA,GAAI;AACL,CAAA,GAEH,EACE,OAAO,UACT,CACF,SAAS,CAAC,EAAE,GAEN,IAAmB,EAAO,GAAK,EAAE,OAAO,mBAAmB,CAAC,GAC/D,EAAE,gBAAa;CACd,SAAS;CACT,qBAAqB;CACrB,WAAW,EAAM,QAAQ,CAAC;EACzB,EAAM,YAAY,KAAK,IAAI,IAAI;EAC9B,qBAAqB;EACrB,KAAK;CACP;AACF,EACF,GAEa,IACX;AAQF,SAAwB,EACtB,GACA;CACA,IAAM,EAAE,iCAA8B,kBAAe,kBAAe,GAE9D,CAAC,GAAM,KAAW,EAAS,EAAE,GAC7B,CAAC,GAAW,KAAgB,EAAS,EAAK,GAC1C,CAAC,GAAmB,KAAwB,EAAS,EAAK,GAC1D,IAAsB,EAA0B,IAAI,GAEpD,EACJ,QAAQ,GACR,WAAW,GACX,aACE,EAA6B,EAC/B,WAAW,EACb,CAAC;CAgBD,OAdA,QAAgB;EACd,eAAe,IAAe;GAC5B,AAAI,KAAc,EAAoB,YACpC,MAAM,EAAS,EAAoB,SAAS,EAAa,CAAU,GAAG;IACpE,SAAS;IACT,Q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