@ozdao/martyrs 0.2.585 → 0.2.586

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 (386) hide show
  1. package/dist/auth.server.js +161 -96
  2. package/dist/{authJwt-J1csaMWA.js → authJwt-DKbMMjw0.js} +33 -0
  3. package/dist/chats.server.js +2 -2
  4. package/dist/community.server.js +1 -1
  5. package/dist/core.server.js +191 -2
  6. package/dist/{core.websocket-C2FxNmZ1.js → core.websocket-Cl76z2wT.js} +41 -5
  7. package/dist/{crud-q1ye5IhV.js → crud-DpOXTZep.js} +1 -1
  8. package/dist/events.server.js +2 -2
  9. package/dist/files.server.js +1 -1
  10. package/dist/gallery.server.js +1 -1
  11. package/dist/index-kvBwwb0w.js +427 -0
  12. package/dist/inventory.server.js +2 -2
  13. package/dist/{mailing-DuEFRsa3.js → mailing-DT7nbNjZ.js} +16 -3
  14. package/dist/{main-xL-jtBkT.js → main-BIf-WirR.js} +863 -865
  15. package/dist/marketplace.server.js +1 -1
  16. package/dist/martyrs/dist/{main-xL-jtBkT.js → main-BIf-WirR.js} +192 -38
  17. package/dist/martyrs/dist/main-BIf-WirR.js.map +1 -0
  18. package/dist/martyrs/dist/{web-BA6h6Z8P.js → web-O7lXcjg0.js} +2 -2
  19. package/dist/martyrs/dist/{web-BA6h6Z8P.js.map → web-O7lXcjg0.js.map} +1 -1
  20. package/dist/martyrs/src/components/Button/{Button.vue2.js → Button.vue.js} +8 -7
  21. package/dist/martyrs/src/components/Button/Button.vue.js.map +1 -0
  22. package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
  23. package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
  24. package/dist/martyrs/src/components/Loader/Loader.vue.js +1 -1
  25. package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -1
  26. package/dist/martyrs/src/components/Spoiler/{Spoiler.vue2.js → Spoiler.vue.js} +2 -2
  27. package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +1 -0
  28. package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js +17 -22
  29. package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js.map +1 -1
  30. package/dist/martyrs/src/modules/auth/auth.client.js +18 -24
  31. package/dist/martyrs/src/modules/auth/auth.client.js.map +1 -1
  32. package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js +178 -0
  33. package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js.map +1 -0
  34. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
  35. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +53 -45
  36. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -1
  37. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +198 -14
  38. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js.map +1 -1
  39. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
  40. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +70 -29
  41. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js.map +1 -1
  42. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +2 -2
  43. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
  44. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +86 -30
  45. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js.map +1 -1
  46. package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js +100 -0
  47. package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js.map +1 -0
  48. package/dist/martyrs/src/modules/auth/views/router/auth.router.js +2 -31
  49. package/dist/martyrs/src/modules/auth/views/router/auth.router.js.map +1 -1
  50. package/dist/martyrs/src/modules/auth/views/router/users.router.js +0 -14
  51. package/dist/martyrs/src/modules/auth/views/router/users.router.js.map +1 -1
  52. package/dist/martyrs/src/modules/auth/views/store/auth.js +1 -56
  53. package/dist/martyrs/src/modules/auth/views/store/auth.js.map +1 -1
  54. package/dist/martyrs/src/modules/auth/views/store/users.js +5 -1
  55. package/dist/martyrs/src/modules/auth/views/store/users.js.map +1 -1
  56. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
  57. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  58. package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +0 -1
  59. package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js.map +1 -1
  60. package/dist/martyrs/src/modules/core/views/components/blocks/PopupAuth.vue.js +1 -1
  61. package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +1 -1
  62. package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js +74 -0
  63. package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js.map +1 -0
  64. package/dist/martyrs/src/modules/core/views/components/layouts/App.vue.js.map +1 -1
  65. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +63 -47
  66. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js.map +1 -1
  67. package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +1 -1
  68. package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +1 -1
  69. package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +1 -1
  70. package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue2.js → Filters.vue.js} +2 -2
  71. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +1 -0
  72. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  73. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  74. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  75. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  76. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
  77. package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +1 -1
  78. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  79. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +1 -1
  80. package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
  81. package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
  82. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +1 -1
  83. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
  84. package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
  85. package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
  86. package/dist/martyrs/src/modules/music/components/blocks/ActionButtons.vue.js +1 -1
  87. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
  88. package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
  89. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
  90. package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
  91. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +1 -1
  92. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +1 -1
  93. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +1 -1
  94. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
  95. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +1 -1
  96. package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
  97. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
  98. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
  99. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
  100. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
  101. package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
  102. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +0 -1
  103. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js.map +1 -1
  104. package/dist/martyrs/src/modules/music/components/player/FullscreenPlayer.vue.js +1 -1
  105. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
  106. package/dist/martyrs/src/modules/music/components/player/PlayerControls.vue.js +1 -1
  107. package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +1 -1
  108. package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +1 -1
  109. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +1 -1
  110. package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +1 -1
  111. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -2
  112. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js.map +1 -1
  113. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  114. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
  115. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  116. package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
  117. package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
  118. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  119. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
  120. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  121. package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
  122. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +2 -2
  123. package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
  124. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
  125. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  126. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -2
  127. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js.map +1 -1
  128. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  129. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +0 -1
  130. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js.map +1 -1
  131. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +0 -1
  132. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js.map +1 -1
  133. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
  134. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
  135. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +0 -1
  136. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
  137. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  138. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +0 -1
  139. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
  140. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  141. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +3 -3
  142. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
  143. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
  144. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +1 -1
  145. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +1 -1
  146. package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  147. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
  148. package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
  149. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  150. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
  151. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
  152. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  153. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  154. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
  155. package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +1 -1
  156. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +1 -1
  157. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +1 -1
  158. package/dist/martyrs.css +1 -1
  159. package/dist/martyrs.es.js +1 -1
  160. package/dist/music.server.js +1 -1
  161. package/dist/notifications.server.js +1 -1
  162. package/dist/orders.server.js +7 -6
  163. package/dist/organizations.server.js +2 -2
  164. package/dist/products.server.js +2 -2
  165. package/dist/profile.schema-C31Lynn3.js +21 -0
  166. package/dist/rents.server.js +1 -1
  167. package/dist/sessions.service-COcwjd0f.js +86 -0
  168. package/dist/style.css +178 -108
  169. package/dist/{tickets.controller-B7r0mK-5.js → tickets.controller-DdF85W-i.js} +1 -1
  170. package/dist/visitors.service-B1dhhuSo.js +83 -0
  171. package/dist/wallet.server.js +2 -2
  172. package/dist/{web-BA6h6Z8P.js → web-O7lXcjg0.js} +1 -1
  173. package/package.json +5 -1
  174. package/src/cli/commands/create.js +106 -0
  175. package/src/cli/index.js +25 -0
  176. package/src/cli/templates/app/.env.development.mustache +14 -0
  177. package/src/cli/templates/app/.env.production.mustache +14 -0
  178. package/src/cli/templates/app/Dockerfile +36 -0
  179. package/src/cli/templates/app/babel.config.js +14 -0
  180. package/src/cli/templates/app/env.js +3 -0
  181. package/src/cli/templates/app/index.js +46 -0
  182. package/src/cli/templates/app/mongodb.config.js +18 -0
  183. package/src/cli/templates/app/package.json.mustache +65 -0
  184. package/src/cli/templates/app/src/client.js +22 -0
  185. package/src/cli/templates/app/src/components/pages/Index.vue +11 -0
  186. package/src/cli/templates/app/src/configs/global.config.js.mustache +40 -0
  187. package/src/cli/templates/app/src/localization/extensions.js +2 -0
  188. package/src/cli/templates/app/src/localization/index.js +44 -0
  189. package/src/cli/templates/app/src/localization/overrides.js +2 -0
  190. package/src/cli/templates/app/src/localization/translations.js +10 -0
  191. package/src/cli/templates/app/src/models/index.js +9 -0
  192. package/src/cli/templates/app/src/router/index.js +48 -0
  193. package/src/cli/templates/app/src/scss/theme.scss +18 -0
  194. package/src/cli/templates/app/src/server.js +68 -0
  195. package/src/cli/templates/app/src/store/index.js +9 -0
  196. package/src/cli/templates/docker-compose.yaml.mustache +47 -0
  197. package/src/cli/templates/nginx/Dockerfile +5 -0
  198. package/src/cli/templates/nginx/default.conf.mustache +55 -0
  199. package/src/cli/templates/public/favicon/.gitkeep +0 -0
  200. package/src/cli/templates/start-dev.sh.mustache +131 -0
  201. package/src/cli/templates/start-prod.sh.mustache +12 -0
  202. package/src/components/Button/Button.vue +61 -15
  203. package/src/components/Loader/Loader.vue +1 -1
  204. package/src/components/Tooltip/Tooltip.vue +31 -23
  205. package/src/modules/TASKS.MD +30 -1
  206. package/src/modules/auth/CLAUDE.md +381 -0
  207. package/src/modules/auth/FIXES.md +0 -38
  208. package/src/modules/auth/auth.client.js +4 -6
  209. package/src/modules/auth/auth.server.js +4 -15
  210. package/src/modules/auth/controllers/middlewares/authJwt.js +59 -17
  211. package/src/modules/auth/controllers/middlewares/index.js +4 -1
  212. package/src/modules/auth/controllers/middlewares/otp.middleware.js +166 -0
  213. package/src/modules/auth/controllers/middlewares/verifySignUp.js +0 -1
  214. package/src/modules/auth/controllers/middlewares/verifyUser.js +58 -11
  215. package/src/modules/auth/controllers/routes/auth.routes.js +48 -6
  216. package/src/modules/auth/controllers/routes/users.routes.js +29 -8
  217. package/src/modules/auth/controllers/services/auth.service.js +62 -12
  218. package/src/modules/auth/controllers/services/otp.service.js +109 -0
  219. package/src/modules/auth/controllers/services/users.service.js +46 -6
  220. package/src/modules/auth/models/otp.model.js +20 -0
  221. package/src/modules/auth/views/components/blocks/OtpDialog.vue +168 -0
  222. package/src/modules/auth/views/components/pages/Profile.vue +18 -13
  223. package/src/modules/auth/views/components/pages/ProfileEditAccount.vue +199 -45
  224. package/src/modules/auth/views/components/pages/ResetPassword.vue +170 -132
  225. package/src/modules/auth/views/components/pages/SignIn.vue +2 -1
  226. package/src/modules/auth/views/components/pages/SignUp.vue +203 -147
  227. package/src/modules/auth/views/plugins/otp.plugin.js +104 -0
  228. package/src/modules/auth/views/router/auth.router.js +1 -24
  229. package/src/modules/auth/views/router/users.router.js +1 -12
  230. package/src/modules/auth/views/store/auth.js +0 -68
  231. package/src/modules/auth/views/store/users.js +6 -2
  232. package/src/modules/core/controllers/classes/core.websocket.js +57 -6
  233. package/src/modules/core/controllers/middlewares/visitor.logger.js +49 -0
  234. package/src/modules/core/controllers/services/requests.service.js +53 -0
  235. package/src/modules/core/controllers/services/sessions.service.js +98 -0
  236. package/src/modules/core/controllers/services/visitors.service.js +102 -0
  237. package/src/modules/core/controllers/utils/mailing.js +16 -3
  238. package/src/modules/core/core.server.js +45 -3
  239. package/src/modules/core/models/request.model.js +30 -0
  240. package/src/modules/core/models/session.model.js +43 -0
  241. package/src/modules/core/models/visitor.model.js +28 -0
  242. package/src/modules/core/views/components/elements/OnlineIndicator.vue +115 -0
  243. package/src/modules/core/views/components/layouts/App.vue +2 -2
  244. package/src/modules/core/views/components/layouts/Client.vue +443 -477
  245. package/src/modules/orders/controllers/orders.controller.js +3 -3
  246. package/src/modules/products/components/pages/Products.vue +1 -1
  247. package/dist/_virtual/alignment-pattern.js +0 -5
  248. package/dist/_virtual/alignment-pattern.js.map +0 -1
  249. package/dist/_virtual/browser.js +0 -8
  250. package/dist/_virtual/browser.js.map +0 -1
  251. package/dist/_virtual/browser2.js +0 -5
  252. package/dist/_virtual/browser2.js.map +0 -1
  253. package/dist/_virtual/canvas.js +0 -5
  254. package/dist/_virtual/canvas.js.map +0 -1
  255. package/dist/_virtual/dijkstra.js +0 -5
  256. package/dist/_virtual/dijkstra.js.map +0 -1
  257. package/dist/_virtual/error-correction-code.js +0 -5
  258. package/dist/_virtual/error-correction-code.js.map +0 -1
  259. package/dist/_virtual/error-correction-level.js +0 -5
  260. package/dist/_virtual/error-correction-level.js.map +0 -1
  261. package/dist/_virtual/finder-pattern.js +0 -5
  262. package/dist/_virtual/finder-pattern.js.map +0 -1
  263. package/dist/_virtual/format-info.js +0 -5
  264. package/dist/_virtual/format-info.js.map +0 -1
  265. package/dist/_virtual/galois-field.js +0 -5
  266. package/dist/_virtual/galois-field.js.map +0 -1
  267. package/dist/_virtual/mask-pattern.js +0 -5
  268. package/dist/_virtual/mask-pattern.js.map +0 -1
  269. package/dist/_virtual/mode.js +0 -5
  270. package/dist/_virtual/mode.js.map +0 -1
  271. package/dist/_virtual/polynomial.js +0 -5
  272. package/dist/_virtual/polynomial.js.map +0 -1
  273. package/dist/_virtual/qrcode.js +0 -5
  274. package/dist/_virtual/qrcode.js.map +0 -1
  275. package/dist/_virtual/regex.js +0 -5
  276. package/dist/_virtual/regex.js.map +0 -1
  277. package/dist/_virtual/segments.js +0 -5
  278. package/dist/_virtual/segments.js.map +0 -1
  279. package/dist/_virtual/svg-tag.js +0 -5
  280. package/dist/_virtual/svg-tag.js.map +0 -1
  281. package/dist/_virtual/utils.js +0 -5
  282. package/dist/_virtual/utils.js.map +0 -1
  283. package/dist/_virtual/utils2.js +0 -5
  284. package/dist/_virtual/utils2.js.map +0 -1
  285. package/dist/_virtual/version-check.js +0 -5
  286. package/dist/_virtual/version-check.js.map +0 -1
  287. package/dist/_virtual/version.js +0 -5
  288. package/dist/_virtual/version.js.map +0 -1
  289. package/dist/index-_Edcmck_.js +0 -170
  290. package/dist/martyrs/dist/main-xL-jtBkT.js.map +0 -1
  291. package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +0 -1336
  292. package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js.map +0 -1
  293. package/dist/martyrs/src/components/Button/Button.vue2.js.map +0 -1
  294. package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.js.map +0 -1
  295. package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js +0 -166
  296. package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js.map +0 -1
  297. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +0 -118
  298. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js.map +0 -1
  299. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +0 -360
  300. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js.map +0 -1
  301. package/dist/martyrs/src/modules/auth/views/store/twofa.js +0 -40
  302. package/dist/martyrs/src/modules/auth/views/store/twofa.js.map +0 -1
  303. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +0 -1
  304. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js +0 -43
  305. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js.map +0 -1
  306. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +0 -47
  307. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js.map +0 -1
  308. package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js +0 -29
  309. package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js.map +0 -1
  310. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +0 -89
  311. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js.map +0 -1
  312. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js +0 -136
  313. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js.map +0 -1
  314. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +0 -238
  315. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js.map +0 -1
  316. package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js +0 -9
  317. package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js.map +0 -1
  318. package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js +0 -134
  319. package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js.map +0 -1
  320. package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js +0 -106
  321. package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js.map +0 -1
  322. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js +0 -79
  323. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js.map +0 -1
  324. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js +0 -14
  325. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js.map +0 -1
  326. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js +0 -43
  327. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js.map +0 -1
  328. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js +0 -85
  329. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js.map +0 -1
  330. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js +0 -40
  331. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js.map +0 -1
  332. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js +0 -34
  333. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js.map +0 -1
  334. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js +0 -36
  335. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js.map +0 -1
  336. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js +0 -367
  337. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js.map +0 -1
  338. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js +0 -52
  339. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js.map +0 -1
  340. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js +0 -25
  341. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js.map +0 -1
  342. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js +0 -24
  343. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js.map +0 -1
  344. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js +0 -38
  345. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js.map +0 -1
  346. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js +0 -46
  347. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js.map +0 -1
  348. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js +0 -149
  349. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js.map +0 -1
  350. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js +0 -90
  351. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js.map +0 -1
  352. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js +0 -41
  353. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js.map +0 -1
  354. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js +0 -44
  355. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js.map +0 -1
  356. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js +0 -279
  357. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js.map +0 -1
  358. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js +0 -38
  359. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +0 -1
  360. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js +0 -33
  361. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js.map +0 -1
  362. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js +0 -201
  363. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js.map +0 -1
  364. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +0 -84
  365. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js.map +0 -1
  366. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js +0 -14
  367. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js.map +0 -1
  368. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js +0 -107
  369. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js.map +0 -1
  370. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js +0 -61
  371. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js.map +0 -1
  372. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js +0 -64
  373. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js.map +0 -1
  374. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +0 -87
  375. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js.map +0 -1
  376. package/dist/profile.schema-CjLOfG7b.js +0 -92
  377. package/src/modules/auth/controllers/middlewares/visitor.logger.js +0 -75
  378. package/src/modules/auth/controllers/routes/twofa.routes.js +0 -8
  379. package/src/modules/auth/controllers/services/twofa.service.js +0 -30
  380. package/src/modules/auth/models/request.model.js +0 -14
  381. package/src/modules/auth/models/visitor.model.js +0 -11
  382. package/src/modules/auth/views/components/pages/EnterCode.vue +0 -204
  383. package/src/modules/auth/views/components/pages/EnterPassword.vue +0 -123
  384. package/src/modules/auth/views/components/sections/ProfileEditCredentials.vue +0 -329
  385. package/src/modules/auth/views/store/twofa.js +0 -70
  386. package/src/modules/auth//320/220/320/240/320/245/320/230/320/242/320/225/320/232/320/242/320/243/320/240/320/220.md +0 -445
@@ -2,11 +2,13 @@ import { ref, computed, createElementBlock, openBlock, createElementVNode, creat
2
2
  import _sfc_main$1 from "../../../../../components/Tab/Tab.vue2.js";
3
3
  import Field from "../../../../../components/Field/Field.vue.js";
4
4
  import _sfc_main$2 from "../../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import _sfc_main$3 from "../../../../../components/Button/Button.vue2.js";
6
- import { useRoute, useRouter } from "vue-router";
5
+ import _sfc_main$3 from "../../../../../components/Button/Button.vue.js";
6
+ import { useRouter } from "vue-router";
7
7
  import { useI18n } from "vue-i18n";
8
- import { useStore } from "../../../../core/views/store/core.store.js";
9
- import { validateInputs, validatePhone, validateEmail } from "../../validations/inputs.validation.js";
8
+ import { useStore, setError } from "../../../../core/views/store/core.store.js";
9
+ import { withOtp } from "../../plugins/otp.plugin.js";
10
+ import $axios from "../../../../core/views/utils/axios-instance.js";
11
+ import { validateInputs, validatePhone, validateEmail, validatePassword } from "../../validations/inputs.validation.js";
10
12
  /* empty css */
11
13
  const _hoisted_1 = { class: "t-left pd-medium" };
12
14
  const _hoisted_2 = { class: "mn-b-small" };
@@ -26,20 +28,21 @@ const _hoisted_8 = {
26
28
  class: "mn-b-semi radius-small o-hidden"
27
29
  };
28
30
  const _hoisted_9 = { class: "mn-b-small t-transp" };
31
+ const _hoisted_10 = { class: "mn-b-semi" };
29
32
  const _sfc_main = {
30
33
  __name: "ResetPassword",
31
34
  setup(__props) {
32
35
  const store = useStore();
33
- const auth = store.auth || { state: {}, actions: {} };
34
- store.twofa || {};
35
36
  const core = store.core || { state: {} };
36
- const { t } = useI18n({
37
- useScope: "global"
38
- });
37
+ const auth = store.auth;
38
+ const router = useRouter();
39
+ const { t } = useI18n({ useScope: "global" });
40
+ const identifier = ref("");
41
+ const password = ref("");
42
+ const passwordRepeat = ref("");
39
43
  const phoneValidation = ref(null);
40
44
  const emailValidation = ref(null);
41
- useRoute();
42
- const router = useRouter();
45
+ const passwordValidation = ref(null);
43
46
  const availableTabs = computed(() => {
44
47
  const tabs = [
45
48
  { name: t("auth.resetPassword.phone"), value: "phone" },
@@ -50,32 +53,54 @@ const _sfc_main = {
50
53
  });
51
54
  const tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : "");
52
55
  async function onSubmit() {
53
- try {
54
- if (tabAuth.value === "phone") await validateInputs(
56
+ if (tabAuth.value === "phone") {
57
+ await validateInputs(
55
58
  phoneValidation,
56
59
  validatePhone,
57
- auth.state.user.phone,
60
+ identifier.value,
58
61
  "Некорректный телефон"
59
62
  );
60
- if (tabAuth.value === "email") await validateInputs(
63
+ }
64
+ if (tabAuth.value === "email") {
65
+ await validateInputs(
61
66
  emailValidation,
62
67
  validateEmail,
63
- auth.state.user.email,
68
+ identifier.value,
64
69
  "Некорректный email"
65
70
  );
66
- } catch (error) {
67
- throw new Error();
71
+ }
72
+ await validateInputs(
73
+ passwordValidation,
74
+ validatePassword,
75
+ password.value,
76
+ "Некорректный пароль"
77
+ );
78
+ if (password.value !== passwordRepeat.value) {
79
+ setError({ response: { data: { errorCode: "PASSWORDS_DO_NOT_MATCH" } } });
80
+ throw new Error("PASSWORDS_DO_NOT_MATCH");
68
81
  }
69
82
  try {
70
- await auth.actions.resetPassword(auth.state.user, tabAuth.value, "reset-password");
83
+ const result = await withOtp(
84
+ (data) => $axios.post("/api/auth/reset-password", data),
85
+ {
86
+ identifier: identifier.value,
87
+ type: tabAuth.value,
88
+ password: password.value
89
+ }
90
+ );
91
+ if (result.data?.accessToken) {
92
+ const Cookies = (await import("../../../../../../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.js")).default;
93
+ Cookies.set("user", JSON.stringify(result.data), { path: "/", expires: 7 });
94
+ await auth.actions.initialize();
95
+ router.push({ name: "User Profile", params: { _id: result.data._id } });
96
+ } else {
97
+ router.push({ name: "Sign In" });
98
+ }
71
99
  } catch (error) {
72
- console.log(error);
73
- throw new Error();
100
+ setError(error);
101
+ throw error;
74
102
  }
75
103
  }
76
- function redirectTo() {
77
- router.push({ name: "Enter Code", query: { type: tabAuth.value, method: "reset-password" } });
78
- }
79
104
  return (_ctx, _cache) => {
80
105
  return openBlock(), createElementBlock("section", _hoisted_1, [
81
106
  createElementVNode("h3", _hoisted_2, toDisplayString(unref(t)("auth.resetPassword.forgotPasswordTitle")), 1),
@@ -94,7 +119,7 @@ const _sfc_main = {
94
119
  tabAuth.value === "phone" ? (openBlock(), createElementBlock("div", _hoisted_6, [
95
120
  createElementVNode("p", _hoisted_7, toDisplayString(unref(t)("auth.resetPassword.smsInfo")), 1),
96
121
  createVNode(_sfc_main$2, {
97
- onChange: _cache[1] || (_cache[1] = (event) => unref(auth).state.user.phone = event),
122
+ onChange: _cache[1] || (_cache[1] = (event) => identifier.value = event),
98
123
  dropdownOptions: {
99
124
  showDialCodeInSelection: true,
100
125
  showFlags: true,
@@ -114,8 +139,8 @@ const _sfc_main = {
114
139
  tabAuth.value === "email" ? (openBlock(), createElementBlock("div", _hoisted_8, [
115
140
  createElementVNode("p", _hoisted_9, toDisplayString(unref(t)("auth.resetPassword.emailInfo")), 1),
116
141
  createVNode(Field, {
117
- field: unref(auth).state.user.email,
118
- "onUpdate:field": _cache[2] || (_cache[2] = ($event) => unref(auth).state.user.email = $event),
142
+ field: identifier.value,
143
+ "onUpdate:field": _cache[2] || (_cache[2] = ($event) => identifier.value = $event),
119
144
  placeholder: unref(t)("auth.resetPassword.emailPlaceholder"),
120
145
  validation: emailValidation.value,
121
146
  class: "bg-light h-4r pd-medium radius-small"
@@ -125,13 +150,29 @@ const _sfc_main = {
125
150
  _: 1
126
151
  })
127
152
  ]),
153
+ createElementVNode("div", _hoisted_10, [
154
+ createVNode(Field, {
155
+ field: password.value,
156
+ "onUpdate:field": _cache[3] || (_cache[3] = ($event) => password.value = $event),
157
+ type: "password",
158
+ placeholder: unref(t)("auth.enterPassword.passwordPlaceholder"),
159
+ validation: passwordValidation.value,
160
+ class: "bg-light pd-small radius-small mn-b-thin"
161
+ }, null, 8, ["field", "placeholder", "validation"]),
162
+ createVNode(Field, {
163
+ field: passwordRepeat.value,
164
+ "onUpdate:field": _cache[4] || (_cache[4] = ($event) => passwordRepeat.value = $event),
165
+ type: "password",
166
+ placeholder: unref(t)("auth.enterPassword.repeatPasswordPlaceholder"),
167
+ class: "bg-light pd-small radius-small"
168
+ }, null, 8, ["field", "placeholder"])
169
+ ]),
128
170
  createVNode(_sfc_main$3, {
129
171
  submit: onSubmit,
130
- callback: redirectTo,
131
172
  class: "w-100 bg-main"
132
173
  }, {
133
174
  default: withCtx(() => [
134
- createTextVNode(toDisplayString(unref(t)("auth.resetPassword.sendCode")), 1)
175
+ createTextVNode(toDisplayString(unref(t)("auth.enterPassword.changePasswordBtn")), 1)
135
176
  ]),
136
177
  _: 1
137
178
  })
@@ -1 +1 @@
1
- {"version":3,"file":"ResetPassword.vue.js","sources":["../../../../../../../../src/modules/auth/views/components/pages/ResetPassword.vue"],"sourcesContent":["<template>\n\t<section class=\"t-left pd-medium\">\n\t\t<!-- <img loading=\"lazy\" src=\"@/assets/icons/password.png\" class=\"i-extra mn-b-small\"> -->\n\t\t<!-- Header -->\n\t\t<h3 class=\"mn-b-small\">{{ t('auth.resetPassword.forgotPasswordTitle') }}</h3>\n\t\t<p class=\"mn-b-small t-transp\">{{ t('auth.resetPassword.instructions') }}</p>\n\t\t\n\t\t<!-- Select -->\n\t\t<div \n\t\t\tv-if=\"availableTabs.length > 1\" \n\t\t\tclass=\"mn-b-small p-small uppercase fw-semi bg-light radius-small o-hidden\"\n\t\t>\n\t\t\t<Tab \n\t\t\t\tv-model:selected=\"tabAuth\"\n\t\t\t\t:tabs=\"availableTabs\"\n\t\t\t\tclassTab=\"pd-small pd-r-medium pd-l-medium w-100 pd-small radius-small\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<!-- Form -->\n\t\t<div class=\"pos-relative\">\n\t\t<!-- Phone -->\n\t\t\t<transition name=\"slide-fade\">\n\t\t\t\t<div v-if=\"tabAuth === 'phone'\" class=\"mn-b-semi radius-small\">\n\t\t\t\t\t<p class=\"mn-b-small t-transp\">{{ t('auth.resetPassword.smsInfo') }}</p>\n\t\t\t\t\t<FieldPhone\n\t\t\t\t\t\t@change=\"(event) => auth.state.user.phone = event\" \t\n\t\t\t\t\t\t:dropdownOptions=\"{\n\t\t\t\t\t\t\tshowDialCodeInSelection: true,\n\t\t\t\t\t\t\tshowFlags: true,\n\t\t\t\t\t\t\tshowDialCodeInList: true\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t:validation=\"phoneValidation\" \n\t\t\t\t\t\tmode=\"national\"\n\t\t\t\t\t\t:inputOptions=\"{placeholder: t('auth.resetPassword.phonePlaceholder')}\"\n\t\t\t\t\t\tclass=\"bg-light h-4r pd-small radius-small mn-b-thin\" \n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t\t<!-- Email -->\n\t\t\t<transition name=\"slide-fade\">\n\t\t\t\t<div v-if=\"tabAuth === 'email'\" class=\"mn-b-semi radius-small o-hidden\">\n\t\t\t\t\t<p class=\"mn-b-small t-transp\">{{ t('auth.resetPassword.emailInfo') }}</p>\n\t\t\t\t\t<Field \n\t\t\t\t\t\tv-model:field=\"auth.state.user.email\" \t\t\n\t\t\t\t\t\t:placeholder=\"t('auth.resetPassword.emailPlaceholder')\" \t\n\t\t\t\t\t\t:validation=\"emailValidation\" \n\t\t\t\t\t\tclass=\"bg-light h-4r pd-medium radius-small\" \n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t</div>\n\t\t<!-- Button -->\n\t\t<Button :submit=\"onSubmit\" :callback=\"redirectTo\" class=\"w-100 bg-main\">{{ t('auth.resetPassword.sendCode') }}</Button>\n\t</section> \n</template>\n\n<script setup>\n// Import components\nimport Tab from '@martyrs/src/components/Tab/Tab.vue'\nimport Field from '@martyrs/src/components/Field/Field.vue'\nimport FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'\nimport Button from '@martyrs/src/components/Button/Button.vue'\n// Import libs\nimport { computed, onMounted, ref } from 'vue'\nimport { useRoute, useRouter } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\n// Import store\nimport { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'\n// Import validation\nimport * as inputsValidation from '@martyrs/src/modules/auth/views/validations/inputs.validation'\n\n// Get store\nconst store = useStore()\nconst auth = store.auth || { state: {}, actions: {} }\nconst twofa = store.twofa || { state: {}, actions: {}, sendCode: () => {} }\nconst core = store.core || { state: {}, actions: {} }\n// Localization\nconst { t } = useI18n({\n\tuseScope: 'global', \n})\n// Validation\nconst phoneValidation = ref(null)\nconst emailValidation = ref(null)\n// Accessing router\nconst route = useRoute()\nconst router = useRouter()\n// Accessing state\nconst availableTabs = computed(() => {\n const tabs = [\n { name: t('auth.resetPassword.phone'), value: 'phone' },\n { name: t('auth.resetPassword.email'), value: 'email' }\n ];\n const excludeMethods = core.state?.options?.auth?.authMethodsExclude || [];\n return tabs.filter(tab => !excludeMethods.includes(tab.value));\n});\n\nconst tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : '');\n// Methods\nasync function onSubmit() {\n\ttry {\n\t if (tabAuth.value === 'phone') await inputsValidation.validateInputs(\n\t\t\tphoneValidation, \n\t\t\tinputsValidation.validatePhone, \n\t\t\tauth.state.user.phone, \n\t\t\t'Некорректный телефон'\n\t\t)\n\t\tif (tabAuth.value === 'email') await inputsValidation.validateInputs(\n\t\t\temailValidation, \n\t\t\tinputsValidation.validateEmail, \n\t\t\tauth.state.user.email, \n\t\t\t'Некорректный email'\n\t\t)\n\t} catch (error) {\n\t\tthrow new Error\n\t}\n\ttry {\n \tawait auth.actions.resetPassword(auth.state.user, tabAuth.value, 'reset-password')\n } catch (error) {\n \tconsole.log(error)\n\t\tthrow new Error\n\t}\n}\n\nfunction redirectTo () {\n\trouter.push({ name: 'Enter Code', query: {type: tabAuth.value, method: 'reset-password'} })\n}\n</script>\n\n<style lang=\"scss\">\n\t.slide-fade-enter-active {\n\t transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n\t}\n\n\t.slide-fade-leave-active {\n\t transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n\n\t}\n\n\t.slide-fade-enter-from,\n\t.slide-fade-leave-to {\n\t\tposition: absolute;\n\t transform: translateX(20px);\n\t opacity: 0;\n\t left: 0;\n\t top: 0;\n\t}\n\n\t.slide-fade-leave-to {\n\n\t}\n</style>\n"],"names":["inputsValidation.validateInputs","inputsValidation.validatePhone","inputsValidation.validateEmail"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyEA,UAAM,QAAQ,SAAQ;AACtB,UAAM,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,GAAI,SAAS,CAAA,EAAE;AACrC,UAAM,SAAS,CAA6C;AAC1E,UAAM,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,EAAgB;AAEpD,UAAM,EAAE,EAAC,IAAK,QAAQ;AAAA,MACrB,UAAU;AAAA,IACX,CAAC;AAED,UAAM,kBAAkB,IAAI,IAAI;AAChC,UAAM,kBAAkB,IAAI,IAAI;AAElB,aAAQ;AACtB,UAAM,SAAS,UAAS;AAExB,UAAM,gBAAgB,SAAS,MAAM;AACjC,YAAM,OAAO;AAAA,QACT,EAAE,MAAM,EAAE,0BAA0B,GAAG,OAAO,QAAO;AAAA,QACrD,EAAE,MAAM,EAAE,0BAA0B,GAAG,OAAO,QAAO;AAAA,MAC7D;AACI,YAAM,iBAAiB,KAAK,OAAO,SAAS,MAAM,sBAAsB,CAAA;AACxE,aAAO,KAAK,OAAO,SAAO,CAAC,eAAe,SAAS,IAAI,KAAK,CAAC;AAAA,IACjE,CAAC;AAED,UAAM,UAAU,IAAI,cAAc,MAAM,SAAS,cAAc,MAAM,CAAC,EAAE,QAAQ,EAAE;AAElF,mBAAe,WAAW;AACzB,UAAI;AACF,YAAI,QAAQ,UAAU,QAAS,OAAMA;AAAAA,UACrC;AAAA,UACAC;AAAAA,UACA,KAAK,MAAM,KAAK;AAAA,UAChB;AAAA,QACH;AACE,YAAI,QAAQ,UAAU,QAAS,OAAMD;AAAAA,UACpC;AAAA,UACAE;AAAAA,UACA,KAAK,MAAM,KAAK;AAAA,UAChB;AAAA,QACH;AAAA,MACC,SAAS,OAAO;AACf,cAAM,IAAI;AAAA,MACX;AACA,UAAI;AACF,cAAM,KAAK,QAAQ,cAAc,KAAK,MAAM,MAAM,QAAQ,OAAO,gBAAgB;AAAA,MAClF,SAAS,OAAO;AACf,gBAAQ,IAAI,KAAK;AAClB,cAAM,IAAI;AAAA,MACX;AAAA,IACD;AAEA,aAAS,aAAc;AACtB,aAAO,KAAK,EAAE,MAAM,cAAc,OAAO,EAAC,MAAM,QAAQ,OAAO,QAAQ,iBAAgB,EAAC,CAAE;AAAA,IAC3F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ResetPassword.vue.js","sources":["../../../../../../../../src/modules/auth/views/components/pages/ResetPassword.vue"],"sourcesContent":["<template>\n <section class=\"t-left pd-medium\">\n <h3 class=\"mn-b-small\">{{ t('auth.resetPassword.forgotPasswordTitle') }}</h3>\n <p class=\"mn-b-small t-transp\">{{ t('auth.resetPassword.instructions') }}</p>\n\n <!-- Tab selector -->\n <div\n v-if=\"availableTabs.length > 1\"\n class=\"mn-b-small p-small uppercase fw-semi bg-light radius-small o-hidden\"\n >\n <Tab\n v-model:selected=\"tabAuth\"\n :tabs=\"availableTabs\"\n classTab=\"pd-small pd-r-medium pd-l-medium w-100 pd-small radius-small\"\n />\n </div>\n\n <!-- Form -->\n <div class=\"pos-relative\">\n <!-- Phone -->\n <transition name=\"slide-fade\">\n <div v-if=\"tabAuth === 'phone'\" class=\"mn-b-semi radius-small\">\n <p class=\"mn-b-small t-transp\">{{ t('auth.resetPassword.smsInfo') }}</p>\n <FieldPhone\n @change=\"(event) => identifier = event\"\n :dropdownOptions=\"{\n showDialCodeInSelection: true,\n showFlags: true,\n showDialCodeInList: true\n }\"\n :validation=\"phoneValidation\"\n mode=\"national\"\n :inputOptions=\"{ placeholder: t('auth.resetPassword.phonePlaceholder') }\"\n class=\"bg-light h-4r pd-small radius-small mn-b-thin\"\n />\n </div>\n </transition>\n <!-- Email -->\n <transition name=\"slide-fade\">\n <div v-if=\"tabAuth === 'email'\" class=\"mn-b-semi radius-small o-hidden\">\n <p class=\"mn-b-small t-transp\">{{ t('auth.resetPassword.emailInfo') }}</p>\n <Field\n v-model:field=\"identifier\"\n :placeholder=\"t('auth.resetPassword.emailPlaceholder')\"\n :validation=\"emailValidation\"\n class=\"bg-light h-4r pd-medium radius-small\"\n />\n </div>\n </transition>\n </div>\n\n <!-- Password fields -->\n <div class=\"mn-b-semi\">\n <Field\n v-model:field=\"password\"\n type=\"password\"\n :placeholder=\"t('auth.enterPassword.passwordPlaceholder')\"\n :validation=\"passwordValidation\"\n class=\"bg-light pd-small radius-small mn-b-thin\"\n />\n <Field\n v-model:field=\"passwordRepeat\"\n type=\"password\"\n :placeholder=\"t('auth.enterPassword.repeatPasswordPlaceholder')\"\n class=\"bg-light pd-small radius-small\"\n />\n </div>\n\n <Button :submit=\"onSubmit\" class=\"w-100 bg-main\">\n {{ t('auth.enterPassword.changePasswordBtn') }}\n </Button>\n </section>\n</template>\n\n<script setup>\nimport Tab from '@martyrs/src/components/Tab/Tab.vue'\nimport Field from '@martyrs/src/components/Field/Field.vue'\nimport FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'\nimport Button from '@martyrs/src/components/Button/Button.vue'\n\nimport { computed, ref } from 'vue'\nimport { useRouter } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\n\nimport { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'\nimport { setError } from '@martyrs/src/modules/core/views/store/core.store.js'\nimport { withOtp } from '@martyrs/src/modules/auth/views/plugins/otp.plugin.js'\nimport $axios from '@martyrs/src/modules/core/views/utils/axios-instance.js'\nimport * as inputsValidation from '@martyrs/src/modules/auth/views/validations/inputs.validation'\n\nconst store = useStore()\nconst core = store.core || { state: {} }\nconst auth = store.auth\n\nconst router = useRouter()\nconst { t } = useI18n({ useScope: 'global' })\n\nconst identifier = ref('')\nconst password = ref('')\nconst passwordRepeat = ref('')\n\nconst phoneValidation = ref(null)\nconst emailValidation = ref(null)\nconst passwordValidation = ref(null)\n\nconst availableTabs = computed(() => {\n const tabs = [\n { name: t('auth.resetPassword.phone'), value: 'phone' },\n { name: t('auth.resetPassword.email'), value: 'email' }\n ]\n const excludeMethods = core.state?.options?.auth?.authMethodsExclude || []\n return tabs.filter(tab => !excludeMethods.includes(tab.value))\n})\n\nconst tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : '')\n\nasync function onSubmit() {\n // Validate identifier\n if (tabAuth.value === 'phone') {\n await inputsValidation.validateInputs(\n phoneValidation,\n inputsValidation.validatePhone,\n identifier.value,\n 'Некорректный телефон'\n )\n }\n if (tabAuth.value === 'email') {\n await inputsValidation.validateInputs(\n emailValidation,\n inputsValidation.validateEmail,\n identifier.value,\n 'Некорректный email'\n )\n }\n\n // Validate password\n await inputsValidation.validateInputs(\n passwordValidation,\n inputsValidation.validatePassword,\n password.value,\n 'Некорректный пароль'\n )\n\n if (password.value !== passwordRepeat.value) {\n setError({ response: { data: { errorCode: 'PASSWORDS_DO_NOT_MATCH' } } })\n throw new Error('PASSWORDS_DO_NOT_MATCH')\n }\n\n // Reset password with OTP verification\n try {\n const result = await withOtp(\n (data) => $axios.post('/api/auth/reset-password', data),\n {\n identifier: identifier.value,\n type: tabAuth.value,\n password: password.value\n }\n )\n\n // Success - save token and redirect\n if (result.data?.accessToken) {\n const Cookies = (await import('js-cookie')).default\n Cookies.set('user', JSON.stringify(result.data), { path: '/', expires: 7 })\n await auth.actions.initialize()\n router.push({ name: 'User Profile', params: { _id: result.data._id } })\n } else {\n router.push({ name: 'Sign In' })\n }\n } catch (error) {\n setError(error)\n throw error\n }\n}\n</script>\n\n<style lang=\"scss\">\n.slide-fade-enter-active,\n.slide-fade-leave-active {\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.slide-fade-enter-from,\n.slide-fade-leave-to {\n position: absolute;\n transform: translateX(20px);\n opacity: 0;\n left: 0;\n top: 0;\n}\n</style>\n"],"names":["inputsValidation.validateInputs","inputsValidation.validatePhone","inputsValidation.validateEmail","inputsValidation.validatePassword"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,UAAM,QAAQ,SAAQ;AACtB,UAAM,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,EAAE;AACtC,UAAM,OAAO,MAAM;AAEnB,UAAM,SAAS,UAAS;AACxB,UAAM,EAAE,EAAC,IAAK,QAAQ,EAAE,UAAU,SAAQ,CAAE;AAE5C,UAAM,aAAa,IAAI,EAAE;AACzB,UAAM,WAAW,IAAI,EAAE;AACvB,UAAM,iBAAiB,IAAI,EAAE;AAE7B,UAAM,kBAAkB,IAAI,IAAI;AAChC,UAAM,kBAAkB,IAAI,IAAI;AAChC,UAAM,qBAAqB,IAAI,IAAI;AAEnC,UAAM,gBAAgB,SAAS,MAAM;AACnC,YAAM,OAAO;AAAA,QACX,EAAE,MAAM,EAAE,0BAA0B,GAAG,OAAO,QAAO;AAAA,QACrD,EAAE,MAAM,EAAE,0BAA0B,GAAG,OAAO,QAAO;AAAA,MACzD;AACE,YAAM,iBAAiB,KAAK,OAAO,SAAS,MAAM,sBAAsB,CAAA;AACxE,aAAO,KAAK,OAAO,SAAO,CAAC,eAAe,SAAS,IAAI,KAAK,CAAC;AAAA,IAC/D,CAAC;AAED,UAAM,UAAU,IAAI,cAAc,MAAM,SAAS,cAAc,MAAM,CAAC,EAAE,QAAQ,EAAE;AAElF,mBAAe,WAAW;AAExB,UAAI,QAAQ,UAAU,SAAS;AAC7B,cAAMA;AAAAA,UACJ;AAAA,UACAC;AAAAA,UACA,WAAW;AAAA,UACX;AAAA,QACN;AAAA,MACE;AACA,UAAI,QAAQ,UAAU,SAAS;AAC7B,cAAMD;AAAAA,UACJ;AAAA,UACAE;AAAAA,UACA,WAAW;AAAA,UACX;AAAA,QACN;AAAA,MACE;AAGA,YAAMF;AAAAA,QACJ;AAAA,QACAG;AAAAA,QACA,SAAS;AAAA,QACT;AAAA,MACJ;AAEE,UAAI,SAAS,UAAU,eAAe,OAAO;AAC3C,iBAAS,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,yBAAwB,IAAI,CAAE;AACxE,cAAM,IAAI,MAAM,wBAAwB;AAAA,MAC1C;AAGA,UAAI;AACF,cAAM,SAAS,MAAM;AAAA,UACnB,CAAC,SAAS,OAAO,KAAK,4BAA4B,IAAI;AAAA,UACtD;AAAA,YACE,YAAY,WAAW;AAAA,YACvB,MAAM,QAAQ;AAAA,YACd,UAAU,SAAS;AAAA,UAC3B;AAAA,QACA;AAGI,YAAI,OAAO,MAAM,aAAa;AAC5B,gBAAM,WAAW,MAAM,OAAO,kGAAW,GAAG;AAC5C,kBAAQ,IAAI,QAAQ,KAAK,UAAU,OAAO,IAAI,GAAG,EAAE,MAAM,KAAK,SAAS,EAAC,CAAE;AAC1E,gBAAM,KAAK,QAAQ,WAAU;AAC7B,iBAAO,KAAK,EAAE,MAAM,gBAAgB,QAAQ,EAAE,KAAK,OAAO,KAAK,MAAK,CAAE;AAAA,QACxE,OAAO;AACL,iBAAO,KAAK,EAAE,MAAM,UAAS,CAAE;AAAA,QACjC;AAAA,MACF,SAAS,OAAO;AACd,iBAAS,KAAK;AACd,cAAM;AAAA,MACR;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import { ref, computed, onMounted, resolveComponent, createElementBlock, openBlo
2
2
  import _sfc_main$1 from "../../../../../components/Tab/Tab.vue2.js";
3
3
  import Field from "../../../../../components/Field/Field.vue.js";
4
4
  import _sfc_main$2 from "../../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import _sfc_main$3 from "../../../../../components/Button/Button.vue2.js";
5
+ import _sfc_main$3 from "../../../../../components/Button/Button.vue.js";
6
6
  import { useRoute, useRouter } from "vue-router";
7
7
  import { useI18n } from "vue-i18n";
8
8
  import { useStore } from "../../../../core/views/store/core.store.js";
@@ -76,6 +76,7 @@ const _sfc_main = {
76
76
  }
77
77
  const userCopy = { ...state.user };
78
78
  await actions.login(userCopy, tabAuth.value);
79
+ redirectTo();
79
80
  }
80
81
  function redirectTo() {
81
82
  if (!state.user._id) {
@@ -195,7 +196,6 @@ const _sfc_main = {
195
196
  ]),
196
197
  createVNode(_sfc_main$3, {
197
198
  submit: onSubmit,
198
- callback: redirectTo,
199
199
  class: "w-100 bg-main"
200
200
  }, {
201
201
  default: withCtx(() => [
@@ -1 +1 @@
1
- {"version":3,"file":"SignIn.vue.js","sources":["../../../../../../../../src/modules/auth/views/components/pages/SignIn.vue"],"sourcesContent":["<template>\n\t<section class=\"\">\n\t\t<!-- Header -->\n\t\t<img loading=\"lazy\" :src=\"'/logo/logo.svg'\" class=\"i-extra radius-small mn-b-small\">\n\n\t\t<h3 class=\"mn-b-medium\">\n\t\t\t{{ t('auth.signIn.title') }}\n\t\t\t<br>\n\t\t\t<span class=\"fw-semi\">{{ t('auth.signIn.subtitle') }}</span>\n\t\t</h3>\n\n\t\t<p class=\"mn-b-big\">\n\t\t\t<router-link :to=\"{name: 'Sign Up', query: { returnUrl: route.query?.returnUrl}}\" class=\"underline t-grey\">{{ t('auth.signIn.signup') }}</router-link>\n\t\t</p>\n\t\t\n\t\t<!-- Select -->\n\t\t<div \n\t\t\tv-if=\"availableTabs.length > 1\" \n\t\t\tclass=\"mn-b-small p-small uppercase fw-semi bg-light radius-small o-hidden\"\n\t\t>\n\t\t\t<Tab \n\t\t\t\tv-model:selected=\"tabAuth\"\n\t\t\t\t:tabs=\"availableTabs\"\n\t\t\t\tclassTab=\"pd-small pd-r-medium pd-l-medium w-100 pd-small radius-small\"\n\t\t\t/>\n\t\t</div>\n\t\t<!-- Form -->\n\t\t<div class=\"pos-relative\">\n\t\t<!-- Phone -->\n\t\t\t<transition name=\"slide-fade\">\n\t\t\t\t<div v-show=\"tabAuth === 'phone'\" class=\"mn-b-thin radius-small\">\n\t\t\t\t\t<FieldPhone\n\t\t\t\t\t\t@change=\"(event) => auth.state.user.phone = event\" \t\n\t\t\t\t\t\t:dropdownOptions=\"{\n\t\t\t\t\t\t\tshowDialCodeInSelection: true,\n\t\t\t\t\t\t\tshowFlags: true,\n\t\t\t\t\t\t\tshowDialCodeInList: true,\n\t\t\t\t\t\t\ttabIndex: -1\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t:validCharactersOnly=\"true\"\n\t\t\t\t\t\t:validation=\"phoneValidation\" \n\t\t\t\t\t\tmode=\"national\"\n\t\t\t\t\t\t:inputOptions=\"{placeholder: t('auth.signIn.phonePlaceholder'), type: 'tel'}\"\n\t\t\t\t\t\tclass=\"bg-light h-4r pd-small radius-small mn-b-thin\" \n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t\t<transition name=\"slide-fade\">\n\t\t\t\t<div v-show=\"tabAuth === 'email'\" class=\"mn-b-thin radius-small o-hidden\">\n\t\t\t\t\t<Field \n\t\t\t\t\t\tv-model:field=\"auth.state.user.email\" \t\n\t\t\t\t\t\t:placeholder=\"t('auth.signIn.emailPlaceholder')\" \t\n\t\t\t\t\t\t:validation=\"emailValidation\"\n\t\t\t\t\t\t:tabIndex=\"-1\"\n\t\t\t\t\t\tclass=\"bg-light h-4r pd-medium radius-small\" \n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t</div>\n\n\t\t<!-- Password -->\n\t\t<Field \n\t\t\tv-model:field=\"auth.state.user.password\"\n\t\t\ttype=\"password\" \t\n\t\t\t:validation=\"passswordValidation\" \n\t\t\t:placeholder=\"t('auth.signIn.passwordPlaceholder')\" \n\t\t\tclass=\"\n bg-light\n pd-medium\n radius-small\n mn-b-semi\n h-4r \n \"\n\t\t/>\n\t\t<!-- Links -->\n\t\t<div class=\"w-100 mn-b-big\">\n\t\t\t<router-link\n\t\t\t\t:to=\"{name: 'Reset Password', query: { returnUrl: route.query?.returnUrl}}\"\n\t\t\t\tclass=\"underline d-block t-blue\"\n\t\t\t>\n\t\t\t\t{{ t('auth.signIn.forgotPassword') }}\n\t\t\t</router-link>\n\t\t</div>\n\t\t<!-- Button -->\n\t\t<Button \n\t\t\t:submit=\"onSubmit\" \n\t\t\t:callback=\"redirectTo\" \n\t\t\tclass=\"w-100 bg-main\"\n\t\t>\n\t\t\t{{ t('auth.signIn.signin') }}\n\t\t</Button>\n\t\t\n\t\t<!-- <Button \n\t\t\t:submit=\"onSubmitApple\" \n\t\t\t:callback=\"redirectTo\" \n\t\t\tclass=\"mn-b-thin bg-black t-white\"\n\t\t>\n\t\t\t{{ t('auth.signIn.signin_apple') }}\n\t\t</Button> -->\n\t</section> \n</template>\n\n<script setup>\n// Import components\nimport Tab from '@martyrs/src/components/Tab/Tab.vue'\nimport Field from '@martyrs/src/components/Field/Field.vue'\nimport FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'\nimport Button from '@martyrs/src/components/Button/Button.vue'\n// Import libs\nimport { computed, onMounted, ref, inject } from 'vue'\nimport { useRoute, useRouter } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\n// Import store\nimport { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth.js'\n// Import validation\nimport * as inputsValidation from '@martyrs/src/modules/auth/views/validations/inputs.validation'\n\n// Get store\nconst store = useStore()\nconst core = store.core\n\n// Init validation\nconst phoneValidation = ref(null)\nconst passswordValidation = ref(null)\nconst emailValidation = ref(null)\n// Accessing router\nconst route = useRoute()\nconst router = useRouter()\n// Localization\nconst { t } = useI18n({\n\tuseScope: 'global'\n})\n// Accessing state\nconst availableTabs = computed(() => {\n const tabs = [\n { name: t('auth.signIn.phone'), value: 'phone' },\n { name: t('auth.signIn.email'), value: 'email' }\n ];\n const excludeMethods = core.state?.options?.auth?.authMethodsExclude || [];\n return tabs.filter(tab => !excludeMethods.includes(tab.value));\n});\n\nconst tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : '');\n\nconst loadExternalScript = (src) => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = src;\n script.onload = resolve;\n script.onerror = reject;\n document.head.appendChild(script);\n });\n}\n\nonMounted(async () => {\n\tawait loadExternalScript('https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js');\n});\n// Methods\nasync function onSubmit() {\n\ttry {\n\t if (tabAuth.value === 'phone') await inputsValidation.validateInputs(\n\t\t\tphoneValidation, \n\t\t\tinputsValidation.validatePhone, \n\t\t\tauth.state.user.phone, \n\t\t\t'Некорректный телефон'\n\t\t)\n\t\tif (tabAuth.value === 'email') await inputsValidation.validateInputs(\n\t\t\temailValidation, \n\t\t\tinputsValidation.validateEmail, \n\t\t\tauth.state.user.email, \n\t\t\t'Некорректный email'\n\t\t)\n\t} catch (error) {\n\t\tconsole.log(error)\n\t\tthrow new Error\n\t}\n\n\t// COSTIL PLEASE GOD MAKE IT GOOD, FUKEN INPUT COMPONENT RETURN OBJECT NUT NUMBER\n\tconst userCopy = {...auth.state.user};\n\t// COSTIL PLEASE GOD MAKE IT GOOD, FUKEN INPUT COMPONENT RETURN OBJECT NUT NUMBER\n\n \tawait auth.actions.login(userCopy, tabAuth.value)\n}\n\nasync function onSubmitApple() {\n try {\n window.AppleID.auth.init({\n clientId: 'com.thecommune.app.signin',\n scope: 'email name',\n redirectURI: 'https://thecommunephuket.com/auth/signin',\n usePopup: true,\n });\n\n let response = await window.AppleID.auth.signIn();\n\n if (response) {\n console.log(response);\n await auth.actions.login(response, 'apple');\n }\n\n } catch (error) {\n console.error(error);\n throw new Error('Error during Apple authentication');\n }\n}\n\nfunction redirectTo () {\n\tif (!auth.state.user._id) {\n\t\tthrow new Error('AUTH_STATE_NOT_INITIALIZED')\n\t}\n\n\tif (route.query?.returnUrl) {\n\t\trouter.push({\n\t\t\tpath: route.query?.returnUrl,\n\t\t\tquery: {\n\t\t\t\tafterAuth: 'true'\n\t\t\t}\n\t\t})\n\t} else {\n\t\trouter.push({\n\t\t\tname: 'User Profile',\n\t\t\tparams: {\n\t\t\t\t_id: auth.state.user._id\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tafterAuth: 'true'\n\t\t\t}\n\t\t})\n\t}\n}\n</script>\n\n<style lang=\"scss\">\n\n\t.input-error {\n\t border: 1px solid red;\n\t box-shadow: 0 0 3px 0 red;\n\t}\n</style>"],"names":["inputsValidation.validateInputs","inputsValidation.validatePhone","auth.state","inputsValidation.validateEmail","auth.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAwHA,UAAM,QAAQ,SAAQ;AACtB,UAAM,OAAO,MAAM;AAGnB,UAAM,kBAAkB,IAAI,IAAI;AAChC,UAAM,sBAAsB,IAAI,IAAI;AACpC,UAAM,kBAAkB,IAAI,IAAI;AAEhC,UAAM,QAAQ,SAAQ;AACtB,UAAM,SAAS,UAAS;AAExB,UAAM,EAAE,EAAC,IAAK,QAAQ;AAAA,MACrB,UAAU;AAAA,IACX,CAAC;AAED,UAAM,gBAAgB,SAAS,MAAM;AACjC,YAAM,OAAO;AAAA,QACT,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,QAAO;AAAA,QAC9C,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,QAAO;AAAA,MACtD;AACI,YAAM,iBAAiB,KAAK,OAAO,SAAS,MAAM,sBAAsB,CAAA;AACxE,aAAO,KAAK,OAAO,SAAO,CAAC,eAAe,SAAS,IAAI,KAAK,CAAC;AAAA,IACjE,CAAC;AAED,UAAM,UAAU,IAAI,cAAc,MAAM,SAAS,cAAc,MAAM,CAAC,EAAE,QAAQ,EAAE;AAElF,UAAM,qBAAqB,CAAC,QAAQ;AAClC,aAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,cAAM,SAAS,SAAS,cAAc,QAAQ;AAC9C,eAAO,OAAO;AACd,eAAO,MAAM;AACb,eAAO,SAAS;AAChB,eAAO,UAAU;AACjB,iBAAS,KAAK,YAAY,MAAM;AAAA,MAClC,CAAC;AAAA,IACH;AAEA,cAAU,YAAY;AACrB,YAAM,mBAAmB,sFAAsF;AAAA,IAChH,CAAC;AAED,mBAAe,WAAW;AACzB,UAAI;AACF,YAAI,QAAQ,UAAU,QAAS,OAAMA;AAAAA,UACrC;AAAA,UACAC;AAAAA,UACAC,MAAW,KAAK;AAAA,UAChB;AAAA,QACH;AACE,YAAI,QAAQ,UAAU,QAAS,OAAMF;AAAAA,UACpC;AAAA,UACAG;AAAAA,UACAD,MAAW,KAAK;AAAA,UAChB;AAAA,QACH;AAAA,MACC,SAAS,OAAO;AACf,gBAAQ,IAAI,KAAK;AACjB,cAAM,IAAI;AAAA,MACX;AAGA,YAAM,WAAW,EAAC,GAAGA,MAAW,KAAI;AAGnC,YAAME,QAAa,MAAM,UAAU,QAAQ,KAAK;AAAA,IAClD;AAwBA,aAAS,aAAc;AACtB,UAAI,CAACF,MAAW,KAAK,KAAK;AACzB,cAAM,IAAI,MAAM,4BAA4B;AAAA,MAC7C;AAEA,UAAI,MAAM,OAAO,WAAW;AAC3B,eAAO,KAAK;AAAA,UACX,MAAM,MAAM,OAAO;AAAA,UACnB,OAAO;AAAA,YACN,WAAW;AAAA,UACf;AAAA,QACA,CAAG;AAAA,MACF,OAAO;AACN,eAAO,KAAK;AAAA,UACX,MAAM;AAAA,UACN,QAAQ;AAAA,YACP,KAAKA,MAAW,KAAK;AAAA,UACzB;AAAA,UACG,OAAO;AAAA,YACN,WAAW;AAAA,UACf;AAAA,QACA,CAAG;AAAA,MACF;AAAA,IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SignIn.vue.js","sources":["../../../../../../../../src/modules/auth/views/components/pages/SignIn.vue"],"sourcesContent":["<template>\n\t<section class=\"\">\n\t\t<!-- Header -->\n\t\t<img loading=\"lazy\" :src=\"'/logo/logo.svg'\" class=\"i-extra radius-small mn-b-small\">\n\n\t\t<h3 class=\"mn-b-medium\">\n\t\t\t{{ t('auth.signIn.title') }}\n\t\t\t<br>\n\t\t\t<span class=\"fw-semi\">{{ t('auth.signIn.subtitle') }}</span>\n\t\t</h3>\n\n\t\t<p class=\"mn-b-big\">\n\t\t\t<router-link :to=\"{name: 'Sign Up', query: { returnUrl: route.query?.returnUrl}}\" class=\"underline t-grey\">{{ t('auth.signIn.signup') }}</router-link>\n\t\t</p>\n\t\t\n\t\t<!-- Select -->\n\t\t<div \n\t\t\tv-if=\"availableTabs.length > 1\" \n\t\t\tclass=\"mn-b-small p-small uppercase fw-semi bg-light radius-small o-hidden\"\n\t\t>\n\t\t\t<Tab \n\t\t\t\tv-model:selected=\"tabAuth\"\n\t\t\t\t:tabs=\"availableTabs\"\n\t\t\t\tclassTab=\"pd-small pd-r-medium pd-l-medium w-100 pd-small radius-small\"\n\t\t\t/>\n\t\t</div>\n\t\t<!-- Form -->\n\t\t<div class=\"pos-relative\">\n\t\t<!-- Phone -->\n\t\t\t<transition name=\"slide-fade\">\n\t\t\t\t<div v-show=\"tabAuth === 'phone'\" class=\"mn-b-thin radius-small\">\n\t\t\t\t\t<FieldPhone\n\t\t\t\t\t\t@change=\"(event) => auth.state.user.phone = event\" \t\n\t\t\t\t\t\t:dropdownOptions=\"{\n\t\t\t\t\t\t\tshowDialCodeInSelection: true,\n\t\t\t\t\t\t\tshowFlags: true,\n\t\t\t\t\t\t\tshowDialCodeInList: true,\n\t\t\t\t\t\t\ttabIndex: -1\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t:validCharactersOnly=\"true\"\n\t\t\t\t\t\t:validation=\"phoneValidation\" \n\t\t\t\t\t\tmode=\"national\"\n\t\t\t\t\t\t:inputOptions=\"{placeholder: t('auth.signIn.phonePlaceholder'), type: 'tel'}\"\n\t\t\t\t\t\tclass=\"bg-light h-4r pd-small radius-small mn-b-thin\" \n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t\t<transition name=\"slide-fade\">\n\t\t\t\t<div v-show=\"tabAuth === 'email'\" class=\"mn-b-thin radius-small o-hidden\">\n\t\t\t\t\t<Field \n\t\t\t\t\t\tv-model:field=\"auth.state.user.email\" \t\n\t\t\t\t\t\t:placeholder=\"t('auth.signIn.emailPlaceholder')\" \t\n\t\t\t\t\t\t:validation=\"emailValidation\"\n\t\t\t\t\t\t:tabIndex=\"-1\"\n\t\t\t\t\t\tclass=\"bg-light h-4r pd-medium radius-small\" \n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t</div>\n\n\t\t<!-- Password -->\n\t\t<Field \n\t\t\tv-model:field=\"auth.state.user.password\"\n\t\t\ttype=\"password\" \t\n\t\t\t:validation=\"passswordValidation\" \n\t\t\t:placeholder=\"t('auth.signIn.passwordPlaceholder')\" \n\t\t\tclass=\"\n bg-light\n pd-medium\n radius-small\n mn-b-semi\n h-4r \n \"\n\t\t/>\n\t\t<!-- Links -->\n\t\t<div class=\"w-100 mn-b-big\">\n\t\t\t<router-link\n\t\t\t\t:to=\"{name: 'Reset Password', query: { returnUrl: route.query?.returnUrl}}\"\n\t\t\t\tclass=\"underline d-block t-blue\"\n\t\t\t>\n\t\t\t\t{{ t('auth.signIn.forgotPassword') }}\n\t\t\t</router-link>\n\t\t</div>\n\t\t<!-- Button -->\n\t\t<Button \n\t\t\t:submit=\"onSubmit\" \n\t\t\tclass=\"w-100 bg-main\"\n\t\t>\n\t\t\t{{ t('auth.signIn.signin') }}\n\t\t</Button>\n\t\t\n\t\t<!-- <Button \n\t\t\t:submit=\"onSubmitApple\" \n\t\t\t:callback=\"redirectTo\" \n\t\t\tclass=\"mn-b-thin bg-black t-white\"\n\t\t>\n\t\t\t{{ t('auth.signIn.signin_apple') }}\n\t\t</Button> -->\n\t</section> \n</template>\n\n<script setup>\n// Import components\nimport Tab from '@martyrs/src/components/Tab/Tab.vue'\nimport Field from '@martyrs/src/components/Field/Field.vue'\nimport FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'\nimport Button from '@martyrs/src/components/Button/Button.vue'\n// Import libs\nimport { computed, onMounted, ref, inject } from 'vue'\nimport { useRoute, useRouter } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\n// Import store\nimport { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth.js'\n// Import validation\nimport * as inputsValidation from '@martyrs/src/modules/auth/views/validations/inputs.validation'\n\n// Get store\nconst store = useStore()\nconst core = store.core\n\n// Init validation\nconst phoneValidation = ref(null)\nconst passswordValidation = ref(null)\nconst emailValidation = ref(null)\n// Accessing router\nconst route = useRoute()\nconst router = useRouter()\n// Localization\nconst { t } = useI18n({\n\tuseScope: 'global'\n})\n// Accessing state\nconst availableTabs = computed(() => {\n const tabs = [\n { name: t('auth.signIn.phone'), value: 'phone' },\n { name: t('auth.signIn.email'), value: 'email' }\n ];\n const excludeMethods = core.state?.options?.auth?.authMethodsExclude || [];\n return tabs.filter(tab => !excludeMethods.includes(tab.value));\n});\n\nconst tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : '');\n\nconst loadExternalScript = (src) => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = src;\n script.onload = resolve;\n script.onerror = reject;\n document.head.appendChild(script);\n });\n}\n\nonMounted(async () => {\n\tawait loadExternalScript('https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js');\n});\n// Methods\nasync function onSubmit() {\n\ttry {\n\t if (tabAuth.value === 'phone') await inputsValidation.validateInputs(\n\t\t\tphoneValidation, \n\t\t\tinputsValidation.validatePhone, \n\t\t\tauth.state.user.phone, \n\t\t\t'Некорректный телефон'\n\t\t)\n\t\tif (tabAuth.value === 'email') await inputsValidation.validateInputs(\n\t\t\temailValidation, \n\t\t\tinputsValidation.validateEmail, \n\t\t\tauth.state.user.email, \n\t\t\t'Некорректный email'\n\t\t)\n\t} catch (error) {\n\t\tconsole.log(error)\n\t\tthrow new Error\n\t}\n\n\t// COSTIL PLEASE GOD MAKE IT GOOD, FUKEN INPUT COMPONENT RETURN OBJECT NUT NUMBER\n\tconst userCopy = {...auth.state.user};\n\t// COSTIL PLEASE GOD MAKE IT GOOD, FUKEN INPUT COMPONENT RETURN OBJECT NUT NUMBER\n\n \tawait auth.actions.login(userCopy, tabAuth.value)\n\n\tredirectTo()\n}\n\nasync function onSubmitApple() {\n try {\n window.AppleID.auth.init({\n clientId: 'com.thecommune.app.signin',\n scope: 'email name',\n redirectURI: 'https://thecommunephuket.com/auth/signin',\n usePopup: true,\n });\n\n let response = await window.AppleID.auth.signIn();\n\n if (response) {\n console.log(response);\n await auth.actions.login(response, 'apple');\n }\n\n } catch (error) {\n console.error(error);\n throw new Error('Error during Apple authentication');\n }\n}\n\nfunction redirectTo () {\n\tif (!auth.state.user._id) {\n\t\tthrow new Error('AUTH_STATE_NOT_INITIALIZED')\n\t}\n\n\tif (route.query?.returnUrl) {\n\t\trouter.push({\n\t\t\tpath: route.query?.returnUrl,\n\t\t\tquery: {\n\t\t\t\tafterAuth: 'true'\n\t\t\t}\n\t\t})\n\t} else {\n\t\trouter.push({\n\t\t\tname: 'User Profile',\n\t\t\tparams: {\n\t\t\t\t_id: auth.state.user._id\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tafterAuth: 'true'\n\t\t\t}\n\t\t})\n\t}\n}\n</script>\n\n<style lang=\"scss\">\n\n\t.input-error {\n\t border: 1px solid red;\n\t box-shadow: 0 0 3px 0 red;\n\t}\n</style>"],"names":["inputsValidation.validateInputs","inputsValidation.validatePhone","auth.state","inputsValidation.validateEmail","auth.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuHA,UAAM,QAAQ,SAAQ;AACtB,UAAM,OAAO,MAAM;AAGnB,UAAM,kBAAkB,IAAI,IAAI;AAChC,UAAM,sBAAsB,IAAI,IAAI;AACpC,UAAM,kBAAkB,IAAI,IAAI;AAEhC,UAAM,QAAQ,SAAQ;AACtB,UAAM,SAAS,UAAS;AAExB,UAAM,EAAE,EAAC,IAAK,QAAQ;AAAA,MACrB,UAAU;AAAA,IACX,CAAC;AAED,UAAM,gBAAgB,SAAS,MAAM;AACjC,YAAM,OAAO;AAAA,QACT,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,QAAO;AAAA,QAC9C,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,QAAO;AAAA,MACtD;AACI,YAAM,iBAAiB,KAAK,OAAO,SAAS,MAAM,sBAAsB,CAAA;AACxE,aAAO,KAAK,OAAO,SAAO,CAAC,eAAe,SAAS,IAAI,KAAK,CAAC;AAAA,IACjE,CAAC;AAED,UAAM,UAAU,IAAI,cAAc,MAAM,SAAS,cAAc,MAAM,CAAC,EAAE,QAAQ,EAAE;AAElF,UAAM,qBAAqB,CAAC,QAAQ;AAClC,aAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,cAAM,SAAS,SAAS,cAAc,QAAQ;AAC9C,eAAO,OAAO;AACd,eAAO,MAAM;AACb,eAAO,SAAS;AAChB,eAAO,UAAU;AACjB,iBAAS,KAAK,YAAY,MAAM;AAAA,MAClC,CAAC;AAAA,IACH;AAEA,cAAU,YAAY;AACrB,YAAM,mBAAmB,sFAAsF;AAAA,IAChH,CAAC;AAED,mBAAe,WAAW;AACzB,UAAI;AACF,YAAI,QAAQ,UAAU,QAAS,OAAMA;AAAAA,UACrC;AAAA,UACAC;AAAAA,UACAC,MAAW,KAAK;AAAA,UAChB;AAAA,QACH;AACE,YAAI,QAAQ,UAAU,QAAS,OAAMF;AAAAA,UACpC;AAAA,UACAG;AAAAA,UACAD,MAAW,KAAK;AAAA,UAChB;AAAA,QACH;AAAA,MACC,SAAS,OAAO;AACf,gBAAQ,IAAI,KAAK;AACjB,cAAM,IAAI;AAAA,MACX;AAGA,YAAM,WAAW,EAAC,GAAGA,MAAW,KAAI;AAGnC,YAAME,QAAa,MAAM,UAAU,QAAQ,KAAK;AAEjD,iBAAU;AAAA,IACX;AAwBA,aAAS,aAAc;AACtB,UAAI,CAACF,MAAW,KAAK,KAAK;AACzB,cAAM,IAAI,MAAM,4BAA4B;AAAA,MAC7C;AAEA,UAAI,MAAM,OAAO,WAAW;AAC3B,eAAO,KAAK;AAAA,UACX,MAAM,MAAM,OAAO;AAAA,UACnB,OAAO;AAAA,YACN,WAAW;AAAA,UACf;AAAA,QACA,CAAG;AAAA,MACF,OAAO;AACN,eAAO,KAAK;AAAA,UACX,MAAM;AAAA,UACN,QAAQ;AAAA,YACP,KAAKA,MAAW,KAAK;AAAA,UACzB;AAAA,UACG,OAAO;AAAA,YACN,WAAW;AAAA,UACf;AAAA,QACA,CAAG;AAAA,MACF;AAAA,IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,11 +2,13 @@ import { ref, computed, resolveComponent, createElementBlock, openBlock, createE
2
2
  import _sfc_main$1 from "../../../../../components/Tab/Tab.vue2.js";
3
3
  import Field from "../../../../../components/Field/Field.vue.js";
4
4
  import _sfc_main$2 from "../../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import _sfc_main$3 from "../../../../../components/Button/Button.vue2.js";
5
+ import _sfc_main$3 from "../../../../../components/Button/Button.vue.js";
6
6
  import { useRoute, useRouter } from "vue-router";
7
7
  import { useI18n } from "vue-i18n";
8
- import { useStore } from "../../../../core/views/store/core.store.js";
9
- import { validateInputs, validatePhone, validateEmail } from "../../validations/inputs.validation.js";
8
+ import { useStore, setError } from "../../../../core/views/store/core.store.js";
9
+ import { withOtp } from "../../plugins/otp.plugin.js";
10
+ import $axios from "../../../../core/views/utils/axios-instance.js";
11
+ import { validateInputs, validatePhone, validateEmail, validatePassword } from "../../validations/inputs.validation.js";
10
12
  /* empty css */
11
13
  const _hoisted_1 = { class: "t-left pd-medium" };
12
14
  const _hoisted_2 = { class: "mn-b-small" };
@@ -19,22 +21,24 @@ const _hoisted_5 = { class: "mn-b-semi radius-small" };
19
21
  const _hoisted_6 = { class: "mn-b-small t-transp" };
20
22
  const _hoisted_7 = { class: "mn-b-semi radius-small o-hidden" };
21
23
  const _hoisted_8 = { class: "mn-b-small t-transp" };
22
- const _hoisted_9 = { class: "w-100" };
24
+ const _hoisted_9 = { class: "mn-b-semi" };
25
+ const _hoisted_10 = { class: "w-100" };
23
26
  const _sfc_main = {
24
27
  __name: "SignUp",
25
28
  setup(__props) {
26
29
  const store = useStore();
27
- const auth = store.auth || { state: {}, actions: {} };
28
- const twofa = store.twofa || { state: {}, actions: {}, sendCode: () => {
29
- } };
30
30
  const core = store.core || { state: {} };
31
- const { t } = useI18n({
32
- useScope: "global"
33
- });
34
- const phoneValidation = ref(null);
35
- const emailValidation = ref(null);
31
+ const auth = store.auth;
36
32
  const route = useRoute();
37
33
  const router = useRouter();
34
+ const { t } = useI18n({ useScope: "global" });
35
+ const email = ref("");
36
+ const phone = ref("");
37
+ const password = ref("");
38
+ const passwordRepeat = ref("");
39
+ const phoneValidation = ref(null);
40
+ const emailValidation = ref(null);
41
+ const passwordValidation = ref(null);
38
42
  const availableTabs = computed(() => {
39
43
  const tabs = [
40
44
  { name: t("auth.signUp.phone"), value: "phone" },
@@ -45,31 +49,58 @@ const _sfc_main = {
45
49
  });
46
50
  const tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : "");
47
51
  async function onSubmit() {
48
- try {
49
- if (tabAuth.value === "phone") await validateInputs(
52
+ if (tabAuth.value === "phone") {
53
+ await validateInputs(
50
54
  phoneValidation,
51
55
  validatePhone,
52
- auth.state.user.phone,
56
+ phone.value,
53
57
  "Некорректный телефон"
54
58
  );
55
- if (tabAuth.value === "email") await validateInputs(
59
+ }
60
+ if (tabAuth.value === "email") {
61
+ await validateInputs(
56
62
  emailValidation,
57
63
  validateEmail,
58
- auth.state.user.email,
64
+ email.value,
59
65
  "Некорректный email"
60
66
  );
61
- } catch (error) {
62
- throw new Error();
67
+ }
68
+ await validateInputs(
69
+ passwordValidation,
70
+ validatePassword,
71
+ password.value,
72
+ "Некорректный пароль"
73
+ );
74
+ if (password.value !== passwordRepeat.value) {
75
+ setError({ response: { data: { errorCode: "PASSWORDS_DO_NOT_MATCH" } } });
76
+ throw new Error("PASSWORDS_DO_NOT_MATCH");
63
77
  }
64
78
  try {
65
- await twofa.sendCode(auth.state.user, "signup", tabAuth.value);
79
+ const result = await withOtp(
80
+ (data) => $axios.post("/api/auth/signup", data),
81
+ {
82
+ email: tabAuth.value === "email" ? email.value : void 0,
83
+ phone: tabAuth.value === "phone" ? phone.value : void 0,
84
+ password: password.value,
85
+ type: tabAuth.value,
86
+ inviteCode: route.query.invite
87
+ }
88
+ );
89
+ if (result.data?.accessToken) {
90
+ const Cookies = (await import("../../../../../../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.js")).default;
91
+ Cookies.set("user", JSON.stringify(result.data), { path: "/", expires: 7 });
92
+ await auth.actions.initialize();
93
+ if (route.query.returnUrl) {
94
+ router.push({ path: route.query.returnUrl, query: { afterAuth: "true" } });
95
+ } else {
96
+ router.push({ name: "User Profile", params: { _id: result.data._id }, query: { afterAuth: "true" } });
97
+ }
98
+ }
66
99
  } catch (error) {
67
- throw new Error();
100
+ setError(error);
101
+ throw error;
68
102
  }
69
103
  }
70
- function redirectTo() {
71
- router.push({ name: "Enter Code", query: { returnUrl: route.query.returnUrl } });
72
- }
73
104
  return (_ctx, _cache) => {
74
105
  const _component_router_link = resolveComponent("router-link");
75
106
  return openBlock(), createElementBlock("section", _hoisted_1, [
@@ -88,7 +119,7 @@ const _sfc_main = {
88
119
  withDirectives(createElementVNode("div", _hoisted_5, [
89
120
  createElementVNode("p", _hoisted_6, toDisplayString(unref(t)("auth.signUp.smsNotice")), 1),
90
121
  createVNode(_sfc_main$2, {
91
- onChange: _cache[1] || (_cache[1] = (event) => unref(auth).state.user.phone = event),
122
+ onChange: _cache[1] || (_cache[1] = (event) => phone.value = event),
92
123
  dropdownOptions: {
93
124
  showDialCodeInSelection: true,
94
125
  showFlags: true,
@@ -110,8 +141,8 @@ const _sfc_main = {
110
141
  withDirectives(createElementVNode("div", _hoisted_7, [
111
142
  createElementVNode("p", _hoisted_8, toDisplayString(unref(t)("auth.signUp.emailNotice")), 1),
112
143
  createVNode(Field, {
113
- field: unref(auth).state.user.email,
114
- "onUpdate:field": _cache[2] || (_cache[2] = ($event) => unref(auth).state.user.email = $event),
144
+ field: email.value,
145
+ "onUpdate:field": _cache[2] || (_cache[2] = ($event) => email.value = $event),
115
146
  placeholder: unref(t)("auth.signUp.emailPlaceholder"),
116
147
  validation: emailValidation.value,
117
148
  class: "bg-light h-4r pd-medium radius-small"
@@ -123,17 +154,42 @@ const _sfc_main = {
123
154
  _: 1
124
155
  })
125
156
  ]),
157
+ createElementVNode("div", _hoisted_9, [
158
+ createVNode(Field, {
159
+ field: password.value,
160
+ "onUpdate:field": _cache[3] || (_cache[3] = ($event) => password.value = $event),
161
+ type: "password",
162
+ placeholder: unref(t)("auth.enterPassword.passwordPlaceholder"),
163
+ validation: passwordValidation.value,
164
+ class: "bg-light pd-small radius-small mn-b-thin"
165
+ }, null, 8, ["field", "placeholder", "validation"]),
166
+ createVNode(Field, {
167
+ field: passwordRepeat.value,
168
+ "onUpdate:field": _cache[4] || (_cache[4] = ($event) => passwordRepeat.value = $event),
169
+ type: "password",
170
+ placeholder: unref(t)("auth.enterPassword.repeatPasswordPlaceholder"),
171
+ class: "bg-light pd-small radius-small"
172
+ }, null, 8, ["field", "placeholder"])
173
+ ]),
174
+ _cache[5] || (_cache[5] = createElementVNode("div", { class: "p-regular fw-semi mn-b-semi" }, [
175
+ createTextVNode(" By registering, you agree to our "),
176
+ createElementVNode("a", {
177
+ class: "t-grey",
178
+ href: "/legal/eula",
179
+ target: "_blank",
180
+ rel: "noopener noreferrer"
181
+ }, "End User License Agreement (EULA)")
182
+ ], -1)),
126
183
  createVNode(_sfc_main$3, {
127
184
  submit: onSubmit,
128
- callback: redirectTo,
129
185
  class: "w-100 bg-main mn-b-big"
130
186
  }, {
131
187
  default: withCtx(() => [
132
- createTextVNode(toDisplayString(unref(t)("auth.signUp.sendCode")), 1)
188
+ createTextVNode(toDisplayString(unref(t)("auth.enterPassword.registerBtn")), 1)
133
189
  ]),
134
190
  _: 1
135
191
  }),
136
- createElementVNode("div", _hoisted_9, [
192
+ createElementVNode("div", _hoisted_10, [
137
193
  createVNode(_component_router_link, {
138
194
  to: { name: "Sign In", query: { returnUrl: unref(route).query.returnUrl } },
139
195
  class: "underline mn-b-medium d-block t-blue"
@@ -1 +1 @@
1
- {"version":3,"file":"SignUp.vue.js","sources":["../../../../../../../../src/modules/auth/views/components/pages/SignUp.vue"],"sourcesContent":["<template>\n\t<section class=\"t-left pd-medium\">\n\t\t<!-- Header -->\n\t\t<!-- <img loading=\"lazy\" src=\"@/assets/images/logo.svg\" class=\"i-extra mn-b-small\"> -->\n\t\t<h3 class=\"mn-b-small\">{{t('auth.signUp.title')}}</h3>\n\t\t\n\t\t<!-- Select -->\n\t\t<div \n\t\t\tv-if=\"availableTabs.length > 1\" \n\t\t\tclass=\"mn-b-small p-small uppercase fw-semi bg-light radius-small o-hidden\"\n\t\t>\n\t\t\t<Tab \n\t\t\t\tv-model:selected=\"tabAuth\"\n\t\t\t\t:tabs=\"availableTabs\"\n\t\t\t\tclassTab=\"pd-small pd-r-medium pd-l-medium w-100 pd-small radius-small\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<!-- Form -->\n\t\t<div class=\"pos-relative\">\n\t\t<!-- Phone -->\n\t\t\t<transition name=\"slide-fade\">\n\t\t\t\t<div v-show=\"tabAuth === 'phone'\" class=\"mn-b-semi radius-small\">\n\t\t\t\t\t<p class=\"mn-b-small t-transp\">{{t('auth.signUp.smsNotice')}}</p>\n\t\t\t\t\t<FieldPhone\n\t\t\t\t\t\t@change=\"(event) => auth.state.user.phone = event\" \t\n\t\t\t\t\t\t:dropdownOptions=\"{\n\t\t\t\t\t\t\tshowDialCodeInSelection: true,\n\t\t\t\t\t\t\tshowFlags: true,\n\t\t\t\t\t\t\tshowDialCodeInList: true\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t:validation=\"phoneValidation\" \n\t\t\t\t\t\tmode=\"national\"\n\t\t\t\t\t\t:inputOptions=\"{placeholder: t('auth.signUp.phonePlaceholder')}\"\n\t\t\t\t\t\tclass=\"bg-light h-4r pd-small radius-small mn-b-thin\" \n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t\t<transition name=\"slide-fade\">\n\t\t\t\t<div v-show=\"tabAuth === 'email'\" class=\"mn-b-semi radius-small o-hidden\">\n\t\t\t\t\t<p class=\"mn-b-small t-transp\">{{t('auth.signUp.emailNotice')}}</p>\n\t\t\t\t\t<Field \n\t\t\t\t\t\tv-model:field=\"auth.state.user.email\" \t\n\t\t\t\t\t\t:placeholder=\"t('auth.signUp.emailPlaceholder')\" \t\n\t\t\t\t\t\t:validation=\"emailValidation\"\n\t\t\t\t\t\tclass=\"bg-light h-4r pd-medium radius-small\" \n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t</div>\n\t\t\n\t\t<!-- Button -->\n\t\t<Button :submit=\"onSubmit\" :callback=\"redirectTo\" class=\"w-100 bg-main mn-b-big\">{{t('auth.signUp.sendCode')}}</Button>\n\t\t\t\n\t\t<!-- Links -->\n\t\t<div class=\"w-100\">\n\t\t\t<router-link :to=\"{name: 'Sign In', query: { returnUrl: route.query.returnUrl}}\" class=\"underline mn-b-medium d-block t-blue\">{{t('auth.signUp.haveAccount')}}</router-link>\n\t\t</div>\n\n\t</section> \n</template>\n\n\t<script setup>\n\t// Import components\n\timport Tab from '@martyrs/src/components/Tab/Tab.vue'\n\timport Field from '@martyrs/src/components/Field/Field.vue'\n\timport FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'\n\timport Button from '@martyrs/src/components/Button/Button.vue'\n\t// Import libs\n\timport { computed, onMounted, ref } from 'vue'\n\timport { useRoute, useRouter } from 'vue-router'\n\timport { useI18n } from 'vue-i18n'\n\t// Import store\n\timport { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'\n\t// Import validation\n\timport * as inputsValidation from '@martyrs/src/modules/auth/views/validations/inputs.validation'\n\t\n\t// Get store\n\tconst store = useStore()\n\tconst auth = store.auth || { state: {}, actions: {} }\n\tconst twofa = store.twofa || { state: {}, actions: {}, sendCode: () => {} }\n\tconst core = store.core || { state: {}, actions: {} }\n\t// Localization\n\tconst { t } = useI18n({\n\t\tuseScope: 'global', \n\t})\n\t// Validation\n\tconst phoneValidation = ref(null)\n\tconst emailValidation = ref(null)\n\t// Accessing router\n\tconst route = useRoute()\n\tconst router = useRouter()\n\t// Accessing state\n\tconst availableTabs = computed(() => {\n\t const tabs = [\n\t { name: t('auth.signUp.phone'), value: 'phone' },\n\t { name: t('auth.signUp.email'), value: 'email' }\n\t ];\n\t const excludeMethods = core.state?.options?.auth?.authMethodsExclude || [];\n\t return tabs.filter(tab => !excludeMethods.includes(tab.value));\n\t});\n\n\tconst tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : '');\n\t// Methods\n\tasync function onSubmit() {\n\t\ttry {\n\t\t if (tabAuth.value === 'phone') await inputsValidation.validateInputs(\n\t\t\t\tphoneValidation, \n\t\t\t\tinputsValidation.validatePhone, \n\t\t\t\tauth.state.user.phone, \n\t\t\t\t'Некорректный телефон'\n\t\t\t)\n\t\t\tif (tabAuth.value === 'email') await inputsValidation.validateInputs(\n\t\t\t\temailValidation, \n\t\t\t\tinputsValidation.validateEmail, \n\t\t\t\tauth.state.user.email, \n\t\t\t\t'Некорректный email'\n\t\t\t)\n\t\t} catch (error) {\n\t\t\tthrow new Error\n\t\t}\n\t\ttry {\n\t \tawait twofa.sendCode(auth.state.user, 'signup', tabAuth.value)\n\t } catch (error) {\n\t\t\tthrow new Error\n\t\t}\n\t}\n\n\tfunction redirectTo () {\n\t\trouter.push({ name: 'Enter Code', query: { returnUrl: route.query.returnUrl}})\n\t}\n</script>\n\n<style lang=\"scss\">\n\t.slide-fade-enter-active {\n\t transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n\t}\n\n\t.slide-fade-leave-active {\n\t transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n\n\t}\n\n\t.slide-fade-enter-from,\n\t.slide-fade-leave-to {\n\t\tposition: absolute;\n\t transform: translateX(20px);\n\t opacity: 0;\n\t left: 0;\n\t top: 0;\n\t}\n\n\t.slide-fade-leave-to {\n\n\t}\n</style>\n"],"names":["inputsValidation.validateInputs","inputsValidation.validatePhone","inputsValidation.validateEmail"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+EC,UAAM,QAAQ,SAAQ;AACtB,UAAM,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,GAAI,SAAS,CAAA,EAAE;AACnD,UAAM,QAAQ,MAAM,SAAS,EAAE,OAAO,IAAI,SAAS,CAAA,GAAI,UAAU,MAAM;AAAA,IAAC,EAAC;AACzE,UAAM,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,EAAgB;AAEpD,UAAM,EAAE,EAAC,IAAK,QAAQ;AAAA,MACrB,UAAU;AAAA,IACZ,CAAE;AAED,UAAM,kBAAkB,IAAI,IAAI;AAChC,UAAM,kBAAkB,IAAI,IAAI;AAEhC,UAAM,QAAQ,SAAQ;AACtB,UAAM,SAAS,UAAS;AAExB,UAAM,gBAAgB,SAAS,MAAM;AACjC,YAAM,OAAO;AAAA,QACT,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,QAAO;AAAA,QAC9C,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,QAAO;AAAA,MACvD;AACK,YAAM,iBAAiB,KAAK,OAAO,SAAS,MAAM,sBAAsB,CAAA;AACxE,aAAO,KAAK,OAAO,SAAO,CAAC,eAAe,SAAS,IAAI,KAAK,CAAC;AAAA,IACjE,CAAC;AAED,UAAM,UAAU,IAAI,cAAc,MAAM,SAAS,cAAc,MAAM,CAAC,EAAE,QAAQ,EAAE;AAElF,mBAAe,WAAW;AACzB,UAAI;AACF,YAAI,QAAQ,UAAU,QAAS,OAAMA;AAAAA,UACrC;AAAA,UACAC;AAAAA,UACA,KAAK,MAAM,KAAK;AAAA,UAChB;AAAA,QACJ;AACG,YAAI,QAAQ,UAAU,QAAS,OAAMD;AAAAA,UACpC;AAAA,UACAE;AAAAA,UACA,KAAK,MAAM,KAAK;AAAA,UAChB;AAAA,QACJ;AAAA,MACE,SAAS,OAAO;AACf,cAAM,IAAI;AAAA,MACX;AACA,UAAI;AACF,cAAM,MAAM,SAAS,KAAK,MAAM,MAAM,UAAU,QAAQ,KAAK;AAAA,MAC9D,SAAS,OAAO;AAChB,cAAM,IAAI;AAAA,MACX;AAAA,IACD;AAEA,aAAS,aAAc;AACtB,aAAO,KAAK,EAAE,MAAM,cAAc,OAAO,EAAE,WAAW,MAAM,MAAM,UAAS,EAAC,CAAC;AAAA,IAC9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SignUp.vue.js","sources":["../../../../../../../../src/modules/auth/views/components/pages/SignUp.vue"],"sourcesContent":["<template>\n <section class=\"t-left pd-medium\">\n <h3 class=\"mn-b-small\">{{ t('auth.signUp.title') }}</h3>\n\n <!-- Tab selector -->\n <div\n v-if=\"availableTabs.length > 1\"\n class=\"mn-b-small p-small uppercase fw-semi bg-light radius-small o-hidden\"\n >\n <Tab\n v-model:selected=\"tabAuth\"\n :tabs=\"availableTabs\"\n classTab=\"pd-small pd-r-medium pd-l-medium w-100 pd-small radius-small\"\n />\n </div>\n\n <!-- Form -->\n <div class=\"pos-relative\">\n <!-- Phone -->\n <transition name=\"slide-fade\">\n <div v-show=\"tabAuth === 'phone'\" class=\"mn-b-semi radius-small\">\n <p class=\"mn-b-small t-transp\">{{ t('auth.signUp.smsNotice') }}</p>\n <FieldPhone\n @change=\"(event) => phone = event\"\n :dropdownOptions=\"{\n showDialCodeInSelection: true,\n showFlags: true,\n showDialCodeInList: true\n }\"\n :validation=\"phoneValidation\"\n mode=\"national\"\n :inputOptions=\"{ placeholder: t('auth.signUp.phonePlaceholder') }\"\n class=\"bg-light h-4r pd-small radius-small mn-b-thin\"\n />\n </div>\n </transition>\n <!-- Email -->\n <transition name=\"slide-fade\">\n <div v-show=\"tabAuth === 'email'\" class=\"mn-b-semi radius-small o-hidden\">\n <p class=\"mn-b-small t-transp\">{{ t('auth.signUp.emailNotice') }}</p>\n <Field\n v-model:field=\"email\"\n :placeholder=\"t('auth.signUp.emailPlaceholder')\"\n :validation=\"emailValidation\"\n class=\"bg-light h-4r pd-medium radius-small\"\n />\n </div>\n </transition>\n </div>\n\n <!-- Password fields -->\n <div class=\"mn-b-semi\">\n <Field\n v-model:field=\"password\"\n type=\"password\"\n :placeholder=\"t('auth.enterPassword.passwordPlaceholder')\"\n :validation=\"passwordValidation\"\n class=\"bg-light pd-small radius-small mn-b-thin\"\n />\n <Field\n v-model:field=\"passwordRepeat\"\n type=\"password\"\n :placeholder=\"t('auth.enterPassword.repeatPasswordPlaceholder')\"\n class=\"bg-light pd-small radius-small\"\n />\n </div>\n\n <!-- EULA -->\n <div class=\"p-regular fw-semi mn-b-semi\">\n By registering, you agree to our\n <a class=\"t-grey\" href=\"/legal/eula\" target=\"_blank\" rel=\"noopener noreferrer\">End User License Agreement (EULA)</a>\n </div>\n\n <!-- Button -->\n <Button :submit=\"onSubmit\" class=\"w-100 bg-main mn-b-big\">\n {{ t('auth.enterPassword.registerBtn') }}\n </Button>\n\n <!-- Links -->\n <div class=\"w-100\">\n <router-link\n :to=\"{ name: 'Sign In', query: { returnUrl: route.query.returnUrl } }\"\n class=\"underline mn-b-medium d-block t-blue\"\n >\n {{ t('auth.signUp.haveAccount') }}\n </router-link>\n </div>\n </section>\n</template>\n\n<script setup>\nimport Tab from '@martyrs/src/components/Tab/Tab.vue'\nimport Field from '@martyrs/src/components/Field/Field.vue'\nimport FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'\nimport Button from '@martyrs/src/components/Button/Button.vue'\n\nimport { computed, ref } from 'vue'\nimport { useRoute, useRouter } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\n\nimport { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'\nimport { setError } from '@martyrs/src/modules/core/views/store/core.store.js'\nimport { withOtp } from '@martyrs/src/modules/auth/views/plugins/otp.plugin.js'\nimport $axios from '@martyrs/src/modules/core/views/utils/axios-instance.js'\nimport * as inputsValidation from '@martyrs/src/modules/auth/views/validations/inputs.validation'\n\nconst store = useStore()\nconst core = store.core || { state: {} }\nconst auth = store.auth\n\nconst route = useRoute()\nconst router = useRouter()\nconst { t } = useI18n({ useScope: 'global' })\n\nconst email = ref('')\nconst phone = ref('')\nconst password = ref('')\nconst passwordRepeat = ref('')\n\nconst phoneValidation = ref(null)\nconst emailValidation = ref(null)\nconst passwordValidation = ref(null)\n\nconst availableTabs = computed(() => {\n const tabs = [\n { name: t('auth.signUp.phone'), value: 'phone' },\n { name: t('auth.signUp.email'), value: 'email' }\n ]\n const excludeMethods = core.state?.options?.auth?.authMethodsExclude || []\n return tabs.filter(tab => !excludeMethods.includes(tab.value))\n})\n\nconst tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : '')\n\nasync function onSubmit() {\n // Validate identifier\n if (tabAuth.value === 'phone') {\n await inputsValidation.validateInputs(\n phoneValidation,\n inputsValidation.validatePhone,\n phone.value,\n 'Некорректный телефон'\n )\n }\n if (tabAuth.value === 'email') {\n await inputsValidation.validateInputs(\n emailValidation,\n inputsValidation.validateEmail,\n email.value,\n 'Некорректный email'\n )\n }\n\n // Validate password\n await inputsValidation.validateInputs(\n passwordValidation,\n inputsValidation.validatePassword,\n password.value,\n 'Некорректный пароль'\n )\n\n if (password.value !== passwordRepeat.value) {\n setError({ response: { data: { errorCode: 'PASSWORDS_DO_NOT_MATCH' } } })\n throw new Error('PASSWORDS_DO_NOT_MATCH')\n }\n\n // Signup with OTP verification\n try {\n const result = await withOtp(\n (data) => $axios.post('/api/auth/signup', data),\n {\n email: tabAuth.value === 'email' ? email.value : undefined,\n phone: tabAuth.value === 'phone' ? phone.value : undefined,\n password: password.value,\n type: tabAuth.value,\n inviteCode: route.query.invite\n }\n )\n\n // Success - save token and redirect\n if (result.data?.accessToken) {\n const Cookies = (await import('js-cookie')).default\n Cookies.set('user', JSON.stringify(result.data), { path: '/', expires: 7 })\n await auth.actions.initialize()\n\n if (route.query.returnUrl) {\n router.push({ path: route.query.returnUrl, query: { afterAuth: 'true' } })\n } else {\n router.push({ name: 'User Profile', params: { _id: result.data._id }, query: { afterAuth: 'true' } })\n }\n }\n } catch (error) {\n setError(error)\n throw error\n }\n}\n</script>\n\n<style lang=\"scss\">\n.slide-fade-enter-active,\n.slide-fade-leave-active {\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.slide-fade-enter-from,\n.slide-fade-leave-to {\n position: absolute;\n transform: translateX(20px);\n opacity: 0;\n left: 0;\n top: 0;\n}\n</style>\n"],"names":["inputsValidation.validateInputs","inputsValidation.validatePhone","inputsValidation.validateEmail","inputsValidation.validatePassword"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0GA,UAAM,QAAQ,SAAQ;AACtB,UAAM,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,EAAE;AACtC,UAAM,OAAO,MAAM;AAEnB,UAAM,QAAQ,SAAQ;AACtB,UAAM,SAAS,UAAS;AACxB,UAAM,EAAE,EAAC,IAAK,QAAQ,EAAE,UAAU,SAAQ,CAAE;AAE5C,UAAM,QAAQ,IAAI,EAAE;AACpB,UAAM,QAAQ,IAAI,EAAE;AACpB,UAAM,WAAW,IAAI,EAAE;AACvB,UAAM,iBAAiB,IAAI,EAAE;AAE7B,UAAM,kBAAkB,IAAI,IAAI;AAChC,UAAM,kBAAkB,IAAI,IAAI;AAChC,UAAM,qBAAqB,IAAI,IAAI;AAEnC,UAAM,gBAAgB,SAAS,MAAM;AACnC,YAAM,OAAO;AAAA,QACX,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,QAAO;AAAA,QAC9C,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,QAAO;AAAA,MAClD;AACE,YAAM,iBAAiB,KAAK,OAAO,SAAS,MAAM,sBAAsB,CAAA;AACxE,aAAO,KAAK,OAAO,SAAO,CAAC,eAAe,SAAS,IAAI,KAAK,CAAC;AAAA,IAC/D,CAAC;AAED,UAAM,UAAU,IAAI,cAAc,MAAM,SAAS,cAAc,MAAM,CAAC,EAAE,QAAQ,EAAE;AAElF,mBAAe,WAAW;AAExB,UAAI,QAAQ,UAAU,SAAS;AAC7B,cAAMA;AAAAA,UACJ;AAAA,UACAC;AAAAA,UACA,MAAM;AAAA,UACN;AAAA,QACN;AAAA,MACE;AACA,UAAI,QAAQ,UAAU,SAAS;AAC7B,cAAMD;AAAAA,UACJ;AAAA,UACAE;AAAAA,UACA,MAAM;AAAA,UACN;AAAA,QACN;AAAA,MACE;AAGA,YAAMF;AAAAA,QACJ;AAAA,QACAG;AAAAA,QACA,SAAS;AAAA,QACT;AAAA,MACJ;AAEE,UAAI,SAAS,UAAU,eAAe,OAAO;AAC3C,iBAAS,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,yBAAwB,IAAI,CAAE;AACxE,cAAM,IAAI,MAAM,wBAAwB;AAAA,MAC1C;AAGA,UAAI;AACF,cAAM,SAAS,MAAM;AAAA,UACnB,CAAC,SAAS,OAAO,KAAK,oBAAoB,IAAI;AAAA,UAC9C;AAAA,YACE,OAAO,QAAQ,UAAU,UAAU,MAAM,QAAQ;AAAA,YACjD,OAAO,QAAQ,UAAU,UAAU,MAAM,QAAQ;AAAA,YACjD,UAAU,SAAS;AAAA,YACnB,MAAM,QAAQ;AAAA,YACd,YAAY,MAAM,MAAM;AAAA,UAChC;AAAA,QACA;AAGI,YAAI,OAAO,MAAM,aAAa;AAC5B,gBAAM,WAAW,MAAM,OAAO,kGAAW,GAAG;AAC5C,kBAAQ,IAAI,QAAQ,KAAK,UAAU,OAAO,IAAI,GAAG,EAAE,MAAM,KAAK,SAAS,EAAC,CAAE;AAC1E,gBAAM,KAAK,QAAQ,WAAU;AAE7B,cAAI,MAAM,MAAM,WAAW;AACzB,mBAAO,KAAK,EAAE,MAAM,MAAM,MAAM,WAAW,OAAO,EAAE,WAAW,SAAQ,CAAE;AAAA,UAC3E,OAAO;AACL,mBAAO,KAAK,EAAE,MAAM,gBAAgB,QAAQ,EAAE,KAAK,OAAO,KAAK,IAAG,GAAI,OAAO,EAAE,WAAW,OAAM,EAAE,CAAE;AAAA,UACtG;AAAA,QACF;AAAA,MACF,SAAS,OAAO;AACd,iBAAS,KAAK;AACd,cAAM;AAAA,MACR;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}