@ozdao/martyrs 0.2.580 → 0.2.582
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/_virtual/dayjs.min.js +1 -1
- package/dist/_virtual/weekOfYear.js +1 -1
- package/dist/builder.js +1 -6
- package/dist/loader.js +1 -6
- package/dist/martyrs/src/components/Block/Block.vue.js +1 -1
- package/dist/martyrs/src/components/Button/{Button.vue2.js → Button.vue.js} +2 -2
- package/dist/martyrs/src/components/Button/Button.vue.js.map +1 -0
- package/dist/martyrs/src/components/EditImages/{EditImages.vue2.js → EditImages.vue.js} +2 -2
- package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +1 -0
- package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/martyrs/src/components/Select/{Select.vue.js → Select.vue2.js} +2 -2
- package/dist/martyrs/src/components/Select/Select.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Spoiler/{Spoiler.vue2.js → Spoiler.vue.js} +2 -2
- package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +1 -0
- package/dist/martyrs/src/components/Tab/{Tab.vue2.js → Tab.vue.js} +2 -2
- package/dist/martyrs/src/components/Tab/Tab.vue.js.map +1 -0
- package/dist/martyrs/src/components/Tooltip/{Tooltip.vue.js → Tooltip.vue2.js} +2 -2
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js.map +1 -0
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +5 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/configs/navigation.user.config.js +2 -3
- package/dist/martyrs/src/modules/auth/views/configs/navigation.user.config.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/router/users.router.js +1 -2
- package/dist/martyrs/src/modules/auth/views/router/users.router.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/store/auth.js +1 -0
- package/dist/martyrs/src/modules/auth/views/store/auth.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/martyrs/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/classes/ws.manager.js +16 -1
- package/dist/martyrs/src/modules/core/views/classes/ws.manager.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +2 -2
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupAuth.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +2 -2
- package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue2.js → Filters.vue.js} +2 -2
- package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +1 -0
- package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js +8 -1
- package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js.map +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
- package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/blocks/ActionButtons.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/PlayerControls.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +1 -1
- package/dist/martyrs/src/modules/notifications/components/blocks/NotificationItem.vue.js +2 -2
- package/dist/martyrs/src/modules/notifications/components/blocks/NotificationItem.vue.js.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/layouts/NotificationsLayout.vue.js +11 -40
- package/dist/martyrs/src/modules/notifications/components/layouts/NotificationsLayout.vue.js.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/pages/Notifications.vue.js +26 -21
- package/dist/martyrs/src/modules/notifications/components/pages/Notifications.vue.js.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +54 -48
- package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js.map +1 -1
- package/dist/martyrs/src/modules/notifications/components/sections/NotificationsList.vue.js +37 -117
- package/dist/martyrs/src/modules/notifications/components/sections/NotificationsList.vue.js.map +1 -1
- package/dist/martyrs/src/modules/notifications/notifications.client.js +18 -15
- package/dist/martyrs/src/modules/notifications/notifications.client.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderUser.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +3 -3
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/blocks/ProductDiscounts.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +4 -4
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +2 -2
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +2 -2
- package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/martyrs/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +1 -1
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +3 -3
- package/dist/{martyrs → node_modules/.pnpm/@vue_server-renderer@3.5.13_vue@3.5.13_typescript@5.8.3_}/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js +1 -1
- package/dist/node_modules/.pnpm/@vue_server-renderer@3.5.13_vue@3.5.13_typescript@5.8.3_/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js.map +1 -0
- package/dist/node_modules/.pnpm/@vue_shared@3.5.13/node_modules/@vue/shared/dist/shared.esm-bundler.js.map +1 -0
- package/dist/{martyrs → node_modules/.pnpm/dayjs@1.11.13}/node_modules/dayjs/dayjs.min.js +1 -1
- package/dist/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/dayjs.min.js.map +1 -0
- package/dist/{martyrs → node_modules/.pnpm/dayjs@1.11.13}/node_modules/dayjs/plugin/weekOfYear.js +1 -1
- package/dist/node_modules/.pnpm/dayjs@1.11.13/node_modules/dayjs/plugin/weekOfYear.js.map +1 -0
- package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/native.js +6 -0
- package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
- package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/rng.js +15 -0
- package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/rng.js.map +1 -0
- package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/stringify.js +11 -0
- package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -0
- package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/v4.js +20 -0
- package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/v4.js.map +1 -0
- package/dist/style.css +2 -189
- package/package.json +1 -1
- package/src/jit/loader.js +1 -6
- package/src/jit/plugin.js +1 -5
- package/src/modules/auth/views/components/pages/ProfileEdit.vue +1 -1
- package/src/modules/auth/views/components/pages/SignIn.vue +14 -10
- package/src/modules/auth/views/configs/navigation.user.config.js +10 -10
- package/src/modules/auth/views/router/users.router.js +0 -1
- package/src/modules/auth/views/store/auth.js +1 -0
- package/src/modules/core/views/classes/ws.manager.js +20 -1
- package/src/modules/core/views/utils/vue-app-renderer.js +9 -3
- package/src/modules/notifications/components/blocks/NotificationItem.vue +1 -1
- package/src/modules/notifications/components/layouts/NotificationsLayout.vue +9 -53
- package/src/modules/notifications/components/pages/Notifications.vue +21 -22
- package/src/modules/notifications/components/sections/NotificationPreferences.vue +41 -180
- package/src/modules/notifications/components/sections/NotificationsList.vue +39 -219
- package/src/modules/notifications/notifications.client.js +17 -16
- package/dist/martyrs/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js.map +0 -1
- package/dist/martyrs/node_modules/@vue/shared/dist/shared.esm-bundler.js.map +0 -1
- package/dist/martyrs/node_modules/dayjs/dayjs.min.js.map +0 -1
- package/dist/martyrs/node_modules/dayjs/plugin/weekOfYear.js.map +0 -1
- package/dist/martyrs/node_modules/uuid/dist/esm-browser/regex.js +0 -5
- package/dist/martyrs/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
- package/dist/martyrs/node_modules/uuid/dist/esm-browser/rng.js +0 -15
- package/dist/martyrs/node_modules/uuid/dist/esm-browser/rng.js.map +0 -1
- package/dist/martyrs/node_modules/uuid/dist/esm-browser/stringify.js +0 -17
- package/dist/martyrs/node_modules/uuid/dist/esm-browser/stringify.js.map +0 -1
- package/dist/martyrs/node_modules/uuid/dist/esm-browser/v4.js +0 -13
- package/dist/martyrs/node_modules/uuid/dist/esm-browser/v4.js.map +0 -1
- package/dist/martyrs/node_modules/uuid/dist/esm-browser/validate.js +0 -8
- package/dist/martyrs/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
- package/dist/martyrs/src/components/Button/Button.vue2.js.map +0 -1
- package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Select/Select.vue.js.map +0 -1
- package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Tab/Tab.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/blocks/ProfileCard.vue.js +0 -44
- package/dist/martyrs/src/modules/auth/views/components/blocks/ProfileCard.vue.js.map +0 -1
- package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +0 -1
- /package/dist/{martyrs → node_modules/.pnpm/@vue_shared@3.5.13}/node_modules/@vue/shared/dist/shared.esm-bundler.js +0 -0
package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { inject, reactive, ref, computed, onMounted, createElementBlock, openBlock, createElementVNode, unref, Fragment, renderList, toDisplayString, createCommentVNode } from "vue";
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
const
|
|
1
|
+
import { inject, reactive, ref, computed, onMounted, createElementBlock, openBlock, createElementVNode, unref, createVNode, Fragment, renderList, toDisplayString, createBlock, createCommentVNode, withCtx, createTextVNode } from "vue";
|
|
2
|
+
import _sfc_main$1 from "../../../../components/Checkbox/Checkbox.vue.js";
|
|
3
|
+
import _sfc_main$2 from "../../../../components/Button/Button.vue.js";
|
|
4
|
+
import Loader from "../../../../components/Loader/Loader.vue.js";
|
|
5
|
+
const _hoisted_1 = {
|
|
6
6
|
key: 0,
|
|
7
|
-
class: "
|
|
7
|
+
class: "pd-large t-center t-transp"
|
|
8
8
|
};
|
|
9
|
-
const
|
|
9
|
+
const _hoisted_2 = {
|
|
10
10
|
key: 1,
|
|
11
|
-
class: "
|
|
11
|
+
class: "gap-thin flex-column flex"
|
|
12
12
|
};
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const _hoisted_10 = ["disabled"];
|
|
13
|
+
const _hoisted_3 = { class: "flex w-100 flex-v-center gap-small mn-r-small" };
|
|
14
|
+
const _hoisted_4 = { class: "h4" };
|
|
15
|
+
const _hoisted_5 = { class: "flex-column flex gap-micro" };
|
|
16
|
+
const _hoisted_6 = { class: "fw-medium lh-1" };
|
|
17
|
+
const _hoisted_7 = { class: "p-small t-transp lh-1" };
|
|
18
|
+
const _hoisted_8 = { class: "flex flex-end gap-small mn-t-thin" };
|
|
20
19
|
const _sfc_main = {
|
|
21
20
|
__name: "NotificationPreferences",
|
|
22
21
|
setup(__props) {
|
|
@@ -115,54 +114,61 @@ const _sfc_main = {
|
|
|
115
114
|
originalPreferences.value = { ...preferences };
|
|
116
115
|
});
|
|
117
116
|
return (_ctx, _cache) => {
|
|
118
|
-
return openBlock(), createElementBlock("div",
|
|
119
|
-
_cache[
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
createElementVNode("p", null, "Loading preferences...", -1)
|
|
124
|
-
]))) : (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
117
|
+
return openBlock(), createElementBlock("div", null, [
|
|
118
|
+
_cache[1] || (_cache[1] = createElementVNode("p", { class: "t-transp mn-b-small" }, "Choose how you want to receive notifications", -1)),
|
|
119
|
+
unref(loading) ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
120
|
+
createVNode(Loader)
|
|
121
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
125
122
|
(openBlock(true), createElementBlock(Fragment, null, renderList(preferences, (enabled, channelType) => {
|
|
126
123
|
return openBlock(), createElementBlock("div", {
|
|
127
124
|
key: channelType,
|
|
128
|
-
class: "
|
|
125
|
+
class: "flex flex-v-center flex-between bg-light radius-small pd-small"
|
|
129
126
|
}, [
|
|
130
|
-
createElementVNode("div",
|
|
131
|
-
createElementVNode("div",
|
|
132
|
-
createElementVNode("div",
|
|
133
|
-
createElementVNode("
|
|
134
|
-
createElementVNode("p",
|
|
127
|
+
createElementVNode("div", _hoisted_3, [
|
|
128
|
+
createElementVNode("div", _hoisted_4, toDisplayString(getChannelIcon(channelType)), 1),
|
|
129
|
+
createElementVNode("div", _hoisted_5, [
|
|
130
|
+
createElementVNode("p", _hoisted_6, toDisplayString(getChannelName(channelType)), 1),
|
|
131
|
+
createElementVNode("p", _hoisted_7, toDisplayString(getChannelDescription(channelType)), 1)
|
|
135
132
|
])
|
|
136
133
|
]),
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
_cache[1] || (_cache[1] = createElementVNode("span", { class: "toggle-slider" }, null, -1))
|
|
144
|
-
])
|
|
134
|
+
createVNode(_sfc_main$1, {
|
|
135
|
+
mode: "switch",
|
|
136
|
+
radio: enabled,
|
|
137
|
+
"onUpdate:radio": ($event) => updatePreference(channelType, $event),
|
|
138
|
+
class: "flex-shrink-0"
|
|
139
|
+
}, null, 8, ["radio", "onUpdate:radio"])
|
|
145
140
|
]);
|
|
146
141
|
}), 128)),
|
|
147
|
-
createElementVNode("div",
|
|
148
|
-
|
|
149
|
-
class: "save-btn",
|
|
150
|
-
disabled: !hasChanges.value || saving.value,
|
|
151
|
-
onClick: savePreferences
|
|
152
|
-
}, toDisplayString(saving.value ? "Saving..." : "Save Changes"), 9, _hoisted_10),
|
|
153
|
-
hasChanges.value ? (openBlock(), createElementBlock("button", {
|
|
142
|
+
createElementVNode("div", _hoisted_8, [
|
|
143
|
+
hasChanges.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
154
144
|
key: 0,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
145
|
+
submit: resetChanges,
|
|
146
|
+
showLoader: false,
|
|
147
|
+
showSucces: false,
|
|
148
|
+
class: "bg-white t-dark"
|
|
149
|
+
}, {
|
|
150
|
+
default: withCtx(() => _cache[0] || (_cache[0] = [
|
|
151
|
+
createTextVNode(" Cancel ")
|
|
152
|
+
])),
|
|
153
|
+
_: 1
|
|
154
|
+
})) : createCommentVNode("", true),
|
|
155
|
+
createVNode(_sfc_main$2, {
|
|
156
|
+
submit: savePreferences,
|
|
157
|
+
validation: !hasChanges.value || saving.value,
|
|
158
|
+
class: "bg-main t-white"
|
|
159
|
+
}, {
|
|
160
|
+
default: withCtx(() => [
|
|
161
|
+
createTextVNode(toDisplayString(saving.value ? "Saving..." : "Save Changes"), 1)
|
|
162
|
+
]),
|
|
163
|
+
_: 1
|
|
164
|
+
}, 8, ["validation"])
|
|
158
165
|
])
|
|
159
166
|
]))
|
|
160
167
|
]);
|
|
161
168
|
};
|
|
162
169
|
}
|
|
163
170
|
};
|
|
164
|
-
const NotificationPreferences = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-420a3f66"]]);
|
|
165
171
|
export {
|
|
166
|
-
|
|
172
|
+
_sfc_main as default
|
|
167
173
|
};
|
|
168
174
|
//# sourceMappingURL=NotificationPreferences.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationPreferences.vue.js","sources":["../../../../../../../src/modules/notifications/components/sections/NotificationPreferences.vue"],"sourcesContent":["<template>\n <div
|
|
1
|
+
{"version":3,"file":"NotificationPreferences.vue.js","sources":["../../../../../../../src/modules/notifications/components/sections/NotificationPreferences.vue"],"sourcesContent":["<template>\n <div>\n <p class=\"t-transp mn-b-small\">Choose how you want to receive notifications</p>\n\n <div v-if=\"loading\" class=\"pd-large t-center t-transp\">\n <Loader />\n </div>\n\n <div v-else class=\"gap-thin flex-column flex\">\n <div\n v-for=\"(enabled, channelType) in preferences\"\n :key=\"channelType\"\n class=\"flex flex-v-center flex-between bg-light radius-small pd-small\"\n >\n <div class=\"flex w-100 flex-v-center gap-small mn-r-small\">\n <div class=\"h4\">{{ getChannelIcon(channelType) }}</div>\n <div class=\"flex-column flex gap-micro\">\n <p class=\"fw-medium lh-1\">{{ getChannelName(channelType) }}</p>\n <p class=\"p-small t-transp lh-1\">{{ getChannelDescription(channelType) }}</p>\n </div>\n </div>\n <Checkbox\n mode=\"switch\"\n :radio=\"enabled\"\n @update:radio=\"updatePreference(channelType, $event)\"\n class=\"flex-shrink-0\"\n />\n </div>\n\n <div class=\"flex flex-end gap-small mn-t-thin\">\n <Button\n v-if=\"hasChanges\"\n :submit=\"resetChanges\"\n :showLoader=\"false\"\n :showSucces=\"false\"\n class=\"bg-white t-dark\"\n >\n Cancel\n </Button>\n <Button\n :submit=\"savePreferences\"\n :validation=\"!hasChanges || saving\"\n class=\"bg-main t-white\"\n >\n {{ saving ? 'Saving...' : 'Save Changes' }}\n </Button>\n </div>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, reactive, computed, onMounted, inject } from 'vue';\nimport Checkbox from '@martyrs/src/components/Checkbox/Checkbox.vue';\nimport Button from '@martyrs/src/components/Button/Button.vue';\nimport Loader from '@martyrs/src/components/Loader/Loader.vue';\n\n// Get notification preferences functionality\nconst { \n preferences: storePreferences,\n loading,\n getPreferences,\n updatePreferences\n} = inject('useNotifications')();\n\n// Local reactive state for form\nconst preferences = reactive({...storePreferences.value});\nconst originalPreferences = ref({});\nconst saving = ref(false);\n\n// Computed properties\nconst hasChanges = computed(() => {\n return Object.keys(preferences).some(key => \n preferences[key] !== originalPreferences.value[key]\n );\n});\n\n// Methods\nconst updatePreference = (channelType, value) => {\n preferences[channelType] = value;\n};\n\nconst savePreferences = async () => {\n try {\n saving.value = true;\n await updatePreferences(preferences);\n originalPreferences.value = {...preferences};\n saving.value = false;\n } catch (error) {\n console.error('Error saving preferences:', error);\n saving.value = false;\n }\n};\n\nconst resetChanges = () => {\n Object.keys(preferences).forEach(key => {\n preferences[key] = originalPreferences.value[key];\n });\n};\n\nconst getChannelIcon = (channelType) => {\n switch (channelType) {\n case 'web': return '🖥️';\n case 'push': return '📱';\n case 'email': return '📧';\n case 'sms': return '📱';\n case 'telegram': return '📬';\n case 'whatsapp': return '💬';\n default: return '🔔';\n }\n};\n\nconst getChannelName = (channelType) => {\n switch (channelType) {\n case 'web': return 'Web Notifications';\n case 'push': return 'Mobile Push Notifications';\n case 'email': return 'Email Notifications';\n case 'sms': return 'SMS Notifications';\n case 'telegram': return 'Telegram Messages';\n case 'whatsapp': return 'WhatsApp Messages';\n default: return channelType;\n }\n};\n\nconst getChannelDescription = (channelType) => {\n switch (channelType) {\n case 'web': \n return 'Real-time notifications in your browser';\n case 'push': \n return 'Notifications on your mobile device even when the app is closed';\n case 'email': \n return 'Receive notifications in your email inbox';\n case 'sms': \n return 'Get text messages for important notifications';\n case 'telegram': \n return 'Receive notifications via Telegram bot';\n case 'whatsapp': \n return 'Get notifications as WhatsApp messages';\n default: \n return '';\n }\n};\n\n// Lifecycle\nonMounted(async () => {\n await getPreferences();\n \n // Copy store preferences to local state\n Object.keys(storePreferences.value).forEach(key => {\n preferences[key] = storePreferences.value[key];\n });\n \n // Create a deep copy of the original preferences\n originalPreferences.value = {...preferences};\n});\n</script>\n\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0DA,UAAM;AAAA,MACJ,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI,OAAO,kBAAkB,EAAC;AAG9B,UAAM,cAAc,SAAS,EAAC,GAAG,iBAAiB,MAAK,CAAC;AACxD,UAAM,sBAAsB,IAAI,EAAE;AAClC,UAAM,SAAS,IAAI,KAAK;AAGxB,UAAM,aAAa,SAAS,MAAM;AAChC,aAAO,OAAO,KAAK,WAAW,EAAE;AAAA,QAAK,SACnC,YAAY,GAAG,MA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,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT,KAAK;AACH,iBAAO;AAAA,QACT;AACE,iBAAO;AAAA,MACb;AAAA,IACA;AAGA,cAAU,YAAY;AACpB,YAAM,eAAc;AAGpB,aAAO,KAAK,iBAAiB,KAAK,EAAE,QAAQ,SAAO;AACjD,oBAAY,GAAG,IAAI,iBAAiB,MAAM,GAAG;AAAA,MAC/C,CAAC;AAGD,0BAAoB,QAAQ,EAAC,GAAG,YAAW;AAAA,IAC7C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,68 +1,18 @@
|
|
|
1
|
-
import { inject,
|
|
2
|
-
import
|
|
1
|
+
import { inject, createBlock, openBlock, withCtx, createElementBlock, Fragment, renderList } from "vue";
|
|
2
|
+
import _sfc_main$1 from "../../../../components/Feed/Feed.vue.js";
|
|
3
3
|
import NotificationItem from "../blocks/NotificationItem.vue.js";
|
|
4
4
|
import { state } from "../../../auth/views/store/auth.js";
|
|
5
|
-
|
|
6
|
-
import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
7
|
-
const _hoisted_1 = { class: "notifications-list-container" };
|
|
8
|
-
const _hoisted_2 = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "notifications-header"
|
|
11
|
-
};
|
|
12
|
-
const _hoisted_3 = {
|
|
13
|
-
key: 1,
|
|
14
|
-
class: "notifications-loading"
|
|
15
|
-
};
|
|
16
|
-
const _hoisted_4 = {
|
|
17
|
-
key: 2,
|
|
18
|
-
class: "notifications-empty"
|
|
19
|
-
};
|
|
20
|
-
const _hoisted_5 = {
|
|
21
|
-
key: 3,
|
|
22
|
-
class: "notifications-items"
|
|
23
|
-
};
|
|
24
|
-
const _hoisted_6 = {
|
|
25
|
-
key: 4,
|
|
26
|
-
class: "notifications-footer"
|
|
27
|
-
};
|
|
5
|
+
import { actions } from "../../store/notifications.store.js";
|
|
28
6
|
const _sfc_main = {
|
|
29
7
|
__name: "NotificationsList",
|
|
30
8
|
setup(__props) {
|
|
31
|
-
|
|
32
|
-
const {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
getNotifications,
|
|
39
|
-
handleNotificationAction
|
|
40
|
-
} = inject("useNotifications")();
|
|
41
|
-
const filterType = ref("all");
|
|
42
|
-
const filteredNotifications = computed(() => {
|
|
43
|
-
let filtered = [...notifications.value];
|
|
44
|
-
if (filterType.value === "unread") {
|
|
45
|
-
filtered = filtered.filter((n) => n.status !== "read");
|
|
46
|
-
} else if (filterType.value === "read") {
|
|
47
|
-
filtered = filtered.filter((n) => n.status === "read");
|
|
48
|
-
} else if (filterType.value !== "all") {
|
|
49
|
-
filtered = filtered.filter((n) => n.type === filterType.value);
|
|
50
|
-
}
|
|
51
|
-
return filtered.sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt));
|
|
52
|
-
});
|
|
53
|
-
const emptyMessage = computed(() => {
|
|
54
|
-
if (notifications.value.length === 0) {
|
|
55
|
-
return "You have no notifications";
|
|
56
|
-
}
|
|
57
|
-
switch (filterType.value) {
|
|
58
|
-
case "unread":
|
|
59
|
-
return "You have no unread notifications";
|
|
60
|
-
case "read":
|
|
61
|
-
return "You have no read notifications";
|
|
62
|
-
default:
|
|
63
|
-
return `You have no ${filterType.value} notifications`;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
9
|
+
const { handleNotificationAction } = inject("useNotifications")();
|
|
10
|
+
const fetchNotifications = async (options) => {
|
|
11
|
+
const userId = state.user._id;
|
|
12
|
+
if (!userId) return [];
|
|
13
|
+
const data = await actions.getNotifications(userId);
|
|
14
|
+
return data || [];
|
|
15
|
+
};
|
|
66
16
|
const handleNotificationClick = (notification) => {
|
|
67
17
|
if (notification._id) {
|
|
68
18
|
handleNotificationAction({
|
|
@@ -71,73 +21,43 @@ const _sfc_main = {
|
|
|
71
21
|
});
|
|
72
22
|
}
|
|
73
23
|
};
|
|
74
|
-
const refreshNotifications = () => {
|
|
75
|
-
const userId = state.user._id;
|
|
76
|
-
if (userId) {
|
|
77
|
-
getNotifications(userId);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
const formatTime = (timestamp) => {
|
|
81
|
-
if (!timestamp) return "";
|
|
82
|
-
const now = /* @__PURE__ */ new Date();
|
|
83
|
-
const date = new Date(timestamp);
|
|
84
|
-
const diffSeconds = Math.floor((now - date) / 1e3);
|
|
85
|
-
if (diffSeconds < 60) {
|
|
86
|
-
return "Just now";
|
|
87
|
-
} else if (diffSeconds < 3600) {
|
|
88
|
-
const minutes = Math.floor(diffSeconds / 60);
|
|
89
|
-
return `${minutes} ${minutes === 1 ? "minute" : "minutes"} ago`;
|
|
90
|
-
} else if (diffSeconds < 86400) {
|
|
91
|
-
const hours = Math.floor(diffSeconds / 3600);
|
|
92
|
-
return `${hours} ${hours === 1 ? "hour" : "hours"} ago`;
|
|
93
|
-
} else {
|
|
94
|
-
return date.toLocaleDateString(void 0, {
|
|
95
|
-
year: "numeric",
|
|
96
|
-
month: "short",
|
|
97
|
-
day: "numeric",
|
|
98
|
-
hour: "2-digit",
|
|
99
|
-
minute: "2-digit"
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
onMounted(() => {
|
|
104
|
-
const userId = state.user._id;
|
|
105
|
-
if (userId && notifications.value.length === 0 && !loading.value) {
|
|
106
|
-
getNotifications(userId);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
24
|
return (_ctx, _cache) => {
|
|
110
|
-
return openBlock(),
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
25
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
26
|
+
states: {
|
|
27
|
+
empty: {
|
|
28
|
+
title: "No Notifications",
|
|
29
|
+
description: "You have no notifications yet"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
store: {
|
|
33
|
+
read: fetchNotifications
|
|
34
|
+
},
|
|
35
|
+
options: {
|
|
36
|
+
limit: 20
|
|
37
|
+
},
|
|
38
|
+
skeleton: {
|
|
39
|
+
structure: [
|
|
40
|
+
{ block: "text", size: "small" },
|
|
41
|
+
{ block: "text", size: "large" }
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
class: "gap-thin cols-1"
|
|
45
|
+
}, {
|
|
46
|
+
default: withCtx(({ items }) => [
|
|
47
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(items, (notification) => {
|
|
121
48
|
return openBlock(), createBlock(NotificationItem, {
|
|
122
49
|
key: notification._id,
|
|
123
50
|
notification,
|
|
124
51
|
onClick: ($event) => handleNotificationClick(notification)
|
|
125
52
|
}, null, 8, ["notification", "onClick"]);
|
|
126
53
|
}), 128))
|
|
127
|
-
])
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
key: 0,
|
|
131
|
-
class: "refresh-btn",
|
|
132
|
-
onClick: refreshNotifications
|
|
133
|
-
}, " 🔄 Last updated: " + toDisplayString(formatTime(unref(lastSync))), 1)) : createCommentVNode("", true)
|
|
134
|
-
])) : createCommentVNode("", true)
|
|
135
|
-
]);
|
|
54
|
+
]),
|
|
55
|
+
_: 1
|
|
56
|
+
}, 8, ["store"]);
|
|
136
57
|
};
|
|
137
58
|
}
|
|
138
59
|
};
|
|
139
|
-
const NotificationsList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5af8a2ed"]]);
|
|
140
60
|
export {
|
|
141
|
-
|
|
61
|
+
_sfc_main as default
|
|
142
62
|
};
|
|
143
63
|
//# sourceMappingURL=NotificationsList.vue.js.map
|
package/dist/martyrs/src/modules/notifications/components/sections/NotificationsList.vue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsList.vue.js","sources":["../../../../../../../src/modules/notifications/components/sections/NotificationsList.vue"],"sourcesContent":["<template>\n <
|
|
1
|
+
{"version":3,"file":"NotificationsList.vue.js","sources":["../../../../../../../src/modules/notifications/components/sections/NotificationsList.vue"],"sourcesContent":["<template>\n <Feed\n :states=\"{\n empty: {\n title: 'No Notifications',\n description: 'You have no notifications yet'\n }\n }\"\n :store=\"{\n read: fetchNotifications\n }\"\n :options=\"{\n limit: 20\n }\"\n :skeleton=\"{\n structure: [\n { block: 'text', size: 'small' },\n { block: 'text', size: 'large' }\n ]\n }\"\n v-slot=\"{ items }\"\n class=\"gap-thin cols-1\"\n >\n <NotificationItem\n v-for=\"notification in items\"\n :key=\"notification._id\"\n :notification=\"notification\"\n @click=\"handleNotificationClick(notification)\"\n />\n </Feed>\n</template>\n\n<script setup>\nimport { inject } from 'vue';\nimport Feed from '@martyrs/src/components/Feed/Feed.vue';\nimport NotificationItem from '../blocks/NotificationItem.vue';\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth.js';\nimport { actions } from '@martyrs/src/modules/notifications/store/notifications.store.js';\n\nconst { handleNotificationAction } = inject('useNotifications')();\n\nconst fetchNotifications = async (options) => {\n const userId = auth.state.user._id;\n if (!userId) return [];\n\n const data = await actions.getNotifications(userId);\n return data || [];\n};\n\nconst handleNotificationClick = (notification) => {\n if (notification._id) {\n handleNotificationAction({\n notificationId: notification._id,\n ...notification.metadata\n });\n }\n};\n</script>\n"],"names":["auth.state"],"mappings":";;;;;;;;AAuCA,UAAM,EAAE,yBAAwB,IAAK,OAAO,kBAAkB,EAAC;AAE/D,UAAM,qBAAqB,OAAO,YAAY;AAC5C,YAAM,SAASA,MAAW,KAAK;AAC/B,UAAI,CAAC,OAAQ,QAAO,CAAA;AAEpB,YAAM,OAAO,MAAM,QAAQ,iBAAiB,MAAM;AAClD,aAAO,QAAQ,CAAA;AAAA,IACjB;AAEA,UAAM,0BAA0B,CAAC,iBAAiB;AAChD,UAAI,aAAa,KAAK;AACpB,iCAAyB;AAAA,UACvB,gBAAgB,aAAa;AAAA,UAC7B,GAAG,aAAa;AAAA,QACtB,CAAK;AAAA,MACH;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,8 +5,8 @@ import * as notifications_store from "./store/notifications.store.js";
|
|
|
5
5
|
import { wsManager } from "../core/views/classes/ws.manager.js";
|
|
6
6
|
import { Preferences } from "../../../node_modules/.pnpm/@capacitor_preferences@7.0.2_@capacitor_core@7.4.4/node_modules/@capacitor/preferences/dist/esm/index.js";
|
|
7
7
|
import _sfc_main from "./components/layouts/NotificationsLayout.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import _sfc_main$2 from "./components/sections/NotificationPreferences.vue.js";
|
|
9
|
+
import _sfc_main$3 from "./components/sections/NotificationsList.vue.js";
|
|
10
10
|
import _sfc_main$1 from "./components/pages/Notifications.vue.js";
|
|
11
11
|
import NotificationItem from "./components/blocks/NotificationItem.vue.js";
|
|
12
12
|
import NotificationBadge from "./components/elements/NotificationBadge.vue.js";
|
|
@@ -324,22 +324,25 @@ function initializeNotifications(app, store, router, options = {}) {
|
|
|
324
324
|
const isServer = typeof window === "undefined";
|
|
325
325
|
const autoInit = !isServer && options.autoInit !== false;
|
|
326
326
|
if (autoInit) {
|
|
327
|
-
notificationManager.initialize();
|
|
328
327
|
watch(
|
|
329
|
-
() => store.core.state.session.
|
|
330
|
-
async (
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
console.log("[Notifications] User logged in, re-registering device...");
|
|
328
|
+
() => store.core.state.session.userId,
|
|
329
|
+
async (userId, oldUserId) => {
|
|
330
|
+
console.log("[Notifications] Watch triggered, userId:", userId, "oldUserId:", oldUserId);
|
|
331
|
+
if (userId && !oldUserId) {
|
|
332
|
+
console.log("[Notifications] User authenticated, initializing WebSocket...", userId);
|
|
335
333
|
await store.notifications.actions.reregisterDeviceAfterLogin();
|
|
336
334
|
notificationManager.disconnect();
|
|
337
335
|
await notificationManager.initialize();
|
|
338
|
-
} else if (!
|
|
336
|
+
} else if (!userId && oldUserId) {
|
|
339
337
|
console.log("[Notifications] User logged out, resetting notifications...");
|
|
338
|
+
notificationManager.disconnect();
|
|
340
339
|
store.notifications.mutations.resetNotifications();
|
|
340
|
+
} else if (!userId && !oldUserId) {
|
|
341
|
+
console.log("[Notifications] Anonymous user, initializing without WebSocket...");
|
|
342
|
+
await notificationManager.initialize();
|
|
341
343
|
}
|
|
342
|
-
}
|
|
344
|
+
},
|
|
345
|
+
{ immediate: true }
|
|
343
346
|
);
|
|
344
347
|
}
|
|
345
348
|
app.provide("useNotifications", () => {
|
|
@@ -371,8 +374,8 @@ const ModuleNotifications = {
|
|
|
371
374
|
// Blocks
|
|
372
375
|
NotificationItem,
|
|
373
376
|
// Sections
|
|
374
|
-
NotificationsList,
|
|
375
|
-
NotificationPreferences,
|
|
377
|
+
NotificationsList: _sfc_main$3,
|
|
378
|
+
NotificationPreferences: _sfc_main$2,
|
|
376
379
|
// Pages
|
|
377
380
|
Notifications: _sfc_main$1,
|
|
378
381
|
// Layouts
|
|
@@ -387,10 +390,10 @@ console.log(`[LOADING 37] Notifications module fully imported in ${totalTime?.du
|
|
|
387
390
|
export {
|
|
388
391
|
NotificationBadge,
|
|
389
392
|
NotificationItem,
|
|
390
|
-
NotificationPreferences,
|
|
393
|
+
_sfc_main$2 as NotificationPreferences,
|
|
391
394
|
_sfc_main$1 as Notifications,
|
|
392
395
|
_sfc_main as NotificationsLayout,
|
|
393
|
-
NotificationsList,
|
|
396
|
+
_sfc_main$3 as NotificationsList,
|
|
394
397
|
SSRUtils,
|
|
395
398
|
ModuleNotifications as default
|
|
396
399
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.client.js","sources":["../../../../../src/modules/notifications/notifications.client.js"],"sourcesContent":["// [LOADING 37] Notifications module import started\nperformance.mark('loading-37-start');\nconsole.log('[LOADING 37] Notifications module import started...');\n\nimport { toRefs, watch } from 'vue';\n// Router import\nimport addRoutes from '@martyrs/src/modules/core/views/router/addRoutes.js';\nimport { getRoutes } from './notifications.router.js';\n// Store\nimport * as storeNotifications from './store/notifications.store.js';\n// Global WebSocket import\nimport wsManager from '@martyrs/src/modules/core/views/classes/ws.manager.js';\n// Capacitor Preferences\nimport { Preferences } from '@capacitor/preferences';\n// Layouts\nimport NotificationsLayout from './components/layouts/NotificationsLayout.vue';\n// Sections\nimport NotificationPreferences from './components/sections/NotificationPreferences.vue';\nimport NotificationsList from './components/sections/NotificationsList.vue';\n// Pages\nimport Notifications from './components/pages/Notifications.vue';\n// Components\nimport NotificationItem from './components/blocks/NotificationItem.vue';\nimport NotificationBadge from './components/elements/NotificationBadge.vue';\n\nperformance.mark('loading-37-imports-end');\nconst importsTime = performance.measure('loading-37-imports', 'loading-37-start', 'loading-37-imports-end');\nconsole.log(`[LOADING 37] All imports completed in ${importsTime.duration.toFixed(2)}ms`);\n\n/**\n * Capacitor Push Notification handler\n */\nclass CapacitorPushHandler {\n constructor(store) {\n this.store = store;\n this.pushNotifications = null;\n this.device = null;\n this.isInitialized = false;\n }\n\n /**\n * Initialize Capacitor plugins\n */\n async initialize() {\n // Skip if running in SSR\n if (typeof window === 'undefined') {\n return false;\n }\n\n try {\n // Dynamic imports to prevent errors in web environment\n const { Capacitor } = await import('@capacitor/core');\n const { PushNotifications } = await import('@capacitor/push-notifications');\n const { Device } = await import('@capacitor/device');\n\n this.capacitor = Capacitor;\n this.pushNotifications = PushNotifications;\n this.device = Device;\n\n // Only proceed if running on a native platform\n if (!this.capacitor.isNativePlatform()) {\n return false;\n }\n\n this.isInitialized = true;\n return true;\n } catch (error) {\n console.error('Error importing Capacitor plugins:', error);\n return false;\n }\n }\n\n /**\n * Request permission and register for push notifications\n */\n async requestPermissions() {\n // Skip if running in SSR\n if (typeof window === 'undefined') {\n return false;\n }\n\n if (!this.isInitialized) {\n const initialized = await this.initialize();\n if (!initialized) return false;\n }\n\n try {\n // Request permission\n const permissionResult = await this.pushNotifications.requestPermissions();\n if (permissionResult.receive !== 'granted') {\n console.log('Push notification permission denied');\n return false;\n }\n\n // Set up event listeners\n this._setupListeners();\n\n // Register with Apple/Google\n await this.pushNotifications.register();\n return true;\n } catch (error) {\n console.error('Error requesting push notification permissions:', error);\n return false;\n }\n }\n\n /**\n * Setup push notification event listeners\n */\n _setupListeners() {\n // Registration event\n this.pushNotifications.addListener('registration', this._handleRegistration.bind(this));\n\n // Notification received event\n this.pushNotifications.addListener('pushNotificationReceived', this._handleNotificationReceived.bind(this));\n\n // Notification action performed event\n this.pushNotifications.addListener('pushNotificationActionPerformed', this._handleNotificationAction.bind(this));\n }\n\n /**\n * Handle registration token received\n */\n async _handleRegistration(token) {\n try {\n // Get device info\n const deviceInfo = await this.device.getInfo();\n const deviceId = await this.device.getId();\n\n // Prepare device data\n const deviceData = {\n deviceId: deviceId.uuid,\n deviceType: deviceInfo.platform.toLowerCase(),\n deviceToken: token.value,\n };\n\n // Store device info for re-registration after login\n try {\n await Preferences.set({\n key: 'notifications_device_id',\n value: deviceId.uuid\n });\n await Preferences.set({\n key: 'notifications_device_token',\n value: token.value\n });\n await Preferences.set({\n key: 'notifications_device_type',\n value: deviceInfo.platform.toLowerCase()\n });\n } catch (error) {\n console.warn('Could not save device info to preferences:', error);\n }\n\n // For anonymous users, add anonymousId\n if (!this.store.core.state.session.userId) {\n let anonymousId = null;\n try {\n const result = await Preferences.get({ key: 'notifications_anonymous_id' });\n anonymousId = result.value;\n } catch (error) {\n console.warn('Could not get anonymous ID from preferences:', error);\n }\n \n if (!anonymousId) {\n anonymousId = 'anon_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);\n try {\n await Preferences.set({\n key: 'notifications_anonymous_id',\n value: anonymousId\n });\n } catch (error) {\n console.warn('Could not save anonymous ID to preferences:', error);\n }\n }\n deviceData.anonymousId = anonymousId;\n }\n\n // Register device with backend\n await this.store.notifications.actions.registerDevice(deviceData);\n } catch (error) {\n console.error('Error handling push registration:', error);\n }\n }\n\n /**\n * Handle received notification\n */\n _handleNotificationReceived(notification) {\n // Add notification to store\n this.store.notifications.actions.addLocalNotification({\n title: notification.title,\n body: notification.body,\n data: notification.data || {},\n });\n }\n\n /**\n * Handle notification action (when user taps on notification)\n */\n _handleNotificationAction(actionData) {\n if (actionData.notification && actionData.notification.data) {\n this.store.notifications.actions.handleNotificationAction(actionData.notification.data);\n }\n }\n\n /**\n * Remove push notification listeners\n */\n removeListeners() {\n if (typeof window === 'undefined') {\n return;\n }\n\n if (this.pushNotifications) {\n this.pushNotifications.removeAllListeners();\n }\n }\n}\n\n/**\n * Notification Manager for coordinating WebSocket and Push notifications\n */\n\nclass NotificationManager {\n constructor(store, options = {}) {\n this.store = store;\n this.options = options;\n this.pushHandler = new CapacitorPushHandler(store);\n this.initialized = false;\n this.isServer = typeof window === 'undefined';\n }\n\n async registerWebPush(store) {\n if (!('Notification' in window) || !('serviceWorker' in navigator) || !('PushManager' in window)) {\n console.warn('Web Push не поддерживается в браузере');\n return;\n }\n\n const permission = await Notification.requestPermission();\n if (permission !== 'granted') {\n console.warn('Разрешение на уведомления не получено');\n return;\n }\n\n const registration = await navigator.serviceWorker.ready;\n const subscription = await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: 'BJtNnRrx05VQS0abnkHC-8gHJWpnmoqC_iQveENCmZOZIs-adWzqAiqFCdGVVd7CbiaLW-Q5iuIBDRgM9G-VnKg',\n });\n\n console.log('New subscription:', JSON.stringify(subscription));\n\n const deviceToken = JSON.stringify(subscription);\n const deviceId = await this.generateDeviceId();\n \n // Store device data for re-registration after login\n try {\n await Preferences.set({\n key: 'notifications_device_id',\n value: deviceId\n });\n await Preferences.set({\n key: 'notifications_device_token',\n value: deviceToken\n });\n await Preferences.set({\n key: 'notifications_device_type',\n value: 'web'\n });\n } catch (error) {\n console.warn('Could not save device info to preferences:', error);\n }\n\n const deviceData = {\n deviceToken,\n deviceType: 'web',\n deviceId\n };\n\n // For anonymous users, get or generate anonymousId\n if (!store.core.state.session.userId) {\n let anonymousId = null;\n try {\n const result = await Preferences.get({ key: 'notifications_anonymous_id' });\n anonymousId = result.value;\n } catch (error) {\n console.warn('Could not get anonymous ID from preferences:', error);\n }\n \n if (!anonymousId) {\n anonymousId = 'anon_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);\n try {\n await Preferences.set({\n key: 'notifications_anonymous_id',\n value: anonymousId\n });\n } catch (error) {\n console.warn('Could not save anonymous ID to preferences:', error);\n }\n }\n deviceData.anonymousId = anonymousId;\n }\n\n // Register device\n console.log('[Notifications] Registering device with data:', deviceData);\n await store.notifications.actions.registerDevice(deviceData);\n }\n\n async generateDeviceId() {\n // Try to get or generate a persistent device ID\n try {\n const result = await Preferences.get({ key: 'notifications_device_id' });\n let deviceId = result.value;\n \n if (!deviceId) {\n deviceId = 'web_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);\n await Preferences.set({\n key: 'notifications_device_id',\n value: deviceId\n });\n }\n return deviceId;\n } catch (error) {\n console.warn('Could not access preferences for device ID:', error);\n return 'web_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);\n }\n }\n\n async initialize() {\n if (this.initialized || this.isServer) return;\n\n const userId = this.store.core.state.session.userId;\n \n // Connect WebSocket only for authenticated users\n if (userId) {\n console.log('Connecting to websockets via notifications');\n wsManager.initialize({\n wsUrl: process.env.WSS_URL,\n maxReconnectAttempts: 10,\n reconnectDelay: 2000,\n });\n\n await wsManager.connect(userId);\n\n wsManager.removeModuleListeners('notification');\n\n await wsManager.subscribeModule('notification');\n\n wsManager.addEventListener(\n 'notification',\n data => {\n this.store.notifications.actions.addLocalNotification(data.data);\n },\n { module: 'notification' }\n );\n\n // Load notifications from API for authenticated users\n await this.store.notifications.actions.getNotifications(userId);\n } else {\n console.log('Initializing notifications for anonymous user');\n }\n\n // Enable push notifications for both authenticated and anonymous users\n // Skip auto-init for mobile apps - will be triggered manually from Walkthrough\n if (this.options.enablePush !== false && !process.env.MOBILE_APP) {\n await this.pushHandler.requestPermissions();\n await this.registerWebPush(this.store);\n }\n\n this.initialized = true;\n }\n\n disconnect() {\n if (this.isServer) return;\n\n wsManager.removeModuleListeners('notification');\n this.pushHandler.removeListeners();\n this.initialized = false;\n }\n}\n\n/**\n * Server-side utility for pre-fetching notification data\n */\nconst SSRUtils = {\n /**\n * Pre-fetch notifications for SSR\n * @param {Object} store - Store instance\n * @param {Object} context - SSR context\n */\n async prefetchNotifications(store, context) {\n try {\n const userId = store.core.state.session.userId;\n if (userId) {\n // Fetch notifications without WebSocket or push setup\n await store.notifications.actions.getNotifications(userId);\n }\n } catch (error) {\n console.error('Error pre-fetching notifications for SSR:', error);\n }\n },\n};\n\n/**\n * Function to initialize the notifications module\n * @param {Object} app - Vue app instance\n * @param {Object} store - Vuex/Pinia store\n * @param {Object} router - Vue Router instance\n * @param {Object} options - Configuration options\n */\nfunction initializeNotifications(app, store, router, options = {}) {\n // Add routes and store\n const routes = getRoutes(options);\n routes.forEach(({ parentName, config }) => {\n addRoutes(router, { ...config, parentName });\n });\n\n store.addStore('notifications', storeNotifications);\n\n // Initialize global WebSocket if needed\n if (options.wsUrl) {\n wsManager.initialize({ wsUrl: process.env.WSS_URL });\n }\n\n // Create notification manager\n const notificationManager = new NotificationManager(store, {\n enablePush: options.enablePush !== false,\n maxReconnectAttempts: options.maxReconnectAttempts || 5,\n reconnectDelay: options.reconnectDelay || 3000,\n pingInterval: options.pingInterval || 30000,\n });\n\n // Attach notification manager to store for access in components\n store.notificationManager = notificationManager;\n\n // Don't auto-initialize on server\n const isServer = typeof window === 'undefined';\n const autoInit = !isServer && options.autoInit !== false;\n\n if (autoInit) {\n // Initialize immediately (supports both authenticated and anonymous users)\n notificationManager.initialize();\n\n // Watch for user login/logout using store.core.state.session\n watch(\n () => store.core.state.session.token,\n async (token, oldToken) => {\n const isAuthenticated = !!token;\n const wasAuthenticated = !!oldToken;\n\n if (isAuthenticated && !wasAuthenticated) {\n // Re-register device for authenticated user\n console.log('[Notifications] User logged in, re-registering device...');\n await store.notifications.actions.reregisterDeviceAfterLogin();\n // Reinitialize notifications for authenticated user\n notificationManager.disconnect();\n await notificationManager.initialize();\n } else if (!isAuthenticated && wasAuthenticated) {\n // Keep notifications active for anonymous users, just reset user-specific data\n console.log('[Notifications] User logged out, resetting notifications...');\n store.notifications.mutations.resetNotifications();\n }\n }\n );\n }\n\n // Provide composable for components to access notification functionality\n app.provide('useNotifications', () => {\n return {\n ...toRefs(store.notifications.state),\n ...store.notifications.actions,\n ...store.notifications.mutations,\n init: notificationManager.initialize.bind(notificationManager),\n disconnect: notificationManager.disconnect.bind(notificationManager),\n isServer,\n };\n });\n\n return notificationManager;\n}\n\n// Module export\nconst ModuleNotifications = {\n initialize: initializeNotifications,\n SSR: SSRUtils, // Export SSR utilities\n views: {\n store: {\n storeNotifications,\n },\n router: {\n getRoutes,\n },\n components: {\n // Elements\n NotificationBadge,\n // Blocks\n NotificationItem,\n // Sections\n NotificationsList,\n NotificationPreferences,\n // Pages\n Notifications,\n // Layouts\n NotificationsLayout,\n },\n },\n};\n\n// Component exports\nexport {\n // Elements\n NotificationBadge,\n // Blocks\n NotificationItem,\n NotificationPreferences,\n // Pages\n Notifications,\n // Layouts\n NotificationsLayout,\n // Sections\n NotificationsList,\n // SSR Utilities\n SSRUtils,\n};\n\n// [LOADING 37] Notifications module import completed\nperformance.mark('loading-37-end');\nperformance.measure('loading-37-total', 'loading-37-start', 'loading-37-end');\nconst totalTime = performance.getEntriesByName('loading-37-total')[0];\nconsole.log(`[LOADING 37] Notifications module fully imported in ${totalTime?.duration?.toFixed(2)}ms`);\n\nexport default ModuleNotifications;\n"],"names":["storeNotifications","Notifications","NotificationsLayout"],"mappings":";;;;;;;;;;;;AACA,YAAY,KAAK,kBAAkB;AACnC,QAAQ,IAAI,qDAAqD;AAuBjE,YAAY,KAAK,wBAAwB;AACzC,MAAM,cAAc,YAAY,QAAQ,sBAAsB,oBAAoB,wBAAwB;AAC1G,QAAQ,IAAI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C;AACpE,QAAQ,IAAI,uDAAuD,WAAW,UAAU,QAAQ,CAAC,CAAC,IAAI;"}
|
|
1
|
+
{"version":3,"file":"notifications.client.js","sources":["../../../../../src/modules/notifications/notifications.client.js"],"sourcesContent":["// [LOADING 37] Notifications module import started\nperformance.mark('loading-37-start');\nconsole.log('[LOADING 37] Notifications module import started...');\n\nimport { toRefs, watch } from 'vue';\n// Router import\nimport addRoutes from '@martyrs/src/modules/core/views/router/addRoutes.js';\nimport { getRoutes } from './notifications.router.js';\n// Store\nimport * as storeNotifications from './store/notifications.store.js';\n// Global WebSocket import\nimport wsManager from '@martyrs/src/modules/core/views/classes/ws.manager.js';\n// Capacitor Preferences\nimport { Preferences } from '@capacitor/preferences';\n// Layouts\nimport NotificationsLayout from './components/layouts/NotificationsLayout.vue';\n// Sections\nimport NotificationPreferences from './components/sections/NotificationPreferences.vue';\nimport NotificationsList from './components/sections/NotificationsList.vue';\n// Pages\nimport Notifications from './components/pages/Notifications.vue';\n// Components\nimport NotificationItem from './components/blocks/NotificationItem.vue';\nimport NotificationBadge from './components/elements/NotificationBadge.vue';\n\nperformance.mark('loading-37-imports-end');\nconst importsTime = performance.measure('loading-37-imports', 'loading-37-start', 'loading-37-imports-end');\nconsole.log(`[LOADING 37] All imports completed in ${importsTime.duration.toFixed(2)}ms`);\n\n/**\n * Capacitor Push Notification handler\n */\nclass CapacitorPushHandler {\n constructor(store) {\n this.store = store;\n this.pushNotifications = null;\n this.device = null;\n this.isInitialized = false;\n }\n\n /**\n * Initialize Capacitor plugins\n */\n async initialize() {\n // Skip if running in SSR\n if (typeof window === 'undefined') {\n return false;\n }\n\n try {\n // Dynamic imports to prevent errors in web environment\n const { Capacitor } = await import('@capacitor/core');\n const { PushNotifications } = await import('@capacitor/push-notifications');\n const { Device } = await import('@capacitor/device');\n\n this.capacitor = Capacitor;\n this.pushNotifications = PushNotifications;\n this.device = Device;\n\n // Only proceed if running on a native platform\n if (!this.capacitor.isNativePlatform()) {\n return false;\n }\n\n this.isInitialized = true;\n return true;\n } catch (error) {\n console.error('Error importing Capacitor plugins:', error);\n return false;\n }\n }\n\n /**\n * Request permission and register for push notifications\n */\n async requestPermissions() {\n // Skip if running in SSR\n if (typeof window === 'undefined') {\n return false;\n }\n\n if (!this.isInitialized) {\n const initialized = await this.initialize();\n if (!initialized) return false;\n }\n\n try {\n // Request permission\n const permissionResult = await this.pushNotifications.requestPermissions();\n if (permissionResult.receive !== 'granted') {\n console.log('Push notification permission denied');\n return false;\n }\n\n // Set up event listeners\n this._setupListeners();\n\n // Register with Apple/Google\n await this.pushNotifications.register();\n return true;\n } catch (error) {\n console.error('Error requesting push notification permissions:', error);\n return false;\n }\n }\n\n /**\n * Setup push notification event listeners\n */\n _setupListeners() {\n // Registration event\n this.pushNotifications.addListener('registration', this._handleRegistration.bind(this));\n\n // Notification received event\n this.pushNotifications.addListener('pushNotificationReceived', this._handleNotificationReceived.bind(this));\n\n // Notification action performed event\n this.pushNotifications.addListener('pushNotificationActionPerformed', this._handleNotificationAction.bind(this));\n }\n\n /**\n * Handle registration token received\n */\n async _handleRegistration(token) {\n try {\n // Get device info\n const deviceInfo = await this.device.getInfo();\n const deviceId = await this.device.getId();\n\n // Prepare device data\n const deviceData = {\n deviceId: deviceId.uuid,\n deviceType: deviceInfo.platform.toLowerCase(),\n deviceToken: token.value,\n };\n\n // Store device info for re-registration after login\n try {\n await Preferences.set({\n key: 'notifications_device_id',\n value: deviceId.uuid\n });\n await Preferences.set({\n key: 'notifications_device_token',\n value: token.value\n });\n await Preferences.set({\n key: 'notifications_device_type',\n value: deviceInfo.platform.toLowerCase()\n });\n } catch (error) {\n console.warn('Could not save device info to preferences:', error);\n }\n\n // For anonymous users, add anonymousId\n if (!this.store.core.state.session.userId) {\n let anonymousId = null;\n try {\n const result = await Preferences.get({ key: 'notifications_anonymous_id' });\n anonymousId = result.value;\n } catch (error) {\n console.warn('Could not get anonymous ID from preferences:', error);\n }\n \n if (!anonymousId) {\n anonymousId = 'anon_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);\n try {\n await Preferences.set({\n key: 'notifications_anonymous_id',\n value: anonymousId\n });\n } catch (error) {\n console.warn('Could not save anonymous ID to preferences:', error);\n }\n }\n deviceData.anonymousId = anonymousId;\n }\n\n // Register device with backend\n await this.store.notifications.actions.registerDevice(deviceData);\n } catch (error) {\n console.error('Error handling push registration:', error);\n }\n }\n\n /**\n * Handle received notification\n */\n _handleNotificationReceived(notification) {\n // Add notification to store\n this.store.notifications.actions.addLocalNotification({\n title: notification.title,\n body: notification.body,\n data: notification.data || {},\n });\n }\n\n /**\n * Handle notification action (when user taps on notification)\n */\n _handleNotificationAction(actionData) {\n if (actionData.notification && actionData.notification.data) {\n this.store.notifications.actions.handleNotificationAction(actionData.notification.data);\n }\n }\n\n /**\n * Remove push notification listeners\n */\n removeListeners() {\n if (typeof window === 'undefined') {\n return;\n }\n\n if (this.pushNotifications) {\n this.pushNotifications.removeAllListeners();\n }\n }\n}\n\n/**\n * Notification Manager for coordinating WebSocket and Push notifications\n */\n\nclass NotificationManager {\n constructor(store, options = {}) {\n this.store = store;\n this.options = options;\n this.pushHandler = new CapacitorPushHandler(store);\n this.initialized = false;\n this.isServer = typeof window === 'undefined';\n }\n\n async registerWebPush(store) {\n if (!('Notification' in window) || !('serviceWorker' in navigator) || !('PushManager' in window)) {\n console.warn('Web Push не поддерживается в браузере');\n return;\n }\n\n const permission = await Notification.requestPermission();\n if (permission !== 'granted') {\n console.warn('Разрешение на уведомления не получено');\n return;\n }\n\n const registration = await navigator.serviceWorker.ready;\n const subscription = await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: 'BJtNnRrx05VQS0abnkHC-8gHJWpnmoqC_iQveENCmZOZIs-adWzqAiqFCdGVVd7CbiaLW-Q5iuIBDRgM9G-VnKg',\n });\n\n console.log('New subscription:', JSON.stringify(subscription));\n\n const deviceToken = JSON.stringify(subscription);\n const deviceId = await this.generateDeviceId();\n \n // Store device data for re-registration after login\n try {\n await Preferences.set({\n key: 'notifications_device_id',\n value: deviceId\n });\n await Preferences.set({\n key: 'notifications_device_token',\n value: deviceToken\n });\n await Preferences.set({\n key: 'notifications_device_type',\n value: 'web'\n });\n } catch (error) {\n console.warn('Could not save device info to preferences:', error);\n }\n\n const deviceData = {\n deviceToken,\n deviceType: 'web',\n deviceId\n };\n\n // For anonymous users, get or generate anonymousId\n if (!store.core.state.session.userId) {\n let anonymousId = null;\n try {\n const result = await Preferences.get({ key: 'notifications_anonymous_id' });\n anonymousId = result.value;\n } catch (error) {\n console.warn('Could not get anonymous ID from preferences:', error);\n }\n \n if (!anonymousId) {\n anonymousId = 'anon_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);\n try {\n await Preferences.set({\n key: 'notifications_anonymous_id',\n value: anonymousId\n });\n } catch (error) {\n console.warn('Could not save anonymous ID to preferences:', error);\n }\n }\n deviceData.anonymousId = anonymousId;\n }\n\n // Register device\n console.log('[Notifications] Registering device with data:', deviceData);\n await store.notifications.actions.registerDevice(deviceData);\n }\n\n async generateDeviceId() {\n // Try to get or generate a persistent device ID\n try {\n const result = await Preferences.get({ key: 'notifications_device_id' });\n let deviceId = result.value;\n \n if (!deviceId) {\n deviceId = 'web_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);\n await Preferences.set({\n key: 'notifications_device_id',\n value: deviceId\n });\n }\n return deviceId;\n } catch (error) {\n console.warn('Could not access preferences for device ID:', error);\n return 'web_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9);\n }\n }\n\n async initialize() {\n if (this.initialized || this.isServer) return;\n\n const userId = this.store.core.state.session.userId;\n \n // Connect WebSocket only for authenticated users\n if (userId) {\n console.log('Connecting to websockets via notifications');\n wsManager.initialize({\n wsUrl: process.env.WSS_URL,\n maxReconnectAttempts: 10,\n reconnectDelay: 2000,\n });\n\n await wsManager.connect(userId);\n\n wsManager.removeModuleListeners('notification');\n\n await wsManager.subscribeModule('notification');\n\n wsManager.addEventListener(\n 'notification',\n data => {\n this.store.notifications.actions.addLocalNotification(data.data);\n },\n { module: 'notification' }\n );\n\n // Load notifications from API for authenticated users\n await this.store.notifications.actions.getNotifications(userId);\n } else {\n console.log('Initializing notifications for anonymous user');\n }\n\n // Enable push notifications for both authenticated and anonymous users\n // Skip auto-init for mobile apps - will be triggered manually from Walkthrough\n if (this.options.enablePush !== false && !process.env.MOBILE_APP) {\n await this.pushHandler.requestPermissions();\n await this.registerWebPush(this.store);\n }\n\n this.initialized = true;\n }\n\n disconnect() {\n if (this.isServer) return;\n\n wsManager.removeModuleListeners('notification');\n this.pushHandler.removeListeners();\n this.initialized = false;\n }\n}\n\n/**\n * Server-side utility for pre-fetching notification data\n */\nconst SSRUtils = {\n /**\n * Pre-fetch notifications for SSR\n * @param {Object} store - Store instance\n * @param {Object} context - SSR context\n */\n async prefetchNotifications(store, context) {\n try {\n const userId = store.core.state.session.userId;\n if (userId) {\n // Fetch notifications without WebSocket or push setup\n await store.notifications.actions.getNotifications(userId);\n }\n } catch (error) {\n console.error('Error pre-fetching notifications for SSR:', error);\n }\n },\n};\n\n/**\n * Function to initialize the notifications module\n * @param {Object} app - Vue app instance\n * @param {Object} store - Vuex/Pinia store\n * @param {Object} router - Vue Router instance\n * @param {Object} options - Configuration options\n */\nfunction initializeNotifications(app, store, router, options = {}) {\n // Add routes and store\n const routes = getRoutes(options);\n routes.forEach(({ parentName, config }) => {\n addRoutes(router, { ...config, parentName });\n });\n\n store.addStore('notifications', storeNotifications);\n\n // Initialize global WebSocket if needed\n if (options.wsUrl) {\n wsManager.initialize({ wsUrl: process.env.WSS_URL });\n }\n\n // Create notification manager\n const notificationManager = new NotificationManager(store, {\n enablePush: options.enablePush !== false,\n maxReconnectAttempts: options.maxReconnectAttempts || 5,\n reconnectDelay: options.reconnectDelay || 3000,\n pingInterval: options.pingInterval || 30000,\n });\n\n // Attach notification manager to store for access in components\n store.notificationManager = notificationManager;\n\n // Don't auto-initialize on server\n const isServer = typeof window === 'undefined';\n const autoInit = !isServer && options.autoInit !== false;\n\n if (autoInit) {\n // Watch for user login/logout using store.core.state.session.userId\n // immediate: true — сработает сразу после применения initialState (гидратация)\n watch(\n () => store.core.state.session.userId,\n async (userId, oldUserId) => {\n console.log('[Notifications] Watch triggered, userId:', userId, 'oldUserId:', oldUserId);\n if (userId && !oldUserId) {\n // Пользователь залогинен (либо при гидратации, либо при логине)\n console.log('[Notifications] User authenticated, initializing WebSocket...', userId);\n await store.notifications.actions.reregisterDeviceAfterLogin();\n notificationManager.disconnect();\n await notificationManager.initialize();\n } else if (!userId && oldUserId) {\n // Пользователь разлогинился\n console.log('[Notifications] User logged out, resetting notifications...');\n notificationManager.disconnect();\n store.notifications.mutations.resetNotifications();\n } else if (!userId && !oldUserId) {\n // Анонимный пользователь — инициализируем без WebSocket\n console.log('[Notifications] Anonymous user, initializing without WebSocket...');\n await notificationManager.initialize();\n }\n },\n { immediate: true }\n );\n }\n\n // Provide composable for components to access notification functionality\n app.provide('useNotifications', () => {\n return {\n ...toRefs(store.notifications.state),\n ...store.notifications.actions,\n ...store.notifications.mutations,\n init: notificationManager.initialize.bind(notificationManager),\n disconnect: notificationManager.disconnect.bind(notificationManager),\n isServer,\n };\n });\n\n return notificationManager;\n}\n\n// Module export\nconst ModuleNotifications = {\n initialize: initializeNotifications,\n SSR: SSRUtils, // Export SSR utilities\n views: {\n store: {\n storeNotifications,\n },\n router: {\n getRoutes,\n },\n components: {\n // Elements\n NotificationBadge,\n // Blocks\n NotificationItem,\n // Sections\n NotificationsList,\n NotificationPreferences,\n // Pages\n Notifications,\n // Layouts\n NotificationsLayout,\n },\n },\n};\n\n// Component exports\nexport {\n // Elements\n NotificationBadge,\n // Blocks\n NotificationItem,\n NotificationPreferences,\n // Pages\n Notifications,\n // Layouts\n NotificationsLayout,\n // Sections\n NotificationsList,\n // SSR Utilities\n SSRUtils,\n};\n\n// [LOADING 37] Notifications module import completed\nperformance.mark('loading-37-end');\nperformance.measure('loading-37-total', 'loading-37-start', 'loading-37-end');\nconst totalTime = performance.getEntriesByName('loading-37-total')[0];\nconsole.log(`[LOADING 37] Notifications module fully imported in ${totalTime?.duration?.toFixed(2)}ms`);\n\nexport default ModuleNotifications;\n"],"names":["storeNotifications","NotificationsList","NotificationPreferences","Notifications","NotificationsLayout"],"mappings":";;;;;;;;;;;;AACA,YAAY,KAAK,kBAAkB;AACnC,QAAQ,IAAI,qDAAqD;AAuBjE,YAAY,KAAK,wBAAwB;AACzC,MAAM,cAAc,YAAY,QAAQ,sBAAsB,oBAAoB,wBAAwB;AAC1G,QAAQ,IAAI,yCAAyC,YAAY,SAAS,QAAQ,CAAC,CAAC,IAAI;AAKxF,MAAM,qBAAqB;AAAA,EACzB,YAAY,OAAO;AACjB,SAAK,QAAQ;AACb,SAAK,oBAAoB;AACzB,SAAK,SAAS;AACd,SAAK,gBAAgB;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,aAAa;AAEjB,QAAI,OAAO,WAAW,aAAa;AACjC,aAAO;AAAA,IACT;AAEA,QAAI;AAEF,YAAM,EAAE,UAAS,IAAK,MAAM,OAAO,8FAAiB;AACpD,YAAM,EAAE,kBAAiB,IAAK,MAAM,OAAO,uJAA+B;AAC1E,YAAM,EAAE,OAAM,IAAK,MAAM,OAAO,+HAAmB;AAEnD,WAAK,YAAY;AACjB,WAAK,oBAAoB;AACzB,WAAK,SAAS;AAGd,UAAI,CAAC,KAAK,UAAU,oBAAoB;AACtC,eAAO;AAAA,MACT;AAEA,WAAK,gBAAgB;AACrB,aAAO;AAAA,IACT,SAAS,OAAO;AACd,cAAQ,MAAM,sCAAsC,KAAK;AACzD,aAAO;AAAA,IACT;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,qBAAqB;AAEzB,QAAI,OAAO,WAAW,aAAa;AACjC,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,KAAK,eAAe;AACvB,YAAM,cAAc,MAAM,KAAK,WAAU;AACzC,UAAI,CAAC,YAAa,QAAO;AAAA,I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AAGK,MAAC,sBAAsB;AAAA,EAC1B,YAAY;AAAA,EACZ,KAAK;AAAA;AAAA,EACL,OAAO;AAAA,IACL,OAAO;AAAA,MACX,oBAAMA;AAAAA,IACN;AAAA,IACI,QAAQ;AAAA,MACN;AAAA,IACN;AAAA,IACI,YAAY;AAAA;AAAA,MAEV;AAAA;AAAA,MAEA;AAAA;AAAA,MAEN,mBAAMC;AAAAA,MACN,yBAAMC;AAAAA;AAAAA,MAEN,eAAMC;AAAAA;AAAAA,MAEN,qBAAMC;AAAAA,IACN;AAAA,EACA;AACA;AAoBA,YAAY,KAAK,gBAAgB;AACjC,YAAY,QAAQ,oBAAoB,oBAAoB,gBAAgB;AAC5E,MAAM,YAAY,YAAY,iBAAiB,kBAAkB,EAAE,CAAC;AACpE,QAAQ,IAAI,uDAAuD,WAAW,UAAU,QAAQ,CAAC,CAAC,IAAI;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, Fragment, renderList, toDisplayString, createVNode, withCtx, createBlock, resolveDynamicComponent } from "vue";
|
|
2
|
-
import _sfc_main$7 from "../../../../components/Tooltip/Tooltip.
|
|
2
|
+
import _sfc_main$7 from "../../../../components/Tooltip/Tooltip.vue2.js";
|
|
3
3
|
import _sfc_main$6 from "../icons/IconStatusCreated.vue.js";
|
|
4
4
|
import _sfc_main$5 from "../icons/IconStatusConfirmed.vue.js";
|
|
5
5
|
import _sfc_main$2 from "../icons/IconStatusInUse.vue.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { mergeModels, useModel, ref, watch, createBlock, openBlock, withCtx, createVNode, createElementVNode, unref, isRef, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
import _sfc_main$1 from "../../../../components/Block/Block.vue.js";
|
|
3
3
|
import Field from "../../../../components/Field/Field.vue.js";
|
|
4
|
-
import Select from "../../../../components/Select/Select.
|
|
5
|
-
import _sfc_main$2 from "../../../../components/Button/Button.
|
|
4
|
+
import Select from "../../../../components/Select/Select.vue2.js";
|
|
5
|
+
import _sfc_main$2 from "../../../../components/Button/Button.vue.js";
|
|
6
6
|
const _hoisted_1 = { class: "gap-thin flex mn-t-small" };
|
|
7
7
|
const _sfc_main = {
|
|
8
8
|
__name: "FormApplicationDetails",
|