@autenticar-me/vue 0.1.0 → 0.3.0

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 (83) hide show
  1. package/dist/components/AuthSwitcher.vue.d.ts +2 -2
  2. package/dist/components/AuthSwitcher.vue.d.ts.map +1 -0
  3. package/dist/components/Buttons/SignInButton.vue.d.ts +2 -2
  4. package/dist/components/Buttons/SignInButton.vue.d.ts.map +1 -0
  5. package/dist/components/Buttons/SignOutButton.vue.d.ts +2 -2
  6. package/dist/components/Buttons/SignOutButton.vue.d.ts.map +1 -0
  7. package/dist/components/Buttons/SignUpButton.vue.d.ts +2 -2
  8. package/dist/components/Buttons/SignUpButton.vue.d.ts.map +1 -0
  9. package/dist/components/Layout/SignedIn.vue.d.ts +12 -7
  10. package/dist/components/Layout/SignedIn.vue.d.ts.map +1 -0
  11. package/dist/components/Layout/SignedOut.vue.d.ts +12 -7
  12. package/dist/components/Layout/SignedOut.vue.d.ts.map +1 -0
  13. package/dist/components/Modals/Modal.vue.d.ts +15 -10
  14. package/dist/components/Modals/Modal.vue.d.ts.map +1 -0
  15. package/dist/components/Modals/SignInModal.vue.d.ts +4 -4
  16. package/dist/components/Modals/SignInModal.vue.d.ts.map +1 -0
  17. package/dist/components/Modals/SignUpModal.vue.d.ts +4 -4
  18. package/dist/components/Modals/SignUpModal.vue.d.ts.map +1 -0
  19. package/dist/components/Notification.vue.d.ts +3 -3
  20. package/dist/components/Notification.vue.d.ts.map +1 -0
  21. package/dist/components/SignIn.vue.d.ts +7 -4
  22. package/dist/components/SignIn.vue.d.ts.map +1 -0
  23. package/dist/components/SignUp.vue.d.ts +7 -4
  24. package/dist/components/SignUp.vue.d.ts.map +1 -0
  25. package/dist/components/UserProfile.vue.d.ts +4 -2
  26. package/dist/components/UserProfile.vue.d.ts.map +1 -0
  27. package/dist/composables/useAtm.d.ts +5 -4
  28. package/dist/composables/useAtm.d.ts.map +1 -0
  29. package/dist/composables/useAtmClient.d.ts +2 -1
  30. package/dist/composables/useAtmClient.d.ts.map +1 -0
  31. package/dist/composables/useAuth.d.ts +3 -2
  32. package/dist/composables/useAuth.d.ts.map +1 -0
  33. package/dist/index.cjs +2278 -0
  34. package/dist/index.cjs.map +1 -0
  35. package/dist/index.d.ts +18 -16
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +2277 -31
  38. package/dist/index.js.map +1 -0
  39. package/dist/plugin.d.ts +2 -1
  40. package/dist/plugin.d.ts.map +1 -0
  41. package/dist/types/configurations.type.d.ts +10 -0
  42. package/dist/types/configurations.type.d.ts.map +1 -0
  43. package/dist/types/session.type.d.ts +1 -0
  44. package/dist/types/session.type.d.ts.map +1 -0
  45. package/dist/types/user-attribute.type.d.ts +1 -0
  46. package/dist/types/user-attribute.type.d.ts.map +1 -0
  47. package/dist/types/user.type.d.ts +2 -1
  48. package/dist/types/user.type.d.ts.map +1 -0
  49. package/dist/utils/device.d.ts +2 -1
  50. package/dist/utils/device.d.ts.map +1 -0
  51. package/dist/utils/fetch-configurations.d.ts +3 -2
  52. package/dist/utils/fetch-configurations.d.ts.map +1 -0
  53. package/dist/utils/fetch-user.d.ts +3 -2
  54. package/dist/utils/fetch-user.d.ts.map +1 -0
  55. package/dist/utils/tokens.d.ts +1 -0
  56. package/dist/utils/tokens.d.ts.map +1 -0
  57. package/package.json +28 -5
  58. package/.claude/settings.local.json +0 -7
  59. package/dist/components/AuthSwitcher.vue.js +0 -76
  60. package/dist/components/Buttons/SignInButton.vue.js +0 -110
  61. package/dist/components/Buttons/SignOutButton.vue.js +0 -68
  62. package/dist/components/Buttons/SignUpButton.vue.js +0 -86
  63. package/dist/components/Layout/SignedIn.vue.js +0 -54
  64. package/dist/components/Layout/SignedOut.vue.js +0 -54
  65. package/dist/components/Modals/Modal.vue.js +0 -133
  66. package/dist/components/Modals/SignInModal.vue.js +0 -149
  67. package/dist/components/Modals/SignUpModal.vue.js +0 -165
  68. package/dist/components/Notification.vue.js +0 -95
  69. package/dist/components/SignIn.vue.js +0 -485
  70. package/dist/components/SignUp.vue.js +0 -339
  71. package/dist/components/UserProfile.vue.js +0 -916
  72. package/dist/composables/useAtm.js +0 -11
  73. package/dist/composables/useAtmClient.js +0 -8
  74. package/dist/composables/useAuth.js +0 -38
  75. package/dist/plugin.js +0 -33
  76. package/dist/types/configurations.type.js +0 -2
  77. package/dist/types/session.type.js +0 -2
  78. package/dist/types/user-attribute.type.js +0 -2
  79. package/dist/types/user.type.js +0 -2
  80. package/dist/utils/device.js +0 -46
  81. package/dist/utils/fetch-configurations.js +0 -45
  82. package/dist/utils/fetch-user.js +0 -36
  83. package/dist/utils/tokens.js +0 -46
package/dist/index.js CHANGED
@@ -1,32 +1,2278 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
1
+
2
+ (function() {
3
+ if (typeof document !== 'undefined') {
4
+ const style = document.createElement('style');
5
+ style.textContent = "\n.atm-overlay[data-v-c347df44] {\n position: fixed;\n inset: 0;\n z-index: 99999;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(4px);\n overflow-y: auto;\n padding: 1.5rem 0;\n}\n.atm-container[data-v-c347df44] {\n padding: 0 1.5rem;\n width: 100%;\n margin: auto;\n}\n.atm-fade-layer[data-v-c347df44] {\n position: fixed;\n inset: 0;\n transition: opacity 0.2s ease;\n pointer-events: none;\n}\n.atm-fade-bg[data-v-c347df44] {\n position: absolute;\n inset: 0;\n opacity: 0.75;\n}\n.atm-modal[data-v-c347df44] {\n position: relative;\n display: inline-block;\n vertical-align: bottom;\n background-color: #ffffff;\n border-radius: 0.5rem;\n text-align: left;\n box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);\n transform: translate(0);\n transition: all 0.2s ease-in-out;\n max-width: 32rem;\n width: 100%;\n max-height: calc(100vh - 3rem);\n display: flex;\n flex-direction: column;\n}\n.atm-close-button[data-v-c347df44] {\n position: absolute;\n top: 1rem;\n right: 1rem;\n color: #9ca3af;\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 0.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10;\n}\n.atm-close-button[data-v-c347df44]:hover {\n color: #4b5563;\n}\n.atm-icon[data-v-c347df44] {\n width: 1.5rem;\n height: 1.5rem;\n}\n.atm-modal-content[data-v-c347df44] {\n padding: 1.25rem;\n overflow-y: auto;\n flex: 1;\n min-height: 0;\n}\n.atm-modal-title[data-v-c347df44] {\n font-size: 1.125rem;\n font-weight: 500;\n color: #111827;\n margin: 0;\n margin-bottom: 0.75rem;\n}\n@media (max-width: 768px) {\n.atm-overlay[data-v-c347df44] {\n padding: 1rem 0;\n}\n.atm-container[data-v-c347df44] {\n padding: 0 1rem;\n}\n.atm-modal[data-v-c347df44] {\n border-radius: 0.375rem;\n max-height: calc(100vh - 2rem);\n}\n.atm-modal-content[data-v-c347df44] {\n padding: 1rem;\n}\n.atm-modal-title[data-v-c347df44] {\n font-size: 1rem;\n margin-bottom: 0.75rem;\n}\n.atm-close-button[data-v-c347df44] {\n top: 0.75rem;\n right: 0.75rem;\n}\n.atm-icon[data-v-c347df44] {\n width: 1.25rem;\n height: 1.25rem;\n}\n}\n@media (max-width: 480px) {\n.atm-overlay[data-v-c347df44] {\n padding: 0.5rem 0;\n}\n.atm-container[data-v-c347df44] {\n padding: 0 0.5rem;\n}\n.atm-modal[data-v-c347df44] {\n border-radius: 0.25rem;\n max-width: 100%;\n max-height: calc(100vh - 1rem);\n}\n.atm-modal-content[data-v-c347df44] {\n padding: 0.875rem;\n}\n.atm-modal-title[data-v-c347df44] {\n font-size: 0.9375rem;\n margin-bottom: 0.625rem;\n}\n.atm-close-button[data-v-c347df44] {\n top: 0.5rem;\n right: 0.5rem;\n}\n}\n@media (max-width: 360px) {\n.atm-overlay[data-v-c347df44] {\n padding: 0.25rem 0;\n}\n.atm-container[data-v-c347df44] {\n padding: 0 0.25rem;\n}\n.atm-modal[data-v-c347df44] {\n max-height: calc(100vh - 0.5rem);\n}\n.atm-modal-content[data-v-c347df44] {\n padding: 0.75rem;\n}\n.atm-modal-title[data-v-c347df44] {\n font-size: 0.875rem;\n margin-bottom: 0.5rem;\n}\n}\n\n.atm-login-container[data-v-69af412a] {\n background: #ffffff;\n border-radius: 8px;\n font-family: 'Segoe UI', system-ui, sans-serif;\n text-align: center;\n}\n.atm-logo-container[data-v-69af412a] {\n margin-bottom: 12px;\n}\n.atm-logo-placeholder[data-v-69af412a] {\n width: 44px;\n height: 44px;\n margin: 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #f0f0f0;\n border-radius: 50%;\n color: #888;\n font-size: 11px;\n}\n.atm-logo-image[data-v-69af412a] {\n max-width: 44px;\n max-height: 44px;\n margin: 0 auto;\n display: block;\n border-radius: 4px;\n object-fit: contain;\n}\n.atm-project-name[data-v-69af412a] {\n margin: 0 0 4px 0;\n font-size: 18px;\n color: var(--e2d4c99e);\n font-weight: 600;\n}\n.atm-welcome-text[data-v-69af412a] {\n margin: 0 0 16px 0;\n font-size: 14px;\n color: #666;\n}\n.atm-form-group[data-v-69af412a] {\n margin-bottom: 12px;\n text-align: left;\n}\n.atm-input-label[data-v-69af412a] {\n display: block;\n margin-bottom: 4px;\n font-size: 13px;\n color: #555;\n font-weight: 500;\n}\n.atm-input-field[data-v-69af412a] {\n width: 100%;\n padding: 8px 10px;\n border: 1px solid #ddd;\n border-radius: 6px;\n font-size: 14px;\n box-sizing: border-box;\n transition: border-color 0.2s;\n}\n.atm-input-field[data-v-69af412a]:focus {\n outline: none;\n border-color: var(--e2d4c99e);\n box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);\n}\n.atm-input-field[data-v-69af412a]:disabled {\n background-color: #f5f5f5;\n cursor: not-allowed;\n}\n.atm-field-error[data-v-69af412a] {\n color: #dc3545;\n font-size: 12px;\n margin-top: 4px;\n text-align: left;\n}\n.atm-alternative-options[data-v-69af412a] {\n margin-top: 8px;\n text-align: center;\n}\n.atm-forgot-password-link[data-v-69af412a] {\n font-size: 12px;\n background: none;\n border: none;\n color: var(--v182122ff);\n cursor: pointer;\n text-decoration: none;\n padding: 0;\n font-family: inherit;\n}\n.atm-forgot-password-link[data-v-69af412a]:hover:not(:disabled) {\n text-decoration: underline;\n}\n.atm-forgot-password-link[data-v-69af412a]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.atm-strategy-choice[data-v-69af412a] {\n text-align: center;\n margin-bottom: 12px;\n}\n.atm-strategy-title[data-v-69af412a] {\n font-size: 14px;\n color: #666;\n margin-bottom: 12px;\n}\n.atm-strategy-buttons[data-v-69af412a] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.atm-strategy-button[data-v-69af412a] {\n width: 100%;\n padding: 10px;\n background: #f8f9fa;\n color: #333;\n border: 1px solid #ddd;\n border-radius: 6px;\n font-size: 14px;\n cursor: pointer;\n transition: all 0.2s;\n}\n.atm-strategy-button[data-v-69af412a]:hover:not(:disabled) {\n background: #e9ecef;\n border-color: var(--e2d4c99e);\n}\n.atm-strategy-button[data-v-69af412a]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n.atm-email-link-text[data-v-69af412a] {\n font-size: 14px;\n color: #666;\n margin: 0;\n text-align: center;\n}\n.atm-login-button[data-v-69af412a] {\n width: 100%;\n padding: 10px;\n margin-top: 4px;\n background: var(--e2d4c99e);\n color: #fff;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n min-height: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.atm-login-button[data-v-69af412a]:hover:not(:disabled) {\n opacity: 0.9;\n transform: translateY(-1px);\n}\n.atm-login-button[data-v-69af412a]:disabled {\n opacity: 0.8;\n cursor: not-allowed;\n transform: none;\n}\n.button-spinner[data-v-69af412a] {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n color: #fff;\n font-weight: 500;\n}\n.spinner-svg[data-v-69af412a] {\n animation: spin-69af412a 1s linear infinite;\n width: 18px;\n height: 18px;\n stroke: #fff;\n}\n.spinner-circle[data-v-69af412a] {\n stroke-dasharray: 90, 150;\n stroke-linecap: round;\n}\n@keyframes spin-69af412a {\n0% {\n transform: rotate(0deg);\n}\n100% {\n transform: rotate(360deg);\n}\n}\n.atm-footer-links[data-v-69af412a] {\n margin-top: 16px;\n font-size: 13px;\n}\n.atm-signup-text[data-v-69af412a] {\n color: #666;\n margin-bottom: 6px;\n}\n.atm-signup-link[data-v-69af412a] {\n color: var(--v182122ff);\n text-decoration: none;\n cursor: pointer;\n}\n.atm-signup-link[data-v-69af412a]:hover {\n text-decoration: underline;\n}\n.atm-powered-by[data-v-69af412a] {\n color: #999;\n font-size: 11px;\n margin: 0;\n}\n@media (max-width: 768px) {\n.atm-project-name[data-v-69af412a] {\n font-size: 17px;\n}\n.atm-welcome-text[data-v-69af412a] {\n font-size: 13px;\n margin-bottom: 14px;\n}\n.atm-form-group[data-v-69af412a] {\n margin-bottom: 10px;\n}\n.atm-input-label[data-v-69af412a] {\n font-size: 12px;\n margin-bottom: 4px;\n}\n.atm-input-field[data-v-69af412a] {\n padding: 8px 10px;\n font-size: 13px;\n}\n.atm-login-button[data-v-69af412a] {\n font-size: 13px;\n padding: 9px;\n min-height: 40px;\n}\n.atm-strategy-button[data-v-69af412a] {\n padding: 9px;\n font-size: 13px;\n}\n.atm-footer-links[data-v-69af412a] {\n margin-top: 14px;\n font-size: 12px;\n}\n}\n@media (max-width: 480px) {\n.atm-logo-placeholder[data-v-69af412a] {\n width: 40px;\n height: 40px;\n font-size: 10px;\n}\n.atm-logo-image[data-v-69af412a] {\n max-width: 40px;\n max-height: 40px;\n}\n.atm-project-name[data-v-69af412a] {\n font-size: 16px;\n margin-bottom: 4px;\n}\n.atm-welcome-text[data-v-69af412a] {\n font-size: 12px;\n margin-bottom: 12px;\n}\n.atm-form-group[data-v-69af412a] {\n margin-bottom: 10px;\n}\n.atm-input-label[data-v-69af412a] {\n font-size: 12px;\n margin-bottom: 3px;\n}\n.atm-input-field[data-v-69af412a] {\n padding: 7px 9px;\n font-size: 13px;\n}\n.atm-login-button[data-v-69af412a] {\n font-size: 13px;\n padding: 9px;\n min-height: 38px;\n}\n.atm-forgot-password-link[data-v-69af412a] {\n font-size: 11px;\n}\n.atm-strategy-title[data-v-69af412a] {\n font-size: 13px;\n margin-bottom: 10px;\n}\n.atm-strategy-button[data-v-69af412a] {\n padding: 9px;\n font-size: 13px;\n}\n.atm-email-link-text[data-v-69af412a] {\n font-size: 13px;\n}\n.atm-footer-links[data-v-69af412a] {\n margin-top: 12px;\n font-size: 12px;\n}\n.atm-powered-by[data-v-69af412a] {\n font-size: 10px;\n}\n.spinner-svg[data-v-69af412a] {\n width: 16px;\n height: 16px;\n}\n.button-spinner[data-v-69af412a] {\n gap: 6px;\n}\n}\n@media (max-width: 360px) {\n.atm-logo-placeholder[data-v-69af412a] {\n width: 36px;\n height: 36px;\n font-size: 9px;\n}\n.atm-logo-image[data-v-69af412a] {\n max-width: 36px;\n max-height: 36px;\n}\n.atm-project-name[data-v-69af412a] {\n font-size: 15px;\n margin-bottom: 3px;\n}\n.atm-welcome-text[data-v-69af412a] {\n font-size: 11px;\n margin-bottom: 10px;\n}\n.atm-form-group[data-v-69af412a] {\n margin-bottom: 8px;\n}\n.atm-input-label[data-v-69af412a] {\n font-size: 11px;\n margin-bottom: 3px;\n}\n.atm-input-field[data-v-69af412a] {\n padding: 6px 8px;\n font-size: 12px;\n}\n.atm-login-button[data-v-69af412a] {\n font-size: 12px;\n padding: 8px;\n min-height: 36px;\n}\n.atm-strategy-button[data-v-69af412a] {\n padding: 8px;\n font-size: 12px;\n}\n.atm-footer-links[data-v-69af412a] {\n margin-top: 10px;\n font-size: 11px;\n}\n.spinner-svg[data-v-69af412a] {\n width: 14px;\n height: 14px;\n}\n}\n\n.atm-notification-container[data-v-f5e47084] {\n font-family: Arial, Helvetica, sans-serif;\n position: fixed;\n top: 20px;\n right: 20px;\n z-index: 99999;\n pointer-events: none;\n}\n.atm-notification[data-v-f5e47084] {\n padding: 12px 16px;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n min-width: 250px;\n max-width: 350px;\n pointer-events: auto;\n}\n.atm-notification--error[data-v-f5e47084] {\n background: #ff3333;\n color: #FFF;\n}\n.atm-notification--success[data-v-f5e47084] {\n background: #00a622;\n color: #FFF;\n}\n.atm-notification--warning[data-v-f5e47084] {\n background: #ffa500;\n color: #FFF;\n}\n.atm-notification-enter-active[data-v-f5e47084] {\n transition: all 0.3s ease-out;\n}\n.atm-notification-leave-active[data-v-f5e47084] {\n transition: all 0.3s ease-in;\n}\n.atm-notification-enter-from[data-v-f5e47084] {\n transform: translateX(100%);\n opacity: 0;\n}\n.atm-notification-leave-to[data-v-f5e47084] {\n transform: translateX(100%);\n opacity: 0;\n}\n@media (max-width: 768px) {\n.atm-notification-container[data-v-f5e47084] {\n top: 16px;\n right: 16px;\n left: 16px;\n}\n.atm-notification[data-v-f5e47084] {\n min-width: auto;\n max-width: 100%;\n padding: 11px 14px;\n font-size: 13px;\n}\n}\n@media (max-width: 480px) {\n.atm-notification-container[data-v-f5e47084] {\n top: 12px;\n right: 12px;\n left: 12px;\n}\n.atm-notification[data-v-f5e47084] {\n padding: 10px 12px;\n font-size: 12px;\n border-radius: 5px;\n}\n}\n@media (max-width: 360px) {\n.atm-notification-container[data-v-f5e47084] {\n top: 10px;\n right: 10px;\n left: 10px;\n}\n.atm-notification[data-v-f5e47084] {\n padding: 9px 11px;\n font-size: 11px;\n border-radius: 4px;\n}\n}\n\n.atm-signup-container[data-v-de716df2] {\n width: 100%;\n border-radius: 8px;\n font-family: 'Segoe UI', system-ui, sans-serif;\n text-align: center;\n}\n.atm-logo-container[data-v-de716df2] {\n margin-bottom: 12px;\n}\n.atm-logo-placeholder[data-v-de716df2] {\n width: 44px;\n height: 44px;\n margin: 0 auto;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #f0f0f0;\n border-radius: 50%;\n color: #888;\n font-size: 11px;\n}\n.atm-logo-image[data-v-de716df2] {\n max-width: 44px;\n max-height: 44px;\n margin: 0 auto;\n display: block;\n border-radius: 4px;\n object-fit: contain;\n}\n.atm-project-name[data-v-de716df2] {\n margin: 0 0 4px 0;\n font-size: 18px;\n color: var(--v8c008960);\n font-weight: 600;\n}\n.atm-welcome-text[data-v-de716df2] {\n margin: 0 0 16px 0;\n font-size: 14px;\n color: #666;\n}\n.atm-form-group[data-v-de716df2] {\n margin-bottom: 12px;\n text-align: left;\n}\n.atm-input-label[data-v-de716df2] {\n display: block;\n margin-bottom: 4px;\n font-size: 13px;\n color: #555;\n font-weight: 500;\n}\n.atm-input-field[data-v-de716df2] {\n width: 100%;\n padding: 8px 10px;\n border: 1px solid #ddd;\n border-radius: 6px;\n font-size: 14px;\n box-sizing: border-box;\n transition: border-color 0.2s;\n}\n.atm-input-field[data-v-de716df2]:focus {\n outline: none;\n border-color: var(--v8c008960);\n box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);\n}\n.atm-input-field[data-v-de716df2]:disabled {\n background-color: #f5f5f5;\n cursor: not-allowed;\n}\n.atm-field-error[data-v-de716df2] {\n color: #dc3545;\n font-size: 12px;\n margin-top: 4px;\n text-align: left;\n}\n.atm-signup-button[data-v-de716df2] {\n width: 100%;\n padding: 10px;\n margin-top: 4px;\n background: var(--v8c008960);\n color: #fff;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n min-height: 42px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.atm-signup-button[data-v-de716df2]:hover:not(:disabled) {\n opacity: 0.9;\n transform: translateY(-1px);\n}\n.atm-signup-button[data-v-de716df2]:disabled {\n opacity: 0.8;\n cursor: not-allowed;\n transform: none;\n}\n.button-spinner[data-v-de716df2] {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n color: #fff;\n font-weight: 500;\n}\n.spinner-svg[data-v-de716df2] {\n animation: spin-de716df2 1s linear infinite;\n width: 18px;\n height: 18px;\n stroke: #fff;\n}\n.spinner-circle[data-v-de716df2] {\n stroke-dasharray: 90, 150;\n stroke-linecap: round;\n}\n@keyframes spin-de716df2 {\n0% {\n transform: rotate(0deg);\n}\n100% {\n transform: rotate(360deg);\n}\n}\n.atm-footer-links[data-v-de716df2] {\n margin-top: 16px;\n font-size: 13px;\n}\n.atm-login-text[data-v-de716df2] {\n color: #666;\n margin-bottom: 6px;\n}\n.atm-login-link[data-v-de716df2] {\n color: var(--v1183b75e);\n text-decoration: none;\n cursor: pointer;\n transition: opacity 0.2s;\n}\n.atm-login-link[data-v-de716df2]:hover:not(.disabled-link) {\n text-decoration: underline;\n}\n.atm-login-link.disabled-link[data-v-de716df2] {\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n}\n.atm-powered-by[data-v-de716df2] {\n color: #999;\n font-size: 11px;\n margin: 0;\n}\n@media (max-width: 768px) {\n.atm-project-name[data-v-de716df2] {\n font-size: 17px;\n}\n.atm-welcome-text[data-v-de716df2] {\n font-size: 13px;\n margin-bottom: 14px;\n}\n.atm-form-group[data-v-de716df2] {\n margin-bottom: 10px;\n}\n.atm-input-label[data-v-de716df2] {\n font-size: 12px;\n margin-bottom: 4px;\n}\n.atm-input-field[data-v-de716df2] {\n padding: 8px 10px;\n font-size: 13px;\n}\n.atm-signup-button[data-v-de716df2] {\n font-size: 13px;\n padding: 9px;\n min-height: 40px;\n}\n.atm-footer-links[data-v-de716df2] {\n margin-top: 14px;\n font-size: 12px;\n}\n}\n@media (max-width: 480px) {\n.atm-logo-placeholder[data-v-de716df2] {\n width: 40px;\n height: 40px;\n font-size: 10px;\n}\n.atm-logo-image[data-v-de716df2] {\n max-width: 40px;\n max-height: 40px;\n}\n.atm-project-name[data-v-de716df2] {\n font-size: 16px;\n margin-bottom: 4px;\n}\n.atm-welcome-text[data-v-de716df2] {\n font-size: 12px;\n margin-bottom: 12px;\n}\n.atm-form-group[data-v-de716df2] {\n margin-bottom: 10px;\n}\n.atm-input-label[data-v-de716df2] {\n font-size: 12px;\n margin-bottom: 3px;\n}\n.atm-input-field[data-v-de716df2] {\n padding: 7px 9px;\n font-size: 13px;\n}\n.atm-signup-button[data-v-de716df2] {\n font-size: 13px;\n padding: 9px;\n min-height: 38px;\n}\n.atm-footer-links[data-v-de716df2] {\n margin-top: 12px;\n font-size: 12px;\n}\n.atm-powered-by[data-v-de716df2] {\n font-size: 10px;\n}\n.spinner-svg[data-v-de716df2] {\n width: 16px;\n height: 16px;\n}\n.button-spinner[data-v-de716df2] {\n gap: 6px;\n}\n}\n@media (max-width: 360px) {\n.atm-logo-placeholder[data-v-de716df2] {\n width: 36px;\n height: 36px;\n font-size: 9px;\n}\n.atm-logo-image[data-v-de716df2] {\n max-width: 36px;\n max-height: 36px;\n}\n.atm-project-name[data-v-de716df2] {\n font-size: 15px;\n margin-bottom: 3px;\n}\n.atm-welcome-text[data-v-de716df2] {\n font-size: 11px;\n margin-bottom: 10px;\n}\n.atm-form-group[data-v-de716df2] {\n margin-bottom: 8px;\n}\n.atm-input-label[data-v-de716df2] {\n font-size: 11px;\n margin-bottom: 3px;\n}\n.atm-input-field[data-v-de716df2] {\n padding: 6px 8px;\n font-size: 12px;\n}\n.atm-signup-button[data-v-de716df2] {\n font-size: 12px;\n padding: 8px;\n min-height: 36px;\n}\n.atm-footer-links[data-v-de716df2] {\n margin-top: 10px;\n font-size: 11px;\n}\n.spinner-svg[data-v-de716df2] {\n width: 14px;\n height: 14px;\n}\n}\n\n.atm-signin-btn[data-v-4139c6d0] {\n padding: 12px;\n margin-top: 8px;\n background: var(--v0f0ded3a);\n color: #FFF;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n min-height: 44px;\n}\n.atm-signin-btn[data-v-4139c6d0]:hover {\n opacity: 0.9;\n}\n@media (max-width: 768px) {\n.atm-signin-btn[data-v-4139c6d0] {\n padding: 11px;\n font-size: 13px;\n min-height: 42px;\n}\n}\n@media (max-width: 480px) {\n.atm-signin-btn[data-v-4139c6d0] {\n padding: 10px;\n font-size: 13px;\n min-height: 40px;\n}\n}\n@media (max-width: 360px) {\n.atm-signin-btn[data-v-4139c6d0] {\n padding: 9px;\n font-size: 12px;\n min-height: 38px;\n}\n}\n\n.atm-signup-btn[data-v-959aa7ef] {\n padding: 12px;\n margin-top: 8px;\n background: var(--v1112fbaa);\n color: #FFF;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n min-height: 44px;\n}\n.atm-signup-btn[data-v-959aa7ef]:hover {\n opacity: 0.9;\n}\n@media (max-width: 768px) {\n.atm-signup-btn[data-v-959aa7ef] {\n padding: 11px;\n font-size: 13px;\n min-height: 42px;\n}\n}\n@media (max-width: 480px) {\n.atm-signup-btn[data-v-959aa7ef] {\n padding: 10px;\n font-size: 13px;\n min-height: 40px;\n}\n}\n@media (max-width: 360px) {\n.atm-signup-btn[data-v-959aa7ef] {\n padding: 9px;\n font-size: 12px;\n min-height: 38px;\n}\n}\n\n.atm-profile-container {\n position: relative;\n display: inline-block;\n font-family: 'Segoe UI', system-ui, sans-serif;\n}\n.atm-profile-button {\n display: flex;\n align-items: center;\n gap: 8px;\n background: none;\n border: none;\n cursor: pointer;\n padding: 8px 12px;\n border-radius: 6px;\n transition: background 0.2s;\n}\n.atm-profile-button:hover {\n background: #f0f0f0;\n}\n.atm-profile-avatar {\n width: 32px;\n height: 32px;\n border-radius: 50%;\n background-color: var(--v1982ae74);\n color: white;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n font-weight: 500;\n}\n.atm-profile-avatar.large {\n width: 48px;\n height: 48px;\n font-size: 16px;\n}\n.atm-profile-avatar-img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n border-radius: 50%;\n}\n.atm-profile-name {\n font-size: 14px;\n color: #333;\n font-weight: 500;\n}\n.atm-profile-arrow {\n width: 16px;\n height: 16px;\n transition: transform 0.2s;\n}\n.atm-rotate {\n transform: rotate(180deg);\n}\n.atm-profile-menu {\n position: absolute;\n top: 100%;\n left: 0;\n width: 280px;\n background: white;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);\n z-index: 1000;\n overflow: hidden;\n margin-top: 4px;\n}\n.atm-profile-info {\n display: flex;\n gap: 12px;\n padding: 16px;\n border-bottom: 1px solid #f0f0f0;\n}\n.atm-profile-details {\n flex: 1;\n min-width: 0;\n}\n.atm-profile-fullname {\n margin: 0;\n font-size: 14px;\n font-weight: 600;\n color: #333;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.atm-profile-email {\n margin: 4px 0 0;\n font-size: 13px;\n color: #666;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.atm-profile-options {\n padding: 8px 0;\n}\n.atm-profile-option {\n display: flex;\n align-items: center;\n width: 100%;\n padding: 10px 16px;\n background: none;\n border: none;\n text-align: left;\n cursor: pointer;\n font-size: 14px;\n color: #333;\n gap: 10px;\n transition: background 0.2s;\n}\n.atm-profile-option:hover {\n background: #f5f5f5;\n}\n.atm-profile-icon {\n width: 18px;\n height: 18px;\n color: #666;\n}\n.atm-fade-enter-active,\n.atm-fade-leave-active {\n transition: opacity 0.2s, transform 0.2s;\n}\n.atm-fade-enter-from,\n.atm-fade-leave-to {\n opacity: 0;\n transform: translateY(-10px);\n}\n.atm-profile-modal {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 9999;\n display: flex;\n justify-content: center;\n align-items: center;\n overflow-y: auto;\n padding: 1.5rem;\n}\n.atm-profile-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n pointer-events: none;\n}\n.atm-profile-content {\n position: relative;\n width: 100%;\n max-width: 450px;\n background: white;\n border-radius: 12px;\n box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);\n z-index: 1;\n max-height: calc(100vh - 3rem);\n display: flex;\n flex-direction: column;\n margin: auto;\n}\n.atm-profile-header {\n padding: 16px;\n border-bottom: 1px solid #f0f0f0;\n display: flex;\n align-items: center;\n}\n.atm-profile-close {\n background: none;\n border: none;\n font-size: 24px;\n cursor: pointer;\n padding: 8px;\n margin-right: 12px;\n color: #666;\n}\n.atm-profile-title {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: #333;\n}\n.atm-profile-tabs {\n display: flex;\n border-bottom: 1px solid #f0f0f0;\n background: #f8f9fa;\n}\n.atm-tab {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 12px 16px;\n background: none;\n border: none;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n color: #666;\n transition: all 0.2s;\n}\n.atm-tab:hover {\n background: #e9ecef;\n}\n.atm-tab-active {\n color: var(--v1982ae74) !important;\n background: white;\n border-bottom: 2px solid var(--v1982ae74);\n}\n.atm-tab-icon {\n width: 16px;\n height: 16px;\n}\n.atm-profile-body {\n padding: 24px;\n text-align: center;\n overflow-y: auto;\n flex: 1;\n min-height: 0;\n}\n.atm-profile-avatar-large {\n width: 80px;\n height: 80px;\n border-radius: 50%;\n background-color: var(--v1982ae74);\n color: white;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 24px;\n font-weight: 600;\n margin: 0 auto 20px;\n}\n.atm-profile-info-grid {\n width: 100%;\n text-align: left;\n margin-top: 20px;\n}\n.atm-profile-info-row {\n display: flex;\n flex-direction: column;\n margin-bottom: 16px;\n}\n.atm-profile-info-label {\n font-size: 13px;\n color: #666;\n margin-bottom: 4px;\n}\n.atm-profile-info-value {\n font-size: 16px;\n color: #333;\n font-weight: 500;\n}\n.atm-profile-edit-form {\n width: 100%;\n text-align: left;\n margin-top: 20px;\n}\n.atm-form-group {\n margin-bottom: 16px;\n}\n.atm-input-label {\n display: block;\n margin-bottom: 6px;\n font-size: 13px;\n color: #555;\n font-weight: 500;\n}\n.atm-input-field {\n width: 100%;\n padding: 10px 12px;\n border: 1px solid #ddd;\n border-radius: 6px;\n font-size: 14px;\n box-sizing: border-box;\n transition: border-color 0.2s;\n}\n.atm-input-field:focus {\n outline: none;\n border-color: var(--v1982ae74);\n box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);\n}\n.atm-form-actions {\n display: flex;\n gap: 12px;\n margin-top: 24px;\n}\n.atm-save-btn,\n.atm-edit-profile-btn,\n.atm-reset-password-btn,\n.atm-add-email-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px;\n background: var(--v1982ae74);\n color: #FFF;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: opacity 0.2s;\n justify-content: center;\n}\n.atm-save-btn:hover,\n.atm-edit-profile-btn:hover,\n.atm-reset-password-btn:hover,\n.atm-add-email-btn:hover {\n opacity: 0.9;\n}\n.atm-cancel-btn {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1;\n padding: 12px;\n background: #f8f9fa;\n color: #666;\n border: 1px solid #ddd;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n justify-content: center;\n}\n.atm-cancel-btn:hover {\n background: #e9ecef;\n}\n.atm-btn-icon {\n width: 16px;\n height: 16px;\n}\n.atm-email-add-section {\n margin-bottom: 24px;\n text-align: left;\n}\n.atm-email-list {\n display: flex;\n flex-direction: column;\n gap: 12px;\n text-align: left;\n}\n.atm-email-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px;\n background: #f8f9fa;\n border-radius: 6px;\n border: 1px solid #e9ecef;\n}\n.atm-email-info {\n display: flex;\n flex-direction: column;\n gap: 8px;\n flex: 1;\n}\n.atm-email-address {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n.atm-email-icon {\n width: 16px;\n height: 16px;\n color: var(--c7d31cfc);\n}\n.atm-email-badges {\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n}\n.atm-badge {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n font-size: 11px;\n font-weight: 500;\n border-radius: 12px;\n text-transform: uppercase;\n}\n.atm-badge-icon {\n width: 12px;\n height: 12px;\n}\n.atm-badge-primary {\n background: #e3f2fd;\n color: #1976d2;\n}\n.atm-badge-verified {\n background: #e8f5e8;\n color: #2e7d32;\n}\n.atm-badge-unverified {\n background: #fff3e0;\n color: #f57c00;\n}\n.atm-email-actions {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.atm-verify-btn {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 6px 12px;\n background: var(--v1982ae74);\n color: white;\n border: none;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: opacity 0.2s;\n}\n.atm-verify-btn:hover {\n opacity: 0.9;\n}\n.atm-delete-btn {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 6px 12px;\n background: #dc3545;\n color: white;\n border: none;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n transition: opacity 0.2s;\n}\n.atm-delete-btn:hover {\n opacity: 0.9;\n}\n.atm-password-section {\n text-align: left;\n}\n.atm-sessions-section {\n text-align: left;\n}\n.atm-sessions-info {\n margin-bottom: 20px;\n}\n.atm-sessions-description {\n margin: 0;\n font-size: 14px;\n color: #666;\n line-height: 1.5;\n}\n.atm-sessions-list {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n.atm-session-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px;\n background: #f8f9fa;\n border-radius: 8px;\n border: 1px solid #e9ecef;\n gap: 16px;\n}\n.atm-session-header {\n display: flex;\n gap: 12px;\n align-items: flex-start;\n}\n.atm-session-icon {\n width: 24px;\n height: 24px;\n color: var(--c7d31cfc);\n flex-shrink: 0;\n}\n.atm-session-details {\n flex: 1;\n min-width: 0;\n}\n.atm-session-title {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 4px;\n font-size: 15px;\n font-weight: 600;\n color: #333;\n}\n.atm-session-device-info {\n font-size: 13px;\n color: #666;\n margin-bottom: 8px;\n}\n.atm-badge-current {\n background: #d1f4e0;\n color: #0f9d58;\n}\n.atm-session-timestamps {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.atm-session-timestamp {\n display: flex;\n gap: 6px;\n font-size: 13px;\n color: #666;\n}\n.atm-timestamp-label {\n font-weight: 500;\n color: #555;\n}\n.atm-session-actions {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.atm-close-session-btn {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 14px;\n background: #dc3545;\n color: white;\n border: none;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: opacity 0.2s;\n white-space: nowrap;\n}\n.atm-close-session-btn:hover {\n opacity: 0.9;\n}\n@media (max-width: 768px) {\n.atm-profile-button {\n padding: 6px 10px;\n gap: 6px;\n}\n.atm-profile-name {\n font-size: 13px;\n}\n.atm-profile-menu {\n width: 260px;\n}\n.atm-profile-modal {\n padding: 1rem;\n}\n.atm-profile-content {\n max-width: 90%;\n max-height: calc(100vh - 2rem);\n}\n.atm-profile-header {\n padding: 14px;\n}\n.atm-profile-title {\n font-size: 16px;\n}\n.atm-profile-body {\n padding: 20px;\n}\n.atm-tab {\n padding: 10px 12px;\n font-size: 13px;\n gap: 4px;\n}\n.atm-tab-icon {\n width: 14px;\n height: 14px;\n}\n.atm-profile-avatar-large {\n width: 70px;\n height: 70px;\n font-size: 22px;\n}\n.atm-email-item {\n flex-direction: column;\n gap: 12px;\n align-items: flex-start;\n}\n.atm-email-actions {\n flex-direction: row;\n width: 100%;\n}\n.atm-verify-btn,\n .atm-delete-btn {\n flex: 1;\n justify-content: center;\n}\n.atm-session-item {\n flex-direction: column;\n align-items: flex-start;\n}\n.atm-session-actions {\n width: 100%;\n}\n.atm-close-session-btn {\n width: 100%;\n justify-content: center;\n}\n}\n@media (max-width: 480px) {\n.atm-profile-button {\n padding: 4px 8px;\n gap: 4px;\n}\n.atm-profile-avatar {\n width: 28px;\n height: 28px;\n font-size: 11px;\n}\n.atm-profile-avatar.large {\n width: 40px;\n height: 40px;\n font-size: 14px;\n}\n.atm-profile-name {\n font-size: 12px;\n}\n.atm-profile-arrow {\n width: 14px;\n height: 14px;\n}\n.atm-profile-menu {\n width: calc(100vw - 20px);\n max-width: 240px;\n}\n.atm-profile-info {\n padding: 12px;\n gap: 10px;\n}\n.atm-profile-fullname {\n font-size: 13px;\n}\n.atm-profile-email {\n font-size: 12px;\n}\n.atm-profile-option {\n padding: 8px 12px;\n font-size: 13px;\n gap: 8px;\n}\n.atm-profile-icon {\n width: 16px;\n height: 16px;\n}\n.atm-profile-modal {\n padding: 0.5rem;\n}\n.atm-profile-content {\n max-width: 95%;\n max-height: calc(100vh - 1rem);\n}\n.atm-profile-header {\n padding: 12px;\n}\n.atm-profile-close {\n font-size: 20px;\n padding: 4px;\n margin-right: 8px;\n}\n.atm-profile-title {\n font-size: 15px;\n}\n.atm-profile-body {\n padding: 16px;\n}\n.atm-tab {\n padding: 8px 8px;\n font-size: 12px;\n gap: 3px;\n}\n.atm-tab-icon {\n width: 13px;\n height: 13px;\n}\n.atm-profile-avatar-large {\n width: 60px;\n height: 60px;\n font-size: 20px;\n margin-bottom: 16px;\n}\n.atm-profile-info-label {\n font-size: 12px;\n}\n.atm-profile-info-value {\n font-size: 14px;\n}\n.atm-input-label {\n font-size: 12px;\n}\n.atm-input-field {\n padding: 8px 10px;\n font-size: 13px;\n}\n.atm-form-actions {\n flex-direction: column;\n gap: 8px;\n}\n.atm-save-btn,\n .atm-cancel-btn,\n .atm-edit-profile-btn,\n .atm-reset-password-btn {\n width: 100%;\n padding: 10px;\n font-size: 13px;\n}\n.atm-email-item {\n padding: 10px;\n}\n.atm-email-address {\n font-size: 13px;\n}\n.atm-badge {\n font-size: 10px;\n padding: 2px 6px;\n}\n}\n@media (max-width: 360px) {\n.atm-profile-button {\n padding: 4px 6px;\n}\n.atm-profile-avatar {\n width: 26px;\n height: 26px;\n font-size: 10px;\n}\n.atm-profile-name {\n display: none;\n}\n.atm-profile-menu {\n width: calc(100vw - 16px);\n max-width: 220px;\n}\n.atm-profile-modal {\n padding: 0.25rem;\n}\n.atm-profile-content {\n max-width: 98%;\n max-height: calc(100vh - 0.5rem);\n}\n.atm-profile-body {\n padding: 12px;\n}\n.atm-tab {\n padding: 8px 6px;\n font-size: 11px;\n flex-direction: column;\n gap: 2px;\n}\n.atm-profile-avatar-large {\n width: 50px;\n height: 50px;\n font-size: 18px;\n}\n.atm-email-item {\n padding: 8px;\n}\n}\n\n.atm-auth-buttons[data-v-0c63ecb8] {\n display: flex;\n flex-wrap: wrap;\n gap: 16px;\n}\n@media (max-width: 768px) {\n.atm-auth-buttons[data-v-0c63ecb8] {\n gap: 14px;\n}\n}\n@media (max-width: 480px) {\n.atm-auth-buttons[data-v-0c63ecb8] {\n gap: 12px;\n flex-direction: column;\n}\n}\n@media (max-width: 360px) {\n.atm-auth-buttons[data-v-0c63ecb8] {\n gap: 10px;\n}\n}\n\n.atm-logout-btn[data-v-7157f989] {\n padding: 12px;\n margin-top: 8px;\n background: var(--v2ec0f896);\n color: #FFF;\n border: none;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: opacity 0.2s;\n min-height: 44px;\n}\n.atm-logout-btn[data-v-7157f989]:hover {\n opacity: 0.9;\n}\n@media (max-width: 768px) {\n.atm-logout-btn[data-v-7157f989] {\n padding: 11px;\n font-size: 13px;\n min-height: 42px;\n}\n}\n@media (max-width: 480px) {\n.atm-logout-btn[data-v-7157f989] {\n padding: 10px;\n font-size: 13px;\n min-height: 40px;\n}\n}\n@media (max-width: 360px) {\n.atm-logout-btn[data-v-7157f989] {\n padding: 9px;\n font-size: 12px;\n min-height: 38px;\n}\n}\n";
6
+ document.head.appendChild(style);
7
+ }
8
+ })();
9
+ import { inject, defineComponent, createElementBlock, openBlock, createElementVNode, normalizeStyle, createCommentVNode, toDisplayString, renderSlot, useCssVars, computed, ref, onMounted, nextTick, watch, unref, withModifiers, withDirectives, vModelText, Fragment, renderList, createTextVNode, createBlock, Teleport, createVNode, Transition, withCtx, normalizeClass, onUnmounted, provide } from "vue";
10
+ import UniversalCookie from "universal-cookie";
11
+ import { AtmClient } from "@autenticar-me/client-js";
12
+ const writeAccessTokenInCookie = (accessToken) => {
13
+ const cookies = new UniversalCookie();
14
+ if (accessToken === null) {
15
+ cookies.remove("atm_access_token");
16
+ } else {
17
+ cookies.set("atm_access_token", accessToken);
18
+ }
19
+ };
20
+ const getAccessToken = async () => {
21
+ const cookies = new UniversalCookie();
22
+ return cookies.get("atm_access_token");
23
+ };
24
+ const writeRefreshTokenInCookie = (refreshToken) => {
25
+ const cookies = new UniversalCookie();
26
+ if (refreshToken === null) {
27
+ cookies.remove("atm_refresh_token");
28
+ } else {
29
+ cookies.set("atm_refresh_token", refreshToken);
30
+ }
31
+ };
32
+ const fetchUser = async (client, user) => {
33
+ let accessToken = await getAccessToken();
34
+ if (accessToken == null) {
35
+ user.value = null;
36
+ return;
37
+ }
38
+ const response = await client.value.account(accessToken).getProfile();
39
+ user.value = {
40
+ id: response.id,
41
+ username: response.username,
42
+ firstName: response.first_name,
43
+ lastName: response.last_name,
44
+ primaryEmailAddress: response.primary_email_address,
45
+ primaryEmailAddressId: response.primary_email_address_id,
46
+ profileImage: response.profile_image,
47
+ attributes: response.attributes.map((atribute) => ({
48
+ key: atribute.key,
49
+ mode: atribute.mode,
50
+ value: atribute.value
51
+ }))
52
+ };
53
+ };
54
+ function useAtm() {
55
+ const ctx = inject("atm");
56
+ if (!ctx) {
57
+ throw new Error("[Autenticar.me] É necessário configurar o plugin no main.ts");
58
+ }
59
+ return ctx;
60
+ }
61
+ function useAuth() {
62
+ const { client, user } = useAtm();
63
+ const signInByAccessToken = async (accessToken) => {
64
+ writeAccessTokenInCookie(accessToken);
65
+ await fetchUser(client, user);
66
+ };
67
+ const logout = async () => {
68
+ const accessToken = await getAccessToken();
69
+ if (accessToken == null) {
70
+ return;
71
+ }
72
+ await client.value.account(accessToken).logout();
73
+ user.value = null;
74
+ writeAccessTokenInCookie(null);
75
+ };
76
+ return {
77
+ user,
78
+ signInByAccessToken,
79
+ getAccessToken,
80
+ fetchUser,
81
+ logout
82
+ };
83
+ }
84
+ const _hoisted_1$8 = { class: "atm-overlay" };
85
+ const _hoisted_2$3 = { class: "atm-modal" };
86
+ const _hoisted_3$3 = { class: "atm-modal-content" };
87
+ const _hoisted_4$3 = {
88
+ key: 0,
89
+ class: "atm-modal-title"
90
+ };
91
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
92
+ __name: "Modal",
93
+ props: {
94
+ title: {
95
+ type: String,
96
+ required: false,
97
+ default: null
98
+ },
99
+ maxWidth: {
100
+ type: Number,
101
+ required: false,
102
+ default: 672
103
+ }
104
+ },
105
+ emits: [
106
+ "close"
107
+ ],
108
+ setup(__props, { emit: __emit }) {
109
+ const emit = __emit;
110
+ const close = () => {
111
+ emit("close");
112
+ };
113
+ return (_ctx, _cache) => {
114
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [
115
+ createElementVNode("div", {
116
+ class: "atm-container",
117
+ style: normalizeStyle({ maxWidth: `${__props.maxWidth}px` })
118
+ }, [
119
+ _cache[2] || (_cache[2] = createElementVNode("div", { class: "atm-fade-layer" }, [
120
+ createElementVNode("div", { class: "atm-fade-bg" })
121
+ ], -1)),
122
+ createElementVNode("div", _hoisted_2$3, [
123
+ createElementVNode("button", {
124
+ class: "atm-close-button",
125
+ onClick: _cache[0] || (_cache[0] = ($event) => close())
126
+ }, [..._cache[1] || (_cache[1] = [
127
+ createElementVNode("svg", {
128
+ class: "atm-icon",
129
+ fill: "none",
130
+ stroke: "currentColor",
131
+ viewBox: "0 0 24 24"
132
+ }, [
133
+ createElementVNode("path", {
134
+ "stroke-linecap": "round",
135
+ "stroke-linejoin": "round",
136
+ "stroke-width": "2",
137
+ d: "M6 18L18 6M6 6l12 12"
138
+ })
139
+ ], -1)
140
+ ])]),
141
+ createElementVNode("div", _hoisted_3$3, [
142
+ __props.title ? (openBlock(), createElementBlock("h3", _hoisted_4$3, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
143
+ createElementVNode("div", null, [
144
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
145
+ ])
146
+ ])
147
+ ])
148
+ ], 4)
149
+ ]);
150
+ };
151
+ }
152
+ });
153
+ const _export_sfc = (sfc, props) => {
154
+ const target = sfc.__vccOpts || sfc;
155
+ for (const [key, val] of props) {
156
+ target[key] = val;
157
+ }
158
+ return target;
159
+ };
160
+ const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-c347df44"]]);
161
+ function useAtmClient() {
162
+ const { client } = useAtm();
163
+ return client.value;
164
+ }
165
+ const DEVICE_TOKEN_KEY = "atm_device_token";
166
+ const getDeviceToken = async (client) => {
167
+ try {
168
+ const storedToken = localStorage.getItem(DEVICE_TOKEN_KEY);
169
+ if (storedToken) {
170
+ return storedToken;
171
+ }
172
+ const response = await fetch(`${client.getProjectUrl()}/api/v1/devices`, {
173
+ method: "POST",
174
+ headers: {
175
+ "accept": "application/json",
176
+ "x-public-key": client.getPublicKey()
177
+ }
178
+ });
179
+ if (!response.ok) {
180
+ const errorBody = await response.json();
181
+ throw new Error(errorBody.message || "Falha ao criar o token do dispositivo.");
182
+ }
183
+ const data = await response.json();
184
+ if (!data.token) {
185
+ throw new Error("O token do dispositivo não foi retornado pelo servidor.");
186
+ }
187
+ localStorage.setItem(DEVICE_TOKEN_KEY, data.token);
188
+ return data.token;
189
+ } catch (error) {
190
+ throw error;
191
+ }
192
+ };
193
+ const _hoisted_1$7 = { class: "atm-login-container" };
194
+ const _hoisted_2$2 = { class: "atm-logo-container" };
195
+ const _hoisted_3$2 = ["src"];
196
+ const _hoisted_4$2 = {
197
+ key: 1,
198
+ class: "atm-logo-placeholder"
199
+ };
200
+ const _hoisted_5$2 = { class: "atm-project-name" };
201
+ const _hoisted_6$2 = { key: 0 };
202
+ const _hoisted_7$2 = {
203
+ key: 0,
204
+ class: "atm-form-group"
205
+ };
206
+ const _hoisted_8$2 = { class: "atm-input-label" };
207
+ const _hoisted_9$2 = ["placeholder", "disabled"];
208
+ const _hoisted_10$2 = {
209
+ key: 0,
210
+ class: "atm-field-error"
211
+ };
212
+ const _hoisted_11$2 = {
213
+ key: 1,
214
+ class: "atm-form-group"
215
+ };
216
+ const _hoisted_12$2 = ["disabled"];
217
+ const _hoisted_13$2 = {
218
+ key: 0,
219
+ class: "atm-field-error"
220
+ };
221
+ const _hoisted_14$2 = {
222
+ class: "atm-alternative-options",
223
+ style: { "margin-top": "4px" }
224
+ };
225
+ const _hoisted_15$2 = ["disabled"];
226
+ const _hoisted_16$2 = {
227
+ key: 2,
228
+ class: "atm-strategy-choice"
229
+ };
230
+ const _hoisted_17$2 = { class: "atm-strategy-buttons" };
231
+ const _hoisted_18$2 = ["onClick", "disabled"];
232
+ const _hoisted_19$2 = { key: 0 };
233
+ const _hoisted_20$2 = {
234
+ key: 3,
235
+ class: "atm-form-group"
236
+ };
237
+ const _hoisted_21$2 = {
238
+ key: 1,
239
+ class: "atm-forgot-password-message",
240
+ style: { "text-align": "center", "color": "#333", "margin-bottom": "16px" }
241
+ };
242
+ const _hoisted_22$2 = ["disabled"];
243
+ const _hoisted_23$2 = { key: 0 };
244
+ const _hoisted_24$2 = {
245
+ key: 1,
246
+ class: "button-spinner"
247
+ };
248
+ const _hoisted_25$2 = { key: 0 };
249
+ const _hoisted_26$2 = { key: 1 };
250
+ const _hoisted_27$2 = { class: "atm-footer-links" };
251
+ const _hoisted_28$1 = { class: "atm-signup-text" };
252
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
253
+ __name: "SignIn",
254
+ emits: [
255
+ "completed",
256
+ "sign-up"
257
+ ],
258
+ setup(__props, { emit: __emit }) {
259
+ useCssVars((_ctx) => ({
260
+ "e2d4c99e": atmPrimaryColor.value,
261
+ "v182122ff": atmSecondaryColor.value
262
+ }));
263
+ const emit = __emit;
264
+ const showNotification = inject("showNotification");
265
+ const form = ref({
266
+ emailAddress: "",
267
+ password: ""
268
+ });
269
+ const currentStep = ref("email");
270
+ const signInStep = ref(null);
271
+ const availableStrategies = ref([]);
272
+ const selectedStrategy = ref(null);
273
+ const serverStep = ref(null);
274
+ const isLoading = ref(false);
275
+ const emailInput = ref(null);
276
+ const passwordInput = ref(null);
277
+ const fieldErrors = ref({
278
+ emailAddress: [],
279
+ password: []
280
+ });
281
+ const client = useAtmClient();
282
+ const { signInByAccessToken } = useAuth();
283
+ const { configurations } = useAtm();
284
+ const atmPrimaryColor = computed(() => configurations.value?.design?.primaryColor);
285
+ const atmSecondaryColor = computed(() => configurations.value?.design?.secondaryColor);
286
+ const logoUrl = computed(() => configurations.value?.project?.logo || "");
287
+ const buttonText = computed(() => {
288
+ if (currentStep.value === "email") return "Entrar";
289
+ if (currentStep.value === "choose_strategy") return "";
290
+ if (currentStep.value === "forgot_password_message") return "";
291
+ return "Finalizar";
292
+ });
293
+ const showEmailField = computed(() => currentStep.value === "email" || currentStep.value === "forgot_password_message");
294
+ const showPasswordField = computed(() => currentStep.value === "password");
295
+ const showStrategyChoice = computed(() => currentStep.value === "choose_strategy");
296
+ const labelText = computed(() => {
297
+ if (configurations.value?.username?.enable === false) {
298
+ return "Email";
299
+ }
300
+ return "Email ou Nome de usuário";
301
+ });
302
+ const inputPlaceholder = computed(() => {
303
+ if (configurations.value?.username?.enable === false) {
304
+ return "email@exemplo.com";
305
+ }
306
+ return "email@exemplo.com ou seu username";
307
+ });
308
+ const processAvailableStrategies = (stepData) => {
309
+ const strategies = stepData?.supported?.first_factors || [];
310
+ return {
311
+ password: strategies.find((s) => s.strategy === "password"),
312
+ emailLink: strategies.find((s) => s.strategy === "email_link")
313
+ };
314
+ };
315
+ const clearErrors = () => {
316
+ fieldErrors.value = {
317
+ emailAddress: [],
318
+ password: []
319
+ };
320
+ };
321
+ const handleEmailStep = async () => {
322
+ if (!form.value.emailAddress.trim()) {
323
+ showNotification?.("Email ou nome de usuário é obrigatório");
324
+ return false;
325
+ }
326
+ try {
327
+ const deviceToken = await getDeviceToken(client);
328
+ const stepData = await client.auth().signInByEmailAddress(form.value.emailAddress, deviceToken);
329
+ signInStep.value = stepData;
330
+ serverStep.value = stepData.step;
331
+ const strategies = processAvailableStrategies(stepData);
332
+ if (strategies.password) {
333
+ selectedStrategy.value = strategies.password;
334
+ currentStep.value = "password";
335
+ } else if (strategies.emailLink) {
336
+ availableStrategies.value = [strategies.emailLink].filter(Boolean);
337
+ currentStep.value = "choose_strategy";
338
+ } else {
339
+ showNotification?.("Nenhum método de autenticação disponível");
340
+ return false;
341
+ }
342
+ return true;
343
+ } catch (error) {
344
+ if (error.errors && typeof error.errors === "object") {
345
+ if (error.errors.email_address) {
346
+ fieldErrors.value.emailAddress = error.errors.email_address;
347
+ }
348
+ } else {
349
+ showNotification?.(error.message || "Erro ao verificar email");
350
+ }
351
+ return false;
352
+ }
353
+ };
354
+ const selectStrategy = (strategy) => {
355
+ selectedStrategy.value = strategy;
356
+ currentStep.value = strategy.strategy;
357
+ if (strategy.strategy === "email_link") {
358
+ handleEmailLinkStep();
359
+ }
360
+ };
361
+ const handlePasswordStep = async () => {
362
+ if (!form.value.password.trim()) {
363
+ showNotification?.("Senha é obrigatória");
364
+ return false;
365
+ }
366
+ try {
367
+ if (!signInStep.value) {
368
+ showNotification?.("Estado de autenticação inválido");
369
+ return false;
370
+ }
371
+ if (serverStep.value !== "first_factor") {
372
+ showNotification?.("Etapa inválida para autenticação com senha");
373
+ return false;
374
+ }
375
+ const attemptToken = signInStep.value.sign_in_attempt_token;
376
+ if (!attemptToken) {
377
+ showNotification?.("Token de tentativa não encontrado");
378
+ return false;
379
+ }
380
+ const response = await client.auth().authenticateWithPassword(signInStep.value.id, attemptToken, form.value.password);
381
+ if (response?.step) {
382
+ serverStep.value = response.step;
383
+ signInStep.value = { ...signInStep.value, ...response };
384
+ }
385
+ return true;
386
+ } catch (error) {
387
+ if (error.errors && typeof error.errors === "object") {
388
+ if (error.errors.password) {
389
+ fieldErrors.value.password = error.errors.password;
390
+ }
391
+ } else {
392
+ showNotification?.(error.message || "Senha incorreta");
393
+ }
394
+ return false;
395
+ }
396
+ };
397
+ const handleEmailLinkStep = async () => {
398
+ try {
399
+ await client.auth().sendEmailLink(signInStep.value.id, selectedStrategy.value?.email_address_id);
400
+ showNotification?.("Link de verificação enviado para seu email", "success");
401
+ return true;
402
+ } catch (error) {
403
+ showNotification?.(error.message || "Erro ao enviar link de verificação");
404
+ return false;
405
+ }
406
+ };
407
+ const sendResetPasswordLink = async () => {
408
+ if (!form.value.emailAddress.trim()) {
409
+ showNotification?.("Informe o email para enviar o link de recuperação");
410
+ return;
411
+ }
412
+ try {
413
+ await client.auth().resetPassword({ email_address: form.value.emailAddress });
414
+ currentStep.value = "forgot_password_message";
415
+ } catch (error) {
416
+ showNotification?.(error.message || "Erro ao solicitar recuperação de senha");
417
+ }
418
+ };
419
+ const completeAuthentication = async () => {
420
+ try {
421
+ const attemptToken = signInStep.value.sign_in_attempt_token;
422
+ if (!attemptToken) {
423
+ showNotification?.("Token de tentativa não encontrado");
424
+ isLoading.value = false;
425
+ return;
426
+ }
427
+ const tokens = await client.auth().generateTokens(signInStep.value.id, attemptToken);
428
+ signInByAccessToken(tokens.access_token);
429
+ writeRefreshTokenInCookie(tokens.refresh_token);
430
+ showNotification?.("Login realizado com sucesso!", "success");
431
+ setTimeout(() => {
432
+ emit("completed");
433
+ }, 1e3);
434
+ } catch (error) {
435
+ showNotification?.(error.message || "Erro ao finalizar autenticação");
436
+ isLoading.value = false;
437
+ }
438
+ };
439
+ const submit = async () => {
440
+ if (isLoading.value) return;
441
+ clearErrors();
442
+ try {
443
+ isLoading.value = true;
444
+ let stepSuccess = false;
445
+ let shouldCompleteAuth = false;
446
+ if (currentStep.value === "email") {
447
+ stepSuccess = await handleEmailStep();
448
+ if (stepSuccess) {
449
+ isLoading.value = false;
450
+ }
451
+ } else if (currentStep.value === "password") {
452
+ stepSuccess = await handlePasswordStep();
453
+ if (stepSuccess) {
454
+ shouldCompleteAuth = true;
455
+ }
456
+ } else if (currentStep.value === "choose_strategy") {
457
+ return;
458
+ } else if (currentStep.value === "email_link") {
459
+ return;
460
+ } else if (currentStep.value === "forgot_password_message") {
461
+ return;
462
+ }
463
+ if (shouldCompleteAuth) {
464
+ await completeAuthentication();
465
+ } else if (!stepSuccess) {
466
+ isLoading.value = false;
467
+ }
468
+ } catch (error) {
469
+ if (error.errors && typeof error.errors === "object") {
470
+ const mappedErrors = {};
471
+ if (error.errors.email_address) {
472
+ mappedErrors.emailAddress = error.errors.email_address;
473
+ }
474
+ if (error.errors.password) {
475
+ mappedErrors.password = error.errors.password;
476
+ }
477
+ fieldErrors.value = { ...fieldErrors.value, ...mappedErrors };
478
+ } else {
479
+ showNotification?.(error.message || "Erro durante o processo de login");
480
+ }
481
+ isLoading.value = false;
482
+ }
483
+ };
484
+ const signUp = () => emit("sign-up");
485
+ onMounted(() => {
486
+ nextTick(() => {
487
+ if (emailInput.value) {
488
+ emailInput.value.focus();
489
+ }
490
+ });
491
+ });
492
+ watch(currentStep, (newStep) => {
493
+ nextTick(() => {
494
+ if (newStep === "password" && passwordInput.value) {
495
+ passwordInput.value.focus();
496
+ }
497
+ });
498
+ });
499
+ return (_ctx, _cache) => {
500
+ return unref(configurations) ? (openBlock(), createElementBlock("form", {
501
+ key: 0,
502
+ onSubmit: _cache[4] || (_cache[4] = withModifiers(($event) => submit(), ["prevent"]))
503
+ }, [
504
+ createElementVNode("div", _hoisted_1$7, [
505
+ createElementVNode("div", _hoisted_2$2, [
506
+ logoUrl.value ? (openBlock(), createElementBlock("img", {
507
+ key: 0,
508
+ src: logoUrl.value,
509
+ alt: "Logo",
510
+ class: "atm-logo-image"
511
+ }, null, 8, _hoisted_3$2)) : (openBlock(), createElementBlock("div", _hoisted_4$2, "Logo"))
512
+ ]),
513
+ createElementVNode("h2", _hoisted_5$2, toDisplayString(unref(configurations).project.name), 1),
514
+ _cache[13] || (_cache[13] = createElementVNode("p", { class: "atm-welcome-text" }, "Bem-vindo de volta! Faça login para continuar", -1)),
515
+ currentStep.value !== "forgot_password_message" ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
516
+ showEmailField.value ? (openBlock(), createElementBlock("div", _hoisted_7$2, [
517
+ createElementVNode("label", _hoisted_8$2, toDisplayString(labelText.value), 1),
518
+ withDirectives(createElementVNode("input", {
519
+ ref_key: "emailInput",
520
+ ref: emailInput,
521
+ type: "text",
522
+ class: "atm-input-field",
523
+ placeholder: inputPlaceholder.value,
524
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.value.emailAddress = $event),
525
+ disabled: currentStep.value !== "email" || isLoading.value
526
+ }, null, 8, _hoisted_9$2), [
527
+ [vModelText, form.value.emailAddress]
528
+ ]),
529
+ fieldErrors.value.emailAddress.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_10$2, toDisplayString(fieldErrors.value.emailAddress[0]), 1)) : createCommentVNode("", true)
530
+ ])) : createCommentVNode("", true),
531
+ showPasswordField.value ? (openBlock(), createElementBlock("div", _hoisted_11$2, [
532
+ _cache[5] || (_cache[5] = createElementVNode("label", { class: "atm-input-label" }, "Senha", -1)),
533
+ withDirectives(createElementVNode("input", {
534
+ ref_key: "passwordInput",
535
+ ref: passwordInput,
536
+ type: "password",
537
+ class: "atm-input-field",
538
+ placeholder: "Digite sua senha",
539
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.value.password = $event),
540
+ disabled: isLoading.value
541
+ }, null, 8, _hoisted_12$2), [
542
+ [vModelText, form.value.password]
543
+ ]),
544
+ fieldErrors.value.password.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_13$2, toDisplayString(fieldErrors.value.password[0]), 1)) : createCommentVNode("", true),
545
+ createElementVNode("div", _hoisted_14$2, [
546
+ createElementVNode("button", {
547
+ type: "button",
548
+ onClick: _cache[2] || (_cache[2] = ($event) => sendResetPasswordLink()),
549
+ class: "atm-forgot-password-link",
550
+ disabled: isLoading.value
551
+ }, " Esqueci a minha senha ", 8, _hoisted_15$2)
552
+ ])
553
+ ])) : createCommentVNode("", true),
554
+ showStrategyChoice.value ? (openBlock(), createElementBlock("div", _hoisted_16$2, [
555
+ _cache[6] || (_cache[6] = createElementVNode("p", { class: "atm-strategy-title" }, "Escolha como deseja fazer login:", -1)),
556
+ createElementVNode("div", _hoisted_17$2, [
557
+ (openBlock(true), createElementBlock(Fragment, null, renderList(availableStrategies.value, (strategy) => {
558
+ return openBlock(), createElementBlock("button", {
559
+ key: strategy.strategy,
560
+ onClick: ($event) => selectStrategy(strategy),
561
+ type: "button",
562
+ class: "atm-strategy-button",
563
+ disabled: isLoading.value
564
+ }, [
565
+ strategy.strategy === "email_link" ? (openBlock(), createElementBlock("span", _hoisted_19$2, "Usar link por email")) : createCommentVNode("", true)
566
+ ], 8, _hoisted_18$2);
567
+ }), 128))
568
+ ])
569
+ ])) : createCommentVNode("", true),
570
+ currentStep.value === "email_link" ? (openBlock(), createElementBlock("div", _hoisted_20$2, [..._cache[7] || (_cache[7] = [
571
+ createElementVNode("p", { class: "atm-email-link-text" }, " Link de verificação enviado para seu email. Verifique sua caixa de entrada. ", -1)
572
+ ])])) : createCommentVNode("", true)
573
+ ])) : (openBlock(), createElementBlock("div", _hoisted_21$2, [
574
+ createElementVNode("p", null, [
575
+ _cache[8] || (_cache[8] = createTextVNode("Foi enviado um link para resetar a senha para o email ", -1)),
576
+ createElementVNode("strong", null, toDisplayString(form.value.emailAddress), 1),
577
+ _cache[9] || (_cache[9] = createTextVNode(". Verifique sua caixa de entrada.", -1))
578
+ ])
579
+ ])),
580
+ buttonText.value ? (openBlock(), createElementBlock("button", {
581
+ key: 2,
582
+ type: "submit",
583
+ class: "atm-login-button",
584
+ disabled: isLoading.value
585
+ }, [
586
+ !isLoading.value ? (openBlock(), createElementBlock("span", _hoisted_23$2, toDisplayString(buttonText.value), 1)) : (openBlock(), createElementBlock("span", _hoisted_24$2, [
587
+ _cache[10] || (_cache[10] = createElementVNode("svg", {
588
+ class: "spinner-svg",
589
+ viewBox: "0 0 50 50"
590
+ }, [
591
+ createElementVNode("circle", {
592
+ class: "spinner-circle",
593
+ cx: "25",
594
+ cy: "25",
595
+ r: "20",
596
+ fill: "none",
597
+ "stroke-width": "5"
598
+ })
599
+ ], -1)),
600
+ currentStep.value === "email" ? (openBlock(), createElementBlock("span", _hoisted_25$2, "Verificando...")) : (openBlock(), createElementBlock("span", _hoisted_26$2, "Entrando..."))
601
+ ]))
602
+ ], 8, _hoisted_22$2)) : createCommentVNode("", true),
603
+ createElementVNode("div", _hoisted_27$2, [
604
+ createElementVNode("p", _hoisted_28$1, [
605
+ _cache[11] || (_cache[11] = createTextVNode(" Ainda não tem uma conta? ", -1)),
606
+ createElementVNode("a", {
607
+ onClick: _cache[3] || (_cache[3] = ($event) => signUp()),
608
+ class: "atm-signup-link"
609
+ }, "Cadastre aqui")
610
+ ]),
611
+ _cache[12] || (_cache[12] = createElementVNode("p", { class: "atm-powered-by" }, [
612
+ createTextVNode(" Secured by "),
613
+ createElementVNode("strong", null, "Autenticar.me")
614
+ ], -1))
615
+ ])
616
+ ])
617
+ ], 32)) : createCommentVNode("", true);
618
+ };
619
+ }
620
+ });
621
+ const SignIn = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-69af412a"]]);
622
+ const _hoisted_1$6 = {
623
+ key: 0,
624
+ class: "atm-notification-container"
625
+ };
626
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
627
+ __name: "Notification",
628
+ props: {
629
+ show: { type: Boolean },
630
+ message: {},
631
+ type: { default: "error" }
632
+ },
633
+ setup(__props) {
634
+ return (_ctx, _cache) => {
635
+ return openBlock(), createBlock(Teleport, { to: "body" }, [
636
+ createVNode(Transition, { name: "atm-notification" }, {
637
+ default: withCtx(() => [
638
+ __props.show ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
639
+ createElementVNode("div", {
640
+ class: normalizeClass(["atm-notification", `atm-notification--${__props.type}`])
641
+ }, toDisplayString(__props.message), 3)
642
+ ])) : createCommentVNode("", true)
643
+ ]),
644
+ _: 1
645
+ })
646
+ ]);
647
+ };
648
+ }
649
+ });
650
+ const Notification = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-f5e47084"]]);
651
+ const _hoisted_1$5 = { class: "atm-signup-container" };
652
+ const _hoisted_2$1 = { class: "atm-logo-container" };
653
+ const _hoisted_3$1 = ["src"];
654
+ const _hoisted_4$1 = {
655
+ key: 1,
656
+ class: "atm-logo-placeholder"
657
+ };
658
+ const _hoisted_5$1 = { class: "atm-project-name" };
659
+ const _hoisted_6$1 = {
660
+ key: 0,
661
+ class: "atm-form-group"
662
+ };
663
+ const _hoisted_7$1 = { class: "atm-input-label" };
664
+ const _hoisted_8$1 = ["disabled"];
665
+ const _hoisted_9$1 = {
666
+ key: 0,
667
+ class: "atm-field-error"
668
+ };
669
+ const _hoisted_10$1 = {
670
+ key: 1,
671
+ class: "atm-form-group"
672
+ };
673
+ const _hoisted_11$1 = { class: "atm-input-label" };
674
+ const _hoisted_12$1 = ["disabled"];
675
+ const _hoisted_13$1 = {
676
+ key: 0,
677
+ class: "atm-field-error"
678
+ };
679
+ const _hoisted_14$1 = { class: "atm-form-group" };
680
+ const _hoisted_15$1 = ["disabled"];
681
+ const _hoisted_16$1 = {
682
+ key: 0,
683
+ class: "atm-field-error"
684
+ };
685
+ const _hoisted_17$1 = {
686
+ key: 2,
687
+ class: "atm-form-group"
688
+ };
689
+ const _hoisted_18$1 = ["disabled"];
690
+ const _hoisted_19$1 = {
691
+ key: 0,
692
+ class: "atm-field-error"
693
+ };
694
+ const _hoisted_20$1 = {
695
+ key: 3,
696
+ class: "atm-form-group"
697
+ };
698
+ const _hoisted_21$1 = ["disabled"];
699
+ const _hoisted_22$1 = {
700
+ key: 0,
701
+ class: "atm-field-error"
702
+ };
703
+ const _hoisted_23$1 = ["disabled"];
704
+ const _hoisted_24$1 = { key: 0 };
705
+ const _hoisted_25$1 = {
706
+ key: 1,
707
+ class: "button-spinner"
708
+ };
709
+ const _hoisted_26$1 = { class: "atm-footer-links" };
710
+ const _hoisted_27$1 = { class: "atm-login-text" };
711
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
712
+ __name: "SignUp",
713
+ emits: ["completed", "sign-in"],
714
+ setup(__props, { emit: __emit }) {
715
+ useCssVars((_ctx) => ({
716
+ "v8c008960": atmPrimaryColor.value,
717
+ "v1183b75e": atmSecondaryColor.value
718
+ }));
719
+ const emit = __emit;
720
+ const { configurations } = useAtm();
721
+ const form = ref({
722
+ first_name: "",
723
+ last_name: "",
724
+ email_address: "",
725
+ password: "",
726
+ confirm_password: ""
727
+ });
728
+ const notification = ref({
729
+ show: false,
730
+ message: "",
731
+ type: "error"
732
+ });
733
+ const isLoading = ref(false);
734
+ const firstNameInput = ref(null);
735
+ const emailInput = ref(null);
736
+ const fieldErrors = ref({
737
+ first_name: [],
738
+ last_name: [],
739
+ email_address: [],
740
+ password: [],
741
+ confirm_password: []
742
+ });
743
+ const showNotification = (message, type = "error") => {
744
+ notification.value = {
745
+ show: true,
746
+ message,
747
+ type
748
+ };
749
+ setTimeout(() => {
750
+ notification.value.show = false;
751
+ }, 3e3);
752
+ };
753
+ onMounted(() => {
754
+ nextTick(() => {
755
+ if (hasFirstName.value && firstNameInput.value) {
756
+ firstNameInput.value.focus();
757
+ } else if (emailInput.value) {
758
+ emailInput.value.focus();
759
+ }
760
+ });
761
+ });
762
+ const atmPrimaryColor = computed(() => configurations.value?.design?.primaryColor);
763
+ const atmSecondaryColor = computed(() => configurations.value?.design?.secondaryColor);
764
+ const logoUrl = computed(() => configurations.value?.project?.logo || "");
765
+ const hasFirstName = computed(() => configurations.value?.firstName?.required === true);
766
+ const hasLastName = computed(() => configurations.value?.lastName?.required === true);
767
+ const hasPassword = computed(() => configurations.value?.password?.enable !== false);
768
+ const lengthConfig = computed(() => configurations.value?.password?.length);
769
+ const validatePassword = () => {
770
+ const password = form.value.password;
771
+ const minLength = lengthConfig.value?.min ?? 8;
772
+ const maxLength = lengthConfig.value?.max ?? 64;
773
+ if (password.length < minLength) {
774
+ return `Senha deve ter pelo menos ${minLength} caracteres`;
775
+ }
776
+ if (password.length > maxLength) {
777
+ return `Senha deve ter no máximo ${maxLength} caracteres`;
778
+ }
779
+ if (configurations.value?.password?.uppercase && !/[A-Z]/.test(password)) {
780
+ return "Senha deve conter pelo menos uma letra maiúscula";
781
+ }
782
+ if (configurations.value?.password?.lowercase && !/[a-z]/.test(password)) {
783
+ return "Senha deve conter pelo menos uma letra minúscula";
784
+ }
785
+ if (configurations.value?.password?.numbers && !/\d/.test(password)) {
786
+ return "Senha deve conter pelo menos um número";
787
+ }
788
+ if (configurations.value?.password?.symbols && !/[!@#$%^&*(),.?":{}|<>]/.test(password)) {
789
+ return "Senha deve conter pelo menos um símbolo especial";
790
+ }
791
+ return null;
792
+ };
793
+ const client = useAtmClient();
794
+ const { signInByAccessToken } = useAuth();
795
+ const clearErrors = () => {
796
+ fieldErrors.value = {
797
+ first_name: [],
798
+ last_name: [],
799
+ email_address: [],
800
+ password: [],
801
+ confirm_password: []
802
+ };
803
+ };
804
+ const submit = async () => {
805
+ if (isLoading.value) return;
806
+ clearErrors();
807
+ if (hasFirstName.value && !form.value.first_name.trim()) {
808
+ showNotification("Nome é obrigatório");
809
+ return;
810
+ }
811
+ if (hasLastName.value && !form.value.last_name.trim()) {
812
+ showNotification("Sobrenome é obrigatório");
813
+ return;
814
+ }
815
+ if (!form.value.email_address.trim()) {
816
+ showNotification("Email é obrigatório");
817
+ return;
818
+ }
819
+ if (hasPassword.value) {
820
+ if (!form.value.password.trim()) {
821
+ showNotification("Senha é obrigatória");
822
+ return;
823
+ }
824
+ const passwordError = validatePassword();
825
+ if (passwordError) {
826
+ showNotification(passwordError);
827
+ return;
828
+ }
829
+ if (!form.value.confirm_password.trim()) {
830
+ showNotification("Confirmação de senha é obrigatória");
831
+ return;
832
+ }
833
+ if (form.value.password !== form.value.confirm_password) {
834
+ showNotification("Senhas não coincidem");
835
+ return;
836
+ }
837
+ }
838
+ try {
839
+ isLoading.value = true;
840
+ await client.auth().register({
841
+ first_name: form.value.first_name,
842
+ last_name: form.value.last_name,
843
+ email_address: form.value.email_address,
844
+ password: form.value.password
845
+ });
846
+ showNotification("Conta criada com sucesso!", "success");
847
+ const deviceToken = await getDeviceToken(client);
848
+ const signInStep = await client.auth().signInByEmailAddress(form.value.email_address, deviceToken);
849
+ const attemptToken = signInStep.token;
850
+ if (!attemptToken) {
851
+ throw new Error("Token de tentativa não encontrado");
852
+ }
853
+ await client.auth().authenticateWithPassword(signInStep.id, attemptToken, form.value.password);
854
+ const tokens = await client.auth().generateTokens(signInStep.id, attemptToken);
855
+ signInByAccessToken(tokens.access_token);
856
+ writeRefreshTokenInCookie(tokens.refresh_token);
857
+ showNotification("Login realizado com sucesso!", "success");
858
+ setTimeout(() => {
859
+ emit("completed");
860
+ }, 1e3);
861
+ } catch (error) {
862
+ if (error.errors && typeof error.errors === "object") {
863
+ fieldErrors.value = { ...fieldErrors.value, ...error.errors };
864
+ } else {
865
+ showNotification(error.message || "Erro ao registrar usuário", "error");
866
+ }
867
+ isLoading.value = false;
868
+ }
869
+ };
870
+ const signIn = () => emit("sign-in");
871
+ return (_ctx, _cache) => {
872
+ return openBlock(), createElementBlock(Fragment, null, [
873
+ createVNode(Notification, {
874
+ show: notification.value.show,
875
+ message: notification.value.message,
876
+ type: notification.value.type
877
+ }, null, 8, ["show", "message", "type"]),
878
+ unref(configurations) ? (openBlock(), createElementBlock("form", {
879
+ key: 0,
880
+ onSubmit: withModifiers(submit, ["prevent"])
881
+ }, [
882
+ createElementVNode("div", _hoisted_1$5, [
883
+ createElementVNode("div", _hoisted_2$1, [
884
+ logoUrl.value ? (openBlock(), createElementBlock("img", {
885
+ key: 0,
886
+ src: logoUrl.value,
887
+ alt: "Logo",
888
+ class: "atm-logo-image"
889
+ }, null, 8, _hoisted_3$1)) : (openBlock(), createElementBlock("div", _hoisted_4$1, "Logo"))
890
+ ]),
891
+ createElementVNode("h2", _hoisted_5$1, toDisplayString(unref(configurations).project.name), 1),
892
+ _cache[11] || (_cache[11] = createElementVNode("p", { class: "atm-welcome-text" }, "Crie sua conta para começar", -1)),
893
+ hasFirstName.value ? (openBlock(), createElementBlock("div", _hoisted_6$1, [
894
+ createElementVNode("label", _hoisted_7$1, " Primeiro Nome " + toDisplayString(unref(configurations).firstName?.required ? "*" : ""), 1),
895
+ withDirectives(createElementVNode("input", {
896
+ ref_key: "firstNameInput",
897
+ ref: firstNameInput,
898
+ type: "text",
899
+ class: "atm-input-field",
900
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => form.value.first_name = $event),
901
+ placeholder: "Digite seu primeiro nome",
902
+ disabled: isLoading.value
903
+ }, null, 8, _hoisted_8$1), [
904
+ [vModelText, form.value.first_name]
905
+ ]),
906
+ fieldErrors.value.first_name.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_9$1, toDisplayString(fieldErrors.value.first_name[0]), 1)) : createCommentVNode("", true)
907
+ ])) : createCommentVNode("", true),
908
+ hasLastName.value ? (openBlock(), createElementBlock("div", _hoisted_10$1, [
909
+ createElementVNode("label", _hoisted_11$1, " Sobrenome " + toDisplayString(unref(configurations).lastName?.required ? "*" : ""), 1),
910
+ withDirectives(createElementVNode("input", {
911
+ type: "text",
912
+ class: "atm-input-field",
913
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => form.value.last_name = $event),
914
+ placeholder: "Digite seu sobrenome",
915
+ disabled: isLoading.value
916
+ }, null, 8, _hoisted_12$1), [
917
+ [vModelText, form.value.last_name]
918
+ ]),
919
+ fieldErrors.value.last_name.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_13$1, toDisplayString(fieldErrors.value.last_name[0]), 1)) : createCommentVNode("", true)
920
+ ])) : createCommentVNode("", true),
921
+ createElementVNode("div", _hoisted_14$1, [
922
+ _cache[5] || (_cache[5] = createElementVNode("label", { class: "atm-input-label" }, "Email ou Nome de usuário *", -1)),
923
+ withDirectives(createElementVNode("input", {
924
+ ref_key: "emailInput",
925
+ ref: emailInput,
926
+ type: "text",
927
+ class: "atm-input-field",
928
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => form.value.email_address = $event),
929
+ placeholder: "email@exemplo.com ou seuusername",
930
+ disabled: isLoading.value
931
+ }, null, 8, _hoisted_15$1), [
932
+ [vModelText, form.value.email_address]
933
+ ]),
934
+ fieldErrors.value.email_address.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_16$1, toDisplayString(fieldErrors.value.email_address[0]), 1)) : createCommentVNode("", true)
935
+ ]),
936
+ hasPassword.value ? (openBlock(), createElementBlock("div", _hoisted_17$1, [
937
+ _cache[6] || (_cache[6] = createElementVNode("label", { class: "atm-input-label" }, "Senha *", -1)),
938
+ withDirectives(createElementVNode("input", {
939
+ type: "password",
940
+ class: "atm-input-field",
941
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => form.value.password = $event),
942
+ placeholder: "",
943
+ disabled: isLoading.value
944
+ }, null, 8, _hoisted_18$1), [
945
+ [vModelText, form.value.password]
946
+ ]),
947
+ fieldErrors.value.password.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_19$1, toDisplayString(fieldErrors.value.password[0]), 1)) : createCommentVNode("", true)
948
+ ])) : createCommentVNode("", true),
949
+ hasPassword.value ? (openBlock(), createElementBlock("div", _hoisted_20$1, [
950
+ _cache[7] || (_cache[7] = createElementVNode("label", { class: "atm-input-label" }, "Confirmar Senha *", -1)),
951
+ withDirectives(createElementVNode("input", {
952
+ type: "password",
953
+ class: "atm-input-field",
954
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => form.value.confirm_password = $event),
955
+ placeholder: "",
956
+ disabled: isLoading.value
957
+ }, null, 8, _hoisted_21$1), [
958
+ [vModelText, form.value.confirm_password]
959
+ ]),
960
+ fieldErrors.value.confirm_password.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_22$1, toDisplayString(fieldErrors.value.confirm_password[0]), 1)) : createCommentVNode("", true)
961
+ ])) : createCommentVNode("", true),
962
+ createElementVNode("button", {
963
+ type: "submit",
964
+ class: "atm-signup-button",
965
+ disabled: isLoading.value
966
+ }, [
967
+ !isLoading.value ? (openBlock(), createElementBlock("span", _hoisted_24$1, "Criar Conta")) : (openBlock(), createElementBlock("span", _hoisted_25$1, [..._cache[8] || (_cache[8] = [
968
+ createElementVNode("svg", {
969
+ class: "spinner-svg",
970
+ viewBox: "0 0 50 50"
971
+ }, [
972
+ createElementVNode("circle", {
973
+ class: "spinner-circle",
974
+ cx: "25",
975
+ cy: "25",
976
+ r: "20",
977
+ fill: "none",
978
+ "stroke-width": "5"
979
+ })
980
+ ], -1),
981
+ createTextVNode(" Criando... ", -1)
982
+ ])]))
983
+ ], 8, _hoisted_23$1),
984
+ createElementVNode("div", _hoisted_26$1, [
985
+ createElementVNode("p", _hoisted_27$1, [
986
+ _cache[9] || (_cache[9] = createTextVNode(" Já tem uma conta? ", -1)),
987
+ createElementVNode("a", {
988
+ onClick: signIn,
989
+ class: normalizeClass(["atm-login-link", { "disabled-link": isLoading.value }])
990
+ }, "Faça login", 2)
991
+ ]),
992
+ _cache[10] || (_cache[10] = createElementVNode("p", { class: "atm-powered-by" }, [
993
+ createTextVNode("Secured by "),
994
+ createElementVNode("strong", null, "Autenticar.me")
995
+ ], -1))
996
+ ])
997
+ ])
998
+ ], 32)) : createCommentVNode("", true)
999
+ ], 64);
1000
+ };
1001
+ }
1002
+ });
1003
+ const SignUp = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-de716df2"]]);
1004
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
1005
+ __name: "SignInModal",
1006
+ emits: [
1007
+ "close"
1008
+ ],
1009
+ setup(__props, { emit: __emit }) {
1010
+ const emit = __emit;
1011
+ const close = () => {
1012
+ emit("close");
1013
+ };
1014
+ const component = ref("sign-in");
1015
+ const signUp = () => component.value = "sign-up";
1016
+ const signIn = () => component.value = "sign-in";
1017
+ const windowWidth = ref(typeof window !== "undefined" ? window.innerWidth : 1024);
1018
+ const maxWidth = computed(() => {
1019
+ if (windowWidth.value <= 360) return 340;
1020
+ if (windowWidth.value <= 480) return windowWidth.value - 20;
1021
+ if (windowWidth.value <= 768) return 400;
1022
+ return 420;
1023
+ });
1024
+ const updateWidth = () => {
1025
+ windowWidth.value = window.innerWidth;
1026
+ };
1027
+ onMounted(() => {
1028
+ window.addEventListener("resize", updateWidth);
1029
+ });
1030
+ onUnmounted(() => {
1031
+ window.removeEventListener("resize", updateWidth);
1032
+ });
1033
+ return (_ctx, _cache) => {
1034
+ return openBlock(), createBlock(Modal, {
1035
+ "max-width": maxWidth.value,
1036
+ onClose: _cache[4] || (_cache[4] = ($event) => close())
1037
+ }, {
1038
+ default: withCtx(() => [
1039
+ component.value === "sign-in" ? (openBlock(), createBlock(SignIn, {
1040
+ key: 0,
1041
+ onSignUp: _cache[0] || (_cache[0] = ($event) => signUp()),
1042
+ onCompleted: _cache[1] || (_cache[1] = ($event) => close())
1043
+ })) : createCommentVNode("", true),
1044
+ component.value === "sign-up" ? (openBlock(), createBlock(SignUp, {
1045
+ key: 1,
1046
+ onSignIn: _cache[2] || (_cache[2] = ($event) => signIn()),
1047
+ onCompleted: _cache[3] || (_cache[3] = ($event) => close())
1048
+ })) : createCommentVNode("", true)
1049
+ ]),
1050
+ _: 1
1051
+ }, 8, ["max-width"]);
1052
+ };
1053
+ }
1054
+ });
1055
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
1056
+ __name: "SignInButton",
1057
+ setup(__props) {
1058
+ useCssVars((_ctx) => ({
1059
+ "v0f0ded3a": atmPrimaryColor.value
1060
+ }));
1061
+ const showSignInModal = ref(false);
1062
+ const { configurations } = useAtm();
1063
+ const atmPrimaryColor = computed(() => configurations.value?.design?.primaryColor);
1064
+ const notification = ref({
1065
+ show: false,
1066
+ message: "",
1067
+ type: "error"
1068
+ });
1069
+ const showNotification = (message, type = "error") => {
1070
+ notification.value = {
1071
+ show: true,
1072
+ message,
1073
+ type
1074
+ };
1075
+ setTimeout(() => {
1076
+ notification.value.show = false;
1077
+ }, 3e3);
1078
+ };
1079
+ provide("showNotification", showNotification);
1080
+ const signIn = () => {
1081
+ showSignInModal.value = true;
1082
+ };
1083
+ return (_ctx, _cache) => {
1084
+ return openBlock(), createElementBlock(Fragment, null, [
1085
+ createVNode(Notification, {
1086
+ show: notification.value.show,
1087
+ message: notification.value.message,
1088
+ type: notification.value.type
1089
+ }, null, 8, ["show", "message", "type"]),
1090
+ showSignInModal.value ? (openBlock(), createBlock(_sfc_main$8, {
1091
+ key: 0,
1092
+ onClose: _cache[0] || (_cache[0] = () => showSignInModal.value = false)
1093
+ })) : createCommentVNode("", true),
1094
+ createElementVNode("button", {
1095
+ onClick: _cache[1] || (_cache[1] = ($event) => signIn()),
1096
+ class: "atm-signin-btn"
1097
+ }, " Entrar ")
1098
+ ], 64);
1099
+ };
1100
+ }
1101
+ });
1102
+ const SignInButton = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-4139c6d0"]]);
1103
+ const _hoisted_1$4 = {
1104
+ key: 2,
1105
+ style: { "padding": "24px", "text-align": "center" }
1106
+ };
1107
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
1108
+ __name: "SignUpModal",
1109
+ emits: [
1110
+ "close"
1111
+ ],
1112
+ setup(__props, { emit: __emit }) {
1113
+ const { configurations } = useAtm();
1114
+ const emit = __emit;
1115
+ const close = () => {
1116
+ emit("close");
1117
+ };
1118
+ const component = ref("sign-up");
1119
+ const isRegistrationAllowed = computed(() => configurations.value?.register?.enable !== false);
1120
+ const signUp = () => component.value = "sign-up";
1121
+ const signIn = () => component.value = "sign-in";
1122
+ const windowWidth = ref(typeof window !== "undefined" ? window.innerWidth : 1024);
1123
+ const maxWidth = computed(() => {
1124
+ if (windowWidth.value <= 360) return 340;
1125
+ if (windowWidth.value <= 480) return windowWidth.value - 20;
1126
+ if (windowWidth.value <= 768) return 400;
1127
+ return 420;
1128
+ });
1129
+ const updateWidth = () => {
1130
+ windowWidth.value = window.innerWidth;
1131
+ };
1132
+ onMounted(() => {
1133
+ window.addEventListener("resize", updateWidth);
1134
+ });
1135
+ onUnmounted(() => {
1136
+ window.removeEventListener("resize", updateWidth);
1137
+ });
1138
+ return (_ctx, _cache) => {
1139
+ return openBlock(), createBlock(Modal, {
1140
+ "max-width": maxWidth.value,
1141
+ onClose: _cache[5] || (_cache[5] = ($event) => close())
1142
+ }, {
1143
+ default: withCtx(() => [
1144
+ component.value === "sign-in" ? (openBlock(), createBlock(SignIn, {
1145
+ key: 0,
1146
+ onSignUp: _cache[0] || (_cache[0] = ($event) => signUp()),
1147
+ onCompleted: _cache[1] || (_cache[1] = ($event) => close())
1148
+ })) : createCommentVNode("", true),
1149
+ component.value === "sign-up" && isRegistrationAllowed.value ? (openBlock(), createBlock(SignUp, {
1150
+ key: 1,
1151
+ onSignIn: _cache[2] || (_cache[2] = ($event) => signIn()),
1152
+ onCompleted: _cache[3] || (_cache[3] = ($event) => close())
1153
+ })) : component.value === "sign-up" ? (openBlock(), createElementBlock("div", _hoisted_1$4, [
1154
+ _cache[6] || (_cache[6] = createElementVNode("p", { style: { "margin-bottom": "16px" } }, "Registro não está disponível no momento", -1)),
1155
+ createElementVNode("button", {
1156
+ onClick: _cache[4] || (_cache[4] = ($event) => signIn()),
1157
+ style: { "padding": "12px 24px", "background": "#007bff", "color": "white", "border": "none", "border-radius": "6px", "cursor": "pointer" }
1158
+ }, "Fazer login")
1159
+ ])) : createCommentVNode("", true)
1160
+ ]),
1161
+ _: 1
1162
+ }, 8, ["max-width"]);
1163
+ };
1164
+ }
1165
+ });
1166
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1167
+ __name: "SignUpButton",
1168
+ setup(__props) {
1169
+ useCssVars((_ctx) => ({
1170
+ "v1112fbaa": atmPrimaryColor.value
1171
+ }));
1172
+ const showSignUpModal = ref(false);
1173
+ const { configurations } = useAtm();
1174
+ const atmPrimaryColor = computed(() => configurations.value?.design?.primaryColor);
1175
+ const isRegistrationAllowed = computed(() => configurations.value?.register?.enable !== false);
1176
+ const signUp = () => {
1177
+ showSignUpModal.value = true;
1178
+ };
1179
+ return (_ctx, _cache) => {
1180
+ return openBlock(), createElementBlock(Fragment, null, [
1181
+ showSignUpModal.value ? (openBlock(), createBlock(_sfc_main$6, {
1182
+ key: 0,
1183
+ onClose: _cache[0] || (_cache[0] = () => showSignUpModal.value = false)
1184
+ })) : createCommentVNode("", true),
1185
+ isRegistrationAllowed.value ? (openBlock(), createElementBlock("button", {
1186
+ key: 1,
1187
+ onClick: _cache[1] || (_cache[1] = ($event) => signUp()),
1188
+ class: "atm-signup-btn"
1189
+ }, " Cadastrar-se ")) : createCommentVNode("", true)
1190
+ ], 64);
1191
+ };
1192
+ }
1193
+ });
1194
+ const SignUpButton = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-959aa7ef"]]);
1195
+ const _hoisted_1$3 = {
1196
+ key: 0,
1197
+ class: "atm-profile-container"
1198
+ };
1199
+ const _hoisted_2 = ["src"];
1200
+ const _hoisted_3 = { key: 1 };
1201
+ const _hoisted_4 = {
1202
+ key: 2,
1203
+ viewBox: "0 0 24 24",
1204
+ class: "atm-btn-icon",
1205
+ style: { "width": "20px", "height": "20px", "color": "white" }
1206
+ };
1207
+ const _hoisted_5 = {
1208
+ key: 0,
1209
+ class: "atm-profile-name"
1210
+ };
1211
+ const _hoisted_6 = {
1212
+ key: 0,
1213
+ class: "atm-profile-menu"
1214
+ };
1215
+ const _hoisted_7 = { class: "atm-profile-info" };
1216
+ const _hoisted_8 = ["src"];
1217
+ const _hoisted_9 = { key: 1 };
1218
+ const _hoisted_10 = {
1219
+ key: 2,
1220
+ viewBox: "0 0 24 24",
1221
+ class: "atm-btn-icon",
1222
+ style: { "width": "40px", "height": "40px", "color": "white" }
1223
+ };
1224
+ const _hoisted_11 = { class: "atm-profile-details" };
1225
+ const _hoisted_12 = {
1226
+ key: 0,
1227
+ class: "atm-profile-fullname"
1228
+ };
1229
+ const _hoisted_13 = {
1230
+ key: 1,
1231
+ class: "atm-profile-fullname"
1232
+ };
1233
+ const _hoisted_14 = { class: "atm-profile-email" };
1234
+ const _hoisted_15 = {
1235
+ key: 0,
1236
+ class: "atm-profile-modal",
1237
+ role: "dialog",
1238
+ "aria-modal": "true",
1239
+ "aria-labelledby": "profile-modal-title"
1240
+ };
1241
+ const _hoisted_16 = { class: "atm-profile-content" };
1242
+ const _hoisted_17 = { class: "atm-profile-tabs" };
1243
+ const _hoisted_18 = {
1244
+ key: 0,
1245
+ class: "atm-profile-body"
1246
+ };
1247
+ const _hoisted_19 = ["src"];
1248
+ const _hoisted_20 = { key: 1 };
1249
+ const _hoisted_21 = {
1250
+ key: 2,
1251
+ viewBox: "0 0 24 24",
1252
+ class: "atm-btn-icon",
1253
+ style: { "width": "80px", "height": "80px", "color": "white", "margin": "0 auto" }
1254
+ };
1255
+ const _hoisted_22 = {
1256
+ key: 0,
1257
+ class: "atm-profile-info-grid"
1258
+ };
1259
+ const _hoisted_23 = { class: "atm-profile-info-row" };
1260
+ const _hoisted_24 = {
1261
+ key: 0,
1262
+ class: "atm-profile-info-value"
1263
+ };
1264
+ const _hoisted_25 = {
1265
+ key: 1,
1266
+ class: "atm-profile-info-value"
1267
+ };
1268
+ const _hoisted_26 = { class: "atm-profile-info-row" };
1269
+ const _hoisted_27 = {
1270
+ key: 0,
1271
+ class: "atm-profile-info-value"
1272
+ };
1273
+ const _hoisted_28 = {
1274
+ key: 1,
1275
+ class: "atm-profile-info-value"
1276
+ };
1277
+ const _hoisted_29 = { class: "atm-profile-info-row" };
1278
+ const _hoisted_30 = { class: "atm-profile-info-value" };
1279
+ const _hoisted_31 = {
1280
+ key: 1,
1281
+ class: "atm-profile-edit-form"
1282
+ };
1283
+ const _hoisted_32 = { class: "atm-form-group" };
1284
+ const _hoisted_33 = { class: "atm-form-group" };
1285
+ const _hoisted_34 = {
1286
+ key: 1,
1287
+ class: "atm-profile-body"
1288
+ };
1289
+ const _hoisted_35 = { class: "atm-email-add-section" };
1290
+ const _hoisted_36 = { class: "atm-form-group" };
1291
+ const _hoisted_37 = { class: "atm-badge" };
1292
+ const _hoisted_38 = { class: "atm-email-list" };
1293
+ const _hoisted_39 = { class: "atm-email-info" };
1294
+ const _hoisted_40 = { class: "atm-email-address" };
1295
+ const _hoisted_41 = { class: "atm-email-badges" };
1296
+ const _hoisted_42 = {
1297
+ key: 0,
1298
+ class: "atm-badge atm-badge-primary"
1299
+ };
1300
+ const _hoisted_43 = {
1301
+ key: 1,
1302
+ class: "atm-badge atm-badge-verified"
1303
+ };
1304
+ const _hoisted_44 = {
1305
+ key: 2,
1306
+ class: "atm-badge atm-badge-unverified"
1307
+ };
1308
+ const _hoisted_45 = { class: "atm-email-actions" };
1309
+ const _hoisted_46 = ["onClick"];
1310
+ const _hoisted_47 = ["onClick"];
1311
+ const _hoisted_48 = {
1312
+ key: 2,
1313
+ class: "atm-profile-body"
1314
+ };
1315
+ const _hoisted_49 = {
1316
+ key: 3,
1317
+ class: "atm-profile-body"
1318
+ };
1319
+ const _hoisted_50 = { class: "atm-sessions-section" };
1320
+ const _hoisted_51 = { class: "atm-sessions-list" };
1321
+ const _hoisted_52 = { class: "atm-session-info" };
1322
+ const _hoisted_53 = { class: "atm-session-header" };
1323
+ const _hoisted_54 = {
1324
+ viewBox: "0 0 24 24",
1325
+ class: "atm-session-icon"
1326
+ };
1327
+ const _hoisted_55 = ["d"];
1328
+ const _hoisted_56 = { class: "atm-session-details" };
1329
+ const _hoisted_57 = { class: "atm-session-title" };
1330
+ const _hoisted_58 = {
1331
+ key: 0,
1332
+ class: "atm-badge atm-badge-current"
1333
+ };
1334
+ const _hoisted_59 = {
1335
+ key: 0,
1336
+ class: "atm-session-device-info"
1337
+ };
1338
+ const _hoisted_60 = { key: 0 };
1339
+ const _hoisted_61 = { key: 1 };
1340
+ const _hoisted_62 = { key: 2 };
1341
+ const _hoisted_63 = { class: "atm-session-timestamps" };
1342
+ const _hoisted_64 = { class: "atm-session-timestamp" };
1343
+ const _hoisted_65 = { class: "atm-session-timestamp" };
1344
+ const _hoisted_66 = { class: "atm-session-actions" };
1345
+ const _hoisted_67 = ["onClick"];
1346
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1347
+ __name: "UserProfile",
1348
+ setup(__props) {
1349
+ useCssVars((_ctx) => ({
1350
+ "v1982ae74": atmPrimaryColor.value,
1351
+ "c7d31cfc": atmSecondaryColor.value
1352
+ }));
1353
+ const { user, logout } = useAuth();
1354
+ const { configurations } = useAtm();
1355
+ const atmPrimaryColor = computed(() => configurations.value?.design?.primaryColor);
1356
+ const atmSecondaryColor = computed(() => configurations.value?.design?.secondaryColor);
1357
+ const isDropdownOpen = ref(false);
1358
+ const isProfileModalOpen = ref(false);
1359
+ const isEditingProfile = ref(false);
1360
+ const buttonRef = ref(null);
1361
+ const emailAddresses = ref([]);
1362
+ const newEmail = ref("");
1363
+ const activeTab = ref("geral");
1364
+ const sessions = ref([]);
1365
+ const client = useAtmClient();
1366
+ const profileForm = ref({
1367
+ firstName: "",
1368
+ lastName: "",
1369
+ primaryEmailAddress: ""
1370
+ });
1371
+ const notification = ref({
1372
+ show: false,
1373
+ message: "",
1374
+ type: "error"
1375
+ });
1376
+ const showNotification = (message, type = "error") => {
1377
+ notification.value = {
1378
+ show: true,
1379
+ message,
1380
+ type
1381
+ };
1382
+ setTimeout(() => {
1383
+ notification.value.show = false;
1384
+ }, 3e3);
1385
+ };
1386
+ provide("showNotification", showNotification);
1387
+ const userInitials = computed(() => {
1388
+ if (!user.value || !user.value.firstName) return "";
1389
+ return (user.value.firstName.charAt(0) + (user.value.lastName?.charAt(0) || "")).toUpperCase();
1390
+ });
1391
+ const toggleMenu = () => isDropdownOpen.value = !isDropdownOpen.value;
1392
+ const closeMenu = (event) => {
1393
+ if (buttonRef.value && !buttonRef.value.contains(event.target)) {
1394
+ isDropdownOpen.value = false;
1395
+ }
1396
+ };
1397
+ const openProfileModal = async () => {
1398
+ isDropdownOpen.value = false;
1399
+ isProfileModalOpen.value = true;
1400
+ activeTab.value = "geral";
1401
+ resetProfileForm();
1402
+ await loadEmailAddresses();
1403
+ await loadSessions();
1404
+ };
1405
+ const closeProfileModal = () => {
1406
+ isProfileModalOpen.value = false;
1407
+ isEditingProfile.value = false;
1408
+ resetProfileForm();
1409
+ emailAddresses.value = [];
1410
+ newEmail.value = "";
1411
+ sessions.value = [];
1412
+ activeTab.value = "geral";
1413
+ };
1414
+ const resetProfileForm = () => {
1415
+ if (user.value) {
1416
+ profileForm.value = {
1417
+ firstName: user.value.firstName || "",
1418
+ lastName: user.value.lastName || "",
1419
+ primaryEmailAddress: user.value.primaryEmailAddress || ""
1420
+ };
1421
+ }
1422
+ };
1423
+ const updateProfileFormWithData = (profileDataUpdated) => {
1424
+ if (profileDataUpdated.first_name) {
1425
+ profileForm.value.firstName = profileDataUpdated.first_name;
1426
+ }
1427
+ if (profileDataUpdated.last_name) {
1428
+ profileForm.value.lastName = profileDataUpdated.last_name;
1429
+ }
1430
+ if (profileDataUpdated.primary_email_address) {
1431
+ profileForm.value.primaryEmailAddress = profileDataUpdated.primary_email_address;
1432
+ }
1433
+ };
1434
+ const loadEmailAddresses = async () => {
1435
+ try {
1436
+ const token = getCookie("atm_access_token");
1437
+ if (!token) {
1438
+ showNotification("Token de acesso não encontrado", "error");
1439
+ return;
1440
+ }
1441
+ const emails = await client.account(token).getEmailsAddresses();
1442
+ emailAddresses.value = emails;
1443
+ } catch (error) {
1444
+ showNotification("Erro ao carregar endereços de email", "error");
1445
+ }
1446
+ };
1447
+ const requestEmailVerification = async (emailId) => {
1448
+ try {
1449
+ const token = getCookie("atm_access_token");
1450
+ if (!token) {
1451
+ showNotification("Token de acesso não encontrado", "error");
1452
+ return;
1453
+ }
1454
+ await client.account(token).requestEmailVerification(emailId);
1455
+ showNotification("Link de verificação enviado para o email", "success");
1456
+ await loadEmailAddresses();
1457
+ } catch (error) {
1458
+ showNotification("Erro ao enviar verificação de email", "error");
1459
+ }
1460
+ };
1461
+ const deleteEmailAddress = async (emailId) => {
1462
+ try {
1463
+ const token = getCookie("atm_access_token");
1464
+ if (!token) {
1465
+ showNotification("Token de acesso não encontrado", "error");
1466
+ return;
1467
+ }
1468
+ await client.account(token).deleteEmailAddress(emailId);
1469
+ showNotification("Email removido com sucesso", "success");
1470
+ await loadEmailAddresses();
1471
+ } catch (error) {
1472
+ showNotification("Erro ao remover email", "error");
1473
+ }
1474
+ };
1475
+ const createEmailAddress = async () => {
1476
+ try {
1477
+ const token = getCookie("atm_access_token");
1478
+ if (!token) {
1479
+ showNotification("Token de acesso não encontrado", "error");
1480
+ return;
1481
+ }
1482
+ if (!newEmail.value.trim()) {
1483
+ showNotification("Informe o novo email", "error");
1484
+ return;
1485
+ }
1486
+ await client.account(token).createEmailAddress(newEmail.value.trim());
1487
+ showNotification("Email adicionado. Verifique sua caixa de entrada.", "success");
1488
+ newEmail.value = "";
1489
+ await loadEmailAddresses();
1490
+ } catch (error) {
1491
+ showNotification("Erro ao adicionar email", "error");
1492
+ }
1493
+ };
1494
+ const startEditing = () => {
1495
+ isEditingProfile.value = true;
1496
+ };
1497
+ const cancelEditing = () => {
1498
+ isEditingProfile.value = false;
1499
+ resetProfileForm();
1500
+ };
1501
+ const getCookie = (name) => {
1502
+ const value = `; ${document.cookie}`;
1503
+ const parts = value.split(`; ${name}=`);
1504
+ if (parts.length === 2) return parts.pop()?.split(";").shift() || null;
1505
+ return null;
1506
+ };
1507
+ const updateProfile = async () => {
1508
+ try {
1509
+ if (!profileForm.value.firstName.trim()) {
1510
+ showNotification("Nome é obrigatório", "error");
1511
+ return;
1512
+ }
1513
+ if (!profileForm.value.lastName.trim()) {
1514
+ showNotification("Sobrenome é obrigatório", "error");
1515
+ return;
1516
+ }
1517
+ const updateData = {};
1518
+ if (profileForm.value.firstName !== user.value?.firstName) {
1519
+ updateData.first_name = profileForm.value.firstName.trim();
1520
+ }
1521
+ if (profileForm.value.lastName !== user.value?.lastName) {
1522
+ updateData.last_name = profileForm.value.lastName.trim();
1523
+ }
1524
+ if (Object.keys(updateData).length === 0) {
1525
+ showNotification("Nenhuma alteração foi feita", "warning");
1526
+ isEditingProfile.value = false;
1527
+ return;
1528
+ }
1529
+ const token = getCookie("atm_access_token");
1530
+ if (!token) {
1531
+ showNotification("Token de acesso não encontrado", "error");
1532
+ return;
1533
+ }
1534
+ await client.account(token).updateProfile(updateData);
1535
+ const profileDataUpdated = await client.account(token).getProfile();
1536
+ updateProfileFormWithData(profileDataUpdated);
1537
+ showNotification("Perfil atualizado com sucesso!", "success");
1538
+ isEditingProfile.value = false;
1539
+ } catch (error) {
1540
+ showNotification(error.message || "Erro ao atualizar perfil", "error");
1541
+ }
1542
+ };
1543
+ const logoutUser = () => {
1544
+ logout();
1545
+ isDropdownOpen.value = false;
1546
+ };
1547
+ const sendResetPasswordLink = async () => {
1548
+ if (!user.value?.primaryEmailAddress) {
1549
+ showNotification("Informe o email para enviar o link de recuperação", "error");
1550
+ return;
1551
+ }
1552
+ try {
1553
+ await client.auth().resetPassword({ email_address: user.value.primaryEmailAddress });
1554
+ showNotification(`Foi enviado um link para resetar a senha para o email ${user.value.primaryEmailAddress}.`, "success");
1555
+ } catch (e) {
1556
+ showNotification(e.message || "Erro ao solicitar recuperação de senha", "error");
1557
+ }
1558
+ };
1559
+ const loadSessions = async () => {
1560
+ try {
1561
+ const token = getCookie("atm_access_token");
1562
+ if (!token) {
1563
+ showNotification("Token de acesso não encontrado", "error");
1564
+ return;
1565
+ }
1566
+ const sessionsData = await client.account(token).getSessions();
1567
+ sessions.value = sessionsData;
1568
+ } catch (error) {
1569
+ showNotification("Erro ao carregar sessões", "error");
1570
+ }
1571
+ };
1572
+ const closeSessionById = async (sessionId) => {
1573
+ try {
1574
+ const token = getCookie("atm_access_token");
1575
+ if (!token) {
1576
+ showNotification("Token de acesso não encontrado", "error");
1577
+ return;
1578
+ }
1579
+ await client.account(token).closeSession(sessionId);
1580
+ showNotification("Sessão encerrada com sucesso", "success");
1581
+ await loadSessions();
1582
+ } catch (error) {
1583
+ showNotification("Erro ao encerrar sessão", "error");
1584
+ }
1585
+ };
1586
+ const formatDate = (dateString) => {
1587
+ const date = new Date(dateString);
1588
+ return date.toLocaleString("pt-BR", {
1589
+ day: "2-digit",
1590
+ month: "2-digit",
1591
+ year: "numeric",
1592
+ hour: "2-digit",
1593
+ minute: "2-digit"
1594
+ });
1595
+ };
1596
+ const getDeviceIcon = (device) => {
1597
+ const platform = device.platform?.toLowerCase() || "";
1598
+ const browser = device.browser?.toLowerCase() || "";
1599
+ if (platform.includes("windows") || platform.includes("win32") || platform.includes("win64")) {
1600
+ return "M0,0V11H11V0ZM13,0V11H24V0ZM0,13V24H11V13ZM13,13V24H24V13Z";
1601
+ }
1602
+ if (platform.includes("mac") || platform.includes("darwin") || platform.includes("os x")) {
1603
+ return "M12,1C7,1 3,5 3,10C3,14 6,17 9,18V22H15V18C18,17 21,14 21,10C21,5 17,1 12,1M12,3C15.9,3 19,6.1 19,10C19,13.4 16.6,16.2 13.4,16.8L13,16.9V20H11V16.9L10.6,16.8C7.4,16.2 5,13.4 5,10C5,6.1 8.1,3 12,3Z";
1604
+ }
1605
+ if (platform.includes("iphone") || platform.includes("ipad") || platform.includes("ipod") || platform.includes("ios")) {
1606
+ return "M15.5,1H8.5C7.67,1 7,1.67 7,2.5V21.5C7,22.33 7.67,23 8.5,23H15.5C16.33,23 17,22.33 17,21.5V2.5C17,1.67 16.33,1 15.5,1M12,22C11.45,22 11,21.55 11,21C11,20.45 11.45,20 12,20C12.55,20 13,20.45 13,21C13,21.55 12.55,22 12,22M15,19H9V4H15V19Z";
1607
+ }
1608
+ if (platform.includes("android")) {
1609
+ return "M16.61,15.15C16.15,15.15 15.77,15.53 15.77,16C15.77,16.46 16.15,16.85 16.61,16.85C17.07,16.85 17.46,16.46 17.46,16C17.46,15.53 17.07,15.15 16.61,15.15M7.41,15.15C6.95,15.15 6.57,15.53 6.57,16C6.57,16.46 6.95,16.85 7.41,16.85C7.87,16.85 8.26,16.46 8.26,16C8.26,15.53 7.87,15.15 7.41,15.15M16.91,10.14L18.58,7.26C18.67,7.09 18.61,6.88 18.45,6.79C18.28,6.69 18.07,6.75 18,6.92L16.29,9.83C14.95,9.22 13.5,8.9 12,8.91C10.47,8.91 9,9.24 7.73,9.82L6.04,6.91C5.95,6.74 5.74,6.68 5.57,6.78C5.4,6.87 5.35,7.08 5.44,7.25L7.1,10.13C4.25,11.69 2.29,14.58 2,18H22C21.72,14.59 19.77,11.7 16.91,10.14Z";
1610
+ }
1611
+ if (platform.includes("linux") || platform.includes("ubuntu") || platform.includes("debian") || platform.includes("fedora") || platform.includes("centos") || platform.includes("arch")) {
1612
+ return "M12,2C11.5,2 11,2.19 10.59,2.59L2.59,10.59C1.8,11.37 1.8,12.63 2.59,13.41L10.59,21.41C11.37,22.2 12.63,22.2 13.41,21.41L21.41,13.41C22.2,12.63 22.2,11.37 21.41,10.59L13.41,2.59C13,2.19 12.5,2 12,2M12,4L20,12L12,20L4,12M12.5,7V13H11V7M12.5,15V17H11V15";
1613
+ }
1614
+ if (platform.includes("chrome") || browser.includes("chrome")) {
1615
+ return "M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4C14.6,4 16.94,5.27 18.35,7.25L15.5,12C15.29,11.41 15,10.87 14.62,10.41C13.69,9.31 12.36,8.63 10.88,8.63C10.75,8.63 10.62,8.64 10.5,8.65L12,4.03C12,4.03 12,4 12,4M4.26,8.09C5.61,6.19 7.82,5 10.29,5L8.5,9.5C7.12,10.5 6.25,12.18 6.25,14.06C6.25,14.66 6.35,15.23 6.53,15.78L4.26,8.09M19.74,8.09L17.47,15.78C18.5,14.16 19.13,12.19 19.13,10.06C19.13,9.38 19.04,8.72 18.88,8.09H19.74M6.06,17C4.5,15.5 3.5,13.38 3.5,11C3.5,10.66 3.53,10.33 3.57,10H7.03C7,10.33 7,10.66 7,11C7,12.96 7.81,14.73 9.11,16L6.06,17M12,20C9.4,20 7.06,18.73 5.65,16.75L8.5,12C8.71,12.59 9,13.13 9.38,13.59C10.31,14.69 11.64,15.37 13.12,15.37C13.25,15.37 13.38,15.36 13.5,15.35L12,19.97C12,19.97 12,20 12,20M17.94,17L15.96,11C17.21,9.89 18,8.21 18,6.31C18,5.71 17.9,5.14 17.72,4.59L19.74,8.09C20.26,9.25 20.55,10.56 20.55,11.94C20.55,14.27 19.64,16.38 18.18,17.91L17.94,17Z";
1616
+ }
1617
+ if (browser.includes("firefox") || browser.includes("mozilla")) {
1618
+ return "M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M15.84,15.5C15.57,16.17 15.16,16.75 14.63,17.23C13.96,17.82 13.17,18.21 12.29,18.42C11.38,18.63 10.47,18.63 9.56,18.42C9,18.29 8.5,18.06 8.04,17.75C7.27,17.23 6.69,16.5 6.32,15.63C5.95,14.76 5.79,13.81 5.86,12.86C5.93,11.91 6.24,11.03 6.77,10.24C7.3,9.45 8,8.84 8.84,8.45C9.68,8.06 10.58,7.93 11.5,8.07C12.41,8.21 13.24,8.59 13.94,9.18C14.64,9.77 15.16,10.53 15.45,11.38C15.74,12.23 15.79,13.13 15.59,14C15.39,14.87 14.96,15.67 14.34,16.32L15.84,15.5Z";
1619
+ }
1620
+ if (browser.includes("safari")) {
1621
+ return "M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M9.5,9.5L14,12L12,14L10.5,14.5L9.5,9.5M12,11A1,1 0 0,1 13,12A1,1 0 0,1 12,13A1,1 0 0,1 11,12A1,1 0 0,1 12,11Z";
1622
+ }
1623
+ if (browser.includes("edge") || browser.includes("edg")) {
1624
+ return "M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12C4,14.5 5.2,16.7 7.1,18C8,17 9.3,16.5 10.7,16.5C12.1,16.5 13.4,17 14.3,18C16.2,16.7 17.4,14.5 17.4,12C17.4,9.5 16.2,7.3 14.3,6C13.4,7 12.1,7.5 10.7,7.5C9.3,7.5 8,7 7.1,6C5.2,7.3 4,9.5 4,12M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10Z";
1625
+ }
1626
+ if (browser.includes("opera")) {
1627
+ return "M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4C7.92,4 4.55,7.05 4.07,11H8.92C9.45,8.7 10.6,7 12,7C13.4,7 14.55,8.7 15.08,11H19.93C19.45,7.05 16.08,4 12,4M4.07,13C4.55,16.95 7.92,20 12,20C16.08,20 19.45,16.95 19.93,13H15.08C14.55,15.3 13.4,17 12,17C10.6,17 9.45,15.3 8.92,13H4.07Z";
1628
+ }
1629
+ if (platform.includes("tablet") || platform.includes("ipad")) {
1630
+ return "M19,18H5V6H19M21,4H3C1.89,4 1,4.89 1,6V18A2,2 0 0,0 3,20H21A2,2 0 0,0 23,18V6C23,4.89 22.1,4 21,4Z";
1631
+ }
1632
+ return "M17,19H7V5H17M17,1H7C5.89,1 5,1.89 5,3V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3C19,1.89 18.1,1 17,1Z";
1633
+ };
1634
+ const hasFullName = computed(() => {
1635
+ return !!(user.value?.firstName && user.value?.lastName);
1636
+ });
1637
+ onMounted(() => document.addEventListener("click", closeMenu));
1638
+ onUnmounted(() => document.removeEventListener("click", closeMenu));
1639
+ return (_ctx, _cache) => {
1640
+ return openBlock(), createElementBlock(Fragment, null, [
1641
+ createVNode(Notification, {
1642
+ show: notification.value.show,
1643
+ message: notification.value.message,
1644
+ type: notification.value.type
1645
+ }, null, 8, ["show", "message", "type"]),
1646
+ unref(user) ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
1647
+ createElementVNode("button", {
1648
+ class: "atm-profile-button",
1649
+ onClick: toggleMenu,
1650
+ ref_key: "buttonRef",
1651
+ ref: buttonRef
1652
+ }, [
1653
+ createElementVNode("div", {
1654
+ class: "atm-profile-avatar",
1655
+ style: normalizeStyle(unref(user)?.profileImage ? {} : { backgroundColor: atmPrimaryColor.value })
1656
+ }, [
1657
+ unref(user)?.profileImage ? (openBlock(), createElementBlock("img", {
1658
+ key: 0,
1659
+ src: unref(user).profileImage,
1660
+ alt: "Profile",
1661
+ class: "atm-profile-avatar-img"
1662
+ }, null, 8, _hoisted_2)) : hasFullName.value ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(userInitials.value), 1)) : (openBlock(), createElementBlock("svg", _hoisted_4, [..._cache[7] || (_cache[7] = [
1663
+ createElementVNode("path", {
1664
+ fill: "currentColor",
1665
+ d: "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"
1666
+ }, null, -1)
1667
+ ])]))
1668
+ ], 4),
1669
+ hasFullName.value ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(unref(user).firstName), 1)) : createCommentVNode("", true),
1670
+ (openBlock(), createElementBlock("svg", {
1671
+ class: normalizeClass(["atm-profile-arrow", { "atm-rotate": isDropdownOpen.value }]),
1672
+ viewBox: "0 0 24 24"
1673
+ }, [..._cache[8] || (_cache[8] = [
1674
+ createElementVNode("path", {
1675
+ fill: "currentColor",
1676
+ d: "M7,10L12,15L17,10H7Z"
1677
+ }, null, -1)
1678
+ ])], 2))
1679
+ ], 512),
1680
+ createVNode(Transition, { name: "atm-fade" }, {
1681
+ default: withCtx(() => [
1682
+ isDropdownOpen.value ? (openBlock(), createElementBlock("div", _hoisted_6, [
1683
+ createElementVNode("div", _hoisted_7, [
1684
+ createElementVNode("div", {
1685
+ class: "atm-profile-avatar large",
1686
+ style: normalizeStyle(unref(user)?.profileImage ? {} : { backgroundColor: atmPrimaryColor.value })
1687
+ }, [
1688
+ unref(user)?.profileImage ? (openBlock(), createElementBlock("img", {
1689
+ key: 0,
1690
+ src: unref(user).profileImage,
1691
+ alt: "Profile",
1692
+ class: "atm-profile-avatar-img"
1693
+ }, null, 8, _hoisted_8)) : hasFullName.value ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(userInitials.value), 1)) : (openBlock(), createElementBlock("svg", _hoisted_10, [..._cache[9] || (_cache[9] = [
1694
+ createElementVNode("path", {
1695
+ fill: "currentColor",
1696
+ d: "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"
1697
+ }, null, -1)
1698
+ ])]))
1699
+ ], 4),
1700
+ createElementVNode("div", _hoisted_11, [
1701
+ hasFullName.value ? (openBlock(), createElementBlock("p", _hoisted_12, toDisplayString(unref(user).firstName) + " " + toDisplayString(unref(user).lastName), 1)) : (openBlock(), createElementBlock("p", _hoisted_13, "Usuário")),
1702
+ createElementVNode("p", _hoisted_14, toDisplayString(unref(user).primaryEmailAddress), 1)
1703
+ ])
1704
+ ]),
1705
+ createElementVNode("div", { class: "atm-profile-options" }, [
1706
+ createElementVNode("button", {
1707
+ class: "atm-profile-option",
1708
+ onClick: openProfileModal,
1709
+ type: "button"
1710
+ }, [..._cache[10] || (_cache[10] = [
1711
+ createElementVNode("svg", {
1712
+ viewBox: "0 0 24 24",
1713
+ class: "atm-profile-icon"
1714
+ }, [
1715
+ createElementVNode("path", {
1716
+ fill: "currentColor",
1717
+ d: "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"
1718
+ })
1719
+ ], -1),
1720
+ createTextVNode(" Meu Perfil ", -1)
1721
+ ])]),
1722
+ createElementVNode("button", {
1723
+ class: "atm-profile-option",
1724
+ onClick: logoutUser,
1725
+ type: "button"
1726
+ }, [..._cache[11] || (_cache[11] = [
1727
+ createElementVNode("svg", {
1728
+ viewBox: "0 0 24 24",
1729
+ class: "atm-profile-icon"
1730
+ }, [
1731
+ createElementVNode("path", {
1732
+ fill: "currentColor",
1733
+ d: "M16,17V14H9V10H16V7L21,12L16,17M14,2A2,2 0 0,1 16,4V6H14V4H5V20H14V18H16V20A2,2 0 0,1 14,22H5A2,2 0 0,1 3,20V4A2,2 0 0,1 5,2H14Z"
1734
+ })
1735
+ ], -1),
1736
+ createTextVNode(" Sair ", -1)
1737
+ ])])
1738
+ ])
1739
+ ])) : createCommentVNode("", true)
1740
+ ]),
1741
+ _: 1
1742
+ }),
1743
+ isProfileModalOpen.value ? (openBlock(), createElementBlock("div", _hoisted_15, [
1744
+ createElementVNode("div", {
1745
+ class: "atm-profile-overlay",
1746
+ onClick: closeProfileModal
1747
+ }),
1748
+ createElementVNode("div", _hoisted_16, [
1749
+ createElementVNode("div", { class: "atm-profile-header" }, [
1750
+ createElementVNode("button", {
1751
+ onClick: closeProfileModal,
1752
+ class: "atm-profile-close",
1753
+ "aria-label": "Fechar"
1754
+ }, "×"),
1755
+ _cache[12] || (_cache[12] = createElementVNode("h2", {
1756
+ id: "profile-modal-title",
1757
+ class: "atm-profile-title"
1758
+ }, "Meu Perfil", -1))
1759
+ ]),
1760
+ createElementVNode("div", _hoisted_17, [
1761
+ createElementVNode("button", {
1762
+ onClick: _cache[0] || (_cache[0] = ($event) => activeTab.value = "geral"),
1763
+ class: normalizeClass(["atm-tab", { "atm-tab-active": activeTab.value === "geral" }])
1764
+ }, [..._cache[13] || (_cache[13] = [
1765
+ createElementVNode("svg", {
1766
+ viewBox: "0 0 24 24",
1767
+ class: "atm-tab-icon"
1768
+ }, [
1769
+ createElementVNode("path", {
1770
+ fill: "currentColor",
1771
+ d: "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"
1772
+ })
1773
+ ], -1),
1774
+ createTextVNode(" Geral ", -1)
1775
+ ])], 2),
1776
+ createElementVNode("button", {
1777
+ onClick: _cache[1] || (_cache[1] = ($event) => activeTab.value = "emails"),
1778
+ class: normalizeClass(["atm-tab", { "atm-tab-active": activeTab.value === "emails" }])
1779
+ }, [..._cache[14] || (_cache[14] = [
1780
+ createElementVNode("svg", {
1781
+ viewBox: "0 0 24 24",
1782
+ class: "atm-tab-icon"
1783
+ }, [
1784
+ createElementVNode("path", {
1785
+ fill: "currentColor",
1786
+ d: "M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z"
1787
+ })
1788
+ ], -1),
1789
+ createTextVNode(" Emails ", -1)
1790
+ ])], 2),
1791
+ createElementVNode("button", {
1792
+ onClick: _cache[2] || (_cache[2] = ($event) => activeTab.value = "senha"),
1793
+ class: normalizeClass(["atm-tab", { "atm-tab-active": activeTab.value === "senha" }])
1794
+ }, [..._cache[15] || (_cache[15] = [
1795
+ createElementVNode("svg", {
1796
+ viewBox: "0 0 24 24",
1797
+ class: "atm-tab-icon"
1798
+ }, [
1799
+ createElementVNode("path", {
1800
+ fill: "currentColor",
1801
+ d: "M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z"
1802
+ })
1803
+ ], -1),
1804
+ createTextVNode(" Senha ", -1)
1805
+ ])], 2),
1806
+ createElementVNode("button", {
1807
+ onClick: _cache[3] || (_cache[3] = ($event) => activeTab.value = "sessoes"),
1808
+ class: normalizeClass(["atm-tab", { "atm-tab-active": activeTab.value === "sessoes" }])
1809
+ }, [..._cache[16] || (_cache[16] = [
1810
+ createElementVNode("svg", {
1811
+ viewBox: "0 0 24 24",
1812
+ class: "atm-tab-icon"
1813
+ }, [
1814
+ createElementVNode("path", {
1815
+ fill: "currentColor",
1816
+ d: "M4,6H20V16H4M20,18A2,2 0 0,0 22,16V6C22,4.89 21.1,4 20,4H4C2.89,4 2,4.89 2,6V16A2,2 0 0,0 4,18H0V20H24V18H20Z"
1817
+ })
1818
+ ], -1),
1819
+ createTextVNode(" Sessões ", -1)
1820
+ ])], 2)
1821
+ ]),
1822
+ activeTab.value === "geral" ? (openBlock(), createElementBlock("div", _hoisted_18, [
1823
+ createElementVNode("div", {
1824
+ class: "atm-profile-avatar-large",
1825
+ style: normalizeStyle(unref(user)?.profileImage ? {} : { backgroundColor: atmPrimaryColor.value })
1826
+ }, [
1827
+ unref(user)?.profileImage ? (openBlock(), createElementBlock("img", {
1828
+ key: 0,
1829
+ src: unref(user).profileImage,
1830
+ alt: "Profile",
1831
+ class: "atm-profile-avatar-img"
1832
+ }, null, 8, _hoisted_19)) : hasFullName.value ? (openBlock(), createElementBlock("span", _hoisted_20, toDisplayString(userInitials.value), 1)) : (openBlock(), createElementBlock("svg", _hoisted_21, [..._cache[17] || (_cache[17] = [
1833
+ createElementVNode("path", {
1834
+ fill: "currentColor",
1835
+ d: "M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z"
1836
+ }, null, -1)
1837
+ ])]))
1838
+ ], 4),
1839
+ !isEditingProfile.value ? (openBlock(), createElementBlock("div", _hoisted_22, [
1840
+ createElementVNode("div", _hoisted_23, [
1841
+ _cache[18] || (_cache[18] = createElementVNode("span", { class: "atm-profile-info-label" }, "Nome", -1)),
1842
+ hasFullName.value ? (openBlock(), createElementBlock("span", _hoisted_24, toDisplayString(profileForm.value.firstName), 1)) : (openBlock(), createElementBlock("span", _hoisted_25, "Não informado"))
1843
+ ]),
1844
+ createElementVNode("div", _hoisted_26, [
1845
+ _cache[19] || (_cache[19] = createElementVNode("span", { class: "atm-profile-info-label" }, "Sobrenome", -1)),
1846
+ hasFullName.value ? (openBlock(), createElementBlock("span", _hoisted_27, toDisplayString(profileForm.value.lastName), 1)) : (openBlock(), createElementBlock("span", _hoisted_28, "Não informado"))
1847
+ ]),
1848
+ createElementVNode("div", _hoisted_29, [
1849
+ _cache[20] || (_cache[20] = createElementVNode("span", { class: "atm-profile-info-label" }, "Email Principal", -1)),
1850
+ createElementVNode("span", _hoisted_30, toDisplayString(profileForm.value.primaryEmailAddress), 1)
1851
+ ]),
1852
+ createElementVNode("div", { class: "atm-profile-info-row" }, [
1853
+ createElementVNode("button", {
1854
+ class: "atm-edit-profile-btn",
1855
+ onClick: startEditing,
1856
+ type: "button"
1857
+ }, [..._cache[21] || (_cache[21] = [
1858
+ createElementVNode("svg", {
1859
+ viewBox: "0 0 24 24",
1860
+ class: "atm-btn-icon"
1861
+ }, [
1862
+ createElementVNode("path", {
1863
+ fill: "currentColor",
1864
+ d: "M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"
1865
+ })
1866
+ ], -1),
1867
+ createTextVNode(" Editar Perfil ", -1)
1868
+ ])])
1869
+ ])
1870
+ ])) : (openBlock(), createElementBlock("div", _hoisted_31, [
1871
+ createElementVNode("div", _hoisted_32, [
1872
+ _cache[22] || (_cache[22] = createElementVNode("label", { class: "atm-input-label" }, "Nome", -1)),
1873
+ withDirectives(createElementVNode("input", {
1874
+ type: "text",
1875
+ class: "atm-input-field",
1876
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => profileForm.value.firstName = $event),
1877
+ placeholder: "Digite seu nome"
1878
+ }, null, 512), [
1879
+ [vModelText, profileForm.value.firstName]
1880
+ ])
1881
+ ]),
1882
+ createElementVNode("div", _hoisted_33, [
1883
+ _cache[23] || (_cache[23] = createElementVNode("label", { class: "atm-input-label" }, "Sobrenome", -1)),
1884
+ withDirectives(createElementVNode("input", {
1885
+ type: "text",
1886
+ class: "atm-input-field",
1887
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => profileForm.value.lastName = $event),
1888
+ placeholder: "Digite seu sobrenome"
1889
+ }, null, 512), [
1890
+ [vModelText, profileForm.value.lastName]
1891
+ ])
1892
+ ]),
1893
+ createElementVNode("div", { class: "atm-form-actions" }, [
1894
+ createElementVNode("button", {
1895
+ class: "atm-save-btn",
1896
+ onClick: updateProfile,
1897
+ type: "button"
1898
+ }, [..._cache[24] || (_cache[24] = [
1899
+ createElementVNode("svg", {
1900
+ viewBox: "0 0 24 24",
1901
+ class: "atm-btn-icon"
1902
+ }, [
1903
+ createElementVNode("path", {
1904
+ fill: "currentColor",
1905
+ d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"
1906
+ })
1907
+ ], -1),
1908
+ createTextVNode(" Salvar ", -1)
1909
+ ])]),
1910
+ createElementVNode("button", {
1911
+ class: "atm-cancel-btn",
1912
+ onClick: cancelEditing,
1913
+ type: "button"
1914
+ }, [..._cache[25] || (_cache[25] = [
1915
+ createElementVNode("svg", {
1916
+ viewBox: "0 0 24 24",
1917
+ class: "atm-btn-icon"
1918
+ }, [
1919
+ createElementVNode("path", {
1920
+ fill: "currentColor",
1921
+ d: "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
1922
+ })
1923
+ ], -1),
1924
+ createTextVNode(" Cancelar ", -1)
1925
+ ])])
1926
+ ])
1927
+ ]))
1928
+ ])) : createCommentVNode("", true),
1929
+ activeTab.value === "emails" ? (openBlock(), createElementBlock("div", _hoisted_34, [
1930
+ createElementVNode("div", _hoisted_35, [
1931
+ createElementVNode("div", _hoisted_36, [
1932
+ _cache[27] || (_cache[27] = createElementVNode("label", { class: "atm-input-label" }, "Adicionar novo email", -1)),
1933
+ createElementVNode("div", _hoisted_37, [
1934
+ withDirectives(createElementVNode("input", {
1935
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => newEmail.value = $event),
1936
+ type: "email",
1937
+ class: "atm-input-field",
1938
+ placeholder: "novo@email.com"
1939
+ }, null, 512), [
1940
+ [vModelText, newEmail.value]
1941
+ ]),
1942
+ createElementVNode("button", {
1943
+ onClick: createEmailAddress,
1944
+ class: "atm-add-email-btn",
1945
+ type: "button"
1946
+ }, [..._cache[26] || (_cache[26] = [
1947
+ createElementVNode("svg", {
1948
+ viewBox: "0 0 24 24",
1949
+ class: "atm-btn-icon"
1950
+ }, [
1951
+ createElementVNode("path", {
1952
+ fill: "currentColor",
1953
+ d: "M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"
1954
+ })
1955
+ ], -1)
1956
+ ])])
1957
+ ])
1958
+ ])
1959
+ ]),
1960
+ createElementVNode("div", _hoisted_38, [
1961
+ (openBlock(true), createElementBlock(Fragment, null, renderList(emailAddresses.value, (email) => {
1962
+ return openBlock(), createElementBlock("div", {
1963
+ key: email.id,
1964
+ class: "atm-email-item"
1965
+ }, [
1966
+ createElementVNode("div", _hoisted_39, [
1967
+ createElementVNode("div", _hoisted_40, [
1968
+ _cache[28] || (_cache[28] = createElementVNode("svg", {
1969
+ viewBox: "0 0 24 24",
1970
+ class: "atm-email-icon"
1971
+ }, [
1972
+ createElementVNode("path", {
1973
+ fill: "currentColor",
1974
+ d: "M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z"
1975
+ })
1976
+ ], -1)),
1977
+ createElementVNode("span", null, toDisplayString(email.email_address), 1)
1978
+ ]),
1979
+ createElementVNode("div", _hoisted_41, [
1980
+ email.primary ? (openBlock(), createElementBlock("span", _hoisted_42, "Principal")) : createCommentVNode("", true),
1981
+ email.verified ? (openBlock(), createElementBlock("span", _hoisted_43, [..._cache[29] || (_cache[29] = [
1982
+ createElementVNode("svg", {
1983
+ viewBox: "0 0 24 24",
1984
+ class: "atm-badge-icon"
1985
+ }, [
1986
+ createElementVNode("path", {
1987
+ fill: "currentColor",
1988
+ d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"
1989
+ })
1990
+ ], -1),
1991
+ createTextVNode(" Verificado ", -1)
1992
+ ])])) : (openBlock(), createElementBlock("span", _hoisted_44, [..._cache[30] || (_cache[30] = [
1993
+ createElementVNode("svg", {
1994
+ viewBox: "0 0 24 24",
1995
+ class: "atm-badge-icon"
1996
+ }, [
1997
+ createElementVNode("path", {
1998
+ fill: "currentColor",
1999
+ d: "M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"
2000
+ })
2001
+ ], -1),
2002
+ createTextVNode(" Não verificado ", -1)
2003
+ ])]))
2004
+ ])
2005
+ ]),
2006
+ createElementVNode("div", _hoisted_45, [
2007
+ !email.verified ? (openBlock(), createElementBlock("button", {
2008
+ key: 0,
2009
+ onClick: ($event) => requestEmailVerification(email.id),
2010
+ class: "atm-verify-btn",
2011
+ type: "button"
2012
+ }, [..._cache[31] || (_cache[31] = [
2013
+ createElementVNode("svg", {
2014
+ viewBox: "0 0 24 24",
2015
+ class: "atm-btn-icon"
2016
+ }, [
2017
+ createElementVNode("path", {
2018
+ fill: "currentColor",
2019
+ d: "M12,1L3,5V11C3,16.55 6.84,21.74 12,23C17.16,21.74 21,16.55 21,11V5L12,1M10,17L6,13L7.41,11.59L10,14.17L16.59,7.58L18,9L10,17Z"
2020
+ })
2021
+ ], -1),
2022
+ createTextVNode(" Verificar ", -1)
2023
+ ])], 8, _hoisted_46)) : createCommentVNode("", true),
2024
+ !email.primary ? (openBlock(), createElementBlock("button", {
2025
+ key: 1,
2026
+ onClick: ($event) => deleteEmailAddress(email.id),
2027
+ class: "atm-delete-btn",
2028
+ type: "button"
2029
+ }, [..._cache[32] || (_cache[32] = [
2030
+ createElementVNode("svg", {
2031
+ viewBox: "0 0 24 24",
2032
+ class: "atm-btn-icon"
2033
+ }, [
2034
+ createElementVNode("path", {
2035
+ fill: "currentColor",
2036
+ d: "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"
2037
+ })
2038
+ ], -1),
2039
+ createTextVNode(" Remover ", -1)
2040
+ ])], 8, _hoisted_47)) : createCommentVNode("", true)
2041
+ ])
2042
+ ]);
2043
+ }), 128))
2044
+ ])
2045
+ ])) : createCommentVNode("", true),
2046
+ activeTab.value === "senha" ? (openBlock(), createElementBlock("div", _hoisted_48, [
2047
+ createElementVNode("div", { class: "atm-password-section" }, [
2048
+ _cache[34] || (_cache[34] = createElementVNode("div", { class: "atm-profile-info-row" }, [
2049
+ createElementVNode("span", { class: "atm-profile-info-label" }, "Redefinir Senha"),
2050
+ createElementVNode("span", { class: "atm-profile-info-value" }, " Enviaremos um link para redefinir sua senha no email principal ")
2051
+ ], -1)),
2052
+ createElementVNode("div", { class: "atm-profile-info-row" }, [
2053
+ createElementVNode("button", {
2054
+ class: "atm-reset-password-btn",
2055
+ onClick: sendResetPasswordLink,
2056
+ type: "button"
2057
+ }, [..._cache[33] || (_cache[33] = [
2058
+ createElementVNode("svg", {
2059
+ viewBox: "0 0 24 24",
2060
+ class: "atm-btn-icon"
2061
+ }, [
2062
+ createElementVNode("path", {
2063
+ fill: "currentColor",
2064
+ d: "M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z"
2065
+ })
2066
+ ], -1),
2067
+ createTextVNode(" Resetar Senha ", -1)
2068
+ ])])
2069
+ ])
2070
+ ])
2071
+ ])) : createCommentVNode("", true),
2072
+ activeTab.value === "sessoes" ? (openBlock(), createElementBlock("div", _hoisted_49, [
2073
+ createElementVNode("div", _hoisted_50, [
2074
+ _cache[38] || (_cache[38] = createElementVNode("div", { class: "atm-sessions-info" }, [
2075
+ createElementVNode("p", { class: "atm-sessions-description" }, " Gerencie os dispositivos conectados à sua conta. Você pode encerrar sessões em dispositivos que não reconhece. ")
2076
+ ], -1)),
2077
+ createElementVNode("div", _hoisted_51, [
2078
+ (openBlock(true), createElementBlock(Fragment, null, renderList(sessions.value, (session) => {
2079
+ return openBlock(), createElementBlock("div", {
2080
+ key: session.id,
2081
+ class: "atm-session-item"
2082
+ }, [
2083
+ createElementVNode("div", _hoisted_52, [
2084
+ createElementVNode("div", _hoisted_53, [
2085
+ (openBlock(), createElementBlock("svg", _hoisted_54, [
2086
+ createElementVNode("path", {
2087
+ fill: "currentColor",
2088
+ d: getDeviceIcon(session.device)
2089
+ }, null, 8, _hoisted_55)
2090
+ ])),
2091
+ createElementVNode("div", _hoisted_56, [
2092
+ createElementVNode("div", _hoisted_57, [
2093
+ createElementVNode("span", null, toDisplayString(session.ip_address), 1),
2094
+ session.current === 1 ? (openBlock(), createElementBlock("span", _hoisted_58, "Atual")) : createCommentVNode("", true)
2095
+ ]),
2096
+ session.device.browser || session.device.platform ? (openBlock(), createElementBlock("div", _hoisted_59, [
2097
+ session.device.browser ? (openBlock(), createElementBlock("span", _hoisted_60, toDisplayString(session.device.browser) + toDisplayString(session.device.browser_version ? ` ${session.device.browser_version}` : ""), 1)) : createCommentVNode("", true),
2098
+ session.device.browser && session.device.platform ? (openBlock(), createElementBlock("span", _hoisted_61, " • ")) : createCommentVNode("", true),
2099
+ session.device.platform ? (openBlock(), createElementBlock("span", _hoisted_62, toDisplayString(session.device.platform), 1)) : createCommentVNode("", true)
2100
+ ])) : createCommentVNode("", true),
2101
+ createElementVNode("div", _hoisted_63, [
2102
+ createElementVNode("div", _hoisted_64, [
2103
+ _cache[35] || (_cache[35] = createElementVNode("span", { class: "atm-timestamp-label" }, "Iniciada:", -1)),
2104
+ createElementVNode("span", null, toDisplayString(formatDate(session.started_at)), 1)
2105
+ ]),
2106
+ createElementVNode("div", _hoisted_65, [
2107
+ _cache[36] || (_cache[36] = createElementVNode("span", { class: "atm-timestamp-label" }, "Última atividade:", -1)),
2108
+ createElementVNode("span", null, toDisplayString(formatDate(session.last_activity_at)), 1)
2109
+ ])
2110
+ ])
2111
+ ])
2112
+ ])
2113
+ ]),
2114
+ createElementVNode("div", _hoisted_66, [
2115
+ session.current !== 1 ? (openBlock(), createElementBlock("button", {
2116
+ key: 0,
2117
+ onClick: ($event) => closeSessionById(session.id),
2118
+ class: "atm-close-session-btn",
2119
+ type: "button"
2120
+ }, [..._cache[37] || (_cache[37] = [
2121
+ createElementVNode("svg", {
2122
+ viewBox: "0 0 24 24",
2123
+ class: "atm-btn-icon"
2124
+ }, [
2125
+ createElementVNode("path", {
2126
+ fill: "currentColor",
2127
+ d: "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
2128
+ })
2129
+ ], -1),
2130
+ createTextVNode(" Encerrar ", -1)
2131
+ ])], 8, _hoisted_67)) : createCommentVNode("", true)
2132
+ ])
2133
+ ]);
2134
+ }), 128))
2135
+ ])
2136
+ ])
2137
+ ])) : createCommentVNode("", true)
2138
+ ])
2139
+ ])) : createCommentVNode("", true)
2140
+ ])) : createCommentVNode("", true)
2141
+ ], 64);
2142
+ };
2143
+ }
2144
+ });
2145
+ const _hoisted_1$2 = {
2146
+ key: 1,
2147
+ class: "atm-auth-buttons"
2148
+ };
2149
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
2150
+ __name: "AuthSwitcher",
2151
+ setup(__props) {
2152
+ const { user } = useAuth();
2153
+ return (_ctx, _cache) => {
2154
+ return openBlock(), createElementBlock("div", null, [
2155
+ unref(user)?.id ? (openBlock(), createBlock(_sfc_main$4, { key: 0 })) : (openBlock(), createElementBlock("div", _hoisted_1$2, [
2156
+ createVNode(SignInButton),
2157
+ createVNode(SignUpButton)
2158
+ ]))
2159
+ ]);
2160
+ };
2161
+ }
2162
+ });
2163
+ const AuthSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-0c63ecb8"]]);
2164
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
2165
+ __name: "SignOutButton",
2166
+ setup(__props) {
2167
+ useCssVars((_ctx) => ({
2168
+ "v2ec0f896": atmPrimaryColor.value
2169
+ }));
2170
+ const { logout, user } = useAuth();
2171
+ const { configurations } = useAtm();
2172
+ const atmPrimaryColor = computed(() => configurations.value?.design?.primaryColor);
2173
+ return (_ctx, _cache) => {
2174
+ return unref(user) ? (openBlock(), createElementBlock("button", {
2175
+ key: 0,
2176
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(logout)()),
2177
+ class: "atm-logout-btn"
2178
+ }, " Sair ")) : createCommentVNode("", true);
2179
+ };
2180
+ }
2181
+ });
2182
+ const SignOutButton = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-7157f989"]]);
2183
+ const _hoisted_1$1 = { key: 0 };
2184
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
2185
+ __name: "SignedIn",
2186
+ setup(__props) {
2187
+ const { isSignedIn } = useAtm();
2188
+ return (_ctx, _cache) => {
2189
+ return unref(isSignedIn) ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
2190
+ renderSlot(_ctx.$slots, "default")
2191
+ ])) : createCommentVNode("", true);
2192
+ };
2193
+ }
2194
+ });
2195
+ const _hoisted_1 = { key: 0 };
2196
+ const _sfc_main = /* @__PURE__ */ defineComponent({
2197
+ __name: "SignedOut",
2198
+ setup(__props) {
2199
+ const { isLoaded, isSignedIn } = useAtm();
2200
+ return (_ctx, _cache) => {
2201
+ return unref(isLoaded) && !unref(isSignedIn) ? (openBlock(), createElementBlock("div", _hoisted_1, [
2202
+ renderSlot(_ctx.$slots, "default")
2203
+ ])) : createCommentVNode("", true);
2204
+ };
2205
+ }
2206
+ });
2207
+ const fetchConfigurations = async (client, configurations) => {
2208
+ const response = await client.value.project().configurations();
2209
+ configurations.value = {
2210
+ project: {
2211
+ name: response.project.name,
2212
+ domain: response.project.domain
2213
+ },
2214
+ design: {
2215
+ primaryColor: response.design.primary_color,
2216
+ secondaryColor: response.design.secondary_color
2217
+ },
2218
+ username: {
2219
+ enable: response.username.enable,
2220
+ length: {
2221
+ min: response.username.length.min,
2222
+ max: response.username.length.max
2223
+ }
2224
+ },
2225
+ password: {
2226
+ enable: response.password.enable
2227
+ },
2228
+ firstName: {
2229
+ required: response.first_name.required
2230
+ },
2231
+ lastName: {
2232
+ required: response.last_name.required
2233
+ },
2234
+ register: {
2235
+ enable: response.register.enable
7
2236
  }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./components/AuthSwitcher.vue"), exports);
18
- __exportStar(require("./components/UserProfile.vue"), exports);
19
- __exportStar(require("./components/Buttons/SignInButton.vue"), exports);
20
- __exportStar(require("./components/Buttons/SignOutButton.vue"), exports);
21
- __exportStar(require("./components/Buttons/SignUpButton.vue"), exports);
22
- __exportStar(require("./components/Layout/SignedIn.vue"), exports);
23
- __exportStar(require("./components/Layout/SignedOut.vue"), exports);
24
- __exportStar(require("./composables/useAtm"), exports);
25
- __exportStar(require("./composables/useAtmClient"), exports);
26
- __exportStar(require("./composables/useAuth"), exports);
27
- __exportStar(require("./types/configurations.type"), exports);
28
- __exportStar(require("./types/user-attribute.type"), exports);
29
- __exportStar(require("./types/user.type"), exports);
30
- __exportStar(require("./types/session.type"), exports);
31
- __exportStar(require("./utils/device"), exports);
32
- __exportStar(require("./plugin"), exports);
2237
+ };
2238
+ };
2239
+ const atmPlugin = {
2240
+ install(app, pluginOptions) {
2241
+ const atmClient = new AtmClient({
2242
+ domain: pluginOptions.domain,
2243
+ publicKey: pluginOptions.publicKey,
2244
+ ssl: false
2245
+ });
2246
+ const client = ref(atmClient);
2247
+ const user = ref(null);
2248
+ const configurations = ref(null);
2249
+ const isSignedIn = computed(() => user.value !== void 0 && user.value !== null);
2250
+ const isLoaded = ref(false);
2251
+ Promise.all([
2252
+ fetchUser(client, user),
2253
+ fetchConfigurations(client, configurations)
2254
+ ]).then(() => isLoaded.value = true);
2255
+ app.provide("atm", {
2256
+ client,
2257
+ user,
2258
+ configurations,
2259
+ isSignedIn,
2260
+ isLoaded
2261
+ });
2262
+ }
2263
+ };
2264
+ export {
2265
+ AuthSwitcher,
2266
+ SignInButton,
2267
+ SignOutButton,
2268
+ SignUpButton,
2269
+ _sfc_main$1 as SignedIn,
2270
+ _sfc_main as SignedOut,
2271
+ _sfc_main$4 as UserProfile,
2272
+ atmPlugin,
2273
+ getDeviceToken,
2274
+ useAtm,
2275
+ useAtmClient,
2276
+ useAuth
2277
+ };
2278
+ //# sourceMappingURL=index.js.map