@greatapps/common 1.1.429 → 1.1.431

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (477) hide show
  1. package/dist/components/account/AccountModals.mjs +18 -0
  2. package/dist/components/account/AccountModals.mjs.map +1 -0
  3. package/dist/components/account/ConfigurationsMyAccountModal.mjs +129 -0
  4. package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +1 -0
  5. package/dist/components/account/ConfirmDeleteAccountModal.mjs +45 -0
  6. package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +1 -0
  7. package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +45 -0
  8. package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +1 -0
  9. package/dist/components/account/DeleteAccountModal.mjs +123 -0
  10. package/dist/components/account/DeleteAccountModal.mjs.map +1 -0
  11. package/dist/components/account/DisableTwoFactorAuthModal.mjs +67 -0
  12. package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +1 -0
  13. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +42 -0
  14. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -0
  15. package/dist/components/account/TwoFactorAuthModal.mjs +182 -0
  16. package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -0
  17. package/dist/components/account/constants.mjs +29 -0
  18. package/dist/components/account/constants.mjs.map +1 -0
  19. package/dist/components/account/hooks/useChangeEmailForm.mjs +53 -0
  20. package/dist/components/account/hooks/useChangeEmailForm.mjs.map +1 -0
  21. package/dist/components/account/hooks/useChangePasswordForm.mjs +47 -0
  22. package/dist/components/account/hooks/useChangePasswordForm.mjs.map +1 -0
  23. package/dist/components/account/hooks/useChangePhoneForm.mjs +91 -0
  24. package/dist/components/account/hooks/useChangePhoneForm.mjs.map +1 -0
  25. package/dist/components/account/hooks/useConfigurationsModal.mjs +34 -0
  26. package/dist/components/account/hooks/useConfigurationsModal.mjs.map +1 -0
  27. package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +54 -0
  28. package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +1 -0
  29. package/dist/components/account/hooks/useOtpVerification.mjs +94 -0
  30. package/dist/components/account/hooks/useOtpVerification.mjs.map +1 -0
  31. package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +80 -0
  32. package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +1 -0
  33. package/dist/components/account/sections/ChangeEmailModal.mjs +181 -0
  34. package/dist/components/account/sections/ChangeEmailModal.mjs.map +1 -0
  35. package/dist/components/account/sections/ChangePasswordSection.mjs +64 -0
  36. package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -0
  37. package/dist/components/account/sections/ChangePhoneModal.mjs +192 -0
  38. package/dist/components/account/sections/ChangePhoneModal.mjs.map +1 -0
  39. package/dist/components/account/sections/MyProfileSection.mjs +317 -0
  40. package/dist/components/account/sections/MyProfileSection.mjs.map +1 -0
  41. package/dist/components/account/sections/PreferencesSection.mjs +227 -0
  42. package/dist/components/account/sections/PreferencesSection.mjs.map +1 -0
  43. package/dist/components/account/sections/SecuritySection.mjs +31 -0
  44. package/dist/components/account/sections/SecuritySection.mjs.map +1 -0
  45. package/dist/components/embeds/CrispEmbed.mjs +89 -0
  46. package/dist/components/embeds/CrispEmbed.mjs.map +1 -0
  47. package/dist/components/embeds/FrillEmbed.mjs +107 -0
  48. package/dist/components/embeds/FrillEmbed.mjs.map +1 -0
  49. package/dist/components/handlers/SearchParamsHandler.mjs +24 -0
  50. package/dist/components/handlers/SearchParamsHandler.mjs.map +1 -0
  51. package/dist/components/layouts/AppMobileNavBar.mjs +60 -0
  52. package/dist/components/layouts/AppMobileNavBar.mjs.map +1 -0
  53. package/dist/components/layouts/AppNavBar.mjs +37 -0
  54. package/dist/components/layouts/AppNavBar.mjs.map +1 -0
  55. package/dist/components/layouts/CollapsibleSidebar.mjs +65 -0
  56. package/dist/components/layouts/CollapsibleSidebar.mjs.map +1 -0
  57. package/dist/components/layouts/MainLayout.mjs +60 -0
  58. package/dist/components/layouts/MainLayout.mjs.map +1 -0
  59. package/dist/components/layouts/MdSideBarNavigation.mjs +54 -0
  60. package/dist/components/layouts/MdSideBarNavigation.mjs.map +1 -0
  61. package/dist/components/layouts/NavBar.mjs +152 -0
  62. package/dist/components/layouts/NavBar.mjs.map +1 -0
  63. package/dist/components/layouts/NavBarItem.mjs +23 -0
  64. package/dist/components/layouts/NavBarItem.mjs.map +1 -0
  65. package/dist/components/layouts/NotificationsPopover.mjs +97 -0
  66. package/dist/components/layouts/NotificationsPopover.mjs.map +1 -0
  67. package/dist/components/layouts/ProfilePopover.mjs +152 -0
  68. package/dist/components/layouts/ProfilePopover.mjs.map +1 -0
  69. package/dist/components/layouts/SideBarNavigation.mjs +63 -0
  70. package/dist/components/layouts/SideBarNavigation.mjs.map +1 -0
  71. package/dist/components/layouts/UsersSelectorPopover.mjs +210 -0
  72. package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -0
  73. package/dist/components/layouts/WhitelabelCodes.mjs +50 -0
  74. package/dist/components/layouts/WhitelabelCodes.mjs.map +1 -0
  75. package/dist/components/modals/BuyCreditsModal.mjs +281 -0
  76. package/dist/components/modals/BuyCreditsModal.mjs.map +1 -0
  77. package/dist/components/modals/ModalManager.mjs +19 -0
  78. package/dist/components/modals/ModalManager.mjs.map +1 -0
  79. package/dist/components/modals/Modals.mjs +20 -0
  80. package/dist/components/modals/Modals.mjs.map +1 -0
  81. package/dist/components/modals/PaidPlanRequiredModal.mjs +46 -0
  82. package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -0
  83. package/dist/components/modals/cards/AddCardModal.mjs +215 -0
  84. package/dist/components/modals/cards/AddCardModal.mjs.map +1 -0
  85. package/dist/components/modals/cards/CardFormFields.mjs +268 -0
  86. package/dist/components/modals/cards/CardFormFields.mjs.map +1 -0
  87. package/dist/components/navigation/AppNavigation.mjs +33 -0
  88. package/dist/components/navigation/AppNavigation.mjs.map +1 -0
  89. package/dist/components/navigation/AppNavigationContext.mjs +13 -0
  90. package/dist/components/navigation/AppNavigationContext.mjs.map +1 -0
  91. package/dist/components/navigation/CancelledSubscriptionBanner.mjs +52 -0
  92. package/dist/components/navigation/CancelledSubscriptionBanner.mjs.map +1 -0
  93. package/dist/components/navigation/NavItem.mjs +41 -0
  94. package/dist/components/navigation/NavItem.mjs.map +1 -0
  95. package/dist/components/navigation/NavItemsContext.mjs +16 -0
  96. package/dist/components/navigation/NavItemsContext.mjs.map +1 -0
  97. package/dist/components/navigation/ProjectSelectorPopover.mjs +147 -0
  98. package/dist/components/navigation/ProjectSelectorPopover.mjs.map +1 -0
  99. package/dist/components/navigation/shells/DesktopShell.mjs +11 -0
  100. package/dist/components/navigation/shells/DesktopShell.mjs.map +1 -0
  101. package/dist/components/navigation/shells/MdShell.mjs +11 -0
  102. package/dist/components/navigation/shells/MdShell.mjs.map +1 -0
  103. package/dist/components/navigation/shells/MobileShell.mjs +27 -0
  104. package/dist/components/navigation/shells/MobileShell.mjs.map +1 -0
  105. package/dist/components/navigation/shells/TabsMobileShell.mjs +61 -0
  106. package/dist/components/navigation/shells/TabsMobileShell.mjs.map +1 -0
  107. package/dist/components/navigation/subcomponents/BottomLinks.mjs +35 -0
  108. package/dist/components/navigation/subcomponents/BottomLinks.mjs.map +1 -0
  109. package/dist/components/navigation/subcomponents/CreditsCard.mjs +33 -0
  110. package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +1 -0
  111. package/dist/components/navigation/subcomponents/NavItems.mjs +25 -0
  112. package/dist/components/navigation/subcomponents/NavItems.mjs.map +1 -0
  113. package/dist/components/navigation/subcomponents/PlanCard.mjs +25 -0
  114. package/dist/components/navigation/subcomponents/PlanCard.mjs.map +1 -0
  115. package/dist/components/navigation/subcomponents/ProjectSelector.mjs +145 -0
  116. package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +1 -0
  117. package/dist/components/navigation/types.mjs +1 -0
  118. package/dist/components/navigation/types.mjs.map +1 -0
  119. package/dist/components/pages/NotFoundPage.mjs +47 -0
  120. package/dist/components/pages/NotFoundPage.mjs.map +1 -0
  121. package/dist/components/pages/notifications/Notifications.mjs +159 -0
  122. package/dist/components/pages/notifications/Notifications.mjs.map +1 -0
  123. package/dist/components/ui/buttons/Button.mjs +52 -0
  124. package/dist/components/ui/buttons/Button.mjs.map +1 -0
  125. package/dist/components/ui/buttons/CancelButton.mjs +17 -0
  126. package/dist/components/ui/buttons/CancelButton.mjs.map +1 -0
  127. package/dist/components/ui/buttons/CopyButton.mjs +42 -0
  128. package/dist/components/ui/buttons/CopyButton.mjs.map +1 -0
  129. package/dist/components/ui/data-display/Accordion.mjs +76 -0
  130. package/dist/components/ui/data-display/Accordion.mjs.map +1 -0
  131. package/dist/components/ui/data-display/Badge.mjs +42 -0
  132. package/dist/components/ui/data-display/Badge.mjs.map +1 -0
  133. package/dist/components/ui/data-display/Card.mjs +92 -0
  134. package/dist/components/ui/data-display/Card.mjs.map +1 -0
  135. package/dist/components/ui/data-display/CardBrandIcons.mjs +484 -0
  136. package/dist/components/ui/data-display/CardBrandIcons.mjs.map +1 -0
  137. package/dist/components/ui/data-display/CardItem.mjs +67 -0
  138. package/dist/components/ui/data-display/CardItem.mjs.map +1 -0
  139. package/dist/components/ui/data-display/Pagination.mjs +118 -0
  140. package/dist/components/ui/data-display/Pagination.mjs.map +1 -0
  141. package/dist/components/ui/data-display/PaymentInfoCard.mjs +161 -0
  142. package/dist/components/ui/data-display/PaymentInfoCard.mjs.map +1 -0
  143. package/dist/components/ui/data-display/ScrollArea.mjs +62 -0
  144. package/dist/components/ui/data-display/ScrollArea.mjs.map +1 -0
  145. package/dist/components/ui/data-display/Separator.mjs +28 -0
  146. package/dist/components/ui/data-display/Separator.mjs.map +1 -0
  147. package/dist/components/ui/data-display/Table.mjs +116 -0
  148. package/dist/components/ui/data-display/Table.mjs.map +1 -0
  149. package/dist/components/ui/data-display/Tabs.mjs +69 -0
  150. package/dist/components/ui/data-display/Tabs.mjs.map +1 -0
  151. package/dist/components/ui/data-display/UserAvatar.mjs +49 -0
  152. package/dist/components/ui/data-display/UserAvatar.mjs.map +1 -0
  153. package/dist/components/ui/feedback/CircularProgress.mjs +71 -0
  154. package/dist/components/ui/feedback/CircularProgress.mjs.map +1 -0
  155. package/dist/components/ui/feedback/DefaultCircularProgress.mjs +63 -0
  156. package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +1 -0
  157. package/dist/components/ui/feedback/LoadingOverlay.mjs +19 -0
  158. package/dist/components/ui/feedback/LoadingOverlay.mjs.map +1 -0
  159. package/dist/components/ui/feedback/Progress.mjs +37 -0
  160. package/dist/components/ui/feedback/Progress.mjs.map +1 -0
  161. package/dist/components/ui/feedback/Skeleton.mjs +9 -0
  162. package/dist/components/ui/feedback/Skeleton.mjs.map +1 -0
  163. package/dist/components/ui/feedback/Toast.mjs +77 -0
  164. package/dist/components/ui/feedback/Toast.mjs.map +1 -0
  165. package/dist/components/ui/form/Calendar.mjs +204 -0
  166. package/dist/components/ui/form/Calendar.mjs.map +1 -0
  167. package/dist/components/ui/form/Checkbox.mjs +33 -0
  168. package/dist/components/ui/form/Checkbox.mjs.map +1 -0
  169. package/dist/components/ui/form/ComboboxField.mjs +130 -0
  170. package/dist/components/ui/form/ComboboxField.mjs.map +1 -0
  171. package/dist/components/ui/form/DatePicker.mjs +82 -0
  172. package/dist/components/ui/form/DatePicker.mjs.map +1 -0
  173. package/dist/components/ui/form/DateRangePicker.mjs +92 -0
  174. package/dist/components/ui/form/DateRangePicker.mjs.map +1 -0
  175. package/dist/components/ui/form/FormField.mjs +103 -0
  176. package/dist/components/ui/form/FormField.mjs.map +1 -0
  177. package/dist/components/ui/form/Input.mjs +21 -0
  178. package/dist/components/ui/form/Input.mjs.map +1 -0
  179. package/dist/components/ui/form/InputOtp.mjs +70 -0
  180. package/dist/components/ui/form/InputOtp.mjs.map +1 -0
  181. package/dist/components/ui/form/PhoneInput.mjs +176 -0
  182. package/dist/components/ui/form/PhoneInput.mjs.map +1 -0
  183. package/dist/components/ui/form/RadioGroup.mjs +37 -0
  184. package/dist/components/ui/form/RadioGroup.mjs.map +1 -0
  185. package/dist/components/ui/form/Select.mjs +179 -0
  186. package/dist/components/ui/form/Select.mjs.map +1 -0
  187. package/dist/components/ui/form/SelectField.mjs +80 -0
  188. package/dist/components/ui/form/SelectField.mjs.map +1 -0
  189. package/dist/components/ui/form/Switch.mjs +33 -0
  190. package/dist/components/ui/form/Switch.mjs.map +1 -0
  191. package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs +40 -0
  192. package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs.map +1 -0
  193. package/dist/components/ui/form/TextAreaField.mjs +56 -0
  194. package/dist/components/ui/form/TextAreaField.mjs.map +1 -0
  195. package/dist/components/ui/form/Textarea.mjs +20 -0
  196. package/dist/components/ui/form/Textarea.mjs.map +1 -0
  197. package/dist/components/ui/overlay/Command.mjs +178 -0
  198. package/dist/components/ui/overlay/Command.mjs.map +1 -0
  199. package/dist/components/ui/overlay/Dialog.mjs +142 -0
  200. package/dist/components/ui/overlay/Dialog.mjs.map +1 -0
  201. package/dist/components/ui/overlay/Popover.mjs +46 -0
  202. package/dist/components/ui/overlay/Popover.mjs.map +1 -0
  203. package/dist/components/ui/overlay/Sheet.mjs +149 -0
  204. package/dist/components/ui/overlay/Sheet.mjs.map +1 -0
  205. package/dist/components/ui/overlay/Tooltip.mjs +57 -0
  206. package/dist/components/ui/overlay/Tooltip.mjs.map +1 -0
  207. package/dist/components/widgets/notifications/NotificationCard.mjs +54 -0
  208. package/dist/components/widgets/notifications/NotificationCard.mjs.map +1 -0
  209. package/dist/enums/AccountSectionType.mjs +11 -0
  210. package/dist/enums/AccountSectionType.mjs.map +1 -0
  211. package/dist/hooks/copy-to-clipboard.hook.mjs +52 -0
  212. package/dist/hooks/copy-to-clipboard.hook.mjs.map +1 -0
  213. package/dist/hooks/useCountdownTimer.mjs +29 -0
  214. package/dist/hooks/useCountdownTimer.mjs.map +1 -0
  215. package/dist/hooks/useDebounce.mjs +19 -0
  216. package/dist/hooks/useDebounce.mjs.map +1 -0
  217. package/dist/hooks/useDebounceState.mjs +12 -0
  218. package/dist/hooks/useDebounceState.mjs.map +1 -0
  219. package/dist/hooks/useDebouncedEffect.mjs +44 -0
  220. package/dist/hooks/useDebouncedEffect.mjs.map +1 -0
  221. package/dist/hooks/useIsMobile.mjs +18 -0
  222. package/dist/hooks/useIsMobile.mjs.map +1 -0
  223. package/dist/hooks/usePasswordVisibility.mjs +13 -0
  224. package/dist/hooks/usePasswordVisibility.mjs.map +1 -0
  225. package/dist/index.mjs +528 -0
  226. package/dist/index.mjs.map +1 -0
  227. package/dist/infra/api/client.mjs +162 -0
  228. package/dist/infra/api/client.mjs.map +1 -0
  229. package/dist/infra/api/types.mjs +31 -0
  230. package/dist/infra/api/types.mjs.map +1 -0
  231. package/dist/infra/utils/client-info.mjs +27 -0
  232. package/dist/infra/utils/client-info.mjs.map +1 -0
  233. package/dist/infra/utils/clsx.mjs +9 -0
  234. package/dist/infra/utils/clsx.mjs.map +1 -0
  235. package/dist/infra/utils/date.mjs +11 -0
  236. package/dist/infra/utils/date.mjs.map +1 -0
  237. package/dist/infra/utils/params.mjs +21 -0
  238. package/dist/infra/utils/params.mjs.map +1 -0
  239. package/dist/infra/utils/parser.mjs +24 -0
  240. package/dist/infra/utils/parser.mjs.map +1 -0
  241. package/dist/infra/utils/percentage.mjs +20 -0
  242. package/dist/infra/utils/percentage.mjs.map +1 -0
  243. package/dist/middleware.mjs +10 -0
  244. package/dist/middleware.mjs.map +1 -0
  245. package/dist/middlewares/chain.mjs +37 -0
  246. package/dist/middlewares/chain.mjs.map +1 -0
  247. package/dist/middlewares/create-auth-middleware.mjs +32 -0
  248. package/dist/middlewares/create-auth-middleware.mjs.map +1 -0
  249. package/dist/middlewares/types.mjs +11 -0
  250. package/dist/middlewares/types.mjs.map +1 -0
  251. package/dist/modules/accounts/actions/account-management.action.mjs +98 -0
  252. package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -0
  253. package/dist/modules/accounts/actions/find-current-account.action.mjs +10 -0
  254. package/dist/modules/accounts/actions/find-current-account.action.mjs.map +1 -0
  255. package/dist/modules/accounts/actions/list-currencies.action.mjs +10 -0
  256. package/dist/modules/accounts/actions/list-currencies.action.mjs.map +1 -0
  257. package/dist/modules/accounts/actions/list-timezones.action.mjs +10 -0
  258. package/dist/modules/accounts/actions/list-timezones.action.mjs.map +1 -0
  259. package/dist/modules/accounts/hooks/current-account.hook.mjs +24 -0
  260. package/dist/modules/accounts/hooks/current-account.hook.mjs.map +1 -0
  261. package/dist/modules/accounts/hooks/useAccountManagement.mjs +71 -0
  262. package/dist/modules/accounts/hooks/useAccountManagement.mjs.map +1 -0
  263. package/dist/modules/accounts/hooks/useCurrencies.mjs +17 -0
  264. package/dist/modules/accounts/hooks/useCurrencies.mjs.map +1 -0
  265. package/dist/modules/accounts/hooks/useTimezones.mjs +17 -0
  266. package/dist/modules/accounts/hooks/useTimezones.mjs.map +1 -0
  267. package/dist/modules/accounts/hooks/useViaCep.mjs +19 -0
  268. package/dist/modules/accounts/hooks/useViaCep.mjs.map +1 -0
  269. package/dist/modules/accounts/services/account.service.mjs +182 -0
  270. package/dist/modules/accounts/services/account.service.mjs.map +1 -0
  271. package/dist/modules/accounts/services/currency.service.mjs +24 -0
  272. package/dist/modules/accounts/services/currency.service.mjs.map +1 -0
  273. package/dist/modules/accounts/services/timezone.service.mjs +65 -0
  274. package/dist/modules/accounts/services/timezone.service.mjs.map +1 -0
  275. package/dist/modules/accounts/services/two-factor.service.mjs +78 -0
  276. package/dist/modules/accounts/services/two-factor.service.mjs.map +1 -0
  277. package/dist/modules/accounts/types.mjs +1 -0
  278. package/dist/modules/accounts/types.mjs.map +1 -0
  279. package/dist/modules/auth/actions/login.action.mjs +14 -0
  280. package/dist/modules/auth/actions/login.action.mjs.map +1 -0
  281. package/dist/modules/auth/actions/logout.action.mjs +14 -0
  282. package/dist/modules/auth/actions/logout.action.mjs.map +1 -0
  283. package/dist/modules/auth/actions/register.action.mjs +14 -0
  284. package/dist/modules/auth/actions/register.action.mjs.map +1 -0
  285. package/dist/modules/auth/actions/validate-session.action.mjs +48 -0
  286. package/dist/modules/auth/actions/validate-session.action.mjs.map +1 -0
  287. package/dist/modules/auth/actions/verify-two-factor.action.mjs +17 -0
  288. package/dist/modules/auth/actions/verify-two-factor.action.mjs.map +1 -0
  289. package/dist/modules/auth/hooks/login.hook.mjs +13 -0
  290. package/dist/modules/auth/hooks/login.hook.mjs.map +1 -0
  291. package/dist/modules/auth/hooks/logout.hook.mjs +13 -0
  292. package/dist/modules/auth/hooks/logout.hook.mjs.map +1 -0
  293. package/dist/modules/auth/hooks/register.hook.mjs +13 -0
  294. package/dist/modules/auth/hooks/register.hook.mjs.map +1 -0
  295. package/dist/modules/auth/hooks/useManagementPermissions.mjs +41 -0
  296. package/dist/modules/auth/hooks/useManagementPermissions.mjs.map +1 -0
  297. package/dist/modules/auth/hooks/useUserQuery.mjs +63 -0
  298. package/dist/modules/auth/hooks/useUserQuery.mjs.map +1 -0
  299. package/dist/modules/auth/schema.mjs +1 -0
  300. package/dist/modules/auth/schema.mjs.map +1 -0
  301. package/dist/modules/auth/services/auth.service.mjs +341 -0
  302. package/dist/modules/auth/services/auth.service.mjs.map +1 -0
  303. package/dist/modules/auth/types/management-permission.type.mjs +1 -0
  304. package/dist/modules/auth/types/management-permission.type.mjs.map +1 -0
  305. package/dist/modules/auth/utils/assert-management-permission.mjs +42 -0
  306. package/dist/modules/auth/utils/assert-management-permission.mjs.map +1 -0
  307. package/dist/modules/auth/utils/assert-management-subscription.mjs +33 -0
  308. package/dist/modules/auth/utils/assert-management-subscription.mjs.map +1 -0
  309. package/dist/modules/auth/utils/assert-paid-subscription.mjs +40 -0
  310. package/dist/modules/auth/utils/assert-paid-subscription.mjs.map +1 -0
  311. package/dist/modules/auth/utils/assert-subscription-addon.mjs +35 -0
  312. package/dist/modules/auth/utils/assert-subscription-addon.mjs.map +1 -0
  313. package/dist/modules/auth/utils/build-wl-override.mjs +27 -0
  314. package/dist/modules/auth/utils/build-wl-override.mjs.map +1 -0
  315. package/dist/modules/auth/utils/get-user-context.mjs +25 -0
  316. package/dist/modules/auth/utils/get-user-context.mjs.map +1 -0
  317. package/dist/modules/cards/actions/create-card.action.mjs +10 -0
  318. package/dist/modules/cards/actions/create-card.action.mjs.map +1 -0
  319. package/dist/modules/cards/actions/list-cards.action.mjs +10 -0
  320. package/dist/modules/cards/actions/list-cards.action.mjs.map +1 -0
  321. package/dist/modules/cards/hooks/cards.hook.mjs +16 -0
  322. package/dist/modules/cards/hooks/cards.hook.mjs.map +1 -0
  323. package/dist/modules/cards/hooks/create-card.hook.mjs +18 -0
  324. package/dist/modules/cards/hooks/create-card.hook.mjs.map +1 -0
  325. package/dist/modules/cards/services/cards.service.mjs +44 -0
  326. package/dist/modules/cards/services/cards.service.mjs.map +1 -0
  327. package/dist/modules/cards/types.mjs +27 -0
  328. package/dist/modules/cards/types.mjs.map +1 -0
  329. package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs +10 -0
  330. package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs.map +1 -0
  331. package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs +76 -0
  332. package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs.map +1 -0
  333. package/dist/modules/ia-credits/services/ia-credits.service.mjs +31 -0
  334. package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +1 -0
  335. package/dist/modules/ia-credits/types.mjs +25 -0
  336. package/dist/modules/ia-credits/types.mjs.map +1 -0
  337. package/dist/modules/plans/actions/find-plan-by-id.action.mjs +10 -0
  338. package/dist/modules/plans/actions/find-plan-by-id.action.mjs.map +1 -0
  339. package/dist/modules/plans/hooks/use-has-plan-addon.hook.mjs +13 -0
  340. package/dist/modules/plans/hooks/use-has-plan-addon.hook.mjs.map +1 -0
  341. package/dist/modules/plans/hooks/use-plan-by-id.hook.mjs +15 -0
  342. package/dist/modules/plans/hooks/use-plan-by-id.hook.mjs.map +1 -0
  343. package/dist/modules/plans/services/plans.service.mjs +34 -0
  344. package/dist/modules/plans/services/plans.service.mjs.map +1 -0
  345. package/dist/modules/plans/types/plan.type.mjs +20 -0
  346. package/dist/modules/plans/types/plan.type.mjs.map +1 -0
  347. package/dist/modules/projects/actions/add-project-user.action.mjs +10 -0
  348. package/dist/modules/projects/actions/add-project-user.action.mjs.map +1 -0
  349. package/dist/modules/projects/actions/list-all-account-users.action.mjs +10 -0
  350. package/dist/modules/projects/actions/list-all-account-users.action.mjs.map +1 -0
  351. package/dist/modules/projects/actions/list-available-users.action.mjs +10 -0
  352. package/dist/modules/projects/actions/list-available-users.action.mjs.map +1 -0
  353. package/dist/modules/projects/actions/list-project-users.action.mjs +10 -0
  354. package/dist/modules/projects/actions/list-project-users.action.mjs.map +1 -0
  355. package/dist/modules/projects/actions/remove-project-user.action.mjs +10 -0
  356. package/dist/modules/projects/actions/remove-project-user.action.mjs.map +1 -0
  357. package/dist/modules/projects/hooks/add-project-user.hook.mjs +61 -0
  358. package/dist/modules/projects/hooks/add-project-user.hook.mjs.map +1 -0
  359. package/dist/modules/projects/hooks/list-all-account-users.hook.mjs +35 -0
  360. package/dist/modules/projects/hooks/list-all-account-users.hook.mjs.map +1 -0
  361. package/dist/modules/projects/hooks/list-available-users.hook.mjs +34 -0
  362. package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +1 -0
  363. package/dist/modules/projects/hooks/list-project-users.hook.mjs +34 -0
  364. package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +1 -0
  365. package/dist/modules/projects/hooks/remove-project-user.hook.mjs +61 -0
  366. package/dist/modules/projects/hooks/remove-project-user.hook.mjs.map +1 -0
  367. package/dist/modules/projects/services/project-users.service.mjs +96 -0
  368. package/dist/modules/projects/services/project-users.service.mjs.map +1 -0
  369. package/dist/modules/projects/types.mjs +23 -0
  370. package/dist/modules/projects/types.mjs.map +1 -0
  371. package/dist/modules/subscriptions/actions/calculate-subscription.action.mjs +10 -0
  372. package/dist/modules/subscriptions/actions/calculate-subscription.action.mjs.map +1 -0
  373. package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs +10 -0
  374. package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs.map +1 -0
  375. package/dist/modules/subscriptions/actions/update-subscription-plan.action.mjs +12 -0
  376. package/dist/modules/subscriptions/actions/update-subscription-plan.action.mjs.map +1 -0
  377. package/dist/modules/subscriptions/constants/addons.constants.mjs +24 -0
  378. package/dist/modules/subscriptions/constants/addons.constants.mjs.map +1 -0
  379. package/dist/modules/subscriptions/constants/query-keys.constants.mjs +5 -0
  380. package/dist/modules/subscriptions/constants/query-keys.constants.mjs.map +1 -0
  381. package/dist/modules/subscriptions/hooks/calculate-subscription.hook.mjs +13 -0
  382. package/dist/modules/subscriptions/hooks/calculate-subscription.hook.mjs.map +1 -0
  383. package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs +17 -0
  384. package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs.map +1 -0
  385. package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs +17 -0
  386. package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs.map +1 -0
  387. package/dist/modules/subscriptions/hooks/update-subscription-plan.hook.mjs +22 -0
  388. package/dist/modules/subscriptions/hooks/update-subscription-plan.hook.mjs.map +1 -0
  389. package/dist/modules/subscriptions/hooks/use-cancelled-subscription-guard.mjs +37 -0
  390. package/dist/modules/subscriptions/hooks/use-cancelled-subscription-guard.mjs.map +1 -0
  391. package/dist/modules/subscriptions/services/subscriptions.service.mjs +75 -0
  392. package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +1 -0
  393. package/dist/modules/subscriptions/types/billing-period.type.mjs +1 -0
  394. package/dist/modules/subscriptions/types/billing-period.type.mjs.map +1 -0
  395. package/dist/modules/subscriptions/types/calculate-subscription.type.mjs +72 -0
  396. package/dist/modules/subscriptions/types/calculate-subscription.type.mjs.map +1 -0
  397. package/dist/modules/subscriptions/types/subscription.type.mjs +57 -0
  398. package/dist/modules/subscriptions/types/subscription.type.mjs.map +1 -0
  399. package/dist/modules/subscriptions/utils/build-plan-extras.mjs +37 -0
  400. package/dist/modules/subscriptions/utils/build-plan-extras.mjs.map +1 -0
  401. package/dist/modules/subscriptions/utils/has-subscription-expired.mjs +10 -0
  402. package/dist/modules/subscriptions/utils/has-subscription-expired.mjs.map +1 -0
  403. package/dist/modules/subscriptions/utils/periodicity.mjs +48 -0
  404. package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -0
  405. package/dist/modules/subscriptions/utils/resolve-plan-extras-prices.mjs +14 -0
  406. package/dist/modules/subscriptions/utils/resolve-plan-extras-prices.mjs.map +1 -0
  407. package/dist/modules/users/action/find-user-by-id.action.mjs +10 -0
  408. package/dist/modules/users/action/find-user-by-id.action.mjs.map +1 -0
  409. package/dist/modules/users/action/list-messages.action.mjs +13 -0
  410. package/dist/modules/users/action/list-messages.action.mjs.map +1 -0
  411. package/dist/modules/users/action/mark-all-messages-as-read.action.mjs +10 -0
  412. package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +1 -0
  413. package/dist/modules/users/action/mark-message-as-read.action.mjs +10 -0
  414. package/dist/modules/users/action/mark-message-as-read.action.mjs.map +1 -0
  415. package/dist/modules/users/hooks/messages.hook.mjs +57 -0
  416. package/dist/modules/users/hooks/messages.hook.mjs.map +1 -0
  417. package/dist/modules/users/schema/messages.schema.mjs +21 -0
  418. package/dist/modules/users/schema/messages.schema.mjs.map +1 -0
  419. package/dist/modules/users/schema.mjs +11 -0
  420. package/dist/modules/users/schema.mjs.map +1 -0
  421. package/dist/modules/users/services/messages.service.mjs +35 -0
  422. package/dist/modules/users/services/messages.service.mjs.map +1 -0
  423. package/dist/modules/users/services/user.service.mjs +52 -0
  424. package/dist/modules/users/services/user.service.mjs.map +1 -0
  425. package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs +21 -0
  426. package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs.map +1 -0
  427. package/dist/modules/whitelabel/actions/revalidate-whitelabel.action.mjs +19 -0
  428. package/dist/modules/whitelabel/actions/revalidate-whitelabel.action.mjs.map +1 -0
  429. package/dist/modules/whitelabel/schema.mjs +1 -0
  430. package/dist/modules/whitelabel/schema.mjs.map +1 -0
  431. package/dist/modules/whitelabel/services/whitelabel.service.mjs +146 -0
  432. package/dist/modules/whitelabel/services/whitelabel.service.mjs.map +1 -0
  433. package/dist/modules/whitelabel/utils/normalize-hostname.mjs +35 -0
  434. package/dist/modules/whitelabel/utils/normalize-hostname.mjs.map +1 -0
  435. package/dist/providers/auth.provider.mjs +114 -0
  436. package/dist/providers/auth.provider.mjs.map +1 -0
  437. package/dist/providers/query.provider.mjs +99 -0
  438. package/dist/providers/query.provider.mjs.map +1 -0
  439. package/dist/providers/whitelabel.provider.mjs +42 -0
  440. package/dist/providers/whitelabel.provider.mjs.map +1 -0
  441. package/dist/server.mjs +111 -0
  442. package/dist/server.mjs.map +1 -0
  443. package/dist/store/useAccountModals.mjs +18 -0
  444. package/dist/store/useAccountModals.mjs.map +1 -0
  445. package/dist/store/useBuyCreditsModal.mjs +16 -0
  446. package/dist/store/useBuyCreditsModal.mjs.map +1 -0
  447. package/dist/store/useDesktopSidebarStore.mjs +39 -0
  448. package/dist/store/useDesktopSidebarStore.mjs.map +1 -0
  449. package/dist/store/useMdSidebarStore.mjs +28 -0
  450. package/dist/store/useMdSidebarStore.mjs.map +1 -0
  451. package/dist/store/useMobileNavbarSheet.mjs +14 -0
  452. package/dist/store/useMobileNavbarSheet.mjs.map +1 -0
  453. package/dist/store/useModalManager.mjs +75 -0
  454. package/dist/store/useModalManager.mjs.map +1 -0
  455. package/dist/store/usePaidPlanRequiredModal.mjs +14 -0
  456. package/dist/store/usePaidPlanRequiredModal.mjs.map +1 -0
  457. package/dist/utils/browser/clipboard.mjs +36 -0
  458. package/dist/utils/browser/clipboard.mjs.map +1 -0
  459. package/dist/utils/constants/br-states.mjs +33 -0
  460. package/dist/utils/constants/br-states.mjs.map +1 -0
  461. package/dist/utils/countries.mjs +219 -0
  462. package/dist/utils/countries.mjs.map +1 -0
  463. package/dist/utils/file/index.mjs +9 -0
  464. package/dist/utils/file/index.mjs.map +1 -0
  465. package/dist/utils/format/masks.mjs +67 -0
  466. package/dist/utils/format/masks.mjs.map +1 -0
  467. package/dist/utils/intl/locales.mjs +12 -0
  468. package/dist/utils/intl/locales.mjs.map +1 -0
  469. package/dist/utils/safeServerAction.mjs +16 -0
  470. package/dist/utils/safeServerAction.mjs.map +1 -0
  471. package/dist/utils/validators/account.mjs +27 -0
  472. package/dist/utils/validators/account.mjs.map +1 -0
  473. package/dist/utils/validators/common.mjs +47 -0
  474. package/dist/utils/validators/common.mjs.map +1 -0
  475. package/dist/utils/withAction.mjs +13 -0
  476. package/dist/utils/withAction.mjs.map +1 -0
  477. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import ConfigurationsMyAccountModal from "./ConfigurationsMyAccountModal";
4
+ import DeleteAccountModal from "./DeleteAccountModal";
5
+ import IsntPossibleDeleteAccountModal from "./IsntPossibleDeleteAccountModal";
6
+ import ConfirmDeleteAccountModal from "./ConfirmDeleteAccountModal";
7
+ function AccountModals() {
8
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
9
+ /* @__PURE__ */ jsx(ConfigurationsMyAccountModal, {}),
10
+ /* @__PURE__ */ jsx(DeleteAccountModal, {}),
11
+ /* @__PURE__ */ jsx(IsntPossibleDeleteAccountModal, {}),
12
+ /* @__PURE__ */ jsx(ConfirmDeleteAccountModal, {})
13
+ ] });
14
+ }
15
+ export {
16
+ AccountModals as default
17
+ };
18
+ //# sourceMappingURL=AccountModals.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/account/AccountModals.tsx"],"sourcesContent":["'use client';\n\nimport ConfigurationsMyAccountModal from './ConfigurationsMyAccountModal';\nimport DeleteAccountModal from './DeleteAccountModal';\nimport IsntPossibleDeleteAccountModal from './IsntPossibleDeleteAccountModal';\nimport ConfirmDeleteAccountModal from './ConfirmDeleteAccountModal';\n\nexport default function AccountModals() {\n return (\n <>\n <ConfigurationsMyAccountModal />\n <DeleteAccountModal />\n <IsntPossibleDeleteAccountModal />\n <ConfirmDeleteAccountModal />\n </>\n );\n}\n"],"mappings":";AASI,mBACE,KADF;AAPJ,OAAO,kCAAkC;AACzC,OAAO,wBAAwB;AAC/B,OAAO,oCAAoC;AAC3C,OAAO,+BAA+B;AAEvB,SAAR,gBAAiC;AACtC,SACE,iCACE;AAAA,wBAAC,gCAA6B;AAAA,IAC9B,oBAAC,sBAAmB;AAAA,IACpB,oBAAC,kCAA+B;AAAA,IAChC,oBAAC,6BAA0B;AAAA,KAC7B;AAEJ;","names":[]}
@@ -0,0 +1,129 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { IconLock, IconSettings2, IconX } from "@tabler/icons-react";
4
+ import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../ui/overlay/Dialog";
5
+ import { Tabs, TabsList, TabsTrigger, TabsContent } from "../ui/data-display/Tabs";
6
+ import { cn } from "../../infra/utils/clsx";
7
+ import { AccountSectionType } from "../../enums/AccountSectionType";
8
+ import { PreferencesSection } from "./sections/PreferencesSection";
9
+ import { ChangePasswordSection } from "./sections/ChangePasswordSection";
10
+ import { SecuritySection } from "./sections/SecuritySection";
11
+ import useConfigurationsModal from "./hooks/useConfigurationsModal";
12
+ import useIsMobile from "../../hooks/useIsMobile";
13
+ import { useAccountModals } from "../../store/useAccountModals";
14
+ import { useAuth } from "../../providers/auth.provider";
15
+ import { UserProfile } from "../../modules/users/schema";
16
+ function ConfigurationsMyAccountModal() {
17
+ const {
18
+ activeModal,
19
+ config,
20
+ openDeleteAccount,
21
+ openIsntPossibleDelete,
22
+ close
23
+ } = useAccountModals();
24
+ const open = activeModal === "configurations";
25
+ const { hasActiveSubscription } = config;
26
+ const { user } = useAuth();
27
+ const isOwnerOrAdmin = user?.profile === UserProfile.owner || user?.profile === UserProfile.admin;
28
+ const isMobile = useIsMobile();
29
+ const { activeSection, setActiveSection } = useConfigurationsModal({
30
+ isOpen: open
31
+ });
32
+ const handleDeleteAccount = () => {
33
+ close();
34
+ if (hasActiveSubscription) {
35
+ openIsntPossibleDelete();
36
+ } else {
37
+ openDeleteAccount();
38
+ }
39
+ };
40
+ const tabTriggerClasses = cn(
41
+ "border-0! px-0 py-0",
42
+ "lg:rounded-md lg:flex lg:items-center lg:gap-2 lg:p-3 lg:justify-start lg:w-full",
43
+ "lg:bg-white lg:hover:bg-gray-100 lg:active:bg-gray-50 lg:border-0",
44
+ "lg:data-[state=active]:bg-gray-50",
45
+ "flex items-center gap-1.5 px-3 py-3 justify-center whitespace-nowrap",
46
+ "border-b-2 border-transparent",
47
+ "data-[state=active]:bg-gray-50 rounded-lg",
48
+ "text-gray-500 data-[state=active]:text-gray-950",
49
+ "hover:text-gray-900 transition-colors"
50
+ );
51
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: close, children: /* @__PURE__ */ jsxs(
52
+ DialogContent,
53
+ {
54
+ showCloseButton: !isMobile,
55
+ overlayClassName: "bg-black/20 lg:bg-black/50",
56
+ className: "\n flex flex-col p-0 gap-0 max-w-full sm:max-w-full overflow-x-hidden border-0\n rounded-t-2xl rounded-b-none h-[100dvh] top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0\n lg:flex-row lg:w-[892px] lg:max-w-[892px] lg:h-[626px] lg:rounded-lg lg:border\n lg:top-[50%] lg:bottom-auto lg:left-[50%] lg:right-auto lg:translate-x-[-50%] lg:translate-y-[-50%]",
57
+ children: [
58
+ /* @__PURE__ */ jsx(DialogHeader, { className: "sr-only", children: /* @__PURE__ */ jsx(DialogTitle, { children: "Configura\xE7\xF5es" }) }),
59
+ /* @__PURE__ */ jsxs("div", { className: "md:hidden flex items-center justify-between px-5 py-3 border-b border-gray-200", children: [
60
+ /* @__PURE__ */ jsx("span", { className: "text-gray-950 paragraph-medium-semibold", children: "Configura\xE7\xF5es" }),
61
+ /* @__PURE__ */ jsx(
62
+ "button",
63
+ {
64
+ type: "button",
65
+ className: "size-8 flex items-center justify-center text-gray-500 cursor-pointer",
66
+ onClick: close,
67
+ children: /* @__PURE__ */ jsx(IconX, { size: 18 })
68
+ }
69
+ )
70
+ ] }),
71
+ /* @__PURE__ */ jsxs(
72
+ Tabs,
73
+ {
74
+ value: activeSection,
75
+ onValueChange: (value) => setActiveSection(value),
76
+ orientation: "vertical",
77
+ className: "flex lg:flex-row flex-col w-full h-full flex-1 lg:h-full lg:pt-0 lg:gap-0",
78
+ children: [
79
+ /* @__PURE__ */ jsxs(
80
+ TabsList,
81
+ {
82
+ className: cn(
83
+ "flex gap-0 bg-transparent border-b-0",
84
+ "lg:flex-col lg:items-stretch lg:justify-start lg:w-auto lg:min-w-60",
85
+ "lg:border-r lg:border-gray-200 lg:pl-5 lg:pr-5 lg:pt-5 lg:gap-5 lg:overflow-x-visible lg:self-stretch",
86
+ "flex-row items-center justify-start w-full overflow-x-auto scrollbar-hide shrink-0",
87
+ "px-4 py-3",
88
+ "[mask-image:linear-gradient(to_right,transparent,black_16px,black_calc(100%-24px),transparent)] lg:[mask-image:none]"
89
+ ),
90
+ children: [
91
+ /* @__PURE__ */ jsx("span", { className: "hidden lg:block paragraph-medium-semibold text-gray-950 mb-0", children: "Configura\xE7\xF5es" }),
92
+ /* @__PURE__ */ jsxs("div", { className: "lg:flex lg:flex-col flex flex-row lg:gap-0 gap-0 lg:w-full", children: [
93
+ /* @__PURE__ */ jsxs(TabsTrigger, { value: AccountSectionType.PREFERENCES, className: tabTriggerClasses, children: [
94
+ /* @__PURE__ */ jsx(IconSettings2, { size: 20, className: "shrink-0" }),
95
+ /* @__PURE__ */ jsx("span", { className: "paragraph-small-medium", children: "Prefer\xEAncias" })
96
+ ] }),
97
+ isOwnerOrAdmin && /* @__PURE__ */ jsxs(TabsTrigger, { value: AccountSectionType.SECURITY, className: tabTriggerClasses, children: [
98
+ /* @__PURE__ */ jsx(IconLock, { size: 20, className: "shrink-0" }),
99
+ /* @__PURE__ */ jsx("span", { className: "paragraph-small-medium", children: "Seguran\xE7a" })
100
+ ] })
101
+ ] })
102
+ ]
103
+ }
104
+ ),
105
+ /* @__PURE__ */ jsxs("div", { className: "w-full flex-1 min-h-0 lg:h-full overflow-hidden lg:overflow-visible relative flex flex-col", children: [
106
+ /* @__PURE__ */ jsx(TabsContent, { value: AccountSectionType.PREFERENCES, className: "h-full! relative overflow-hidden", children: /* @__PURE__ */ jsx(PreferencesSection, { onClose: close }) }),
107
+ isOwnerOrAdmin && /* @__PURE__ */ jsxs(Fragment, { children: [
108
+ /* @__PURE__ */ jsx(TabsContent, { value: AccountSectionType.SECURITY, className: "h-full! relative overflow-hidden", children: /* @__PURE__ */ jsx(
109
+ SecuritySection,
110
+ {
111
+ setActiveSection,
112
+ onClose: close,
113
+ onDeleteAccount: handleDeleteAccount
114
+ }
115
+ ) }),
116
+ /* @__PURE__ */ jsx(TabsContent, { value: AccountSectionType.CHANGE_PASSWORD, className: "h-full! relative overflow-hidden", children: /* @__PURE__ */ jsx(ChangePasswordSection, { onBack: () => setActiveSection(AccountSectionType.SECURITY) }) })
117
+ ] })
118
+ ] })
119
+ ]
120
+ }
121
+ )
122
+ ]
123
+ }
124
+ ) });
125
+ }
126
+ export {
127
+ ConfigurationsMyAccountModal as default
128
+ };
129
+ //# sourceMappingURL=ConfigurationsMyAccountModal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/account/ConfigurationsMyAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { IconLock, IconSettings2, IconX } from '@tabler/icons-react';\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../ui/data-display/Tabs';\nimport { cn } from '../../infra/utils/clsx';\nimport { AccountSectionType } from '../../enums/AccountSectionType';\nimport { PreferencesSection } from './sections/PreferencesSection';\nimport { ChangePasswordSection } from './sections/ChangePasswordSection';\nimport { SecuritySection } from './sections/SecuritySection';\nimport useConfigurationsModal from './hooks/useConfigurationsModal';\nimport useIsMobile from '../../hooks/useIsMobile';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport { useAuth } from '../../providers/auth.provider';\nimport { UserProfile } from '../../modules/users/schema';\n\nexport default function ConfigurationsMyAccountModal() {\n const {\n activeModal,\n config,\n openDeleteAccount,\n openIsntPossibleDelete,\n close,\n } = useAccountModals();\n\n const open = activeModal === 'configurations';\n const { hasActiveSubscription } = config;\n\n const { user } = useAuth();\n const isOwnerOrAdmin = user?.profile === UserProfile.owner || user?.profile === UserProfile.admin;\n const isMobile = useIsMobile();\n const { activeSection, setActiveSection } = useConfigurationsModal({\n isOpen: open,\n });\n\n const handleDeleteAccount = () => {\n close();\n if (hasActiveSubscription) {\n openIsntPossibleDelete();\n } else {\n openDeleteAccount();\n }\n };\n\n const tabTriggerClasses = cn(\n 'border-0! px-0 py-0',\n\n 'lg:rounded-md lg:flex lg:items-center lg:gap-2 lg:p-3 lg:justify-start lg:w-full',\n 'lg:bg-white lg:hover:bg-gray-100 lg:active:bg-gray-50 lg:border-0',\n 'lg:data-[state=active]:bg-gray-50',\n\n 'flex items-center gap-1.5 px-3 py-3 justify-center whitespace-nowrap',\n 'border-b-2 border-transparent',\n 'data-[state=active]:bg-gray-50 rounded-lg',\n\n 'text-gray-500 data-[state=active]:text-gray-950',\n 'hover:text-gray-900 transition-colors'\n );\n\n return (\n <Dialog open={open} onOpenChange={close}>\n <DialogContent\n showCloseButton={!isMobile}\n overlayClassName=\"bg-black/20 lg:bg-black/50\"\n className=\"\n flex flex-col p-0 gap-0 max-w-full sm:max-w-full overflow-x-hidden border-0\n rounded-t-2xl rounded-b-none h-[100dvh] top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0\n lg:flex-row lg:w-[892px] lg:max-w-[892px] lg:h-[626px] lg:rounded-lg lg:border\n lg:top-[50%] lg:bottom-auto lg:left-[50%] lg:right-auto lg:translate-x-[-50%] lg:translate-y-[-50%]\"\n >\n <DialogHeader className=\"sr-only\">\n <DialogTitle>Configurações</DialogTitle>\n </DialogHeader>\n <div className=\"md:hidden flex items-center justify-between px-5 py-3 border-b border-gray-200\">\n <span className=\"text-gray-950 paragraph-medium-semibold\">Configurações</span>\n <button\n type=\"button\"\n className=\"size-8 flex items-center justify-center text-gray-500 cursor-pointer\"\n onClick={close}\n >\n <IconX size={18} />\n </button>\n </div>\n <Tabs\n value={activeSection}\n onValueChange={(value) => setActiveSection(value as AccountSectionType)}\n orientation=\"vertical\"\n className=\"flex lg:flex-row flex-col w-full h-full flex-1 lg:h-full lg:pt-0 lg:gap-0\"\n >\n <TabsList\n className={cn(\n 'flex gap-0 bg-transparent border-b-0',\n\n 'lg:flex-col lg:items-stretch lg:justify-start lg:w-auto lg:min-w-60',\n 'lg:border-r lg:border-gray-200 lg:pl-5 lg:pr-5 lg:pt-5 lg:gap-5 lg:overflow-x-visible lg:self-stretch',\n\n 'flex-row items-center justify-start w-full overflow-x-auto scrollbar-hide shrink-0',\n 'px-4 py-3',\n '[mask-image:linear-gradient(to_right,transparent,black_16px,black_calc(100%-24px),transparent)] lg:[mask-image:none]'\n )}\n >\n <span className=\"hidden lg:block paragraph-medium-semibold text-gray-950 mb-0\">\n Configurações\n </span>\n\n <div className=\"lg:flex lg:flex-col flex flex-row lg:gap-0 gap-0 lg:w-full\">\n <TabsTrigger value={AccountSectionType.PREFERENCES} className={tabTriggerClasses}>\n <IconSettings2 size={20} className=\"shrink-0\" />\n <span className=\"paragraph-small-medium\">Preferências</span>\n </TabsTrigger>\n\n {isOwnerOrAdmin && (\n <TabsTrigger value={AccountSectionType.SECURITY} className={tabTriggerClasses}>\n <IconLock size={20} className=\"shrink-0\" />\n <span className=\"paragraph-small-medium\">Segurança</span>\n </TabsTrigger>\n )}\n </div>\n </TabsList>\n\n <div className=\"w-full flex-1 min-h-0 lg:h-full overflow-hidden lg:overflow-visible relative flex flex-col\">\n <TabsContent value={AccountSectionType.PREFERENCES} className=\"h-full! relative overflow-hidden\">\n <PreferencesSection onClose={close} />\n </TabsContent>\n\n {isOwnerOrAdmin && (\n <>\n <TabsContent value={AccountSectionType.SECURITY} className=\"h-full! relative overflow-hidden\">\n <SecuritySection\n setActiveSection={setActiveSection}\n onClose={close}\n onDeleteAccount={handleDeleteAccount}\n />\n </TabsContent>\n\n <TabsContent value={AccountSectionType.CHANGE_PASSWORD} className=\"h-full! relative overflow-hidden\">\n <ChangePasswordSection onBack={() => setActiveSection(AccountSectionType.SECURITY)} />\n </TabsContent>\n </>\n )}\n </div>\n </Tabs>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { IconAlertTriangle } from "@tabler/icons-react";
4
+ import { toast } from "sonner";
5
+ import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../ui/overlay/Dialog";
6
+ import { Button } from "../ui/buttons/Button";
7
+ import { Toast } from "../ui/feedback/Toast";
8
+ import { useAccountModals } from "../../store/useAccountModals";
9
+ function ConfirmDeleteAccountModal() {
10
+ const { activeModal, pagesCount, close } = useAccountModals();
11
+ const open = activeModal === "confirmDelete";
12
+ const handleConfirm = () => {
13
+ toast.custom((t) => /* @__PURE__ */ jsx(Toast, { variant: "success", message: "Conta exclu\xEDda com sucesso", toastId: t }));
14
+ close();
15
+ };
16
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: close, children: /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col p-0 gap-0 max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!", children: [
17
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5 p-4 lg:p-5", children: [
18
+ /* @__PURE__ */ jsx(DialogHeader, { className: "p-0", children: /* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-gray-950", children: "Uma pena te ver ir!" }) }),
19
+ /* @__PURE__ */ jsxs("div", { className: "bg-red-50 p-4 lg:p-5 rounded-lg flex items-center gap-4", children: [
20
+ /* @__PURE__ */ jsx(IconAlertTriangle, { size: 20, className: "text-red-500 shrink-0", strokeWidth: 2 }),
21
+ /* @__PURE__ */ jsxs("p", { className: "paragraph-small-regular text-gray-600", children: [
22
+ "Todas suas",
23
+ " ",
24
+ /* @__PURE__ */ jsxs("span", { className: "font-semibold text-gray-950", children: [
25
+ pagesCount,
26
+ " p\xE1ginas"
27
+ ] }),
28
+ " ",
29
+ "ser\xE3o deletadas permanentemente. Essa a\xE7\xE3o \xE9",
30
+ " ",
31
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-gray-950", children: "irrevers\xEDvel!" })
32
+ ] })
33
+ ] })
34
+ ] }),
35
+ /* @__PURE__ */ jsx("div", { className: "h-px bg-gray-200" }),
36
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 p-4 lg:p-5", children: [
37
+ /* @__PURE__ */ jsx(Button, { className: "h-10 flex-1", onClick: close, children: "Manter minha conta" }),
38
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", className: "h-10! flex-1", onClick: handleConfirm, children: "Excluir mesmo assim" })
39
+ ] })
40
+ ] }) });
41
+ }
42
+ export {
43
+ ConfirmDeleteAccountModal as default
44
+ };
45
+ //# sourceMappingURL=ConfirmDeleteAccountModal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/account/ConfirmDeleteAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { IconAlertTriangle } from '@tabler/icons-react';\nimport { toast } from 'sonner';\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Button } from '../ui/buttons/Button';\nimport { Toast } from '../ui/feedback/Toast';\nimport { useAccountModals } from '../../store/useAccountModals';\n\nexport default function ConfirmDeleteAccountModal() {\n const { activeModal, pagesCount, close } = useAccountModals();\n const open = activeModal === 'confirmDelete';\n\n const handleConfirm = () => {\n toast.custom((t) => (\n <Toast variant=\"success\" message=\"Conta excluída com sucesso\" toastId={t} />\n ));\n close();\n };\n\n return (\n <Dialog open={open} onOpenChange={close}>\n <DialogContent className=\"flex flex-col p-0 gap-0 max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!\">\n <div className=\"flex flex-col gap-5 p-4 lg:p-5\">\n <DialogHeader className=\"p-0\">\n <DialogTitle className=\"paragraph-medium-semibold text-gray-950\">\n Uma pena te ver ir!\n </DialogTitle>\n </DialogHeader>\n\n <div className=\"bg-red-50 p-4 lg:p-5 rounded-lg flex items-center gap-4\">\n <IconAlertTriangle size={20} className=\"text-red-500 shrink-0\" strokeWidth={2} />\n <p className=\"paragraph-small-regular text-gray-600\">\n Todas suas{' '}\n <span className=\"font-semibold text-gray-950\">{pagesCount} páginas</span>{' '}\n serão deletadas permanentemente. Essa ação é{' '}\n <span className=\"font-semibold text-gray-950\">irreversível!</span>\n </p>\n </div>\n </div>\n\n <div className=\"h-px bg-gray-200\" />\n\n <div className=\"flex items-center gap-2 p-4 lg:p-5\">\n <Button className=\"h-10 flex-1\" onClick={close}>\n Manter minha conta\n </Button>\n <Button variant=\"secondary\" className=\"h-10! flex-1\" onClick={handleConfirm}>\n Excluir mesmo assim\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAeM,cAmBQ,YAnBR;AAbN,SAAS,yBAAyB;AAClC,SAAS,aAAa;AACtB,SAAS,QAAQ,eAAe,cAAc,mBAAmB;AACjE,SAAS,cAAc;AACvB,SAAS,aAAa;AACtB,SAAS,wBAAwB;AAElB,SAAR,4BAA6C;AAClD,QAAM,EAAE,aAAa,YAAY,MAAM,IAAI,iBAAiB;AAC5D,QAAM,OAAO,gBAAgB;AAE7B,QAAM,gBAAgB,MAAM;AAC1B,UAAM,OAAO,CAAC,MACZ,oBAAC,SAAM,SAAQ,WAAU,SAAQ,iCAA6B,SAAS,GAAG,CAC3E;AACD,UAAM;AAAA,EACR;AAEA,SACE,oBAAC,UAAO,MAAY,cAAc,OAChC,+BAAC,iBAAc,WAAU,2NACvB;AAAA,yBAAC,SAAI,WAAU,kCACb;AAAA,0BAAC,gBAAa,WAAU,OACtB,8BAAC,eAAY,WAAU,2CAA0C,iCAEjE,GACF;AAAA,MAEA,qBAAC,SAAI,WAAU,2DACb;AAAA,4BAAC,qBAAkB,MAAM,IAAI,WAAU,yBAAwB,aAAa,GAAG;AAAA,QAC/E,qBAAC,OAAE,WAAU,yCAAwC;AAAA;AAAA,UACxC;AAAA,UACX,qBAAC,UAAK,WAAU,+BAA+B;AAAA;AAAA,YAAW;AAAA,aAAQ;AAAA,UAAQ;AAAA,UAAI;AAAA,UACjC;AAAA,UAC7C,oBAAC,UAAK,WAAU,+BAA8B,8BAAa;AAAA,WAC7D;AAAA,SACF;AAAA,OACF;AAAA,IAEA,oBAAC,SAAI,WAAU,oBAAmB;AAAA,IAElC,qBAAC,SAAI,WAAU,sCACb;AAAA,0BAAC,UAAO,WAAU,eAAc,SAAS,OAAO,gCAEhD;AAAA,MACA,oBAAC,UAAO,SAAQ,aAAY,WAAU,gBAAe,SAAS,eAAe,iCAE7E;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { IconAlertTriangle } from "@tabler/icons-react";
4
+ import { Button } from "../ui/buttons/Button";
5
+ import {
6
+ Dialog,
7
+ DialogContent,
8
+ DialogHeader,
9
+ DialogTitle,
10
+ DialogDescription
11
+ } from "../ui/overlay/Dialog";
12
+ import { Separator } from "../ui/data-display/Separator";
13
+ function ConfirmGlobalPreferencesModal({
14
+ open,
15
+ onConfirm,
16
+ onCancel
17
+ }) {
18
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: onCancel, children: /* @__PURE__ */ jsxs(DialogContent, { className: "flex flex-col p-0 gap-0 md:w-[386px]! lg:w-[386px]! max-w-[386px]! max-[386px]:w-[calc(100%-32px)]", children: [
19
+ /* @__PURE__ */ jsxs(DialogHeader, { className: "sr-only", children: [
20
+ /* @__PURE__ */ jsx(DialogTitle, { children: "Alterar prefer\xEAncias globais" }),
21
+ /* @__PURE__ */ jsx(DialogDescription, { children: "Confirma\xE7\xE3o de altera\xE7\xE3o de prefer\xEAncias globais da conta" })
22
+ ] }),
23
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 p-5", children: [
24
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center bg-gray-50 rounded-lg size-10", children: /* @__PURE__ */ jsx(IconAlertTriangle, { size: 24, className: "text-gray-950" }) }),
25
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
26
+ /* @__PURE__ */ jsx("span", { className: "paragraph-medium-semibold text-gray-950", children: "Alterar prefer\xEAncias globais" }),
27
+ /* @__PURE__ */ jsxs("span", { className: "paragraph-small-regular text-gray-600", children: [
28
+ "Voc\xEA est\xE1 alterando configura\xE7\xF5es que impactam",
29
+ " ",
30
+ /* @__PURE__ */ jsx("span", { className: "paragraph-small-semibold text-gray-950", children: "todos os usu\xE1rios da conta" }),
31
+ ". Deseja confirmar?"
32
+ ] })
33
+ ] })
34
+ ] }),
35
+ /* @__PURE__ */ jsx(Separator, { className: "w-full" }),
36
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 p-5", children: [
37
+ /* @__PURE__ */ jsx(Button, { onClick: onConfirm, className: "h-10!", children: "Confirmar" }),
38
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: onCancel, className: "h-10!", children: "Cancelar" })
39
+ ] })
40
+ ] }) });
41
+ }
42
+ export {
43
+ ConfirmGlobalPreferencesModal as default
44
+ };
45
+ //# sourceMappingURL=ConfirmGlobalPreferencesModal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/account/ConfirmGlobalPreferencesModal.tsx"],"sourcesContent":["'use client';\n\nimport { IconAlertTriangle } from '@tabler/icons-react';\nimport { Button } from '../ui/buttons/Button';\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogDescription,\n} from '../ui/overlay/Dialog';\nimport { Separator } from '../ui/data-display/Separator';\n\ninterface ConfirmGlobalPreferencesModalProps {\n open: boolean;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\nexport default function ConfirmGlobalPreferencesModal({\n open,\n onConfirm,\n onCancel,\n}: ConfirmGlobalPreferencesModalProps) {\n return (\n <Dialog open={open} onOpenChange={onCancel}>\n <DialogContent className=\"flex flex-col p-0 gap-0 md:w-[386px]! lg:w-[386px]! max-w-[386px]! max-[386px]:w-[calc(100%-32px)]\">\n <DialogHeader className=\"sr-only\">\n <DialogTitle>Alterar preferências globais</DialogTitle>\n <DialogDescription>\n Confirmação de alteração de preferências globais da conta\n </DialogDescription>\n </DialogHeader>\n\n <div className=\"flex flex-col gap-3 p-5\">\n <div className=\"flex items-center justify-center bg-gray-50 rounded-lg size-10\">\n <IconAlertTriangle size={24} className=\"text-gray-950\" />\n </div>\n <div className=\"flex flex-col gap-2\">\n <span className=\"paragraph-medium-semibold text-gray-950\">\n Alterar preferências globais\n </span>\n <span className=\"paragraph-small-regular text-gray-600\">\n Você está alterando configurações que impactam{' '}\n <span className=\"paragraph-small-semibold text-gray-950\">\n todos os usuários da conta\n </span>\n . Deseja confirmar?\n </span>\n </div>\n </div>\n\n <Separator className=\"w-full\" />\n\n <div className=\"flex items-center gap-2 p-5\">\n <Button onClick={onConfirm} className=\"h-10!\">\n Confirmar\n </Button>\n <Button variant=\"secondary\" onClick={onCancel} className=\"h-10!\">\n Cancelar\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AA2BQ,SACE,KADF;AAzBR,SAAS,yBAAyB;AAClC,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;AAQX,SAAR,8BAA+C;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACF,GAAuC;AACrC,SACE,oBAAC,UAAO,MAAY,cAAc,UAChC,+BAAC,iBAAc,WAAU,sGACvB;AAAA,yBAAC,gBAAa,WAAU,WACtB;AAAA,0BAAC,eAAY,6CAA4B;AAAA,MACzC,oBAAC,qBAAkB,sFAEnB;AAAA,OACF;AAAA,IAEA,qBAAC,SAAI,WAAU,2BACb;AAAA,0BAAC,SAAI,WAAU,kEACb,8BAAC,qBAAkB,MAAM,IAAI,WAAU,iBAAgB,GACzD;AAAA,MACA,qBAAC,SAAI,WAAU,uBACb;AAAA,4BAAC,UAAK,WAAU,2CAA0C,6CAE1D;AAAA,QACA,qBAAC,UAAK,WAAU,yCAAwC;AAAA;AAAA,UACP;AAAA,UAC/C,oBAAC,UAAK,WAAU,0CAAyC,2CAEzD;AAAA,UAAO;AAAA,WAET;AAAA,SACF;AAAA,OACF;AAAA,IAEA,oBAAC,aAAU,WAAU,UAAS;AAAA,IAE9B,qBAAC,SAAI,WAAU,+BACb;AAAA,0BAAC,UAAO,SAAS,WAAW,WAAU,SAAQ,uBAE9C;AAAA,MACA,oBAAC,UAAO,SAAQ,aAAY,SAAS,UAAU,WAAU,SAAQ,sBAEjE;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -0,0 +1,123 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useState, useCallback } from "react";
4
+ import { IconLock, IconAlertTriangle } from "@tabler/icons-react";
5
+ import { toast } from "sonner";
6
+ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../ui/overlay/Dialog";
7
+ import { Button } from "../ui/buttons/Button";
8
+ import { FormField } from "../ui/form/FormField";
9
+ import { SelectField } from "../ui/form/SelectField";
10
+ import { TextAreaField } from "../ui/form/TextAreaField";
11
+ import { Toast } from "../ui/feedback/Toast";
12
+ import usePasswordVisibility from "../../hooks/usePasswordVisibility";
13
+ import { useAccountModals } from "../../store/useAccountModals";
14
+ import { AccountSectionType } from "../../enums/AccountSectionType";
15
+ const REASON_OPTIONS = [
16
+ { value: "sem-funcao", label: "A ferramenta n\xE3o possui uma fun\xE7\xE3o que eu preciso" },
17
+ { value: "problemas", label: "Encontrei problemas t\xE9cnicos ou erros no sistema" },
18
+ { value: "suporte", label: "Tive problemas com o suporte ou atendimento" },
19
+ { value: "demora", label: "As atualiza\xE7\xF5es demoram mais do que o esperado" },
20
+ { value: "temporario", label: "O cancelamento \xE9 tempor\xE1rio" },
21
+ { value: "outro", label: "Outro motivo" }
22
+ ];
23
+ function DeleteAccountModal() {
24
+ const { activeModal, pagesCount, openConfigurations, openConfirmDelete, close } = useAccountModals();
25
+ const open = activeModal === "deleteAccount";
26
+ const [reason, setReason] = useState("");
27
+ const [description, setDescription] = useState("");
28
+ const [password, setPassword] = useState("");
29
+ const { showPassword, togglePassword } = usePasswordVisibility();
30
+ const isFormValid = Boolean(reason && description && password);
31
+ const resetForm = useCallback(() => {
32
+ setReason("");
33
+ setDescription("");
34
+ setPassword("");
35
+ }, []);
36
+ const handleClose = () => {
37
+ resetForm();
38
+ openConfigurations(AccountSectionType.SECURITY);
39
+ };
40
+ const handleDelete = (e) => {
41
+ e.preventDefault();
42
+ if (!isFormValid) {
43
+ toast.custom((t) => /* @__PURE__ */ jsx(Toast, { variant: "error", message: "Preencha todos os campos obrigat\xF3rios", toastId: t }));
44
+ return;
45
+ }
46
+ resetForm();
47
+ openConfirmDelete(pagesCount);
48
+ };
49
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsx(DialogContent, { className: "flex flex-col p-0 gap-0 max-w-full sm:max-w-full border-0 rounded-t-2xl rounded-b-none h-[100dvh] top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0 lg:max-w-lg lg:h-auto lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%] lg:left-[50%] lg:right-auto lg:bottom-auto lg:translate-x-[-50%] lg:translate-y-[-50%] overflow-y-auto", children: /* @__PURE__ */ jsxs("form", { onSubmit: handleDelete, className: "flex flex-col flex-1 lg:flex-none", children: [
50
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 p-4 lg:p-6 flex-1 lg:flex-none", children: [
51
+ /* @__PURE__ */ jsxs(DialogHeader, { className: "p-0", children: [
52
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-fit bg-red-50 rounded-lg p-2.5 mb-5", children: /* @__PURE__ */ jsx(IconAlertTriangle, { size: 20, className: "text-red-500" }) }),
53
+ /* @__PURE__ */ jsx(DialogTitle, { children: "Excluir conta" }),
54
+ /* @__PURE__ */ jsxs(DialogDescription, { className: "paragraph-small-regular", children: [
55
+ "Esta a\xE7\xE3o \xE9 ",
56
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-gray-950", children: "irrevers\xEDvel" }),
57
+ ". Ao confirmar, sua conta e todos os seus dados ser\xE3o exclu\xEDdos."
58
+ ] })
59
+ ] }),
60
+ /* @__PURE__ */ jsx(
61
+ SelectField,
62
+ {
63
+ label: "Motivo do cancelamento",
64
+ required: true,
65
+ placeholder: "Selecione",
66
+ options: REASON_OPTIONS,
67
+ value: reason,
68
+ onChange: (value) => setReason(value),
69
+ className: "h-10!"
70
+ }
71
+ ),
72
+ /* @__PURE__ */ jsxs("div", { children: [
73
+ /* @__PURE__ */ jsx(
74
+ TextAreaField,
75
+ {
76
+ label: "Descreva o que levou a tomar essa decis\xE3o",
77
+ required: true,
78
+ placeholder: "Explique sua decis\xE3o...",
79
+ value: description,
80
+ onChange: (e) => setDescription(e.target.value),
81
+ rows: 4,
82
+ maxLength: 400
83
+ }
84
+ ),
85
+ /* @__PURE__ */ jsxs("span", { className: "paragraph-xsmall-medium text-gray-600 text-left mt-1 block", children: [
86
+ description.length,
87
+ "/400 caracteres"
88
+ ] })
89
+ ] }),
90
+ /* @__PURE__ */ jsx(
91
+ FormField,
92
+ {
93
+ className: "text-gray-600",
94
+ label: "Senha",
95
+ type: "password",
96
+ placeholder: "Informe sua senha",
97
+ leftIcon: IconLock,
98
+ value: password,
99
+ onChange: (e) => setPassword(e.target.value),
100
+ classnameContainer: "h-10!",
101
+ showPassword,
102
+ onTogglePassword: togglePassword
103
+ }
104
+ )
105
+ ] }),
106
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-start gap-2 p-4 lg:p-6 border-t border-gray-200 bg-white mt-auto lg:mt-0", children: [
107
+ /* @__PURE__ */ jsx(
108
+ Button,
109
+ {
110
+ variant: "default",
111
+ className: "h-10",
112
+ type: "submit",
113
+ children: "Excluir conta"
114
+ }
115
+ ),
116
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", className: "h-10", type: "button", onClick: handleClose, children: "Fechar" })
117
+ ] })
118
+ ] }) }) });
119
+ }
120
+ export {
121
+ DeleteAccountModal as default
122
+ };
123
+ //# sourceMappingURL=DeleteAccountModal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/account/DeleteAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { useState, useCallback } from 'react';\nimport { IconLock, IconAlertTriangle } from '@tabler/icons-react';\nimport { toast } from 'sonner';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Button } from '../ui/buttons/Button';\nimport { FormField } from '../ui/form/FormField';\nimport { SelectField } from '../ui/form/SelectField';\nimport { TextAreaField } from '../ui/form/TextAreaField';\nimport { Toast } from '../ui/feedback/Toast';\nimport usePasswordVisibility from '../../hooks/usePasswordVisibility';\nimport { useAccountModals } from '../../store/useAccountModals';\nimport { AccountSectionType } from '../../enums/AccountSectionType';\n\nconst REASON_OPTIONS = [\n { value: 'sem-funcao', label: 'A ferramenta não possui uma função que eu preciso' },\n { value: 'problemas', label: 'Encontrei problemas técnicos ou erros no sistema' },\n { value: 'suporte', label: 'Tive problemas com o suporte ou atendimento' },\n { value: 'demora', label: 'As atualizações demoram mais do que o esperado' },\n { value: 'temporario', label: 'O cancelamento é temporário' },\n { value: 'outro', label: 'Outro motivo' },\n];\n\nexport default function DeleteAccountModal() {\n const { activeModal, pagesCount, openConfigurations, openConfirmDelete, close } = useAccountModals();\n const open = activeModal === 'deleteAccount';\n\n const [reason, setReason] = useState('');\n const [description, setDescription] = useState('');\n const [password, setPassword] = useState('');\n const { showPassword, togglePassword } = usePasswordVisibility();\n\n const isFormValid = Boolean(reason && description && password);\n\n const resetForm = useCallback(() => {\n setReason('');\n setDescription('');\n setPassword('');\n }, []);\n\n const handleClose = () => {\n resetForm();\n openConfigurations(AccountSectionType.SECURITY);\n };\n\n const handleDelete = (e: React.FormEvent) => {\n e.preventDefault();\n if (!isFormValid) {\n toast.custom((t) => (\n <Toast variant=\"error\" message=\"Preencha todos os campos obrigatórios\" toastId={t} />\n ));\n return;\n }\n resetForm();\n openConfirmDelete(pagesCount);\n };\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"flex flex-col p-0 gap-0 max-w-full sm:max-w-full border-0 rounded-t-2xl rounded-b-none h-[100dvh] top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0 lg:max-w-lg lg:h-auto lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%] lg:left-[50%] lg:right-auto lg:bottom-auto lg:translate-x-[-50%] lg:translate-y-[-50%] overflow-y-auto\">\n <form onSubmit={handleDelete} className=\"flex flex-col flex-1 lg:flex-none\">\n <div className=\"flex flex-col gap-6 p-4 lg:p-6 flex-1 lg:flex-none\">\n <DialogHeader className=\"p-0\">\n <div className=\"flex items-center justify-center w-fit bg-red-50 rounded-lg p-2.5 mb-5\">\n <IconAlertTriangle size={20} className=\"text-red-500\" />\n </div>\n <DialogTitle>Excluir conta</DialogTitle>\n <DialogDescription className=\"paragraph-small-regular\">\n Esta ação é <span className=\"font-semibold text-gray-950\">irreversível</span>. Ao\n confirmar, sua conta e todos os seus dados serão excluídos.\n </DialogDescription>\n </DialogHeader>\n\n <SelectField\n label=\"Motivo do cancelamento\"\n required\n placeholder=\"Selecione\"\n options={REASON_OPTIONS}\n value={reason}\n onChange={(value) => setReason(value as string)}\n className=\"h-10!\"\n />\n\n <div>\n <TextAreaField\n label=\"Descreva o que levou a tomar essa decisão\"\n required\n placeholder=\"Explique sua decisão...\"\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n rows={4}\n maxLength={400}\n />\n <span className=\"paragraph-xsmall-medium text-gray-600 text-left mt-1 block\">\n {description.length}/400 caracteres\n </span>\n </div>\n\n <FormField\n className=\"text-gray-600\"\n label=\"Senha\"\n type=\"password\"\n placeholder=\"Informe sua senha\"\n leftIcon={IconLock}\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n classnameContainer=\"h-10!\"\n showPassword={showPassword}\n onTogglePassword={togglePassword}\n />\n </div>\n\n <div className=\"flex flex-row items-center justify-start gap-2 p-4 lg:p-6 border-t border-gray-200 bg-white mt-auto lg:mt-0\">\n <Button\n variant=\"default\"\n className=\"h-10\"\n type=\"submit\"\n >\n Excluir conta\n </Button>\n <Button variant=\"secondary\" className=\"h-10\" type=\"button\" onClick={handleClose}>\n Fechar\n </Button>\n </div>\n </form>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":"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","names":[]}
@@ -0,0 +1,67 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { IconShieldCheck } from "@tabler/icons-react";
4
+ import { Button } from "../ui/buttons/Button";
5
+ import {
6
+ Dialog,
7
+ DialogContent,
8
+ DialogDescription,
9
+ DialogHeader,
10
+ DialogTitle
11
+ } from "../ui/overlay/Dialog";
12
+ import { InputOTP, InputOTPGroup, InputOTPSlot } from "../ui/form/InputOtp";
13
+ import useDisableTwoFactorAuthForm from "./hooks/useDisableTwoFactorAuthForm";
14
+ function DisableTwoFactorAuthModal({
15
+ open,
16
+ onClose,
17
+ onSuccess
18
+ }) {
19
+ const { code, setCode, isValid, isLoading, handleClose, handleSubmit } = useDisableTwoFactorAuthForm({ onClose, onSuccess });
20
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsx(DialogContent, { overlayClassName: "z-[1010]", className: "z-[1011] flex flex-col p-0 gap-0 max-w-full sm:max-w-full border-0 rounded-t-2xl rounded-b-none h-dvh top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0 lg:max-w-117.5 lg:h-auto lg:rounded-lg lg:border lg:top-[50%] lg:left-[50%] lg:right-auto lg:bottom-auto lg:translate-x-[-50%] lg:translate-y-[-50%]", children: /* @__PURE__ */ jsxs(
21
+ "form",
22
+ {
23
+ onSubmit: (e) => {
24
+ e.preventDefault();
25
+ handleSubmit();
26
+ },
27
+ className: "flex flex-col flex-1 lg:flex-none",
28
+ children: [
29
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 lg:gap-5 p-4 lg:p-5 flex-1 lg:flex-none", children: [
30
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-fit bg-gray-50 rounded-lg p-2", children: /* @__PURE__ */ jsx(IconShieldCheck, { size: 20, className: "text-gray-600" }) }),
31
+ /* @__PURE__ */ jsxs(DialogHeader, { className: "p-0 gap-2", children: [
32
+ /* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-gray-950", children: "Desabilitar autentica\xE7\xE3o 2FA" }),
33
+ /* @__PURE__ */ jsx(DialogDescription, { className: "paragraph-small-regular text-gray-600", children: "Informe o c\xF3digo de 6 d\xEDgitos do seu aplicativo autenticador para confirmar a desativa\xE7\xE3o." })
34
+ ] }),
35
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
36
+ /* @__PURE__ */ jsx("span", { className: "paragraph-small-medium text-gray-700", children: "C\xF3digo do autenticador" }),
37
+ /* @__PURE__ */ jsx(InputOTP, { maxLength: 6, value: code, onChange: setCode, children: /* @__PURE__ */ jsx(InputOTPGroup, { className: "gap-2", children: Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ jsx(
38
+ InputOTPSlot,
39
+ {
40
+ index: i,
41
+ className: "w-11! lg:w-12! h-13! lg:h-14! rounded-lg! text-lg border-gray-200"
42
+ },
43
+ i
44
+ )) }) })
45
+ ] })
46
+ ] }),
47
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2 p-4 lg:p-5 border-t border-gray-200 mt-auto lg:mt-0", children: [
48
+ /* @__PURE__ */ jsx(Button, { className: "h-10! flex-1", disabled: !isValid || isLoading, type: "submit", children: isLoading ? "Desabilitando..." : "Desabilitar 2FA" }),
49
+ /* @__PURE__ */ jsx(
50
+ Button,
51
+ {
52
+ variant: "secondary",
53
+ className: "h-10! flex-1",
54
+ type: "button",
55
+ onClick: handleClose,
56
+ children: "Cancelar"
57
+ }
58
+ )
59
+ ] })
60
+ ]
61
+ }
62
+ ) }) });
63
+ }
64
+ export {
65
+ DisableTwoFactorAuthModal as default
66
+ };
67
+ //# sourceMappingURL=DisableTwoFactorAuthModal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/account/DisableTwoFactorAuthModal.tsx"],"sourcesContent":["'use client';\n\nimport { IconShieldCheck } from '@tabler/icons-react';\nimport { Button } from '../ui/buttons/Button';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from '../ui/overlay/Dialog';\nimport { InputOTP, InputOTPGroup, InputOTPSlot } from '../ui/form/InputOtp';\nimport useDisableTwoFactorAuthForm from './hooks/useDisableTwoFactorAuthForm';\n\ninterface DisableTwoFactorAuthModalProps {\n open: boolean;\n onClose: () => void;\n onSuccess?: () => void;\n}\n\nexport default function DisableTwoFactorAuthModal({\n open,\n onClose,\n onSuccess,\n}: DisableTwoFactorAuthModalProps) {\n const { code, setCode, isValid, isLoading, handleClose, handleSubmit } =\n useDisableTwoFactorAuthForm({ onClose, onSuccess });\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent overlayClassName=\"z-[1010]\" className=\"z-[1011] flex flex-col p-0 gap-0 max-w-full sm:max-w-full border-0 rounded-t-2xl rounded-b-none h-dvh top-0 bottom-0 left-0 right-0 translate-x-0 translate-y-0 lg:max-w-117.5 lg:h-auto lg:rounded-lg lg:border lg:top-[50%] lg:left-[50%] lg:right-auto lg:bottom-auto lg:translate-x-[-50%] lg:translate-y-[-50%]\">\n <form\n onSubmit={(e) => {\n e.preventDefault();\n handleSubmit();\n }}\n className=\"flex flex-col flex-1 lg:flex-none\"\n >\n <div className=\"flex flex-col gap-4 lg:gap-5 p-4 lg:p-5 flex-1 lg:flex-none\">\n <div className=\"flex items-center justify-center w-fit bg-gray-50 rounded-lg p-2\">\n <IconShieldCheck size={20} className=\"text-gray-600\" />\n </div>\n <DialogHeader className=\"p-0 gap-2\">\n <DialogTitle className=\"paragraph-medium-semibold text-gray-950\">\n Desabilitar autenticação 2FA\n </DialogTitle>\n <DialogDescription className=\"paragraph-small-regular text-gray-600\">\n Informe o código de 6 dígitos do seu aplicativo autenticador para confirmar a\n desativação.\n </DialogDescription>\n </DialogHeader>\n\n <div className=\"flex flex-col gap-2\">\n <span className=\"paragraph-small-medium text-gray-700\">Código do autenticador</span>\n <InputOTP maxLength={6} value={code} onChange={setCode}>\n <InputOTPGroup className=\"gap-2\">\n {Array.from({ length: 6 }).map((_, i) => (\n <InputOTPSlot\n key={i}\n index={i}\n className=\"w-11! lg:w-12! h-13! lg:h-14! rounded-lg! text-lg border-gray-200\"\n />\n ))}\n </InputOTPGroup>\n </InputOTP>\n </div>\n </div>\n\n <div className=\"flex flex-row items-center gap-2 p-4 lg:p-5 border-t border-gray-200 mt-auto lg:mt-0\">\n <Button className=\"h-10! flex-1\" disabled={!isValid || isLoading} type=\"submit\">\n {isLoading ? 'Desabilitando...' : 'Desabilitar 2FA'}\n </Button>\n <Button\n variant=\"secondary\"\n className=\"h-10! flex-1\"\n type=\"button\"\n onClick={handleClose}\n >\n Cancelar\n </Button>\n </div>\n </form>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAwCc,cAEF,YAFE;AAtCd,SAAS,uBAAuB;AAChC,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU,eAAe,oBAAoB;AACtD,OAAO,iCAAiC;AAQzB,SAAR,0BAA2C;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AACF,GAAmC;AACjC,QAAM,EAAE,MAAM,SAAS,SAAS,WAAW,aAAa,aAAa,IACnE,4BAA4B,EAAE,SAAS,UAAU,CAAC;AAEpD,SACE,oBAAC,UAAO,MAAY,cAAc,aAChC,8BAAC,iBAAc,kBAAiB,YAAW,WAAU,wTACnD;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,CAAC,MAAM;AACf,UAAE,eAAe;AACjB,qBAAa;AAAA,MACf;AAAA,MACA,WAAU;AAAA,MAEV;AAAA,6BAAC,SAAI,WAAU,+DACb;AAAA,8BAAC,SAAI,WAAU,oEACb,8BAAC,mBAAgB,MAAM,IAAI,WAAU,iBAAgB,GACvD;AAAA,UACA,qBAAC,gBAAa,WAAU,aACtB;AAAA,gCAAC,eAAY,WAAU,2CAA0C,gDAEjE;AAAA,YACA,oBAAC,qBAAkB,WAAU,yCAAwC,oHAGrE;AAAA,aACF;AAAA,UAEA,qBAAC,SAAI,WAAU,uBACb;AAAA,gCAAC,UAAK,WAAU,wCAAuC,uCAAsB;AAAA,YAC7E,oBAAC,YAAS,WAAW,GAAG,OAAO,MAAM,UAAU,SAC7C,8BAAC,iBAAc,WAAU,SACtB,gBAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MACjC;AAAA,cAAC;AAAA;AAAA,gBAEC,OAAO;AAAA,gBACP,WAAU;AAAA;AAAA,cAFL;AAAA,YAGP,CACD,GACH,GACF;AAAA,aACF;AAAA,WACF;AAAA,QAEA,qBAAC,SAAI,WAAU,wFACb;AAAA,8BAAC,UAAO,WAAU,gBAAe,UAAU,CAAC,WAAW,WAAW,MAAK,UACpE,sBAAY,qBAAqB,mBACpC;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,WAAU;AAAA,cACV,MAAK;AAAA,cACL,SAAS;AAAA,cACV;AAAA;AAAA,UAED;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF,GACF;AAEJ;","names":[]}
@@ -0,0 +1,42 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { IconAlertTriangle } from "@tabler/icons-react";
4
+ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../ui/overlay/Dialog";
5
+ import { Button } from "../ui/buttons/Button";
6
+ import { useAccountModals } from "../../store/useAccountModals";
7
+ function IsntPossibleDeleteAccountModal() {
8
+ const { activeModal, close, config } = useAccountModals();
9
+ const { onGoToSubscription } = config;
10
+ const open = activeModal === "isntPossibleDelete";
11
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: close, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!", children: [
12
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
13
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-fit bg-red-50 rounded-lg p-2.5", children: /* @__PURE__ */ jsx(IconAlertTriangle, { size: 20, className: "text-red-500" }) }),
14
+ /* @__PURE__ */ jsxs(DialogHeader, { className: "p-0 gap-2", children: [
15
+ /* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-gray-950", children: "N\xE3o \xE9 poss\xEDvel excluir a conta" }),
16
+ /* @__PURE__ */ jsxs(DialogDescription, { className: "paragraph-small-regular text-gray-600", children: [
17
+ "Voc\xEA tem uma assinatura ativa. Para excluir sua conta,",
18
+ " ",
19
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-gray-950", children: "primeiro cancele a assinatura" }),
20
+ " na p\xE1gina Assinatura e depois tente novamente."
21
+ ] })
22
+ ] })
23
+ ] }),
24
+ /* @__PURE__ */ jsx("div", { className: "h-px bg-gray-200 -mx-6" }),
25
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2", children: [
26
+ /* @__PURE__ */ jsx(Button, { className: "h-10 flex-1", onClick: close, children: "Ok, entendi" }),
27
+ /* @__PURE__ */ jsx(
28
+ Button,
29
+ {
30
+ variant: "secondary",
31
+ className: "h-10 flex-1",
32
+ onClick: onGoToSubscription ?? close,
33
+ children: "Ir para assinatura"
34
+ }
35
+ )
36
+ ] })
37
+ ] }) });
38
+ }
39
+ export {
40
+ IsntPossibleDeleteAccountModal as default
41
+ };
42
+ //# sourceMappingURL=IsntPossibleDeleteAccountModal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/account/IsntPossibleDeleteAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { IconAlertTriangle } from '@tabler/icons-react';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Button } from '../ui/buttons/Button';\nimport { useAccountModals } from '../../store/useAccountModals';\n\nexport default function IsntPossibleDeleteAccountModal() {\n const { activeModal, close, config } = useAccountModals();\n const { onGoToSubscription } = config;\n const open = activeModal === 'isntPossibleDelete';\n\n return (\n <Dialog open={open} onOpenChange={close}>\n <DialogContent className=\"max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!\">\n <div className=\"flex flex-col gap-5\">\n <div className=\"flex items-center justify-center w-fit bg-red-50 rounded-lg p-2.5\">\n <IconAlertTriangle size={20} className=\"text-red-500\" />\n </div>\n <DialogHeader className=\"p-0 gap-2\">\n <DialogTitle className=\"paragraph-medium-semibold text-gray-950\">\n Não é possível excluir a conta\n </DialogTitle>\n <DialogDescription className=\"paragraph-small-regular text-gray-600\">\n Você tem uma assinatura ativa. Para excluir sua conta,{' '}\n <span className=\"font-semibold text-gray-950\">primeiro cancele a assinatura</span> na\n página Assinatura e depois tente novamente.\n </DialogDescription>\n </DialogHeader>\n </div>\n\n <div className=\"h-px bg-gray-200 -mx-6\" />\n\n <div className=\"flex flex-row items-center gap-2\">\n <Button className=\"h-10 flex-1\" onClick={close}>\n Ok, entendi\n </Button>\n <Button\n variant=\"secondary\"\n className=\"h-10 flex-1\"\n onClick={onGoToSubscription ?? close}\n >\n Ir para assinatura\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAiBY,cAMA,YANA;AAfZ,SAAS,yBAAyB;AAClC,SAAS,QAAQ,eAAe,mBAAmB,cAAc,mBAAmB;AACpF,SAAS,cAAc;AACvB,SAAS,wBAAwB;AAElB,SAAR,iCAAkD;AACvD,QAAM,EAAE,aAAa,OAAO,OAAO,IAAI,iBAAiB;AACxD,QAAM,EAAE,mBAAmB,IAAI;AAC/B,QAAM,OAAO,gBAAgB;AAE7B,SACE,oBAAC,UAAO,MAAY,cAAc,OAChC,+BAAC,iBAAc,WAAU,mMACvB;AAAA,yBAAC,SAAI,WAAU,uBACb;AAAA,0BAAC,SAAI,WAAU,qEACb,8BAAC,qBAAkB,MAAM,IAAI,WAAU,gBAAe,GACxD;AAAA,MACA,qBAAC,gBAAa,WAAU,aACtB;AAAA,4BAAC,eAAY,WAAU,2CAA0C,qDAEjE;AAAA,QACA,qBAAC,qBAAkB,WAAU,yCAAwC;AAAA;AAAA,UACZ;AAAA,UACvD,oBAAC,UAAK,WAAU,+BAA8B,2CAA6B;AAAA,UAAO;AAAA,WAEpF;AAAA,SACF;AAAA,OACF;AAAA,IAEA,oBAAC,SAAI,WAAU,0BAAyB;AAAA,IAExC,qBAAC,SAAI,WAAU,oCACb;AAAA,0BAAC,UAAO,WAAU,eAAc,SAAS,OAAO,yBAEhD;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,SAAS,sBAAsB;AAAA,UAChC;AAAA;AAAA,MAED;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}