@greatapps/common 1.1.789 → 1.1.791
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/components/account/AccountHubLinkHandler.mjs +36 -0
- package/dist/components/account/AccountHubLinkHandler.mjs.map +1 -0
- package/dist/components/account/AccountModalLayout.mjs +137 -0
- package/dist/components/account/AccountModalLayout.mjs.map +1 -0
- package/dist/components/account/AccountModals.mjs +10 -3
- package/dist/components/account/AccountModals.mjs.map +1 -1
- package/dist/components/account/DeleteAccountModal.mjs +1 -1
- package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +8 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
- package/dist/components/account/MyAccountModal.mjs +167 -0
- package/dist/components/account/MyAccountModal.mjs.map +1 -0
- package/dist/components/account/TwoFactorAuthModal.mjs +1 -1
- package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
- package/dist/components/account/hooks/useAccountHubActions.mjs +85 -0
- package/dist/components/account/hooks/useAccountHubActions.mjs.map +1 -0
- package/dist/components/account/hooks/useAddCardWithPaymentSwitch.mjs +44 -0
- package/dist/components/account/hooks/useAddCardWithPaymentSwitch.mjs.map +1 -0
- package/dist/components/account/hooks/useAffiliatesActions.mjs +69 -0
- package/dist/components/account/hooks/useAffiliatesActions.mjs.map +1 -0
- package/dist/components/account/hooks/useMyAccountModal.mjs +27 -0
- package/dist/components/account/hooks/useMyAccountModal.mjs.map +1 -0
- package/dist/components/account/hooks/useProjectsActions.mjs +40 -0
- package/dist/components/account/hooks/useProjectsActions.mjs.map +1 -0
- package/dist/components/account/hooks/useSubscriptionActions.mjs +87 -0
- package/dist/components/account/hooks/useSubscriptionActions.mjs.map +1 -0
- package/dist/components/account/hooks/useTeamActions.mjs +31 -0
- package/dist/components/account/hooks/useTeamActions.mjs.map +1 -0
- package/dist/components/account/sections/AffiliatesSection.mjs +313 -0
- package/dist/components/account/sections/AffiliatesSection.mjs.map +1 -0
- package/dist/components/account/sections/ChangePasswordSection.mjs +5 -5
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
- package/dist/components/account/sections/MyProfileSection.mjs +194 -144
- package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
- package/dist/components/account/sections/PreferencesSection.mjs +60 -49
- package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
- package/dist/components/account/sections/ProjectsSection.mjs +77 -0
- package/dist/components/account/sections/ProjectsSection.mjs.map +1 -0
- package/dist/components/account/sections/SecuritySection.mjs +55 -36
- package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
- package/dist/components/account/sections/SubscriptionSection.mjs +29 -0
- package/dist/components/account/sections/SubscriptionSection.mjs.map +1 -0
- package/dist/components/account/sections/TeamSection.mjs +119 -0
- package/dist/components/account/sections/TeamSection.mjs.map +1 -0
- package/dist/components/account/sections/TokenSection.mjs +41 -43
- package/dist/components/account/sections/TokenSection.mjs.map +1 -1
- package/dist/components/account/sections/affiliates/AffiliateCommissionCard.mjs +73 -0
- package/dist/components/account/sections/affiliates/AffiliateCommissionCard.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateFlows.mjs +20 -0
- package/dist/components/account/sections/affiliates/AffiliateFlows.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateLeadsSheet.mjs +99 -0
- package/dist/components/account/sections/affiliates/AffiliateLeadsSheet.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateStatsCard.mjs +31 -0
- package/dist/components/account/sections/affiliates/AffiliateStatsCard.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateStepCard.mjs +15 -0
- package/dist/components/account/sections/affiliates/AffiliateStepCard.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/AffiliateTransactionsList.mjs +108 -0
- package/dist/components/account/sections/affiliates/AffiliateTransactionsList.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/NoReceivingAccountModal.mjs +49 -0
- package/dist/components/account/sections/affiliates/NoReceivingAccountModal.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/ReceivingAccountModal.mjs +182 -0
- package/dist/components/account/sections/affiliates/ReceivingAccountModal.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/RequestWithdrawalSheet.mjs +476 -0
- package/dist/components/account/sections/affiliates/RequestWithdrawalSheet.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/ViewAttachmentModal.mjs +34 -0
- package/dist/components/account/sections/affiliates/ViewAttachmentModal.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.mjs +27 -0
- package/dist/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/reports/AffiliatesReportsTab.mjs +30 -0
- package/dist/components/account/sections/affiliates/reports/AffiliatesReportsTab.mjs.map +1 -0
- package/dist/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.mjs +120 -0
- package/dist/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.mjs.map +1 -0
- package/dist/components/account/sections/projects/DeleteProjectModal.mjs +205 -0
- package/dist/components/account/sections/projects/DeleteProjectModal.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectFlows.mjs +16 -0
- package/dist/components/account/sections/projects/ProjectFlows.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectMembersStack.mjs +53 -0
- package/dist/components/account/sections/projects/ProjectMembersStack.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectRow.mjs +85 -0
- package/dist/components/account/sections/projects/ProjectRow.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectSheet.mjs +499 -0
- package/dist/components/account/sections/projects/ProjectSheet.mjs.map +1 -0
- package/dist/components/account/sections/projects/ProjectsDisabledModal.mjs +55 -0
- package/dist/components/account/sections/projects/ProjectsDisabledModal.mjs.map +1 -0
- package/dist/components/account/sections/projects/project-form.schema.mjs +28 -0
- package/dist/components/account/sections/projects/project-form.schema.mjs.map +1 -0
- package/dist/components/account/sections/shared/ConnectListRow.mjs +45 -0
- package/dist/components/account/sections/shared/ConnectListRow.mjs.map +1 -0
- package/dist/components/account/sections/shared/DateFilterPopover.mjs +51 -0
- package/dist/components/account/sections/shared/DateFilterPopover.mjs.map +1 -0
- package/dist/components/account/sections/shared/EntityAvatar.mjs +41 -0
- package/dist/components/account/sections/shared/EntityAvatar.mjs.map +1 -0
- package/dist/components/account/sections/shared/FilterPopover.mjs +62 -0
- package/dist/components/account/sections/shared/FilterPopover.mjs.map +1 -0
- package/dist/components/account/sections/shared/FormSection.mjs +14 -0
- package/dist/components/account/sections/shared/FormSection.mjs.map +1 -0
- package/dist/components/account/sections/shared/IconBox.mjs +18 -0
- package/dist/components/account/sections/shared/IconBox.mjs.map +1 -0
- package/dist/components/account/sections/shared/InfiniteScrollList.mjs +36 -0
- package/dist/components/account/sections/shared/InfiniteScrollList.mjs.map +1 -0
- package/dist/components/account/sections/shared/ListPagination.mjs +69 -0
- package/dist/components/account/sections/shared/ListPagination.mjs.map +1 -0
- package/dist/components/account/sections/shared/RowActionsMenu.mjs +52 -0
- package/dist/components/account/sections/shared/RowActionsMenu.mjs.map +1 -0
- package/dist/components/account/sections/shared/SectionLoadError.mjs +20 -0
- package/dist/components/account/sections/shared/SectionLoadError.mjs.map +1 -0
- package/dist/components/account/sections/shared/StatusBadge.mjs +26 -0
- package/dist/components/account/sections/shared/StatusBadge.mjs.map +1 -0
- package/dist/components/account/sections/shared/WorkspaceSection.mjs +10 -0
- package/dist/components/account/sections/shared/WorkspaceSection.mjs.map +1 -0
- package/dist/components/account/sections/subscription/AiCreditsUsage.mjs +106 -0
- package/dist/components/account/sections/subscription/AiCreditsUsage.mjs.map +1 -0
- package/dist/components/account/sections/subscription/BillingAddressSheet.mjs +407 -0
- package/dist/components/account/sections/subscription/BillingAddressSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/BoletoDetailsDialog.mjs +73 -0
- package/dist/components/account/sections/subscription/BoletoDetailsDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/BoletoGeneratedDialog.mjs +22 -0
- package/dist/components/account/sections/subscription/BoletoGeneratedDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/CancelPlanDialog.mjs +161 -0
- package/dist/components/account/sections/subscription/CancelPlanDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ChargeRow.mjs +127 -0
- package/dist/components/account/sections/subscription/ChargeRow.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ChargeStatusBadge.mjs +27 -0
- package/dist/components/account/sections/subscription/ChargeStatusBadge.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ChargesList.mjs +88 -0
- package/dist/components/account/sections/subscription/ChargesList.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ManageCardsSheet.mjs +49 -0
- package/dist/components/account/sections/subscription/ManageCardsSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/OverdueReceiptOpener.mjs +26 -0
- package/dist/components/account/sections/subscription/OverdueReceiptOpener.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PayChargeDialog.mjs +222 -0
- package/dist/components/account/sections/subscription/PayChargeDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PaymentConfirmationDialog.mjs +61 -0
- package/dist/components/account/sections/subscription/PaymentConfirmationDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PaymentMethodsCard.mjs +72 -0
- package/dist/components/account/sections/subscription/PaymentMethodsCard.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PendingChangeDialog.mjs +117 -0
- package/dist/components/account/sections/subscription/PendingChangeDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PixDetailsDialog.mjs +165 -0
- package/dist/components/account/sections/subscription/PixDetailsDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PixPaymentDialog.mjs +155 -0
- package/dist/components/account/sections/subscription/PixPaymentDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/PlanDetailsSheet.mjs +253 -0
- package/dist/components/account/sections/subscription/PlanDetailsSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/ReceiptDetailsSheet.mjs +237 -0
- package/dist/components/account/sections/subscription/ReceiptDetailsSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/SubscriptionFlows.mjs +40 -0
- package/dist/components/account/sections/subscription/SubscriptionFlows.mjs.map +1 -0
- package/dist/components/account/sections/subscription/SubscriptionPlanCard.mjs +303 -0
- package/dist/components/account/sections/subscription/SubscriptionPlanCard.mjs.map +1 -0
- package/dist/components/account/sections/subscription/UsageReportSheet.mjs +163 -0
- package/dist/components/account/sections/subscription/UsageReportSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/ChangePlanSheet.mjs +75 -0
- package/dist/components/account/sections/subscription/change-plan/ChangePlanSheet.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.mjs +55 -0
- package/dist/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/AddonsBlock.mjs +188 -0
- package/dist/components/account/sections/subscription/change-plan/components/AddonsBlock.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.mjs +66 -0
- package/dist/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/CouponBlock.mjs +42 -0
- package/dist/components/account/sections/subscription/change-plan/components/CouponBlock.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/CouponDialog.mjs +119 -0
- package/dist/components/account/sections/subscription/change-plan/components/CouponDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/PricePreview.mjs +17 -0
- package/dist/components/account/sections/subscription/change-plan/components/PricePreview.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/components/SummaryBlock.mjs +130 -0
- package/dist/components/account/sections/subscription/change-plan/components/SummaryBlock.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/plan-comparison.mjs +38 -0
- package/dist/components/account/sections/subscription/change-plan/plan-comparison.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.mjs +127 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.mjs +111 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PlanViewStep.mjs +69 -0
- package/dist/components/account/sections/subscription/change-plan/steps/PlanViewStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.mjs +88 -0
- package/dist/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.mjs +115 -0
- package/dist/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.mjs.map +1 -0
- package/dist/components/account/sections/subscription/change-plan/useChangePlanState.mjs +918 -0
- package/dist/components/account/sections/subscription/change-plan/useChangePlanState.mjs.map +1 -0
- package/dist/components/account/sections/subscription/downgrade/CannotDowngradeDialog.mjs +216 -0
- package/dist/components/account/sections/subscription/downgrade/CannotDowngradeDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/downgrade/DowngradeReasonDialog.mjs +128 -0
- package/dist/components/account/sections/subscription/downgrade/DowngradeReasonDialog.mjs.map +1 -0
- package/dist/components/account/sections/subscription/plans/PlanCard.mjs +281 -0
- package/dist/components/account/sections/subscription/plans/PlanCard.mjs.map +1 -0
- package/dist/components/account/sections/subscription/plans/PlanCardSkeleton.mjs +53 -0
- package/dist/components/account/sections/subscription/plans/PlanCardSkeleton.mjs.map +1 -0
- package/dist/components/account/sections/subscription/plans/PlansCatalogDialog.mjs +119 -0
- package/dist/components/account/sections/subscription/plans/PlansCatalogDialog.mjs.map +1 -0
- package/dist/components/account/sections/team/DeleteUserModal.mjs +116 -0
- package/dist/components/account/sections/team/DeleteUserModal.mjs.map +1 -0
- package/dist/components/account/sections/team/TeamFlows.mjs +14 -0
- package/dist/components/account/sections/team/TeamFlows.mjs.map +1 -0
- package/dist/components/account/sections/team/TeamMemberRow.mjs +99 -0
- package/dist/components/account/sections/team/TeamMemberRow.mjs.map +1 -0
- package/dist/components/account/sections/team/UserSheet.mjs +570 -0
- package/dist/components/account/sections/team/UserSheet.mjs.map +1 -0
- package/dist/components/account/sections/team/steps/NotificationsStep.mjs +80 -0
- package/dist/components/account/sections/team/steps/NotificationsStep.mjs.map +1 -0
- package/dist/components/account/sections/team/steps/ProjectSelectionStep.mjs +180 -0
- package/dist/components/account/sections/team/steps/ProjectSelectionStep.mjs.map +1 -0
- package/dist/components/account/sections/team/steps/UserInformationStep.mjs +371 -0
- package/dist/components/account/sections/team/steps/UserInformationStep.mjs.map +1 -0
- package/dist/components/account/sections/team/user-form.schema.mjs +37 -0
- package/dist/components/account/sections/team/user-form.schema.mjs.map +1 -0
- package/dist/components/account/types/workspace-actions.type.mjs +1 -0
- package/dist/components/account/types/workspace-actions.type.mjs.map +1 -0
- package/dist/components/layouts/ProfilePopover.mjs +10 -12
- package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +7 -4
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
- package/dist/components/modals/AccountDeletionWarningModal.mjs +4 -5
- package/dist/components/modals/AccountDeletionWarningModal.mjs.map +1 -1
- package/dist/components/modals/AccountFrozenModal.mjs +6 -3
- package/dist/components/modals/AccountFrozenModal.mjs.map +1 -1
- package/dist/components/modals/Modals.mjs +3 -3
- package/dist/components/modals/Modals.mjs.map +1 -1
- package/dist/components/modals/PaidPlanRequiredModal.mjs +4 -5
- package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
- package/dist/components/modals/cards/AddFirstCardWarningModal.mjs +63 -0
- package/dist/components/modals/cards/AddFirstCardWarningModal.mjs.map +1 -0
- package/dist/components/modals/cards/SwitchPaymentToCardModal.mjs +187 -0
- package/dist/components/modals/cards/SwitchPaymentToCardModal.mjs.map +1 -0
- package/dist/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.mjs +5 -4
- package/dist/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.mjs.map +1 -1
- package/dist/components/ui/data-display/CardItem.mjs +9 -1
- package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
- package/dist/components/ui/data-display/PaymentMethodIcons.mjs +50 -0
- package/dist/components/ui/data-display/PaymentMethodIcons.mjs.map +1 -0
- package/dist/components/ui/form/BillingPeriodSelector.mjs +108 -0
- package/dist/components/ui/form/BillingPeriodSelector.mjs.map +1 -0
- package/dist/components/ui/form/PaymentMethodToggle.mjs +82 -0
- package/dist/components/ui/form/PaymentMethodToggle.mjs.map +1 -0
- package/dist/components/ui/form/RadioOptionFieldIcon.mjs +57 -0
- package/dist/components/ui/form/RadioOptionFieldIcon.mjs.map +1 -0
- package/dist/components/ui/form/SegmentedControl.mjs +56 -0
- package/dist/components/ui/form/SegmentedControl.mjs.map +1 -0
- package/dist/components/ui/overlay/Dialog.mjs +41 -6
- package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
- package/dist/components/ui/overlay/Sheet.mjs +43 -13
- package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
- package/dist/components/ui/overlay/layers.mjs +72 -26
- package/dist/components/ui/overlay/layers.mjs.map +1 -1
- package/dist/enums/AccountHubFlow.mjs +13 -0
- package/dist/enums/AccountHubFlow.mjs.map +1 -0
- package/dist/enums/DateFilterPeriod.mjs +22 -0
- package/dist/enums/DateFilterPeriod.mjs.map +1 -0
- package/dist/enums/WorkspaceSectionType.mjs +11 -0
- package/dist/enums/WorkspaceSectionType.mjs.map +1 -0
- package/dist/handlers.mjs +24 -0
- package/dist/handlers.mjs.map +1 -1
- package/dist/hooks/useDebounce.mjs +5 -3
- package/dist/hooks/useDebounce.mjs.map +1 -1
- package/dist/hooks/useUploadProgress.mjs +33 -0
- package/dist/hooks/useUploadProgress.mjs.map +1 -0
- package/dist/i18n/messages/en-us.mjs +863 -3
- package/dist/i18n/messages/en-us.mjs.map +1 -1
- package/dist/i18n/messages/es-es.mjs +863 -3
- package/dist/i18n/messages/es-es.mjs.map +1 -1
- package/dist/i18n/messages/pt-br.mjs +863 -3
- package/dist/i18n/messages/pt-br.mjs.map +1 -1
- package/dist/index.mjs +87 -7
- package/dist/index.mjs.map +1 -1
- package/dist/infra/http/paged.mjs +20 -0
- package/dist/infra/http/paged.mjs.map +1 -0
- package/dist/middleware.mjs +2 -0
- package/dist/middleware.mjs.map +1 -1
- package/dist/middlewares/create-auth-middleware.mjs +1 -3
- package/dist/middlewares/create-auth-middleware.mjs.map +1 -1
- package/dist/middlewares/create-legacy-account-routes-middleware.mjs +44 -0
- package/dist/middlewares/create-legacy-account-routes-middleware.mjs.map +1 -0
- package/dist/middlewares/is-route-equals.mjs +7 -0
- package/dist/middlewares/is-route-equals.mjs.map +1 -0
- package/dist/modules/accounts/actions/account-management.action.mjs +20 -1
- package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -1
- package/dist/modules/accounts/constants/account-hub-link.constants.mjs +9 -0
- package/dist/modules/accounts/constants/account-hub-link.constants.mjs.map +1 -0
- package/dist/modules/accounts/constants/legacy-account-routes.constants.mjs +5 -0
- package/dist/modules/accounts/constants/legacy-account-routes.constants.mjs.map +1 -0
- package/dist/modules/accounts/handlers/list-account-members.handler.mjs +22 -0
- package/dist/modules/accounts/handlers/list-account-members.handler.mjs.map +1 -0
- package/dist/modules/accounts/hooks/add-user-projects.hook.mjs +51 -0
- package/dist/modules/accounts/hooks/add-user-projects.hook.mjs.map +1 -0
- package/dist/modules/accounts/hooks/create-account-user.hook.mjs +20 -0
- package/dist/modules/accounts/hooks/create-account-user.hook.mjs.map +1 -0
- package/dist/modules/accounts/hooks/remove-user-projects.hook.mjs +47 -0
- package/dist/modules/accounts/hooks/remove-user-projects.hook.mjs.map +1 -0
- package/dist/modules/accounts/hooks/use-account-members.hook.mjs +20 -0
- package/dist/modules/accounts/hooks/use-account-members.hook.mjs.map +1 -0
- package/dist/modules/accounts/services/account.service.mjs +59 -0
- package/dist/modules/accounts/services/account.service.mjs.map +1 -1
- package/dist/modules/accounts/types/account-hub-link.type.mjs +1 -0
- package/dist/modules/accounts/types/account-hub-link.type.mjs.map +1 -0
- package/dist/modules/accounts/utils/build-account-hub-url.mjs +16 -0
- package/dist/modules/accounts/utils/build-account-hub-url.mjs.map +1 -0
- package/dist/modules/accounts/utils/is-account-hub-flow.mjs +9 -0
- package/dist/modules/accounts/utils/is-account-hub-flow.mjs.map +1 -0
- package/dist/modules/accounts/utils/is-account-section.mjs +9 -0
- package/dist/modules/accounts/utils/is-account-section.mjs.map +1 -0
- package/dist/modules/accounts/utils/is-my-account-section.mjs +13 -0
- package/dist/modules/accounts/utils/is-my-account-section.mjs.map +1 -0
- package/dist/modules/accounts/utils/map-legacy-account-route.mjs +93 -0
- package/dist/modules/accounts/utils/map-legacy-account-route.mjs.map +1 -0
- package/dist/modules/accounts/utils/parse-account-hub-link.mjs +20 -0
- package/dist/modules/accounts/utils/parse-account-hub-link.mjs.map +1 -0
- package/dist/modules/affiliates/actions/ensure-affiliate.action.mjs +10 -0
- package/dist/modules/affiliates/actions/ensure-affiliate.action.mjs.map +1 -0
- package/dist/modules/affiliates/actions/request-deposit.action.mjs +10 -0
- package/dist/modules/affiliates/actions/request-deposit.action.mjs.map +1 -0
- package/dist/modules/affiliates/actions/update-affiliate.action.mjs +10 -0
- package/dist/modules/affiliates/actions/update-affiliate.action.mjs.map +1 -0
- package/dist/modules/affiliates/constants/affiliate.constants.mjs +11 -0
- package/dist/modules/affiliates/constants/affiliate.constants.mjs.map +1 -0
- package/dist/modules/affiliates/constants/query-keys.constants.mjs +15 -0
- package/dist/modules/affiliates/constants/query-keys.constants.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/affiliate-report-analytics.handler.mjs +16 -0
- package/dist/modules/affiliates/handlers/affiliate-report-analytics.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.mjs +12 -0
- package/dist/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/current-affiliate.handler.mjs +12 -0
- package/dist/modules/affiliates/handlers/current-affiliate.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/list-affiliate-coupons.handler.mjs +12 -0
- package/dist/modules/affiliates/handlers/list-affiliate-coupons.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/list-affiliate-leads.handler.mjs +22 -0
- package/dist/modules/affiliates/handlers/list-affiliate-leads.handler.mjs.map +1 -0
- package/dist/modules/affiliates/handlers/list-affiliate-transactions.handler.mjs +22 -0
- package/dist/modules/affiliates/handlers/list-affiliate-transactions.handler.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-affiliate-coupons.hook.mjs +17 -0
- package/dist/modules/affiliates/hooks/use-affiliate-coupons.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-affiliate-leads.hook.mjs +22 -0
- package/dist/modules/affiliates/hooks/use-affiliate-leads.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-affiliate-report-analytics.hook.mjs +17 -0
- package/dist/modules/affiliates/hooks/use-affiliate-report-analytics.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-affiliate-transactions.hook.mjs +20 -0
- package/dist/modules/affiliates/hooks/use-affiliate-transactions.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-current-affiliate.hook.mjs +17 -0
- package/dist/modules/affiliates/hooks/use-current-affiliate.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-ensure-affiliate.hook.mjs +23 -0
- package/dist/modules/affiliates/hooks/use-ensure-affiliate.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-request-deposit.hook.mjs +28 -0
- package/dist/modules/affiliates/hooks/use-request-deposit.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-update-affiliate.hook.mjs +22 -0
- package/dist/modules/affiliates/hooks/use-update-affiliate.hook.mjs.map +1 -0
- package/dist/modules/affiliates/hooks/use-withdrawal-limits.hook.mjs +17 -0
- package/dist/modules/affiliates/hooks/use-withdrawal-limits.hook.mjs.map +1 -0
- package/dist/modules/affiliates/services/affiliates.service.mjs +183 -0
- package/dist/modules/affiliates/services/affiliates.service.mjs.map +1 -0
- package/dist/modules/affiliates/types/affiliate.type.mjs +100 -0
- package/dist/modules/affiliates/types/affiliate.type.mjs.map +1 -0
- package/dist/modules/affiliates/utils/get-affiliate-share-link.mjs +9 -0
- package/dist/modules/affiliates/utils/get-affiliate-share-link.mjs.map +1 -0
- package/dist/modules/charges/actions/get-nota-fiscal.action.mjs +10 -0
- package/dist/modules/charges/actions/get-nota-fiscal.action.mjs.map +1 -0
- package/dist/modules/charges/actions/refresh-pix.action.mjs +10 -0
- package/dist/modules/charges/actions/refresh-pix.action.mjs.map +1 -0
- package/dist/modules/charges/hooks/nota-fiscal.hook.mjs +13 -0
- package/dist/modules/charges/hooks/nota-fiscal.hook.mjs.map +1 -0
- package/dist/modules/charges/hooks/refresh-pix.hook.mjs +13 -0
- package/dist/modules/charges/hooks/refresh-pix.hook.mjs.map +1 -0
- package/dist/modules/charges/services/charges.service.mjs +67 -0
- package/dist/modules/charges/services/charges.service.mjs.map +1 -1
- package/dist/modules/charges/types/nota-fiscal.type.mjs +1 -0
- package/dist/modules/charges/types/nota-fiscal.type.mjs.map +1 -0
- package/dist/modules/charges/types/refresh-pix.type.mjs +1 -0
- package/dist/modules/charges/types/refresh-pix.type.mjs.map +1 -0
- package/dist/modules/charges/utils/get-charge-download-url.mjs +8 -0
- package/dist/modules/charges/utils/get-charge-download-url.mjs.map +1 -0
- package/dist/modules/coupons/constants/query-keys.constants.mjs +5 -0
- package/dist/modules/coupons/constants/query-keys.constants.mjs.map +1 -0
- package/dist/modules/coupons/handlers/find-coupon-by-code.handler.mjs +17 -0
- package/dist/modules/coupons/handlers/find-coupon-by-code.handler.mjs.map +1 -0
- package/dist/modules/coupons/handlers/find-coupon-by-id.handler.mjs +16 -0
- package/dist/modules/coupons/handlers/find-coupon-by-id.handler.mjs.map +1 -0
- package/dist/modules/coupons/hooks/use-coupon-by-code.hook.mjs +15 -0
- package/dist/modules/coupons/hooks/use-coupon-by-code.hook.mjs.map +1 -0
- package/dist/modules/coupons/hooks/use-coupon-by-id.hook.mjs +18 -0
- package/dist/modules/coupons/hooks/use-coupon-by-id.hook.mjs.map +1 -0
- package/dist/modules/coupons/services/coupons.service.mjs +44 -0
- package/dist/modules/coupons/services/coupons.service.mjs.map +1 -0
- package/dist/modules/coupons/types/coupon.type.mjs +61 -0
- package/dist/modules/coupons/types/coupon.type.mjs.map +1 -0
- package/dist/modules/coupons/utils/coupon-restrictions.mjs +60 -0
- package/dist/modules/coupons/utils/coupon-restrictions.mjs.map +1 -0
- package/dist/modules/domains/handlers/count-domains.handler.mjs +12 -0
- package/dist/modules/domains/handlers/count-domains.handler.mjs.map +1 -0
- package/dist/modules/domains/hooks/count-domains.hook.mjs +17 -0
- package/dist/modules/domains/hooks/count-domains.hook.mjs.map +1 -0
- package/dist/modules/domains/services/domains.service.mjs +18 -0
- package/dist/modules/domains/services/domains.service.mjs.map +1 -0
- package/dist/modules/ia-credits/handlers/list-ia-credit-operations.handler.mjs +15 -0
- package/dist/modules/ia-credits/handlers/list-ia-credit-operations.handler.mjs.map +1 -0
- package/dist/modules/ia-credits/hooks/ia-credit-operations.hook.mjs +28 -0
- package/dist/modules/ia-credits/hooks/ia-credit-operations.hook.mjs.map +1 -0
- package/dist/modules/ia-credits/services/ia-credits.service.mjs +23 -2
- package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +1 -1
- package/dist/modules/pages/handlers/count-pages.handler.mjs +4 -2
- package/dist/modules/pages/handlers/count-pages.handler.mjs.map +1 -1
- package/dist/modules/pages/hooks/count-published-pages.hook.mjs +26 -0
- package/dist/modules/pages/hooks/count-published-pages.hook.mjs.map +1 -0
- package/dist/modules/pages/services/pages.service.mjs +3 -2
- package/dist/modules/pages/services/pages.service.mjs.map +1 -1
- package/dist/modules/plans/constants/plan-tooltips.constants.mjs +14 -0
- package/dist/modules/plans/constants/plan-tooltips.constants.mjs.map +1 -0
- package/dist/modules/plans/hooks/use-enriched-plans.hook.mjs +28 -0
- package/dist/modules/plans/hooks/use-enriched-plans.hook.mjs.map +1 -0
- package/dist/modules/plans/hooks/use-ui-plans.hook.mjs +20 -0
- package/dist/modules/plans/hooks/use-ui-plans.hook.mjs.map +1 -0
- package/dist/modules/projects/hooks/add-project-users.hook.mjs +25 -0
- package/dist/modules/projects/hooks/add-project-users.hook.mjs.map +1 -0
- package/dist/modules/projects/hooks/list-all-account-users.hook.mjs +3 -6
- package/dist/modules/projects/hooks/list-all-account-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-available-users.hook.mjs +3 -6
- package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-infinite-projects.hook.mjs +3 -6
- package/dist/modules/projects/hooks/list-infinite-projects.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/list-project-users.hook.mjs +3 -6
- package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +1 -1
- package/dist/modules/projects/hooks/remove-project-users.hook.mjs +25 -0
- package/dist/modules/projects/hooks/remove-project-users.hook.mjs.map +1 -0
- package/dist/modules/projects/services/project-users.service.mjs +5 -0
- package/dist/modules/projects/services/project-users.service.mjs.map +1 -1
- package/dist/modules/projects/types.mjs +3 -2
- package/dist/modules/projects/types.mjs.map +1 -1
- package/dist/modules/subscriptions/actions/cancel-subscription.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/cancel-subscription.action.mjs.map +1 -0
- package/dist/modules/subscriptions/actions/create-subscription.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/create-subscription.action.mjs.map +1 -0
- package/dist/modules/subscriptions/actions/find-pending-pix-status.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/find-pending-pix-status.action.mjs.map +1 -0
- package/dist/modules/subscriptions/actions/find-subscription-by-id.action.mjs +10 -0
- package/dist/modules/subscriptions/actions/find-subscription-by-id.action.mjs.map +1 -0
- package/dist/modules/subscriptions/constants/addons.constants.mjs +35 -0
- package/dist/modules/subscriptions/constants/addons.constants.mjs.map +1 -1
- package/dist/modules/subscriptions/constants/downgrade.constants.mjs +25 -0
- package/dist/modules/subscriptions/constants/downgrade.constants.mjs.map +1 -0
- package/dist/modules/subscriptions/constants/subscription.constants.mjs +2 -0
- package/dist/modules/subscriptions/constants/subscription.constants.mjs.map +1 -1
- package/dist/modules/subscriptions/handlers/pending-pix-status.handler.mjs +15 -0
- package/dist/modules/subscriptions/handlers/pending-pix-status.handler.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/cancel-subscription.hook.mjs +25 -0
- package/dist/modules/subscriptions/hooks/cancel-subscription.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/create-subscription.hook.mjs +33 -0
- package/dist/modules/subscriptions/hooks/create-subscription.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/find-subscription-by-id.hook.mjs +18 -0
- package/dist/modules/subscriptions/hooks/find-subscription-by-id.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/hooks/pending-pix-status.hook.mjs +25 -0
- package/dist/modules/subscriptions/hooks/pending-pix-status.hook.mjs.map +1 -0
- package/dist/modules/subscriptions/services/subscriptions.service.mjs +71 -0
- package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +1 -1
- package/dist/modules/subscriptions/types/cancel-subscription.type.mjs +9 -0
- package/dist/modules/subscriptions/types/cancel-subscription.type.mjs.map +1 -0
- package/dist/modules/subscriptions/types/create-subscription.type.mjs +62 -0
- package/dist/modules/subscriptions/types/create-subscription.type.mjs.map +1 -0
- package/dist/modules/subscriptions/types/pending-pix-status.type.mjs +28 -0
- package/dist/modules/subscriptions/types/pending-pix-status.type.mjs.map +1 -0
- package/dist/modules/subscriptions/types/subscription.type.mjs +9 -1
- package/dist/modules/subscriptions/types/subscription.type.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/addon-buckets.mjs +69 -0
- package/dist/modules/subscriptions/utils/addon-buckets.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/confirm-payment-if-required.mjs +8 -2
- package/dist/modules/subscriptions/utils/confirm-payment-if-required.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/first-period-pricing.mjs +25 -0
- package/dist/modules/subscriptions/utils/first-period-pricing.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/is-api-subscription.mjs +8 -0
- package/dist/modules/subscriptions/utils/is-api-subscription.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/is-boleto-payer.mjs +17 -0
- package/dist/modules/subscriptions/utils/is-boleto-payer.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/is-free-subscription.mjs +8 -0
- package/dist/modules/subscriptions/utils/is-free-subscription.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/periodicity.mjs +55 -1
- package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
- package/dist/modules/subscriptions/utils/resolve-subscription-plan-name.mjs +27 -0
- package/dist/modules/subscriptions/utils/resolve-subscription-plan-name.mjs.map +1 -0
- package/dist/modules/users/hooks/messages.hook.mjs +3 -5
- package/dist/modules/users/hooks/messages.hook.mjs.map +1 -1
- package/dist/server.mjs +6 -0
- package/dist/server.mjs.map +1 -1
- package/dist/store/useAccountModals.mjs +9 -2
- package/dist/store/useAccountModals.mjs.map +1 -1
- package/dist/store/useAffiliateFlows.mjs +23 -0
- package/dist/store/useAffiliateFlows.mjs.map +1 -0
- package/dist/store/useProjectFlows.mjs +18 -0
- package/dist/store/useProjectFlows.mjs.map +1 -0
- package/dist/store/useSubscriptionFlows.mjs +58 -0
- package/dist/store/useSubscriptionFlows.mjs.map +1 -0
- package/dist/store/useTeamFlows.mjs +15 -0
- package/dist/store/useTeamFlows.mjs.map +1 -0
- package/dist/testing/factories/coupon.factory.mjs +19 -0
- package/dist/testing/factories/coupon.factory.mjs.map +1 -0
- package/dist/testing/factories/index.mjs +6 -0
- package/dist/testing/factories/index.mjs.map +1 -1
- package/dist/testing/factories/project-user.factory.mjs +17 -0
- package/dist/testing/factories/project-user.factory.mjs.map +1 -0
- package/dist/testing/factories/project.factory.mjs +21 -0
- package/dist/testing/factories/project.factory.mjs.map +1 -0
- package/dist/testing/react/providers.mjs +1 -1
- package/dist/testing/react/providers.mjs.map +1 -1
- package/dist/utils/browser/chart-custom-tooltip.mjs +69 -0
- package/dist/utils/browser/chart-custom-tooltip.mjs.map +1 -0
- package/dist/utils/browser/get-css-variable.mjs +9 -0
- package/dist/utils/browser/get-css-variable.mjs.map +1 -0
- package/dist/utils/constants/scrollbar.mjs +5 -0
- package/dist/utils/constants/scrollbar.mjs.map +1 -0
- package/dist/utils/date-filter-period.mjs +34 -0
- package/dist/utils/date-filter-period.mjs.map +1 -0
- package/dist/utils/file/index.mjs +11 -1
- package/dist/utils/file/index.mjs.map +1 -1
- package/dist/utils/format/initials.mjs +8 -0
- package/dist/utils/format/initials.mjs.map +1 -0
- package/dist/utils/format/masks.mjs +32 -1
- package/dist/utils/format/masks.mjs.map +1 -1
- package/dist/utils/qrcode/to-data-url.mjs +12 -0
- package/dist/utils/qrcode/to-data-url.mjs.map +1 -0
- package/dist/utils/validators/account.mjs +1 -7
- package/dist/utils/validators/account.mjs.map +1 -1
- package/package.json +20 -8
- package/src/components/account/AccountHubLinkHandler.tsx +39 -0
- package/src/components/account/AccountModalLayout.tsx +190 -0
- package/src/components/account/AccountModals.tsx +12 -2
- package/src/components/account/DeleteAccountModal.tsx +1 -1
- package/src/components/account/IsntPossibleDeleteAccountModal.tsx +9 -1
- package/src/components/account/MyAccountModal.tsx +215 -0
- package/src/components/account/TwoFactorAuthModal.tsx +1 -1
- package/src/components/account/hooks/useAccountHubActions.ts +95 -0
- package/src/components/account/hooks/useAddCardWithPaymentSwitch.ts +70 -0
- package/src/components/account/hooks/useAffiliatesActions.tsx +78 -0
- package/src/components/account/hooks/useMyAccountModal.ts +40 -0
- package/src/components/account/hooks/useProjectsActions.ts +44 -0
- package/src/components/account/hooks/useSubscriptionActions.ts +99 -0
- package/src/components/account/hooks/useTeamActions.ts +35 -0
- package/src/components/account/sections/AffiliatesSection.tsx +342 -0
- package/src/components/account/sections/ChangePasswordSection.tsx +6 -10
- package/src/components/account/sections/MyProfileSection.tsx +207 -143
- package/src/components/account/sections/PreferencesSection.tsx +55 -51
- package/src/components/account/sections/ProjectsSection.tsx +110 -0
- package/src/components/account/sections/SecuritySection.tsx +72 -62
- package/src/components/account/sections/SubscriptionSection.tsx +36 -0
- package/src/components/account/sections/TeamSection.tsx +161 -0
- package/src/components/account/sections/TokenSection.tsx +4 -8
- package/src/components/account/sections/affiliates/AffiliateCommissionCard.tsx +83 -0
- package/src/components/account/sections/affiliates/AffiliateFlows.tsx +20 -0
- package/src/components/account/sections/affiliates/AffiliateLeadsSheet.tsx +143 -0
- package/src/components/account/sections/affiliates/AffiliateStatsCard.tsx +56 -0
- package/src/components/account/sections/affiliates/AffiliateStepCard.tsx +20 -0
- package/src/components/account/sections/affiliates/AffiliateTransactionsList.tsx +194 -0
- package/src/components/account/sections/affiliates/NoReceivingAccountModal.tsx +63 -0
- package/src/components/account/sections/affiliates/ReceivingAccountModal.tsx +213 -0
- package/src/components/account/sections/affiliates/RequestWithdrawalSheet.tsx +586 -0
- package/src/components/account/sections/affiliates/ViewAttachmentModal.tsx +47 -0
- package/src/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.tsx +45 -0
- package/src/components/account/sections/affiliates/reports/AffiliatesReportsTab.tsx +44 -0
- package/src/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.ts +148 -0
- package/src/components/account/sections/projects/DeleteProjectModal.tsx +246 -0
- package/src/components/account/sections/projects/ProjectFlows.tsx +16 -0
- package/src/components/account/sections/projects/ProjectMembersStack.tsx +75 -0
- package/src/components/account/sections/projects/ProjectRow.tsx +96 -0
- package/src/components/account/sections/projects/ProjectSheet.tsx +603 -0
- package/src/components/account/sections/projects/ProjectsDisabledModal.tsx +69 -0
- package/src/components/account/sections/projects/project-form.schema.ts +30 -0
- package/src/components/account/sections/shared/ConnectListRow.tsx +68 -0
- package/src/components/account/sections/shared/DateFilterPopover.tsx +58 -0
- package/src/components/account/sections/shared/EntityAvatar.tsx +54 -0
- package/src/components/account/sections/shared/FilterPopover.tsx +79 -0
- package/src/components/account/sections/shared/FormSection.tsx +23 -0
- package/src/components/account/sections/shared/IconBox.tsx +21 -0
- package/src/components/account/sections/shared/InfiniteScrollList.tsx +57 -0
- package/src/components/account/sections/shared/ListPagination.tsx +84 -0
- package/src/components/account/sections/shared/RowActionsMenu.tsx +66 -0
- package/src/components/account/sections/shared/SectionLoadError.tsx +27 -0
- package/src/components/account/sections/shared/StatusBadge.tsx +33 -0
- package/src/components/account/sections/shared/WorkspaceSection.tsx +22 -0
- package/src/components/account/sections/subscription/AiCreditsUsage.tsx +152 -0
- package/src/components/account/sections/subscription/BillingAddressSheet.tsx +460 -0
- package/src/components/account/sections/subscription/BoletoDetailsDialog.tsx +104 -0
- package/src/components/account/sections/subscription/BoletoGeneratedDialog.tsx +24 -0
- package/src/components/account/sections/subscription/CancelPlanDialog.tsx +221 -0
- package/src/components/account/sections/subscription/ChargeRow.tsx +161 -0
- package/src/components/account/sections/subscription/ChargeStatusBadge.tsx +29 -0
- package/src/components/account/sections/subscription/ChargesList.tsx +125 -0
- package/src/components/account/sections/subscription/ManageCardsSheet.tsx +93 -0
- package/src/components/account/sections/subscription/OverdueReceiptOpener.tsx +29 -0
- package/src/components/account/sections/subscription/PayChargeDialog.tsx +306 -0
- package/src/components/account/sections/subscription/PaymentConfirmationDialog.tsx +70 -0
- package/src/components/account/sections/subscription/PaymentMethodsCard.tsx +117 -0
- package/src/components/account/sections/subscription/PendingChangeDialog.tsx +168 -0
- package/src/components/account/sections/subscription/PixDetailsDialog.tsx +246 -0
- package/src/components/account/sections/subscription/PixPaymentDialog.tsx +242 -0
- package/src/components/account/sections/subscription/PlanDetailsSheet.tsx +380 -0
- package/src/components/account/sections/subscription/ReceiptDetailsSheet.tsx +318 -0
- package/src/components/account/sections/subscription/SubscriptionFlows.tsx +40 -0
- package/src/components/account/sections/subscription/SubscriptionPlanCard.tsx +433 -0
- package/src/components/account/sections/subscription/UsageReportSheet.tsx +244 -0
- package/src/components/account/sections/subscription/change-plan/ChangePlanSheet.tsx +95 -0
- package/src/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.tsx +57 -0
- package/src/components/account/sections/subscription/change-plan/components/AddonsBlock.tsx +214 -0
- package/src/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.tsx +92 -0
- package/src/components/account/sections/subscription/change-plan/components/CouponBlock.tsx +42 -0
- package/src/components/account/sections/subscription/change-plan/components/CouponDialog.tsx +134 -0
- package/src/components/account/sections/subscription/change-plan/components/PricePreview.tsx +28 -0
- package/src/components/account/sections/subscription/change-plan/components/SummaryBlock.tsx +194 -0
- package/src/components/account/sections/subscription/change-plan/plan-comparison.ts +52 -0
- package/src/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.tsx +161 -0
- package/src/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.tsx +165 -0
- package/src/components/account/sections/subscription/change-plan/steps/PlanViewStep.tsx +89 -0
- package/src/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.tsx +117 -0
- package/src/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.tsx +139 -0
- package/src/components/account/sections/subscription/change-plan/useChangePlanState.tsx +1158 -0
- package/src/components/account/sections/subscription/downgrade/CannotDowngradeDialog.tsx +297 -0
- package/src/components/account/sections/subscription/downgrade/DowngradeReasonDialog.tsx +154 -0
- package/src/components/account/sections/subscription/plans/PlanCard.tsx +417 -0
- package/src/components/account/sections/subscription/plans/PlanCardSkeleton.tsx +70 -0
- package/src/components/account/sections/subscription/plans/PlansCatalogDialog.tsx +156 -0
- package/src/components/account/sections/team/DeleteUserModal.tsx +134 -0
- package/src/components/account/sections/team/TeamFlows.tsx +14 -0
- package/src/components/account/sections/team/TeamMemberRow.tsx +151 -0
- package/src/components/account/sections/team/UserSheet.tsx +688 -0
- package/src/components/account/sections/team/steps/NotificationsStep.tsx +109 -0
- package/src/components/account/sections/team/steps/ProjectSelectionStep.tsx +219 -0
- package/src/components/account/sections/team/steps/UserInformationStep.tsx +423 -0
- package/src/components/account/sections/team/user-form.schema.ts +43 -0
- package/src/components/account/types/workspace-actions.type.ts +56 -0
- package/src/components/layouts/ProfilePopover.tsx +11 -12
- package/src/components/layouts/UsersSelectorPopover.tsx +7 -4
- package/src/components/modals/AccountDeletionWarningModal.tsx +4 -5
- package/src/components/modals/AccountFrozenModal.tsx +6 -3
- package/src/components/modals/Modals.tsx +6 -3
- package/src/components/modals/PaidPlanRequiredModal.tsx +4 -5
- package/src/components/modals/cards/AddFirstCardWarningModal.tsx +72 -0
- package/src/components/modals/cards/SwitchPaymentToCardModal.tsx +232 -0
- package/src/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.tsx +5 -4
- package/src/components/ui/data-display/CardItem.tsx +9 -5
- package/src/components/ui/data-display/PaymentMethodIcons.tsx +43 -0
- package/src/components/ui/form/BillingPeriodSelector.tsx +173 -0
- package/src/components/ui/form/PaymentMethodToggle.tsx +119 -0
- package/src/components/ui/form/RadioOptionFieldIcon.tsx +64 -0
- package/src/components/ui/form/SegmentedControl.tsx +77 -0
- package/src/components/ui/overlay/Dialog.tsx +70 -33
- package/src/components/ui/overlay/Sheet.tsx +89 -56
- package/src/components/ui/overlay/layers.tsx +114 -27
- package/src/enums/AccountHubFlow.ts +8 -0
- package/src/enums/DateFilterPeriod.ts +17 -0
- package/src/enums/WorkspaceSectionType.ts +6 -0
- package/src/handlers.ts +14 -0
- package/src/hooks/useDebounce.ts +5 -3
- package/src/hooks/useUploadProgress.ts +42 -0
- package/src/i18n/messages/en-us.ts +904 -2
- package/src/i18n/messages/es-es.ts +908 -2
- package/src/i18n/messages/pt-br.ts +908 -2
- package/src/index.ts +56 -1
- package/src/infra/http/paged.ts +24 -0
- package/src/middleware.ts +1 -0
- package/src/middlewares/create-auth-middleware.ts +1 -4
- package/src/middlewares/create-legacy-account-routes-middleware.ts +54 -0
- package/src/middlewares/is-route-equals.ts +3 -0
- package/src/modules/accounts/actions/account-management.action.ts +22 -1
- package/src/modules/accounts/constants/account-hub-link.constants.ts +3 -0
- package/src/modules/accounts/constants/legacy-account-routes.constants.ts +1 -0
- package/src/modules/accounts/handlers/list-account-members.handler.ts +23 -0
- package/src/modules/accounts/hooks/add-user-projects.hook.ts +72 -0
- package/src/modules/accounts/hooks/create-account-user.hook.ts +21 -0
- package/src/modules/accounts/hooks/remove-user-projects.hook.ts +68 -0
- package/src/modules/accounts/hooks/use-account-members.hook.ts +31 -0
- package/src/modules/accounts/services/account.service.ts +71 -0
- package/src/modules/accounts/types/account-hub-link.type.ts +13 -0
- package/src/modules/accounts/types.ts +9 -0
- package/src/modules/accounts/utils/build-account-hub-url.ts +14 -0
- package/src/modules/accounts/utils/is-account-hub-flow.ts +7 -0
- package/src/modules/accounts/utils/is-account-section.ts +7 -0
- package/src/modules/accounts/utils/is-my-account-section.ts +12 -0
- package/src/modules/accounts/utils/map-legacy-account-route.ts +108 -0
- package/src/modules/accounts/utils/parse-account-hub-link.ts +21 -0
- package/src/modules/affiliates/actions/ensure-affiliate.action.ts +9 -0
- package/src/modules/affiliates/actions/request-deposit.action.ts +9 -0
- package/src/modules/affiliates/actions/update-affiliate.action.ts +9 -0
- package/src/modules/affiliates/constants/affiliate.constants.ts +11 -0
- package/src/modules/affiliates/constants/query-keys.constants.ts +7 -0
- package/src/modules/affiliates/handlers/affiliate-report-analytics.handler.ts +16 -0
- package/src/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.ts +10 -0
- package/src/modules/affiliates/handlers/current-affiliate.handler.ts +10 -0
- package/src/modules/affiliates/handlers/list-affiliate-coupons.handler.ts +10 -0
- package/src/modules/affiliates/handlers/list-affiliate-leads.handler.ts +23 -0
- package/src/modules/affiliates/handlers/list-affiliate-transactions.handler.ts +23 -0
- package/src/modules/affiliates/hooks/use-affiliate-coupons.hook.ts +19 -0
- package/src/modules/affiliates/hooks/use-affiliate-leads.hook.ts +27 -0
- package/src/modules/affiliates/hooks/use-affiliate-report-analytics.hook.ts +19 -0
- package/src/modules/affiliates/hooks/use-affiliate-transactions.hook.ts +25 -0
- package/src/modules/affiliates/hooks/use-current-affiliate.hook.ts +19 -0
- package/src/modules/affiliates/hooks/use-ensure-affiliate.hook.ts +24 -0
- package/src/modules/affiliates/hooks/use-request-deposit.hook.ts +29 -0
- package/src/modules/affiliates/hooks/use-update-affiliate.hook.ts +24 -0
- package/src/modules/affiliates/hooks/use-withdrawal-limits.hook.ts +20 -0
- package/src/modules/affiliates/services/affiliates.service.ts +240 -0
- package/src/modules/affiliates/types/affiliate.type.ts +180 -0
- package/src/modules/affiliates/utils/get-affiliate-share-link.ts +8 -0
- package/src/modules/charges/actions/get-nota-fiscal.action.ts +8 -0
- package/src/modules/charges/actions/refresh-pix.action.ts +8 -0
- package/src/modules/charges/hooks/nota-fiscal.hook.ts +13 -0
- package/src/modules/charges/hooks/refresh-pix.hook.ts +13 -0
- package/src/modules/charges/services/charges.service.ts +121 -0
- package/src/modules/charges/types/nota-fiscal.type.ts +20 -0
- package/src/modules/charges/types/refresh-pix.type.ts +14 -0
- package/src/modules/charges/utils/get-charge-download-url.ts +10 -0
- package/src/modules/coupons/constants/query-keys.constants.ts +1 -0
- package/src/modules/coupons/handlers/find-coupon-by-code.handler.ts +16 -0
- package/src/modules/coupons/handlers/find-coupon-by-id.handler.ts +15 -0
- package/src/modules/coupons/hooks/use-coupon-by-code.hook.ts +16 -0
- package/src/modules/coupons/hooks/use-coupon-by-id.hook.ts +20 -0
- package/src/modules/coupons/services/coupons.service.ts +54 -0
- package/src/modules/coupons/types/coupon.type.ts +70 -0
- package/src/modules/coupons/utils/coupon-restrictions.ts +112 -0
- package/src/modules/domains/handlers/count-domains.handler.ts +10 -0
- package/src/modules/domains/hooks/count-domains.hook.ts +17 -0
- package/src/modules/domains/services/domains.service.ts +18 -0
- package/src/modules/ia-credits/handlers/list-ia-credit-operations.handler.ts +14 -0
- package/src/modules/ia-credits/hooks/ia-credit-operations.hook.ts +33 -0
- package/src/modules/ia-credits/services/ia-credits.service.ts +32 -1
- package/src/modules/pages/handlers/count-pages.handler.ts +5 -2
- package/src/modules/pages/hooks/count-published-pages.hook.ts +26 -0
- package/src/modules/pages/services/pages.service.ts +3 -2
- package/src/modules/plans/constants/plan-tooltips.constants.ts +16 -0
- package/src/modules/plans/hooks/use-enriched-plans.hook.ts +31 -0
- package/src/modules/plans/hooks/use-ui-plans.hook.ts +22 -0
- package/src/modules/projects/hooks/add-project-users.hook.ts +29 -0
- package/src/modules/projects/hooks/list-all-account-users.hook.ts +3 -6
- package/src/modules/projects/hooks/list-available-users.hook.ts +3 -6
- package/src/modules/projects/hooks/list-infinite-projects.hook.ts +3 -6
- package/src/modules/projects/hooks/list-project-users.hook.ts +3 -6
- package/src/modules/projects/hooks/remove-project-users.hook.ts +29 -0
- package/src/modules/projects/services/project-users.service.ts +135 -130
- package/src/modules/projects/types.ts +89 -88
- package/src/modules/subscriptions/actions/cancel-subscription.action.ts +12 -0
- package/src/modules/subscriptions/actions/create-subscription.action.ts +9 -0
- package/src/modules/subscriptions/actions/find-pending-pix-status.action.ts +8 -0
- package/src/modules/subscriptions/actions/find-subscription-by-id.action.ts +8 -0
- package/src/modules/subscriptions/constants/addons.constants.ts +50 -0
- package/src/modules/subscriptions/constants/downgrade.constants.ts +30 -0
- package/src/modules/subscriptions/constants/subscription.constants.ts +3 -0
- package/src/modules/subscriptions/handlers/pending-pix-status.handler.ts +17 -0
- package/src/modules/subscriptions/hooks/cancel-subscription.hook.ts +28 -0
- package/src/modules/subscriptions/hooks/create-subscription.hook.ts +34 -0
- package/src/modules/subscriptions/hooks/find-subscription-by-id.hook.ts +17 -0
- package/src/modules/subscriptions/hooks/pending-pix-status.hook.ts +30 -0
- package/src/modules/subscriptions/services/subscriptions.service.ts +401 -301
- package/src/modules/subscriptions/types/cancel-subscription.type.ts +8 -0
- package/src/modules/subscriptions/types/create-subscription.type.ts +79 -0
- package/src/modules/subscriptions/types/pending-pix-status.type.ts +33 -0
- package/src/modules/subscriptions/types/subscription.type.ts +157 -147
- package/src/modules/subscriptions/utils/addon-buckets.ts +129 -0
- package/src/modules/subscriptions/utils/confirm-payment-if-required.ts +9 -2
- package/src/modules/subscriptions/utils/first-period-pricing.ts +63 -0
- package/src/modules/subscriptions/utils/is-api-subscription.ts +6 -0
- package/src/modules/subscriptions/utils/is-boleto-payer.ts +21 -0
- package/src/modules/subscriptions/utils/is-free-subscription.ts +6 -0
- package/src/modules/subscriptions/utils/periodicity.ts +101 -0
- package/src/modules/subscriptions/utils/resolve-subscription-plan-name.ts +44 -0
- package/src/modules/users/hooks/messages.hook.ts +3 -5
- package/src/server.ts +102 -99
- package/src/store/useAccountModals.ts +22 -5
- package/src/store/useAffiliateFlows.ts +46 -0
- package/src/store/useProjectFlows.ts +42 -0
- package/src/store/useSubscriptionFlows.ts +176 -0
- package/src/store/useTeamFlows.ts +34 -0
- package/src/testing/factories/coupon.factory.ts +17 -0
- package/src/testing/factories/index.ts +3 -0
- package/src/testing/factories/project-user.factory.ts +15 -0
- package/src/testing/factories/project.factory.ts +19 -0
- package/src/testing/react/providers.tsx +2 -1
- package/src/utils/browser/chart-custom-tooltip.ts +85 -0
- package/src/utils/browser/get-css-variable.ts +6 -0
- package/src/utils/constants/scrollbar.ts +10 -0
- package/src/utils/date-filter-period.ts +34 -0
- package/src/utils/file/index.ts +13 -0
- package/src/utils/format/initials.ts +10 -0
- package/src/utils/format/masks.ts +41 -0
- package/src/utils/qrcode/to-data-url.ts +23 -0
- package/src/utils/validators/account.ts +0 -8
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +0 -143
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +0 -1
- package/dist/components/account/hooks/useConfigurationsModal.mjs +0 -34
- package/dist/components/account/hooks/useConfigurationsModal.mjs.map +0 -1
- package/src/components/account/ConfigurationsMyAccountModal.tsx +0 -179
- package/src/components/account/hooks/useConfigurationsModal.ts +0 -45
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { Controller, useForm } from "react-hook-form";
|
|
5
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
6
|
+
import { IconAlertTriangle, IconInfoCircle, IconPencil, IconUpload, IconX } from "@tabler/icons-react";
|
|
7
|
+
import { useTranslations } from "next-intl";
|
|
8
|
+
import { toast } from "sonner";
|
|
9
|
+
import z from "zod";
|
|
10
|
+
import { Button } from "../../../ui/buttons/Button";
|
|
11
|
+
import { Separator } from "../../../ui/data-display/Separator";
|
|
12
|
+
import { Toast } from "../../../ui/feedback/Toast";
|
|
13
|
+
import { FormField } from "../../../ui/form/FormField";
|
|
14
|
+
import { Dialog, DialogContent } from "../../../ui/overlay/Dialog";
|
|
15
|
+
import { Sheet, SheetContent, SheetFooter, SheetHeader, SheetTitle } from "../../../ui/overlay/Sheet";
|
|
16
|
+
import { useCurrentAffiliate } from "../../../../modules/affiliates/hooks/use-current-affiliate.hook";
|
|
17
|
+
import { useRequestDeposit } from "../../../../modules/affiliates/hooks/use-request-deposit.hook";
|
|
18
|
+
import { useWithdrawalLimits } from "../../../../modules/affiliates/hooks/use-withdrawal-limits.hook";
|
|
19
|
+
import { AFFILIATE_FINANCE_EMAIL } from "../../../../modules/affiliates/constants/affiliate.constants";
|
|
20
|
+
import {
|
|
21
|
+
formatCurrency,
|
|
22
|
+
formatCurrencyNumber,
|
|
23
|
+
parseCurrencyToNumber
|
|
24
|
+
} from "../../../../utils/format/currency";
|
|
25
|
+
import { formatDocument, formatPixKey } from "../../../../utils/format/masks";
|
|
26
|
+
import { formatFileSize, isPDFFile } from "../../../../utils/file/index";
|
|
27
|
+
import { useUploadProgress } from "../../../../hooks/useUploadProgress";
|
|
28
|
+
import useIsMobile from "../../../../hooks/useIsMobile";
|
|
29
|
+
import { useIsDefaultWhitelabel } from "../../../../providers/whitelabel.provider";
|
|
30
|
+
import { cn } from "../../../../infra/utils/clsx";
|
|
31
|
+
import { useAffiliateFlows } from "../../../../store/useAffiliateFlows";
|
|
32
|
+
const MIN_WITHDRAWAL = 25;
|
|
33
|
+
const toCents = (value) => Math.round(value * 100);
|
|
34
|
+
function readFileAsBase64DataUrl(file) {
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
const reader = new FileReader();
|
|
37
|
+
reader.onload = () => resolve(reader.result);
|
|
38
|
+
reader.onerror = () => reject(new Error("read-file-failed"));
|
|
39
|
+
reader.readAsDataURL(file);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function buildWithdrawalSchema(maxAvailable, minWithdrawal, messages) {
|
|
43
|
+
return z.object({
|
|
44
|
+
value: z.string().min(1, messages.required).refine((value) => parseCurrencyToNumber(value) >= minWithdrawal, { message: messages.minValue }).refine((value) => toCents(parseCurrencyToNumber(value)) <= toCents(maxAvailable), {
|
|
45
|
+
message: messages.maxBalance
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function PdfFileIcon() {
|
|
50
|
+
return /* @__PURE__ */ jsxs("svg", { width: "24", height: "27", viewBox: "0 0 24 27", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
"path",
|
|
53
|
+
{
|
|
54
|
+
d: "M14.5 1H4.5A2.5 2.5 0 0 0 2 3.5v20A2.5 2.5 0 0 0 4.5 26h15a2.5 2.5 0 0 0 2.5-2.5V8.5L14.5 1Z",
|
|
55
|
+
fill: "#fff",
|
|
56
|
+
stroke: "#D4D4D8",
|
|
57
|
+
strokeWidth: "1.5",
|
|
58
|
+
strokeLinejoin: "round"
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ jsx("path", { d: "M14 1.5V8.5h7", stroke: "#D4D4D8", strokeWidth: "1.5", strokeLinejoin: "round" }),
|
|
62
|
+
/* @__PURE__ */ jsx("rect", { x: "4", y: "13", width: "16", height: "9", rx: "2", fill: "#E11D48" }),
|
|
63
|
+
/* @__PURE__ */ jsx("text", { x: "12", y: "19.5", textAnchor: "middle", fill: "#fff", fontSize: "6", fontWeight: "700", fontFamily: "sans-serif", children: "PDF" })
|
|
64
|
+
] });
|
|
65
|
+
}
|
|
66
|
+
function UploadedPdfFile({ file, onRemove }) {
|
|
67
|
+
const translateSheet = useTranslations("common.account.workspace.affiliates.withdrawal");
|
|
68
|
+
const { progress } = useUploadProgress({ interval: 80, increment: 10 });
|
|
69
|
+
const fileNameWithoutExtension = file.name.replace(/\.[^/.]+$/, "");
|
|
70
|
+
const fileExtension = file.name.split(".").pop()?.toUpperCase() || "";
|
|
71
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 bg-[#f8f8f7] rounded-lg", children: [
|
|
72
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
73
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center size-12.5 shrink-0 bg-white border border-zinc-200 rounded-lg", children: /* @__PURE__ */ jsx(PdfFileIcon, {}) }),
|
|
74
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5 min-w-0 flex-1", children: [
|
|
75
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-medium text-zinc-950 truncate", children: fileNameWithoutExtension }),
|
|
76
|
+
/* @__PURE__ */ jsxs("span", { className: "paragraph-xsmall-medium text-zinc-500", children: [
|
|
77
|
+
".",
|
|
78
|
+
fileExtension,
|
|
79
|
+
" ",
|
|
80
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-500/40", children: "\u2022" }),
|
|
81
|
+
" ",
|
|
82
|
+
formatFileSize(file.size)
|
|
83
|
+
] })
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ jsx(
|
|
86
|
+
"button",
|
|
87
|
+
{
|
|
88
|
+
type: "button",
|
|
89
|
+
onClick: onRemove,
|
|
90
|
+
className: "flex items-center justify-center size-8 shrink-0 rounded-lg hover:bg-zinc-100 hover:cursor-pointer transition-colors",
|
|
91
|
+
"aria-label": translateSheet("removeAttachmentAriaLabel"),
|
|
92
|
+
children: /* @__PURE__ */ jsx(IconX, { size: 18, className: "text-zinc-500" })
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
] }),
|
|
96
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
97
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 h-1.5 bg-white rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
className: "bg-zinc-950 h-full rounded-full transition-all duration-100",
|
|
101
|
+
style: { width: `${progress}%` }
|
|
102
|
+
}
|
|
103
|
+
) }),
|
|
104
|
+
/* @__PURE__ */ jsxs("span", { className: "paragraph-xsmall-medium text-zinc-500 shrink-0", children: [
|
|
105
|
+
progress,
|
|
106
|
+
"%"
|
|
107
|
+
] })
|
|
108
|
+
] })
|
|
109
|
+
] });
|
|
110
|
+
}
|
|
111
|
+
function RequestWithdrawalSheet() {
|
|
112
|
+
const translate = useTranslations();
|
|
113
|
+
const translateSheet = useTranslations("common.account.workspace.affiliates.withdrawal");
|
|
114
|
+
const isMobile = useIsMobile();
|
|
115
|
+
const isDefaultWhitelabel = useIsDefaultWhitelabel();
|
|
116
|
+
const isOpen = useAffiliateFlows((state) => state.isWithdrawalOpen);
|
|
117
|
+
const close = useAffiliateFlows((state) => state.closeWithdrawal);
|
|
118
|
+
const openReceivingAccount = useAffiliateFlows((state) => state.openReceivingAccount);
|
|
119
|
+
const { data: affiliateData } = useCurrentAffiliate();
|
|
120
|
+
const affiliate = affiliateData?.data;
|
|
121
|
+
const { data: limitsData } = useWithdrawalLimits({ enabled: isOpen && !!affiliate });
|
|
122
|
+
const limits = limitsData?.data;
|
|
123
|
+
const requestDeposit = useRequestDeposit();
|
|
124
|
+
const balance = Number(affiliate?.balance ?? 0);
|
|
125
|
+
const availableToWithdraw = limits?.availableToWithdraw ?? balance;
|
|
126
|
+
const minWithdrawal = limits?.minValue ?? MIN_WITHDRAWAL;
|
|
127
|
+
const requiresInvoice = limits?.requiresInvoice ?? false;
|
|
128
|
+
const hasReceivingAccount = !!(affiliate?.pix && affiliate?.holder_name && affiliate?.holder_document);
|
|
129
|
+
const minValueLabel = minWithdrawal.toFixed(2).replace(".", ",");
|
|
130
|
+
const withdrawalSchema = useMemo(
|
|
131
|
+
() => buildWithdrawalSchema(availableToWithdraw, minWithdrawal, {
|
|
132
|
+
required: translateSheet("validationRequired"),
|
|
133
|
+
minValue: translateSheet("validationMinValue", { minValue: minValueLabel }),
|
|
134
|
+
maxBalance: translateSheet("validationMaxBalance", {
|
|
135
|
+
balance: formatCurrencyNumber(availableToWithdraw)
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
138
|
+
[availableToWithdraw, minWithdrawal, minValueLabel, translateSheet]
|
|
139
|
+
);
|
|
140
|
+
const form = useForm({
|
|
141
|
+
resolver: zodResolver(withdrawalSchema),
|
|
142
|
+
defaultValues: { value: "" }
|
|
143
|
+
});
|
|
144
|
+
const watchedValue = form.watch("value");
|
|
145
|
+
const withdrawalAmount = parseCurrencyToNumber(watchedValue || "") || 0;
|
|
146
|
+
const fileInputRef = useRef(null);
|
|
147
|
+
const [showUploadArea, setShowUploadArea] = useState(false);
|
|
148
|
+
const [attachmentFile, setAttachmentFile] = useState(null);
|
|
149
|
+
const [attachmentBase64, setAttachmentBase64] = useState(null);
|
|
150
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
151
|
+
const [showConfirmDialog, setShowConfirmDialog] = useState(false);
|
|
152
|
+
const [pendingWithdrawalValue, setPendingWithdrawalValue] = useState(null);
|
|
153
|
+
const handlePdfFile = useCallback(
|
|
154
|
+
async (file) => {
|
|
155
|
+
if (!isPDFFile(file)) {
|
|
156
|
+
toast.custom((toastId) => /* @__PURE__ */ jsx(Toast, { variant: "error", message: translateSheet("errorPdfOnly"), toastId }));
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
setAttachmentFile(file);
|
|
160
|
+
setAttachmentBase64(await readFileAsBase64DataUrl(file));
|
|
161
|
+
},
|
|
162
|
+
[translateSheet]
|
|
163
|
+
);
|
|
164
|
+
const handleFileInputChange = useCallback(
|
|
165
|
+
(event) => {
|
|
166
|
+
const file = event.target.files?.[0];
|
|
167
|
+
if (file) handlePdfFile(file);
|
|
168
|
+
event.target.value = "";
|
|
169
|
+
},
|
|
170
|
+
[handlePdfFile]
|
|
171
|
+
);
|
|
172
|
+
const handleDrop = useCallback(
|
|
173
|
+
(event) => {
|
|
174
|
+
event.preventDefault();
|
|
175
|
+
setIsDragging(false);
|
|
176
|
+
const file = event.dataTransfer.files?.[0];
|
|
177
|
+
if (file) handlePdfFile(file);
|
|
178
|
+
},
|
|
179
|
+
[handlePdfFile]
|
|
180
|
+
);
|
|
181
|
+
const handleRemoveAttachment = useCallback(() => {
|
|
182
|
+
setAttachmentFile(null);
|
|
183
|
+
setAttachmentBase64(null);
|
|
184
|
+
}, []);
|
|
185
|
+
const handleClose = () => {
|
|
186
|
+
form.reset({ value: "" });
|
|
187
|
+
setShowUploadArea(false);
|
|
188
|
+
handleRemoveAttachment();
|
|
189
|
+
setShowConfirmDialog(false);
|
|
190
|
+
setPendingWithdrawalValue(null);
|
|
191
|
+
close();
|
|
192
|
+
};
|
|
193
|
+
const executeWithdrawal = async (value, attachment) => {
|
|
194
|
+
if (!affiliate) return;
|
|
195
|
+
try {
|
|
196
|
+
const result = await requestDeposit.mutateAsync({
|
|
197
|
+
value: parseCurrencyToNumber(value),
|
|
198
|
+
...attachment ? { attachment } : {}
|
|
199
|
+
});
|
|
200
|
+
toast.custom((toastId) => /* @__PURE__ */ jsx(Toast, { variant: "success", message: result.message, toastId }));
|
|
201
|
+
handleClose();
|
|
202
|
+
} catch (error) {
|
|
203
|
+
const message = error instanceof Error ? error.message : translateSheet("errorRequestDeposit");
|
|
204
|
+
toast.custom((toastId) => /* @__PURE__ */ jsx(Toast, { variant: "error", message, toastId }));
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
const handleConfirmWithdrawal = async () => {
|
|
208
|
+
if (pendingWithdrawalValue === null) return;
|
|
209
|
+
setShowConfirmDialog(false);
|
|
210
|
+
await executeWithdrawal(pendingWithdrawalValue, attachmentBase64);
|
|
211
|
+
setPendingWithdrawalValue(null);
|
|
212
|
+
};
|
|
213
|
+
const infoBoxClasses = cn(
|
|
214
|
+
"flex items-center gap-3 text-zinc-950 rounded-lg p-4",
|
|
215
|
+
isDefaultWhitelabel ? "bg-cyan-50" : "bg-zinc-50"
|
|
216
|
+
);
|
|
217
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
218
|
+
/* @__PURE__ */ jsx(Sheet, { open: isOpen, onOpenChange: (nextOpen) => !nextOpen && handleClose(), children: /* @__PURE__ */ jsxs(
|
|
219
|
+
SheetContent,
|
|
220
|
+
{
|
|
221
|
+
side: isMobile ? "bottom" : "right",
|
|
222
|
+
className: cn(
|
|
223
|
+
isMobile ? "h-dvh w-full max-w-full rounded-none pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]" : "h-screen max-w-[480px]! w-[480px]!",
|
|
224
|
+
"data-[state=open]:max-h-none data-[state=open]:h-dvh"
|
|
225
|
+
),
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ jsx(SheetHeader, { className: "border-b border-zinc-200", children: /* @__PURE__ */ jsx(SheetTitle, { className: "text-zinc-950 paragraph-medium-semibold", children: translateSheet("sheetTitle") }) }),
|
|
228
|
+
/* @__PURE__ */ jsxs(
|
|
229
|
+
"form",
|
|
230
|
+
{
|
|
231
|
+
onSubmit: form.handleSubmit((data) => {
|
|
232
|
+
setPendingWithdrawalValue(data.value);
|
|
233
|
+
setShowConfirmDialog(true);
|
|
234
|
+
}),
|
|
235
|
+
className: "flex flex-col flex-1 overflow-hidden",
|
|
236
|
+
children: [
|
|
237
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 px-5 py-5 overflow-y-auto [scrollbar-width:auto] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-zinc-300 flex-1", children: [
|
|
238
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
239
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-500 paragraph-small-semibold", children: translateSheet("availableBalance") }),
|
|
240
|
+
/* @__PURE__ */ jsx("span", { className: "text-green-600 paragraph-medium-semibold", children: formatCurrencyNumber(balance) })
|
|
241
|
+
] }),
|
|
242
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
243
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
244
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
245
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-zinc-600", children: translateSheet("receivingAccount") }),
|
|
246
|
+
/* @__PURE__ */ jsxs(Button, { variant: "secondary", className: "h-8!", type: "button", onClick: openReceivingAccount, children: [
|
|
247
|
+
/* @__PURE__ */ jsx(IconPencil, {}),
|
|
248
|
+
translate("common.actions.edit")
|
|
249
|
+
] })
|
|
250
|
+
] }),
|
|
251
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col rounded-lg bg-zinc-50 p-4 gap-4", children: [
|
|
252
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
253
|
+
/* @__PURE__ */ jsx("span", { className: "w-40 text-zinc-950 paragraph-small-medium", children: translateSheet("holderLabel") }),
|
|
254
|
+
/* @__PURE__ */ jsx("span", { className: "w-full text-zinc-600 paragraph-small-regular", children: affiliate?.holder_name ?? "\u2014" })
|
|
255
|
+
] }),
|
|
256
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
257
|
+
/* @__PURE__ */ jsx("span", { className: "w-40 text-zinc-950 paragraph-small-medium", children: translateSheet("pixKeyLabel") }),
|
|
258
|
+
/* @__PURE__ */ jsx("span", { className: "w-full text-zinc-600 paragraph-small-regular truncate", children: affiliate?.pix ? formatPixKey(affiliate.pix) : "\u2014" })
|
|
259
|
+
] }),
|
|
260
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
261
|
+
/* @__PURE__ */ jsx("span", { className: "w-40 text-zinc-950 paragraph-small-medium", children: translateSheet("holderDocumentLabel") }),
|
|
262
|
+
/* @__PURE__ */ jsx("span", { className: "w-full text-zinc-600 paragraph-small-regular truncate", children: affiliate?.holder_document ? formatDocument(affiliate.holder_document) : "\u2014" })
|
|
263
|
+
] })
|
|
264
|
+
] })
|
|
265
|
+
] }),
|
|
266
|
+
limits && !limits.canWithdraw ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 bg-zinc-50 rounded-lg p-4", children: [
|
|
267
|
+
/* @__PURE__ */ jsx("div", { className: "size-8 bg-white rounded-lg shadow-[0px_2px_10px_0px_rgba(26,26,26,0.05)] flex items-center justify-center", children: /* @__PURE__ */ jsx(IconAlertTriangle, { size: 18, className: "text-amber-500" }) }),
|
|
268
|
+
/* @__PURE__ */ jsx("p", { className: "paragraph-small-medium text-zinc-950", children: translateSheet("blockedTitle") }),
|
|
269
|
+
/* @__PURE__ */ jsx("p", { className: "paragraph-small-regular text-zinc-600", children: translateSheet("blockedDescription") }),
|
|
270
|
+
/* @__PURE__ */ jsx(
|
|
271
|
+
Button,
|
|
272
|
+
{
|
|
273
|
+
variant: "secondary",
|
|
274
|
+
className: "h-10! w-fit",
|
|
275
|
+
type: "button",
|
|
276
|
+
onClick: openReceivingAccount,
|
|
277
|
+
children: translateSheet("blockedEditAccountButton")
|
|
278
|
+
}
|
|
279
|
+
)
|
|
280
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
281
|
+
/* @__PURE__ */ jsx(
|
|
282
|
+
Controller,
|
|
283
|
+
{
|
|
284
|
+
name: "value",
|
|
285
|
+
control: form.control,
|
|
286
|
+
render: ({ field, fieldState }) => /* @__PURE__ */ jsx(
|
|
287
|
+
FormField,
|
|
288
|
+
{
|
|
289
|
+
required: true,
|
|
290
|
+
label: translateSheet("withdrawalValueLabel"),
|
|
291
|
+
placeholder: translateSheet("withdrawalValuePlaceholder"),
|
|
292
|
+
inputMode: "numeric",
|
|
293
|
+
hintMessage: translateSheet("withdrawalValueHint", { minValue: minValueLabel }),
|
|
294
|
+
value: field.value,
|
|
295
|
+
onChange: (event) => {
|
|
296
|
+
const raw = event.target.value.replace(/\D/g, "");
|
|
297
|
+
if (!raw) return field.onChange("");
|
|
298
|
+
field.onChange(formatCurrency(raw));
|
|
299
|
+
},
|
|
300
|
+
error: !!fieldState.error,
|
|
301
|
+
errorMessage: fieldState.error?.message
|
|
302
|
+
}
|
|
303
|
+
)
|
|
304
|
+
}
|
|
305
|
+
),
|
|
306
|
+
limits?.personType === "cpf" && /* @__PURE__ */ jsxs("div", { className: infoBoxClasses, children: [
|
|
307
|
+
/* @__PURE__ */ jsx(IconInfoCircle, { size: 16, className: "shrink-0" }),
|
|
308
|
+
/* @__PURE__ */ jsxs("span", { className: "paragraph-small-semibold", children: [
|
|
309
|
+
translateSheet("cpfMonthlyLimit", {
|
|
310
|
+
value: formatCurrencyNumber(limits.maxValuePerMonth ?? 0)
|
|
311
|
+
}),
|
|
312
|
+
" ",
|
|
313
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-600 paragraph-small-regular", children: translateSheet("cpfMonthlyRemaining", {
|
|
314
|
+
value: formatCurrencyNumber(limits.monthlyRemaining ?? 0)
|
|
315
|
+
}) })
|
|
316
|
+
] })
|
|
317
|
+
] }),
|
|
318
|
+
limits?.personType === "cnpj" && requiresInvoice && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 bg-zinc-50 rounded-lg p-4", children: [
|
|
319
|
+
/* @__PURE__ */ jsx("div", { className: "size-8 bg-white rounded-lg shadow-[0px_2px_10px_0px_rgba(26,26,26,0.05)] flex items-center justify-center", children: /* @__PURE__ */ jsx(IconAlertTriangle, { size: 18, className: "text-amber-500" }) }),
|
|
320
|
+
/* @__PURE__ */ jsx("p", { className: "paragraph-small-medium text-zinc-950", children: translateSheet("invoiceWarningCnpj") }),
|
|
321
|
+
!showUploadArea && !attachmentFile && /* @__PURE__ */ jsxs(
|
|
322
|
+
Button,
|
|
323
|
+
{
|
|
324
|
+
variant: "secondary",
|
|
325
|
+
className: "h-10! w-fit",
|
|
326
|
+
type: "button",
|
|
327
|
+
onClick: () => setShowUploadArea(true),
|
|
328
|
+
children: [
|
|
329
|
+
translateSheet("attachInvoiceButton"),
|
|
330
|
+
/* @__PURE__ */ jsx(IconUpload, { size: 20 })
|
|
331
|
+
]
|
|
332
|
+
}
|
|
333
|
+
),
|
|
334
|
+
/* @__PURE__ */ jsx(
|
|
335
|
+
"input",
|
|
336
|
+
{
|
|
337
|
+
ref: fileInputRef,
|
|
338
|
+
type: "file",
|
|
339
|
+
accept: "application/pdf",
|
|
340
|
+
className: "hidden",
|
|
341
|
+
onChange: handleFileInputChange
|
|
342
|
+
}
|
|
343
|
+
),
|
|
344
|
+
showUploadArea && !attachmentFile && /* @__PURE__ */ jsxs(
|
|
345
|
+
"div",
|
|
346
|
+
{
|
|
347
|
+
role: "button",
|
|
348
|
+
tabIndex: 0,
|
|
349
|
+
onClick: () => fileInputRef.current?.click(),
|
|
350
|
+
onKeyDown: (event) => event.key === "Enter" && fileInputRef.current?.click(),
|
|
351
|
+
onDragOver: (event) => {
|
|
352
|
+
event.preventDefault();
|
|
353
|
+
setIsDragging(true);
|
|
354
|
+
},
|
|
355
|
+
onDragLeave: (event) => {
|
|
356
|
+
event.preventDefault();
|
|
357
|
+
setIsDragging(false);
|
|
358
|
+
},
|
|
359
|
+
onDrop: handleDrop,
|
|
360
|
+
className: cn(
|
|
361
|
+
"flex flex-col items-center justify-center gap-3.5 p-14 border-2 border-dashed rounded-lg cursor-pointer transition-colors hover:border-zinc-400",
|
|
362
|
+
isDragging ? "border-zinc-400 bg-zinc-100" : "border-zinc-200 bg-white"
|
|
363
|
+
),
|
|
364
|
+
children: [
|
|
365
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center size-14 bg-zinc-100 rounded-lg", children: /* @__PURE__ */ jsx(IconUpload, { size: 24, className: "text-zinc-600" }) }),
|
|
366
|
+
/* @__PURE__ */ jsxs("p", { className: "paragraph-small-regular text-zinc-500 text-center", children: [
|
|
367
|
+
translateSheet("uploadAreaText"),
|
|
368
|
+
" ",
|
|
369
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-small-medium text-zinc-950", children: translateSheet("uploadAreaExt") })
|
|
370
|
+
] })
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
),
|
|
374
|
+
attachmentFile && /* @__PURE__ */ jsx(UploadedPdfFile, { file: attachmentFile, onRemove: handleRemoveAttachment })
|
|
375
|
+
] })
|
|
376
|
+
] }),
|
|
377
|
+
/* @__PURE__ */ jsxs("div", { className: infoBoxClasses, children: [
|
|
378
|
+
/* @__PURE__ */ jsx(IconInfoCircle, { size: 16, className: "shrink-0" }),
|
|
379
|
+
/* @__PURE__ */ jsxs("span", { className: "paragraph-small-semibold", children: [
|
|
380
|
+
translateSheet("processingInfo"),
|
|
381
|
+
" ",
|
|
382
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-600 paragraph-small-regular", children: translateSheet("processingInfoSub") })
|
|
383
|
+
] })
|
|
384
|
+
] }),
|
|
385
|
+
/* @__PURE__ */ jsxs("div", { className: infoBoxClasses, children: [
|
|
386
|
+
/* @__PURE__ */ jsx(IconInfoCircle, { size: 16, className: "shrink-0" }),
|
|
387
|
+
/* @__PURE__ */ jsxs("span", { className: "paragraph-small-semibold", children: [
|
|
388
|
+
translateSheet("contactInfo"),
|
|
389
|
+
" ",
|
|
390
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-600 paragraph-small-regular", children: AFFILIATE_FINANCE_EMAIL })
|
|
391
|
+
] })
|
|
392
|
+
] })
|
|
393
|
+
] }),
|
|
394
|
+
/* @__PURE__ */ jsxs(SheetFooter, { className: "flex-row items-center justify-between border-t border-zinc-200 shrink-0", children: [
|
|
395
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", className: "h-10!", type: "button", onClick: handleClose, children: translate("common.actions.cancel") }),
|
|
396
|
+
/* @__PURE__ */ jsx(
|
|
397
|
+
Button,
|
|
398
|
+
{
|
|
399
|
+
className: "h-10!",
|
|
400
|
+
type: "submit",
|
|
401
|
+
disabled: !affiliate || !limits || !hasReceivingAccount || !withdrawalAmount || withdrawalAmount < minWithdrawal || toCents(withdrawalAmount) > toCents(availableToWithdraw) || requiresInvoice && !attachmentFile || !limits.canWithdraw || requestDeposit.isPending,
|
|
402
|
+
loading: requestDeposit.isPending,
|
|
403
|
+
children: translateSheet("submitButton")
|
|
404
|
+
}
|
|
405
|
+
)
|
|
406
|
+
] })
|
|
407
|
+
]
|
|
408
|
+
}
|
|
409
|
+
)
|
|
410
|
+
]
|
|
411
|
+
}
|
|
412
|
+
) }),
|
|
413
|
+
pendingWithdrawalValue && /* @__PURE__ */ jsx(Dialog, { open: showConfirmDialog, onOpenChange: setShowConfirmDialog, children: /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col p-0! gap-0! max-w-[calc(100%-2rem)]! w-full sm:max-w-[400px]! lg:max-w-[420px]! rounded-lg border", children: [
|
|
414
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5 p-4 lg:p-5", children: [
|
|
415
|
+
/* @__PURE__ */ jsx("span", { className: "paragraph-medium-semibold text-zinc-950", children: translateSheet("reviewTitle") }),
|
|
416
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 bg-zinc-50 rounded-lg p-4", children: [
|
|
417
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
418
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-600 paragraph-small-medium", children: translateSheet("reviewValueLabel") }),
|
|
419
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-950 paragraph-small-semibold", children: formatCurrencyNumber(parseCurrencyToNumber(pendingWithdrawalValue)) })
|
|
420
|
+
] }),
|
|
421
|
+
/* @__PURE__ */ jsx("div", { className: "h-px bg-zinc-200" }),
|
|
422
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
423
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-600 paragraph-small-medium", children: translateSheet("holderLabel") }),
|
|
424
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-950 paragraph-small-regular", children: affiliate?.holder_name ?? "\u2014" })
|
|
425
|
+
] }),
|
|
426
|
+
/* @__PURE__ */ jsx("div", { className: "h-px bg-zinc-200" }),
|
|
427
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
428
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-600 paragraph-small-medium", children: translateSheet("reviewPixLabel") }),
|
|
429
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-950 paragraph-small-regular truncate", children: affiliate?.pix ? formatPixKey(affiliate.pix) : "\u2014" })
|
|
430
|
+
] }),
|
|
431
|
+
/* @__PURE__ */ jsx("div", { className: "h-px bg-zinc-200" }),
|
|
432
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
433
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-600 paragraph-small-medium", children: translateSheet("reviewDeadlineLabel") }),
|
|
434
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-950 paragraph-small-regular", children: translateSheet("reviewDeadlineValue") })
|
|
435
|
+
] }),
|
|
436
|
+
limits?.personType === "cnpj" && attachmentFile && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
437
|
+
/* @__PURE__ */ jsx("div", { className: "h-px bg-zinc-200" }),
|
|
438
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
439
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-600 paragraph-small-medium", children: translateSheet("reviewInvoiceLabel") }),
|
|
440
|
+
/* @__PURE__ */ jsx("span", { className: "text-zinc-950 paragraph-small-regular", children: attachmentFile.name })
|
|
441
|
+
] })
|
|
442
|
+
] })
|
|
443
|
+
] }),
|
|
444
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 bg-amber-50 rounded-lg p-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
445
|
+
/* @__PURE__ */ jsx(IconAlertTriangle, { size: 20, className: "text-amber-600 shrink-0 mt-0.5" }),
|
|
446
|
+
/* @__PURE__ */ jsx("p", { className: "paragraph-small-regular text-zinc-950", children: translateSheet("reviewWarning") })
|
|
447
|
+
] }) })
|
|
448
|
+
] }),
|
|
449
|
+
/* @__PURE__ */ jsx("div", { className: "h-px bg-zinc-200" }),
|
|
450
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2 p-4 lg:p-5", children: [
|
|
451
|
+
/* @__PURE__ */ jsx(
|
|
452
|
+
Button,
|
|
453
|
+
{
|
|
454
|
+
className: "h-10 w-fit",
|
|
455
|
+
onClick: handleConfirmWithdrawal,
|
|
456
|
+
loading: requestDeposit.isPending,
|
|
457
|
+
children: translateSheet("reviewConfirmButton")
|
|
458
|
+
}
|
|
459
|
+
),
|
|
460
|
+
/* @__PURE__ */ jsx(
|
|
461
|
+
Button,
|
|
462
|
+
{
|
|
463
|
+
variant: "secondary",
|
|
464
|
+
className: "h-10 w-fit",
|
|
465
|
+
onClick: () => setShowConfirmDialog(false),
|
|
466
|
+
children: translate("common.actions.back")
|
|
467
|
+
}
|
|
468
|
+
)
|
|
469
|
+
] })
|
|
470
|
+
] }) })
|
|
471
|
+
] });
|
|
472
|
+
}
|
|
473
|
+
export {
|
|
474
|
+
RequestWithdrawalSheet
|
|
475
|
+
};
|
|
476
|
+
//# sourceMappingURL=RequestWithdrawalSheet.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/account/sections/affiliates/RequestWithdrawalSheet.tsx"],"sourcesContent":["'use client';\n\nimport { useCallback, useMemo, useRef, useState, type ChangeEvent, type DragEvent } from 'react';\nimport { Controller, useForm } from 'react-hook-form';\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport { IconAlertTriangle, IconInfoCircle, IconPencil, IconUpload, IconX } from '@tabler/icons-react';\nimport { useTranslations } from 'next-intl';\nimport { toast } from 'sonner';\nimport z from 'zod';\nimport { Button } from '../../../ui/buttons/Button';\nimport { Separator } from '../../../ui/data-display/Separator';\nimport { Toast } from '../../../ui/feedback/Toast';\nimport { FormField } from '../../../ui/form/FormField';\nimport { Dialog, DialogContent } from '../../../ui/overlay/Dialog';\nimport { Sheet, SheetContent, SheetFooter, SheetHeader, SheetTitle } from '../../../ui/overlay/Sheet';\nimport { useCurrentAffiliate } from '../../../../modules/affiliates/hooks/use-current-affiliate.hook';\nimport { useRequestDeposit } from '../../../../modules/affiliates/hooks/use-request-deposit.hook';\nimport { useWithdrawalLimits } from '../../../../modules/affiliates/hooks/use-withdrawal-limits.hook';\nimport { AFFILIATE_FINANCE_EMAIL } from '../../../../modules/affiliates/constants/affiliate.constants';\nimport {\n formatCurrency,\n formatCurrencyNumber,\n parseCurrencyToNumber,\n} from '../../../../utils/format/currency';\nimport { formatDocument, formatPixKey } from '../../../../utils/format/masks';\nimport { formatFileSize, isPDFFile } from '../../../../utils/file/index';\nimport { useUploadProgress } from '../../../../hooks/useUploadProgress';\nimport useIsMobile from '../../../../hooks/useIsMobile';\nimport { useIsDefaultWhitelabel } from '../../../../providers/whitelabel.provider';\nimport { cn } from '../../../../infra/utils/clsx';\nimport { useAffiliateFlows } from '../../../../store/useAffiliateFlows';\n\nconst MIN_WITHDRAWAL = 25;\n\n/** Compara em centavos: o saldo vem do backend em reais e a comparação direta erra no arredondamento. */\nconst toCents = (value: number) => Math.round(value * 100);\n\nfunction readFileAsBase64DataUrl(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(reader.result as string);\n reader.onerror = () => reject(new Error('read-file-failed'));\n reader.readAsDataURL(file);\n });\n}\n\nfunction buildWithdrawalSchema(maxAvailable: number, minWithdrawal: number, messages: {\n required: string;\n minValue: string;\n maxBalance: string;\n}) {\n return z.object({\n value: z\n .string()\n .min(1, messages.required)\n .refine((value) => parseCurrencyToNumber(value) >= minWithdrawal, { message: messages.minValue })\n .refine((value) => toCents(parseCurrencyToNumber(value)) <= toCents(maxAvailable), {\n message: messages.maxBalance,\n }),\n });\n}\n\ntype WithdrawalFormData = { value: string };\n\nfunction PdfFileIcon() {\n return (\n <svg width=\"24\" height=\"27\" viewBox=\"0 0 24 27\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M14.5 1H4.5A2.5 2.5 0 0 0 2 3.5v20A2.5 2.5 0 0 0 4.5 26h15a2.5 2.5 0 0 0 2.5-2.5V8.5L14.5 1Z\"\n fill=\"#fff\"\n stroke=\"#D4D4D8\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n />\n <path d=\"M14 1.5V8.5h7\" stroke=\"#D4D4D8\" strokeWidth=\"1.5\" strokeLinejoin=\"round\" />\n <rect x=\"4\" y=\"13\" width=\"16\" height=\"9\" rx=\"2\" fill=\"#E11D48\" />\n <text x=\"12\" y=\"19.5\" textAnchor=\"middle\" fill=\"#fff\" fontSize=\"6\" fontWeight=\"700\" fontFamily=\"sans-serif\">\n PDF\n </text>\n </svg>\n );\n}\n\nfunction UploadedPdfFile({ file, onRemove }: { file: File; onRemove: () => void }) {\n const translateSheet = useTranslations('common.account.workspace.affiliates.withdrawal');\n const { progress } = useUploadProgress({ interval: 80, increment: 10 });\n const fileNameWithoutExtension = file.name.replace(/\\.[^/.]+$/, '');\n const fileExtension = file.name.split('.').pop()?.toUpperCase() || '';\n\n return (\n <div className=\"flex flex-col gap-3 bg-[#f8f8f7] rounded-lg\">\n <div className=\"flex items-center gap-3\">\n <div className=\"flex items-center justify-center size-12.5 shrink-0 bg-white border border-zinc-200 rounded-lg\">\n <PdfFileIcon />\n </div>\n <div className=\"flex flex-col gap-0.5 min-w-0 flex-1\">\n <span className=\"paragraph-small-medium text-zinc-950 truncate\">{fileNameWithoutExtension}</span>\n <span className=\"paragraph-xsmall-medium text-zinc-500\">\n .{fileExtension} <span className=\"text-zinc-500/40\">•</span> {formatFileSize(file.size)}\n </span>\n </div>\n <button\n type=\"button\"\n onClick={onRemove}\n className=\"flex items-center justify-center size-8 shrink-0 rounded-lg hover:bg-zinc-100 hover:cursor-pointer transition-colors\"\n aria-label={translateSheet('removeAttachmentAriaLabel')}\n >\n <IconX size={18} className=\"text-zinc-500\" />\n </button>\n </div>\n <div className=\"flex items-center gap-3\">\n <div className=\"flex-1 h-1.5 bg-white rounded-full overflow-hidden\">\n <div\n className=\"bg-zinc-950 h-full rounded-full transition-all duration-100\"\n style={{ width: `${progress}%` }}\n />\n </div>\n <span className=\"paragraph-xsmall-medium text-zinc-500 shrink-0\">{progress}%</span>\n </div>\n </div>\n );\n}\n\n/** Solicitação de saque do saldo de afiliado, com conta de recebimento, limites e nota fiscal. */\nexport function RequestWithdrawalSheet() {\n const translate = useTranslations();\n const translateSheet = useTranslations('common.account.workspace.affiliates.withdrawal');\n const isMobile = useIsMobile();\n const isDefaultWhitelabel = useIsDefaultWhitelabel();\n\n const isOpen = useAffiliateFlows((state) => state.isWithdrawalOpen);\n const close = useAffiliateFlows((state) => state.closeWithdrawal);\n const openReceivingAccount = useAffiliateFlows((state) => state.openReceivingAccount);\n\n const { data: affiliateData } = useCurrentAffiliate();\n const affiliate = affiliateData?.data;\n const { data: limitsData } = useWithdrawalLimits({ enabled: isOpen && !!affiliate });\n const limits = limitsData?.data;\n const requestDeposit = useRequestDeposit();\n\n const balance = Number(affiliate?.balance ?? 0);\n const availableToWithdraw = limits?.availableToWithdraw ?? balance;\n const minWithdrawal = limits?.minValue ?? MIN_WITHDRAWAL;\n const requiresInvoice = limits?.requiresInvoice ?? false;\n const hasReceivingAccount = !!(affiliate?.pix && affiliate?.holder_name && affiliate?.holder_document);\n\n const minValueLabel = minWithdrawal.toFixed(2).replace('.', ',');\n\n const withdrawalSchema = useMemo(\n () =>\n buildWithdrawalSchema(availableToWithdraw, minWithdrawal, {\n required: translateSheet('validationRequired'),\n minValue: translateSheet('validationMinValue', { minValue: minValueLabel }),\n maxBalance: translateSheet('validationMaxBalance', {\n balance: formatCurrencyNumber(availableToWithdraw),\n }),\n }),\n [availableToWithdraw, minWithdrawal, minValueLabel, translateSheet]\n );\n\n const form = useForm<WithdrawalFormData>({\n resolver: zodResolver(withdrawalSchema),\n defaultValues: { value: '' },\n });\n\n const watchedValue = form.watch('value');\n const withdrawalAmount = parseCurrencyToNumber(watchedValue || '') || 0;\n\n const fileInputRef = useRef<HTMLInputElement>(null);\n const [showUploadArea, setShowUploadArea] = useState(false);\n const [attachmentFile, setAttachmentFile] = useState<File | null>(null);\n const [attachmentBase64, setAttachmentBase64] = useState<string | null>(null);\n const [isDragging, setIsDragging] = useState(false);\n const [showConfirmDialog, setShowConfirmDialog] = useState(false);\n const [pendingWithdrawalValue, setPendingWithdrawalValue] = useState<string | null>(null);\n\n const handlePdfFile = useCallback(\n async (file: File) => {\n if (!isPDFFile(file)) {\n toast.custom((toastId) => (\n <Toast variant=\"error\" message={translateSheet('errorPdfOnly')} toastId={toastId} />\n ));\n return;\n }\n setAttachmentFile(file);\n setAttachmentBase64(await readFileAsBase64DataUrl(file));\n },\n [translateSheet]\n );\n\n const handleFileInputChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n if (file) handlePdfFile(file);\n event.target.value = '';\n },\n [handlePdfFile]\n );\n\n const handleDrop = useCallback(\n (event: DragEvent) => {\n event.preventDefault();\n setIsDragging(false);\n const file = event.dataTransfer.files?.[0];\n if (file) handlePdfFile(file);\n },\n [handlePdfFile]\n );\n\n const handleRemoveAttachment = useCallback(() => {\n setAttachmentFile(null);\n setAttachmentBase64(null);\n }, []);\n\n const handleClose = () => {\n form.reset({ value: '' });\n setShowUploadArea(false);\n handleRemoveAttachment();\n setShowConfirmDialog(false);\n setPendingWithdrawalValue(null);\n close();\n };\n\n const executeWithdrawal = async (value: string, attachment: string | null) => {\n if (!affiliate) return;\n\n try {\n const result = await requestDeposit.mutateAsync({\n value: parseCurrencyToNumber(value),\n ...(attachment ? { attachment } : {}),\n });\n toast.custom((toastId) => <Toast variant=\"success\" message={result.message} toastId={toastId} />);\n handleClose();\n } catch (error) {\n const message = error instanceof Error ? error.message : translateSheet('errorRequestDeposit');\n toast.custom((toastId) => <Toast variant=\"error\" message={message} toastId={toastId} />);\n }\n };\n\n const handleConfirmWithdrawal = async () => {\n if (pendingWithdrawalValue === null) return;\n setShowConfirmDialog(false);\n await executeWithdrawal(pendingWithdrawalValue, attachmentBase64);\n setPendingWithdrawalValue(null);\n };\n\n const infoBoxClasses = cn(\n 'flex items-center gap-3 text-zinc-950 rounded-lg p-4',\n isDefaultWhitelabel ? 'bg-cyan-50' : 'bg-zinc-50'\n );\n\n return (\n <>\n <Sheet open={isOpen} onOpenChange={(nextOpen) => !nextOpen && handleClose()}>\n <SheetContent\n side={isMobile ? 'bottom' : 'right'}\n className={cn(\n isMobile\n ? 'h-dvh w-full max-w-full rounded-none pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]'\n : 'h-screen max-w-[480px]! w-[480px]!',\n 'data-[state=open]:max-h-none data-[state=open]:h-dvh'\n )}\n >\n <SheetHeader className=\"border-b border-zinc-200\">\n <SheetTitle className=\"text-zinc-950 paragraph-medium-semibold\">\n {translateSheet('sheetTitle')}\n </SheetTitle>\n </SheetHeader>\n\n <form\n onSubmit={form.handleSubmit((data) => {\n setPendingWithdrawalValue(data.value);\n setShowConfirmDialog(true);\n })}\n className=\"flex flex-col flex-1 overflow-hidden\"\n >\n <div className=\"flex flex-col gap-6 px-5 py-5 overflow-y-auto [scrollbar-width:auto] [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-zinc-300 flex-1\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-zinc-500 paragraph-small-semibold\">\n {translateSheet('availableBalance')}\n </span>\n <span className=\"text-green-600 paragraph-medium-semibold\">\n {formatCurrencyNumber(balance)}\n </span>\n </div>\n\n <Separator />\n\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex items-center justify-between\">\n <span className=\"paragraph-small-regular text-zinc-600\">\n {translateSheet('receivingAccount')}\n </span>\n <Button variant=\"secondary\" className=\"h-8!\" type=\"button\" onClick={openReceivingAccount}>\n <IconPencil />\n {translate('common.actions.edit')}\n </Button>\n </div>\n <div className=\"flex flex-col rounded-lg bg-zinc-50 p-4 gap-4\">\n <div className=\"flex items-center gap-3\">\n <span className=\"w-40 text-zinc-950 paragraph-small-medium\">\n {translateSheet('holderLabel')}\n </span>\n <span className=\"w-full text-zinc-600 paragraph-small-regular\">\n {affiliate?.holder_name ?? '—'}\n </span>\n </div>\n <div className=\"flex items-center gap-3\">\n <span className=\"w-40 text-zinc-950 paragraph-small-medium\">\n {translateSheet('pixKeyLabel')}\n </span>\n <span className=\"w-full text-zinc-600 paragraph-small-regular truncate\">\n {affiliate?.pix ? formatPixKey(affiliate.pix) : '—'}\n </span>\n </div>\n <div className=\"flex items-center gap-3\">\n <span className=\"w-40 text-zinc-950 paragraph-small-medium\">\n {translateSheet('holderDocumentLabel')}\n </span>\n <span className=\"w-full text-zinc-600 paragraph-small-regular truncate\">\n {affiliate?.holder_document ? formatDocument(affiliate.holder_document) : '—'}\n </span>\n </div>\n </div>\n </div>\n\n {limits && !limits.canWithdraw ? (\n <div className=\"flex flex-col gap-3 bg-zinc-50 rounded-lg p-4\">\n <div className=\"size-8 bg-white rounded-lg shadow-[0px_2px_10px_0px_rgba(26,26,26,0.05)] flex items-center justify-center\">\n <IconAlertTriangle size={18} className=\"text-amber-500\" />\n </div>\n <p className=\"paragraph-small-medium text-zinc-950\">{translateSheet('blockedTitle')}</p>\n <p className=\"paragraph-small-regular text-zinc-600\">\n {translateSheet('blockedDescription')}\n </p>\n <Button\n variant=\"secondary\"\n className=\"h-10! w-fit\"\n type=\"button\"\n onClick={openReceivingAccount}\n >\n {translateSheet('blockedEditAccountButton')}\n </Button>\n </div>\n ) : (\n <>\n <Controller\n name=\"value\"\n control={form.control}\n render={({ field, fieldState }) => (\n <FormField\n required\n label={translateSheet('withdrawalValueLabel')}\n placeholder={translateSheet('withdrawalValuePlaceholder')}\n inputMode=\"numeric\"\n hintMessage={translateSheet('withdrawalValueHint', { minValue: minValueLabel })}\n value={field.value}\n onChange={(event) => {\n const raw = event.target.value.replace(/\\D/g, '');\n if (!raw) return field.onChange('');\n field.onChange(formatCurrency(raw));\n }}\n error={!!fieldState.error}\n errorMessage={fieldState.error?.message}\n />\n )}\n />\n\n {limits?.personType === 'cpf' && (\n <div className={infoBoxClasses}>\n <IconInfoCircle size={16} className=\"shrink-0\" />\n <span className=\"paragraph-small-semibold\">\n {translateSheet('cpfMonthlyLimit', {\n value: formatCurrencyNumber(limits.maxValuePerMonth ?? 0),\n })}{' '}\n <span className=\"text-zinc-600 paragraph-small-regular\">\n {translateSheet('cpfMonthlyRemaining', {\n value: formatCurrencyNumber(limits.monthlyRemaining ?? 0),\n })}\n </span>\n </span>\n </div>\n )}\n\n {limits?.personType === 'cnpj' && requiresInvoice && (\n <div className=\"flex flex-col gap-3 bg-zinc-50 rounded-lg p-4\">\n <div className=\"size-8 bg-white rounded-lg shadow-[0px_2px_10px_0px_rgba(26,26,26,0.05)] flex items-center justify-center\">\n <IconAlertTriangle size={18} className=\"text-amber-500\" />\n </div>\n <p className=\"paragraph-small-medium text-zinc-950\">\n {translateSheet('invoiceWarningCnpj')}\n </p>\n\n {!showUploadArea && !attachmentFile && (\n <Button\n variant=\"secondary\"\n className=\"h-10! w-fit\"\n type=\"button\"\n onClick={() => setShowUploadArea(true)}\n >\n {translateSheet('attachInvoiceButton')}\n <IconUpload size={20} />\n </Button>\n )}\n\n <input\n ref={fileInputRef}\n type=\"file\"\n accept=\"application/pdf\"\n className=\"hidden\"\n onChange={handleFileInputChange}\n />\n\n {showUploadArea && !attachmentFile && (\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => fileInputRef.current?.click()}\n onKeyDown={(event) => event.key === 'Enter' && fileInputRef.current?.click()}\n onDragOver={(event) => {\n event.preventDefault();\n setIsDragging(true);\n }}\n onDragLeave={(event) => {\n event.preventDefault();\n setIsDragging(false);\n }}\n onDrop={handleDrop}\n className={cn(\n 'flex flex-col items-center justify-center gap-3.5 p-14 border-2 border-dashed rounded-lg cursor-pointer transition-colors hover:border-zinc-400',\n isDragging ? 'border-zinc-400 bg-zinc-100' : 'border-zinc-200 bg-white'\n )}\n >\n <div className=\"flex items-center justify-center size-14 bg-zinc-100 rounded-lg\">\n <IconUpload size={24} className=\"text-zinc-600\" />\n </div>\n <p className=\"paragraph-small-regular text-zinc-500 text-center\">\n {translateSheet('uploadAreaText')}{' '}\n <span className=\"paragraph-small-medium text-zinc-950\">\n {translateSheet('uploadAreaExt')}\n </span>\n </p>\n </div>\n )}\n\n {attachmentFile && (\n <UploadedPdfFile file={attachmentFile} onRemove={handleRemoveAttachment} />\n )}\n </div>\n )}\n </>\n )}\n\n <div className={infoBoxClasses}>\n <IconInfoCircle size={16} className=\"shrink-0\" />\n <span className=\"paragraph-small-semibold\">\n {translateSheet('processingInfo')}{' '}\n <span className=\"text-zinc-600 paragraph-small-regular\">\n {translateSheet('processingInfoSub')}\n </span>\n </span>\n </div>\n\n <div className={infoBoxClasses}>\n <IconInfoCircle size={16} className=\"shrink-0\" />\n <span className=\"paragraph-small-semibold\">\n {translateSheet('contactInfo')}{' '}\n <span className=\"text-zinc-600 paragraph-small-regular\">{AFFILIATE_FINANCE_EMAIL}</span>\n </span>\n </div>\n </div>\n\n <SheetFooter className=\"flex-row items-center justify-between border-t border-zinc-200 shrink-0\">\n <Button variant=\"secondary\" className=\"h-10!\" type=\"button\" onClick={handleClose}>\n {translate('common.actions.cancel')}\n </Button>\n <Button\n className=\"h-10!\"\n type=\"submit\"\n disabled={\n !affiliate ||\n !limits ||\n !hasReceivingAccount ||\n !withdrawalAmount ||\n withdrawalAmount < minWithdrawal ||\n toCents(withdrawalAmount) > toCents(availableToWithdraw) ||\n (requiresInvoice && !attachmentFile) ||\n !limits.canWithdraw ||\n requestDeposit.isPending\n }\n loading={requestDeposit.isPending}\n >\n {translateSheet('submitButton')}\n </Button>\n </SheetFooter>\n </form>\n </SheetContent>\n </Sheet>\n\n {pendingWithdrawalValue && (\n <Dialog open={showConfirmDialog} onOpenChange={setShowConfirmDialog}>\n <DialogContent className=\"flex flex-col p-0! gap-0! max-w-[calc(100%-2rem)]! w-full sm:max-w-[400px]! lg:max-w-[420px]! rounded-lg border\">\n <div className=\"flex flex-col gap-5 p-4 lg:p-5\">\n <span className=\"paragraph-medium-semibold text-zinc-950\">{translateSheet('reviewTitle')}</span>\n\n <div className=\"flex flex-col gap-3 bg-zinc-50 rounded-lg p-4\">\n <div className=\"flex items-center justify-between\">\n <span className=\"text-zinc-600 paragraph-small-medium\">\n {translateSheet('reviewValueLabel')}\n </span>\n <span className=\"text-zinc-950 paragraph-small-semibold\">\n {formatCurrencyNumber(parseCurrencyToNumber(pendingWithdrawalValue))}\n </span>\n </div>\n <div className=\"h-px bg-zinc-200\" />\n <div className=\"flex items-center justify-between\">\n <span className=\"text-zinc-600 paragraph-small-medium\">\n {translateSheet('holderLabel')}\n </span>\n <span className=\"text-zinc-950 paragraph-small-regular\">\n {affiliate?.holder_name ?? '—'}\n </span>\n </div>\n <div className=\"h-px bg-zinc-200\" />\n <div className=\"flex items-center justify-between\">\n <span className=\"text-zinc-600 paragraph-small-medium\">\n {translateSheet('reviewPixLabel')}\n </span>\n <span className=\"text-zinc-950 paragraph-small-regular truncate\">\n {affiliate?.pix ? formatPixKey(affiliate.pix) : '—'}\n </span>\n </div>\n <div className=\"h-px bg-zinc-200\" />\n <div className=\"flex items-center justify-between\">\n <span className=\"text-zinc-600 paragraph-small-medium\">\n {translateSheet('reviewDeadlineLabel')}\n </span>\n <span className=\"text-zinc-950 paragraph-small-regular\">\n {translateSheet('reviewDeadlineValue')}\n </span>\n </div>\n {limits?.personType === 'cnpj' && attachmentFile && (\n <>\n <div className=\"h-px bg-zinc-200\" />\n <div className=\"flex items-center justify-between\">\n <span className=\"text-zinc-600 paragraph-small-medium\">\n {translateSheet('reviewInvoiceLabel')}\n </span>\n <span className=\"text-zinc-950 paragraph-small-regular\">{attachmentFile.name}</span>\n </div>\n </>\n )}\n </div>\n\n <div className=\"flex flex-col gap-4 bg-amber-50 rounded-lg p-4\">\n <div className=\"flex items-start gap-3\">\n <IconAlertTriangle size={20} className=\"text-amber-600 shrink-0 mt-0.5\" />\n <p className=\"paragraph-small-regular text-zinc-950\">{translateSheet('reviewWarning')}</p>\n </div>\n </div>\n </div>\n\n <div className=\"h-px bg-zinc-200\" />\n\n <div className=\"flex flex-row items-center gap-2 p-4 lg:p-5\">\n <Button\n className=\"h-10 w-fit\"\n onClick={handleConfirmWithdrawal}\n loading={requestDeposit.isPending}\n >\n {translateSheet('reviewConfirmButton')}\n </Button>\n <Button\n variant=\"secondary\"\n className=\"h-10 w-fit\"\n onClick={() => setShowConfirmDialog(false)}\n >\n {translate('common.actions.back')}\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n )}\n </>\n );\n}\n"],"mappings":";AAkEI,SAuRY,UAtRV,KADF;AAhEJ,SAAS,aAAa,SAAS,QAAQ,gBAAkD;AACzF,SAAS,YAAY,eAAe;AACpC,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB,gBAAgB,YAAY,YAAY,aAAa;AACjF,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,OAAO,OAAO;AACd,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AACtB,SAAS,iBAAiB;AAC1B,SAAS,QAAQ,qBAAqB;AACtC,SAAS,OAAO,cAAc,aAAa,aAAa,kBAAkB;AAC1E,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC,SAAS,+BAA+B;AACxC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gBAAgB,oBAAoB;AAC7C,SAAS,gBAAgB,iBAAiB;AAC1C,SAAS,yBAAyB;AAClC,OAAO,iBAAiB;AACxB,SAAS,8BAA8B;AACvC,SAAS,UAAU;AACnB,SAAS,yBAAyB;AAElC,MAAM,iBAAiB;AAGvB,MAAM,UAAU,CAAC,UAAkB,KAAK,MAAM,QAAQ,GAAG;AAEzD,SAAS,wBAAwB,MAA6B;AAC5D,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAM,SAAS,IAAI,WAAW;AAC9B,WAAO,SAAS,MAAM,QAAQ,OAAO,MAAgB;AACrD,WAAO,UAAU,MAAM,OAAO,IAAI,MAAM,kBAAkB,CAAC;AAC3D,WAAO,cAAc,IAAI;AAAA,EAC3B,CAAC;AACH;AAEA,SAAS,sBAAsB,cAAsB,eAAuB,UAIzE;AACD,SAAO,EAAE,OAAO;AAAA,IACd,OAAO,EACJ,OAAO,EACP,IAAI,GAAG,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ACR,WAAU;AAAA,YACV,SAAS,MAAM,qBAAqB,KAAK;AAAA,YAExC,oBAAU,qBAAqB;AAAA;AAAA,QAClC;AAAA,SACF;AAAA,OACF,GACF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslations } from "next-intl";
|
|
4
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../../../ui/overlay/Dialog";
|
|
5
|
+
import { useAffiliateFlows } from "../../../../store/useAffiliateFlows";
|
|
6
|
+
const STORAGE_URL = process.env.NEXT_PUBLIC_STORAGE_URL || "";
|
|
7
|
+
function ViewAttachmentModal() {
|
|
8
|
+
const translate = useTranslations();
|
|
9
|
+
const attachment = useAffiliateFlows((state) => state.attachment);
|
|
10
|
+
const close = useAffiliateFlows((state) => state.closeAttachment);
|
|
11
|
+
const pdfUrl = attachment ? `${STORAGE_URL}/${attachment}` : null;
|
|
12
|
+
return /* @__PURE__ */ jsx(Dialog, { open: !!attachment, onOpenChange: (nextOpen) => !nextOpen && close(), children: /* @__PURE__ */ jsxs(
|
|
13
|
+
DialogContent,
|
|
14
|
+
{
|
|
15
|
+
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
16
|
+
className: "flex flex-col p-0 gap-0 w-[90vw]! max-w-[900px]! h-[85vh]! max-h-[85vh]! duration-0!",
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsx(DialogHeader, { className: "text-left p-5 pb-4", children: /* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-zinc-950", children: translate("common.account.workspace.affiliates.viewAttachment.title") }) }),
|
|
19
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 px-5 pb-5", children: pdfUrl ? /* @__PURE__ */ jsx(
|
|
20
|
+
"iframe",
|
|
21
|
+
{
|
|
22
|
+
src: pdfUrl,
|
|
23
|
+
title: translate("common.account.workspace.affiliates.viewAttachment.iframeTitle"),
|
|
24
|
+
className: "w-full h-full rounded-lg border border-zinc-200"
|
|
25
|
+
}
|
|
26
|
+
) : /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx("span", { className: "paragraph-small-regular text-zinc-500", children: translate("common.account.workspace.affiliates.viewAttachment.noAttachment") }) }) })
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
) });
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
ViewAttachmentModal
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=ViewAttachmentModal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/account/sections/affiliates/ViewAttachmentModal.tsx"],"sourcesContent":["'use client';\n\nimport { useTranslations } from 'next-intl';\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../../../ui/overlay/Dialog';\nimport { useAffiliateFlows } from '../../../../store/useAffiliateFlows';\n\nconst STORAGE_URL = process.env.NEXT_PUBLIC_STORAGE_URL || '';\n\n/** Visualizador da nota fiscal anexada à comissão. */\nexport function ViewAttachmentModal() {\n const translate = useTranslations();\n const attachment = useAffiliateFlows((state) => state.attachment);\n const close = useAffiliateFlows((state) => state.closeAttachment);\n\n const pdfUrl = attachment ? `${STORAGE_URL}/${attachment}` : null;\n\n return (\n <Dialog open={!!attachment} onOpenChange={(nextOpen) => !nextOpen && close()}>\n <DialogContent\n onOpenAutoFocus={(event) => event.preventDefault()}\n className=\"flex flex-col p-0 gap-0 w-[90vw]! max-w-[900px]! h-[85vh]! max-h-[85vh]! duration-0!\"\n >\n <DialogHeader className=\"text-left p-5 pb-4\">\n <DialogTitle className=\"paragraph-medium-semibold text-zinc-950\">\n {translate('common.account.workspace.affiliates.viewAttachment.title')}\n </DialogTitle>\n </DialogHeader>\n\n <div className=\"flex-1 min-h-0 px-5 pb-5\">\n {pdfUrl ? (\n <iframe\n src={pdfUrl}\n title={translate('common.account.workspace.affiliates.viewAttachment.iframeTitle')}\n className=\"w-full h-full rounded-lg border border-zinc-200\"\n />\n ) : (\n <div className=\"flex items-center justify-center h-full\">\n <span className=\"paragraph-small-regular text-zinc-500\">\n {translate('common.account.workspace.affiliates.viewAttachment.noAttachment')}\n </span>\n </div>\n )}\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAkBM,SAKI,KALJ;AAhBN,SAAS,uBAAuB;AAChC,SAAS,QAAQ,eAAe,cAAc,mBAAmB;AACjE,SAAS,yBAAyB;AAElC,MAAM,cAAc,QAAQ,IAAI,2BAA2B;AAGpD,SAAS,sBAAsB;AACpC,QAAM,YAAY,gBAAgB;AAClC,QAAM,aAAa,kBAAkB,CAAC,UAAU,MAAM,UAAU;AAChE,QAAM,QAAQ,kBAAkB,CAAC,UAAU,MAAM,eAAe;AAEhE,QAAM,SAAS,aAAa,GAAG,WAAW,IAAI,UAAU,KAAK;AAE7D,SACE,oBAAC,UAAO,MAAM,CAAC,CAAC,YAAY,cAAc,CAAC,aAAa,CAAC,YAAY,MAAM,GACzE;AAAA,IAAC;AAAA;AAAA,MACC,iBAAiB,CAAC,UAAU,MAAM,eAAe;AAAA,MACjD,WAAU;AAAA,MAEV;AAAA,4BAAC,gBAAa,WAAU,sBACtB,8BAAC,eAAY,WAAU,2CACpB,oBAAU,0DAA0D,GACvE,GACF;AAAA,QAEA,oBAAC,SAAI,WAAU,4BACZ,mBACC;AAAA,UAAC;AAAA;AAAA,YACC,KAAK;AAAA,YACL,OAAO,UAAU,gEAAgE;AAAA,YACjF,WAAU;AAAA;AAAA,QACZ,IAEA,oBAAC,SAAI,WAAU,2CACb,8BAAC,UAAK,WAAU,yCACb,oBAAU,iEAAiE,GAC9E,GACF,GAEJ;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|