@rpcbase/client 0.458.0 → 0.460.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +207 -151
- package/dist/index.js.map +1 -1
- package/dist/notifications.d.ts +2 -0
- package/dist/notifications.d.ts.map +1 -1
- package/dist/notificationsRealtime.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -416,7 +416,7 @@ function _temp4$1() {
|
|
|
416
416
|
function _temp5$1() {
|
|
417
417
|
return startToaster();
|
|
418
418
|
}
|
|
419
|
-
function _temp6() {
|
|
419
|
+
function _temp6$1() {
|
|
420
420
|
return startToaster();
|
|
421
421
|
}
|
|
422
422
|
function _temp7() {
|
|
@@ -426,7 +426,7 @@ function _temp7() {
|
|
|
426
426
|
});
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
|
-
window.setTimeout(_temp6, 150);
|
|
429
|
+
window.setTimeout(_temp6$1, 150);
|
|
430
430
|
}
|
|
431
431
|
function _temp8() {
|
|
432
432
|
if (typeof window === "undefined") {
|
|
@@ -2566,12 +2566,15 @@ const toIso = (value) => {
|
|
|
2566
2566
|
return void 0;
|
|
2567
2567
|
};
|
|
2568
2568
|
const toNotificationItem = (doc) => {
|
|
2569
|
-
const
|
|
2569
|
+
const rawId = doc.notificationId ?? doc._id;
|
|
2570
|
+
const id = typeof rawId === "string" ? rawId : String(rawId ?? "");
|
|
2570
2571
|
if (!id) return null;
|
|
2571
2572
|
if (typeof doc.title !== "string") return null;
|
|
2572
2573
|
return {
|
|
2573
2574
|
id,
|
|
2574
2575
|
topic: typeof doc.topic === "string" ? doc.topic : void 0,
|
|
2576
|
+
tag: typeof doc.tag === "string" ? doc.tag : void 0,
|
|
2577
|
+
deliveryId: typeof doc.deliveryId === "string" ? doc.deliveryId : void 0,
|
|
2575
2578
|
title: doc.title,
|
|
2576
2579
|
body: doc.body,
|
|
2577
2580
|
image: doc.image,
|
|
@@ -2643,6 +2646,7 @@ const getScopedNotificationKey = (userId, appName) => `${encodeURIComponent(appN
|
|
|
2643
2646
|
const getTabStateKey = (userId, appName) => `${TAB_STATE_KEY_PREFIX}${getScopedNotificationKey(userId, appName)}:${NOTIFICATION_TAB_ID}`;
|
|
2644
2647
|
const getTabStateKeyPrefix = (userId, appName) => `${TAB_STATE_KEY_PREFIX}${getScopedNotificationKey(userId, appName)}:`;
|
|
2645
2648
|
const getDeliveryKey = (userId, appName, mode, notificationId) => `${DELIVERY_KEY_PREFIX}${mode}:${getScopedNotificationKey(userId, appName)}:${encodeURIComponent(notificationId)}`;
|
|
2649
|
+
const getNotificationDeliveryId = (item) => item.deliveryId ?? `${item.id}:${item.createdAt}`;
|
|
2646
2650
|
const getDeliveryLockName = (userId, appName) => `${DELIVERY_LOCK_PREFIX}${getScopedNotificationKey(userId, appName)}`;
|
|
2647
2651
|
const getFallbackDeliveryLockKey = (userId, appName) => `${FALLBACK_DELIVERY_LOCK_KEY_PREFIX}${getScopedNotificationKey(userId, appName)}`;
|
|
2648
2652
|
const getLocalStorage = () => {
|
|
@@ -2733,20 +2737,20 @@ const removeNotificationDeliveryMarkers = (items, userId, appName, mode) => {
|
|
|
2733
2737
|
if (!storage) return;
|
|
2734
2738
|
try {
|
|
2735
2739
|
for (const item of items) {
|
|
2736
|
-
storage.removeItem(getDeliveryKey(userId, appName, mode, item
|
|
2740
|
+
storage.removeItem(getDeliveryKey(userId, appName, mode, getNotificationDeliveryId(item)));
|
|
2737
2741
|
}
|
|
2738
2742
|
} catch {
|
|
2739
2743
|
return;
|
|
2740
2744
|
}
|
|
2741
2745
|
};
|
|
2742
|
-
const filterNotificationsWithoutDelivery = (items, userId, appName, mode) => items.filter((item) => !hasRecentNotificationDelivery(userId, appName, mode, item
|
|
2746
|
+
const filterNotificationsWithoutDelivery = (items, userId, appName, mode) => items.filter((item) => !hasRecentNotificationDelivery(userId, appName, mode, getNotificationDeliveryId(item)));
|
|
2743
2747
|
const claimNotificationDeliveriesFromStorage = (items, userId, appName, mode) => {
|
|
2744
2748
|
const storage = getLocalStorage();
|
|
2745
2749
|
if (!storage) return items;
|
|
2746
2750
|
const now = Date.now();
|
|
2747
2751
|
const claimed = [];
|
|
2748
2752
|
for (const item of items) {
|
|
2749
|
-
const key = getDeliveryKey(userId, appName, mode, item
|
|
2753
|
+
const key = getDeliveryKey(userId, appName, mode, getNotificationDeliveryId(item));
|
|
2750
2754
|
const current = parseJsonRecord(storage.getItem(key));
|
|
2751
2755
|
const deliveredAt = typeof current?.deliveredAt === "number" ? current.deliveredAt : 0;
|
|
2752
2756
|
if (deliveredAt && now - deliveredAt < DELIVERY_TTL_MS) continue;
|
|
@@ -2891,7 +2895,7 @@ const getNativeNotificationOptions = (item) => {
|
|
|
2891
2895
|
return {
|
|
2892
2896
|
body: item.body,
|
|
2893
2897
|
icon: item.image,
|
|
2894
|
-
tag: `${NATIVE_NOTIFICATION_TAG_PREFIX}:${item
|
|
2898
|
+
tag: `${NATIVE_NOTIFICATION_TAG_PREFIX}:${encodeURIComponent(getNotificationDeliveryId(item))}`,
|
|
2895
2899
|
data: {
|
|
2896
2900
|
...item.data,
|
|
2897
2901
|
notificationId: item.id,
|
|
@@ -2969,12 +2973,12 @@ const flushPendingInAppToasts = (pendingInAppToastItems, userId, appName, render
|
|
|
2969
2973
|
};
|
|
2970
2974
|
const queuePendingInAppToasts = (pendingInAppToastItems, items, userId, appName, renderNotificationToast) => {
|
|
2971
2975
|
for (const item of items) {
|
|
2972
|
-
pendingInAppToastItems.current.set(item
|
|
2976
|
+
pendingInAppToastItems.current.set(getNotificationDeliveryId(item), item);
|
|
2973
2977
|
}
|
|
2974
2978
|
flushPendingInAppToasts(pendingInAppToastItems, userId, appName, renderNotificationToast);
|
|
2975
2979
|
};
|
|
2976
2980
|
function NotificationsRealtimeProvider(t0) {
|
|
2977
|
-
const $ = c(
|
|
2981
|
+
const $ = c(73);
|
|
2978
2982
|
const {
|
|
2979
2983
|
userId,
|
|
2980
2984
|
appName,
|
|
@@ -3113,99 +3117,148 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3113
3117
|
}
|
|
3114
3118
|
const notificationsQuery = useQuery("RBNotification", query, t10);
|
|
3115
3119
|
let t11;
|
|
3120
|
+
if ($[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3121
|
+
t11 = {
|
|
3122
|
+
createdAt: -1
|
|
3123
|
+
};
|
|
3124
|
+
$[22] = t11;
|
|
3125
|
+
} else {
|
|
3126
|
+
t11 = $[22];
|
|
3127
|
+
}
|
|
3128
|
+
let t12;
|
|
3129
|
+
if ($[23] !== canUseRts || $[24] !== limit) {
|
|
3130
|
+
t12 = {
|
|
3131
|
+
key: "rb.notification-deliveries",
|
|
3132
|
+
sort: t11,
|
|
3133
|
+
limit,
|
|
3134
|
+
enabled: canUseRts
|
|
3135
|
+
};
|
|
3136
|
+
$[23] = canUseRts;
|
|
3137
|
+
$[24] = limit;
|
|
3138
|
+
$[25] = t12;
|
|
3139
|
+
} else {
|
|
3140
|
+
t12 = $[25];
|
|
3141
|
+
}
|
|
3142
|
+
const notificationDeliveriesQuery = useQuery("RBNotificationDelivery", query, t12);
|
|
3143
|
+
let t13;
|
|
3116
3144
|
bb1: {
|
|
3117
3145
|
const raw = notificationsQuery.data;
|
|
3118
3146
|
if (!Array.isArray(raw)) {
|
|
3119
|
-
let
|
|
3120
|
-
if ($[
|
|
3121
|
-
|
|
3122
|
-
$[
|
|
3147
|
+
let t143;
|
|
3148
|
+
if ($[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3149
|
+
t143 = [];
|
|
3150
|
+
$[26] = t143;
|
|
3123
3151
|
} else {
|
|
3124
|
-
|
|
3152
|
+
t143 = $[26];
|
|
3125
3153
|
}
|
|
3126
|
-
|
|
3154
|
+
t13 = t143;
|
|
3127
3155
|
break bb1;
|
|
3128
3156
|
}
|
|
3129
|
-
let
|
|
3130
|
-
if ($[
|
|
3131
|
-
|
|
3132
|
-
$[
|
|
3133
|
-
$[
|
|
3157
|
+
let t142;
|
|
3158
|
+
if ($[27] !== raw) {
|
|
3159
|
+
t142 = raw.map(_temp).filter(_temp2);
|
|
3160
|
+
$[27] = raw;
|
|
3161
|
+
$[28] = t142;
|
|
3134
3162
|
} else {
|
|
3135
|
-
|
|
3163
|
+
t142 = $[28];
|
|
3136
3164
|
}
|
|
3137
|
-
|
|
3165
|
+
t13 = t142;
|
|
3138
3166
|
}
|
|
3139
|
-
const notifications =
|
|
3140
|
-
let
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3167
|
+
const notifications = t13;
|
|
3168
|
+
let t14;
|
|
3169
|
+
bb2: {
|
|
3170
|
+
const raw_0 = notificationDeliveriesQuery.data;
|
|
3171
|
+
if (!Array.isArray(raw_0)) {
|
|
3172
|
+
let t153;
|
|
3173
|
+
if ($[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3174
|
+
t153 = [];
|
|
3175
|
+
$[29] = t153;
|
|
3176
|
+
} else {
|
|
3177
|
+
t153 = $[29];
|
|
3178
|
+
}
|
|
3179
|
+
t14 = t153;
|
|
3180
|
+
break bb2;
|
|
3181
|
+
}
|
|
3182
|
+
let t152;
|
|
3183
|
+
if ($[30] !== raw_0) {
|
|
3184
|
+
t152 = raw_0.map(_temp3).filter(_temp4);
|
|
3185
|
+
$[30] = raw_0;
|
|
3186
|
+
$[31] = t152;
|
|
3187
|
+
} else {
|
|
3188
|
+
t152 = $[31];
|
|
3189
|
+
}
|
|
3190
|
+
t14 = t152;
|
|
3191
|
+
}
|
|
3192
|
+
const notificationDeliveries = t14;
|
|
3193
|
+
let t15;
|
|
3194
|
+
if ($[32] !== notifications) {
|
|
3195
|
+
t15 = notifications.reduce(_temp5, 0);
|
|
3196
|
+
$[32] = notifications;
|
|
3197
|
+
$[33] = t15;
|
|
3145
3198
|
} else {
|
|
3146
|
-
|
|
3199
|
+
t15 = $[33];
|
|
3147
3200
|
}
|
|
3148
|
-
const unreadCount =
|
|
3149
|
-
let
|
|
3150
|
-
if ($[
|
|
3151
|
-
|
|
3152
|
-
$[
|
|
3153
|
-
$[
|
|
3201
|
+
const unreadCount = t15;
|
|
3202
|
+
let t16;
|
|
3203
|
+
if ($[34] !== notifications) {
|
|
3204
|
+
t16 = notifications.reduce(_temp6, 0);
|
|
3205
|
+
$[34] = notifications;
|
|
3206
|
+
$[35] = t16;
|
|
3154
3207
|
} else {
|
|
3155
|
-
|
|
3208
|
+
t16 = $[35];
|
|
3156
3209
|
}
|
|
3157
|
-
const unseenCount =
|
|
3158
|
-
let
|
|
3159
|
-
if ($[
|
|
3160
|
-
|
|
3161
|
-
$[
|
|
3210
|
+
const unseenCount = t16;
|
|
3211
|
+
let t17;
|
|
3212
|
+
if ($[36] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3213
|
+
t17 = /* @__PURE__ */ new Set();
|
|
3214
|
+
$[36] = t17;
|
|
3162
3215
|
} else {
|
|
3163
|
-
|
|
3216
|
+
t17 = $[36];
|
|
3164
3217
|
}
|
|
3165
|
-
const
|
|
3218
|
+
const lastToastDeliveryIds = useRef(t17);
|
|
3166
3219
|
const hasSeededToastIds = useRef(false);
|
|
3167
|
-
let
|
|
3168
|
-
if ($[
|
|
3169
|
-
|
|
3170
|
-
$[
|
|
3220
|
+
let t18;
|
|
3221
|
+
if ($[37] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3222
|
+
t18 = Date.now();
|
|
3223
|
+
$[37] = t18;
|
|
3171
3224
|
} else {
|
|
3172
|
-
|
|
3225
|
+
t18 = $[37];
|
|
3173
3226
|
}
|
|
3174
|
-
const toastStartMs = useRef(
|
|
3175
|
-
let
|
|
3176
|
-
if ($[
|
|
3177
|
-
|
|
3178
|
-
$[
|
|
3227
|
+
const toastStartMs = useRef(t18);
|
|
3228
|
+
let t19;
|
|
3229
|
+
if ($[38] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3230
|
+
t19 = /* @__PURE__ */ new Map();
|
|
3231
|
+
$[38] = t19;
|
|
3179
3232
|
} else {
|
|
3180
|
-
|
|
3233
|
+
t19 = $[38];
|
|
3181
3234
|
}
|
|
3182
|
-
const pendingInAppToastItems = useRef(
|
|
3183
|
-
let
|
|
3184
|
-
if ($[
|
|
3185
|
-
|
|
3235
|
+
const pendingInAppToastItems = useRef(t19);
|
|
3236
|
+
let t20;
|
|
3237
|
+
if ($[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3238
|
+
t20 = () => {
|
|
3186
3239
|
hasSeededToastIds.current = false;
|
|
3187
|
-
|
|
3240
|
+
lastToastDeliveryIds.current = /* @__PURE__ */ new Set();
|
|
3188
3241
|
toastStartMs.current = Date.now();
|
|
3189
3242
|
pendingInAppToastItems.current = /* @__PURE__ */ new Map();
|
|
3190
3243
|
};
|
|
3191
|
-
$[
|
|
3244
|
+
$[39] = t20;
|
|
3192
3245
|
} else {
|
|
3193
|
-
|
|
3246
|
+
t20 = $[39];
|
|
3194
3247
|
}
|
|
3195
|
-
let
|
|
3196
|
-
if ($[
|
|
3197
|
-
|
|
3198
|
-
$[
|
|
3199
|
-
$[
|
|
3200
|
-
$[
|
|
3248
|
+
let t21;
|
|
3249
|
+
if ($[40] !== normalizedAppName || $[41] !== trimmedUserId) {
|
|
3250
|
+
t21 = [normalizedAppName, trimmedUserId];
|
|
3251
|
+
$[40] = normalizedAppName;
|
|
3252
|
+
$[41] = trimmedUserId;
|
|
3253
|
+
$[42] = t21;
|
|
3201
3254
|
} else {
|
|
3202
|
-
|
|
3255
|
+
t21 = $[42];
|
|
3203
3256
|
}
|
|
3204
|
-
useEffect(
|
|
3205
|
-
let
|
|
3206
|
-
let
|
|
3207
|
-
if ($[
|
|
3208
|
-
|
|
3257
|
+
useEffect(t20, t21);
|
|
3258
|
+
let t22;
|
|
3259
|
+
let t23;
|
|
3260
|
+
if ($[43] !== canUseRts || $[44] !== normalizedAppName || $[45] !== trimmedUserId) {
|
|
3261
|
+
t22 = () => {
|
|
3209
3262
|
if (!canUseRts) {
|
|
3210
3263
|
return;
|
|
3211
3264
|
}
|
|
@@ -3231,21 +3284,21 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3231
3284
|
removeState();
|
|
3232
3285
|
};
|
|
3233
3286
|
};
|
|
3234
|
-
|
|
3235
|
-
$[
|
|
3236
|
-
$[
|
|
3237
|
-
$[
|
|
3238
|
-
$[
|
|
3239
|
-
$[
|
|
3287
|
+
t23 = [canUseRts, normalizedAppName, trimmedUserId];
|
|
3288
|
+
$[43] = canUseRts;
|
|
3289
|
+
$[44] = normalizedAppName;
|
|
3290
|
+
$[45] = trimmedUserId;
|
|
3291
|
+
$[46] = t22;
|
|
3292
|
+
$[47] = t23;
|
|
3240
3293
|
} else {
|
|
3241
|
-
|
|
3242
|
-
|
|
3294
|
+
t22 = $[46];
|
|
3295
|
+
t23 = $[47];
|
|
3243
3296
|
}
|
|
3244
|
-
useEffect(
|
|
3245
|
-
let
|
|
3246
|
-
let
|
|
3247
|
-
if ($[
|
|
3248
|
-
|
|
3297
|
+
useEffect(t22, t23);
|
|
3298
|
+
let t24;
|
|
3299
|
+
let t25;
|
|
3300
|
+
if ($[48] !== canUseRts || $[49] !== normalizedAppName || $[50] !== renderNotificationToast || $[51] !== trimmedUserId) {
|
|
3301
|
+
t24 = () => {
|
|
3249
3302
|
if (!canUseRts) {
|
|
3250
3303
|
return;
|
|
3251
3304
|
}
|
|
@@ -3262,35 +3315,35 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3262
3315
|
document.removeEventListener("visibilitychange", handlePendingInAppToastFlush);
|
|
3263
3316
|
};
|
|
3264
3317
|
};
|
|
3265
|
-
|
|
3266
|
-
$[
|
|
3267
|
-
$[
|
|
3268
|
-
$[
|
|
3269
|
-
$[
|
|
3270
|
-
$[
|
|
3271
|
-
$[
|
|
3318
|
+
t25 = [canUseRts, normalizedAppName, renderNotificationToast, trimmedUserId];
|
|
3319
|
+
$[48] = canUseRts;
|
|
3320
|
+
$[49] = normalizedAppName;
|
|
3321
|
+
$[50] = renderNotificationToast;
|
|
3322
|
+
$[51] = trimmedUserId;
|
|
3323
|
+
$[52] = t24;
|
|
3324
|
+
$[53] = t25;
|
|
3272
3325
|
} else {
|
|
3273
|
-
|
|
3274
|
-
|
|
3326
|
+
t24 = $[52];
|
|
3327
|
+
t25 = $[53];
|
|
3275
3328
|
}
|
|
3276
|
-
useEffect(
|
|
3277
|
-
let
|
|
3278
|
-
let
|
|
3279
|
-
if ($[
|
|
3280
|
-
|
|
3329
|
+
useEffect(t24, t25);
|
|
3330
|
+
let t26;
|
|
3331
|
+
let t27;
|
|
3332
|
+
if ($[54] !== canUseRts || $[55] !== normalizedAppName || $[56] !== notificationDeliveries || $[57] !== notificationDeliveriesQuery.loading || $[58] !== renderNotificationToast || $[59] !== toastOnNew || $[60] !== trimmedUserId) {
|
|
3333
|
+
t26 = () => {
|
|
3281
3334
|
if (!toastOnNew) {
|
|
3282
3335
|
return;
|
|
3283
3336
|
}
|
|
3284
3337
|
if (!canUseRts) {
|
|
3285
3338
|
return;
|
|
3286
3339
|
}
|
|
3287
|
-
if (
|
|
3340
|
+
if (notificationDeliveriesQuery.loading) {
|
|
3288
3341
|
return;
|
|
3289
3342
|
}
|
|
3290
3343
|
if (!hasSeededToastIds.current) {
|
|
3291
3344
|
hasSeededToastIds.current = true;
|
|
3292
|
-
|
|
3293
|
-
const eligible =
|
|
3345
|
+
lastToastDeliveryIds.current = new Set(notificationDeliveries.map(getNotificationDeliveryId));
|
|
3346
|
+
const eligible = notificationDeliveries.filter((n_3) => {
|
|
3294
3347
|
const createdAtMs = Date.parse(n_3.createdAt);
|
|
3295
3348
|
if (!Number.isFinite(createdAtMs)) {
|
|
3296
3349
|
return false;
|
|
@@ -3304,12 +3357,12 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3304
3357
|
}
|
|
3305
3358
|
return;
|
|
3306
3359
|
}
|
|
3307
|
-
const nextNew =
|
|
3360
|
+
const nextNew = notificationDeliveries.filter((n_4) => !lastToastDeliveryIds.current.has(getNotificationDeliveryId(n_4)));
|
|
3308
3361
|
if (!nextNew.length) {
|
|
3309
3362
|
return;
|
|
3310
3363
|
}
|
|
3311
3364
|
for (const n_5 of nextNew) {
|
|
3312
|
-
|
|
3365
|
+
lastToastDeliveryIds.current.add(getNotificationDeliveryId(n_5));
|
|
3313
3366
|
}
|
|
3314
3367
|
const eligible_0 = nextNew.filter((n_6) => {
|
|
3315
3368
|
const createdAtMs_0 = Date.parse(n_6.createdAt);
|
|
@@ -3325,70 +3378,73 @@ function NotificationsRealtimeProvider(t0) {
|
|
|
3325
3378
|
queuePendingInAppToasts(pendingInAppToastItems, pending_0, trimmedUserId, normalizedAppName, renderNotificationToast);
|
|
3326
3379
|
});
|
|
3327
3380
|
};
|
|
3328
|
-
|
|
3329
|
-
$[
|
|
3330
|
-
$[
|
|
3331
|
-
$[
|
|
3332
|
-
$[
|
|
3333
|
-
$[
|
|
3334
|
-
$[
|
|
3335
|
-
$[
|
|
3336
|
-
$[
|
|
3337
|
-
$[
|
|
3381
|
+
t27 = [canUseRts, normalizedAppName, notificationDeliveries, notificationDeliveriesQuery.loading, renderNotificationToast, toastOnNew, trimmedUserId];
|
|
3382
|
+
$[54] = canUseRts;
|
|
3383
|
+
$[55] = normalizedAppName;
|
|
3384
|
+
$[56] = notificationDeliveries;
|
|
3385
|
+
$[57] = notificationDeliveriesQuery.loading;
|
|
3386
|
+
$[58] = renderNotificationToast;
|
|
3387
|
+
$[59] = toastOnNew;
|
|
3388
|
+
$[60] = trimmedUserId;
|
|
3389
|
+
$[61] = t26;
|
|
3390
|
+
$[62] = t27;
|
|
3338
3391
|
} else {
|
|
3339
|
-
|
|
3340
|
-
|
|
3392
|
+
t26 = $[61];
|
|
3393
|
+
t27 = $[62];
|
|
3341
3394
|
}
|
|
3342
|
-
useEffect(
|
|
3343
|
-
let
|
|
3344
|
-
if ($[
|
|
3345
|
-
|
|
3395
|
+
useEffect(t26, t27);
|
|
3396
|
+
let t28;
|
|
3397
|
+
if ($[63] !== notifications || $[64] !== notificationsQuery.error || $[65] !== notificationsQuery.loading || $[66] !== unreadCount || $[67] !== unseenCount) {
|
|
3398
|
+
t28 = {
|
|
3346
3399
|
notifications,
|
|
3347
3400
|
unreadCount,
|
|
3348
3401
|
unseenCount,
|
|
3349
3402
|
loading: notificationsQuery.loading,
|
|
3350
3403
|
error: notificationsQuery.error
|
|
3351
3404
|
};
|
|
3352
|
-
$[
|
|
3353
|
-
$[
|
|
3354
|
-
$[
|
|
3355
|
-
$[
|
|
3356
|
-
$[
|
|
3357
|
-
$[
|
|
3405
|
+
$[63] = notifications;
|
|
3406
|
+
$[64] = notificationsQuery.error;
|
|
3407
|
+
$[65] = notificationsQuery.loading;
|
|
3408
|
+
$[66] = unreadCount;
|
|
3409
|
+
$[67] = unseenCount;
|
|
3410
|
+
$[68] = t28;
|
|
3358
3411
|
} else {
|
|
3359
|
-
|
|
3360
|
-
}
|
|
3361
|
-
const value =
|
|
3362
|
-
const
|
|
3363
|
-
let
|
|
3364
|
-
if ($[
|
|
3365
|
-
|
|
3366
|
-
$[
|
|
3412
|
+
t28 = $[68];
|
|
3413
|
+
}
|
|
3414
|
+
const value = t28;
|
|
3415
|
+
const t29 = canUseRts ? value : null;
|
|
3416
|
+
let t30;
|
|
3417
|
+
if ($[69] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
3418
|
+
t30 = /* @__PURE__ */ jsx("style", { children: notificationToastStyles });
|
|
3419
|
+
$[69] = t30;
|
|
3367
3420
|
} else {
|
|
3368
|
-
|
|
3421
|
+
t30 = $[69];
|
|
3369
3422
|
}
|
|
3370
|
-
let
|
|
3371
|
-
if ($[
|
|
3372
|
-
|
|
3373
|
-
|
|
3423
|
+
let t31;
|
|
3424
|
+
if ($[70] !== children || $[71] !== t29) {
|
|
3425
|
+
t31 = /* @__PURE__ */ jsxs(NotificationsRealtimeContext.Provider, { value: t29, children: [
|
|
3426
|
+
t30,
|
|
3374
3427
|
children
|
|
3375
3428
|
] });
|
|
3376
|
-
$[
|
|
3377
|
-
$[
|
|
3378
|
-
$[
|
|
3429
|
+
$[70] = children;
|
|
3430
|
+
$[71] = t29;
|
|
3431
|
+
$[72] = t31;
|
|
3379
3432
|
} else {
|
|
3380
|
-
|
|
3433
|
+
t31 = $[72];
|
|
3381
3434
|
}
|
|
3382
|
-
return
|
|
3435
|
+
return t31;
|
|
3436
|
+
}
|
|
3437
|
+
function _temp6(acc_0, n_2) {
|
|
3438
|
+
return acc_0 + (n_2.seenAt ? 0 : 1);
|
|
3383
3439
|
}
|
|
3384
|
-
function _temp5(
|
|
3385
|
-
return
|
|
3440
|
+
function _temp5(acc, n_1) {
|
|
3441
|
+
return acc + (n_1.readAt ? 0 : 1);
|
|
3386
3442
|
}
|
|
3387
|
-
function _temp4(
|
|
3388
|
-
return
|
|
3443
|
+
function _temp4(n_0) {
|
|
3444
|
+
return Boolean(n_0);
|
|
3389
3445
|
}
|
|
3390
|
-
function _temp3(
|
|
3391
|
-
return
|
|
3446
|
+
function _temp3(doc_0) {
|
|
3447
|
+
return toNotificationItem(doc_0);
|
|
3392
3448
|
}
|
|
3393
3449
|
function _temp2(n) {
|
|
3394
3450
|
return Boolean(n);
|