@braze/web-sdk 4.2.1 → 4.4.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 (178) hide show
  1. package/index.d.ts +57 -6
  2. package/package.json +1 -1
  3. package/shared-lib/braze-shared-lib.js +8 -1
  4. package/shared-lib/encoding-utils.js +12 -1
  5. package/shared-lib/event-types.js +32 -1
  6. package/shared-lib/guid.js +10 -1
  7. package/shared-lib/indexed-db-adapter.js +315 -1
  8. package/shared-lib/logger.js +38 -1
  9. package/shared-lib/supported-options.js +26 -1
  10. package/src/Card/card-manager-factory.js +14 -1
  11. package/src/Card/card-manager.js +72 -1
  12. package/src/Card/display/card-display.js +134 -1
  13. package/src/Card/index.js +5 -1
  14. package/src/Card/log-card-click.js +11 -1
  15. package/src/Card/log-card-dismissal.js +11 -1
  16. package/src/Card/log-card-impressions.js +13 -1
  17. package/src/Card/log-content-card-impressions.js +4 -1
  18. package/src/Card/models/banner.js +30 -1
  19. package/src/Card/models/captioned-image.js +32 -1
  20. package/src/Card/models/card.js +174 -1
  21. package/src/Card/models/classic-card.js +32 -1
  22. package/src/Card/models/control-card.js +38 -1
  23. package/src/Card/models/index.js +5 -1
  24. package/src/Card/util/card-factory.js +104 -1
  25. package/src/ContentCards/content-cards-provider-factory.js +20 -1
  26. package/src/ContentCards/content-cards-provider.js +283 -1
  27. package/src/ContentCards/content-cards.js +24 -1
  28. package/src/ContentCards/get-cached-content-cards.js +5 -1
  29. package/src/ContentCards/index.js +8 -1
  30. package/src/ContentCards/log-content-cards-displayed.js +5 -1
  31. package/src/ContentCards/request-content-cards-refresh.js +5 -1
  32. package/src/ContentCards/subscribe-to-content-cards-updates.js +14 -1
  33. package/src/ContentCards/ui/hide-content-cards.js +8 -1
  34. package/src/ContentCards/ui/show-content-cards.js +72 -1
  35. package/src/ContentCards/ui/toggle-content-cards.js +8 -1
  36. package/src/Core/add-sdk-metadata.js +27 -1
  37. package/src/Core/braze-sdk-metadata.js +10 -1
  38. package/src/Core/change-user.js +19 -1
  39. package/src/Core/destroy.js +5 -1
  40. package/src/Core/device-properties.js +9 -1
  41. package/src/Core/disable-sdk.js +10 -1
  42. package/src/Core/enable-sdk.js +8 -1
  43. package/src/Core/get-device-id.js +10 -1
  44. package/src/Core/get-user.js +4 -1
  45. package/src/Core/handle-braze-action.js +64 -1
  46. package/src/Core/index.js +23 -1
  47. package/src/Core/initialize.js +4 -1
  48. package/src/Core/is-disabled.js +4 -1
  49. package/src/Core/log-custom-event.js +36 -1
  50. package/src/Core/log-purchase.js +245 -1
  51. package/src/Core/open-session.js +23 -1
  52. package/src/Core/remove-all-subscriptions.js +4 -1
  53. package/src/Core/remove-subscription.js +4 -1
  54. package/src/Core/request-immediate-data-flush.js +4 -1
  55. package/src/Core/set-logger.js +4 -1
  56. package/src/Core/set-sdk-authentication-signature.js +9 -1
  57. package/src/Core/subscribe-to-sdk-authentication-failures.js +4 -1
  58. package/src/Core/toggle-logging.js +4 -1
  59. package/src/Core/wipe-data.js +15 -1
  60. package/src/FeatureFlags/feature-flag-factory.js +14 -0
  61. package/src/FeatureFlags/feature-flag.js +16 -0
  62. package/src/FeatureFlags/feature-flags-provider-factory.js +19 -0
  63. package/src/FeatureFlags/feature-flags-provider.js +94 -0
  64. package/src/FeatureFlags/get-all-feature-flags.js +12 -0
  65. package/src/FeatureFlags/get-feature-flag.js +12 -0
  66. package/src/FeatureFlags/index.js +4 -0
  67. package/src/FeatureFlags/refresh-feature-flags.js +9 -0
  68. package/src/FeatureFlags/subscribe-to-feature-flags-updates.js +6 -0
  69. package/src/Feed/feed-provider-factory.js +18 -1
  70. package/src/Feed/feed-provider.js +79 -1
  71. package/src/Feed/feed.js +20 -1
  72. package/src/Feed/get-cached-feed.js +5 -1
  73. package/src/Feed/index.js +8 -1
  74. package/src/Feed/log-feed-displayed.js +5 -1
  75. package/src/Feed/request-feed-refresh.js +5 -1
  76. package/src/Feed/subscribe-to-feed-updates.js +5 -1
  77. package/src/Feed/ui/hide-feed.js +7 -1
  78. package/src/Feed/ui/show-feed.js +89 -1
  79. package/src/Feed/ui/toggle-feed.js +8 -1
  80. package/src/InAppMessage/display/get-animation-effect.js +19 -1
  81. package/src/InAppMessage/display/html-message-to-html.js +223 -1
  82. package/src/InAppMessage/display/in-app-message-to-html.js +152 -1
  83. package/src/InAppMessage/display/modal-utils.js +68 -1
  84. package/src/InAppMessage/in-app-message-factory.js +145 -1
  85. package/src/InAppMessage/in-app-message-manager-factory.js +16 -1
  86. package/src/InAppMessage/in-app-message-manager.js +189 -1
  87. package/src/InAppMessage/index.js +14 -1
  88. package/src/InAppMessage/log-in-app-message-button-click.js +19 -1
  89. package/src/InAppMessage/log-in-app-message-click.js +16 -1
  90. package/src/InAppMessage/log-in-app-message-html-click.js +23 -1
  91. package/src/InAppMessage/log-in-app-message-impression.js +13 -1
  92. package/src/InAppMessage/models/control-message.js +8 -1
  93. package/src/InAppMessage/models/full-screen-message.js +71 -1
  94. package/src/InAppMessage/models/html-message.js +54 -1
  95. package/src/InAppMessage/models/in-app-message-button.js +40 -1
  96. package/src/InAppMessage/models/in-app-message.js +267 -1
  97. package/src/InAppMessage/models/modal-message.js +68 -1
  98. package/src/InAppMessage/models/slide-up-message.js +58 -1
  99. package/src/InAppMessage/models/templated-in-app-message.js +14 -1
  100. package/src/InAppMessage/subscribe-to-in-app-message.js +10 -1
  101. package/src/InAppMessage/ui/automatically-show-in-app-messages.js +15 -1
  102. package/src/InAppMessage/ui/show-in-app-message.js +170 -1
  103. package/src/Push/index.js +5 -1
  104. package/src/Push/is-push-blocked.js +5 -1
  105. package/src/Push/is-push-permission-granted.js +5 -1
  106. package/src/Push/is-push-supported.js +5 -1
  107. package/src/Push/push-manager-factory.js +30 -1
  108. package/src/Push/push-manager.js +360 -1
  109. package/src/Push/request-push-permission.js +8 -1
  110. package/src/Push/unregister-push.js +5 -1
  111. package/src/Push/utils/push-utils.js +34 -1
  112. package/src/User/index.js +1 -1
  113. package/src/User/user-manager.js +70 -1
  114. package/src/User/user.js +278 -1
  115. package/src/common/base-feed.js +25 -1
  116. package/src/common/base-provider.js +6 -1
  117. package/src/common/constants.js +5 -1
  118. package/src/common/event-logger.js +24 -1
  119. package/src/common/feed-display.js +200 -1
  120. package/src/common/translations.js +148 -1
  121. package/src/index.js +9 -1
  122. package/src/l10n/l10n-manager-factory.js +22 -1
  123. package/src/l10n/l10n-manager.js +21 -1
  124. package/src/managers/auth-manager.js +48 -1
  125. package/src/managers/braze-instance.js +307 -1
  126. package/src/managers/device-manager.js +80 -1
  127. package/src/managers/network-manager.js +219 -1
  128. package/src/managers/server-config-manager.js +88 -1
  129. package/src/managers/session-manager.js +68 -1
  130. package/src/managers/storage-manager-factory.js +35 -1
  131. package/src/managers/storage-manager.js +394 -1
  132. package/src/managers/subscription-manager.js +25 -1
  133. package/src/models/backend-errors.js +8 -1
  134. package/src/models/braze-event.js +41 -1
  135. package/src/models/braze-sdk-metadata.js +10 -1
  136. package/src/models/device.js +26 -1
  137. package/src/models/identifier.js +20 -1
  138. package/src/models/push-token.js +22 -1
  139. package/src/models/request-result.js +8 -1
  140. package/src/models/server-config.js +32 -1
  141. package/src/request-controller.js +288 -1
  142. package/src/triggers/models/custom-event-data.js +14 -1
  143. package/src/triggers/models/custom-event-property-data.js +21 -1
  144. package/src/triggers/models/filter-set.js +55 -1
  145. package/src/triggers/models/filter.js +98 -1
  146. package/src/triggers/models/in-app-message-click-data.js +25 -1
  147. package/src/triggers/models/purchase-data.js +14 -1
  148. package/src/triggers/models/purchase-property-data.js +21 -1
  149. package/src/triggers/models/push-click-data.js +15 -1
  150. package/src/triggers/models/trigger-condition.js +109 -1
  151. package/src/triggers/models/trigger-events.js +8 -1
  152. package/src/triggers/models/trigger.js +110 -1
  153. package/src/triggers/triggers-provider-factory.js +30 -1
  154. package/src/triggers/triggers-provider.js +307 -1
  155. package/src/ui/js/attach-css.js +12 -1
  156. package/src/ui/js/feed-css.js +12 -1
  157. package/src/ui/js/iam-css.js +12 -1
  158. package/src/ui/js/index.js +3 -1
  159. package/src/ui/js/load-font-awesome.js +13 -1
  160. package/src/util/base-device-parser.js +14 -1
  161. package/src/util/braze-actions.js +79 -1
  162. package/src/util/browser-detector.js +85 -1
  163. package/src/util/client-hints-parser.js +60 -1
  164. package/src/util/code-utils.js +92 -1
  165. package/src/util/color-utils.js +23 -1
  166. package/src/util/component-utils.js +26 -1
  167. package/src/util/date-utils.js +27 -1
  168. package/src/util/deprecation-utils.js +5 -1
  169. package/src/util/device-constants.js +14 -1
  170. package/src/util/dom-utils.js +87 -1
  171. package/src/util/key-codes.js +1 -1
  172. package/src/util/math.js +5 -1
  173. package/src/util/net.js +75 -1
  174. package/src/util/string-utils.js +22 -1
  175. package/src/util/url-utils.js +23 -1
  176. package/src/util/user-agent-parser.js +85 -1
  177. package/src/util/validation-utils.js +136 -1
  178. package/src/util/window-utils.js +35 -1
@@ -1 +1,10 @@
1
- export default{GOOGLE_TAG_MANAGER:"gg",MPARTICLE:"mp",SEGMENT:"sg",TEALIUM:"tl",MANUAL:"manu",NPM:"npm",CDN:"wcd",SHOPIFY:"shp"};
1
+ export default {
2
+ GOOGLE_TAG_MANAGER: "gg",
3
+ MPARTICLE: "mp",
4
+ SEGMENT: "sg",
5
+ TEALIUM: "tl",
6
+ MANUAL: "manu",
7
+ NPM: "npm",
8
+ CDN: "wcd",
9
+ SHOPIFY: "shp"
10
+ };
@@ -1 +1,26 @@
1
- import DeviceProperties from"../Core/device-properties.js";export default class Ie{constructor(s){this.id=s}li(){const s={};return null!=this[DeviceProperties.BROWSER]&&(s.browser=this[DeviceProperties.BROWSER]),null!=this[DeviceProperties.BROWSER_VERSION]&&(s.browser_version=this[DeviceProperties.BROWSER_VERSION]),null!=this[DeviceProperties.OS]&&(s.os_version=this[DeviceProperties.OS]),null!=this[DeviceProperties.RESOLUTION]&&(s.resolution=this[DeviceProperties.RESOLUTION]),null!=this[DeviceProperties.LANGUAGE]&&(s.locale=this[DeviceProperties.LANGUAGE]),null!=this[DeviceProperties.TIME_ZONE]&&(s.time_zone=this[DeviceProperties.TIME_ZONE]),null!=this[DeviceProperties.USER_AGENT]&&(s.user_agent=this[DeviceProperties.USER_AGENT]),s}}
1
+ import DeviceProperties from "../Core/device-properties.js";
2
+ export default class Ie {
3
+ constructor(s) {
4
+ this.id = s;
5
+ }
6
+ Mi() {
7
+ const s = {};
8
+ return (
9
+ null != this[DeviceProperties.BROWSER] &&
10
+ (s.browser = this[DeviceProperties.BROWSER]),
11
+ null != this[DeviceProperties.BROWSER_VERSION] &&
12
+ (s.browser_version = this[DeviceProperties.BROWSER_VERSION]),
13
+ null != this[DeviceProperties.OS] &&
14
+ (s.os_version = this[DeviceProperties.OS]),
15
+ null != this[DeviceProperties.RESOLUTION] &&
16
+ (s.resolution = this[DeviceProperties.RESOLUTION]),
17
+ null != this[DeviceProperties.LANGUAGE] &&
18
+ (s.locale = this[DeviceProperties.LANGUAGE]),
19
+ null != this[DeviceProperties.TIME_ZONE] &&
20
+ (s.time_zone = this[DeviceProperties.TIME_ZONE]),
21
+ null != this[DeviceProperties.USER_AGENT] &&
22
+ (s.user_agent = this[DeviceProperties.USER_AGENT]),
23
+ s
24
+ );
25
+ }
26
+ }
@@ -1 +1,20 @@
1
- import r from"../../shared-lib/braze-shared-lib.js";export default class _t{constructor(t,e,s){null==t&&(t=r.it.nt()),s=parseInt(s),(isNaN(s)||0===s)&&(s=(new Date).valueOf()),this.eu=t,this.xh=s,this._h=(new Date).valueOf(),this.Nh=e}ss(){return{g:this.eu,e:this.Nh,c:this.xh,l:this._h}}static yn(t){if(null==t||null==t.g)return null;const e=new _t(t.g,t.e,t.c);return e._h=t.l,e}}
1
+ import r from "../../shared-lib/braze-shared-lib.js";
2
+ export default class _t {
3
+ constructor(t, e, s) {
4
+ null == t && (t = r.it.nt()),
5
+ (s = parseInt(s)),
6
+ (isNaN(s) || 0 === s) && (s = new Date().valueOf()),
7
+ (this.iu = t),
8
+ (this.fh = s),
9
+ (this.bh = new Date().valueOf()),
10
+ (this.jh = e);
11
+ }
12
+ ss() {
13
+ return { g: this.iu, e: this.jh, c: this.fh, l: this.bh };
14
+ }
15
+ static Dn(t) {
16
+ if (null == t || null == t.g) return null;
17
+ const e = new _t(t.g, t.e, t.c);
18
+ return (e.bh = t.l), e;
19
+ }
20
+ }
@@ -1 +1,22 @@
1
- import{rehydrateDateAfterJsonization as w}from"../util/date-utils.js";export default class ei{constructor(t,i,l,s,u){this.endpoint=t||null,this.wn=i||null,this.publicKey=l||null,this.tl=s||null,this.oh=u||null}ss(){return{e:this.endpoint,c:this.wn,p:this.publicKey,u:this.tl,v:this.oh}}static yn(t){return new ei(t.e,w(t.c),t.p,t.u,t.v)}}
1
+ import { rehydrateDateAfterJsonization as w } from "../util/date-utils.js";
2
+ export default class ei {
3
+ constructor(t, i, l, s, u) {
4
+ (this.endpoint = t || null),
5
+ (this.Pn = i || null),
6
+ (this.publicKey = l || null),
7
+ (this.zl = s || null),
8
+ (this.gl = u || null);
9
+ }
10
+ ss() {
11
+ return {
12
+ e: this.endpoint,
13
+ c: this.Pn,
14
+ p: this.publicKey,
15
+ u: this.zl,
16
+ v: this.gl
17
+ };
18
+ }
19
+ static Dn(t) {
20
+ return new ei(t.e, w(t.c), t.p, t.u, t.v);
21
+ }
22
+ }
@@ -1 +1,8 @@
1
- export default class t{constructor(t,s){this.S=!!t,this.ve=s||[]}V(t){this.S=this.S&&t.S,this.ve.push(...t.ve)}}
1
+ export default class t {
2
+ constructor(t, s) {
3
+ (this.S = !!t), (this.ve = s || []);
4
+ }
5
+ V(t) {
6
+ (this.S = this.S && t.S), this.ve.push(...t.ve);
7
+ }
8
+ }
@@ -1 +1,32 @@
1
- export default class jt{constructor(t,s,i,h,l,e,r){this.hh=t||0,this.gh=s||[],this.mh=i||[],this.fh=h||[],this.ph=l,null!=l&&""!==l||(this.ph=null),this.oh=e||null,this.uh=r||{}}ss(){return{s:"4.2.1",l:this.hh,e:this.gh,a:this.mh,p:this.fh,m:this.ph,v:this.oh,c:this.uh}}static yn(t){let s=t.l;return"4.2.1"!==t.s&&(s=0),new jt(s,t.e,t.a,t.p,t.m,t.v,t.c)}}
1
+ export default class Ft {
2
+ constructor(t, s, i, h, l, e, r, u) {
3
+ (this.ul = t || 0),
4
+ (this.bl = s || []),
5
+ (this.dl = i || []),
6
+ (this.vl = h || []),
7
+ (this.Cl = l),
8
+ (null != l && "" !== l) || (this.Cl = null),
9
+ (this.gl = e || null),
10
+ (this.ml = r || {}),
11
+ (this.cl = u || {});
12
+ }
13
+ ss() {
14
+ return {
15
+ s: "4.4.0",
16
+ l: this.ul,
17
+ e: this.bl,
18
+ a: this.dl,
19
+ p: this.vl,
20
+ m: this.Cl,
21
+ v: this.gl,
22
+ c: this.ml,
23
+ f: this.cl
24
+ };
25
+ }
26
+ static Dn(t) {
27
+ let s = t.l;
28
+ return (
29
+ "4.4.0" !== t.s && (s = 0), new Ft(s, t.e, t.a, t.p, t.m, t.v, t.c, t.f)
30
+ );
31
+ }
32
+ }
@@ -1 +1,288 @@
1
- import b from"./util/net.js";import ue from"./models/braze-event.js";import s from"./common/event-logger.js";import{randomInclusive as lt}from"./util/math.js";import t from"./models/request-result.js";import r from"../shared-lib/braze-shared-lib.js";import{STORAGE_KEYS as o}from"./managers/storage-manager.js";import u from"./managers/subscription-manager.js";import ht from"./Push/utils/push-utils.js";export default class Ot{constructor(t,s,i,e,n,l,h,o,r,a){this.Ji=t,this.yo=s,this.sl=0,this.il=h.Ba(),this.hl=null,this.j=i,this.Qi=e,this.v=n,this.gt=l,this.h=h,this.Bo=r,this.vt=a,this.ol=o,this.rl=new u,this.ul=50}al(t,s){return!t&&!s&&this.Bo.Qn()>=this.ul}cl(t){let s=this.j.Eh();if(t.length>0){const i=this.v.getUserId();for(const e of t){const t=!e.userId&&!i||e.userId===i;e.type===r.A.Wh&&t&&(s=!0)}}return s}ml(t,s,i,e,n,l,h){null==i&&(i=!0),i&&this.dl();const u=this.h.Ca(),a=this.h.Ua();let c=!1;const m=(t,s)=>{let h=!1;b.Hs({url:this.yo+"/data/",data:t,headers:s,S:i=>{null!=t.respond_with&&t.respond_with.triggers&&(this.sl=Math.max(this.sl-1,0)),this.vt.Os(t,i,s)?(this.Bo.Qs(),this.gt.lh(i),null!=t.respond_with&&t.respond_with.user_id!=this.v.getUserId()||(null!=t.device&&this.h.B(o.q.Ho,t.device),null!=t.sdk_metadata&&(this.h.B(o.q.Yo,t.sdk_metadata),this.h.B(o.q.Zo,this.j.Vo())),this.ol(i),"function"==typeof e&&e())):i.auth_error&&(h=!0)},error:()=>{null!=t.respond_with&&t.respond_with.triggers&&(this.sl=Math.max(this.sl-1,0)),this.vt.sa(t.events,t.attributes),"function"==typeof n&&n()},fl:t=>{if("function"==typeof l&&l(t),i&&!c){if(t&&!h)this.gl();else{let t=this.hl;(null==t||t<1e3*this.il)&&(t=1e3*this.il),this.gl(Math.min(3e5,lt(1e3*this.il,3*t)))}c=!0}}})},d=this.cl(u),f=s||d;if(this.al(h,d))return void r.D.info("Declining to flush data due to 50 consecutive authentication failures");if(i&&!this.vt.fa(u,a,t,f))return this.gl(),void("function"==typeof l&&l(!0));const g=this.vt.ma(t,f,u,a);f&&this.sl++;let p=!1;if(g)for(const t of g)this.vt.Gs(t.requestData,(()=>m(t.requestData,t.headers))),p=!0;this.Bo.Gn()&&i&&!p?this.gl():d&&(r.D.info("Invoking new session subscriptions"),this.rl.St())}bl(){return this.sl>0}gl(t){this.kl||(null==t&&(t=1e3*this.il),this.dl(),this.wl=setTimeout((()=>{if(document.hidden){const t="visibilitychange",s=()=>{document.hidden||(document.removeEventListener(t,s,!1),this.ml())};document.addEventListener(t,s,!1)}else this.ml()}),t),this.hl=t)}dl(){null!=this.wl&&(clearTimeout(this.wl),this.wl=null)}initialize(){this.kl=!1,this.gl()}destroy(){this.rl.removeAllSubscriptions(),this.Bo.On(),this.dl(),this.kl=!0,this.ml(null,null,!1),this.wl=null}cr(t){return this.rl.ut(t)}openSession(){const t=this.j.Vo()!==this.j.mo();t&&(this.h.va(o.iu.Go),this.h.va(o.iu.su)),this.ml(null,!1,null,null,null),this.$n(),t&&import("./Push/push-manager-factory.js").then((t=>{if(this.kl)return;const s=t.default.aa();if(null!=s&&(ht.isPushPermissionGranted()||ht.isPushBlocked())){const t=()=>{s.Er()?r.D.info("Push token maintenance is disabled, not refreshing token for backend."):s.subscribe()},i=(s,i)=>{i&&t()},e=()=>{const s=this.h.I(o.q.gn);(null==s||s)&&t()},n=r.xt.Ft;new r.qt(n,r.D).hr(n.$t.pu,i,e)}}))}changeUser(t,s,i){const e=this.v.getUserId();if(e!==t){this.j.kh(),null!=e&&this.ml(null,!1,null,null,null),this.v.uu(t),i?this.Bo.setSdkAuthenticationSignature(i):this.Bo.Ln();for(let t=0;t<s.length;t++)s[t].changeUser(null==e);null!=e&&this.h.Xs(o.q.P),this.h.Xs(o.q.Ho),this.openSession(),r.D.info('Changed user to "'+t+'".')}else{let s="Doing nothing.";i&&this.Bo.Hn()!==i&&(this.Bo.setSdkAuthenticationSignature(i),s="Updated SDK authentication signature"),r.D.info(`Current user is already ${t}. ${s}`)}}requestImmediateDataFlush(t){this.dl(),this.j.mo(),this.ml(null,null,null,null,null,t,!0)}requestFeedRefresh(){this.j.mo(),this.ml(!0)}zr(t,s){this.j.mo(),r.D.info("Requesting explicit trigger refresh."),this.ml(null,!0,null,t,s)}Nn(t,i){const e=r.A.yl,n={a:t,l:i},l=s.G(e,n);return l&&r.D.info(`Logged alias ${t} with label ${i}`),l}In(i,e,n){if(this.gt.hu(e))return r.D.info(`Custom Attribute "${e}" is blocklisted, ignoring.`),new t;const l={key:e,value:n},h=s.G(i,l);return h&&r.D.info(`Logged custom attribute: ${e} with value: ${n}`),h}setLastKnownLocation(t,i,e,n,l,h){const o={latitude:i,longitude:e};null!=n&&(o.altitude=n),null!=l&&(o.ll_accuracy=l),null!=h&&(o.alt_accuracy=h);const u=s.G(r.A.vl,o,t);return u&&r.D.info(`Set user last known location as ${JSON.stringify(o,null,2)}`),u}kr(t,s){const i=this.j.mo();return new ue(this.v.getUserId(),r.A.Sl,t,i,{cid:s})}$n(){const t=r.xt.Ft;new r.qt(t,r.D).setItem(t.$t.jl,1,{baseUrl:this.yo,data:{api_key:this.Ji,device_id:this.Qi.te().id},userId:this.v.getUserId(),sdkAuthEnabled:this.Bo.Gn()})}wr(t){for(const s of t)if(s.api_key===this.Ji)this.vt.sa(s.events,s.attributes);else{const t=r.xt.Ft;new r.qt(t,r.D).setItem(t.$t.$r,r.it.nt(),s)}}Fn(i,e,n){if(this.gt.hu(i))return r.D.info(`Custom Attribute "${i}" is blocklisted, ignoring.`),new t;let l,h;return null===e&&null===n?(l=r.A.$l,h={key:i}):(l=r.A.Al,h={key:i,latitude:e,longitude:n}),s.G(l,h)}Tn(t,i){const e={group_id:t,status:i};return s.G(r.A.Cl,e)}}
1
+ import b from "./util/net.js";
2
+ import ue from "./models/braze-event.js";
3
+ import s from "./common/event-logger.js";
4
+ import { randomInclusive as pt } from "./util/math.js";
5
+ import t from "./models/request-result.js";
6
+ import r from "../shared-lib/braze-shared-lib.js";
7
+ import { STORAGE_KEYS as o } from "./managers/storage-manager.js";
8
+ import u from "./managers/subscription-manager.js";
9
+ import dt from "./Push/utils/push-utils.js";
10
+ export default class Lt {
11
+ constructor(t, s, i, e, n, l, h, o, r, a) {
12
+ (this._r = t),
13
+ (this.zo = s),
14
+ (this.kl = 0),
15
+ (this.yl = h.Pa()),
16
+ (this.jl = null),
17
+ (this.j = i),
18
+ (this.Ur = e),
19
+ (this.v = n),
20
+ (this.gt = l),
21
+ (this.h = h),
22
+ (this.Go = r),
23
+ (this.vt = a),
24
+ (this.$l = o),
25
+ (this.Al = new u()),
26
+ (this.Tl = 50);
27
+ }
28
+ _l(t, s) {
29
+ return !t && !s && this.Go.Xn() >= this.Tl;
30
+ }
31
+ ql(t) {
32
+ let s = this.j.gh();
33
+ if (t.length > 0) {
34
+ const i = this.v.getUserId();
35
+ for (const e of t) {
36
+ const t = (!e.userId && !i) || e.userId === i;
37
+ e.type === r.A.Ch && t && (s = !0);
38
+ }
39
+ }
40
+ return s;
41
+ }
42
+ Fl(t, s, i, e, n, l, h) {
43
+ null == i && (i = !0), i && this.Dl();
44
+ const u = this.h.Ua(),
45
+ a = this.h.Ba();
46
+ let c = !1;
47
+ const d = (t, s) => {
48
+ let h = !1;
49
+ b.Hs({
50
+ url: this.zo + "/data/",
51
+ data: t,
52
+ headers: s,
53
+ S: i => {
54
+ null != t.respond_with &&
55
+ t.respond_with.triggers &&
56
+ (this.kl = Math.max(this.kl - 1, 0)),
57
+ this.vt.Os(t, i, s)
58
+ ? (this.Go.Qs(),
59
+ this.gt.al(i),
60
+ (null != t.respond_with &&
61
+ t.respond_with.user_id != this.v.getUserId()) ||
62
+ (null != t.device && this.h.B(o.q.Xo, t.device),
63
+ null != t.sdk_metadata &&
64
+ (this.h.B(o.q.oa, t.sdk_metadata),
65
+ this.h.B(o.q.ua, this.j.ha())),
66
+ this.$l(i),
67
+ "function" == typeof e && e()))
68
+ : i.auth_error && (h = !0);
69
+ },
70
+ error: () => {
71
+ null != t.respond_with &&
72
+ t.respond_with.triggers &&
73
+ (this.kl = Math.max(this.kl - 1, 0)),
74
+ this.vt.ca(t.events, t.attributes),
75
+ "function" == typeof n && n();
76
+ },
77
+ Ll: t => {
78
+ if (("function" == typeof l && l(t), i && !c)) {
79
+ if (t && !h) this.Pl();
80
+ else {
81
+ let t = this.jl;
82
+ (null == t || t < 1e3 * this.yl) && (t = 1e3 * this.yl),
83
+ this.Pl(Math.min(3e5, pt(1e3 * this.yl, 3 * t)));
84
+ }
85
+ c = !0;
86
+ }
87
+ }
88
+ });
89
+ },
90
+ m = this.ql(u),
91
+ f = s || m;
92
+ if (this._l(h, m))
93
+ return void r.D.info(
94
+ "Declining to flush data due to 50 consecutive authentication failures"
95
+ );
96
+ if (i && !this.vt.ba(u, a, t, f))
97
+ return this.Pl(), void ("function" == typeof l && l(!0));
98
+ const g = this.vt.ga(t, f, u, a);
99
+ f && this.kl++;
100
+ let p = !1;
101
+ if (g)
102
+ for (const t of g)
103
+ this.vt.Gs(t.requestData, () => d(t.requestData, t.headers)), (p = !0);
104
+ this.Go.Jn() && i && !p
105
+ ? this.Pl()
106
+ : m && (r.D.info("Invoking new session subscriptions"), this.Al.St());
107
+ }
108
+ Rl() {
109
+ return this.kl > 0;
110
+ }
111
+ Pl(t) {
112
+ this.Ml ||
113
+ (null == t && (t = 1e3 * this.yl),
114
+ this.Dl(),
115
+ (this.Il = setTimeout(() => {
116
+ if (document.hidden) {
117
+ const t = "visibilitychange",
118
+ s = () => {
119
+ document.hidden ||
120
+ (document.removeEventListener(t, s, !1), this.Fl());
121
+ };
122
+ document.addEventListener(t, s, !1);
123
+ } else this.Fl();
124
+ }, t)),
125
+ (this.jl = t));
126
+ }
127
+ Dl() {
128
+ null != this.Il && (clearTimeout(this.Il), (this.Il = null));
129
+ }
130
+ initialize() {
131
+ (this.Ml = !1), this.Pl();
132
+ }
133
+ destroy() {
134
+ this.Al.removeAllSubscriptions(),
135
+ this.Go.Vn(),
136
+ this.Dl(),
137
+ (this.Ml = !0),
138
+ this.Fl(null, null, !1),
139
+ (this.Il = null);
140
+ }
141
+ cr(t) {
142
+ return this.Al.ut(t);
143
+ }
144
+ openSession() {
145
+ const t = this.j.ha() !== this.j.mo();
146
+ t && (this.h.ya(o.eu.Jo), this.h.ya(o.eu.su)),
147
+ this.Fl(null, !1, null, null, null),
148
+ this.Bn(),
149
+ t &&
150
+ import("./Push/push-manager-factory.js").then(t => {
151
+ if (this.Ml) return;
152
+ const s = t.default.aa();
153
+ if (
154
+ null != s &&
155
+ (dt.isPushPermissionGranted() || dt.isPushBlocked())
156
+ ) {
157
+ const t = () => {
158
+ s.Yr()
159
+ ? r.D.info(
160
+ "Push token maintenance is disabled, not refreshing token for backend."
161
+ )
162
+ : s.subscribe();
163
+ },
164
+ i = (s, i) => {
165
+ i && t();
166
+ },
167
+ e = () => {
168
+ const s = this.h.I(o.q.kn);
169
+ (null == s || s) && t();
170
+ },
171
+ n = r.xt.Ft;
172
+ new r.qt(n, r.D).hr(n.$t.cu, i, e);
173
+ }
174
+ });
175
+ }
176
+ changeUser(t, s, i) {
177
+ const e = this.v.getUserId();
178
+ if (e !== t) {
179
+ this.j.Gh(),
180
+ null != e && this.Fl(null, !1, null, null, null),
181
+ this.v.uu(t),
182
+ i ? this.Go.setSdkAuthenticationSignature(i) : this.Go.Qn();
183
+ for (let t = 0; t < s.length; t++) s[t].changeUser(null == e);
184
+ null != e && this.h.Xs(o.q.P),
185
+ this.h.Xs(o.q.Xo),
186
+ this.openSession(),
187
+ r.D.info('Changed user to "' + t + '".');
188
+ } else {
189
+ let s = "Doing nothing.";
190
+ i &&
191
+ this.Go.Kn() !== i &&
192
+ (this.Go.setSdkAuthenticationSignature(i),
193
+ (s = "Updated SDK authentication signature")),
194
+ r.D.info(`Current user is already ${t}. ${s}`);
195
+ }
196
+ }
197
+ requestImmediateDataFlush(t) {
198
+ this.Dl(), this.j.mo();
199
+ this.Fl(
200
+ null,
201
+ null,
202
+ null,
203
+ null,
204
+ () => {
205
+ r.D.error(
206
+ "Failed to flush data, request will be retried automatically."
207
+ );
208
+ },
209
+ t,
210
+ !0
211
+ );
212
+ }
213
+ requestFeedRefresh() {
214
+ this.j.mo(), this.Fl(!0);
215
+ }
216
+ zr(t, s) {
217
+ this.j.mo(),
218
+ r.D.info("Requesting explicit trigger refresh."),
219
+ this.Fl(null, !0, null, t, s);
220
+ }
221
+ Nn(t, i) {
222
+ const e = r.A.Nl,
223
+ n = { a: t, l: i },
224
+ l = s.G(e, n);
225
+ return l && r.D.info(`Logged alias ${t} with label ${i}`), l;
226
+ }
227
+ In(i, e, n) {
228
+ if (this.gt.hu(e))
229
+ return (
230
+ r.D.info(`Custom Attribute "${e}" is blocklisted, ignoring.`), new t()
231
+ );
232
+ const l = { key: e, value: n },
233
+ h = s.G(i, l);
234
+ return h && r.D.info(`Logged custom attribute: ${e} with value: ${n}`), h;
235
+ }
236
+ setLastKnownLocation(t, i, e, n, l, h) {
237
+ const o = { latitude: i, longitude: e };
238
+ null != n && (o.altitude = n),
239
+ null != l && (o.ll_accuracy = l),
240
+ null != h && (o.alt_accuracy = h);
241
+ const u = s.G(r.A.Ol, o, t);
242
+ return (
243
+ u &&
244
+ r.D.info(
245
+ `Set user last known location as ${JSON.stringify(o, null, 2)}`
246
+ ),
247
+ u
248
+ );
249
+ }
250
+ kr(t, s) {
251
+ const i = this.j.mo();
252
+ return new ue(this.v.getUserId(), r.A.Ul, t, i, { cid: s });
253
+ }
254
+ Bn() {
255
+ const t = r.xt.Ft;
256
+ new r.qt(t, r.D).setItem(t.$t.xl, 1, {
257
+ baseUrl: this.zo,
258
+ data: { api_key: this._r, device_id: this.Ur.te().id },
259
+ userId: this.v.getUserId(),
260
+ sdkAuthEnabled: this.Go.Jn()
261
+ });
262
+ }
263
+ wr(t) {
264
+ for (const s of t)
265
+ if (s.api_key === this._r) this.vt.ca(s.events, s.attributes);
266
+ else {
267
+ const t = r.xt.Ft;
268
+ new r.qt(t, r.D).setItem(t.$t.$r, r.it.nt(), s);
269
+ }
270
+ }
271
+ Tn(i, e, n) {
272
+ if (this.gt.hu(i))
273
+ return (
274
+ r.D.info(`Custom Attribute "${i}" is blocklisted, ignoring.`), new t()
275
+ );
276
+ let l, h;
277
+ return (
278
+ null === e && null === n
279
+ ? ((l = r.A.Kl), (h = { key: i }))
280
+ : ((l = r.A.Wl), (h = { key: i, latitude: e, longitude: n })),
281
+ s.G(l, h)
282
+ );
283
+ }
284
+ $n(t, i) {
285
+ const e = { group_id: t, status: i };
286
+ return s.G(r.A.Bl, e);
287
+ }
288
+ }
@@ -1 +1,14 @@
1
- export default class xt{constructor(t){this.xl=t}zl(t){return null==this.xl||this.xl===t[0]}static fromJson(t){return new xt(t?t.event_name:null)}ss(){return this.xl}}
1
+ export default class xt {
2
+ constructor(t) {
3
+ this.Jl = t;
4
+ }
5
+ Gl(t) {
6
+ return null == this.Jl || this.Jl === t[0];
7
+ }
8
+ static fromJson(t) {
9
+ return new xt(t ? t.event_name : null);
10
+ }
11
+ ss() {
12
+ return this.Jl;
13
+ }
14
+ }
@@ -1 +1,21 @@
1
- import Bt from"./filter-set.js";export default class Mt{constructor(t,s){this.xl=t,this.Bl=s}zl(t){if(null==this.xl||null==this.Bl)return!1;const s=t[0],r=t[1];return s===this.xl&&this.Bl.zl(r)}static fromJson(t){return new Mt(t?t.event_name:null,t?Bt.fromJson(t.property_filters):null)}ss(){return{e:this.xl,pf:this.Bl.ss()}}}
1
+ import kt from "./filter-set.js";
2
+ export default class Dt {
3
+ constructor(t, s) {
4
+ (this.Jl = t), (this.Hl = s);
5
+ }
6
+ Gl(t) {
7
+ if (null == this.Jl || null == this.Hl) return !1;
8
+ const s = t[0],
9
+ r = t[1];
10
+ return s === this.Jl && this.Hl.Gl(r);
11
+ }
12
+ static fromJson(t) {
13
+ return new Dt(
14
+ t ? t.event_name : null,
15
+ t ? kt.fromJson(t.property_filters) : null
16
+ );
17
+ }
18
+ ss() {
19
+ return { e: this.Jl, pf: this.Hl.ss() };
20
+ }
21
+ }
@@ -1 +1,55 @@
1
- import kt from"./filter.js";import{isArray as p}from"../../util/code-utils.js";export default class Bt{constructor(t){this.filters=t}zl(t){let r=!0;for(let e=0;e<this.filters.length;e++){const o=this.filters[e];let s=!1;for(let r=0;r<o.length;r++)if(o[r].zl(t)){s=!0;break}if(!s){r=!1;break}}return r}static fromJson(t){if(null==t||!p(t))return null;const r=[];for(let e=0;e<t.length;e++){const o=[],s=t[e];for(let t=0;t<s.length;t++)o.push(kt.fromJson(s[t]));r.push(o)}return new Bt(r)}ss(){const t=[];for(let r=0;r<this.filters.length;r++){const e=this.filters[r],o=[];for(let t=0;t<e.length;t++)o.push(e[t].ss());t.push(o)}return t}static yn(t){const r=[];for(let e=0;e<t.length;e++){const o=[],s=t[e];for(let t=0;t<s.length;t++)o.push(kt.yn(s[t]));r.push(o)}return new Bt(r)}}
1
+ import Gt from "./filter.js";
2
+ import { isArray as p } from "../../util/code-utils.js";
3
+ export default class kt {
4
+ constructor(t) {
5
+ this.filters = t;
6
+ }
7
+ Gl(t) {
8
+ let r = !0;
9
+ for (let e = 0; e < this.filters.length; e++) {
10
+ const o = this.filters[e];
11
+ let s = !1;
12
+ for (let r = 0; r < o.length; r++)
13
+ if (o[r].Gl(t)) {
14
+ s = !0;
15
+ break;
16
+ }
17
+ if (!s) {
18
+ r = !1;
19
+ break;
20
+ }
21
+ }
22
+ return r;
23
+ }
24
+ static fromJson(t) {
25
+ if (null == t || !p(t)) return null;
26
+ const r = [];
27
+ for (let e = 0; e < t.length; e++) {
28
+ const o = [],
29
+ s = t[e];
30
+ for (let t = 0; t < s.length; t++) o.push(Gt.fromJson(s[t]));
31
+ r.push(o);
32
+ }
33
+ return new kt(r);
34
+ }
35
+ ss() {
36
+ const t = [];
37
+ for (let r = 0; r < this.filters.length; r++) {
38
+ const e = this.filters[r],
39
+ o = [];
40
+ for (let t = 0; t < e.length; t++) o.push(e[t].ss());
41
+ t.push(o);
42
+ }
43
+ return t;
44
+ }
45
+ static Dn(t) {
46
+ const r = [];
47
+ for (let e = 0; e < t.length; e++) {
48
+ const o = [],
49
+ s = t[e];
50
+ for (let t = 0; t < s.length; t++) o.push(Gt.Dn(s[t]));
51
+ r.push(o);
52
+ }
53
+ return new kt(r);
54
+ }
55
+ }
@@ -1 +1,98 @@
1
- import{isDate as yt}from"../../util/code-utils.js";import{convertMsToSeconds as l,dateFromUnixTimestamp as h,secondsAgo as Ht,secondsInTheFuture as Ut}from"../../util/date-utils.js";export default class kt{constructor(t,s,e,i){this.El=t,this.Tl=s,this.comparator=e,this._l=i,this.Tl===kt.Ml.Nl&&this.comparator!==kt.Hl.Rl&&this.comparator!==kt.Hl.Ll&&this.comparator!==kt.Hl.Il&&this.comparator!==kt.Hl.Ol&&(this._l=h(this._l))}zl(t){let s=null;switch(null!=t&&(s=t[this.El]),this.comparator){case kt.Hl.Ul:return null!=s&&s.valueOf()===this._l.valueOf();case kt.Hl.Dl:return null==s||s.valueOf()!==this._l.valueOf();case kt.Hl.Ql:return typeof s==typeof this._l&&s>this._l;case kt.Hl.Rl:return this.Tl===kt.Ml.Nl?null!=s&&yt(s)&&Ht(s)<=this._l:typeof s==typeof this._l&&s>=this._l;case kt.Hl.Xl:return typeof s==typeof this._l&&s<this._l;case kt.Hl.Ll:return this.Tl===kt.Ml.Nl?null!=s&&yt(s)&&Ht(s)>=this._l:typeof s==typeof this._l&&s<=this._l;case kt.Hl.Gl:return null!=s&&"string"==typeof s&&typeof s==typeof this._l&&null!=s.match(this._l);case kt.Hl.Fl:return null!=s;case kt.Hl.Jl:return null==s;case kt.Hl.Il:return null!=s&&yt(s)&&Ut(s)<this._l;case kt.Hl.Ol:return null!=s&&yt(s)&&Ut(s)>this._l;case kt.Hl.Vl:return null==s||typeof s!=typeof this._l||"string"!=typeof s||null==s.match(this._l)}return!1}static fromJson(t){return new kt(t.property_key,t.property_type,t.comparator,t.property_value)}ss(){let t=this._l;return yt(this._l)&&(t=l(t.valueOf())),{k:this.El,t:this.Tl,c:this.comparator,v:t}}static yn(t){return new kt(t.k,t.t,t.c,t.v)}}kt.Hl={Ul:1,Dl:2,Ql:3,Rl:4,Xl:5,Ll:6,Gl:10,Fl:11,Jl:12,Il:15,Ol:16,Vl:17},kt.Ml={ql:"boolean",Kl:"number",Pl:"string",Nl:"date"};
1
+ import { isDate as yt } from "../../util/code-utils.js";
2
+ import {
3
+ convertMsToSeconds as l,
4
+ dateFromUnixTimestamp as h,
5
+ secondsAgo as Ht,
6
+ secondsInTheFuture as Ut
7
+ } from "../../util/date-utils.js";
8
+ export default class Gt {
9
+ constructor(t, s, e, i) {
10
+ (this.Ql = t),
11
+ (this.Xl = s),
12
+ (this.comparator = e),
13
+ (this.Vl = i),
14
+ this.Xl === Gt.Zl.Yl &&
15
+ this.comparator !== Gt.Ah.Th &&
16
+ this.comparator !== Gt.Ah._h &&
17
+ this.comparator !== Gt.Ah.yh &&
18
+ this.comparator !== Gt.Ah.Mh &&
19
+ (this.Vl = h(this.Vl));
20
+ }
21
+ Gl(t) {
22
+ let s = null;
23
+ switch ((null != t && (s = t[this.Ql]), this.comparator)) {
24
+ case Gt.Ah.Rh:
25
+ return null != s && s.valueOf() === this.Vl.valueOf();
26
+ case Gt.Ah.Hh:
27
+ return null == s || s.valueOf() !== this.Vl.valueOf();
28
+ case Gt.Ah.Lh:
29
+ return typeof s == typeof this.Vl && s > this.Vl;
30
+ case Gt.Ah.Th:
31
+ return this.Xl === Gt.Zl.Yl
32
+ ? null != s && yt(s) && Ht(s) <= this.Vl
33
+ : typeof s == typeof this.Vl && s >= this.Vl;
34
+ case Gt.Ah.Ih:
35
+ return typeof s == typeof this.Vl && s < this.Vl;
36
+ case Gt.Ah._h:
37
+ return this.Xl === Gt.Zl.Yl
38
+ ? null != s && yt(s) && Ht(s) >= this.Vl
39
+ : typeof s == typeof this.Vl && s <= this.Vl;
40
+ case Gt.Ah.Oh:
41
+ return (
42
+ null != s &&
43
+ "string" == typeof s &&
44
+ typeof s == typeof this.Vl &&
45
+ null != s.match(this.Vl)
46
+ );
47
+ case Gt.Ah.Uh:
48
+ return null != s;
49
+ case Gt.Ah.Qh:
50
+ return null == s;
51
+ case Gt.Ah.yh:
52
+ return null != s && yt(s) && Ut(s) < this.Vl;
53
+ case Gt.Ah.Mh:
54
+ return null != s && yt(s) && Ut(s) > this.Vl;
55
+ case Gt.Ah.Xh:
56
+ return (
57
+ null == s ||
58
+ typeof s != typeof this.Vl ||
59
+ "string" != typeof s ||
60
+ null == s.match(this.Vl)
61
+ );
62
+ }
63
+ return !1;
64
+ }
65
+ static fromJson(t) {
66
+ return new Gt(
67
+ t.property_key,
68
+ t.property_type,
69
+ t.comparator,
70
+ t.property_value
71
+ );
72
+ }
73
+ ss() {
74
+ let t = this.Vl;
75
+ return (
76
+ yt(this.Vl) && (t = l(t.valueOf())),
77
+ { k: this.Ql, t: this.Xl, c: this.comparator, v: t }
78
+ );
79
+ }
80
+ static Dn(t) {
81
+ return new Gt(t.k, t.t, t.c, t.v);
82
+ }
83
+ }
84
+ (Gt.Ah = {
85
+ Rh: 1,
86
+ Hh: 2,
87
+ Lh: 3,
88
+ Th: 4,
89
+ Ih: 5,
90
+ _h: 6,
91
+ Oh: 10,
92
+ Uh: 11,
93
+ Qh: 12,
94
+ yh: 15,
95
+ Mh: 16,
96
+ Xh: 17
97
+ }),
98
+ (Gt.Zl = { Bh: "boolean", Fh: "number", kh: "string", Yl: "date" });
@@ -1 +1,25 @@
1
- import Ft from"./trigger-condition.js";export default class Gt{constructor(t,i){this.Wl=t,this.Yl=i}zl(t){if(null==this.Wl)return!1;const i=Ft.Zl(t[0],this.Wl);if(!i)return!1;let r=null==this.Yl||0===this.Yl.length;if(null!=this.Yl)for(let i=0;i<this.Yl.length;i++)if(this.Yl[i]===t[1]){r=!0;break}return i&&r}static fromJson(t){return new Gt(t?t.id:null,t?t.buttons:null)}ss(){return this.Wl}}
1
+ import Kt from "./trigger-condition.js";
2
+ export default class Qt {
3
+ constructor(t, i) {
4
+ (this.fu = t), (this.au = i);
5
+ }
6
+ Gl(t) {
7
+ if (null == this.fu) return !1;
8
+ const i = Kt.du(t[0], this.fu);
9
+ if (!i) return !1;
10
+ let r = null == this.au || 0 === this.au.length;
11
+ if (null != this.au)
12
+ for (let i = 0; i < this.au.length; i++)
13
+ if (this.au[i] === t[1]) {
14
+ r = !0;
15
+ break;
16
+ }
17
+ return i && r;
18
+ }
19
+ static fromJson(t) {
20
+ return new Qt(t ? t.id : null, t ? t.buttons : null);
21
+ }
22
+ ss() {
23
+ return this.fu;
24
+ }
25
+ }
@@ -1 +1,14 @@
1
- export default class Kt{constructor(t){this.productId=t}zl(t){return null==this.productId||t[0]===this.productId}static fromJson(t){return new Kt(t?t.product_id:null)}ss(){return this.productId}}
1
+ export default class Wt {
2
+ constructor(t) {
3
+ this.productId = t;
4
+ }
5
+ Gl(t) {
6
+ return null == this.productId || t[0] === this.productId;
7
+ }
8
+ static fromJson(t) {
9
+ return new Wt(t ? t.product_id : null);
10
+ }
11
+ ss() {
12
+ return this.productId;
13
+ }
14
+ }