@braze/web-sdk 5.6.1 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/README.md +1 -1
  2. package/index.d.ts +15 -5
  3. package/package.json +1 -1
  4. package/shared-lib/encoding-utils.js +1 -1
  5. package/shared-lib/event-types.js +23 -23
  6. package/shared-lib/indexed-db-adapter.js +20 -20
  7. package/shared-lib/logger.js +2 -2
  8. package/shared-lib/supported-options.js +17 -17
  9. package/src/Banner/banner-provider.js +53 -50
  10. package/src/Banner/banner.js +1 -1
  11. package/src/Banner/get-all-banners.js +3 -4
  12. package/src/Banner/get-banner.js +11 -11
  13. package/src/Banner/log-banner-click.js +1 -1
  14. package/src/Banner/log-banner-impressions.js +4 -4
  15. package/src/Banner/request-banners-refresh.js +21 -13
  16. package/src/Banner/subscribe-to-banners-updates.js +14 -13
  17. package/src/Banner/ui/insert-banner.js +11 -9
  18. package/src/Card/card-manager.js +10 -10
  19. package/src/Card/log-card-impressions.js +2 -2
  20. package/src/Card/models/captioned-image.js +1 -1
  21. package/src/Card/models/card.js +3 -3
  22. package/src/Card/models/classic-card.js +1 -1
  23. package/src/Card/models/control-card.js +1 -1
  24. package/src/Card/models/image-only.js +1 -1
  25. package/src/ContentCards/content-cards-provider-factory.js +1 -1
  26. package/src/ContentCards/content-cards-provider.js +139 -180
  27. package/src/ContentCards/content-cards.js +3 -3
  28. package/src/ContentCards/get-cached-content-cards.js +1 -1
  29. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  30. package/src/ContentCards/subscribe-to-content-cards-updates.js +10 -10
  31. package/src/ContentCards/ui/show-content-cards.js +8 -8
  32. package/src/Core/add-sdk-metadata.js +2 -2
  33. package/src/Core/change-user.js +3 -3
  34. package/src/Core/disable-sdk.js +7 -7
  35. package/src/Core/enable-sdk.js +5 -5
  36. package/src/Core/get-device-id.js +2 -2
  37. package/src/Core/get-user.js +1 -1
  38. package/src/Core/is-disabled.js +1 -1
  39. package/src/Core/log-custom-event.js +3 -3
  40. package/src/Core/log-purchase.js +1 -1
  41. package/src/Core/open-session.js +9 -9
  42. package/src/Core/wipe-data.js +5 -5
  43. package/src/FeatureFlags/feature-flag-factory.js +4 -4
  44. package/src/FeatureFlags/feature-flag.js +18 -18
  45. package/src/FeatureFlags/feature-flags-provider.js +81 -78
  46. package/src/FeatureFlags/get-all-feature-flags.js +6 -7
  47. package/src/FeatureFlags/get-feature-flag.js +5 -6
  48. package/src/FeatureFlags/log-feature-flag-impression.js +4 -4
  49. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +2 -2
  50. package/src/Feed/feed-provider.js +34 -34
  51. package/src/Feed/feed.js +2 -2
  52. package/src/Feed/get-cached-feed.js +1 -1
  53. package/src/Feed/request-feed-refresh.js +1 -1
  54. package/src/Feed/subscribe-to-feed-updates.js +1 -1
  55. package/src/Feed/ui/show-feed.js +5 -5
  56. package/src/InAppMessage/defer-in-app-message.js +1 -1
  57. package/src/InAppMessage/display/html-message-to-html.js +10 -10
  58. package/src/InAppMessage/display/in-app-message-to-html.js +21 -21
  59. package/src/InAppMessage/display/modal-utils.js +6 -6
  60. package/src/InAppMessage/in-app-message-factory.js +4 -4
  61. package/src/InAppMessage/in-app-message-manager-factory.js +1 -1
  62. package/src/InAppMessage/in-app-message-manager.js +115 -91
  63. package/src/InAppMessage/log-in-app-message-button-click.js +2 -2
  64. package/src/InAppMessage/log-in-app-message-click.js +3 -3
  65. package/src/InAppMessage/log-in-app-message-html-click.js +4 -4
  66. package/src/InAppMessage/log-in-app-message-impression.js +2 -2
  67. package/src/InAppMessage/models/control-message.js +1 -1
  68. package/src/InAppMessage/models/full-screen-message.js +5 -5
  69. package/src/InAppMessage/models/html-message.js +10 -10
  70. package/src/InAppMessage/models/in-app-message-button.js +5 -5
  71. package/src/InAppMessage/models/in-app-message.js +42 -42
  72. package/src/InAppMessage/models/modal-message.js +5 -5
  73. package/src/InAppMessage/models/slide-up-message.js +8 -8
  74. package/src/InAppMessage/models/templated-in-app-message.js +8 -8
  75. package/src/InAppMessage/subscribe-to-in-app-message.js +1 -1
  76. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +3 -3
  77. package/src/InAppMessage/ui/show-in-app-message.js +24 -24
  78. package/src/Push/is-push-blocked.js +2 -2
  79. package/src/Push/is-push-permission-granted.js +2 -2
  80. package/src/Push/is-push-supported.js +2 -2
  81. package/src/Push/push-manager-factory.js +8 -8
  82. package/src/Push/push-manager.js +90 -90
  83. package/src/Push/utils/push-utils.js +12 -12
  84. package/src/User/user-manager.js +12 -12
  85. package/src/User/user.js +48 -36
  86. package/src/common/base-feed.js +3 -3
  87. package/src/common/constants.js +1 -1
  88. package/src/common/event-logger.js +4 -4
  89. package/src/common/feed-display.js +14 -14
  90. package/src/l10n/l10n-manager-factory.js +2 -2
  91. package/src/l10n/l10n-manager.js +1 -1
  92. package/src/managers/auth-manager.js +10 -10
  93. package/src/managers/braze-instance.js +128 -128
  94. package/src/managers/device-manager.js +18 -18
  95. package/src/managers/network-manager.js +184 -147
  96. package/src/managers/server-config-manager.js +63 -63
  97. package/src/managers/session-manager.js +27 -27
  98. package/src/managers/storage-manager-factory.js +10 -10
  99. package/src/managers/storage-manager.js +146 -146
  100. package/src/managers/subscription-manager.js +8 -8
  101. package/src/managers/utils.js +1 -1
  102. package/src/models/backend-errors.js +4 -4
  103. package/src/models/braze-event.js +8 -8
  104. package/src/models/device.js +2 -2
  105. package/src/models/identifier.js +12 -12
  106. package/src/models/push-token.js +8 -8
  107. package/src/models/server-config.js +31 -31
  108. package/src/request-controller.js +163 -151
  109. package/src/triggers/models/custom-event-data.js +5 -5
  110. package/src/triggers/models/custom-event-property-data.js +6 -6
  111. package/src/triggers/models/filter-set.js +8 -8
  112. package/src/triggers/models/filter.js +16 -16
  113. package/src/triggers/models/in-app-message-click-data.js +2 -2
  114. package/src/triggers/models/purchase-data.js +2 -2
  115. package/src/triggers/models/purchase-property-data.js +4 -4
  116. package/src/triggers/models/push-click-data.js +2 -2
  117. package/src/triggers/models/trigger-condition.js +37 -37
  118. package/src/triggers/models/trigger-events.js +2 -2
  119. package/src/triggers/models/trigger.js +11 -11
  120. package/src/triggers/triggers-provider-factory.js +3 -3
  121. package/src/triggers/triggers-provider.js +39 -39
  122. package/src/ui/js/attach-css.js +3 -3
  123. package/src/ui/js/iam-css.js +1 -1
  124. package/src/ui/js/load-font-awesome.js +2 -2
  125. package/src/util/base-device-parser.js +3 -3
  126. package/src/util/braze-actions.js +4 -4
  127. package/src/util/browser-detector.js +6 -6
  128. package/src/util/client-hints-parser.js +1 -1
  129. package/src/util/component-utils.js +2 -2
  130. package/src/util/dom-utils.js +6 -6
  131. package/src/util/html-display-utils.js +1 -0
  132. package/src/util/key-codes.js +1 -1
  133. package/src/util/net.js +22 -23
  134. package/src/util/request-header-utils.js +25 -22
  135. package/src/util/user-agent-parser.js +1 -1
  136. package/src/util/validation-utils.js +17 -17
  137. package/src/util/window-utils.js +2 -2
@@ -1,43 +1,43 @@
1
- import { isArray as w, isEqual as ii } from "../util/code-utils.js";
1
+ import { isArray as z, isEqual as ii } from "../util/code-utils.js";
2
2
  import ti from "../models/push-token.js";
3
3
  import { logger as N, EncodingUtils as ei } from "../../shared-lib/index.js";
4
4
  import { STORAGE_KEYS as t } from "../managers/storage-manager.js";
5
5
  import { User } from "../User/index.js";
6
- import yt from "./utils/push-utils.js";
6
+ import vt from "./utils/push-utils.js";
7
7
  import { getErrorMessage as si } from "../util/error-utils.js";
8
8
  export default class na {
9
9
  constructor(i, t, e, s, r, n, o, u, a, h, c) {
10
- (this.bn = i),
11
- (this.yn = t),
12
- (this.wn = e),
13
- (this.kn = r),
14
- (this.Pn = n),
15
- (this.Dn = o),
10
+ (this.hn = i),
11
+ (this.cn = t),
12
+ (this.fn = e),
13
+ (this.dn = r),
14
+ (this.bn = n),
15
+ (this.yn = o),
16
16
  (this.B = u),
17
- (this.Sn = a),
18
- (this.An = h),
17
+ (this.mn = a),
18
+ (this.gn = h),
19
19
  (this.C = c),
20
- (this.bn = i),
21
- (this.yn = t),
22
- (this.wn = e),
23
- (this.xn = s + "/safari/" + t),
24
- (this.kn = r || "/service-worker.js"),
25
- (this.Dn = o),
20
+ (this.hn = i),
21
+ (this.cn = t),
22
+ (this.fn = e),
23
+ (this.vn = s + "/safari/" + t),
24
+ (this.dn = r || "/service-worker.js"),
25
+ (this.yn = o),
26
26
  (this.B = u),
27
- (this.Sn = a || !1),
28
- (this.An = h || !1),
27
+ (this.mn = a || !1),
28
+ (this.gn = h || !1),
29
29
  (this.C = c),
30
- (this.Nn = yt.Un()),
31
- (this.Wn = yt._n());
30
+ (this.wn = vt.kn()),
31
+ (this.Pn = vt.Dn());
32
32
  }
33
- Tn() {
34
- return this.An;
33
+ Sn() {
34
+ return this.gn;
35
35
  }
36
- In(i, t, e, s, r) {
36
+ An(i, t, e, s, r) {
37
37
  i.unsubscribe()
38
38
  .then((i) => {
39
39
  i
40
- ? this.Vn(t, e, s, r)
40
+ ? this.jn(t, e, s, r)
41
41
  : (N.error("Failed to unsubscribe device from push."),
42
42
  "function" == typeof r && r(!1));
43
43
  })
@@ -46,7 +46,7 @@ export default class na {
46
46
  "function" == typeof r && r(!1);
47
47
  });
48
48
  }
49
- qn(i, t, e) {
49
+ xn(i, t, e) {
50
50
  var s;
51
51
  const r = ((i) => {
52
52
  if ("string" == typeof i) return i;
@@ -55,9 +55,9 @@ export default class na {
55
55
  let t = i.endpoint;
56
56
  const e = i;
57
57
  return (
58
- e.zn &&
59
- -1 === i.endpoint.indexOf(e.zn) &&
60
- (t = i.endpoint + "/" + e.zn),
58
+ e.Nn &&
59
+ -1 === i.endpoint.indexOf(e.Nn) &&
60
+ (t = i.endpoint + "/" + e.Nn),
61
61
  t
62
62
  );
63
63
  })(i);
@@ -84,53 +84,53 @@ export default class na {
84
84
  .replace(/\//g, "_")
85
85
  : null;
86
86
  })(u);
87
- null === (s = this.bn) || void 0 === s || s.En(r, t, n, o, a),
87
+ null === (s = this.hn) || void 0 === s || s.Un(r, t, n, o, a),
88
88
  r && "function" == typeof e && e(r, n, o);
89
89
  }
90
- Rn() {
90
+ Wn() {
91
91
  var i;
92
- null === (i = this.bn) || void 0 === i || i.Cn(!0);
92
+ null === (i = this.hn) || void 0 === i || i._n(!0);
93
93
  }
94
- Fn(i, t) {
94
+ Tn(i, t) {
95
95
  var e;
96
- null === (e = this.bn) || void 0 === e || e.Cn(!1),
96
+ null === (e = this.hn) || void 0 === e || e._n(!1),
97
97
  N.info(i),
98
98
  "function" == typeof t && t(!1);
99
99
  }
100
- On(i, t, e, s) {
100
+ In(i, t, e, s) {
101
101
  var r;
102
102
  if ("default" === t.permission)
103
103
  try {
104
104
  window.safari.pushNotification.requestPermission(
105
- this.xn,
105
+ this.vn,
106
106
  i,
107
107
  {
108
- api_key: this.yn,
108
+ api_key: this.cn,
109
109
  device_id:
110
- (null === (r = this.wn) || void 0 === r ? void 0 : r.ce().id) ||
110
+ (null === (r = this.fn) || void 0 === r ? void 0 : r.de().id) ||
111
111
  "",
112
112
  },
113
113
  (t) => {
114
114
  "granted" === t.permission &&
115
- this.bn &&
116
- this.bn.setPushNotificationSubscriptionType(
115
+ this.hn &&
116
+ this.hn.setPushNotificationSubscriptionType(
117
117
  User.NotificationSubscriptionTypes.OPTED_IN,
118
118
  ),
119
- this.On(i, t, e, s);
119
+ this.In(i, t, e, s);
120
120
  },
121
121
  );
122
122
  } catch (i) {
123
- this.Fn("Could not request permission for push: " + i, s);
123
+ this.Tn("Could not request permission for push: " + i, s);
124
124
  }
125
125
  else
126
126
  "denied" === t.permission
127
- ? this.Fn(
127
+ ? this.Tn(
128
128
  "The user has blocked notifications from this site, or Safari push is not configured in the Braze dashboard.",
129
129
  s,
130
130
  )
131
131
  : "granted" === t.permission &&
132
132
  (N.info("Device successfully subscribed to push."),
133
- this.qn(t.deviceToken, new Date(), e));
133
+ this.xn(t.deviceToken, new Date(), e));
134
134
  }
135
135
  requestPermission(i, t, e) {
136
136
  const s = (s) => {
@@ -159,27 +159,27 @@ export default class na {
159
159
  : (r = !0);
160
160
  }
161
161
  }
162
- Vn(i, t, e, s) {
162
+ jn(i, t, e, s) {
163
163
  const r = { userVisibleOnly: !0 };
164
164
  null != t && (r.applicationServerKey = t),
165
165
  i.pushManager
166
166
  .subscribe(r)
167
167
  .then((i) => {
168
168
  N.info("Device successfully subscribed to push."),
169
- this.qn(i, new Date(), e);
169
+ this.xn(i, new Date(), e);
170
170
  })
171
171
  .catch((i) => {
172
- yt.isPushBlocked()
172
+ vt.isPushBlocked()
173
173
  ? (N.info("Permission for push notifications was denied."),
174
174
  "function" == typeof s && s(!1))
175
175
  : (N.error("Push subscription failed: " + i),
176
176
  "function" == typeof s && s(!0));
177
177
  });
178
178
  }
179
- Bn() {
180
- if (this.Sn) return navigator.serviceWorker.getRegistration(this.kn);
181
- const i = this.Pn ? { scope: this.Pn } : void 0;
182
- return navigator.serviceWorker.register(this.kn, i).then(() =>
179
+ Vn() {
180
+ if (this.mn) return navigator.serviceWorker.getRegistration(this.dn);
181
+ const i = this.bn ? { scope: this.bn } : void 0;
182
+ return navigator.serviceWorker.register(this.dn, i).then(() =>
183
183
  navigator.serviceWorker.ready.then(
184
184
  (i) => (
185
185
  i &&
@@ -192,32 +192,32 @@ export default class na {
192
192
  ),
193
193
  );
194
194
  }
195
- Mn(i) {
196
- this.Sn ||
195
+ qn(i) {
196
+ this.mn ||
197
197
  (i.unregister(), N.info("Service worker successfully unregistered."));
198
198
  }
199
199
  subscribe(i, e) {
200
- if (!yt.isPushSupported())
201
- return N.info(na.Yn), void ("function" == typeof e && e(!1));
202
- if (this.Nn) {
203
- if (!this.Sn && null != window.location) {
204
- let i = this.kn;
200
+ if (!vt.isPushSupported())
201
+ return N.info(na.zn), void ("function" == typeof e && e(!1));
202
+ if (this.wn) {
203
+ if (!this.mn && null != window.location) {
204
+ let i = this.dn;
205
205
  -1 === i.indexOf(window.location.host) &&
206
206
  (i = window.location.host + i),
207
207
  -1 === i.indexOf(window.location.protocol) &&
208
208
  (i = window.location.protocol + "//" + i);
209
209
  }
210
- if (yt.isPushBlocked())
211
- return void this.Fn(
210
+ if (vt.isPushBlocked())
211
+ return void this.Tn(
212
212
  "Notifications from this site are blocked. This may be a temporary embargo or a permanent denial.",
213
213
  e,
214
214
  );
215
- if (this.B && !this.B.Gn() && 0 === this.B.Es())
215
+ if (this.B && !this.B.En() && 0 === this.B.Us())
216
216
  return (
217
217
  N.info(
218
218
  "Waiting for VAPID key from server config before subscribing to push.",
219
219
  ),
220
- void this.B.Hn(() => {
220
+ void this.B.Rn(() => {
221
221
  this.subscribe(i, e);
222
222
  })
223
223
  );
@@ -227,20 +227,20 @@ export default class na {
227
227
  },
228
228
  r = () => {
229
229
  let i = "Permission for push notifications was ignored.";
230
- yt.isPushBlocked() &&
230
+ vt.isPushBlocked() &&
231
231
  (i +=
232
232
  " The browser has automatically blocked further permission requests for a period (probably 1 week)."),
233
233
  N.info(i),
234
234
  "function" == typeof e && e(!0);
235
235
  },
236
- n = yt.isPushPermissionGranted(),
236
+ n = vt.isPushPermissionGranted(),
237
237
  o = () => {
238
238
  !n &&
239
- this.bn &&
240
- this.bn.setPushNotificationSubscriptionType(
239
+ this.hn &&
240
+ this.hn.setPushNotificationSubscriptionType(
241
241
  User.NotificationSubscriptionTypes.OPTED_IN,
242
242
  ),
243
- this.Bn()
243
+ this.Vn()
244
244
  .then((s) => {
245
245
  if (null == s)
246
246
  return (
@@ -258,16 +258,16 @@ export default class na {
258
258
  (null !=
259
259
  (null === (n = this.B) || void 0 === n
260
260
  ? void 0
261
- : n.Gn()) && (o = ei.Jn(this.B.Gn())),
261
+ : n.En()) && (o = ei.Cn(this.B.En())),
262
262
  r)
263
263
  ) {
264
264
  let n,
265
265
  u = null,
266
266
  a = null;
267
- if ((this.C && (n = this.C.ps(t.bs.Kn)), n && !w(n))) {
267
+ if ((this.C && (n = this.C.vs(t.gs.Fn)), n && !z(n))) {
268
268
  let i;
269
269
  try {
270
- i = ti.Qn(n).Ln;
270
+ i = ti.Bn(n).On;
271
271
  } catch (t) {
272
272
  i = null;
273
273
  }
@@ -291,31 +291,31 @@ export default class na {
291
291
  : N.info(
292
292
  "Attempting to upgrade a gcm_sender_id-based push registration to VAPID - depending on the browser this may or may not result in the same gcm_sender_id-based subscription.",
293
293
  ),
294
- this.In(r, s, o, i, e))
294
+ this.An(r, s, o, i, e))
295
295
  : r.expirationTime &&
296
296
  new Date(r.expirationTime).valueOf() <=
297
297
  new Date().valueOf()
298
298
  ? (N.info(
299
299
  "Push subscription is expired, creating new subscription.",
300
300
  ),
301
- this.In(r, s, o, i, e))
302
- : n && w(n)
303
- ? this.In(r, s, o, i, e)
301
+ this.An(r, s, o, i, e))
302
+ : n && z(n)
303
+ ? this.An(r, s, o, i, e)
304
304
  : null == a
305
305
  ? (N.info(
306
306
  "No push subscription creation date found, creating new subscription.",
307
307
  ),
308
- this.In(r, s, o, i, e))
308
+ this.An(r, s, o, i, e))
309
309
  : a.valueOf() <= new Date().valueOf()
310
310
  ? (N.info(
311
311
  "Push subscription older than 6 months, creating new subscription.",
312
312
  ),
313
- this.In(r, s, o, i, e))
313
+ this.An(r, s, o, i, e))
314
314
  : (N.info(
315
315
  "Device already subscribed to push, sending existing subscription to backend.",
316
316
  ),
317
- this.qn(r, u, i));
318
- } else this.Vn(s, o, i, e);
317
+ this.xn(r, u, i));
318
+ } else this.jn(s, o, i, e);
319
319
  })
320
320
  .catch((i) => {
321
321
  N.error("Error checking current push subscriptions: " + i);
@@ -326,29 +326,29 @@ export default class na {
326
326
  });
327
327
  };
328
328
  this.requestPermission(o, r, s);
329
- } else if (this.Wn) {
330
- if (null == this.Dn || "" === this.Dn)
329
+ } else if (this.Pn) {
330
+ if (null == this.yn || "" === this.yn)
331
331
  return (
332
332
  N.error(
333
333
  "You must supply the safariWebsitePushId initialization option in order to use registerPush on Safari",
334
334
  ),
335
335
  void ("function" == typeof e && e(!0))
336
336
  );
337
- const t = window.safari.pushNotification.permission(this.Dn);
338
- this.On(this.Dn, t, i, e);
337
+ const t = window.safari.pushNotification.permission(this.yn);
338
+ this.In(this.yn, t, i, e);
339
339
  }
340
340
  }
341
341
  unsubscribe(i, t) {
342
- if (!yt.isPushSupported())
343
- return N.info(na.Yn), void ("function" == typeof t && t());
344
- this.Nn
345
- ? navigator.serviceWorker.getRegistration(this.kn).then((e) => {
342
+ if (!vt.isPushSupported())
343
+ return N.info(na.zn), void ("function" == typeof t && t());
344
+ this.wn
345
+ ? navigator.serviceWorker.getRegistration(this.dn).then((e) => {
346
346
  e
347
347
  ? e.pushManager
348
348
  .getSubscription()
349
349
  .then((s) => {
350
350
  s
351
- ? (this.Rn(),
351
+ ? (this.Wn(),
352
352
  s
353
353
  .unsubscribe()
354
354
  .then((s) => {
@@ -361,7 +361,7 @@ export default class na {
361
361
  "Failed to unsubscribe device from push.",
362
362
  ),
363
363
  "function" == typeof t && t()),
364
- this.Mn(e);
364
+ this.qn(e);
365
365
  })
366
366
  .catch((i) => {
367
367
  N.error("Push unsubscription error: " + i),
@@ -377,10 +377,10 @@ export default class na {
377
377
  : (N.info("Device already unsubscribed from push."),
378
378
  "function" == typeof i && i());
379
379
  })
380
- : this.Wn &&
381
- (this.Rn(),
380
+ : this.Pn &&
381
+ (this.Wn(),
382
382
  N.info("Device unsubscribed from push."),
383
383
  "function" == typeof i && i());
384
384
  }
385
385
  }
386
- na.Yn = "Push notifications are not supported in this browser.";
386
+ na.zn = "Push notifications are not supported in this browser.";
@@ -1,36 +1,36 @@
1
- const yt = {
2
- Un: () =>
1
+ const vt = {
2
+ kn: () =>
3
3
  "serviceWorker" in navigator &&
4
4
  "undefined" != typeof ServiceWorkerRegistration &&
5
5
  "showNotification" in ServiceWorkerRegistration.prototype &&
6
6
  "PushManager" in window,
7
- _n: () =>
7
+ Dn: () =>
8
8
  "safari" in window &&
9
9
  "pushNotification" in window.safari &&
10
10
  "function" == typeof window.safari.pushNotification.permission &&
11
11
  "function" == typeof window.safari.pushNotification.requestPermission,
12
- isPushSupported: () => yt.Un() || yt._n(),
12
+ isPushSupported: () => vt.kn() || vt.Dn(),
13
13
  isPushBlocked: () => {
14
14
  const i =
15
- yt.isPushSupported() &&
15
+ vt.isPushSupported() &&
16
16
  "Notification" in window &&
17
17
  null != window.Notification &&
18
18
  null != window.Notification.permission &&
19
19
  "denied" === window.Notification.permission,
20
20
  n =
21
- yt.isPushSupported() &&
21
+ vt.isPushSupported() &&
22
22
  (!("Notification" in window) || null == window.Notification);
23
23
  return i || n;
24
24
  },
25
25
  isPushPermissionGranted: () =>
26
- yt.isPushSupported() &&
26
+ vt.isPushSupported() &&
27
27
  "Notification" in window &&
28
28
  null != window.Notification &&
29
29
  null != window.Notification.permission &&
30
30
  "granted" === window.Notification.permission,
31
- Ur: () =>
32
- !yt.isPushBlocked() &&
33
- yt.isPushSupported() &&
34
- !yt.isPushPermissionGranted(),
31
+ Nr: () =>
32
+ !vt.isPushBlocked() &&
33
+ vt.isPushSupported() &&
34
+ !vt.isPushPermissionGranted(),
35
35
  };
36
- export default yt;
36
+ export default vt;
@@ -1,10 +1,10 @@
1
1
  import _t from "../models/identifier.js";
2
2
  import { getByteLength as er } from "../util/string-utils.js";
3
3
  import ti from "../models/push-token.js";
4
- import { logger as N, IndexedDBAdapter as it } from "../../shared-lib/index.js";
4
+ import { logger as N, IndexedDBAdapter as tt } from "../../shared-lib/index.js";
5
5
  import { STORAGE_KEYS as t } from "../managers/storage-manager.js";
6
6
  import { User } from "../User/index.js";
7
- export default class kt {
7
+ export default class bt {
8
8
  constructor(t, s) {
9
9
  (this.B = t), (this.C = s), (this.B = t), (this.C = s);
10
10
  }
@@ -13,8 +13,8 @@ export default class kt {
13
13
  if (null == s) return null;
14
14
  let i = s.eu,
15
15
  e = er(i);
16
- if (e > User.mr) {
17
- for (; e > User.mr; ) (i = i.slice(0, i.length - 1)), (e = er(i));
16
+ if (e > User.ur) {
17
+ for (; e > User.ur; ) (i = i.slice(0, i.length - 1)), (e = er(i));
18
18
  (s.eu = i), this.C.uu(t.iu.su, s);
19
19
  }
20
20
  return i;
@@ -47,17 +47,17 @@ export default class kt {
47
47
  u
48
48
  );
49
49
  }
50
- En(s, i, e, u, o) {
50
+ Un(s, i, e, u, o) {
51
51
  this.nu("push_token", s, !1, !0),
52
52
  this.nu("custom_push_public_key", e, !1, !0),
53
53
  this.nu("custom_push_user_auth", u, !1, !0),
54
54
  this.nu("custom_push_vapid_public_key", o, !1, !0);
55
- const r = it.Gs._s,
56
- h = new it(r, N),
55
+ const r = tt._s.Xs,
56
+ h = new tt(r, N),
57
57
  n = new ti(s, i, e, u, o);
58
- this.C.js(t.bs.Kn, n.Bs()), h.setItem(r.Os.cu, r.oe, !0);
58
+ this.C.Bs(t.gs.Fn, n.bs()), h.setItem(r.Ks.cu, r.te, !0);
59
59
  }
60
- Cn(s) {
60
+ _n(s) {
61
61
  if (
62
62
  (this.nu("push_token", null, !1, !0),
63
63
  this.nu("custom_push_public_key", null, !1, !0),
@@ -65,9 +65,9 @@ export default class kt {
65
65
  this.nu("custom_push_vapid_public_key", null, !1, !0),
66
66
  s)
67
67
  ) {
68
- const s = it.Gs._s,
69
- i = new it(s, N);
70
- this.C.js(t.bs.Kn, !1), i.setItem(s.Os.cu, s.oe, !1);
68
+ const s = tt._s.Xs,
69
+ i = new tt(s, N);
70
+ this.C.Bs(t.gs.Fn, !1), i.setItem(s.Ks.cu, s.te, !1);
71
71
  }
72
72
  }
73
73
  }