@braze/web-sdk 4.7.1 → 4.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 (161) hide show
  1. package/index.d.ts +27 -24
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +5 -5
  4. package/shared-lib/encoding-utils.js +1 -1
  5. package/shared-lib/event-types.js +24 -24
  6. package/shared-lib/guid.js +3 -3
  7. package/shared-lib/indexed-db-adapter.js +17 -17
  8. package/shared-lib/logger.js +18 -18
  9. package/shared-lib/supported-options.js +18 -18
  10. package/src/Card/card-manager-factory.js +2 -2
  11. package/src/Card/card-manager.js +47 -41
  12. package/src/Card/display/card-display.js +70 -67
  13. package/src/Card/log-card-click.js +1 -1
  14. package/src/Card/log-card-dismissal.js +1 -1
  15. package/src/Card/log-card-impressions.js +3 -3
  16. package/src/Card/models/banner.js +3 -2
  17. package/src/Card/models/captioned-image.js +6 -5
  18. package/src/Card/models/card.js +107 -87
  19. package/src/Card/models/classic-card.js +5 -5
  20. package/src/Card/models/control-card.js +5 -21
  21. package/src/Card/types.js +1 -0
  22. package/src/Card/util/card-factory.js +32 -32
  23. package/src/ContentCards/content-cards-provider-factory.js +3 -3
  24. package/src/ContentCards/content-cards-provider.js +283 -175
  25. package/src/ContentCards/content-cards.js +2 -2
  26. package/src/ContentCards/get-cached-content-cards.js +1 -1
  27. package/src/ContentCards/log-content-cards-displayed.js +2 -2
  28. package/src/ContentCards/request-content-cards-refresh.js +1 -1
  29. package/src/ContentCards/subscribe-to-content-cards-updates.js +9 -6
  30. package/src/ContentCards/types.js +1 -0
  31. package/src/ContentCards/ui/hide-content-cards.js +2 -2
  32. package/src/ContentCards/ui/show-content-cards.js +35 -33
  33. package/src/Core/add-sdk-metadata.js +17 -18
  34. package/src/Core/change-user.js +12 -14
  35. package/src/Core/destroy.js +1 -1
  36. package/src/Core/disable-sdk.js +7 -6
  37. package/src/Core/enable-sdk.js +4 -4
  38. package/src/Core/get-device-id.js +7 -6
  39. package/src/Core/get-user.js +1 -1
  40. package/src/Core/handle-braze-action.js +57 -40
  41. package/src/Core/is-disabled.js +2 -2
  42. package/src/Core/log-custom-event.js +22 -15
  43. package/src/Core/log-purchase.js +33 -33
  44. package/src/Core/open-session.js +17 -15
  45. package/src/Core/request-immediate-data-flush.js +4 -2
  46. package/src/Core/set-logger.js +1 -1
  47. package/src/Core/set-sdk-authentication-signature.js +5 -6
  48. package/src/Core/subscribe-to-sdk-authentication-failures.js +3 -1
  49. package/src/Core/toggle-logging.js +1 -1
  50. package/src/Core/types.js +1 -0
  51. package/src/Core/wipe-data.js +11 -10
  52. package/src/FeatureFlags/feature-flag-factory.js +6 -6
  53. package/src/FeatureFlags/feature-flag.js +17 -17
  54. package/src/FeatureFlags/feature-flags-provider-factory.js +2 -2
  55. package/src/FeatureFlags/feature-flags-provider.js +67 -65
  56. package/src/FeatureFlags/get-all-feature-flags.js +3 -3
  57. package/src/FeatureFlags/get-feature-flag.js +4 -4
  58. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +4 -1
  59. package/src/Feed/feed-provider-factory.js +8 -8
  60. package/src/Feed/feed-provider.js +57 -46
  61. package/src/Feed/feed.js +1 -1
  62. package/src/Feed/get-cached-feed.js +2 -2
  63. package/src/Feed/log-feed-displayed.js +3 -1
  64. package/src/Feed/request-feed-refresh.js +2 -2
  65. package/src/Feed/subscribe-to-feed-updates.js +2 -2
  66. package/src/Feed/types.js +1 -0
  67. package/src/Feed/ui/hide-feed.js +2 -2
  68. package/src/Feed/ui/show-feed.js +40 -36
  69. package/src/InAppMessage/display/html-message-to-html.js +125 -119
  70. package/src/InAppMessage/display/in-app-message-to-html.js +72 -69
  71. package/src/InAppMessage/display/modal-utils.js +18 -13
  72. package/src/InAppMessage/in-app-message-factory.js +9 -8
  73. package/src/InAppMessage/in-app-message-manager-factory.js +7 -7
  74. package/src/InAppMessage/in-app-message-manager.js +122 -108
  75. package/src/InAppMessage/log-in-app-message-button-click.js +10 -10
  76. package/src/InAppMessage/log-in-app-message-click.js +9 -9
  77. package/src/InAppMessage/log-in-app-message-html-click.js +10 -10
  78. package/src/InAppMessage/log-in-app-message-impression.js +5 -5
  79. package/src/InAppMessage/models/control-message.js +4 -1
  80. package/src/InAppMessage/models/full-screen-message.js +35 -37
  81. package/src/InAppMessage/models/html-message.js +34 -33
  82. package/src/InAppMessage/models/in-app-message-button.js +23 -16
  83. package/src/InAppMessage/models/in-app-message.js +147 -105
  84. package/src/InAppMessage/models/modal-message.js +34 -36
  85. package/src/InAppMessage/models/slide-up-message.js +25 -27
  86. package/src/InAppMessage/models/templated-in-app-message.js +12 -7
  87. package/src/InAppMessage/subscribe-to-in-app-message.js +2 -2
  88. package/src/InAppMessage/types.js +1 -0
  89. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +4 -4
  90. package/src/InAppMessage/ui/show-in-app-message.js +95 -89
  91. package/src/InAppMessage/utils/in-app-message-utils.js +1 -0
  92. package/src/Push/is-push-blocked.js +2 -2
  93. package/src/Push/is-push-permission-granted.js +2 -2
  94. package/src/Push/is-push-supported.js +2 -2
  95. package/src/Push/push-manager-factory.js +20 -20
  96. package/src/Push/push-manager.js +192 -174
  97. package/src/Push/request-push-permission.js +4 -3
  98. package/src/Push/types.js +1 -0
  99. package/src/Push/unregister-push.js +2 -2
  100. package/src/Push/utils/push-utils.js +10 -10
  101. package/src/User/types.js +1 -0
  102. package/src/User/user-manager.js +24 -24
  103. package/src/User/user.js +117 -105
  104. package/src/common/base-feed.js +7 -7
  105. package/src/common/base-provider.js +2 -2
  106. package/src/common/constants.js +6 -0
  107. package/src/common/event-logger.js +6 -6
  108. package/src/common/feed-display.js +18 -18
  109. package/src/common/types.js +1 -0
  110. package/src/l10n/l10n-manager-factory.js +5 -5
  111. package/src/l10n/l10n-manager.js +1 -1
  112. package/src/managers/auth-manager.js +32 -32
  113. package/src/managers/braze-instance.js +204 -202
  114. package/src/managers/device-manager.js +23 -23
  115. package/src/managers/network-manager.js +96 -82
  116. package/src/managers/server-config-manager.js +60 -42
  117. package/src/managers/session-manager.js +41 -41
  118. package/src/managers/storage-manager-factory.js +15 -15
  119. package/src/managers/storage-manager.js +165 -155
  120. package/src/managers/subscription-manager.js +11 -11
  121. package/src/models/backend-errors.js +5 -5
  122. package/src/models/braze-event.js +7 -7
  123. package/src/models/device.js +2 -2
  124. package/src/models/identifier.js +7 -7
  125. package/src/models/push-token.js +7 -7
  126. package/src/models/request-result.js +3 -3
  127. package/src/models/server-config.js +20 -20
  128. package/src/request-controller.js +176 -174
  129. package/src/triggers/models/custom-event-data.js +6 -6
  130. package/src/triggers/models/custom-event-property-data.js +9 -9
  131. package/src/triggers/models/filter-set.js +9 -9
  132. package/src/triggers/models/filter.js +64 -64
  133. package/src/triggers/models/in-app-message-click-data.js +12 -12
  134. package/src/triggers/models/purchase-data.js +3 -3
  135. package/src/triggers/models/purchase-property-data.js +9 -9
  136. package/src/triggers/models/push-click-data.js +5 -5
  137. package/src/triggers/models/trigger-condition.js +52 -52
  138. package/src/triggers/models/trigger-events.js +2 -2
  139. package/src/triggers/models/trigger.js +42 -42
  140. package/src/triggers/triggers-provider-factory.js +8 -8
  141. package/src/triggers/triggers-provider.js +171 -168
  142. package/src/types.js +1 -0
  143. package/src/ui/js/attach-css.js +3 -3
  144. package/src/ui/js/load-font-awesome.js +2 -2
  145. package/src/util/base-device-parser.js +1 -1
  146. package/src/util/braze-actions.js +20 -20
  147. package/src/util/browser-detector.js +22 -22
  148. package/src/util/client-hints-parser.js +6 -6
  149. package/src/util/code-utils.js +1 -1
  150. package/src/util/color-utils.js +2 -2
  151. package/src/util/component-utils.js +2 -2
  152. package/src/util/deprecation-utils.js +1 -1
  153. package/src/util/device-constants.js +5 -5
  154. package/src/util/dom-utils.js +2 -2
  155. package/src/util/key-codes.js +1 -1
  156. package/src/util/net.js +11 -11
  157. package/src/util/request-header-utils.js +23 -0
  158. package/src/util/string-utils.js +1 -1
  159. package/src/util/user-agent-parser.js +20 -20
  160. package/src/util/validation-utils.js +44 -44
  161. package/src/util/window-utils.js +3 -3
@@ -1,16 +1,16 @@
1
- import Vt from "./filter.js";
1
+ import Zt from "./filter.js";
2
2
  import { isArray as p } from "../../util/code-utils.js";
3
- export default class Gt {
3
+ export default class Qt {
4
4
  constructor(t) {
5
5
  this.filters = t;
6
6
  }
7
- Jl(t) {
7
+ Bl(t) {
8
8
  let r = !0;
9
9
  for (let e = 0; e < this.filters.length; e++) {
10
10
  const o = this.filters[e];
11
11
  let s = !1;
12
12
  for (let r = 0; r < o.length; r++)
13
- if (o[r].Jl(t)) {
13
+ if (o[r].Bl(t)) {
14
14
  s = !0;
15
15
  break;
16
16
  }
@@ -27,10 +27,10 @@ export default class Gt {
27
27
  for (let e = 0; e < t.length; e++) {
28
28
  const o = [],
29
29
  s = t[e];
30
- for (let t = 0; t < s.length; t++) o.push(Vt.fromJson(s[t]));
30
+ for (let t = 0; t < s.length; t++) o.push(Zt.fromJson(s[t]));
31
31
  r.push(o);
32
32
  }
33
- return new Gt(r);
33
+ return new Qt(r);
34
34
  }
35
35
  ss() {
36
36
  const t = [];
@@ -42,14 +42,14 @@ export default class Gt {
42
42
  }
43
43
  return t;
44
44
  }
45
- static Pn(t) {
45
+ static Tn(t) {
46
46
  const r = [];
47
47
  for (let e = 0; e < t.length; e++) {
48
48
  const o = [],
49
49
  s = t[e];
50
- for (let t = 0; t < s.length; t++) o.push(Vt.Pn(s[t]));
50
+ for (let t = 0; t < s.length; t++) o.push(Zt.Tn(s[t]));
51
51
  r.push(o);
52
52
  }
53
- return new Gt(r);
53
+ return new Qt(r);
54
54
  }
55
55
  }
@@ -1,69 +1,69 @@
1
1
  import { isDate as Nt } from "../../util/code-utils.js";
2
2
  import {
3
- convertMsToSeconds as l,
4
- dateFromUnixTimestamp as h,
5
- secondsAgo as Qt,
6
- secondsInTheFuture as Wt
3
+ convertMsToSeconds as h,
4
+ dateFromUnixTimestamp as l,
5
+ secondsAgo as ts,
6
+ secondsInTheFuture as es
7
7
  } from "../../util/date-utils.js";
8
- export default class Vt {
8
+ export default class Zt {
9
9
  constructor(t, s, e, i) {
10
- (this.Hl = t),
11
- (this.Ql = s),
10
+ (this.El = t),
11
+ (this.Hl = s),
12
12
  (this.comparator = e),
13
- (this.Xl = i),
14
- this.Ql === Vt.Kl.Vl &&
15
- this.comparator !== Vt.Yl.Wl &&
16
- this.comparator !== Vt.Yl.Zl &&
17
- this.comparator !== Vt.Yl.Uh &&
18
- this.comparator !== Vt.Yl.Qh &&
19
- (this.Xl = h(this.Xl));
13
+ (this.Il = i),
14
+ this.Hl === Zt.Ql.Ul &&
15
+ this.comparator !== Zt.Gl.Xl &&
16
+ this.comparator !== Zt.Gl.Vl &&
17
+ this.comparator !== Zt.Gl.Kl &&
18
+ this.comparator !== Zt.Gl.Wl &&
19
+ (this.Il = l(this.Il));
20
20
  }
21
- Jl(t) {
21
+ Bl(t) {
22
22
  let s = null;
23
- switch ((null != t && (s = t[this.Hl]), this.comparator)) {
24
- case Vt.Yl.Xh:
25
- return null != s && s.valueOf() === this.Xl.valueOf();
26
- case Vt.Yl.Vh:
27
- return null == s || s.valueOf() !== this.Xl.valueOf();
28
- case Vt.Yl.Kh:
29
- return typeof s == typeof this.Xl && s > this.Xl;
30
- case Vt.Yl.Wl:
31
- return this.Ql === Vt.Kl.Vl
32
- ? null != s && Nt(s) && Qt(s) <= this.Xl
33
- : typeof s == typeof this.Xl && s >= this.Xl;
34
- case Vt.Yl.Yh:
35
- return typeof s == typeof this.Xl && s < this.Xl;
36
- case Vt.Yl.Zl:
37
- return this.Ql === Vt.Kl.Vl
38
- ? null != s && Nt(s) && Qt(s) >= this.Xl
39
- : typeof s == typeof this.Xl && s <= this.Xl;
40
- case Vt.Yl.Zh:
23
+ switch ((null != t && (s = t[this.El]), this.comparator)) {
24
+ case Zt.Gl.Yl:
25
+ return null != s && s.valueOf() === this.Il.valueOf();
26
+ case Zt.Gl.Zl:
27
+ return null == s || s.valueOf() !== this.Il.valueOf();
28
+ case Zt.Gl.Zh:
29
+ return typeof s == typeof this.Il && s > this.Il;
30
+ case Zt.Gl.Xl:
31
+ return this.Hl === Zt.Ql.Ul
32
+ ? null != s && Nt(s) && ts(s) <= this.Il
33
+ : typeof s == typeof this.Il && s >= this.Il;
34
+ case Zt.Gl.$h:
35
+ return typeof s == typeof this.Il && s < this.Il;
36
+ case Zt.Gl.Vl:
37
+ return this.Hl === Zt.Ql.Ul
38
+ ? null != s && Nt(s) && ts(s) >= this.Il
39
+ : typeof s == typeof this.Il && s <= this.Il;
40
+ case Zt.Gl.Eu:
41
41
  return (
42
42
  null != s &&
43
43
  "string" == typeof s &&
44
- typeof s == typeof this.Xl &&
45
- null != s.match(this.Xl)
44
+ typeof s == typeof this.Il &&
45
+ null != s.match(this.Il)
46
46
  );
47
- case Vt.Yl.$h:
47
+ case Zt.Gl.Tu:
48
48
  return null != s;
49
- case Vt.Yl.Eu:
49
+ case Zt.Gl._u:
50
50
  return null == s;
51
- case Vt.Yl.Uh:
52
- return null != s && Nt(s) && Wt(s) < this.Xl;
53
- case Vt.Yl.Qh:
54
- return null != s && Nt(s) && Wt(s) > this.Xl;
55
- case Vt.Yl.au:
51
+ case Zt.Gl.Kl:
52
+ return null != s && Nt(s) && es(s) < this.Il;
53
+ case Zt.Gl.Wl:
54
+ return null != s && Nt(s) && es(s) > this.Il;
55
+ case Zt.Gl.yu:
56
56
  return (
57
57
  null == s ||
58
- typeof s != typeof this.Xl ||
58
+ typeof s != typeof this.Il ||
59
59
  "string" != typeof s ||
60
- null == s.match(this.Xl)
60
+ null == s.match(this.Il)
61
61
  );
62
62
  }
63
63
  return !1;
64
64
  }
65
65
  static fromJson(t) {
66
- return new Vt(
66
+ return new Zt(
67
67
  t.property_key,
68
68
  t.property_type,
69
69
  t.comparator,
@@ -71,28 +71,28 @@ export default class Vt {
71
71
  );
72
72
  }
73
73
  ss() {
74
- let t = this.Xl;
74
+ let t = this.Il;
75
75
  return (
76
- Nt(this.Xl) && (t = l(t.valueOf())),
77
- { k: this.Hl, t: this.Ql, c: this.comparator, v: t }
76
+ Nt(this.Il) && (t = h(t.valueOf())),
77
+ { k: this.El, t: this.Hl, c: this.comparator, v: t }
78
78
  );
79
79
  }
80
- static Pn(t) {
81
- return new Vt(t.k, t.t, t.c, t.v);
80
+ static Tn(t) {
81
+ return new Zt(t.k, t.t, t.c, t.v);
82
82
  }
83
83
  }
84
- (Vt.Yl = {
85
- Xh: 1,
86
- Vh: 2,
87
- Kh: 3,
88
- Wl: 4,
89
- Yh: 5,
90
- Zl: 6,
91
- Zh: 10,
92
- $h: 11,
93
- Eu: 12,
94
- Uh: 15,
95
- Qh: 16,
96
- au: 17
84
+ (Zt.Gl = {
85
+ Yl: 1,
86
+ Zl: 2,
87
+ Zh: 3,
88
+ Xl: 4,
89
+ $h: 5,
90
+ Vl: 6,
91
+ Eu: 10,
92
+ Tu: 11,
93
+ _u: 12,
94
+ Kl: 15,
95
+ Wl: 16,
96
+ yu: 17
97
97
  }),
98
- (Vt.Kl = { Tu: "boolean", Au: "number", _u: "string", Vl: "date" });
98
+ (Zt.Ql = { Nu: "boolean", Mu: "number", Ru: "string", Ul: "date" });
@@ -1,25 +1,25 @@
1
- import Yt from "./trigger-condition.js";
2
- export default class Zt {
1
+ import ri from "./trigger-condition.js";
2
+ export default class si {
3
3
  constructor(t, i) {
4
- (this.fu = t), (this.du = i);
4
+ (this.ju = t), (this.ku = i);
5
5
  }
6
- Jl(t) {
7
- if (null == this.fu) return !1;
8
- const i = Yt.gu(t[0], this.fu);
6
+ Bl(t) {
7
+ if (null == this.ju) return !1;
8
+ const i = ri.wu(t[0], this.ju);
9
9
  if (!i) return !1;
10
- let r = null == this.du || 0 === this.du.length;
11
- if (null != this.du)
12
- for (let i = 0; i < this.du.length; i++)
13
- if (this.du[i] === t[1]) {
10
+ let r = null == this.ku || 0 === this.ku.length;
11
+ if (null != this.ku)
12
+ for (let i = 0; i < this.ku.length; i++)
13
+ if (this.ku[i] === t[1]) {
14
14
  r = !0;
15
15
  break;
16
16
  }
17
17
  return i && r;
18
18
  }
19
19
  static fromJson(t) {
20
- return new Zt(t ? t.id : null, t ? t.buttons : null);
20
+ return new si(t ? t.id : null, t ? t.buttons : null);
21
21
  }
22
22
  ss() {
23
- return this.fu;
23
+ return this.ju;
24
24
  }
25
25
  }
@@ -1,12 +1,12 @@
1
- export default class $t {
1
+ export default class sr {
2
2
  constructor(t) {
3
3
  this.productId = t;
4
4
  }
5
- Jl(t) {
5
+ Bl(t) {
6
6
  return null == this.productId || t[0] === this.productId;
7
7
  }
8
8
  static fromJson(t) {
9
- return new $t(t ? t.product_id : null);
9
+ return new sr(t ? t.product_id : null);
10
10
  }
11
11
  ss() {
12
12
  return this.productId;
@@ -1,21 +1,21 @@
1
- import Gt from "./filter-set.js";
2
- export default class ts {
1
+ import Qt from "./filter-set.js";
2
+ export default class is {
3
3
  constructor(t, s) {
4
- (this.productId = t), (this.Gl = s);
4
+ (this.productId = t), (this.Jl = s);
5
5
  }
6
- Jl(t) {
7
- if (null == this.productId || null == this.Gl) return !1;
6
+ Bl(t) {
7
+ if (null == this.productId || null == this.Jl) return !1;
8
8
  const s = t[0],
9
9
  i = t[1];
10
- return s === this.productId && this.Gl.Jl(i);
10
+ return s === this.productId && this.Jl.Bl(i);
11
11
  }
12
12
  static fromJson(t) {
13
- return new ts(
13
+ return new is(
14
14
  t ? t.product_id : null,
15
- t ? Gt.fromJson(t.property_filters) : null
15
+ t ? Qt.fromJson(t.property_filters) : null
16
16
  );
17
17
  }
18
18
  ss() {
19
- return { id: this.productId, pf: this.Gl.ss() };
19
+ return { id: this.productId, pf: this.Jl.ss() };
20
20
  }
21
21
  }
@@ -1,15 +1,15 @@
1
- import Yt from "./trigger-condition.js";
1
+ import ri from "./trigger-condition.js";
2
2
  export default class lr {
3
3
  constructor(t) {
4
- this.fu = t;
4
+ this.ju = t;
5
5
  }
6
- Jl(t) {
7
- return null == this.fu || Yt.gu(t[0], this.fu);
6
+ Bl(t) {
7
+ return null == this.ju || ri.wu(t[0], this.ju);
8
8
  }
9
9
  static fromJson(t) {
10
10
  return new lr(t ? t.campaign_id : null);
11
11
  }
12
12
  ss() {
13
- return this.fu;
13
+ return this.ju;
14
14
  }
15
15
  }
@@ -1,26 +1,26 @@
1
- import xt from "./custom-event-data.js";
2
- import Ht from "./custom-event-property-data.js";
3
- import Gt from "./filter-set.js";
4
- import Zt from "./in-app-message-click-data.js";
5
- import $t from "./purchase-data.js";
6
- import ts from "./purchase-property-data.js";
1
+ import Gt from "./custom-event-data.js";
2
+ import Yt from "./custom-event-property-data.js";
3
+ import Qt from "./filter-set.js";
4
+ import si from "./in-app-message-click-data.js";
5
+ import sr from "./purchase-data.js";
6
+ import is from "./purchase-property-data.js";
7
7
  import lr from "./push-click-data.js";
8
- import V from "./trigger-events.js";
8
+ import tt from "./trigger-events.js";
9
9
  import r from "../../../shared-lib/braze-shared-lib.js";
10
- export default class Yt {
10
+ export default class ri {
11
11
  constructor(e, t) {
12
12
  (this.type = e), (this.data = t);
13
13
  }
14
14
  ec(e, t) {
15
- return Yt.tc[this.type] === e && (null == this.data || this.data.Jl(t));
15
+ return ri.tc[this.type] === e && (null == this.data || this.data.Bl(t));
16
16
  }
17
- static gu(e, t) {
17
+ static wu(e, t) {
18
18
  let a = null;
19
19
  try {
20
20
  a = window.atob(e);
21
21
  } catch (t) {
22
22
  return (
23
- r.D.info("Failed to unencode analytics id " + e + ": " + t.message), !1
23
+ r.j.info("Failed to unencode analytics id " + e + ": " + t.message), !1
24
24
  );
25
25
  }
26
26
  return t === a.split("_")[0];
@@ -29,81 +29,81 @@ export default class Yt {
29
29
  const t = e.type;
30
30
  let r;
31
31
  switch (t) {
32
- case Yt.rc.OPEN:
32
+ case ri.rc.OPEN:
33
33
  r = null;
34
34
  break;
35
- case Yt.rc.Rr:
36
- r = $t.fromJson(e.data);
35
+ case ri.rc.Rr:
36
+ r = sr.fromJson(e.data);
37
37
  break;
38
- case Yt.rc.ac:
39
- r = ts.fromJson(e.data);
38
+ case ri.rc.ac:
39
+ r = is.fromJson(e.data);
40
40
  break;
41
- case Yt.rc.vr:
41
+ case ri.rc.zr:
42
42
  r = lr.fromJson(e.data);
43
43
  break;
44
- case Yt.rc.be:
45
- r = xt.fromJson(e.data);
44
+ case ri.rc.be:
45
+ r = Gt.fromJson(e.data);
46
46
  break;
47
- case Yt.rc.sc:
48
- r = Ht.fromJson(e.data);
47
+ case ri.rc.sc:
48
+ r = Yt.fromJson(e.data);
49
49
  break;
50
- case Yt.rc.Mr:
51
- r = Zt.fromJson(e.data);
50
+ case ri.rc.Kr:
51
+ r = si.fromJson(e.data);
52
52
  break;
53
- case Yt.rc.ks:
53
+ case ri.rc.ks:
54
54
  r = null;
55
55
  }
56
- return new Yt(t, r);
56
+ return new ri(t, r);
57
57
  }
58
58
  ss() {
59
59
  return { t: this.type, d: this.data ? this.data.ss() : null };
60
60
  }
61
- static Pn(e) {
61
+ static Tn(e) {
62
62
  let t, r;
63
63
  switch (e.t) {
64
- case Yt.rc.OPEN:
64
+ case ri.rc.OPEN:
65
65
  t = null;
66
66
  break;
67
- case Yt.rc.Rr:
68
- t = new $t(e.d);
67
+ case ri.rc.Rr:
68
+ t = new sr(e.d);
69
69
  break;
70
- case Yt.rc.ac:
71
- (r = e.d || {}), (t = new ts(r.id, Gt.Pn(r.pf || [])));
70
+ case ri.rc.ac:
71
+ (r = e.d || {}), (t = new is(r.id, Qt.Tn(r.pf || [])));
72
72
  break;
73
- case Yt.rc.vr:
73
+ case ri.rc.zr:
74
74
  t = new lr(e.d);
75
75
  break;
76
- case Yt.rc.be:
77
- t = new xt(e.d);
76
+ case ri.rc.be:
77
+ t = new Gt(e.d);
78
78
  break;
79
- case Yt.rc.sc:
80
- (r = e.d || {}), (t = new Ht(r.e, Gt.Pn(r.pf || [])));
79
+ case ri.rc.sc:
80
+ (r = e.d || {}), (t = new Yt(r.e, Qt.Tn(r.pf || [])));
81
81
  break;
82
- case Yt.rc.Mr:
83
- t = new Zt(e.d);
82
+ case ri.rc.Kr:
83
+ t = new si(e.d);
84
84
  break;
85
- case Yt.rc.ks:
85
+ case ri.rc.ks:
86
86
  t = null;
87
87
  }
88
- return new Yt(e.t, t);
88
+ return new ri(e.t, t);
89
89
  }
90
90
  }
91
- (Yt.rc = {
91
+ (ri.rc = {
92
92
  OPEN: "open",
93
93
  Rr: "purchase",
94
94
  ac: "purchase_property",
95
- vr: "push_click",
95
+ zr: "push_click",
96
96
  be: "custom_event",
97
97
  sc: "custom_event_property",
98
- Mr: "iam_click",
98
+ Kr: "iam_click",
99
99
  ks: "test"
100
100
  }),
101
- (Yt.tc = {}),
102
- (Yt.tc[Yt.rc.OPEN] = V.OPEN),
103
- (Yt.tc[Yt.rc.Rr] = V.Rr),
104
- (Yt.tc[Yt.rc.ac] = V.Rr),
105
- (Yt.tc[Yt.rc.vr] = V.vr),
106
- (Yt.tc[Yt.rc.be] = V.be),
107
- (Yt.tc[Yt.rc.sc] = V.be),
108
- (Yt.tc[Yt.rc.Mr] = V.Mr),
109
- (Yt.tc[Yt.rc.ks] = V.ks);
101
+ (ri.tc = {}),
102
+ (ri.tc[ri.rc.OPEN] = tt.OPEN),
103
+ (ri.tc[ri.rc.Rr] = tt.Rr),
104
+ (ri.tc[ri.rc.ac] = tt.Rr),
105
+ (ri.tc[ri.rc.zr] = tt.zr),
106
+ (ri.tc[ri.rc.be] = tt.be),
107
+ (ri.tc[ri.rc.sc] = tt.be),
108
+ (ri.tc[ri.rc.Kr] = tt.Kr),
109
+ (ri.tc[ri.rc.ks] = tt.ks);
@@ -1,8 +1,8 @@
1
1
  export default {
2
2
  OPEN: "open",
3
3
  Rr: "purchase",
4
- vr: "push_click",
4
+ zr: "push_click",
5
5
  be: "custom_event",
6
- Mr: "iam_click",
6
+ Kr: "iam_click",
7
7
  ks: "test"
8
8
  };
@@ -1,48 +1,48 @@
1
1
  import {
2
- dateFromUnixTimestamp as h,
2
+ dateFromUnixTimestamp as l,
3
3
  rehydrateDateAfterJsonization as w
4
4
  } from "../../util/date-utils.js";
5
5
  import r from "../../../shared-lib/braze-shared-lib.js";
6
- import Yt from "./trigger-condition.js";
7
- import { validateValueIsFromEnum as F } from "../../util/code-utils.js";
8
- export default class pt {
6
+ import ri from "./trigger-condition.js";
7
+ import { validateValueIsFromEnum as H } from "../../util/code-utils.js";
8
+ export default class mt {
9
9
  constructor(t, i, s, e, r, l, o, n, h, a, u, d) {
10
10
  (this.id = t),
11
- (this.pu = i || []),
11
+ (this.Du = i || []),
12
12
  void 0 === s && (s = null),
13
13
  (this.startTime = s),
14
14
  void 0 === e && (e = null),
15
15
  (this.endTime = e),
16
16
  (this.priority = r || 0),
17
17
  (this.type = l),
18
- (this.Du = n || 0),
19
- null == a && (a = 1e3 * (this.Du + 30)),
20
- (this.Vi = a),
18
+ (this.Pu = n || 0),
19
+ null == a && (a = 1e3 * (this.Pu + 30)),
20
+ (this.Jr = a),
21
21
  (this.data = o),
22
- null == h && (h = pt.Pu),
23
- (this.yu = h),
24
- (this.ju = u),
25
- (this.wu = d || null);
22
+ null == h && (h = mt.vu),
23
+ (this.zu = h),
24
+ (this.Iu = u),
25
+ (this.$u = d || null);
26
26
  }
27
- Nu(t) {
27
+ xu(t) {
28
28
  return (
29
- null == this.wu || (this.yu !== pt.Pu && t - this.wu >= 1e3 * this.yu)
29
+ null == this.$u || (this.zu !== mt.vu && t - this.$u >= 1e3 * this.zu)
30
30
  );
31
31
  }
32
- vu(t) {
33
- this.wu = t;
32
+ Bu(t) {
33
+ this.$u = t;
34
34
  }
35
- zu(t) {
36
- const i = t + 1e3 * this.Du;
35
+ Cu(t) {
36
+ const i = t + 1e3 * this.Pu;
37
37
  return Math.max(i - new Date().valueOf(), 0);
38
38
  }
39
- Iu(t) {
39
+ Hu(t) {
40
40
  const i = new Date().valueOf() - t,
41
- s = null == t || isNaN(i) || null == this.Vi || i < this.Vi;
41
+ s = null == t || isNaN(i) || null == this.Jr || i < this.Jr;
42
42
  return (
43
43
  s ||
44
- r.D.info(
45
- `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.Vi}ms.`
44
+ r.j.info(
45
+ `Trigger action ${this.type} is no longer eligible for display - fired ${i}ms ago and has a timeout of ${this.Jr}ms.`
46
46
  ),
47
47
  !s
48
48
  );
@@ -51,28 +51,28 @@ export default class pt {
51
51
  const i = t.id,
52
52
  s = [];
53
53
  for (let i = 0; i < t.trigger_condition.length; i++)
54
- s.push(Yt.fromJson(t.trigger_condition[i]));
55
- const e = h(t.start_time),
56
- r = h(t.end_time),
57
- l = t.priority,
58
- o = t.type,
59
- n = t.delay,
54
+ s.push(ri.fromJson(t.trigger_condition[i]));
55
+ const e = l(t.start_time),
56
+ r = l(t.end_time),
57
+ o = t.priority,
58
+ n = t.type,
59
+ h = t.delay,
60
60
  a = t.re_eligibility,
61
61
  u = t.timeout,
62
62
  d = t.data,
63
63
  m = t.min_seconds_since_last_trigger;
64
- return F(
65
- pt.Ki,
66
- o,
64
+ return H(
65
+ mt._r,
66
+ n,
67
67
  "Could not construct Trigger from server data",
68
68
  "Trigger.Types"
69
69
  )
70
- ? new pt(i, s, e, r, l, o, d, n, a, u, m)
70
+ ? new mt(i, s, e, r, o, n, d, h, a, u, m)
71
71
  : null;
72
72
  }
73
73
  ss() {
74
74
  const t = [];
75
- for (let i = 0; i < this.pu.length; i++) t.push(this.pu[i].ss());
75
+ for (let i = 0; i < this.Du.length; i++) t.push(this.Du[i].ss());
76
76
  return {
77
77
  i: this.id,
78
78
  c: t,
@@ -81,17 +81,17 @@ export default class pt {
81
81
  p: this.priority,
82
82
  t: this.type,
83
83
  da: this.data,
84
- d: this.Du,
85
- r: this.yu,
86
- tm: this.Vi,
87
- ss: this.ju,
88
- ld: this.wu
84
+ d: this.Pu,
85
+ r: this.zu,
86
+ tm: this.Jr,
87
+ ss: this.Iu,
88
+ ld: this.$u
89
89
  };
90
90
  }
91
- static Pn(t) {
91
+ static Tn(t) {
92
92
  const i = [];
93
- for (let s = 0; s < t.c.length; s++) i.push(Yt.Pn(t.c[s]));
94
- return new pt(
93
+ for (let s = 0; s < t.c.length; s++) i.push(ri.Tn(t.c[s]));
94
+ return new mt(
95
95
  t.i,
96
96
  i,
97
97
  w(t.s),
@@ -107,4 +107,4 @@ export default class pt {
107
107
  );
108
108
  }
109
109
  }
110
- (pt.Pu = -1), (pt.Ki = { Ji: "inapp", $u: "templated_iam" });
110
+ (mt.vu = -1), (mt._r = { Mr: "inapp", Ju: "templated_iam" });