@greatapps/common 1.1.739 → 1.1.741
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/modals/billing/RequiredBillingDataModal.mjs +448 -0
- package/dist/components/modals/billing/RequiredBillingDataModal.mjs.map +1 -0
- package/dist/i18n/messages/en-us.mjs +39 -0
- package/dist/i18n/messages/en-us.mjs.map +1 -1
- package/dist/i18n/messages/es-es.mjs +39 -0
- package/dist/i18n/messages/es-es.mjs.map +1 -1
- package/dist/i18n/messages/pt-br.mjs +40 -0
- package/dist/i18n/messages/pt-br.mjs.map +1 -1
- package/dist/index.mjs +48 -32
- package/dist/index.mjs.map +1 -1
- package/dist/modules/accounts/actions/account-management.action.mjs +15 -0
- package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -1
- package/dist/modules/accounts/hooks/use-required-billing-data.hook.mjs +26 -0
- package/dist/modules/accounts/hooks/use-required-billing-data.hook.mjs.map +1 -0
- package/dist/modules/accounts/hooks/useAccountManagement.mjs +13 -1
- package/dist/modules/accounts/hooks/useAccountManagement.mjs.map +1 -1
- package/dist/modules/accounts/utils/billing-data.mjs +35 -0
- package/dist/modules/accounts/utils/billing-data.mjs.map +1 -0
- package/dist/modules/subscriptions/utils/has-paid-subscription.mjs +13 -0
- package/dist/modules/subscriptions/utils/has-paid-subscription.mjs.map +1 -0
- package/dist/server.mjs +2 -0
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/modals/billing/RequiredBillingDataModal.tsx +548 -0
- package/src/i18n/messages/en-us.ts +40 -0
- package/src/i18n/messages/es-es.ts +40 -0
- package/src/i18n/messages/pt-br.ts +42 -0
- package/src/index.ts +11 -0
- package/src/modules/accounts/actions/account-management.action.ts +24 -0
- package/src/modules/accounts/hooks/use-required-billing-data.hook.ts +38 -0
- package/src/modules/accounts/hooks/useAccountManagement.ts +13 -0
- package/src/modules/accounts/types.ts +11 -0
- package/src/modules/accounts/utils/billing-data.ts +81 -0
- package/src/modules/subscriptions/utils/has-paid-subscription.ts +27 -0
- package/src/server.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -119,6 +119,7 @@ import {
|
|
|
119
119
|
import { buildPlanExtras } from "./modules/subscriptions/utils/build-plan-extras";
|
|
120
120
|
import { hasSubscriptionExpired } from "./modules/subscriptions/utils/has-subscription-expired";
|
|
121
121
|
import { hasActivePaidSubscription } from "./modules/subscriptions/utils/has-active-paid-subscription";
|
|
122
|
+
import { hasPaidSubscription } from "./modules/subscriptions/utils/has-paid-subscription";
|
|
122
123
|
import {
|
|
123
124
|
confirmPaymentIfRequired,
|
|
124
125
|
PaymentAuthenticationError
|
|
@@ -143,7 +144,8 @@ import { default as default2 } from "./components/modals/BuyCreditsModal";
|
|
|
143
144
|
import { default as default3 } from "./components/modals/CreditsDisabledModal";
|
|
144
145
|
import { default as default4 } from "./components/modals/PaidPlanRequiredModal";
|
|
145
146
|
import { default as default5 } from "./components/modals/AccountDeletionWarningModal";
|
|
146
|
-
import { default as default6 } from "./components/modals/
|
|
147
|
+
import { default as default6 } from "./components/modals/billing/RequiredBillingDataModal";
|
|
148
|
+
import { default as default7 } from "./components/modals/cards/AddCardModal";
|
|
147
149
|
import { DeleteCardModal } from "./components/modals/cards/DeleteCardModal";
|
|
148
150
|
import { CannotDeleteCardModal } from "./components/modals/cards/CannotDeleteCardModal";
|
|
149
151
|
import {
|
|
@@ -177,13 +179,13 @@ import { AppNavBar } from "./components/layouts/AppNavBar";
|
|
|
177
179
|
import { AppMobileNavBar } from "./components/layouts/AppMobileNavBar";
|
|
178
180
|
import { SideBarNavigation } from "./components/layouts/SideBarNavigation";
|
|
179
181
|
import { MdSideBarNavigation } from "./components/layouts/MdSideBarNavigation";
|
|
180
|
-
import { default as
|
|
182
|
+
import { default as default8 } from "./components/widgets/notifications/NotificationCard";
|
|
181
183
|
import { NotificationsPopover } from "./components/layouts/NotificationsPopover";
|
|
182
184
|
import { NotificationPageContent } from "./components/pages/notifications/Notifications";
|
|
183
185
|
import { NotFoundPage } from "./components/pages/NotFoundPage";
|
|
184
186
|
import { UsersSelectorPopover } from "./components/layouts/UsersSelectorPopover";
|
|
185
187
|
import { ProfilePopover } from "./components/layouts/ProfilePopover";
|
|
186
|
-
import { default as
|
|
188
|
+
import { default as default9 } from "./components/layouts/WhitelabelCodes";
|
|
187
189
|
import { NavBarItem } from "./components/layouts/NavBarItem";
|
|
188
190
|
import { AppNavigation } from "./components/navigation/AppNavigation";
|
|
189
191
|
import { CancelledSubscriptionBanner } from "./components/navigation/CancelledSubscriptionBanner";
|
|
@@ -197,10 +199,10 @@ import {
|
|
|
197
199
|
useWlQueryKey,
|
|
198
200
|
useWlId
|
|
199
201
|
} from "./hooks/useAuthQueryKey";
|
|
200
|
-
import { default as
|
|
202
|
+
import { default as default10 } from "./hooks/copy-to-clipboard.hook";
|
|
201
203
|
import { Button, buttonVariants } from "./components/ui/buttons/Button";
|
|
202
204
|
import { CopyButton } from "./components/ui/buttons/CopyButton";
|
|
203
|
-
import { default as
|
|
205
|
+
import { default as default11 } from "./components/ui/buttons/CancelButton";
|
|
204
206
|
import {
|
|
205
207
|
Accordion,
|
|
206
208
|
AccordionItem,
|
|
@@ -245,8 +247,8 @@ import {
|
|
|
245
247
|
TabsContent
|
|
246
248
|
} from "./components/ui/data-display/Tabs";
|
|
247
249
|
import { UserAvatar } from "./components/ui/data-display/UserAvatar";
|
|
248
|
-
import { default as
|
|
249
|
-
import { default as
|
|
250
|
+
import { default as default12 } from "./components/ui/feedback/CircularProgress";
|
|
251
|
+
import { default as default13 } from "./components/ui/feedback/DefaultCircularProgress";
|
|
250
252
|
import { Progress } from "./components/ui/feedback/Progress";
|
|
251
253
|
import { LoadingOverlay } from "./components/ui/feedback/LoadingOverlay";
|
|
252
254
|
import { useBrandLoadingIcon } from "./hooks/useBrandLoadingIcon";
|
|
@@ -340,9 +342,9 @@ import { useMdSidebarStore } from "./store/useMdSidebarStore";
|
|
|
340
342
|
import { useDesktopSidebarStore } from "./store/useDesktopSidebarStore";
|
|
341
343
|
import { useModalManager } from "./store/useModalManager";
|
|
342
344
|
import { AccountSectionType } from "./enums/AccountSectionType";
|
|
343
|
-
import { default as
|
|
344
|
-
import { default as
|
|
345
|
-
import { default as
|
|
345
|
+
import { default as default14 } from "./hooks/usePasswordVisibility";
|
|
346
|
+
import { default as default15 } from "./hooks/useCountdownTimer";
|
|
347
|
+
import { default as default16 } from "./hooks/useIsMobile";
|
|
346
348
|
import { useDebounce } from "./hooks/useDebounce";
|
|
347
349
|
import { useDebouncedEffect } from "./hooks/useDebouncedEffect";
|
|
348
350
|
import { useDebounceState } from "./hooks/useDebounceState";
|
|
@@ -370,8 +372,8 @@ import { copyToClipboard, readFromClipboard } from "./utils/browser/clipboard";
|
|
|
370
372
|
import { FormField } from "./components/ui/form/FormField";
|
|
371
373
|
import { SelectField } from "./components/ui/form/SelectField";
|
|
372
374
|
import { ComboboxField } from "./components/ui/form/ComboboxField";
|
|
373
|
-
import { default as
|
|
374
|
-
import { default as
|
|
375
|
+
import { default as default17 } from "./components/ui/form/PhoneInput";
|
|
376
|
+
import { default as default18 } from "./components/ui/form/SwitchOptionFieldWithIcon";
|
|
375
377
|
import { TextAreaField } from "./components/ui/form/TextAreaField";
|
|
376
378
|
import {
|
|
377
379
|
useCurrentAccount,
|
|
@@ -382,19 +384,26 @@ import {
|
|
|
382
384
|
useUpdateAccount,
|
|
383
385
|
useUpdateAccountUser,
|
|
384
386
|
useUpdateAccountUserById,
|
|
387
|
+
useUpdateBillingData,
|
|
385
388
|
useDeleteAccountUser,
|
|
386
389
|
useDeleteAccount,
|
|
387
390
|
ACCOUNT_USERS_QUERY_KEY
|
|
388
391
|
} from "./modules/accounts/hooks/useAccountManagement";
|
|
389
392
|
import { useViaCep } from "./modules/accounts/hooks/useViaCep";
|
|
390
393
|
import { useAccountToken } from "./modules/accounts/hooks/use-account-token.hook";
|
|
391
|
-
import {
|
|
394
|
+
import { useRequiredBillingData } from "./modules/accounts/hooks/use-required-billing-data.hook";
|
|
395
|
+
import {
|
|
396
|
+
hasCompleteBillingData,
|
|
397
|
+
isInternationalAccount,
|
|
398
|
+
INTERNATIONAL_GATEWAY
|
|
399
|
+
} from "./modules/accounts/utils/billing-data";
|
|
400
|
+
import { default as default19 } from "./components/account/AccountModals";
|
|
392
401
|
import { useAccountModals } from "./store/useAccountModals";
|
|
393
402
|
import { ModalManager } from "./components/modals/ModalManager";
|
|
394
403
|
import { Modals } from "./components/modals/Modals";
|
|
395
|
-
import { default as
|
|
396
|
-
import { default as
|
|
397
|
-
import { default as
|
|
404
|
+
import { default as default20 } from "./components/account/TwoFactorAuthModal";
|
|
405
|
+
import { default as default21 } from "./components/account/DisableTwoFactorAuthModal";
|
|
406
|
+
import { default as default22 } from "./components/account/ConfirmGlobalPreferencesModal";
|
|
398
407
|
import { MyProfileSection } from "./components/account/sections/MyProfileSection";
|
|
399
408
|
import { PreferencesSection } from "./components/account/sections/PreferencesSection";
|
|
400
409
|
import { SecuritySection } from "./components/account/sections/SecuritySection";
|
|
@@ -443,9 +452,9 @@ export {
|
|
|
443
452
|
AccordionItem,
|
|
444
453
|
AccordionTrigger,
|
|
445
454
|
default5 as AccountDeletionWarningModal,
|
|
446
|
-
|
|
455
|
+
default19 as AccountModals,
|
|
447
456
|
AccountSectionType,
|
|
448
|
-
|
|
457
|
+
default7 as AddCardModal,
|
|
449
458
|
AppMobileNavBar,
|
|
450
459
|
AppNavBar,
|
|
451
460
|
AppNavigation,
|
|
@@ -460,7 +469,7 @@ export {
|
|
|
460
469
|
CURRENCY_OPTIONS,
|
|
461
470
|
Calendar,
|
|
462
471
|
CalendarDayButton,
|
|
463
|
-
|
|
472
|
+
default11 as CancelButton,
|
|
464
473
|
CancelledSubscriptionBanner,
|
|
465
474
|
CannotDeleteCardModal,
|
|
466
475
|
Card,
|
|
@@ -478,7 +487,7 @@ export {
|
|
|
478
487
|
ChangePhoneModal,
|
|
479
488
|
ChargeSchema,
|
|
480
489
|
Checkbox,
|
|
481
|
-
|
|
490
|
+
default12 as CircularProgress,
|
|
482
491
|
ClarityEmbed,
|
|
483
492
|
ComboboxField,
|
|
484
493
|
Command,
|
|
@@ -490,14 +499,14 @@ export {
|
|
|
490
499
|
CommandList,
|
|
491
500
|
CommandSeparator,
|
|
492
501
|
CommandShortcut,
|
|
493
|
-
|
|
502
|
+
default22 as ConfirmGlobalPreferencesModal,
|
|
494
503
|
CopyButton,
|
|
495
504
|
CreateCardRequestSchema,
|
|
496
505
|
default3 as CreditsDisabledModal,
|
|
497
506
|
CrispEmbed,
|
|
498
507
|
DatePicker,
|
|
499
508
|
DateRangePicker,
|
|
500
|
-
|
|
509
|
+
default13 as DefaultCircularProgress,
|
|
501
510
|
DeleteCardModal,
|
|
502
511
|
Dialog,
|
|
503
512
|
DialogClose,
|
|
@@ -509,7 +518,7 @@ export {
|
|
|
509
518
|
DialogPortal,
|
|
510
519
|
DialogTitle,
|
|
511
520
|
DialogTrigger,
|
|
512
|
-
|
|
521
|
+
default21 as DisableTwoFactorAuthModal,
|
|
513
522
|
EmbedWidgets,
|
|
514
523
|
FindCardsParamsSchema,
|
|
515
524
|
FindChargesParamsSchema,
|
|
@@ -517,6 +526,7 @@ export {
|
|
|
517
526
|
FrillEmbed,
|
|
518
527
|
GENDER_OPTIONS,
|
|
519
528
|
INFINITE_PROJECTS_QUERY_KEY,
|
|
529
|
+
INTERNATIONAL_GATEWAY,
|
|
520
530
|
ImageCropModal,
|
|
521
531
|
ImageTooSmallModal,
|
|
522
532
|
ImageUpload,
|
|
@@ -548,7 +558,7 @@ export {
|
|
|
548
558
|
NavBarItem,
|
|
549
559
|
NavigationProvider,
|
|
550
560
|
NotFoundPage,
|
|
551
|
-
|
|
561
|
+
default8 as NotificationCard,
|
|
552
562
|
NotificationPageContent,
|
|
553
563
|
NotificationsPopover,
|
|
554
564
|
OverdueInvoiceBanner,
|
|
@@ -568,7 +578,7 @@ export {
|
|
|
568
578
|
PaymentAuthenticationError,
|
|
569
579
|
CardSchema as PaymentCardSchema,
|
|
570
580
|
PaymentInfoCard,
|
|
571
|
-
|
|
581
|
+
default17 as PhoneInput,
|
|
572
582
|
PixPendingDataSchema,
|
|
573
583
|
PlanItemSchema,
|
|
574
584
|
PlanSchema,
|
|
@@ -583,6 +593,7 @@ export {
|
|
|
583
593
|
QueryProvider,
|
|
584
594
|
RadioGroup,
|
|
585
595
|
RadioGroupItem,
|
|
596
|
+
default6 as RequiredBillingDataModal,
|
|
586
597
|
SUBSCRIPTIONS_QUERY_KEY,
|
|
587
598
|
SUBSCRIPTION_GRACE_PERIOD_DAYS,
|
|
588
599
|
ScrollArea,
|
|
@@ -616,7 +627,7 @@ export {
|
|
|
616
627
|
SubscriptionPendingPixResponseSchema,
|
|
617
628
|
SubscriptionSchema,
|
|
618
629
|
Switch,
|
|
619
|
-
|
|
630
|
+
default18 as SwitchOptionFieldWithIcon,
|
|
620
631
|
TIME_FORMAT_OPTIONS,
|
|
621
632
|
Table,
|
|
622
633
|
TableBody,
|
|
@@ -638,12 +649,12 @@ export {
|
|
|
638
649
|
TooltipProvider,
|
|
639
650
|
TooltipTrigger,
|
|
640
651
|
TrialBanner,
|
|
641
|
-
|
|
652
|
+
default20 as TwoFactorAuthModal,
|
|
642
653
|
USER_QUERY_KEY,
|
|
643
654
|
UpcomingInvoiceBanner,
|
|
644
655
|
UserAvatar,
|
|
645
656
|
UsersSelectorPopover,
|
|
646
|
-
|
|
657
|
+
default9 as WhitelabelCodes,
|
|
647
658
|
badgeVariants,
|
|
648
659
|
base64ToFile,
|
|
649
660
|
buildCardFormSchema,
|
|
@@ -680,8 +691,11 @@ export {
|
|
|
680
691
|
getPriceFromCalculatedData,
|
|
681
692
|
getSubscriptionCancellationState,
|
|
682
693
|
hasActivePaidSubscription,
|
|
694
|
+
hasCompleteBillingData,
|
|
695
|
+
hasPaidSubscription,
|
|
683
696
|
hasSubscriptionExpired,
|
|
684
697
|
hideCrisp,
|
|
698
|
+
isInternationalAccount,
|
|
685
699
|
isSubscriptionPendingPixResponse,
|
|
686
700
|
isValidCNPJ,
|
|
687
701
|
isValidCPF,
|
|
@@ -718,9 +732,9 @@ export {
|
|
|
718
732
|
useChargeAction,
|
|
719
733
|
useChargeById,
|
|
720
734
|
useCharges,
|
|
721
|
-
|
|
735
|
+
default10 as useCopyToClipboard,
|
|
722
736
|
useCountPages,
|
|
723
|
-
|
|
737
|
+
default15 as useCountdownTimer,
|
|
724
738
|
useCreateCard,
|
|
725
739
|
useCreateProject,
|
|
726
740
|
useCreateSetupIntent,
|
|
@@ -742,7 +756,7 @@ export {
|
|
|
742
756
|
useImageUpload,
|
|
743
757
|
useInfiniteProjects,
|
|
744
758
|
useInvalidateUser,
|
|
745
|
-
|
|
759
|
+
default16 as useIsMobile,
|
|
746
760
|
useListAllAccountUsers,
|
|
747
761
|
useListAvailableUsers,
|
|
748
762
|
useListProjectUsers,
|
|
@@ -753,12 +767,13 @@ export {
|
|
|
753
767
|
useNavigationFallback,
|
|
754
768
|
usePaidPlanRequiredModal,
|
|
755
769
|
useParams,
|
|
756
|
-
|
|
770
|
+
default14 as usePasswordVisibility,
|
|
757
771
|
usePathname,
|
|
758
772
|
usePlanById,
|
|
759
773
|
usePlans,
|
|
760
774
|
useProject,
|
|
761
775
|
useProjects,
|
|
776
|
+
useRequiredBillingData,
|
|
762
777
|
useRouter,
|
|
763
778
|
useSearchParams,
|
|
764
779
|
useSetDefaultCard,
|
|
@@ -771,6 +786,7 @@ export {
|
|
|
771
786
|
useUpdateAccount,
|
|
772
787
|
useUpdateAccountUser,
|
|
773
788
|
useUpdateAccountUserById,
|
|
789
|
+
useUpdateBillingData,
|
|
774
790
|
useUpdateProject,
|
|
775
791
|
useUpdateSubscriptionPayment,
|
|
776
792
|
useUpdateSubscriptionPlan,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Types\nexport * from \"./modules/auth/schema\";\nexport * from \"./modules/users/schema\";\nexport * from \"./modules/whitelabel/schema\";\n// Style types now come from whitelabel schema directly\nexport * from \"./infra/api/types\";\n\n// Contexts\nexport * from \"./providers/query.provider\";\nexport * from \"./providers/auth.provider\";\nexport * from \"./providers/whitelabel.provider\";\nexport {\n NavigationProvider,\n useNavigationFallback,\n} from \"./providers/navigation.provider\";\n\n// Navigation (safe drop-in replacement for next/navigation)\nexport { useRouter } from \"./hooks/useRouter\";\nexport type { SafeAppRouter } from \"./hooks/useRouter\";\nexport {\n usePathname,\n useSearchParams,\n useParams,\n redirect,\n notFound,\n} from \"./utils/next-navigation\";\n\n// Hooks\nexport {\n useListProjectUsers,\n LIST_PROJECT_USERS_QUERY_KEY,\n LIST_PROJECT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-project-users.hook\";\nexport {\n useListAvailableUsers,\n LIST_AVAILABLE_USERS_QUERY_KEY,\n LIST_AVAILABLE_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-available-users.hook\";\nexport {\n useListAllAccountUsers,\n LIST_ALL_ACCOUNT_USERS_QUERY_KEY,\n LIST_ALL_ACCOUNT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-all-account-users.hook\";\nexport {\n useProjects,\n PROJECTS_BASE_KEY,\n PROJECTS_QUERY_KEY,\n} from \"./modules/projects/hooks/list-projects.hook\";\nexport {\n useInfiniteProjects,\n INFINITE_PROJECTS_QUERY_KEY,\n} from \"./modules/projects/hooks/list-infinite-projects.hook\";\nexport { useProject } from \"./modules/projects/hooks/find-project.hook\";\nexport { useCreateProject } from \"./modules/projects/hooks/create-project.hook\";\nexport { useUpdateProject } from \"./modules/projects/hooks/update-project.hook\";\nexport { useDeleteProject } from \"./modules/projects/hooks/delete-project.hook\";\nexport type {\n Project,\n ProjectsPage,\n CreateProjectRequest,\n UpdateProjectRequest,\n ProjectUser,\n AccountUser,\n AddRemoveProjectUsersParams,\n ListUsersParams,\n UsersPage,\n} from \"./modules/projects/types\";\nexport { ProjectSchema } from \"./modules/projects/types\";\nexport type { ListProjectsActionParams } from \"./modules/projects/actions/list-projects.action\";\nexport {\n useUserQuery,\n useUserValidateSession,\n useInvalidateUser,\n useSetUserData,\n useTwoFactorVerify,\n USER_QUERY_KEY,\n} from \"./modules/auth/hooks/useUserQuery\";\nexport { useManagementPermissions } from \"./modules/auth/hooks/useManagementPermissions\";\nexport type { ManagementPermission } from \"./modules/auth/types/management-permission.type\";\nexport { useSocialGoogleLogin } from \"./modules/auth/hooks/social-google-login.hook\";\nexport { useSocialGoogleOnboarding } from \"./modules/auth/hooks/social-google-onboarding.hook\";\nexport { useUnlinkGoogle } from \"./modules/auth/hooks/unlink-google.hook\";\nexport { useSubscriptions } from \"./modules/subscriptions/hooks/list-subscriptions.hook\";\nexport {\n SUBSCRIPTIONS_QUERY_KEY,\n CHARGES_QUERY_KEY,\n} from \"./modules/subscriptions/constants/query-keys.constants\";\nexport { useActiveSubscription } from \"./modules/subscriptions/hooks/find-active-subscription.hook\";\nexport { useCancelledSubscriptionGuard } from \"./modules/subscriptions/hooks/use-cancelled-subscription-guard\";\nexport { usePlanById } from \"./modules/plans/hooks/use-plan-by-id.hook\";\nexport { useHasPlanAddon } from \"./modules/plans/hooks/use-has-plan-addon.hook\";\nexport { useCalculateSubscription } from \"./modules/subscriptions/hooks/calculate-subscription.hook\";\nexport { useUpdateSubscriptionPlan } from \"./modules/subscriptions/hooks/update-subscription-plan.hook\";\nexport { useUpdateSubscriptionPayment } from \"./modules/subscriptions/hooks/update-subscription-payment.hook\";\nexport { useCards, CARDS_QUERY_KEY } from \"./modules/cards/hooks/cards.hook\";\nexport { useCardById } from \"./modules/cards/hooks/card-by-id.hook\";\nexport { useCreateCard } from \"./modules/cards/hooks/create-card.hook\";\nexport { useCreateSetupIntent } from \"./modules/cards/hooks/create-setup-intent.hook\";\nexport { useSetDefaultCard } from \"./modules/cards/hooks/set-default-card.hook\";\nexport { useDeleteCard } from \"./modules/cards/hooks/delete-card.hook\";\nexport { useDeleteConfirmation } from \"./modules/cards/hooks/delete-confirmation.hook\";\nexport type { DeleteConfirmationFormData } from \"./modules/cards/hooks/delete-confirmation.hook\";\nexport { useHandleDeleteCard } from \"./modules/cards/hooks/handle-delete-card.hook\";\nexport { useCharges } from \"./modules/charges/hooks/charges.hook\";\nexport { useChargeById } from \"./modules/charges/hooks/charge-by-id.hook\";\nexport { useChargeAction } from \"./modules/charges/hooks/charge-action.hook\";\nexport { useIaCredits } from \"./modules/ia-credits/hooks/ia-credits.hook\";\nexport type {\n IaCreditsSummary,\n IaCreditsSummaryData,\n IaCreditAddBatch,\n IaCreditOperation,\n} from \"./modules/ia-credits/types\";\nexport type {\n Subscription,\n SubscriptionItem,\n FindSubscriptionsParams,\n} from \"./modules/subscriptions/types/subscription.type\";\nexport {\n SubscriptionSchema,\n SubscriptionItemSchema,\n} from \"./modules/subscriptions/types/subscription.type\";\nexport {\n ADDON_IDS,\n AI_CREDIT_OPTIONS,\n AI_CREDIT_VALUES,\n} from \"./modules/subscriptions/constants/addons.constants\";\nexport type {\n AddonKindEnum,\n AiCreditOption,\n} from \"./modules/subscriptions/constants/addons.constants\";\nexport type {\n Plan,\n PlanItem,\n UiPlan,\n PlanFeature,\n PlanMainFeatures,\n PlanPricingByPeriod,\n PlanTooltips,\n} from \"./modules/plans/types/plan.type\";\nexport { PlanSchema, PlanItemSchema } from \"./modules/plans/types/plan.type\";\nexport {\n mapApiPlanToUiPlan,\n mapApiPlanToUiPlanForCurrency,\n} from \"./modules/plans/utils/map-api-plan-to-ui\";\nexport type { PlanBillingPeriod } from \"./modules/plans/utils/map-api-plan-to-ui\";\nexport {\n usePlans,\n PLANS_QUERY_KEY,\n} from \"./modules/plans/hooks/list-plans.hook\";\nexport type { BillingPeriod } from \"./modules/subscriptions/types/billing-period.type\";\nexport type {\n CalculateSubscriptionRequest,\n CalculateSubscriptionResponse,\n UpdateSubscriptionPlanRequest,\n} from \"./modules/subscriptions/types/calculate-subscription.type\";\nexport {\n PixPendingDataSchema,\n SubscriptionPendingPixResponseSchema,\n isSubscriptionPendingPixResponse,\n} from \"./modules/subscriptions/types/pix-pending.type\";\nexport type {\n PixPendingData,\n SubscriptionPendingPixResponse,\n} from \"./modules/subscriptions/types/pix-pending.type\";\nexport type {\n Card as PaymentCard,\n CreateCardRequest,\n FindCardsParams,\n SetupIntent,\n} from \"./modules/cards/types\";\nexport {\n CardSchema as PaymentCardSchema,\n CreateCardRequestSchema,\n FindCardsParamsSchema,\n SetupIntentSchema,\n} from \"./modules/cards/types\";\nexport type {\n Charge,\n FindChargesParams,\n PayChargeInput,\n} from \"./modules/charges/types/charge.type\";\nexport {\n ChargeSchema,\n FindChargesParamsSchema,\n PayChargeInputSchema,\n} from \"./modules/charges/types/charge.type\";\nexport { buildPlanExtras } from \"./modules/subscriptions/utils/build-plan-extras\";\nexport { hasSubscriptionExpired } from \"./modules/subscriptions/utils/has-subscription-expired\";\nexport { hasActivePaidSubscription } from \"./modules/subscriptions/utils/has-active-paid-subscription\";\nexport {\n confirmPaymentIfRequired,\n PaymentAuthenticationError,\n} from \"./modules/subscriptions/utils/confirm-payment-if-required\";\nexport { SUBSCRIPTION_GRACE_PERIOD_DAYS } from \"./modules/subscriptions/constants/subscription.constants\";\nexport { getSubscriptionCancellationState } from \"./modules/subscriptions/utils/get-subscription-cancellation-state\";\nexport type { SubscriptionCancellationState } from \"./modules/subscriptions/utils/get-subscription-cancellation-state\";\nexport {\n useCountPages,\n COUNT_PAGES_QUERY_KEY,\n} from \"./modules/pages/hooks/count-pages.hook\";\nexport { PAGES_QUERY_KEY } from \"./modules/pages/constants/query-keys.constants\";\nexport {\n getPriceFromCalculatedData,\n getOriginalPriceFromCalculatedData,\n periodicityToBillingPeriod,\n} from \"./modules/subscriptions/utils/periodicity\";\nexport { useBuyCreditsModal } from \"./store/useBuyCreditsModal\";\nexport { useCreditsDisabledModal } from \"./store/useCreditsDisabledModal\";\nexport { usePaidPlanRequiredModal } from \"./store/usePaidPlanRequiredModal\";\nexport { useAccountDeletionWarningModal } from \"./store/useAccountDeletionWarningModal\";\nexport { default as BuyCreditsModal } from \"./components/modals/BuyCreditsModal\";\nexport { default as CreditsDisabledModal } from \"./components/modals/CreditsDisabledModal\";\nexport { default as PaidPlanRequiredModal } from \"./components/modals/PaidPlanRequiredModal\";\nexport { default as AccountDeletionWarningModal } from \"./components/modals/AccountDeletionWarningModal\";\nexport { default as AddCardModal } from \"./components/modals/cards/AddCardModal\";\nexport { DeleteCardModal } from \"./components/modals/cards/DeleteCardModal\";\nexport { CannotDeleteCardModal } from \"./components/modals/cards/CannotDeleteCardModal\";\nexport {\n CardFormFields,\n cardFormSchema,\n buildCardFormSchema,\n} from \"./components/modals/cards/CardFormFields\";\nexport type { CardFormData } from \"./components/modals/cards/CardFormFields\";\nexport { Skeleton } from \"./components/ui/feedback/Skeleton\";\nexport { PaymentInfoCard } from \"./components/ui/data-display/PaymentInfoCard\";\nexport { CardBrandIcon } from \"./components/ui/data-display/CardBrandIcons\";\nexport { CardItem } from \"./components/ui/data-display/CardItem\";\n\n// Providers\nexport { QueryProvider } from \"./providers/query.provider\";\n\n// Middleware\nexport { createAuthMiddleware } from \"./middlewares/create-auth-middleware\";\nexport { createMiddlewareChain } from \"./middlewares/chain\";\nexport { continueChain, stopChain } from \"./middlewares/types\";\nexport type {\n MiddlewareFunction,\n MiddlewareConfig,\n MiddlewareResult,\n} from \"./middlewares/types\";\n\n// Utils\nexport { cn } from \"./infra/utils/clsx\";\nexport { formatShortDate, formatDateTime, calendarDateSchema, toCalendarDate, daysBetween } from \"./infra/utils/date\";\nexport { buildQueryParams } from \"./infra/utils/params\";\nexport { parseSchema, parseResult } from \"./infra/utils/parser\";\nexport { withAction } from \"./utils/withAction\";\nexport { resolveSafeRedirect, sameHostOr } from \"./utils/redirect\";\nexport { COUNTRIES, flagUrl } from \"./utils/countries\";\nexport type { Country } from \"./utils/countries\";\n\n// Layout\nexport {\n MainLayout,\n MainLayoutContent,\n MainLayoutSpacer,\n MainLayoutMain,\n} from \"./components/layouts/MainLayout\";\nexport { NavBar } from \"./components/layouts/NavBar\";\nexport type { NavBarProps } from \"./components/layouts/NavBar\";\nexport { AppNavBar } from \"./components/layouts/AppNavBar\";\nexport type { AppNavBarProps } from \"./components/layouts/AppNavBar\";\nexport { AppMobileNavBar } from \"./components/layouts/AppMobileNavBar\";\nexport type { AppMobileNavBarProps } from \"./components/layouts/AppMobileNavBar\";\nexport { SideBarNavigation } from \"./components/layouts/SideBarNavigation\";\nexport { MdSideBarNavigation } from \"./components/layouts/MdSideBarNavigation\";\nexport { default as NotificationCard } from \"./components/widgets/notifications/NotificationCard\";\nexport type { NotificationCardProps } from \"./components/widgets/notifications/NotificationCard\";\nexport { NotificationsPopover } from \"./components/layouts/NotificationsPopover\";\nexport type { NotificationsPopoverProps } from \"./components/layouts/NotificationsPopover\";\nexport { NotificationPageContent } from \"./components/pages/notifications/Notifications\";\nexport { NotFoundPage } from \"./components/pages/NotFoundPage\";\nexport { UsersSelectorPopover } from \"./components/layouts/UsersSelectorPopover\";\nexport type { UsersSelectorPopoverProps } from \"./components/layouts/UsersSelectorPopover\";\nexport { ProfilePopover } from \"./components/layouts/ProfilePopover\";\nexport type {\n ProfilePopoverProps,\n ProfileMenuItem,\n} from \"./components/layouts/ProfilePopover\";\nexport { default as WhitelabelCodes } from \"./components/layouts/WhitelabelCodes\";\nexport { NavBarItem } from \"./components/layouts/NavBarItem\";\nexport type { NavBarItemProps } from \"./components/layouts/NavBarItem\";\n\n// Navigation\nexport { AppNavigation } from \"./components/navigation/AppNavigation\";\nexport { CancelledSubscriptionBanner } from \"./components/navigation/CancelledSubscriptionBanner\";\nexport { SubscriptionBanner } from \"./components/navigation/SubscriptionBanner\";\nexport { OverdueInvoiceBanner } from \"./components/navigation/OverdueInvoiceBanner\";\nexport { UpcomingInvoiceBanner } from \"./components/navigation/UpcomingInvoiceBanner\";\nexport { TrialBanner } from \"./components/navigation/TrialBanner\";\nexport type { NavItemConfig } from \"./components/navigation/subcomponents/NavItems\";\nexport { useMobileNavbarSheet } from \"./store/useMobileNavbarSheet\";\n\n// Auth Query Key Utilities\nexport {\n useAuthQueryKey,\n useWlQueryKey,\n useWlId,\n} from \"./hooks/useAuthQueryKey\";\n\n// Hooks\nexport { default as useCopyToClipboard } from \"./hooks/copy-to-clipboard.hook\";\n\n// UI - Buttons\nexport { Button, buttonVariants } from \"./components/ui/buttons/Button\";\nexport { CopyButton } from \"./components/ui/buttons/CopyButton\";\nexport { default as CancelButton } from \"./components/ui/buttons/CancelButton\";\n\n// UI - Data Display\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from \"./components/ui/data-display/Accordion\";\nexport { Badge, badgeVariants } from \"./components/ui/data-display/Badge\";\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n} from \"./components/ui/data-display/Card\";\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n} from \"./components/ui/data-display/Pagination\";\nexport { ScrollArea, ScrollBar } from \"./components/ui/data-display/ScrollArea\";\nexport { Separator } from \"./components/ui/data-display/Separator\";\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from \"./components/ui/data-display/Table\";\nexport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n} from \"./components/ui/data-display/Tabs\";\nexport { UserAvatar } from \"./components/ui/data-display/UserAvatar\";\nexport type { UserAvatarProps } from \"./components/ui/data-display/UserAvatar\";\n\n// UI - Feedback\nexport { default as CircularProgress } from \"./components/ui/feedback/CircularProgress\";\nexport { default as DefaultCircularProgress } from \"./components/ui/feedback/DefaultCircularProgress\";\nexport { Progress } from \"./components/ui/feedback/Progress\";\nexport { LoadingOverlay } from \"./components/ui/feedback/LoadingOverlay\";\nexport { useBrandLoadingIcon } from \"./hooks/useBrandLoadingIcon\";\nexport {\n Toast,\n toastVariants,\n toastIconContainerVariants,\n} from \"./components/ui/feedback/Toast\";\nexport type { ToastProps } from \"./components/ui/feedback/Toast\";\n\n// UI - Form\nexport { Calendar, CalendarDayButton } from \"./components/ui/form/Calendar\";\nexport { Checkbox } from \"./components/ui/form/Checkbox\";\nexport { DatePicker } from \"./components/ui/form/DatePicker\";\nexport { DateRangePicker } from \"./components/ui/form/DateRangePicker\";\nexport { Input } from \"./components/ui/form/Input\";\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n} from \"./components/ui/form/InputOtp\";\nexport { RadioGroup, RadioGroupItem } from \"./components/ui/form/RadioGroup\";\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from \"./components/ui/form/Select\";\nexport { Switch } from \"./components/ui/form/Switch\";\nexport { Textarea } from \"./components/ui/form/Textarea\";\n\n// UI - Overlay\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n} from \"./components/ui/overlay/Command\";\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from \"./components/ui/overlay/Dialog\";\nexport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n PopoverAnchor,\n} from \"./components/ui/overlay/Popover\";\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n} from \"./components/ui/overlay/Sheet\";\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n} from \"./components/ui/overlay/Tooltip\";\n\n// Embeds\nexport { FrillEmbed } from \"./components/embeds/FrillEmbed\";\nexport {\n CrispEmbed,\n openCrispHelpdesk,\n hideCrisp,\n showCrisp,\n updateCrispUser,\n} from \"./components/embeds/CrispEmbed\";\nexport { EmbedWidgets } from \"./components/embeds/EmbedWidgets\";\nexport { ClarityEmbed } from \"./components/embeds/ClarityEmbed\";\n\n// Store\nexport { useMdSidebarStore } from \"./store/useMdSidebarStore\";\nexport { useDesktopSidebarStore } from \"./store/useDesktopSidebarStore\";\nexport { useModalManager } from \"./store/useModalManager\";\nexport type { ModalData } from \"./store/useModalManager\";\n\n// Enums\nexport { AccountSectionType } from \"./enums/AccountSectionType\";\n\n// Hooks\nexport { default as usePasswordVisibility } from \"./hooks/usePasswordVisibility\";\nexport { default as useCountdownTimer } from \"./hooks/useCountdownTimer\";\nexport { default as useIsMobile } from \"./hooks/useIsMobile\";\nexport { useDebounce } from \"./hooks/useDebounce\";\nexport { useDebouncedEffect } from \"./hooks/useDebouncedEffect\";\nexport { useDebounceState } from \"./hooks/useDebounceState\";\n\n// Utils\nexport {\n formatPhone,\n formatTimer,\n formatFullName,\n formatCPF,\n formatCNPJ,\n formatCardNumber,\n} from \"./utils/format/masks\";\nexport {\n formatCurrency,\n formatCurrencyNumber,\n parseCurrencyToNumber,\n getCurrencyForGateway,\n} from \"./utils/format/currency\";\nexport type { CurrencyCode } from \"./utils/format/currency\";\nexport { isValidCPF, isValidCNPJ, isValidTaxId } from \"./utils/validators/common\";\nexport { BR_STATE_OPTIONS } from \"./utils/constants/br-states\";\nexport type { TimezoneOption } from \"./modules/accounts/services/timezone.service\";\nexport {\n buildLocaleOptions,\n LANGUAGE_OPTIONS as LOCALE_LANGUAGE_OPTIONS,\n} from \"./utils/intl/locales\";\nexport type { LocaleOption } from \"./utils/intl/locales\";\nexport { copyToClipboard, readFromClipboard } from \"./utils/browser/clipboard\";\n\n// UI - Form (new widgets)\nexport { FormField } from \"./components/ui/form/FormField\";\nexport { SelectField } from \"./components/ui/form/SelectField\";\nexport { ComboboxField } from \"./components/ui/form/ComboboxField\";\nexport type { ComboboxOption } from \"./components/ui/form/ComboboxField\";\nexport { default as PhoneInput } from \"./components/ui/form/PhoneInput\";\nexport { default as SwitchOptionFieldWithIcon } from \"./components/ui/form/SwitchOptionFieldWithIcon\";\nexport { TextAreaField } from \"./components/ui/form/TextAreaField\";\n\n// Account Module - Hooks\nexport {\n useCurrentAccount,\n ACCOUNT_QUERY_KEY,\n} from \"./modules/accounts/hooks/current-account.hook\";\nexport { useCurrencyFormatter } from \"./modules/accounts/hooks/use-currency-formatter.hook\";\nexport {\n useUpdateAccount,\n useUpdateAccountUser,\n useUpdateAccountUserById,\n useDeleteAccountUser,\n useDeleteAccount,\n ACCOUNT_USERS_QUERY_KEY,\n} from \"./modules/accounts/hooks/useAccountManagement\";\nexport { useViaCep } from \"./modules/accounts/hooks/useViaCep\";\nexport { useAccountToken } from \"./modules/accounts/hooks/use-account-token.hook\";\n\n// Account Types\nexport type {\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n ChangePasswordRequest,\n DeleteAccountActionResult,\n DeleteUserActionResult,\n UpdateAccountActionResult,\n UpdateUserActionResult,\n TwoFactorGenerateResult,\n TwoFactorActionResult,\n ContactResetResult,\n} from \"./modules/accounts/types\";\n\nexport { default as AccountModals } from \"./components/account/AccountModals\";\nexport { useAccountModals } from \"./store/useAccountModals\";\nexport type { AccountModalsConfig } from \"./store/useAccountModals\";\n\nexport { ModalManager } from \"./components/modals/ModalManager\";\nexport { Modals } from \"./components/modals/Modals\";\n\nexport { default as TwoFactorAuthModal } from \"./components/account/TwoFactorAuthModal\";\nexport { default as DisableTwoFactorAuthModal } from \"./components/account/DisableTwoFactorAuthModal\";\nexport { default as ConfirmGlobalPreferencesModal } from \"./components/account/ConfirmGlobalPreferencesModal\";\nexport { MyProfileSection } from \"./components/account/sections/MyProfileSection\";\nexport { PreferencesSection } from \"./components/account/sections/PreferencesSection\";\nexport { SecuritySection } from \"./components/account/sections/SecuritySection\";\nexport { ChangePasswordSection } from \"./components/account/sections/ChangePasswordSection\";\nexport { ChangeEmailModal } from \"./components/account/sections/ChangeEmailModal\";\nexport { ChangePhoneModal } from \"./components/account/sections/ChangePhoneModal\";\n\n// Account Constants\nexport {\n GENDER_OPTIONS,\n CURRENCY_OPTIONS,\n TIME_FORMAT_OPTIONS,\n NOTIFICATION_TYPES,\n LANGUAGE_OPTIONS,\n} from \"./components/account/constants\";\n\n// Image Upload\nexport {\n ImageUpload,\n ImageCropModal,\n ImageTooSmallModal,\n} from \"./components/widgets/ImageUpload\";\nexport {\n useImageUpload,\n type ImageTooSmallError,\n} from \"./modules/images/hooks/use-image-upload.hook\";\nexport {\n ACCEPTED_IMAGE_FORMATS,\n ACCEPTED_IMAGE_FORMATS_STRING,\n MAX_FILE_SIZE_MB,\n} from \"./modules/images/constants/image.constants\";\nexport type {\n ImageConfig,\n CropArea,\n ProcessedImage,\n CompressImageOptions,\n} from \"./modules/images/types/image.type\";\nexport { compressImage } from \"./modules/images/utils/compress-image\";\nexport { cropImageToCanvas } from \"./modules/images/utils/crop-image\";\nexport { base64ToFile, fileToBase64 } from \"./modules/images/utils/base64\";\nexport {\n validateImage,\n validateImageFormat,\n validateImageSize,\n getImageDimensions,\n} from \"./modules/images/utils/validate-image\";\n"],"mappings":"AACA,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAGP,SAAS,iBAAiB;AAE1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AACjC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AAA,OACK;AACP,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAgBhC,SAAoB,WAAXA,iBAAgC;AACzC,SAAS,wBAAwB;AAGjC,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AAEvB,SAAoB,WAAXA,iBAAqC;AAC9C,SAAoB,WAAXA,iBAA4C;AACrD,SAAoB,WAAXA,iBAAgD;AACzD,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAGjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAAC;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,SAAS,cAAc,oBAAoB;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["default","LANGUAGE_OPTIONS"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Types\nexport * from \"./modules/auth/schema\";\nexport * from \"./modules/users/schema\";\nexport * from \"./modules/whitelabel/schema\";\n// Style types now come from whitelabel schema directly\nexport * from \"./infra/api/types\";\n\n// Contexts\nexport * from \"./providers/query.provider\";\nexport * from \"./providers/auth.provider\";\nexport * from \"./providers/whitelabel.provider\";\nexport {\n NavigationProvider,\n useNavigationFallback,\n} from \"./providers/navigation.provider\";\n\n// Navigation (safe drop-in replacement for next/navigation)\nexport { useRouter } from \"./hooks/useRouter\";\nexport type { SafeAppRouter } from \"./hooks/useRouter\";\nexport {\n usePathname,\n useSearchParams,\n useParams,\n redirect,\n notFound,\n} from \"./utils/next-navigation\";\n\n// Hooks\nexport {\n useListProjectUsers,\n LIST_PROJECT_USERS_QUERY_KEY,\n LIST_PROJECT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-project-users.hook\";\nexport {\n useListAvailableUsers,\n LIST_AVAILABLE_USERS_QUERY_KEY,\n LIST_AVAILABLE_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-available-users.hook\";\nexport {\n useListAllAccountUsers,\n LIST_ALL_ACCOUNT_USERS_QUERY_KEY,\n LIST_ALL_ACCOUNT_USERS_BASE_KEY,\n} from \"./modules/projects/hooks/list-all-account-users.hook\";\nexport {\n useProjects,\n PROJECTS_BASE_KEY,\n PROJECTS_QUERY_KEY,\n} from \"./modules/projects/hooks/list-projects.hook\";\nexport {\n useInfiniteProjects,\n INFINITE_PROJECTS_QUERY_KEY,\n} from \"./modules/projects/hooks/list-infinite-projects.hook\";\nexport { useProject } from \"./modules/projects/hooks/find-project.hook\";\nexport { useCreateProject } from \"./modules/projects/hooks/create-project.hook\";\nexport { useUpdateProject } from \"./modules/projects/hooks/update-project.hook\";\nexport { useDeleteProject } from \"./modules/projects/hooks/delete-project.hook\";\nexport type {\n Project,\n ProjectsPage,\n CreateProjectRequest,\n UpdateProjectRequest,\n ProjectUser,\n AccountUser,\n AddRemoveProjectUsersParams,\n ListUsersParams,\n UsersPage,\n} from \"./modules/projects/types\";\nexport { ProjectSchema } from \"./modules/projects/types\";\nexport type { ListProjectsActionParams } from \"./modules/projects/actions/list-projects.action\";\nexport {\n useUserQuery,\n useUserValidateSession,\n useInvalidateUser,\n useSetUserData,\n useTwoFactorVerify,\n USER_QUERY_KEY,\n} from \"./modules/auth/hooks/useUserQuery\";\nexport { useManagementPermissions } from \"./modules/auth/hooks/useManagementPermissions\";\nexport type { ManagementPermission } from \"./modules/auth/types/management-permission.type\";\nexport { useSocialGoogleLogin } from \"./modules/auth/hooks/social-google-login.hook\";\nexport { useSocialGoogleOnboarding } from \"./modules/auth/hooks/social-google-onboarding.hook\";\nexport { useUnlinkGoogle } from \"./modules/auth/hooks/unlink-google.hook\";\nexport { useSubscriptions } from \"./modules/subscriptions/hooks/list-subscriptions.hook\";\nexport {\n SUBSCRIPTIONS_QUERY_KEY,\n CHARGES_QUERY_KEY,\n} from \"./modules/subscriptions/constants/query-keys.constants\";\nexport { useActiveSubscription } from \"./modules/subscriptions/hooks/find-active-subscription.hook\";\nexport { useCancelledSubscriptionGuard } from \"./modules/subscriptions/hooks/use-cancelled-subscription-guard\";\nexport { usePlanById } from \"./modules/plans/hooks/use-plan-by-id.hook\";\nexport { useHasPlanAddon } from \"./modules/plans/hooks/use-has-plan-addon.hook\";\nexport { useCalculateSubscription } from \"./modules/subscriptions/hooks/calculate-subscription.hook\";\nexport { useUpdateSubscriptionPlan } from \"./modules/subscriptions/hooks/update-subscription-plan.hook\";\nexport { useUpdateSubscriptionPayment } from \"./modules/subscriptions/hooks/update-subscription-payment.hook\";\nexport { useCards, CARDS_QUERY_KEY } from \"./modules/cards/hooks/cards.hook\";\nexport { useCardById } from \"./modules/cards/hooks/card-by-id.hook\";\nexport { useCreateCard } from \"./modules/cards/hooks/create-card.hook\";\nexport { useCreateSetupIntent } from \"./modules/cards/hooks/create-setup-intent.hook\";\nexport { useSetDefaultCard } from \"./modules/cards/hooks/set-default-card.hook\";\nexport { useDeleteCard } from \"./modules/cards/hooks/delete-card.hook\";\nexport { useDeleteConfirmation } from \"./modules/cards/hooks/delete-confirmation.hook\";\nexport type { DeleteConfirmationFormData } from \"./modules/cards/hooks/delete-confirmation.hook\";\nexport { useHandleDeleteCard } from \"./modules/cards/hooks/handle-delete-card.hook\";\nexport { useCharges } from \"./modules/charges/hooks/charges.hook\";\nexport { useChargeById } from \"./modules/charges/hooks/charge-by-id.hook\";\nexport { useChargeAction } from \"./modules/charges/hooks/charge-action.hook\";\nexport { useIaCredits } from \"./modules/ia-credits/hooks/ia-credits.hook\";\nexport type {\n IaCreditsSummary,\n IaCreditsSummaryData,\n IaCreditAddBatch,\n IaCreditOperation,\n} from \"./modules/ia-credits/types\";\nexport type {\n Subscription,\n SubscriptionItem,\n FindSubscriptionsParams,\n} from \"./modules/subscriptions/types/subscription.type\";\nexport {\n SubscriptionSchema,\n SubscriptionItemSchema,\n} from \"./modules/subscriptions/types/subscription.type\";\nexport {\n ADDON_IDS,\n AI_CREDIT_OPTIONS,\n AI_CREDIT_VALUES,\n} from \"./modules/subscriptions/constants/addons.constants\";\nexport type {\n AddonKindEnum,\n AiCreditOption,\n} from \"./modules/subscriptions/constants/addons.constants\";\nexport type {\n Plan,\n PlanItem,\n UiPlan,\n PlanFeature,\n PlanMainFeatures,\n PlanPricingByPeriod,\n PlanTooltips,\n} from \"./modules/plans/types/plan.type\";\nexport { PlanSchema, PlanItemSchema } from \"./modules/plans/types/plan.type\";\nexport {\n mapApiPlanToUiPlan,\n mapApiPlanToUiPlanForCurrency,\n} from \"./modules/plans/utils/map-api-plan-to-ui\";\nexport type { PlanBillingPeriod } from \"./modules/plans/utils/map-api-plan-to-ui\";\nexport {\n usePlans,\n PLANS_QUERY_KEY,\n} from \"./modules/plans/hooks/list-plans.hook\";\nexport type { BillingPeriod } from \"./modules/subscriptions/types/billing-period.type\";\nexport type {\n CalculateSubscriptionRequest,\n CalculateSubscriptionResponse,\n UpdateSubscriptionPlanRequest,\n} from \"./modules/subscriptions/types/calculate-subscription.type\";\nexport {\n PixPendingDataSchema,\n SubscriptionPendingPixResponseSchema,\n isSubscriptionPendingPixResponse,\n} from \"./modules/subscriptions/types/pix-pending.type\";\nexport type {\n PixPendingData,\n SubscriptionPendingPixResponse,\n} from \"./modules/subscriptions/types/pix-pending.type\";\nexport type {\n Card as PaymentCard,\n CreateCardRequest,\n FindCardsParams,\n SetupIntent,\n} from \"./modules/cards/types\";\nexport {\n CardSchema as PaymentCardSchema,\n CreateCardRequestSchema,\n FindCardsParamsSchema,\n SetupIntentSchema,\n} from \"./modules/cards/types\";\nexport type {\n Charge,\n FindChargesParams,\n PayChargeInput,\n} from \"./modules/charges/types/charge.type\";\nexport {\n ChargeSchema,\n FindChargesParamsSchema,\n PayChargeInputSchema,\n} from \"./modules/charges/types/charge.type\";\nexport { buildPlanExtras } from \"./modules/subscriptions/utils/build-plan-extras\";\nexport { hasSubscriptionExpired } from \"./modules/subscriptions/utils/has-subscription-expired\";\nexport { hasActivePaidSubscription } from \"./modules/subscriptions/utils/has-active-paid-subscription\";\nexport { hasPaidSubscription } from \"./modules/subscriptions/utils/has-paid-subscription\";\nexport {\n confirmPaymentIfRequired,\n PaymentAuthenticationError,\n} from \"./modules/subscriptions/utils/confirm-payment-if-required\";\nexport { SUBSCRIPTION_GRACE_PERIOD_DAYS } from \"./modules/subscriptions/constants/subscription.constants\";\nexport { getSubscriptionCancellationState } from \"./modules/subscriptions/utils/get-subscription-cancellation-state\";\nexport type { SubscriptionCancellationState } from \"./modules/subscriptions/utils/get-subscription-cancellation-state\";\nexport {\n useCountPages,\n COUNT_PAGES_QUERY_KEY,\n} from \"./modules/pages/hooks/count-pages.hook\";\nexport { PAGES_QUERY_KEY } from \"./modules/pages/constants/query-keys.constants\";\nexport {\n getPriceFromCalculatedData,\n getOriginalPriceFromCalculatedData,\n periodicityToBillingPeriod,\n} from \"./modules/subscriptions/utils/periodicity\";\nexport { useBuyCreditsModal } from \"./store/useBuyCreditsModal\";\nexport { useCreditsDisabledModal } from \"./store/useCreditsDisabledModal\";\nexport { usePaidPlanRequiredModal } from \"./store/usePaidPlanRequiredModal\";\nexport { useAccountDeletionWarningModal } from \"./store/useAccountDeletionWarningModal\";\nexport { default as BuyCreditsModal } from \"./components/modals/BuyCreditsModal\";\nexport { default as CreditsDisabledModal } from \"./components/modals/CreditsDisabledModal\";\nexport { default as PaidPlanRequiredModal } from \"./components/modals/PaidPlanRequiredModal\";\nexport { default as AccountDeletionWarningModal } from \"./components/modals/AccountDeletionWarningModal\";\nexport { default as RequiredBillingDataModal } from \"./components/modals/billing/RequiredBillingDataModal\";\nexport { default as AddCardModal } from \"./components/modals/cards/AddCardModal\";\nexport { DeleteCardModal } from \"./components/modals/cards/DeleteCardModal\";\nexport { CannotDeleteCardModal } from \"./components/modals/cards/CannotDeleteCardModal\";\nexport {\n CardFormFields,\n cardFormSchema,\n buildCardFormSchema,\n} from \"./components/modals/cards/CardFormFields\";\nexport type { CardFormData } from \"./components/modals/cards/CardFormFields\";\nexport { Skeleton } from \"./components/ui/feedback/Skeleton\";\nexport { PaymentInfoCard } from \"./components/ui/data-display/PaymentInfoCard\";\nexport { CardBrandIcon } from \"./components/ui/data-display/CardBrandIcons\";\nexport { CardItem } from \"./components/ui/data-display/CardItem\";\n\n// Providers\nexport { QueryProvider } from \"./providers/query.provider\";\n\n// Middleware\nexport { createAuthMiddleware } from \"./middlewares/create-auth-middleware\";\nexport { createMiddlewareChain } from \"./middlewares/chain\";\nexport { continueChain, stopChain } from \"./middlewares/types\";\nexport type {\n MiddlewareFunction,\n MiddlewareConfig,\n MiddlewareResult,\n} from \"./middlewares/types\";\n\n// Utils\nexport { cn } from \"./infra/utils/clsx\";\nexport { formatShortDate, formatDateTime, calendarDateSchema, toCalendarDate, daysBetween } from \"./infra/utils/date\";\nexport { buildQueryParams } from \"./infra/utils/params\";\nexport { parseSchema, parseResult } from \"./infra/utils/parser\";\nexport { withAction } from \"./utils/withAction\";\nexport { resolveSafeRedirect, sameHostOr } from \"./utils/redirect\";\nexport { COUNTRIES, flagUrl } from \"./utils/countries\";\nexport type { Country } from \"./utils/countries\";\n\n// Layout\nexport {\n MainLayout,\n MainLayoutContent,\n MainLayoutSpacer,\n MainLayoutMain,\n} from \"./components/layouts/MainLayout\";\nexport { NavBar } from \"./components/layouts/NavBar\";\nexport type { NavBarProps } from \"./components/layouts/NavBar\";\nexport { AppNavBar } from \"./components/layouts/AppNavBar\";\nexport type { AppNavBarProps } from \"./components/layouts/AppNavBar\";\nexport { AppMobileNavBar } from \"./components/layouts/AppMobileNavBar\";\nexport type { AppMobileNavBarProps } from \"./components/layouts/AppMobileNavBar\";\nexport { SideBarNavigation } from \"./components/layouts/SideBarNavigation\";\nexport { MdSideBarNavigation } from \"./components/layouts/MdSideBarNavigation\";\nexport { default as NotificationCard } from \"./components/widgets/notifications/NotificationCard\";\nexport type { NotificationCardProps } from \"./components/widgets/notifications/NotificationCard\";\nexport { NotificationsPopover } from \"./components/layouts/NotificationsPopover\";\nexport type { NotificationsPopoverProps } from \"./components/layouts/NotificationsPopover\";\nexport { NotificationPageContent } from \"./components/pages/notifications/Notifications\";\nexport { NotFoundPage } from \"./components/pages/NotFoundPage\";\nexport { UsersSelectorPopover } from \"./components/layouts/UsersSelectorPopover\";\nexport type { UsersSelectorPopoverProps } from \"./components/layouts/UsersSelectorPopover\";\nexport { ProfilePopover } from \"./components/layouts/ProfilePopover\";\nexport type {\n ProfilePopoverProps,\n ProfileMenuItem,\n} from \"./components/layouts/ProfilePopover\";\nexport { default as WhitelabelCodes } from \"./components/layouts/WhitelabelCodes\";\nexport { NavBarItem } from \"./components/layouts/NavBarItem\";\nexport type { NavBarItemProps } from \"./components/layouts/NavBarItem\";\n\n// Navigation\nexport { AppNavigation } from \"./components/navigation/AppNavigation\";\nexport { CancelledSubscriptionBanner } from \"./components/navigation/CancelledSubscriptionBanner\";\nexport { SubscriptionBanner } from \"./components/navigation/SubscriptionBanner\";\nexport { OverdueInvoiceBanner } from \"./components/navigation/OverdueInvoiceBanner\";\nexport { UpcomingInvoiceBanner } from \"./components/navigation/UpcomingInvoiceBanner\";\nexport { TrialBanner } from \"./components/navigation/TrialBanner\";\nexport type { NavItemConfig } from \"./components/navigation/subcomponents/NavItems\";\nexport { useMobileNavbarSheet } from \"./store/useMobileNavbarSheet\";\n\n// Auth Query Key Utilities\nexport {\n useAuthQueryKey,\n useWlQueryKey,\n useWlId,\n} from \"./hooks/useAuthQueryKey\";\n\n// Hooks\nexport { default as useCopyToClipboard } from \"./hooks/copy-to-clipboard.hook\";\n\n// UI - Buttons\nexport { Button, buttonVariants } from \"./components/ui/buttons/Button\";\nexport { CopyButton } from \"./components/ui/buttons/CopyButton\";\nexport { default as CancelButton } from \"./components/ui/buttons/CancelButton\";\n\n// UI - Data Display\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n} from \"./components/ui/data-display/Accordion\";\nexport { Badge, badgeVariants } from \"./components/ui/data-display/Badge\";\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n} from \"./components/ui/data-display/Card\";\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n} from \"./components/ui/data-display/Pagination\";\nexport { ScrollArea, ScrollBar } from \"./components/ui/data-display/ScrollArea\";\nexport { Separator } from \"./components/ui/data-display/Separator\";\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableHead,\n TableRow,\n TableCell,\n TableCaption,\n} from \"./components/ui/data-display/Table\";\nexport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n} from \"./components/ui/data-display/Tabs\";\nexport { UserAvatar } from \"./components/ui/data-display/UserAvatar\";\nexport type { UserAvatarProps } from \"./components/ui/data-display/UserAvatar\";\n\n// UI - Feedback\nexport { default as CircularProgress } from \"./components/ui/feedback/CircularProgress\";\nexport { default as DefaultCircularProgress } from \"./components/ui/feedback/DefaultCircularProgress\";\nexport { Progress } from \"./components/ui/feedback/Progress\";\nexport { LoadingOverlay } from \"./components/ui/feedback/LoadingOverlay\";\nexport { useBrandLoadingIcon } from \"./hooks/useBrandLoadingIcon\";\nexport {\n Toast,\n toastVariants,\n toastIconContainerVariants,\n} from \"./components/ui/feedback/Toast\";\nexport type { ToastProps } from \"./components/ui/feedback/Toast\";\n\n// UI - Form\nexport { Calendar, CalendarDayButton } from \"./components/ui/form/Calendar\";\nexport { Checkbox } from \"./components/ui/form/Checkbox\";\nexport { DatePicker } from \"./components/ui/form/DatePicker\";\nexport { DateRangePicker } from \"./components/ui/form/DateRangePicker\";\nexport { Input } from \"./components/ui/form/Input\";\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n InputOTPSeparator,\n} from \"./components/ui/form/InputOtp\";\nexport { RadioGroup, RadioGroupItem } from \"./components/ui/form/RadioGroup\";\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n} from \"./components/ui/form/Select\";\nexport { Switch } from \"./components/ui/form/Switch\";\nexport { Textarea } from \"./components/ui/form/Textarea\";\n\n// UI - Overlay\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n} from \"./components/ui/overlay/Command\";\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n} from \"./components/ui/overlay/Dialog\";\nexport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n PopoverAnchor,\n} from \"./components/ui/overlay/Popover\";\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n} from \"./components/ui/overlay/Sheet\";\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n TooltipProvider,\n} from \"./components/ui/overlay/Tooltip\";\n\n// Embeds\nexport { FrillEmbed } from \"./components/embeds/FrillEmbed\";\nexport {\n CrispEmbed,\n openCrispHelpdesk,\n hideCrisp,\n showCrisp,\n updateCrispUser,\n} from \"./components/embeds/CrispEmbed\";\nexport { EmbedWidgets } from \"./components/embeds/EmbedWidgets\";\nexport { ClarityEmbed } from \"./components/embeds/ClarityEmbed\";\n\n// Store\nexport { useMdSidebarStore } from \"./store/useMdSidebarStore\";\nexport { useDesktopSidebarStore } from \"./store/useDesktopSidebarStore\";\nexport { useModalManager } from \"./store/useModalManager\";\nexport type { ModalData } from \"./store/useModalManager\";\n\n// Enums\nexport { AccountSectionType } from \"./enums/AccountSectionType\";\n\n// Hooks\nexport { default as usePasswordVisibility } from \"./hooks/usePasswordVisibility\";\nexport { default as useCountdownTimer } from \"./hooks/useCountdownTimer\";\nexport { default as useIsMobile } from \"./hooks/useIsMobile\";\nexport { useDebounce } from \"./hooks/useDebounce\";\nexport { useDebouncedEffect } from \"./hooks/useDebouncedEffect\";\nexport { useDebounceState } from \"./hooks/useDebounceState\";\n\n// Utils\nexport {\n formatPhone,\n formatTimer,\n formatFullName,\n formatCPF,\n formatCNPJ,\n formatCardNumber,\n} from \"./utils/format/masks\";\nexport {\n formatCurrency,\n formatCurrencyNumber,\n parseCurrencyToNumber,\n getCurrencyForGateway,\n} from \"./utils/format/currency\";\nexport type { CurrencyCode } from \"./utils/format/currency\";\nexport { isValidCPF, isValidCNPJ, isValidTaxId } from \"./utils/validators/common\";\nexport { BR_STATE_OPTIONS } from \"./utils/constants/br-states\";\nexport type { TimezoneOption } from \"./modules/accounts/services/timezone.service\";\nexport {\n buildLocaleOptions,\n LANGUAGE_OPTIONS as LOCALE_LANGUAGE_OPTIONS,\n} from \"./utils/intl/locales\";\nexport type { LocaleOption } from \"./utils/intl/locales\";\nexport { copyToClipboard, readFromClipboard } from \"./utils/browser/clipboard\";\n\n// UI - Form (new widgets)\nexport { FormField } from \"./components/ui/form/FormField\";\nexport { SelectField } from \"./components/ui/form/SelectField\";\nexport { ComboboxField } from \"./components/ui/form/ComboboxField\";\nexport type { ComboboxOption } from \"./components/ui/form/ComboboxField\";\nexport { default as PhoneInput } from \"./components/ui/form/PhoneInput\";\nexport { default as SwitchOptionFieldWithIcon } from \"./components/ui/form/SwitchOptionFieldWithIcon\";\nexport { TextAreaField } from \"./components/ui/form/TextAreaField\";\n\n// Account Module - Hooks\nexport {\n useCurrentAccount,\n ACCOUNT_QUERY_KEY,\n} from \"./modules/accounts/hooks/current-account.hook\";\nexport { useCurrencyFormatter } from \"./modules/accounts/hooks/use-currency-formatter.hook\";\nexport {\n useUpdateAccount,\n useUpdateAccountUser,\n useUpdateAccountUserById,\n useUpdateBillingData,\n useDeleteAccountUser,\n useDeleteAccount,\n ACCOUNT_USERS_QUERY_KEY,\n} from \"./modules/accounts/hooks/useAccountManagement\";\nexport { useViaCep } from \"./modules/accounts/hooks/useViaCep\";\nexport { useAccountToken } from \"./modules/accounts/hooks/use-account-token.hook\";\nexport { useRequiredBillingData } from \"./modules/accounts/hooks/use-required-billing-data.hook\";\nexport {\n hasCompleteBillingData,\n isInternationalAccount,\n INTERNATIONAL_GATEWAY,\n} from \"./modules/accounts/utils/billing-data\";\nexport type { BillingDataSnapshot } from \"./modules/accounts/utils/billing-data\";\n\n// Account Types\nexport type {\n UpdateAccountRequest,\n UpdateBillingDataRequest,\n UpdateAccountUserRequest,\n ChangePasswordRequest,\n DeleteAccountActionResult,\n DeleteUserActionResult,\n UpdateAccountActionResult,\n UpdateUserActionResult,\n TwoFactorGenerateResult,\n TwoFactorActionResult,\n ContactResetResult,\n} from \"./modules/accounts/types\";\n\nexport { default as AccountModals } from \"./components/account/AccountModals\";\nexport { useAccountModals } from \"./store/useAccountModals\";\nexport type { AccountModalsConfig } from \"./store/useAccountModals\";\n\nexport { ModalManager } from \"./components/modals/ModalManager\";\nexport { Modals } from \"./components/modals/Modals\";\n\nexport { default as TwoFactorAuthModal } from \"./components/account/TwoFactorAuthModal\";\nexport { default as DisableTwoFactorAuthModal } from \"./components/account/DisableTwoFactorAuthModal\";\nexport { default as ConfirmGlobalPreferencesModal } from \"./components/account/ConfirmGlobalPreferencesModal\";\nexport { MyProfileSection } from \"./components/account/sections/MyProfileSection\";\nexport { PreferencesSection } from \"./components/account/sections/PreferencesSection\";\nexport { SecuritySection } from \"./components/account/sections/SecuritySection\";\nexport { ChangePasswordSection } from \"./components/account/sections/ChangePasswordSection\";\nexport { ChangeEmailModal } from \"./components/account/sections/ChangeEmailModal\";\nexport { ChangePhoneModal } from \"./components/account/sections/ChangePhoneModal\";\n\n// Account Constants\nexport {\n GENDER_OPTIONS,\n CURRENCY_OPTIONS,\n TIME_FORMAT_OPTIONS,\n NOTIFICATION_TYPES,\n LANGUAGE_OPTIONS,\n} from \"./components/account/constants\";\n\n// Image Upload\nexport {\n ImageUpload,\n ImageCropModal,\n ImageTooSmallModal,\n} from \"./components/widgets/ImageUpload\";\nexport {\n useImageUpload,\n type ImageTooSmallError,\n} from \"./modules/images/hooks/use-image-upload.hook\";\nexport {\n ACCEPTED_IMAGE_FORMATS,\n ACCEPTED_IMAGE_FORMATS_STRING,\n MAX_FILE_SIZE_MB,\n} from \"./modules/images/constants/image.constants\";\nexport type {\n ImageConfig,\n CropArea,\n ProcessedImage,\n CompressImageOptions,\n} from \"./modules/images/types/image.type\";\nexport { compressImage } from \"./modules/images/utils/compress-image\";\nexport { cropImageToCanvas } from \"./modules/images/utils/crop-image\";\nexport { base64ToFile, fileToBase64 } from \"./modules/images/utils/base64\";\nexport {\n validateImage,\n validateImageFormat,\n validateImageSize,\n getImageDimensions,\n} from \"./modules/images/utils/validate-image\";\n"],"mappings":"AACA,cAAc;AACd,cAAc;AACd,cAAc;AAEd,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAGP,SAAS,iBAAiB;AAE1B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AACjC,SAAS,w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S,qBAAqB;AAG9B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAChC,SAAS,8BAA8B;AACvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAkBP,SAAoB,WAAXA,iBAAgC;AACzC,SAAS,wBAAwB;AAGjC,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AAEvB,SAAoB,WAAXA,iBAAqC;AAC9C,SAAoB,WAAXA,iBAA4C;AACrD,SAAoB,WAAXA,iBAAgD;AACzD,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAGjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,oBAAAC;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,SAAS,cAAc,oBAAoB;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":["default","LANGUAGE_OPTIONS"]}
|
|
@@ -33,6 +33,20 @@ async function updateAccountAction(data) {
|
|
|
33
33
|
return accountService.updateAccount(data);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
async function updateBillingDataAction(data) {
|
|
37
|
+
return safeMutationAction(async () => {
|
|
38
|
+
const userResult = await findUserById();
|
|
39
|
+
const profile = userResult.success ? userResult.data?.profile : void 0;
|
|
40
|
+
if (profile !== UserProfile.owner && profile !== UserProfile.admin) {
|
|
41
|
+
throw new ApiError(
|
|
42
|
+
"Apenas o propriet\xE1rio ou um administrador pode alterar os dados de cobran\xE7a",
|
|
43
|
+
"FORBIDDEN",
|
|
44
|
+
403
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
return accountService.updateAccount(data);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
36
50
|
async function deleteAccountUserAction(userId) {
|
|
37
51
|
return safeMutationAction(() => accountService.deleteAccountUser(userId));
|
|
38
52
|
}
|
|
@@ -94,6 +108,7 @@ export {
|
|
|
94
108
|
requestPhoneChangeAction,
|
|
95
109
|
updateAccountAction,
|
|
96
110
|
updateAccountUserByIdAction,
|
|
111
|
+
updateBillingDataAction,
|
|
97
112
|
updateUserAction
|
|
98
113
|
};
|
|
99
114
|
//# sourceMappingURL=account-management.action.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/accounts/actions/account-management.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { safeMutationAction } from '../../../utils/safeMutationAction';\nimport { accountService } from '../services/account.service';\nimport type {\n AccountUsersPaginationParams,\n ChangePasswordRequest,\n CreateAccountUserRequest,\n DeleteAccountRequest,\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n} from '../types';\nimport { twoFactorService } from '../services/two-factor.service';\nimport { findUserById } from '../../users/action/find-user-by-id.action';\nimport { UserProfile } from '../../users/schema';\nimport { ApiError } from '../../../infra/api/types';\n\nexport async function listAccountUsersAction(params?: AccountUsersPaginationParams) {\n return safeServerAction(async () => {\n const { users, total } = await accountService.listAccountUsers(params);\n return { data: users, total };\n });\n}\n\nexport async function updateUserAction(user: UpdateAccountUserRequest) {\n return safeMutationAction(() => accountService.updateAccountUser(user));\n}\n\nexport async function updateAccountUserByIdAction(\n userId: number,\n user: UpdateAccountUserRequest\n) {\n return safeMutationAction(() => accountService.updateAccountUserById(userId, user));\n}\n\nexport async function updateAccountAction(data: UpdateAccountRequest) {\n return safeMutationAction(async () => {\n if (data.name !== undefined) {\n const userResult = await findUserById();\n if (!userResult.success || userResult.data?.profile !== UserProfile.owner) {\n throw new ApiError(\n 'Apenas o proprietário da conta pode alterar o nome da empresa',\n 'FORBIDDEN',\n 403\n );\n }\n }\n\n return accountService.updateAccount(data);\n });\n}\n\nexport async function deleteAccountUserAction(userId: number) {\n return safeMutationAction(() => accountService.deleteAccountUser(userId));\n}\n\nexport async function deleteAccountAction(data: DeleteAccountRequest) {\n return safeMutationAction(() => accountService.deleteAccount(data));\n}\n\nexport async function createAccountUserAction(user: CreateAccountUserRequest) {\n return safeMutationAction(() => accountService.createAccountUser(user));\n}\n\nexport async function changePasswordAction(data: ChangePasswordRequest) {\n return safeMutationAction(() => accountService.changePassword(data));\n}\n\nexport async function requestEmailChangeAction(newEmail: string) {\n return safeMutationAction(() => accountService.requestContactReset('email', newEmail));\n}\n\nexport async function confirmEmailChangeAction(token: string, newEmail: string) {\n return safeMutationAction(() => accountService.confirmContactReset('email', token, newEmail));\n}\n\nexport async function requestPhoneChangeAction(newPhone: string, ddi?: string) {\n return safeMutationAction(() => accountService.requestContactReset('phone', newPhone, ddi));\n}\n\nexport async function confirmPhoneChangeAction(token: string, newPhone: string, ddi?: string) {\n return safeMutationAction(() => accountService.confirmContactReset('phone', token, newPhone, ddi));\n}\n\nexport async function generateTwoFactorAction() {\n return safeMutationAction(async () => {\n const result = await twoFactorService.generate();\n return {\n qrcode: result.data.qrcode,\n backupCodes: result.data.backup_codes,\n };\n });\n}\n\nexport async function confirmTwoFactorAction(code: string) {\n return safeMutationAction(async () => {\n await twoFactorService.confirm(code);\n await accountService.updateAccountUser({ two_factor_authentication: true });\n });\n}\n\nexport async function disableTwoFactorAction(code: string) {\n return safeMutationAction(async () => {\n await twoFactorService.verify(code);\n await twoFactorService.disable();\n await accountService.updateAccountUser({ two_factor_authentication: false });\n });\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/accounts/actions/account-management.action.ts"],"sourcesContent":["'use server';\n\nimport { safeServerAction } from '../../../utils/safeServerAction';\nimport { safeMutationAction } from '../../../utils/safeMutationAction';\nimport { accountService } from '../services/account.service';\nimport type {\n AccountUsersPaginationParams,\n ChangePasswordRequest,\n CreateAccountUserRequest,\n DeleteAccountRequest,\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n UpdateBillingDataRequest,\n} from '../types';\nimport { twoFactorService } from '../services/two-factor.service';\nimport { findUserById } from '../../users/action/find-user-by-id.action';\nimport { UserProfile } from '../../users/schema';\nimport { ApiError } from '../../../infra/api/types';\n\nexport async function listAccountUsersAction(params?: AccountUsersPaginationParams) {\n return safeServerAction(async () => {\n const { users, total } = await accountService.listAccountUsers(params);\n return { data: users, total };\n });\n}\n\nexport async function updateUserAction(user: UpdateAccountUserRequest) {\n return safeMutationAction(() => accountService.updateAccountUser(user));\n}\n\nexport async function updateAccountUserByIdAction(\n userId: number,\n user: UpdateAccountUserRequest\n) {\n return safeMutationAction(() => accountService.updateAccountUserById(userId, user));\n}\n\nexport async function updateAccountAction(data: UpdateAccountRequest) {\n return safeMutationAction(async () => {\n if (data.name !== undefined) {\n const userResult = await findUserById();\n if (!userResult.success || userResult.data?.profile !== UserProfile.owner) {\n throw new ApiError(\n 'Apenas o proprietário da conta pode alterar o nome da empresa',\n 'FORBIDDEN',\n 403\n );\n }\n }\n\n return accountService.updateAccount(data);\n });\n}\n\n/**\n * Cadastro de cobrança/fiscal. Restrito a owner/admin — mesmo recorte de\n * `manage_subscriptions` no `assertManagementPermission`, replicado aqui pra não\n * arrastar a checagem de assinatura vigente junto (a conta pode estar em atraso\n * e ainda assim precisa poder regularizar o cadastro).\n */\nexport async function updateBillingDataAction(data: UpdateBillingDataRequest) {\n return safeMutationAction(async () => {\n const userResult = await findUserById();\n const profile = userResult.success ? userResult.data?.profile : undefined;\n\n if (profile !== UserProfile.owner && profile !== UserProfile.admin) {\n throw new ApiError(\n 'Apenas o proprietário ou um administrador pode alterar os dados de cobrança',\n 'FORBIDDEN',\n 403\n );\n }\n\n return accountService.updateAccount(data);\n });\n}\n\nexport async function deleteAccountUserAction(userId: number) {\n return safeMutationAction(() => accountService.deleteAccountUser(userId));\n}\n\nexport async function deleteAccountAction(data: DeleteAccountRequest) {\n return safeMutationAction(() => accountService.deleteAccount(data));\n}\n\nexport async function createAccountUserAction(user: CreateAccountUserRequest) {\n return safeMutationAction(() => accountService.createAccountUser(user));\n}\n\nexport async function changePasswordAction(data: ChangePasswordRequest) {\n return safeMutationAction(() => accountService.changePassword(data));\n}\n\nexport async function requestEmailChangeAction(newEmail: string) {\n return safeMutationAction(() => accountService.requestContactReset('email', newEmail));\n}\n\nexport async function confirmEmailChangeAction(token: string, newEmail: string) {\n return safeMutationAction(() => accountService.confirmContactReset('email', token, newEmail));\n}\n\nexport async function requestPhoneChangeAction(newPhone: string, ddi?: string) {\n return safeMutationAction(() => accountService.requestContactReset('phone', newPhone, ddi));\n}\n\nexport async function confirmPhoneChangeAction(token: string, newPhone: string, ddi?: string) {\n return safeMutationAction(() => accountService.confirmContactReset('phone', token, newPhone, ddi));\n}\n\nexport async function generateTwoFactorAction() {\n return safeMutationAction(async () => {\n const result = await twoFactorService.generate();\n return {\n qrcode: result.data.qrcode,\n backupCodes: result.data.backup_codes,\n };\n });\n}\n\nexport async function confirmTwoFactorAction(code: string) {\n return safeMutationAction(async () => {\n await twoFactorService.confirm(code);\n await accountService.updateAccountUser({ two_factor_authentication: true });\n });\n}\n\nexport async function disableTwoFactorAction(code: string) {\n return safeMutationAction(async () => {\n await twoFactorService.verify(code);\n await twoFactorService.disable();\n await accountService.updateAccountUser({ two_factor_authentication: false });\n });\n}\n"],"mappings":";AAEA,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAU/B,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,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,eAAe,kBAAkB,IAAI,CAAC;AACxE;AAEA,eAAsB,qBAAqB,MAA6B;AACtE,SAAO,mBAAmB,MAAM,eAAe,eAAe,IAAI,CAAC;AACrE;AAEA,eAAsB,yBAAyB,UAAkB;AAC/D,SAAO,mBAAmB,MAAM,eAAe,oBAAoB,SAAS,QAAQ,CAAC;AACvF;AAEA,eAAsB,yBAAyB,OAAe,UAAkB;AAC9E,SAAO,mBAAmB,MAAM,eAAe,oBAAoB,SAAS,OAAO,QAAQ,CAAC;AAC9F;AAEA,eAAsB,yBAAyB,UAAkB,KAAc;AAC7E,SAAO,mBAAmB,MAAM,eAAe,oBAAoB,SAAS,UAAU,GAAG,CAAC;AAC5F;AAEA,eAAsB,yBAAyB,OAAe,UAAkB,KAAc;AAC5F,SAAO,mBAAmB,MAAM,eAAe,oBAAoB,SAAS,OAAO,UAAU,GAAG,CAAC;AACnG;AAEA,eAAsB,0BAA0B;AAC9C,SAAO,mBAAmB,YAAY;AACpC,UAAM,SAAS,MAAM,iBAAiB,SAAS;AAC/C,WAAO;AAAA,MACL,QAAQ,OAAO,KAAK;AAAA,MACpB,aAAa,OAAO,KAAK;AAAA,IAC3B;AAAA,EACF,CAAC;AACH;AAEA,eAAsB,uBAAuB,MAAc;AACzD,SAAO,mBAAmB,YAAY;AACpC,UAAM,iBAAiB,QAAQ,IAAI;AACnC,UAAM,eAAe,kBAAkB,EAAE,2BAA2B,KAAK,CAAC;AAAA,EAC5E,CAAC;AACH;AAEA,eAAsB,uBAAuB,MAAc;AACzD,SAAO,mBAAmB,YAAY;AACpC,UAAM,iBAAiB,OAAO,IAAI;AAClC,UAAM,iBAAiB,QAAQ;AAC/B,UAAM,eAAe,kBAAkB,EAAE,2BAA2B,MAAM,CAAC;AAAA,EAC7E,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCurrentAccount } from "./current-account.hook";
|
|
3
|
+
import { useActiveSubscription } from "../../subscriptions/hooks/find-active-subscription.hook";
|
|
4
|
+
import { hasPaidSubscription } from "../../subscriptions/utils/has-paid-subscription";
|
|
5
|
+
import { useManagementPermissions } from "../../auth/hooks/useManagementPermissions";
|
|
6
|
+
import { hasCompleteBillingData, isInternationalAccount } from "../utils/billing-data";
|
|
7
|
+
function useRequiredBillingData() {
|
|
8
|
+
const { isOwnerOrAdmin } = useManagementPermissions();
|
|
9
|
+
const { data: account, isPending: isAccountPending } = useCurrentAccount();
|
|
10
|
+
const {
|
|
11
|
+
data: { data: [subscription] = [] } = {},
|
|
12
|
+
isPending: isSubscriptionPending
|
|
13
|
+
} = useActiveSubscription();
|
|
14
|
+
const isLoading = isAccountPending || isSubscriptionPending;
|
|
15
|
+
const isRequired = !isLoading && isOwnerOrAdmin && hasPaidSubscription(subscription) && !hasCompleteBillingData(account);
|
|
16
|
+
return {
|
|
17
|
+
isRequired,
|
|
18
|
+
isLoading,
|
|
19
|
+
account,
|
|
20
|
+
isInternational: isInternationalAccount(account)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
useRequiredBillingData
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=use-required-billing-data.hook.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/accounts/hooks/use-required-billing-data.hook.ts"],"sourcesContent":["'use client';\n\nimport { useCurrentAccount } from './current-account.hook';\nimport { useActiveSubscription } from '../../subscriptions/hooks/find-active-subscription.hook';\nimport { hasPaidSubscription } from '../../subscriptions/utils/has-paid-subscription';\nimport { useManagementPermissions } from '../../auth/hooks/useManagementPermissions';\nimport { hasCompleteBillingData, isInternationalAccount } from '../utils/billing-data';\n\n/**\n * Contas que já pagaram mas nunca preencheram o cadastro de cobrança ficam sem\n * nota fiscal (chamado \"Nota fiscal não emitida em pagamentos confirmados\").\n * Este hook diz quando o preenchimento vira obrigatório — o modal que ele\n * alimenta é bloqueante, então só liga com os dados já carregados e só para\n * quem consegue resolver: owner/admin.\n */\nexport function useRequiredBillingData() {\n const { isOwnerOrAdmin } = useManagementPermissions();\n const { data: account, isPending: isAccountPending } = useCurrentAccount();\n const {\n data: { data: [subscription] = [] } = {},\n isPending: isSubscriptionPending,\n } = useActiveSubscription();\n\n const isLoading = isAccountPending || isSubscriptionPending;\n\n const isRequired =\n !isLoading &&\n isOwnerOrAdmin &&\n hasPaidSubscription(subscription) &&\n !hasCompleteBillingData(account);\n\n return {\n isRequired,\n isLoading,\n account,\n isInternational: isInternationalAccount(account),\n };\n}\n"],"mappings":";AAEA,SAAS,yBAAyB;AAClC,SAAS,6BAA6B;AACtC,SAAS,2BAA2B;AACpC,SAAS,gCAAgC;AACzC,SAAS,wBAAwB,8BAA8B;AASxD,SAAS,yBAAyB;AACvC,QAAM,EAAE,eAAe,IAAI,yBAAyB;AACpD,QAAM,EAAE,MAAM,SAAS,WAAW,iBAAiB,IAAI,kBAAkB;AACzE,QAAM;AAAA,IACJ,MAAM,EAAE,MAAM,CAAC,YAAY,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,IACvC,WAAW;AAAA,EACb,IAAI,sBAAsB;AAE1B,QAAM,YAAY,oBAAoB;AAEtC,QAAM,aACJ,CAAC,aACD,kBACA,oBAAoB,YAAY,KAChC,CAAC,uBAAuB,OAAO;AAEjC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,iBAAiB,uBAAuB,OAAO;AAAA,EACjD;AACF;","names":[]}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
updateUserAction,
|
|
7
7
|
updateAccountAction,
|
|
8
8
|
updateAccountUserByIdAction,
|
|
9
|
+
updateBillingDataAction,
|
|
9
10
|
deleteAccountUserAction,
|
|
10
11
|
deleteAccountAction
|
|
11
12
|
} from "../actions/account-management.action";
|
|
@@ -26,6 +27,16 @@ function useUpdateAccount() {
|
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
29
|
}
|
|
30
|
+
function useUpdateBillingData() {
|
|
31
|
+
const queryClient = useQueryClient();
|
|
32
|
+
const accountKey = useWlQueryKey([...ACCOUNT_QUERY_KEY]);
|
|
33
|
+
return useMutation({
|
|
34
|
+
mutationFn: withAction(updateBillingDataAction),
|
|
35
|
+
onSuccess: () => {
|
|
36
|
+
queryClient.invalidateQueries({ queryKey: accountKey });
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
29
40
|
function useUpdateAccountUser() {
|
|
30
41
|
const queryClient = useQueryClient();
|
|
31
42
|
const accountUsersKey = useAuthQueryKey([...ACCOUNT_USERS_QUERY_KEY]);
|
|
@@ -76,6 +87,7 @@ export {
|
|
|
76
87
|
useDeleteAccountUser,
|
|
77
88
|
useUpdateAccount,
|
|
78
89
|
useUpdateAccountUser,
|
|
79
|
-
useUpdateAccountUserById
|
|
90
|
+
useUpdateAccountUserById,
|
|
91
|
+
useUpdateBillingData
|
|
80
92
|
};
|
|
81
93
|
//# sourceMappingURL=useAccountManagement.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/modules/accounts/hooks/useAccountManagement.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, useQueryClient } from '@tanstack/react-query';\nimport { USER_QUERY_KEY } from '../../auth/hooks/useUserQuery';\nimport { ACCOUNT_QUERY_KEY } from './current-account.hook';\nimport type {\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n DeleteAccountUserResponse,\n DeleteAccountRequest,\n DeleteAccountResponse,\n} from '../types';\nimport {\n updateUserAction,\n updateAccountAction,\n updateAccountUserByIdAction,\n deleteAccountUserAction,\n deleteAccountAction,\n} from '../actions/account-management.action';\nimport { withAction } from '../../../utils/withAction';\nimport type { UseMutationOptions } from '@tanstack/react-query';\nimport { useAuthQueryKey, useWlQueryKey } from '../../../hooks/useAuthQueryKey';\n\nexport const ACCOUNT_USERS_QUERY_KEY = ['account-users'] as const;\n\nexport function useUpdateAccount() {\n const queryClient = useQueryClient();\n const accountUsersKey = useAuthQueryKey([...ACCOUNT_USERS_QUERY_KEY]);\n const accountKey = useWlQueryKey([...ACCOUNT_QUERY_KEY]);\n const userKey = useWlQueryKey([...USER_QUERY_KEY]);\n\n return useMutation({\n mutationFn: withAction(updateAccountAction),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: accountUsersKey });\n queryClient.invalidateQueries({ queryKey: accountKey });\n queryClient.invalidateQueries({ queryKey: userKey });\n },\n });\n}\n\nexport function useUpdateAccountUser() {\n const queryClient = useQueryClient();\n const accountUsersKey = useAuthQueryKey([...ACCOUNT_USERS_QUERY_KEY]);\n const accountKey = useWlQueryKey([...ACCOUNT_QUERY_KEY]);\n const userKey = useWlQueryKey([...USER_QUERY_KEY]);\n\n return useMutation({\n mutationFn: withAction(updateUserAction),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: accountUsersKey });\n queryClient.invalidateQueries({ queryKey: accountKey });\n queryClient.invalidateQueries({ queryKey: userKey });\n },\n });\n}\n\nexport function useUpdateAccountUserById() {\n const queryClient = useQueryClient();\n const accountUsersKey = useAuthQueryKey([...ACCOUNT_USERS_QUERY_KEY]);\n\n return useMutation({\n mutationFn: withAction(({ userId: targetUserId, ...user }: UpdateAccountUserRequest & { userId: number }) =>\n updateAccountUserByIdAction(targetUserId, user)\n ),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: accountUsersKey });\n },\n });\n}\n\nexport function useDeleteAccountUser(\n options?: UseMutationOptions<DeleteAccountUserResponse, Error, number>\n) {\n const queryClient = useQueryClient();\n const accountUsersKey = useAuthQueryKey([...ACCOUNT_USERS_QUERY_KEY]);\n\n return useMutation({\n mutationFn: withAction(deleteAccountUserAction),\n ...options,\n onSuccess: (...params) => {\n options?.onSuccess?.(...params);\n queryClient.invalidateQueries({ queryKey: accountUsersKey });\n },\n });\n}\n\nexport function useDeleteAccount(\n options?: UseMutationOptions<DeleteAccountResponse, Error, DeleteAccountRequest>\n) {\n return useMutation({\n mutationFn: withAction(deleteAccount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,GAAG,uBAAuB,CAAC;AAEpE,SAAO,YAAY;AAAA,IACjB,YAAY;AAAA,MAAW,CAAC,EAAE,QAAQ,cAAc,GAAG,KAAK,MACtD,4BAA4B,cAAc,IAAI;AAAA,IAChD;AAAA,IACA,WAAW,MAAM;AACf,kBAAY,kBAAkB,EAAE,UAAU,gBAAgB,CAAC;AAAA,IAC7D;AAAA,EACF,CAAC;AACH;AAEO,SAAS,qBACd,SACA;AACA,QAAM,cAAc,eAAe;AACnC,QAAM,kBAAkB,gBAAgB,CAAC,GAAG,uBAAuB,CAAC;AAEpE,SAAO,YAAY;AAAA,IACjB,YAAY,WAAW,uBAAuB;AAAA,IAC9C,GAAG;AAAA,IACH,WAAW,IAAI,WAAW;AACxB,eAAS,YAAY,GAAG,MAAM;AAC9B,kBAAY,kBAAkB,EAAE,UAAU,gBAAgB,CAAC;AAAA,IAC7D;AAAA,EACF,CAAC;AACH;AAEO,SAAS,iBACd,SACA;AACA,SAAO,YAAY;AAAA,IACjB,YAAY,WAAW,mBAAmB;AAAA,IAC1C,GAAG;AAAA,EACL,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/modules/accounts/hooks/useAccountManagement.ts"],"sourcesContent":["'use client';\n\nimport { useMutation, useQueryClient } from '@tanstack/react-query';\nimport { USER_QUERY_KEY } from '../../auth/hooks/useUserQuery';\nimport { ACCOUNT_QUERY_KEY } from './current-account.hook';\nimport type {\n UpdateAccountRequest,\n UpdateAccountUserRequest,\n DeleteAccountUserResponse,\n DeleteAccountRequest,\n DeleteAccountResponse,\n} from '../types';\nimport {\n updateUserAction,\n updateAccountAction,\n updateAccountUserByIdAction,\n updateBillingDataAction,\n deleteAccountUserAction,\n deleteAccountAction,\n} from '../actions/account-management.action';\nimport { withAction } from '../../../utils/withAction';\nimport type { UseMutationOptions } from '@tanstack/react-query';\nimport { useAuthQueryKey, useWlQueryKey } from '../../../hooks/useAuthQueryKey';\n\nexport const ACCOUNT_USERS_QUERY_KEY = ['account-users'] as const;\n\nexport function useUpdateAccount() {\n const queryClient = useQueryClient();\n const accountUsersKey = useAuthQueryKey([...ACCOUNT_USERS_QUERY_KEY]);\n const accountKey = useWlQueryKey([...ACCOUNT_QUERY_KEY]);\n const userKey = useWlQueryKey([...USER_QUERY_KEY]);\n\n return useMutation({\n mutationFn: withAction(updateAccountAction),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: accountUsersKey });\n queryClient.invalidateQueries({ queryKey: accountKey });\n queryClient.invalidateQueries({ queryKey: userKey });\n },\n });\n}\n\nexport function useUpdateBillingData() {\n const queryClient = useQueryClient();\n const accountKey = useWlQueryKey([...ACCOUNT_QUERY_KEY]);\n\n return useMutation({\n mutationFn: withAction(updateBillingDataAction),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: accountKey });\n },\n });\n}\n\nexport function useUpdateAccountUser() {\n const queryClient = useQueryClient();\n const accountUsersKey = useAuthQueryKey([...ACCOUNT_USERS_QUERY_KEY]);\n const accountKey = useWlQueryKey([...ACCOUNT_QUERY_KEY]);\n const userKey = useWlQueryKey([...USER_QUERY_KEY]);\n\n return useMutation({\n mutationFn: withAction(updateUserAction),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: accountUsersKey });\n queryClient.invalidateQueries({ queryKey: accountKey });\n queryClient.invalidateQueries({ queryKey: userKey });\n },\n });\n}\n\nexport function useUpdateAccountUserById() {\n const queryClient = useQueryClient();\n const accountUsersKey = useAuthQueryKey([...ACCOUNT_USERS_QUERY_KEY]);\n\n return useMutation({\n mutationFn: withAction(({ userId: targetUserId, ...user }: UpdateAccountUserRequest & { userId: number }) =>\n updateAccountUserByIdAction(targetUserId, user)\n ),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: accountUsersKey });\n },\n });\n}\n\nexport function useDeleteAccountUser(\n options?: UseMutationOptions<DeleteAccountUserResponse, Error, number>\n) {\n const queryClient = useQueryClient();\n const accountUsersKey = useAuthQueryKey([...ACCOUNT_USERS_QUERY_KEY]);\n\n return useMutation({\n mutationFn: withAction(deleteAccountUserAction),\n ...options,\n onSuccess: (...params) => {\n options?.onSuccess?.(...params);\n queryClient.invalidateQueries({ queryKey: accountUsersKey });\n },\n });\n}\n\nexport function useDeleteAccount(\n options?: UseMutationOptions<DeleteAccountResponse, Error, DeleteAccountRequest>\n) {\n return useMutation({\n mutationFn: withAction(deleteAccountAction),\n ...options,\n });\n}\n"],"mappings":";AAEA,SAAS,aAAa,sBAAsB;AAC5C,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAQlC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAE3B,SAAS,iBAAiB,qBAAqB;AAExC,MAAM,0BAA0B,CAAC,eAAe;AAEhD,SAAS,mBAAmB;AACjC,QAAM,cAAc,eAAe;AACnC,QAAM,kBAAkB,gBAAgB,CAAC,GAAG,uBAAuB,CAAC;AACpE,QAAM,aAAa,cAAc,CAAC,GAAG,iBAAiB,CAAC;AACvD,QAAM,UAAU,cAAc,CAAC,GAAG,cAAc,CAAC;AAEjD,SAAO,YAAY;AAAA,IACjB,YAAY,WAAW,mBAAmB;AAAA,IAC1C,WAAW,MAAM;AACf,kBAAY,kBAAkB,EAAE,UAAU,gBAAgB,CAAC;AAC3D,kBAAY,kBAAkB,EAAE,UAAU,WAAW,CAAC;AACtD,kBAAY,kBAAkB,EAAE,UAAU,QAAQ,CAAC;AAAA,IACrD;AAAA,EACF,CAAC;AACH;AAEO,SAAS,uBAAuB;AACrC,QAAM,cAAc,eAAe;AACnC,QAAM,aAAa,cAAc,CAAC,GAAG,iBAAiB,CAAC;AAEvD,SAAO,YAAY;AAAA,IACjB,YAAY,WAAW,uBAAuB;AAAA,IAC9C,WAAW,MAAM;AACf,kBAAY,kBAAkB,EAAE,UAAU,WAAW,CAAC;AAAA,IACxD;AAAA,EACF,CAAC;AACH;AAEO,SAAS,uBAAuB;AACrC,Q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ATIONAL_GATEWAY = "stripe_usd";
|
|
2
|
+
const INTERNATIONAL_BILLING_FIELDS = [
|
|
3
|
+
"financial_name",
|
|
4
|
+
"zipcode",
|
|
5
|
+
"address",
|
|
6
|
+
"city",
|
|
7
|
+
"state",
|
|
8
|
+
"country"
|
|
9
|
+
];
|
|
10
|
+
const BR_BILLING_FIELDS = [
|
|
11
|
+
...INTERNATIONAL_BILLING_FIELDS,
|
|
12
|
+
"financial_document",
|
|
13
|
+
"address_number",
|
|
14
|
+
"neighborhood"
|
|
15
|
+
];
|
|
16
|
+
function isInternationalAccount(account) {
|
|
17
|
+
return account?.gateway === INTERNATIONAL_GATEWAY;
|
|
18
|
+
}
|
|
19
|
+
function isFilled(value) {
|
|
20
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
21
|
+
}
|
|
22
|
+
function hasCompleteBillingData(account) {
|
|
23
|
+
if (!account) return false;
|
|
24
|
+
const fields = isInternationalAccount(account) ? INTERNATIONAL_BILLING_FIELDS : BR_BILLING_FIELDS;
|
|
25
|
+
for (const field of fields) {
|
|
26
|
+
if (!isFilled(account[field])) return false;
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
INTERNATIONAL_GATEWAY,
|
|
32
|
+
hasCompleteBillingData,
|
|
33
|
+
isInternationalAccount
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=billing-data.mjs.map
|