UNPKG

@braze/web-sdk

Version:

Braze SDK for web sites and other JS platforms.

52 lines (51 loc) 1.05 kB
import { STORAGE_KEYS as s } from "./storage-manager.js"; import f from "./subscription-manager.js"; import { logger as E, IndexedDBAdapter as et } from "../../shared-lib/index.js"; export default class Gt { constructor(t, i, s) { (this.C = t), (this.gh = i), (this.bh = s), (this.C = t), (this.gh = i || !1), (this.bh = s), (this.Sh = new f()), (this.Ah = 0), (this.ph = 1); } Fh() { return this.gh; } kh() { return this.C.Rt(s.Tt.fh); } setSdkAuthenticationSignature(t) { const i = this.kh(); this.C.It(s.Tt.fh, t); const e = et.Ps.$s; new et(e, E).setItem(e.Os.wh, this.ph, t), i !== t && this.ct(); } jh() { this.C.Qt(s.Tt.fh); const t = et.Ps.$s; new et(t, E).ge(t.Os.wh, this.ph); } subscribeToSdkAuthenticationFailures(t) { return this.bh.Kt(t); } Ch(t) { this.bh.A(t); } xh() { this.Sh.removeAllSubscriptions(); } Eh() { this.Ah += 1; } Ih() { return this.Ah; } ct() { this.Ah = 0; } }