UNPKG

@braze/web-sdk

Version:

Braze SDK for web sites and other JS platforms.

52 lines (51 loc) 1.25 kB
import { REQUEST_ATTEMPT_DEFAULT as Ae } from "../common/constants.js"; import { STORAGE_KEYS as s } from "../managers/storage-manager.js"; const h = { O: { gl: "data", vi: "content_cards/sync", Le: "feature_flags/sync", Mr: "template", K: "banners/sync", }, Hl: (t) => (null == t ? void 0 : t.ft(s.gt.SE)), sm: (t) => (null == t ? void 0 : t.ft(s.gt._E)), nm: (t, e) => { null == t || t.Bt(s.gt.SE, e); }, rm: (t, e) => { null == t || t.Bt(s.gt._E, e); }, Tl: (t, e) => { if (!t || !e) return -1; const s = h.Hl(t); if (null == s) return -1; const n = s[e]; return null == n || isNaN(n) ? -1 : n; }, kl: (t, e) => { let s = Ae; if (!t || !e) return s; const n = h.sm(t); return null == n ? s : ((s = n[e]), null == s || isNaN(s) ? Ae : s); }, W: (t, e, s) => { if (!t || !e) return; let n = h.Hl(t); null == n && (n = {}), (n[e] = s), h.nm(t, n); }, yl: (t, e, s) => { if (!t || !e) return; let n = h.sm(t); null == n && (n = {}), (n[e] = s), h.rm(t, n); }, bi: (t, e) => { t && e && h.yl(t, e, Ae); }, $l: (t, e) => { if (!t || !e) return; const s = h.kl(t, e); h.yl(t, e, s + 1); }, }; export default h;