@oxyhq/services 5.17.17 → 5.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (618) hide show
  1. package/README.md +32 -38
  2. package/lib/commonjs/core/CrossDomainAuth.js +277 -0
  3. package/lib/commonjs/core/CrossDomainAuth.js.map +1 -0
  4. package/lib/commonjs/core/HttpService.js +82 -15
  5. package/lib/commonjs/core/HttpService.js.map +1 -1
  6. package/lib/commonjs/core/OxyServices.base.js +11 -3
  7. package/lib/commonjs/core/OxyServices.base.js.map +1 -1
  8. package/lib/commonjs/core/OxyServices.js +4 -1
  9. package/lib/commonjs/core/OxyServices.js.map +1 -1
  10. package/lib/commonjs/core/index.js +30 -0
  11. package/lib/commonjs/core/index.js.map +1 -1
  12. package/lib/commonjs/core/mixins/OxyServices.assets.js +16 -3
  13. package/lib/commonjs/core/mixins/OxyServices.assets.js.map +1 -1
  14. package/lib/commonjs/core/mixins/OxyServices.auth.js +73 -32
  15. package/lib/commonjs/core/mixins/OxyServices.auth.js.map +1 -1
  16. package/lib/commonjs/core/mixins/OxyServices.features.js +372 -0
  17. package/lib/commonjs/core/mixins/OxyServices.features.js.map +1 -0
  18. package/lib/commonjs/core/mixins/OxyServices.fedcm.js +289 -0
  19. package/lib/commonjs/core/mixins/OxyServices.fedcm.js.map +1 -0
  20. package/lib/commonjs/core/mixins/OxyServices.popup.js +352 -0
  21. package/lib/commonjs/core/mixins/OxyServices.popup.js.map +1 -0
  22. package/lib/commonjs/core/mixins/OxyServices.redirect.js +378 -0
  23. package/lib/commonjs/core/mixins/OxyServices.redirect.js.map +1 -0
  24. package/lib/commonjs/core/mixins/OxyServices.user.js +35 -24
  25. package/lib/commonjs/core/mixins/OxyServices.user.js.map +1 -1
  26. package/lib/commonjs/core/mixins/index.js +28 -15
  27. package/lib/commonjs/core/mixins/index.js.map +1 -1
  28. package/lib/commonjs/crypto/index.js +30 -0
  29. package/lib/commonjs/crypto/index.js.map +1 -1
  30. package/lib/commonjs/crypto/keyManager.js +902 -0
  31. package/lib/commonjs/crypto/keyManager.js.map +1 -0
  32. package/lib/commonjs/crypto/polyfill.js +14 -5
  33. package/lib/commonjs/crypto/polyfill.js.map +1 -1
  34. package/lib/commonjs/crypto/recoveryPhrase.js +152 -0
  35. package/lib/commonjs/crypto/recoveryPhrase.js.map +1 -0
  36. package/lib/commonjs/crypto/signatureService.js +289 -0
  37. package/lib/commonjs/crypto/signatureService.js.map +1 -0
  38. package/lib/commonjs/i18n/locales/en-US.json +1 -1
  39. package/lib/commonjs/index.js +40 -26
  40. package/lib/commonjs/index.js.map +1 -1
  41. package/lib/commonjs/models/interfaces.js +0 -15
  42. package/lib/commonjs/models/interfaces.js.map +1 -1
  43. package/lib/commonjs/ui/components/BottomSheetRouter.js +9 -1
  44. package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -1
  45. package/lib/commonjs/ui/components/GroupedItem.js +11 -1
  46. package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
  47. package/lib/commonjs/ui/components/Icon.js.map +1 -1
  48. package/lib/commonjs/ui/components/IconButton/utils.js.map +1 -1
  49. package/lib/commonjs/ui/components/OxyProvider.js +41 -11
  50. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  51. package/lib/commonjs/ui/components/SettingRow.js +17 -4
  52. package/lib/commonjs/ui/components/SettingRow.js.map +1 -1
  53. package/lib/commonjs/ui/components/TextField/Adornment/utils.js.map +1 -1
  54. package/lib/commonjs/ui/components/TextField/helpers.js.map +1 -1
  55. package/lib/commonjs/ui/components/TouchableRipple/utils.js.map +1 -1
  56. package/lib/commonjs/ui/components/Typography/AnimatedText.js.map +1 -1
  57. package/lib/commonjs/ui/components/feedback/FormInput.js +72 -0
  58. package/lib/commonjs/ui/components/feedback/FormInput.js.map +1 -0
  59. package/lib/commonjs/ui/components/feedback/ProgressIndicator.js +33 -0
  60. package/lib/commonjs/ui/components/feedback/ProgressIndicator.js.map +1 -0
  61. package/lib/commonjs/ui/components/feedback/constants.js +59 -0
  62. package/lib/commonjs/ui/components/feedback/constants.js.map +1 -0
  63. package/lib/commonjs/ui/components/feedback/feedbackStyles.js +262 -0
  64. package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +1 -0
  65. package/lib/commonjs/ui/components/feedback/index.js +54 -0
  66. package/lib/commonjs/ui/components/feedback/index.js.map +1 -0
  67. package/lib/commonjs/ui/components/feedback/types.js +6 -0
  68. package/lib/commonjs/ui/components/feedback/types.js.map +1 -0
  69. package/lib/commonjs/ui/components/feedback/useFeedbackForm.js +52 -0
  70. package/lib/commonjs/ui/components/feedback/useFeedbackForm.js.map +1 -0
  71. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +282 -0
  72. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -0
  73. package/lib/commonjs/ui/components/modals/index.js +14 -0
  74. package/lib/commonjs/ui/components/modals/index.js.map +1 -0
  75. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +309 -0
  76. package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -0
  77. package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +79 -0
  78. package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -0
  79. package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +108 -0
  80. package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -0
  81. package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +79 -0
  82. package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -0
  83. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +176 -0
  84. package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -0
  85. package/lib/commonjs/ui/components/payment/constants.js +53 -0
  86. package/lib/commonjs/ui/components/payment/constants.js.map +1 -0
  87. package/lib/commonjs/ui/components/payment/index.js +80 -0
  88. package/lib/commonjs/ui/components/payment/index.js.map +1 -0
  89. package/lib/commonjs/ui/components/payment/paymentStyles.js +409 -0
  90. package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -0
  91. package/lib/commonjs/ui/components/payment/types.js +6 -0
  92. package/lib/commonjs/ui/components/payment/types.js.map +1 -0
  93. package/lib/commonjs/ui/context/OxyContext.js +110 -199
  94. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  95. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +150 -19
  96. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  97. package/lib/commonjs/ui/context/hooks/useSessionManagement.js +279 -0
  98. package/lib/commonjs/ui/context/hooks/useSessionManagement.js.map +1 -0
  99. package/lib/commonjs/ui/hooks/index.js +26 -0
  100. package/lib/commonjs/ui/hooks/index.js.map +1 -1
  101. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js +79 -72
  102. package/lib/commonjs/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  103. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js +38 -51
  104. package/lib/commonjs/ui/hooks/queries/useAccountQueries.js.map +1 -1
  105. package/lib/commonjs/ui/hooks/queries/useSecurityQueries.js +3 -3
  106. package/lib/commonjs/ui/hooks/queries/useSecurityQueries.js.map +1 -1
  107. package/lib/commonjs/ui/hooks/queries/useServicesQueries.js +18 -12
  108. package/lib/commonjs/ui/hooks/queries/useServicesQueries.js.map +1 -1
  109. package/lib/commonjs/ui/hooks/useAsyncAction.js +95 -0
  110. package/lib/commonjs/ui/hooks/useAsyncAction.js.map +1 -0
  111. package/lib/commonjs/ui/hooks/useProfileEditing.js +3 -5
  112. package/lib/commonjs/ui/hooks/useProfileEditing.js.map +1 -1
  113. package/lib/commonjs/ui/hooks/useSessionManagement.js +4 -8
  114. package/lib/commonjs/ui/hooks/useSessionManagement.js.map +1 -1
  115. package/lib/commonjs/ui/hooks/useSessionSocket.js +162 -315
  116. package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -1
  117. package/lib/commonjs/ui/hooks/useSettingToggle.js +126 -0
  118. package/lib/commonjs/ui/hooks/useSettingToggle.js.map +1 -0
  119. package/lib/commonjs/ui/hooks/useStorage.js +24 -58
  120. package/lib/commonjs/ui/hooks/useStorage.js.map +1 -1
  121. package/lib/commonjs/ui/index.js +50 -21
  122. package/lib/commonjs/ui/index.js.map +1 -1
  123. package/lib/commonjs/ui/navigation/routes.js +6 -1
  124. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  125. package/lib/commonjs/ui/screens/AccountCenterScreen.js +6 -4
  126. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  127. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +33 -30
  128. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  129. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +29 -24
  130. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  131. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +3 -3
  132. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  133. package/lib/commonjs/ui/screens/FAQScreen.js +315 -0
  134. package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -0
  135. package/lib/commonjs/ui/screens/FeedbackScreen.js +73 -590
  136. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  137. package/lib/commonjs/ui/screens/HelpSupportScreen.js +8 -7
  138. package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
  139. package/lib/commonjs/ui/screens/OxyAuthScreen.js +134 -66
  140. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  141. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +67 -1395
  142. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
  143. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js +6 -13
  144. package/lib/commonjs/ui/screens/PrivacySettingsScreen.js.map +1 -1
  145. package/lib/commonjs/ui/screens/ProfileScreen.js +13 -5
  146. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  147. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +16 -10
  148. package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
  149. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +23 -11
  150. package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  151. package/lib/commonjs/ui/stores/accountStore.js +2 -4
  152. package/lib/commonjs/ui/stores/accountStore.js.map +1 -1
  153. package/lib/commonjs/ui/stores/authStore.js +45 -32
  154. package/lib/commonjs/ui/stores/authStore.js.map +1 -1
  155. package/lib/commonjs/ui/styles/spacing.js +54 -2
  156. package/lib/commonjs/ui/styles/spacing.js.map +1 -1
  157. package/lib/commonjs/ui/utils/avatarUtils.js +37 -41
  158. package/lib/commonjs/ui/utils/avatarUtils.js.map +1 -1
  159. package/lib/commonjs/ui/utils/storageHelpers.js.map +1 -1
  160. package/lib/commonjs/utils/errorUtils.js +13 -0
  161. package/lib/commonjs/utils/errorUtils.js.map +1 -1
  162. package/lib/commonjs/utils/validationUtils.js +15 -1
  163. package/lib/commonjs/utils/validationUtils.js.map +1 -1
  164. package/lib/module/core/CrossDomainAuth.js +271 -0
  165. package/lib/module/core/CrossDomainAuth.js.map +1 -0
  166. package/lib/module/core/HttpService.js +82 -15
  167. package/lib/module/core/HttpService.js.map +1 -1
  168. package/lib/module/core/OxyServices.base.js +11 -4
  169. package/lib/module/core/OxyServices.base.js.map +1 -1
  170. package/lib/module/core/OxyServices.js +4 -1
  171. package/lib/module/core/OxyServices.js.map +1 -1
  172. package/lib/module/core/index.js +6 -1
  173. package/lib/module/core/index.js.map +1 -1
  174. package/lib/module/core/mixins/OxyServices.assets.js +16 -3
  175. package/lib/module/core/mixins/OxyServices.assets.js.map +1 -1
  176. package/lib/module/core/mixins/OxyServices.auth.js +73 -32
  177. package/lib/module/core/mixins/OxyServices.auth.js.map +1 -1
  178. package/lib/module/core/mixins/OxyServices.features.js +369 -0
  179. package/lib/module/core/mixins/OxyServices.features.js.map +1 -0
  180. package/lib/module/core/mixins/OxyServices.fedcm.js +286 -0
  181. package/lib/module/core/mixins/OxyServices.fedcm.js.map +1 -0
  182. package/lib/module/core/mixins/OxyServices.popup.js +349 -0
  183. package/lib/module/core/mixins/OxyServices.popup.js.map +1 -0
  184. package/lib/module/core/mixins/OxyServices.redirect.js +375 -0
  185. package/lib/module/core/mixins/OxyServices.redirect.js.map +1 -0
  186. package/lib/module/core/mixins/OxyServices.user.js +35 -24
  187. package/lib/module/core/mixins/OxyServices.user.js.map +1 -1
  188. package/lib/module/core/mixins/index.js +16 -3
  189. package/lib/module/core/mixins/index.js.map +1 -1
  190. package/lib/module/crypto/index.js +8 -4
  191. package/lib/module/crypto/index.js.map +1 -1
  192. package/lib/module/crypto/keyManager.js +899 -0
  193. package/lib/module/crypto/keyManager.js.map +1 -0
  194. package/lib/module/crypto/polyfill.js +6 -5
  195. package/lib/module/crypto/polyfill.js.map +1 -1
  196. package/lib/module/crypto/recoveryPhrase.js +147 -0
  197. package/lib/module/crypto/recoveryPhrase.js.map +1 -0
  198. package/lib/module/crypto/signatureService.js +286 -0
  199. package/lib/module/crypto/signatureService.js.map +1 -0
  200. package/lib/module/i18n/locales/en-US.json +1 -1
  201. package/lib/module/index.js +6 -9
  202. package/lib/module/index.js.map +1 -1
  203. package/lib/module/models/interfaces.js +0 -15
  204. package/lib/module/models/interfaces.js.map +1 -1
  205. package/lib/module/ui/components/BottomSheetRouter.js +6 -2
  206. package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
  207. package/lib/module/ui/components/GroupedItem.js +11 -1
  208. package/lib/module/ui/components/GroupedItem.js.map +1 -1
  209. package/lib/module/ui/components/Icon.js.map +1 -1
  210. package/lib/module/ui/components/IconButton/utils.js.map +1 -1
  211. package/lib/module/ui/components/OxyProvider.js +41 -11
  212. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  213. package/lib/module/ui/components/SettingRow.js +17 -4
  214. package/lib/module/ui/components/SettingRow.js.map +1 -1
  215. package/lib/module/ui/components/TextField/Adornment/utils.js.map +1 -1
  216. package/lib/module/ui/components/TextField/helpers.js.map +1 -1
  217. package/lib/module/ui/components/TouchableRipple/utils.js.map +1 -1
  218. package/lib/module/ui/components/Typography/AnimatedText.js.map +1 -1
  219. package/lib/module/ui/components/feedback/FormInput.js +67 -0
  220. package/lib/module/ui/components/feedback/FormInput.js.map +1 -0
  221. package/lib/module/ui/components/feedback/ProgressIndicator.js +28 -0
  222. package/lib/module/ui/components/feedback/ProgressIndicator.js.map +1 -0
  223. package/lib/module/ui/components/feedback/constants.js +55 -0
  224. package/lib/module/ui/components/feedback/constants.js.map +1 -0
  225. package/lib/module/ui/components/feedback/feedbackStyles.js +257 -0
  226. package/lib/module/ui/components/feedback/feedbackStyles.js.map +1 -0
  227. package/lib/module/ui/components/feedback/index.js +8 -0
  228. package/lib/module/ui/components/feedback/index.js.map +1 -0
  229. package/lib/module/ui/components/feedback/types.js +4 -0
  230. package/lib/module/ui/components/feedback/types.js.map +1 -0
  231. package/lib/module/ui/components/feedback/useFeedbackForm.js +47 -0
  232. package/lib/module/ui/components/feedback/useFeedbackForm.js.map +1 -0
  233. package/lib/module/ui/components/modals/DeleteAccountModal.js +276 -0
  234. package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -0
  235. package/lib/module/ui/components/modals/index.js +4 -0
  236. package/lib/module/ui/components/modals/index.js.map +1 -0
  237. package/lib/module/ui/components/payment/PaymentDetailsStep.js +303 -0
  238. package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -0
  239. package/lib/module/ui/components/payment/PaymentMethodStep.js +73 -0
  240. package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -0
  241. package/lib/module/ui/components/payment/PaymentReviewStep.js +102 -0
  242. package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -0
  243. package/lib/module/ui/components/payment/PaymentSuccessStep.js +73 -0
  244. package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -0
  245. package/lib/module/ui/components/payment/PaymentSummaryStep.js +170 -0
  246. package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -0
  247. package/lib/module/ui/components/payment/constants.js +47 -0
  248. package/lib/module/ui/components/payment/constants.js.map +1 -0
  249. package/lib/module/ui/components/payment/index.js +10 -0
  250. package/lib/module/ui/components/payment/index.js.map +1 -0
  251. package/lib/module/ui/components/payment/paymentStyles.js +404 -0
  252. package/lib/module/ui/components/payment/paymentStyles.js.map +1 -0
  253. package/lib/module/ui/components/payment/types.js +4 -0
  254. package/lib/module/ui/components/payment/types.js.map +1 -0
  255. package/lib/module/ui/context/OxyContext.js +112 -191
  256. package/lib/module/ui/context/OxyContext.js.map +1 -1
  257. package/lib/module/ui/context/hooks/useAuthOperations.js +150 -19
  258. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  259. package/lib/module/ui/context/hooks/useSessionManagement.js +274 -0
  260. package/lib/module/ui/context/hooks/useSessionManagement.js.map +1 -0
  261. package/lib/module/ui/hooks/index.js +2 -0
  262. package/lib/module/ui/hooks/index.js.map +1 -1
  263. package/lib/module/ui/hooks/mutations/useAccountMutations.js +80 -72
  264. package/lib/module/ui/hooks/mutations/useAccountMutations.js.map +1 -1
  265. package/lib/module/ui/hooks/queries/useAccountQueries.js +31 -44
  266. package/lib/module/ui/hooks/queries/useAccountQueries.js.map +1 -1
  267. package/lib/module/ui/hooks/queries/useSecurityQueries.js +1 -1
  268. package/lib/module/ui/hooks/queries/useSecurityQueries.js.map +1 -1
  269. package/lib/module/ui/hooks/queries/useServicesQueries.js +13 -7
  270. package/lib/module/ui/hooks/queries/useServicesQueries.js.map +1 -1
  271. package/lib/module/ui/hooks/useAsyncAction.js +89 -0
  272. package/lib/module/ui/hooks/useAsyncAction.js.map +1 -0
  273. package/lib/module/ui/hooks/useProfileEditing.js +3 -5
  274. package/lib/module/ui/hooks/useProfileEditing.js.map +1 -1
  275. package/lib/module/ui/hooks/useSessionManagement.js +4 -8
  276. package/lib/module/ui/hooks/useSessionManagement.js.map +1 -1
  277. package/lib/module/ui/hooks/useSessionSocket.js +162 -315
  278. package/lib/module/ui/hooks/useSessionSocket.js.map +1 -1
  279. package/lib/module/ui/hooks/useSettingToggle.js +120 -0
  280. package/lib/module/ui/hooks/useSettingToggle.js.map +1 -0
  281. package/lib/module/ui/hooks/useStorage.js +25 -59
  282. package/lib/module/ui/hooks/useStorage.js.map +1 -1
  283. package/lib/module/ui/index.js +15 -10
  284. package/lib/module/ui/index.js.map +1 -1
  285. package/lib/module/ui/navigation/routes.js +6 -1
  286. package/lib/module/ui/navigation/routes.js.map +1 -1
  287. package/lib/module/ui/screens/AccountCenterScreen.js +6 -4
  288. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  289. package/lib/module/ui/screens/AccountOverviewScreen.js +33 -30
  290. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  291. package/lib/module/ui/screens/AccountSettingsScreen.js +29 -24
  292. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  293. package/lib/module/ui/screens/AccountSwitcherScreen.js +3 -3
  294. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  295. package/lib/module/ui/screens/FAQScreen.js +310 -0
  296. package/lib/module/ui/screens/FAQScreen.js.map +1 -0
  297. package/lib/module/ui/screens/FeedbackScreen.js +64 -581
  298. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  299. package/lib/module/ui/screens/HelpSupportScreen.js +8 -7
  300. package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
  301. package/lib/module/ui/screens/OxyAuthScreen.js +135 -68
  302. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  303. package/lib/module/ui/screens/PaymentGatewayScreen.js +67 -1397
  304. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
  305. package/lib/module/ui/screens/PrivacySettingsScreen.js +6 -13
  306. package/lib/module/ui/screens/PrivacySettingsScreen.js.map +1 -1
  307. package/lib/module/ui/screens/ProfileScreen.js +13 -5
  308. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  309. package/lib/module/ui/screens/SavesCollectionsScreen.js +16 -10
  310. package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
  311. package/lib/module/ui/screens/karma/KarmaCenterScreen.js +23 -11
  312. package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
  313. package/lib/module/ui/stores/accountStore.js +2 -4
  314. package/lib/module/ui/stores/accountStore.js.map +1 -1
  315. package/lib/module/ui/stores/authStore.js +45 -32
  316. package/lib/module/ui/stores/authStore.js.map +1 -1
  317. package/lib/module/ui/styles/spacing.js +6 -2
  318. package/lib/module/ui/styles/spacing.js.map +1 -1
  319. package/lib/module/ui/utils/avatarUtils.js +37 -40
  320. package/lib/module/ui/utils/avatarUtils.js.map +1 -1
  321. package/lib/module/ui/utils/storageHelpers.js.map +1 -1
  322. package/lib/module/utils/errorUtils.js +7 -0
  323. package/lib/module/utils/errorUtils.js.map +1 -1
  324. package/lib/module/utils/validationUtils.js +13 -0
  325. package/lib/module/utils/validationUtils.js.map +1 -1
  326. package/lib/typescript/core/CrossDomainAuth.d.ts +161 -0
  327. package/lib/typescript/core/CrossDomainAuth.d.ts.map +1 -0
  328. package/lib/typescript/core/HttpService.d.ts +1 -1
  329. package/lib/typescript/core/HttpService.d.ts.map +1 -1
  330. package/lib/typescript/core/OxyServices.base.d.ts +0 -6
  331. package/lib/typescript/core/OxyServices.base.d.ts.map +1 -1
  332. package/lib/typescript/core/OxyServices.d.ts +5 -36
  333. package/lib/typescript/core/OxyServices.d.ts.map +1 -1
  334. package/lib/typescript/core/index.d.ts +4 -0
  335. package/lib/typescript/core/index.d.ts.map +1 -1
  336. package/lib/typescript/core/mixins/OxyServices.analytics.d.ts.map +1 -1
  337. package/lib/typescript/core/mixins/OxyServices.assets.d.ts.map +1 -1
  338. package/lib/typescript/core/mixins/OxyServices.auth.d.ts +40 -20
  339. package/lib/typescript/core/mixins/OxyServices.auth.d.ts.map +1 -1
  340. package/lib/typescript/core/mixins/OxyServices.developer.d.ts.map +1 -1
  341. package/lib/typescript/core/mixins/OxyServices.devices.d.ts.map +1 -1
  342. package/lib/typescript/core/mixins/OxyServices.features.d.ts +229 -0
  343. package/lib/typescript/core/mixins/OxyServices.features.d.ts.map +1 -0
  344. package/lib/typescript/core/mixins/OxyServices.fedcm.d.ts +195 -0
  345. package/lib/typescript/core/mixins/OxyServices.fedcm.d.ts.map +1 -0
  346. package/lib/typescript/core/mixins/OxyServices.karma.d.ts.map +1 -1
  347. package/lib/typescript/core/mixins/OxyServices.language.d.ts.map +1 -1
  348. package/lib/typescript/core/mixins/OxyServices.location.d.ts.map +1 -1
  349. package/lib/typescript/core/mixins/OxyServices.payment.d.ts.map +1 -1
  350. package/lib/typescript/core/mixins/OxyServices.popup.d.ts +206 -0
  351. package/lib/typescript/core/mixins/OxyServices.popup.d.ts.map +1 -0
  352. package/lib/typescript/core/mixins/OxyServices.privacy.d.ts.map +1 -1
  353. package/lib/typescript/core/mixins/OxyServices.redirect.d.ts +246 -0
  354. package/lib/typescript/core/mixins/OxyServices.redirect.d.ts.map +1 -0
  355. package/lib/typescript/core/mixins/OxyServices.security.d.ts.map +1 -1
  356. package/lib/typescript/core/mixins/OxyServices.user.d.ts +6 -4
  357. package/lib/typescript/core/mixins/OxyServices.user.d.ts.map +1 -1
  358. package/lib/typescript/core/mixins/OxyServices.utility.d.ts.map +1 -1
  359. package/lib/typescript/core/mixins/index.d.ts +291 -9
  360. package/lib/typescript/core/mixins/index.d.ts.map +1 -1
  361. package/lib/typescript/crypto/index.d.ts +6 -3
  362. package/lib/typescript/crypto/index.d.ts.map +1 -1
  363. package/lib/typescript/crypto/keyManager.d.ts +190 -0
  364. package/lib/typescript/crypto/keyManager.d.ts.map +1 -0
  365. package/lib/typescript/crypto/polyfill.d.ts +4 -3
  366. package/lib/typescript/crypto/polyfill.d.ts.map +1 -1
  367. package/lib/typescript/crypto/recoveryPhrase.d.ts +59 -0
  368. package/lib/typescript/crypto/recoveryPhrase.d.ts.map +1 -0
  369. package/lib/typescript/crypto/signatureService.d.ts +87 -0
  370. package/lib/typescript/crypto/signatureService.d.ts.map +1 -0
  371. package/lib/typescript/index.d.ts +5 -6
  372. package/lib/typescript/index.d.ts.map +1 -1
  373. package/lib/typescript/models/interfaces.d.ts +2 -14
  374. package/lib/typescript/models/interfaces.d.ts.map +1 -1
  375. package/lib/typescript/models/session.d.ts +0 -9
  376. package/lib/typescript/models/session.d.ts.map +1 -1
  377. package/lib/typescript/types/bip39.d.ts +32 -0
  378. package/lib/typescript/ui/components/BottomSheetRouter.d.ts +5 -0
  379. package/lib/typescript/ui/components/BottomSheetRouter.d.ts.map +1 -1
  380. package/lib/typescript/ui/components/GroupedItem.d.ts +5 -1
  381. package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
  382. package/lib/typescript/ui/components/IconButton/utils.d.ts +1 -1
  383. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  384. package/lib/typescript/ui/components/SettingRow.d.ts +6 -0
  385. package/lib/typescript/ui/components/SettingRow.d.ts.map +1 -1
  386. package/lib/typescript/ui/components/TextField/Addons/Outline.d.ts +2 -2
  387. package/lib/typescript/ui/components/TextField/Adornment/utils.d.ts +1 -1
  388. package/lib/typescript/ui/components/TextField/Adornment/utils.d.ts.map +1 -1
  389. package/lib/typescript/ui/components/TextField/helpers.d.ts +8 -8
  390. package/lib/typescript/ui/components/TextField/types.d.ts +1 -0
  391. package/lib/typescript/ui/components/TextField/types.d.ts.map +1 -1
  392. package/lib/typescript/ui/components/feedback/FormInput.d.ts +20 -0
  393. package/lib/typescript/ui/components/feedback/FormInput.d.ts.map +1 -0
  394. package/lib/typescript/ui/components/feedback/ProgressIndicator.d.ts +11 -0
  395. package/lib/typescript/ui/components/feedback/ProgressIndicator.d.ts.map +1 -0
  396. package/lib/typescript/ui/components/feedback/constants.d.ts +5 -0
  397. package/lib/typescript/ui/components/feedback/constants.d.ts.map +1 -0
  398. package/lib/typescript/ui/components/feedback/feedbackStyles.d.ts +280 -0
  399. package/lib/typescript/ui/components/feedback/feedbackStyles.d.ts.map +1 -0
  400. package/lib/typescript/ui/components/feedback/index.d.ts +7 -0
  401. package/lib/typescript/ui/components/feedback/index.d.ts.map +1 -0
  402. package/lib/typescript/ui/components/feedback/types.d.ts +46 -0
  403. package/lib/typescript/ui/components/feedback/types.d.ts.map +1 -0
  404. package/lib/typescript/ui/components/feedback/useFeedbackForm.d.ts +9 -0
  405. package/lib/typescript/ui/components/feedback/useFeedbackForm.d.ts.map +1 -0
  406. package/lib/typescript/ui/components/modals/DeleteAccountModal.d.ts +19 -0
  407. package/lib/typescript/ui/components/modals/DeleteAccountModal.d.ts.map +1 -0
  408. package/lib/typescript/ui/components/modals/index.d.ts +2 -0
  409. package/lib/typescript/ui/components/modals/index.d.ts.map +1 -0
  410. package/lib/typescript/ui/components/payment/PaymentDetailsStep.d.ts +21 -0
  411. package/lib/typescript/ui/components/payment/PaymentDetailsStep.d.ts.map +1 -0
  412. package/lib/typescript/ui/components/payment/PaymentMethodStep.d.ts +14 -0
  413. package/lib/typescript/ui/components/payment/PaymentMethodStep.d.ts.map +1 -0
  414. package/lib/typescript/ui/components/payment/PaymentReviewStep.d.ts +16 -0
  415. package/lib/typescript/ui/components/payment/PaymentReviewStep.d.ts.map +1 -0
  416. package/lib/typescript/ui/components/payment/PaymentSuccessStep.d.ts +10 -0
  417. package/lib/typescript/ui/components/payment/PaymentSuccessStep.d.ts.map +1 -0
  418. package/lib/typescript/ui/components/payment/PaymentSummaryStep.d.ts +15 -0
  419. package/lib/typescript/ui/components/payment/PaymentSummaryStep.d.ts.map +1 -0
  420. package/lib/typescript/ui/components/payment/constants.d.ts +7 -0
  421. package/lib/typescript/ui/components/payment/constants.d.ts.map +1 -0
  422. package/lib/typescript/ui/components/payment/index.d.ts +9 -0
  423. package/lib/typescript/ui/components/payment/index.d.ts.map +1 -0
  424. package/lib/typescript/ui/components/payment/paymentStyles.d.ts +396 -0
  425. package/lib/typescript/ui/components/payment/paymentStyles.d.ts.map +1 -0
  426. package/lib/typescript/ui/components/payment/types.d.ts +40 -0
  427. package/lib/typescript/ui/components/payment/types.d.ts.map +1 -0
  428. package/lib/typescript/ui/components/types.d.ts +4 -0
  429. package/lib/typescript/ui/components/types.d.ts.map +1 -1
  430. package/lib/typescript/ui/context/OxyContext.d.ts +57 -3
  431. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  432. package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts +10 -3
  433. package/lib/typescript/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  434. package/lib/typescript/ui/context/hooks/useSessionManagement.d.ts +41 -0
  435. package/lib/typescript/ui/context/hooks/useSessionManagement.d.ts.map +1 -0
  436. package/lib/typescript/ui/hooks/index.d.ts +2 -0
  437. package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
  438. package/lib/typescript/ui/hooks/mutations/useAccountMutations.d.ts.map +1 -1
  439. package/lib/typescript/ui/hooks/queries/useAccountQueries.d.ts.map +1 -1
  440. package/lib/typescript/ui/hooks/queries/useServicesQueries.d.ts.map +1 -1
  441. package/lib/typescript/ui/hooks/useAsyncAction.d.ts +51 -0
  442. package/lib/typescript/ui/hooks/useAsyncAction.d.ts.map +1 -0
  443. package/lib/typescript/ui/hooks/useProfileEditing.d.ts.map +1 -1
  444. package/lib/typescript/ui/hooks/useSessionManagement.d.ts.map +1 -1
  445. package/lib/typescript/ui/hooks/useSessionSocket.d.ts +1 -2
  446. package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -1
  447. package/lib/typescript/ui/hooks/useSettingToggle.d.ts +55 -0
  448. package/lib/typescript/ui/hooks/useSettingToggle.d.ts.map +1 -0
  449. package/lib/typescript/ui/hooks/useStorage.d.ts +3 -9
  450. package/lib/typescript/ui/hooks/useStorage.d.ts.map +1 -1
  451. package/lib/typescript/ui/index.d.ts +6 -2
  452. package/lib/typescript/ui/index.d.ts.map +1 -1
  453. package/lib/typescript/ui/navigation/routes.d.ts +1 -1
  454. package/lib/typescript/ui/navigation/routes.d.ts.map +1 -1
  455. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  456. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  457. package/lib/typescript/ui/screens/FAQScreen.d.ts +5 -0
  458. package/lib/typescript/ui/screens/FAQScreen.d.ts.map +1 -0
  459. package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
  460. package/lib/typescript/ui/screens/HelpSupportScreen.d.ts.map +1 -1
  461. package/lib/typescript/ui/screens/OxyAuthScreen.d.ts +1 -1
  462. package/lib/typescript/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  463. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +3 -15
  464. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
  465. package/lib/typescript/ui/screens/PrivacySettingsScreen.d.ts.map +1 -1
  466. package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
  467. package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
  468. package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
  469. package/lib/typescript/ui/stores/accountStore.d.ts.map +1 -1
  470. package/lib/typescript/ui/stores/authStore.d.ts +8 -7
  471. package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
  472. package/lib/typescript/ui/styles/spacing.d.ts +5 -0
  473. package/lib/typescript/ui/styles/spacing.d.ts.map +1 -1
  474. package/lib/typescript/ui/types/navigation.d.ts +2 -1
  475. package/lib/typescript/ui/types/navigation.d.ts.map +1 -1
  476. package/lib/typescript/ui/utils/avatarUtils.d.ts +2 -13
  477. package/lib/typescript/ui/utils/avatarUtils.d.ts.map +1 -1
  478. package/lib/typescript/ui/utils/storageHelpers.d.ts +0 -3
  479. package/lib/typescript/ui/utils/storageHelpers.d.ts.map +1 -1
  480. package/lib/typescript/utils/errorUtils.d.ts +6 -0
  481. package/lib/typescript/utils/errorUtils.d.ts.map +1 -1
  482. package/lib/typescript/utils/validationUtils.d.ts +8 -0
  483. package/lib/typescript/utils/validationUtils.d.ts.map +1 -1
  484. package/package.json +8 -7
  485. package/src/core/CrossDomainAuth.ts +307 -0
  486. package/src/core/HttpService.ts +99 -16
  487. package/src/core/OxyServices.base.ts +20 -3
  488. package/src/core/OxyServices.ts +7 -3
  489. package/src/core/index.ts +9 -1
  490. package/src/core/mixins/OxyServices.assets.ts +14 -3
  491. package/src/core/mixins/OxyServices.auth.ts +105 -36
  492. package/src/core/mixins/OxyServices.features.ts +428 -0
  493. package/src/core/mixins/OxyServices.fedcm.ts +315 -0
  494. package/src/core/mixins/OxyServices.popup.ts +402 -0
  495. package/src/core/mixins/OxyServices.redirect.ts +397 -0
  496. package/src/core/mixins/OxyServices.user.ts +39 -24
  497. package/src/core/mixins/index.ts +33 -14
  498. package/src/crypto/index.ts +16 -5
  499. package/src/crypto/keyManager.ts +966 -0
  500. package/src/crypto/polyfill.ts +6 -5
  501. package/src/crypto/recoveryPhrase.ts +166 -0
  502. package/src/crypto/signatureService.ts +323 -0
  503. package/src/i18n/locales/en-US.json +1 -1
  504. package/src/index.ts +19 -15
  505. package/src/models/interfaces.ts +4 -16
  506. package/src/models/session.ts +2 -11
  507. package/src/types/bip39.d.ts +32 -0
  508. package/src/ui/components/BottomSheetRouter.tsx +6 -1
  509. package/src/ui/components/GroupedItem.tsx +19 -1
  510. package/src/ui/components/Icon.tsx +1 -1
  511. package/src/ui/components/IconButton/utils.ts +1 -1
  512. package/src/ui/components/OxyProvider.tsx +44 -12
  513. package/src/ui/components/SettingRow.tsx +26 -4
  514. package/src/ui/components/TextField/Addons/Outline.tsx +2 -2
  515. package/src/ui/components/TextField/Adornment/utils.ts +2 -2
  516. package/src/ui/components/TextField/helpers.tsx +10 -10
  517. package/src/ui/components/TextField/types.tsx +1 -1
  518. package/src/ui/components/TouchableRipple/utils.ts +2 -2
  519. package/src/ui/components/Typography/AnimatedText.tsx +2 -2
  520. package/src/ui/components/feedback/FormInput.tsx +84 -0
  521. package/src/ui/components/feedback/ProgressIndicator.tsx +35 -0
  522. package/src/ui/components/feedback/constants.ts +22 -0
  523. package/src/ui/components/feedback/feedbackStyles.ts +247 -0
  524. package/src/ui/components/feedback/index.ts +6 -0
  525. package/src/ui/components/feedback/types.ts +52 -0
  526. package/src/ui/components/feedback/useFeedbackForm.ts +44 -0
  527. package/src/ui/components/modals/DeleteAccountModal.tsx +294 -0
  528. package/src/ui/components/modals/index.ts +1 -0
  529. package/src/ui/components/payment/PaymentDetailsStep.tsx +222 -0
  530. package/src/ui/components/payment/PaymentMethodStep.tsx +89 -0
  531. package/src/ui/components/payment/PaymentReviewStep.tsx +126 -0
  532. package/src/ui/components/payment/PaymentSuccessStep.tsx +71 -0
  533. package/src/ui/components/payment/PaymentSummaryStep.tsx +159 -0
  534. package/src/ui/components/payment/constants.ts +39 -0
  535. package/src/ui/components/payment/index.ts +9 -0
  536. package/src/ui/components/payment/paymentStyles.ts +397 -0
  537. package/src/ui/components/payment/types.ts +45 -0
  538. package/src/ui/components/types.tsx +6 -0
  539. package/src/ui/context/OxyContext.tsx +173 -195
  540. package/src/ui/context/hooks/useAuthOperations.ts +177 -36
  541. package/src/ui/context/hooks/useSessionManagement.ts +399 -0
  542. package/src/ui/hooks/index.ts +3 -1
  543. package/src/ui/hooks/mutations/useAccountMutations.ts +83 -76
  544. package/src/ui/hooks/queries/useAccountQueries.ts +29 -35
  545. package/src/ui/hooks/queries/useSecurityQueries.ts +1 -1
  546. package/src/ui/hooks/queries/useServicesQueries.ts +14 -6
  547. package/src/ui/hooks/useAsyncAction.ts +129 -0
  548. package/src/ui/hooks/useProfileEditing.ts +3 -3
  549. package/src/ui/hooks/useSessionManagement.ts +5 -10
  550. package/src/ui/hooks/useSessionSocket.ts +46 -175
  551. package/src/ui/hooks/useSettingToggle.ts +147 -0
  552. package/src/ui/hooks/useStorage.ts +24 -76
  553. package/src/ui/index.ts +22 -13
  554. package/src/ui/navigation/routes.ts +8 -2
  555. package/src/ui/screens/AccountCenterScreen.tsx +4 -4
  556. package/src/ui/screens/AccountOverviewScreen.tsx +36 -38
  557. package/src/ui/screens/AccountSettingsScreen.tsx +34 -37
  558. package/src/ui/screens/AccountSwitcherScreen.tsx +4 -4
  559. package/src/ui/screens/FAQScreen.tsx +332 -0
  560. package/src/ui/screens/FeedbackScreen.tsx +91 -626
  561. package/src/ui/screens/HelpSupportScreen.tsx +7 -5
  562. package/src/ui/screens/OxyAuthScreen.tsx +138 -64
  563. package/src/ui/screens/PaymentGatewayScreen.tsx +96 -1275
  564. package/src/ui/screens/PrivacySettingsScreen.tsx +6 -12
  565. package/src/ui/screens/ProfileScreen.tsx +11 -6
  566. package/src/ui/screens/SavesCollectionsScreen.tsx +19 -10
  567. package/src/ui/screens/karma/KarmaCenterScreen.tsx +10 -10
  568. package/src/ui/stores/accountStore.ts +1 -11
  569. package/src/ui/stores/authStore.ts +43 -44
  570. package/src/ui/styles/spacing.ts +15 -2
  571. package/src/ui/types/navigation.ts +2 -2
  572. package/src/ui/utils/avatarUtils.ts +39 -46
  573. package/src/ui/utils/storageHelpers.ts +0 -4
  574. package/src/utils/__tests__/validationUtils.test.ts +16 -1
  575. package/src/utils/errorUtils.ts +8 -1
  576. package/src/utils/validationUtils.ts +12 -0
  577. package/lib/commonjs/core/services/SessionService.js +0 -163
  578. package/lib/commonjs/core/services/SessionService.js.map +0 -1
  579. package/lib/commonjs/core/services/TokenService.js +0 -220
  580. package/lib/commonjs/core/services/TokenService.js.map +0 -1
  581. package/lib/commonjs/crypto/types.js +0 -2
  582. package/lib/commonjs/crypto/types.js.map +0 -1
  583. package/lib/commonjs/ui/context/OxyContextBase.js +0 -21
  584. package/lib/commonjs/ui/context/OxyContextBase.js.map +0 -1
  585. package/lib/commonjs/ui/context/hooks/useStorage.js +0 -79
  586. package/lib/commonjs/ui/context/hooks/useStorage.js.map +0 -1
  587. package/lib/commonjs/ui/hooks/useAvatarPicker.js +0 -56
  588. package/lib/commonjs/ui/hooks/useAvatarPicker.js.map +0 -1
  589. package/lib/module/core/services/SessionService.js +0 -159
  590. package/lib/module/core/services/SessionService.js.map +0 -1
  591. package/lib/module/core/services/TokenService.js +0 -217
  592. package/lib/module/core/services/TokenService.js.map +0 -1
  593. package/lib/module/crypto/types.js +0 -2
  594. package/lib/module/crypto/types.js.map +0 -1
  595. package/lib/module/ui/context/OxyContextBase.js +0 -16
  596. package/lib/module/ui/context/OxyContextBase.js.map +0 -1
  597. package/lib/module/ui/context/hooks/useStorage.js +0 -74
  598. package/lib/module/ui/context/hooks/useStorage.js.map +0 -1
  599. package/lib/module/ui/hooks/useAvatarPicker.js +0 -50
  600. package/lib/module/ui/hooks/useAvatarPicker.js.map +0 -1
  601. package/lib/typescript/core/services/SessionService.d.ts +0 -78
  602. package/lib/typescript/core/services/SessionService.d.ts.map +0 -1
  603. package/lib/typescript/core/services/TokenService.d.ts +0 -72
  604. package/lib/typescript/core/services/TokenService.d.ts.map +0 -1
  605. package/lib/typescript/crypto/types.d.ts +0 -22
  606. package/lib/typescript/crypto/types.d.ts.map +0 -1
  607. package/lib/typescript/ui/context/OxyContextBase.d.ts +0 -63
  608. package/lib/typescript/ui/context/OxyContextBase.d.ts.map +0 -1
  609. package/lib/typescript/ui/context/hooks/useStorage.d.ts +0 -22
  610. package/lib/typescript/ui/context/hooks/useStorage.d.ts.map +0 -1
  611. package/lib/typescript/ui/hooks/useAvatarPicker.d.ts +0 -19
  612. package/lib/typescript/ui/hooks/useAvatarPicker.d.ts.map +0 -1
  613. package/src/core/services/SessionService.ts +0 -173
  614. package/src/core/services/TokenService.ts +0 -237
  615. package/src/crypto/types.ts +0 -23
  616. package/src/ui/context/OxyContextBase.tsx +0 -78
  617. package/src/ui/context/hooks/useStorage.ts +0 -104
  618. package/src/ui/hooks/useAvatarPicker.ts +0 -61
@@ -4,7 +4,6 @@ import { useEffect, useRef } from 'react';
4
4
  import io from 'socket.io-client';
5
5
  import { toast } from '../../lib/sonner';
6
6
  import { logger } from '../../utils/loggerUtils';
7
- import { tokenService } from '../../core/services/TokenService';
8
7
  export function useSessionSocket({
9
8
  userId,
10
9
  activeSessionId,
@@ -13,16 +12,13 @@ export function useSessionSocket({
13
12
  logout,
14
13
  clearSessionState,
15
14
  baseURL,
16
- getAccessToken,
17
15
  onRemoteSignOut,
18
16
  onSessionRemoved
19
17
  }) {
20
18
  const socketRef = useRef(null);
21
19
  const joinedRoomRef = useRef(null);
22
- const accessTokenRef = useRef(null);
23
- const handlersSetupRef = useRef(false);
24
- const lastRegisteredSocketIdRef = useRef(null);
25
- const getAccessTokenRef = useRef(getAccessToken);
20
+
21
+ // Store callbacks in refs to avoid re-joining when they change
26
22
  const refreshSessionsRef = useRef(refreshSessions);
27
23
  const logoutRef = useRef(logout);
28
24
  const clearSessionStateRef = useRef(clearSessionState);
@@ -30,6 +26,8 @@ export function useSessionSocket({
30
26
  const onSessionRemovedRef = useRef(onSessionRemoved);
31
27
  const activeSessionIdRef = useRef(activeSessionId);
32
28
  const currentDeviceIdRef = useRef(currentDeviceId);
29
+
30
+ // Update refs when callbacks change
33
31
  useEffect(() => {
34
32
  refreshSessionsRef.current = refreshSessions;
35
33
  logoutRef.current = logout;
@@ -38,363 +36,212 @@ export function useSessionSocket({
38
36
  onSessionRemovedRef.current = onSessionRemoved;
39
37
  activeSessionIdRef.current = activeSessionId;
40
38
  currentDeviceIdRef.current = currentDeviceId;
41
- getAccessTokenRef.current = getAccessToken;
42
- }, [refreshSessions, logout, clearSessionState, onRemoteSignOut, onSessionRemoved, activeSessionId, currentDeviceId, getAccessToken]);
39
+ }, [refreshSessions, logout, clearSessionState, onRemoteSignOut, onSessionRemoved, activeSessionId, currentDeviceId]);
43
40
  useEffect(() => {
44
41
  if (!userId || !baseURL) {
45
- if (socketRef.current) {
46
- socketRef.current.disconnect();
47
- socketRef.current = null;
42
+ // Clean up if userId or baseURL becomes invalid
43
+ if (socketRef.current && joinedRoomRef.current) {
44
+ socketRef.current.emit('leave', {
45
+ userId: joinedRoomRef.current
46
+ });
48
47
  joinedRoomRef.current = null;
49
48
  }
50
49
  return;
51
50
  }
52
- const freshToken = getAccessTokenRef.current();
53
- if (!freshToken) {
54
- logger.debug('Deferring socket creation - no access token available yet', {
55
- component: 'useSessionSocket',
56
- userId
51
+ const roomId = `user:${userId}`;
52
+
53
+ // Only create socket if it doesn't exist
54
+ if (!socketRef.current) {
55
+ socketRef.current = io(baseURL, {
56
+ transports: ['websocket']
57
57
  });
58
- if (socketRef.current) {
59
- socketRef.current.disconnect();
60
- socketRef.current = null;
61
- joinedRoomRef.current = null;
62
- }
63
- return;
64
58
  }
65
- const initializeSocket = async () => {
66
- try {
67
- await tokenService.refreshTokenIfNeeded();
68
- } catch (error) {
69
- logger.debug('Token refresh failed before socket connection', {
70
- component: 'useSessionSocket',
71
- userId,
72
- error
59
+ const socket = socketRef.current;
60
+
61
+ // Only join if we haven't already joined this room
62
+ if (joinedRoomRef.current !== roomId) {
63
+ // Leave previous room if switching users
64
+ if (joinedRoomRef.current) {
65
+ socket.emit('leave', {
66
+ userId: joinedRoomRef.current
73
67
  });
74
68
  }
75
- const accessToken = getAccessTokenRef.current();
76
- const tokenChanged = accessTokenRef.current !== accessToken;
77
- if (!socketRef.current || tokenChanged) {
78
- if (socketRef.current) {
79
- socketRef.current.disconnect();
80
- socketRef.current = null;
81
- }
82
- const socketOptions = {
83
- transports: ['websocket']
84
- };
85
- const freshToken = getAccessTokenRef.current();
86
- if (freshToken) {
87
- socketOptions.auth = {
88
- token: freshToken
89
- };
90
- } else {
91
- logger.debug('No access token available for socket authentication', {
92
- component: 'useSessionSocket',
93
- userId
94
- });
95
- return;
96
- }
97
- socketRef.current = io(baseURL, socketOptions);
98
- accessTokenRef.current = freshToken;
99
- joinedRoomRef.current = null;
100
- handlersSetupRef.current = false;
69
+ socket.emit('join', {
70
+ userId: roomId
71
+ });
72
+ joinedRoomRef.current = roomId;
73
+ if (__DEV__) {
74
+ console.log('Emitting join for room:', roomId);
101
75
  }
102
- const socket = socketRef.current;
103
- if (!socket) return;
104
- if (!joinedRoomRef.current && socket.connected) {
105
- joinedRoomRef.current = `user:${userId}`;
76
+ }
77
+
78
+ // Set up event handlers (only once per socket instance)
79
+ const handleConnect = () => {
80
+ if (__DEV__) {
81
+ console.log('Socket connected:', socket.id);
106
82
  }
107
- const handleConnect = () => {
108
- const currentToken = getAccessTokenRef.current();
109
- if (__DEV__) {
110
- console.log('[useSessionSocket] Socket connected', {
111
- socketId: socket.id,
112
- userId,
113
- room: `user:${userId}`,
114
- hasAuth: !!currentToken
115
- });
116
- logger.debug('Socket connected', {
117
- component: 'useSessionSocket',
118
- socketId: socket.id,
119
- userId
120
- });
121
- }
122
- // Server auto-joins room on connection when authenticated
123
- // Just track that we're connected
124
- if (userId) {
125
- joinedRoomRef.current = `user:${userId}`;
83
+ };
84
+ const handleSessionUpdate = async data => {
85
+ if (__DEV__) {
86
+ console.log('Received session_update:', data);
87
+ }
88
+ const currentActiveSessionId = activeSessionIdRef.current;
89
+ const currentDeviceId = currentDeviceIdRef.current;
90
+
91
+ // Handle different event types
92
+ if (data.type === 'session_removed') {
93
+ // Track removed session
94
+ if (data.sessionId && onSessionRemovedRef.current) {
95
+ onSessionRemovedRef.current(data.sessionId);
126
96
  }
127
- };
128
- const handleDisconnect = async reason => {
129
- logger.debug('Socket disconnected', {
130
- component: 'useSessionSocket',
131
- reason,
132
- userId
133
- });
134
- joinedRoomRef.current = null;
135
97
 
136
- // If disconnected due to auth error, try to refresh token and reconnect
137
- if (reason === 'io server disconnect' || reason.includes('auth') || reason.includes('Authentication')) {
98
+ // If the removed sessionId matches the current activeSessionId, immediately clear state
99
+ if (data.sessionId === currentActiveSessionId) {
100
+ if (onRemoteSignOutRef.current) {
101
+ onRemoteSignOutRef.current();
102
+ } else {
103
+ toast.info('You have been signed out remotely.');
104
+ }
105
+ // Use clearSessionState since session was already removed server-side
106
+ // Await to ensure storage cleanup completes before continuing
138
107
  try {
139
- // Refresh token and reconnect
140
- await tokenService.refreshTokenIfNeeded();
141
- const freshToken = getAccessTokenRef.current();
142
- if (freshToken && socketRef.current) {
143
- // Update auth and reconnect
144
- socketRef.current.auth = {
145
- token: freshToken
146
- };
147
- socketRef.current.connect();
148
- }
108
+ await clearSessionStateRef.current();
149
109
  } catch (error) {
150
- logger.debug('Failed to refresh token after disconnect', {
151
- component: 'useSessionSocket',
152
- userId,
153
- error
154
- });
110
+ if (__DEV__) {
111
+ logger.error('Failed to clear session state after session_removed', error instanceof Error ? error : new Error(String(error)), {
112
+ component: 'useSessionSocket'
113
+ });
114
+ }
155
115
  }
156
- }
157
- };
158
- const handleError = error => {
159
- logger.error('Socket error', error, {
160
- component: 'useSessionSocket',
161
- userId
162
- });
163
- };
164
- const handleConnectError = async error => {
165
- logger.debug('Socket connection error', {
166
- component: 'useSessionSocket',
167
- userId,
168
- error: error.message
169
- });
170
-
171
- // If error is due to expired/invalid token, try to refresh and reconnect
172
- if (error.message.includes('Authentication') || error.message.includes('expired') || error.message.includes('token')) {
173
- try {
174
- await tokenService.refreshTokenIfNeeded();
175
- const freshToken = getAccessTokenRef.current();
176
- if (freshToken && socketRef.current) {
177
- // Update auth and reconnect
178
- socketRef.current.auth = {
179
- token: freshToken
180
- };
181
- socketRef.current.connect();
116
+ } else {
117
+ // Otherwise, just refresh the sessions list (with error handling)
118
+ refreshSessionsRef.current().catch(error => {
119
+ // Silently handle errors from refresh - they're expected if sessions were removed
120
+ if (__DEV__) {
121
+ logger.debug('Failed to refresh sessions after session_removed', {
122
+ component: 'useSessionSocket'
123
+ }, error);
182
124
  }
183
- } catch (refreshError) {
184
- logger.debug('Failed to refresh token after connection error', {
185
- component: 'useSessionSocket',
186
- userId,
187
- error: refreshError
188
- });
125
+ });
126
+ }
127
+ } else if (data.type === 'device_removed') {
128
+ // Track all removed sessions from this device
129
+ if (data.sessionIds && onSessionRemovedRef.current) {
130
+ for (const sessionId of data.sessionIds) {
131
+ onSessionRemovedRef.current(sessionId);
189
132
  }
190
133
  }
191
- };
192
- const handleSessionUpdate = async data => {
193
- logger.debug('Received session_update event', {
194
- component: 'useSessionSocket',
195
- type: data.type,
196
- socketId: socket.id,
197
- socketConnected: socket.connected,
198
- roomId: joinedRoomRef.current
199
- });
200
- const currentActiveSessionId = activeSessionIdRef.current;
201
- const currentDeviceId = currentDeviceIdRef.current;
202
134
 
203
- // Handle different event types
204
- if (data.type === 'session_removed') {
205
- // Track removed session
206
- if (data.sessionId && onSessionRemovedRef.current) {
207
- onSessionRemovedRef.current(data.sessionId);
135
+ // If the removed deviceId matches the current device, immediately clear state
136
+ if (data.deviceId && data.deviceId === currentDeviceId) {
137
+ if (onRemoteSignOutRef.current) {
138
+ onRemoteSignOutRef.current();
139
+ } else {
140
+ toast.info('This device has been removed. You have been signed out.');
208
141
  }
209
-
210
- // If the removed sessionId matches the current activeSessionId, immediately clear state
211
- if (data.sessionId === currentActiveSessionId) {
212
- if (onRemoteSignOutRef.current) {
213
- onRemoteSignOutRef.current();
214
- } else {
215
- toast.info('You have been signed out remotely.');
216
- }
217
- // Use clearSessionState since session was already removed server-side
218
- // Await to ensure storage cleanup completes before continuing
219
- try {
220
- await clearSessionStateRef.current();
221
- } catch (error) {
222
- if (__DEV__) {
223
- logger.error('Failed to clear session state after session_removed', error instanceof Error ? error : new Error(String(error)), {
224
- component: 'useSessionSocket'
225
- });
226
- }
142
+ // Use clearSessionState since sessions were already removed server-side
143
+ // Await to ensure storage cleanup completes before continuing
144
+ try {
145
+ await clearSessionStateRef.current();
146
+ } catch (error) {
147
+ if (__DEV__) {
148
+ logger.error('Failed to clear session state after device_removed', error instanceof Error ? error : new Error(String(error)), {
149
+ component: 'useSessionSocket'
150
+ });
227
151
  }
228
- } else {
229
- // Otherwise, just refresh the sessions list (with error handling)
230
- refreshSessionsRef.current().catch(error => {
231
- // Silently handle errors from refresh - they're expected if sessions were removed
232
- if (__DEV__) {
233
- logger.debug('Failed to refresh sessions after session_removed', {
234
- component: 'useSessionSocket'
235
- }, error);
236
- }
237
- });
238
152
  }
239
- } else if (data.type === 'device_removed') {
240
- // Track all removed sessions from this device
241
- if (data.sessionIds && onSessionRemovedRef.current) {
242
- for (const sessionId of data.sessionIds) {
243
- onSessionRemovedRef.current(sessionId);
153
+ } else {
154
+ // Otherwise, refresh sessions and device list (with error handling)
155
+ refreshSessionsRef.current().catch(error => {
156
+ // Silently handle errors from refresh - they're expected if sessions were removed
157
+ if (__DEV__) {
158
+ logger.debug('Failed to refresh sessions after device_removed', {
159
+ component: 'useSessionSocket'
160
+ }, error);
244
161
  }
162
+ });
163
+ }
164
+ } else if (data.type === 'sessions_removed') {
165
+ // Track all removed sessions
166
+ if (data.sessionIds && onSessionRemovedRef.current) {
167
+ for (const sessionId of data.sessionIds) {
168
+ onSessionRemovedRef.current(sessionId);
245
169
  }
170
+ }
246
171
 
247
- // If the removed deviceId matches the current device, immediately clear state
248
- if (data.deviceId && data.deviceId === currentDeviceId) {
249
- if (onRemoteSignOutRef.current) {
250
- onRemoteSignOutRef.current();
251
- } else {
252
- toast.info('This device has been removed. You have been signed out.');
253
- }
254
- // Use clearSessionState since sessions were already removed server-side
255
- // Await to ensure storage cleanup completes before continuing
256
- try {
257
- await clearSessionStateRef.current();
258
- } catch (error) {
259
- if (__DEV__) {
260
- logger.error('Failed to clear session state after device_removed', error instanceof Error ? error : new Error(String(error)), {
261
- component: 'useSessionSocket'
262
- });
263
- }
264
- }
172
+ // If the current activeSessionId is in the removed sessionIds list, immediately clear state
173
+ if (data.sessionIds && currentActiveSessionId && data.sessionIds.includes(currentActiveSessionId)) {
174
+ if (onRemoteSignOutRef.current) {
175
+ onRemoteSignOutRef.current();
265
176
  } else {
266
- // Otherwise, refresh sessions and device list (with error handling)
267
- refreshSessionsRef.current().catch(error => {
268
- // Silently handle errors from refresh - they're expected if sessions were removed
269
- if (__DEV__) {
270
- logger.debug('Failed to refresh sessions after device_removed', {
271
- component: 'useSessionSocket'
272
- }, error);
273
- }
274
- });
275
- }
276
- } else if (data.type === 'sessions_removed') {
277
- // Track all removed sessions
278
- if (data.sessionIds && onSessionRemovedRef.current) {
279
- for (const sessionId of data.sessionIds) {
280
- onSessionRemovedRef.current(sessionId);
281
- }
177
+ toast.info('You have been signed out remotely.');
282
178
  }
283
-
284
- // If the current activeSessionId is in the removed sessionIds list, immediately clear state
285
- if (data.sessionIds && currentActiveSessionId && data.sessionIds.includes(currentActiveSessionId)) {
286
- if (onRemoteSignOutRef.current) {
287
- onRemoteSignOutRef.current();
288
- } else {
289
- toast.info('You have been signed out remotely.');
290
- }
291
- // Use clearSessionState since sessions were already removed server-side
292
- // Await to ensure storage cleanup completes before continuing
293
- try {
294
- await clearSessionStateRef.current();
295
- } catch (error) {
296
- if (__DEV__) {
297
- logger.error('Failed to clear session state after sessions_removed', error instanceof Error ? error : new Error(String(error)), {
298
- component: 'useSessionSocket'
299
- });
300
- }
179
+ // Use clearSessionState since sessions were already removed server-side
180
+ // Await to ensure storage cleanup completes before continuing
181
+ try {
182
+ await clearSessionStateRef.current();
183
+ } catch (error) {
184
+ if (__DEV__) {
185
+ logger.error('Failed to clear session state after sessions_removed', error instanceof Error ? error : new Error(String(error)), {
186
+ component: 'useSessionSocket'
187
+ });
301
188
  }
302
- } else {
303
- // Otherwise, refresh sessions list (with error handling)
304
- refreshSessionsRef.current().catch(error => {
305
- // Silently handle errors from refresh - they're expected if sessions were removed
306
- if (__DEV__) {
307
- logger.debug('Failed to refresh sessions after sessions_removed', {
308
- component: 'useSessionSocket'
309
- }, error);
310
- }
311
- });
312
189
  }
313
190
  } else {
314
- // For other event types (e.g., session_created), refresh sessions (with error handling)
191
+ // Otherwise, refresh sessions list (with error handling)
315
192
  refreshSessionsRef.current().catch(error => {
316
- // Log but don't throw - refresh errors shouldn't break the socket handler
193
+ // Silently handle errors from refresh - they're expected if sessions were removed
317
194
  if (__DEV__) {
318
- logger.debug('Failed to refresh sessions after session_update', {
195
+ logger.debug('Failed to refresh sessions after sessions_removed', {
319
196
  component: 'useSessionSocket'
320
197
  }, error);
321
198
  }
322
199
  });
323
-
324
- // If the current session was logged out (legacy behavior), handle it specially
325
- if (data.sessionId === currentActiveSessionId) {
326
- if (onRemoteSignOutRef.current) {
327
- onRemoteSignOutRef.current();
328
- } else {
329
- toast.info('You have been signed out remotely.');
330
- }
331
- // Use clearSessionState since session was already removed server-side
332
- // Await to ensure storage cleanup completes before continuing
333
- try {
334
- await clearSessionStateRef.current();
335
- } catch (error) {
336
- logger.error('Failed to clear session state after session_update', error instanceof Error ? error : new Error(String(error)), {
337
- component: 'useSessionSocket'
338
- });
339
- }
340
- }
341
200
  }
342
- };
201
+ } else {
202
+ // For other event types (e.g., session_created), refresh sessions (with error handling)
203
+ refreshSessionsRef.current().catch(error => {
204
+ // Log but don't throw - refresh errors shouldn't break the socket handler
205
+ if (__DEV__) {
206
+ logger.debug('Failed to refresh sessions after session_update', {
207
+ component: 'useSessionSocket'
208
+ }, error);
209
+ }
210
+ });
343
211
 
344
- // Register event handlers (only once per socket instance)
345
- // Track by socket.id to prevent duplicate registrations when socket reconnects
346
- const currentSocketId = socket.id || 'pending';
347
- if (!handlersSetupRef.current || lastRegisteredSocketIdRef.current !== currentSocketId) {
348
- // Remove old handlers if socket changed (reconnection)
349
- if (socketRef.current && handlersSetupRef.current && lastRegisteredSocketIdRef.current) {
212
+ // If the current session was logged out (legacy behavior), handle it specially
213
+ if (data.sessionId === currentActiveSessionId) {
214
+ if (onRemoteSignOutRef.current) {
215
+ onRemoteSignOutRef.current();
216
+ } else {
217
+ toast.info('You have been signed out remotely.');
218
+ }
219
+ // Use clearSessionState since session was already removed server-side
220
+ // Await to ensure storage cleanup completes before continuing
350
221
  try {
351
- socketRef.current.off('connect', handleConnect);
352
- socketRef.current.off('disconnect', handleDisconnect);
353
- socketRef.current.off('error', handleError);
354
- socketRef.current.off('session_update', handleSessionUpdate);
222
+ await clearSessionStateRef.current();
355
223
  } catch (error) {
356
- // Ignore errors when removing handlers
224
+ if (__DEV__) {
225
+ console.error('Failed to clear session state after session_update:', error);
226
+ }
357
227
  }
358
228
  }
359
-
360
- // Register handlers on current socket
361
- socket.on('connect', handleConnect);
362
- socket.on('disconnect', handleDisconnect);
363
- socket.on('error', handleError);
364
- socket.on('connect_error', handleConnectError);
365
- socket.on('session_update', handleSessionUpdate);
366
- handlersSetupRef.current = true;
367
- lastRegisteredSocketIdRef.current = currentSocketId;
368
- logger.debug('Event handlers set up', {
369
- component: 'useSessionSocket',
370
- socketId: socket.id,
371
- userId
372
- });
373
- }
374
- if (!socket.connected) {
375
- logger.debug('Socket not connected, connecting...', {
376
- component: 'useSessionSocket',
377
- userId
378
- });
379
- socket.connect();
380
229
  }
381
230
  };
382
- initializeSocket();
231
+ socket.on('connect', handleConnect);
232
+ socket.on('session_update', handleSessionUpdate);
383
233
  return () => {
384
- // Only clean up handlers if socket still exists and handlers were set up
385
- if (socketRef.current && handlersSetupRef.current) {
386
- try {
387
- socketRef.current.off('connect');
388
- socketRef.current.off('disconnect');
389
- socketRef.current.off('error');
390
- socketRef.current.off('connect_error');
391
- socketRef.current.off('session_update');
392
- } catch (error) {
393
- // Ignore errors when removing handlers
394
- }
395
- handlersSetupRef.current = false;
234
+ socket.off('connect', handleConnect);
235
+ socket.off('session_update', handleSessionUpdate);
236
+
237
+ // Only leave on unmount if we're still in this room
238
+ if (joinedRoomRef.current === roomId) {
239
+ socket.emit('leave', {
240
+ userId: roomId
241
+ });
242
+ joinedRoomRef.current = null;
396
243
  }
397
244
  };
398
- }, [userId, baseURL]); // Only depend on userId and baseURL - functions are in refs
245
+ }, [userId, baseURL]); // Only depend on userId and baseURL - callbacks are in refs
399
246
  }
400
247
  //# sourceMappingURL=useSessionSocket.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useRef","io","toast","logger","tokenService","useSessionSocket","userId","activeSessionId","currentDeviceId","refreshSessions","logout","clearSessionState","baseURL","getAccessToken","onRemoteSignOut","onSessionRemoved","socketRef","joinedRoomRef","accessTokenRef","handlersSetupRef","lastRegisteredSocketIdRef","getAccessTokenRef","refreshSessionsRef","logoutRef","clearSessionStateRef","onRemoteSignOutRef","onSessionRemovedRef","activeSessionIdRef","currentDeviceIdRef","current","disconnect","freshToken","debug","component","initializeSocket","refreshTokenIfNeeded","error","accessToken","tokenChanged","socketOptions","transports","auth","token","socket","connected","handleConnect","currentToken","__DEV__","console","log","socketId","id","room","hasAuth","handleDisconnect","reason","includes","connect","handleError","handleConnectError","message","refreshError","handleSessionUpdate","data","type","socketConnected","roomId","currentActiveSessionId","sessionId","info","Error","String","catch","sessionIds","deviceId","currentSocketId","off","on"],"sourceRoot":"../../../../src","sources":["ui/hooks/useSessionSocket.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,OAAOC,EAAE,MAAM,kBAAkB;AACjC,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,MAAM,QAAQ,yBAAyB;AAChD,SAASC,YAAY,QAAQ,kCAAkC;AAe/D,OAAO,SAASC,gBAAgBA,CAAC;EAAEC,MAAM;EAAEC,eAAe;EAAEC,eAAe;EAAEC,eAAe;EAAEC,MAAM;EAAEC,iBAAiB;EAAEC,OAAO;EAAEC,cAAc;EAAEC,eAAe;EAAEC;AAAwC,CAAC,EAAE;EAC5M,MAAMC,SAAS,GAAGhB,MAAM,CAAM,IAAI,CAAC;EACnC,MAAMiB,aAAa,GAAGjB,MAAM,CAAgB,IAAI,CAAC;EACjD,MAAMkB,cAAc,GAAGlB,MAAM,CAAgB,IAAI,CAAC;EAClD,MAAMmB,gBAAgB,GAAGnB,MAAM,CAAU,KAAK,CAAC;EAC/C,MAAMoB,yBAAyB,GAAGpB,MAAM,CAAgB,IAAI,CAAC;EAC7D,MAAMqB,iBAAiB,GAAGrB,MAAM,CAACa,cAAc,CAAC;EAEhD,MAAMS,kBAAkB,GAAGtB,MAAM,CAACS,eAAe,CAAC;EAClD,MAAMc,SAAS,GAA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AAO,IAAIV,gBAAgB,CAACU,OAAO,EAAE;QACjD,IAAI;UACFb,SAAS,CAACa,OAAO,CAAC+C,GAAG,CAAC,SAAS,CAAC;UAChC5D,SAAS,CAACa,OAAO,CAAC+C,GAAG,CAAC,YAAY,CAAC;UACnC5D,SAAS,CAACa,OAAO,CAAC+C,GAAG,CAAC,OAAO,CAAC;UAC9B5D,SAAS,CAACa,OAAO,CAAC+C,GAAG,CAAC,eAAe,CAAC;UACtC5D,SAAS,CAACa,OAAO,CAAC+C,GAAG,CAAC,gBAAgB,CAAC;QACzC,CAAC,CAAC,OAAOxC,KAAK,EAAE;UACd;QAAA;QAEFjB,gBAAgB,CAACU,OAAO,GAAG,KAAK;MAClC;IACF,CAAC;EACH,CAAC,EAAE,CAACvB,MAAM,EAAEM,OAAO,CAAC,CAAC,CAAC,CAAC;AACzB","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useRef","io","toast","logger","useSessionSocket","userId","activeSessionId","currentDeviceId","refreshSessions","logout","clearSessionState","baseURL","onRemoteSignOut","onSessionRemoved","socketRef","joinedRoomRef","refreshSessionsRef","logoutRef","clearSessionStateRef","onRemoteSignOutRef","onSessionRemovedRef","activeSessionIdRef","currentDeviceIdRef","current","emit","roomId","transports","socket","__DEV__","console","log","handleConnect","id","handleSessionUpdate","data","currentActiveSessionId","type","sessionId","info","error","Error","String","component","catch","debug","sessionIds","deviceId","includes","on","off"],"sourceRoot":"../../../../src","sources":["ui/hooks/useSessionSocket.ts"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,OAAOC,EAAE,MAAM,kBAAkB;AACjC,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,MAAM,QAAQ,yBAAyB;AAchD,OAAO,SAASC,gBAAgBA,CAAC;EAAEC,MAAM;EAAEC,eAAe;EAAEC,eAAe;EAAEC,eAAe;EAAEC,MAAM;EAAEC,iBAAiB;EAAEC,OAAO;EAAEC,eAAe;EAAEC;AAAwC,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