@replyke/core 5.1.6-beta.0 → 5.1.6-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/context/index.d.ts +0 -1
- package/dist/cjs/context/index.js +3 -3
- package/dist/cjs/context/index.js.map +1 -1
- package/dist/cjs/helpers/addNotificationsMessages.js +7 -7
- package/dist/cjs/helpers/addNotificationsMessages.js.map +1 -1
- package/dist/cjs/hooks/app-notifications-redux/index.d.ts +1 -2
- package/dist/cjs/hooks/app-notifications-redux/index.js +1 -3
- package/dist/cjs/hooks/app-notifications-redux/index.js.map +1 -1
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsRedux.d.ts +18 -4
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsRedux.js +78 -8
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsRedux.js.map +1 -1
- package/dist/cjs/hooks/lists-redux/index.d.ts +2 -0
- package/dist/cjs/hooks/lists-redux/index.js +12 -0
- package/dist/cjs/hooks/lists-redux/index.js.map +1 -0
- package/dist/cjs/hooks/lists-redux/useListsActionsRedux.d.ts +21 -0
- package/dist/cjs/hooks/lists-redux/useListsActionsRedux.js +329 -0
- package/dist/cjs/hooks/lists-redux/useListsActionsRedux.js.map +1 -0
- package/dist/cjs/hooks/{lists/useListsData.d.ts → lists-redux/useListsRedux.d.ts} +9 -5
- package/dist/cjs/hooks/lists-redux/useListsRedux.js +239 -0
- package/dist/cjs/hooks/lists-redux/useListsRedux.js.map +1 -0
- package/dist/cjs/hooks/user-redux/index.d.ts +2 -0
- package/dist/cjs/hooks/user-redux/index.js +12 -0
- package/dist/cjs/hooks/user-redux/index.js.map +1 -0
- package/dist/cjs/hooks/user-redux/useUserActionsRedux.d.ts +12 -0
- package/dist/cjs/hooks/user-redux/useUserActionsRedux.js +125 -0
- package/dist/cjs/hooks/user-redux/useUserActionsRedux.js.map +1 -0
- package/dist/cjs/hooks/user-redux/useUserRedux.d.ts +18 -0
- package/dist/cjs/hooks/user-redux/useUserRedux.js +116 -0
- package/dist/cjs/hooks/user-redux/useUserRedux.js.map +1 -0
- package/dist/cjs/hooks/users/index.d.ts +0 -2
- package/dist/cjs/hooks/users/index.js +4 -5
- package/dist/cjs/hooks/users/index.js.map +1 -1
- package/dist/cjs/index.d.ts +7 -6
- package/dist/cjs/index.js +11 -18
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/store/api/appNotificationsApi.d.ts +144 -141
- package/dist/cjs/store/api/appNotificationsApi.js +11 -0
- package/dist/cjs/store/api/appNotificationsApi.js.map +1 -1
- package/dist/cjs/store/api/baseApi.d.ts +1 -1
- package/dist/cjs/store/api/baseApi.js +2 -2
- package/dist/cjs/store/api/baseApi.js.map +1 -1
- package/dist/cjs/store/api/index.d.ts +1 -0
- package/dist/cjs/store/api/index.js +2 -1
- package/dist/cjs/store/api/index.js.map +1 -1
- package/dist/cjs/store/api/listsApi.d.ts +3044 -0
- package/dist/cjs/store/api/listsApi.js +288 -0
- package/dist/cjs/store/api/listsApi.js.map +1 -0
- package/dist/cjs/store/api/userApi.d.ts +183 -0
- package/dist/cjs/store/api/userApi.js +38 -0
- package/dist/cjs/store/api/userApi.js.map +1 -0
- package/dist/cjs/store/index.d.ts +6 -2
- package/dist/cjs/store/rootReducer.d.ts +6 -2
- package/dist/cjs/store/rootReducer.js +4 -0
- package/dist/cjs/store/rootReducer.js.map +1 -1
- package/dist/cjs/store/slices/authThunks.js +6 -0
- package/dist/cjs/store/slices/authThunks.js.map +1 -1
- package/dist/cjs/store/slices/listsSlice.d.ts +66 -0
- package/dist/cjs/store/slices/listsSlice.js +213 -0
- package/dist/cjs/store/slices/listsSlice.js.map +1 -0
- package/dist/cjs/store/slices/userSlice.d.ts +29 -0
- package/dist/cjs/store/slices/userSlice.js +87 -0
- package/dist/cjs/store/slices/userSlice.js.map +1 -0
- package/dist/esm/context/index.d.ts +0 -1
- package/dist/esm/context/index.js +2 -1
- package/dist/esm/context/index.js.map +1 -1
- package/dist/esm/helpers/addNotificationsMessages.js +7 -7
- package/dist/esm/helpers/addNotificationsMessages.js.map +1 -1
- package/dist/esm/hooks/app-notifications-redux/index.d.ts +1 -2
- package/dist/esm/hooks/app-notifications-redux/index.js +0 -1
- package/dist/esm/hooks/app-notifications-redux/index.js.map +1 -1
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsRedux.d.ts +18 -4
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsRedux.js +77 -9
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsRedux.js.map +1 -1
- package/dist/esm/hooks/lists-redux/index.d.ts +2 -0
- package/dist/esm/hooks/lists-redux/index.js +4 -0
- package/dist/esm/hooks/lists-redux/index.js.map +1 -0
- package/dist/esm/hooks/lists-redux/useListsActionsRedux.d.ts +21 -0
- package/dist/esm/hooks/lists-redux/useListsActionsRedux.js +326 -0
- package/dist/esm/hooks/lists-redux/useListsActionsRedux.js.map +1 -0
- package/dist/esm/hooks/{lists/useListsData.d.ts → lists-redux/useListsRedux.d.ts} +9 -5
- package/dist/esm/hooks/lists-redux/useListsRedux.js +234 -0
- package/dist/esm/hooks/lists-redux/useListsRedux.js.map +1 -0
- package/dist/esm/hooks/user-redux/index.d.ts +2 -0
- package/dist/esm/hooks/user-redux/index.js +4 -0
- package/dist/esm/hooks/user-redux/index.js.map +1 -0
- package/dist/esm/hooks/user-redux/useUserActionsRedux.d.ts +12 -0
- package/dist/esm/hooks/user-redux/useUserActionsRedux.js +122 -0
- package/dist/esm/hooks/user-redux/useUserActionsRedux.js.map +1 -0
- package/dist/esm/hooks/user-redux/useUserRedux.d.ts +18 -0
- package/dist/esm/hooks/user-redux/useUserRedux.js +111 -0
- package/dist/esm/hooks/user-redux/useUserRedux.js.map +1 -0
- package/dist/esm/hooks/users/index.d.ts +0 -2
- package/dist/esm/hooks/users/index.js +3 -2
- package/dist/esm/hooks/users/index.js.map +1 -1
- package/dist/esm/index.d.ts +7 -6
- package/dist/esm/index.js +9 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/store/api/appNotificationsApi.d.ts +144 -141
- package/dist/esm/store/api/appNotificationsApi.js +11 -0
- package/dist/esm/store/api/appNotificationsApi.js.map +1 -1
- package/dist/esm/store/api/baseApi.d.ts +1 -1
- package/dist/esm/store/api/baseApi.js +2 -2
- package/dist/esm/store/api/baseApi.js.map +1 -1
- package/dist/esm/store/api/index.d.ts +1 -0
- package/dist/esm/store/api/index.js +2 -1
- package/dist/esm/store/api/index.js.map +1 -1
- package/dist/esm/store/api/listsApi.d.ts +3044 -0
- package/dist/esm/store/api/listsApi.js +285 -0
- package/dist/esm/store/api/listsApi.js.map +1 -0
- package/dist/esm/store/api/userApi.d.ts +183 -0
- package/dist/esm/store/api/userApi.js +35 -0
- package/dist/esm/store/api/userApi.js.map +1 -0
- package/dist/esm/store/index.d.ts +6 -2
- package/dist/esm/store/rootReducer.d.ts +6 -2
- package/dist/esm/store/rootReducer.js +4 -0
- package/dist/esm/store/rootReducer.js.map +1 -1
- package/dist/esm/store/slices/authThunks.js +6 -0
- package/dist/esm/store/slices/authThunks.js.map +1 -1
- package/dist/esm/store/slices/listsSlice.d.ts +66 -0
- package/dist/esm/store/slices/listsSlice.js +203 -0
- package/dist/esm/store/slices/listsSlice.js.map +1 -0
- package/dist/esm/store/slices/userSlice.d.ts +29 -0
- package/dist/esm/store/slices/userSlice.js +78 -0
- package/dist/esm/store/slices/userSlice.js.map +1 -0
- package/package.json +1 -1
- package/dist/cjs/context/lists-context.d.ts +0 -9
- package/dist/cjs/context/lists-context.js +0 -17
- package/dist/cjs/context/lists-context.js.map +0 -1
- package/dist/cjs/context/user-context.d.ts +0 -8
- package/dist/cjs/context/user-context.js +0 -28
- package/dist/cjs/context/user-context.js.map +0 -1
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsDataRedux.d.ts +0 -21
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsDataRedux.js +0 -108
- package/dist/cjs/hooks/app-notifications-redux/useAppNotificationsDataRedux.js.map +0 -1
- package/dist/cjs/hooks/lists/index.d.ts +0 -10
- package/dist/cjs/hooks/lists/index.js +0 -27
- package/dist/cjs/hooks/lists/index.js.map +0 -1
- package/dist/cjs/hooks/lists/useAddToList.d.ts +0 -6
- package/dist/cjs/hooks/lists/useAddToList.js +0 -70
- package/dist/cjs/hooks/lists/useAddToList.js.map +0 -1
- package/dist/cjs/hooks/lists/useCreateList.d.ts +0 -6
- package/dist/cjs/hooks/lists/useCreateList.js +0 -70
- package/dist/cjs/hooks/lists/useCreateList.js.map +0 -1
- package/dist/cjs/hooks/lists/useDeleteList.d.ts +0 -4
- package/dist/cjs/hooks/lists/useDeleteList.js +0 -69
- package/dist/cjs/hooks/lists/useDeleteList.js.map +0 -1
- package/dist/cjs/hooks/lists/useFetchRootList.d.ts +0 -3
- package/dist/cjs/hooks/lists/useFetchRootList.js +0 -69
- package/dist/cjs/hooks/lists/useFetchRootList.js.map +0 -1
- package/dist/cjs/hooks/lists/useFetchSubLists.d.ts +0 -5
- package/dist/cjs/hooks/lists/useFetchSubLists.js +0 -68
- package/dist/cjs/hooks/lists/useFetchSubLists.js.map +0 -1
- package/dist/cjs/hooks/lists/useIsEntitySaved.d.ts +0 -5
- package/dist/cjs/hooks/lists/useIsEntitySaved.js +0 -78
- package/dist/cjs/hooks/lists/useIsEntitySaved.js.map +0 -1
- package/dist/cjs/hooks/lists/useLists.d.ts +0 -2
- package/dist/cjs/hooks/lists/useLists.js +0 -9
- package/dist/cjs/hooks/lists/useLists.js.map +0 -1
- package/dist/cjs/hooks/lists/useListsData.js +0 -391
- package/dist/cjs/hooks/lists/useListsData.js.map +0 -1
- package/dist/cjs/hooks/lists/useRemoveFromList.d.ts +0 -6
- package/dist/cjs/hooks/lists/useRemoveFromList.js +0 -70
- package/dist/cjs/hooks/lists/useRemoveFromList.js.map +0 -1
- package/dist/cjs/hooks/lists/useUpdateList.d.ts +0 -8
- package/dist/cjs/hooks/lists/useUpdateList.js +0 -70
- package/dist/cjs/hooks/lists/useUpdateList.js.map +0 -1
- package/dist/cjs/hooks/users/useUser.d.ts +0 -2
- package/dist/cjs/hooks/users/useUser.js +0 -9
- package/dist/cjs/hooks/users/useUser.js.map +0 -1
- package/dist/cjs/hooks/users/useUserData.d.ts +0 -12
- package/dist/cjs/hooks/users/useUserData.js +0 -76
- package/dist/cjs/hooks/users/useUserData.js.map +0 -1
- package/dist/cjs/legacy/context/app-notifications-context.d.ts +0 -8
- package/dist/cjs/legacy/context/app-notifications-context.js +0 -28
- package/dist/cjs/legacy/context/app-notifications-context.js.map +0 -1
- package/dist/cjs/legacy/context/auth-context.d.ts +0 -8
- package/dist/cjs/legacy/context/auth-context.js +0 -29
- package/dist/cjs/legacy/context/auth-context.js.map +0 -1
- package/dist/cjs/legacy/hooks/app-notifications/index.d.ts +0 -5
- package/dist/cjs/legacy/hooks/app-notifications/index.js +0 -17
- package/dist/cjs/legacy/hooks/app-notifications/index.js.map +0 -1
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotifications.d.ts +0 -2
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotifications.js +0 -9
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotifications.js.map +0 -1
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotificationsData.d.ts +0 -16
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotificationsData.js +0 -225
- package/dist/cjs/legacy/hooks/app-notifications/useAppNotificationsData.js.map +0 -1
- package/dist/cjs/legacy/hooks/app-notifications/useCountUnreadNotifications.d.ts +0 -2
- package/dist/cjs/legacy/hooks/app-notifications/useCountUnreadNotifications.js +0 -72
- package/dist/cjs/legacy/hooks/app-notifications/useCountUnreadNotifications.js.map +0 -1
- package/dist/cjs/legacy/hooks/app-notifications/useFetchAppNotifications.d.ts +0 -6
- package/dist/cjs/legacy/hooks/app-notifications/useFetchAppNotifications.js +0 -79
- package/dist/cjs/legacy/hooks/app-notifications/useFetchAppNotifications.js.map +0 -1
- package/dist/cjs/legacy/hooks/app-notifications/useMarkNotificationAsRead.d.ts +0 -2
- package/dist/cjs/legacy/hooks/app-notifications/useMarkNotificationAsRead.js +0 -74
- package/dist/cjs/legacy/hooks/app-notifications/useMarkNotificationAsRead.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/index.d.ts +0 -8
- package/dist/cjs/legacy/hooks/auth/index.js +0 -23
- package/dist/cjs/legacy/hooks/auth/index.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useAuth.d.ts +0 -2
- package/dist/cjs/legacy/hooks/auth/useAuth.js +0 -9
- package/dist/cjs/legacy/hooks/auth/useAuth.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useAuthData.d.ts +0 -41
- package/dist/cjs/legacy/hooks/auth/useAuthData.js +0 -271
- package/dist/cjs/legacy/hooks/auth/useAuthData.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useChangePassword.d.ts +0 -5
- package/dist/cjs/legacy/hooks/auth/useChangePassword.js +0 -70
- package/dist/cjs/legacy/hooks/auth/useChangePassword.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useRequestNewAccessToken.d.ts +0 -7
- package/dist/cjs/legacy/hooks/auth/useRequestNewAccessToken.js +0 -71
- package/dist/cjs/legacy/hooks/auth/useRequestNewAccessToken.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useSignInWithEmailAndPassword.d.ts +0 -9
- package/dist/cjs/legacy/hooks/auth/useSignInWithEmailAndPassword.js +0 -72
- package/dist/cjs/legacy/hooks/auth/useSignInWithEmailAndPassword.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useSignOut.d.ts +0 -4
- package/dist/cjs/legacy/hooks/auth/useSignOut.js +0 -67
- package/dist/cjs/legacy/hooks/auth/useSignOut.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useSignUpWithEmailAndPassword.d.ts +0 -20
- package/dist/cjs/legacy/hooks/auth/useSignUpWithEmailAndPassword.js +0 -80
- package/dist/cjs/legacy/hooks/auth/useSignUpWithEmailAndPassword.js.map +0 -1
- package/dist/cjs/legacy/hooks/auth/useVerifyExternalUser.d.ts +0 -8
- package/dist/cjs/legacy/hooks/auth/useVerifyExternalUser.js +0 -70
- package/dist/cjs/legacy/hooks/auth/useVerifyExternalUser.js.map +0 -1
- package/dist/esm/context/lists-context.d.ts +0 -9
- package/dist/esm/context/lists-context.js +0 -10
- package/dist/esm/context/lists-context.js.map +0 -1
- package/dist/esm/context/user-context.d.ts +0 -8
- package/dist/esm/context/user-context.js +0 -21
- package/dist/esm/context/user-context.js.map +0 -1
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsDataRedux.d.ts +0 -21
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsDataRedux.js +0 -103
- package/dist/esm/hooks/app-notifications-redux/useAppNotificationsDataRedux.js.map +0 -1
- package/dist/esm/hooks/lists/index.d.ts +0 -10
- package/dist/esm/hooks/lists/index.js +0 -11
- package/dist/esm/hooks/lists/index.js.map +0 -1
- package/dist/esm/hooks/lists/useAddToList.d.ts +0 -6
- package/dist/esm/hooks/lists/useAddToList.js +0 -65
- package/dist/esm/hooks/lists/useAddToList.js.map +0 -1
- package/dist/esm/hooks/lists/useCreateList.d.ts +0 -6
- package/dist/esm/hooks/lists/useCreateList.js +0 -65
- package/dist/esm/hooks/lists/useCreateList.js.map +0 -1
- package/dist/esm/hooks/lists/useDeleteList.d.ts +0 -4
- package/dist/esm/hooks/lists/useDeleteList.js +0 -64
- package/dist/esm/hooks/lists/useDeleteList.js.map +0 -1
- package/dist/esm/hooks/lists/useFetchRootList.d.ts +0 -3
- package/dist/esm/hooks/lists/useFetchRootList.js +0 -64
- package/dist/esm/hooks/lists/useFetchRootList.js.map +0 -1
- package/dist/esm/hooks/lists/useFetchSubLists.d.ts +0 -5
- package/dist/esm/hooks/lists/useFetchSubLists.js +0 -63
- package/dist/esm/hooks/lists/useFetchSubLists.js.map +0 -1
- package/dist/esm/hooks/lists/useIsEntitySaved.d.ts +0 -5
- package/dist/esm/hooks/lists/useIsEntitySaved.js +0 -73
- package/dist/esm/hooks/lists/useIsEntitySaved.js.map +0 -1
- package/dist/esm/hooks/lists/useLists.d.ts +0 -2
- package/dist/esm/hooks/lists/useLists.js +0 -6
- package/dist/esm/hooks/lists/useLists.js.map +0 -1
- package/dist/esm/hooks/lists/useListsData.js +0 -386
- package/dist/esm/hooks/lists/useListsData.js.map +0 -1
- package/dist/esm/hooks/lists/useRemoveFromList.d.ts +0 -6
- package/dist/esm/hooks/lists/useRemoveFromList.js +0 -65
- package/dist/esm/hooks/lists/useRemoveFromList.js.map +0 -1
- package/dist/esm/hooks/lists/useUpdateList.d.ts +0 -8
- package/dist/esm/hooks/lists/useUpdateList.js +0 -65
- package/dist/esm/hooks/lists/useUpdateList.js.map +0 -1
- package/dist/esm/hooks/users/useUser.d.ts +0 -2
- package/dist/esm/hooks/users/useUser.js +0 -6
- package/dist/esm/hooks/users/useUser.js.map +0 -1
- package/dist/esm/hooks/users/useUserData.d.ts +0 -12
- package/dist/esm/hooks/users/useUserData.js +0 -71
- package/dist/esm/hooks/users/useUserData.js.map +0 -1
- package/dist/esm/legacy/context/app-notifications-context.d.ts +0 -8
- package/dist/esm/legacy/context/app-notifications-context.js +0 -21
- package/dist/esm/legacy/context/app-notifications-context.js.map +0 -1
- package/dist/esm/legacy/context/auth-context.d.ts +0 -8
- package/dist/esm/legacy/context/auth-context.js +0 -22
- package/dist/esm/legacy/context/auth-context.js.map +0 -1
- package/dist/esm/legacy/hooks/app-notifications/index.d.ts +0 -5
- package/dist/esm/legacy/hooks/app-notifications/index.js +0 -6
- package/dist/esm/legacy/hooks/app-notifications/index.js.map +0 -1
- package/dist/esm/legacy/hooks/app-notifications/useAppNotifications.d.ts +0 -2
- package/dist/esm/legacy/hooks/app-notifications/useAppNotifications.js +0 -6
- package/dist/esm/legacy/hooks/app-notifications/useAppNotifications.js.map +0 -1
- package/dist/esm/legacy/hooks/app-notifications/useAppNotificationsData.d.ts +0 -16
- package/dist/esm/legacy/hooks/app-notifications/useAppNotificationsData.js +0 -220
- package/dist/esm/legacy/hooks/app-notifications/useAppNotificationsData.js.map +0 -1
- package/dist/esm/legacy/hooks/app-notifications/useCountUnreadNotifications.d.ts +0 -2
- package/dist/esm/legacy/hooks/app-notifications/useCountUnreadNotifications.js +0 -67
- package/dist/esm/legacy/hooks/app-notifications/useCountUnreadNotifications.js.map +0 -1
- package/dist/esm/legacy/hooks/app-notifications/useFetchAppNotifications.d.ts +0 -6
- package/dist/esm/legacy/hooks/app-notifications/useFetchAppNotifications.js +0 -74
- package/dist/esm/legacy/hooks/app-notifications/useFetchAppNotifications.js.map +0 -1
- package/dist/esm/legacy/hooks/app-notifications/useMarkNotificationAsRead.d.ts +0 -2
- package/dist/esm/legacy/hooks/app-notifications/useMarkNotificationAsRead.js +0 -69
- package/dist/esm/legacy/hooks/app-notifications/useMarkNotificationAsRead.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/index.d.ts +0 -8
- package/dist/esm/legacy/hooks/auth/index.js +0 -9
- package/dist/esm/legacy/hooks/auth/index.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useAuth.d.ts +0 -2
- package/dist/esm/legacy/hooks/auth/useAuth.js +0 -6
- package/dist/esm/legacy/hooks/auth/useAuth.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useAuthData.d.ts +0 -41
- package/dist/esm/legacy/hooks/auth/useAuthData.js +0 -266
- package/dist/esm/legacy/hooks/auth/useAuthData.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useChangePassword.d.ts +0 -5
- package/dist/esm/legacy/hooks/auth/useChangePassword.js +0 -65
- package/dist/esm/legacy/hooks/auth/useChangePassword.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useRequestNewAccessToken.d.ts +0 -7
- package/dist/esm/legacy/hooks/auth/useRequestNewAccessToken.js +0 -66
- package/dist/esm/legacy/hooks/auth/useRequestNewAccessToken.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useSignInWithEmailAndPassword.d.ts +0 -9
- package/dist/esm/legacy/hooks/auth/useSignInWithEmailAndPassword.js +0 -67
- package/dist/esm/legacy/hooks/auth/useSignInWithEmailAndPassword.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useSignOut.d.ts +0 -4
- package/dist/esm/legacy/hooks/auth/useSignOut.js +0 -62
- package/dist/esm/legacy/hooks/auth/useSignOut.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useSignUpWithEmailAndPassword.d.ts +0 -20
- package/dist/esm/legacy/hooks/auth/useSignUpWithEmailAndPassword.js +0 -75
- package/dist/esm/legacy/hooks/auth/useSignUpWithEmailAndPassword.js.map +0 -1
- package/dist/esm/legacy/hooks/auth/useVerifyExternalUser.d.ts +0 -8
- package/dist/esm/legacy/hooks/auth/useVerifyExternalUser.js +0 -65
- package/dist/esm/legacy/hooks/auth/useVerifyExternalUser.js.map +0 -1
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { useCallback } from "react";
|
|
38
|
-
import useUpdateUser from "./useUpdateUser";
|
|
39
|
-
import { handleError } from "../../utils/handleError";
|
|
40
|
-
function useUserData(_a) {
|
|
41
|
-
var _this = this;
|
|
42
|
-
var user = _a.user, setUser = _a.setUser;
|
|
43
|
-
var updateUser = useUpdateUser();
|
|
44
|
-
var handleUpdateUser = useCallback(function (update) { return __awaiter(_this, void 0, void 0, function () {
|
|
45
|
-
var newUser, err_1;
|
|
46
|
-
return __generator(this, function (_a) {
|
|
47
|
-
switch (_a.label) {
|
|
48
|
-
case 0:
|
|
49
|
-
if (!user)
|
|
50
|
-
return [2 /*return*/];
|
|
51
|
-
_a.label = 1;
|
|
52
|
-
case 1:
|
|
53
|
-
_a.trys.push([1, 3, , 4]);
|
|
54
|
-
return [4 /*yield*/, updateUser({ userId: user.id, update: update })];
|
|
55
|
-
case 2:
|
|
56
|
-
newUser = _a.sent();
|
|
57
|
-
if (newUser)
|
|
58
|
-
setUser === null || setUser === void 0 ? void 0 : setUser(newUser);
|
|
59
|
-
return [3 /*break*/, 4];
|
|
60
|
-
case 3:
|
|
61
|
-
err_1 = _a.sent();
|
|
62
|
-
handleError(err_1, "Updating user failed");
|
|
63
|
-
return [3 /*break*/, 4];
|
|
64
|
-
case 4: return [2 /*return*/];
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}); }, [user, updateUser, setUser]);
|
|
68
|
-
return { user: user, updateUser: handleUpdateUser };
|
|
69
|
-
}
|
|
70
|
-
export default useUserData;
|
|
71
|
-
//# sourceMappingURL=useUserData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUserData.js","sourceRoot":"","sources":["../../../../src/hooks/users/useUserData.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,aAAmC,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAYtD,SAAS,WAAW,CAAC,EAAmC;IAAxD,iBAgBC;QAhBsB,IAAI,UAAA,EAAE,OAAO,aAAA;IAClC,IAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IAEnC,IAAM,gBAAgB,GAAG,WAAW,CAClC,UAAO,MAAwB;;;;;oBAC7B,IAAI,CAAC,IAAI;wBAAE,sBAAO;;;;oBAEA,qBAAM,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,MAAM,QAAA,EAAE,CAAC,EAAA;;oBAAvD,OAAO,GAAG,SAA6C;oBAC7D,IAAI,OAAO;wBAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,OAAO,CAAC,CAAC;;;;oBAEhC,WAAW,CAAC,KAAG,EAAE,sBAAsB,CAAC,CAAC;;;;;SAE5C,EACD,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAC5B,CAAC;IACF,OAAO,EAAE,IAAI,MAAA,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;AAChD,CAAC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { UseAppNotificationsDataValues, UseAppNotificationsDataProps } from "../hooks/app-notifications/useAppNotificationsData";
|
|
2
|
-
export interface AppNotificationsContextProps extends UseAppNotificationsDataProps {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
export interface AppNotificationsContextValues extends UseAppNotificationsDataValues {
|
|
6
|
-
}
|
|
7
|
-
export declare const AppNotificationsContext: import("react").Context<Partial<AppNotificationsContextValues>>;
|
|
8
|
-
export declare const AppNotificationsProvider: React.FC<AppNotificationsContextProps>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { createContext } from "react";
|
|
14
|
-
import useAppNotificationsData from "../hooks/app-notifications/useAppNotificationsData";
|
|
15
|
-
export var AppNotificationsContext = createContext({});
|
|
16
|
-
export var AppNotificationsProvider = function (_a) {
|
|
17
|
-
var children = _a.children, restOfProps = __rest(_a, ["children"]);
|
|
18
|
-
var data = useAppNotificationsData(restOfProps);
|
|
19
|
-
return (_jsx(AppNotificationsContext.Provider, { value: data, children: children }));
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=app-notifications-context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-notifications-context.js","sourceRoot":"","sources":["../../../../src/legacy/context/app-notifications-context.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,uBAGN,MAAM,oDAAoD,CAAC;AAU5D,MAAM,CAAC,IAAM,uBAAuB,GAAG,aAAa,CAElD,EAAE,CAAC,CAAC;AAEN,MAAM,CAAC,IAAM,wBAAwB,GAEjC,UAAC,EAA0D;IAAxD,IAAA,QAAQ,cAAA,EAAK,WAAW,cAA1B,YAA4B,CAAF;IAC7B,IAAM,IAAI,GAAG,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAClD,OAAO,CACL,KAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,YAC1C,QAAQ,GACwB,CACpC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { UseAuthDataProps, UseAuthDataValues } from "../hooks/auth/useAuthData";
|
|
2
|
-
export interface AuthContextProps extends UseAuthDataProps {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
export interface AuthContextValues extends Omit<UseAuthDataValues, "user" | "setUser"> {
|
|
6
|
-
}
|
|
7
|
-
export declare const AuthContext: import("react").Context<Partial<AuthContextValues>>;
|
|
8
|
-
export declare const AuthProvider: React.FC<AuthContextProps>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { createContext } from "react";
|
|
14
|
-
import useAuthData from "../hooks/auth/useAuthData";
|
|
15
|
-
import { UserProvider } from "../../context/user-context";
|
|
16
|
-
export var AuthContext = createContext({});
|
|
17
|
-
export var AuthProvider = function (_a) {
|
|
18
|
-
var children = _a.children, restOfProps = __rest(_a, ["children"]);
|
|
19
|
-
var _b = useAuthData(restOfProps), user = _b.user, setUser = _b.setUser, restOfValues = __rest(_b, ["user", "setUser"]);
|
|
20
|
-
return (_jsx(AuthContext.Provider, { value: restOfValues, children: _jsx(UserProvider, { user: user, setUser: setUser, children: children }) }));
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=auth-context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth-context.js","sourceRoot":"","sources":["../../../../src/legacy/context/auth-context.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,WAGN,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAS1D,MAAM,CAAC,IAAM,WAAW,GAAG,aAAa,CAA6B,EAAE,CAAC,CAAC;AAEzE,MAAM,CAAC,IAAM,YAAY,GAA+B,UAAC,EAGtC;IAFjB,IAAA,QAAQ,cAAA,EACL,WAAW,cAFyC,YAGxD,CADe;IAEd,IAAM,KAAqC,WAAW,CAAC,WAAW,CAAC,EAA3D,IAAI,UAAA,EAAE,OAAO,aAAA,EAAK,YAAY,cAAhC,mBAAkC,CAA2B,CAAC;IAEpE,OAAO,CACL,KAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YACvC,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,YACvC,QAAQ,GACI,GACM,CACxB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { default as useAppNotifications } from "./useAppNotifications";
|
|
2
|
-
export { default as useAppNotificationsData } from "./useAppNotificationsData";
|
|
3
|
-
export { default as useCountUnreadNotifications } from "./useCountUnreadNotifications";
|
|
4
|
-
export { default as useFetchAppNotifications } from "./useFetchAppNotifications";
|
|
5
|
-
export { default as useMarkNotificationAsRead } from "./useMarkNotificationAsRead";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default as useAppNotifications } from "./useAppNotifications";
|
|
2
|
-
export { default as useAppNotificationsData } from "./useAppNotificationsData";
|
|
3
|
-
export { default as useCountUnreadNotifications } from "./useCountUnreadNotifications";
|
|
4
|
-
export { default as useFetchAppNotifications } from "./useFetchAppNotifications";
|
|
5
|
-
export { default as useMarkNotificationAsRead } from "./useMarkNotificationAsRead";
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/legacy/hooks/app-notifications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { useContext } from "react";
|
|
2
|
-
import { AppNotificationsContext, } from "../../context/app-notifications-context";
|
|
3
|
-
export default function useAppNotifications() {
|
|
4
|
-
return useContext(AppNotificationsContext);
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=useAppNotifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAppNotifications.js","sourceRoot":"","sources":["../../../../../src/legacy/hooks/app-notifications/useAppNotifications.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EACL,uBAAuB,GAExB,MAAM,yCAAyC,CAAC;AAEjD,MAAM,CAAC,OAAO,UAAU,mBAAmB;IACzC,OAAO,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { NotificationTemplates, UnifiedAppNotification } from "../../../interfaces/models/AppNotification";
|
|
2
|
-
export interface UseAppNotificationsDataProps {
|
|
3
|
-
limit?: number;
|
|
4
|
-
notificationTemplates?: Partial<NotificationTemplates>;
|
|
5
|
-
}
|
|
6
|
-
export interface UseAppNotificationsDataValues {
|
|
7
|
-
appNotifications: UnifiedAppNotification[];
|
|
8
|
-
unreadAppNotificationsCount: number;
|
|
9
|
-
loading: boolean;
|
|
10
|
-
hasMore: boolean;
|
|
11
|
-
loadMore: () => void;
|
|
12
|
-
markNotificationAsRead: (notificationId: string) => Promise<void>;
|
|
13
|
-
resetAppNotifications: () => Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
declare function useAppNotificationsData({ limit, notificationTemplates, }: UseAppNotificationsDataProps): UseAppNotificationsDataValues;
|
|
16
|
-
export default useAppNotificationsData;
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
23
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
49
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
50
|
-
if (ar || !(i in from)) {
|
|
51
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
52
|
-
ar[i] = from[i];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
|
-
};
|
|
57
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
58
|
-
import useFetchAppNotifications from "./useFetchAppNotifications";
|
|
59
|
-
import useCountUnreadNotifications from "./useCountUnreadNotifications";
|
|
60
|
-
import useMarkNotificationAsRead from "./useMarkNotificationAsRead";
|
|
61
|
-
import { handleError } from "../../../utils/handleError";
|
|
62
|
-
import addNotificationsMessages from "../../../helpers/addNotificationsMessages";
|
|
63
|
-
function useAppNotificationsData(_a) {
|
|
64
|
-
var _this = this;
|
|
65
|
-
var _b = _a.limit, limit = _b === void 0 ? 10 : _b, notificationTemplates = _a.notificationTemplates;
|
|
66
|
-
var _c = useState([]), appNotifications = _c[0], setAppNotifications = _c[1];
|
|
67
|
-
var _d = useState(0), unreadAppNotificationsCount = _d[0], setUnreadAppNotificationsCount = _d[1];
|
|
68
|
-
var _e = useState(1), page = _e[0], setPage = _e[1];
|
|
69
|
-
var loading = useRef(true);
|
|
70
|
-
var _f = useState(true), loadingState = _f[0], setLoadingState = _f[1];
|
|
71
|
-
var hasMore = useRef(true);
|
|
72
|
-
var _g = useState(true), hasMoreState = _g[0], setHasMoreState = _g[1];
|
|
73
|
-
var fetchAppNotifications = useFetchAppNotifications();
|
|
74
|
-
var countUnreadNotifications = useCountUnreadNotifications();
|
|
75
|
-
var markNotificationAsRead = useMarkNotificationAsRead();
|
|
76
|
-
var resetAppNotifications = useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
77
|
-
var newAppNotifications, completeNotifications, err_1;
|
|
78
|
-
return __generator(this, function (_a) {
|
|
79
|
-
switch (_a.label) {
|
|
80
|
-
case 0:
|
|
81
|
-
_a.trys.push([0, 2, 3, 4]);
|
|
82
|
-
loading.current = true;
|
|
83
|
-
setLoadingState(true);
|
|
84
|
-
hasMore.current = true;
|
|
85
|
-
setHasMoreState(true);
|
|
86
|
-
setPage(1);
|
|
87
|
-
setAppNotifications([]);
|
|
88
|
-
return [4 /*yield*/, fetchAppNotifications({
|
|
89
|
-
page: 1,
|
|
90
|
-
limit: limit,
|
|
91
|
-
})];
|
|
92
|
-
case 1:
|
|
93
|
-
newAppNotifications = _a.sent();
|
|
94
|
-
if (newAppNotifications) {
|
|
95
|
-
completeNotifications = addNotificationsMessages(newAppNotifications, notificationTemplates);
|
|
96
|
-
setAppNotifications(completeNotifications);
|
|
97
|
-
if (newAppNotifications.length < limit) {
|
|
98
|
-
hasMore.current = false;
|
|
99
|
-
setHasMoreState(false);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return [3 /*break*/, 4];
|
|
103
|
-
case 2:
|
|
104
|
-
err_1 = _a.sent();
|
|
105
|
-
handleError(err_1, "Failed to refesh notifications:");
|
|
106
|
-
return [3 /*break*/, 4];
|
|
107
|
-
case 3:
|
|
108
|
-
loading.current = false;
|
|
109
|
-
setLoadingState(false);
|
|
110
|
-
return [7 /*endfinally*/];
|
|
111
|
-
case 4: return [2 /*return*/];
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}); }, [fetchAppNotifications, limit, notificationTemplates]);
|
|
115
|
-
var loadMore = function () {
|
|
116
|
-
if (loading.current || !hasMore.current)
|
|
117
|
-
return;
|
|
118
|
-
setPage(function (prevPage) {
|
|
119
|
-
return prevPage + 1;
|
|
120
|
-
});
|
|
121
|
-
};
|
|
122
|
-
var handleMarkNotificationAsRead = function (notificationId) { return __awaiter(_this, void 0, void 0, function () {
|
|
123
|
-
var err_2;
|
|
124
|
-
return __generator(this, function (_a) {
|
|
125
|
-
switch (_a.label) {
|
|
126
|
-
case 0:
|
|
127
|
-
_a.trys.push([0, 2, , 3]);
|
|
128
|
-
return [4 /*yield*/, markNotificationAsRead(notificationId)];
|
|
129
|
-
case 1:
|
|
130
|
-
_a.sent();
|
|
131
|
-
setUnreadAppNotificationsCount(function (prevCount) { return Math.max(prevCount - 1, 0); });
|
|
132
|
-
setAppNotifications(function (prevNotifs) {
|
|
133
|
-
return prevNotifs.map(function (notif) {
|
|
134
|
-
return notif.id === notificationId ? __assign(__assign({}, notif), { isRead: true }) : notif;
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
return [3 /*break*/, 3];
|
|
138
|
-
case 2:
|
|
139
|
-
err_2 = _a.sent();
|
|
140
|
-
handleError(err_2, "Failed to mark notification as read:");
|
|
141
|
-
return [3 /*break*/, 3];
|
|
142
|
-
case 3: return [2 /*return*/];
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}); };
|
|
146
|
-
// Check how many unread notifications we have
|
|
147
|
-
useEffect(function () {
|
|
148
|
-
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
149
|
-
var newCount;
|
|
150
|
-
return __generator(this, function (_a) {
|
|
151
|
-
switch (_a.label) {
|
|
152
|
-
case 0: return [4 /*yield*/, countUnreadNotifications()];
|
|
153
|
-
case 1:
|
|
154
|
-
newCount = _a.sent();
|
|
155
|
-
if (typeof newCount === "number")
|
|
156
|
-
setUnreadAppNotificationsCount(newCount);
|
|
157
|
-
return [2 /*return*/];
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
}); })();
|
|
161
|
-
}, [countUnreadNotifications]);
|
|
162
|
-
useEffect(function () {
|
|
163
|
-
resetAppNotifications === null || resetAppNotifications === void 0 ? void 0 : resetAppNotifications();
|
|
164
|
-
}, [resetAppNotifications]);
|
|
165
|
-
// useEffect to get a new batch of app notifications
|
|
166
|
-
useEffect(function () {
|
|
167
|
-
var loadMoreNotifications = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
168
|
-
var newAppNotifications, completeNotifications_1, err_3;
|
|
169
|
-
return __generator(this, function (_a) {
|
|
170
|
-
switch (_a.label) {
|
|
171
|
-
case 0:
|
|
172
|
-
_a.trys.push([0, 2, 3, 4]);
|
|
173
|
-
loading.current = true;
|
|
174
|
-
return [4 /*yield*/, fetchAppNotifications({
|
|
175
|
-
page: page,
|
|
176
|
-
limit: limit,
|
|
177
|
-
})];
|
|
178
|
-
case 1:
|
|
179
|
-
newAppNotifications = _a.sent();
|
|
180
|
-
if (newAppNotifications) {
|
|
181
|
-
completeNotifications_1 = addNotificationsMessages(newAppNotifications, notificationTemplates);
|
|
182
|
-
setAppNotifications(function (prevEntities) {
|
|
183
|
-
return __spreadArray(__spreadArray([], prevEntities, true), completeNotifications_1, true);
|
|
184
|
-
});
|
|
185
|
-
if (newAppNotifications.length < limit) {
|
|
186
|
-
hasMore.current = false;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return [3 /*break*/, 4];
|
|
190
|
-
case 2:
|
|
191
|
-
err_3 = _a.sent();
|
|
192
|
-
handleError(err_3, "Loading more app notifications failed:");
|
|
193
|
-
return [3 /*break*/, 4];
|
|
194
|
-
case 3:
|
|
195
|
-
loading.current = false;
|
|
196
|
-
return [7 /*endfinally*/];
|
|
197
|
-
case 4: return [2 /*return*/];
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
}); };
|
|
201
|
-
// We only load more if the page changed
|
|
202
|
-
// We rmoved this && hasMore.current && !loading.current because i caused us to skip page 2 (as request came to soon). Still not sure if it's issue that we don't check if we're loading
|
|
203
|
-
// Maybe we can do something with debounce? So it will only allow the page state to increase by 1 until it finsihed loading?
|
|
204
|
-
// EDIT: 've added it back aftr checking that indeed this is the issue. Let's keep it safe and find a way to fix it after
|
|
205
|
-
if (page > 1 && hasMore.current && !loading.current) {
|
|
206
|
-
loadMoreNotifications();
|
|
207
|
-
}
|
|
208
|
-
}, [page]);
|
|
209
|
-
return {
|
|
210
|
-
appNotifications: appNotifications,
|
|
211
|
-
unreadAppNotificationsCount: unreadAppNotificationsCount,
|
|
212
|
-
loading: loadingState,
|
|
213
|
-
hasMore: hasMoreState,
|
|
214
|
-
loadMore: loadMore,
|
|
215
|
-
markNotificationAsRead: handleMarkNotificationAsRead,
|
|
216
|
-
resetAppNotifications: resetAppNotifications,
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
export default useAppNotificationsData;
|
|
220
|
-
//# sourceMappingURL=useAppNotificationsData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAppNotificationsData.js","sourceRoot":"","sources":["../../../../../src/legacy/hooks/app-notifications/useAppNotificationsData.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { useCallback } from "react";
|
|
38
|
-
import useAxiosPrivate from "../../../config/useAxiosPrivate";
|
|
39
|
-
import useProject from "../../../hooks/projects/useProject";
|
|
40
|
-
import { useUserRedux } from "../../../hooks/auth-redux";
|
|
41
|
-
function useCountUnreadNotifications() {
|
|
42
|
-
var _this = this;
|
|
43
|
-
var axios = useAxiosPrivate();
|
|
44
|
-
var projectId = useProject().projectId;
|
|
45
|
-
var user = useUserRedux().user;
|
|
46
|
-
var countUnreadNotifications = useCallback(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
47
|
-
var response;
|
|
48
|
-
return __generator(this, function (_a) {
|
|
49
|
-
switch (_a.label) {
|
|
50
|
-
case 0:
|
|
51
|
-
if (!user) {
|
|
52
|
-
throw new Error("No authenticated user");
|
|
53
|
-
}
|
|
54
|
-
if (!projectId) {
|
|
55
|
-
throw new Error("No projectId available.");
|
|
56
|
-
}
|
|
57
|
-
return [4 /*yield*/, axios.get("/".concat(projectId, "/app-notifications/count"), { withCredentials: true })];
|
|
58
|
-
case 1:
|
|
59
|
-
response = _a.sent();
|
|
60
|
-
return [2 /*return*/, response.data];
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}); }, [projectId, user, axios]);
|
|
64
|
-
return countUnreadNotifications;
|
|
65
|
-
}
|
|
66
|
-
export default useCountUnreadNotifications;
|
|
67
|
-
//# sourceMappingURL=useCountUnreadNotifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCountUnreadNotifications.js","sourceRoot":"","sources":["../../../../../src/legacy/hooks/app-notifications/useCountUnreadNotifications.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,SAAS,2BAA2B;IAApC,iBAsBC;IArBC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,YAAY,EAAE,KAAnB,CAAoB;IAEhC,IAAM,wBAAwB,GAAG,WAAW,CAAC;;;;;oBAC3C,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;oBAC3C,CAAC;oBAED,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,6BAA0B,EACvC,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,EAAA;;oBAHK,QAAQ,GAAG,SAGhB;oBACD,sBAAO,QAAQ,CAAC,IAAc,EAAC;;;SAChC,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAE7B,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAED,eAAe,2BAA2B,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { UnifiedAppNotification } from "../../../interfaces/models/AppNotification";
|
|
2
|
-
declare function useFetchAppNotifications(): ({ page, limit }: {
|
|
3
|
-
page: number;
|
|
4
|
-
limit: number;
|
|
5
|
-
}) => Promise<UnifiedAppNotification[]>;
|
|
6
|
-
export default useFetchAppNotifications;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
import { useCallback } from "react";
|
|
38
|
-
import useAxiosPrivate from "../../../config/useAxiosPrivate";
|
|
39
|
-
import useProject from "../../../hooks/projects/useProject";
|
|
40
|
-
import { useUserRedux } from "../../../hooks/auth-redux";
|
|
41
|
-
function useFetchAppNotifications() {
|
|
42
|
-
var _this = this;
|
|
43
|
-
var axios = useAxiosPrivate();
|
|
44
|
-
var projectId = useProject().projectId;
|
|
45
|
-
var user = useUserRedux().user;
|
|
46
|
-
var fetchAppNotifications = useCallback(function (_a) { return __awaiter(_this, [_a], void 0, function (_b) {
|
|
47
|
-
var response;
|
|
48
|
-
var page = _b.page, limit = _b.limit;
|
|
49
|
-
return __generator(this, function (_c) {
|
|
50
|
-
switch (_c.label) {
|
|
51
|
-
case 0:
|
|
52
|
-
if (!user) {
|
|
53
|
-
throw new Error("No authenticated user");
|
|
54
|
-
}
|
|
55
|
-
if (!projectId) {
|
|
56
|
-
throw new Error("No projectId available.");
|
|
57
|
-
}
|
|
58
|
-
return [4 /*yield*/, axios.get("/".concat(projectId, "/app-notifications"), {
|
|
59
|
-
params: {
|
|
60
|
-
page: page,
|
|
61
|
-
limit: limit,
|
|
62
|
-
},
|
|
63
|
-
withCredentials: true,
|
|
64
|
-
})];
|
|
65
|
-
case 1:
|
|
66
|
-
response = _c.sent();
|
|
67
|
-
return [2 /*return*/, response.data];
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
}); }, [projectId, axios, user]);
|
|
71
|
-
return fetchAppNotifications;
|
|
72
|
-
}
|
|
73
|
-
export default useFetchAppNotifications;
|
|
74
|
-
//# sourceMappingURL=useFetchAppNotifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchAppNotifications.js","sourceRoot":"","sources":["../../../../../src/legacy/hooks/app-notifications/useFetchAppNotifications.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,UAAU,MAAM,oCAAoC,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,SAAS,wBAAwB;IAAjC,iBAgCC;IA/BC,IAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IACxB,IAAA,SAAS,GAAK,UAAU,EAAE,UAAjB,CAAkB;IAC3B,IAAA,IAAI,GAAK,YAAY,EAAE,KAAnB,CAAoB;IAEhC,IAAM,qBAAqB,GAAG,WAAW,CACvC,gEAAO,EAAgD;;YAA9C,IAAI,UAAA,EAAE,KAAK,WAAA;;;;oBAClB,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;oBAC3C,CAAC;oBAED,IAAI,CAAC,SAAS,EAAE,CAAC;wBACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;oBAC7C,CAAC;oBAEgB,qBAAM,KAAK,CAAC,GAAG,CAC9B,WAAI,SAAS,uBAAoB,EACjC;4BACE,MAAM,EAAE;gCACN,IAAI,MAAA;gCACJ,KAAK,OAAA;6BACN;4BACD,eAAe,EAAE,IAAI;yBACtB,CACF,EAAA;;oBATK,QAAQ,GAAG,SAShB;oBAED,sBAAO,QAAQ,CAAC,IAAgC,EAAC;;;SAClD,EACD,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,CACzB,CAAC;IAEF,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAED,eAAe,wBAAwB,CAAC"}
|